query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
setDbcoll Sets the collection to work with | function setDbcoll($collection){
$this->collection = $collection;
$this->dbdotcoll = $this->mdb.'.'.$this->collection;
} | [
"private static function _setDbCollection()\n {\n self::$_db = self::$_config['db'];\n self::$_collection = self::$_config['collection'];\n }",
"public function setCollection($collection) {\n $this->collection = $this->db->selectCollection($collection);\n }",
"private function makeCollection() {\n if($this->link && $this->coder->table) {\n $this->collection = $this->link->selectCollection($this->coder->table);\n } else {\n Logger::error('null given table or null given mongo db!');\n }\n }",
"function setCollection($collection)\n {\n $this->_collection = $collection;\n }",
"public function setCollection(MongoCollection $collection) {\n\t\tself::$_collections [$this->getCollectionName ()] = $collection;\n\t}",
"function set_collection($collection)\r\n {\r\n $this->set_additional_property(self :: PROPERTY_COLLECTION, $collection);\r\n }",
"public function save()\n {\n if ($collection = DBM_Collection::where('name', $this->collection)->first()) {\n $collection->fields()->delete();\n $collection->delete();\n }\n\n $collection = new DBM_Collection;\n $collection->name = $this->collection;\n $collection->old_name = $this->collection;\n $collection->extra = '';\n $collection->created_at = now();\n $collection->updated_at = now();\n $collection->save();\n\n foreach ($this->columns as $column) {\n $field = new CollectionField;\n $field->dbm_collection_id = $collection->_id;\n foreach ($column as $key => $value) {\n $field->{$key} = $value;\n }\n\n $field->save();\n }\n\n $this->columns = [];\n $this->name = '';\n }",
"public function set(array $collection);",
"public function setCollection($collection)\r\n {\r\n $this->collection = $collection;\r\n }",
"protected function _initCollection()\n {\n $entity = ucfirst($this->_getRequestData('entity'));\n $className = str_replace(self::ENTITY_PLACEHOLDER, $entity, self::COLLECTION_CLASS_TEMPLATE);\n $collection = new $className($this->_getDataContainer(self::DC_MODEL));\n $this->_addDataContainer(self::DC_COLLECTION, $collection);\n }",
"public function setUpCollection()\n {\n $this->type = 'collection';\n }",
"protected function forceCollection()\n {\n if (!$this->isCollection()) {\n $this->isCollection = true;\n $this->data = [$this->data];\n }\n }",
"public function setDb($db);",
"public function dropCollection($coll){}",
"public function getCollection()\n\t{\n\t\tif (!isset($this->_collection))\n {\n $this->_collection = Yii::app()->edmsMongoCollection($this->_collectionName,$this->_dbName,$this->_connectionId);\n $this->callObjectMethods($this->_collection,$this->_callAfterCollectionCreate,self::CALLAFTER_COLLECTIONCREATE);\n }\n\n\t\treturn $this->_collection;\n\t}",
"static protected function _createMongoCollection($config)\n {\n if(!isset($config['server'])){\n $server = \"mongodb://localhost:27017\";\n } else {\n $server = $config['server'];\n }\n if(!isset($config['options']) || !is_array($config['options'])){\n $options = array();\n } else {\n $options = $config['options'];\n }\n $mongo = new MongoDb($server, $options);\n return $mongo->selectDB($config['database'])\n ->selectCollection($config['collection']);\n }",
"public function initAlumnos()\n\t{\n\t\t$this->collAlumnos = array();\n\t}",
"public function MongodbUtility($_dbHost, $_dbName, $_collectionName)\n\t{\n\t\t\n\t\t$this->dbHost = $_dbHost;\n\t\t$this->dbName = $_dbName;\n\t\t$this->collectionName = $_collectionName;\n\t\t\n\t}",
"public function setACollection()\n {\n $collection = new EntityCollection(Person::class);\n $cache = $this->getCacheStorageMock();\n $cache->expects($this->once())\n ->method('set')\n ->with('test1', $collection)\n ->willReturn($this->returnSelf());\n $this->collectionsMap->setCache($cache);\n $this->assertSame(\n $this->collectionsMap,\n $this->collectionsMap->set('test1', $collection)\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle style preview ajax request for modal. | function cp_display_preview_modal()
{
require_once(CP_BASE_DIR . '/modules/modal/style-preview-ajax.php');
die();
} | [
"public function cp_display_preview_modal() {\n\t\t\trequire_once CP_BASE_DIR . '/modules/modal/style-preview-ajax.php';\n\t\t\tdie();\n\t\t}",
"public function ajax_load_thumbnail_editor() {\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$data = json_decode( stripslashes( $_POST['data'] ), true );\n\t\t$content_type = isset( $_POST['content_type'] ) ? $_POST['content_type'] : $slide_default_settings['content_type']['default_value'];\n\t\t$content_class = $content_type === 'custom' ? 'custom' : 'dynamic';\n\n\t\tinclude( 'views/thumbnail-editor.php' );\n\n\t\tdie();\n\t}",
"protected function _process_ajax() {}",
"function cp_display_preview_slide_in()\n {\n require_once(CP_BASE_DIR . '/modules/slide_in/style-preview-ajax.php');\n die();\n }",
"public function cp_display_preview_slide_in() {\n\t\t\trequire_once CP_BASE_DIR . '/modules/slide_in/style-preview-ajax.php';\n\t\t\tdie();\n\t\t}",
"public function ajax_render_tab_preview_mode( LaterPay_Core_Event $event ) {\n $preview_form = new LaterPay_Form_PreviewMode( $_GET ); //phpcs:ignore\n\n if ( ! $preview_form->is_valid() ) {\n $event->stop_propagation();\n return;\n }\n\n $post_id = $preview_form->get_field_value( 'post_id' );\n if ( ! LaterPay_Helper_User::can( 'laterpay_has_full_access_to_content', $post_id ) ) {\n $event->stop_propagation();\n return;\n }\n\n $post = get_post( $post_id );\n // assign variables\n $view_args = array(\n 'diplay_preview_pane' => LaterPay_Helper_User::display_preview_pane(),\n 'hide_preview_mode_pane' => LaterPay_Helper_User::preview_mode_pane_is_hidden(),\n 'preview_post_as_visitor' => (bool) LaterPay_Helper_User::preview_post_as_visitor( $post ),\n 'admin_menu' => LaterPay_Helper_View::get_admin_menu(),\n 'plugin_is_in_live_mode' => $this->config->get( 'is_in_live_mode' ),\n );\n $this->assign( 'laterpay', $view_args );\n\n $this->render( 'frontend/partials/post/select-preview-mode-tab' );\n die;\n }",
"function preview_action() {\n if (Request::isAjax()) {\n $this->set_content_type('text/html; charset=UTF-8');\n $this->render_text(studip_utf8encode(formatReady(transformBeforeSave(studip_utf8decode(Request::get('posting'))))));\n } else {\n $this->render_text(formatReady(ForumEntry::parseEdit(transformBeforeSave(Request::get('posting')))));\n }\n }",
"public function ajax_load_main_image_editor() {\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$data = json_decode( stripslashes( $_POST['data'] ), true );\n\t\t$content_type = isset( $_POST['content_type'] ) ? $_POST['content_type'] : $slide_default_settings['content_type']['default_value'];\n\t\t$content_class = $content_type === 'custom' ? 'custom' : 'dynamic';\n\n\t\tinclude( 'views/main-image-editor.php' );\n\n\t\tdie();\n\t}",
"public function preview_broadcast() {\n\n\t\tcheck_ajax_referer( 'ig-es-admin-ajax-nonce', 'security' );\n\n\t\t$response = array();\n\n\t\t$preview_type = ig_es_get_request_data( 'preview_type' );\n\t\t$broadcast_data = ig_es_get_request_data( 'broadcast_data', array(), false );\n\n\t\t$template_data['content'] = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';\n\t\t$template_data['template_id'] = ! empty( $broadcast_data['template_id'] ) ? $broadcast_data['template_id'] : '';\n\t\t$template_data['campaign_id'] = ! empty( $broadcast_data['id'] ) ? $broadcast_data['id'] : 0;\n\n\t\t$tempate_html = '';\n\t\tob_start();\n\t\t$this->es_broadcast_preview_callback( $template_data );\n\t\t$tempate_html = ob_get_clean();\n\t\t$response['template_html'] = $tempate_html;\n\n\t\tif ( 'inline' === $preview_type ) {\n\t\t\t$inline_preview_data = $this->get_broadcast_inline_preview_data( $broadcast_data );\n\t\t\t$response = array_merge( $response, $inline_preview_data );\n\t\t}\n\n\t\tif ( ! empty( $response ) ) {\n\t\t\twp_send_json_success( $response );\n\t\t} else {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t}",
"public function ajax_load_layers_editor() {\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\t\t$layer_default_settings = BQW_SliderPro_Settings::getLayerSettings();\n\n\t\t$layers = json_decode( stripslashes( $_POST['data'] ), true );\n\t\t$content_type = isset( $_POST['content_type'] ) ? $_POST['content_type'] : $slide_default_settings['content_type']['default_value'];\n\t\t\n\t\tinclude( 'views/layers-editor.php' );\n\n\t\tdie();\n\t}",
"public function customize_preview_loading_style()\n {\n }",
"public function ajax_preview_page(): void {\n if (!isset($_POST['hash']) or !authenticate($_POST['hash']))\n show_403(\n __(\"Access Denied\"),\n __(\"Invalid authentication token.\")\n );\n\n if (!Visitor::current()->group->can(\"add_page\"))\n show_403(\n __(\"Access Denied\"),\n __(\"You do not have sufficient privileges to add pages.\")\n );\n\n $trigger = Trigger::current();\n $main = MainController::current();\n\n $field = fallback($_POST['field'], \"body\");\n $content = fallback($_POST['content'], \"\");\n\n # Page title filters.\n if ($field == \"title\")\n $trigger->filter($content, array(\"markup_page_title\", \"markup_title\"));\n\n # Page body filters.\n if ($field == \"body\")\n $trigger->filter($content, array(\"markup_page_text\", \"markup_text\"));\n\n header(\"Cache-Control: no-cache, must-revalidate\");\n header(\"Expires: Mon, 03 Jun 1991 05:30:00 GMT\");\n\n $main->display(\n \"content\".DIR.\"preview\",\n array(\"content\" => $content),\n __(\"Preview\")\n );\n }",
"public function customize_preview_loading_style()\n {\n ?>\n <style>\n body.wp-customizer-unloading {\n opacity: 0.25;\n cursor: progress !important;\n -webkit-transition: opacity 0.5s;\n transition: opacity 0.5s;\n }\n\n body.wp-customizer-unloading * {\n pointer-events: none !important;\n }\n\n form.customize-unpreviewable,\n form.customize-unpreviewable input,\n form.customize-unpreviewable select,\n form.customize-unpreviewable button,\n a.customize-unpreviewable,\n area.customize-unpreviewable {\n cursor: not-allowed !important;\n }\n </style><?php\n }",
"public function preview_handler() {\n\t\tif ( ! $_POST ) {\n\t\t\treturn;\n\t\t}\n\t\t// Edit = show submit form again\n\t\tif ( ! empty( $_POST['edit_event'] ) ) {\n\t\t\t$this->step --;\n\t\t}\n\t\t// Continue = change event status then show next screen\n\t\tif ( ! empty( $_POST['continue'] ) ) {\n\t\t\t$event = get_post( $this->event_id );\n\t\t\tif ( in_array( $event->post_status, array( 'preview', 'expired' ) ) ) {\n\t\t\t\t// Reset expiry\n\t\t\t\tdelete_post_meta( $event->ID, '_event_expiry_date' );\n\t\t\t\t// Update event listing\n\t\t\t\t$update_event = array();\n\t\t\t\t$update_event['ID'] = $event->ID;\n\t\t\t\t$update_event['post_status'] = apply_filters( 'submit_event_post_status', get_option( 'event_manager_submission_requires_approval' ) ? 'pending' : 'publish',$event);\n\t\t\t\t$update_event['post_date'] = current_time( 'mysql' );\n\t\t\t\t$update_event['post_date_gmt'] = current_time( 'mysql', 1 );\n\t\t\t\twp_update_post( $update_event );\n\t\t\t}\t\t\t\n\t\t\t$this->step ++;\n\t\t}\n\t}",
"public function wp_ajax_conductor_query_builder_preview_query() {\n\t\t\t// Generic error message\n\t\t\t$error = __( 'There was an error previewing the query. Please try again later.', 'conductor' );\n\n\t\t\t// Grab the post ID\n\t\t\t$post_id = ( isset( $_POST['ID'] ) ) ? ( int ) $_POST['ID'] : false;\n\n\t\t\t// Grab the post type\n\t\t\t$post_type = ( $post_id ) ? get_post_type( $post_id ) : false;\n\n\t\t\t// Status flags\n\t\t\t$status = array();\n\n\t\t\t// Check post ID, post type, and AJAX referrer\n\t\t\tif ( ! $post_id || $post_type !== $this->post_type_name || ! check_ajax_referer( sanitize_text_field( $_POST['nonce_action'] ), 'nonce', false ) ) {\n\t\t\t\t$status['error'] = $error;\n\t\t\t\twp_send_json_error( $status );\n\t\t\t}\n\n\t\t\t// Return an error if the current user can't edit this query\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\t$status['error'] = __( 'You do not have sufficient permissions to preview a query on this site.', 'conductor' );\n\t\t\t\twp_send_json_error( $status );\n\t\t\t}\n\n\t\t\t// Grab the query builder mode\n\t\t\t$query_builder_mode = $this->get_query_builder_mode();\n\n\t\t\t// Grab the Conductor Query Builder data (default to an empty array)\n\t\t\t$conductor_query_builder_data = $this->get_query_builder_data( $_POST, $query_builder_mode );\n\n\t\t\tdo_action( 'conductor_query_builder_preview_query_before', $post_id, $post_type, $query_builder_mode, $conductor_query_builder_data, $this );\n\n\t\t\t// Grab the simple query builder data\n\t\t\t$simple_conductor_query_builder_data = $this->get_simple_query_builder_data( ( $query_builder_mode === 'simple' ) ? $_POST : $conductor_query_builder_data, $query_builder_mode );\n\n\n\t\t\t// Setup the query builder mode preview data reference\n\t\t\t$this->preview_data['query_builder_mode'] = $query_builder_mode;\n\n\t\t\t// Setup the Conductor Widget instance preview data reference\n\t\t\t$this->preview_data['conductor_widget_instance'] = $simple_conductor_query_builder_data;\n\n\n\t\t\t// Grab the clause types\n\t\t\t$clause_types = $this->get_clause_types();\n\n\t\t\t// Loop through the clause types\n\t\t\tforeach ( $clause_types as $clause_type ) {\n\t\t\t\t/*\n\t\t\t\t * Setup the preview data references\n\t\t\t\t */\n\n\t\t\t\t// Post Meta\n\t\t\t\t$this->preview_data['post_meta'][$clause_type] = $this->get_clause_type_post_meta( $post_id, $clause_type, $conductor_query_builder_data );\n\n\t\t\t\t// Query Arguments (call $this->get_clause_type_query_args() twice; once for the database value and once for the query value)\n\t\t\t\t$this->preview_data['query_args'] += $this->get_clause_type_query_args( $post_id, $clause_type, $this->get_clause_type_query_args( $post_id, $clause_type, $this->preview_data['post_meta'][$clause_type] ), 'query', true );\n\t\t\t}\n\n\t\t\t// Start output buffering\n\t\t\tob_start();\n\n\t\t\t// Preview this Conductor Query\n\t\t\t$this->render_preview( $post_id );\n\n\t\t\t// Grab the output from the buffer\n\t\t\t$preview = ob_get_clean();\n\n\t\t\tdo_action( 'conductor_query_builder_preview_query_after', $post_id, $post_type, $query_builder_mode, $conductor_query_builder_data, $preview, $this );\n\n\t\t\t// If the post was inserted successfully\n\t\t\tif ( $post_id ) {\n\t\t\t\t$status['preview'] = $preview;\n\t\t\t\twp_send_json_success( $status );\n\t\t\t}\n\t\t}",
"public function actionModalAjax() {\r\n Yii::app()->clientScript->scriptMap['jquery.js'] = false;\r\n Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;\t\r\n Yii::app()->clientScript->scriptMap['bootstrap.js'] = false;\r\n Yii::app()->clientScript->scriptMap['bootstrap.css'] = false;\r\n Yii::app()->clientScript->scriptMap['bootstrap.bootbox.min.js'] = false;\r\n Yii::app()->clientScript->scriptMap['bootstrap-responsive.css'] = false;\r\n Yii::app()->clientScript->scriptMap['bootstrap-yii.css'] = false;\r\n Yii::app()->clientScript->scriptMap['jquery-ui-bootstrap.css'] = false;\r\n Yii::app()->clientScript->scriptMap['bootstrap.min.css'] = false;\t\r\n Yii::app()->clientScript->scriptMap['bootstrap.min.js'] = false;\r\n \r\n \r\n if($_POST[\"modal\"] == \"perfiles\"){\r\n \r\n $response[\"data\"] = $this->renderPartial(\"_modalAjax\", array(), true, true); \r\n \r\n } \r\n if($_POST[\"modal\"] == \"giftcard\"){\r\n \r\n $response[\"data\"] = $this->renderPartial(\"//giftcard/_modalGiftCard\", array(\"id\" => $_POST[\"id\"]), true, true); \r\n \r\n } \r\n \r\n \r\n echo CJSON::encode($response);\r\n \r\n }",
"function wp_ajax_image_editor() {}",
"public function import_customizer_ajax() {\n\t\tif ( ! $this->wp_customize->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview' );\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'customizer-import', 'nonce', false ) ) {\n\t\t\twp_send_json_error( 'invalid_nonce' );\n\t\t}\n\n\t\tif ( ! isset( $_POST['demo'] ) ) { // Input var ok.\n\t\t\twp_send_json_error( 'invalid_demo' );\n\t\t} else {\n\t\t\t$demo = sanitize_text_field( wp_unslash( $_POST['demo'] ) ); // Input var ok.\n\t\t}\n\n\t\t$this->reset_customizer();\n\n\t\t$this->import_customizer( $demo );\n\n\t\twp_send_json_success();\n\t}",
"function ci_featgal_AJAXPreview() {\n\t$ids = $_POST['ids'];\n\t$urls = ci_featgal_get_images( $ids );\n\tif ( $urls === false ) {\n\t\techo 'FAIL';\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\twp_die();\n\t\t} else {\n\t\t\tdie;\n\t\t}\n\t} else {\n\t\twp_send_json( $urls );\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the token kinds which can work as function calls. | private function getFunctionyTokenKinds(): array
{
static $tokens = [
T_ARRAY,
T_ECHO,
T_EMPTY,
T_EVAL,
T_EXIT,
T_INCLUDE,
T_INCLUDE_ONCE,
T_ISSET,
T_LIST,
T_PRINT,
T_REQUIRE,
T_REQUIRE_ONCE,
T_UNSET,
T_VARIABLE,
];
return $tokens;
} | [
"public static function functionCallTokens()\n {\n // Function calls and class instantiation.\n $tokens = self::$nameTokens;\n $tokens[\\T_VARIABLE] = \\T_VARIABLE;\n // Class instantiation only.\n $tokens[\\T_ANON_CLASS] = \\T_ANON_CLASS;\n $tokens += self::$ooHierarchyKeywords;\n return $tokens;\n }",
"public static function provideTokenTypes(): array\n {\n return [\n [ '9', Token::NUMBER ],\n [ 'i', Token::IDENTIFIER ],\n [ '+', Token::OPERATOR | Token::RIGHT ],\n [ '-', Token::OPERATOR | Token::RIGHT ],\n [ '*', Token::OPERATOR | Token::RIGHT ],\n [ '/', Token::OPERATOR | Token::RIGHT ],\n [ '=', Token::OPERATOR | Token::LEFT ],\n [ '^', Token::OPERATOR | Token::LEFT ],\n [ '(', Token::PARENTHESIS | Token::OPEN ],\n [ ')', Token::PARENTHESIS | Token::CLOSE ],\n [ ',', Token::COMMA ],\n [ '#', Token::UNKNOWN ],\n ];\n }",
"public function getSupportedTokenType();",
"public static function parameterTypeTokens()\n {\n $tokens = self::$parameterTypeTokens;\n $tokens += self::namespacedNameTokens();\n return $tokens;\n }",
"public function getOperationTypes();",
"public function getTokens();",
"public function get_tokens(){\n\t\t\t\n\t\t\t$tokens = get_tokens( $this->name );\n\t\t\t\n\t\t\treturn $tokens;\n\t\t\t\n\t\t}",
"public static function parameterPassingTokens()\n {\n // Function call and class instantiation tokens.\n $tokens = self::functionCallTokens();\n // Function-look-a-like language constructs which can take multiple \"parameters\".\n $tokens[\\T_ISSET] = \\T_ISSET;\n $tokens[\\T_UNSET] = \\T_UNSET;\n // Array tokens.\n $tokens += self::arrayOpenTokensBC();\n return $tokens;\n }",
"public static function returnTypeTokens()\n {\n $tokens = self::$returnTypeTokens;\n $tokens += self::$ooHierarchyKeywords;\n $tokens += self::namespacedNameTokens();\n return $tokens;\n }",
"public static function getTypes()\n {\n return [ self::TT_WORD,\n self::TT_PHRASE,\n self::TT_FIELD,\n self::TT_FIELD_INDICATOR,\n self::TT_REQUIRED,\n self::TT_PROHIBITED,\n self::TT_FUZZY_PROX_MARK,\n self::TT_BOOSTING_MARK,\n self::TT_RANGE_INCL_START,\n self::TT_RANGE_INCL_END,\n self::TT_RANGE_EXCL_START,\n self::TT_RANGE_EXCL_END,\n self::TT_SUBQUERY_START,\n self::TT_SUBQUERY_END,\n self::TT_AND_LEXEME,\n self::TT_OR_LEXEME,\n self::TT_NOT_LEXEME,\n self::TT_TO_LEXEME,\n self::TT_NUMBER\n ];\n }",
"private function _findMethods($tokens) {\n return $this->_splitByToken($tokens, T_FUNCTION);\n }",
"public function getAllTokens();",
"public function getTokenClassNames()\n {\n return [Token::class];\n }",
"function getAllSymbolics() {\n\t\treturn array(\n\t\t\t'SIGNOFF_COPYEDITING',\n\t\t\t'SIGNOFF_PROOFING',\n\t\t\t'SIGNOFF_FAIR_COPY',\n\t\t\t'SIGNOFF_REVIEW_REVISION',\n\t\t\t'SIGNOFF_SIGNOFF'\n\t\t);\n\t}",
"function test_symb($token) { // otestuj jestli vyhovuje symbolu\n $t = test_var($token);\n if(!count($t)) { // pokud nesedi na var\n $c = test_const($token);\n if(!count($c)) {\n return array(); // nesedela na konstantu \n }\n else // na konstantu sedela\n return $c; \n }\n else // sedi na promennou\n return $t;\n}",
"protected function getSupportedFunctionNames() {\n return self::supportedFunctions;\n }",
"public function getSignatureMethods();",
"public function getKinds()\n {\n return $this->kinds;\n }",
"public function getRegisteredFunctions();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches the privileges of specied user | function get_user_privileges($id)
{
$this->db->select("*");
$this->db->from("users_privileges");
$this->db->join("privileges", "privileges.id = users_privileges.privilege_id", "");
$this->db->where("users_privileges.user_id", $id);
$query = $this->db->get();
return $query->result();
} | [
"function getUserPrivileges() {\r\n $sSql = \"SELECT * FROM pg_user s LEFT OUTER JOIN pg_group g on (s.usesysid = any(g.grolist) ) where usename = '\" . $_SESSION[\"ses_Login\"] . \"'\";\r\n $oResult = $this->oBd->execute($sSql);\r\n if (empty($this->oBd->enErreur) && $this->oBd->nombreLigne($oResult) > 0) {\r\n while ($aPrivilege = $this->oBd->ligneSuivante($oResult)) {\r\n array_push($this->aPrivileges, $aPrivilege['groname']);\r\n }\r\n }\r\n }",
"public function privileges()\n {\n return $this->requestGet('user/privileges');\n }",
"public function getPrivileges();",
"abstract public function getPrivileges();",
"public function GetPrivileges($dbusername, $dbname, $privileges = \"ALL\", $host=\"localhost\")\r\n\t\t{\r\n\t\t\t//TODO: implement GetPrivileges\r\n\t\t}",
"public function get_account_privileges() {\n $sql = \"\n \tSELECT isAllowed, t2.Name AS PrivilegeName, t2.isSingular AS PrivilegeisSingular, t4.Name AS ActionName, t5.Name AS DomainName, t5.isSingular AS DomainisSingular,\n t7.Name AS ObjectName, t8.Name AS RoleName, t8.Importance as RoleImportance\nFROM {$GLOBALS[\"dbName\"]}.roles_domains_privileges AS t1\n\t\t\t\t-- Privileges Joins --\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_privileges AS t2 ON t2.id = t1.PrivilegeID\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_privileges_actions AS t3 ON t3.PrivilegeID = t2.id\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_actions AS t4 ON t4.id = t3.ActionID\n\t\t\t\t-- Domain Joins --\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_domains AS t5 ON t5.id = t1.DomainID\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_domains_objects AS t6 ON t6.DomainID = t5.id\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles_objects AS t7 ON t7.id = t6.ObjectID\n\t\t\t\t-- Roles to user Joins --\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.roles AS t8 ON t8.id = t1.RoleID\n\t\t\t\tINNER JOIN {$GLOBALS[\"dbName\"]}.customers_roles AS t9 ON t9.role_id = t8.id\n\t\t\tWHERE customer_id = '{$this->customer_id}'\n\t\t\tORDER BY t8.Importance DESC, t8.Name\n \t\";\n\n $sql_query = $this->mysql->q($sql);\n return $sql_query;\n }",
"function db_get_user_resource_privilege( $id_user, $resource_type = 0 )\n{\n global $g_mysql;\n $sql = \"SELECT A.resource_type, A.id_resource, B.id_privilege FROM ac_user_resource_rule AS A, ac_rule_privilege AS B \n WHERE A.id_rule = B.id_rule AND A.id_user = ?\";\n\n if( $resource_type > 0 )\n $sql = $sql . \" AND A.resource_type = {$resource_type}\";\n\n $bind_param = array( $id_user );\n\n $rows = $g_mysql->selectData($sql, $bind_param);\n\n $result = [];\n foreach( $rows as $row )\n {\n $one_privileges = db_expand_one_privilege($row['resource_type'], $row['id_resource'], $row['id_privilege'], true);\n array_push($result, ...$one_privileges);\n }\n\n return $result;\n}",
"public function getPrivilegies(){\n \treturn $this->privilege;\n }",
"function Privileges() {\n global $session;\n if ( !isset($this->privileges) ) $this->privileges = 0;\n if ( is_string($this->privileges) ) $this->privileges = bindec( $this->privileges );\n if ( $this->_is_group && in_array(ConstructURL('/'.$session->username.'/'), $this->GroupMemberSet()) ) {\n $this->privileges |= privilege_to_bits( array('DAV::read', 'DAV::read-current-user-privilege-set') ); \n }\n return $this->privileges;\n }",
"abstract protected function getRequiredPrivileges(): array;",
"function getOverallUserPrivs($userid) {\n\t$query = \"SELECT DISTINCT t.name \"\n\t . \"FROM userprivtype t, \"\n\t . \"userpriv u \"\n\t . \"WHERE u.userprivtypeid = t.id AND \"\n\t . \"t.name NOT IN ('configAdmin', 'serverProfileAdmin') AND \"\n\t . \"(u.userid = $userid OR \"\n\t . \"u.usergroupid IN (SELECT usergroupid \"\n\t . \"FROM usergroupmembers \"\n\t . \"WHERE userid = $userid) OR \"\n\t . \"u.usergroupid IN (SELECT id \"\n\t . \"FROM usergroup \"\n\t . \"WHERE ownerid = $userid))\";\n\t$qh = doQuery($query, 107);\n\t$privileges = array();\n\twhile($row = mysqli_fetch_row($qh))\n\t\t$privileges[] = $row[0];\n\tif(in_array(\"mgmtNodeAdmin\", $privileges))\n\t\t$privileges[] = 'managementnodeAdmin';\n\treturn $privileges;\n}",
"function check_for_privileges(){\n\t\tglobal $config, $errors;\n\n if (false === $privilege = $this->data->get_privileges_of_user($this->auth[\"uname\"], $this->auth[\"udomain\"], \n array('SUPER','RESELLER', 'ADMIN','USER'), $errors)) return false;\n\n switch ($privilege){\n case 'SUPER':\n $this->auth[\"perm\"]=\"USER,ADMIN,RESELLER,SUPER\";\n\t break;\n\n case 'RESELLER':\n $this->auth[\"perm\"]=\"USER,ADMIN,RESELLER\";\n break;\n\n case 'ADMIN':\n $this->auth[\"perm\"]=\"USER,ADMIN\";\n break;\n case 'USER':\n $this->auth[\"perm\"]=\"USER\";\n break;\n\n }//switch\n\n\n\n }",
"public function getPrivileges()\n {\n $this->cleanError();\n $this->prepareToken();\n\n try {\n $url = $this->getURL(Constants::LIST_PRIVILEGES_URL);\n $headers = $this->getAuthorizedHeader();\n\n $response = $this->client->get(\n $url,\n array(\n 'headers' => $headers\n )\n );\n $data = json_decode($response->getBody());\n\n $privileges = array();\n if (!empty($data)) {\n foreach ($data as $privilegeData) {\n $privileges[] = new Privilege($privilegeData);\n }\n }\n return $privileges;\n } catch (ClientException $e) {\n $response = $e->getResponse();\n $this->error = $this->extractStatusCodeFromResponse($response);\n $this->errorDescription = $this->extractErrorMessageFromResponse($response);\n } catch (\\Exception $e) {\n $this->error = 500;\n $this->errorDescription = $e->getMessage();\n }\n }",
"public function listPrivileges() {\r\n \r\n $ret = Array();\r\n $ret['world'] = $this->getWorldPrivileges();\r\n $ret['users'] = $this->listUsersPrivileges();\r\n $ret['groups'] = $this->listGroupsPrivileges();\r\n\r\n return $ret;\r\n }",
"public function getUserRights(){\n\t\treturn $GLOBALS['db']->select(\"select * from user_rights order by id\");\t\n\t}",
"public function getPrivileges()\n {\n // publish resource to allow modification of privileges\n // only publish when privileges first accessed, this\n // also permits access to privileges from subscribers\n if (!$this->_published) {\n $this->_published = true;\n P4Cms_PubSub::publish(\n 'p4cms.acl.' . $this->getId() . '.privileges',\n $this\n );\n }\n\n return $this->_privileges;\n }",
"public function privileges() {\n\t\t$privileges = CmaConnect::privileges();\n\t\t$this->set(compact('privileges'));\n\t}",
"public function privilege_list($user_id){\n\t\t\n\t\t$this->db->select('a.*,b.*');\n\t\t$this->db->from($this->prifix.$this->controllers.\" as a\");\n\t\t$this->db->join($this->prifix.$this->userprivilege.\" as b\",\"ON a.\".$this->controllers.\"_id = b.\".$this->userprivilege.\"_controllers_id\",\"inner\");\n\t\t$this->db->where(\"b.\".$this->userprivilege.'_user_id',$user_id);\n\t\t$rs = $this->db->get();\n\t\treturn $rs->result_array();\n\t}",
"public function getAllPrivileges()\n {\n return $this->permissionsModel->getAllPrivileges();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get url template to load edit form | public function getEditUrlTemplate()
{
return Mage::getModel('adminhtml/url')->getUrl('adminhtml/mageworx_ordersedit_edit/loadEditForm', array('block_id' => '%block_id%', 'order_id' => $this->getOrderId()));
} | [
"abstract public function getEditUrl();",
"public function getEditUrl()\n {\n return $this->getUrl(self::BASE_URL . 'edit', ['_query' => false]);\n }",
"public function getEditViewUrl() {\r\n\t\treturn $this->getDefaultUrl(). '&view=Edit';\r\n\t}",
"public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';\n\t}",
"public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getModuleName() . '&view=' . $this->getModule()->getEditViewName() . ($this->getId() ? '&record=' . $this->getId() : '');\n\t}",
"public static function get_edit_url() {\n\t\treturn tcb_get_editor_url( static::get_page_id() );\n\t}",
"public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getModuleName() . '&view=EditView&record=' . $this->getId();\n\t}",
"public function getCpEditUrl()\n {\n return UrlHelper::cpUrl('simple-forms/forms/edit/'.$this->id);\n }",
"public function GetUiEditUrl() : string {\n return \"/ui/v1/entries/{$this->GetId()}/edit\";\n }",
"public function getEditViewUrl() {\n\t\t$module = $this->getModule();\n\t\treturn 'index.php?module=Calendar&view='.$module->getEditViewName().'&record='.$this->getId();\n\t}",
"public function getEditUrl()\r\n {\r\n if (empty(parent::getEditUrl())) {\r\n return \"\";\r\n }\r\n\r\n if ($this->contentObject instanceof File) {\r\n return $this->contentObject->content->container->createUrl($this->editRoute, ['id' => $this->contentObject->getItemId(), 'fromWall' => true]);\r\n }\r\n\r\n return \"\";\r\n }",
"public function getEditViewUrl()\n\t{\n\t\treturn $this->getModule()->getEditViewUrl() . '&record=' . $this->getId();\n\t}",
"public function editUrl()\n {\n return cp_route('entry.edit', $this->collectionName() . '/' . $this->slug());\n }",
"public function generate_contactediturl() {\n $url = new Url($this->generate_contacturl());\n $url->path->add('edit');\n return $url->getUrl();\n }",
"public function editUrl();",
"public function editUrl()\n {\n $parameters = [];\n // All records\n $elements = $this->elFromTable('');\n foreach ($elements as $tP => $value) {\n list($table, $uid) = explode('|', $tP);\n $parameters['edit[' . $table . '][' . $uid . ']'] = 'edit';\n }\n return BackendUtility::getModuleUrl('record_edit', $parameters);\n }",
"public function getCpEditUrl()\n\t{\n\t\treturn UrlHelper::getCpUrl('formbuilder/entries/'.$this->id);\n\t}",
"public function getEditUrl()\n {\n return $this->urlBuilder->getUrl('customer/account/edit');\n }",
"public function editUrl(): string\n {\n return route('blogetc.admin.edit_post', $this->id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Required. The Directed Acyclic Graph of Jobs to submit. Generated from protobuf field repeated .google.cloud.dataproc.v1.OrderedJob jobs = 8 [(.google.api.field_behavior) = REQUIRED]; | public function setJobs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataproc\V1\OrderedJob::class);
$this->jobs = $arr;
return $this;
} | [
"public function setJobs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\RoadRunner\\Jobs\\DTO\\V1\\Job::class);\n $this->jobs = $arr;\n\n return $this;\n }",
"public function setJobs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Talent\\V4beta1\\Job::class);\n $this->jobs = $arr;\n\n return $this;\n }",
"public function setJobs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Scheduler\\V1beta1\\Job::class);\n $this->jobs = $arr;\n\n return $this;\n }",
"public function getJobs()\n {\n return $this->jobs;\n }",
"function operativeJobs()\n {\n return $this->jobRepository->operativeJobs();\n }",
"public function getJobs()\n {\n return $this->buildExistingJobsArray();\n }",
"public function enqueueBatch(array $jobs);",
"public function testJobCollection()\n {\n $flow = new Flow('test-flow');\n\n $job1 = new TestJob('test-job-1', null);\n $flow->addJob($job1);\n $job2 = new TestJob('test-job-2', null);\n $flow->addJob($job2);\n $job3 = new TestJob('test-job-3', null);\n $flow->addJob($job3);\n\n $this->assertEquals(3, $flow->getJobCount());\n $this->assertEquals(3, count($flow->getJobs()));\n\n foreach ($flow->getJobs() as $job) {\n $this->assertTrue($job instanceof JobInterface);\n }\n }",
"public function getJobs();",
"public function listJob()\n {\n $batch_date = $this->getDate();\n\n $data = sprintf(\"GET\\n\\n\\n\\n\\n\\n%s\\n\\n\\n\\n\\n\\n/%s/jobs\\napi-version:%s\\ntimeout:20\",\n $batch_date,\n $this->batch_account,\n $this->api_version\n );\n\n $signature = $this->signatureString($data);\n\n $response = Curl::to(sprintf(\"%s/jobs?api-version=%s&timeout=20\", $this->batch_url, $this->api_version))\n ->withHeader(sprintf(\"Authorization: SharedKey %s:%s\", $this->batch_account, $signature))\n ->withHeader('Date: ' . $batch_date)\n ->returnResponseObject()\n ->get();\n\n if ($response->status == 200) {\n\n $contents = json_decode($response->content);\n $jobs = $contents->value;\n\n return $jobs;\n\n } else {\n return [];\n }\n }",
"public function getJobs() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"public function listJobs(): array;",
"public function approvedJobsList()\n {\n $params = [\n 'approval_status' => 'approved'\n ];\n $with = [\n 'job_job_sub_categories.job_sub_category.job_category',\n 'company.user',\n 'hataraki_kata_resource.hataraki_kata',\n 'days',\n 'geolocation',\n 'nearest_station'\n ];\n\n return $this->jobChoiceRepository->job()->where($params, $with, 20);\n }",
"public function jobs() \n\t{\n\t\tif (!isset($this->jobs)) {\n\t\t\t$this->jobs = new \\Zamzar\\Jobs($this->getConfig());\n\t\t}\n\t\treturn $this->jobs;\n\t}",
"public function getRunningJobs() {\n $jobs = array();\n // TODO: impelement this function.\n return $jobs;\n }",
"public function jobOrders()\n {\n return $this->hasMany('App\\Models\\JobOrder');\n }",
"public function jobsAction()\n {\n return array();\n }",
"public function admin_jobs() {\n\t\tif ($this->_isFromForm('Package')) {\n\t\t\ttry {\n\t\t\t\t$this->Package->fireJob($this->request->data);\n\t\t\t\t$this->Session->setFlash(__('Job has been loaded and enqueued.'), 'flash/success');\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->Session->setFlash($e->getMessage(), 'flash/error');\n\t\t\t}\n\t\t\treturn $this->redirect($this->referer());\n\t\t}\n\t\t$this->set('jobs', $this->Package->getJobs());\n\t}",
"public function listJobs($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_JobService_ListJobsResponse\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
buatlah sebuah file dengan nama tentukanderetgeometri.php. Di dalam file tersebut buatlah function dengan nama tentukan_deret_geometri yang menerima parameter berupa array berisi angkaangka. function akan mereturn true jika kumpulan angka tersebut adalah sebuah deret geometri dan mereturn false jika bukan merupakan deret geometri. Contohnya jika parameternya [2, 6, 18, 54] akan mereturn true karena deret angka tersebut merupakan deret geometri dengan rasio 3. | function tentukan_deret_geometri($arr) {
// kode di sini
} | [
"function peramalanBerdasarkanRelasi(){\n $data = data(); // data sementara\n\n $f = menghitung_nilai_peramalan(); // f = hitung peramalan\n $jF = count(menghitung_nilai_peramalan()); // jumlah (f = hitung peramalan)\n $fuzzyfikasi = fuzzyfikasi();\n $jFuzzyfikasi = count(fuzzyfikasi());\n $jhitung_interval = count(hitung_interval());\n $hitung_interval = hitung_interval();\n\n // var_dump($fuzzyfikasi[$jFuzzyfikasi-1][1]);\n // die;\n\n// var_dump($jhitung_interval);\n// die;\n for ($i=1; $i < $jFuzzyfikasi ; $i++) {\n for ($j=0; $j < $jF ; $j++) {\n if ($fuzzyfikasi[$i][1] == $f[$j][2]) {\n $peramalan[] = [\n $data[$i]['tanggal'],\n $data[$i]['hasil_panen'],\n $f[$j][1]\n ];\n }\n }\n }\n\n// var_dump($fuzzyfikasi[$jFuzzyfikasi-1][1]);\n// die;\n// menentukan peramlan priode kedepan\n for ($i=0; $i <$jhitung_interval ; $i++) {\n if ($fuzzyfikasi[$jFuzzyfikasi-1][1] == $hitung_interval[$i][3]) {\n // echo $hitung_interval[$i][2];\n $peramalan[] = [\n 'bulan kedepan',\n 'hasil_panen',\n $hitung_interval[$i][2]\n ];\n }\n }\n// end menentukan peramlan priode kedepan\n\n\n\n return $peramalan;\n}",
"function getGridAntri($noterima) {\n//\t\t\t\t replace(trim(a.Ongkos),right(trim(a.Ongkos),3),'') as Ongkos \n//\t\t\t\t from tt_antri a where a.NoTerima = '$noterima'\");\n $query = $this->db->query(\"select a.BANYAK,a.Satuan,a.Barang, round(JUMLAH,2) as JUMLAH, a.SAT, \n\t\t\t\t a.Ongkos,a.jml_ongkos \n\t\t\t\t from tt_antri a where a.NoTerima = '$noterima'\");\n return ($query->num_rows() > 0) ? $query->result_array() : FALSE;\n }",
"function pegaParametrosLegImg()\n {\n // error_reporting(0);\n $legenda = $this->mapa->legend;\n $height = $legenda->height;\n $width = $legenda->width;\n $keysizex = $legenda->keysizex;\n $keysizey = $legenda->keysizey;\n $keyspacingx = $legenda->keyspacingx;\n $keyspacingy = $legenda->keyspacingy;\n $outlinecolor = corRGB($legenda->outlinecolor); // Color of outline of box, -1 for no outline\n $status = $legenda->status; // MS_ON, MS_OFF, MS_EMBED\n $position = $legenda->position;\n if ($position < 99) {\n $position = \"10\" . $position;\n }\n $transparent = 100;\n $imagecolor = corRGB($legenda->imagecolor);\n $label = $legenda->label;\n $font = $label->font;\n if ($font == MS_BITMAP) {\n $l = $label->size;\n if ($l == MS_TINY) {\n $t = 5;\n }\n if ($l == MS_SMALL) {\n $t = 7;\n }\n if ($l == MS_MEDIUM) {\n $t = 10;\n }\n if ($l == MS_LARGE) {\n $t = 12;\n }\n if ($l == MS_GIANT) {\n $t = 14;\n }\n $labelsize = $t;\n } else\n $labelsize = $label->size;\n\n $tipofonte = $label->type;\n return (array(\n \"tipofonte\" => $tipofonte,\n \"font\" => $font,\n \"imagecolor\" => $imagecolor,\n \"transparent\" => transparent,\n \"position\" => $position,\n \"status\" => $status,\n \"outlinecolor\" => $outlinecolor,\n \"keyspacingy\" => $keyspacingy,\n \"keyspacingx\" => $keyspacingx,\n \"keysizey\" => $keysizey,\n \"keysizex\" => $keysizex,\n \"height\" => $height,\n \"width\" => $width,\n \"labelsize\" => $labelsize\n ));\n }",
"public function _tmp_ket_tinggal_dengan()\n {\n $tinggal_dengan = $this->input->post('tmp_tinggal_dengan');\n $ket_tinggal_dengan = $this->input->post('tmp_ket_tinggal_dengan');\n\n if ($tinggal_dengan != '0') {\n // Kalau tinggal dengan dipilih, maka keterangan tinggal dengan harus dikosongkan\n if (! empty($ket_tinggal_dengan)) {\n $this->form_validation->set_message('_tmp_ket_tinggal_dengan', \"Karena tinggal dengan sudah dipilih, maka kolom keterangan tinggal dengan harus dikosongkan.\");\n return false;\n } else {\n return true;\n }\n } else {\n if (empty($ket_tinggal_dengan)) {\n $this->form_validation->set_message('_tmp_ket_tinggal_dengan', \"Karena tinggal dengan adalah 'lainnya', maka kolom keterangan tinggal dengan harus diisi.\");\n return false;\n } else {\n return true;\n }\n }\n }",
"function generate_Parameter_LCG(){\n\t//deklarasi variabel\n\t$lcg = array(array());\n\n\t//generate bilangan K untuk A\n\t$k = array (rand(0,25), rand(0,25), rand(0,25));\n\t$lcg['A'][0] = 1+(4*$k[0]);\n\t$lcg['A'][1] = 1+(4*$k[1]);\n\t$lcg['A'][2] = 1+(4*$k[2]);\n\t//generate bilangan prima untuk C\t\n\t$prima = bilangan_prima();\n\t$rand_prima = array_rand($prima, 3);\n\t$lcg['C'][0] = $prima[$rand_prima[0]];\n\t$lcg['C'][1] = $prima[$rand_prima[1]];\n\t$lcg['C'][2] = $prima[$rand_prima[2]];\n\t//generate bilangan b untuk M\n\t$b = rand(2,10);\n\t$lcg['M'] = pow(2, $b);\n\t//generate aturan untuk Z0\n\t$MinMax = array(\n\t\t\t\t\"Min\" => array(\n\t\t\t\t\t\t\tmin($lcg['A'][0], $lcg['C'][0], $lcg['M']),\n\t\t\t\t\t\t\tmin($lcg['A'][1], $lcg['C'][1], $lcg['M']),\n\t\t\t\t\t\t\tmin($lcg['A'][2], $lcg['C'][2], $lcg['M'])\n\t\t\t\t\t\t\t),\n\t\t\t\t\"Max\" => array(\n\t\t\t\t\t\t\tmax($lcg['A'][0], $lcg['C'][0], $lcg['M']),\n\t\t\t\t\t\t\tmax($lcg['A'][1], $lcg['C'][1], $lcg['M']),\n\t\t\t\t\t\t\tmax($lcg['A'][2], $lcg['C'][2], $lcg['M'])\n\t\t\t\t\t\t\t)\n\t\t\t\t);\n\t$lcg['Z'][0] = rand($MinMax[\"Min\"][0], $MinMax[\"Max\"][0]);\n\t$lcg['Z'][1] = rand($MinMax[\"Min\"][1], $MinMax[\"Max\"][1]);\n\t$lcg['Z'][2] = rand($MinMax[\"Min\"][2], $MinMax[\"Max\"][2]);\n\t//return value\n\treturn $lcg;\n}",
"function penampil_tabel_no_foto_untuk_surat_balasan ($array_atribut,$query_yang_mau_ditampilkan,$submenu,$kolom_direktori='direktori',$direktori_avatar='/public/img/no-image.jpg'){\n $Recordset1=$this->CI->model_frommyframework->user_defined_query_model($query_yang_mau_ditampilkan,$token='andisinra');\n if (!$Recordset1) {\n echo \"<center>TABEL YANG BERSESUAIAN KOSONG, SILAHKAN DIISI DULU</center>\";\n } else {\n $Recordset=array();\n //ambil nama-nama key dari hasil query\n foreach ($Recordset1 as $isi) {\n array_push($Recordset,$isi);\n }\n \n unset($Recordset1);\n\n if(isset($Recordset[0])){\n $key_query=array_keys($Recordset[0]);\n \n $tampung_key=array();\n foreach($key_query as $index_array){\n if(is_string($index_array)) {\n array_push($tampung_key,$index_array);\n }else {\n\n }\n } \n \n //$this->header_lengkap_bootstrap();\n echo \"<h4>Kelola Surat Balasan Sekretariat</h4>\";\n echo \"<div \".$array_atribut[0].\" ><table \".$array_atribut[1].\" ><tr \".$array_atribut[2].\" >\";\n echo \"<th scope='col' ><span >Aksi</span></th>\";\n if(in_array($kolom_direktori,$tampung_key)){\n echo \"<th ><span >Foto</span></th>\";\n }\n foreach ($tampung_key as $value) {\n echo \"<th > $value </th>\";\n } \n echo \"</tr>\";\n \n \n $i=0;\n foreach($Recordset as $isi){\n echo \"<tr>\";\n //$tampung=array_values($isi); \n $i++;\n echo \"<td valign=top>\";\n $this->buat_komponen_form($type='button_ajax_post_CI',$nama_komponen='button_ajax_post_CI'.$isi[$tampung_key[0]],$class='btn btn-warning btn-xs',$id='button_ajax_post_CI_rincian'.$isi[$tampung_key[0]],$atribut='',$event='',$label='',$value='Rincian',$value_selected_combo='',$submenu='rincian_penampil_tabel_balasan',$aksi='rincian',$perekam_id_untuk_button_ajax=NULL,$target_ajax=\"Frontoffice/gerbang/\".$submenu,$data_ajax=\"{\\\"\".$tampung_key[0].\"\\\":\\\"\".$isi[$tampung_key[0]].\"\\\" }\");\n echo \"</td>\";\n /*\n echo \"<td valign=top>\";\n $this->buat_komponen_form($type='button_ajax_post_CI',$nama_komponen='button_ajax_post_CI'.$isi[$tampung_key[0]],$class='btn btn-success btn-xs',$id='button_ajax_post_CI_edit'.$isi[$tampung_key[0]],$atribut='',$event='',$label='',$value='Edit',$value_selected_combo='',$submenu='edit_penampil_tabel',$aksi='edit',$perekam_id_untuk_button_ajax=NULL,$target_ajax=\"Frontoffice/gerbang/\".$submenu,$data_ajax=\"{\\\"\".$tampung_key[0].\"\\\":\\\"\".$isi[$tampung_key[0]].\"\\\" }\");\n echo \"</td>\";\n */\n if(in_array($kolom_direktori,$tampung_key)) {\n $direktori=$isi[$kolom_direktori];\n if ((!$direktori) or ($direktori==\"../../public/img/\")){$direktori=$direktori_avatar;}\n echo \"<td valign=top><img src=\\\"\".base_url($direktori).\"\\\" width=\\\"50px\\\" height=\\\"50px\\\" onmouseover=\\\"this.style.width='100px';this.style.height='100px';\\\" onmouseout=\\\"this.style.width='50px';this.style.height='50px';\\\" /> </td>\";\n } \n foreach ($tampung_key as $k) {\n echo \"<td align=left valign=top>\".$isi[$k].\"</td>\";\n } \n echo \"</tr>\";\n\n }\n \n echo \"</table></div>\";\n }else{\n echo \"<center>TABEL YANG BERSESUAIAN KOSONG, SILAHKAN DIISI DULU</center>\";\n }\n }\n }",
"function graficoLinhas()\n{\n\tglobal $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path,$R_libpath;\n\tglobal $percentual,$nome,$margem,$margemexterna,$margeminterna,$xlab,$ylab,$grid,$ppontos,$spline,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$nome;\n\t//pega os valores\n\t$dir = dirname(dirname($map_file));\n\tif($nome == \"\")\n\t{\n\t\t$temp = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,\"\",false);\n\t\t$nnval = $temp[\"dados\"];\n\t\t$nome = $dir.\"/\".nomeRandomico(20);\n\t\tgravaDados($nnval,$nome);\n\t}\n\t$gfile_name = nomeRandomico(20);\n\t$rcode = iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexterna,$margeminterna,$locaplic,$R_libpath);\n\t$rcode[] = 'valores=read.table(\"'.$nome.'\",header=TRUE,sep=\";\")';\n\t$rcode[] = 'attach(valores)';\n\t$rcode[] = 'names(x)= n';\n\t$parametros = 'col.lab='.$collab.',col.axis='.$colaxis.',cex.lab='.$cexlab.',cex.axis='.$cexaxis.',font.lab='.$fontlab.',las='.$las.',tck='.$tck.',cex.main='.$cexmain;\n\t$rcode[] = 'par(pty=\"s\")';\n\t$rcode[] = 'plot(x,'.$parametros.', type = \"n\", axes = FALSE, ann = FALSE)';\n\tif ($grid == \"TRUE\")\n\t$rcode[] = \"grid()\";\n\tif ($spline==\"FALSE\")\n\t{$rcode[] = 'lines(x,col='.$border.',lty='.$lty.',lwd='.$lwd.')';}\n\telse\n\t{$rcode[] = 'lines(spline(x),col='.$border.',lty='.$lty.',lwd='.$lwd.')';}\n\tif ($ppontos==\"TRUE\")\n\t{$rcode[] = 'points(x, pch =\"'.$pch.'\", bg = \"light grey\", cex ='.$tpt.')';}\n\t$rcode[] = \"axis(2,lines=NA)\";\n\t$rcode[] = 'axis(1, lines=NA)';\n\t$rcode[] = 'box()';\n\t$rcode[] = 'title(xlab = \"'.$xlab.'\")';\n\t$rcode[] = 'title(ylab = \"'.$ylab.'\")';\n\t$rcode[] = 'title(main = \"'.$main.'\",col.main='.$colmain.',font.main='.$fontmain.')';\n\t$rcode[]='close.screen(all = TRUE)';\n\t$rcode[] = 'dev.off()';\n\t$r = executaR($rcode,$dir_tmp,$R_path);\n\t$map = ms_newMapObj($map_file);\n\t$webo = $map->web;\n\t$url = dirname($webo->imageurl).\"/\";\n\treturn($url.$gfile_name.\".png,\".$url.(basename($nome)).\",\".$nome);\n}",
"function verificaMiniatura($map,$tipo,$admin=false)\n{\n\tglobal $versao,$base;\n\t$postgis_mapa = $_SESSION[\"postgis_mapa\"];\n\t$locaplic = $_SESSION[\"locaplic\"];\n\tif($versao == \"\"){\n\t\t$versao = \\admin\\php\\funcoesAdmin\\versao();\n\t\t$versao = $versao[\"principal\"];\n\t}\n\tms_ResetErrorList();\n\t$tema = \"\";\n\t$map = str_replace(\"\\\\\",\"/\",$map);\n\t$map = basename($map);\n\t$extensao = \".map\";\n\tif (file_exists($_SESSION[\"locaplic\"].'/temas/'.$map)){\n\t\t$tema = $_SESSION[\"locaplic\"].'/temas/'.$map;\n\t}\n\telse{\n\t\tif (file_exists($_SESSION[\"locaplic\"].'/temas/'.$map.'.gvp')){\n\t\t\t$extensao = \".gvp\";\n\t\t}\n\t\t$tema = $_SESSION[\"locaplic\"].'/temas/'.$map.$extensao;\n\t}\n\tif ($tema != \"\"){\n\t\tif(isset($base) && $base != \"\"){\n\t\t\tif(file_exists($base))\n\t\t\t{$f = $base;}\n\t\t\telse\n\t\t\t{$f = $_SESSION[\"locaplic\"].\"/aplicmap/\".$base.\".map\";}\n\t\t\tif(!file_exists($base)){\n\t\t\t\techo \"<div class='alert alert-danger'>ARQUIVO $base NÂO FOI ENCONTRADO. CORRIJA ISSO EM ms_configura.php\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$f = \"\";\n\t\t\tif (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){\n\t\t\t\t$f = $_SESSION[\"locaplic\"].\"/aplicmap/geral1windowsv\".$versao.\".map\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($f == \"\" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){\n\t\t\t\t\t$f = \"/var/www/i3geo/aplicmap/geral1debianv\".$versao.\".map\";\n\t\t\t\t}\n\t\t\t\tif($f == \"\" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){\n\t\t\t\t\t$f = \"/var/www/html/i3geo/aplicmap/geral1fedorav\".$versao.\".map\";\n\t\t\t\t}\n\t\t\t\tif($f == \"\" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){\n\t\t\t\t\t$f = \"/opt/www/html/i3geo/aplicmap/geral1v\".$versao.\".map\";\n\t\t\t\t}\n\t\t\t\tif($f == \"\"){\n\t\t\t\t\t$f = $_SESSION[\"locaplic\"].\"/aplicmap/geral1v\".$versao.\".map\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$mapa = ms_newMapObj($f);\n\t\tif($extensao == \".map\"){\n\t\t\tif(@ms_newMapObj($tema)){\n\t\t\t\t$nmapa = ms_newMapObj($tema);\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"<div class='alert alert-danger'>erro no arquivo $tema </div>\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$dados = \"\";\n\t\t\t$numlayers = $nmapa->numlayers;\n\t\t\tfor ($i=0;$i < $numlayers;$i++){\n\t\t\t\t$layern = $nmapa->getlayer($i);\n\t\t\t\t$layern->set(\"status\",MS_DEFAULT);\n\t\t\t\tcloneInlineSymbol($layern,$nmapa,$mapa);\n\t\t\t\tms_newLayerObj($mapa, $layern);\n\t\t\t\tautoClasses($layern,$mapa,$_SESSION[\"locaplic\"]);\n\t\t\t\tif ($layern->data == \"\"){\n\t\t\t\t\t$dados = $layern->connection;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$dados = $layern->data;\n\t\t\t\t}\n\t\t\t\t$pegarext = $layern->name;\n\t\t\t}\n\t\t\tif (isset($postgis_mapa)){\n\t\t\t\tif ($postgis_mapa != \"\"){\n\t\t\t\t\t$numlayers = $mapa->numlayers;\n\t\t\t\t\tfor ($i=0;$i < $numlayers;$i++){\n\t\t\t\t\t\t$layern = $mapa->getlayer($i);\n\t\t\t\t\t\tif (!empty($postgis_mapa)){\n\t\t\t\t\t\t\tif ($layern->connectiontype == MS_POSTGIS){\n\t\t\t\t\t\t\t\t$lcon = $layern->connection;\n\t\t\t\t\t\t\t\tif (($lcon == \" \") || ($lcon == \"\") || (in_array($lcon,array_keys($postgis_mapa)))){\n\t\t\t\t\t\t\t\t\tif(($lcon == \" \") || ($lcon == \"\")) //para efeitos de compatibilidade\n\t\t\t\t\t\t\t\t\t{$layern->set(\"connection\",$postgis_mapa);}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$layern->set(\"connection\",$postgis_mapa[$lcon]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//zoomTemaMiniatura($pegarext,$mapa);\n\t\t}\n\t\tif ($tipo == \"mini\" || $tipo == \"todos\"){\n\t\t\t$mapa->setsize(50,50);\n\t\t\t$sca = $mapa->scalebar;\n\t\t\t$sca->set(\"status\",MS_OFF);\n\t\t\t$objImagemM = @$mapa->draw();\n\t\t\t//if ($objImagemM == \"\" || $objImagemM == MS_FAILURE)\n\t\t\t//{echo \"Problemas ao gerar o mapa<br>\";return;}\n\t\t\t$weboM = $mapa->web;\n\t\t\t$urlM = $weboM->imageurl.\"/\".$map;\n\t\t}\n\t\tif ($tipo == \"grande\" || $tipo == \"todos\"){\n\t\t\t$mapa->setsize(300,300);\n\t\t\t$sca = $mapa->scalebar;\n\t\t\t$sca->set(\"status\",MS_OFF);\n\t\t\t$objImagemG = @$mapa->draw();\n\t\t\t$weboG = $mapa->web;\n\t\t\t$urlG = $weboG->imageurl.\"/\".$map;\n\t\t}\n\t\tif($tipo==\"mini\" || $tipo == \"todos\"){\n\t\t\tif (!$objImagemM){\n\t\t\t\techo \"Problemas ao gerar o mapa<br>\";\n\t\t\t\t$error = \"\";\n\t\t\t\t$error = ms_GetErrorObj();\n\t\t\t\twhile($error && $error->code != MS_NOERR){\n\t\t\t\t\techo \"<div class='alert alert-danger'>Error in %s: %s</div>\", $error->routine, $error->message;\n\t\t\t\t\t$error = $error->next();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($objImagemM->imagepath == \"\"){\n\t\t\t\techo \"<div class='alert alert-danger'>Erro IMAGEPATH vazio</div>\";return;\n\t\t\t}\n\t\t\t$nomecM = ($objImagemM->imagepath).$map.\".mini.png\";\n\t\t\t$objImagemM->saveImage($nomecM);\n\t\t}\n\t\tif($tipo==\"grande\" || $tipo == \"todos\"){\n\t\t\tif (!$objImagemG){\n\t\t\t\techo \"<div class='alert alert-danger'>Problemas ao gerar o mapa</div>\";\n\t\t\t\t$error = \"\";\n\t\t\t\t$error = ms_GetErrorObj();\n\t\t\t\twhile($error && $error->code != MS_NOERR){\n\t\t\t\t\techo \"<div class='alert alert-danger'>Error in %s: %s</div>\", $error->routine, $error->message;\n\t\t\t\t\t$error = $error->next();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($objImagemG->imagepath == \"\"){\n\t\t\t\techo \"<div class='alert alert-danger'>Erro IMAGEPATH vazio</div>\";return;\n\t\t\t}\n\t\t\t$nomecG = ($objImagemG->imagepath).$map.\".grande.png\";\n\t\t\t$objImagemG->saveImage($nomecG);\n\t\t}\n\t\tif($admin === false){\n\t\t\tif($tipo==\"mini\" || $tipo == \"todos\")\n\t\t\t{echo \"<img class='img-thumbnail' src='\".$urlM.\".mini.png' />\";}\n\t\t\tif($tipo==\"grande\" || $tipo == \"todos\")\n\t\t\t{echo \"<img class='img-thumbnail' src='\".$urlG.\".grande.png' />\";}\n\t\t}\n\t\t//\n\t\t//copia a imagem\n\t\t//\n\t\tif($admin === true){\n\t\t\t$dir = $_SESSION[\"locaplic\"].\"/temas/miniaturas\";\n\t\t\t$mini = $dir.\"/\".$map.\".map.mini.png\";\n\t\t\t$grande = $dir.\"/\".$map.\".map.grande.png\";\n\t\t\tif(file_exists($mini))\n\t\t\t{unlink($mini);}\n\t\t\tif(file_exists($grande))\n\t\t\t{unlink($grande);}\n\t\t\tcopy(($objImagemG->imagepath).$map.\".grande.png\",$grande);\n\t\t\tcopy(($objImagemM->imagepath).$map.\".mini.png\",$mini);\n\t\t}\n\t}\n}",
"function BD1_739_VER01_PARAMETER06($post){\r\n\r\n $iAspekId = $post['_iAspekId'];\r\n $cNipNya = $post['_cNipNya'];\r\n //$cNipNya = 'N09484';\r\n $dPeriode1 = $post['_dPeriode1'];\r\n $x_prd1 = explode(\"-\", $dPeriode1);\r\n $perode1 = $x_prd1['2'].\"-\".$x_prd1['1'].\"-\".$x_prd1['0'];\r\n\r\n $dPeriode2 = $post['_dPeriode2'];\r\n $x_prd2 = explode(\"-\", $dPeriode2);\r\n $perode2 = $x_prd2['2'].\"-\".$x_prd2['1'].\"-\".$x_prd2['0'];\r\n\r\n $jenis = array(1=>'UM',2=>'Claim');\r\n\r\n $bulan = $this->hitung_bulan($perode1,$perode2);\r\n\r\n //cari aspek dulu\r\n $sql = \"SELECT vAspekName FROM hrd.pk_aspek WHERE id='\".$iAspekId.\"'\";\r\n $query = $this->db_erp_pk->query($sql);\r\n $vAspekName = $query->row()->vAspekName;\r\n\r\n $html = \"\r\n <table width='750px'>\r\n <tr>\r\n <td><b>Point Untuk Aspek :</b></td>\r\n <td>\".$vAspekName.\"</td>\r\n\r\n </tr>\r\n </table>\";\r\n\r\n $sqPrareg = 'SELECT aa.* FROM (\r\n SELECT z.*\r\n FROM (\r\n SELECT u.tinfo_paten, u.`iupb_id`, u.`iGroup_produk` , u.iteambusdev_id, mku.vkategori, u.`ikategoriupb_id`,\r\n u.`vupb_nomor`,u.vupb_nama,if(u.ineed_prareg=1,\"Ya\", \"Tidak\") as needPrareg, DATE(la.dCreate) as appdir, if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg) as tanggalSubmit,\r\n ABS(datediff(la.dCreate, if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg))) as selisih\r\n FROM plc2.plc2_upb u\r\n # JOIN plc2.plc2_upb_prioritas_detail det on det.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules \r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort \r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n JOIN plc2.plc2_upb_master_kategori_upb mku ON u.ikategoriupb_id=mku.ikategori_id\r\n WHERE u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 4 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n AND u.iKill = 0\r\n and u.ldeleted = 0\r\n AND la.iApprove=2\r\n AND u.`ikategoriupb_id` = 10\r\n and u.itipe_id <> 6\r\n \r\n AND (\r\n case when u.ineed_prareg=1 then\r\n u.tsubmit_prareg is not null\r\n AND u.tsubmit_prareg >= \"'.$perode1.'\" \r\n AND u.tsubmit_prareg <= \"'.$perode2.'\" \r\n ELSE\r\n u.tsubmit_reg is not null\r\n AND u.tsubmit_reg >= \"'.$perode1.'\" \r\n AND u.tsubmit_reg <= \"'.$perode2.'\" \r\n END\r\n )\r\n UNION \r\n SELECT u.tinfo_paten, u.`iupb_id`, u.`iGroup_produk` , u.iteambusdev_id, mku.vkategori, u.`ikategoriupb_id`,\r\n u.`vupb_nomor`,u.vupb_nama,if(u.ineed_prareg=1,\"Ya\", \"Tidak\") as needPrareg, DATE(la.dCreate) as appdir, if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg) as tanggalSubmit,\r\n ABS(datediff(la.dCreate, if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg))) as selisih\r\n FROM plc2.plc2_upb u\r\n # JOIN plc2.plc2_upb_prioritas_detail det on det.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n JOIN plc2.plc2_upb_master_kategori_upb mku ON u.ikategoriupb_id=mku.ikategori_id\r\n JOIN plc2.tanggal_history_prareg_reg his on his.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort \r\n where u.ldeleted = 0 \r\n AND la.lDeleted=0 \r\n AND mo.lDeleted=0 \r\n AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 4 \r\n AND u.`ikategoriupb_id` = 10\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n AND la.iApprove=2\r\n and moa.iType=3\r\n and his.ldeleted=0\r\n AND his.ijenis = 1\r\n #Check Aktivity\r\n and his.id IN (\r\n select na.id_pk from ( \r\n select ta.dtanggal,ta.id as id_pk \r\n FROM plc2.tanggal_history_prareg_reg ta\r\n join plc2.plc2_upb up on up.iupb_id=ta.iupb_id \r\n WHERE ta.ldeleted=0 \r\n AND (case when up.ineed_prareg=1 then\r\n ta.ijenis=1\r\n ELSE\r\n ta.ijenis=2\r\n END)\r\n group by ta.iupb_id \r\n order by ta.id ASC \r\n ) as na\r\n Where na.dtanggal >= \"'.$perode1.'\"\r\n AND na.dtanggal <= \"'.$perode2.'\"\r\n )\r\n \r\n\r\n ) AS z\r\n\r\n # ORDER BY z.nilai ASC\r\n\r\n ) as aa GROUP BY aa.iupb_id\r\n ORDER BY needPrareg\r\n ';\r\n \r\n\r\n /* $sqPrareg = 'SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, ua.tupdate, u.tsubmit_prareg ,u.iteambusdev_id,kat.vkategori\r\n FROM plc2.`plc2_upb` u\r\n JOIN plc2.plc2_upb_approve ua ON ua.`iupb_id` = u.`iupb_id`\r\n JOIN plc2.master_group_produk m on u.`iGroup_produk` = m.imaster_group_produk\r\n join plc2.plc2_upb_master_kategori_upb kat on kat.ikategori_id=u.ikategoriupb_id\r\n WHERE u.`ldeleted` = 0 \r\n AND u.tsubmit_prareg IS NOT NULL AND u.tsubmit_prareg <>\"0000-00-00\"\r\n AND u.`iteambusdev_id` = 4\r\n AND ua.`vtipe` = \"DR\"\r\n AND ua.`iapprove` = 2\r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg = 1\r\n AND u.ldeleted = 0 \r\n AND u.ikategoriupb_id = 10 # Kategori A\r\n AND u.`tsubmit_prareg` >= \"'.$perode1.'\"\r\n AND u.`tsubmit_prareg` <= \"'.$perode2.'\"\r\n ';\r\n*/\r\n $upbPrareg = $this->db_erp_pk->query($sqPrareg)->result_array(); \r\n $html .= \"<table cellspacing='0' cellpadding='3' width='750px'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <th colspan='6' style='text-align: left;border: 1px solid #dddddd;' >Tanggal Submit Prareg</th> \r\n </tr>\r\n <tr style='width:100%; border: 1px solid #f86609; background: #b5f2a6; border-collapse: collapse;text-align: center;'>\r\n <th>No</th>\r\n <th>No UPB</th>\r\n <th>Nama UPB</th> \r\n <th>Team Busdev</th> \r\n <th>Kategori</th> \r\n <th>Need Prareg</th> \r\n <th>Tanggal Approval Direksi</th>\r\n <th>Tanggal Submit Prareg</th> \r\n </tr>\r\n \"; \r\n\r\n $cekDouble = array();\r\n $kurangTotal=0;\r\n $i=0;\r\n $total_parareg = 0;\r\n foreach ($upbPrareg as $ub) {\r\n $sqlk =\"SELECT u.`vteam` FROM plc2.`plc2_upb_team` u WHERE u.`ldeleted`=0 AND u.`iteam_id` = '\".$ub['iteambusdev_id'].\"'\";\r\n $kat = $this->db_erp_pk->query($sqlk)->row_array();\r\n if(empty($kat['vteam'])){\r\n $k = '-';\r\n }else{\r\n $k = $kat['vteam'];\r\n }\r\n\r\n $i++; \r\n if (in_array($ub['iupb_id'], $cekDouble)) {\r\n $kurangTotal++;\r\n }\r\n array_push($cekDouble,$ub['iupb_id']);\r\n $total_parareg++;\r\n $html .= \"<tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;' >\".$i.\"</td> \r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vupb_nomor'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vupb_nama'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$k.\"</td> \r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vkategori'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['needPrareg'].\"</td> \r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['appdir'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['tanggalSubmit'].\"</td>\r\n </tr>\"; \r\n\r\n \r\n\r\n } \r\n $html .= \"</table><br /> \";\r\n\r\n //-------------------------------------------------------------------------------------- INI REG\r\n\r\n\r\n\r\n $totalUpb =$total_parareg; \r\n $jumlahUpb = $totalUpb - $kurangTotal; \r\n $result = number_format($jumlahUpb);\r\n $getpoint = $this->getPoint($result,$iAspekId);\r\n $x_getpoint = explode(\"~\", $getpoint);\r\n $point = $x_getpoint['0'];\r\n $warna = $x_getpoint['1'];\r\n\r\n\r\n $html .= \"<table align='left' cellspacing='0' cellpadding='3' style='width: 500px;'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;background-color: #3bdeea;'>\r\n <td colspan='2' style='text-align: left;border: 1px solid #dddddd;'></td>\r\n </tr>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Total UPB Prareg & Reg</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$totalUpb.\" </td>\r\n </tr>\r\n \r\n </table><br/><br/>\";\r\n\r\n\r\n echo $result.\"~\".$point.\"~\".$warna.\"~\".$html;\r\n }",
"function tanggal($tgl) {\n\t// variabel BulanIndo merupakan variabel array yang menyimpan nama-nama bulan\n\t$array_hari = array('Sun'=>'Minggu', 'Mon'=>'Senin', 'Tue'=>'Selasa', 'Wed'=>'Rabu', 'Thu'=>'Kamis', 'Fri'=>'Jumat', 'Sat'=>'Sabtu');\n\t$BulanIndo = array(\"01\"=>\"Januari\", \"02\"=>\"Februari\", \"03\"=>\"Maret\",\n\t\t\t\t\t \"04\"=>\"April\", \"05\"=>\"Mei\", \"06\"=>\"Juni\",\n\t\t\t\t\t \"07\"=>\"Juli\", \"08\"=>\"Agustus\", \"09\"=>\"September\",\n\t\t\t\t\t \"10\"=>\"Oktober\", \"11\"=>\"November\", \"12\"=>\"Desember\");\n\t$tgl_arr = explode('-',$tgl);\n\t$tahun = $tgl_arr[0]; \n\t$bulan = $tgl_arr[1]; \n\t$hari = $tgl_arr[2]; \n\t$kd_hari = date('D', strtotime($tgl));\n\t$nama_hari = $array_hari[$kd_hari];\n\t//$result = $nama_hari.', '.$hari . \" \" . $BulanIndo[$bulan] . \" \". $tahun;\n\t$result = $nama_hari.', '.$hari . \" \" . $BulanIndo[$bulan] . \" \". $tahun;\n\treturn($result);\n}",
"public function calculDistance($distance, $maLatitude, $maLongitude, $listeEtablissement, $bool) {\n\n $tmp=array();\n $compteur=0;\n $tab_distance=array();\n\n //on converti en radiant notre lat et notre long\n $latFrom = deg2rad($maLatitude);\n $lonFrom = deg2rad($maLongitude);\n\n //pour chaque etablissement\n foreach ($listeEtablissement as $e) {\n\n //on converti aussi sa lat et sa long en radiant\n $latTo = deg2rad($e->getLattitude());\n $lonTo = deg2rad($e->getLongitude());\n\n //on soustrait a la position de l'etablissemnt notre position pour sa lat et sa long\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n //calcul des 2 points pour trouver l'angle\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\n\n //arc tangeante de racineCaree(a) et de b\n $angle = atan2(sqrt($a), $b);\n\n //POur avoir une distance en km on multiplie l'angle par le diametre de la Terre et on divise par 1000\n $dist=($angle * 6371000)/1000; \n\n //Si la distane choisie est 0 on prend tous les etablissement\n if ($distance==0) {\n $tmp[$compteur]=$e;\n //on rajoute la distance pour ensuite pouvoir classé nos etablissemnts du moins loin au plus loin\n $tmp[$compteur]->setDistance(ceil($dist));\n $compteur++;\n\n //si bool=true alors on recupere tous les etablissements dont la distance est inferieure a celle choisie\n } else if ($bool) {\n if (ceil($dist)<=$distance) {\n $tmp[$compteur]=$e;\n $tmp[$compteur]->setDistance(ceil($dist));\n $compteur++;\n }\n }\n\n // Pour les meilleurs etablissemnts on ne chosie que les etablissements ayant une moyenne > 2.5\n else {\n if (ceil($dist)<=$distance && $e->getMoyenne()>2.5) {\n $tmp[$compteur]=$e;\n $tmp[$compteur]->setDistance(ceil($dist));\n $compteur++;\n }\n }\n }\n\n //tri a bulle en fonction de la distance\n $n=$compteur;\n $i = null; $j = null; $temp = null;\n if ($bool) {\n for ($i = 0; $i < ($n - 1); $i++) {\n for ($j = ($i + 1); $j < $n; $j++) {\n if ($tmp[$j]->getDistance() < $tmp[$i]->getDistance()) {\n $temp = $tmp[$i];\n $tmp[$i] = $tmp[$j];\n $tmp[$j] = $temp; \n } \n }\n }\n //tri a bulle en fonction du coefficient de l'etablissemnt (pour fc meilleurs etablissements)\n } else {\n for ($i = 0; $i < ($n - 1); $i++) {\n for ($j = ($i + 1); $j < $n; $j++) {\n if ($tmp[$j]->getCoefficient() > $tmp[$i]->getCoefficient()) {\n $temp = $tmp[$i];\n $tmp[$i] = $tmp[$j];\n $tmp[$j] = $temp; \n } \n }\n }\n}\n\n//on retourne alors le nouveau tableau d'etablissemnts\nreturn $tmp;\n}",
"function BD2_739_VER01_PARAMETER05($post){\r\n\r\n $iAspekId = $post['_iAspekId'];\r\n $cNipNya = $post['_cNipNya'];\r\n //$cNipNya = 'N09484';\r\n $dPeriode1 = $post['_dPeriode1'];\r\n $x_prd1 = explode(\"-\", $dPeriode1);\r\n $perode1 = $x_prd1['2'].\"-\".$x_prd1['1'].\"-\".$x_prd1['0'];\r\n\r\n $dPeriode2 = $post['_dPeriode2'];\r\n $x_prd2 = explode(\"-\", $dPeriode2);\r\n $perode2 = $x_prd2['2'].\"-\".$x_prd2['1'].\"-\".$x_prd2['0'];\r\n\r\n $jenis = array(1=>'UM',2=>'Claim');\r\n\r\n $bulan = $this->hitung_bulan($perode1,$perode2);\r\n\r\n //cari aspek dulu\r\n $sql = \"SELECT vAspekName FROM hrd.pk_aspek WHERE id='\".$iAspekId.\"'\";\r\n $query = $this->db_erp_pk->query($sql);\r\n $vAspekName = $query->row()->vAspekName;\r\n\r\n $html = \"\r\n <table width='750px'>\r\n <tr>\r\n <td><b>Point Untuk Aspek :</b></td>\r\n <td>\".$vAspekName.\"</td>\r\n\r\n </tr>\r\n </table>\";\r\n\r\n $sqPrareg = 'SELECT aa.* FROM (\r\n SELECT z.*\r\n FROM (\r\n SELECT u.vupb_nomor,u.vgenerik, u.iupb_id, u.vupb_nama, e.cNip, e.vName,if(u.ineed_prareg=1,\"YA\", \"TIDAK\") as needPrareg, date(la.dCreate) as tglSettingPrio , if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg) as tanggalSubmit,\r\n ABS(datediff(la.dCreate, if(u.ineed_prareg=1,u.tsubmit_prareg, u.tsubmit_reg))) as selisih,u.iteambusdev_id,Concat(\"2\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc2.plc2_upb_prioritas_detail det on det.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=det.iprioritas_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules \r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort \r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n WHERE u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n AND la.iApprove=2\r\n and mo.vKode_modul=\"PL00002\"\r\n and moa.vDept_assigned=\"DR\"\r\n and moa.iType=3\r\n and moa.iM_activity=4\r\n AND (\r\n case when u.ineed_prareg=1 then\r\n u.tsubmit_prareg is not null\r\n AND u.tsubmit_prareg >= \"'.$perode1.'\"\r\n AND u.tsubmit_prareg <= \"'.$perode2.'\"\r\n ELSE\r\n u.tsubmit_reg is not null\r\n AND u.tsubmit_reg >= \"'.$perode1.'\"\r\n AND u.tsubmit_reg <= \"'.$perode2.'\"\r\n END\r\n )\r\n\r\n UNION\r\n\r\n SELECT u.vupb_nomor,u.vgenerik, u.iupb_id, u.vupb_nama, e.cNip, e.vName,if(u.ineed_prareg=1,\"YA\", \"TIDAK\") as needPrareg, date(la.dCreate) as tglSettingPrio , his.dtanggal as tanggalSubmit,\r\n ABS(datediff(la.dCreate, his.dtanggal)) as selisih,u.iteambusdev_id,Concat(\"2\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc2.plc2_upb_prioritas_detail det on det.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=det.iprioritas_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n JOIN plc2.tanggal_history_prareg_reg his on his.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort \r\n where u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n AND la.iApprove=2\r\n and mo.vKode_modul=\"PL00002\"\r\n and moa.vDept_assigned=\"DR\"\r\n and moa.iType=3\r\n and moa.iM_activity=4\r\n and his.ldeleted=0\r\n #Check Aktivity\r\n and his.id IN (\r\n select na.id_pk from ( \r\n select ta.dtanggal,ta.id as id_pk \r\n FROM plc2.tanggal_history_prareg_reg ta \r\n join plc2.plc2_upb up on up.iupb_id=ta.iupb_id\r\n WHERE ta.ldeleted=0 \r\n AND (case when up.ineed_prareg=1 then\r\n ta.ijenis=1\r\n ELSE\r\n ta.ijenis=2\r\n END) \r\n group by ta.iupb_id \r\n order by ta.id ASC \r\n ) as na\r\n Where na.dtanggal >= \"'.$perode1.'\"\r\n AND na.dtanggal <= \"'.$perode2.'\"\r\n )\r\n ) as z\r\n ORDER BY z.nilai ASC\r\n ) as aa GROUP BY aa.iupb_id\r\n ';\r\n \r\n \r\n $upbPrareg = $this->db_erp_pk->query($sqPrareg)->result_array(); \r\n $html .= \"<table cellspacing='0' cellpadding='3' width='750px'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <th colspan='6' style='text-align: left;border: 1px solid #dddddd;' >Tanggal Submit Prareg / Reg</th> \r\n </tr>\r\n <tr style='width:100%; border: 1px solid #f86609; background: #b5f2a6; border-collapse: collapse;text-align: center;'>\r\n <th>No</th>\r\n <th>No UPB</th>\r\n <th>Nama Generik</th> \r\n <th>Selisih</th> \r\n <th>Melalui Prareg</th> \r\n <th>Tgl Prareg / Reg</th>\r\n <th>Tgl Setting Prioritas</th> \r\n </tr>\r\n \"; \r\n\r\n $cekDouble = array();\r\n\r\n $i=0;\r\n $total_parareg = array();\r\n foreach ($upbPrareg as $ub) {\r\n $selisih = $this->getDurasiBulan($ub['tglSettingPrio'],$ub['tanggalSubmit']);\r\n $i++; \r\n $html .= \"<tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;' >\".$i.\"</td> \r\n <td style='width:5%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vupb_nomor'].\"</td>\r\n <td style='width:25%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vgenerik'].\"</td>\r\n <td style='width:5%;text-align: right;border: 1px solid #dddddd;'>\r\n \".$selisih.\"</td> \r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ub['needPrareg'].\"</td>\r\n <td style='width:10%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ub['tanggalSubmit'].\"</td>\r\n <td style='width:10%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ub['tglSettingPrio'].\"</td>\r\n </tr>\"; \r\n $total_parareg[]=$selisih;\r\n\r\n } \r\n $html .= \"</table><br /> \";\r\n\r\n //-------------------------------------------------------------------------------------- INI REG\r\n\r\n $sqReq = 'SELECT aa.* FROM (\r\n SELECT z.*\r\n FROM (\r\n SELECT u.vupb_nomor,u.vgenerik, u.iupb_id, u.vupb_nama, e.cNip, e.vName,if(u.ineed_prareg=1,\"YA\", \"TIDAK\") as needPrareg, date(la.dCreate) as tglSettingPrio , concat(\"'.$perode2.'\") as tanggalSubmit,\r\n ABS(datediff(la.dCreate, \"'.$perode2.'\")) as selisih,u.iteambusdev_id,Concat(\"2\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc2.plc2_upb_prioritas_detail det on det.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=det.iprioritas_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules \r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort \r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n WHERE u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n AND la.iApprove=2\r\n and mo.vKode_modul=\"PL00002\"\r\n and moa.vDept_assigned=\"DR\"\r\n and moa.iType=3\r\n and moa.iM_activity=4\r\n AND (\r\n case when u.ineed_prareg=1 then\r\n u.tsubmit_prareg is NULL\r\n ELSE\r\n u.tsubmit_reg is null\r\n END\r\n )\r\n ) as z\r\n ORDER BY z.nilai ASC\r\n ) as aa GROUP BY aa.iupb_id\r\n '; \r\n $upbReq = $this->db_erp_pk->query($sqReq)->result_array(); \r\n $html .= \"<table cellspacing='0' cellpadding='3' width='750px'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <th colspan='6' style='text-align: left;border: 1px solid #dddddd;' >UPB Belum Tanggal Prareg / Reg</th> \r\n </tr>\r\n <tr style='width:100%; border: 1px solid #f86609; background: #b5f2a6; border-collapse: collapse;text-align: center;'>\r\n <th>No</th>\r\n <th>No UPB</th>\r\n <th>Nama Generik</th> \r\n <th>Selisih</th> \r\n <th>Melalui Prareg</th> \r\n <th>Tgl Prareg / Reg</th>\r\n <th>Tgl Akhir Semester</th> \r\n </tr>\r\n \"; \r\n $i=0;\r\n foreach ($upbReq as $ur) {\r\n $selisih = $this->getDurasiBulan($ur['tglSettingPrio'],$ur['tanggalSubmit']);\r\n $i++; \r\n $html .= \"<tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;' >\".$i.\"</td> \r\n <td style='width:5%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['vupb_nomor'].\"</td>\r\n <td style='width:25%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['vgenerik'].\"</td>\r\n <td style='width:5%;text-align: right;border: 1px solid #dddddd;'>\r\n \".$selisih.\"</td> \r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ur['needPrareg'].\"</td>\r\n <td style='width:10%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ur['tanggalSubmit'].\"</td>\r\n <td style='width:10%;text-align: center;border: 1px solid #dddddd;'>\r\n \".$ur['tglSettingPrio'].\"</td>\r\n </tr>\"; \r\n $total_parareg[]=$selisih;\r\n\r\n } \r\n $html .= \"</table><br /> \";\r\n\r\n $total=array_sum($total_parareg);\r\n $nn=$total/$i;\r\n $result = number_format($nn);\r\n $getpoint = $this->getPoint($result,$iAspekId);\r\n $x_getpoint = explode(\"~\", $getpoint);\r\n $point = $x_getpoint['0'];\r\n $warna = $x_getpoint['1'];\r\n\r\n\r\n $html .= \"<table align='left' cellspacing='0' cellpadding='3' style='width: 500px;'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;background-color: #3bdeea;'>\r\n <td colspan='2' style='text-align: left;border: 1px solid #dddddd;'></td>\r\n </tr>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Jangka Waktu Proses Pengembangan UPB</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$total.\" Bulan</td>\r\n </tr>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>UPB Belum Tanggal Prareg / Reg</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$i.\"</td>\r\n </tr>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Rata - Rata Jangka Waktu Proses Pengembangan UPB</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$result.\" Bulan</td>\r\n </tr>\r\n \r\n </table><br/><br/>\";\r\n\r\n\r\n echo $result.\"~\".$point.\"~\".$warna.\"~\".$html;\r\n }",
"public function hesapla(){\n\t\t$zirveEsitler = $this->esitPuanlilar( max(array_values($this->points) ), $this->points );\n\t\t\n\t\t// zirve puani\n\t\t$zirvePuan = $this->points[$zirveEsitler[0]];\n\t\t\n\t\t// sampiyonluk sansi olan takimlar\n\t\t$this->yarisanlar = $this->zirveTakibi( $zirvePuan, $this->points, $this->kalanHafta );\n\t\t\n\t\t// yarisanlarin baslangic yuzdesi\n\t\t$yarisanlarYuzdesi = round(100/ count($this->yarisanlar));\n\t\t\n\t\t// zirvedekilerin baslangic yuzdesini ata. Cunku diger takimlarin kayip degeri ustune eklenecek\n\t\tforeach( array_keys($zirveEsitler) as $key )\n\t\t\t$this->yuzde[$key] = (int)$yarisanlarYuzdesi;\n\t\t\t\n\t\tfor( $i = count($this->yarisanlar) -1 ; $i >= count($zirveEsitler) ; $i-- ){\n\t\t\t// zirveden kaybedilen oran\n\t\t\t$kayipOran = ( $zirvePuan - $this->yarisanlar[$i] ) / ( $this->kalanHafta * 3 + 1 );\n\t\t\t\n\t\t\t$kayipPuanDegeri =round( $yarisanlarYuzdesi * $kayipOran); // liderden uzaklasilan puan degeri. Lider bu oran kadar kazanirken,rakip bu kadar kaybetmis\n\t\t\t\n\t\t\t// liderden bu oranda kaybetti\n\t\t\t$this->yuzde[$i] = (int)$yarisanlarYuzdesi - $kayipPuanDegeri; \n\t\t\t\n\t\t\t// zirvedeki takimlara, diger takimlarin kayip orani ekle\n\t\t\tfor( $j = count( $zirveEsitler )-1 ; $j >= 0; $j-- ){\n\t\t\t\t$this->yuzde[$j] += (int)($kayipPuanDegeri / count( $zirveEsitler ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tksort( $this->yuzde );\n\t}",
"function BD2_739_VER01_PARAMETER04($post){\r\n\r\n $iAspekId = $post['_iAspekId'];\r\n $cNipNya = $post['_cNipNya'];\r\n //$cNipNya = 'N09484';\r\n $dPeriode1 = $post['_dPeriode1'];\r\n $x_prd1 = explode(\"-\", $dPeriode1);\r\n $perode1 = $x_prd1['2'].\"-\".$x_prd1['1'].\"-\".$x_prd1['0'];\r\n\r\n $dPeriode2 = $post['_dPeriode2'];\r\n $x_prd2 = explode(\"-\", $dPeriode2);\r\n $perode2 = $x_prd2['2'].\"-\".$x_prd2['1'].\"-\".$x_prd2['0'];\r\n\r\n $jenis = array(1=>'UM',2=>'Claim');\r\n\r\n $bulan = $this->hitung_bulan($perode1,$perode2);\r\n\r\n //cari aspek dulu\r\n $sql = \"SELECT vAspekName FROM hrd.pk_aspek WHERE id='\".$iAspekId.\"'\";\r\n $query = $this->db_erp_pk->query($sql);\r\n $vAspekName = $query->row()->vAspekName;\r\n\r\n $html = \"\r\n <table width='750px'>\r\n <tr>\r\n <td><b>Point Untuk Aspek :</b></td>\r\n <td>\".$vAspekName.\"</td>\r\n\r\n </tr>\r\n </table>\";\r\n\r\n $sqPrareg = 'SELECT aa.* FROM (\r\n SELECT z.*\r\n FROM (\r\n SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, e.cNip, e.vName, date(la.dCreate) as tconfirm_dok_qa , u.tsubmit_prareg ,\r\n ABS(datediff(la.dCreate, u.tsubmit_prareg)) as selisih,u.iteambusdev_id,Concat(\"2\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules \r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort and moa.vDept_assigned=\"QA\"\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n WHERE u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg=1\r\n AND la.iApprove=2\r\n and mo.vKode_modul=\"PL00018\"\r\n AND u.iconfirm_dok_qa = 2 AND u.tsubmit_prareg IS NOT NULL\r\n AND u.tsubmit_prareg >= \"'.$perode1.'\"\r\n AND u.tsubmit_prareg <= \"'.$perode2.'\"\r\n \r\n UNION\r\n \r\n SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, e.cNip, e.vName, date(la.dCreate) as tconfirm_dok_qa , his.dtanggal as tsubmit_prareg ,\r\n ABS(datediff(la.dCreate, his.dtanggal)) as selisih,u.iteambusdev_id, Concat(\"1\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n JOIN plc2.tanggal_history_prareg_reg his on his.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort and moa.vDept_assigned=\"QA\"\r\n where u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg=1\r\n and la.iApprove=2\r\n and la.lDeleted=0\r\n AND u.iconfirm_dok_qa = 2\r\n and mo.vKode_modul=\"PL00018\"\r\n #Check Aktivity\r\n and his.id IN (\r\n select na.id_pk from ( \r\n select ta.dtanggal,ta.id as id_pk \r\n FROM plc2.tanggal_history_prareg_reg ta \r\n WHERE ta.ldeleted=0 \r\n AND ta.ijenis=1 \r\n group by ta.iupb_id \r\n order by ta.id ASC \r\n ) as na\r\n Where na.dtanggal >= \"'.$perode1.'\"\r\n AND na.dtanggal <= \"'.$perode2.'\"\r\n )\r\n ) as z\r\n ORDER BY z.nilai ASC\r\n ) as aa GROUP BY aa.iupb_id\r\n ';\r\n\r\n $upbPrareg = $this->db_erp_pk->query($sqPrareg)->result_array(); \r\n //$html.='<pre>'.$sqPrareg.'</pre>';\r\n $html .= \"<table cellspacing='0' cellpadding='3' width='750px'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <th colspan='7' style='text-align: left;border: 1px solid #dddddd;' >Tanggal Approval QA Manager Cek Dokumen Prareg</th> \r\n </tr>\r\n <tr style='width:100%; border: 1px solid #f86609; background: #b5f2a6; border-collapse: collapse;text-align: center;'>\r\n <th>No</th>\r\n <th>No UPB</th>\r\n <th>Nama UPB</th>\r\n <th>Team Busdev</th>\r\n <th>Approval QA By</th>\r\n <th>Tanggal Approval QA</th>\r\n <th>Tanggal Submit Prareg</th> \r\n <th>Selisih</th> \r\n </tr>\r\n \"; \r\n\r\n $cekDouble = array();\r\n\r\n $i=0;\r\n $sumselisih = 0;\r\n $total_parareg = 0;\r\n foreach ($upbPrareg as $ub) {\r\n $selisih = $this->datediff($ub['tconfirm_dok_qa'],$ub['tsubmit_prareg'],$cNipNya);\r\n\r\n $sqlk =\"SELECT u.`vteam` FROM plc2.`plc2_upb_team` u WHERE u.`ldeleted`=0 AND u.`iteam_id` = '\".$ub['iteambusdev_id'].\"'\";\r\n $kat = $this->db_erp_pk->query($sqlk)->row_array();\r\n if(empty($kat['vteam'])){\r\n $k = '-';\r\n }else{\r\n $k = $kat['vteam'];\r\n }\r\n\r\n $i++; \r\n // array_push($cekDouble,$u['iupb_id']);\r\n $total_parareg++;\r\n $sumselisih += $selisih;\r\n $html .= \"<tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;' >\".$i.\"</td> \r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vupb_nomor'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['vupb_nama'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$k.\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['cNip'].\"-\".$ub['vName'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['tconfirm_dok_qa'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ub['tsubmit_prareg'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$selisih.\"</td>\r\n </tr>\"; \r\n\r\n } \r\n $html .= \"</table><br /> \";\r\n\r\n //-------------------------------------------------------------------------------------- INI REG\r\n\r\n $sqReq = 'SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, e.cNip, e.vName, date(u.tconfirm_registrasi_qa) as tconfirm_registrasi_qa, u.tsubmit_reg , ABS(datediff(u.tconfirm_registrasi_qa, u.tsubmit_reg )) as selisih,u.iteambusdev_id\r\n FROM plc2.plc2_upb u \r\n JOIN hrd.employee e on e.cNip = u.cnip_confirm_registrasi_qa\r\n where u.`ldeleted` = 0 AND u.`iteambusdev_id` = 22 \r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg=0\r\n AND u.iconfirm_registrasi_qa = 1 AND u.tsubmit_reg IS NOT NULL\r\n AND u.`tsubmit_reg` >= \"'.$perode1.'\"\r\n AND u.`tsubmit_reg` <= \"'.$perode2.'\"\r\n ';\r\n $sqReq = 'SELECT aa.* FROM (\r\n SELECT z.*\r\n FROM (\r\n SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, e.cNip, e.vName, date(la.dCreate) as tconfirm_registrasi_qa , u.tsubmit_reg ,\r\n ABS(datediff(la.dCreate, u.tsubmit_reg)) as selisih,u.iteambusdev_id,Concat(\"2\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules \r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort and moa.vDept_assigned=\"QA\"\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n WHERE u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg=0\r\n AND la.iApprove=2\r\n and mo.vKode_modul=\"PL00029\"\r\n AND u.iconfirm_registrasi_qa = 2 AND u.tsubmit_reg IS NOT NULL\r\n AND u.tsubmit_reg >= \"'.$perode1.'\"\r\n AND u.tsubmit_reg <= \"'.$perode2.'\"\r\n \r\n UNION\r\n \r\n SELECT u.vupb_nomor, u.iupb_id, u.vupb_nama, e.cNip, e.vName, date(la.dCreate) as tconfirm_registrasi_qa ,his.dtanggal as tsubmit_reg ,\r\n ABS(datediff(la.dCreate, his.dtanggal)) as selisih,u.iteambusdev_id,Concat(\"1\") as nilai\r\n FROM plc2.plc2_upb u\r\n JOIN plc3.m_modul_log_activity la on la.iKey_id=u.iupb_id\r\n JOIN plc3.m_modul mo on mo.idprivi_modules=la.idprivi_modules\r\n JOIN hrd.employee e on e.cNip = la.cCreated\r\n JOIN plc2.tanggal_history_prareg_reg his on his.iupb_id=u.iupb_id\r\n JOIN plc3.m_modul_activity moa on moa.iM_modul=mo.iM_modul and moa.iM_activity=la.iM_activity and la.iSort=moa.iSort and moa.vDept_assigned=\"QA\"\r\n where u.ldeleted = 0 AND la.lDeleted=0 AND mo.lDeleted=0 AND moa.lDeleted=0\r\n AND u.iteambusdev_id = 22 \r\n #AND u.istatus = 7\r\n AND u.iappdireksi = 2\r\n AND u.itipe_id <> 6\r\n and u.ineed_prareg=0\r\n and la.iApprove=2\r\n and la.lDeleted=0\r\n AND u.iconfirm_registrasi_qa = 2\r\n and mo.vKode_modul=\"PL00029\"\r\n #Check Aktivity\r\n and his.id IN (\r\n select na.id_pk from ( \r\n select ta.dtanggal,ta.id as id_pk \r\n FROM plc2.tanggal_history_prareg_reg ta \r\n WHERE ta.ldeleted=0 \r\n AND ta.ijenis=2 \r\n group by ta.iupb_id \r\n order by ta.id ASC \r\n ) as na\r\n Where na.dtanggal >= \"'.$perode1.'\"\r\n AND na.dtanggal <= \"'.$perode2.'\"\r\n )\r\n ) as z\r\n ORDER BY z.nilai ASC\r\n ) as aa GROUP BY aa.iupb_id\r\n ';\r\n //$html.='<pre>'.$sqReq.'</pre>';\r\n $upbReq = $this->db_erp_pk->query($sqReq)->result_array(); \r\n $html .= \"<table cellspacing='0' cellpadding='3' width='750px'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <th colspan='7' style='text-align: left;border: 1px solid #dddddd;' >Tanggal Approval QA Manager Cek Dokumen Registrasi</th> \r\n </tr>\r\n <tr style='width:100%; border: 1px solid #f86609; background: #b5f2a6; border-collapse: collapse;text-align: center;'>\r\n <th>No</th>\r\n <th>No UPB</th>\r\n <th>Nama UPB</th>\r\n <th>Team Busdev</th>\r\n <th>Approval QA By</th>\r\n <th>Tanggal Approval QA</th>\r\n <th>Tanggal Submit Registrasi</th> \r\n <th>Selisih</th> \r\n </tr>\r\n \"; \r\n $i=0;\r\n $total_req=0;\r\n $kurangTotal = 0;\r\n foreach ($upbReq as $ur) {\r\n $sqlk =\"SELECT u.`vteam` FROM plc2.`plc2_upb_team` u WHERE u.`ldeleted`=0 AND u.`iteam_id` = '\".$ur['iteambusdev_id'].\"'\";\r\n $kat = $this->db_erp_pk->query($sqlk)->row_array();\r\n if(empty($kat['vteam'])){\r\n $k = '-';\r\n }else{\r\n $k = $kat['vteam'];\r\n }\r\n\r\n $i++; \r\n $total_req++;\r\n if (in_array($ur['iupb_id'], $cekDouble)) {\r\n $kurangTotal++;\r\n }\r\n\r\n $selisih = $this->datediff($ur['tconfirm_registrasi_qa'],$ur['tsubmit_reg'],$cNipNya);\r\n\r\n $sumselisih += $selisih;\r\n $html .= \"<tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:5%;text-align: center;border: 1px solid #dddddd;' >\".$i.\"</td> \r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['vupb_nomor'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['vupb_nama'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$k.\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['cNip'].\"-\".$ur['vName'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['tconfirm_registrasi_qa'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$ur['tsubmit_reg'].\"</td>\r\n <td style='width:10%;text-align: left;border: 1px solid #dddddd;'>\r\n \".$selisih.\"</td>\r\n </tr>\"; \r\n\r\n } \r\n $html .= \"</table><br /> \";\r\n\r\n $totalUpb = $total_req + $total_parareg; \r\n $jumlahUpb = $totalUpb - $kurangTotal;\r\n if($sumselisih==0){\r\n $tot = 0;\r\n }else{\r\n $tot = $sumselisih / $totalUpb;\r\n $tot = $tot/5;\r\n }\r\n $result = number_format($tot,2);\r\n $getpoint = $this->getPoint($result,$iAspekId);\r\n $x_getpoint = explode(\"~\", $getpoint);\r\n $point = $x_getpoint['0'];\r\n $warna = $x_getpoint['1'];\r\n\r\n\r\n $html .= \"<table align='left' cellspacing='0' cellpadding='3' style='width: 500px;'>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;background-color: #3bdeea;'>\r\n <td colspan='2' style='text-align: left;border: 1px solid #dddddd;'></td>\r\n </tr>\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Total UPB Prareg & Reg</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$totalUpb.\" </td>\r\n </tr>\r\n\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Jumlah Selisih (Hari)</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".number_format($sumselisih).\" </td>\r\n </tr>\r\n\r\n <tr style='border: 1px solid #dddddd; border-collapse: collapse;'>\r\n <td style='width:150px;text-align: left;border: 1px solid #dddddd;'>Rata- Rata (Minggu)</td>\r\n <td style='width:100px;text-align: right;border: 1px solid #dddddd;'>\".$result.\" Minggu</td>\r\n </tr>\r\n\r\n </table><br/><br/>\";\r\n\r\n\r\n echo $result.\"~\".$point.\"~\".$warna.\"~\".$html;\r\n }",
"Private Function TarianWaggle($i){\n\t\t//Lakukan perulangan untuk setiap lebah nonaktif\n\t\tFor ($ii = 0; $ii <= $this->totalLebahNonaktif - 1; $ii++){\n\t\t\t$b = $this->daftarindeksLebahNonaktif[$ii]; \t\t\t\t\t\t//indeks lebah nonaktif\n\t\t\tIf ($this->daftarLebah[$b]->status <> 0){\n\t\t\t\tThrow New Exception(\"Terjadi kesalahan: lebah ini bukan lebah nonaktif\");\n\t\t\t}\n\t\t\tIf ($this->daftarLebah[$b]->jumlahPerjalanan <> 0){\n\t\t\t\tThrow New Exception(\"Terjadi kesalahan: ditemukan lebah nonaktif dengan jumlah perjalanan tidak sama dengan 0\");\n\t\t\t}\n\n\t\t\t//Jika jalur lebah pencari lebih baik dari jalur lebah nonaktif\n\t\t\t//Cari nilai acak untuk dibandingkan dengan probabilitas terbujuk\n\t\t\t//Jika nilai acak tersebut kurang dari probabilitas terbujuk, maka ambil jalur dari lebah pencari sebagai jalur lebah nonaktif\n\t\t\tIf ($this->daftarLebah[$i]->nilaiJalur < $this->daftarLebah[$b]->nilaiJalur){\n\t\t\t\t$p = rand() / getrandmax();\n\t\t\t\tIf ($this->probTerbujuk > $p){ \t\t\t\t\t\t//apakah lebah nonAktif akan terbujuk oleh lebah pencari? (biasanya terbujuk, karena nilai probTerbujuk sangat tinggi, ~0.90)\n\t\t\t\t\t$this->daftarLebah[$b]->jalur = $this->daftarLebah[$i]->jalur;\n\t\t\t\t\t$this->daftarLebah[$b]->nilaiJalur = $this->daftarLebah[$i]->nilaiJalur;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function separarCaracteristicas($array_caracteristicas_ordenadas,$longitude_de_array){\n\t$array_de_lineas = file(\"config/config.txt\");\n\t$numeroCaracteristicas = count($array_de_lineas);\n\tfor ($i=0; $i < $numeroCaracteristicas; $i++) { \n\t\t ${'array_caracteristica'.$i} = array();\n\t}\n\t// print_r($array_caracteristica0);\n\t// print_r($array_caracteristica1);\n\t// print_r($array_caracteristica2);\n\t$array_sexo = array();\n\t$array_pelo = array();\n\t$array_gafas = array();\n\tfor ($i=0; $i <$longitude_de_array ; $i++) { \n\t\t$x = preg_split(\"/,/\", $array_caracteristicas_ordenadas[$i]);\n\t\t$count = count($x);\n\t\tfor ($q=0; $q < $count; $q++) { \n\t\t\t${\"variable_caracteristica\".$q} = $x[$q];\n\t\t\tarray_push(${\"array_caracteristica\".$q},${\"variable_caracteristica\".$q});\n\t\t\t// print_r($array_caracteristica0);\n\t\t\t// print_r($array_caracteristica1);\n\t\t\t// print_r($array_caracteristica2);\n\t\t}\n\t\t$var_guardarSexo = $x[0];\n\t\t$var_guardarPelo = $x[1];\n\t\t$var_guardarGafas = $x[2];\n\t\tarray_push($array_sexo,$var_guardarSexo);\n\t\tarray_push($array_pelo,$var_guardarPelo);\n\t\tarray_push($array_gafas,$var_guardarGafas);\n\t}\n\tfor ($i=0; $i < $numeroCaracteristicas; $i++) { \n\t\t ${'array_caracteristica'.$i.\"U\"} = array();\n\t}\n\t$array_sexoU = array();\n\t$array_peloU = array();\n\t$array_gafasU = array();\n\tfor ($i=0; $i <$longitude_de_array ; $i++) { \n\t\tfor ($q=0; $q < $count; $q++) { \n\t\t\t${\"split\".$q} = preg_split(\"/ /\", ${\"array_caracteristica\".$q}[$i]);\n\t\t\t${\"variable_caracteristica\".$q.\"U\"} = ${\"split\".$q}[2];\n\t\t\tarray_push(${\"array_caracteristica\".$q.\"U\"},${\"variable_caracteristica\".$q.\"U\"});\n\t\t\t// print_r($array_caracteristica0U);\n\t\t\t// print_r($array_caracteristica1U);\n\t\t\t// print_r($array_caracteristica2U);\n\t\t}\n\t\t$s = preg_split(\"/ /\", $array_sexo[$i]);\n\t\t$p = preg_split(\"/ /\", $array_pelo[$i]);\n\t\t$g = preg_split(\"/ /\", $array_gafas[$i]);\n\t\t$var_guardarSexoU = $s[2];\n\t\t$var_guardarPeloU = $p[2];\n\t\t$var_guardarGafasU = $g[2];\n\t\t//Con la funcion trim estoy eliminando el \\n del final de linea.\n\t\t$var_guardarGafasUTrimmed = trim($var_guardarGafasU, \" \\n\");\n\t\t$var_guardarGafasUTrimmed = preg_replace('/\\s+/', '', $var_guardarGafasU);\n\t\tarray_push($array_sexoU,$var_guardarSexoU);\n\t\tarray_push($array_peloU,$var_guardarPeloU);\n\t\tarray_push($array_gafasU,$var_guardarGafasUTrimmed);\n\t}\n\t//Aqui al separar todas las caracteristicas, contruimos otro array similar a una imagen en HTML para introducir por separado las caracteristicas.\n\t$array_nombres_caracteristicas = leerConfigYSacarNombres();\n\t($array_nombres_caracteristicas);\n\t$array_caracteristicas_completas_img = array();\n\t$text = \"<img class='img'>\";\n\t$array_caracteristicas_completas_img = array();\n\tfor ($i=0; $i <$longitude_de_array ; $i++) { \n\t\t$text = \"<img class='img' sexo='$array_sexoU[$i]' pelo='$array_peloU[$i]' gafas='$array_gafasU[$i]' \";\n\t\tarray_push($array_caracteristicas_completas_img,$text);\n\t}\n\treturn $array_caracteristicas_completas_img;\n}",
"function ghep2($arr){\n // co phai array khong\n if(is_array($arr)){\n // test array cap 2\n if(testArray2($arr)){\n // lay ra array con trong bien truyen vao\n foreach($arr as $key=>$value){\n // duyet cac mang con\n foreach($value as $key2=>$value2){\n // tim mang chua phan tu con\n if(is_array($value2)){\n // nếu là lần đầu sẽ là thay thế giá trị mảng bằng phần tử của nó\n if($key2 == 0){\n // tao bien moi co gia tri giong $arr\n $result = $arr;\n // thay the gia tri tai vi tri $key bang gia tri moi khong phai mang $value2\n $result[$key] = $value2; \n return $result;\n }else{\n // neu khong phai la lan dau thi chen\n // them phan tu mới tại vị trí có key = $key + 1 + $key2\n $keyChen = $key + 1 + $key2;\n $result = chenArray($result,$keyChen,$value2);\n return $result;\n }\n \n \n \n\n\n\n }\n }\n }\n }\n }\n }",
"private function generateNilaiAkhir($thn_ajaran = NULL, $smt = NULL, $kode_kel = NULL, $nbi = NULL) {\r\n if ( !$this->session->userdata('isLecturerTps') && !$this->session->userdata('isAdminTps') ) {\r\n redirect('public/home','refresh');\r\n }\r\n\r\n $dataFilter = [\r\n 'thn_ajaran' => $thn_ajaran,\r\n 'smt' => $smt,\r\n 'kode_kel' => $kode_kel,\r\n 'nbi' => $nbi\r\n ];\r\n\r\n $dataAnggota = $this->M_anggota->getAnggota($dataFilter)->row();\r\n\r\n if ( $dataAnggota ) {\r\n \r\n $setting = $this->M_setting->getSetting()->row();\r\n\r\n // Bobot masing masing nilai\r\n $bobot_bimbingan = $setting->bobot_bimbingan;\r\n $bobot_moderator = $setting->bobot_moderator;\r\n $bobot_penguji1 = $setting->bobot_penguji1;\r\n $bobot_penguji2 = $setting->bobot_penguji2;\r\n $kom_a = $setting->kom_a;\r\n $kom_b = $setting->kom_b;\r\n $kom_c = $setting->kom_c;\r\n $kom_d = $setting->kom_d;\r\n // Bobot masing masing nilai\r\n\r\n // nilai bimbingan\r\n $bimb = ( $bobot_bimbingan/100 ) * $dataAnggota->nilai_bimb;\r\n // nilai bimbingan\r\n\r\n // nilai moderator\r\n $kom_a_mod = ( $kom_a/100 ) * $dataAnggota->nilai_11;\r\n $kom_b_mod = ( $kom_b/100 ) * $dataAnggota->nilai_12;\r\n $kom_c_mod = ( $kom_c/100 ) * $dataAnggota->nilai_13;\r\n $kom_d_mod = ( $kom_d/100 ) * $dataAnggota->nilai_14;\r\n\r\n $tot_mod = ( $kom_a_mod + $kom_b_mod + $kom_c_mod + $kom_d_mod ) * ( $bobot_moderator/100 );\r\n // nilai moderator\r\n \r\n // nilai penguji 1\r\n $kom_a_p1 = ( $kom_a/100 ) * $dataAnggota->nilai_21;\r\n $kom_b_p1 = ( $kom_b/100 ) * $dataAnggota->nilai_22;\r\n $kom_c_p1 = ( $kom_c/100 ) * $dataAnggota->nilai_23;\r\n $kom_d_p1 = ( $kom_d/100 ) * $dataAnggota->nilai_24;\r\n\r\n $tot_p1 = ( $kom_a_p1 + $kom_b_p1 + $kom_c_p1 + $kom_d_p1 ) * ( $bobot_penguji1/100 );\r\n // nilai penguji 1\r\n \r\n // nilai penguji 2\r\n $kom_a_p2 = ( $kom_a/100 ) * $dataAnggota->nilai_31;\r\n $kom_b_p2 = ( $kom_b/100 ) * $dataAnggota->nilai_32;\r\n $kom_c_p2 = ( $kom_c/100 ) * $dataAnggota->nilai_33;\r\n $kom_d_p2 = ( $kom_d/100 ) * $dataAnggota->nilai_34;\r\n\r\n $tot_p2 = ( $kom_a_p2 + $kom_b_p2 + $kom_c_p2 + $kom_d_p2 ) * ( $bobot_penguji2/100 );\r\n // nilai penguji 2\r\n\r\n // Perhitungan nilai kahir\r\n $totalNilai = $bimb + $tot_mod + $tot_p1 + $tot_p2;\r\n // Perhitungan nilai kahir\r\n \r\n $dataUpdate = ['nilai_akhir' => $totalNilai];\r\n $updateNilaiAkhir = $this->M_anggota->update($thn_ajaran,$smt,$kode_kel,$nbi,$dataUpdate);\r\n\r\n if ( $updateNilaiAkhir ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n } else {\r\n return false;\r\n }\r\n\r\n }",
"function ambil_peg_pengawas($koneksi,$nama_tabel,$kd_fakultas, $kd_jabatan){\n\t//echo \"nama_tabel : \".$nama_tabel.\" <br>\";\n\t//echo \"nama_tabel2 : \".$nama_tabel2.\" <br>\";\n\t//echo \"kd_thn_ajaran : \".$kd_thn_ajaran.\" <br>\";\n\t//echo \"kel : \".$kel.\" <br>\";\n\n\t$baca_nama_tabel = mysqli_query($koneksi,\"SELECT p.`NIP`,p.`NAMAPEGAWAI` FROM $nama_tabel AS p \"\n\t.\"WHERE p.`KODEJABATAN`='$kd_jabatan' AND p.`KODEFAKULTAS`= '$kd_fakultas' \"\n\t.\"ORDER BY p.`NAMAPEGAWAI` ASC\");\t\n\t\n\t$matNama_Tabel_php = array();\n\t$nNama_Tabel_php = 0;\n\twhile($row = mysqli_fetch_row($baca_nama_tabel)){\n\t\t\t$matNama_Tabel_php[$nNama_Tabel_php] = $row;\n\t\t\t$nNama_Tabel_php++;\n\t\t\t} \t\n\treturn $matNama_Tabel_php;\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/========== taxonomy for Modules ========== | function modules_taxonomy() {
$labels = array(
'name' => _x( 'modules', 'Taxonomy General Name', 'text_domain' ),
'singular_name' => _x( 'Module', 'Taxonomy Singular Name', 'text_domain' ),
'menu_name' => __( 'Lesson Modules', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'parent_item' => __( 'Parent Item', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'new_item_name' => __( 'New Item Name', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update Item', 'text_domain' ),
'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
'search_items' => __( 'Search Items', 'text_domain' ),
'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),
'choose_from_most_used' => __( 'Choose from the most used items', 'text_domain' ),
'not_found' => __( 'Not Found', 'text_domain' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
);
register_taxonomy( 'modules', array( 'lessons_post' ), $args );
} | [
"public function setup_modules_taxonomy(){\n\n $labels = array(\n 'name' => __('Modules', 'woothemes-sensei'),\n 'singular_name' => __('Module', 'woothemes-sensei'),\n 'search_items' => __('Search Modules', 'woothemes-sensei'),\n 'all_items' => __('All Modules', 'woothemes-sensei'),\n 'parent_item' => __('Parent Module', 'woothemes-sensei'),\n 'parent_item_colon' => __('Parent Module:', 'woothemes-sensei'),\n 'edit_item' => __('Edit Module', 'woothemes-sensei'),\n 'update_item' => __('Update Module', 'woothemes-sensei'),\n 'add_new_item' => __('Add New Module', 'woothemes-sensei'),\n 'new_item_name' => __('New Module Name', 'woothemes-sensei'),\n 'menu_name' => __('Modules', 'woothemes-sensei'),\n );\n\n /**\n * Filter to alter the Sensei Modules rewrite slug\n *\n * @since 1.8.0\n * @param string default 'modules'\n */\n $modules_rewrite_slug = apply_filters('sensei_module_slug', 'modules');\n\n $args = array(\n 'public' => true,\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'capabilities' => array(\n 'manage_terms' => 'manage_categories',\n 'edit_terms' => 'edit_courses',\n 'delete_terms' => 'manage_categories',\n 'assign_terms' => 'edit_courses'\n ),\n 'show_in_nav_menus' => false,\n 'show_in_quick_edit' => false,\n 'show_ui' => true,\n 'rewrite' => array('slug' => $modules_rewrite_slug ),\n 'labels' => $labels\n );\n\n register_taxonomy( 'module' , array('course', 'lesson'), $args);\n\n }",
"public function module_type();",
"function registerTaxonomy()\n{\n\n // Use GenerateWP for generating code for custom taxonomy\n // https://generatewp.com/taxonomy/\n}",
"public static function registerTaxonomy()\n {\n }",
"public function registerTaxonomy();",
"function suffusion_set_custom_taxonomy_globals() {\r\n\tglobal $suffusion_taxonomy_options, $suffusion_taxonomy_labels, $suffusion_taxonomy_args;\r\n\t$suffusion_taxonomy_options = array(\r\n\t\tarray('name' => 'taxonomy', 'type' => 'text', 'desc' => 'Taxonomy (e.g. genres)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'object_type', 'type' => 'text', 'desc' => 'Applicable to post types (comma-separated list e.g. book, movie)', 'std' => '', 'reqd' => true),\r\n\t);\r\n\r\n\t$suffusion_taxonomy_labels = array(\r\n\t\tarray('name' => 'name', 'type' => 'text', 'desc' => 'Name (e.g. Genres)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'singular_name', 'type' => 'text', 'desc' => 'Singular Name (e.g. Genre)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'search_items', 'type' => 'text', 'desc' => 'Text for \"Search Items\" (e.g. Search Genres)', 'std' => ''),\r\n\t\tarray('name' => 'popular_items', 'type' => 'text', 'desc' => 'Text for \"Popular Items\" (e.g. Popular Genres)', 'std' => ''),\r\n\t\tarray('name' => 'all_items', 'type' => 'text', 'desc' => 'Text for \"All Items\" (e.g. All Genres)', 'std' => ''),\r\n\t\tarray('name' => 'parent_item', 'type' => 'text', 'desc' => 'Parent Item (e.g. Parent Genre)', 'std' => ''),\r\n\t\tarray('name' => 'parent_item_colon', 'type' => 'text', 'desc' => 'Parent Item Colon (e.g. Parent Genre:)', 'std' => ''),\r\n\t\tarray('name' => 'edit_item', 'type' => 'text', 'desc' => 'Text for \"Edit Item\" (e.g. Edit Genre)', 'std' => ''),\r\n\t\tarray('name' => 'update_item', 'type' => 'text', 'desc' => 'Text for \"Update Item\" (e.g. Update Genre)', 'std' => ''),\r\n\t\tarray('name' => 'add_new_item', 'type' => 'text', 'desc' => 'Text for \"Add New Item\" (e.g. Add New Genre)', 'std' => ''),\r\n\t\tarray('name' => 'new_item_name', 'type' => 'text', 'desc' => 'Text for \"New Item Name\" (e.g. New Genre Name)', 'std' => ''),\r\n\t);\r\n\r\n\t$suffusion_taxonomy_args = array(\r\n\t\tarray('name' => 'public', 'desc' => 'Public', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'show_ui', 'desc' => 'Show UI', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'show_tagcloud', 'desc' => 'Show in Tagcloud widget', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'hierarchical', 'desc' => 'Hierarchical', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'rewrite', 'desc' => 'Rewrite', 'type' => 'checkbox', 'default' => true),\r\n\t);\r\n}",
"function init()\n{\n register_extended_taxonomy(\n 'pcc-role',\n 'pcc-person',\n [\n 'show_in_rest' => false,\n 'required' => true,\n ],\n [\n 'singular' => __('Role', 'pcc-framework'),\n 'plural' => __('Roles', 'pcc-framework'),\n 'slug' => __('role', 'pcc-framework'),\n ]\n );\n}",
"function mycuma_define_taxononomy_actu() {\n\n $labels = array(\n 'name' => 'Types Actualites',\n 'singular_name' => 'type',\n 'all_items' => 'tous les types',\n 'edit_item' => 'modifier le type',\n 'update_item' => 'mettre à jour le type',\n 'add_new_item' => 'ajouter un type',\n 'search_items' => 'Rechercher dans les types',\n 'new_item_name' => 'nouveau nom du type',\n 'menu_name' => 'types des actualités'\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'hierarchical' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'actu'),\n 'show_admin_column' => true\n );\n\n register_taxonomy('type_actu', 'mycuma_actualite', $args);\n}",
"protected function taxonomy() {\n\t\t\n\t\tif( !empty($this->action_vars) ) {\n\t\t\t/*\n\t\t\t * First element of action_vars is action of taxonomy block \n\t\t\t * Second element, if exists, contain \"id\" of taxonomy item \n\t\t\t * ( \".../polls/taxonomy/$taxonomy_action/$taxonomy_id\" )\n\t\t\t */\n\t\t\t$taxonomy_action = $this->action_vars[0];\n\t\t\t$taxonomy_id = $this->action_vars[1];\n\t\t\t\n\t\t\tswitch( $taxonomy_action ) {\n\t\t\t\t//View polls in this taxonomy\n\t\t\t\tcase \"view\":\n\t\t\t\t\t$this->view_taxonomy( $taxonomy_id );\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Create new taxonomy ( only for category)\n\t\t\t\tcase \"new\":\n\t\t\t\t\t$this->new_category();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Edit taxonomy \n\t\t\t\tcase \"edit\":\n\t\t\t\t\t$this->edit_taxonomy( $taxonomy_id );\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//List of all taxonomies\t\n\t\t\t\tdefault:\n\t\t\t\t\t$this->list_taxonomy();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->list_taxonomy();\n\t\t}\n\t\t\n\t}",
"function artists_taxonomy() {\n\n /** plural title */\n $pt = 'هنرمندان';\n\n /** single title */\n $st = 'هنرمند';\n\n $cat_name = 'wikinode';\n $tag_name = 'wiki-tag';\n\n $labels = array(\n 'name' => _x( $pt, 'Taxonomy General Name', 'nava' ),\n 'singular_name' => _x( $st, 'Taxonomy Singular Name', 'nava' ),\n 'menu_name' => __( 'دسته بندی '.$pt, 'nava' ),\n 'all_items' => __( 'همه دسته بندی ها', 'nava' ),\n 'add_new_item' => __( 'افزودن دسته بندی جدید', 'nava' ),\n 'edit_item' => __( 'ویرایش دسته بندی', 'nava' ),\n 'update_item' => __( 'به روز رسانی دسته بندی', 'nava' ),\n 'view_item' => __( 'نمایش دسته بندی', 'nava' ),\n 'add_or_remove_items' => __( 'افزودن و یا حذف دسته بندی', 'nava' ),\n 'choose_from_most_used' => __( 'انتخاب از بین محبوب ترین ها', 'nava' ),\n 'popular_items' => __( 'دسته بندی های محبوب', 'nava' ),\n 'search_items' => __( 'جستجو دسته بندی ها', 'nava' ),\n 'not_found' => __( 'یافت نشد!', 'nava' ),\n 'no_terms' => __( 'دسته بندی وجود ندارد', 'nava' ),\n 'items_list' => __( 'لیست دسته بندی ها', 'nava' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n // 'rewrite' => array('slug' => 'music')\n\n );\n /* */\n $tag_labels = array(\n 'name' => _x( $pt, 'Taxonomy General Name', 'nava' ),\n 'singular_name' => _x( $st, 'Taxonomy Singular Name', 'nava' ),\n 'menu_name' => __( 'برچسب '.$pt, 'nava' ),\n 'all_items' => __( 'همه برچسب ها', 'nava' ),\n 'add_new_item' => __( 'افزودن برچسب جدید', 'nava' ),\n 'edit_item' => __( 'ویرایش برچسب', 'nava' ),\n 'update_item' => __( 'به روز رسانی برچسب', 'nava' ),\n 'view_item' => __( 'نمایش برچسب', 'nava' ),\n 'add_or_remove_items' => __( 'افزودن و یا حذف برچسب', 'nava' ),\n 'choose_from_most_used' => __( 'انتخاب از بین محبوب ترین ها', 'nava' ),\n 'popular_items' => __( 'برچسب های محبوب', 'nava' ),\n 'search_items' => __( 'جستجو برچسب ها', 'nava' ),\n 'not_found' => __( 'یافت نشد!', 'nava' ),\n 'no_terms' => __( 'برچسب وجود ندارد', 'nava' ),\n 'items_list' => __( 'لیست برچسب ها', 'nava' ),\n );\n $tag_args = array(\n 'labels' => $tag_labels,\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n //'rewrite' => array('slug' => 'music')\n\n );\n register_taxonomy( $cat_name, array( 'wiki' ), $args );\n register_taxonomy( $tag_name, array( 'wiki' ), $tag_args );\n\n}",
"function resource_custom_taxonomies(){\n\t// register_taxonomy('use_case', array( 'case_study','product_info','report','video','webinar' ), array(\n\tregister_taxonomy('use_case', array( 'case_study','product_info','white_paper','video' ), array(\n\t\t'labels' => array(\n\t\t\t'name' => 'Use Case',\n\t\t\t'singular_name' => 'Use Case',\n\t\t\t'menu_name' => 'Use Cases',\n\t\t\t'all_items' => 'All Use Cases',\n\t\t\t'parent_item' => 'Parent Use Case',\n\t\t\t'parent_item_colon' => 'Parent Use Case:',\n\t\t\t'new_item_name' => 'New Use Case',\n\t\t\t'add_new_item' => 'Add New Use Case',\n\t\t\t'edit_item' => 'Edit Use Case',\n\t\t\t'update_item' => 'Update Use Case',\n\t\t\t'separate_items_with_commas' => 'Separate Use Cases with commas',\n\t\t\t'search_items' => 'Search Use Cases',\n\t\t\t'add_or_remove_items' => 'Add or remove Use Cases',\n\t\t\t'choose_from_most_used' => 'Choose from the most common Use Cases'\n\t\t),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_tagcloud' => true,\n\t\t'rewrite' => array(\n\t\t\t'slug' => '/',\n\t\t\t'with_front' => false,\n\t\t\t'hierarchical' => true\n\t\t\t)\n\t\t)\n\t);\n\n}",
"public function setup_default_terms() {\n\n\t\t$modules = cur_get_modules();\n\n\t\t// Check for all enabled modules, add or delete terms as necessary\n\t\t$terms = get_terms( $this->tax_slug, array( 'hide_empty' => false ) );\n\n\t\tforeach ( $modules as $module => $module_info ) {\n\n\t\t\t// For enabled modules check to see if the term exists, if it doesn't add it\n\t\t\tif ( ! empty( $module_info['enabled'] ) && true === $module_info['enabled'] ) {\n\n\t\t\t\t// Check to see if we have this term already\n\t\t\t\t$module_term = get_term_by( 'slug', $module_info['slug'], $this->tax_slug );\n\n\t\t\t\t// If we don't have it then let's add it\n\t\t\t\tif ( false === $module_term && ! is_wp_error( $module_term ) ) {\n\t\t\t\t\twp_insert_term( $module_info['slug'], $this->tax_slug );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function installTaxonomy() {\n // This creates 12 taxonomy terms.\n $file = DRUPAL_ROOT . '/' . drupal_get_path('module', 'workbench_access') . \"/workbench_access.drush.inc\";\n require_once $file;\n drush_workbench_access_test();\n }",
"function register_taxonomies() {\n\t\t// Load plugin options\n\t\t$cp_options = cp_get_options();\n\n\t\t// Check if debug mode is enabled\n\t\t$cp_debug_mode = ( isset( $cp_options['debug_mode'] ) && $cp_options['debug_mode'] == 'enabled' ) ? true : false;\n\n\t\t// Groups. Todo: abstract this to the groups class\n\t\tregister_taxonomy( 'cp-bp-group', 'cp-projects', array(\n\t\t\t'label' \t=> 'BP Groups',\n\t\t\t'public' \t=> $cp_debug_mode,\n\t\t\t'query_var' \t=> 'cp-bp-group'\n\t\t) );\n\n\t}",
"function content_create_glossary_taxonomy(){\r\n if(!taxonomy_exists('alpha_cat')){\r\n register_taxonomy('alpha_cat',array('glossary'),array(\r\n 'show_ui' => false\r\n ));\r\n }\r\n}",
"function nature_taxonomies_project() {\n\t\t$project_type_labels = array(\n\t\t\t'name' => __('Project Types','nature'),\n\t\t\t'singular_name' => __('Project Type','nature'),\n\t\t\t'search_items' => __('Search Project Types','nature'),\n\t\t\t'all_items' => __('All Project Types','nature'),\n\t\t\t'parent_item' => __('Parent Project Type','nature'),\n\t\t\t'parent_item_colon' =>__('Parent Project Type:','nature'),\n\t\t\t'edit_item' => __('Edit Project Type','nature'),\n\t\t\t'update_item' => __('Update Project Type','nature'),\n\t\t\t'add_new_item' => __('Add New Project Type','nature'),\n\t\t\t'new_item_name' => __('Project Type Name','nature'),\n\t\t\t'menu_name' => __('Project Types','nature')\n\t\t);\nregister_taxonomy(\n\t'project_type',\n\t'project',\n\t\tarray(\n\t\t'hierarchical' => true,\n\t\t'labels' => $project_type_labels,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'project-type','nature')\n\t\t)\n\t);\n}",
"public function add_custom_taxonomy() {\n //http://code.tutsplus.com/articles/custom-post-type-helper-class--wp-25104\n }",
"function eman_register_taxonomy_site()\n{\n\tregister_taxonomy( 'em_status',\n\t\tarray('em_noc', 'em_tickets', 'em_dcr', 'em_reviews', 'em_issue', 'em_letter'),\n\t\tarray(\n\t\t\t'hierarchical' => true,\n\t\t\t'labels' => array(\n\t\t\t\t'name' => 'Statuses',\n\t\t\t\t'singular_name' => 'Status',\n\t\t\t\t'search_items' => 'Search Status',\n\t\t\t\t'all_items' => 'All Statuses',\n\t\t\t\t'parent_item' => 'Parent Status',\n\t\t\t\t'parent_item_colon' => 'Parent Status:',\n\t\t\t\t'edit_item' => 'Edit Status',\n\t\t\t\t'update_item' => 'Update Status',\n\t\t\t\t'add_new_item' => 'Add New Status',\n\t\t\t\t'new_item_name' => 'Status Name',\n\t\t\t),\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t)\n\t);\n\n\tregister_taxonomy( 'em_clboxes',\n\t\tarray('em_checklist'),\n\t\tarray(\n\t\t\t'hierarchical' => true,\n\t\t\t'labels' => array(\n\t\t\t\t'name' => 'Checklist Boxes',\n\t\t\t\t'singular_name' => 'Checklist Box',\n\t\t\t\t'search_items' => 'Search Checklist Box',\n\t\t\t\t'all_items' => 'All Checklist Boxes',\n\t\t\t\t'parent_item' => 'Parent Checklist Box',\n\t\t\t\t'parent_item_colon' => 'Parent Checklist Box:',\n\t\t\t\t'edit_item' => 'Edit Checklist Box',\n\t\t\t\t'update_item' => 'Update Checklist Box',\n\t\t\t\t'add_new_item' => 'Add New Checklist Box',\n\t\t\t\t'new_item_name' => 'Checklist Box Name',\n\t\t\t),\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t)\n\t);\n}",
"function dpe_vendor_shelf_taxonomy() {\n register_taxonomy(\n 'vendor_shelf',\n 'user',\n array(\n 'description' => 'Vendor Shelves which will be assigned per a vendor',\n 'public' => true,\n 'labels' => array(\n 'name' => 'Vendor Shelves',\n 'singular_name' => 'Vendor Shelf',\n 'menu_name' => 'Vendor Shelves',\n 'search_items' => 'Search Vendor Shelf',\n 'popular_items' => 'Popular Vendor Shelves',\n 'all_items' => 'All Vendor Shelves',\n 'edit_item' => 'Edit Vendor Shelf',\n 'update_item' => 'Update Vendor Shelf',\n 'add_new_item' => 'Add New Vendor Shelf',\n 'new_item_name' => 'New Vendor Shelf Name',\n ),\n 'update_count_callback' => function() {\n return;\n }\n )\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the current browser. | function setBrowser($browser) {
$this->_browser = $browser;
} | [
"function setBrowser($browser)\n {\n $this->_browser = $browser;\n }",
"public function setBrowser($browser)\n {\n $this->_browser_name = $browser;\n }",
"public function setBrowser($browser) { return $this->_browser_name = $browser; }",
"public function browserSet($browser)\r\n\t{\r\n\t\t$this->browser = $browser;\r\n\t\t\r\n\t\t//convert the browscap agent to the caniuse agent\r\n\t\tif (array_key_exists($browser->Browser,$this->agentMap))\r\n\t\t{\r\n\t\t\t$this->agent = $this->agentMap[$browser->Browser];\r\n\t\t}\r\n\r\n\t\t//do the version too\r\n\t\t$this->version = floatval($this->browser->Version);\r\n\t}",
"public function setBrowserName($name)\n {\n $this->browserName = $name;\n }",
"public function set($name, Browser $browser)\n {\n $this->browsers[$name] = $browser;\n }",
"public function setPageBrowser($pageBrowser=NULL) {\n\t\t$this->pageBrowser = $pageBrowser ; // ? $pageBrowser : $this->factoryObj->pageBrowser;\n\t\t$this->setActivePage($this->pageBrowser->getActivePage());\n\t\t$this->setResultsPerPage($this->pageBrowser->getCountEntriesPerPage);\n\t}",
"public function setManagedBrowser($val)\n {\n $this->_propDict[\"managedBrowser\"] = $val;\n return $this;\n }",
"public function setBrowserClass($browserClass)\n {\n $this->browserClass = $browserClass;\n }",
"private function setBrowser() {\n $this->checkBrowser();\n $readAgent = new Read;\n $readAgent->exeRead('ws_siteviews_agent', 'WHERE agent_name=:name', \"name=$this->Browser\");\n if (!$readAgent->getResult()): //se não existir regitro, inserir dados na tabela\n $dados = ['agent_name' => $this->Browser, 'agent_views' => 1];\n $cadastro = new Create;\n $cadastro->exeCreate('ws_siteviews_agent', $dados);\n else: //se existir, atualizar tabela\n $dados = ['agent_views' => $readAgent->getResult()[0]['agent_views'] + 1];\n $update = new Update;\n $update->exeUpdate('ws_siteviews_agent', $dados, 'WHERE agent_name=:name', \"name=$this->Browser\");\n endif;\n }",
"public function getBrowser()\n {\n return $this->browser;\n }",
"public function getBrowser() { return $this->_browser_name; }",
"public function setManagedBrowser(?ManagedBrowserType $value): void {\n $this->getBackingStore()->set('managedBrowser', $value);\n }",
"public function getBrowser( )\n {\n return $this->_browser;\n }",
"public function setBrowserVersion($version)\n {\n $this->browserVersion = $version;\n }",
"public function setUseManagedBrowser($val)\n {\n $this->_propDict[\"useManagedBrowser\"] = boolval($val);\n return $this;\n }",
"public function setUseManagedBrowser(?bool $value): void {\n $this->getBackingStore()->set('useManagedBrowser', $value);\n }",
"public function getBrowserName()\n {\n return $this->browserName;\n }",
"public function setBrowserTitle($browserTitle)\n {\n if (!empty(Yii::$app->name)) {\n $this->title = Yii::$app->name . ' - ' . $browserTitle;\n } else {\n $this->title = $browserTitle;\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get the minimum element height | public function getElementHeight()
{
return $this->element_height;
} | [
"public function getContentMinHeight(){\n\t\treturn $this->_contentMinHeight;\n }",
"function AutoCompGetMaxHeight(){}",
"function GetMinimumSizeY(){}",
"public function getFirstHeight()\n {\n return $this->firstHeight;\n }",
"private function getHeight() {\n return $this->properties->getWidgetProperty(self::PROPERTY_HEIGHT);\n }",
"public function get_height();",
"public function getStartHeight()\n {\n return $this->startHeight;\n }",
"public function getCalulatedHeight();",
"function GetMinimumPaneSize(){}",
"public function getInnerHeight()\n {\n return $this->getHeight() - $this->getTopMargin() - $this->getBottomMargin();\n }",
"public function getHeight() {\n\t\treturn $this->getAttribute( 'height' );\n\t}",
"public function getNodeHeight();",
"function GetMinTickAbsSize()\n {\n return $this->minor_abs_size;\n }",
"public function heightTopLeft();",
"public function getHeightM()\n {\n if (! isset($this->heightM)) {\n $this->heightM = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightM;\n }",
"function getHeight() {\n\t\treturn $this->getData('height');\n\t}",
"public function height():int{\n return $this->innerHeight($this->root);\n }",
"public function getAvailableHeight()\n\t{\n\t\treturn $this->getStyle()->getPageHeight();\n\t}",
"public function getAvailableHeight()\n {\n return 671 - ($this->includeNavbar ? navbar::getHeight() : 0) - ($this->includeTitleTable ? 73 : 0);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hands off conversation to a live agent. Generated from protobuf field .google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; | public function getLiveAgentHandoff()
{
return $this->readOneof(3);
} | [
"public function setLiveAgentHandoff($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\Cx\\V3\\ResponseMessage\\LiveAgentHandoff::class);\n $this->writeOneof(10, $var);\n\n return $this;\n }",
"public function getGoalAway()\n {\n return $this->goalAway;\n }",
"public function getHumanAgentHandoffConfig()\n {\n return $this->human_agent_handoff_config;\n }",
"public function setHireHero(Down_GuildHireHero $value)\n {\n return $this->set(self::_HIRE_HERO, $value);\n }",
"public function setSplitHeroReply(Down_SplitHeroReply $value)\n {\n return $this->set(self::_SPLIT_HERO_REPLY, $value);\n }",
"public function setHeroUpgradeReply(Down_HeroUpgradeReply $value)\n {\n return $this->set(self::_HERO_UPGRADE_REPLY, $value);\n }",
"public function setWebAgent(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\Agent $webAgent = null)\n {\n if (is_null($webAgent) || (is_array($webAgent) && empty($webAgent))) {\n unset($this->WebAgent);\n } else {\n $this->WebAgent = $webAgent;\n }\n return $this;\n }",
"public function setFulfillmentResponse($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\WebhookResponse\\FulfillmentResponse::class);\n $this->fulfillment_response = $var;\n\n return $this;\n }",
"public function botman()\n {\n $botman = app('botman');\n\n $botman->middleware->received(ApiAi::create(config('services.dialogflow.key'))->listenForAction());\n\n $botman->hears('{something}', __CLASS__ . '@telegram');\n\n $botman->listen();\n }",
"public function getSplitHeroReply()\n {\n return $this->get(self::_SPLIT_HERO_REPLY);\n }",
"public function handle()\n {\n /**\n * `$botman` is Initiating instance of botman\n */\n $botman = app('botman');\n\n /**\n * Creating instance of dialogFlow middleWare we are then passing\n * the commands through dialogFlow is listening for\n */\n $dialogflow = \\BotMan\\Middleware\\DialogFlow\\V2\\DialogFlow::create('en');\n $botman->middleware->received($dialogflow);\n\n /**\n * Passing the string value `$botman` hears to be evaluated in if block,\n * if the controller can handle the reply it will be executed. Otherwise we\n * will turn to dialogflow to provide a response.\n */\n $botman->hears('{message}', function ($botman, $message) {\n\n if ($message == 'hi') {\n $botman->reply(\"you said hi\");\n } elseif ($message == 'no') {\n $botman->reply(\"you said no\");\n }\n else {\n $extras = $botman->getMessage()->getExtras();\n $botman->reply($extras['apiReply']);\n }\n\n \n\n });\n\n\n /**\n * when outside of botman studio listen MUST be called at and of the handle function\n */\n $botman->listen();\n\n }",
"public function setScoreAway($scoreAway)\n {\n $this->scoreAway = $scoreAway;\n\n return $this;\n }",
"public function setWithdrawExcavateHeroReply(Down_WithdrawExcavateHeroReply $value)\n {\n return $this->set(self::_WITHDRAW_EXCAVATE_HERO_REPLY, $value);\n }",
"public static function handOver()\n {\n $_SESSION['handOver'] = true;\n }",
"public function setHiringAgency($var)\n {\n GPBUtil::checkBool($var);\n $this->hiring_agency = $var;\n\n return $this;\n }",
"public function setHumanAgentSideConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\HumanAgentAssistantConfig\\SuggestionQueryConfig\\DialogflowQuerySource\\HumanAgentSideConfig::class);\n $this->human_agent_side_config = $var;\n\n return $this;\n }",
"public function forwardAgent();",
"public function getter_away()\n\t{\n\t\t$response = $this->getWhois();\n\t\t\n\t\tif(!$response)\n\t\t\treturn false;\n\t\t\n\t\treturn !empty($response->away) ? $response->away : \"\";\n\t}",
"public function getHeroEquipUpgradeReply()\n {\n return $this->get(self::_HERO_EQUIP_UPGRADE_REPLY);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the iOSLobAppProvisioningConfigAssignments property value. The iOSLobAppProvisioningConfigAssignments property | public function setIOSLobAppProvisioningConfigAssignments(?array $value): void {
$this->getBackingStore()->set('iOSLobAppProvisioningConfigAssignments', $value);
} | [
"public function setAppProvisioningConfigurationGroupAssignments(?array $value): void {\n $this->getBackingStore()->set('appProvisioningConfigurationGroupAssignments', $value);\n }",
"public function setAssignments(array $assignments);",
"public function setJobAssignments(?array $jobAssignments): void\n {\n $this->jobAssignments['value'] = $jobAssignments;\n }",
"public function setAssignmentPolicies($val)\n {\n $this->_propDict[\"assignmentPolicies\"] = $val;\n return $this;\n }",
"public function setAccessPackageAssignmentPolicies($val)\n {\n $this->_propDict[\"accessPackageAssignmentPolicies\"] = $val;\n return $this;\n }",
"public function setAssignments(?PlannerAssignments $value): void {\n $this->getBackingStore()->set('assignments', $value);\n }",
"public function setIosLobAppProvisioningConfigurations(?array $value): void {\n $this->getBackingStore()->set('iosLobAppProvisioningConfigurations', $value);\n }",
"public function setRoleAssignments(?array $value): void {\n $this->getBackingStore()->set('roleAssignments', $value);\n }",
"public function setAccessPackageAssignments($val)\n {\n $this->_propDict[\"accessPackageAssignments\"] = $val;\n return $this;\n }",
"public function setRoleAssignments($val)\n {\n $this->_propDict[\"roleAssignments\"] = $val;\n return $this;\n }",
"public function setAssignments(?array $value): void {\n $this->getBackingStore()->set('assignments', $value);\n }",
"public function setAssignmentApprovals(?array $value): void {\n $this->getBackingStore()->set('assignmentApprovals', $value);\n }",
"public function setAssignments(PropelCollection $assignments, PropelPDO $con = null)\n {\n $assignmentsToDelete = $this->getAssignments(new Criteria(), $con)->diff($assignments);\n\n $this->assignmentsScheduledForDeletion = unserialize(serialize($assignmentsToDelete));\n\n foreach ($assignmentsToDelete as $assignmentRemoved) {\n $assignmentRemoved->setCourse(null);\n }\n\n $this->collAssignments = null;\n foreach ($assignments as $assignment) {\n $this->addAssignment($assignment);\n }\n\n $this->collAssignments = $assignments;\n $this->collAssignmentsPartial = false;\n\n return $this;\n }",
"public function setAccessPackageAssignments(?array $value): void {\n $this->getBackingStore()->set('accessPackageAssignments', $value);\n }",
"public function setAssignments(PropelCollection $assignments, PropelPDO $con = null)\n {\n $this->clearAssignments();\n $currentAssignments = $this->getAssignments();\n\n $this->assignmentsScheduledForDeletion = $currentAssignments->diff($assignments);\n\n foreach ($assignments as $assignment) {\n if (!$currentAssignments->contains($assignment)) {\n $this->doAddAssignment($assignment);\n }\n }\n\n $this->collAssignments = $assignments;\n\n return $this;\n }",
"public function setAssignments($val)\n {\n $this->_propDict[\"assignments\"] = $val;\n return $this;\n }",
"public function setManagedAppPolicies(?array $value): void {\n $this->getBackingStore()->set('managedAppPolicies', $value);\n }",
"public function setRoleAssignmentIds(?array $value): void {\n $this->getBackingStore()->set('roleAssignmentIds', $value);\n }",
"public function loadAssignments()\n {\n if ($this->isAssignmentsLoaded) {\n return;\n }\n $db = eZDB::instance();\n $roleId = (int)$this->role->attribute('id');\n foreach ($db->arrayQuery(\"SELECT contentobject_id, limit_identifier, limit_value FROM ezuser_role WHERE role_id=${roleId}\") as $row) {\n $limitId = $row['limit_identifier'];\n $limitValue = $row['limit_value'];\n $limitDbValue = null;\n if ($limitValue === 'Subtree') {\n $node = eZContentobjectTreeNode::fetchByPath($limitValue);\n if ($node) {\n $limitDbValue = $limitValue;\n $limitValue = $node->attribute('node_id');\n }\n }\n $this->assignments[] = array(\n 'status' => 'nop',\n 'userId' => (int)$row['contentobject_id'],\n 'limitId' => $limitId,\n 'limitValue' => $limitValue,\n 'limitDbValue' => $limitDbValue,\n );\n }\n $this->isAssignmentsLoaded = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add item to repairLabourRates value | public function addToRepairLabourRates($item)
{
// validation for constraint: itemType
if (!(is_int($item) || ctype_digit($item))) {
throw new \InvalidArgumentException(sprintf('The repairLabourRates property can only contain items of type long, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->repairLabourRates[] = $item;
return $this;
} | [
"public function addToRepairVatRates($item)\n {\n // validation for constraint: itemType\n if (!(is_int($item) || ctype_digit($item))) {\n throw new \\InvalidArgumentException(sprintf('The repairVatRates property can only contain items of type int, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->repairVatRates[] = $item;\n return $this;\n }",
"function addItemFixed($refCode,$q,$t,$f1,$f2,$c)\n {\n $cnt = (int) count($this->rateReq['ItemList']);\n $this->rateReq['ItemList'][$cnt] = array();\n $this->rateReq['ItemList'][$cnt]['CalcMethod'] = 'F';\n $this->rateReq['ItemList'][$cnt]['RefCode'] = $refCode;\n $this->rateReq['ItemList'][$cnt]['Quantity'] = (float) abs($q);\n $this->rateReq['ItemList'][$cnt]['FeeType'] = (!strcasecmp('F',$t) ? 'F' : 'C');\n $this->rateReq['ItemList'][$cnt]['Fee1'] = (float) abs($f1);\n if (isset($f2)) $this->rateReq['ItemList'][$cnt]['Fee2'] = (float) abs($f2);\n $this->rateReq['ItemList'][$cnt]['FeeCode'] = $c;\n }",
"function utiliserPointsBonus($ar){\n $orderoid = $ar['orderoid'];\n $lines = $ar['bonuslines'];\n foreach($lines as $line){\n $dp = $this->dscatalog->rdisplay($line['PRODUCT'], NULL, false, '', '', array('wtsticket'=>array('target_fields'=>array('duree'))));\n $rs = selectQueryGetAll('select duree from '.XModEPassLibre::$tableTICKET.' where lang=\\'FR\\' and KOID=\\''.$dp['owtsticket']->raw.'\\'');\n $jours = $rs[0]['duree'];\n XLogs::notice('utilistation points bonus '.$jours.' '.$dp['owtsticket']->raw);\n $cardid = $this->checkCard($line['WTPCARD']);\n $points = $this->getPointsFromJours($jours);\n $this->dswtptrans->procInput(array('_options'=>array('local'=>true),\n 'wtpcard'=>$cardid,\n 'datetran'=>date('Y-m-d H:i:s'),\n 'linetype'=>XModEPassLibre::$WTSWTPTRANSACTION_LINETYPE_UTILISATION, //$GLOBALS['WTSWTPTRANSACTION_LINETYPE_UTILISATION'],\n 'transori'=>'COMMANDE',\n 'apoints'=>'0.0',\n 'upoints'=>$points,\n 'orderline'=>$line['KOID']\n )\n );\n }\n $this->updateBonus(array('cardoid'=>$cardid));\n }",
"public function parseFiat() {\n $client = new Client();\n $raw = $client->get('https://api.privatbank.ua/p24api/pubinfo?json&exchange&coursid=5')->getBody();\n $result = json_decode($raw, 1);\n\n foreach ($result as $rate) {\n if (in_array($rate['ccy'], config('currencies.fiat')))\n DB::table('rates')->updateOrInsert(\n ['name' => $rate['ccy']],\n [\n 'name' => $rate['ccy'],\n 'rate' => $rate['sale'],\n 'type' => 'fiat'\n ]\n );\n }\n }",
"public function testUpdateAdditionalCost()\n {\n }",
"public function addFraisrIdToOrderItem($observer)\n {\n //Check if extension is active\n if (false === Mage::helper('fraisrconnect/adminhtml_data')->isActive(false)) {\n return;\n }\n \n $event = $observer->getEvent();\n $order_item = $event->getOrderItem();\n $order_item->setFraisrProductId($event->getItem()->getFraisrProductId());\n $order_item->setFraisrCauseId($event->getItem()->getFraisrCauseId());\n $order_item->setFraisrDonationPercentage($event->getItem()->getFraisrDonationPercentage());\n }",
"function Inscription_Payment_Register(&$item,$newvalue)\n {\n $updatedatas=array();\n $lot=$this->Inscription_Payment_Lot($item);\n\n if (!empty($lot) && $item[ \"Lot\" ]!=$lot)\n {\n $lot=$lot[ \"ID\" ];\n \n $item[ \"Lot\" ]=$lot;\n array_push($updatedatas,\"Lot\");\n }\n\n \n if ($item[ \"Type\" ]==3)\n {\n $item[ \"Lot\" ]=0;\n array_push($updatedatas,\"Lot\");\n }\n \n \n if ($item[ \"Has_Paid\" ]!=$newvalue)\n {\n $item[ \"Has_Paid\" ]=$newvalue;\n array_push($updatedatas,\"Has_Paid\");\n }\n \n $datepaid=$this->Inscription_Payment_Register_CGI2Date($item);\n if ($item[ \"Date_Paid\" ]!=$datepaid)\n {\n $item[ \"Date_Paid\" ]=$datepaid;\n array_push($updatedatas,\"Date_Paid\");\n }\n\n \n $valuepaid=$this->Inscription_Payment_Register_CGI2Value($item);\n if ($item[ \"Value_Paid\" ]!=$valuepaid)\n {\n $item[ \"Value_Paid\" ]=$valuepaid;\n array_push($updatedatas,\"Value_Paid\");\n }\n \n if (count($updatedatas)>0)\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n }",
"public function fill_data_courier_pickup(){\n\t $today = date(\"Y-m-d\");\n\t\t$tomorrow = date('Y-m-d', strtotime($today. ' + 1 days'));\n\t\t$tomorrow = str_replace(\"-\", \"/\", $tomorrow);\n\n\t\t$courier_details = $this->db->query(\"SELECT ecs_schedules.*, ecs_status.status, ecs_status.remark, ecs_investors.name FROM ecs_schedules inner join ecs_status on ecs_schedules.investor_id = ecs_status.investor_id inner join ecs_investors on ecs_status.investor_id = ecs_investors.invuser_id where ecs_schedules.date_of_pickup like '\".$tomorrow.\"%' AND (ecs_status.status = 'scheduled' OR ecs_status.status = 'rescheduled');\")->result();\n\n\t\tforeach($courier_details as $courier_details_row){\n\t\t\t$courier_pickup_data = array(\n\t\t\t\t\"address\" => $courier_details_row->address.\", \".$courier_details_row->landmark.\", \".$courier_details_row->city.\", \".$courier_details_row->state.\", \".$courier_details_row->pincode,\n\t\t\t\t\"date_of_pickup\" => $courier_details_row->date_of_pickup,\n\t\t\t\t\"time_of_pickup\" => $courier_details_row->time_of_pickup,\n\t\t\t\t\"status\" => $courier_details_row->status,\n\t\t\t\t\"remark\" => $courier_details_row->remark,\n\t\t\t\t\"investor_name\" => $courier_details_row->investor_name,\n\t\t\t\t\"update_date_time\" => date(\"Y-m-d H:i:s\")\n\t\t\t);\n\t\t\t$this->db->where(\"investor_id\", $courier_details_row->investor_id);\n\t\t\tif(count($this->db->get(\"ecs_courier_pickups\")->result()) > 0){\n\t\t\t\t// Update\n\t\t\t\t$this->db->where(\"investor_id\", $courier_details_row->investor_id);\n\t\t\t\t$this->db->update(\"ecs_courier_pickups\", $courier_pickup_data);\n\t\t\t}else{\n\t\t\t\t// Insert\n\t\t\t\t$courier_pickup_data[\"investor_id\"] = $courier_details_row->investor_id;\n\t\t\t\t$this->db->insert(\"ecs_courier_pickups\", $courier_pickup_data);\n\t\t\t}\n\t\t}\n\t}",
"public function addLineItem($params) {\r\n \r\n $i = count($this->lineItems) + 1;\r\n $prefix = \"LV3_ITEM${i}_\"; // VALUE REQUIRED IN:\r\n $this->lineItems[] = array( // USA | CANADA\r\n \"${prefix}UNIT_COST\" => $params['unitCost'], // * *\r\n \"${prefix}QUANTITY\" => $params['quantity'], // * *\r\n \"${prefix}ITEM_SKU\" => $params['itemSKU'] ?? '', // *\r\n \"${prefix}ITEM_DESCRIPTOR\" => $params['descriptor'] ?? '', // * *\r\n \"${prefix}COMMODITY_CODE\" => $params['commodityCode'] ?? '', // * *\r\n \"${prefix}PRODUCT_CODE\" => $params['productCode'] ?? '', // *\r\n \"${prefix}MEASURE_UNITS\" => $params['measureUnits'] ?? '', // * *\r\n \"${prefix}ITEM_DISCOUNT\" => $params['itemDiscount'] ?? '', // *\r\n \"${prefix}TAX_RATE\" => $params['taxRate'] ?? '', // *\r\n \"${prefix}GOODS_TAX_RATE\" => $params['goodsTaxRate'] ?? '', // *\r\n \"${prefix}TAX_AMOUNT\" => $params['taxAmount'] ?? '', // *\r\n \"${prefix}GOODS_TAX_AMOUNT\" => $params['goodsTaxAmount'] ?? '', // *\r\n \"${prefix}CITY_TAX_RATE\" => $params['cityTaxRate'] ?? '', \r\n \"${prefix}CITY_TAX_AMOUNT\" => $params['cityTaxAmount'] ?? '', \r\n \"${prefix}COUNTY_TAX_RATE\" => $params['countyTaxRate'] ?? '', \r\n \"${prefix}COUNTY_TAX_AMOUNT\" => $params['countyTaxAmount'] ?? '', \r\n \"${prefix}STATE_TAX_RATE\" => $params['stateTaxRate'] ?? '', \r\n \"${prefix}STATE_TAX_AMOUNT\" => $params['stateTaxAmount'] ?? '', \r\n \"${prefix}CUST_SKU\" => $params['custSKU'] ?? '', \r\n \"${prefix}CUST_PO\" => $params['custPO'] ?? '', \r\n \"${prefix}SUPPLEMENTAL_DATA\" => $params['supplementalData'] ?? '', \r\n \"${prefix}GL_ACCOUNT_NUMBER\" => $params['glAccountNumber'] ?? '', \r\n \"${prefix}DIVISION_NUMBER\" => $params['divisionNumber'] ?? '', \r\n \"${prefix}PO_LINE_NUMBER\" => $params['poLineNumber'] ?? '', \r\n \"${prefix}LINE_ITEM_TOTAL\" => $params['lineItemTotal'] ?? '' // *\r\n );\r\n }",
"public function testUpdateCreditBureau()\n {\n }",
"function rebAdd()\n {\n $this->bluepay_post_vars['unit'] = mb_strtoupper($this->bluepay_post_vars['unit']);\n $this->doRebill = '1';\n $this->rebAmount = $this->formatAmount($this->bluepay_post_vars['amount']);\n $this->rebDate = print_date(DATETIME24H, 'Y-m-d');\n $this->rebExpr = $this->bluepay_post_vars['length'] . ' ' . $this->bluepay_post_vars['unit'];\n $this->rebCycles = '';\n }",
"private function getExchangeRates() {\n$values=array();\n$exchangeRateXML=simplexml_load_file($this->xml);\n\n // Increased the DECIMAL(precision, scale) in create.sql to handle weaker currencies, such as the VND\n foreach ($exchangeRateXML->conversion as $conversion) {\n $values[]='(\"' . (string)$conversion->currency . '\", ' . (float)$conversion->rate . ')';\n}\n\n// TO DO: Write ON DUPLICATE KEY UPDATE statement to prevent duplicating rows each time query is performed.\n$this->mysqli->query('INSERT INTO currencyrates (currencyType, currencyRate) VALUES ' . implode(',', $values));\n}",
"function Lots_Value_Update($item,$data,$newvalue)\n {\n if (preg_match('/^\\d+[.,]?\\d*$/',$newvalue))\n {\n $newvalue=preg_replace('/,$/',\".\",$newvalue);\n $newvalue=sprintf(\"%.02f\",$newvalue);\n \n $item[ $data ]=$newvalue;\n }\n \n return $item;\n }",
"function add_to_new_and_slots($skus) {\n foreach ($skus->new as $key => $value) {\n if (!isset($this->new_and_slots->new[$key])) $this->new_and_slots->new[$key] = 0;\n $this->new_and_slots->new[$key] += $value;\n }\n \n // add new needed slots to list of skus\n foreach ($skus->slots as $key => $value) {\n if (!isset($this->new_and_slots->slots[$key])) $this->new_and_slots->slots[$key] = 0;\n $this->new_and_slots->slots[$key] += $value;\n }\n }",
"public function addFraisrIdToQuoteItem($observer)\n {\n //Check if extension is active\n if (false === Mage::helper('fraisrconnect/adminhtml_data')->isActive(false)) {\n return;\n }\n\n $event = $observer->getEvent();\n $quoteItem = $event->getQuoteItem();\n $product = $quoteItem->getProduct();\n\n if (false === is_null($product->getFraisrId())\n && 1 == $product->getFraisrEnabled()\n && false === is_null($product->getFraisrCause())\n && false === is_null($product->getFraisrDonationPercentage())) {\n $quoteItem->setFraisrProductId($product->getFraisrId());\n $quoteItem->setFraisrCauseId($product->getFraisrCause());\n $quoteItem->setFraisrDonationPercentage($product->getFraisrDonationPercentage());\n }\n }",
"private function add_rates( $shipwire_rates, $package ) {\n\n\t\tif ( ! is_array( $shipwire_rates ) || empty( $shipwire_rates ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $shipwire_rates as $shipwire_rate ) {\n\n\t\t\t// require delivery confirmation\n\t\t\tif ( 'yes' === $this->require_delivery_confirmation && false === $shipwire_rate['service_delivery_confirmation'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// require trackable service\n\t\t\tif ( 'yes' === $this->require_tracking && false === $shipwire_rate['service_trackable'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// use user-set labels for services instead of carrier-provided labels\n\t\t\tif ( 'no' === $this->show_service ) {\n\t\t\t\t$label = 'label_' . strtolower( str_replace( '-', '_', $shipwire_rate['id'] ) );\n\t\t\t\t$shipwire_rate['service_name'] = $this->$label;\n\t\t\t}\n\n\t\t\t// show delivery estimates if enabled\n\t\t\tif ( 'yes' === $this->show_delivery_estimate ) {\n\n\t\t\t\t$delivery_date = $this->format_delivery_date( $shipwire_rate['delivery_estimate_min'], $shipwire_rate['delivery_estimate_max'] );\n\n\t\t\t\t$shipwire_rate['service_name'] = apply_filters( 'wc_shipwire_shipping_method_delivery_date', $shipwire_rate['service_name'] . ' ' . $delivery_date );\n\t\t\t}\n\n\t\t\t// build rate\n\t\t\t$rate = array(\n\t\t\t\t'id' => $this->id . '_' . $shipwire_rate['id'],\n\t\t\t\t'label' => $shipwire_rate['service_name'],\n\t\t\t\t'cost' => $shipwire_rate['cost']\n\t\t\t);\n\n\t\t\t// add handling fee\n\t\t\tif ( $this->handling_fee > 0 ) {\n\n\t\t\t\t$rate['cost'] += $this->get_fee( $this->handling_fee, $package['contents_cost'] );\n\n\t\t\t\t// add additional handling fee if there's more than 1 item in the cart, only applied to each item past the first item\n\t\t\t\tif ( $this->additional_handling_fee > 0 && WC()->cart->cart_contents_count > 1 ) {\n\t\t\t\t\t$rate['cost'] += ( $this->additional_handling_fee * ( WC()->cart->cart_contents_count - 1 ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add as valid rate\n\t\t\t$this->add_rate( apply_filters( 'wc_shipwire_shipping_method_rate', $rate, $shipwire_rate, $package, $this ) );\n\t\t}\n\t}",
"private function _set_rate($couriers_cost) {\n // format the costs from API to WooCommerce\n foreach($couriers_cost as $courier):\n\n if(empty($courier) ) { break; }\n\n // get full list of services\n $code = $courier[0]['code'];\n $all_services = WCIS_Data::get_services($code);\n\n // get allowed service from this courier\n $setting_id = $code . '_services';\n $allowed_services = isset($this->settings[$setting_id]) ? $this->settings[$setting_id] : array();\n\n foreach($courier[0]['costs'] as $service):\n\n // check if this service is allowed\n $is_allowed = false;\n foreach($allowed_services as $as) {\n // if has variation\n if(isset($all_services[$as]['vars']) ) {\n $is_allowed = in_array($service['service'], $all_services[$as]['vars'] );\n }\n else {\n $is_allowed = $service['service'] === $as;\n }\n\n if($is_allowed) { break; }\n }\n\n if($is_allowed) {\n $rate = array(\n 'id' => $code . '_' . strtolower($service['service']),\n 'label' => strtoupper($code) . ' ' . $service['service'],\n 'cost' => $service['cost'][0]['value'],\n 'calc_tax' => 'per_order'\n );\n\n $this->add_rate($rate);\n }\n endforeach;\n endforeach;\n }",
"public function positive_stock_adjust($filter_data,$qty)\n {\n # update the quantity in master inventory by adding the adjusted quantity \n # where the item code is equal to the item code of the refunded item\n $sql=\"UPDATE master_inventory SET Available_stock=Available_stock+$qty WHERE item_code='$filter_data'\";\n $this->db->query($sql);\n\n }",
"private static function add_rate_code() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t// Add new rate \r\n\t\t$_tax_rate = array(\r\n\t\t\t'tax_rate_country' => 'WOOTAX',\r\n\t\t\t'tax_rate_state' => 'RATE',\r\n\t\t\t'tax_rate' => 0,\r\n\t\t\t'tax_rate_name' => 'DO-NOT-REMOVE',\r\n\t\t\t'tax_rate_priority' => NULL,\r\n\t\t\t'tax_rate_compound' => true,\r\n\t\t\t'tax_rate_shipping' => NULL,\r\n\t\t\t'tax_rate_order' => NULL,\r\n\t\t\t'tax_rate_class' => 'standard',\r\n\t\t);\r\n\r\n\t\t$wpdb->insert( $wpdb->prefix . 'woocommerce_tax_rates', $_tax_rate );\r\n\r\n\t\t$tax_rate_id = $wpdb->insert_id;\r\n\r\n\t\tupdate_option( 'wootax_rate_id', $tax_rate_id );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ ///////////////////////////////////////////////////////////////////// Getter & Setter ////////////////////////////////////////////////////////////////// Get DC General | public function getDC()
{
return $this->objDC;
} | [
"public function getDc()\n {\n return $this->dc;\n }",
"public function getXdcSpecific()\n {\n return $this->xdc_specific;\n }",
"public function createDcGeneral();",
"public function getDcGeneralClassName();",
"protected function getAppDc()\n {\n return self::$app->dc;\n }",
"public function getGeneralConfig()\n {\n if ($this->general === null) {\n $prefix = 'integernet_solr/general/';\n $this->general = new GeneralConfig(\n $this->_getConfigFlag($prefix . 'is_active'),\n $this->_getConfig($prefix . 'license_key'),\n $this->_getConfigFlag($prefix . 'log'),\n $this->_getConfigFlag($prefix . 'debug')\n );\n }\n return $this->general;\n }",
"public function getProdGeneral()\n {\n return $this->prod_general;\n }",
"public function setDcGeneralClassName($dcGeneralClassName);",
"public function getGeneral(){\n\n\t\tuser_login_required(); //Login needed\n\n\t\t//Fetch user settings\n\t\t$user_settings = components()->settings->get_general(userID);\n\n\t\t//Check for error\n\t\tif(!$user_settings->isValid())\n\t\t\tRest_fatal_error(500, \"Could not get user settings !\");\n\n\t\t//Parse and return settings entry\n\t\treturn $this->GeneralSettingsToAPI($user_settings);\n\n\t}",
"function GetPrintDC(){}",
"public function getGeneralValues(){\n return $this->general;\n }",
"function SS_WC_Digital_Details() {\n\treturn SS_WC_Digital_Details::instance();\n}",
"public function getCedcon(){\n\t\treturn $this->cedcon;\n\t}",
"public function getGeneralData(){\n\t\t$gd = DBManager::app()->getGameDetails($this->gameid);\n\t\tif (!$gd){return;}\n\n\t\t$this->settings = new GD($gd);\n\t\tstatic::$turn = $gd[\"turn\"];\n\t\tstatic::$phase = $gd[\"phase\"];\n\t\t$this->playerstatus = DBManager::app()->getDBPlayerStatus($this->gameid);\n\t\t$this->weapons = DmgCalc::setWeaponPriority();\n\t}",
"public function getGeneralConfig()\n {\n foreach ($this->_configData as $configElement) {\n if ($configElement[\"name\"]==\"general\") {\n return $configElement;\n }\n }\n }",
"public function getDomainCategory()\n {\n return $this->domain_category;\n }",
"public function getPdc()\n {\n $apiKey = $this->getConfig('fattura24/generali/api_key');\n $dataReturned = $this->apiCall('https://www.app.fattura24.com/api/v0.3/GetPdc', $apiKey);\n $listaNomi = array();\n $listaNomi['Nessun Pdc'] = 'Nessun Pdc';\n $xml = simplexml_load_string(utf8_encode($dataReturned));\n if (is_object($xml)) {\n foreach ($xml->pdc as $pdc) {\n if (intval($pdc->ultimoLivello) == 1) {\n $listaNomi[intval($pdc->id)] = str_replace('^', '.', strval($pdc->codice)).' - '.strval($pdc->descrizione);\n }\n }\n } else {\n $this->trace('error list pdc', $dataReturned);\n }\n\n return $listaNomi;\n }",
"public function getDataCenter(){\n if (strstr($this->_api_key,\"-\")){\n list($key, $this->_dc) = explode(\"-\",$this->_api_key,2); \n }\n return $this->_dc;\n }",
"public function getVolumenGeneral() {\n\n $vol=self::$mesaMezclas->getVol(\"master\");\n return $vol;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find users by event and status. | public function findUsersByEventsAndStatusQueryBuilder($events = null, $status = null)
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('u')
->addSelect('t')
->from('StfalconEventBundle:Ticket', 't')
->join('t.user', 'u')
->join('t.event', 'e')
//@todo hot fix необходимо сделать рассылку для предыдущих ивентов
//->andWhere('e.active = :eventStatus')
//->setParameter(':eventStatus', true)
->groupBy('u');
if (null !== $events) {
$qb->andWhere($qb->expr()->in('t.event', ':events'))
->setParameter(':events', $events->toArray());
}
if (null !== $status) {
$statusOr = $qb->expr()->orX('p.status = :status');
if ('pending' == $status) {
$statusOr->add('p.status IS NULL');
}
$qb->leftJoin('t.payment', 'p')
->andWhere($statusOr)
->setParameter(':status', $status);
}
return $qb;
} | [
"public function findByEventAndStatus($event, $status = false)\n {\n $parameters = array(\n 'event' => $event\n );\n\n $usersInEvent = $this\n ->createQueryBuilder('uie')\n ->andWhere('uie.event = :event')\n ;\n\n if ($status) {\n $usersInEvent = $usersInEvent->andWhere('uie.status = :status');\n\n $parameters['status'] = $status;\n }\n\n $usersInEvent = $usersInEvent->setParameters($parameters)\n ->getQuery()\n ->getResult();\n\n return $usersInEvent;\n }",
"public function findUsersByEventsAndStatus($events = null, $status = null)\n {\n $users = [];\n\n foreach ($this->findUsersByEventsAndStatusQueryBuilder($events, $status)->getQuery()->execute() as $result) {\n $users[] = $result->getUser();\n }\n\n return $users;\n }",
"public function getUsersByEventID($event_id){\n $dbcon = Database::getDB();\n $sql = \"SELECT * from users\n INNER JOIN events_users on users.id = events_users.user_id \n WHERE events_users.event_id = :event_id AND events_users.has_rsvp =1 AND users.allow_notif =1\";\n $pst = $dbcon->prepare($sql);\n $pst->bindParam(':event_id', $event_id);\n $pst->execute();\n $users = $pst->fetchAll(PDO::FETCH_OBJ);\n $pst->closeCursor();\n return $users;\n }",
"public function getEvents($userId, $status) {\n $events = $this->find('list', array(\n 'conditions' => array(\n 'EventMember.user_id' => $userId,\n 'EventMember.status' => $status\n ),\n 'fields' => array('EventMember.event_id')\n ));\n\n return $events;\n }",
"public static function get_users_by_resident_status($data)\n {\n $query = DB::table('users')\n ->select('users.*','basic_details.*','religion_info.*', 'professtion_info.*','user_location.*', 'users.id as user_id')\n ->join('basic_details','basic_details.user_id','=','users.id')\n ->join('religion_info','religion_info.user_id','=','users.id')\n ->join('professtion_info','professtion_info.user_id','=','users.id')\n ->join('user_location','user_location.user_id','=','users.id');\n if ($data['resident_status'])\n {\n $query->where(array(\n 'user_location.resident_status' => $data['resident_status'],\n 'users.deleted_at' => NULL\n ));\n }\n $result = $query->get();\n return $result;\n }",
"public function list($status) {\n $now = date('Y-m-d H:i:s');\n\n if($status == 'forthcoming') {\n $registeredEvents = DB::table('event_register')\n ->where([\n ['user_id', '=', Auth::id()],\n ['status', '=', 1] \n ])\n ->get();\n $temp = [];\n foreach($registeredEvents as $item) {\n array_push($temp, $item->event_id);\n }\n \n $events = \\App\\Event::leftjoin('users', 'events.creator', '=', 'users.id')\n ->leftjoin('agency', 'events.agency_id', '=', 'agency.id')\n ->leftjoin('agency_photos', function ($join) {\n $join->on('events.agency_id', '=', 'agency_photos.agency_id');\n $join->on(function($query) {\n $query->where('agency_photos.type', '=', 'avatar'); \n });\n })\n ->where([\n ['limit_time_register', '>', $now],\n ['status', '=', 'forthcoming']\n ])\n ->whereIn('events.id', $temp)\n ->select(DB::raw('\n events.*,\n users.name as creator_name, \n users.avatar as creator_avatar, \n agency.address as address, \n agency_photos.source as agency_avatar\n '))\n ->orderBy('start_time', 'DESC')\n ->paginate(10);\n } else if($status == 'finished') {\n $registeredEvents = DB::table('event_register')\n ->where([\n ['user_id', '=', Auth::id()],\n ['status', '=', 1] \n ])\n ->get();\n $temp = [];\n foreach($registeredEvents as $item) {\n array_push($temp, $item->event_id);\n }\n \n $events = \\App\\Event::leftjoin('users', 'events.creator', '=', 'users.id')\n ->leftjoin('agency', 'events.agency_id', '=', 'agency.id')\n ->leftjoin('agency_photos', function ($join) {\n $join->on('events.agency_id', '=', 'agency_photos.agency_id');\n $join->on(function($query) {\n $query->where('agency_photos.type', '=', 'avatar'); \n });\n })\n ->where([\n ['start_time', '<', $now],\n ['status', '=', 'finished']\n ])\n ->whereIn('events.id', $temp)\n ->select(DB::raw('\n events.*,\n users.name as creator_name, \n users.avatar as creator_avatar, \n agency.address as address, \n agency_photos.source as agency_avatar\n '))\n ->orderBy('start_time', 'DESC')\n ->paginate(10);\n } else if($status == 'cancelled') {\n $temp = [];\n // tim các cuộc hẹn đôi mà register status = 0\n $registeredCoupleEvents = DB::table('event_register')\n ->join('events', 'events.id', '=', 'event_register.event_id')\n ->where([\n ['user_id', '=', Auth::id()], \n ['events.status', '=', 'cancelled'],\n ['events.type', '=', 'couple']\n ])\n ->get();\n \n foreach($registeredCoupleEvents as $item) {\n array_push($temp, $item->event_id);\n }\n\n $registeredGroupEvents = DB::table('event_register')\n ->join('events', 'events.id', '=', 'event_register.event_id')\n ->where([\n ['user_id', '=', Auth::id()], \n ['events.status', '=', 'cancelled'],\n ['events.type', '=', 'group'],\n ['event_register.status', '=', 1]\n ])\n ->get();\n \n foreach($registeredGroupEvents as $item) {\n array_push($temp, $item->event_id);\n }\n \n $events = \\App\\Event::leftjoin('users', 'events.creator', '=', 'users.id')\n ->leftjoin('agency', 'events.agency_id', '=', 'agency.id')\n ->leftjoin('agency_photos', function ($join) {\n $join->on('events.agency_id', '=', 'agency_photos.agency_id');\n $join->on(function($query) {\n $query->where('agency_photos.type', '=', 'avatar'); \n });\n })\n ->whereIn('events.id', $temp)\n ->select(DB::raw('\n events.*,\n users.name as creator_name, \n users.avatar as creator_avatar, \n agency.address as address, \n agency_photos.source as agency_avatar\n '))\n ->orderBy('start_time', 'DESC')\n ->paginate(10); \n }\n\n $events_id = [];\n foreach($events as $key => $event) {\n $event['is_joined'] = 1;\n array_push($events_id, $event->id);\n }\n\n $event_meta = DB::table('event_meta')\n ->whereIn('event_id', $events_id)\n ->leftJoin('user_jobs', function($join) {\n $join->on('user_jobs.id', '=', 'event_meta.meta_value');\n $join->on('event_meta.meta_key', '=', DB::raw(\"'job_conditional'\"));\n })\n ->get();\n\n $events->map( function ($event, $key) use ($event_meta) {\n $job = [];\n $marital_status = [];\n foreach($event_meta as $metadata) {\n if($metadata->event_id == $event->id) {\n $key = $metadata->meta_key;\n\n if($key == 'job_conditional') {\n array_push($job, $metadata->name);\n } else if($key == 'marital_status') {\n array_push($marital_status, $metadata->meta_value);\n } else {\n $event[$key] = $metadata->meta_value;\n }\n }\n }\n $event['job'] = $job;\n $event['marital_status'] = $marital_status;\n });\n return json_encode($events);\n }",
"function filter_users_by_status( $query ) {\r\n\t\t\tglobal $wpdb, $pagenow;\r\n\r\n\t\t\tif ( is_admin() && $pagenow == 'users.php' && ! empty( $_GET['status'] ) ) {\r\n\r\n\t\t\t\t$status = urldecode( $_GET['status'] );\r\n\r\n\t\t\t\tif ( $status == 'needs-verification' ) {\r\n\t\t\t\t\t$query->query_where = str_replace('WHERE 1=1',\r\n\t\t\t\t\t\t\"WHERE 1=1 AND {$wpdb->users}.ID IN (\r\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\r\n WHERE {$wpdb->usermeta}.meta_key = '_um_verified'\r\n AND {$wpdb->usermeta}.meta_value = 'pending')\",\r\n\t\t\t\t\t\t$query->query_where\r\n\t\t\t\t\t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$query->query_where = str_replace('WHERE 1=1',\r\n\t\t\t\t\t\t\"WHERE 1=1 AND {$wpdb->users}.ID IN (\r\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\r\n WHERE {$wpdb->usermeta}.meta_key = 'account_status'\r\n AND {$wpdb->usermeta}.meta_value = '{$status}')\",\r\n\t\t\t\t\t\t$query->query_where\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn $query;\r\n\t\t}",
"function getAllUserByStatus()\n {\n $SQL = \"SELECT * FROM user_tab WHERE status = 'Yes'\";\n $this->db->executeQuery($SQL);\n\n $result = array();\n $count = 0;\n\n while ($rs = $this->db->nextRecord()) {\n $user = new User();\n $user->setId($rs['id']);\n $user->setOrder_no($rs['order_no']);\n $user->setCode($rs['code']);\n $user->setUsername($rs['username']);\n $user->setPassword($rs['password']);\n $user->setData_date($rs['data_date']);\n $user->setStatus($rs['status']);\n $user->setDate_($rs['date_']);\n $result[$count++] = $user;\n }\n\n $this->db->closeRs();\n return $result;\n\n }",
"function getAvatarsByStatus($status) {\r\n\r\n if ( empty($status) ) throw new \\Videosquare\\Model\\Exception('[ERROR] Cannot get avatar list. Status is empty.');\r\n\r\n $query = \"\r\n SELECT\r\n a.id AS userid,\r\n a.nickname,\r\n a.email,\r\n a.avatarfilename,\r\n a.avatarstatus,\r\n a.organizationid,\r\n a.avatarsourceip,\r\n b.domain\r\n FROM\r\n users AS a,\r\n organizations AS b\r\n WHERE\r\n a.avatarstatus = '\" . $status . \"' AND\r\n a.avatarsourceip = '\" . $this->bootstrap->config['node_sourceip'] . \"' AND\r\n a.organizationid = b.id\";\r\n\r\n $model = $this->bootstrap->getVSQModel('users');\r\n $rs = $model->safeExecute($query);\r\n\r\n if ( $rs->RecordCount() < 1 ) return false;\r\n\r\n return $rs;\r\n }",
"public function getUserList($status)\n {\n $user_store = $this->getUserStore();\n $user_list = $user_store->get('user_list', array());\n $filtered_user_list = array();\n\n if ($status === 'active') {\n foreach ($user_list as $stored_user) {\n if (is_null($stored_user['deleted_at'])) {\n $user = new User($stored_user);\n array_push($filtered_user_list, $user->getUserInfo());\n }\n }\n } else if ($status === 'deleted') {\n foreach ($user_list as $stored_user) {\n if (!is_null($stored_user['deleted_at'])) {\n $user = new User($stored_user);\n array_push($filtered_user_list, $user->getUserInfo());\n }\n }\n } else { // status === 'any'\n foreach ($user_list as $stored_user) {\n $user = new User($stored_user);\n array_push($filtered_user_list, $user->getUserInfo());\n }\n }\n\n return $filtered_user_list;\n }",
"public function findAllByStatus(User $currentUser, string $status)\n { \n\n return $this->createQueryBuilder('f')\n ->andWhere('(f.inviter = :inviter OR f.invitee = :invitee) \n AND f.status = :status')\n ->setParameters([\n 'inviter' => $currentUser,\n 'invitee' => $currentUser,\n 'status' => $status,\n ])\n ->getQuery()\n ->getResult()\n ;\n \n }",
"function findUsersByState($state)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection(); \n $sqlProcedure = \"SELECT * FROM user WHERE state='$state'\";\n\n if($result = $mysqli->query($sqlProcedure))\n {\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if(count($row) > 0)\n {\n $this->id = $row[\"id\"];\n $this->lastName = $row[\"lastname\"];\n $this->firstName = $row[\"firstname\"];\n $this->password = $row[\"password\"];\n $this->email = $row[\"email\"];\n $this->state = $row[\"state\"];\n $this->privilege = $row[\"privilege\"];\n }\n }else{\n # Devuelvo el nombre de la funcion y texto\n new LogFiles(__FUNCTION__,\"No puede devolver usuarios.\");\n header(ERROR_404);\n }\n }",
"function getEventsOfUser($mysqli, $username){\n //find userID (UID)\n $result = $mysqli->query(\"SELECT UID FROM User_ WHERE Username='\".$username.\"';\");\n if(is_bool($result) || mysqli_num_rows($result) == 0){\n return 'getEventsOfUser: User with username '.$username.' was not found.';\n }\n $first_row = mysqli_fetch_row($result);\n\n\n\n //get all the titles of the events the user belongs to and the EventID of those\n $result2 = $mysqli->query(\"SELECT Event_.EventID, Event_.Title, Is_Member_Event.requestStatus FROM Event_ INNER JOIN Is_Member_Event ON Is_Member_Event.EventID=Event_.EventID WHERE Is_Member_Event.UID=\".$first_row[0].\" AND (Is_Member_Event.requestStatus='member' OR Is_Member_Event.requestStatus='admin');\");\n return $result2;\n }",
"function get_users_with_events($date)\n {\n $users_with_events = $this->db->select(\"email\")->distinct(\"email\")->where(\"date\",$date)->get($this->table_name);\n if($users_with_events->num_rows() > 0)\n {\n return $users_with_events->result();\n }\n else\n {\n return NULL;\n }\n }",
"private function getUser($status)\n {\n return GalleryUser::findOne(['status' => $status]);\n }",
"function getRegisteredUsersToEvent($eventid) {\n //SELECT EVENT_USER.fk_USERusername, USER.email FROM EVENT_USER INNER JOIN USER ON EVENT_USER.fk_USERusername = USER.username WHERE fk_EVENTid = 7\n $q = \"SELECT \" . TBL_USERS . \".email FROM \" . TBL_EVENT_USER \n . \" INNER JOIN \" . TBL_USERS . \" ON \" . TBL_EVENT_USER . \n \".fk_USERusername = \" . TBL_USERS . \".username WHERE fk_EVENTid = $eventid\";\n $result = mysqli_query($this->connection, $q);\n if (!$result || (mysqli_num_rows($result) < 1)) {\n return NULL;\n }\n /* Return result array */\n return $result;\n }",
"function getEventPendingUsers($mysqli, $eventTitle){\n //find eventID\n $result = $mysqli->query(\"SELECT EventID FROM Event_ WHERE Title='\".$eventTitle.\"';\");\n if(is_bool($result) || mysqli_num_rows($result) == 0){\n return 'getEventPendingUsers: Event with title '.$eventTitle.' does not exist.';\n }\n $first_row = mysqli_fetch_row($result);\n\n //get UIDs of the people that belong to the event. Use OneTimeCode when inviting someone else to the event.\n $result2 = $mysqli->query(\"SELECT UID FROM Is_Member_Event WHERE EventID=\".$first_row[0].\" AND requestStatus='pending' AND OneTimeCode IS NULL\");\n return $result2;\n }",
"public static function findByUsername($username) {\n $status_active = Status::getActive();\n\n if (strpos($username, '@')) {\n return self::findWithCheckOrganizationStatus(static::find()->where(['email' => $username, 'status' => $status_active])->limit(1)->one());\n // return self::findWithCheckOrganizationStatus(static::findOne(['email' => $username, 'status' => $status_active]));\n // return static::findOne(['email' => $username, 'status' => $status_active]);\n }\n\n if (strlen($username) > self::MAGIC_USERID_LEN) {\n $u_part = substr($username, -self::MAGIC_USERID_LEN);\n $o_part = substr($username, 0, strlen($username) - self::MAGIC_USERID_LEN);\n $user_id = 1 * $u_part;\n $org_id = 1 * $o_part;\n $sql = \"SELECT {{users}}.* FROM {{users}}\n INNER JOIN {{org_employees}} ON {{org_employees}}.[[user_id]] = {{users}}.[[id]]\n WHERE {{users}}.[[id]] = :user_id AND {{org_employees}}.[[org_id]] = :org_id\n AND {{users}}.[[status]] = :status_active AND {{org_employees}}.[[status]] = :status_active\";\n // return static::findBySql($sql, [':user_id' => $user_id, ':org_id' => $org_id,\n // ':status_active' => $status_active])->limit(1)->one();\n return self::findWithCheckOrganizationStatus(static::findBySql($sql, [':user_id' => $user_id, ':org_id' => $org_id,\n ':status_active' => $status_active])->limit(1)->one());\n }\n\n $user_id = 1 * $username;\n\n // return json_encode(static::findOne(['id' => $user_id, 'status' => $status_active]));\n return self::findWithCheckOrganizationStatus(static::findOne(['id' => $user_id, 'status' => $status_active]));\n }",
"public function findUserBy(array $criteria);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the namespace the callable class was registered from | public function getRootNamespace()
{
// The namespace the callable class was registered from.
return $this->sNamespace;
} | [
"public function getNamespace()\n {\n return substr(get_called_class(), 0, strrpos(get_called_class(), '\\\\'));\n }",
"protected static function getCalledClassNamespace()\n {\n $namespace = NULL;\n\n # The namespace is being rebuilt.\n if( strstr($calledClass = get_called_class(), $separator = '\\\\') )\n {\n $namespace = explode($separator, $calledClass);\n \n array_pop($namespace);\n\n $namespace = implode($separator, $namespace) . $separator;\n }\n\n return $namespace;\n }",
"public function getNamespacedName()\n {\n return get_class();\n }",
"protected function obtainInvokerNamespace ()\n {\n return sprintf('%s/%s', __CLASS__, spl_object_hash($this->getInvoker()));\n }",
"public function getFactoryNamespace();",
"public function getNamespaceValidator() : ?callable {\n return $this->validation['namespace'] ?? null;\n }",
"public function classNamespace()\n {\n return $this->namespace;\n }",
"public function getNamespaceClass()\n {\n return $this->_namespaceClass;\n }",
"public function getPhpNamespace() {}",
"public function get_namespace() {\n\t\treturn $this->namespace;\n\t}",
"public function getControllerNamespace();",
"protected function getNamespace(): string\n {\n return $this->config->classNamespace(\n static::ELEMENT,\n (string)$this->argument('name')\n );\n }",
"protected function getNamespace() {\n $namespace = 'App\\Controllers\\\\';\n if (array_key_exists('namespace', $this->params)) {\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n return $namespace;\n }",
"public function getNamespace() {\n\n\t\treturn new ReflectionClassNamespace($this);\n\t}",
"protected function getNamespace(){\n\t\t$namespace = '\\App\\Controllers\\\\';\n\t\t\n\t\tif (array_key_exists('namespace', $this->params)) {\n\t\t\t$namespace .= $this->params['namespace'] .'\\\\';\n\t\t}\n\t\treturn $namespace;\n\t}",
"private function getNamespace() {\n $namespace = 'App\\Controllers\\\\';\n\n if(array_key_exists('namespace', $this->params)) {\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n\n return $namespace;\n }",
"public static function getNamespace()\n {\n if (empty(self::$namespace)) {\n self::$namespace = uniqid(__NAMESPACE__ . '\\\\runkit_') . '\\\\';\n }\n\n return self::$namespace;\n }",
"protected function getNamespace(){\n $namespace = \"App\\Controllers\\\\\" ;\n if(array_key_exists('namespace' , $this->params)) {\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n \n\n return $namespace;\n }",
"public function getNamespace()\n {\n $this->_init();\n return unserialize($this->_list_cache->getNamespace());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new uUID BBIE Catalogue Deletion. UUID. Identifier A universally unique identifier for an instance of this ABIE. 0..1 Catalogue Deletion UUID Identifier Identifier. Type | public function setUUID(\NOKA\PHPUBL\UBL\Common\BasicComponents\UUID $uUID)
{
$this->uUID = $uUID;
return $this;
} | [
"public function setUUID();",
"public function setUUID(\\horstoeko\\ubl\\entities\\cbc\\UUID $uUID)\n {\n $this->uUID = $uUID;\n return $this;\n }",
"public function setTypeDelete()\n\t{\n\t\t$this->type = 'delete';\n\t}",
"public function testUpdateUEId()\n {\n }",
"public function setUUID($uuid);",
"public function delete() {\n\t\t// showOrdner\n\t\t$this->removePositions();\n\t\t\n\t\t// delete LinkUs item\n\t\t$sql = \"DELETE FROM wcf\".WCF_N.\"_linkus\n\t\t\tWHERE\t\tlinkusID = \".$this->linkusID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// reset cache\n\t\tself::resetCache();\n\t}",
"public function delete($type, $id);",
"function deleteType()\n {\n global $objDatabase, $_ARRAYLANG;\n\n if (isset($_GET['typeId'])) {\n $typeId=intval($_GET['typeId']);\n $objResult = $objDatabase->Execute(\"SELECT id FROM \".DBPREFIX.\"module_news WHERE typeid=\".$typeId);\n\n if ($objResult !== false) {\n if (!$objResult->EOF) {\n $this->strErrMessage = $_ARRAYLANG['TXT_TYPE_NOT_DELETED_BECAUSE_IN_USE'];\n }\n else {\n if ($objDatabase->Execute(\n \"DELETE tblC, tblL\n FROM \".DBPREFIX.\"module_news_types AS tblC\n INNER JOIN \".DBPREFIX.\"module_news_types_locale AS tblL ON tblL.type_id=tblC.typeid\n WHERE tblC.typeid=\".$typeId\n ) !== false\n ) {\n $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_DELETED_SUCCESSFUL'];\n } else {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n }\n }\n }\n }\n }",
"public function setDeDuplicationId(?string $value): void {\n $this->getBackingStore()->set('deDuplicationId', $value);\n }",
"public function setTypeID($value) {\n\t\t$this->_type_id = $value;\n\t}",
"public static function post_deleteUser($arguments) {\n\t\t// Find all objectid/tagId pairs.\n\t\t$result = null;\n\t\ttry {\n\t\t\t$stmt = \\OCP\\DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '\n\t\t\t\t. 'WHERE `uid` = ?');\n\t\t\t$result = $stmt->execute(array($arguments['uid']));\n\t\t\tif (\\OCP\\DB::isError($result)) {\n\t\t\t\t\\OCP\\Util::writeLog('core', __METHOD__. 'DB error: ' . \\OCP\\DB::getErrorMessage($result), \\OCP\\Util::ERROR);\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\OCP\\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),\n\t\t\t\t\\OCP\\Util::ERROR);\n\t\t}\n\n\t\tif(!is_null($result)) {\n\t\t\ttry {\n\t\t\t\t$stmt = \\OCP\\DB::prepare('DELETE FROM `' . self::RELATION_TABLE . '` '\n\t\t\t\t\t. 'WHERE `categoryid` = ?');\n\t\t\t\twhile( $row = $result->fetchRow()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$stmt->execute(array($row['id']));\n\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t\\OCP\\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),\n\t\t\t\t\t\t\t\\OCP\\Util::ERROR);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\\OCP\\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),\n\t\t\t\t\t\\OCP\\Util::ERROR);\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\t$stmt = \\OCP\\DB::prepare('DELETE FROM `' . self::TAG_TABLE . '` '\n\t\t\t\t. 'WHERE `uid` = ?');\n\t\t\t$result = $stmt->execute(array($arguments['uid']));\n\t\t\tif (\\OCP\\DB::isError($result)) {\n\t\t\t\t\\OCP\\Util::writeLog('core', __METHOD__. ', DB error: ' . \\OCP\\DB::getErrorMessage($result), \\OCP\\Util::ERROR);\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\OCP\\Util::writeLog('core', __METHOD__ . ', exception: '\n\t\t\t\t. $e->getMessage(), \\OCP\\Util::ERROR);\n\t\t}\n\t}",
"function tutor_assignment_delete($username, $type, $selected_uid) {\n $type = rtrim($type, \"s\");\n\n $select = eto_user_load($selected_uid);\n \n $title = \"Delete the $type '\" . $select->name . \"' from $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'selected_uid' => $selected_uid,\n\t\t\t 'type' => $type);\n\n $output .= \"Are you sure you want to delete this assignment?\";\n $output .= drupal_get_form('delete_assignment_form', $node);\n\n return $output;\n}",
"public static function untagOnDelete();",
"public function setO_unite_delai($io_unite_delai) {\n\t\t\tif(!is_object($io_unite_delai)) {\n\t\t\t\tMessage::bufferMessage(new Message('all', 3, 'x', 'setO_unite_delai'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/* Check class */\n\t\t\tif(get_class($io_unite_delai) != 'Cust_unite' && get_class($io_unite_delai) != 'stdClass') {\n\t\t\t\tMessage::bufferMessage(new Message('all', 2, 'x', 'Cust_unite', get_class($io_unite_delai)));\n\t\t\t} elseif (get_class($io_unite_delai) == 'Cust_unite') {\n\t\t\t\t/* Object is Cust_unite, direct assignment */\n\t\t\t\t$this->o_unite_delai = $io_unite_delai;\n\t\t\t\t$this->o_unite_delai->setUnite($this->getDelai_unite());\n\t\t\t} else {\n\t\t\t\t/* Object is stdClass, convert it to desired class */\n\t\t\t\t$lt_data = [];\n\t\t\t\tforeach ($io_unite_delai as $lv_key => $lv_value) {\n\t\t\t\t\t$lv_key = Utilities::convertJsToPhpVar($lv_key);\n\t\t\t\t\t$lt_data[$lv_key] = $lv_value;\n\t\t\t\t}\n\t\t\t\t$this->o_unite_delai = new Cust_unite($lt_data);\n\t\t\t}\n\t\t}",
"public function delete($identifier);",
"function delete_classifiers($type, $id) {\n\tglobal $CONFIG;\n\t$id_name = $type == \"entity\" ? \"guid\" : \"id\";\n\tdelete_data(\"DELETE FROM {$CONFIG->dbprefix}classifiers WHERE \n\t\ttype='{$type}' AND id=$id\");\n}",
"public function setO_unite_duree($io_unite_duree) {\n\t\t\tif(!is_object($io_unite_duree)) {\n\t\t\t\tMessage::bufferMessage(new Message('all', 3, 'x', 'setO_unite_duree'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/* Check class */\n\t\t\tif(get_class($io_unite_duree) != 'Cust_unite' && get_class($io_unite_duree) != 'stdClass') {\n\t\t\t\tMessage::bufferMessage(new Message('all', 2, 'x', 'Cust_unite', get_class($io_unite_duree)));\n\t\t\t} elseif (get_class($io_unite_duree) == 'Cust_unite') {\n\t\t\t\t/* Object is Cust_unite, direct assignment */\n\t\t\t\t$this->o_unite_duree = $io_unite_duree;\n\t\t\t\t$this->o_unite_duree->setUnite($this->getDuree_unite());\n\t\t\t} else {\n\t\t\t\t/* Object is stdClass, convert it to desired class */\n\t\t\t\t$lt_data = [];\n\t\t\t\tforeach ($io_unite_duree as $lv_key => $lv_value) {\n\t\t\t\t\t$lv_key = Utilities::convertJsToPhpVar($lv_key);\n\t\t\t\t\t$lt_data[$lv_key] = $lv_value;\n\t\t\t\t}\n\t\t\t\t$this->o_unite_duree = new Cust_unite($lt_data);\n\t\t\t}\n\t\t}",
"public static function unregister_object_type($type_identifier){\r\n $db = new argent_database();\r\n \r\n $error = new argent_error();\r\n \r\n if (!self::valid_object_type($type_identifier))\r\n $error->add('1036','Unregistered object type',$type_identifier,'argent_meta');\r\n \r\n if (self::is_system_type($type_identifier))\r\n $error->add ('1037', 'System type cannot be modified', $type_identifier.' > '.$type_name, 'argent_meta');\r\n \r\n if ($error->has_errors())\r\n return $error;\r\n \r\n $sql = \"\r\n DELETE FROM\r\n `ua_object_types`\r\n WHERE\r\n `type_identifier` = '{$db->escape_value(strtoupper($type_identifier))}'\r\n \";\r\n $res = $db->query($sql);\r\n \r\n if (!$res)\r\n {\r\n $error->add('1000','Database Error',$sql,'argent_meta');\r\n return $error;\r\n }\r\n \r\n return true;\r\n }",
"function delete_purpose( $iUid, $sClass='' ) {\n \n\t\tinitializeJsonArray();\n\t\t\n $iUid = safeText($iUid, false, '', true);\n \n\t\tif( isAdminLoggedIn() ) {\n\t\t\t\n //p($iUid);\n if( $iUid != 1 ) {\n \n $this->db->where('uid', $iUid);\n $this->db->delete('contact_us_purposes');\n \n $this->aJsonOutput['output']['success'] = formatMessage('The purpose has been deleted', 'success');\n \n } else {\n \n $this->aJsonOutput['output']['error'] = formatMessage('The \"general\" purpose cannot be deleted', 'error');\n }\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$this->aJsonOutput['output']['error_type'] = $this->aErrorTypes['not_logged_in'];\n\t\t\t$this->aJsonOutput['output']['error'] = 'Not logged In';\n\t\t\t\n\t\t}\n\t\t$this->aJsonOutput['output']['c'] = $sClass;\n\t\toutputJson();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine loading arrangement of modules. | public static function determineModuleOrder(): array {
$module_order = ['Core'];
$failed = [];
foreach (self::getModules() as $module) {
if ($module->getName() == 'Core') {
continue;
}
foreach ($module_order as $n => $nValue) {
$before_after = Util::findBeforeAfter($module_order, $nValue);
if (!array_diff($module->getLoadAfter(), $before_after[0]) && !array_diff($module->getLoadBefore(), $before_after[1])) {
array_splice($module_order, $n + 1, 0, $module->getName());
continue 2;
}
}
$failed[] = $module->getName();
}
return ['modules' => $module_order, 'failed' => $failed];
} | [
"public static function computeLoadingOrder($modules){\n\t\t// build a list of module pseudo object to set flags\n\t\t$module_list = array();\n\t\tforeach ($modules as $module){\n\t\t\t$mod = new \\stdClass();\n\t\t\t$mod->name = $module->name;\n\t\t\t$mod->is_loaded = false;\n\t\t\t$mod->dependencies = json_decode($module->dependencies ?: \"[]\");\n\t\t\t$module_list[$module->name] = $mod;\n\t\t}\n\t\t// compute the loading order\n\t\t// NOTE : can be optimized by sorting with # of dependencies\n\t\t$module_loaded = array();\n\t\tforeach ($module_list as $module){\n\t\t\tstatic::_computeLoadingOrder($module_list, $module, $module_loaded);\n\t\t}\n\t\treturn $module_loaded;\n\t}",
"private function buildLoadingOrder()\n {\n $loadingOrder = [];\n\n foreach ($this->configs as $bundle) {\n $name = $bundle->getName();\n\n $loadingOrder[$name] = [];\n\n foreach ($bundle->getLoadAfter() as $package) {\n $loadingOrder[$name][] = $package;\n }\n }\n\n return $loadingOrder;\n }",
"public function getLoadedModules();",
"public function getLoadedModules() {}",
"public function loadModules();",
"public function getRequiredModules();",
"private function getModuleOrder() {\n $modules = array();\n try {\n $data = parse_ini_file( self::$CONFIGFILE );\n $modules = $data['modules'];\n } catch(Exception $e) {\n $modules = scandir(self::$MODMASTERDIR);\n }\n return $modules;\n }",
"private static function _computeLoadingOrder($list, $module, &$loaded, $limit=0){\n\t\tif($limit > 1000) return ''; // Make sure not to have an endless recursion --> not sure\n\t\t$module_name = $module->name;\n\t\tif(!$list[$module_name]->is_loaded){\n\t\t\t$dependencies = $list[$module_name]->dependencies;\n\t\t\tforeach ($dependencies as $dep_name){\n\t\t\t\tstatic::_computeLoadingOrder($list, $list[$dep_name], $loaded, $limit++);\n\t\t\t}\n\t\t\t$list[$module_name]->is_loaded = true;\n\t\t\t$loaded[] = $module_name;\n\t\t}\n\t}",
"protected function loadModules()\n\t{\n\t\t/**\n\t\t * Loads the scripts module\n\t\t */\n\t\t$this->loadModule('Anunaboilerplate_Scripts');\n\n\t\t/**\n\t\t * Loads the views module\n\t\t */\n\t\t$this->loadModule('Anunaboilerplate_Views');\n\t}",
"private function _loadDefered() {\r\n\t\t$defered = $this->_defered;\r\n\t\t$this->_defered = [];\r\n\r\n\t\tforeach ($defered as $name) {\r\n\t\t\tif (!array_key_exists($name, $this->_modules)) $this->_loadModule($name);\r\n\t\t}\r\n\t}",
"protected function sortModules()\n {\n uasort($this->search_path, function ($l, $r) {\n if ($l['precedence'] !== $r['precedence'])\n return $l['precedence'] - $r['precedence'];\n return strcmp($l['path'], $r['path']);\n });\n\n $this->sorted = true;\n }",
"public function modules_loaded() {\r\n $this->desploy_modules_position();\r\n }",
"private function loadModules()\n {\n //echo 'loading modules ';var_dump(Ini::$storeModules); \n foreach (Ini::$storeModules as $module)\n {\n $className = \\Sys\\Sysutils::Ucase($module);\n $fqClassname = \"\\\\Sys\\\\\".$className;\n Ini::loadModule(\\Sys\\Sysutils::Ucase($module), \\Sys\\Sysutils::Ucase($module), '\\Sys');\n Ini::$autoLoadedClasses[$className] = $fqClassname; \n }\n\n }",
"private function loadModuleStates()\n {\n if ($this->option('modules')) {\n $this->syncWithManualOption();\n return;\n }\n\n if ($this->option('fresh') !== true) {\n $this->syncWithDatabase();\n return;\n }\n\n $this->alert(\"Real module state is taken into considerations.\");\n }",
"private function sortModules($a, $b)\n {\n if (\n !empty($b[self::MODULE_DEPENDS])\n && in_array($a[self::MODULE_NAME], $b[self::MODULE_DEPENDS])\n ) {\n return 1;\n }\n if (\n !empty($a[self::MODULE_DEPENDS])\n && in_array($b[self::MODULE_NAME], $a[self::MODULE_DEPENDS])\n ) {\n return -1;\n }\n return 0;\n }",
"private function geatherModules() {\n /* getting global modules for all site */\n foreach ($this->routes_config->global as $module) {\n $this->fetchModules($module);\n }\n /* excludes modules for current subdomain */\n foreach ($this->subdomain->exclude as $module) {\n if ($module->attr('name') == '*') {\n $this->modules = array();\n continue;\n }\n $this->fetchModules($module, false);\n }\n /* getting global modules for current subdomain */\n foreach ($this->subdomain->global as $module) {\n $this->fetchModules($module);\n }\n /* excludes module for current route */\n foreach ($this->croute->exclude as $module) {\n if ($module->attr('name') == '*') {\n $this->modules = array();\n continue;\n }\n $this->fetchModules($module, false);\n }\n /* getting modules for current route */\n foreach ($this->croute->include as $module) {\n $this->fetchModules($module);\n }\n /* getting parameters for current route */\n if ($this->croute->params->param) {\n foreach ($this->croute->params->param as $param) {\n $this->route_params[$param->attr('name')] = $param->val();\n }\n }\n }",
"protected function loadModules()\n {\n foreach ($this->modules as $key => $null) {\n $this->modules[$key] = new $key($this);\n $this->modules[$key]->load();\n }\n }",
"private function load_modules() {\n\t\t$factory = new Factory( $this->customizer_modules );\n\t\t$factory->load_modules();\n\t}",
"abstract protected function loadDependencies();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is for add tags to followers. | public function addTagsToFollowers($channelId, $followers, $tags, $idType = 'user')
{
$url = $this->weconnectDomain . '/accounts/' . $channelId . '/users/bulkAddTags';
$params = ['tags' => $tags];
if ($idType === 'user') {
$params['userIds'] = $followers;
} else if ($idType === 'origin') {
$params['originIds'] = $followers;
}
return $this->_curl(self::METHOD_POST, $url, 'channel', $params, false);
} | [
"public function addFollower($tgn)\n {\n $this->db->query(\"select * from relation_between_user_id_tag_id where user_id = '\".$_SESSION['sessiondata']['user_id'].\"' and tag_id='\".$tgn.\"'\");\n if($this->db->affected_rows() > 0){\n $this->db->query(\"update relation_between_user_id_tag_id set status= '\".\"live\".\"' where user_id = '\".$_SESSION['sessiondata']['user_id'].\"' and tag_id='\".$tgn.\"'\");\n }\n else {\n $data = array(\n 'tag_id' => $tgn,\n 'user_id' =>$_SESSION['sessiondata']['user_id'] \n ); \n $this->db->insert('relation_between_user_id_tag_id',$data);\n\n }\n\n $this->db->set('followed_by','`followed_by`+1',FALSE);\n $this->db->where('tag_id',$tgn);\n return $this->db->update('tags');\n\n \n }",
"public function follower(){\n\t\t\t$id=AuthComponent::user('id');\n\t\t\t$this->loadModel('User');\n\t\t\t$this->loadModel('Tweet');\n\n\t\t\t$this->Paginator->settings = array(\n\t\t 'conditions'=>array('User.id'=>$this->Follower->getFolloweridList($id)),\n\t\t 'limit' => 10\n\t\t );\n\t\t $feed = $this->Paginator->paginate('User');\n\t\t $this->set('followers',$feed);\n\n\t\t\t$this->setSidebarData($id);\n\t\t}",
"function bp_follow_add_listing_follow_button() {\n\tglobal $members_template;\n\n\tif ( bp_loggedin_user_id() === $members_template->member->id ) {\n\t\treturn;\n\t}\n\n\tbp_follow_add_follow_button( 'leader_id=' . $members_template->member->id );\n}",
"public function followNewFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n if (!$user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n return;\n }\n\n $instagram = $this->inicializeInstagramSocializer($user_id, $args);\n\n /* @var Instagram_follower[] $followers */\n $followers = $user\n ->instagram_follower\n ->where('need_follow', true)\n ->where('access_token_id', $access_token_id)\n ->get();\n foreach($followers as $follower) {\n $answer = $instagram->modifyUserRelationship($follower->follower_id, 'follow');\n if ($answer->meta->code != 200) {\n echo $answer->meta->error_message;\n if ($answer->meta->error_type == 'OAuthPermissionsException') {\n break;\n }\n } else {\n $follower->setNeedFollow(false);\n $follower->save();\n }\n }\n }",
"public function add_follow_button() {\n\t\tif ( false === bp_follow_activity_can_follow() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tbp_follow_activity_button();\n\t}",
"function bp_follow_add_profile_follow_button() {\n\tbp_follow_add_follow_button();\n}",
"public function addTag();",
"function bp_follow_add_group_member_follow_button() {\n\tglobal $members_template;\n\n\tif ( bp_loggedin_user_id() === $members_template->member->user_id || ! bp_loggedin_user_id() ) {\n\t\treturn;\n\t}\n\n\tbp_follow_add_follow_button( 'leader_id=' . $members_template->member->user_id );\n}",
"public function addTags()\n {\n $this->tagsservice->addTags();\n }",
"public function add_task_followers()\n {\n\n if (!has_permission('manageTasks')) {\n access_denied('manageTasks');\n }\n\n echo json_encode(array(\n 'success' => $this->tasks_model->add_task_followers($this->input->post())\n ));\n }",
"public function add_related_tags($tagnames) {\n $context = context_system::instance();\n $tagobjects = static::create_if_missing($this->tagcollid, $tagnames);\n\n $currenttags = static::get_item_tags('core', 'tag', $this->id);\n\n foreach ($tagobjects as $name => $tag) {\n foreach ($currenttags as $currenttag) {\n if ($currenttag->name === $name) {\n continue 2;\n }\n }\n $this->add_instance('core', 'tag', $tag->id, $context, 0);\n $tag->add_instance('core', 'tag', $this->id, $context, 0);\n $currenttags[] = $tag;\n }\n }",
"function bp_follow_add_following_tab() {\n\n\tif ( ! is_user_logged_in() ) {\n\t\treturn;\n\t}\n\n\t$count = bp_follow_get_the_following_count();\n\n\tif ( empty( $count ) ) {\n\t\treturn;\n\t}\n?>\n\n\t<li id=\"members-following\"><a href=\"<?php echo bp_loggedin_user_domain() . BP_FOLLOWING_SLUG ?>\"><?php printf( __( 'Following <span>%d</span>', 'buddypress-followers' ), esc_html( $count ) ) ?></a></li>\n\n<?php\n}",
"public function addFollowers($followers)\n {\n if (is_array($followers)) {\n foreach ($followers as $follower)\n $this->followers->add($follower);\n } else {\n $this->followers->add($followers);\n }\n }",
"public function updateFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n \n $twitter = $this->inicializeTwitterSocializer($user_id, $args);\n\n $user->twitter_follower\n ->where('still_follow', true)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'still_follow' => false\n ]);\n\n $answer = $twitter->get_followers();\n if ($answer->errors) {\n foreach($answer->errors as $err) {\n log_message('TASK_ERROR', __FUNCTION__ . 'Twitter error: code: '.$err->code.'. Message: ' . $err->message);\n }\n } else {\n $followersIds = $answer->ids;\n Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'unfollow_time' => null,\n 'still_follow' => true\n ]);\n $exists_followers_ids = Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->get()->all_to_array('follower_id');\n $new_followers_ids = [];\n foreach($exists_followers_ids as $exists_followers_id) {\n if(!in_array($exists_followers_id['follower_id'], $followersIds)) {\n $new_followers_ids[] = $exists_followers_id['follower_id'];\n }\n }\n foreach ($new_followers_ids as $new_followers_id) {\n $twitterFollower = new Twitter_follower();\n $twitterFollower->setFollowerId($new_followers_id);\n $twitterFollower->setUserId($user_id);\n if ($user->ifUserHasConfigValue('auto_send_welcome_message', $access_token_id)) {\n $twitterFollower->setNeedMessage(true);\n }\n if ($user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n $twitterFollower->setNeedFollow(true);\n }\n $twitterFollower->setStillFollow(true);\n $twitterFollower->setAccessTokenId($access_token_id);\n $twitterFollower->save();\n }\n\n $unfollowers_query = [\n 'still_follow' => false,\n 'unfollow_time' => null,\n 'start_follow_time' => null,\n 'end_follow_time' => null,\n 'access_token_id' => $access_token_id\n ];\n\n $new_unfollowers_count = $user->twitter_follower\n ->where($unfollowers_query)\n ->count();\n\n $user->twitter_follower\n ->where($unfollowers_query)\n ->update([\n 'unfollow_time' => time()\n ]);\n Social_analytics::updateAnalytics(\n $access_token_id,\n Social_analytics::NEW_UNFOLLOWERS_ANALYTICS_TYPE,\n $new_unfollowers_count\n );\n }\n }",
"public function setFollow()\n\t{\n\t\t$tag_id=$_SESSION['tag_id'];\n\t\t$data=$_SESSION['user_data'];\n\t\t$u_id=$data['u_id'];\n\t\t$insert_data=array(\n\t\t\t'u_id'=>$u_id,\n\t\t\t'tag_id'=>$tag_id\n\t\t\t);\n\t\t$this->load->model(\"Tag_model\");\n\t\t$tmodel = new Tag_model;\n\t\t$flag=$tmodel->setFollowDB($insert_data);\n\t\tif($flag)\n\t\t{\n\t\t\t$response=array('result'=>1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response=array('result'=>1);\n\n\t\t}\n\n\t\techo json_encode($response);\n\n\t}",
"function tagging_on_update_post(&$datahandler)\r\n{\r\n\tglobal $mybb, $post, $plugins, $db;\r\n\tif($post['uid'] != $mybb->user['uid'])\r\n\t\treturn;\r\n\t$pid = $datahandler->data['pid'];\r\n\t$tid = $datahandler->data['tid'];\r\n\t$old_tags = unserialize($post['tags']);\r\n\tif(!is_array($old_tags))\r\n\t\t$old_tags = array();\r\n\t$old_tags_tag = array();\r\n\t$old_tags_uid = array();\r\n\tforeach($old_tags as $key => $t)\r\n\t{\r\n\t\tif(preg_match(\"#\".preg_quote(\"@[{$t['username']}\").\"#\", $post['message']))\r\n\t\t{\r\n\t\t\t$old_tags_tag[$key] = $t['username'];\r\n\t\t\t$old_tags_uid[$key] = $t['uid'];\r\n\t\t}\r\n\t\tif(preg_match(\"#\".preg_quote(\"@[{$t['uid']}\").\"#\", $post['message']))\r\n\t\t{\r\n\t\t\t$old_tags_tag[$key] = $t['uid'];\r\n\t\t\t$old_tags_uid[$key] = $t['uid'];\r\n\t\t}\r\n\t}\r\n\t$tags = get_tags_from_message(tagging_strip_post($datahandler->data['message']));\r\n\t$exclude = array($post['uid'], $post['username']);\r\n\t$u_tags = array_diff($tags, $exclude, $old_tags_tag);\r\n\t$n_tags = array();\r\n\tif(count($u_tags))\r\n\t{\r\n\t\t$uids = array();\r\n\t\tforeach($u_tags as $tag)\r\n\t\t{\r\n\t\t\t$user = tagging_get_user($tag);\r\n\t\t\tif(!in_array(intval($user['uid']), $uids))\r\n\t\t\t{\r\n\t\t\t\tif(tagging_can_tag_user($post['uid'], $user['uid']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$uids[] = $user['uid'];\r\n\t\t\t\t\t$n_tags[] = array('uid' => $user['uid'], 'username' => $user['username']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($uids))\r\n\t\t{\r\n\t\t\t$params = array('pid' => $pid, 'tid' => $tid, 'users' => $uids);\r\n\t\t\t$plugins->run_hooks(\"tagging_tag_added\", $params);\r\n\t\t\ttagging_send_pm($uids, $post['uid'], $mybb->settings['tagging_tag_pm_title'], str_replace(array(\"{bburl}\", \"{posturl}\"), array($mybb->settings['bburl'] . \"/\", get_post_link($pid) . \"#pid\" . $pid), $mybb->settings['tagging_tag_pm_message']));\r\n\t\t}\r\n\t}\r\n\t$r_tags = array_diff($old_tags_tag, $tags);\r\n\t$r_uids = array();\r\n\tforeach($r_tags as $key => $tag)\r\n\t{\r\n\t\t$r_uids[] = $old_tags_uid[$key];\r\n\t\tunset($old_tags[$key]);\r\n\t}\r\n\tif(count($r_uids))\r\n\t{\r\n\t\t$params = array('pid' => $pid, 'tid' => $tid, 'users' => $uids);\r\n\t\t$plugins->run_hooks(\"tagging_tag_removed\", $params);\r\n\t}\r\n\t$data = array_merge($old_tags, $n_tags);\r\n\tif(count($data))\r\n\t\t$datahandler->post_update_data['tags'] = $db->escape_string(serialize($data));\r\n\telse\r\n\t\t$datahandler->post_update_data['tags'] = \"\";\r\n}",
"public function addMentionsFromBody()\n {\n $entity = $this->getItem();\n $usernames = $this->extractMentions($entity->body);\n\n foreach ($usernames as $username) {\n $entity->addMention(trim($username));\n }\n\n $this->_newly_mentioned = $usernames;\n }",
"function pods_twitter_follow() {\n\t$twitter = get_the_author_meta('twitter');\n\t$name = get_author_meta('user_firstname');\n\t?>\n\t<a class=\"twitter-follow-button\" data-show-count=\"false\" href=\"<?php echo $twitter; ?>\">Follow <?php echo $name; ?></a>\n\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n<?php\n}",
"function addTags() {\n // tossing all tags into one array\n @$alltags = array_merge($this->matchedCompanyTags, $this->matchedSubjectTags);\n\n // splitting up comma separated values and putting them back into the array\n @$tags = explode(',',join(\",\", $alltags));\n\n // cleaning the tags\n $cleantags = \"\";\n foreach ($tags as $tag) {\n $tag = trim($tag);\n if (!empty($tag))\n $cleantags[] = \"[$tag]\";\n }\n\n // removing duplicates\n if (is_array($cleantags)) {\n $cleantags = array_unique($cleantags);\n\n // sorting tags\n asort($cleantags);\n\n // joining them into one string\n $this->tags=implode($cleantags);\n\n $this->output(\"tags: \" . $this->tags);\n }\n else {\n $this->output(\"tags: no tags to assign\");\n }\n\n // changing date in fileName only if tags are to assign\n if (!empty($this->tags))\n $this->newName = str_replace(\"[nt]\",$this->tags, $this->newName);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fit the transformer to a dataset. | public function fit(Dataset $dataset) : void
{
$this->dfs = array_fill(0, $dataset->numFeatures(), 0);
$this->n = 0;
$this->update($dataset);
} | [
"public function fit(Dataset $dataset) : void\n {\n SamplesAreCompatibleWithTransformer::check($dataset, $this);\n\n $columns = $dataset->numColumns();\n\n $p = count(static::DISTRIBUTION) - 1;\n\n $r = [];\n\n while (count($r) < $columns) {\n $row = [];\n\n while (count($row) < $this->dimensions) {\n $row[] = static::DISTRIBUTION[rand(0, $p)];\n }\n\n $r[] = $row;\n }\n\n $this->r = Matrix::quick($r);\n }",
"public function fit(Dataset $dataset) : void\n {\n SamplesAreCompatibleWithTransformer::with($dataset, $this)->check();\n\n $donors = [];\n\n foreach ($dataset->samples() as $sample) {\n foreach ($sample as $value) {\n if (is_float($value)) {\n if (is_nan($value)) {\n continue 2;\n }\n } else {\n if ($value === $this->categoricalPlaceholder) {\n continue 2;\n }\n }\n }\n\n $donors[] = $sample;\n }\n\n if (empty($donors)) {\n throw new RuntimeException('No complete donors found in dataset.');\n }\n\n $labels = array_fill(0, count($donors), '');\n\n $this->tree->grow(Labeled::quick($donors, $labels));\n }",
"public function fit(Dataset $dataset) : void\n {\n if (!$dataset instanceof Labeled) {\n throw new InvalidArgumentException('This transformer requires'\n . ' a Labeled dataset.');\n }\n\n $classes = $dataset->possibleOutcomes();\n\n $zeros = array_fill(0, $dataset->numFeatures(), 0);\n\n $this->tfs = array_fill_keys($classes, $zeros);\n $this->dfs = $this->totals = $zeros;\n $this->n = 0;\n\n $this->update($dataset);\n }",
"public function fit(Dataset $dataset) : void\n {\n if (!$dataset->homogeneous() or $dataset->columnType(0) !== DataType::CONTINUOUS) {\n throw new InvalidArgumentException('This transformer only works'\n . ' with continuous features.');\n }\n\n $columns = $dataset->numColumns();\n\n $p = count(static::DISTRIBUTION) - 1;\n\n $r = [];\n\n for ($i = 0; $i < $columns; $i++) {\n $row = [];\n\n for ($j = 0; $j < $this->dimensions; $j++) {\n $row[] = static::DISTRIBUTION[rand(0, $p)];\n }\n\n $r[] = $row;\n }\n\n $this->r = Matrix::quick($r);\n }",
"public function train(Dataset $dataset) : void\n {\n SpecificationChain::with([\n new DatasetIsLabeled($dataset),\n new DatasetIsNotEmpty($dataset),\n new LabelsAreCompatibleWithLearner($dataset, $this),\n ])->check();\n\n $this->strategy->fit($dataset->labels());\n }",
"public function setTrainingData(Dataset $dataset)\n {\n $this->trainingData = $dataset;\n }",
"public function train(Dataset $dataset) : void\n {\n DatasetIsCompatibleWithEstimator::check($dataset, $this);\n\n $samples = $dataset->samples();\n\n $dataset = Labeled::quick($samples, array_keys($samples));\n\n $this->tree->grow($dataset);\n\n $this->kdistances = $this->lrds = [];\n\n $indices = $distances = [];\n\n foreach ($dataset as $sample) {\n [$iHat, $dHat] = $this->tree->nearest($sample, $this->k);\n\n $distances[] = $dHat;\n $indices[] = $iHat;\n \n $this->kdistances[] = end($dHat);\n }\n\n foreach ($distances as $i => $row) {\n $this->lrds[] = $this->localReachabilityDensity($indices[$i], $row);\n }\n\n $lofs = [];\n\n foreach ($dataset as $sample) {\n $lofs[] = $this->localOutlierFactor($sample);\n }\n\n $shift = Stats::percentile($lofs, 100. * $this->contamination);\n \n $this->offset = self::THRESHOLD + $shift;\n }",
"public function train(Dataset $dataset) : void\n {\n $specifications = [\n new DatasetIsNotEmpty($dataset),\n new SamplesAreCompatibleWithEstimator($dataset, $this),\n ];\n\n if ($this->type()->isSupervised()) {\n $specifications[] = new DatasetIsLabeled($dataset);\n\n if ($dataset instanceof Labeled) {\n $specifications[] = new LabelsAreCompatibleWithLearner($dataset, $this);\n }\n }\n\n SpecificationChain::with($specifications)->check();\n\n $p = max(self::MIN_SUBSAMPLE, (int) round($this->ratio * $dataset->numSamples()));\n\n $this->backend->flush();\n\n for ($i = 0; $i < $this->estimators; ++$i) {\n $estimator = clone $this->base;\n\n $subset = $dataset->randomSubsetWithReplacement($p);\n\n $task = new TrainLearner($estimator, $subset);\n\n $this->backend->enqueue($task);\n }\n\n $this->ensemble = $this->backend->process();\n }",
"public function train(Dataset $dataset) : void\n {\n $specifications = [\n new DatasetIsNotEmpty($dataset),\n new SamplesAreCompatibleWithEstimator($dataset, $this),\n ];\n\n if ($this->type()->isSupervised()) {\n $specifications[] = new DatasetIsLabeled($dataset);\n\n if ($dataset instanceof Labeled) {\n $specifications[] = new LabelsAreCompatibleWithLearner($dataset, $this);\n }\n }\n\n SpecificationChain::with($specifications)->check();\n\n $this->backend->flush();\n\n foreach ($this->experts as $estimator) {\n $task = new TrainLearner($estimator, $dataset);\n\n $this->backend->enqueue($task);\n }\n\n $this->experts = $this->backend->process();\n\n switch ($this->type()) {\n case EstimatorType::classifier():\n if ($dataset instanceof Labeled) {\n $this->classes = array_fill_keys($dataset->possibleOutcomes(), 0.0);\n }\n\n break;\n\n case EstimatorType::anomalyDetector():\n $this->classes = [0 => 0.0, 1 => 0.0];\n\n break;\n }\n }",
"public function train(Dataset $dataset) : void\n {\n DatasetIsCompatibleWithEstimator::check($dataset, $this);\n\n $n = $dataset->numRows();\n \n $maxDepth = (int) ceil(log(max($n, 2), 2));\n\n $p = (int) round($this->ratio * $n);\n\n $this->forest = [];\n\n for ($epoch = 1; $epoch <= $this->estimators; $epoch++) {\n $tree = new ITree($maxDepth);\n\n $subset = $dataset->randomize()->head($p);\n\n $tree->grow($subset);\n\n $this->forest[] = $tree;\n }\n\n $this->pHat = $this->c($p);\n\n $scores = [];\n\n foreach ($dataset as $sample) {\n $scores[] = $this->isolationScore($sample);\n }\n\n $shift = Stats::percentile($scores, 100. * $this->contamination);\n\n $this->offset = $shift;\n }",
"public function setTestData(Dataset $dataset)\n {\n $this->testData = $dataset;\n }",
"public function setDataset(Dataset $dataset)\n {\n $this->dataset = $dataset;\n }",
"public function train(Dataset $dataset) : void\n {\n if (!$dataset instanceof Labeled) {\n throw new InvalidArgumentException('Learner requires a'\n . ' labeled training set.');\n }\n\n SamplesAreCompatibleWithEstimator::check($dataset, $this);\n\n if ($this->logger) {\n $this->logger->info('Learner init ' . Params::stringify([\n 'base' => $this->estimator,\n 'metric' => $this->metric,\n 'validator' => $this->validator,\n 'backend' => $this->backend,\n ]));\n }\n\n $this->backend->flush();\n\n $combinations = $this->combinations();\n\n foreach ($combinations as $params) {\n $estimator = new $this->base(...$params);\n\n $this->backend->enqueue(\n new Deferred(\n [self::class, 'score'],\n [\n $this->validator,\n $estimator,\n $dataset,\n $this->metric,\n ]\n ),\n function ($result) use ($params) {\n if ($this->logger) {\n $constructor = array_combine($this->args, $params);\n\n $this->logger->info(Params::stringify([\n 'Params' => $constructor ?: [],\n Params::shortName($this->metric) => $result,\n ]));\n }\n }\n );\n }\n\n $scores = $this->backend->process();\n\n $bestScore = -INF;\n $bestParams = [];\n\n foreach ($scores as $i => $score) {\n if ($score > $bestScore) {\n $bestParams = $combinations[$i];\n $bestScore = $score;\n }\n }\n\n $this->best = $bestParams;\n\n $estimator = new $this->base(...$bestParams);\n\n if ($this->logger) {\n $this->logger->info('Training learner with best'\n . ' params on full dataset');\n }\n\n $estimator->train($dataset);\n\n $this->estimator = $estimator;\n\n if ($this->logger) {\n $this->logger->info('Training complete');\n }\n }",
"public function predict(Dataset $dataset) : array;",
"public function fitted() : bool;",
"function fann_descale_train($ann, $train_data){}",
"public function predict(Dataset $dataset) : array\n {\n if ($dataset instanceof Labeled) {\n $dataset = $this->process($dataset);\n }\n\n return $this->conductor->predict($dataset);\n }",
"function fit($x,$y) { \n $yln = array_map('exp',$y);\n $fit = Polyfit::fit($x,$yln,1);\n $fit->eq = sprintf(\"%f + log(%f*x)\",log($fit->coef[0]), $fit->coef[1]);\n return $fit;\n }",
"public function getDataTransformers();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION FOR EDITING A GROUP END AJAX FUNCTION FOR POSTING THE ABOUT US CONTENT START | public function post_about_us_content(){
$this->layout = 'ajax';
$message = trim($_POST['aboutUsMessage']);
$groupId = $_POST['group_id'];
$groupArr = $this->Group->find('first', array('conditions'=>array('Group.id'=>$groupId)));
if($groupArr['Group']['user_id'] == $this->Session->read('Auth.User.User.id')){
$saveData['Group']['id'] = $groupId;
$saveData['Group']['description'] = $message;
if($this->Group->save($saveData)){
echo 'saved';
}else
echo '<font color="red">Please Try Later!!</font>';
}else
echo '<font color="red">Invalid Groups!!</font>';
exit;
} | [
"public function add_page() {\n global $wpdb;\n\n if (!current_user_can('add_small_groups')) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n\n // Fetch any action result forwarded to us\n $action_result = CRU_Utils::get_action_result(); \n?>\n<div class=\"wrap\">\n<h2 class=\"cru_admin_header\">\nAdd Small Group\n</h2>\n\n<?php\n CRU_Utils::print_action_result($action_result);\n\n // Retrieve the target areas\n $target_area_query = \"SELECT * FROM \" . $wpdb->prefix . CRU_Utils::_target_areas_table . \" ORDER BY area_name ASC\";\n $target_areas = $wpdb->get_results($target_area_query, ARRAY_A); \n\n // Collect the cru students and staff who lead groups\n $leaders = CRU_Contacts::get_contacts_short();\n\n if ($target_areas === NULL\n || !is_array($target_areas)\n || $leaders === NULL\n || !is_array($leaders)) {\n wp_die(__('Failed to retrieve information from the database'));\n } else {\n?>\n<form class=\"ajax-form\" method=\"post\" name=\"add-group\" id=\"add-group\" action=\"<?php echo(admin_url('admin.php?page=cru-handle-action')); ?>\">\n <input type=\"hidden\" name=\"_cru_add_small_group_nonce\" value=\"<?php echo(wp_create_nonce('cru_add_small_group')); ?>\">\n <input type=\"hidden\" name=\"action\" value=\"cru_add_small_group\">\n <table class=\"form-table\">\n <tbody>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"leader\">Leader <span class=\"description\">(required)</span></label></th>\n <td>\n <select name=\"leader\">\n <?php\n // Print out an <option> for each leader\n foreach ($leaders as $leader) {\n ?>\n <option value=\"<?php echo esc_attr($leader['ID']);?>\"><?php echo($leader['display_name']); ?></option>\n <?php\n }\n ?>\n </select name=\"leader\">\n </td>\n </tr>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"day\">Day <span class=\"description\">(required)</span></label></th> \n <td>\n <select name=\"day\" id=\"day\">\n <option selected=\"true\">Monday</option>\n <option>Tuesday</option>\n <option>Wednesday</option>\n <option>Thursday</option>\n <option>Friday</option>\n <option>Saturday</option>\n <option>Sunday</option>\n </select>\n </td>\n </tr>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"time\">Time <span class=\"description\">(required)</span></label></th>\n <td>\n <select name=\"time\" id=\"time\"> \n\t\t\t\t<option value=\"TBD\">TBD</option> \n <?php\n\n // Print out the time options from 8:00AM to 11:30AM\n for ($i = 8; $i <= 11; $i++) {\n for ($j = 0; $j < 2; $j++) {\n\t\t\t\t\t\t$time = sprintf(\"%d:%002dAM\", $i, $j * 30);\n ?> \n <option value=\"<?php echo $time?>\"><?php echo $time; ?></option>\n <?php \n }\n }\n ?> \n <option value=\"12:00PM\">12:00PM</option> \n <option value=\"12:30PM\">12:30PM</option> \n <?php\n // Print out the time options from 1:00PM to 10:00PM\n for ($i = 1; $i <= 10; $i++) {\n for ($j = 0; $j < 2; $j++) {\n\t\t\t\t\t\t$time = sprintf(\"%d:%002dPM\", $i, $j * 30);\n ?> \n <option value=\"<?php echo $time?>\"><?php echo $time; ?></option>\n <?php \n }\n }\n ?>\n <select>\n </td>\n </tr>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"area\">Target Area <span class=\"description\">(required)</span></label></th>\n <td>\n <select name=\"area_id\">\n <?php\n // Print out the target areas the group could be a part of\n foreach ($target_areas as $target_area) { ?>\n <option value=\"<?php echo esc_attr($target_area['area_id']); ?>\"><?php echo($target_area['area_name']); ?></option>\n <?php\n }\n ?>\n </select>\n </td>\n </tr>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"location\">Location: <span class=\"description\">(required)</span></label></th>\n <td>\n <textarea name=\"location\" id=\"location\" aria-required=\"true\" rows=\"4\" cols=\"50\"></textarea>\n </td>\n </tr>\n </tbody>\n </table>\n <p class=\"submit\"><input name=\"add_group\" id=\"add_group\" class=\"button button-primary\" value=\"Add New Small Group \" type=\"submit\"></p>\n</form>\n</div>\n<?php \n }\n }",
"function edit_group_popup()\n\t{\n\t\tif($this->scrap_wall->login_check_ajax() == TRUE)\n\t\t{\n\t\t\t// Get the view\n\t\t\t$this->load->view('customers/ajax/edit_customer_group_popup');\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 9876;\n\t\t}\n\t}",
"function it_exchange_membership_addon_ajax_add_content_access_group() {\n\n\tif ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], 'it-exchange-membership-product-edit' ) ) {\n\t\twp_send_json_error( array(\n\t\t\t'message' => __( 'Request expired. Please refresh the page and try again.', 'LION' )\n\t\t) );\n\t}\n\n\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\twp_send_json_error( array(\n\t\t\t'message' => __( 'You don\\'t have permission to do this.', 'LION' )\n\t\t) );\n\t}\n\n\t$return = '';\n\n\tif ( isset( $_REQUEST['count'] ) && isset( $_REQUEST['group_count'] ) ) { //use isset() in case count is 0\n\n\t\t$count = $_REQUEST['count'];\n\t\t$group_id = $_REQUEST['group_count'];\n\n\t\t$return = '<div class=\"it-exchange-membership-addon-content-access-rule it-exchange-membership-addon-content-access-group columns-wrapper\" data-count=\"' . $count . '\">';\n\n\t\t$return .= '<div class=\"it-exchange-membership-addon-sort-content-access-rule column\"></div>';\n\n\t\t$return .= '<input type=\"text\" name=\"it_exchange_content_access_rules[' . $count . '][group]\" class=\"it-exchange-membership-group-rule-title\" value=\"\" />';\n\t\t$return .= '<input type=\"hidden\" name=\"it_exchange_content_access_rules[' . $count . '][group_id]\" value=\"' . $group_id . '\" />';\n\n\t\t$return .= '<div class=\"group-layout-options\">';\n\t\t$return .= '<span class=\"group-layout active-group-layout\" data-type=\"grid\">grid</span><span class=\"group-layout\" data-type=\"list\">list</span>';\n\t\t$return .= '<input type=\"hidden\" class=\"group-layout-input\" name=\"it_exchange_content_access_rules[' . $count . '][group_layout]\" value=\"grid\" />';\n\t\t$return .= '</div>';\n\n\t\t$return .= '<div class=\"it-exchange-membership-addon-group-action-wrapper\">';\n\t\t$return .= '<div class=\"it-exchange-membership-addon-group-action\">ACTION</div>';\n\t\t$return .= '<div class=\"it-exchange-membership-addon-group-actions\">';\n\t\t$return .= '\t<div class=\"it-exchange-membership-addon-ungroup-content-access-group column\">';\n\t\t$return .= '\t\t<a href=\"#\">' . __( 'Ungroup', 'LION' ) . '</a>';\n\t\t$return .= '\t</div>';\n\t\t$return .= '\t<div class=\"it-exchange-membership-addon-remove-content-access-group column\">';\n\t\t$return .= '\t\t<a href=\"#\">' . __( 'Delete Group', 'LION' ) . '</a>';\n\t\t$return .= '\t</div>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\n\t\t$return .= '<input type=\"hidden\" class=\"it-exchange-content-access-group\" name=\"it_exchange_content_access_rules[' . $count . '][grouped_id]\" value=\"\" />';\n\n\t\t$return .= '<div class=\"columns-wrapper it-exchange-membership-content-access-group-content content-access-sortable\" data-group-id=\"' . $group_id . '\">';\n\t\t$return .= '<div class=\"nosort\">' . __( 'Drag content items into this area to group them together.', 'LION' ) . '</div></div>';\n\n\t\t$return .= '</div>';\n\t}\n\n\tdie( $return );\n}",
"function ubc_di_group_editer_callback() {\n\t\tglobal $wpdb;\n\t\tif ( ! isset( $_POST['ubc_di_nonce_field'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['ubc_di_nonce_field'] ) ), 'ubc_di_nonce_check' ) ) {\n\t\t\techo 'Sorry, WordPress has rejected your submission - specifically, your nonce did not verify. Please reload the form page and try again. This message may occur if you took more than a day to complete your form, if you do not have the appropriate privileges to submit soil sites but nonetheless try, or if the Digging In coding team made an error.';\n\t\t} else {\n\t\t\tif ( isset( $_POST['ubc_di_group_title'] ) && isset( $_POST['ubc_di_group_people'] ) && isset( $_POST['ubc_di_group_ta'] ) && isset( $_POST['ubc_di_group_id'] ) ) {\n\t\t\t\t$ubc_di_group_post = array(\n\t\t\t\t\t'ID' => intval( $_POST['ubc_di_group_id'] ),\n\t\t\t\t\t'post_title' => sanitize_text_field( wp_unslash( $_POST['ubc_di_group_title'] ) ),\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'post_type' => 'ubc_di_group',\n\t\t\t\t);\n\t\t\t\t$ubc_di_group_id = wp_update_post( $ubc_di_group_post );\n\t\t\t\t$ubc_di_group_people = explode( ',', sanitize_text_field( wp_unslash( $_POST['ubc_di_group_people'] ) ) );\n\t\t\t\tarray_pop( $ubc_di_group_people );\n\t\t\t\tupdate_post_meta( $ubc_di_group_id, 'ubc_di_group_people', $ubc_di_group_people );\n\t\t\t\tupdate_post_meta( $ubc_di_group_id, 'ubc_di_group_ta', intval( $_POST['ubc_di_group_ta'] ) );\n\t\t\t\techo intval( $_POST['ubc_di_group_id'] );\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t}",
"function edit_group()\n\t{\n\t\t// ----- APPLICATION PROFILER --------------------------------\n\t\t$this->output->enable_profiler(TRUE);\n\n\t\t// Some variables\n\t\t$show_host_id = $this->scrap_web->get_show_host_id();\n\t\t$group_name = $this->input->post('inpCustomerGroup');\n\t\t$group_id = $this->input->post('hdGroupId');\n\t\t$return_url = $this->input->post('hdReturnUrl');\n\n\t\t// Group info\n\t\t$url_group = 'fastsellcustomergroups/.json?id='.$group_id;\n\t\t$call_group = $this->scrap_web->webserv_call($url_group);\n\n\t\tif($call_group['error'] == FALSE)\n\t\t{\n\t\t\t$json_group = $call_group['result'];\n\n\t\t\t$json_group->name = $group_name;\n\t\t\t$json_group->show_host_organization->id = $show_host_id;\n\t\t\t$json_group->customer_organizations = null;\n\n\t\t\t// Add the customer ids to the group\n\t\t\tif($this->input->post('checkCustomer'))\n\t\t\t{\n\t\t\t\t// Some variables\n\t\t\t\t$ar_pv_customer_ids = $this->input->post('checkCustomer');\n\t\t\t\t$ar_customer_ids = array();\n\n\t\t\t\tforeach($ar_pv_customer_ids as $customer_id)\n\t\t\t\t{\n\t\t\t\t\tarray_push($ar_customer_ids, array('id' => $customer_id));\n\t\t\t\t}\n\t\t\t\t$json_group->customer_organizations = $ar_customer_ids;\n\t\t\t}\n\n\t\t\t// Encode\n\t\t\t$json_group = json_encode($json_group);\n\n\t\t\t// Create the group\n\t\t\t$update_group = $this->scrap_web->webserv_call('fastsellcustomergroups/.json', $json_group, 'post');\n\n\t\t\t// Redirect\n\t\t\tredirect($return_url);\n\t\t}\n\t}",
"function exit_group_edit_action(){\n global $object_group_editor_url;\n redirect_form_action($object_group_editor_url);\n}",
"public function edit_page() {\n global $wpdb;\n\n // TODO Add javascript for this page\n\n if (!current_user_can(\"edit_target_areas\")) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n\n if (CRU_Utils::get_request_param('area_id') === FALSE) {\n wp_die(__(\"Invalid area given\")); \n } else {\n $table_prefix = $wpdb->prefix;\n $area_contacts_table = $table_prefix . CRU_Utils::_area_contacts_table;\n\n // Check if the area even exists\n $area_id = CRU_Utils::get_request_param('area_id');\n $table_name = $table_prefix . CRU_Utils::_target_areas_table;\n $area_query = $wpdb->prepare(\"SELECT * FROM $table_name WHERE area_id = %s\", $area_id);\n $area = $wpdb->get_row($area_query, ARRAY_A);\n \n // Fetch the cru contacts\n $cru_contacts = CRU_Contacts::get_contacts_short();\n\n // Fetch the cru contacts who are affiliated with this area\n $affiliated_users = CRU_Target_Areas::get_affiliated_contacts($area_id);\n\n // Check the query results\n if ($area === NULL || !is_array($area)\n || $cru_contacts === NULL || !is_array($cru_contacts)\n || $affiliated_users === NULL || !is_array($affiliated_users)) {\n wp_die(__(\"Failed to retrieve any CRU contacts\"));\n } else {\n \n // Fetch any action results forwarded to this page\n $action_result = CRU_Utils::get_action_result();\n $area_id = CRU_Utils::get_request_param('area_id');\n?>\n<div class=\"wrap\">\n<h2 class=\"cru_admin_header\">\nEdit Target Area\n</h2>\n\n<?php CRU_Utils::print_action_result($action_result); ?>\n \n<table class=\"form-table\">\n<form class=\"ajax-form\" name=\"edit_area\" id=\"edit_area\" method=\"post\" action=\"<?php echo esc_attr(admin_url('admin.php?page=cru-handle-action&action=cru_edit_target_area')); ?>\">\n <input type=\"hidden\" name=\"_cru_edit_target_area_nonce\" value=\"<?php echo esc_attr(wp_create_nonce(\"cru_edit_target_area-$area_id\")); ?>\">\n <input type=\"hidden\" name=\"action\" value=\"cru_edit_target_area\">\n <input type=\"hidden\" name=\"area_id\" value=\"<?php echo esc_attr($area_id); ?>\">\n <table class=\"form-table\">\n <tbody>\n <tr class=\"form-field form-required\">\n <th scope=\"row\"><label for=\"area_name\">Target Area Name <span class=\"description\">(required)</span></label></th>\n <td>\n <input type=\"text\" class=\"regular-text\" name=\"area_name\" id=\"area_name\" value=\"<?php echo esc_attr($area['area_name']); ?>\">\n </td>\n </tr> \n </tbody>\n </table>\n <p class=\"submit\"><input name=\"edit_area\" id=\"edit_area\" class=\"button button-primary\" value=\"Edit Target Area \" type=\"submit\"></p>\n</form>\n</table>\n\n<h2 class=\"cru_admin_header\">\nView Affiliations\n</h2>\n\n<table class=\"wp-list-table widefat fixed\">\n<thead>\n <tr>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"contact\">Contact</label></th>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"affiliation_type\">Affiliation Type</label></th>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"button\"></label></th>\n </tr>\n</thead>\n <?php\n // Printout the affiliated users\n $index = 0;\n foreach($affiliated_users as $user) { ?>\n <tr<?php if ($index++ % 2 == 0) echo(' class=\"alternate\"'); ?>>\n <td class=\"username column-username\">\n <?php echo($user['display_name']); ?>\n </td>\n <td class=\"username column-username\">\n <?php echo (CRU_Target_Areas::get_affiliation_string($user['affiliation_type'])); ?>\n </td>\n <td class=\"username column-username\">\n <form class=\"ajax-form\" name=\"delete_affiliation\" method=\"post\" action=\"<?php echo esc_attr(CRU_Target_Areas::delete_affiliation_url($area_id)); ?>\">\n <input type=\"hidden\" name=\"contact_id\" value=\"<?php echo esc_attr($user['contact_id']); ?>\">\n <input type=\"hidden\" name=\"area_id\" value=\"<?php echo esc_attr($area_id); ?>\">\n <input type=\"hidden\" name=\"affiliation_type\" value=\"<?php echo esc_attr($user['affiliation_type']); ?>\">\n <?php $nonce = CRU_Target_Areas::delete_affiliation_nonce($area_id,\n $user['contact_id'],\n $user['affiliation_type']); ?>\n <input type=\"hidden\" name=\"_cru_delete_affiliation_nonce\" value=\"<?php echo esc_attr($nonce); ?>\">\n <p class=\"submit\">\n <input class=\"button button-primary\" id=\"delete_affiliation\" name=\"delete_affiliation\" value=\"Delete Affiliation\" type=\"submit\">\n </p>\n </form>\n </td>\n </tr>\n <?php\n }\n ?>\n</table>\n\n<h2 class=\"cru_admin_header\">\nAdd Affiliation\n</h2>\n\n<form class=\"ajax-form\" name=\"add_affiliation\" id=\"add_affiliation\" method=\"post\" action=\"<?php echo(admin_url('admin.php?page=cru-handle-action&action=cru_add_affiliation')); ?>\">\n <input type=\"hidden\" name=\"area_id\" value=\"<?php echo esc_attr(CRU_Utils::get_request_param('area_id')); ?>\">\n <input type=\"hidden\" name=\"_cru_add_affiliation_nonce\" value=\"<?php echo esc_attr(wp_create_nonce(\"cru_add_affiliation\")); ?>\">\n <table class=\"wp-list-table widefat fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"contact\">Contact</label></th>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"affiliation_type\">Affiliation Type</label></th>\n <th scope=\"col\" class=\"manage-column column\"><label for=\"button\"></label></th>\n </tr>\n </thead>\n <tr class=\"form-field form-required\"> \n <td>\n <select name=\"contact_id\" id=\"contact\">\n <?php\n foreach ($cru_contacts as $contact) {\n ?>\n <option value=\"<?php echo esc_attr($contact['ID']); ?>\"><?php echo $contact['display_name']; ?></option>\n <?php\n }\n ?>\n </select>\n </td>\n <td>\n <select name=\"affiliation_type\" id=\"affiliation_type\">\n\t\t\t\t<?php\n // Assumption made here that there is always at least one affiliation type\n\t\t\t\t\tforeach (CRU_Utils::$_affiliation_names as $affiliation => $name) { ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr($affiliation); ?>\"><?php echo $name; ?></option>\n\t\t\t\t<?php }?>\n </select>\n </td> \n <td>\n \n </td>\n </tr>\n </table>\n <p class=\"submit\"><input name=\"add_affiliation\" id=\"add_affiliation\" class=\"button button-primary\" value=\"Add Affiliation\" type=\"submit\"></p>\n</form>\n</div>\n<?php\n }\n }\n }",
"function ajax_edit_important_link()\n {\n $imLink_id = $this->uri(3);\n $page_data['imLink_id'] = $imLink_id;\n $htmlData = $this->load->view('backend/admin/ajax_elements/edit_important_link_form_holder' , $page_data, true);\n $this->jsonMsgReturn(true,'Edit Moad ON',$htmlData);\n }",
"public static function groups_page()\n\t{\n\n\t\t//If the form was submitted\n\t\tif ( $_POST ){\n\n\t\t\t//Do a bit of validation\n\t\t\tif ( ! $_POST['mz_group_name'] ){\n\t\t\t\t$error = 'You must fill in the form';\n\t\t\t\tmz_Groups::newGroupForm( $error );\n\t\t\t} else {\n\t\t\t\t//Make the update\n\t\t\t\t$mz_group_name = esc_sql( stripslashes( $_POST['mz_group_name'] ) );\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$ins = $wpdb->query('INSERT INTO ' . $wpdb->prefix . GROUPS_DB_TABLE . ' ( groupname , groupactive ) VALUES (\"' . $mz_group_name . '\" , \"0\") ');\n\t\t\t}\n\n\t\t}\n\n\n\t\techo '<div class=\"wrap\">';\n\t\techo '<h2>Mentorz - Group Administration</h2>';\n\n\t\t//Generate the form\n\t\tmz_Groups::newGroupForm();\n\n\t\tglobal $wpdb;\n\t\t$results = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . GROUPS_DB_TABLE , ARRAY_A);\n\n\t\tif(count($results)){\n\t\t\t\n\t\t\techo '<p> </p>';\n\t\t\techo '<table cellspacing=\"0\" class=\"widefat\">';\n\t\t\techo '<thead>';\n\t\t\t\techo '<tr>';\n\t\t\t\t\techo '<th class=\"column-title\"><span>Group Name</span></th>';\n\t\t\t\t\t//echo '<th class=\"column-title\">Group Active</th>';\n\t\t\t\t\techo '<th class=\"column-title\">Edit</th>';\n\t\t\t\t\techo '<th class=\"column-title\">Delete</th>';\n echo '<th class=\"column-title\">Info</th>';\n\n echo '</tr>';\n\t\t\techo '</thead>';\n\n\t\t\tforeach ($results as $key => $value) {\n\n\t\t\t\t//Clean up the status\n\t\t\t\t$status = $value['groupactive'];\n\t\t\t\tif ( $status == 0 ){\n\t\t\t\t\t$status = \"Inactive\";\n\t\t\t\t} elseif ( $status == 1 ){\n\t\t\t\t\t$status = \"Active\";\n\t\t\t\t}\n\n\t\t\t\techo '<tbody>';\n\t\t\t\t\techo '<tr>';\n\t\t\t\t\t\techo '<td>' . $value['groupname'] . '</td>';\n\t\t\t\t\t\t//echo '<td>' . $status . '</td>';\n\t\t\t\t\t\techo '<td style=\"width: 30px;\">';\n\t\t\t\t\t\t\techo '<a href=\"' . str_replace( '%7E', '~', $_SERVER['REQUEST_URI']) . '&edit='.$value['groupid'].'\" class=\"\">EDIT</a>';\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\techo '<td style=\"width: 30px;\">';\n\t\t\t\t\t\t\techo '<a href=\"' . str_replace( '%7E', '~', $_SERVER['REQUEST_URI']) . '&del='.$value['groupid'].'\" class=\"\">DELETE</a>';\n\t\t\t\t\t\techo '</td>';\n echo '<td style=\"width: 30px;\">';\n echo '<a href=\"#\" class=\"mz_accordion_button\" rel=\"mz_accord_'.$value['groupid'].'\">INFO</a>';\n echo '</td>';\n\t\t\t\t\techo '</tr>';\n\n echo '<tr class=\"mz_accord mz_accord_'.$value['groupid'].'_inner\">';\n echo '<td style=\"width: 30px;\" colspan=\"99\">';\n echo '<div>';\n\n $mentor = mz_Func::get_group_mentor( $value['groupid'] );\n\n if ( $mentor ){\n echo '<h4>The group mentor is ' . mz_Func::get_group_mentor( $value['groupid'] ) . '</h4>';\n } else {\n echo '<h4>The group does not have a mentor</h4>';\n }\n\n $students = mz_func::get_all_students_in_group( $value['groupid'] );\n\n if ( $students ){\n\n echo '<h4>The groups beneficiaries are</h4>';\n echo '<ul>';\n\n foreach ( $students as $student ) {\n\n echo '<li>'.mz_Func::get_users_display_name( $student['userid'] ).'</li>';\n\n }\n\n echo '</ul>';\n\n } else {\n\n echo '<h4>The group does not have any beneficiaries</h4>';\n\n }\n\n\n\n echo '</div>';\n echo '</td>';\n echo '</tr>';\n\n\t\t\t\techo '</tbody>';\n\n\n\t\t\t}//fe\n\n\t\t} else {\n\n\t\t\techo '<h3>There are no groups yet</h3>';\n\t\t\t\n\t\t}\n\n\t\techo '</div>';\n\n\t}",
"function wp_ajax_closed_postboxes()\n {\n }",
"protected function _process_ajax() {}",
"function bp_next_ajax_joinleave_group() {\n\t$response = array(\n\t\t'feedback' => sprintf(\n\t\t\t'<div class=\"feedback error bp-ajax-message\"><p>%s</p></div>',\n\t\t\tesc_html__( 'There was a problem performing this action. Please try again.', 'bp-next' )\n\t\t)\n\t);\n\n\t// Bail if not a POST action.\n\tif ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) || empty( $_POST['action'] ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\tif ( empty( $_POST['nonce'] ) || empty( $_POST['item_id'] ) || ! bp_is_active( 'groups' ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\t// Use default nonce\n\t$nonce = $_POST['nonce'];\n\t$check = 'bp_next_groups';\n\n\t// Use a specific one for actions needed it\n\tif ( ! empty( $_POST['_wpnonce'] ) && ! empty( $_POST['action'] ) ) {\n\t\t$nonce = $_POST['_wpnonce'];\n\t\t$check = $_POST['action'];\n\t}\n\n\t// Nonce check!\n\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, $check ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\t// Cast gid as integer.\n\t$group_id = (int) $_POST['item_id'];\n\n\tif ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) {\n\t\t$response['feedback'] = sprintf(\n\t\t\t'<div class=\"bp-feedback error\"><p>%s</p></div>',\n\t\t\tesc_html__( 'You cannot join this group.', 'bp-next' )\n\t\t);\n\n\t\twp_send_json_error( $response );\n\t}\n\n\t// Validate and get the group\n\t$group = groups_get_group( array( 'group_id' => $group_id ) );\n\n\tif ( empty( $group->id ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\t/**\n\t *\n\n\t Every action should be handled here\n\n\t */\n\tswitch ( $_POST['action'] ) {\n\n\t\tcase 'groups_accept_invite' :\n\t\t\tif ( ! groups_accept_invite( bp_loggedin_user_id(), $group_id ) ) {\n\t\t\t\t$response = array(\n\t\t\t\t\t'feedback' => sprintf(\n\t\t\t\t\t\t'<div class=\"bp-feedback error\">%s</div>',\n\t\t\t\t\t\tesc_html__( 'Group invite could not be accepted', 'bp-next' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'error'\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\tgroups_record_activity( array(\n\t\t\t\t\t'type' => 'joined_group',\n\t\t\t\t\t'item_id' => $group->id\n\t\t\t\t) );\n\n\t\t\t\t$response = array(\n\t\t\t\t\t'feedback' => sprintf(\n\t\t\t\t\t\t'<div class=\"bp-feedback success\">%s</div>',\n\t\t\t\t\t\tesc_html__( 'Group invite accepted', 'bp-next' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'success',\n\t\t\t\t\t'is_user' => bp_is_user(),\n\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'groups_reject_invite' :\n\t\t\tif ( ! groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) {\n\t\t\t\t$response = array(\n\t\t\t\t\t'feedback' => sprintf(\n\t\t\t\t\t\t'<div class=\"bp-feedback error\">%s</div>',\n\t\t\t\t\t\tesc_html__( 'Group invite could not be rejected', 'bp-next' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'error'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$response = array(\n\t\t\t\t\t'feedback' => sprintf(\n\t\t\t\t\t\t'<div class=\"bp-feedback success\">%s</div>',\n\t\t\t\t\t\tesc_html__( 'Group invite rejected', 'bp-next' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'success',\n\t\t\t\t\t'is_user' => bp_is_user(),\n\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif ( 'error' === $response['type'] ) {\n\t\twp_send_json_error( $response );\n\t} else {\n\t\twp_send_json_success( $response );\n\t}\n\n\tif ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {\n\t\tif ( 'public' == $group->status ) {\n\n\t\t\tif ( ! groups_join_group( $group->id ) ) {\n\t\t\t\t$response['feedback'] = sprintf(\n\t\t\t\t\t'<div class=\"feedback error bp-ajax-message\"><p>%s</p></div>',\n\t\t\t\t\tesc_html__( 'Error joining group', 'bp-next' )\n\t\t\t\t);\n\n\t\t\t\twp_send_json_error( $response );\n\t\t\t} else {\n\t\t\t\t// User is now a member of the group\n\t\t\t\t$group->is_member = '1';\n\n\t\t\t\twp_send_json_success( array(\n\t\t\t\t\t'contents' => bp_get_group_join_button( $group ),\n\t\t\t\t\t'is_group' => bp_is_group()\n\t\t\t\t) );\n\t\t\t}\n\n\t\t} elseif ( 'private' == $group->status ) {\n\n\t\t\t// If the user has already been invited, then this is\n\t\t\t// an Accept Invitation button.\n\t\t\tif ( groups_check_user_has_invite( bp_loggedin_user_id(), $group->id ) ) {\n\n\t\t\t\tif ( ! groups_accept_invite( bp_loggedin_user_id(), $group->id ) ) {\n\t\t\t\t\t$response['feedback'] = sprintf(\n\t\t\t\t\t\t'<div class=\"feedback error bp-ajax-message\"><p>%s</p></div>',\n\t\t\t\t\t\tesc_html__( 'Error requesting membership', 'bp-next' )\n\t\t\t\t\t);\n\n\t\t\t\t\twp_send_json_error( $response );\n\t\t\t\t} else {\n\t\t\t\t\t// User is now a member of the group\n\t\t\t\t\t$group->is_member = '1';\n\n\t\t\t\t\twp_send_json_success( array(\n\t\t\t\t\t\t'contents' => bp_get_group_join_button( $group ),\n\t\t\t\t\t\t'is_group' => bp_is_group()\n\t\t\t\t\t) );\n\t\t\t\t}\n\n\t\t\t// Otherwise, it's a Request Membership button.\n\t\t\t} else {\n\n\t\t\t\tif ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) {\n\t\t\t\t\t$response['feedback'] = sprintf(\n\t\t\t\t\t\t'<div class=\"feedback error bp-ajax-message\"><p>%s</p></div>',\n\t\t\t\t\t\tesc_html__( 'Error requesting membership', 'bp-next' )\n\t\t\t\t\t);\n\n\t\t\t\t\twp_send_json_error( $response );\n\t\t\t\t} else {\n\t\t\t\t\t// Request is pending\n\t\t\t\t\t$group->is_pending = '1';\n\n\t\t\t\t\twp_send_json_success( array(\n\t\t\t\t\t\t'contents' => bp_get_group_join_button( $group ),\n\t\t\t\t\t\t'is_group' => bp_is_group()\n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t} else {\n\n\t\tif ( ! groups_leave_group( $group->id ) ) {\n\t\t\t$response['feedback'] = sprintf(\n\t\t\t\t'<div class=\"feedback error bp-ajax-message\"><p>%s</p></div>',\n\t\t\t\tesc_html__( 'Error leaving group', 'bp-next' )\n\t\t\t);\n\n\t\t\twp_send_json_error( $response );\n\t\t} else {\n\t\t\t// User is no more a member of the group\n\t\t\t$group->is_member = '0';\n\n\t\t\twp_send_json_success( array(\n\t\t\t\t'contents' => bp_get_group_join_button( $group ),\n\t\t\t\t'is_group' => bp_is_group()\n\t\t\t) );\n\t\t}\n\t}\n}",
"function ceo_admin_footer() {\n global $pagenow, $wp_version;\n \n if ( version_compare( $wp_version, '3.5', '>=' ) AND in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) {\n $ceoContent = get_option('ceocontent','nm');\n echo \"<script type='text/javascript'>var ceoContent = '$ceoContent';</script>\";\n?>\n<div id=\"add-email-link\" style=\"display:none;\">\n <form name=\"ceoaddtopost\" id=\"ceoaddtopost\" method=\"post\" action=\"\" autocomplete=\"off\">\n <div class=\"ceospinner\"></div>\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">Email:</th>\n <td>\n <div id=\"ceoSearchContainer\">\n <input name=\"email\" id=\"ceoSearch\" type=\"text\" placeholder=\"Recipient's email address\" />\n <div id=\"ceoSearchItems\"></div>\n </div>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">Display text:</th>\n <td>\n <input name=\"content\" id=\"ceoLinkContent\" type=\"text\" placeholder=\"Text that the viewer sees\" />\n </td>\n </tr>\n <tr>\n <th scope=\"row\">Link CSS Class:</th>\n <td>\n <input name=\"linkClass\" id=\"ceoLinkClass\" type=\"text\" placeholder=\"CSS class for your anchor tag\" />\n </td>\n </tr>\n </tbody>\n </table>\n <p class=\"submit\">\n <input type=\"hidden\" id=\"ceoIdResult\" name=\"ceoIdResult\" />\n <button type=\"button\" class=\"button-primary\" onclick=\"addLinkToText();\" title=\"Insert\">Insert</button>\n <button type=\"button\" class=\"button-secondary\" onclick=\"tb_remove();\" title=\"Cancel\">Cancel</button>\n </p>\n </form>\n</div>\n<script type=\"text/javascript\">ceo_autocomplete(); loadRecipients();</script>\n<?php\n }\n}",
"function fetch_corresponding_groups_data(){\n\t\t$this->layout = 'ajax';\n\n\t\t//$this->BusinessFeed->recursive = -1;\n\t\t$this->set('feed', $this->GroupGallery->findById($_POST['id']));\n\t}",
"abstract public function adminAjax();",
"function master_accounts_group_hm()\n{\n$this->layout='session';\n$s_role_id=$this->Session->read('role_id');\n$s_society_id = (int)$this->Session->read('society_id');\n$s_user_id=$this->Session->read('user_id');\t\n\n$del_id = (int)@$this->request->query['con'];\n$this->set('del_id',$del_id);\n\nif(isset($this->request->data['delc']))\n{\n$del = (int)$this->request->data['del_id'];\n\n$this->loadmodel('accounts_group');\n$this->accounts_group->updateAll(array(\"delete_id\" => 1),array(\"auto_id\" => $del));\n?>\n<script>\nwindow.location.href=\"master_accounts_group_hm\";\n</script>\n<?php\n}\n$this->loadmodel('accounts_group');\n$order=array('accounts_group.auto_id'=> 'ASC');\n$cursor=$this->accounts_group->find('all',array('order' =>$order));\nforeach ($cursor as $collection) \n{\n$auto_id = (int)$collection['accounts_group']['auto_id'];\nif(isset($this->request->data['sub'.$auto_id]))\n{\n$group_name = $this->request->data['cat'.$auto_id];\n$this->loadmodel('accounts_group');\n$this->accounts_group->updateAll(array(\"group_name\" => $group_name),array(\"auto_id\" => $auto_id));\t\n}\n}\n\nif(isset($this->request->data['sub']))\n{\n$main_id = $this->request->data['main_id'];\n$name = $this->request->data['cat_name'];\n\n$this->loadmodel('accounts_group');\n$order=array('accounts_group.auto_id'=> 'ASC');\n$cursor=$this->accounts_group->find('all',array('order' =>$order,'limit'=>1));\nforeach ($cursor as $collection) \n{\n$last=$collection['accounts_group'][\"auto_id\"];\n}\nif(empty($last))\n{\n$i=0;\n}\t\nelse\n{\t\n$i=$last;\n}\n$i++;\n$this->loadmodel('accounts_group');\n$multipleRowData = Array( Array(\"auto_id\" => $i, \"accounts_id\" => $main_id, \"group_name\" => $name,\"delete_id\" => 0));\n$this->accounts_group->saveAll($multipleRowData);\t\n}\n\n$this->loadmodel('accounts_group');\n$conditions=array(\"delete_id\" => 0);\n$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n$this->set('cursor1',$cursor1);\n\n$this->loadmodel('accounts_category');\n$conditions=array(\"delete_id\" => 0);\n$cursor2=$this->accounts_category->find('all',array('conditions'=>$conditions));\n$this->set('cursor2',$cursor2);\n}",
"public function ajaxGroupPublishStatusChange() {\r\n //print_r(PageContext::$request);\r\n $id = PageContext::$request['id'];\r\n $value = PageContext::$request['value'];\r\n if ($id > 0) {\r\n $updateVal = Cmshelper::updateGroupPublishStatus($id, $value);\r\n $data['success'] = true;\r\n $data['message'] = 'Record updated successfully.';\r\n header(\"Location:\".BASE_URL.\"cms#/groups\");\r\n //echo json_encode($data);\r\n exit;\r\n }\r\n exit();\r\n }",
"public function updateLandmarkGroupInfo()\n {\n $ajax_data = array();\n $post = $this->request->request->all();\n \t$landmarkgroup_id = $post['primary_keys']['landmarkGroupPk'];\n $params = array();\n\n if (! empty($post['id'])) {\n if ($post['id'] == 'landmark-group-name') {\n $params['territorygroupname'] = $post['value'];\n $params['account_id'] = $this->user_session->getAccountId();\n }\n }\n\n if (! empty($params) AND ! empty($landmarkgroup_id)) {\n if ($this->territory_logic->updateTerritoryGroupInfo($landmarkgroup_id, $params) !== false) {\n $ajax_data['data'] = $post;\n $ajax_data['code'] = 0;\n $ajax_data['message'] = 'Updated Landmark Group Information';\n } else {\n $errors = $this->territory_logic->getErrorMessage();\n if (! empty($errors) AND is_array($errors)) {\n $errors = implode(',', $errors); \n }\n $ajax_data['code'] = 1;\n $ajax_data['validation_error'][] = $ajax_data['message'] = $errors;\n }\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Error';\n }\n\n $this->ajax_respond($ajax_data);\n }",
"protected function _ajax_action() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests various properties on a meta object. | public function test_properties()
{
$fields = array(
'id' => new Jam_Field_Primary,
'id2' => new Jam_Field_Primary,
'name' => new Jam_Field_String,
);
$meta = new Jam_Meta('foo');
$meta->db('foo')
->table('foo')
->fields($fields)
->sorting(array('foo' => 'bar'))
->primary_key('id2')
->name_key('name')
->foreign_key('meta_fk')
->behaviors(array(new Jam_Behavior_Test))
->finalize('meta');
// Ensure the simple properties are preserved
$expected = array(
'initialized' => TRUE,
'db' => 'foo',
'table' => 'foo',
'model' => 'meta',
'primary_key' => 'id2',
'name_key' => 'name',
'foreign_key' => 'meta_fk',
'sorting' => array('foo' => 'bar'),
);
foreach ($expected as $property => $value)
{
$this->assertSame($meta->$property(), $value);
}
// Ensure we can retrieve fields properly
$this->assertSame($meta->field('id2')->name, 'id2');
// Ensure all fields match
$this->assertSame($meta->fields(), $fields);
// Ensure defaults are set properly
$this->assertSame($meta->defaults(), array(
'id' => NULL,
'id2' => NULL,
'name' => ''
));
foreach ($meta->behaviors() as $behavior)
{
// Ensure Behaviors return actual objects
$this->assertTrue($behavior instanceof Jam_Behavior);
}
} | [
"abstract public function checkProperties();",
"public function testByMappedProperty()\n {\n $reflexClass = new \\ReflectionClass(ObjectMetadata::class);\n $instance = $reflexClass->newInstanceWithoutConstructor();\n\n $properties = $this->getProperties();\n $metadataProperties = $this->getReflexMetadataProperties();\n $metadataProperties->setAccessible(true);\n $metadataProperties->setValue($instance, array_values($properties));\n\n foreach ($properties as $propertyName => $mockObject) {\n $this->assertSame(\n $mockObject,\n $instance->getByMappedProperty($propertyName)\n );\n }\n\n $this->assertNull($instance->getByMappedProperty('undefined'));\n }",
"public function testProperties()\n {\n $orderDetails = $this->getTestOrderDetails();\n $this->validateOrderDetails($orderDetails);\n }",
"public function getMetaProperties();",
"public function testAssertHasMeta()\n {\n $meta = [\n 'foo' => 'bar'\n ];\n\n $this->specify('The key \"meta\" is required for item.', function () use ($meta) {\n $item = $this->service->item($this->book, $this->transformer)\n ->setMeta($meta)\n ->toArray();\n verify($item)->hasKey('meta');\n verify($item['meta'])->equals($meta);\n });\n\n $this->specify('The key \"meta\" is required for collection.', function () use ($meta) {\n $collection = $this->service->collection([$this->book], $this->transformer)\n ->setMeta($meta)\n ->toArray();\n verify($collection)->hasKey('meta');\n verify($collection['meta'])->equals($meta);\n });\n }",
"public function test_meta_method()\n {\n $items = array(\n NULL,\n array(),\n array(\n 'title' => 'PHP Library',\n 'shortcut_icon' => 'phplibrary-icon.png',\n 'touch_icon' => 'phplibrary-logo-blue.png',\n 'google_site_verification' => '123456789abcdefghijklmn',\n ),\n );\n\n foreach ($items as $item)\n {\n $result = $this->website_object->meta($item);\n\n $this->assertNotEmpty($result);\n $this->assertIsString($result);\n }\n }",
"public function testFieldProperties() {\n $contact = new Contact();\n $this->assertObjectHasAttribute('source_tag', $contact);\n $this->assertObjectHasAttribute('supporter_tags', $contact);\n }",
"private static function has_properties( $metadata ) {\n\t\tif ( array_key_exists( 'properties', $metadata ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function testGetProperties()\n {\n $properties = $this->Class->getProperties();\n $this->assertContainsOnlyInstancesOf(PropertyEntity::class, $properties);\n $this->assertSame(['Puppy', 'description', 'isCat'], $properties->map(function (PropertyEntity $property) {\n return $property->getName();\n })->toList());\n }",
"public function hasProperties();",
"public\n function test_properties()\n {\n $enzymes = new Enzymes3();\n\n $attrs = array(\n // Properties extracted from the columns of the table.\n 'ID',\n 'post_author',\n 'post_name',\n 'post_type',\n 'post_title',\n 'post_date',\n 'post_date_gmt',\n 'post_content',\n 'post_excerpt',\n 'post_status',\n 'comment_status',\n 'ping_status',\n 'post_password',\n 'post_parent',\n 'post_modified',\n 'post_modified_gmt',\n 'comment_count',\n 'menu_order',\n // Properties not documented at http://codex.wordpress.org/Class_Reference/WP_Post\n 'to_ping',\n 'pinged',\n 'post_content_filtered',\n 'guid',\n 'post_mime_type',\n );\n $attrs_seq = ':' . implode(' | :', $attrs);\n $attrs_count = count($attrs);\n\n $post = $this->factory->post->create_and_get();\n $data = array();\n foreach ($attrs as $key) {\n $data[$key] = $post->$key;\n }\n $data = \"(\" . implode(\")(\", $data) . \")\";\n\n $post_id = $post->ID;\n $code = '\n list($data) = $arguments;\n $result = \"(\" . implode(\")(\", $data) . \")\";\n return $result;\n ';\n add_post_meta($post_id, 'implode', $code);\n\n $content1 = \"Before \\\"{[ $attrs_seq | array($attrs_count) | .implode(1) ]}\\\" and after.\";\n $content2 = \"Before \\\"$data\\\" and after.\";\n $this->assertEquals($content2, $enzymes->metabolize($content1, $post));\n }",
"function checkProperties()\n {\n foreach ($this->properties as $property)\n {\n $strTag = $property->getTag();\n if( false == $this->checkProperty($strTag) )\n {\n return false;\n }\n }\n return true;\n }",
"public function testMeta() {\n\t\t$this->assertEquals('<meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" />' . PHP_EOL, $this->object->meta('Content-Type'));\n\t\t$this->assertEquals('<meta content=\"application/json\" http-equiv=\"Content-Type\" />' . PHP_EOL, $this->object->meta('content-type', 'application/json'));\n\t\t$this->assertEquals('<meta content=\"text/javascript\" http-equiv=\"Content-Script-Type\" />' . PHP_EOL, $this->object->meta('content-script-type'));\n\t\t$this->assertEquals('<meta content=\"text/css\" http-equiv=\"Content-Style-Type\" />' . PHP_EOL, $this->object->meta('content-Style-type'));\n\t\t$this->assertEquals('<meta content=\"\" http-equiv=\"Content-Language\" />' . PHP_EOL, $this->object->meta('content-language'));\n\t\t$this->assertEquals('<meta content=\"en-us\" http-equiv=\"Content-Language\" />' . PHP_EOL, $this->object->meta('content-language', 'en-us'));\n\n\t\t$this->assertEquals('<meta content=\"\" name=\"keywords\" />' . PHP_EOL, $this->object->meta('keywords'));\n\t\t$this->assertEquals('<meta content=\"key, words, "here", &, stuff\" name=\"keywords\" />' . PHP_EOL, $this->object->meta('keywords', 'key, words, \"here\", &, stuff'));\n\t\t$this->assertEquals('<meta content=\"\" name=\"description\" />' . PHP_EOL, $this->object->meta('description'));\n\t\t$this->assertEquals('<meta content=\"This "is" a description.\" name=\"description\" />' . PHP_EOL, $this->object->meta('description', 'This \"is\" a description.'));\n\t\t$this->assertEquals('<meta content=\"\" name=\"robots\" />' . PHP_EOL, $this->object->meta('robots'));\n\t\t$this->assertEquals('<meta content=\"nofollow\" name=\"robots\" />' . PHP_EOL, $this->object->meta('robots', 'nofollow'));\n\t\t$this->assertEquals('<meta content=\"\" name=\"author\" />' . PHP_EOL, $this->object->meta('author'));\n\t\t$this->assertEquals('<meta content=\"Miles "gearvOsh" Johnson\" name=\"author\" />' . PHP_EOL, $this->object->meta('author', 'Miles \"gearvOsh\" Johnson'));\n\n\t\t$this->assertEquals('<meta link=\"\" rel=\"alternate\" title=\"\" type=\"application/rss+xml\" />' . PHP_EOL, $this->object->meta('rss'));\n\t\t$this->assertEquals('<meta link=\"feed.rss\" rel=\"alternate\" title=\"\" type=\"application/rss+xml\" />' . PHP_EOL, $this->object->meta('rss', 'feed.rss'));\n\t\t$this->assertEquals('<meta link=\"path/feed.rss\" rel=\"alternate\" title=\"My RSS\" type=\"application/rss+xml\" />' . PHP_EOL, $this->object->meta('rss', 'path/feed.rss', ['title' => 'My RSS']));\n\t\t$this->assertEquals('<meta link=\"\" title=\"\" type=\"application/atom+xml\" />' . PHP_EOL, $this->object->meta('atom'));\n\t\t$this->assertEquals('<meta link=\"atom.rss\" title=\"\" type=\"application/atom+xml\" />' . PHP_EOL, $this->object->meta('atom', 'atom.rss'));\n\t\t$this->assertEquals('<meta link=\"path/atom.rss\" title=\"My Atom Feed\" type=\"application/atom+xml\" />' . PHP_EOL, $this->object->meta('atom', 'path/atom.rss', ['title' => 'My Atom Feed']));\n\t\t$this->assertEquals('<meta link=\"favicon.ico\" rel=\"icon\" type=\"image/x-icon\" />' . PHP_EOL, $this->object->meta('icon', 'favicon.ico'));\n\n\t\t// custom, open graph, etc\n\t\t$this->assertEquals('<meta content=\"website\" property=\"og:type\" />' . PHP_EOL, $this->object->meta([\n\t\t\t'property' => 'og:type',\n\t\t\t'content' => 'website'\n\t\t]));\n\t}",
"public function testReadOtherColumnsThanProperties() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select UUID OTHERUUID, BOOLEAN_VALUE OTHERBOOL, INT_VALUE OTHERINT, STRING_VALUE OTHERSTRING from POTEST where UUID = \\'abcdefg\\'';\r\n $po = $this->getPersistenceAdapter()->executeSingleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Compare properties\r\n // These columns must not match because they were not read out with the query\r\n $this->assertNotEquals($uuid, $po->uuid, 'Uuid value from persistent object equals the UUID value of the database.');\r\n $this->assertNotEquals($bool, $po->booleanValue, 'Boolean value from persistent object equals the boolean value of the database.');\r\n $this->assertNotEquals($int, $po->intValue, 'Integer value from persistent object equals the int value of the database.');\r\n $this->assertNotEquals($string, $po->stringValue, 'String value from persistent object equals the string value of the database.');\r\n // Make sure that the columns from the query are NOT stored as dynamic properties of the object\r\n $this->assertFalse(property_exists($po, 'OTHERUUID'), 'Dynamic property otheruuid exists.');\r\n $this->assertFalse(property_exists($po, 'OTHERBOOL'), 'Dynamic property otherbool exists.');\r\n $this->assertFalse(property_exists($po, 'OTHERINT'), 'Dynamic property otherint exists.');\r\n $this->assertFalse(property_exists($po, 'OTHERSTRING'), 'Dynamic property otherstring exists.');\r\n }",
"public function testCanGetProperties() {\n\t\t$person = $this->getPerson();\n\n\t\t$this->assertEquals('Vince Noir', $person->getName());\n\t\t$this->assertEquals('19880211', $person->getDob(false));\n\t\t$this->assertEquals('dev@null.com', $person->getEmail());\n\t}",
"public function testClassTypedProperties(): bool;",
"public function testGetProperties()\n {\n $properties = ['abc' => 'def'];\n\n $object = new Engine($properties);\n\n self::assertSame($properties, $object->getProperties());\n }",
"public function testPropertyExistance()\n\t{\n\t\t$game = new Game();\n\n\t\tforeach ($this->properties as $prop) {\n\t\t\t$this->assertTrue(property_exists($game, $prop));\n\t\t}\n\t}",
"public function testFromAnnotationsForClass()\n {\n $meta = $this->createMeta(new \\ReflectionClass(FooBar::class));\n $this->assertInstanceOf(Meta::class, $meta);\n \n $this->assertSame(true, $meta['foo']);\n $this->assertSame(\"Hello world\", $meta['bar']);\n $this->assertSame(\"22\", $meta['blue']);\n \n $this->assertInstanceOf(Meta::class, $meta->ofProperty('x'));\n $this->assertInstanceOf(Meta::class, $meta->ofProperty('y'));\n $this->assertInstanceOf(Meta::class, $meta->ofProperty('bike'));\n $this->assertInstanceOf(Meta::class, $meta->ofProperty('ball'));\n\n $this->assertInstanceOf(Meta::class, $meta->ofProperty('no'));\n $this->assertInstanceOf(Meta::class, $meta->ofProperty('nop'));\n \n $this->assertSame('123', $meta->ofProperty('x')['test']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print the Website Url field with also the value (if exist). | public function websiteUrlCallback() {
printf(
'<input id="%s" class="regular-text" type="text" name="%s[%s]" value="%s"/>',
self::FI_WEBSITE_URL_FIELD,
self::OPTION_NAME,
self::FI_WEBSITE_URL_FIELD,
isset($this->options[self::FI_WEBSITE_URL_FIELD]) ? esc_attr($this->options[self::FI_WEBSITE_URL_FIELD]) : ''
);
} | [
"function backend_url_field($args) {\r\n $value = get_option('backend_url');\r\n echo '<input type=\"text\" id=\"backend_url\" name=\"backend_url\" value=\"' . $value . '\" />';\r\n }",
"public function url_field()\n {\n echo '<input type=\"url\" name=\"hackerspace_spaceapi[url]\" value=\"'.esc_attr($this->options->url).'\" class=\"regular-text code\" required=\"required\" />';\n echo '<p class=\"description\">'.__('URL to your space website.', 'wp-hackerspace').'</p>';\n }",
"public function createFieldUrl()\n {\n ?>\n <input type=\"text\" id=\"input_c24api_url\" name=\"c24[url]\" value=\"<?php echo $this->settings->getSetting('url', 'http://www.culture24.org.uk/api/rest/v');\n ?>\" size=\"128\" />\n <?php\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}",
"public function _settings_field_kayako_url()\n\t{\n\n\t\tif (!empty($this->settings) && array_key_exists('kayako_url', $this->settings)) {\n\t\t\t$kayako_url = htmlspecialchars($this->settings['kayako_url']);\n\t\t}\n\t\t?>\n\t\t<input type=\"text\" name=\"kayako-settings[kayako_url]\" id=\"kayako-settings[kayako_url]\" size=\"60\" value=\"<?php echo $kayako_url; ?>\"/> <?php\n\t}",
"private function _getSocialSiteUrl() {\n $sqlStr = readResource(SQL_DIR . '/site/getSocialUrl.sql');\n $rslt = doSQLQuery($sqlStr);\n if ( is_array($rslt) ) {\n foreach ( $rslt as $Row ) {\n return NoNull($Row['social_url']);\n }\n }\n return '';\n }",
"public function render_static_url_field() {\n\t\t?>\n\t\t<input\n\t\t\t\tstyle=\"width: 600px; height: 40px;\"\n\t\t\t\tname=\"coral_talk_static_url\"\n\t\t\t\tplaceholder=\"https://cdn.talk-assets.com\"\n\t\t\t\tid=\"coral_talk_static_url\"\n\t\t\t\ttype=\"url\"\n\t\t\t\tvalue=\"<?php echo esc_url( get_option( 'coral_talk_static_url' ) ); ?>\"\n\t\t/>\n\t\t<p class=\"description\">The root url where static Coral assets should be served from. This is the same value as <a href=\"<?php echo esc_url( 'https://docs.coralproject.net/talk/advanced-configuration/#talk-static-uri' ); ?>\">STATIC_URI</a> defined in the Coral application configuration.</p>\n\t\t<?php\n\t}",
"public function url_field() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn (isset($class::_object()->url_field) && !empty($class::_object()->url_field)) ? $class::_object()->url_field:null;\r\n\t}",
"public function render_static_url_field() {\n\t\t?>\n\t\t<input\n\t\t\t\tstyle=\"width: 600px; height: 40px;\"\n\t\t\t\tname=\"coral_talk_static_url\"\n\t\t\t\tplaceholder=\"https://cdn.talk-assets.com\"\n\t\t\t\tid=\"coral_talk_static_url\"\n\t\t\t\ttype=\"url\"\n\t\t\t\tvalue=\"<?php echo esc_url( get_option( 'coral_talk_static_url' ) ); ?>\"\n\t\t/>\n\t\t<p class=\"description\">The root url where static Talk assets should be served from. This is the same value as <a href=\"<?php echo esc_url( 'https://coralproject.github.io/talk/advanced-configuration/#talk_static_uri' ); ?>\">TALK_STATIC_URI</a> defined in the Talk application configuration.</p>\n\t\t<?php\n\t}",
"function print_link($link) {\n //check if is a valid Link\n if (filter_var($link, FILTER_VALIDATE_URL) !== FALSE) {\n echo $link;\n } else {\n echo SITE_ADDR . $link;\n }\n}",
"public function get_website(){\n\t\treturn $this->v_website;\n\t}",
"public function display_css_url() {\n\t\t$key = 'css-url';\n\n\t\tif ( isset( $this->existing_options[$key] ) && $this->existing_options[$key] )\n\t\t\t$existing_value = $this->existing_options[$key];\n\t\telse\n\t\t\t$existing_value = '';\n\n\t\t$id = 'css-url';\n\t\tsettings_errors( $id );\n\t\techo '<input type=\"url\" name=\"' . self::OPTION_NAME . '[' . $key . ']\" id=\"' . $id . '\"';\n\t\tif ( $existing_value )\n\t\t\techo ' value=\"' . esc_attr( $existing_value ) . '\"';\n\t\techo ' maxlength=\"255\" size=\"40\" autocomplete=\"off\" />';\n\n\t\techo '<p class=\"description\">' . esc_html( __( 'Please insert here an optional external CSS file URL.', 'envireit-simple-cdn' ) ) . '</p>';\n\t}",
"function trst_display_redirect_url_field() {\n ?>\n <input type=\"text\" name=\"redirect_url\" id=\"redirect_url\" value=\"<?php echo get_option('redirect_url'); ?>\" />\n <?php\n}",
"public function getWebsite();",
"public function getUrl() {\n\t\treturn $this->siteURL;\n\t}",
"private function AddUrlField()\n {\n $name = 'Url';\n $this->AddField(Input::Text($name, $this->page->GetUrl()));\n $this->SetRequired($name);\n $this->AddValidator($name, DatabaseCount::UniqueFieldAnd($this->page, $name, $this->SiteCondition()));\n }",
"public function getWebsiteSearchLink() : string\n {\n return $this->wowDBSerachLink;\n }",
"function getOrgWebsite($org)\n{\n return $org->field_homepage === '' ? $org->path : $org->field_homepage;\n}",
"public function url()\n {\n $url = $this->value;\n\n if (!str_contains('http', $url)) {\n $url = url($url);\n }\n\n return $url;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all fixed discounts from the customer group | public function AddFixGroupDiscount($customerGroup)
{
$arrayFixedDiscount=array();
$sumFixedDiscount = 0;
foreach ($customerGroup as $objectGroup) {
$fixedDiscount = $objectGroup->getFixedDiscount();
$groupName=$objectGroup->getName();
if ($fixedDiscount != null) {
$arrayDiscount=array('name'=>$groupName, 'discount'=>$fixedDiscount);
array_push($arrayFixedDiscount,$arrayDiscount);
$sumFixedDiscount += intval($fixedDiscount);
}
}
// combines the discount of different groups (example 5euro of marketing and 2euro of becode)
$allFixedInfo=array('details'=>$arrayFixedDiscount, 'total'=>$sumFixedDiscount);
return($allFixedInfo);
} | [
"public function get_group_discounts()\r\n\t{\r\n\t\t// Check the discount tables exist in the config file and are enabled.\r\n\t\tif ($this->get_enabled_status('discounts'))\r\n\t\t{\r\n\t\t\t// Set aliases of discount table data.\r\n\t\t\t$tbl_cols_discounts = $this->flexi->cart_database['discounts']['columns'];\r\n\t\t\t$tbl_cols_group_discounts = $this->flexi->cart_database['discount_groups']['columns'];\r\n\t\t\t$tbl_cols_group_item_discounts = $this->flexi->cart_database['discount_group_items']['columns'];\r\n\t\t\r\n\t\t\t$sql_select = array(\r\n\t\t\t\t$tbl_cols_group_item_discounts['item'].' AS item_id',\r\n\t\t\t\t$tbl_cols_discounts['group'].' AS group_id'\r\n\t\t\t);\r\n\r\n\t\t\t// Lookup item id from item data array and add to SQL WHERE string\r\n\t\t\t$sql_where = ' AND ('.$tbl_cols_group_item_discounts['item'].' IN (';\r\n\t\t\tforeach($this->flexi->cart_contents['items'] as $item)\r\n\t\t\t{\r\n\t\t\t\t$sql_where .= $item[$this->flexi->cart_columns['item_id']].',';\r\n\t\t\t}\r\n\t\t\t$sql_where = rtrim($sql_where,',').') AND '.$tbl_cols_group_discounts['status'].' = 1)';\r\n\t\t\t\r\n\t\t\tif ($group_item_discount_data = $this->get_database_discount_data($sql_select, $sql_where, 'group_discounts'))\r\n\t\t\t{\r\n\t\t\t\treturn $this->sort_discount_data($group_item_discount_data);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"public function getCartDiscounts();",
"function getDiscounts() {\n if (!empty($this->code)) {\n $this->filterDiscountByCode();\n }\n $this->filterDiscountByEntity();\n if (!$this->is_display_field_mode) {\n $this->filterDiscountsByContact();\n }\n return $this->entity_discounts;\n }",
"public function clientDiscounts(){\n\n return ClientDiscount::ClientServiceRequestsDiscounts()->get();\n }",
"function dscGetAllOrderPriceDiscounts()\r\n{\r\n return _dscGetAllDiscounts('A');\r\n}",
"public function checkCustomerDiscount(): array\n {\n $bool = false; //default is false which means that the customer and the group have different types of discount\n $discount = $this->discountComparison();\n $groupOrCustumor = \"\";\n if ($discount[1] == true && $this->customer->getVarDiscount() != null) {\n $variableDiscCustomer = ($this->product->getProductprice() / 100) * $this->customer->getVarDiscount(); //get value that will be substracted\n $variableDiscGroup = ($this->product->getProductprice() / 100) * $discount[0]; //get value that will be substracted\n $bool = true; //set to true because the customer and the group have a variable discount\n if ($variableDiscGroup < $variableDiscCustomer) {\n $this->discount = intval($this->customer->getVarDiscount());\n array_push($this->calculation, 'customer'); //adding the customer so we know where the variable discount comes from\n } else {\n array_push($this->calculation, 'group'); //adding the group so we know where the variable discount comes from\n }\n }\n array_push($discount, $bool);\n return $discount;\n }",
"public function getDiscounts(): array\n {\n return $this->discounts;\n }",
"public function getDiscountRates();",
"public function getDiscounts() {\n\n $discounts = array();\n $collection = new GeneralActivityHasRelationProductDiscountCollection();\n $attribute = array(\"activity_id\" => $this->getId());\n $result = $collection->getRecords($attribute, 1, 10000);\n\n foreach($result[\"records\"] as $key => $record) {\n array_push($discounts, new GeneralActivityHasRelationProductDiscount($record[\"id\"]));\n }\n\n return $discounts;\n }",
"protected function refundedData()\n {\n $charges = $this->search('charge');\n\n return $this->days()->mapToGroups(function ($day) use ($charges) {\n return [$day->format('M Y') => $charges->filter(function ($charge) use ($day) {\n return $charge->created >= $day->startOfDay()->getTimestamp()\n && $charge->created <= $day->endOfDay()->getTimestamp();\n })->sum(function ($charge) {\n return $charge->amount_refunded / 100;\n })];\n });\n }",
"public function getGlobalDiscounts()\n\t{\n\t\tif (\\App\\Cache::has('Inventory', 'Discounts')) {\n\t\t\treturn \\App\\Cache::get('Inventory', 'Discounts');\n\t\t}\n\t\t$discounts = (new App\\Db\\Query())->from('a_#__discounts_global')->where(['status' => 0])\n\t\t\t->createCommand(App\\Db::getInstance('admin'))->queryAllByGroup(1);\n\t\t\\App\\Cache::save('Inventory', 'Discounts', $discounts, \\App\\Cache::LONG);\n\t\treturn $discounts;\n\t}",
"public function find_discounts(&$order)\n\t{\n\t\tif ($this->found_discounts) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (! empty($this->records)) {\n\t\t\tforeach ($this->records AS &$record) {\n\t\t\t\t$this->total_discount += $record['amount'];\n\t\t\t\t$this->discounts[$record['name']] = $record['amount'];\n\t\t\t}\n\t\t}\n\t\tif (! empty($this->product_discount)) {\n\t\t\tforeach ($this->product_discount AS &$product_discount) {\n\t\t\t\t$product_discount['total_discount'] = array_sum($product_discount);\n\t\t\t}\n\t\t}\n\t\t$this->found_discounts = TRUE;\n\t}",
"function filterDiscountsByContact() {\n if (empty($this->contact_id)) {\n return;\n }\n $entityDiscounts = $this->entity_discounts;\n foreach ($this->entity_discounts as $discount_id => $discount) {\n if (empty($discount['autodiscount'])) {\n if (!empty($discount['memberships'])) {\n $applyForMembershipOnly = TRUE;\n continue;\n }\n unset($entityDiscounts[$discount_id]);\n }\n foreach (array_keys($discount['autodiscount']) as $entity) {\n $additionalParams = array('contact_id' => $this->contact_id);\n $id = ($entity == 'contact') ? $this->contact_id : NULL;\n if (!$this->checkDiscountsByEntity($discount, $entity, $id, 'autodiscount', $additionalParams)) {\n unset($entityDiscounts[$discount_id]);\n continue;\n }\n }\n }\n if (empty($applyForMembershipOnly) && $this->entity != 'membership') {\n $this->autoDiscounts = $entityDiscounts;\n }\n }",
"public function getDiscountRefunded();",
"public function getDiscounts()\n {\n if (!empty($this->shop_list_discounts))\n {\n $discounts = [];\n foreach ($this->shop_list_discounts as $relationship)\n {\n $discounts[] = $relationship->getDiscount();\n }\n }\n else\n {\n $discounts = [];\n }\n\n return $discounts;\n }",
"public function getDiscountsData()\n {\n $discounts = [];\n if ($this->hasDiscounts()) {\n foreach($this->getDiscounts() as $discount) {\n $discounts[] = $discount->toArray();\n }\n }\n return $discounts;\n }",
"public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"function get_price_discounts(){\n\t\treturn apply_filters('em_booking_get_price_discounts', $this->get_price_adjustments('discounts'), $this);\n\t}",
"public function getCategoryDiscount()\n {\n return $this->hasMany(CustomerCategoryDiscount::className(), ['customer_id' => 'id']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decorates the role in the provided cell | public function decorate(Cell $cell, Row $row, $rowNumber, array $remainingRows) {
$role = $cell->getValue();
if (!($role instanceof RoleData)) {
$cell->setValue('');
return;
}
$html = $role->name;
if ($this->action) {
$anchor = new Anchor($html, $this->action . $role->id);
$html = $anchor->getHtml();
}
if ($role->permissions || $role->isSuperRole) {
$html .= '<div class="info">';
if ($role->isSuperRole) {
$html .= $this->translator->translate(self::TRANSLATION_SUPER_ROLE) . '<br />';
}
if ($role->permissions) {
$permissions = array();
foreach ($role->permissions as $permission) {
$permissions[] = $permission->getPermissionCode();
}
asort($permissions);
$html .= $this->translator->translate(self::TRANSLATION_PERMISSIONS) . ': ' . implode(', ', $permissions);
}
$html .= '</div>';
}
$cell->setValue($html);
} | [
"protected function getRoleColumn()\n {\n return function ($row) {\n $roles = $row->roles;\n $value = [];\n\n foreach ($roles as $role) {\n $value[] = app('html')->create('span', e(strtoupper($role->name)), [\n 'class' => 'label label-success',\n 'role' => 'role',\n ]);\n }\n\n return implode('', [\n app('html')->create('span', app('html')->raw(implode(' ', $value)), [\n 'class' => 'meta',\n ]),\n ]);\n };\n }",
"function adaptRoleColor($role) {\r\n if ($role == 1) {\r\n return 'purple';\r\n } else {\r\n return 'gray';\r\n }\r\n}",
"function setRole($role);",
"public function addRole($role) ;",
"public function getUserRoleDecorator() {\n $user = $this->getUser();\n $SfUser = $this->getSfUser();\n $decoratorFactory = $this->getUserRoleDecoratorFactory();\n $roleDecoratorChain = array();\n\n if ($SfUser->isAuthenticated()) {\n if ($SfUser->hasCredential('Admin')) {\n $roleDecorator = $decoratorFactory->getRoleDecorator('Admin');\n $roleDecorator->setUser($user);\n array_push($roleDecoratorChain, $roleDecorator);\n }\n\n if ($SfUser->hasCredential('Moderator')) {\n $roleDecorator = $decoratorFactory->getRoleDecorator('Moderator');\n $roleDecorator->setUser($user);\n array_push($roleDecoratorChain, $roleDecorator);\n }\n } else {\n $roleDecorator = $decoratorFactory->getRoleDecorator('NormalUser');\n $roleDecorator->setUser($user);\n array_push($roleDecoratorChain, $roleDecorator);\n }\n\n return $roleDecoratorChain;\n }",
"function SetColAttr(wxGridCellAttr &$attr, $col){}",
"public function role()\n {\n if ($this->user_type == static::OWNER) {\n return \"<span class=\\\"label label-danger\\\">Vlasnik</span>\";\n } else if ($this->user_type == static::ADMIN) {\n return \"<span class=\\\"label label-primary\\\">Administrator</span>\";\n } else {\n return \"<span class=\\\"label label-default\\\">Korisnik</span>\";\n }\n }",
"public function decorateUserType($value, $row, $column, $isExport)\n {\n $options = $column->getOptions();\n\n $value = ($row->getCustomerId()) ?$options[1] :$options[0];\n $cell = $value;\n\n return $cell;\n }",
"public function addRole($role);",
"function SetRowAttr(wxGridCellAttr &$attr, $row){}",
"public function decorateStatus($value, $row, $column, $isExport)\n {\n Mage::getSingleton('helpmate/status')->getOptionArray();\n// Zend_Debug::dump($row);die;\n switch ($row->priority) {\n case TM_Helpmate_Model_Priority::PRIORITY_EMERGENCY:\n case TM_Helpmate_Model_Priority::PRIORITY_CRITICAL:\n $cell = '<span class=\"grid-severity-critical\"><span>'.$value.'</span></span>';\n break;\n case TM_Helpmate_Model_Priority::PRIORITY_HIGHT:\n $cell = '<span class=\"grid-severity-major\"><span>'.$value.'</span></span>';\n break;\n case TM_Helpmate_Model_Priority::PRIORITY_MEDIUM:\n $cell = '<span class=\"grid-severity-minor\"><span>'.$value.'</span></span>';\n break;\n case TM_Helpmate_Model_Priority::PRIORITY_LOW:\n default:\n $cell = '<span class=\"grid-severity-notice\"><span>'.$value.'</span></span>';\n break;\n }\n\n return $cell;\n }",
"function SetAttr(wxGridCellAttr &$attr, $row, $col){}",
"function getRoleAccess($role){\n if($role==\"administrador\"){\n return 0;\n }else if($role==\"editor\"){\n return 1;\n }else{ // lector\n return -1;\n }\n}",
"public function updateRole($role);",
"public function getRole();",
"public function render($role) {\n\t\t$hasRole = FALSE;\n\t\tforeach ($this->securityContext->getAccount()->getRoles() as $userRole) {\n\t\t\tif ($role == strval($userRole)) {\n\t\t\t\t$hasRole = TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif ($hasRole === TRUE) {\n\t\t\treturn $this->renderThenChild();\n\t\t} else {\n\t\t\treturn $this->renderElseChild();\n\t\t}\n\t}",
"function SetRowAttr($row, wxGridCellAttr &$attr){}",
"public function addUserListingCustomColumnContent( $val , $column_name , $user_id ) {\n\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\tif ( $column_name == 'wwlc_user_status' ) {\n\n\t\t\t\tif ( in_array( WWLC_UNAPPROVED_ROLE , $user->roles ) )\n\t\t\t\t\treturn \"<span style='width: 80px; text-align: center; color: #fff; background-color: black; display: inline-block; padding: 0 6px;'>\" . __( 'Unapproved' , 'woocommerce-wholesale-lead-capture' ) . \"</span>\";\n\t\t\t\telseif ( in_array( WWLC_REJECTED_ROLE , $user->roles ) )\n\t\t\t\t\treturn \"<span style='width: 80px; text-align: center; color: #fff; background-color: orange; display: inline-block; padding: 0 6px;'>\" . __( 'Rejected' , 'woocommerce-wholesale-lead-capture' ) . \"</span>\";\n\t\t\t\telseif ( in_array( WWLC_INACTIVE_ROLE , $user->roles ) )\n\t\t\t\t\treturn \"<span style='width: 80px; text-align: center; color: #fff; background-color: grey; display: inline-block; padding: 0 6px;'>\" . __( 'Inactive' , 'woocommerce-wholesale-lead-capture' ) . \"</span>\";\n\t\t\t\telse\n\t\t\t\t\treturn \"<span style='width: 80px; text-align: center; color: #fff; background-color: green; display: inline-block; padding: 0 6px;'>\" . __( 'Active' , 'woocommerce-wholesale-lead-capture' ) . \"</span>\";\n\n\t\t\t} elseif ( $column_name == 'wwlc_registration_date' ) {\n\n\t\t\t\treturn \"<span class='wwlc_registration_date' >\" . $user->user_registered . \"</span>\";\n\n\t\t\t} elseif ( $column_name == 'wwlc_approval_date' ) {\n\n\t\t\t\tif ( !in_array( WWLC_UNAPPROVED_ROLE , $user->roles ) && !in_array( WWLC_REJECTED_ROLE , $user->roles ) ) {\n\n\t\t\t\t\t$approval_date = get_user_meta( $user->ID , 'wwlc_approval_date' , true );\n\n\t\t\t\t\t// For older versions of this plugin (prior to 1.3.1) we don't save approval dates.\n\t\t\t\t\t// If approval date is not present, we will use the registration date by default.\n\t\t\t\t\tif ( !$approval_date )\n\t\t\t\t\t\t$approval_date = $user->user_registered;\n\n\t\t\t\t\treturn \"<span class='wwlc_approval_date'>\" . $approval_date . \"</span>\";\n\n\t\t\t\t}\n\n\t\t\t} elseif ( $column_name == 'wwlc_rejection_date' ) {\n\n\t\t\t\tif ( in_array( WWLC_REJECTED_ROLE , $user->roles ) ) {\n\n\t\t\t\t\t$rejection_date = get_user_meta( $user->ID , 'wwlc_rejection_date' , true );\n\n\t\t\t\t\treturn \"<span class='wwlc_rejection_date'>\" . $rejection_date . \"</span>\";\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}",
"function getUserRoles($role_name='')\n{\n if($role_name == 'Buyer')\n {\n $color = '#f1556c';\n }else if($role_name == 'Seller')\n {\n $color = '#254afc';\n }\n\n $html = '<span class=\"badge\" style=\"background-color: '.$color.'; color: white;\" >'.$role_name.'</span>';\n return $html;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the bibtex file from all the entries. | public function getBibliography() {
$bibtex = '';
foreach ($this->bib_entries as $bib) {
$bibtex .= $bib . "\n\n";
}
return $bibtex;
} | [
"function bibTex()\n {\n $bibtex = '';\n foreach ($this->data as $entry) {\n //Intro\n $bibtex .= '@'.strtolower($entry['entryType']).' { '.$entry['cite'].\",\\n\";\n //Other fields except author\n foreach ($entry as $key=>$val) {\n if ($this->_options['wordWrapWidth']>0) {\n $val = $this->_wordWrap($val);\n }\n if (!in_array($key, array('cite','entryType','author'))) {\n $bibtex .= \"\\t\".$key.' = {'.$val.\"},\\n\";\n }\n }\n //Author\n if (array_key_exists('author', $entry)) {\n if ($this->_options['extractAuthors']) {\n $tmparray = array(); //In this array the authors are saved and the joind with an and\n foreach ($entry['author'] as $authorentry) {\n $tmparray[] = $this->_formatAuthor($authorentry);\n }\n $author = join(' and ', $tmparray);\n } else {\n $author = $entry['author'];\n }\n } else {\n $author = '';\n }\n $bibtex .= \"\\tauthor = {\".$author.\"}\\n\";\n $bibtex.=\"}\\n\\n\";\n }\n return $bibtex;\n }",
"function getEntries() {\n return $this->bibdb;\n }",
"function bib_get_item_files($item, $bibtex = true)\n{\n\tglobal $bib_files_dir;\n\tglobal $bib_bibtex_dir;\n\tglobal $bib_files_url;\n\tglobal $bib_bibtex_url;\n\t\n\t$item_files = array();\n\t\n\tif (array_key_exists(\"filename\", $item)) if ($item[\"filename\"]) {\n\t\tforeach (array(\"ps\", \"ps.gz\", \"pdf\") as $ext) {\n\t\t\t$filename = \"$bib_files_dir/\".$item[\"filename\"].\".$ext\";\n\t\t\tif (file_exists($filename)) {\n\t\t\t\t$url = $bib_files_url.\"/\".$item[\"filename\"].\".$ext\";\n\t\t\t\t$filesize = filesize($filename)/1024;\n\t\t\t\t$filesize = ($filesize > 1024) ? (round($filesize/1024, 2).\" MB\") : (round($filesize).\" KB\");\n\t\t\t\t$item_files []= array(\"filename\"=>$filename, \"url\"=>$url, \"ext\"=>$ext, \"filesize\"=>$filesize);\n\t\t\t}\n\t\t}\n\t}\n\tif ($bibtex) {\n\t\t$filename = \"$bib_bibtex_dir/\".$item[\"key\"].\".bib\";\n\t\tif (file_exists($filename)) {\n\t\t\t$url = $bib_bibtex_url.\"/\".$item[\"key\"].\".bib\";\n\t\t\t$item_files []= array(\"filename\"=>$filename, \"url\"=>$url, \"ext\"=>\"bib\");\n\t\t}\n\t}\n\t\n\treturn $item_files;\n}",
"function parse_bibtexs($file_names) {\n\n\n $mergedEntries = array();\n\n foreach ($file_names as $file_name) {\n $parse = NEW PARSEENTRIES();\n $parse->expandMacro = FALSE;\n $parse->fieldExtract = TRUE;\n $parse->openBib($file_name);\n $parse->extractEntries();\n $parse->closeBib();\n list($preamble, $strings, $entries, $undefinedStrings) = $parse->returnArrays();\n\n foreach ($entries as $entry) {\n // Skip entry if already in entries\n if (array_key_exists($entry['bibtexCitation'], $mergedEntries)) {\n continue;\n }\n\n // Skip entries that do not have authors\n if (!array_key_exists('author', $entry)) {\n continue;\n }\n\n // Add entry\n $mergedEntries[$entry['bibtexCitation']] = $entry;\n }\n }\n\n\n return $mergedEntries;\n}",
"function format_entries($entries, $argv=array()) {\n global $wgUser;\n \n $dbname = reset($this->dbs);\n if (count($entries) == 0)\n return;\n\n // for backwards compatibility\n if (array_key_exists(\"pdflink\", $argv))\n $argv[\"filelink\"] = $argv[\"pdflink\"];\n\n // set defaults\n $compact = $this->array_isset(\"compact\", \n\t\t\t\t $argv, $this->default_format);\n $abstract = $this->array_isset(\"abstract\", \n\t\t\t\t $argv, $this->default_format);\n $filelink = $this->array_isset(\"filelink\", \n\t\t\t\t $argv, $this->default_format);\n $meta = $this->array_isset(\"meta\", \n\t\t\t $argv, $this->default_format);\n $bibtex = $this->array_isset(\"bibtex\", \n\t\t\t\t $argv, $this->default_format);\n $fullentrylink = $this->array_isset(\"fullentrylink\", \n\t\t\t\t\t$argv, $this->default_format);\n\n echo \"<ul class=\\\"plainlinks\\\">\\n\";\n\n foreach ($entries as $entry) {\n // fetch the entry\n \n // use db name if given\n if(is_array($entry) && array_key_exists(\"db\", $entry))\n {\n $data = dba_fetch(reset($entry), $this->dbs[$entry[\"db\"]]);\n $dbname = $entry[\"db\"];\n \n if (!$data) {\n\t echo \"<li class=\\\"error\\\">\";\n\t echo wfMsg('externbib-entry-notfound', reset($entry));\n\t echo \"</li>\\n\";\n\t continue;\n }\n $entry = reset($entry);\n } else {\n\t// else check in each database if entry exists\n\tforeach ($this->dbs as $db){\n\t $data = dba_fetch($entry, $db);\n\t if ($data)\n\t break;\n\t}\n \n $dbname = key($this->dbs);\n \n if (!$data) {\n\t echo \"<li class=\\\"error\\\">\";\n\t echo wfMsg('externbib-entry-notfound', $entry);\n\t echo \"</li>\\n\";\n\t continue;\n }\n }\n \n \n \n //if(is_array($entry) && array_key_exists(\"db\", $entry))\n // $dbname = $entry[\"db\"];\n //elseif (isset($this->dbs))\n // $dbname = key($this->dbs);\n \n reset($this->dbs);\n \n // current entry is used by getb and issetb\n $this->current_entry = unserialize($data);\n unset($data);\n \n // check whether the entry is superseded by another one\n if ($this->issetb(\"superseded\")) {\n\tif ($meta) {\n\t $superseded = $this->getb(\"superseded\");\n\t $supersededLink = \n\t $this->fullEntryLink($superseded, \n\t\t\t\t wfMsg('externbib-fullentry'));\n\n\t echo \"<li class=\\\"warning\\\">\";\n\t echo wfMsg('externbib-entry-superseded', \n\t\t $entry,\n\t\t $superseded,\n\t\t $supersededLink\n\t\t );\n\t echo \".</li>\\n\";\n\t}\n\tcontinue;\n } \n\n echo \"<li>\\n\";\n \n // main formatting\n\n if ($meta) echo \"[$entry]<br/>\\n\";\n \n if ($this->getb(\"author\") || $this->getb(\"entryType\") != \"book\" ) {\n echo $this->getb(\"author\", \"Unknown author\") . \". \";\n if (!$compact) echo \"<br/>\";\n echo \"\\n\";\n }\n \n echo \"<b>\" . $this->getb(\"title\", \"Unknown title.\", \"\\\"%s\\\".\") . \"</b>\";\n if (!$compact) echo \"<br/>\";\n echo \"\\n\";\n\n switch ($this->getb(\"entryType\")) {\n case \"article\":\n\techo \"<i>\" . $this->getb(\"journal\", \"Unknown journal\") . \"</i>\\n\";\n\techo $this->getb(\"volume\");\n\techo $this->getb(\"number\", \"\", \"(%s)\");\n\techo $this->getb(\"pages\", \"\", \"(%s)\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\");\n\techo \".\\n\";\n\tbreak;\n\n case \"book\":\n\techo $this->getb(\"series\", \"\", \"<i>%s</i>, \");\n\techo $this->getb(\"publisher\", \"Unknown publisher\", \"%s\");\n\techo $this->getb(\"editor\", \"\", \", %s\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\"); \n\techo \". \\n\";\n\tbreak;\n\n case \"inbook\":\n case \"incollection\":\n\techo \"In \";\n echo \"<i>\" . $this->getb(\"booktitle\", \"unknown booktitle\") . \"</i>\";\n\tif ($this->issetb(\"series\") || $this->issetb(\"volume\")) {\n\t echo \", volume \" . $this->getb(\"volume\") . \" of \";\n\t echo \"<i>\" . $this->getb(\"series\", \"\") . \"</i>\";\n\t}\n\techo $this->getb(\"chapter\", \"\", \", chapter %s\");\n\techo $this->getb(\"pages\", \"\", \", pages %s\");\n\techo \".\";\n\techo $this->getb(\"editor\", \"\", \" Editors: %s,\\n\");\n\tif (!$compact) echo \"<br/>\";\n\techo \"\\n\";\n\techo $this->getb(\"publisher\", \"Unknown publisher\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\");\n\techo \". \\n\";\n break;\n\n case \"conference\":\n case \"inproceedings\":\n\techo \"<i>\" . $this->getb(\"booktitle\", \"unknown booktitle\") . \"</i>\\n\";\n if ($this->issetb(\"series\") || $this->issetb(\"volume\")) {\n\techo \", volume \" . $this->getb(\"volume\") . \" of \";\n\techo \"<i>\" . $this->getb(\"series\", \"\") . \"</i>\";\n }\n echo $this->getb(\"chapter\", \"\", \", chapter %s\");\n echo $this->getb(\"pages\", \"\", \", pages %s, \");\n echo $this->getb(\"editor\", \"\", \"Editors: %s,\\n\");\n echo $this->getb(\"address\", \"\", \", %s\");\n echo $this->getb(\"year\", \"\", \", <b>%s</b>\");\n echo \".\";\n if (!$compact) echo \"<br/>\";\n echo \"\\n\";\n echo $this->getb(\"publisher\", \"Unknown publisher\");\n echo $this->getb(\"pubaddress\", \"\", \", %s\");\n echo \". \\n\";\n break;\n\n case \"mastersthesis\":\n\techo $this->getb(\"type\", \"<i>Master's thesis</i>\");\n\techo $this->getb(\"school\", \"\", \", %s\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"month\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\"); \n\techo \". \\n\";\n\tbreak;\n\n case \"bookreview\":\n\techo \"Book review: \";\n\techo $this->getb(\"title\", \"\", \", %s\");\n\techo \"<i>\" . $this->getb(\"journal\", \"Unknown journal\") . \"</i>, \\n\";\n\techo $this->getb(\"volume\");\n\techo $this->getb(\"number\", \"\", \"(%s)\");\n\techo $this->getb(\"pages\", \"\", \", (%s)\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\"); \n\techo \". \\n\";\n\tbreak;\n\n case \"phdthesis\":\n\techo $this->getb(\"type\", \"<i>PhD thesis</i>\");\n\techo $this->getb(\"school\", \"\", \", %s\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"month\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\"); \n\techo \". \\n\";\n\tbreak;\n \n case \"habilitation\":\n\techo \"<i>Habilitationsschrift</i> :\";\n\techo $this->getb(\"month\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\");\n\techo \". \\n\";\n\tbreak;\n\n case \"techreport\":\n\techo $this->getb(\"type\", \"Technical report\", \"%s\");\n\techo $this->getb(\"institution\", \"\", \", %s\");\n\techo $this->getb(\"pages\", \"\", \", pages %s\");\n\techo $this->getb(\"editor\", \"\", \", %s, editors\");\n\techo $this->getb(\"publisher\", \"\", \", %s\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\"); \n\techo \". \\n\";\n\tbreak;\n\n case \"manual\":\n\techo $this->getb(\"publisher\", \"unknown publisher\", \"%s\");\n\techo $this->getb(\"address\", \"\", \", %s\");\n\techo $this->getb(\"year\", \"\", \", <b>%s</b>\");\n\techo \". \\n\";\n\tbreak;\n\n case \"unpublished\":\n case \"misc\":\n default:\n\techo $this->getb(\"year\", \"\", \"<b>%s</b>.\\n\");\n break;\n } //end switch\n\n // Notes\n if ($this->issetb(\"note\")) {\n\tif (! $compact) echo \"<br/>\\n\";\n\techo $this->getb(\"note\");\n }\n\n // Links\n if (!$compact) echo \"<br/>\\n\";\n\n // link to full entry\n if ($fullentrylink)\n\techo $this->fullEntryLink($entry, '[' . \n\t\t\t\t wfMsg('externbib-fullentry') . \n\t\t\t\t ']') . \"\\n\";\n\n // link to files\n if ($filelink) {\n\tfor ($i=0; $i < count($this->filedirs); $i++) {\n\t $dir = $this->filedirs[$i];\n\t $urlbase = $this->filebaseurls[$i];\n\t \n\t $pdffile = \"$dir/$entry.pdf\";\n\t if (file_exists($pdffile)) {\n\t echo \"<a href=\\\"$urlbase/$entry.pdf\\\">[PDF]</a>\";\n\t echo \" (\" . $this->hfilesize($pdffile) . \")\\n\";\n\t }\n \n\t $psfile = \"$dir/$entry.ps\";\n\t if (file_exists($psfile)) {\n\t echo \"<a href=\\\"$urlbase/$entry.ps\\\">[PS]</a>\";\n\t echo \" (\" . $this->hfilesize($psfile) .\")\\n\";\n\t }\n\n\t $psgzfile = \"dir/$entry.ps.gz\";\n\t if (file_exists($psgzfile)) {\n\t echo \"<a href=\\\"$urlbase/$entry.ps.gz\\\">[PS.GZ]</a>\";\n\t echo \" (\" . $this->hfilesize($psgzfile) .\")\\n\";\n\t }\n\t}\n }\n \n echo $this->getb(\"e-print\", \"\", \n\t\t \"<a href=\\\"\" . $this->eprintbaseurl . \"/%s\\\">[Preprint]</a>\\n\");\n echo $this->getb(\"doi\", \"\",\n\t\t \"<a href=\\\"\" . $this->doibaseurl . \"/%s\\\">[DOI]</a>\\n\");\n echo $this->getb(\"url\", \"\", \"<a href=\\\"%s\\\">[URL]</a>\\n\");\n\t\n // Abstract\n if ($abstract && $this->issetb(\"abstract\")) {\n\techo \"<div style=\\\"margin:0pt 1em 1em 1em;font-size:75%\\\">\\n\";\n\techo $this->getb(\"abstract\");\n\techo \"</div>\\n\";\n }\n\n // Timestamp\n if ($meta && \n\t ($this->issetb('timestamp') || $this->issetb('owner'))) {\n\techo \"<div style=\\\"margin-left:1em;font-size:90%;\\\">\";\n\tif ($this->issetb('timestamp') && $this->issetb('owner'))\n\t echo wfMsg('externbib-enteredon', \n\t\t $this->getb(\"owner\"), $this->getb(\"timestamp\"), $dbname);\n\telseif ($this->issetb('timestamp'))\n\t echo wfMsg('externbib-enteredon-noowner', \n\t\t $this->getb(\"timestamp\"), $dbname);\n\telse\n\t echo wfMsg('externbib-enteredon-notimestamp', \n\t\t $this->getb(\"owner\"), $dbname);\n\n\techo \"</div>\\n\";\n }\n\n // BibTeX record\n if ($bibtex && $this->issetb(\"fullEntry\")) {\n\techo \"<pre>\\n\";\n\techo $this->getb(\"fullEntry\");\n\techo \"</pre>\\n\";\n }\n \n echo \"</li>\\n\";\n } //end foreach\n\n echo \"</ul>\\n\";\n }",
"function bibentry( $input, $argv, $parser, $frame ) {\n global $wgOut, $wgParser;\n\n // TODO: check whether this can be avoided\n // disable the cache\n $parser->mOutput->updateCacheExpiry( 0 );\n\n // parse $input and split it into entries\n $input = trim(trim($input), ',');\n $entries = preg_split(\"/[\\s,]+/\", $input);\n\n // start writing into the output buffer\n ob_start();\n \n $this->format_entries($entries, $argv);\n \n // get everything from the output buffer\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }",
"function bibtex2html($texEntry){\n\t\n\t$ret=extractBib(\"text\",$texEntry);\n\tif(trim($ret)==\"\"){\n\t\t//begin there is no predefined text to show, we create some\n\t\t$author=extractBib(\"author\",$texEntry);\n\t\tif($author==\"\") {\n\t\t\t$author=extractBib(\"editor\",$texEntry);\n\t\t\t$author=$author.\", ed.\";\n\t\t}\n\t\t$ret=$ret.shortenAuthors($author);\n\t\t$year=extractBib(\"year\",$texEntry);\n\t\tif($ret[strlen($ret)-1]!=\".\") $ret=$ret.\".\";\n\t\t$ret=$ret.\" \";\n\t\t$title=extractBib(\"title\",$texEntry);\n\t\t\n\t\t$webpdf = extractBib(\"webpdf\",$texEntry);\n\t\tif(trim($webpdf)!=\"\") {\n\t\t\t$title = '<a href=\"'.$webpdf.'\" >'.$title.'</a>';\n\t\t}\n\t\t\n\t\tif((trim($author)==\"\")||(trim($title)==\"\")) return \"\";\n\t\t$texType=strtolower(extractBibType($texEntry));\n\t\tif(($texType!=\"article\")&&($texType!=\"inproceedings\")) $ret=$ret.\"<i>$title</i>\";\n\t\telse $ret=$ret.$title;\n\t\tif($title[strlen($title)-1]!=\".\") $ret=$ret.\".\";\n\t\tif($texType==\"phdthesis\"){\n\t\t\t$ret=$ret.\" Ph.D. Thesis\";\n\t\t\t$school=extractBib(\"school\",$texEntry);\n\t\t\tif(trim($school)!=\"\") $ret=$ret.\", \".$school;\n\t\t\t$addrs=extractBib(\"address\",$texEntry);\n\t\t\tif(trim($addrs)!=\"\") $ret=$ret.\", \".$addrs;\n\t\t\tif(trim(strtolower($year))!=\"\") $ret=$ret.\", \".$year;\n\t\t\t$ret=$ret.\".\";\n\t\t}\n\t\tif($texType==\"article\"){\n\t\t\t$journ=extractBib(\"journal\",$texEntry);\n\t\t\tif($journ==\"\") $journ=extractBib(\"book\",$texEntry); //might be a book chapter...\n\t\t\tif(trim(strtolower($journ))!=\"\"){\n\t\t\t\t$ret=$ret.\" In <i>\".$journ.\"</i>\";\n\t\t\t\t$vol=extractBib(\"volume\",$texEntry);\n\t\t\t\tif(trim(strtolower($vol))!=\"\") $ret=$ret.\", \".$vol;\n\t\t\t\t$numb=extractBib(\"number\",$texEntry);\n\t\t\t\tif(trim(strtolower($numb))!=\"\") $ret=$ret.\" (\".str_replace(\"--\",\"-\",$numb).\")\";\n\t\t\t\t$pages=extractBib(\"pages\",$texEntry);\n\t\t\t\tif(trim(strtolower($pages))!=\"\") $ret=$ret.\": \".str_replace(\"--\",\"-\",$pages);\n\t\t\t\tif(trim(strtolower($year))!=\"\") $ret=$ret.\", \".$year;\n\t\t\t\t$ret=$ret.\".\";\n\t\t\t}\n\t\t}\n\t\tif($texType==\"inproceedings\"){\n\t\t\t$booktitle=extractBib(\"booktitle\",$texEntry);\n\t\t\tif(trim(strtolower($booktitle))!=\"\"){\n\t\t\t\t$ret=$ret.\" In <i>\".$booktitle.\"</i>\";\n\t\t\t\t$pages=extractBib(\"pages\",$texEntry);\n\t\t\t\tif(trim(strtolower($pages))!=\"\") $ret=$ret.\", pages \".str_replace(\"--\",\"-\",$pages);\n\t\t\t\t$publisher=extractBib(\"publisher\",$texEntry);\n\t\t\t\tif(trim(strtolower($publisher))!=\"\") $ret=$ret.\", \".$publisher;\n\t\t\t\tif(trim(strtolower($year))!=\"\") $ret=$ret.\", \".$year;\n\t\t\t\t$ret=$ret.\".\";\n\t\t\t}\n\t\t}\n\t\tif($texType==\"book\"){\n\t\t\t$publisher=extractBib(\"publisher\",$texEntry);\n\t\t\tif(trim(strtolower($publisher))!=\"\") $ret=$ret.\" \".$publisher;\n\t\t\t$pubaddress=extractBib(\"address\",$texEntry);\n\t\t\tif(trim(strtolower($pubaddress))!=\"\") $ret=$ret.\", \".$pubaddress;\n\t\t\tif(trim(strtolower($year))!=\"\") $ret=$ret.\", \".$year;\n\t\t\t$ret=$ret.\".\";\n\t\t}\n\t\tif($texType==\"unpublished\"){\n\t\t\t$note = extractBib(\"note\", $texEntry);\n\t\t\tif($note <> \"\") $ret .= ' '.$note;\n\t\t}\n\t\t\n\t\t$webcs = extractBib(\"citeseerurl\",$texEntry);\n\t\tif(trim($webcs)!=\"\") {\n\t\t\t$ret .= ' <a href=\"'.$webcs.'\" target=\"_blank\">citeseer..</a> ';\n\t\t}\n\t\t\n\t\t$webdoi = extractBib(\"doi\",$texEntry);\n\t\tif(trim($webdoi)!=\"\") {\n\t\t\t$ret .= ' <a href=\"'.$webdoi.'\" target=\"_blank\">doi..</a> ';\n\t\t}\n\t\t\n\t\t$weblink = extractBib(\"url\",$texEntry);\n\t\tif(trim($weblink)!=\"\") {\n\t\t\t$ret .= ' <a href=\"'.$weblink.'\" target=\"_blank\">more..</a> ';\n\t\t}\n\t\t\n\t\tif(trim($webpdf)!=\"\") {\n\t\t\t$ret .= ' <a href=\"'.$webpdf.'\" >pdf..</a> ';\n\t\t}\n\n\t\t$publisherurl = extractBib(\"publisherurl\",$texEntry);\n\t\tif(trim($publisherurl)!=\"\") {\n\t\t\t$ret .= ' <a href=\"'.$publisherurl.'\" target=\"_blank\">publisher..</a> ';\n\t\t}\n\t\t\n\t}//end there is no predefined text to show, we create some\n\t\t\n\t\n\treturn $ret;\n}",
"function bibfile2html($filename, $displayTypes = array(\t 'article' => 'Journal Papers',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'book' => 'Books',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'booklet' => 'Booklets',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conference' => 'Conferences',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'inbook' => 'Book chapters',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'incollection' => 'Collections',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'inproceedings' => 'Conference Papers',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'manual' => 'Manuals',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'mastersthesis' => 'MSc Theses',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'misc' => 'Misc',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'phdthesis' => 'PhD Theses',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'proceedings' => 'Conference Proceedings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'techreport' => 'Technical Reports',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unpublished' => 'Unpublished',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '_unknown' => 'Other'),\n\t\t\t\t\t\t\t\t$groupType = true, $groupYear = true) {\n\t\n\t\n\t$fileContent = file($filename);\n\t\n\t$entries = array();\n\t$i = 0;\n\t$j = 0;\n\t$len = count($fileContent);\n\tfor($i = 0; $i < $len; $i++) {\n\t\tif(substr($fileContent[$i], 0, 1) == '@') {\n\t\t\t// Start of new entry\n\t\t\t$type = strtolower(substr($fileContent[$i], 1, strpos($fileContent[$i], '{') - 1));\n\t\t\t$bibEntry = '';\n\t\t\t$eoe = false;\n\t\t\tfor($l = $i; $l < $len && !$eoe; $l++) {\n\t\t\t\t$bibEntry .= ' '.$fileContent[$l];\n\t\t\t\t$eoe = substr($fileContent[$l], 0, 1) == '}';\n\t\t\t}\n\t\t\t$i = $l-1;\n\t\t\t\n\t\t\tif(!array_key_exists($type, $displayTypes)) $type = '_unknown';\n\t\t\t\n\t\t\t$bibEntry = trim($bibEntry);\n\t\t\t$year = extractBib(\"year\",$bibEntry);\n\t\t\t$text = bibtex2html($bibEntry);\n\t\t\t\n\t\t\tif($year != '' && $text != '') {\n\t\t\t\tif($groupType) $entries[$type][$year][$j] = $text;\n\t\t\t\telse $entries[$year][$j] = $text;\n\t\t\t\t$j++;\n\t\t\t}\n\t\t}\n\t} \n\t\n\t$ret = '';\n\t$j = 1;\n\tif($groupType) {\n\t\tforeach($displayTypes as $type => $typeName) {\n\t\t\tif(isset($entries[$type])) {\n\t\t\t\tkrsort($entries[$type]);\n\t\t\t\t$ret .= '<h2>'.$typeName.'</h2>';\n\t\t\t\tif(!$groupYear) $ret .= '<ol start=\"'.$j.'\">';\n\t\t\t\tforeach($entries[$type] as $year => $yearEntries) {\n\t\t\t\t\tif($groupYear) {\n\t\t\t\t\t\t$ret .= '<h3>'.$year.'</h3>';\n\t\t\t\t\t\t$ret .= '<ol start=\"'.$j.'\">';\n\t\t\t\t\t}\n\t\t\t\t\tforeach($yearEntries as $index => $text) {\n\t\t\t\t\t\tif(trim($text) != '') $ret .= '<li>'.$text.'</li>';\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t}\n\t\t\t\t\tif($groupYear) $ret .= '</ol>';\n\t\t\t\t}\t\n\t\t\t\tif(!$groupYear) $ret .= '</ol>';\n\t\t\t}\n\t\t}\n\t} else {\t\n\t\tkrsort($entries);\n\t\tif(!$groupYear) $ret .= '<ol start=\"'.$j.'\">';\n\t\tforeach($entries as $year => $yearEntries) {\n\t\t\tif($groupYear) {\n\t\t\t\t$ret .= '<h2>'.$year.'</h2>';\n\t\t\t\t$ret .= '<ol start=\"'.$j.'\">';\n\t\t\t}\n\t\t\tforeach($yearEntries as $index => $text) {\n\t\t\t\tif(trim($text) != '') $ret .= '<li>'.$text.'</li>';\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\tif($groupYear) $ret .= '</ol>';\n\t\t}\t\n\t\tif(!$groupYear) $ret .= '</ol>';\n\t}\n\treturn $ret;\n}",
"function getByBibtexID($bibtex_id)\r\n {\r\n $CI = &get_instance();\r\n //retrieve one publication row\r\n $Q = $CI->db->getwhere('publication',array('bibtex_id'=>$bibtex_id));\r\n\r\n if ($Q->num_rows() > 0)\r\n {\r\n //load the publication\r\n return $this->getFromRow($Q->row());\r\n }\r\n else\r\n return null;\r\n }",
"function get_blog_entry($entry_name){\r\n\t\r\n\t$handle = fopen(ENTRIES_PATH.'.entries', \"rb\") or die('Missing or inaccessible entries file');\r\n\twhile (($data = fgetcsv($handle, 1000, \";\")) !== FALSE) {\r\n\t\tif($entry_name == $data[1]){\r\n\t\t\t$entry = array('id'=>$data[0],'file'=>ENTRIES_PATH.$data[0],'name'=>$data[1],'title'=>$data[2],'tags'=>$data[3],'user'=>$data[4],'created'=>$data[5],'updated'=>filemtime(ENTRIES_PATH.$data[0]));\r\n\t\t}\r\n\t}\r\n\tfclose($handle);\r\n\r\n\tif($entry != null && file_exists(ENTRIES_PATH.$data[0])) return $entry;\r\n\telse return null;\r\n}",
"function load_bibs( $formated = false ) {\r\n $bibdb_def = array(\r\n 'post_title' => 'BIBSDB',\r\n 'post_status' => 'draft',\r\n 'post_type' => 'bib',\r\n );\r\n $bibdb_post = get_posts( $bibdb_def );\r\n $bibdb = get_post_meta( $bibdb_post[0]->ID, $this->bid );\r\n $bibs = array();\r\n foreach( $bibdb as $b )\r\n //hash our bib for easier identification\r\n $bibs[ md5( $b ) ] = $formated ? $this->format( $b ) : $b;\r\n return $bibs;\r\n }",
"public function getBibliografia()\n {\n return $this->bibliografia;\n }",
"public function get_biblio_url() {\n return $this->bc->make_item_url((string)$this->item->BcId);\n }",
"public function writeSourcefileEntriesToDb() {\n\t\t//Read File\n\t\t$entries_from_file = array();\n\t\tswitch ($this->getFiletype()) {\n\t\t\tcase(\"ris\"):\n\t\t\t\t$entries_from_file = self::__readRisFile($this->getFileAbsolutePath());\n\t\t\t\tbreak;\n\t\t\tcase(\"bib\"):\n\t\t\t\t$entries_from_file = self::__readBibFile($this->getFileAbsolutePath());\n\t\t\t\tbreak;\n\t\t}\n\t\t//fill each entry into a ilBibliographicEntry object and then write it to DB by executing doCreate()\n\t\tforeach ($entries_from_file as $file_entry) {\n\t\t\t$type = NULL;\n\t\t\t$x = 0;\n\t\t\t$parsed_entry = array();\n\t\t\tforeach ($file_entry as $key => $attribute) {\n\t\t\t\t// if the attribute is an array, make a comma separated string out of it\n\t\t\t\tif (is_array($attribute)) {\n\t\t\t\t\t$attribute = implode(\", \", $attribute);\n\t\t\t\t}\n\t\t\t\t// reduce the attribute strings to a maximum of 4000 (ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH) characters, in order to fit in the database\n\t\t\t\t//if (mb_strlen($attribute, 'UTF-8') > self::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH) {\n\t\t\t\tif (ilStr::strLen($attribute) > self::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH) {\n\t\t\t\t\t// $attribute = mb_substr($attribute, 0, self::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH - 3, 'UTF-8') . '...';\n\t\t\t\t\t$attribute = ilStr::subStr($attribute, 0, self::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH - 3) . '...';\n\t\t\t\t}\n\t\t\t\t// ty (RIS) or entryType (BIB) is the type and is treated seperately\n\t\t\t\tif (strtolower($key) == 'ty' || strtolower($key) == 'entrytype') {\n\t\t\t\t\t$type = $attribute;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//TODO - Refactoring for ILIAS 4.5 - get rid off array restructuring\n\t\t\t\t//change array structure (name not as the key, but under the key \"name\")\n\t\t\t\t$parsed_entry[$x]['name'] = $key;\n\t\t\t\t$parsed_entry[$x ++]['value'] = $attribute;\n\t\t\t}\n\t\t\t//create the entry and fill data into database by executing doCreate()\n\t\t\t$entry_model = ilBibliographicEntry::getInstance($this->getFiletype());\n\t\t\t$entry_model->setType($type);\n\t\t\t$entry_model->setAttributes($parsed_entry);\n\t\t\t$entry_model->setBibliographicObjId($this->getId());\n\t\t\t$entry_model->doCreate();\n\t\t}\n\t}",
"function &getSubmissionFile() {\n\t\t$returner =& $this->getData('submissionFile');\n\t\treturn $returner;\n\t}",
"function get_article(){\n //if ($this->article_name=''){$this->article_name=\"home.dat\";}\n $text=$this->content=file_get_contents($this->article_name);\n return $text;\n }",
"static private function fetch_missing_bibtex()\n {\n $results = self::database_select_chunks(\"SELECT inspire FROM records WHERE (inspire != '' AND inspire IS NOT NULL) AND (bibtex = '' OR bibtex IS NULL)\")->chunks;\n\n $found = [];\n $total_count = 0;\n foreach ($results as $inspireArray) {\n $query = implode(\" OR \", $inspireArray);\n\n $url = \"https://inspirehep.net/search?p=find+recid+\" . urlencode($query) . \"&of=hx&rg=150\";\n $results = file_get_contents($url);\n\n $e1 = explode(\"</pre>\", $results);\n foreach ($e1 as $e2) {\n $e2 = explode(\"<pre>\", $e2);\n if (isset($e2[1])) {\n $bibtex = $e2[1];\n $e3 = explode(\"@\", $bibtex, 2);\n $e3 = explode(\"{\", $e3[1], 2);\n $e3 = explode(\",\", $e3[1], 2);\n $bibkey = $e3[0];\n\n $bibtex = htmlspecialchars_decode($bibtex);\n\n if ($bibkey) {\n $query = sprintf(\"UPDATE records SET bibtex = '%s' WHERE bibkey = '{$bibkey}'\",\n mySpires::db()->real_escape_string($bibtex));\n mySpires::db_query($query);\n\n if(mySpires::db()->affected_rows)\n $found[] = $bibkey;\n }\n }\n }\n\n $total_count += sizeof($inspireArray);\n }\n\n $lost_count = $total_count - sizeof($found);\n\n if(sizeof($found) > 0)\n self::log(\"Synced BibTeX for \" . sizeof($found) . \" records from INSPIRE: \" . implode(\", \", $found) . \".\");\n if($lost_count > 0)\n self::log($lost_count . \" records did not have a BibTeX record on INSPIRE.\");\n\n $results = self::database_select_chunks(\"SELECT arxiv FROM records WHERE (inspire = '' OR inspire IS NULL) AND (arxiv != '' AND arxiv IS NOT NULL) AND (bibtex = '' OR bibtex IS NULL)\")->chunks;\n\n $found_nasa = [];\n $total_count_nasa = 0;\n foreach ($results as $arxivArray) {\n $query = implode(\" OR \", $arxivArray);\n\n $response = mySpires::nasa_ads(\"search/query\",\n [\"q\" => \"arXiv:\" . $query, \"fl\" => \"bibcode,identifier\", \"rows\" => 150]);\n\n $results = $response->response->docs;\n $nasa_ids = [];\n foreach($results as $result) {\n $arxiv = null;\n foreach($result->identifier as $i) {\n $e = explode(\"arXiv:\", $i);\n if(sizeof($e) == 2) {\n $arxiv = $e[1];\n break;\n }\n }\n $nasa_ids[$result->bibcode] = $arxiv;\n }\n\n $response = mySpires::nasa_ads(\"export/bibtex\", [\"bibcode\" => array_keys($nasa_ids)]);\n $results = explode(\"\\n\\n\", $response->export);\n\n foreach($results as $bibtex) {\n $e = explode(\"{\", $bibtex);\n $e = explode(\",\", $e[1]);\n\n if($bibtex && $e[0]) {\n $arxiv = $nasa_ids[$e[0]];\n $query = sprintf(\"UPDATE records SET bibtex = '%s' WHERE arxiv = '{$arxiv}'\",\n mySpires::db()->real_escape_string($bibtex));\n mySpires::db_query($query);\n array_push($found_nasa, $arxiv);\n }\n }\n\n $total_count_nasa += sizeof($arxivArray);\n }\n\n $lost_count_nasa = $total_count_nasa - sizeof($found_nasa);\n\n if(sizeof($found_nasa) > 0)\n self::log(\"Synced BibTeX for \" . sizeof($found_nasa) . \" records: \" . implode(\", \", $found_nasa) . \" from NASA-ADS.\");\n if($lost_count_nasa > 0)\n self::log($lost_count_nasa . \" records did not have a BibTeX record on NASA-ADS.\");\n\n\n return (object)Array(\"found\" => array_merge($found, $found_nasa), \"lost_count\" => ($lost_count + $lost_count_nasa));\n }",
"public function getEntry();",
"private function initialize_citations_file()\n {\n \n $tmp_file = Functions::save_remote_file_to_local($this->citations_tsv_file, $this->download_options);\n \n $i = 0;\n if(!file_exists($tmp_file)) {\n exit(\"\\nFile does not exist: [$tmp_file]\\n\");\n }\n foreach(new FileIterator($tmp_file) as $line => $row) {\n $row = Functions::conv_to_utf8($row);\n $i++; \n if($i == 1) {\n // URL.to.paper\n $fields = explode(\"\\t\", $row);\n print_r($fields); //exit;\n }\n else {\n if(!$row) continue;\n $tmp = explode(\"\\t\", $row);\n // print_r($tmp); //exit;\n $rec = array(); $k = 0;\n foreach($fields as $field) {\n $rec[$field] = $tmp[$k];\n $k++;\n }\n $rec = array_map('trim', $rec);\n \n // print_r($rec); //exit;\n /*Array(\n [URL to paper] => http://onlinelibrary.wiley.com/doi/10.1111/nph.13935/abstract\n [DOI] => 10.1111/nph.13935\n [Journal] => New Phytologist\n [Publisher] => Wiley\n [Title] => Plasticity in plant functional traits is shaped by variability in neighbourhood species composition\n [Author] => Abakumova\n [Year] => 2016\n [author_year] => .abakumova.2016\n [BibTeX citation] => @article {NPH:NPH13935,author = {Abakumova, Maria and Zobel, Kristjan and Lepik, Anu and Semchenko, Marina},title = {Plasticity in plant functional traits is shaped by variability in neighbourhood species composition},journal = {New Phytologist},volume = {211},number = {2},issn = {1469-8137},url = {http://dx.doi.org/10.1111/nph.13935},doi = {10.1111/nph.13935},pages = {455--463},keywords = {biotic environment, competition, functional traits, local adaptation, neighbour recognition, phenotypic plasticity, selection, spatial patterns},year = {2016},note = {2015-20353},}\n [Taxonomy ] => Plantae\n [Person] => Anne\n [WhoWroteFunction] => \n [Everything Completed?] => \n [] => \n )\n Last, F. M. (Year, Month Date Published). Article title. Retrieved from URL\n Last, F. M. (Year Published) Book. City, State: Publisher.\n */\n $full_ref = \"$rec[Author]. ($rec[Year]). $rec[Title]. $rec[Journal]. $rec[Publisher].\";\n $full_ref = trim(Functions::remove_whitespace($full_ref));\n $rec['full_ref'] = $full_ref;\n $this->refs[$rec['author_year']] = $rec;\n }\n }\n unlink($tmp_file);\n // exit(\"\\nstop muna\\n\");\n /* as of Oct 14, 2019: \n no citations yet\n ----- .albouy.2015 total: 1\n ----- .anderson.2015 total: 1\n */\n \n /* Latest citations.tsv from repo has \".albuoy.2015\" */\n $this->refs['.albouy.2015'] = $this->refs['.albuoy.2015'];\n \n /* added by Jen: https://eol-jira.bibalex.org/browse/DATA-1754?focusedCommentId=64033&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-64033\n Meanwhile, any luck on those dangling references? If not, I have a pretty good guess we can add manually:\n */\n $rek = array();\n $rek['author_year'] = \".anderson.2015\";\n $rek['full_ref'] = \"Jill T Anderson, Zachariah J. Gezon. 2015. Plasticity in functional traits in the context of climate change: a case study of the subalpine forb Boechera stricta (Brassicaceae). Global change biology 2015. DOI:10.1111/gcb.12770\";\n $rek['URL.to.paper'] = '';\n $rek['DOI'] = \"DOI:10.1111/gcb.12770\";\n $rek['Publisher'] = \"\";\n $rek['Title'] = \"Plasticity in functional traits in the context of climate change: a case study of the subalpine forb Boechera stricta (Brassicaceae)\";\n $rek['Author'] = \"Jill T Anderson, Zachariah J. Gezon.\";\n $this->refs[$rek['author_year']] = $rek;\n\n /* No need for manual entry anymore for these two:\n $rek = array();\n $rek['author_year'] = '.albouy.2015';\n $rek['full_ref'] = \"Albouy, C. , Lasram, F. B., Velez, L. , Guilhaumon, F. , Meynard, C. N., Boyer, S. , Benestan, L. , Mouquet, N. , Douzery, E. , Aznar, R. , Troussellier, M. , Somot, S. , Leprieur, F. , Le Loc'h, F. and Mouillot, D. (2015), FishMed: traits, phylogeny, current and projected species distribution of Mediterranean fishes, and environmental data. Ecology, 96: 2312-2313. doi:10.1890/14-2279.1\";\n $rek['URL.to.paper'] = '';\n $rek['DOI'] = 'doi:10.1890/14-2279.1';\n $rek['Publisher'] = \"\";\n $rek['Title'] = \"FishMed: traits, phylogeny, current and projected species distribution of Mediterranean fishes, and environmental data\";\n $rek['Author'] = \"Albouy, C. , Lasram, F. B., Velez, L. , Guilhaumon, F. , Meynard, C. N., Boyer, S. , Benestan, L. , Mouquet, N. , Douzery, E. , Aznar, R. , Troussellier, M. , Somot, S. , Leprieur, F. , Le Loc'h, F. and Mouillot, D.\";\n $this->refs[$rek['author_year']] = $rek;\n\n $rek = array();\n $rek['author_year'] = \".goncalves.2018\";\n $rek['full_ref'] = \"Gonçalves, F. , Bovendorp, R. S., Beca, G. , Bello, C. , et al. (2018), ATLANTIC MAMMAL TRAITS: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology, 99: 498-498. doi:10.1002/ecy.2106\";\n $rek['URL.to.paper'] = '';\n $rek['DOI'] = \"doi:10.1002/ecy.2106\";\n $rek['Publisher'] = \"\";\n $rek['Title'] = \"ATLANTIC MAMMAL TRAITS: a data set of morphological traits of mammals in the Atlantic Forest of South America\";\n $rek['Author'] = \"Gonçalves, F. , Bovendorp, R. S., Beca, G. , Bello, C. , et al.\";\n $this->refs[$rek['author_year']] = $rek;\n */\n \n // print_r($this->refs); exit;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if banner status = 1 and banner linked to active placeholder | public function isActive()
{
if ($this->getStatus() && count($this->getPlaceholderIds(true))) {
return true;
}
return false;
} | [
"function catalyst_is_banner_active() {\n $page_settings = catalyst_get_page_settings();\n return ! $page_settings['hide_banner'] && ( ! empty( $page_settings['banner_title'] ) || ! empty( $page_settings['banner_tagline'] ) || ! empty( $page_settings['banner_menu'] ) || ! empty( $page_settings['banner_image'] ) );\n}",
"function adventure_tours_vp_header_section_is_banner($value) {\n\treturn $value == 'banner';\n}",
"public function hasBanner($type);",
"public static function hasBanner()\n {\n return !is_null(static::$banner);\n }",
"public function should_display_banner() {\n\t\treturn $this->banner_not_dismissed() &&\n\t\t\t$this->jetpack_installed_and_active() &&\n\t\t\t$this->jetpack_up_to_date() &&\n\t\t\t$this->jetpack_connected &&\n\t\t\t$this->no_incompatible_plugins_installed &&\n\t\t\t$this->order_has_shippable_products() &&\n\t\t\t$this->store_in_us_and_usd() &&\n\t\t\t( $this->wcs_not_installed() || (\n\t\t\t\t$this->wcs_up_to_date() && ! $this->wcs_tos_accepted\n\t\t\t) );\n\t}",
"public function has_banners() {\n\t\treturn ! empty( $this->banners );\n\t}",
"public function hasBanner($type){\n\t\t$this->processBanners();\n\t\treturn isset($this->m_banners) ? $this->m_banners->hasBanner($type) : false;\n\t}",
"public function isActive(){\n return !empty($this->imgActive);\n }",
"function zen_activate_banners() {\r\n global $db;\r\n $banners_query = \"select banners_id, date_scheduled\r\n from \" . TABLE_BANNERS . \"\r\n where date_scheduled != NULL\";\r\n\r\n $banners = $db->Execute($banners_query);\r\n\r\n if ($banners->RecordCount() > 0) {\r\n while (!$banners->EOF) {\r\n if (date('Y-m-d H:i:s') >= $banners->fields['date_scheduled']) {\r\n zen_set_banner_status($banners->fields['banners_id'], '1');\r\n }\r\n $banners->MoveNext();\r\n }\r\n }\r\n }",
"protected function isBannerSystem()\n {\n return $this->isModuleEnabled('Banner', 'QSL');\n }",
"public function activateBanner($id){\n\t\t$myArr = array( 'status' => 1 );\n\t\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update('banner', $myArr);\n\t\n\t\treturn $this->db->affected_rows();\n\t}",
"function osc_set_banner_status($banners_id, $status) {\n if ($status == '1') {\n return osc_db_query(\"update \" . TABLE_BANNERS . \" set status = '1', expires_impressions = NULL, expires_date = NULL, date_status_change = NULL where banners_id = '\" . $banners_id . \"'\");\n } elseif ($status == '0') {\n return osc_db_query(\"update \" . TABLE_BANNERS . \" set status = '0', date_status_change = now() where banners_id = '\" . $banners_id . \"'\");\n } else {\n return -1;\n }\n }",
"public function bannersExist() {\n global $DB;\n return $DB->record_exists($this->banners_table, array('audience'=>$this->audience));\n }",
"private function user_has_banner(int $user)\n {\n $profile_query = $this->link->prepare(\n 'SELECT id\n FROM upload\n WHERE\n uploader_id = :user &&\n type = :type'\n );\n $profile_query->execute([\n ':user' => $user,\n ':type' => $this->types[$this::BANNER]\n ]);\n return (\n $profile_query->rowCount() !== 0\n );\n }",
"public function getActiveBanner()\n {\n return Mage::getModel('space48timer/banner')->load($this->getData('active'));\n }",
"function is_header_video_active() {}",
"function isLive() {\n \treturn $this->getStatusID() == LIVE;\n }",
"public static function is_bbpress_active() {\n\t\t\treturn ( self::is_plugin_active( 'bbpress/bbpress.php' )\n\t\t\t && ( self::is_plugin_active( 'wsal-bbpress.php' ) )\n );\n\t\t}",
"protected function IsActive() {\n\treturn \n\t $this->Status_DoHoldRestock()\n\t || $this->Status_DoHoldCharge()\n\t || $this->Status_DoContact()?'[do contact]':NULL\n\t || $this->Status_DoExamine()?'[do examine]':NULL\n\t ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
format arguments to be instert to sql query, Ex. last_name = value,first_name = value this fucntion will return a series if value is a string then this function will automatically put a single quote if the fields and the value is not the same length/count the it will return an empty string | private static function formatArguments(array $fields,array $values):string{
$formated_arguments = "";
if(count($fields)==count($values)){
$count = 0;
foreach($fields as $field){
$input_value = (gettype($values[$count])=="string")?"'".$values[$count]."'":$values[$count];//if string type the put single quote
if($field!=NULL){
if($count<count($values)-1){
$formated_arguments .= $field."=".$input_value.",";
}
else{
$formated_arguments .= $field."=".$input_value;
}
}
$count++;
}
}
if($formated_arguments!="")return $formated_arguments;
return "";
} | [
"function formatField($fields, $values, $op = \" AND \") { //{{{\n global $noQuoteFields;\n \n $format = \"%s:%s%s%s^%d\";\n \n $fields = is_array($fields) ? $fields : array($fields => 1);\n \n $valueTerms = array();\n\n // values is 2D array, so $op everything, disjoining on fields\n // used for text input queries\n if (isset($values[0]) && is_array($values[0])) {\n foreach ($values as $val) {\n foreach ((array) $val as $v) {\n $fieldTerms = array();\n \n // loop over fields, looking for value in each field\n foreach ($fields as $f => $b) {\n // don't quote *s or values in noQuoteFields\n $q = \"*\" == $v || in_array($f, $noQuoteFields) ? \"\" : '\"';\n \n $fieldTerms[] = sprintf($format,\n $f, $q, $v, $q, $b);\n }\n \n // disjoin searches for current value in each field\n $valueTerms[] = sprintf(\"(%s)\", implode(\" OR \", $fieldTerms));\n }\n }\n }\n // values is 1D array - assumes that fields only has 1 element\n // essentially disjoin values\n // used for facets\n else {\n $fieldTerms = array();\n foreach ($values as $val) {\n // loop over fields, looking for value in each field\n foreach ($fields as $f => $b) {\n // don't quote *s or values in noQuoteFields\n $q = \"*\" == $val || in_array($f, $noQuoteFields) ? \"\" : '\"';\n \n $fieldTerms[] = sprintf($format,\n $f, $q, $val, $q, $b);\n }\n }\n \n // disjoin searches for current value in each field\n $valueTerms[] = sprintf(\"(%s)\", implode(\" OR \", $fieldTerms));\n }\n\n // join groups of value queries using operator\n return sprintf(\"(%s)\", implode($op, $valueTerms));\n}",
"private function format_sql($args)\n{ \n\n // Get connection\n $type = preg_match(\"/^(select|show|describe) /i\", $args[0]) ? 'read' : 'write';\n $conn = $this->get_connection($type);\n $this->conn = $conn;\n\n\n // Set variables\n $x=1;\n $values = array();\n $bind_params = '';\n $raw_sql = $args[0];\n\n // Go through args\n preg_match_all(\"/\\%(\\w+)/\", $args[0], $args_match, PREG_SET_ORDER);\n foreach ($args_match as $match) { \n $value = $args[$x] ?? '';\n\n // Check data type\n $is_valid = true;\n if ($match[1] == 'i' && $value != '0' && !filter_var($value, FILTER_VALIDATE_INT)) { $is_valid = false; }\n elseif ($match[1] == 'd' && $value != '' && !preg_match(\"/^[0-9]+(\\.[0-9]{1,})?$/\", (string) abs($value))) { $is_valid = false; }\n elseif ($match[1] == 'b' && $value != '0' && !filter_var($value, FILTER_VALIDATE_INT)) { $is_valid = false; }\n elseif ($match[1] == 'e' && !filter_var($value, FILTER_VALIDATE_EMAIL)) { $is_valid = false; }\n elseif ($match[1] == 'url' && !filter_var($value, FILTER_VALIDATE_URL)) { $is_valid = false; }\n elseif ($match[1] == 'ds') { \n if (preg_match(\"/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/\", $value, $dmatch)) { \n if (!check_date($dmatch[2], $dmatch[3], $dmatch[1])) { $is_valid = false; }\n } else { $is_valid = false; }\n } elseif ($match[1] == 'ts' && !preg_match(\"/^\\d\\d:\\d\\d:\\d\\d$/\", $value)) { $is_valid = false; }\n elseif ($match[1] == 'dt') { \n if (preg_match(\"/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d) \\d\\d:\\d\\d:\\d\\d$/\", $value, $dmatch)) { \n if (!check_date($dmatch[2], $dmatch[3], $dmatch[1])) { $is_valid = false; }\n } else { $is_valid = false; }\n }\n \n\n // Process invalid argument, if needed\n if ($is_valid === false) { \n throw new DBException('invalid_variable', $args[0], '', '', '', '', $match[1], $value);\n }\n\n // Add bind_param\n if ($match[1] == 'i' || $match[1] == 'b') { $bind_params .= 'i'; }\n elseif ($match[1] == 'd') { $bind_params .= 'd'; }\n elseif ($match[1] == 'blobl') { $bind_params .= 'b'; }\n else { $bind_params .= 's'; }\n\n // Format value\n if ($match[1] == 'ls') { $value = '%' . $value . '%'; }\n $values[] = $value;\n\n // Replace placeholder in SQL\n $args[0] = preg_replace(\"/$match[0]/\", '?', $args[0], 1);\n $raw_sql = preg_replace(\"/$match[0]/\", \"'\" . mysqli_real_escape_string($conn, (string) $value) . \"'\", $raw_sql, 1);\n\n $x++; }\n\n // Check for prepared statement\n $hash = 's' . crc32($args[0]);\n if (!isset($this->prepared[$hash])) { \n if (!$this->prepared[$hash] = mysqli_prepare($conn, $args[0])) { \n throw new DBException('query', $raw_sql, mysqli_error($conn));\n }\n }\n $this->raw_sql = $raw_sql;\n\n // Return\n return array($hash, $bind_params, $values);\n\n}",
"public function format($sql);",
"private function renderQuery($args) {\n /*all given arguments as array*/\n $converted_args = array();\n\n /*first argument is sql query, others are params for rendering*/\n $query_part = $args[0];\n for ($i=1;$i<count($args);$i++) {\n if (is_string($args[$i])) {\n /*escape dangerous chars*/\n $args[$i] = \"'\".$this->connection->escape_string($args[$i]).\"'\";\n } elseif ($args[$i] === Null) {\n /*translate Null type to db NULL*/\n $args[$i] = \"NULL\";\n } elseif ($args[$i] === False) {\n $args[$i] = 0;\n }\n\n array_push($converted_args, $args[$i]);\n }\n return vsprintf($query_part, $converted_args);\n }",
"private static function esc_sql_value( $values ) {\n\t\t$quote = static function ( $v ) {\n\t\t\t// Don't quote integer values to avoid MySQL's implicit type conversion.\n\t\t\tif ( preg_match( '/^[+-]?[0-9]{1,20}$/', $v ) ) { // MySQL BIGINT UNSIGNED max 18446744073709551615 (20 digits).\n\t\t\t\treturn esc_sql( $v );\n\t\t\t}\n\n\t\t\t// Put any string values between single quotes.\n\t\t\treturn \"'\" . esc_sql( $v ) . \"'\";\n\t\t};\n\n\t\tif ( is_array( $values ) ) {\n\t\t\treturn array_map( $quote, $values );\n\t\t}\n\n\t\treturn $quote( $values );\n\t}",
"function format_sql( $value, $like = NULL ){ \n\t// Stripslashes\n\tif ( get_magic_quotes_gpc() ) {\n\t\t$value = stripslashes( $value );\n\t}\n\n\t// Quote if not a number or a numeric string,\n\t// add % if using LIKE\n\tif ( !is_numeric( $value ) ) {\n\t\t$value = \"'\". ( $like ? '%' : '' ) . mysql_real_escape_string( $value ) . ( $like ? '%' : '' ) .\"'\";\n\t}\n\n\treturn $value;\n}",
"private function inserirStr(){\n\t $fields = '';\n\t $values = '';\n\n for($x=1;$x < $this->numFields();$x++){\n $field = $this->fieldName($x);\n\n\t\t // Este if gera o seguinte código para a variável $fields = \"nome, email, data_nasc, cpf\" (exemplo para clientes)\n\t\t // E também para a variável $values = \":nome, :email, :data_nasc, cpf\"\n\t\t if($x < $this->numFields()-1){\n $fields .= \"$field,\";\n $values .= \":$field, \";\n\t\t }else{\n $fields .= \"$field\";\n $values .= \":$field\";\n\t\t }\n\t }\n $inserirStr = \"($fields) VALUES ($values)\";\n return $inserirStr;\n }",
"public function format($format)\n\t{\n\t\t$query = $this;\n\t\t$args = array_slice(func_get_args(), 1);\n\t\tarray_unshift($args, null);\n\n\t\t$i = 1;\n\t\t$func = function ($match) use ($query, $args, &$i)\n\t\t{\n\t\t\tif (isset($match[6]) && $match[6] == '%')\n\t\t\t{\n\t\t\t\treturn '%';\n\t\t\t}\n\n\t\t\t// No argument required, do not increment the argument index.\n\t\t\tswitch ($match[5])\n\t\t\t{\n\t\t\t\tcase 't':\n\t\t\t\t\treturn $query->currentTimestamp();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'z':\n\t\t\t\t\treturn $query->nullDate(false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Z':\n\t\t\t\t\treturn $query->nullDate(true);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Increment the argument index only if argument specifier not provided.\n\t\t\t$index = is_numeric($match[4]) ? (int) $match[4] : $i++;\n\n\t\t\tif (!$index || !isset($args[$index]))\n\t\t\t{\n\t\t\t\t// TODO - What to do? sprintf() throws a Warning in these cases.\n\t\t\t\t$replacement = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$replacement = $args[$index];\n\t\t\t}\n\n\t\t\tswitch ($match[5])\n\t\t\t{\n\t\t\t\tcase 'a':\n\t\t\t\t\treturn 0 + $replacement;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'e':\n\t\t\t\t\treturn $query->escape($replacement);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'E':\n\t\t\t\t\treturn $query->escape($replacement, true);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'n':\n\t\t\t\t\treturn $query->quoteName($replacement);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'q':\n\t\t\t\t\treturn $query->quote($replacement);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Q':\n\t\t\t\t\treturn $query->quote($replacement, false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'r':\n\t\t\t\t\treturn $replacement;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Dates\n\t\t\t\tcase 'y':\n\t\t\t\t\treturn $query->year($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Y':\n\t\t\t\t\treturn $query->year($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'm':\n\t\t\t\t\treturn $query->month($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'M':\n\t\t\t\t\treturn $query->month($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'd':\n\t\t\t\t\treturn $query->day($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'D':\n\t\t\t\t\treturn $query->day($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'h':\n\t\t\t\t\treturn $query->hour($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'H':\n\t\t\t\t\treturn $query->hour($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'i':\n\t\t\t\t\treturn $query->minute($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'I':\n\t\t\t\t\treturn $query->minute($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\treturn $query->second($query->quote($replacement));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'S':\n\t\t\t\t\treturn $query->second($query->quoteName($replacement));\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn '';\n\t\t};\n\n\t\t/**\n\t\t * Regexp to find an replace all tokens.\n\t\t * Matched fields:\n\t\t * 0: Full token\n\t\t * 1: Everything following '%'\n\t\t * 2: Everything following '%' unless '%'\n\t\t * 3: Argument specifier and '$'\n\t\t * 4: Argument specifier\n\t\t * 5: Type specifier\n\t\t * 6: '%' if full token is '%%'\n\t\t */\n\t\treturn preg_replace_callback('#%(((([\\d]+)\\$)?([aeEnqQryYmMdDhHiIsStzZ]))|(%))#', $func, $format);\n\t}",
"protected function normalizeValSQL($symbol,$name,$arg){\n\n $ret_str = sprintf(' %s %s ?',$name,$symbol);\n return array($ret_str,$arg);\n \n }",
"function prepare($args=NULL) {\n if ( NULL === $args )\n return;\n $args = func_get_args();\n $query = array_shift($args);\n $query = str_replace(\"'%s'\", '%s', $query); // in case someone mistakenly already singlequoted it\n $query = str_replace('\"%s\"', '%s', $query); // doublequote unquoting\n $query = str_replace('%s', \"'%s'\", $query); // quote the strings\n array_walk($args, array(&$this, 'escape_by_ref'));\n return @vsprintf($query, $args);\n }",
"public function insertEscaped(...$field_values);",
"private function genInsertValuesString(array $values){\n\t\t$sql = '';\n\t\t$i = 0;\n\t\t$cnt = count($values);\n\t\tforeach($values as $val){\n\t\t\t$sql .= $this->prepareValue($val);\n\t\t\tif($i++ != $cnt-1) $sql .= ', ';\n\t\t}\n\t\treturn $sql;\n\t}",
"function squery() {\n\t\t$args = func_num_args();\n\t\tif($args > 0) {\n\t\t\t$param = func_get_args();\n\t\t\treturn $this->query(call_user_func_array('sprintf', $param));\n\t\t}\n\t}",
"function makeString(){\n $n = func_num_args();\n $args = func_get_args();\n $val = \"\";\n $sep = \",\";\n $container = \"'\";\n if($n==2){\n $sep=$args[1];\n }\n elseif($n==3){\n $sep=$args[1];\n $container=$args[2];\n }\n foreach($args[0] as $v){\n $val.=\"$container$v$container$sep\";\n }\n $val = rtrim($val,$sep);\n return $val;\n}",
"private function formatUpdate(): string {\n $rawValues = reset($this->update);\n $table = key($this->update);\n $values = [];\n foreach ($rawValues as $col => $value) {\n $values[] = \"{$col} = \" . ($value !== NULL ? \"{$this->connection->quote($value)}\" : \"null\");\n }\n $values = implode(\", \", $values);\n $query = \"UPDATE {$table} SET {$values}\";\n return $query;\n }",
"function format(): string\n\t{\n\t\t$args = func_get_args();\n\n\t\tif (is_array($args[0]))\n\t\t\t$args = $args[0];\n\n\t\treturn vsprintf($args[0], array_slice($args, 1));\n\t}",
"public function format() {\n $a= func_get_args();\n return $this->apply($this->formatString, $a);\n }",
"private function buildValues() {\n\t\t$sql = \"\";\n\t\tif (!empty($this->fields)) {\n\t\t\t$i=0;\n\t\t\t$fields = \"\";\n\t\t\t$values = \"\";\n\t\t\tforeach ($this->fields as $field => $value) {\n\t\t\t\t$fields .= ($i > 0 ? \", \" : \"\") . $this->escapeField($field);\n\t\t\t\t$values .= ($i > 0 ? \", \" : \"\");\n\t\t\t\t\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\tif (isset($value['bind_value']) && $value['bind_value'] === false)\n\t\t\t\t\t\t$values .= (isset($value['escape']) && $value['escape'] ? $this->escapeField($value['value']) : $value['value']);\n\t\t\t\t\telse {\n\t\t\t\t\t\t$values .= \"?\";\n\t\t\t\t\t\t$this->values[] = $value['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$values .= \"?\";\n\t\t\t\t\t$this->values[] = $value;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t$sql .= \" (\" . $fields . \") VALUES (\" . $values . \")\";\n\t\t}\n\t\t\n\t\treturn $sql;\n\t}",
"function my_sprintf($format, $arg1) {\r\n\t$args = func_get_args();\r\n\t$args = array_slice($args, 0, 1, true) + \r\n\t\t\tarray_map(\"mysql_real_escape_string\", array_slice($args, 1, count($args) - 1, true));\r\n return call_user_func_array('sprintf', $args);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the vehicle is assigned to the driver. | public function isVehicleAssigned()
{
return $this->isVehicleNotAssigned() === false;
} | [
"public function isVehicleNotAssigned()\n {\n return !$this->vehicle_uuid;\n }",
"public function canAssignDriver()\n {\n return $this->isAdmin() || $this->isDriver();\n }",
"public function hasDriver()\n {\n return $this->trip->hasDriver();\n }",
"public function hasVehicle()\n {\n return isset($this->vehicle);\n }",
"public function hasDriver($driverUID);",
"protected function hasUpdatedVehicles()\n {\n return ($this->application->getLicenceVehicles()->count() > 0);\n }",
"public function isAssignedToDevice()\n\t{\n\t\t$device_id = $this->getDeviceId();\n\t\treturn isset($device_id);\n\t}",
"function check_own_vehicle($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\tif (empty($cid))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, $lang['No_vehicle_id_specified'], '', __LINE__, __FILE__);\n\t\t}\n\t\n\t\t$sql = \"SELECT g.member_id FROM \" . GARAGE_TABLE . \" AS g WHERE g.id = $cid \";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\t$vehicle = $db->sql_fetchrow($result); \n\t\t$db->sql_freeresult($result);\n\t\n\t\tif ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )\n\t\t{\n\t\t\t//Allow A Moderator Or Administrator Do What They Want....\n\t\t\treturn;\n\t\t}\n\t\telse if ( $vehicle['member_id'] != $userdata['user_id'] )\n\t\t{\n\t\t\t$message = $lang['Not_Vehicle_Owner'] . \"<br /><br />\" . sprintf($lang['Click_return_garage'], \"<a href=\\\"\" . append_sid(\"garage.$phpEx\") . \"\\\">\", \"</a>\") . \"<br /><br />\" . sprintf($lang['Click_return_index'], \"<a href=\\\"\" . append_sid(\"index.$phpEx\") . \"\\\">\", \"</a>\");\n\t\n\t\t\tmessage_die(GENERAL_MESSAGE, $message);\n\t\t}\n\t\n\t\treturn ;\n\t}",
"public function hasGuardPokemonId()\n {\n return $this->GuardPokemonId !== null;\n }",
"public function isDriverReviewGiven() {\n //we dont care about comment because we know its not our responsibility: both comment and rating are mandatory\n if ($this->reviewDriverRating != null && $this->reviewDriverRating > 0) {\n return true;\n }\n return false;\n }",
"public function isDriver()\n {\n return $this->isRole('driver');\n }",
"public function isReady()\n {\n foreach ($this->contenders as $contender) {\n if (!$contender->team_id) return false;\n }\n if ($this->poolState == PoolState::Prep) return true;\n }",
"public function CheckPlayer() {\n if(!$this->guid || !$this->name) {\n return false;\n }\n return true;\n }",
"public function isAssignedToAnyAgent()\n {\n return (bool) $this->assignment;\n }",
"public function isSelfAssigned(): bool\n {\n return RijksregisternummerHelper::isSelfAssigned($this->rijksregisternummer);\n }",
"public function check_company_setup_status()\n {\n return (Auth::user()->company_id > 0) ? true : false;\n }",
"public function isControllable()\n\t{\n\t\treturn $this->isControl() && $this->isAssignedToDevice();\n\t}",
"public function hasSeatAssignment(): boolean\n {\n return $this->getSeat() ? true : false;\n }",
"public function hasGuardPokemonCp()\n {\n return $this->guard_pokemon_cp !== null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getting the latest products | public static function getLatestShop()
{
return self::where('new_product','1')->get();
} | [
"public function getLatest(){\n $query = \"SELECT * FROM products LIMIT 1\";\n $pdo = new Connection();\n $pdo = $pdo->open();\n $results = $pdo->query($query);\n $rows = [];\n foreach($results->fetchAll() as $row){\n $rows[] = new Product($row['name'], $row['price'], $row['image'], $row['description'], $row['id']);\n }\n return $rows;\n }",
"public function getLatestProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table ORDER BY added LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }",
"public function fetchProductByOldest() {\r\n $sqlQuery = 'SELECT * FROM tb_product ORDER BY id ASC';\r\n $statement = $this->_dbHandle->prepare($sqlQuery); // prepare PDO statement\r\n $statement->execute(); // execute the PDO statement\r\n\r\n $dataSet = [];\r\n while ($row = $statement->fetch()) {\r\n $dataSet[] = new productData($row);\r\n }\r\n return $dataSet;\r\n }",
"public function getLatestProducts(){\r\n\r\n $collection = $this->_productCollectionFactory->create();\r\n\r\n $collection = $this->_addProductAttributesAndPrices(\r\n $collection\r\n )->addStoreFilter()\r\n ->addAttributeToSort('entity_id', 'desc')\r\n ->setPageSize($this->_limit)->setCurPage(1);\r\n $collection = $this->findProductByCatgoryIds($collection);\r\n $collection->getSelect()->group('e.entity_id');\r\n\r\n return $collection;\r\n }",
"function getLatestProducts(){\n\t\t\t//checking for latest category in category table\n\t\t\t$category = $this->manage_content->getValue_where(\"product_category\",\"*\",\"category\",\"Novo v ponudbi\");\n\t\t\t//checking for latest products availability\n\t\t\tif(!empty($category[0]) && $category[0]['status'] == 1)\n\t\t\t{\n\t\t\t\t//getting latest product list from database\n\t\t\t\t$latests = $this->manage_content->getValue_likely_descending(\"product_table\",\"*\",\"category\",\"Novo v ponudbi\");\n\t\t\t\techo '<h4 class=\"left_container_heading\"><span class=\"heading_text\">Novo v ponudbi</span></h4>';\n\t\t\t\t//fetching them in left sidebar\n\t\t\t\tforeach($latests as $latest){\n\t\t\t\t\t//checking for date expiry\n\t\t\t\t\t$expire_date = $this->checkingDate($latest['expiration_date']);\n\t\t\t\t\tif($latest['status'] == 1 && $expire_date == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<div class=\"row-fluid left_container_product\">\n\t\t\t\t\t\t\t\t<div class=\"span3\"><a href=\"product.php?product='.$latest['product_id'].'\"><img src=\"'.$latest['image'].'\"/></a></div>\n\t\t\t\t\t\t\t\t<div class=\"span7 offset1\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"product.php?product='.$latest['product_id'].'\">'.$latest['product_name'].'</a></p>\n\t\t\t\t\t\t\t\t\t<p class=\"left_container_product_amount\"><a href=\"product.php?product='.$latest['product_id'].'\"> € '.$latest['price_members'].'</a></p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function loadLatestProducts()\n {\n $products = $this->createQueryBuilder('p')\n ->join('p.image', 'i')\n ->addSelect('i')\n ->where('p.isActive = :isactive')\n ->andWhere('p.new = :new')\n ->setParameter(':isactive', true)\n ->setParameter(':new', 'new')\n ->getQuery()\n ->getArrayResult();\n shuffle($products);\n return array_slice($products, 0, 7, true);\n }",
"public function get_newest_products()\n {\n return DB::select()\n ->from('products')\n ->order_by('id', 'DESC')\n ->where('is_discount', '=', 0)\n ->limit(6)\n ->as_object()\n ->execute();\n }",
"function get_products_recent(){\n require(ROOT_PATH . \"inc/database.php\");\n try {\n $results = $db->prepare(\"\n SELECT name, price, img, sku, paypal \n FROM products \n ORDER BY sku DESC \n LIMIT 4\");\n $results->execute();\n } catch (Exception $e) {\n echo \"Not possible to run the query...\";\n exit();\n }\n\n $recent = $results->fetchAll(PDO::FETCH_ASSOC);\n $recent = array_reverse($recent);\n return $recent;\n }",
"public function getLatestItem();",
"public function select_latest_product(){\n $sql=\"SELECT * FROM tbl_product WHERE publication_status=1 ORDER BY product_id DESC LIMIT 9\";\n if(mysqli_query($this->db_connect,$sql)){\n $query_published=mysqli_query($this->db_connect,$sql);\n return $query_published;\n }else{\n die('Query Problem'.mysqli_error($this->db_connect));\n }\n }",
"function get_products_recent(){\n $recent = array();\n $all = get_products_all();\n $totalProducts = count($all); \n $position = 0; \n foreach ($all as $product) { \n $position++;\n if($position <= $totalProducts-4){ continue;}\n $recent[] = $product;\n }\n return $recent;\n }",
"private function getNextProducts(){\n\t\t$where = \" pid = \".$this->conf['pidlist'].\" AND deleted = 0 AND starttime > \".time().\" ORDER BY starttime ASC\";\n $sql = $GLOBALS[\"TYPO3_DB\"]->exec_SELECTquery(\"*\",$this->dbTableProducts,$where);\n while($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($sql)){\n $res[] = $row;\n }\n return $res;\n }",
"public function actionGetrecentproduct() {\r\n if (isset(Yii::$app->user->identity->id)) {\r\n if (isset(Yii::$app->session['temp_user_product'])) {\r\n $models = RecentlyViewed::find()->where(['session_id' => Yii::$app->session['temp_user_product']])->all();\r\n\r\n foreach ($models as $msd) {\r\n $data = RecentlyViewed::find()->where(['product_id' => $msd->product_id, 'user_id' => Yii::$app->user->identity->id])->one();\r\n if (empty($data)) {\r\n $msd->user_id = Yii::$app->user->identity->id;\r\n $msd->session_id = '';\r\n $msd->save();\r\n } else {\r\n $data->date = $msd->date;\r\n if ($data->save()) {\r\n $msd->delete();\r\n }\r\n }\r\n }\r\n unset(Yii::$app->session['temp_user_product']);\r\n }\r\n }\r\n }",
"function get_products_recent() {\n\n require(ROOT_PATH . \"inc/database.php\");\n\n try {\n $results = $db->query(\"SELECT name, price, img, sku, paypal FROM products ORDER BY sku DESC LIMIT 4\");\n } catch (Exception $e) {\n echo \"Data could not be retrieved from the database.\";\n exit;\n }\n\n $recent = $results->fetchAll(PDO::FETCH_ASSOC);\n $recent = array_reverse($recent);\n\n return $recent;\n}",
"public static function findPreminumLatest() {\n\t\t$product = Config::get ( 'constants.TABLE_NAME.PRODUCT' );\n\t\t$setting = Store::getSetting(self::LATEST_PRODUCT_SETTING);\n\t\t$user = Config::get ( 'constants.TABLE_NAME.USER' );\n\n\t\treturn DB::table ( $product . ' AS p' )->select ( 'p.*')\n\t\t->join ( 'user AS u', 'p.user_id', '=', 'u.id' )\n\t\t->where ( 'u.account_type', '=', self::PREMINUM )\n\t\t->where( 'p.publish_date','<=',date('Y-m-d H:i:s'))\n\t\t->where ( 'p.is_publish', '=', self::IS_PUBLISH )\n\t\t->orderBy ( 'p.publish_date', 'DESC' )->take ( $setting )->get ();\n\t}",
"public function getNewProducts(){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE is_new = '1'\");\r\n\t}",
"public function getnewproducts()\n\t{\n\t\t\n\t\t$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n\t\t$_rootcatID = Mage::app($this->storeId)->getStore()->getRootCategoryId();\n\n\t\t$_productCollection = Mage::getResourceModel('catalog/product_collection')\n\t\t\t\t->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')\n\t\t\t\t->addAttributeToFilter('category_id', array('in' => $_rootcatID))\n\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t->addAttributeToFilter('status',array('eq'=>1))\n\t\t\t\t->setPageSize (5)\n\t\t\t\t->addAttributeToFilter('visibility',array('eq'=>4))\n\t\t\t\t->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))\n\t\t\t\t->addAttributeToFilter('news_to_date', array('or'=> array(\n\t\t\t\t\t\t\t0 => array('date' => true, 'from' => $todayDate),\n\t\t\t\t\t\t\t1 => array('is' => new Zend_Db_Expr('null')))\n\t\t\t\t\t\t\t), 'left')\n\t\t\t\t->setStoreId($this->storeId)\n\t\t\t\t;\n\n\n\t\t\t$now = date('Y-m-d');\n\t\t\t$newsFrom= substr($_productCollection->getData('news_from_date'),0,10);\n\t\t\t$newsTo= substr($_productCollection->getData('news_to_date'),0,10);\n\n\t\t\tMage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($_productCollection);\n\t\t\t\n\t\t\tif(!$_productCollection->count()):\n\t\t\t\t\treturn $new_productlist = array ();\n\t\t\telse:\n\t\t\t\tif ($now>=$newsFrom && $now<=$newsTo)$i=0;\n\t\t\t\t \n\t\t\t$new_productlist = array ();\n\t\t\t$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();\n\t\t\t$currentCurrency = $this->currency;\n\t\t\tforeach ( $_productCollection as $product ) {\n\t\t\t\t\n\t\t\t\t\t$product = Mage::getModel ( 'catalog/product' )->load ( $product ['entity_id'] );\n\t\t\t\t\t\n\t\t\t\t\t$rating = Mage::getModel('rating/rating')->getEntitySummary($product->getId());\n\t\t\t\t\t$rating_final = ($rating->getSum()/$rating->getCount())/20;\n\n\t\t\t\tif($product->getTypeId() == \"configurable\")\n\t\t\t\t\t$qty = Mage::helper('connector')->getProductStockInfoById($product->getId());\n\t\t\t\telse\n\t\t\t\t\t$qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId())->getQty();\n\n\n\t\t\t\t$new_productlist [] = array (\n\t\t\t\t\t\t'entity_id' => $product->getId (),\n\t\t\t\t\t\t'sku' => $product->getSku (),\n\t\t\t\t\t\t'name' => $product->getName (),\n\t\t\t\t\t\t'news_from_date' => $product->getNewsFromDate (),\n\t\t\t\t\t\t'news_to_date' => $product->getNewsToDate (),\n\t\t\t\t\t\t'special_from_date' => $product->getSpecialFromDate (),\n\t\t\t\t\t\t'special_to_date' => $product->getSpecialToDate (),\n\t\t\t\t\t\t'image_url' => Mage::helper('connector')-> Imageresize($product->getImage(),'product','300','300'),\n\t\t\t\t\t\t'url_key' => $product->getProductUrl (),\n\t\t\t\t\t\t'regular_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( $product->getPrice (), $baseCurrency, $currentCurrency ), 2, '.', '' ),\n\t\t\t\t\t\t'final_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( \n\t\t\t\t\t\t\tMage::helper('tax')->getPrice($product, $product->getFinalPrice(), \n\t\t\t\t\t\t\ttrue, null, null, null, null, false),\n\t\t\t\t\t\t\t$baseCurrency, $currentCurrency ), 2, '.', '' ),\n\t\t\t\t\t\t'symbol'=>Mage::helper('connector')->getCurrencysymbolByCode($this->currency),\n\t\t\t\t\t\t'qty'=>$qty,\n\t\t\t\t\t\t'product_type'=>$product->getTypeId(),\n\t\t\t\t\t\t//'rating' => $rating_final,\n\t\t\t\t\t\t'wishlist' => Mage::helper('connector')->check_wishlist($product->getId ()),\n\t\t\t\t\t\t'specialprice'=>number_format (Mage::helper('connector')->getSpecialPriceProduct($product->getId ()), 2, '.', '' ),\n\t\t\t\t);\n\t\t\t}\n\t\n\t\t\treturn $new_productlist;\n\t\t\t\n\t\tendif;\n\n\t}",
"public function getTopNewProducts() {\n\n\t\t$scope = ['products.*'];\n\n\t\treturn $this->getProductsForFilter($scope);\n\t}",
"function ss_last_products(){\n $args = array( 'post_type' => 'product', \n 'stock' => 1, \n 'posts_per_page' => 5, \n 'orderby' =>'date',\n 'order' => 'DESC' );\n\n $wp_query = new WP_Query( $args );\n echo '<div class=\"custom-home-title\"><span>New Products</span></div>';\n //render output\n ss_render_home_section($wp_query);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Customise path to language files, and point it to Lang directory contained in Base package. | public function langPath()
{
return __DIR__ . "/../Lang";
} | [
"public function langPath()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'lang';\n }",
"public function langPath()\n {\n return $this->resourcePath() . DIRECTORY_SEPARATOR . 'lang';\n }",
"public function langPath()\n {\n return $this->resourcePath().DIRECTORY_SEPARATOR.'lang';\n }",
"protected function addLanguageFiles() {\r\n\t\tif ($this->pofile) {\r\n\t\t\tif (!is_array($this->pofile)) {\r\n\t\t\t\t$this->addPoFile($this->pofile);\r\n\t\t\t} else {\r\n\t\t\t\tforeach ($this->pofile as $pf) {\r\n\t\t\t\t\t$this->addPoFile($pf);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addPoFile('form.po', $_SERVER['DOCUMENT_ROOT'].'/../locales');\r\n\t\t$this->addPoFile('crud.po', $_SERVER['DOCUMENT_ROOT'].'/../locales');\r\n\t}",
"function wp_set_lang_dir()\n {\n }",
"protected function getLocalLangFileName() {}",
"protected function setContentLangFile()\n {\n // Set the base-folder for localization-files as stated in the config.\n $this->contentLangFile = config('routetree.localization.base_folder') . '/';\n\n // We only have to replace dots with slashes in this node's id to get the rest.\n $this->contentLangFile .= str_replace('.', '/', $this->id);\n }",
"protected function lang1Path()\n {\n return realpath(dirname(__FILE__) . '/data/languages/language1');\n }",
"function searchydoo_set_lang_file() {\n $currentLocale = get_locale();\n if(!empty($currentLocale)) {\n $moFile = dirname(__FILE__) . \"/lang/\" . $currentLocale . \".mo\";\n if (@file_exists($moFile) && is_readable($moFile)) {\n load_textdomain(EMU2_I18N_DOMAIN, $moFile);\n }\n\n }\n}",
"public function lang($path);",
"public function getLangDir(){\n return $this->getRootDir() . 'lang/';\n }",
"public function getTranslationResources()\n {\n return [__DIR__ . '/../lang/'];\n }",
"private static function _getLanguagesDir()\n\t{\n\t\treturn BASE_DIR . 'language' . DS;\n\t}",
"function ops_set_lang_file() {\r\n\t$currentLocale = get_locale();\r\n\tif(!empty($currentLocale)) {\r\n\t\t$moFile = dirname(__FILE__) . \"/lang/\" . $currentLocale . \".mo\";\r\n\t\tif(@file_exists($moFile) && is_readable($moFile)) load_textdomain('OldPostSpinner', $moFile);\r\n\t}\r\n}",
"function dss_set_lang_file() {\n\t$currentLocale = get_locale();\n\tif(!empty($currentLocale)) {\n\t\t$moFile = dirname(__FILE__) . \"/lang/\" . $currentLocale . \".mo\";\n\t\tif(@file_exists($moFile) && is_readable($moFile)) load_textdomain('dss', $moFile);\n\t}\n}",
"protected function lang2Path()\n {\n return realpath(dirname(__FILE__) . '/data/languages/language2');\n }",
"public static function lang()\n {\n return self::dirURL() . 'lang/';\n }",
"public static function LanguageFolder()\n {\n return dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . Configuration::getApplicationFolder() . DIRECTORY_SEPARATOR . 'Language';\n }",
"public function generateLanguageFiles() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
finds the date of the first day of the year containing the date or datetime $dts | function dtlFirstDayOfYear($mixed = '') {
// * returns false if invalid input
// * if parameter not provided then assumes current date
if ($mixed == '') {
$year = dtlGetYear();
}
elseif (dtlIsInt($mixed)) {
$year = $mixed;
}
else {
if (dtlIsValidDate($mixed) || dtlIsValidDateTime($mixed)) {
$year = dtlGetYear($mixed);
}
else {
return false;
}
}
return dtlDateStr($year, 1, 1);
} | [
"function dtlGetDayOfYear($dts = '') {\n // * if no params, returns current day of year\n // * returns false if $dts not a valid date or datetime\n if ($dts == '') {\n $dts = dtlToday();\n }\n else {\n if (!dtlIsValidDate($dts) && !dtlIsValidDateTime($dts)) {\n return false;\n }\n }\n $da = dtlDateStrToArray(dtlGetDate($dts));\n if ($da['month'] == 1) {\n return $da['day'];\n }\n else {\n return dtlDaysInMonths($da['year'], $da['month'] - 1) + $da['day'];\n }\n}",
"function FirstOfYear($dtDate)\n{\n return(new DateTime($dtDate->format(\"1/1/Y\")));\n}",
"public static function firstDayOfYear()\n {\n \t$firstday = strtotime('first day of january this year');\n \treturn date('Y-m-d', $firstday);\n }",
"function yearStartOf($date)\n {\n $time1 = $this->gmtime($date);\n\n return gmmktime(0, 0, 0, 1, 1, $time1[\"tm_year\"] + 1900);\n }",
"public function test_first_day_of_year_method()\n {\n $day = Date_Time_Format::first_day_of_year('l', 2018);\n\n $this->assertEquals('Monday', $day);\n\n $false_values = array(\n -5,\n 13,\n 'x',\n 'nothing',\n );\n\n foreach ($false_values as $value)\n {\n $day = Date_Time_Format::first_day_of_year($value);\n\n $this->assertFalse($day);\n }\n }",
"public static function yearStartDate($year) {\r\n return strtotime(\"first day of january $year\");\r\n }",
"private function _get_start_first_week() {\n\t\t$yearStart = $this->_get_year_start();\n\t\tif ($yearStart->dayNo == 1) {\n\t\t\treturn $yearStart;\n\t\t} \n\t\t$yearStart->adjust_day((7-$yearStart->dayNo)+1);\n\t\tif ($yearStart->epoc <= $this->epoc) {\n\t\t\treturn $yearStart;\n\t\t}\n\t\t\n\t\t$yearStart->year--;\n\t\t$yearStart->day = 1;\n\t\tif ($yearStart->dayNo == 1) {\n\t\t\treturn $yearStart;\n\t\t}\n\t\t\n\t\t$yearStart->adjust_day((7-$yearStart->dayNo)+1);\n\t\treturn $yearStart;\n\t}",
"public function testFirstDayOfTheYear() {\n $calendar = new Calendar();\n $day = $calendar->getFirstDayOfTheYear(1991);\n $this->assertEquals('Monday', $day, 'Expecting Monday as the first day of year 1991.');\n }",
"function FirstOfThisYear($date=null, $fmt=null) {\n\n\t# add to the depth count\n\t$this->GoDeeper();\n\n\t# if a valid date is passed\n\tif ($good =$this->DateIsValid($date)) {\n\n\t\t# hold the time block\n\t\t$tb = $this->GetTheTimeBlock($good);\n\n\t\t# get the YMD array\n\t\t$ymd = $this->GetYmdArray($good);\n\n\t\t# build a string for the year and Jan 1\n\t\t$first = $ymd[0] .'0101' ;\n\n\t\t# append the appropriate time block\n\t\t$first = $this->AddTimeBlock($first, $tb);\n\n\t\t# format the resulting date\n\t\t$result = $this->FormatADate($first, $fmt);\n\n\t# else\n\t} else {\n\n\t\t# report invalid date\n\t\t$result = $this->SetInvalidDateMessage($date);\n\t# ....\n\t}\n\n\t# return the result\n\treturn $this->ReturnResult($result);\n\n# end function\n}",
"public static function firstSundayOfYear($year = null)\n {\n $year = $year ? (int) $year : Date('Y');\n $sunday = Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);\n return ((int) $sunday->format('Y') === $year) ? $sunday : $sunday->addDays(7);\n }",
"function dtlSetDayOfYear(&$dts, $doy) {\n // * returns false if $dts is not a valid date or datetime\n // or if result is not a valid date or datetime\n // check for valid input:\n if (!dtlIsInt($doy) || !dtlIsValidDate($dts) && !dtlIsValidDateTime($dts)) {\n return false;\n }\n // do we need to do anything?\n if ($doy == dtlGetDayOfYear($dts)) {\n return true;\n }\n // change the day of year:\n $year = dtlGetYear($dts);\n $month = 1;\n $day = $doy;\n if (!dtlMakeDateValid($year, $month, $day)) {\n return false;\n }\n dtlSetDate($dts, dtlDateStr($year, $month, $day));\n return true;\n}",
"function getExistenceDateEarliestYear($xml = false)\n {\n $earliestYear = false;\n if (!$xml) $xml = $this->ro->getSimpleXML();\n foreach ($xml->xpath('//ro:existenceDates') AS $date) {\n if ($date->startDate) {\n if (strlen(trim($date->startDate)) == 4)\n $date->startDate = \"Jan 1, \" . $date->startDate;\n $start = strtotime($date->startDate);\n $earliestYear = date(\"Y\", $start);\n }\n }\n return $earliestYear;\n }",
"function NextFirstOfTheYear($date=null, $fmt=null) {\n\n\t# add to the depth count\n\t$this->GoDeeper();\n\n\t# if a valid date was passed\n\tif ($good = $this->DateIsValid($date)) {\n\n\t\t# get the day of the year\n\t\t$dow = $this->DayOfTheYear($good);\n\n\t\t# if the given date is not the first of the year\n\t\tif ($dow != 1) {\n\n\t\t\t# get 1st of next year\n\t\t\t$good = $this->FirstOfNextYear($good);\n\t\t# ....\n\t\t}\n\n\t\t# format the result\n\t\t$result = $this->FormatADate($good, $fmt);\n\n\t# else\n\t} else {\n\n\t\t# report invalid date\n\t\t$result = $this->SetInvalidDateMessage($date);\n\t# ....\n\t}\n\n\t# return the result\n\treturn $this->ReturnResult($result);\n\n# end function\n}",
"public function startOfYear(): static\n {\n return $this->modify('first day of january midnight');\n }",
"function schoolYearStart()\n{\n /* This is the current time. */\n $cTime = time();\n $cDate = getdate($cTime);\n\n /* Up to 2008/2009 we start the year on Monday of the week containing\n October 1. So if we call this function before Monday of that particular\n week, we shall return the current year decreased by one. */\n $oct01 = mktime(0, 0, 0, 10, 1);\n $wEnd = previousWeekEnd($oct01);\n\n /* Now find if we have passed the date or not. */\n if ($cTime < $wEnd)\n {\n /* We are still in the schoolyear that ends this year. */\n $tYear = $cDate['year'] - 1;\n }\n else\n {\n /* We are already in the schoolyear that started this year. */\n $tYear = $cDate['year'];\n }\n return $tYear;\n}",
"public static function getEarliestYear($record)\n {\n $earliestYear = false;\n $recordData = $record->getCurrentData();\n $registryObjectsElement = XMLUtil::getSimpleXMLFromString($recordData->data);\n\n foreach ($registryObjectsElement->xpath('//ro:existenceDates') AS $date) {\n if ($date->startDate) {\n if (strlen(trim($date->startDate)) == 4)\n $date->startDate = \"Jan 1, \" . $date->startDate;\n $start = strtotime($date->startDate);\n $earliestYear = date(\"Y\", $start);\n }\n }\n return $earliestYear;\n }",
"function getFirstSa($jahr) {\r\n\t$allFirstWeekdays = array(6, 7, 1, 2, 4, 5, 6, 7, 2, 3, 4, 5, 7, 1, 2, 3, 5, 6, 7, 1);\r\n\r\n\t// 1. first weekday for this year\r\n\t$firstWeekday = $allFirstWeekdays[($jahr - 2005)];\r\n\r\n\t// 2. find day number of first Sa\r\n\t$startSA = 6 - $firstWeekday;\r\n\r\n\treturn $startSA;\r\n}",
"function date_from_day_of_year($format = null, $dayOfYear = null, $year = null)\n\t{\n\t\t$format = ($format === null) ? 'j. F Y' : $format;\n\n\t\t$dayOfYear = ($dayOfYear === null) ? now()->dayOfYear : $dayOfYear - 1;\n\n\t\t$year = ($year === null) ? now()->year : $year;\n\n\t\t$dt = \\Carbon\\Carbon::create($year, 1, 1, 0)->addSeconds($dayOfYear*86400)->toDateTimeString();\n\n\t\treturn localized_date($format, $dt);\n\t}",
"public static function get_first_of_year() {\n global $I2_SQL;\n $yr = (int)date('Y');\n // June and before is of the previous year\n if((int)date('n') <= 6) $yr--;\n $date = $yr.\"-09-01\";\n $q = $I2_SQL->query('SELECT bid FROM eighth_blocks WHERE DATE >= %t ORDER BY bid ASC LIMIT 1', $date)->fetch_all_arrays(Result::ASSOC); \n if(sizeof($q) == 0) return null;\n return $q[0]['bid'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup the linting hook | private function setupPHPLintingHook(Config\Hook $config): void
{
$answer = $this->io->ask(
' <info>Do you want to check your files for syntax errors?</info> <comment>[y,n]</comment> ',
'n'
);
if (IOUtil::answerToBool($answer)) {
$call = '\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting';
$config->addAction(new Config\Action($call));
}
} | [
"public function setup_hooks()\n {\n }",
"public static function set_hooks() {\n\t}",
"public static function init() {\n\t\tadd_action( 'init', [ static::class, 'check_hooks' ] );\n\n\t\tstatic::legacy_runner();\n\t}",
"public function hook();",
"public function setupHooks() { \n $this->loadTranslations();\n \n // if the builder is installed and activated load custom modules\n\t\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\t\treturn;\t\n\t\t}\t\t\t\t\n add_action( 'init', array($this, 'loadModules')); \n }",
"public static function setupHooks()\n {\n if (! class_exists('FLBuilder')) {\n return;\n }\n \n // Load custom modules.\n add_action('init', __CLASS__ . '::loadModules');\n }",
"private static function hooks()\n\t{\n\t\t// check for shortcut in url\n\t\tEvent::add('system.post_routing', array('Webgrind_Hooks', 'detect_shortcut'));\n\t\t// hook for javascript redirect\n\t\tEvent::add('system.display', array('Webgrind_Hooks', 'webgrind_redirect'));\n\t\t// webgrind path constant\n\t\tdefine('WEBGRIND', url::site().str_replace(DOCROOT, '', MODPATH).'webgrind/');\n\t}",
"function runkit_lint($code)\n{\n}",
"public function setup_hooks() {\n\n\t\t/**\n\t\t * No Beaver Builder. We need to notify admin and return early to prevent further execution.\n\t\t */\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\t}",
"private function declare_public_hooks() {\n }",
"protected function wp_setup() { // phpcs:ignore\n\n\t\tparent::wp_setup();\n\n\t\t// About: add actions and filters here.\n\t}",
"public function hookInitialize()\n {\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jobs' . DIRECTORY_SEPARATOR . 'import.php';\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jobs' . DIRECTORY_SEPARATOR . 'sync.php';\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'APIfunctions.php';\n }",
"public function setup_hooks() {\n\n\t\t$this->setup_actions();\n\n\t\t$this->setup_filters();\n\n\t}",
"public function setupWebHook() {\n\n }",
"protected static function setupHooks()\n\t{\n\t\tglobal $wgHooks;\n\t\t\n\t\tforeach ( self::$hookList as $index => $hookName)\n\t\t\tif ( method_exists( $this, 'h'.$hookName ) )\t\t\t\t\t\n\t\t\t\t\t$wgHooks[$hookName][] = array( &$this, 'h'.$hookName );\n\t\t\n\t}",
"abstract public function hook();",
"private function define_admin_hooks() {\n\t}",
"public function init()\n\t{\n\t\t$this->title( __( 'Aggregated Hook Usage', 'debug-bar' ) );\n\t}",
"private function setUpCustomRuleset(): void\n {\n $sniffCode = Common::getSniffCode(\\get_class($this));\n list($standardName, $categoryName, $sniffName) = \\explode('.', $sniffCode);\n\n $rulesetPath = $this->getCustomRulesetPath($categoryName, $sniffName);\n if ($rulesetPath === null) {\n return;\n }\n\n $config = new Config();\n $config->cache = false;\n\n $ruleset = new Ruleset($config);\n $ruleset->processRuleset($rulesetPath);\n\n $GLOBALS['PHP_CODESNIFFER_CONFIG'] = $config;\n $GLOBALS['PHP_CODESNIFFER_RULESETS'][$standardName] = $ruleset;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize cshamoo router Usage CSR::initialize(); | function initialize() {
CSR::set('initialized', true);
CSR::set('renderable', true);
CSR::set('event', new CSR_EventObject());
CSR::set('phase', new CSR_PhaseObject());
CSR::set('dispatcher', new CSR_Dispatcher());
CSR::set('modules', array());
CSR::addEvent(EVENT_DISPATCH_ERROR, array('CSR', 'dispatchError'));
// Add main phase
CSR::addPhase(PHASE_APPLICATION_START, array('CSR_DefaultPhases', 'applicationStartPhase'));
CSR::addPhase(PHASE_PARSE_ROUTE, array('CSR_DefaultPhases', 'parseRoutePhase'));
CSR::addPhase(PHASE_ACTION, array('CSR_DefaultPhases', 'actionPhase'));
CSR::addPhase(PHASE_RENDER, array('CSR_DefaultPhases', 'renderPhase'));
CSR::addPhase(PHASE_OUTPUT, array('CSR_DefaultPhases', 'outputPhase'));
CSR::addPhase(PHASE_APPLICATION_END, array('CSR_DefaultPhases', 'applicationEndPhase'));
} | [
"public function initializeRouter()\r\n {\r\n $this->route = trim($this->app->request->get('route') , '/');\r\n\r\n $this->route = $this->route ? explode('/' , $this->route) : false;\r\n\r\n $this->setScript();\r\n\r\n $this->establishRoutes();\r\n\r\n $this->setRouteKey();\r\n\r\n $this->setRouteController();\r\n\r\n $this->setControllerMethod();\r\n\r\n $this->setControllerArguments();\r\n\r\n }",
"public function init()\n {\n // generate private key\n $this->generate_private_key();\n\n // compute public key\n $this->compute_public();\n }",
"protected function init()\n\t{\n\t\t$this->registry = ipsRegistry::instance();\n\t\t$this->registry->init();\n\t}",
"public final function initialize() {\n\t\t$this->_ensureModuleExistance();\n\t\t$this->_memcache = new Memcache();\n\t\t$this->_memcache->connect($this->_host, $this->_port);\n\t}",
"public function __construct()\n\t{\n\t\trequire_once Kohana::find_file('vendor', 'autoload');\n\t\t$config = Kohana::$config->load('recaptcha');\n\t\t$this->_public_key = $config['public_key'];\n\t\t$this->_private_key = $config['private_key'];\n\t}",
"private function initializeKey() : void\n {\n $this->namespace = Uuid::uuid5($this->instanceKey, $this->key);\n $this->crypto = new AES256GCM($this->key->toString());\n }",
"function __construct(){\n\t\t//echo dirname( __FILE__ ) . \"/../lib/captcha/\" . ;\n\t\t\n\t\t$this->ssl = true;\n\t\t\n\t\trequire_once( dirname( __FILE__ ) . \"/../lib/captcha/\" .'recaptchalib.php' );\n\t\t\n\t}",
"private static function init() {\n // Create CAS client.\n phpCAS::client(CAS_VERSION_3_0, CAS_SERVER_HOST, CAS_SERVER_PORT, CAS_SERVER_URI);\n \n // Set no validation.\n phpCAS::setNoCasServerValidation();\n }",
"private static function init() {\n // Create CAS client.\n phpCAS::client(CAS_VERSION_2_0, CAS_SERVER_HOST, CAS_SERVER_PORT, CAS_SERVER_URI);\n // Set no validation.\n phpCAS::setNoCasServerValidation();\n }",
"public function __construct()\n\t\t{\n\t\t\t$this->sRequestType = $_SERVER[ \"REQUEST_METHOD\" ];\n\t\t\t$this->bSecureConnection = isset( $_SERVER[ \"HTTPS\" ] ) && !empty( $_SERVER[ \"HTTPS\" ] );\n\t\t\n\t\t}",
"public function initGateway() {\n\t}",
"protected function busiInit()\n {\n }",
"private function initialize()\n {\n $this->requires('lib/_autoload.php', $this->_path);\n\n // \n // Support both new namespaced class and older version:\n // \n if (class_exists(\"SimpleSAML\\Auth\\Simple\")) {\n $this->client = new SimpleSAML_Auth_Simple3($this->_spid);\n } else {\n $this->client = new SimpleSAML_Auth_Simple1($this->_spid);\n }\n }",
"function __construct(){\n\t\t$this->apns_data = array(\n\t\t\t'production'=>array(\n\t\t\t\t'certificate'=>IOS_PN_CERT_PRODUCTION,\n\t\t\t\t'ssl'=>IOS_PN_URL_PRODUCTION,\n\t\t\t\t'feedback'=>IOS_PN_URL_FEEDBACK_PRODUCTION\n\t\t\t),\n\t\t\t'development'=>array(\n\t\t\t\t'certificate'=>IOS_PN_CERT_DEVELOPMENT,\n\t\t\t\t'ssl'=>IOS_PN_URL_DEVELOPMENT,\n\t\t\t\t'feedback'=>IOS_PN_URL_FEEDBACK_DEVELOPMENT\n\t\t\t)\n\t\t);\n\t\t\n\t\tcheck_valid_cert(IOS_PN_CERT_DEVELOPMENT);\n\t\tcheck_valid_cert(IOS_PN_CERT_PRODUCTION);\n\t\t\n\t}",
"private function initialize()\n\t{\n\t\tif (is_object($this->aes))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$password = $this->getPassword();\n\n\t\tif (empty($password))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$phpFunc = new \\FOF30\\Utils\\Phpfunc();\n\t\t$this->aes = new Aes($password, 128, 'cbc', $phpFunc);\n\t}",
"public function initialize()\n\t{\n\t\t// Set the prefix\n\t\t$this->setPrefix('/api');\n\n\t\t// Define all routes\n\t\t$this->addPost('/users/getProfile', 'Users::getProfile');\n\t}",
"protected function Init() {\n\t\t$laapp_req_id = AppSession::GetGlobalParam(AppSession::ConvertToSessionCase('AAPP_RID',self::$session_keys_case),FALSE,$this->subsession,FALSE);\n\t\tif(strlen($laapp_req_id)) {\n\t\t\t$this->app_req_id = $laapp_req_id;\n\t\t} else {\n\t\t\t$this->app_req_id = AppSession::GetNewUID();\n\t\t\tAppSession::SetGlobalParam(AppSession::ConvertToSessionCase('AAPP_RID',self::$session_keys_case),$this->app_req_id,FALSE,$this->subsession,FALSE);\n\t\t}//if(strlen($laapp_req_id))\n\t\t$this->StartSecureHttp();\n\t}",
"public function __construct ()\n\t{\n\t\t$this->_keystore = Gwilym_KeyStore::factory();\n\t\t$this->_keystore->prefix('gwilym,plugin,' . $this->id() . ',');\n\t\t$this->_keystore->lockPrefix();\n\t}",
"private function initRouter()\r\n {\r\n try {\r\n $routing = Routing::getInstance();\r\n $routing->addRoutes($this->rest);\r\n $routing->setCors(\"*\", \"origin, content-type, accept, authorization\");\r\n $routing = $routing->processRoutingRequest($this->target);\r\n if (!$routing) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' 400 ERROR');\r\n header(\"Content-Type: application/json\");\r\n echo json_encode(array(\"errorCode\" => 'ROUTER_NOT_FOUND'));\r\n die();\r\n }\r\n } catch (Exception $e) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' 500 FATAL ERROR');\r\n die(json_encode($e->getMessage()));\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The search custom rest api endpoint callback | public function searchCallback( WP_REST_Request $request ) {
$parameters = $request->get_query_params();
$arguments = $this->searchBuildArguments( $parameters );
if ( $arguments[ "s" ] ) {
$wpQuery = new WP_Query( $arguments );
relevanssi_do_query( $wpQuery );
if ( !empty( $wpQuery->posts ) ) {
$posts = array_map( function( $post ) use ( $parameters ) {
return $this->preparePostForResponse( $post, $parameters );
}, $wpQuery->posts );
$response = [
"success" => true,
"results" => $posts,
"meta" => [
"filter" => [],
"total" => $wpQuery->found_posts,
"pages" => $wpQuery->max_num_pages,
"current_page" => $arguments[ "paged" ],
"per_page" => $arguments[ "posts_per_page" ],
"s" => $arguments[ "s" ],
]
];
if ( isset( $arguments[ "tax_query" ] ) ) {
$response[ "meta" ][ "filter" ][ "category" ] = $arguments[ "tax_query" ][ 0 ][ "terms" ];
$response[ "meta" ][ "filter" ][ "taxonomy" ] = $arguments[ "tax_query" ][ 0 ][ "taxonomy" ];
}
if ( intval( $arguments[ "paged" ] ) < $wpQuery->max_num_pages ) {
$response[ "meta" ][ "next" ] = $this->getSearchRequestUrl( $arguments, $parameters, "next" );
}
if ( intval( $arguments[ "paged" ] ) > 1 ) {
$response[ "meta" ][ "previous" ] = $this->getSearchRequestUrl( $arguments, $parameters, "previous" );
}
return $this->response( $response );
} else {
return $this->response( [
"error" => true,
"message" => "Nothing found"
], 404 );
}
} else {
return $this->response( [
"error" => true,
"message" => "Empty search query",
], 400 );
}
} | [
"function universityRegisterSearch() {\n register_rest_route('university/v1', 'search', array(\n 'methods' => WP_REST_SERVER::READABLE, //Creates a new readable rest api for the user\n 'callback' => 'universitySearchResults' //any of the results get returned to the universitySearchResults function below\n ));\n}",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"function universityRegisterSearch() {\n register_rest_route('university/v1', 'search', array(\n // Methods are for crud, we could just put 'GET' but not all browsers will work with this \n // request so we use WP_REST_SERVER::READABLE\n 'methods' => WP_REST_SERVER::READABLE,\n 'callback' => 'universitySearchResults'\n ));\n}",
"public function ajax_search_callback() {\n\n\t\t$search = new Mlp_Relationship_Control_Ajax_Search( $this->data );\n\t\t$search->send_response();\n\t}",
"public abstract function search_items(\\WP_REST_Request $request);",
"private function search()\n {\n //set empty parameter array\n $url_params = array();\n\n //add the parameters\n $url_params['location'] = $this->location;\n $url_params['sort'] = $this->sort;\n $url_params['category_filter'] = $this->category_filter;\n\n //create the search path including the base URL and parameters\n $search_path = $this->search_path . \"?\" . http_build_query($url_params);\n\n //return response\n return $this->request($search_path);\n }",
"public function search_items(\\WP_REST_Request $request)\n {\n }",
"public function searchuserAction(){\n\n $data = [ 'search' => 'search' , 'id' => 1 ];\n $client = new Client();\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest');\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setParameterPost(\n $data\n );\n $client->setMethod( Request::METHOD_POST );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }",
"public function doSearch();",
"public function searchAction()\n\t{\n\t}",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( OauthClients::grid() )->search ();\n\t}",
"public function getQuickSearch()\n {\n $callback = Input::get('callback');\n $keyword = Input::get('keyword');\n $result = SearchService::quickSearch($keyword);\n return Response::json($result, 200)->setCallback($callback);\n }",
"public function search()\n {\n if (!$this->validate()) {\n $response = ['errors' => $this->errors];\n } else {\n $data = $this->getData();\n if (empty($data)) {\n $response = \"No results found\";\n }\n else {\n $response = [\n 'searchQuery' => $this->request,\n 'searchResults' => $data\n ];\n }\n }\n\n echo (json_encode($response));\n }",
"public function search_items(\\WP_REST_Request $request)\n {\n }",
"function search() {\n\t\tparent::MY_Controller();\n\t\t$this->defineSearchResultsViews();\n\t}",
"private function getSearchEndpoint()\n {\n return \"{$this->endpoint}/search\";\n }",
"public function getSearchService();",
"public function searchAction() {\n \n \n // get the cookie data from the client \n $request = $this->get('request');\n $cookies = $request->cookies;\n $user = $cookies->get(AppConstants::USER_NAME_COOKIE);\n \n \n\n /** @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface */\n $dispatcher = $this->container->get('event_dispatcher');\n $event = $this->get('api_searchtweets.filter_manager_event');\n \n\n\n // if the user is not found as a cookie value\n // the first search will be performed and the \n // results will be saved in database as a new user \n\n if (!$user) {\n\n \n // perform the first search\n $dispatcher->dispatch(ApiSearchtweetsEvents::SERVICE_SEARCH);\n \n \n } else {\n\n \n\n // the search will be checked in database\n // if the last search by city is not expired (1 hour)\n // the data will be returned from database\n // oherwise a new serch will be performed\n // check if the search is expired \n \n $event->setData($user);\n $dispatcher->dispatch(ApiSearchtweetsEvents::CHECK_EXPIRED);\n $isexpired = $event->getResponse();\n \n \n\n if (!$isexpired) { \n \n // not expired - load from cache \n $event->setData($user);\n $dispatcher->dispatch(ApiSearchtweetsEvents::SERVICE_LOAD_CACHED);\n \n } else {\n \n \n // expired - perform a new search \n $event->setData($user);\n $dispatcher->dispatch(ApiSearchtweetsEvents::SERVICE_SEARCH); \n $dispatcher->dispatch(ApiSearchtweetsEvents::SAVE_CACHE);\n }\n }\n\n $response = new Response($event->getResponse());\n $response->headers->set('Content-Type', 'text/plain');\n\n return $response;\n }",
"public function searchRs(){\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get overview information data. | public function getOverviewInfo() {
return $this->overviewInfo;
} | [
"public function retrieveOverview();",
"public function getOverview() {\n return $this->_data['overview'];\n }",
"public function getOverview()\n {\n \treturn $this->overview;\n }",
"public function getOverview()\n {\n return $this->overview;\n }",
"public function getOverview()\n {\n return $this->overview;\n }",
"public function overview_data() {\n\t //Purge Requirements\n\t Requirements::clear();\n\t \n\t \n\t //If we're not configured properly return an error\n\t if(!$this->getIsConfigured()) {\n $msg=_t('NewRelicPerformanceReport.API_APP_CONFIG_ERROR', '_New Relic API Key or Application ID is missing, check configuration');\n $e=new SS_HTTPResponse_Exception($msg, 400);\n $e->getResponse()->addHeader('Content-Type', 'text/plain');\n $e->getResponse()->addHeader('X-Status', rawurlencode($msg));\n\t throw $e;\n\t \n\t return;\n\t }\n\t \n\t \n\t //Build the base restful service object\n\t $service=new RestfulService('https://api.newrelic.com/v2/applications/'.Convert::raw2url($this->config()->application_id).'/metrics/data.json', $this->config()->refresh_rate);\n\t $service->httpHeader('X-Api-Key:'.Convert::raw2url($this->config()->api_key));\n\t \n\t \n\t //Perform the request\n\t $response=$service->request('', 'POST', 'names[]=HttpDispatcher&names[]=Apdex&names[]=EndUser/Apdex&names[]=Errors/all&names[]=EndUser&period=60');\n\t \n\t \n\t //Retrieve the body\n\t $body=$response->getBody();\n\t if(!empty($body)) {\n \t $this->response->addHeader('Content-Type', 'application/json; charset=utf-8');\n \t return $body;\n\t }\n\t \n\t \n\t //Data failed to load\n\t $msg=_t('NewRelicPerformanceReport.DATA_LOAD_FAIL', '_Failed to retrieve data from New Relic');\n\t $e=new SS_HTTPResponse_Exception($msg, 400);\n\t $e->getResponse()->addHeader('Content-Type', 'text/plain');\n\t $e->getResponse()->addHeader('X-Status', rawurlencode($msg));\n\t throw $e;\n\t}",
"function overview(){\n $this->get_session();\n\n // Get data\n $data = $this->getAssignments($_SESSION['user']);\n $columns = [[\"Titel\", \"title\"], [\"Status\", \"status\"], [\"Uiterste inleverdatum\", \"end_date\"]];\n\n // Generate menu\n $menu = $this->menu($this->bootstrap, [\"active\" => \"Opdrachten\", \"align\" => \"stacked\"]);\n $breadcrumbs = $this->breadcrumbs($this->bootstrap, [$_SESSION[\"name\"] => \"#\", \"Opdrachten\" => \"#\"]);\n $link = '<a href=\"%s/\">%s</a>';\n $options = [\n [\"<a class='' href='%s/'><i class='glyphicon glyphicon-pencil'></i> Inleveren</a>\"],\n ];\n\n // Generate page\n echo $this->templates->render(\"assignments::index\", [\n \"title\" => \"Tekstmijn | Opdrachten\",\n \"page_title\" => \"Opdrachten\",\n \"table\" => $this->table($this->bootstrap, $columns, $data, $options, $link),\n \"menu\" => $menu,\n \"breadcrumbs\" => $breadcrumbs,\n ]);\n }",
"public function getTVShowOverview() {\n return $this->_data['overview'];\n }",
"public function getOverview()\n {\n $content = '<div class=\"thumbnail sidebar overview\">'\n . '<img class=\"img-responsive\" '\n . 'alt=\"'\n . htmlspecialchars($this->attribution[0]['current'])\n . ' - '\n . htmlspecialchars($this->repo)\n . ' - '\n . htmlspecialchars($this->title[0]['current'])\n . ' - '\n . $this->t->trans('overall')\n . '\"'\n . 'title=\"'\n . htmlspecialchars($this->attribution[0]['current'])\n . ' - '\n . htmlspecialchars($this->repo)\n . ' - '\n . htmlspecialchars($this->title[0]['current'])\n . ' - '\n . $this->t->trans('overall')\n . '\"'\n . 'src=\"' .$this->config->getLegacyImagesBaseUrl(). $this->dynDir->getDir() . 'thumbnails/'\n . $this->objectFolder . '/01_Overall/'\n . $this->overallImage . '.jpg\">'\n . '<div class=\"caption\">'\n . '<h6>' . $this->title[0]['current'] . '</h6>'\n . '<p>' . $this->dating[0]['current'] . '</p>'\n . '<p>' . $this->attribution[0]['prefix'] . ' '\n . $this->attribution[0]['current'] . ' ' . $this->attribution[0]['suffix'] . '</p>'\n . '<p>' . $this->repo . '</p>'\n //\t\t. '<p>'.$this->objNr.'</p>'\n //\t\t. '<p>'.$this->t->trans('frNr').': '.$this->frNr.'</p>'\n //\t\t. '<p>'.$this->dimensions['short'].'</p>'\n . '</div>';\n\n // close overview div\n $content .= '</div>';\n\n // return overview html content\n return $content;\n }",
"public function getDataOverview(){\n $data['general']=$this->lang->line('general');\n $data['Find_Resident']=$this->lang->line('Find_Resident');\n $data['Add_Resident']=$this->lang->line('Add_Resident');\n $data['Login_Resident']=$this->lang->line('Login_Resident');\n $data['Add_Facility']=$this->lang->line('Add_Facility');\n $data['Find_Facility']=$this->lang->line('Find_Facility');\n $data['Add_Caregiver']=$this->lang->line('Add_Caregiver');\n $data['Division_Timestamp']=$this->lang->line('Division_Timestamp');\n $data['Add_Activity']=$this->lang->line('Add_Activity');\n $data['Log_out']=$this->lang->line('Log_out');\n return $data;\n }",
"public abstract function getSummaryData();",
"public function getMovieOverview() {\n return $this->_data['overview'];\n }",
"public function getInfo();",
"public function getEntryOverview()\n {\n return $this->entry_overview;\n }",
"function overview(){\n $this->get_session();\n $breadcrumbs = $this->breadcrumbs($this->bootstrap, [$_SESSION[\"staff_name\"] => \"/staff/account/\", \"Vragenlijsten\" => \"#\"]);\n $menu = $this->menu($this->bootstrap, [\"active\" => \"/staff/questionnaire/\", \"align\" => \"stacked\"], $_SESSION['type']);\n\n $questionnaires = $this->getQuestionnaires();\n $columns = [\n [\"#\", \"id\"],\n [\"Titel\", \"title\"],\n [\"School\", \"name\"]\n ];\n $options = [\n [\"<a class='pull-right' href='%s/'><i class='glyphicon glyphicon-pencil'></i> Bewerken</a>\"],\n ];\n\n $table = $this->table($this->bootstrap, $columns, $questionnaires, $options, '<a href=\"%s/\">%s</a>');\n\n echo $this->templates->render(\"questionnaire::overview\",\n [\n \"breadcrumbs\" => $breadcrumbs,\n \"menu\" => $menu,\n \"table\" => $table,\n \"page_title\" => \"Vragenlijsten\",\n \"title\" => \"Tekstmijn | Vragenlijsten\"\n ]);\n }",
"public function getUsageOverview()\n {\n $usageOverview = $this->repository->getUsageOverview();\n return response()->json($usageOverview->first());\n\n }",
"public function overview()\n {\n $overview = [];\n\n $overview['total_products'] = 0;\n $overview['subtotal_price'] = 0;\n $overview['shipping_costs'] = $this->calculateShippingCosts();\n $overview['total_price'] = 0;\n\n foreach ($this->shopping_cart as $order_product)\n {\n $overview['total_products'] += $order_product['quantity'];\n $overview['subtotal_price'] += ($order_product['store_product']->price_details->{$order_product['supplier_id']}->total_price_in * $order_product['quantity']);\n }\n\n // Add shipping costs to the subtotal to calculate the total price\n $overview['total_price'] = $overview['subtotal_price'] + $overview['shipping_costs'];\n\n return $overview;\n }",
"public function displayContentOverview() {}",
"public function ProfileOverview() {\n return ApiClient::Request('account/profileoverview');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of k. | public function setK($k)
{
$this->k = $k;
return $this;
} | [
"public function set_k_max($k)\n {\n if($k <= 0)\n {\n throw new KNNGraphException(\"k must be +ve\");\n }\n if($k > sizeof($this->nodes))\n {\n throw new KNNGraphException(\"k_max provided too big for data!\");\n }\n\n if(isset($this->k_max) && ($k <= $this->k_max))\n {\n $this->k_max = $k;\n for($i = 0; $i < sizeof($this->nodes); $i++)\n {\n $curr = $this->nodes[$i];\n $curr->set_k($k);\n }\n }\n else\n {\n $this->k_max = $k;\n $this->graph_knn();\n }\n }",
"public function keyEdit($k){\r\n $this->key = $k;\r\n }",
"function __construct($k)\n {\n $this->size = $k;\n }",
"function __construct($k) {\n $this->capacity = $k + 1;\n }",
"public function setK_number($k_number)\n {\n $this->k_number = $k_number;\n\n return $this;\n }",
"public function setKty(?string $value): void {\n $this->getBackingStore()->set('kty', $value);\n }",
"public function setTemplateVar($k, $v)\n {\n //$this->tpl->assign($k, $v);\n $this->tmplVars[$k] = $v;\n }",
"public function setMampuHandleKk($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->mampu_handle_kk !== $v) {\n $this->mampu_handle_kk = $v;\n $this->modifiedColumns[] = PtkPeer::MAMPU_HANDLE_KK;\n }\n\n if ($this->aKebutuhanKhusus !== null && $this->aKebutuhanKhusus->getKebutuhanKhususId() !== $v) {\n $this->aKebutuhanKhusus = null;\n }\n\n\n return $this;\n }",
"public function LSet($key, $index, $value);",
"function __construct($k) {\n $this->head = [];\n $this->tail = [];\n $this->size = $k;\n }",
"public function getK()\n {\n return $this->k;\n }",
"function __construct($k) {\n $this->length = (int)$k;\n\t\t$this->queue = [];\n\t\t$this->front = 0;\n\t\t$this->rear = 0;\n\t\t$this->next = 0;\n }",
"function __construct($k)\n {\n $this->capacity = $k;\n $this->count = 0;\n $this->queue = [];\n $this->headIndex = 0;\n }",
"public function setNodeKey($nk)\n {\n $this->isNodeKey = (boolean) $nk;\n }",
"function changeOpt($k,$value,$text,$selected=FALSE,$disabled=FALSE)\n\t{\n\t\t$this->_arOpt[$k]['value'] = $value;\n\t\t$this->_arOpt[$k]['text']\t= $text;\n\t\t$this->_arOpt[$k]['selected'] = $selected;\n\t\t$this->_arOpt[$k]['disabled'] = $disabled;\n\t}",
"public function force_option( $k, $v )\n\t{\n\t\tif ( array_key_exists( $k, $this->options ) ) {\n\t\t\tLiteSpeed_Cache_Log::debug( \"[Conf] ** $k forced value to \" . var_export( $v, true ) ) ;\n\t\t\t$this->options[ $k ] = $v ;\n\t\t}\n\t}",
"public function setPrivateKey($k){\r\n $secp256k1 = new SECp256k1();\r\n $n = $secp256k1->n;\r\n \r\n //private key has to be passed as an hexadecimal number\r\n if(gmp_cmp(gmp_init($k, 16), gmp_sub($n, gmp_init(1, 10))) == 1)\r\n {\r\n throw new \\Exception('Private Key is not in the 1,n-1 range');\r\n }\r\n $this->k = $k;\r\n }",
"public function __set($key, $val);",
"function __construct($k)\n {\n $this->deque = [];\n $this->count = 0;\n $this->capacity = $k;\n $this->front = 0;\n $this->rear = 0; //与循环单向队列相比多增加了一个尾部指针\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an array of instances of Replacer interface. | abstract public function getReplacers(): array; | [
"public function getReplacements()\n {\n return $this->replacements;\n }",
"public function getReplacements()\n {\n return $this->replacements;\n }",
"protected function findReplacers()\n\t{\n\t\tforeach ($this->templates as $i => $template) \n\t\t{\n\t\t\t$template = $this->constructor->findReplacers($template);\n\t\t}\n\t}",
"function get_replaces()\n\t{\n\t\t$this->replaces_loaded = true;\n\n\t\t$replace = $this->db->query(\"SELECT * FROM %preplacements ORDER BY LENGTH(replacement_search) DESC\");\n\t\twhile ($r = $this->db->nqfetch($replace))\n\t\t{\n\t\t\tif ($r['replacement_type'] == 'emoticon') {\n\t\t\t\t$this->emotes['replacement'][$r['replacement_search']] = \"<img src=\\\"./skins/$this->skin/emoticons/{$r['replacement_replace']}\\\" alt=\\\"{$r['replacement_search']}\\\" />\";\n\n\t\t\t\tif ($r['replacement_clickable']) {\n\t\t\t\t\t$this->emotes['replacement_clickable'][$r['replacement_search']] = \"<img src=\\\"./skins/$this->skin/emoticons/{$r['replacement_replace']}\\\" alt=\\\"{$r['replacement_search']}\\\" />\";\n\t\t\t\t}\n\t\t\t} elseif ($r['replacement_type'] == 'censor') {\n\t\t\t\t$this->censor[] = '/' . $r['replacement_search'] . '/i';\n\t\t\t}\n\t\t}\n\t}",
"public static function getBackendReplacements()\n {\n $table = rex::getTable('xoutputfilter');\n $sql = rex_sql::factory();\n\n $query = \"SELECT `html`, `marker`, `excludeids`, `categories`, `allcats`, `insertbefore`, `once` FROM $table WHERE `typ` = '5' AND `active` = '1' ORDER BY `name` ASC \";\n\n return $sql->getArray($query);\n }",
"protected function getReplacement(string $stub): array\n {\n $replacements = $this->pluginRepository->config('stubs.replacements');\n\n if (! isset($replacements[$stub])) {\n return [];\n }\n\n $keys = $replacements[$stub];\n\n $replaces = [];\n\n if ($stub === 'json' || $stub === 'composer') {\n if (in_array('PROVIDER_NAMESPACE', $keys, true) === false) {\n $keys[] = 'PROVIDER_NAMESPACE';\n }\n }\n foreach ($keys as $key) {\n if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {\n $replaces[$key] = $this->$method();\n } else {\n $replaces[$key] = null;\n }\n }\n\n return $replaces;\n }",
"public function replace(...$arrays);",
"protected function getReplacements($options) {\n if ($replacements = $this->getDefinitionValue('replacements')) {\n $converted_replacements = [];\n foreach ($replacements as $key => $value) {\n $new_key = '__' . strtoupper($key);\n $converted_replacements[$new_key] = $value;\n }\n return $converted_replacements;\n }\n return [];\n }",
"public function getSubstitutes();",
"public function fromArray(array $config): PatternReplacer\n {\n $replacer = new static($config[\"placeholder\"]);\n\n foreach ($config[\"replacements\"] as list($type, $matchIndex, $replace)) {\n $replacer->replace($type, $matchIndex, $replace);\n }\n\n return $replacer;\n }",
"public function getReplacedExtensions();",
"public function __invoke($data){\n \n return array($this->replace($data[0],$data[1]));\n \n }",
"public function getOldReplaceValues();",
"public static function get_replacement_patterns() {\n\t\tuksort(\n\t\t\tself::$replace_patterns,\n\t\t\tfunction( $a, $b ) {\n\t\t\t\treturn strlen( $a ) < strlen( $b );\n\t\t\t}\n\t\t);\n\t\treturn self::$replace_patterns;\n\t}",
"public function expand(string $pattern, string $replacement): array;",
"public function provideReplacement();",
"public static function getDetectors(): array\n {\n return [\n (new LinePatternDetector())->setPattern(static::$pattern)\n ];\n }",
"public function getRegExpMap(): array\n {\n return $this->regexpMap;\n }",
"protected function sortReplacements(array $replace): array\n {\n return (new Collection($replace))->sortBy(function ($value, $key) {\n return mb_strlen($key) * -1;\n })->all();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a default crypt value, if any is available | public function getDefaultCrypt(): Encrypter|null
{
return Crypt::getFacadeRoot();
} | [
"public function getDefaultCrypt(): Encrypter|null;",
"public function getDefaultPassword(): string|null;",
"public function getDefaultPassword() : ?string;",
"public function get_default_value();",
"private function getCryptKey() {\n\t\t$config = SecureConfiguration::getInstance()->getTokenCryptKey();\n\t\treturn $config ? $config : 'ssaTokenProvider';\n\t}",
"private function get_default_salt() {\n\t\tif ( defined( 'GOOGLESITEKIT_ENCRYPTION_SALT' ) && '' !== GOOGLESITEKIT_ENCRYPTION_SALT ) {\n\t\t\treturn GOOGLESITEKIT_ENCRYPTION_SALT;\n\t\t}\n\n\t\tif ( defined( 'LOGGED_IN_SALT' ) && '' !== LOGGED_IN_SALT ) {\n\t\t\treturn LOGGED_IN_SALT;\n\t\t}\n\n\t\t// If this is reached, you're either not on a live site or have a serious security issue.\n\t\treturn 'das-ist-kein-geheimes-salz';\n\t}",
"public function getDefaultEncryption()\n {\n return $this->default_encryption;\n }",
"public function decryptionDefaultWithSalt()\n {\n return Encryption::decrypt(\n $this->encryptionDefaultWithSalt(),\n $this->salt\n );\n }",
"function action_get_default_usr() {\n\t\t\t\n\t\t\t$cnf_methods = get_class_methods(\"CONF\");\n\t\t\t\n\t\t\t$select = \"SELECT usr, pwd FROM \".$this->tbl_usr.\" WHERE id = \".CONF::guest();\n\n\t\t\t$default = $this->DB->query($select);\n\n\t\t\t$params = $default->r();\n\t\t\t$params['__encoded'] = true;\n\n\t\t\t$usr = $this->action_usr_validate($params);\n\t\t\t\n\t\t\t$usr['is_default'] = true;\n\t\t\t\n\t\t\treturn $usr;\n\t\t}",
"public function decryptionDefault()\n {\n return Encryption::decrypt(\n $this->encryptionDefault()\n );\n }",
"public function getDefaultCipher () {\n\t\treturn $this->defaultCipher;\n\t}",
"function get_default_user_value($value_name, $default)\n{\n $default_user = get_default_user_info(true);\n if ($default_user === false or empty($default_user[$value_name]))\n {\n return $default;\n }\n else\n {\n return $default_user[$value_name];\n }\n}",
"public function getCryptKey(): string;",
"public function cryptValue($value)\n\t{\n\t\tload_class('Q\\Crypt');\n\t\treturn empty($this['crypt']) || !isset($value) ? $value : Crypt::with($this['crypt'])->encrypt($value);\n\t}",
"public function return_crypt_type () {\n if(CRYPT_SHA512 == 1) { return 'CRYPT_SHA512'; }\n elseif(CRYPT_SHA256 == 1) { return 'CRYPT_SHA256'; }\n elseif(CRYPT_BLOWFISH == 1) { return 'CRYPT_BLOWFISH'; }\n elseif(CRYPT_MD5 == 1) { return 'CRYPT_MD5'; }\n else { return \"No crypt types supported\"; }\n }",
"private function detect_crypt_type () {\n if(CRYPT_SHA512 == 1) { return '$6$rounds=3000$'; }\n elseif(CRYPT_SHA256 == 1) { return '$5$rounds=3000$'; }\n elseif(CRYPT_BLOWFISH == 1) { return '$2y$'.str_pad(rand(4,31),2,0, STR_PAD_LEFT).'$'; }\n elseif(CRYPT_MD5 == 1) { return '$5$rounds=3000$'; }\n else { $this->Result->show(\"danger\", _(\"No crypt types supported\"), true); }\n }",
"function _get_cipher() {\n\t\tif ($this->_mcrypt_cipher == '') {\n\t\t\t$this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;\n\t\t}\n\t\t\n\t\treturn $this->_mcrypt_cipher;\n\t}",
"function getCryptKey($type = 'CRYPT_STD_DES') {\n /*--------------------------------------------------------------------------\n | CRYPT_STD_DES - Standard DES-based hash with a two character salt from the \n | alphabet \"./0-9A-Za-z\". Using invalid characters in the salt will cause \n | crypt() to fail.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_STD_DES == 1 && $type == 'CRYPT_STD_DES') {\n return crypt('HCL6QGsKwDMN2','HC');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_EXT_DES - Extended DES-based hash. The \"salt\" is a 9-character \n | string consisting of an underscore followed by 4 bytes of iteration count \n | and 4 bytes of salt. These are encoded as printable characters, 6 bits \n | per character, least significant character first. The values 0 to 63 are \n | encoded as \"./0-9A-Za-z\". Using invalid characters in the salt will cause \n crypt() to fail.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_EXT_DES == 1 && $type == 'CRYPT_EXT_DES') {\n return crypt('_a...HCig8tp30mPhjfQ','_a ... HCig');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_MD5 - MD5 hashing with a twelve character salt starting with $1$\n |---------------------------------------------------------------------------\n */\n if (CRYPT_MD5 == 1 && $type == 'CRYPT_MD5') {\n return crypt('$1$HCigmW9T$VoHVZfkndAEVxjEOMKNO90','$1$HCigmW9T$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_BLOWFISH - Blowfish hashing with a salt as follows: \"$2a$\", \"$2x$\" \n | or \"$2y$\", a two digit cost parameter, \"$\", and 22 characters from the \n | alphabet \"./0-9A-Za-z\". Using characters outside of this range in the salt \n | will cause crypt() to return a zero-length string. The two digit cost \n | parameter is the base-2 logarithm of the iteration count for the underlying \n | Blowfish-based hashing algorithmeter and must be in range 04-31, values \n | outside this range will cause crypt() to fail. Versions of PHP before \n | 5.3.7 only support \"$2a$\" as the salt prefix: PHP 5.3.7 introduced the \n | new prefixes to fix a security weakness in the Blowfish implementation. \n | Please refer to » this document for full details of the security fix, \n | but to summarise, developers targeting only PHP 5.3.7 and later should \n | use \"$2y$\" in preference to \"$2a$\".\n |---------------------------------------------------------------------------\n */\n if (CRYPT_BLOWFISH == 1 && $type == 'CRYPT_BLOWFISH') {\n return crypt('$2y$06$HCigmW9Tnoaw.aIzOEobLOVDWnTgG2QAC5Eu/5DIOAeGlEVq0Q.2O','$2y$0$HCigmW9Tnoaw.aIzOEobLX$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_SHA256 - SHA-256 hash with a sixteen character salt prefixed with \n | $5$. If the salt string starts with 'rounds=<N>$', the numeric value \n | of N is used to indicate how many times the hashing loop should \n | be executed, much like the cost parameter on Blowfish. The default \n | number of rounds is 5000, there is a minimum of 1000 and a maximum of \n | 999,999,999. Any selection of N outside this range will be truncated \n | to the nearest limit.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_SHA256 == 1 && $type == 'CRYPT_SHA256') {\n return crypt('$5$rounds=34319$HCigmW9Tnoaw.aIz$YKQXJttdJxXCNBJEGW82I8Hyhz5ztG3A67P3XlpNpvA','$5$rounds=34319$HCigmW9Tnoaw.aIz$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_SHA512 - SHA-512 hash with a sixteen character salt prefixed with \n | $6$. If the salt string starts with 'rounds=<N>$', the numeric value of N \n | is used to indicate how many times the hashing loop should be executed, \n | much like the cost parameter on Blowfish. The default number of rounds \n | is 5000, there is a minimum of 1000 and a maximum of 999,999,999. Any \n | selection of N outside this range will be truncated to the nearest limit.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_SHA512 == 1 && $type == 'CRYPT_SHA512') {\n return crypt('$6$rounds=34319$HCigmW9Tnoaw.aIz$G4kCr.3sQfC2Bm7.TQHufQ3bBtqUYYPrZuLbnG2YvgVp4TiHLcOdFQT174ng1VTHRxLlINSE8pQqSlWab3xgZ/','$6$rounds=34319$HCigmW9Tnoaw.aIz$');\n }\n}",
"public function getSystemValue($key, $default = '');"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the video/frame codec, should be in the available ones, otherwise an exception is thrown. | public function setVideoCodec(Codec $codec)
{
if ($this->getAvailableVideoCodecs() && ! in_array($codec, $this->getAvailableVideoCodecs(), false))
{
throw new \InvalidArgumentException(sprintf('Wrong video codec value for "%s", available values are %s',
$codec, implode(', ', $this->getAvailableVideoCodecs())));
}
$this->videoCodec = $codec;
return $this;
} | [
"public function setVideoCodec(?string $videoCodec): void\n {\n $this->videoCodec = $videoCodec;\n }",
"public function getVideoCodec()\n\t{\n\t\treturn $this->videoCodec;\n\t}",
"public function getVideoCodecType()\n {\n return $this->videoCodecType;\n }",
"public function getVideoCodec()\n\t{\n\t\treturn $this->getFormat()->getVideoCodec();\n\t}",
"public function getAvailableVideoCodecs();",
"public function getVideoCodec(){\n \t$t = $this->_id3();\n \tif(isset($t['video']['fourcc']))\n \t\treturn $t['video']['fourcc'];\n\n \tZend_Debug::dump($t, \"Unable to found video codec for \".$this->getFileName());\n \t//throw new Exception(\"Fatal Error\");\n }",
"public function setVcodecs($vcodecs)\n {\n $this->vcodecs = $vcodecs;\n $this->get('vcodec')->setValueOptions($this->vcodecs);\n\n }",
"public function set_encoding_acodec($codec){\n$this->encoding_acodec = $codec;\n}",
"protected function setAvailableVideoCodecs(array $codecs, $force = false)\n\t{\n\t\tif ( ! $force && $this->getAvailableVideoCodecs())\n\t\t{\n\t\t\t$codecs = array_intersect($this->getAvailableVideoCodecs(), $codecs);\n\t\t}\n\t\t\n\t\t$this->videoAvailableCodecs = array_map('strval', $codecs);\n\t\t\n\t\treturn $this;\n\t}",
"public function setVideoCodecParameters(VideoCodecParameters $parameters)\n {\n return $this->setAttribute('video_codec_parameters', $parameters);\n }",
"public function setSupportedCodecs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::ENUM, \\Ydb\\PersQueue\\V1\\Codec::class);\n $this->supported_codecs = $arr;\n\n return $this;\n }",
"public function getHighqualityVideoCodec()\n\t{\n\t\treturn $this->highquality_video_codec;\n\t}",
"public function getLowqualityVideoCodec()\n\t{\n\t\treturn $this->lowquality_video_codec;\n\t}",
"public function getSetSupportedCodecs()\n {\n return $this->set_supported_codecs;\n }",
"public function getVideoCodec() {\n\t\t$match = array();\n\t\tpreg_match(self::$REGEX_VIDEO_CODEC, $this->output, $match);\n\t\t$videoCodec = (array_key_exists(1, $match)) ? trim($match[1]) : '';\n\t\t\n\t\treturn $videoCodec;\n }",
"public function getVideoEncoders($default = \"copy\")\n {\n //Function have same code for video, audio and subtitle codecs\n //FFMPeg encoder looks like this:\n //H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )\n //We need to extract only name of encoder and their corresponding encoders (sub encoders)\n //set default to copy (no encoding needed)\n $vencArray = array($default => $default);\n $vencArray['copy'] = 'copy';\n $venc = $this->getSupportedCodecs();\n\n foreach ($venc as $line) :\n $line = trim($line);\n //EV stands for Encoding Video. Change EA for Encoding Audio\n if (strpos($line, 'EV')) { //if line have Encoding Video\n $splitted = explode(\" \", $line); //remove empty space from array\n $i = 0; //$i = index of $splitted line for removing from array $splitted\n foreach ($splitted as $emptyItem) : //array 0=codec params (encoder, decoder..) , 1=name, ... = description and sub-encoders\n if (empty($emptyItem)) {\n unset($splitted[$i]);\n }\n $i++;\n endforeach;\n\n //reindex array\n $splitted_reindexed = array_values($splitted);\n\n //add encoder to vencArray\n // $apush[$splitted_reindexed[1]] = $splitted_reindexed[1];\n $vencArray[$splitted_reindexed[1]] = $splitted_reindexed[1];\n // array_push($vencArray, $apush);\n\n //get sub encoders ex: h264 (h264_nvenc, h264_cuvid.. )\n $sr = 0; // index of $splitted_reindexed\n foreach ($splitted_reindexed as $encItem) {\n if ($encItem === \"(encoders:\") {\n //remove unnecessary words from array\n $spliced = array_splice($splitted_reindexed, $sr);\n $i = 1; //$i = index of splitted encoder description. Skip index 0 because it is not encoder name ;\n while ($spliced[$i] != ')') {\n //add to encoder array\n $vencArray[$spliced[$i]] = $spliced[$i];\n $i++;\n }\n }\n $sr++;\n }\n }\n endforeach;\n\n //remove double and return\n return array_unique($vencArray);\n }",
"public function testCodecTypeMustBeAudioOrVideo()\n {\n $result = $this->sonus->codec('test', 'test');\n $expected = false;\n $this->assertTrue($result == $expected);\n }",
"public function getVideoFormat()\n {\n return $this->video_format;\n }",
"private function codecVideo($path)\n {\n $ffmpeg = FFMpeg::create([\n 'ffmpeg.binaries' => env('FFMPG'),\n 'ffprobe.binaries' => env('FFPROBE'),\n 'timeout' => 9800, // The timeout for the underlying process\n 'ffmpeg.threads' => 1\n ]);\n Log::info('starting open video');\n\n $videoCodec = $ffmpeg->open(public_path($path));\n $format = new X264();\n $format->setAudioCodec('libmp3lame');\n Log::info('coding audio');\n $codecName =\"export_\".str_random(20).\".mp4\";\n $newVideoPath = public_path(\"uploads/targets/$codecName\");\n $videoCodec->save($format,$newVideoPath);\n Log::info('video coding finish');\n\n return $codecName;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function Add a field to the post meta array | function register_post_field($args) {
$this->postmeta[ $args['post_type'] ][ $args['section'] ][ $args['id'] ] = $args;
} | [
"public function addField($field_id, array $field) {\n $this->metafields[$field_id] = $field;\n }",
"public function register_meta_fields() : void {\n\n $args = array(\n 'show_in_rest' => true,\n 'single' => true,\n 'type' => 'string',\n );\n\n foreach( $this->metafields as $key => $value ) {\n\n \\register_meta( 'post' , $value , $args );\n\n }\n \n }",
"public function register_fields_meta() {\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\tforeach ( $this->fields as $field ) {\n\t\t\t\t$show_in_rest = true;\n\t\t\t\tif ( 'flag' === $field->type ) {\n\t\t\t\t\t$type = 'boolean';\n\t\t\t\t} elseif ( 'multiple' === $field->type ) {\n\t\t\t\t\t$type = 'array';\n\t\t\t\t\t$show_in_rest = [\n\t\t\t\t\t\t'schema' => [\n\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t'items' => [\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t];\n\t\t\t\t} elseif ( 'measure' === $field->type ) {\n\t\t\t\t\t$type = 'array';\n\t\t\t\t\t$show_in_rest = [\n\t\t\t\t\t\t'schema' => [\n\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t'items' => [\n\t\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\t$type = 'string';\n\t\t\t\t}\n\n\t\t\t\tregister_post_meta(\n\t\t\t\t\t$this->object_post_type->options['type'],\n\t\t\t\t\t$field->slug,\n\t\t\t\t\t[\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'description' => $field->name,\n\t\t\t\t\t\t'single' => true,\n\t\t\t\t\t\t'show_in_rest' => $show_in_rest,\n\t\t\t\t\t\t'auth_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'edit_posts' );\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function add_meta( &$data, $meta ){}",
"function add_field($field, $value) {\r\n // sent to bitpay as POST variables. If the value is already in the \r\n // array, it will be overwritten.\r\n \r\n $this->fields[\"$field\"] = $value;\r\n }",
"function addField($field, $value)\n\t{\n\t\t$this->data[\"$field\"] = $value;\n\t}",
"public function register_post_meta() {\n\n\t\tregister_rest_field(\n\t\t\t'envira',\n\t\t\t'gallery_data',\n\t\t\tarray(\n\t\t\t\t'get_callback' => array( $this, 'get_gallery_data' ),\n\t\t\t\t'update_callback' => array( $this, 'update_gallery_data' ),\n\t\t\t)\n\t\t);\n\n\t}",
"public function add_meta( Caldera_Forms_Entry_Meta $item ){\n\t\t$this->meta[] = $item;\n\t}",
"function add_custom_field($args) {\n register_rest_field( array(\"post\", \"page\"), 'wpnext', \n array(\n 'get_callback' => array( &$this, 'custom_field_get' ),\n 'update_callback' => array( &$this, 'custom_field_update' ),\n 'schema' => array(\n 'description' => \"Components and listed values.\",\n 'type' => 'object',\n 'context' => array('view', 'edit')\n )\n )\n );\n }",
"public function add_field( array $args, $position = 0 );",
"public function addMeta(array $meta);",
"function add($meta = array(), $post_id = 0, $is_main = \\false)\n {\n }",
"public function add_meta(&$data, $meta);",
"public function event_organizer_add_meta_fields() {\n\t\tforeach ( Events_Maker()->organizer_fields as $key => $field ) {\n\t\t\techo $this->taxonomy_form_field( $key, $field );\n\t\t}\n\t}",
"public function add( $args, $assoc_args ) {\n\t\tlist( $object_id, $meta_key ) = $args;\n\n\t\t$meta_value = \\WP_CLI::get_value_from_arg_or_stdin( $args, 2 );\n\t\t$meta_value = \\WP_CLI::read_value( $meta_value, $assoc_args );\n\n\t\t$object_id = $this->check_object_id( $object_id );\n\n\t\t$success = \\add_metadata( $this->meta_type, $object_id, $meta_key, $meta_value );\n\n\t\tif ( $success ) {\n\t\t\t\\WP_CLI::success( \"Added custom field.\" );\n\t\t} else {\n\t\t\t\\WP_CLI::error( \"Failed to add custom field.\" );\n\t\t}\n\t}",
"function additional_page_meta_fields(){\n add_meta_box(\n 'additional_page_meta_fields',\n __( 'Additional Post Meta' ),\n 'Theme\\Admin\\additional_page_meta_fields_box',\n ['page', 'post'],\n 'side',\n 'low'\n );\n }",
"function append_custom_fields() {\n\t\t\n\t\tforeach ( $this->custom_fields as $this->custom_field ) {\n\t\t\t$this->set_single_custom_field();\n\t\t\t$this->add_to_post( $this->meta_key, apply_filters( \"append-post-data-$this->post_type\", get_post_meta( $this->post->ID, $this->meta_key, $this->unique ), $this ) );\n\t\t}\n\t\t\n\t}",
"function thisismyurl_add_custom_media_fields($form_fields, $post)\n{\n\n $media_custom_fields = get_option('thisismyurl_custom_media_fields', NULL);\n\n foreach ($media_custom_fields as $custom_field) {\n\n $form_fields[$custom_field['unique_id']] = array(\n 'label' => $custom_field['name'],\n 'value' => get_post_meta($post->ID, '_' . $custom_field['unique_id'], true),\n 'helps' => $custom_field['help']\n );\n\n }\n\n return $form_fields;\n}",
"function add_field($field, $value) {\r\n // sent to paypal as POST variables. If the value is already in the\r\n // array, it will be overwritten.\r\n\r\n $this->fields[\"$field\"] = $value;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the private 'notification.type.post' service. | protected function getNotification_Type_PostService()
{
$instance = new \phpbb\notification\type\post(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \phpbb\db\driver\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \phpbb\auth\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');
$instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});
$instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});
return $instance;
} | [
"protected function getNotification_Type_PostService()\n {\n $instance = new \\phpbb\\notification\\type\\post($this->get('dbal.conn'), $this->get('language'), $this->get('user'), $this->get('auth'), './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader($this->get('user_loader'));\n $instance->set_config($this->get('config'));\n\n return $instance;\n }",
"public function getPostService()\n {\n return $this->get('talkfest.service.post');\n }",
"public function getPostService()\n {\n if (null === $this->postService)\n $this->postService = $this->getService('post');\n return $this->postService;\n }",
"protected function getNotification_Type_PostInQueueService()\n {\n return new \\phpbb\\notification\\type\\post_in_queue($this->get('user_loader'), $this->get('dbal.conn'), $this->get('cache.driver'), $this->get('user'), $this->get('auth'), $this->get('config'), './../', 'php', 'phpbb_notification_types', 'phpbb_notifications', 'phpbb_user_notifications');\n }",
"public static function post()\n {\n return self::$post;\n }",
"protected function getNotification_Type_DisapprovePostService()\n {\n $instance = new \\phpbb\\notification\\type\\disapprove_post($this->get('dbal.conn'), $this->get('language'), $this->get('user'), $this->get('auth'), './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader($this->get('user_loader'));\n $instance->set_config($this->get('config'));\n\n return $instance;\n }",
"protected function getNotification_Type_PostInQueueService()\n {\n $instance = new \\phpbb\\notification\\type\\post_in_queue(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }",
"protected function getNotification_Type_PostInQueueService()\n {\n $instance = new \\phpbb\\notification\\type\\post_in_queue($this->get('dbal.conn'), $this->get('language'), $this->get('user'), $this->get('auth'), './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader($this->get('user_loader'));\n $instance->set_config($this->get('config'));\n\n return $instance;\n }",
"function AE_AE_Message_Posttype()\r\n {\r\n return AE_AE_Message_Posttype::getInstance();\r\n }",
"public function getPostType()\n {\n return $this->postType;\n }",
"protected function getNotification_Type_ApprovePostService()\n {\n $instance = new \\phpbb\\notification\\type\\approve_post($this->get('dbal.conn'), $this->get('language'), $this->get('user'), $this->get('auth'), './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader($this->get('user_loader'));\n $instance->set_config($this->get('config'));\n\n return $instance;\n }",
"private function getServicePostLike()\n {\n return $this->container->get('app_service_post_like');\n }",
"protected function getSocial_Service_PostService()\n {\n return $this->services['social.service.post'] = new \\Ology\\SocialBundle\\Service\\PostService($this->get('social.dao.post'), $this->get('social.dao.ology'), $this->get('social.dao.user'), $this->get('social.dao.postsologies'), $this->get('social.dao.postschannels'), $this->get('social.dao.postsstashes'), $this->get('social.dao.cache'), $this->get('social.service.comment'), $this->get('social.service.mail'));\n }",
"protected function getNotification_Type_ReportPostService()\n {\n $instance = new \\phpbb\\notification\\type\\report_post($this->get('dbal.conn'), $this->get('language'), $this->get('user'), $this->get('auth'), './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader($this->get('user_loader'));\n $instance->set_config($this->get('config'));\n\n return $instance;\n }",
"public static function post_type(){}",
"public static function post_type() {\n\t\treturn self::$post_type ? : ( self::$post_type = TypeRegistry::get_type( 'PostType' ) );\n\t}",
"public function getPostTypeName();",
"public function testCreateNotificationUsingPost()\n {\n }",
"protected function getPostHelperService()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds a "final" attribute in the current element. If the current element does not support the attribute then it is not built. | public function buildFinalAttribute(string $value): void; | [
"public static function getFinal()\n {\n return new PhpDocElement('final', '', '', '');\n }",
"public function getFinalValueAttribute()\n {\n return '$' . Money::convertDatabaseToView($this->attributes['finalValue'], 2, '.', ',');\n }",
"private function buildAttributes()\n {\n $attributeString = new String();\n $end = end(array_keys($this->attributes));\n\n foreach($this->attributes as $name => $value)\n {\n if(!$this->selfClosing && $name == 'value') continue;\n\n $attributeString->append(' ')\n ->append($name)\n ->append('=\"')\n ->append($value)\n ->append('\"');\n\n if($name != $end) {\n $attributeString->append(' ');\n }\n }\n\n return $attributeString;\n }",
"protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}",
"function setFinal() {\n\t\t$this->keywords['final'] = true;\n\t}",
"public function setMarkAsFinal()\n {\n $this->_markAsFinal = 1;\n $this->addProperties(['contentStatus' => 'Final']);\n $this->generateOVERRIDE(\n '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.' .\n 'custom-properties+xml'\n );\n }",
"public function setMarkAsFinal()\n {\n $this->_markAsFinal = 1;\n $this->addProperties(array('contentStatus' => 'Final'));\n $this->generateOVERRIDE(\n '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.' .\n 'custom-properties+xml'\n );\n }",
"public function build()\n {\n if (isset($this->attribute['href']) && (! isset($this->attribute['alt']))) {\n $this->attribute['alt'] = $this->attribute['href'];\n }\n\n return parent::build();\n }",
"public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }",
"public function createAttribute(ElementBuilder $e)\n {\n $attr = new AttributeElement(end($this->classes));\n $this->addElementDocBlock($attr);\n $attr->addBodyElement($e);\n $attr->setName(str_replace('$', '', $this->tokenParser->findElementName($e)));\n return $attr;\n }",
"function WriteEndAttribute(){\n \t$this->xw->endAttribute();\n }",
"public function generate_html_attribute()\n\t{\n\t\t$output = '';\n\t\t\n\t\tif ( iterable($this->_attributes) ) {\n\t\t\tforeach ( $this->_attributes as $attr_name => $attr_value ) {\n\t\t\t\tif ( !$this->is_valid_attribute($attr_name) ) {\n\t\t\t\t\t$attr_name = 'data-' . $attr_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output .= $attr_name . '=\"' . htmlentities($attr_value) . '\" ';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn rtrim($output);\n\t}",
"public function setFinal($final){\n if($final === true){\n $this->final = true;\n }else{\n $this->final = false;\n }\n }",
"function site_inner_attr( $attributes ) {\n\t$attributes['class'] .= ' full';\n\n\t$attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );\n\n\treturn $attributes;\n\n}",
"public function makeFinal() {}",
"public function testBuildFinalDefaultAttributeCreatesAttrWhenSchemaAndValueIsValid(\n string $value,\n bool $ext, \n bool $res, \n bool $lst, \n bool $unn\n ): void\n {\n $this->sut->buildFinalDefaultAttribute($value);\n $sch = $this->sut->getSchema();\n \n self::assertElementNamespaceDeclarations([], $sch);\n self::assertSchemaElementHasOnlyFinalDefaultAttribute($sch);\n self::assertSchemaElementFinalDefaultAttribute($ext, $res, $lst, $unn, $sch);\n self::assertSame([], $sch->getElements());\n }",
"private function replaceDynamicAttribute(string $html)\n {\n $str = new Builder();\n\n foreach(explode('<', $html) as $tag)\n {\n if(!Str::startWith($tag, ['/', '?', '!']) && $tag !== '')\n {\n if(Str::has($tag, '>'))\n {\n $pos = strpos($tag, ' ');\n $props = $pos ? Str::move(Str::break($tag, '>')[0], $pos) : '';\n $props = $props === false ? '' : $props;\n\n if(!empty($props))\n {\n $str->append('<' . Str::break($tag, ' ')[0] . ' ');\n $props = Str::moveFromBothEnds($props, ' ');\n $content = Str::break($tag, '>')[1] ?? null;\n $attrs = explode('\" ', $props);\n $first = $attrs[0] ?? null;\n \n foreach($attrs as $attr)\n {\n if(!empty($attr) && Str::startWith($attr, ':'))\n {\n $name = Str::move(Str::break($attr, '=')[0], 1);\n $value = Str::moveFromEnd(Str::break($attr, '=\"')[1], '\"');\n \n if($name === 'class')\n {\n $str = Str::moveFromEnd($str, ' ');\n $classes = new Arr();\n\n foreach(explode(' ', $value) as $class)\n {\n if(Str::startWith($class, '$'))\n {\n $this->callable->push('<?php echo htmlspecialchars(' . $class . '); ?>');\n $classes->push('[#### ' . $this->index . ' ####]');\n $this->index++;\n }\n else\n {\n $classes->push($class);\n }\n }\n\n if(Str::startWith($first, ':class'))\n {\n $str->append(' class=\"' . $classes->implode(' ') . '\" ');\n }\n else\n {\n $str->append('class=\"' . $classes->implode(' ') . '\" ');\n }\n }\n else\n {\n $this->callable->push('<?php\n \n if(!empty(' . $value . ') && !is_null(' . $value . ') && ' . $value . ' !== false) {\n if(' . $value . ' === true) {\n echo \\'' . $name . ' \\';\n }\n else \n {\n echo \\'' . $name . '=\"\\' . htmlspecialchars(' . $value . ') . \\'\" \\';\n }\n }\n\n ?>');\n\n $str->append('[#### ' . $this->index . ' ####]');\n $this->index++;\n }\n }\n else\n {\n if($attr !== '/' && !Str::endWith($attr, '=\"\"'))\n {\n if(Str::has($attr, '=\"'))\n {\n $str->append(Str::moveFromBothEnds($attr, '\"') . '\" ');\n }\n else\n {\n $str->append(Str::moveFromEnd($attr, '\"'));\n }\n }\n }\n }\n\n $str->moveFromEnd(' ')->append('>');\n\n if(!is_null($content))\n {\n $str->append($content);\n }\n }\n else\n {\n $str->append('<' . $tag);\n }\n }\n else\n {\n $str->append($tag);\n }\n }\n else\n {\n $str->append('<' . $tag);\n }\n }\n\n if(Str::startWith($str, '<<'))\n {\n $str = Str::move($str, 1);\n }\n else\n {\n $str = $str->get();\n }\n\n return $str;\n }",
"protected function create_attributes()\n {\n $attr = '';\n if (!empty($this->attr)) {\n foreach ($this->attr as $name => $value) {\n $attr .= ' ' . $name . '=\"' . $value . '\"';\n }\n }\n\n return $attr;\n }",
"protected function _getComputedOnBlurAttrib(){\n\t\t$onBlur = 'YAHOO.util.Dom.removeClass(this, \"' . self::kTextInputClassFocus . '\");';\n\t\tif($this->getOnBlur() !== ''){\n\t\t\t$onBlur .= $this->getOnBlur();\n\t\t}\n\t\treturn ' onBlur=\"' . oldHtmlspecialchars($onBlur) . '\"';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing the rule MaxWidth | public function testRuleMaxWidth(): void {
$validator = new Validator();
$validator -> file('file.0') -> maxWidth(120);
$this -> assertTrue($validator -> passes());
$this -> assertFalse($validator -> fails());
$validator = new Validator();
$validator -> file('file.0') -> maxWidth(100);
$this -> assertFalse($validator -> passes());
$validator = new Validator();
$validator -> file('non-existing') -> maxWidth(120);
$this -> assertTrue($validator -> passes());
$this -> assertFalse($validator -> fails());
} | [
"public function getMaxWidth() {}",
"public function getMaxWidth();",
"function AutoCompGetMaxWidth(){}",
"private function addMaxWidthRule()\n {\n $this->app['validator']->extend('maxWidth', function($attribute, $value, $parameters)\n {\n list ($imageWidth) = getimagesize($value);\n if (! $imageWidth)\n return false;\n if ((isset($parameters[0]) && $parameters[0] != 0) && $imageWidth > (int) $this->maxWidth)\n return false;\n\n return true;\n });\n }",
"public function testValidateMaxWidth()\n {\n $this->expectException(InvalidArgumentException::class);\n Validator::validateMaxWidth(self::LESS_THAN_ZERO);\n }",
"public function getMaxWidth()\n {\n return ( !empty( $this->get( 'width' ) ) ) ? (int)$this->get( 'width' ) : self::WIDTH;\n }",
"public function testPropertyMaximumContentWidth($value)\n {\n $object = new ConditionalComponentLayout();\n $object->setMaximumContentWidth($value);\n\n $this->assertEquals($value, $object->getMaximumContentWidth());\n }",
"public function getMaxWidth()\n {\n return $this->maxWidth;\n }",
"public function max_width() {\n return strlen($this->leftText) + $this->widestCell + strlen($this->rightText);\n }",
"function mf_validate_max_length($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$target_value = $value[0];\r\n\t\t$exploded \t = explode('#',$value[1]);\r\n\t\t\r\n\t\t$range_limit_by = $exploded[0];\r\n\t\t$range_max\t\t= (int) $exploded[1];\r\n\t\t\r\n\t\tif($range_limit_by == 'c' || $range_limit_by == 'd'){\r\n\t\t\t$target_length = strlen($target_value);\r\n\t\t}elseif ($range_limit_by == 'w'){\r\n\t\t\t$target_length = count(preg_split(\"/[\\s\\.]+/\", $target_value, NULL, PREG_SPLIT_NO_EMPTY));\r\n\t\t}\r\n\t\t\r\n\t\tif($target_length > $range_max){\r\n\t\t\treturn 'error_no_display';\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function getMaxWidth() {\n return $this->maxWidth;\n }",
"public function getWidthLimit()\n {\n }",
"public function getMaxLengthRule() {\n\t\treturn $this->maxLength;\n\t}",
"private function isMaxWidth(){\r\n // Si tout se d�roule parfaitement, le formulaire prend toute la place.\r\n $indicateur = true; \r\n // Des erreurs && ( block erreur a droite || gauche)\r\n if(count($this->errorManager->getArrayError()) && ($this->getErrorBlockPosition() == 'right' || $this->getErrorBlockPosition() == 'left')){\r\n $indicateur = false;\t\t\r\n } // Des infos && ( block infos a droite || gauche)\r\n elseif(count($this->informationManager->getArrayInformation()) && ($this->getInformationBlockPosition() == 'right' || $this->getInformationBlockPosition() == 'left')){\r\n $indicateur = false;\r\n } // Une validation (block info a droite ou gauche)\r\n elseif($this->allowValidMsg && ($this->getInformationBlockPosition() == 'right' || $this->getInformationBlockPosition() == 'left')){\r\n $indicateur = false;\r\n }\r\n return $indicateur;\r\n\t}",
"public function testMaxHeight() {\n $this->assertTrue(Validate::maxHeight($this->image, 267));\n $this->assertTrue(Validate::maxHeight($this->image, 300));\n $this->assertFalse(Validate::maxHeight($this->image, 265));\n $this->assertFalse(Validate::maxHeight($this->image, 144));\n }",
"public function get_max_width() {\n return $this->max_width;\n }",
"public function setOptimizedMaximumWidth($width);",
"function validate_fileMaxWidth($value, $maxWidth){\n\tif(!is_array($value)) return true;\n\tif(!file_exists($value['tmp_name'])) return true;\n\tlist($width, $height) = getimagesize($value['tmp_name']);\n\treturn ($width <= $maxWidth);\n}",
"function checkWidth()\r\n\t{\r\n\t\t$file = getimagesize($this->file_tmp);\r\n\t\t//$width = $file[0];\r\n\t\t\r\n\t\tif($file[0] > $this->max_height)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query function to check if hero need last name. | public function needLastName()
{
return $this->heroRace->needLastName();
} | [
"public function hasLastName() {\n\t\treturn $this->hasString('last_name');\n\t}",
"public function hasLastName()\n {\n return $this->hasData(self::LAST_NAME_KEY);\n }",
"protected function checkSendLastName()\n {\n // get first name from form if data is sent\n $lastName = $this->formData->getData('last-name');\n\n // if data is send\n if ($lastName) {\n // add sent data in build sql query\n $this->builder->getLastName($lastName);\n }\n }",
"private function checklname() {\r\n\t\t$variable = \"lname\";\r\n\t\tif(!preg_match(\"/[a-z]/i\", $this->$variable)) {\r\n\t\t\t$this->setAddResultRecord(\"Lastname at least contain 1 letter.<br>\");\r\n\t\t\t$this->validated = 0;\r\n\t\t}\r\n\t\tif(!$this->checkname($this->$variable)) {\r\n\t\t\t$this->setAddResultRecord(\"Lastname should be alphabetic and not more than 20 letters.<br>\");\r\n\t\t\t$this->validated = 0;\r\n\t\t}\r\n\t}",
"function validLastName($lastname)\n {\n return !empty($lastname) && ctype_alpha($lastname);\n }",
"protected function askLastName()\n {\n while (!isset($last_name) || !$this->validateLastName($last_name)) {\n $last_name = $this->io->ask(\"Enter the admin user last name (1-30 characters): \");\n }\n return $last_name;\n }",
"public function hasName();",
"function exists($db, $firstName, $lastName)\n {\n $query = \"SELECT id\n FROM actors\n WHERE first_name LIKE $firstName AND\n last_name = $lastName;\";\n\n return count($db->query($query)->fetchAll()) != 0;\n }",
"private function _getNames()\n\t {\n\t\t$result = array();\n\t\t$rows = $this->_db->exec(\"SELECT * FROM `names` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$result[] = mb_strtoupper($row[\"name\"]);\n\t\t } //end while\n\n\t\t$result = array_unique($result);\n\n\t\tif (count($result) > 1)\n\t\t {\n\t\t\treturn false;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn true;\n\t\t } //end if\n\n\t }",
"public function testLastName() {\n if (isset($this->lastName)) {\n if (!preg_match(\"/^[a-zA-Z ]*$/\", $this->lastName)) {\n $this->lastNameValid = false;\n $this->lastNameError = \"Only letters and white space allowed in last name.\";\n } else {\n $this->lastName = $this->test_input($this->lastName);\n $this->lastNameValid = true;\n }\n } else {\n $this->lastNameValid = false;\n $this->lastNameError = \"Last name is required.\";\n }\n }",
"function checkName() {\n\t\tglobal $NET_ID, $FULL_NAME;\n\t\t$db = new Database();\n\t\t$studentsDAO = &$db->getStudentsDAO();\n\t\t$success = true;\n\n\t\t$result = $studentsDAO->getStudentName($NET_ID);\n\t\tif(Database::getNextRow($result)['full_name'] == '')\n\t\t\t$success = $studentsDAO->addStudentName($NET_ID, $FULL_NAME);\n\n\t\t$db->close($success);\n\t}",
"private function select_student_like_last_name($last_name){\n\t\treturn $this->_db->select_student_like_last_name($last_name);\n\t}",
"function is_valid_first_or_last_name($name)\n {\n if ($name === null) {\n return false;\n }\n return (preg_match('/^[A-Z]+$/', $name) == true);\n }",
"protected function lastName($lastName)\n {\n return $this->builder->where('last_name','like',$lastName.'%');\n }",
"protected function askLastName()\n {\n while (!isset($lastName) || !$this->validateLastName($lastName)) {\n $lastName = $this->io->ask(\"Enter the user last name (1-30 characters)\");\n }\n return $lastName;\n }",
"function get_lastname($fullName = '')\n {\n $arrFullName = explode(' ', $fullName);\n $lastName = isset($arrFullName[1]) ? isset($arrFullName[1]) : '';\n return $lastName;\n }",
"public function getLastname() {\n $lastname = $this->userdetails['firstname'];\n return $lastname;\n }",
"function get_actors_by_last_name( $letter ) {\n\tglobal $pdo;\n\n\t$stmt = $pdo->prepare('\n\t\tSELECT actor_id, first_name, last_name\n\t\tFROM actor\n\t\tWHERE last_name LIKE :letter\n\t\tLIMIT 50');\n\n\t$stmt->execute( array( ':letter' => $letter . '%' ) );\n\n\treturn $stmt->fetchAll( PDO::FETCH_OBJ );\n}",
"public function isHuman();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the active skills form a heroId | public function getSkillSet( $heroId )
{
if ( isset( \Sentry::getUser()->battletag ) && isset( \Sentry::getUser()->server ) )
{
$battletag = \Sentry::getUser()->battletag;
$server = \Sentry::getUser()->server;
}
else
return false;
// Instantiate a new d3 instance
$Diablo3 = new \Diablo3($battletag, $server, 'en_US');
// Get the hero information for the given heroId
$heroData = $Diablo3->getHero($heroId);
// If errors were returned
if ( !is_array( $heroData ) ) return false;
$skillSet = [];
$n = 0;
foreach ($heroData['skills']['active'] as $skills)
{
// Checking for empty ones (=not a lvl60 hero)
if ( isset( $skills['skill'] ) )
$skillSet[$n] = $skills['skill'];
$n++;
}
return $skillSet;
} | [
"public function get($hero_id);",
"public function get_skills()\n {\n $skills = DB::table('skill')\n ->select('skill.skill_id AS id', 'skill.title AS title')\n ->where('skill.franchise_id', $this->franchise_id)\n ->where('skill.club_id', $this->club_id)\n ->orderBy('skill.title')\n ->get();\n return response()->json($skills, 200);\n }",
"public function hero(string $heroId): array\n\t{\n\t\t$talents = [];\n\n\t\tforeach ($this->data->getContents()->$heroId->talents as $levelId => $collection)\n\t\t{\n\t\t\tforeach ($collection as $contents)\n\t\t\t{\n\t\t\t\t$skillId = Skill::createId($contents);\n\t\t\t\t$strings = $this->fetchStrings($skillId);\n\n\t\t\t\t$talents[] = new Talent($heroId, $levelId, $contents, $strings);\n\t\t\t}\n\t\t}\n\n\t\treturn $talents;\n\t}",
"public function skills()\n {\n return $this->skills;\n }",
"public function skills(){\n return $this->skills;\n }",
"public function skills()\n {\n return $this->hasMany(Skill::class);\n }",
"function getCombatByHeroId($id) {\n $retValue = false;\n $sql = sprintf(\"SELECT k.id, k.name, k.wert_def, hk.wert\n FROM kampf AS k\n LEFT JOIN held_kampf AS hk ON k.id = hk.id_kampf\n AND hk.id_held = %d;\",\n mysql_real_escape_string($id));\n return $this->queryDB($sql);\n }",
"public function skills()\n {\n return $this->hasManyThrough(Skill::class, Profile::class)\n ->select(['skills.id', 'expertise AS group', 'description'])\n ->where('is_group', true);\n }",
"public function getAllSkills()\n {\n $skills = Skill::all();\n\n return response()->json($skills, 200);\n }",
"function load_skills($char_id)\n{\n global $link;\n $the_skills = [];\n $player_id = intval($_SESSION['id']);\n if ($char_id > 0) {\n $query = <<<EOQ\n SELECT \n `skill`.`id` as 'skill_id',\n `skill`.`name` as 'skill_name',\n `skill`.`value` as 'skill_value',\n `skill`.`ticks` as 'skill_ticks',\n `specialty`.`id` as 'specialty_id',\n `specialty`.`name` as 'specialty_name',\n `specialty`.`value` as 'specialty_value'\n FROM `skill`\n INNER JOIN `character` ON (`character`.`id` = `skill`.`parent`)\n INNER JOIN `player` ON (`player`.`id` = `character`.`player`)\n LEFT OUTER JOIN `specialty` ON (`specialty`.`parent` = `skill`.`id`)\n WHERE `skill`.`parent` = '$char_id'\n AND `player`.`id` = '$player_id'\n ORDER BY `skill`.`id` ASC\nEOQ;\n $result = $link->query($query) or die (\"Query \".$query.\" failed!\". $link->error);\n while ($row = $result->fetch_assoc()) {\n $skill_id = $row['skill_id'];\n if (! array_key_exists($skill_id, $the_skills)) {\n $skill_data = [\n 'id' => intval($skill_id),\n 'name' => htmlenc($row['skill_name'] ),\n 'value' => intval($row['skill_value']),\n 'ticks' => intval($row['skill_ticks']),\n 'specialties' => []\n ];\n $the_skills[$skill_id] = $skill_data;\n }\n if ($row['specialty_name'] !== NULL) {\n $the_skills[$skill_id]['specialties'][] = [\n 'id' => intval($row['specialty_id']),\n 'name' => htmlenc($row['specialty_name'] ),\n 'value' => intval($row['specialty_value'])\n ];\n }\n }\n $result->free();\n }\n return $the_skills;\n}",
"public function getSkills()\n {\n return $this->_db->select(\"SELECT * FROM `skills`\");\n }",
"public function appendHeroSkills($value)\n {\n return $this->append(self::HERO_SKILLS, $value);\n }",
"public function get_skills($club_id)\n {\n $skills = Skill::select(\n DB::raw('SQL_CALC_FOUND_ROWS skill.skill_id'),\n 'skill.title',\n 'skill_category.title AS category',\n 'skill.category_id'\n )\n ->leftJoin('skill_category', 'skill.category_id', '=', 'skill_category.category_id')\n ->where('skill.franchise_id', $this->franchise_id)\n ->where('skill.club_id', $club_id)\n ->orderBy('skill_category.category_id')\n ->orderBy('skill.title')\n ->get();\n\n //count the results so we can use them in pagination\n $requestsCount = DB::select(DB::raw(\"SELECT FOUND_ROWS() AS count;\"));\n $count = reset($requestsCount)->count;\n return format_response($skills, $count, NULL);\n }",
"public function getSkills() {\n return $this->skills;\n }",
"public function skills()\n {\n return $this->hasMany(Skills::class, 'applicant_id', 'id');\n }",
"public function getSkills()\n {\n return $this->skills;\n }",
"function getSkills() {\n \n $select = \"SELECT * FROM skills\";\n $res = $this->pdo->query($select);\n return $res->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getHero()\n {\n return Hero::where('name', $this->hero)\n ->with('lmbAbility', 'rmbAbility', 'fAbility', 'qAbility', 'eAbility', 'getTalent1', 'getTalent2', 'getTalent3')\n ->first();\n }",
"public function skills()\n\t{\n\t\treturn $this->hasMany('App\\Skill');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Agency is new, it will return an empty collection; or if this Agency has previously been saved, it will retrieve related MissionsRelatedByAgencyId from storage. This method is protected by default in order to keep the public api reasonable. You can provide public methods for those you actually need in Agency. | public function getMissionsRelatedByAgencyIdJoinCamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
if ($criteria === null) {
$criteria = new Criteria(AgencyPeer::DATABASE_NAME);
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collMissionsRelatedByAgencyId === null) {
if ($this->isNew()) {
$this->collMissionsRelatedByAgencyId = array();
} else {
$criteria->add(MissionPeer::AGENCY_ID, $this->id);
$this->collMissionsRelatedByAgencyId = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
}
} else {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(MissionPeer::AGENCY_ID, $this->id);
if (!isset($this->lastMissionRelatedByAgencyIdCriteria) || !$this->lastMissionRelatedByAgencyIdCriteria->equals($criteria)) {
$this->collMissionsRelatedByAgencyId = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
}
}
$this->lastMissionRelatedByAgencyIdCriteria = $criteria;
return $this->collMissionsRelatedByAgencyId;
} | [
"public function agency()\n {\n return $this->belongsTo(Agency::class);\n }",
"public function agency()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_AgencyPersoninfoId_FK')->withDefault();\n }",
"public function getAgency(PropelPDO $con = null)\n\t{\n\t\tif ($this->aAgency === null && ($this->agency_id !== null)) {\n\t\t\t$c = new Criteria(AgencyPeer::DATABASE_NAME);\n\t\t\t$c->add(AgencyPeer::ID, $this->agency_id);\n\t\t\t$this->aAgency = AgencyPeer::doSelectOne($c, $con);\n\t\t\t/* The following can be used additionally to\n\t\t\t guarantee the related object contains a reference\n\t\t\t to this object. This level of coupling may, however, be\n\t\t\t undesirable since it could result in an only partially populated collection\n\t\t\t in the referenced object.\n\t\t\t $this->aAgency->addRequesters($this);\n\t\t\t */\n\t\t}\n\t\treturn $this->aAgency;\n\t}",
"public function getMissionsRelatedByOtherAgencyId($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(AgencyPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collMissionsRelatedByOtherAgencyId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collMissionsRelatedByOtherAgencyId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);\n\n\t\t\t\tMissionPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);\n\n\t\t\t\tMissionPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastMissionRelatedByOtherAgencyIdCriteria) || !$this->lastMissionRelatedByOtherAgencyIdCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastMissionRelatedByOtherAgencyIdCriteria = $criteria;\n\t\treturn $this->collMissionsRelatedByOtherAgencyId;\n\t}",
"private function goals_collection() {\n if (is_null($this->goals_collection)) {\n $this->goals_collection = new GoalsCollection($this->name, $this->goals);\n }\n\n return $this->goals_collection;\n }",
"public function all()\n {\n return new AgenceCollection($this->Agence->all());\n }",
"public function getAgenciesUsed()\n {\n return $this\n ->hasMany(Agency::class, ['owner_id' => 'id'])\n ->viaTable('{{%tours}}', ['agency_id' => 'id']);\n }",
"public function agents(){\n\n return $this->hasMany('App\\Agent', 'agency_id', 'id');\n\n\n }",
"public function getMissionsRelatedByAgencyIdJoinMissionType($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(AgencyPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collMissionsRelatedByAgencyId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t\t$this->collMissionsRelatedByAgencyId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(MissionPeer::AGENCY_ID, $this->id);\n\n\t\t\t\t$this->collMissionsRelatedByAgencyId = MissionPeer::doSelectJoinMissionType($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t} else {\n\t\t\t// the following code is to determine if a new query is\n\t\t\t// called for. If the criteria is the same as the last\n\t\t\t// one, just return the collection.\n\n\t\t\t$criteria->add(MissionPeer::AGENCY_ID, $this->id);\n\n\t\t\tif (!isset($this->lastMissionRelatedByAgencyIdCriteria) || !$this->lastMissionRelatedByAgencyIdCriteria->equals($criteria)) {\n\t\t\t\t$this->collMissionsRelatedByAgencyId = MissionPeer::doSelectJoinMissionType($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t}\n\t\t$this->lastMissionRelatedByAgencyIdCriteria = $criteria;\n\n\t\treturn $this->collMissionsRelatedByAgencyId;\n\t}",
"protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_docwise/exam_collection');\n if ($this->getDocwisement()->getId()) {\n $constraint = 'related.docwisement_id='.$this->getDocwisement()->getId();\n } else {\n $constraint = 'related.docwisement_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_docwise/exam_docwisement')),\n 'related.exam_id=main_table.entity_id AND '.$constraint,\n array('position')\n );\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }",
"public function getMissionsRelatedByOtherAgencyIdJoinItinerary($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(AgencyPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collMissionsRelatedByOtherAgencyId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t\t$this->collMissionsRelatedByOtherAgencyId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);\n\n\t\t\t\t$this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelectJoinItinerary($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t} else {\n\t\t\t// the following code is to determine if a new query is\n\t\t\t// called for. If the criteria is the same as the last\n\t\t\t// one, just return the collection.\n\n\t\t\t$criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);\n\n\t\t\tif (!isset($this->lastMissionRelatedByOtherAgencyIdCriteria) || !$this->lastMissionRelatedByOtherAgencyIdCriteria->equals($criteria)) {\n\t\t\t\t$this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelectJoinItinerary($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t}\n\t\t$this->lastMissionRelatedByOtherAgencyIdCriteria = $criteria;\n\n\t\treturn $this->collMissionsRelatedByOtherAgencyId;\n\t}",
"protected function fetchAgencyCoreQuery(): PhysicianCollection\n {\n $token = Identity::rawToken();\n $url = resolve('AgencyCoreApiService')->url($slug = \"patient-physicians/{$this->getParam('patientId')}\");\n\n $response = Http::withToken($token)->get($url);\n\n if ($response->failed()) {\n throw new EmrApiException('Failed to fetch Physicians from Home Health');\n }\n\n $physicians = array_map(fn($physician) => PhysicianPayload::fromHomeHealthApi($physician), $response->object());\n\n return new PhysicianCollection(...$physicians);\n }",
"public function initMissionsRelatedByOtherAgencyId()\n\t{\n\t\t$this->collMissionsRelatedByOtherAgencyId = array();\n\t}",
"public function Organisations($actionCode = null) {\n\t\treturn parent::related($actionCode);\n\t}",
"public function addCollectorGeocache(CollectorGeocache $l)\n {\n if ($this->collCollectorGeocaches === null)\n {\n $this->initCollectorGeocaches();\n }\n if (!$this->collCollectorGeocaches->contains($l)) { // only add it if the **same** object is not already associated\n $this->doAddCollectorGeocache($l);\n }\n\n return $this;\n }",
"public function getAreaCollectionObject()\n {\n /** @var Concrete\\Core\\Area\\Area $instance */\n return $instance->getAreaCollectionObject();\n }",
"public function agents()\n\t{\n\t\t// a business can have many agents\n\t\treturn $this->belongsToMany( Agent::class );\n\t}",
"public function getAgencyOffers($agency_id){\r\n return Property::find()->where(['user_id' => $agency_id])->orderBy(['id' => SORT_DESC])->all();\r\n }",
"public function getCollection0()\n {\n return $this->hasOne(Collection::className(), ['id' => 'collection']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All his parents and himself | public function getParentsAndYou()
{
return $this->getParentsRecursive($this, []);
} | [
"public function getAllParents();",
"public function getAllParentsWhichHaveAChildren();",
"public function getParents();",
"public function getParents() {\n return $this->parents;\n }",
"public function getParents()\n {\n return $this->newQuery()->parents()->get();\n }",
"public static function parentsList()\n {\n return self::parents()->pluck('title', 'id')->toArray();\n }",
"public function\tgetParents() {\n $cast = $this;\n do {\n $par = $cast->par;\n if (!empty($par))\n\t$parents[] = $par;\n $cast = $cast->par;\n } while (!empty($par));\n if (empty($parents))\n return $parents;\n return array_reverse($parents);\n }",
"public function getAllParents()\n {\n $parents = array();\n\n $parent = $this;\n\n while ($parent = $parent->getParent()) {\n $parents[] = $parent;\n }\n\n return $parents;\n }",
"public function getParents() {\n\n return $this->_mappedAccounts->get('parents.', array());\n\n }",
"public static function parents()\n {\n return self::whereRaw('(parent_id is NULL OR parent_id = 0)')\n ->orderBy('title')\n ->get();\n }",
"public function getParents()\n {\n $parents = array();\n for ($x = $this; $x['id_parent'] != null; $x = $x->getParent()) {\n array_unshift($parents, $x);\n }\n\n return $parents; //TODO find cycles in structure?\n }",
"public function getAncestors();",
"public function get_parents() {\n\t\t$list = [];\n\t\t$temp = $this;\n\t\tfor ($i = 0; $i < 100 && $temp->parent_category; $i++) {\n\t\t\t$list[] = $temp->parent_category;\n\t\t\t$temp = $temp->parent_category;\n\t\t}\n\t\treturn $list;\n\t}",
"public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}",
"public function getParents()\n {\n if (!isset($this->_objects['Parents'])) {\n $this->_objects['Parents'] = $this->_getRepository()->fetchParents($this->id);\n }\n\n return $this->_objects['Parents'];\n }",
"public function getParents() {\r\n return $this->getParentsMP();\r\n }",
"public function ancestors()\n\t{\n\t\t$parents = $this->parents()->get();\n\t\t\n\t\tfor ($i = 0; $i < $parents->count(); $i++)\n\t\t{\n\t\t\t$parent = $parents[$i];\n\t\t\tif ($parent->parents->count() > 0)\n\t\t\t{\n\t\t\t\t$parents = $parents->merge($parent->parents()->get());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $parents->unique();\n\t}",
"public function allWithParent()\n {\n return $this->section->with('parent')->get();\n }",
"public function getAllChildrenAndSelf()\n {\n return $this->newQuery()->allChildren(true)->get();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a message object based on the name of the message | public function getMessage($message)
{
$c = $this->config->getMessageClass($message);
$message_object = $this->createMessage($c);
$message_object->setSource($this->config->getMessageSource($message));
$message_object->setDestination($this->config->getMessageDestination($message));
return $message_object;
} | [
"protected function createMessage()\n {\n return new Message();\n }",
"public function createMessage()\n {\n return new Message();\n }",
"public function createMessage();",
"protected function createMailMessage()\n {\n return $this->objectManager->get(MailMessage::class);\n }",
"protected function createMessage() {\n\t\t$message = new Message( new Swift_Message );\n\n\t\t// If a global from address has been specified we will set it on every message\n\t\t// instances so the developer does not have to repeat themselves every time\n\t\t// they create a new message. We will just go ahead and push the address.\n\t\tif ( isset( $this->from['address'] ) ) {\n\t\t\t$message->from( $this->from['address'], $this->from['name'] );\n\t\t}\n\n\t\treturn $message;\n\t}",
"public static function getMessage($code) {\n \n if(isset(self::$messages[$code])) {\n return new Message(self::$messages[$code]);\n //return (Object)(self::$messages[$code]);\n } else if (Msg::getMessage($code)) {\n return Msg::getMessage($code);\n } else {\n return new Message();\n }\n \n \n }",
"public function getMessageName()\n {\n return $this->messageName();\n }",
"public function getMessageInstance()\n {\n try {\n $message = ($this->tokenizationEnabled) ? MauticMessage::newInstance() : \\Swift_Message::newInstance();\n\n return $message;\n } catch (\\Exception $e) {\n $this->logError($e);\n\n return false;\n }\n }",
"protected function createMessage()\n {\n $message = new SesMessage();\n\n // If a global from address has been specified we will set it on every message\n // instances so the developer does not have to repeat themselves every time\n // they create a new message. We will just go ahead and push the address.\n if (isset($this->from['address']))\n {\n $message->from($this->from['address'], $this->from['name']);\n }\n\n return $message;\n }",
"public function newMessage()\n {\n return new Message(\n $this->getHeaderFactory()\n );\n }",
"public function originalMessage()\n {\n try {\n return Message::findByHash($this->request->target());\n } catch (Exception $e) {\n //\n }\n }",
"public function getMessageFactory() : MessageFactory;",
"public function getMessageFactory();",
"private function lookUpMessageName()\n\t{\n\t\tglobal\t$dbConnection;\n\n\t\t$sql = \"SELECT name FROM mailmessages WHERE id=$this->id\";\n\t\t$result = mysqli_query($dbConnection, $sql)\n\t\t\tor die(\"Look up message error \" . mysqli_error($dbConnection) . \" $sql\");\n\t\t$record = mysqli_fetch_array($result);\n\t\t$this->messageName = $record['name'];\n\t\tmysqli_free_result($result);\n\t}",
"public function createMessage(): MessageInterface\n {\n $class = $this->getClass();\n\n if (!$class || !class_exists($class)) {\n throw new InvalidMessageClassException(sprintf(\n 'Could not create message of given class `%s`', $class\n ));\n }\n\n $message = new $class();\n $message->setType($this);\n\n // apply default values\n foreach ($this->getDefaultValues() as $name => $v) {\n $fname = 'set'.ucfirst($name);\n\n if (method_exists($message, $fname)) {\n $message->$fname($v);\n }\n }\n\n return $message;\n }",
"public function get_message_template( $name ) {\n\n\t\tif ( ! isset( $this->message_templates[ $name ] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->message_templates[ $name ];\n\t}",
"public function translate(AMQPMessage $msg): BickMessageInterface;",
"public function getMessFromName ()\n {\n return $this->mess_from_name;\n }",
"abstract protected function getBuiltMessage();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that cancelling an expression from a rule works. | public function testCancelExpressionInRule() {
// Setup a rule with one condition.
$this->testCreateReactionRule();
$this->clickLink('Add condition');
$this->fillField('Condition', 'rules_node_is_promoted');
$this->pressButton('Continue');
$this->fillField('context_definitions[node][setting]', 'node');
$this->pressButton('Save');
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
$assert->pageTextContains('You have unsaved changes.');
// Edit and cancel.
$this->pressButton('Cancel');
$assert->pageTextContains('Canceled.');
// Make sure that we are back at the overview listing page.
$this->assertEquals(1, preg_match('#/admin/config/workflow/rules$#', $this->getSession()->getCurrentUrl()));
} | [
"public function testCancelExpressionInRule() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n $this->clickLink('Add condition');\n $this->fillField('Condition', 'rules_node_is_promoted');\n $this->pressButton('Continue');\n\n $this->fillField('context[node][setting]', '1');\n $this->pressButton('Save');\n\n /** @var \\Drupal\\Tests\\WebAssert $assert */\n $assert = $this->assertSession();\n $assert->pageTextContains('You have unsaved changes.');\n\n // Edit and cancel.\n $this->pressButton('Cancel');\n $assert->pageTextContains('Canceled.');\n\n // Make sure that we are back at the overview listing page.\n $this->assertEquals(1, preg_match('#/admin/config/workflow/rules$#', $this->getSession()->getCurrentUrl()));\n }",
"public function testCancelSettleLater()\n {\n }",
"function testCancelDropRule()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Drop the rule\r\n\t\t$this->assertTrue($this->get(\"$webUrl/rules.php\", array(\r\n 'server' => $SERVER,\r\n\t\t\t'action' => 'confirm_drop',\r\n\t\t\t'database' => $DATABASE,\r\n\t\t\t'schema' => 'public',\r\n\t\t\t'reltype' => 'table',\r\n\t\t\t'table' => 'student',\r\n\t\t\t'subject' => 'rule',\r\n\t\t\t'rule' => 'insert_stu_rule'))\r\n\t\t);\r\n $this->assertTrue($this->clickSubmit($lang['strno']));\r\n \r\n return TRUE;\r\n }",
"public function testCancelAllDunningPending()\n {\n }",
"public function testCancelReminder()\n {\n extract($this->defaults);\n $name = 'reminder1';\n $event = $this->getEvent(['start', $name]);\n $queue = Phake::mock('\\Phergie\\Irc\\Bot\\React\\EventQueueInterface');\n $this->assertTrue(empty($this->plugin->activeTimers));\n $this->plugin->startReminder($event, $queue);\n $this->assertTrue(array_key_exists($name, $this->plugin->activeTimers[$nick]));\n $event = $this->getEvent(['cancel', $name]);\n $this->plugin->cancelReminder($event, $queue);\n $this->assertFalse(isset($this->plugin->activeTimers[$nick][$name]));\n }",
"public function testCancelForOrder()\n {\n /** @var CaseRepositoryInterface $caseRepository */\n $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class);\n $caseEntity = $caseRepository->getByCaseId(self::$caseId);\n\n $this->gateway->expects(self::once())\n ->method('cancelGuarantee')\n ->with(self::equalTo(self::$caseId))\n ->willReturn(CaseInterface::GUARANTEE_CANCELED);\n\n $this->logger->expects(self::never())\n ->method('error');\n\n $result = $this->service->cancelForOrder($caseEntity->getOrderId());\n self::assertTrue($result);\n\n $updatedCase = $caseRepository->getByCaseId(self::$caseId);\n self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $updatedCase->getGuaranteeDisposition());\n\n /** @var OrderRepositoryInterface $orderRepository */\n $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class);\n $order = $orderRepository->get($updatedCase->getOrderId());\n $histories = $order->getStatusHistories();\n self::assertNotEmpty($histories);\n\n /** @var OrderStatusHistoryInterface $caseCreationComment */\n $caseCreationComment = array_pop($histories);\n self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment);\n self::assertEquals('Case Update: Case guarantee has been cancelled.', $caseCreationComment->getComment());\n }",
"public function test_cancel_canceled_ticket()\n {\n $ticket_id = $this->model->generateTicketId();\n $ticket_model = Model::getModel('App\\Josel\\Models\\Ticket');\n $ticket_model->getObjects()->setData(array(\n 'ticket_id' => $ticket_id,\n 'state' => $ticket_model::STATE_CANCELED,\n ));\n $ticket_model->save();\n\n $_SERVER[\"REQUEST_URI\"] = self::CANCEL_URL;\n $_GET['ticket_id'] = $ticket_id;\n $this->request = new Request();\n $response = $this->controler->cancel($this->request);\n $this->assertEquals(403, http_response_code());\n $this->assertEquals($response['success'], false);\n $this->assertEquals($response['message'], \"ERROR: ticket $ticket_id not cancelable\");\n }",
"public function testDeleteExpressionInRule() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n $this->clickLink('Delete');\n\n /** @var \\Drupal\\Tests\\WebAssert $assert */\n $assert = $this->assertSession();\n $assert->pageTextContains('Are you sure you want to delete Condition: Node is promoted from Test rule?');\n\n $this->pressButton('Delete');\n $assert->pageTextContains('You have unsaved changes.');\n\n $this->pressButton('Save');\n $assert->pageTextContains('Reaction rule Test rule has been updated. ');\n }",
"public function testCanceledOrderNotification()\n {\n $order = new ChainOfResponsibility\\Order(34541, 'Denzel', 'Washington');\n $order->setStatus(ChainOfResponsibility\\Order::ORDER_STATUS_CANCELED);\n\n $this->assertSame('', $this->chainOfResponsibility->handleOrder($order));\n }",
"public function testExecuteUnableToCancelOrder()\n {\n $params = [\n 'brq_ordernumber' => null,\n 'brq_invoicenumber' => null,\n 'brq_statuscode' => null\n ];\n\n $this->request->shouldReceive('getParams')->andReturn($params);\n\n $this->configProviderFactory->shouldReceive('getFailureRedirect')->andReturn('failure_url');\n $this->configProviderFactory->shouldReceive('getCancelOnFailed')->andReturn(true);\n\n $this->cart->shouldReceive('setQuote')->once()->andReturnSelf();\n $this->cart->shouldReceive('save')->once()->andReturn(true);\n\n $payment = $this->getFakeMock(Payment::class)\n ->setMethods(['getMethodInstance', 'canProcessPostData'])\n ->getMock();\n $payment->expects($this->atLeastOnce())->method('getMethodInstance')->willReturnSelf();\n $payment->expects($this->once())->method('canProcessPostData')->with($payment, $params)->willReturn(true);\n\n $this->order->makePartial();\n $this->order->shouldReceive('loadByIncrementId')->with(null)->andReturnSelf();\n $this->order->shouldReceive('getId')->andReturnNull();\n $this->order->shouldReceive('canCancel')->once()->andReturn(false);\n $this->order->shouldReceive('getStore')->andReturnSelf();\n $this->order->shouldReceive('getPayment')->andReturn($payment);\n\n $this->messageManager->shouldReceive('addErrorMessage');\n\n $this->redirect->shouldReceive('redirect')->once()->with(\\Mockery::any(), 'failure_url', []);\n\n $this->controller->execute();\n\n if ($container = \\Mockery::getContainer()) {\n $this->addToAssertionCount($container->mockery_getExpectationCount());\n }\n }",
"public function testEvaluationBadOperation()\n {\n $rule = new Rule(array(), 'PHP');\n $rule->setTest(array(\n 'key' => 'foo',\n 'operation' => 'badop',\n 'value' => '1'\n ));\n $ini = array();\n $result = $rule->evaluate($ini);\n }",
"protected function _cancelOperation(){ }",
"public function cancel() {\n\t\treturn PaymentResult::newFailure();\n\t}",
"public function testRuleSuppressorFalse()\n {\n $rule = $this->getMockBuilder('izzum\\rules\\Rule')\n ->disableOriginalConstructor()\n ->setMethods(array('_applies'))\n ->getMock();\n\n $rule->expects($this->once())\n ->method('_applies')\n ->will($this->throwException(new Exception('not good')));\n\n $supressedrule = new izzum\\rules\\ExceptionSupressor($rule, false);\n $this->assertFalse($supressedrule->applies());\n }",
"public function testNegatedCondition() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n /** @var \\Drupal\\Tests\\WebAssert $assert */\n $assert = $this->assertSession();\n // Check that the label shows up on the Rule edit page.\n $assert->pageTextContains('Condition: Node is promoted');\n\n // Edit the condition, negate it, then check the label again.\n $this->clickLink('Edit');\n $this->fillField('Negate', 1);\n $this->pressButton('Save');\n $assert->pageTextContains('Condition: NOT Node is promoted');\n }",
"public function testCancelReport()\n {\n }",
"public function testDeleteExpressionInRule() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n /** @var \\Drupal\\Tests\\WebAssert $assert */\n $assert = $this->assertSession();\n\n $this->clickLink('Delete');\n $assert->pageTextContains('Are you sure you want to delete Node is promoted from Test rule?');\n\n $this->pressButton('Delete');\n $assert->pageTextContains('You have unsaved changes.');\n\n $this->pressButton('Save');\n $assert->pageTextContains('Reaction rule Test rule has been updated. ');\n }",
"public function is_cancelled() {\n }",
"public function testNoContextCondition() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n $this->clickLink('Add condition');\n // The rules_test_true condition does not define context in its annotation.\n $this->fillField('Condition', 'rules_test_true');\n $this->pressButton('Continue');\n // Pressing 'Save' will generate an exception and the test will fail if\n // Rules does not support conditions without a context.\n // Exception: Warning: Invalid argument supplied for foreach().\n $this->pressButton('Save');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the service container. The cached version of the service container is used when fresh, otherwise the container is built. | protected function initializeContainer()
{
$class = $this->getContainerClass();
$cache = new ConfigCache($this->getCacheDir().'/symfony/'.$class.'.php', $this->debug);
$fresh = true;
if (!$cache->isFresh()) {
$container = $this->buildContainer();
$container->register('novice.cache', $this->getCacheClass());
$container->compile();
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
$fresh = false;
}
require_once $cache->getPath();
$this->container = new $class();
$this->container->set('app', $this);
if (!$fresh && $this->container->has('cache_warmer')) {
$this->container->get('cache_warmer')->warmUp($this->container->getParameter('app.cache_dir'));
}
} | [
"protected function initializeContainer()\n {\n $this->container = $this->buildContainer();\n\n // Load all the default services\n $this->getContainerLoader($this->container)->load('services.xml');\n\n $this->container->compile();\n }",
"protected function initializeContainer()\n {\n $class = $this->getContainerClass();\n $cache = new ConfigCache($this->getCacheDir() . '/' . $class . '.php', $this->debug);\n $fresh = true;\n if (!$cache->isFresh()) {\n $container = $this->buildContainer();\n $container->compile();\n $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());\n\n $fresh = false;\n }\n\n require_once $cache;\n\n $this->container = new $class();\n $this->container->set('kernel', $this);\n\n $this->container->set('dispatcher', new EventDispatcher());\n $this->container->set('sugar_manager', new \\Insulin\\Sugar\\Manager());\n\n if (!$fresh && $this->container->has('cache_warmer')) {\n $this->container->get('cache_warmer')->warmUp(\n $this->container->getParameter('kernel.cache_dir')\n );\n }\n }",
"private function initializeContainer()\n {\n $containerClass = $this->getContainerClass();\n \n $alwaysCheckCache = true;\n $cache = new ConfigCache($this->getCacheDir() . '/' . $containerClass . '.php', $alwaysCheckCache);\n if ( ! $cache->isFresh()) {\n $container = $this->buildContainer();\n $container->compile();\n $this->dumpContainer($cache, $container, $containerClass);\n }\n require_once $cache->getPath();\n $this->container = new $containerClass();\n $this->container->set('disqontrol', $this);\n $configFactory = $this->container->get('configuration_factory');\n $configFactory->setConfigArray($this->configParams);\n }",
"protected function initializeContainer()\n {\n $this->container = $this->buildContainer();\n $this->useSymfonizeRoutes();\n $this->container->compile();\n// $class = $this->getContainerClass();\n// $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);\n// $fresh = true;\n// if (!$cache->isFresh()) {\n// $container = $this->buildContainer();\n// $container->compile();\n// $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());\n//\n// $fresh = false;\n// }\n\n// require_once $cache->getPath();\n//\n// $this->container = new $class();\n// $this->container=$container;\n $this->container->set('kernel', $this);\n//\n// if (!$fresh && $this->container->has('cache_warmer')) {\n// $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));\n// }\n }",
"public function initializeContainer() {\n if ($this->container !== null)\n return;\n\n $this->container = ContainerSingleton::getInstance();\n $this->container->setParameter(\"service_container\", $this->container);\n $this->container->setParameter(\"root_dir\", $this->getRootDir());\n $this->container->setParameter(\"env\", $this->getEnvironment());\n $this->container->setParameter(\"router\")\n // Registering providers\n $providers = $this->registerProviders();\n foreach ($providers as $provider) {\n if ($provider instanceof AbstractProvider) {\n $this->providers[] = $provider;\n $provider->init();\n $provider->inject($this->container);\n }\n }\n }",
"protected function initializeContainer()\n {\n if ($this->isDebug() && sfConfig::get('sf_logging_enabled'))\n {\n $timer = sfTimerManager::getTimer('Factories');\n }\n\n $class = $this->getContainerClass();\n $cache = new ConfigCache(sfConfig::get('sf_config_cache_dir') . '/' . $class . '.php', $this->debug);\n\n $fresh = true;\n if (!$cache->isFresh())\n {\n $container = $this->buildContainer();\n $container->compile();\n $this->dumpContainer($cache, $container);\n\n $fresh = false;\n }\n\n require_once $cache->getPath();\n\n $this->container = new $class();\n\n $this->container->set('sf_event_dispatcher', $this->getEventDispatcher());\n $this->container->set('sf_application_configuration', $this);\n\n\n //if (!$fresh && $this->container->has('cache_warmer'))\n //{\n // $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));\n //}\n\n if (isset($timer))\n {\n $timer->addTime();\n }\n }",
"protected function initializeContainer()\n {\n $customClass = $this->getCustomContainerClass();\n $baseClass = $this->getContainerClass();\n $customCache = new ConfigCache($this->getCacheDir().'/'.$customClass.'.php', $this->debug);\n $baseCache = new ConfigCache($this->getCacheDir().'/'.$baseClass.'.php', $this->debug);\n $fresh = true;\n if (!$baseCache->isFresh() || !$customCache->isFresh()) {\n $container = $this->buildContainer();\n if (!$container->hasParameter('jihel.plugin.dynamic_parameter.table_prefix')) {\n $container->setParameter('jihel.plugin.dynamic_parameter.table_prefix', 'jihel_');\n }\n $container->compile();\n $this->dumpContainer($baseCache, $container, $baseClass, $this->getContainerBaseClass());\n $this->dumpCustomContainer($customCache, $container, $baseClass);\n\n $fresh = false;\n }\n\n require_once $baseCache;\n require_once $customCache;\n\n $this->container = new $customClass();\n $this->container->set('kernel', $this);\n\n if (!$fresh && $this->container->has('cache_warmer')) {\n $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));\n }\n }",
"protected static function instantiateServiceContainer() : void\n {\n $container = Container::getInstance();\n\n if (!$container) {\n $container = new Container();\n Container::setInstance($container);\n }\n\n static::$container = $container;\n }",
"public function initializeServiceContainer(sfEvent $event)\n {\n\n $application = sfConfig::get('sf_app');\n $debug = sfConfig::get('sf_debug');\n $environment = sfConfig::get('sf_environment');\n $name = 'Project'.md5($application.$debug.$environment).'ServiceContainer';\n $file = sfConfig::get('sf_app_cache_dir') . '/' . $name.'.php';\n\n if (!$debug && file_exists($file))\n {\n require_once $file;\n $sc = new $name();\n }\n else\n {\n $sc = self::createServiceContainer($environment);\n $this->dispatcher->notify(new sfEvent($this->serviceContainer, 'service_container.load_configuration'));\n\n if (!$debug)\n {\n $dumper = new sfServiceContainerDumperPhp($sc);\n\n file_put_contents($file, $dumper->dump(array('class' => $name)));\n }\n }\n $this->serviceContainer = $sc;\n $this->dispatcher->notify(new sfEvent($this->serviceContainer, 'service_container.post_initialize'));\n }",
"public function init()\n {\n // initialize the service class\n $this->service = $this->newService('AppserverIo\\Appserver\\Core\\Api\\ContainerService');\n\n //We will check the distribution type by it's release file, as we have problems doing so using php_uname('s').\n //These mappings are for the most common platforms. If others are needed see the link below\n //@link http://linuxmafia.com/faq/Admin/release-files.html\n $this->distroMapping = array(\n \"Arch\" => \"arch-release\",\n \"Debian\" => \"debian_version\",\n \"Fedora\" => \"fedora-release\",\n \"Ubuntu\" => \"lsb-release\",\n 'Redhat' => 'redhat-release',\n 'CentOS' => 'centos-release'\n );\n\n // initialize the available restart commands\n $this->restartCommands = array(\n DeploymentScanner::DARWIN => DeploymentScanner::LAUNCHD_INIT_STRING,\n DeploymentScanner::WINDOWS_NT => DeploymentScanner::WIN_NT_INIT_STRING,\n 'Debian' . DeploymentScanner::LINUX => DeploymentScanner::SYSTEMV_INIT_STRING,\n 'Ubuntu' . DeploymentScanner::LINUX => DeploymentScanner::SYSTEMV_INIT_STRING,\n 'CentOS' . DeploymentScanner::LINUX => DeploymentScanner::SYSTEMV_INIT_STRING,\n 'Fedora' . DeploymentScanner::LINUX => DeploymentScanner::SYSTEMD_INIT_STRING\n );\n }",
"private function initContainer()\n {\n $cacheDirectory = new CacheDirectoryProvider(\n _PS_VERSION_,\n _PS_ROOT_DIR_,\n _PS_MODE_DEV_\n );\n $containerProvider = new ContainerProvider($this->moduleName, $this->moduleLocalPath, $cacheDirectory);\n\n $this->container = $containerProvider->get(defined('_PS_ADMIN_DIR_') || defined('PS_INSTALLATION_IN_PROGRESS') ? 'admin' : 'front');\n }",
"protected function initContainer()\n {\n $this->container->setScalars(array(\n 'rootFolder' => $this->getApplication()->getProjectFolder(),\n 'logFolder' => $this->getApplication()->getProjectFolder().'/var/log',\n 'logName' => 'console',\n 'logLevel' => LogLevel::DEBUG,\n ));\n\n // By setting to the debug mode we ignore the cached config\n $this->container->defineSingletonWithInterface(Configuration::class, ConfigurationFactory::class, array('debug' => true));\n\n $this->container->defineSingletonWithInterface(\n LoggerInterface::class, CommonLoggerFactory::class);\n }",
"protected function _initServices(){\n $services = ServicesApplication::initializeServices(null, $this->getConfig());\n $this->setDI($services->getDI());\n }",
"protected function _initialize()\n {\n \t// initialize the container configuration\n \t$this->_containerConfiguration->initialize($this->getCache());\n \t// load the beans and the plugins from the configuration\n \t$this->_setEntities($this->_containerConfiguration->getEntities());\n \t$this->_setPlugins($this->_containerConfiguration->getPlugins());\n }",
"protected function prepareContainer()\n {\n $this -> container\n -> set('app', new InstanceService($this))\n -> set('config', new InstanceService($this -> config));\n }",
"protected function initializeSystemContainerServices() : void\n {\n $this->initSystemServices(\\dirname(__DIR__));\n }",
"public static function init()\n {\n if (!file_exists(self::SERVICE_FILE)) {\n throw new ContainerException('ServiceContainer configuration file \\'services.json\\' doesn\\'t exist');\n }\n if (!$services = json_decode(file_get_contents(self::SERVICE_FILE), true)) {\n throw new ContainerException('ServiceContainer configuration file \\'services.json\\' badly formated');\n }\n foreach ($services as $name => $serviceArray) {\n if (!isset($serviceArray['class'])) {\n continue;\n }\n self::$serviceCollection[$name] = self::instanciate($serviceArray);\n }\n }",
"protected function init()\n {\n //creamos la instancia del AppContext\n $context = new AppContext($this->request, $this->production, $this->getAppPath(), $this->routes, $this->namespaces);\n //leemos la config de la app\n $config = new ConfigReader($context);\n //iniciamos el container con esa config\n $this->initContainer($config->getConfig());\n //asignamos el kernel al container como un servicio\n self::$container->set('app.kernel', $this);\n //iniciamos el dispatcher con esa config\n $this->initDispatcher($config->getConfig());\n\n //seteamos el contexto de la aplicación como servicio\n self::$container->set('app.context', $context);\n //le asignamos el servicio session al request\n $this->request->setSession(self::$container->get('session'));\n $this->request->setAppContext($context);\n\n //agregamos el request al container\n self::$container->set('request', $this->request);\n\n }",
"protected function initService()\n {\n return $this->service = Service\\Container::getInstance()->getService($this->config['service']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import one student's transcripts | public function importTranscripts($id){} | [
"public function importTranslations(array $langcodes);",
"public function exportTranscripts($id){}",
"public function load_import_transaction_editor( ){\n\t//\techo \"This is the student import editor!\";\n\t\n\t\tif ( ! current_user_can( 'create_users' ) )\n\t\t\twp_die('You do not have sufficient permissions to access this page.' );\t\t\t\n\t\t\t\n\t\t//print_pre($_REQUEST);\t\n\t\t\n\t\tself::nb_admin_header( \"Batch Import Student Transactions\" );\n\t\t\n\t\t//First check to see if we have something to display for review.\n \t\tif ( isset( $_POST['humming-birds-and-bees'] ) ) {\n\t\t\tcheck_admin_referer( 'import_prep', 'humming-birds-and-bees' );\n\t\t\t$results = self::prepare_import_csv();\t\n\t\t\t\n\t\t\t$home_url = home_url();\n\t\t\t$stud_url = $home_url .'/wp-admin/admin.php?page=edit_student&student_id=';\n\t\t\t$trans_url = $home_url .'/wp-admin/admin.php?page=edit_transaction&trans_id=';\n\t\t\t//Perform Checks first\t\n\t\t\t//Check for errors\n\t\t\tif( !empty( $results['errors'] ) ){\n\t\t\t\t\n\t\t\t\t//Display errors\n\t\t\t\techo '<div class=\"error\"><p><strong>' . $results['errors'] . '</strong></p></div>';\n\t\t\t\t$cur_path=$_SERVER['REQUEST_URI'];\n\t\t\t\techo \"<p><a href='\".blog_info('url').\"/\".$cur_path.\"'>Please try again!</a></p>\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//take the results of the prepared import_csv and display them for consideration. \n\t\t\t\t//Set a new form with new nonce for processing import\n\t\t\t\t\n\t\t\t\t\n\t\t\t\techo '<form method=\"post\" action=\"\" enctype=\"multipart/form-data\">';\n\t\t\t\twp_nonce_field( 'import_transaction', 'busy-bees-and-birds' ); \n\t\t\t\t\t\n\t\t\t\techo \"<table class='wp-list-table widefat fixed'>\n\t\t\t\t\t\t<thead><tr>\n\t\t\t\t\t\t\t<th>Name/ID</th>\n\t\t\t\t\t\t\t<th>Import Message</th>\n\t\t\t\t\t\t\t<th>Additional Messages</th>\n\t\t\t\t\t\t\t<th class='check-column'><em>Skip</em></th>\n\t\t\t\t\t\t</tr></thead>\n\t\t\t\t\t\t<tbody>\";\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//Displaying results for those transactions that are being proposed for update\t\n\t\t\t\t$i = 1;\n\t\t\t\tforeach($results as $result){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\tif( empty( $result['transArr'] ) ){\n\t\t\t\t\t\techo \"<td class='skip-row' colspan='4'>\";\n\t\t\t\t\t\techo \"{$result['notice']}\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !empty( $result['sid'] ) )\n\t\t\t\t\t\t\techo \" <a href='{$trans_url}{$result['trans_id']}' target='_blank'>Trx ID: {$result['trans_id']} </a>, student: <a href='{$stud_url}{$result['sid']}' target='_blank'>{$result['name']} / id#:{$result['sid']}</a>\";\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"</td>\";\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cereal_trans = serialize( $result );\n\t\t\t\t\t\t$cereal_id = 'cereal_trans_'.$i;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"<input type='hidden' name='$cereal_id' value='$cereal_trans'>\";\n\t\t\t\t\t\t//Name/ID\n\t\t\t\t\t\techo \"<td>\";\n\t\t\t\t\t\techo \"<a href='\".$stud_url . $result['sid'].\"' target='_blank'>\".$result['transArr']['Name'].\" / id#:\". $result['sid'].\"</a>\";\t\t\t \n\t\t\t\t\t\techo \"</td>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Import Summary\n\t\t\t\t\t\techo \"<td>\";\n\t\t\t\t\t\techo $result['import_message'];\t\t\t \n\t\t\t\t\t\techo \"</td>\";\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t//Additional messages\n\t\t\t\t\t\techo \"<td>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($result['add_mess'] as $mess ){\n\t\t\t\t\t\t\techo \"- $mess<br>\";\n\t\t\t\t\t\t} \n\t\t\t\t\t\techo \"</td>\";\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//Skip check box\n\t\t\t\t\t\t$check_id = 'trans_check_'.$i;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"<th class='check-column'>\";\n\t\t\t\t\t\techo \"<input type='checkbox' name='$check_id'>\";\t\t\t \n\t\t\t\t\t\techo \"</th>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\techo '</tbody></table>\n\t\t\t\t\n\t\t\t\t<p><input type=\"submit\" class=\"button-primary\" value=\"Process\" /></p>\n\t\t\t\t</form>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t//This actually processes the transactions and updates the database. Results of this are displayed here. \n\t\t} elseif( isset( $_POST['busy-bees-and-birds'] ) ) {\n\t\t\t\n\t\t\tcheck_admin_referer( 'import_transaction', 'busy-bees-and-birds' );\n\t\t\t\t\t\t\n\t\t\t$prepArr = array();\n\t\t\t\n\t\t\tforeach($_POST as $pKey => $pVal){\n\t\t\t\tif( strpos( $pKey , 'cereal_trans_' ) !== FALSE ){\n\t\t\t\t\t$cur_id = intval( str_replace( 'cereal_trans_', '', $pKey ) );\n\t\t\t\t\t//check if we should skip this transaction. \n\t\t\t\t\t$skipped = 'trans_check_'.$cur_id;\t\t\t\t\t\n\t\t\t\t\tif( array_key_exists( $skipped, $_POST ) !== TRUE ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$prepArr[] = unserialize( stripslashes($pVal) );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//print_pre($prepArr);\n\t\t\t\n\t\t\t//Call the PROCESS IMPORT CSV, $process_results is an array of results. \n\t\t\t$process_results = self::process_import_csv($prepArr);\n\t\t\t\n\t\t\t//Display Results from \n\t\t\t\n\t\t\t//Make available a timestamped batch record for bookkeeping purposes\n\t\t\t\n\t\t\tif( !empty( $process_results['errors'] ) ){\n\t\t\t\techo \"NB_Editor::load_student_import_editor, line 1182, there was an error in the process: <br>\";\n\t\t\t\n\t\t\t} elseif( !empty( $process_results ) ){\n\t\t\t\t\n\t\t\t\t//echo \"NB_Editor::load_student_import_editor, line 1186, process results is not empty: <br>\";\n\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"NB_Editor::load_student_import_editor, line 1189, something else is wrong: <br>\";\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//print_pre( $process_results );\n\n\t\t\t\n\t\t\t//Dates should be at the beginning of the array. \n\t\t\t$batchDates = array_shift($process_results);\n\t\t\t\n\t\t\t//print_pre($batchDates);\n\t\t\t$start_date = $batchDates['start_date'];\n\t\t\t$end_date = $batchDates['end_date'];\n\t\t\t\n\t\t\t$displayBatchReport = '';\n\t\t\t\n\t\t\t$batchDate = date('m/d/Y');\n\t\t\t$displayBatchReport = \"New Beginnings Doula Training\nTransaction Import Batch Report, processed on $batchDate. \nStart Date: $start_date, End Date: $end_date \n================================================\n\\n\";\n\t\t\t\n\t\t\t$displayBatchReport .= self::batchReport($process_results);\n\t\t\t\t\t\t\n\t\t\t$batchReport = strip_tags( $displayBatchReport );\n\t\t\t\n\t\t\t$dateStamp = $start_date.'_'.$end_date;\n\t\t\t$dateStamp = str_replace('/', '', $dateStamp);\n\t\t\t$form_fields = array ('save'); // this is a list of the form field contents I want passed along between page views\n\t\t\t$method = 'ftp'; // Normally you leave this an empty string and it figures it out by itself, but you can override the filesystem method here\n\t\t\t \n\t\t\t// check to see if we are trying to save a file\n\t\n\t\t\t$url = wp_nonce_url('admin.php?page=import_transaction','import_transaction', $_POST['busy-bees-and-birds']);\n\t\t\t$creds = request_filesystem_credentials($url);\n\t\t\tWP_Filesystem($creds);\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t\n\t\t\t//print_pre($upload_dir);\n\t\t\t$fileuri = trailingslashit($upload_dir['path']).'batchReport_'.$dateStamp.'.txt';\n\t\t\t$fileurl = trailingslashit($upload_dir['url']).'batchReport_'.$dateStamp.'.txt';\n\t\t\t\n\t\t\t$a = 1; \n\t\t\t$fileuri = self::check_batch_file_exists( $fileuri, $a ); \n\t\t\t$fileurl = self::check_batch_file_exists( $fileurl, $a ); \n\n\t\t\t// by this point, the $wp_filesystem global should be working, so let's use it to create a file\n\t\t\tglobal $wp_filesystem;\n\t\t\t\t\t\t\n\t\t\tif ( ! $wp_filesystem->put_contents( $fileuri, $batchReport, FS_CHMOD_FILE) ) {\n\t\t\t\techo '<div class=\"error\"><p>Error saving file!</p></div>';\n\t\t\t} else {\n\t\t\t\techo '<div class=\"updated\"><p><a href=\"'.$fileurl.' \" target=\"_blank\">Open Batch Report!</a> (saved in .txt format)</p></div>';\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t$displayBatchReport = nl2br( $displayBatchReport );\n\t\t\techo '<hr>';\n\t\t\techo $displayBatchReport;\n\t\t\techo '<hr>';\n\t\t\t$import_admin_url = admin_url( 'admin.php?page=import_transaction' );\n\t\t\techo \"<a href='$inport_admin_url'>Add Another Batch!</a>\";\n\t\t} else {\n\t\t\n\t\t// Show the form. \n\t\t?>\n\t\t<form method=\"post\" action=\"\" enctype=\"multipart/form-data\">\n\t\t\t<?php wp_nonce_field( 'import_prep', 'humming-birds-and-bees' ); ?>\n\t\t\t\n\t\t\t<div class=\"updated\"><p>This importer is designed to take a batch of transactions from Paypal and process them. Existing users will have their accounts updated with latest transaction information. Transactions that don't have a user account associated with them will be ignored.</p></div>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<td><label for=\"users_csv\">CSV file</label><br>\n\t\t\t\t\t\t<input type=\"file\" id=\"users_csv\" name=\"users_csv\" value=\"\" class=\"all-options\" /><br>\n\t\t\t\t\t\t<span class=\"description\"><?php echo sprintf( 'You may want to see <a href=\"%s\" target=\"_blank\">the example of the CSV file</a>.', '/migration/import-sample.csv'); ?></span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"Import\" />\n\t\t\t</p>\n\t\t</form>\n\t\t\n\t\t<hr>\n\t\t<h3>Other Management Tools</h3>\n\t\t<p>Jump to -> \n\t\t<a href=\"http://dev.trainingdoulas.com/tools/ledger_prep.php\" target=\"_blank\">Batch Ledger Tool</a> (opens new window)</p>\n\t\t\n\t\t\n\t\t<?php\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tself::nb_admin_footer();\n\t}",
"function import_ta_list( $obj_file, $int_greengene_course )\n\t{\n\t\tglobal $g_obj_ta_manager;\n\t\t\n\t\t// read the lines\n\t\t$arr_lines = file( $obj_file );\n\t\t\n\t\t$arr_success = array();\n\t\t$arr_fail = array();\n\t\t\n\t\tfor ( $i = 0; $i < count( $arr_lines ); ++$i )\n\t\t{\n\t\t\t$line = FileHandler::trim_string( $arr_lines[$i] );\n\t\t\t\n\t\t\tlist( $str_first_name, $str_last_name ) = explode( ',', $line );\n\t\t\n\t\t\tif ( isset( $str_first_name ) && isset( $str_last_name ) )\n\t\t\t{\n\t\t\t\t$str_first_name = FileHandler::trim_string( $str_first_name );\n\t\t\t\t$str_last_name = FileHandler::trim_string( $str_last_name );\n\t\t\t\t\n\t\t\t\t// generate username and password for this user\n\t\t\t\t$str_user_name = $g_obj_ta_manager->autogen_user( $str_first_name, $str_last_name );\n\t\t\t\t$str_password = $g_obj_ta_manager->autogen_password( $str_first_name, $str_last_name );\n\t\t\t\t\n\t\t\t\t$arr_tmp = array();\n\t\t\t\t$arr_tmp[0] = $str_user_name;\n\t\t\t\t$arr_tmp[1] = $str_password;\n\t\t\t\t\n\t\t\t\t// add the user to the database\n\t\t\t\tif ( $g_obj_ta_manager->create_user( $str_user_name, $int_greengene_course, UP_TA, $str_first_name, $str_last_name, $str_password, 0 ) )\n\t\t\t\t{\n\t\t\t\t\tarray_push( $arr_success, $arr_tmp );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tarray_push( $arr_fail, $arr_tmp );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( count( $arr_success ) != 0 )\n\t\t{\n\t\t\t$str_message = PageHandler::display_users_id_password( 'Successfully created', $arr_success );\n\t\t\n\t\t\tMessageHandler::add_message( MSG_SUCCESS, $str_message );\n\t\t}\n\t\t\n\t\tif ( count( $arr_fail ) != 0 )\n\t\t{\n\t\t\t$str_message = PageHandler::display_users_id_password( 'Failed to create', $arr_fail );\n\t\t\n\t\t\tMessageHandler::add_message( MSG_FAIL, $str_message );\n\t\t}\n\t}",
"public function importFromLanguageAction()\n\t{\n\t\t$importPath = BASE_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'translator' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR;\n\n\t\tforeach (new DirectoryIterator($importPath) as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$file = $file->__toString();\n\t\t\t\t$fileName = $importPath.$file;\n\t\t\t\t$xml = simplexml_load_file($fileName);\n\t\t\t\t$generated_time = $xml['generated_at'];\n\t\t\t\tunset($xml['generated_at']);\n\t\t\t\t$newArray = $this->mergeArray($xml);\n\t\t\t\t$this->updateDatabase($newArray);\n\t\t\t}\n\t\t}\n\t}",
"public function import(string $filePath, Language $originalLang, Language $translationLang, WordGroup $group);",
"public function imported_articles(){\r\n\r\n\t\t}",
"function import() {\r\n\t\tif($this->data) {\r\n\t\t\t$import_string = $this->data['Quote']['import_data'];\r\n\t\t\t$import_string = str_replace(\"\\r\\n\", \"\\n\", $import_string);\r\n\t\t\t$import_arr = explode(\"\\n\\n\", $import_string);\r\n\t\t\t$new_data = array();\r\n\t\t\tforeach($import_arr as $quote_full) {\r\n\t\t\t\t$quote_parts = explode(\"\\n-\", $quote_full);\r\n\t\t\t\t$quote = empty($quote_parts[0]) ? '' : $quote_parts[0];\r\n\t\t\t\t$author = empty($quote_parts[1]) ? '' : $quote_parts[1];\r\n\r\n\t\t\t\t// Prepare data to save\r\n\t\t\t\t$quote_data = array(\r\n\t\t\t\t\t'Quote' => array(\r\n\t\t\t\t\t\t'quote' => $quote\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t$this->_add_quote($quote_data, $author);\r\n\t\t\t}\r\n\t\t\t$this->flash('All quotes have been added!', '/quotes');\r\n\t\t}\r\n\t}",
"function locale_translate_batch_import($filepath, &$context) {\n // The filename is either {langcode}.po or {prefix}.{langcode}.po, so\n // we can extract the language code to use for the import from the end.\n if (preg_match('!(/|\\.)([^\\./]+)\\.po$!', $filepath, $langcode)) {\n $file = entity_create('file', array(\n 'filename' => drupal_basename($filepath),\n 'uri' => $filepath,\n ));\n _locale_import_read_po('db-store', $file, LOCALE_IMPORT_KEEP, $langcode[2]);\n $context['results'][] = $filepath;\n }\n}",
"public function f_import_siswa()\n \t{\t\n\t\t$data['judul_halaman'] = \"Form Import Siswa\";\n\t\t$data['files'] = array(\n\t\t\tAPPPATH . 'modules/import_user/views/v-form_import_siswa.php',\n\t\t\t);\n\t\t$hakAkses = $this->session->userdata['HAKAKSES'];\n\t\tif ($hakAkses == 'admin') {\n\t\t\t$this->parser->parse('admin/v-index-admin', $data);\n\t\t} elseif ($hakAkses == 'guru') {\n\t\t\tredirect(site_url('guru/dashboard/'));\n\t\t} elseif ($hakAkses == 'siswa') {\n\t\t\tredirect(site_url('welcome'));\n\t\t} else {\n\t\t\tredirect(site_url('login'));\n\t\t}\n \t}",
"private function importTranscription($post) {\n $tmpfname = tempnam(sys_get_temp_dir(), 'coraIL');\n $_SESSION['importLogFile'] = $tmpfname;\n $_SESSION['importInProgress'] = true;\n $errmsg = $this->checkFileUpload($_FILES['transFile']);\n if ($errmsg) {\n return array(\"errors\" => array($this->lh->_(\"ServerError.upload\") . \" \" . $errmsg));\n }\n if (!isset($post['via'])) {\n $post['via'] = null;\n }\n $this->releaseConnection(array(\"success\" => true), $post['via']);\n // from here on, the client connection should be closed\n $data = $_FILES['transFile'];\n $options = array();\n if (!empty($post['fileEnc'])) {\n $options['encoding'] = $post['fileEnc'];\n }\n if (!empty($post['transName'])) {\n $options['name'] = $post['transName'];\n }\n if (!empty($post['sigle'])) {\n $options['sigle'] = $post['sigle'];\n }\n $options['tagsets'] = $post['linktagsets'];\n $options['project'] = $post['project'];\n $options['logfile'] = $tmpfname;\n try {\n $success = $this->sh->importTranscriptionFile($data, $options);\n if ($success) {\n $logfile = fopen($tmpfname, 'a');\n fwrite($logfile, \"~FINISHED\\n\");\n fclose($logfile);\n }\n }\n catch(Exception $e) {\n $logfile = fopen($tmpfname, 'a');\n fwrite($logfile, \"~ERROR PHPEXCEPTION\\n\");\n fwrite($logfile, $e->getMessage() . \"\\n\");\n fclose($logfile);\n }\n @session_start();\n $_SESSION[\"importInProgress\"] = false;\n exit(); // we don't return because there's no client connection left\n }",
"abstract public function import();",
"public function testTranscriptsList()\n {\n }",
"function doimport(){\n // Get the maximum index for members\n JRequest::checkToken() or jexit( 'JInvalid_Token' );\n $n = JRequest::getInt('staffCount');\n $count = 0;\n $actions = JResearchAccessHelper::getActions();\n $jinput = JFactory::getApplication()->input; \n if($actions->get('core.staff.create')){\n for ($i=0; $i<= $n; $i++) {\n $username = $jinput->get('member'.$i);\n if($username !== null){\n JTable::addIncludePath(JRESEARCH_COMPONENT_ADMIN.DS.'tables');\n $newMember = JTable::getInstance('Member', 'JResearch');\n $newMember->ordering = $i;\n $newMember->bindFromUser($username);\n if ($newMember->store()) {\n $count++;\n } else {\n JError::raiseWarning(1, JText::sprintf('JRESEARCH_USER_IMPORTED_FAILED', $username));\n }\n }\n }\n $this->setRedirect('index.php?option=com_jresearch&controller=staff', JText::plural('JRESEARCH_N_USER_IMPORTED_SUCCESSFULLY', $count));\n }else{\n JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));\t\t\t\t\n }\n }",
"function islandora_transcription_file_update($transcription, $filename) {\n $transcription['TRANSCRIPTION']->setContentFromFile($filename);\n unlink($filename);\n}",
"function import_language_texts($id, $path)\r\n {\r\n global $app;\r\n\r\n // get the language details and open the file\r\n $row = new Language;\r\n $row = $row->get($id);\r\n if ($row->code == DEFAULT_LANGUAGE)\r\n $app->abort(\"The default language cannot be imported\");\r\n $fh = @fopen($path, 'rb');\r\n if (!$fh)\r\n $app->abort(\"##Unable to open## '$path'\");\r\n\r\n // setup stream parser\r\n $xml = xml_parser_create('UTF-8');\r\n xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, false);\r\n xml_parser_set_option($xml, XML_OPTION_TARGET_ENCODING, 'UTF-8');\r\n $obj = new LangImportHandler;\r\n $obj->language_id = $id;\r\n xml_set_object($xml, $obj);\r\n xml_set_element_handler($xml, 'start_element', 'end_element');\r\n xml_set_character_data_handler($xml, 'character_data');\r\n\r\n // parse the document in chunks\r\n while ($data = fread($fh, 4096)) {\r\n xml_parse($xml, $data, feof($fh))\r\n or $app->abort(\"##XML Parsing Error in## '\", $path, \"': \", xml_error_string(xml_get_error_code($xml)), ' ##Line##:', xml_get_current_line_number($xml), ' ##Column##:', xml_get_current_column_number($xml), '. ##Not all texts were imported##.');\r\n }\r\n @fclose($fh);\r\n\r\n // free the parser\r\n xml_parser_free($xml);\r\n\r\n // report any application errors during parsing\r\n if (!empty($app->errors))\r\n $app->abort(implode(' ', $app->errors));\r\n }",
"public function passo1() {\n $this->Traducao->import('default.pot');\n }",
"public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }",
"protected abstract function doImport();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Monitoring of Voucher process | public function monitorVouchers($postvars)
{
$model = new MonitoringVoucherForm();
$rawdata = array();
$model->attributes = $postvars;
$data = $model->attributes;
$vouchertype = $data['vouchertype'];
$datefrom = $data['datefrom'];
$dateto = $data['dateto'];
Yii::app()->session['vouchertype'] = $vouchertype;
if($vouchertype > 0){
/*******************************************TICKETS**********************************************************/
//check if vouchertype is ticket
if($vouchertype == 1)
{
if ($datefrom != "" && $dateto != "")
{
$vouchercount = $model->getAllTicketCount($datefrom, $dateto);
$activeticketcount = $model->getTicketCount(1, $datefrom, $dateto);
$queuedticketcount = $model->getTicketCount(1, $datefrom, $dateto, 1);
$voidticketcount = $model->getTicketCount(2, $datefrom, $dateto);
$usedticketcount = $model->getTicketCount(3, $datefrom, $dateto);
$encashmentticketcount = $model->getTicketCount(4, $datefrom, $dateto);
$cancelledticketcount = $model->getTicketCount(5, $datefrom, $dateto);
$reimbursedticketcount = $model->getTicketCount(6, $datefrom, $dateto);
$expiredticketcount = $model->getTicketCount(7, $datefrom, $dateto);
$activeticketcounts = (float)$activeticketcount;
$queuedticketcounts = (float)$queuedticketcount;
$voidticketcounts = (float)$voidticketcount;
$usedticketcounts = (float)$usedticketcount;
$encashmentticketcounts = (float)$encashmentticketcount;
$cancelledticketcounts = (float)$cancelledticketcount;
$reimbursedticketcounts = (float)$reimbursedticketcount;
$expiredticketcounts = (float)$expiredticketcount;
$vouchercounts = (float)$vouchercount;
//ActiveTicket Count
// if ($activeticketcounts > 0)
// {
// $activepercentage = round(($activeticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $activepercentage = 0;
// }
// //Active (Queued)
// if ($queuedticketcounts > 0)
// {
// $queuedpercentage = round(($queuedticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $queuedpercentage = 0;
// }
// //Void Tickets
// if ($voidticketcounts > 0)
// {
// $voidpercentage = round(($voidticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $voidpercentage = 0;
// }
// //Used Percentage
// if ($usedticketcounts > 0)
// {
// $usedpercentage = round(($usedticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $usedpercentage = 0;
// }
// //Encashment Percentage
// if ($encashmentticketcounts > 0)
// {
// $encashmentpercentage = round(($encashmentticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $encashmentpercentage = 0;
// }
// //Cancelled Tickets
// if ($cancelledticketcounts > 0)
// {
// $cancelledpercentage = round(($cancelledticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $cancelledpercentage = 0;
// }
// //Reimbursed Tickets
// if ($reimbursedticketcounts > 0)
// {
// $reimbursedpercentage = round(($reimbursedticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $reimbursedpercentage = 0;
// }
// //Expired Tickets
// if ($expiredticketcounts > 0)
// {
// $expiredpercentage = round(($expiredticketcounts/$vouchercounts)*100,2);
// }
// else
// {
// $expiredpercentage = 0;
// }
$rawdata = array(
// array(
// 'Status' => 'Active (Queued)',
// 'Count' => number_format($queuedticketcounts),
// //'Percentage' => $queuedpercentage.' %',
// ),
array(
'Status' => 'Active',
'Count' => number_format($activeticketcounts),
//'Percentage' => $activepercentage.' %',
),
array(
'Status' => 'Void',
'Count' => number_format($voidticketcounts),
//'Percentage' => $voidpercentage.' %',
),
array(
'Status' => 'Used',
'Count' => number_format($usedticketcounts),
//'Percentage' => $usedpercentage.' %',
),
array(
'Status' => 'Encashed',
'Count' => number_format($encashmentticketcounts),
//'Percentage' => $encashmentpercentage.' %',
),
// array(
// 'Status' => 'Cancelled',
// 'Count' => number_format($cancelledticketcounts),
// //'Percentage' => $cancelledpercentage.' %',
// ),
array(
'Status' => 'Reimbursed',
'Count' => number_format($reimbursedticketcounts),
//'Percentage' => $reimbursedpercentage.' %',
),
array(
'Status' => 'Expired',
'Count' => number_format($expiredticketcounts),
//'Percentage' => $expiredpercentage.' %',
),
array(
'Status' => 'Total',
'Count' => number_format($vouchercounts),
//'Percentage' => '100 %',
),
);
}
else
{
$this->hasError = true;
$errorcode = 1; //Please enter date from/to
}
}
/*******************************************COUPONS**********************************************************/
else{
//coupons
$vouchercount = $model->getAllCouponCount();
$inactivecouponcount = $model->getCouponCount(0);
$activecouponcount = $model->getCouponCount(1);
$deactivatedcouponcount = $model->getCouponCount(2);
$usedcouponcount = $model->getCouponCount(3);
$cancelledcouponcount = $model->getCouponCount(4);
$reimbursedcouponcount = $model->getCouponCount(5);
$inactivecouponcounts = (float)$inactivecouponcount;
$activecouponcounts = (float)$activecouponcount;
$deactivatedcouponcounts = (float)$deactivatedcouponcount;
$usedcouponcounts = (float)$usedcouponcount;
$cancelledcouponcounts = (float)$cancelledcouponcount;
$reimbursedcouponcounts = (float)$reimbursedcouponcount;
$vouchercounts = (float)$vouchercount;
$inactivepercentage = round(($inactivecouponcounts/$vouchercounts)*100,2);
$activepercentage = round(($activecouponcounts/$vouchercounts)*100,2);
$deactivatedpercentage = round(($deactivatedcouponcounts/$vouchercounts)*100,2);
$usedpercentage = round(($usedcouponcounts/$vouchercounts)*100,2);
$cancelledpercentage = round(($cancelledcouponcounts/$vouchercounts)*100,2);
$reimbursedpercentage = round(($reimbursedcouponcounts/$vouchercounts)*100,2);
$rawdata = array(
array(
'Status' => 'Inactive',
'Count' => number_format($inactivecouponcounts),
'Percentage' => $inactivepercentage.' %',
),
array(
'Status' => 'Active',
'Count' => number_format($activecouponcounts),
'Percentage' => $activepercentage.' %',
),
array(
'Status' => 'Deactivated',
'Count' => number_format($deactivatedcouponcounts),
'Percentage' => $deactivatedpercentage.' %',
),
array(
'Status' => 'Used',
'Count' => number_format($usedcouponcounts),
'Percentage' => $usedpercentage.' %',
),
array(
'Status' => 'Cancelled',
'Count' => number_format($cancelledcouponcounts),
'Percentage' => $cancelledpercentage.' %',
),
array(
'Status' => 'Reimbursed',
'Count' => number_format($reimbursedcouponcounts),
'Percentage' => $reimbursedpercentage.' %',
),
array(
'Status' => 'Total',
'Count' => number_format($vouchercounts),
'Percentage' => '100 %',
),
);
}
if ($this->hasError)
{
if ($errorcode == 1)
{
$this->showDialog = true;
$this->dialogMsg = "Please enter From/To Date";
}
}
else
{
$display = 'block';
Yii::app()->session['display'] = $display;
}
}
else{
$rawdata = array();
}
return $rawdata;
} | [
"public function run()\n\t\t{\n\t\t\t// Sets up the Applog, any other pre-requisites in the parent\n\t\t\tparent::run();\n\t\t\t\n\t\t\t$this->log->Write('Starting Teletrack Updates');\n\t\t\t\n\t\t\t$start_date = $this->start_date . \" 00:00:00\";\n\t\t\t$end_date = $this->end_date . ' 23:59:59';\n\n\t\t\t$applications = array();\n\n\t\t\t$paid_status_list = array();\n\t\t\tif($paid_status = $this->status_list->toId('paid::customer::*root'))\n\t\t\t{\n\t\t\t\t$paid_status_list[] = $paid_status;\n\t\t\t\t$paid_apps = $this->findApplications($start_date, $end_date, $paid_status_list, 'paid_off');\n\t\t\t\t$applications = array_merge($applications, $paid_apps);\n\t\t\t}\n\n\t\t\t$chargeoff_status_list = array();\n\t\t\tif($chargeoff = $this->status_list->toId('chargeoff::collections::customer::*root'))\n\t\t\t{\n\t\t\t\t$chargeoff_status_list[] = $chargeoff;\n\t\t\t}\n\n\t\t\tif($sent = $this->status_list->toId('sent::external_collections::*root'))\n\t\t\t{\n\t\t\t\t$chargeoff_status_list[] = $sent;\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($chargeoff_status_list))\n\t\t\t{\n\t\t\t\t$chargeoff_apps = $this->findApplications($start_date, $end_date, $chargeoff_status_list, 'chargeoff');\n\t\t\t\t$applications = array_merge($applications, $chargeoff_apps);\n\t\t\t}\n\t\t\t\n\t\t\t$cancelled_apps = $this->getCancellations($start_date, $end_date);\n\t\t\t$applications = array_merge($applications, $cancelled_apps);\n\t\t\t\n\t\t\t$datax_license_key = ECash::getConfig()->DATAX_LICENSE_KEY;\n\t\t\t$datax_password = ECash::getConfig()->DATAX_PASSWORD;\n\t\t\t\n\t\t\tforeach($applications as $application_data)\n\t\t\t{\n\t\t\t\t$this->log->Write(\"Teletrack Update Ran For Application: \" . $application_data->application_id);\n\t\t\t\t\n\t\t\t\t$DataX = new ECash_DataX($datax_license_key, $datax_password, $application_data->call_type);\n\t\t\t\t$DataX->setRequest(\"Status_Update\");\n\t\t\t\t$DataX->setResponse(\"Status_Update\");\n\t\t\t\t\n\t\t\t\t$DataX->execute((array)$application_data);\n\t\t\t\t$DataX->saveResult();\n\t\t\t}\n\t\t\t$this->log->Write('Finished Teletrack Updates');\n\t\t}",
"public function monitor() {\n\n $hold = $this->cfg['hold'];\n\n $http = $this->extcode();\n\n $rqst = $this->req->gettime();\n\n $time = ($rqst > $hold);\n\n $code = ($http != NULL);\n\n if($http == $this->req->conf['code']) {\n\n $this->logdata($this->cfg['log2']);\n\n return;\n\n }\n\n else if($time && !$code) {\n\n return $this->alert()->load($rqst);\n\n }\n\n else if(!$time && $code) {\n\n return $this->alert()->resp($http);\n\n }\n\n else if($time && $code) {\n\n return $this->alert()->tcrq($rqst, $http);\n\n }\n\n else {\n\n return;\n\n }\n\n }",
"public function execute() {\n $enrol = enrol_get_plugin('billplz');\n $trace = new \\text_progress_trace();\n $enrol->process_expirations($trace);\n }",
"function monitor() {\n\t\t$this->common->check_session();\n\t\t// Permission Checking\n\t\tif (!$this->user->has_permission('scan')) {\n\t\t\t$this->session->set_userdata('errormessage', 'You do not have permission to access that page.');\n\t\t\tredirect($this->config->item('base_url').'main');\n\t\t\t$this->logging->log('error', 'debug', 'Permission Denied to access '.uri_string());\n\t\t\treturn;\n\t\t}\n\n\t\t$barcode = $this->session->userdata('barcode');\n\t\t// Get our book\n\t\t$this->book->load($barcode);\n\t\t$this->common->check_missing_metadata($this->book);\n\n\t\t// We found something!\n\t\t$data['item_title'] = $this->session->userdata('title');\n\t\t$data['ip_address'] = $_SERVER['REMOTE_ADDR'];\n\t\t$data['hostname'] = $this->common->_get_host($_SERVER['REMOTE_ADDR']);\n\t\t$data['incoming_path'] = $this->cfg['incoming_directory'].'/'.$barcode;\n\t\tif ($this->cfg['incoming_directory_remote'] == '') {\n\t\t\t$data['remote_path'] = $this->cfg['incoming_directory'].'/'.$barcode;\n\t\t} else {\n\t\t\t$data['remote_path'] = $this->cfg['incoming_directory_remote'].'/'.$barcode;\n\t\t}\n\t\t$status = $this->book->status;\n\t\tif ($status == 'new' || $status == 'scanning') {\n\t\t\t$data['book_has_missing_pages'] = false;\n\t\t} else {\n\t\t\t$data['book_has_missing_pages'] = true;\t\t\n\t\t}\n\n\t\t// The path can be blank, so we need to handle things properly.\n\t\tif ($this->cfg['incoming_directory'] && !file_exists($data['incoming_path'])) {\n\t\t\t// If the folder for the new pages is not there, we add it.\n\t\t\t// Assume that we've already checked for writability in this folder. (which we have, in the Common library)\n\t\t\tmkdir($data['incoming_path']);\n\t\t\t$this->logging->log('access', 'info', 'Created incoming directory: '.$data['incoming_path']);\n\t\t}\n\t\t$this->logging->log('access', 'info', 'Scanning monitor loaded for '.$barcode.'.');\n\n\t\t$this->load->view('scan/monitor_view', $data);\n\t}",
"public function status() {\n $this->out('Notification Shell - status');\n $this->loadModel('Certifications');\n \n \n //Users with expiring certs\n $invalid_certs = $this->Certifications->find()\n ->where(['status >' => 1,\n 'active' => true,\n 'valid' => true])\n ->select('user_id')\n ->distinct('user_id')->extract('user_id');\n \n //Users with expiring registers\n $this->loadModel('Registers');\n $invalid_registers = $this->Registers->find()\n ->where(['status' => 'Registered',\n 'active' => true,\n 'cert_status >' => 1])\n ->select('user_id')\n ->distinct('user_id')->extract('user_id');\n \n $users = array_merge($invalid_certs->toArray(), $invalid_registers->toArray());\n $users = array_unique($users);\n \n if(!empty($users)){\n //Processing count($users)\n $this->out('Processing '.count($users).' users.');\n $this->loadModel('Users');\n foreach($users as $user_id){\n $this->Users->sendStatusEmail($user_id);\n sleep(3);\n }\n }\n \n }",
"public function monitorpromoAction()\n {\n $dirname = $this->getRequest()->getParam('dirname');\n //$dirname = '/var/www/sites/SmartData/data/ftp/bpcs/product/supplement';\n \n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dirname)\n );\n \n\n foreach ($files as $file) {\n if (!in_array(strtolower($file->getExtension()), $this->_extensions)) {\n continue;\n }\n \n // CREATE TRIGGER FILE\n shell_exec('touch ' . $dirname . '/promo.trg');\n \n // TODO: launch parse supplement action in separate proc, via shell_exec()\n $promo_shell_command = 'export APP_ENV=\"' .getenv('APP_ENV') . '\" && export APP_SITE=\"' .getenv('APP_SITE') . '\" && php public/index.php parse promo ' .$file->getRealPath() . '';\n echo $promo_shell_command;\n exit;\n //$promo_shell_output = shell_exec($promo_shell_command);\n }\n }",
"function uc_veritrans_vt_web_payment_notification() {\n // Set library config\n $veritrans = new Veritrans_Config();\n Veritrans_Config::$serverKey = variable_get('uc_veritrans_server_key', '');\n // error_log(\"Veritrans_Config::$serverKey --- \".Veritrans_Config::$serverKey); // debugan\n // error_log(\"variable_get('uc_veritrans_server_key', '') --- \".variable_get('uc_veritrans_server_key', '')); // debugan\n $payment_mode = variable_get('uc_veritrans_payment_mode', 'TEST');\n if ($payment_mode == 'TEST') {\n Veritrans_Config::$isProduction = FALSE;\n }\n else {\n Veritrans_Config::$isProduction = TRUE;\n }\n\n // create notification object from HTTP POST received\n $notification = new Veritrans_Notification();\n\n // get order id\n $order_id = $notification->order_id;\n if (empty($order_id)) {\n $error_redirect_url = variable_get('uc_veritrans_error_redirect_url', 'vt_web/error');\n drupal_goto($error_redirect_url);\n }\n\n // build order object\n $order = uc_order_load($order_id);\n if (variable_get('uc_veritrans_debugging', FALSE)) {\n watchdog('vt_web', 'Response from Veritrance <pre>@response</pre>', array('@response' => print_r($notification, TRUE)), WATCHDOG_DEBUG);\n }\n if ($order == FALSE) {\n watchdog('vt_web', 'IPN attempted for non-existent order @order_id.', array('@order_id' => $notification->order_id), WATCHDOG_ERROR);\n return FALSE;\n }\n\n // get the order status\n $result = Veritrans_Transaction::status($order_id);\n if ($result->transaction_id != $notification->transaction_id || $result->fraud_status != $notification->fraud_status) {\n watchdog('vt_web', 'Verification of transaction failed.', array(), WATCHDOG_WARNING);\n return FALSE;\n }\n\n // Do action according to transaction status\n $transaction = $notification->transaction_status;\n $fraud = $notification->fraud_status;\n if ($transaction == 'capture') {\n if ($fraud == 'challenge') {\n // Set payment status in merchant's database to 'challenge'.\n uc_order_update_status($order->order_id, 'veritrans_pending');\n uc_order_comment_save($order->order_id, 0, t('Payment is challanged, please take action in Veritrans Portal'), 'admin');\n }\n elseif ($fraud == 'accept') {\n // Set payment status in merchant's database to 'success'.\n $payment_message = t('Payment using Veritrans for ORDERNUMBER: @ordernumber.', array('@ordernumber' => $order->order_id));\n uc_payment_enter($order->order_id, 'vt_web', $order->order_total, $order->uid, NULL, $payment_message);\n\n uc_order_update_status($order->order_id, 'payment_received');\n $payment_reported = t('Veritrans reported a payment of @amount.', array('@amount' => $order->order_total));\n uc_order_comment_save($order->order_id, 0, $payment_reported, 'admin');\n }\n }\n elseif ($notification->payment_type != 'credit_card' && $transaction == 'settlement') {\n // Set payment status in merchant's database to 'success'.\n $payment_message = t('Payment using Veritrans for ORDERNUMBER: @ordernumber.', array('@ordernumber' => $order->order_id));\n uc_payment_enter($order->order_id, 'vt_web', $order->order_total, $order->uid, NULL, $payment_message);\n\n uc_order_update_status($order->order_id, 'payment_received');\n $payment_reported = t('Veritrans reported a payment of @amount.', array('@amount' => $order->order_total));\n uc_order_comment_save($order->order_id, 0, $payment_reported, 'admin');\n }\n elseif ($transaction == 'cancel') {\n if ($fraud == 'challenge' || $fraud == 'accept') {\n // Set payment status in merchant's database to 'failure'.\n \t uc_order_update_status($order->order_id, 'canceled');\n uc_order_comment_save($order->order_id, 0, t('Payment canceled by merchant.'), 'admin');\n }\n }\n elseif ($transaction == 'deny') {\n // Set payment status in merchant's database to 'failure'.\n uc_order_update_status($order->order_id, 'canceled');\n uc_order_comment_save($order->order_id, 0, t('Payment declined by merchant.'), 'admin');\n }\n elseif ($transaction == 'pending') {\n // Set payment status in merchant's database to 'pending'.\n uc_order_update_status($order->order_id, 'pending');\n uc_order_comment_save($order->order_id, 0, t('Awaiting customer payment at Veritrans.'), 'admin');\n }\n else {\n watchdog('vt_web', 'Invalid Transaction. Check Response from Veritrance <pre>@response</pre>', array('@response' => print_r($notification, TRUE)), WATCHDOG_DEBUG);\n }\n}",
"private function checkClientProcessStatus()\n {\n // get info from systemData table\n $systemData = SystemData::find(self::CLIENT_PROCESS_ID);\n \n // get time differences\n $currentTime = new Carbon();\n $intervalDiff = $systemData->notifyTimestamp->diffInMinutes($currentTime);\n $totalRun = $systemData->timestamp->diffInMinutes($currentTime);\n \n // if the time comparison is greater than or equal to the $interval value then send an alert\n if ($intervalDiff >= $systemData->notifyInterval) {\n $this->info(\"Processor has been running for \" . (int) ($totalRun / 60) . \" hours and \" . $totalRun % 60 . \" minutes.\");\n \n $emailContent = [];\n $emailContent['process'] = 'Client';\n $emailContent['process_time'] = $totalRun;\n $emailContent['timestamp'] = $systemData->timestamp->toDayDateTimeString();\n \n // process running too long, send alert email\n $subject = \"CLIENT PROCESS \" . strtoupper($systemData->status) . \" STUCK\";\n \n // send email\n Mail::send('emails.stuck-process-alert', $emailContent, function ($m) use ($subject) {\n $m->from('bills@energycap.com', 'EnergyCAP Bill CAPture');\n $m->to('bills@energycap.com')->subject($subject);\n });\n \n // send push alert\n Pushover::push(\"\", \"Client process stuck for \" . $totalRun . \" minutes.\");\n Pushover::send();\n }\n \n return $systemData->value;\n }",
"public function check_voucher()\n {\n\t\t// get values\n\t\t\t$get=$this->get_input_vals();\n\n\t\t// apply the voucher to the cart\n\t\t\t$ajax_display_message=$this->voucher_model->apply_voucher($get['voucher_id']);\n\n\t\t// recalculate the basket totals for output\n\t\t\t$total=$this->basket_model->total();\n\n\t\tif ($this->input->is_ajax_request())\n\t\t{\n\t\t\t// html array with various totals we might need in it\n\t\t\t\t$html=array(\n\t\t\t\t\t0=>$ajax_display_message['message'],\n\t\t\t\t\t1=>number_format($total['total'],2),\n\t\t\t\t\t2=>number_format($total['postage'],2),\n\t\t\t\t\t3=>number_format($total['voucher'],2)\n\t\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//log, reload\n\t\t\t\t$this->_log_action(\"basket\",$ajax_display_message['message'],$ajax_display_message['pass']);\n\t\t\t\t$this->_reload(\"basket\",$ajax_display_message['message'],$ajax_display_message['pass']);\n\t\t}\n exit(json_encode($html));\n }",
"public function StartChecker(){\n file_put_contents(\"pid.txt\",getmypid());\n $this->DC1->Check_ALL_For_Current_TLD_and_Adv_To_Next();\n }",
"function view_voucher($demand_id)\n {\n }",
"public function plgVmOnPaymentNotification()\n {\n $hashes = $_REQUEST['hash_codes'];\n\n if ($hashes)\n {\n $hashes = explode(',', $hashes);\n\n if (count($hashes) > 0)\n {\n // Setup EBANX settings\n $this->setupEbanx();\n\n foreach ($hashes as $hash)\n {\n $response = \\Ebanx\\Ebanx::doQuery(array('hash' => $hash));\n\n if (isset($response->status) && $response->status == 'SUCCESS')\n {\n $reference = (int) $response->payment->order_number;\n $status = $response->payment->status;\n $newStatus = $this->getPaymentStatus($status);\n\n if ($status == 'CO')\n {\n $this->updateOrderStatus($reference, $newStatus, 'Changed to Paid by IPN.');\n echo \"OK: Payment {$hash} was completed\";\n }\n else if ($status == 'CA')\n {\n $this->updateOrderStatus($reference, $newStatus, 'Changed to Cancelled by IPN.');\n echo \"OK: Payment {$hash} was cancelled via IPN\";\n }\n else\n {\n echo \"SKIP: Payment {$hash} is pending.\";\n }\n }\n }\n\n exit;\n }\n }\n }",
"function consult_the_voters() {\n \t\t\n \t\tif (!$this->in_power) {\n \t\t\t$this->in_opposition();\n \t\t\treturn;\n \t\t}\n\n \t\tif (!$this->pay('bank', 1000)) { /* referenda cost 1000 */\n \t\t\t $this->cant_pay(1000);\n \t\t\t return;\n \t\t}\n if ($this->referendum()) $this->approve_change(TRUE);\n else $this->disapprove_change();;\n \t}",
"protected function monitor() {\n\t\t$jobId = $this->currentJobId;\n\t\t$job = $this->getStatus($jobId);\n\n\t\t// If the start time is in the future, wait for that time (and re-check again)\n\t\twhile (($job = $this->getStatus($jobId)) && strtotime($job['start_time']) > time()) {\n\t\t\tset_time_limit($this->errorTimeout + (strtotime($job['start_time']) - time()) + 5);\n\t\t\tsleep((strtotime($job['start_time']) - time()));\n\t\t}\n\n\t\tif ($job['request']) {\n\t\t\t$result = $this->runAction(json_decode($job['request'], true), $jobId);\n\n\t\t\tif ($result !== true) {\n\t\t\t\t$job = $this->getStatus($jobId);\n\t\t\t\t$this->fail(array(\n\t\t\t\t\t'status_text' => $job['status_text'] . '<br>' . $result\n\t\t\t\t));\n\t\t\t}\n\t\t\t$this->finish(); // make sure it's finished if it's not finished or failed already\n\t\t} else {\n\t\t\t$this->fail(array('status_text' => 'Error: Request not found' . $jobId . var_export($job, true)));\n\t\t}\n\n\t\tYii::app()->end();\n\t}",
"public function voucherdetailsAction()\n {\n $purchaseId = $this->_getParam('purchase_id');\n $purchaseModel = new Core_Model_Finance_Purchase($purchaseId);\n $this->view->purchaseId = $purchaseId;\n $this->view->purchaseRecord = $purchaseModel->fetch();\n $this->view->purchaseItems = $purchaseModel->getVoucherItems();\n }",
"function edd_veritrans_notification(){\n\tglobal $edd_options;\n\n\trequire_once plugin_dir_path( __FILE__ ) . '/lib/Veritrans.php';\n\tif(edd_is_test_mode()){\n\t\t// set test credentials here\n\t\t// error_log('masuk test mode'); //debugan\n\t\tVeritrans_Config::$serverKey = $edd_options['vt_sandbox_api_key'];\n\t\tVeritrans_Config::$isProduction = false;\n\t}else {\n\t\t// set test credentials here\n\t\t// error_log('masuk production mode'); //debugan\n\t\tVeritrans_Config::$serverKey = $edd_options['vt_production_api_key'];\n\t\tVeritrans_Config::$isProduction = true;\n\t}\n\t// error_log('serverKey: '.Veritrans_Config::$serverKey); //debugan\n\t// error_log('isProduction: '.Veritrans_Config::$isProduction); //debugan\n\t\n\t$notif = new Veritrans_Notification();\n\t// error_log('$notif '.print_r($notif)); //debugan\n\n\t$transaction = $notif->transaction_status;\n\t$fraud = $notif->fraud_status;\n\t$order_id = $notif->order_id;\n\n\t// error_log('$order_id '.$order_id); //debugan\n\t// error_log('$fraud '.$fraud); //debugan\n\t// error_log('$transaction '.$transaction); //debugan\n\t\n\tif ($transaction == 'capture') {\n\t\tif ($fraud == 'challenge') {\n\t\t \t// TODO Set payment status in merchant's database to 'challenge'\n\t\t\tedd_update_payment_status($order_id, 'challenge');\n\t\t\t// error_log('challenge gan!'); //debugan\n\t\t}\n\t\telse if ($fraud == 'accept') {\n\t\t \tedd_update_payment_status($order_id, 'complete');\n\t\t\t// error_log('accepted gan!'); //debugan\n\t\t}\n\t}\n\telse if ($notif->transaction_status != 'credit_card' && $transaction == 'settlement') {\n\t\tedd_update_payment_status($order_id, 'complete');\n\t\t\t// error_log('accepted gan!'); //debugan\n\t}\n\telse if ($transaction == 'cancel') {\n\t\tedd_update_payment_status($order_id, 'cancel');\n\t\t\t// error_log('cancelled gan!'); //debugan\n\t}\n\telse if ($transaction == 'deny') {\n\t \tedd_update_payment_status($order_id, 'failed');\n\t\t\t// error_log('denied gan!'); //debugan\n\t}\n}",
"public function sendForVetting()\n\t{\n\t\t$this->status = self::STATUS_VETTING;\n\t\t$this->editable = false;\n\t\t$this->recallable = false;\n\t\t$this->save();\n\t}",
"public function testUpdateVoucher()\n {\n }",
"public function statusAction() {\n // Restrict to admins only\n $this->_adminsOnly();\n // Embedded JS\n queue_js_file('status');\n // Authentication status message\n $this->view->auth_status = $this->__getAuthStatusMessage();\n // Daemon status message\n $this->view->daemon_status = $this->__getDaemonStatusMessage();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if monster has heal buff and apply it | public function apply_heal_buff(){
foreach($this->get_buffs() as $buff){
if ( $buff["type"] == BUFF::HEAL ){
// Check if mob has unrecoverable debuff
foreach($this->get_debuffs() as $mydebuff){
if ( $mydebuff["type"]==DEBUFF::NOHEAL ) return false;
}
$maxHP = $this->fightStats[STATS::MAXHP];
$heal = round($maxHP * 0.15);
$newHP = $this->fightStats[STATS::HP] + $heal;
if ( $newHP > $maxHP ) $newHP = $maxHP;
$this->fightStats[STATS::HP] = $newHP;
return true;
}
}
return false;
} | [
"public function heal();",
"public function testLesserHealDoesDamage() {\r\n $this->assertEquals(30, $this->board->getOpponent()->getHero()->getHealth());\r\n\r\n // Add Auchenai Soulpriest to my battlefield\r\n $this->board->addToBattlefield(new AuchenaiSoulpriest(), $this->board->getMe());\r\n\r\n // Use hero power on opponent hero\r\n $this->board->getMe()->getHero()->useHeroPower($this->board->getOpponent()->getHero());\r\n\r\n // Assert that enemy hero health is 2 less == 28\r\n $this->assertEquals(28, $this->board->getOpponent()->getHero()->getHealth());\r\n }",
"public function buildHealFor(): int {\n $classBonus = $this->prophetHealingBonus($this->character) + $this->getVampiresHealingBonus($this->character);\n\n $classType = new CharacterClassValue($this->character->class->name);\n\n $healingAmount = $this->fetchHealingAmount();\n $dmgStat = $this->character->class->damage_stat;\n\n if ($classType->isVampire()) {\n $healingAmount += $this->character->{$dmgStat} - $this->character->{$dmgStat} * .025;\n }\n\n if ($classType->isProphet()) {\n $hasHealingSpells = $this->prophetHasHealingSpells($this->character);\n\n if ($hasHealingSpells) {\n $healingAmount += $this->character->{$dmgStat} * .025;\n }\n }\n\n return round($healingAmount + ($healingAmount * ($this->fetchSkillHealingMod() + $classBonus)));\n }",
"function get_heal_amount($w, $player, $tbName){\r\n\tglobal $petMaxHP, $petCurrHP, $oppMaxHP, $oppCurrHP;\r\n\t$con = connect_to_server();\r\n\t\r\n\tif($player == 'pet'){\r\n\t\t$maxHP = $petMaxHP;\r\n\t\t$currHP = $petCurrHP;\r\n\t}\r\n\telseif($player == 'opp'){\r\n\t\t$maxHP = $oppMaxHP;\r\n\t\t$currHP = $oppCurrHP;\r\n\t}\r\n\t\r\n\t$percentHealLimit = $maxHP - $currHP; //prevents percent-based healers from overhealing\r\n\t\r\n\t$sql = \"SELECT * FROM `$tbName` WHERE `id` = '$w'\";\r\n\t$result = mysqli_query($con, $sql);\r\n\t$result = mysqli_fetch_array($result);\r\n\t$useage = $result['useage'];\r\n\t$heal = $result['heal'];\r\n\t\r\n\t//check for conditional healing (cond,heal_true,heal_false) (istaff/wodf)\r\n\tif(substr($heal, 0, 1) == '('){\r\n\t\t$heal = str_replace(\"(\", \"\", $heal);\r\n\t\t$heal = str_replace(\")\", \"\", $heal);\r\n\t\t$heal = explode(\",\", $heal);\r\n\t\t$cond = $heal[0];\r\n\t\tif($cond > 1000){ //% condition\r\n\t\t\t$cond = ($cond - 1000) / 100;\r\n\t\t\t$hp = $currHP / $maxHP;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$hp = $currHP;\r\n\t\t}\r\n\t\t\r\n\t\t//set heal amount\r\n\t\tif($hp <= $cond){\r\n\t\t\t$heal = $heal[1];\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$heal = $heal[2];\r\n\t\t}\r\n\t}\r\n\telseif(strpos($heal, ',') !== false){\r\n\t\t$getFlag = explode(',', $heal);\r\n\t\t$heal = $getFlag[0];\r\n\t\t$flag = $getFlag[1];\r\n\t}\r\n\t\r\n\tif($heal > 1000){ //indicates percent healer\r\n\t\tif(!isset($flag)){\r\n\t\t\t$healPercent = ($heal - 1000) / 100;\r\n\t\t\t$healAmt = $maxHP * $healPercent;\r\n\t\t\tif($healAmt > $percentHealLimit){ //percent healers can't overheal\r\n\t\t\t\t$healAmt = $percentHealLimit;\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($flag == 'm'){ //heal based on missing health\r\n\t\t\t$healPercent = ($heal - 1000) / 100;\r\n\t\t\t$healAmt = ($maxHP - $currHP) * $healPercent;\r\n\t\t\tif($healAmt > $percentHealLimit){ //percent healers can't overheal\r\n\t\t\t\t$healAmt = $percentHealLimit;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//heal range\r\n\telseif(strpos($heal, \":\") !== false){\r\n\t\t$healRange = explode(\":\", $heal);\r\n\t\t$healMin = $healRange[0];\r\n\t\t$healMax = $healRange[1];\r\n\t\t$healAmt = rand($healMin, $healMax);\r\n\t}\r\n\telse{\r\n\t\t$healAmt = $heal;\r\n\t}\r\n\t\r\n\t//break\r\n\t\r\n\t\r\n\treturn $healAmt;\r\n}",
"private function attack() {\n\n $this->damage = $this->current_attacker->attack($this->current_attacker->strength, $this->current_defender->defence);\n\n }",
"public function applyDamage(){\n\t\treturn $this->getRandomApplyingDamageValue($this->minDmg, $this->maxDmg);\n\t}",
"public static function sumHealBonusWeapon(stdClass $data){\n\t\tif($data->weaponType==TYPE_NONE){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->weaponEnchant==ENCHANT_MW_NINE OR $data->weaponEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//base\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD_BASE : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\t\telseif($data->weaponBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_NEW : BONUS_WEAPON_NEW_PLAIN);\n\t\t}\n\n\t\t//+0 (old and current only)\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD_BASE : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusPlus AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\t\telseif($data->weaponBonusPlus AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_NEW : BONUS_WEAPON_NEW_PLAIN);\n\t\t}\n\n\t\t//fix (current and new only)\n\t\tif($data->weaponType!=TYPE_OLD AND $data->weaponBonusFix AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += BONUS_WEAPON_FIX;\n\t\t}\n\n\t\t//mw (current only)\n\t\tif($data->weaponType==TYPE_CURRENT AND $data->weaponBonusMw AND $data->weaponEnchant==ENCHANT_MW_TWELVE){\n\t\t\t$bonus += BONUS_WEAPON_OLD_MW;\n\t\t}\n\n\t\treturn $bonus;\n\t}",
"public abstract function damage();",
"public static function sumTargetHealBonus(stdClass $data){\n\t\t//limit max earrings to 2\n\t\tself::limit($data, array('oldEarrings', 'newEarrings'), 2);\n\n\t\tif(!$data->includeTargetBonus){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->chestEnchant==ENCHANT_MW_NINE OR $data->chestEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//earrings\n\t\t$bonus += $data->oldEarrings * BONUS_EARRING_OLD;\n\t\t$bonus += $data->newEarrings * BONUS_EARRING_NEW;\n\n\t\t//earring bonus stats\n\t\tif($data->earringBonusLeft){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusLeft);\n\t\t}\n\t\tif($data->earringBonusRight){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusRight);\n\t\t}\n\n\t\t//heart potion\n\t\tif($data->heartPotion){\n\t\t\t$bonus += BONUS_HEART_POTION;\n\t\t}\n\n\t\t//if chest is disabled, stop here\n\t\tif($data->chestType==TYPE_NONE){\n\t\t\treturn $bonus;\n\t\t}\n\n\t\t//base (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//+0 (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\t\telseif($data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN);\n\t\t}\n\n\t\treturn $bonus;\n\t}",
"public function damage() {\n return $this->damageMultiplier * $this->weapon->damage();\n }",
"private function recalculateDamageIncreaseByWeapon(){\n\t\t$this->damageIncreaseByWeapon = $this->getWeaponDamage();\n\t}",
"public function defenseLuck () {\n foreach ($this->specialSkills['defense'] as $name => $skill) {\n $randomLuck = rand(0, 100);\n if (($skill['chance'] > $randomLuck) && $skill['type'] == 'passive') {\n return $skill;\n }\n }\n return false;\n }",
"function doHealing($patient, $healer, $tool) {\n $healer = trim($healer);\n $patient = trim($patient);\n $tool = trim($tool);\n\n $result = array();\n\n if (!$this->checkPlayerInGame($patient)) {\n // attacker isn't in game, add them\n $this->addPlayer($patient);\n echo \"added patient {$patient} to game - {$this->getPlayersString()}\\n\";\n }\n\n if (!$this->checkPlayerInGame($healer)) {\n // victim isn't in game, add them\n $this->addPlayer($healer);\n echo \"added healer {$healer} to game - {$this->getPlayersString()}\\n\";\n }\n\n $tool = $this->getCleanToolName($tool);\n\n $toheal = rand(1, 1500);\n\n $decideIfSuccess = rand(1, 100);\n if ($decideIfSuccess < 50) {\n $isSuccess = true;\n } else {\n $isSuccess = false;\n }\n\n if ($isSuccess) {\n $newhp = $this->damagePlayer($patient, \"-\" . $toheal);\n $result['type'] = \"success\";\n } else {\n // decide if it should backfire or just fail\n $decideIfBackfire = rand(1, 100);\n if ($decideIfBackfire > 70) {\n // backfire!\n $newhp = $this->damagePlayer($healer, $toheal);\n if ($newhp == 0) {\n $result['type'] = \"fatalbackfire\";\n } else {\n $result['type'] = \"backfire\";\n }\n } else {\n $toheal = 0;\n $newhp = $this->damagePlayer($patient, 0);\n $result['type'] = \"fail\";\n }\n }\n\n $result[\"healing\"] = $toheal;\n $result[\"hp\"] = $newhp;\n $result[\"tool\"] = $tool;\n\n print_r($result);\n return $result;\n }",
"private function GetCharacterSpellBonusDamage() {\n $tmp_stats = array();\n $holySchool = SPELL_SCHOOL_HOLY;\n $minModifier = Utils::GetSpellBonusDamage($holySchool, $this->guid, $this->db);\n \n for ($i=1;$i<7;$i++) {\n $bonusDamage[$i] = Utils::GetSpellBonusDamage($i, $this->guid, $this->db);\n $minModifier = min($minModifier, $bonusDamage);\n }\n $tmp_stats['holy'] = round($bonusDamage[1]);\n $tmp_stats['fire'] = round($bonusDamage[2]);\n $tmp_stats['nature'] = round($bonusDamage[3]);\n $tmp_stats['frost'] = round($bonusDamage[4]);\n $tmp_stats['shadow'] = round($bonusDamage[5]);\n $tmp_stats['arcane'] = round($bonusDamage[6]);\n $tmp_stats['attack'] = -1;\n $tmp_stats['damage'] = -1;\n if($this->class == CLASS_HUNTER || $this->class == CLASS_WARLOCK) {\n $shadow = Utils::GetSpellBonusDamage(5, $this->guid, $this->db);\n $fire = Utils::GetSpellBonusDamage(2, $this->guid, $this->db);\n $tmp_stats['attack'] = Utils::ComputePetBonus(6, max($shadow, $fire), $this->class);\n $tmp_stats['damage'] = Utils::ComputePetBonus(5, max($shadow, $fire), $this->class);\n }\n $tmp_stats['fromType'] = null;\n return $tmp_stats;\n }",
"private function apply_debuff($debuff,$idMonster){\n\t\t\tif ( $this->effect_applies($this->playingMonster->get_fight_stat(STATS::PRE),$this->teams[$this->targetSide][$idMonster]->get_fight_stat(STATS::RES),$debuff[\"perCent\"]) ){\n\t\t\t\tif ( $this->verbose ) echo \"<br> \".DEBUFF::get_name($debuff[\"type\"]).\" on monster #\".$idMonster.\" for \".$debuff[\"turns\"].\" turns\";\n\t\t\t\t$debuff[\"src\"] = $this->idPlayingMonster;\n\t\t\t\t$this->teams[$this->targetSide][$idMonster]->add_debuff($debuff);\n\t\t\t}elseif ( $this->verbose ) echo \"<br> monster #\".$idMonster.\" resist \".DEBUFF::get_name($debuff[\"type\"]);\n\t\t}",
"public function getDefensiveHitChangeMod($target, $shooter, $pos, $turn, $weapon){\n return 0;\n }",
"public function hit()\n {\n if (($this->current_health - $this->damage) <= 0) {\n $this->current_health = 0;\n } else {\n $this->current_health = $this->current_health - $this->damage;\n }\n }",
"function skill_weapon_bonus(&$player_conf){\n \n $weapon_skill = 0; // initial bonus\n \n $filter = \"WHERE skill_id = {$player_conf['weapon']}\n AND player_id = {$player_conf['id']}\";\n \n $data = qdm_player_skills($filter); // player skills\n\n if( !empty($data) ){ \n \n $exp = $data[0]['exp'];\n $skill_data = calc_skill_exp($exp); // calc skill rank\n $weapon_skill = floor($skill_data['lvl'] / 2); // 2 per 1 dmg\n $player_conf['weapon_add'] = $player_conf['weapon_add'] + $weapon_skill;\n }\n \n \n // Check anatomy - rank 5 will give add dmg\n \n $filter = \"WHERE skill_id = \" . SKILL_ANATOMY . \"\n AND player_id = {$player_conf['id']}\";\n \n $data = qdm_player_skills($filter); // player skills\n\n if( !empty($data) ){ \n \n $exp = $data[0]['exp'];\n $skill_data = calc_skill_exp($exp); // calc skill rank\n $weapon_skill = $skill_data['lvl']; // 2 per 1 dmg\n \n if( $weapon_skill > 4 ){ $player_conf['weapon_add']++; }\n }\n \n}",
"function moraleModifier(&$objEnemy)\n\t{\n\t\t$fltMorale = $this -> morale + 10 * count($this -> arrVeterans) - $objEnemy -> enemyMoraleMod;\n\t\tif ($fltMorale > 49)\n\t\t\t$intBonus = min(floor($fltMorale / 15) + 1, 80);\n\t\telseif ($fltMorale < -49)\n\t\t\t$intBonus = max(floor($fltMorale / 15) - 1, -75);\n\t\tif (isset($intBonus))\n\t\t{\n\t\t\t$this -> attack *= 1 + $intBonus / 100;\n\t\t\t$this -> defense *= 1 + $intBonus / 100;\n\t\t}\n\t\tsetType($this -> attack, 'int');\n\t\tsetType($this -> defense, 'int');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getScheduledPlanLogTags' | protected function getScheduledPlanLogTagsRequest($scheduled_plan_log_id)
{
// verify the required parameter 'scheduled_plan_log_id' is set
if ($scheduled_plan_log_id === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $scheduled_plan_log_id when calling getScheduledPlanLogTags'
);
}
$resourcePath = '/beta/scheduledPlanLog/{scheduledPlanLogId}/tag';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($scheduled_plan_log_id !== null) {
$resourcePath = str_replace(
'{' . 'scheduledPlanLogId' . '}',
ObjectSerializer::toPathValue($scheduled_plan_log_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('API-Key');
if ($apiKey !== null) {
$headers['API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"private function getTagTypesRequest($accountId)\n {\n $resourcePath = \"/{accountId}/CallLogs/Tags\";\n\n $resourcePath = str_replace(\"{accountId}\", $accountId, $resourcePath);\n\n $requestUrl = $this->config->getHost() . $resourcePath;\n $request = new Request('GET', $requestUrl);\n\n return $request;\n }",
"function TestPlan_get_tags($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get_tags', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function getScheduledPlanLogTagsAsyncWithHttpInfo($scheduled_plan_log_id)\n {\n $returnType = '';\n $request = $this->getScheduledPlanLogTagsRequest($scheduled_plan_log_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function getScheduledPlanLogFilesRequest($scheduled_plan_log_id)\n {\n // verify the required parameter 'scheduled_plan_log_id' is set\n if ($scheduled_plan_log_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $scheduled_plan_log_id when calling getScheduledPlanLogFiles'\n );\n }\n\n $resourcePath = '/beta/scheduledPlanLog/{scheduledPlanLogId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($scheduled_plan_log_id !== null) {\n $resourcePath = str_replace(\n '{' . 'scheduledPlanLogId' . '}',\n ObjectSerializer::toPathValue($scheduled_plan_log_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createLogLogentriesRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $name = array_key_exists('name', $options) ? $options['name'] : null;\n $placement = array_key_exists('placement', $options) ? $options['placement'] : null;\n $response_condition = array_key_exists('response_condition', $options) ? $options['response_condition'] : null;\n $format = array_key_exists('format', $options) ? $options['format'] : '%h %l %u %t \"%r\" %>s %b';\n $format_version = array_key_exists('format_version', $options) ? $options['format_version'] : self::FORMAT_VERSION_v2;\n $port = array_key_exists('port', $options) ? $options['port'] : 20000;\n $token = array_key_exists('token', $options) ? $options['token'] : null;\n $use_tls = array_key_exists('use_tls', $options) ? $options['use_tls'] : null;\n $region = array_key_exists('region', $options) ? $options['region'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling createLogLogentries'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling createLogLogentries'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/logging/logentries';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n\n // form params\n if ($name !== null) {\n $formParams['name'] = ObjectSerializer::toFormValue($name);\n }\n // form params\n if ($placement !== null) {\n $formParams['placement'] = ObjectSerializer::toFormValue($placement);\n }\n // form params\n if ($response_condition !== null) {\n $formParams['response_condition'] = ObjectSerializer::toFormValue($response_condition);\n }\n // form params\n if ($format !== null) {\n $formParams['format'] = ObjectSerializer::toFormValue($format);\n }\n // form params\n if ($format_version !== null) {\n $formParams['format_version'] = ObjectSerializer::toFormValue($format_version);\n }\n // form params\n if ($port !== null) {\n $formParams['port'] = ObjectSerializer::toFormValue($port);\n }\n // form params\n if ($token !== null) {\n $formParams['token'] = ObjectSerializer::toFormValue($token);\n }\n // form params\n if ($use_tls !== null) {\n $formParams['use_tls'] = ObjectSerializer::toFormValue($use_tls);\n }\n // form params\n if ($region !== null) {\n $formParams['region'] = ObjectSerializer::toFormValue($region);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getCustomerTagsRequest()\n {\n $resourcePath = '/customer-tags';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listAllAccountLogsRequest()\n { \n $account_id = $this->config->getUsername();\n // verify the required parameter 'account_id' is set\n if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $account_id when calling listAllAccountLogs'\n );\n }\n\n $resourcePath = '/Accounts/{accountId}/Logs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'accountId' . '}',\n ObjectSerializer::toPathValue($account_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function getLogs()\n {\n $logs = [];\n $statusText = (new Code)->statusText;\n foreach ($this->resourceLogger as $resourceLog) {\n list($request, $response) = $resourceLog;\n $logs[] = [\n 'request' => $request->toUriWithMethod(),\n 'code' => \"{$response->code} {$statusText[$response->code]}\",\n 'body' => (string)$response\n ];\n }\n return $logs;\n }",
"public function actionIndex()\n {\n $searchModel = new TagLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"protected function getDuplicateScheduledPlanLogByIdRequest($scheduled_plan_log_id)\n {\n // verify the required parameter 'scheduled_plan_log_id' is set\n if ($scheduled_plan_log_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $scheduled_plan_log_id when calling getDuplicateScheduledPlanLogById'\n );\n }\n\n $resourcePath = '/beta/scheduledPlanLog/duplicate/{scheduledPlanLogId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($scheduled_plan_log_id !== null) {\n $resourcePath = str_replace(\n '{' . 'scheduledPlanLogId' . '}',\n ObjectSerializer::toPathValue($scheduled_plan_log_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function describeProductResourceTagKeyList($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->describeProductResourceTagKeyListWithOptions($request, $runtime);\n }",
"private function getLogsByDateRequest(string $accountId)\n {\n $resourcePath = \"/{accountId}/CallLogs/Date\";\n\n $resourcePath = str_replace(\"{accountId}\", $accountId, $resourcePath);\n\n $requestUrl = $this->config->getHost() . $resourcePath;\n $request = new Request('POST', $requestUrl);\n\n return $request;\n }",
"public function getSystemLogs(Request $request){\n \t\treturn $this->createGetResponse($request,(new Logs)->newQuery()\n ->orderBy('LOGS_ID','DESC'));\n \t}",
"public function getTagSqlParams()\n {\n\n return array('fields' => '* ',\n 'main_table' => LOG_TABLE,\n 'title' => 'title',\n 'comment' => 'comment',\n 'draft' => 'draft',\n 'date' => 'date',\n 'map_table' => LOG_TAG_MAP_TABLE,\n 'log_id' => 'log_id',\n 'tag_id' => 'tag_id',\n 'tag_name' => 'tag_name',\n 'tag_table' => LOG_TAG_TABLE\n );\n }",
"public function getLogLogentriesRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $logging_logentries_name = array_key_exists('logging_logentries_name', $options) ? $options['logging_logentries_name'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling getLogLogentries'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling getLogLogentries'\n );\n }\n // verify the required parameter 'logging_logentries_name' is set\n if ($logging_logentries_name === null || (is_array($logging_logentries_name) && count($logging_logentries_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $logging_logentries_name when calling getLogLogentries'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/logging/logentries/{logging_logentries_name}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n // path params\n if ($logging_logentries_name !== null) {\n $resourcePath = str_replace(\n '{' . 'logging_logentries_name' . '}',\n ObjectSerializer::toPathValue($logging_logentries_name),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getInvoiceWorksheetLineTagsRequest($invoice_worksheet_line_id)\n {\n // verify the required parameter 'invoice_worksheet_line_id' is set\n if ($invoice_worksheet_line_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_worksheet_line_id when calling getInvoiceWorksheetLineTags'\n );\n }\n\n $resourcePath = '/beta/invoiceWorksheetLine/{invoiceWorksheetLineId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($invoice_worksheet_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'invoiceWorksheetLineId' . '}',\n ObjectSerializer::toPathValue($invoice_worksheet_line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createLogLogglyRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $name = array_key_exists('name', $options) ? $options['name'] : null;\n $placement = array_key_exists('placement', $options) ? $options['placement'] : null;\n $format_version = array_key_exists('format_version', $options) ? $options['format_version'] : null;\n $response_condition = array_key_exists('response_condition', $options) ? $options['response_condition'] : null;\n $format = array_key_exists('format', $options) ? $options['format'] : '%h %l %u %t \"%r\" %>s %b';\n $token = array_key_exists('token', $options) ? $options['token'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling createLogLoggly'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling createLogLoggly'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/logging/loggly';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n\n // form params\n if ($name !== null) {\n $formParams['name'] = ObjectSerializer::toFormValue($name);\n }\n // form params\n if ($placement !== null) {\n $formParams['placement'] = ObjectSerializer::toFormValue($placement);\n }\n // form params\n if ($format_version !== null) {\n $formParams['format_version'] = ObjectSerializer::toFormValue($format_version);\n }\n // form params\n if ($response_condition !== null) {\n $formParams['response_condition'] = ObjectSerializer::toFormValue($response_condition);\n }\n // form params\n if ($format !== null) {\n $formParams['format'] = ObjectSerializer::toFormValue($format);\n }\n // form params\n if ($token !== null) {\n $formParams['token'] = ObjectSerializer::toFormValue($token);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function bulkTagCreateBulkTagRequest($request, $accountid)\n {\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling bulkTagCreateBulkTag'\n );\n }\n // verify the required parameter 'accountid' is set\n if ($accountid === null || (is_array($accountid) && count($accountid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accountid when calling bulkTagCreateBulkTag'\n );\n }\n\n $resourcePath = '/{accountid}/bulkTags';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($accountid !== null) {\n $resourcePath = str_replace(\n '{' . 'accountid' . '}',\n ObjectSerializer::toPathValue($accountid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getSubscriptionTagsRequest($subscriptionId, $includedDeleted = 'false', $audit = 'NONE')\n {\n // verify the required parameter 'subscriptionId' is set\n if ($subscriptionId === null || (is_array($subscriptionId) && count($subscriptionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $subscriptionId when calling getSubscriptionTags'\n );\n }\n\n $resourcePath = '/1.0/kb/subscriptions/{subscriptionId}/tags';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($includedDeleted !== null) {\n $queryParams['includedDeleted'] = ObjectSerializer::toQueryValue($includedDeleted);\n }\n // query params\n if ($audit !== null) {\n $queryParams['audit'] = ObjectSerializer::toQueryValue($audit);\n }\n\n // path params\n if ($subscriptionId !== null) {\n $resourcePath = str_replace(\n '{' . 'subscriptionId' . '}',\n ObjectSerializer::toPathValue($subscriptionId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n } elseif (is_array($httpBody) && $headers['Content-Type'] === 'application/json') {\n $httpBody = array_map(function($value) {\n return ObjectSerializer::sanitizeForSerialization($value);\n }, $_tempBody);\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Killbill-ApiKey');\n if ($apiKey !== null) {\n $headers['X-Killbill-ApiKey'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Killbill-ApiSecret');\n if ($apiKey !== null) {\n $headers['X-Killbill-ApiSecret'] = $apiKey;\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a session based authentication guard. | public function createSessionDriver( $name, $config )
{
$provider = $this->createUserProvider( $config['provider'] );
$guard = new SessionGuard( $name, $provider, Framework::get( 'session.store' ) );
// When using the remember me functionality of the authentication services we
// will need to be set the encryption instance of the guard, which allows
// secure, encrypted cookie values to get generated for those cookies.
if ( method_exists( $guard, 'setCookieJar' ) )
$guard->setCookieJar( Framework::get( 'http.factory' )->cookieJar() );
if ( method_exists( $guard, 'setRequest' ) )
$guard->setRequest( Framework::get( 'http.factory' )->request() );
return $guard;
} | [
"public function useSessionAuth();",
"public function createSessionDriver($name, $config)\n {\n $provider = $this->createUserProvider($config['provider']);\n\n $guard = new SessionGuard($name, $provider, $this->app->make('session.store'));\n\n // When using the remember me functionality of the authentication services we\n // will need to be set the encryption instance of the guard, which allows\n // secure, encrypted cookie values to get generated for those cookies.\n\n if (\\method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app->make('cookie'));\n }\n\n if (\\method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app->make('events'));\n }\n\n if (\\method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n return $guard;\n }",
"public function createSession();",
"public function createSessionDriver($name, $config)\n {\n $provider = $this->createUserProvider($config['provider'] ?? null);\n\n $guard = new SessionGuard(\n $name,\n $provider,\n $this->app['session.store'],\n );\n\n // When using the remember me functionality of the authentication services we\n // will need to be set the encryption instance of the guard, which allows\n // secure, encrypted cookie values to get generated for those cookies.\n if (method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app['cookie']);\n }\n\n if (method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app['events']);\n }\n\n if (method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n if (isset($config['remember'])) {\n $guard->setRememberDuration($config['remember']);\n }\n\n return $guard;\n }",
"protected function createSession()\r\n {\r\n return new Backend_Session();\r\n }",
"protected function guard()\n {\n $guard = $this->getGuard();\n return Auth::guard($guard);\n }",
"public static function createLoginSession()\n {\n //check if user have an existent logging instance in the database\n $getHash = Cookie::get(REM_COOKIE_NAME);\n $record = databaseAPI::getInstance()->selectData(\"*\", [ ['hash', '=',$getHash] ], \"sessions\");\n if (empty($record))\n self::clearLoggedTrace();\n else\n Session::set(LOGIN_SESSION_NAME, $record[0]->user_id);\n }",
"protected function guard() {\n return Auth::guard($this->guard);\n }",
"protected function initSession()\n {\n $this->di->setShared(\n 'session',\n function () {\n $session = new Session;\n $session->start();\n\n return $session;\n }\n );\n }",
"protected function createSessionDriver()\n {\n return $this->buildSession(new SessionHandler());\n }",
"public static function factory() {\n\t\treturn new Auth;\n\t}",
"protected function guard()\n {\n return Auth::guard($this->guard);\n }",
"protected function guard() {\n return Auth::guard('web_artist');\n }",
"protected function createCookieDriver()\n {\n $lifetime = $this->app['config']['session.lifetime'];\n return $this->buildSession(new CookieSessionHandler($this->app['cookie'], $lifetime));\n }",
"public static function session() {}",
"public function create() {\n if (!isset($_SESSION)) {\n session_start();\n }\n \n }",
"private function sessionAuthenticate() {\n require_once('User.php');\n $this->_user = new User($this->_registry, intval($_SESSION['authSessionUid']), '', '');\n if ($this->_user->isValid()) {\n if ($this->_user->isActive() == false) {\n $this->_loggedIn = false;\n $this->_loginFailureReason = 'inactive';\n } else {\n $this->_loggedIn = true;\n // transfers basket content to user if products are added to basket before login\n $this->_registry->getModel('basket')->transferToUser($this->_user->getUserId());\n session_regenerate_id();\n $this->_userId = $this->_user->getUserId();\n }\n } else {\n $this->_loggedIn = false;\n $this->_loginFailureReason = 'nouser';\n }\n if ($this->_loggedIn == false) {\n $this->logout();\n }\n }",
"protected function _initAuth()\n {\n //$session->setExpirationSeconds(60 * 60 * 24); // = 1 day\n $this->bootstrap('session');\n\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session());\n Zend_Registry::set('auth', $auth);\n }",
"protected function createSessionHandler(): SessionHandlerInterface {\n return new SessionHandler();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a localized meridiem. The meridiem param can be one of the Localization::MERIDIEM_ constants. | public static function getMeridiem($meridiem)
{
if (isset(self::$map[LocalizationMap::MERIDIAMS][$meridiem])) {
return self::$map[LocalizationMap::MERIDIAMS][$meridiem];
}
} | [
"public function get_meridiem( $meridiem ) {\n\t\treturn $this->meridiem[ $meridiem ];\n\t}",
"public function get_meridiem($meridiem)\n {\n }",
"private static function setMeridiams()\n {\n $m = self::$map;\n $m[self::MERIDIAMS][self::MERIDIEM_AM_LOWER] = t('am');\n $m[self::MERIDIAMS][self::MERIDIEM_PM_LOWER] = t('pm');\n $m[self::MERIDIAMS][self::MERIDIEM_AM_UPPER] = t('AM');\n $m[self::MERIDIAMS][self::MERIDIEM_PM_UPPER] = t('PM');\n self::$map = $m;\n }",
"public function getMercrediPMdeb() {\n return $this->mercrediPMdeb;\n }",
"function get_hora_meridiano($hora){\n\t$hora = explode(\":\",$hora);\n\t$h = $hora[0];\n\t$m = $hora[1];\n\tif($h > 12){\n\t\t$h = $h - 12;\n\t\tif($h < 10){\n\t\t\t$h = '0'.$h;\n\t\t}\n\t\t$h = $h.':'.$m.' pm';\t\t\n\t}else{\n\t\tif($h == 12){\n\t\t\t$h = $h.':'.$m.' m';\n\t\t}else{\n\t\t\t$h = $h.':'.$m.' am';\n\t\t}\t\t\n\t}\n\treturn $h;\n}",
"function getMeridienByPathologie(){\n return(($this->_db)->query(\"SELECT patho.idP, patho.desc, meridien.nom FROM patho\n JOIN meridien ON patho.mer = meridien.code\n ORDER BY patho.idP\")->fetchAll(PDO::FETCH_ASSOC));\n }",
"function obtener_id_materia($id_materia_periodo_lectivo){\n $oDB=$this->getDB();\n $sQuery=\"SELECT id_materia from ul_materia_periodo_lectivo where id=$id_materia_periodo_lectivo\";\n $result=$oDB->getFirstRowQuery($sQuery);\n $str=\"\";\n if(is_array($result) && count($result)>0){\n $str=$result[0];\n }\n return $str;\n }",
"function getLocalizedMohGrant() {\r\n\t\treturn $this->getLocalizedData('mohGrant');\r\n\t}",
"public function getSemuaMahasiswa(){\n $mahasiswa = Dosen::find(1)->mahasiswa()->get();\n return $mahasiswa;\n }",
"public function fcpoGetMandateText() \n {\n $aMandate = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoMandate');\n\n $blMandateTextValid = (\n $aMandate &&\n array_key_exists('mandate_status', $aMandate) !== false &&\n $aMandate['mandate_status'] == 'pending' &&\n array_key_exists('mandate_text', $aMandate) !== false\n );\n\n $mReturn = false;\n if ($blMandateTextValid) {\n $mReturn = urldecode($aMandate['mandate_text']);\n }\n\n return $mReturn;\n }",
"public static function get_mce_locale()\n {\n }",
"function getText($id, $locale='') {\n\n global $SM_clientLocale;\n\n // set default_locale\n if (!empty($this->directive['defaultLocale'])) {\n $default_locale = $this->directive['defaultLocale'];\n }\n else { \n $default_locale = $GLOBALS['SM_defaultLocale'];\n }\n \n // try to decide which locale to use\n if ($locale == '') { \n\n if (($this->siteConfig->getVar('localization','useClientLocale'))&& \n (isset($SM_clientLocale))) {\n // use locale specified by browser. might be array\n $locale = $SM_clientLocale;\n\n }\n elseif (!empty($this->directive['defaultLocale'])) {\n $locale = $this->directive['defaultLocale'];\n }\n else { \n $locale = $GLOBALS['SM_defaultLocale'];\n }\n }\n\n // if after all that, we still don't have a locale, default to us, english\n if (($locale == '')||( (is_array($locale))&&(sizeof($locale) == 0) )) {\n $locale = 'en_US';\n $default_locale = $locale;\n }\n\n // loop through $locale if it's an array, return first value found\n if (is_array($locale)) {\n $lSearch = '';\n foreach ($locale as $l) {\n // force proper format\n if (strlen($l) > 2) {\n if ($l{2} == '-') {\n $l{2} = '_';\n }\n list($lang, $country) = split('_',$l,2);\n $l = strtolower($lang).'_'.strtoupper($country);\n }\n $lSearch .= $l.',';\n if (isset($this->liText[$l][$id]))\n return $this->liText[$l][$id];\n }\n // no translation text found for this locale...\n // -> use default_locale\n $this->debugLog(\"no translation found for $lSearch (using default_locale $default_locale)\");\n return $this->liText[$default_locale][$id];\n }\n else {\n // force proper format\n if (strlen($locale) > 2) {\n if ($locale{2} == '-') {\n $locale{2} = '_';\n }\n list($lang, $country) = split('_',$locale,2);\n $locale = strtolower($lang).'_'.strtoupper($country);\n }\n if (isset($this->liText[$locale][$id])) {\n return $this->liText[$locale][$id];\n }\n else {\n // browser returns no locale at all ...\n // -> use default_locale\n $this->debugLog(\"browser returns no localization informations (using default_locale $default_locale)\");\n return $this->liText[$default_locale][$id];\n }\n }\n\n }",
"public function getApellidoM()\n {\n return $this->apellidoM;\n }",
"function get_materia($idMateria)\n {\n return $this->db->get_where('materias',array('idMateria'=>$idMateria))->row_array();\n }",
"function meridianSelector($selected=null) {\n return HtmlUtils::selector(array(\n HtmlUtils::option(__('GLOBAL.AM', 'AM', 1), 'AM', $selected == 'AM' ? 1 : 0),\n HtmlUtils::option(__('GLOBAL.PM', 'PM', 1), 'PM', $selected == 'PM' ? 1 : 0)\n ),\n 'meridian'\n );\n }",
"public function getCodePostalMariage(): ?string {\n return $this->codePostalMariage;\n }",
"public static function get_mce_locale() {\n\t\tif ( empty( self::$mce_locale ) ) {\n\t\t\t$mce_locale = get_user_locale();\n\t\t\tself::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1.\n\t\t}\n\n\t\treturn self::$mce_locale;\n\t}",
"private function getDiaSemana(){\r\n\t\t\r\n\t\t$dia_semana = Date(\"w\");\r\n\t\t$dia_semana++;\r\n\t\t\r\n\t\tswitch ($dia_semana){\r\n\t\t\tcase 1:\r\n\t\t\t\t$dia = \"Domingo, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\t$dia = \"Segunda-feira, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\t$dia = \"Terça-feira, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\t$dia = \"Quarta-feira, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\t$dia = \"Quinta-feira, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6:\r\n\t\t\t\t$dia = \"Sexta-feira, \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t$dia = \"Sábado, \";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $dia;\r\n\t}",
"public function getSummer()\n\t{\n\t\treturn $this->summer;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Report Sts By Id | public function report($id)
{
//
} | [
"public static function report($id)\r\n\t{\r\n\t\t$student = DB::first('SELECT s.id AS id, \r\n\t\t\t\t\t\t\t \ts.first_name AS first_name, \r\n\t\t\t\t\t\t\t \ts.last_name AS last_name,\r\n\t\t\t\t\t\t\t \ts.email AS email,\r\n\t\t\t\t\t\t\t \tcap.catalog AS catalog,\r\n\t\t\t\t\t\t\t \tcap.degree AS degree,\r\n\t\t\t\t\t\t\t \tcap.major_1 AS major,\r\n\t\t\t\t\t\t\t \tcap.gpa AS gpa,\r\n\t\t\t\t\t\t\t \tcap.total_credits AS total_credits,\r\n\t\t\t\t\t\t\t \treport.report_term AS report_term,\r\n\t\t\t\t\t\t\t \treport.notes AS notes,\r\n\t\t\t\t\t\t\t \treport.updated_at AS updated_at,\r\n\t\t\t\t\t\t\t \tstat.id AS status_id,\r\n\t\t\t\t\t\t\t \tstat.status_type AS status \t\r\n\t\t\t\t\t\t\tFROM grad_app.student s\r\n\t\t\t\t\t\t\tLEFT JOIN grad_app.capp_report cap ON s.id = cap.student_id\r\n\t\t\t\t\t\t\tLEFT JOIN grad_app.app_report_status report ON s.id = report.student_id\r\n\t\t\t\t\t\t\tLEFT JOIN grad_app.status stat ON report.status_id = stat.id\r\n\t\t\t\t\t\t\tWHERE s.id = ?', array($id));\r\n\t\treturn $student;\r\n\t}",
"public function exportTranscripts($id){}",
"function get_report_by_id($id) {\n return ilp_report::from_id($id);\n }",
"function get_data_views_for_report_by_id($id){\n\tglobal $workbooks;\n\t$result = $workbooks->assertGet('/reporting/data_views.api', array( \n\t'_ff[]' => 'report_id',\n\t'_ft[]' => 'eq',\n\t'_fc[]' => $id));\n $workbooks->log('Result', $result, 'debug', 200000); //log 200000 characters of the result. This is more than the default logging, may be too noisy.\n\treturn $result;\n}",
"public function getReportId();",
"function series_by_id($id){\n\n\t\t$return = $this->get_limited(\"code\", $id);\n\n\t\treturn $return;\n\t}",
"public function find($id)\n {\n $query=\"SELECT id,\".\n \"link,\".\n \"entity0,\".\n \"entity1,\".\n \"edits_pending,\".\n \"last_updated,\".\n \"link_order,\".\n \"entity0_credit,\".\n \"entity1_credit \". \t\t \n\t \"FROM l_instrument_series \".\n\t \"WHERE id=\".$id;\n\n return($this->selectDB($query, \"L_instrument_series\"));\n }",
"public function finances($id, $year) \n {\n Orphan::find($id)->financialReport($year)->output(\"report-$id-$year.pdf\", 'D');\n }",
"public function series(string $id)\n {\n return $this->request(\"series/{$id}\");\n }",
"public function dailyReportSKdTest()\n {\n $this->dailyReportSKd();\n\n }",
"public static function detailSprint($id){\n $record = DB::table('sprint AS s')\n ->select('s.name')\n ->where('s.id', '=', $id)\n ->first();\n return $record;\n }",
"public function fetchSingleShipData($id);",
"function get_report($id)\n {\n return $this->db->get_where('report', array('id' => $id))->row_array();\n }",
"function mySeriesData($stationId) {\n global $page, $db, $user;\n\t\tif(!$page->loggedIn())\n return NULL; // not logged in yet\n $stationId = sotf_Utils::magicQuotes($stationId);\n $sql = \"SELECT s.id AS id, s.name AS name FROM sotf_series s, sotf_user_permissions u\".\n \" WHERE u.user_id = '$user->id' AND u.object_id=s.id\";\n if ($stationId) $sql .= \" AND s.station_id='$stationId'\";\n $sql .= \" ORDER BY s.name\";\n $sdata = $db->getAll($sql);\n return $sdata;\n }",
"function export($id)\n {\n $this->load->model('event_model');\n $talks = $this->event_model->getEventFeedback($id);\n\n $fp = fopen('php://memory', 'w+');\n foreach ($talks as $k => $v) {\n fputcsv($fp, (array)$v);\n }\n\n rewind($fp);\n $out = stream_get_contents($fp);\n fclose($fp);\n\n header('Content-type: application/octet-stream');\n header(\n 'Content-Disposition: attachment; filename=\"Event_Comments_' .\n $id . '.csv\"'\n );\n\n echo $out;\n }",
"public function report($id)\n {\n $prefix = $this->prefixPenomoran->findBy('formulir', '=', PrefixPenomoran::FORMULIR_BKU_PENERIMAAN);\n $prefixPenomoran = explode('/', $prefix->format_penomoran);\n $bku = $this->bku->findBy('id', '=', $id, ['*'], [\n 'unitKerja', 'bkuRincian.unitKerja', 'bkuRincian.sts.unitKerja', 'bkuRincian.sp2d.unitKerja', \n 'bkuRincian.setorPajak.pajak', 'bkuRincian.kontrapos.unitKerja'\n ]);\n\n $where = function ($query) use($bku) {\n $query->where('kode_unit_kerja', $bku->kode_unit_kerja);\n };\n $saldoAwal = $this->saldoAwal->get(['*'], $where, ['saldoAwalRincian']);\n\n $saldoAwal = $saldoAwal->sum(function ($item) {\n return $item->saldoAwalRincian->sum('debet');\n });\n\n if ($bku->nomor_otomatis) {\n $nomorFix = nomor_fix($prefixPenomoran, $bku->nomor, $bku->kode_unit_kerja);\n $bku->nomorfix = $nomorFix;\n\n } else {\n $bku->nomorfix = $bku->nomor;\n }\n\n $totalPenerimaan = 0;\n $totalPengeluaran = 0;\n\n foreach ($bku->bkuRincian as $value) {\n $totalPenerimaan += $value->penerimaan;\n $totalPengeluaran += $value->pengeluaran;\n }\n\n $datetime = new \\DateTime($bku->tanggal);\n $yesterday = date('Y-m-d', strtotime('yesterday', strtotime($bku->tanggal)));\n $bku->yesterday = $yesterday;\n\n $date = Carbon::createFromDate(date('Y'), date('m'), date('d'));\n $startOfYear = $date->copy()->startOfYear()->format('Y-m-d');\n\n $bkuYesterDay = $this->bku->reportBku($bku->kode_unit_kerja, $startOfYear, $bku->yesterday);\n $bkuToday = $this->bku->reportBku($bku->kode_unit_kerja, $startOfYear, $bku->tanggal);\n \n $totalPenerimaanYesterday = $bkuYesterDay->sum(function ($item) {\n return $item->bkuRincian->sum('penerimaan');\n });\n\n $totalPengeluaranYesterday = $bkuYesterDay->sum(function ($item) {\n return $item->bkuRincian->sum('pengeluaran');\n });\n\n $totalPenerimaanToday = $bkuToday->sum(function ($item) {\n return $item->bkuRincian->sum('penerimaan');\n });\n\n $totalPengeluaranToday = $bkuToday->sum(function ($item) {\n return $item->bkuRincian->sum('pengeluaran');\n });\n\n $kontraPos = 0;\n\n $pejabat = $this->pejabatUnit->getAllPejabat($bku->kode_unit_kerja);\n $ppk = clone $pejabat;\n $ppk = $ppk->where('jabatan_id', 2)->first();\n \n $pdf = PDF::loadview('admin.report.form_bku', compact(\n 'bku', 'totalPenerimaan', 'totalPengeluaran', 'totalPenerimaanYesterday', 'totalPengeluaranYesterday',\n 'totalPenerimaanToday', 'totalPengeluaranToday', 'saldoAwal', 'ppk'\n ));\n return $pdf->stream('report-bku.pdf', ['Attachment' => false]);\n }",
"public function getById($id)\n {\n $export = $this->entityManager->getRepository(\n get_class($this->exportEntity)\n )->findBy(array('id' => $id));\n if (empty($export)) {\n throw new SmsException(_('Export error'));\n }\n return $export[0];\n }",
"public function getSaleById($id);",
"public function getCrqsas($id){\n\n $crqsas = Patient::find($id)->crq_sas()->first();\n info($crqsas);\n\n return $crqsas;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all widgets that are enabled for a particular page, grouped by location and insert position | public function getEnabledPageWidgetsGrouped($page)
{
$results = $this->getEntityManager()->createQuery('
SELECT w
FROM DeskPRO:Widget w
LEFT JOIN w.plugin p
WHERE w.page = :page AND w.enabled = 1
AND (p.enabled = 1 OR p.enabled IS NULL)
')->execute(array('page' => $page));
$output = array();
foreach ($results AS $widget) {
$output[$widget->page_location][$widget->insert_position][] = $widget;
}
return $output;
} | [
"function widgets()\n {\n $this->assertPageInited();\n\n // construct a list of all widgets that are in our instances list.\n $widgets = array();\n foreach ($this->instances as $id => $obj) {\n if (!($obj instanceof WFWidget)) continue;\n $widgets[$id] = $obj;\n }\n\n return $widgets;\n }",
"public static function GetAllActiveWidgets() {\r\n global $core;\r\n $widgets = array();\r\n foreach ($core->widgetTpl->getPath() as $templateFolder) {\r\n $widgetFilesForFolder = @glob($templateFolder.'/*.widget.html');\r\n if (!is_array($widgetFilesForFolder))\r\n continue;\r\n foreach ($widgetFilesForFolder as $widgetFile) {\r\n $widgetId = basename($widgetFile,'.widget.html');\r\n if (!isset($widgets[$widgetId]))\r\n $widgets[$widgetId] = $widgetFile;\r\n }\r\n }\r\n return $widgets;\r\n }",
"public function getWidgets();",
"private function available_widgets() {\n\t\tglobal $wp_registered_widget_controls;\n\t\t$widget_controls = $wp_registered_widget_controls;\n\t\t$available_widgets = array();\n\n\t\tforeach ( $widget_controls as $widget ) {\n\t\t\tif ( ! empty( $widget['id_base'] ) && ! isset( $available_widgets[ $widget['id_base'] ] ) ) {\n\t\t\t\t$available_widgets[ $widget['id_base'] ]['id_base'] = $widget['id_base'];\n\t\t\t\t$available_widgets[ $widget['id_base'] ]['name'] = $widget['name'];\n\t\t\t}\n\t\t}\n\t\treturn apply_filters( 'LaStudio_Importer/widgets/available_widgets', $available_widgets );\n\t}",
"function available_widgets() {\n\n\t \tglobal $wp_registered_widget_controls;\n\n\t \t$widget_controls = $wp_registered_widget_controls;\n\n\t \t$available_widgets = array();\n\n\t \tforeach ( $widget_controls as $widget ) {\n\n\t \t\tif ( ! empty( $widget['id_base'] ) && ! isset( $available_widgets[$widget['id_base']] ) ) { // no dupes\n\n\t \t\t\t$available_widgets[$widget['id_base']]['id_base'] = $widget['id_base'];\n\t \t\t\t$available_widgets[$widget['id_base']]['name'] = $widget['name'];\n\n\t \t\t}\n\n\t \t}\n\n\t \treturn $available_widgets;\n\n\t }",
"public function getWidgets() {\n $aHomeWidgets = [];\n\n # Get all widgets from database\n $oWidgetsDB = CoreController::$aCoreTables['core-widget']->select();\n if(count($oWidgetsDB) > 0) {\n foreach($oWidgetsDB as $oWid) {\n $aHomeWidgets[] = $oWid;\n }\n }\n return $aHomeWidgets;\n }",
"protected function widgets() {\n return array();\n }",
"function all_active_widgets() {\n\n\t\t$arr = array();\n\n\t\tfor ( $i = 1; $i <= $this->max_widgets ; $i++ ) {\n\t\t\tif ( is_active_sidebar( 'footer-' . $i ) ) {\n\t\t\t\t$arr[] = $i;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\n\t}",
"public function get_active_widgets() {\n\n global $wp_meta_boxes;\n\n // This lovely, crazy loop is what gathers all of the widgets and organizes it into MY array\n foreach ( $wp_meta_boxes['dashboard'] as $context => $priorities ) {\n foreach ( $priorities as $priority => $widgets ) {\n foreach ( $widgets as $id => $values ) {\n $this->active_widgets[ $id ]['title'] = $values['title'];\n $this->active_widgets[ $id ]['context'] = $context;\n $this->active_widgets[ $id ]['priority'] = $priority;\n $this->active_widgets[ $id ]['callback'] = $values['callback'];\n }\n }\n }\n\n // Add CD widgets to for continuity\n foreach ( self::$_cd_widgets as $ID => $widget ) {\n $this->active_widgets[ $ID ] = $widget;\n }\n\n // Only update for Admin\n if ( current_user_can( 'manage_options' ) ) {\n\n // Update these values so that we can signal the user on the widgets page to come back here\n $active_plugins = get_option( 'active_plugins' );\n update_option( 'cd_active_plugins', $active_plugins );\n update_option( 'cd_active_widgets', $this->active_widgets );\n }\n }",
"public function findWidgetsByPage($page = null)\n {\n $query = $this->getEntityManager()->createQueryBuilder()\n ->addSelect('w.id')\n ->addSelect('widget.id as wid')\n ->addSelect('widget.name')\n ->addSelect('w.config')\n ->addSelect('w.data')\n ->addSelect('w.dataType')\n ->addSelect('w.tplArea')\n ->addSelect('widget.macros')\n ->from(PageWidget::class, 'w')\n ->leftJoin(Widget::class, 'widget', 'WITH', 'w.widget = widget.id')\n ->where(\"w.page = :page\")\n ->setParameter('page', $page)\n ->getQuery();\n\n return $query->getResult();\n }",
"public function getWidgetAreas() {\n $areas = $this->website->getThemeManager()->getCurrentThemeMeta()->getWidgetAreas($this->website);\n $areas[1] = $this->website->t(\"widgets.the_homepage\");\n return $areas;\n }",
"public function getAuthorizedWidgets() : array;",
"public static function getAllAvailableWidgets() : array\n {\n /**\n * First we get the list of modules\n */\n $Modules = self::getModulesListInformation();\n\n $WidgetsDefinitions = [];\n foreach( $Modules AS $module ){\n try{\n $ModuleDefinition = Module::loadModuleDefinition( $module-> name ); // I hope it has a definition\n /**\n * If the module definition has widgets, we can show them here.\n */\n if( isset($ModuleDefinition -> widgets) && is_array( $ModuleDefinition -> widgets ) ){\n foreach( $ModuleDefinition -> widgets AS $widget ){\n $aux = new DModuleWidgetDefinition( $module->name , $widget -> name , $widget -> label , $widget -> description );\n $aux -> setLabel( $widget->label );\n /**\n * After creating the widget definition, we can send it to the array\n */\n $WidgetsDefinitions[] = $aux;\n }\n }\n }catch(\\Exception $err){} catch (\\Error $err){}\n\n }\n return $WidgetsDefinitions;\n }",
"public static function get_all_widgets() {\r\n\t\t$ret = array(\r\n\t\t\tself::WIDGET_ACCORDION,\r\n\t\t\tself::WIDGET_DATEPICKER,\r\n\t\t\tself::WIDGET_DIALOG,\r\n\t\t\tself::WIDGET_PROGRESSBAR,\r\n\t\t\tself::WIDGET_SLIDER,\r\n\t\t\tself::WIDGET_TABS,\r\n\t\t\tself::WIDGET_AUTOCOMPLETE\r\n\t\t);\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\t$ret[] = self::WIDGET_BUTTON; \r\n\t\t}\r\n\t\treturn $ret;\r\n\t}",
"function listWidgetAreas() {\n\tglobal $mbp_config;\n\n\t$list = '';\n\t$x = 1;\n\t$widgetAreas = unserialize( $mbp_config['ftsmbp_widget_areas'] );\n\tksort( $widgetAreas );\n\n\tforeach ( $widgetAreas as $area => $name ) {\n\t\t$list .= '\n\t\t\t<div class=\"box' . ( ( $x > 1 ) ? ' closed' : '' ) . '\">\n\t\t\t\t<div class=\"box-header\">\n\t\t\t\t\t<div class=\"sidebar-name-arrow\"> </div>\n\t\t\t\t\t<h3>' . __( $name ) . '</h3>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"box-content widgets-sortables ui-sortable\" style=\"min-height: 98px;\" id=\"' . $area . '\">\n\t\t\t\t\t' . listWidgetsByArea( $area ) . '\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t$x ++;\n\t}\n\n\treturn $list;\n}",
"public function getAvailableWidgets()\n {\n return array(\n array(\n 'title' => \"Text Widget\",\n \"id\" => \"\",\n \"bundle\" => \"ArnmContent\",\n \"controller\" => \"Text\"\n ),\n array(\n 'title' => \"Html Widget\",\n \"id\" => \"\",\n \"bundle\" => \"ArnmContent\",\n \"controller\" => \"Html\"\n ),\n array(\n 'title' => \"Menu Widget\",\n \"id\" => \"\",\n \"bundle\" => \"ArnmMenu\",\n \"controller\" => \"PlainMenu\"\n ),\n array(\n 'title' => \"Slide Show Widget\",\n \"id\" => \"\",\n \"bundle\" => \"MediaContent\",\n \"controller\" => \"SlideShow\"\n ),\n array(\n 'title' => \"Small Slide Show Widget\",\n \"id\" => \"\",\n \"bundle\" => \"MediaContent\",\n \"controller\" => \"SmallSlideShow\"\n ),\n array(\n 'title' => \"Filmstrip Widget\",\n \"id\" => \"\",\n \"bundle\" => \"MediaContent\",\n \"controller\" => \"FilmStrip\"\n ),\n array(\n 'title' => \"Showcase Collections List Widget\",\n \"id\" => \"\",\n \"bundle\" => \"ArnmCatalog\",\n \"controller\" => \"CollectionsList\"\n ),\n array(\n 'title' => \"Showcase Container Widget\",\n \"id\" => \"\",\n \"bundle\" => \"ArnmCatalog\",\n \"controller\" => \"ShowcaseContainer\"\n )\n );\n }",
"public function getWidgetList()\n {\n // Register this request\n $register = MageBridgeModelRegister::getInstance();\n $id = $register->add('api', 'magebridge_widget.list');\n\n // Send the request to the bridge\n $bridge = MageBridgeModelBridge::getInstance();\n $bridge->build();\n $list = $bridge->getAPI('magebridge_widget.list');\n return $list;\n }",
"public function getAllWidgetsFromArea($area){\n\t\treturn $this->_widgets[$area];\n\t}",
"public function get_widgets_in_position($profile_position){\n\n $widgets = wp_get_sidebars_widgets();\n\n $result_widgets = array();\n\n foreach($widgets as $position => $list) {\n\n // SKIP if the position name does not start with peepso\n if ('peepso' != substr($position,0,6)){\n continue;\n }\n\n // SKIP if the position is empty\n if (!count($list)) {\n continue;\n }\n\n $widget_instances = array();\n\n // loop through widgets in a position\n foreach($list as $widget) {\n\n // SKIP if the widget name does not contain \"peepsowidget\"\n if (!stristr($widget, 'peepsowidget')) {\n continue;\n }\n\n // remove \"peepsowidget\"\n $widget = str_ireplace('peepsowidget', '', $widget);\n\n // extract last part of class name and id of the instance\n // eg \"videos-1\" becomes \"videos\" and \"1\"\n $widget = explode('-', $widget);\n\n $widget_class = 'PeepSoWidget'.ucfirst($widget[0]);\n $widget_instance_id = $widget[1];\n\n // to avoid creating multiple instances use the local aray to store repeated widgets\n if (!array_key_exists($widget_class, $widget_instances) && class_exists($widget_class)) {\n $widget_instance = new $widget_class;\n $widget_instances[$widget_class] = $widget_instance->get_settings();\n }\n\n // load the instance we are interested in (eg PeepSoVideos 1)\n if (array_key_exists($widget_class, $widget_instances)){\n $current_instance = $widget_instances[$widget_class][$widget_instance_id];\n } else {\n continue;\n }\n // SKIP if the instance isn't in a valid position\n if (!isset($current_instance['position']) || $current_instance['position'] != $profile_position) {\n continue;\n }\n\n $current_instance['widget_class'] = $widget_class;\n\n // add to result array\n $result_widgets[]=$current_instance;\n }\n }\n\n return $result_widgets;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: main_menu Inputs: $current_project, $current_phase Outputs: none Returns: nothing Description: | function main_menu($current_project = NULL, $current_phase = NULL, $current_logged_in_user = NULL) {
echo <<<_END
<script>
dojo.addOnLoad(_initMenuLoader);
function _initMenuLoader() {
var menuitem = dojo.byId("navMenu");
menuitem.style.display = "block";
menuitem = dojo.byId("projMenu");
menuitem.style.display = "block";
}
</script>
<div dojoType="dijit.MenuBar" id="navMenu" style="float:left; display:none">
<div dojoType="dijit.PopupMenuBarItem">
<span>
Projects
</span>
<div dojoType="dijit.Menu" id="projectMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=project&action=show'">
Projects
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=phase&action=show'">
Phases
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=project&action=selectcurrentprojectphase'">
Set Current Project/Phase
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Scenarios
</span>
<div dojoType="dijit.Menu" id="scenarioMenu" style="display:none">
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=scenario&action=show'">
Scenarios
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=testcase&action=show'">
Testcases
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=testlevel&action=show'">
Testlevels
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=hostselectortype&action=query'">
Host Selector Types
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=hostselectorvalue&action=show'">
Host Selector Values
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=outcomeaction&action=show'">
Outcome Actions
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=parameter&action=show'">
User Defined Parameters
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Teststands
</span>
<div dojoType="dijit.Menu" id="teststandMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=teststand&action=show'">
Teststands
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=host&action=show'">
Hosts
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=objecttype&action=show'">
Object Types
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=objectattributetype&action=show'">
Object Attribute Types
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=object&action=query'">
Query Objects
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Collectors
</span>
<div dojoType="dijit.Menu" id="collectorMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=collectortype&action=show'">
Collector Types
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=collectorvalue&action=show'">
Collector Values
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=collectorset&action=show'">
Collector Sets
</div>
<div dojoType="dijit.MenuItem" onClick="window.location='index.php?object=collectorsetmember&action=show'">
Collector Set Members
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Environments
</span>
<div dojoType="dijit.Menu" id="environmentMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=environment&action=show'">
Environments
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Levels
</span>
<div dojoType="dijit.Menu" id="levelMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=level&action=show'">
Levels
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=levelinstance&action=show'">
Level Instances
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Users
</span>
<div dojoType="dijit.Menu" id="userMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=user&action=show'">
Users
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=maillist&action=show'">
Mail Lists
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
What is running?
</span>
<div dojoType="dijit.Menu" id="runningMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=active_workrequest&action=query'">
Active Scenarios
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=active_workqueue&action=query'">
Workqueue items
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Results
</span>
<div dojoType="dijit.Menu" id="resultMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=scenarioresult&action=show'">
Scenario Results
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=scenarioresult&action=query'">
Query Scenario Results
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=actionresult&action=show'">
Testcase Action Results
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=archive_workrequest&action=show'">
Archived Work Requests
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=archive_workqueue&action=show'">
Archived Work Queue
</div>
</div>
</div>
<div dojoType="dijit.PopupMenuBarItem">
<span>
Admin
</span>
<div dojoType="dijit.Menu" id="adminMenu" style="display:none">
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=backup&action=show'">
Backup and Restore
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=dafserver&action=show'">
DAF Server administration
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=auditlog&action=show'">
Show Audit Log
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=licence&action=show'">
Show Licence Information
</div>
<div dojoType="dijit.MenuItem" onclick="window.location='index.php?object=licence&action=update'">
Update Licence Information
</div>
</div>
</div>
</div>
_END;
echo '<div dojoType="dijit.MenuBar" id="projMenu" style="display:none" dir="rtl">' . "\n";
if (isset ( $current_logged_in_user )) {
echo <<<_END
<div dojoType="dijit.MenuBarItem" id="LogoutMenu">
<div dojoType="dijit.MenuItem" onclick="window.location = 'index.php?action=logout'">
Logout
</div>
</div>
<div dojoType="dijit.MenuBarItem">|</div>
_END;
}
echo "<div dojoType=\"dijit.MenuBarItem\">\n";
if (isset ( $current_project ) && isset ( $current_phase )) {
echo "<span>Project: $current_project Phase: $current_phase</span>\n";
} else {
// must have something in the menubar, otherwise it appears as a thinner bar than normal
echo "<span> </span>\n";
}
echo "</div>\n";
echo "<div dojoType=\"dijit.MenuBarItem\">|</div>\n";
echo "<div dojoType=\"dijit.MenuBarItem\">\n";
if (isset ( $current_logged_in_user )) {
echo "<span>User: $current_logged_in_user </span>";
}
echo "</div>\n";
echo "</div>\n";
} | [
"abstract public static function mainMenu();",
"function menuFlow() {\n\t\tincludeFile('templates/mainmenu');\n\t\techo PHP_EOL;\n\t}",
"function HD_program_menu() {\n\tregister_js(HD_PLUGIN_URL.'program/program.js',100);\n\thd_menu('Program', 'program','HD_program_gui', 100);\n}",
"function print_menu() {\n/*\tif( auth_is_user_authenticated() ) {\n\t\t$t_protected = current_user_get_field( 'protected' );\n\t\t$t_current_project = helper_get_current_project();\n\n\t\techo '<table class=\"width100\" cellspacing=\"0\">';\n\t\techo '<tr>';\n\t\techo '<td class=\"menu\">';\n\t\t$t_menu_options = array();\n\n\t\t# Main Page\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'main_page.php' ) . '\">' . lang_get( 'main_link' ) . '</a>';\n\n\t\t# Plugin / Event added options\n\t\t$t_event_menu_options = event_signal( 'EVENT_MENU_MAIN_FRONT' );\n\t\tforeach( $t_event_menu_options as $t_plugin => $t_plugin_menu_options ) {\n\t\t\tforeach( $t_plugin_menu_options as $t_callback => $t_callback_menu_options ) {\n\t\t\t\tif( is_array( $t_callback_menu_options ) ) {\n\t\t\t\t\t$t_menu_options = array_merge( $t_menu_options, $t_callback_menu_options );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !is_null( $t_callback_menu_options ) ) {\n\t\t\t\t\t\t$t_menu_options[] = $t_callback_menu_options;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# My View\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'my_view_page.php\">' ) . lang_get( 'my_view_link' ) . '</a>';\n\n\t\t# View Bugs\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'view_all_bug_page.php\">' ) . lang_get( 'view_bugs_link' ) . '</a>';\n\n\t\t# Report Bugs\n\t\tif( access_has_project_level( config_get( 'report_bug_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = string_get_bug_report_link();\n\t\t}\n\n\t\t# Changelog Page\n\t\tif( access_has_project_level( config_get( 'view_changelog_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'changelog_page.php\">' ) . lang_get( 'changelog_link' ) . '</a>';\n\t\t}\n\n\t\t# Roadmap Page\n\t\tif( access_has_project_level( config_get( 'roadmap_view_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'roadmap_page.php\">' ) . lang_get( 'roadmap_link' ) . '</a>';\n\t\t}\n\n\t\t# Summary Page\n\t\tif( access_has_project_level( config_get( 'view_summary_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'summary_page.php\">' ) . lang_get( 'summary_link' ) . '</a>';\n\t\t}\n\n\t\t# Project Documentation Page\n\t\tif( ON == config_get( 'enable_project_documentation' ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'proj_doc_page.php\">' ) . lang_get( 'docs_link' ) . '</a>';\n\t\t}\n\n\t\t# Project Wiki\n\t\tif( config_get_global( 'wiki_enable' ) == ON ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'wiki.php?type=project&id=' ) . $t_current_project . '\">' . lang_get( 'wiki' ) . '</a>';\n\t\t}\n\n\t\t# Plugin / Event added options\n\t\t$t_event_menu_options = event_signal( 'EVENT_MENU_MAIN' );\n\t\tforeach( $t_event_menu_options as $t_plugin => $t_plugin_menu_options ) {\n\t\t\tforeach( $t_plugin_menu_options as $t_callback => $t_callback_menu_options ) {\n\t\t\t\tif( is_array( $t_callback_menu_options ) ) {\n\t\t\t\t\t$t_menu_options = array_merge( $t_menu_options, $t_callback_menu_options );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !is_null( $t_callback_menu_options ) ) {\n\t\t\t\t\t\t$t_menu_options[] = $t_callback_menu_options;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# Manage Users (admins) or Manage Project (managers) or Manage Custom Fields\n\t\tif( access_has_global_level( config_get( 'manage_site_threshold' ) ) ) {\n\t\t\t$t_link = helper_mantis_url( 'manage_overview_page.php' );\n\t\t\t$t_menu_options[] = \"<a href=\\\"$t_link\\\">\" . lang_get( 'manage_link' ) . '</a>';\n\t\t} else {\n\t\t\t$t_show_access = min( config_get( 'manage_user_threshold' ), config_get( 'manage_project_threshold' ), config_get( 'manage_custom_fields_threshold' ) );\n\t\t\tif( access_has_global_level( $t_show_access ) || access_has_any_project( $t_show_access ) ) {\n\t\t\t\t$t_current_project = helper_get_current_project();\n\t\t\t\tif( access_has_global_level( config_get( 'manage_user_threshold' ) ) ) {\n\t\t\t\t\t$t_link = helper_mantis_url( 'manage_user_page.php' );\n\t\t\t\t} else {\n\t\t\t\t\tif( access_has_project_level( config_get( 'manage_project_threshold' ), $t_current_project ) && ( $t_current_project <> ALL_PROJECTS ) ) {\n\t\t\t\t\t\t$t_link = helper_mantis_url( 'manage_proj_edit_page.php?project_id=' ) . $t_current_project;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$t_link = helper_mantis_url( 'manage_proj_page.php' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$t_menu_options[] = \"<a href=\\\"$t_link\\\">\" . lang_get( 'manage_link' ) . '</a>';\n\t\t\t}\n\t\t}\n\n\t\t# News Page\n\t\tif ( news_is_enabled() && access_has_project_level( config_get( 'manage_news_threshold' ) ) ) {\n\n\t\t\t# Admin can edit news for All Projects (site-wide)\n\t\t\tif( ALL_PROJECTS != helper_get_current_project() || current_user_is_administrator() ) {\n\t\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'news_menu_page.php\">' ) . lang_get( 'edit_news_link' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'login_select_proj_page.php\">' ) . lang_get( 'edit_news_link' ) . '</a>';\n\t\t\t}\n\t\t}\n\n\t\t# Account Page (only show accounts that are NOT protected)\n\t\tif( OFF == $t_protected ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'account_page.php\">' ) . lang_get( 'account_link' ) . '</a>';\n\t\t}\n\n\t\t# Add custom options\n\t\t$t_custom_options = prepare_custom_menu_options( 'main_menu_custom_options' );\n\t\t$t_menu_options = array_merge( $t_menu_options, $t_custom_options );\n\n\t\t# Time Tracking / Billing\n\t\tif( config_get( 'time_tracking_enabled' ) && access_has_global_level( config_get( 'time_tracking_reporting_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'billing_page.php\">' ) . lang_get( 'time_tracking_billing_link' ) . '</a>';\n\t\t}\n\n\t\t# Logout (no if anonymously logged in)\n\t\tif( !current_user_is_anonymous() ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'logout_page.php\">' ) . lang_get( 'logout_link' ) . '</a>';\n\t\t}\n\t\techo implode( $t_menu_options, ' | ' );\n\t\techo '</td>';\n\t\techo '<td class=\"menu right nowrap\">';\n\t\techo '<form method=\"post\" action=\"' . helper_mantis_url( 'jump_to_bug.php\">' );\n\t\t# CSRF protection not required here - form does not result in modifications\n\n\t\tif( ON == config_get( 'use_javascript' ) ) {\n\t\t\t$t_bug_label = lang_get( 'issue_id' );\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"bug_id\\\" size=\\\"10\\\" class=\\\"small\\\" value=\\\"$t_bug_label\\\" onfocus=\\\"if (this.value == '$t_bug_label') this.value = ''\\\" onblur=\\\"if (this.value == '') this.value = '$t_bug_label'\\\" /> \";\n\t\t} else {\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"bug_id\\\" size=\\\"10\\\" class=\\\"small\\\" /> \";\n\t\t}\n\n\t\techo '<input type=\"submit\" class=\"button-small\" value=\"' . lang_get( 'jump' ) . '\" /> ';\n\t\techo '</form>';\n\t\techo '</td>';\n\t\techo '</tr>';\n\t\techo '</table>';\n\t}\n*/\n\n}",
"public function phase_page_restiction( $project_id, $phase_id ){\r\n \r\n switch ( $phase_id ) { \r\n \r\n \r\n case $phase_id == 2: // Design\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 1);\r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 3: // Development\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 2);\r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 4: // Content\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 3);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n break;\r\n \r\n case $phase_id == 5: // Responsive\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 4);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 6: // Training\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 5);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 7: // QA & Testing\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 6);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 8: // Pre-Launc\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 7);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 9: // Launch\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 8);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n break;\r\n \r\n case $phase_id == 10: // Post Launch \r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 9);\r\n \r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n case $phase_id == 11: // Warranty\r\n // check is phase one is being approved\r\n $is_pahse_approved = $this->is_phase_approved($project_id, 10);\r\n \r\n if( $is_pahse_approved ) { \r\n \r\n return TRUE; //yes approved\r\n \r\n }else {\r\n \r\n return FALSE; // not approved yet \r\n }\r\n \r\n break;\r\n \r\n default:\r\n return TRUE;\r\n \r\n }\r\n }",
"function prism_do_opt_section_main() {\n\t$prism_opt_section_main = '';\n\techo ( apply_filters( 'prism_theme_opt_section_main' , $prism_opt_section_main ) );\n}",
"private function stepNav() {\n $course = $this->step->course;\n\t\t$root = $course->root;\n\t\t$stepUrl = $this->step->url;\n\n\t\t$prev = $this->stepSection->prev;\n\t\t$prevUrl = $prev !== null ? $prev->url : $stepUrl;\n\n\t\t$next = $this->stepSection->next;\n\t\t$nextUrl = $next !== null ? $next->url : $stepUrl;\n\t\t\n\t\t$html = <<<END1\n<div class=\"cl-stepnav-div\"><nav class=\"cl-stepnav cl-nav\"><div><ul>\n<li><a href=\"$stepUrl\"><span>Return to Step Page</span>\n<img alt=\"Return to Step\" width=\"28\" height=\"25\" src=\"$root/vendor/cl/step/img/returnstep.png\" /></a></li>\nEND1;\n\n\t\t// Extra menu items here\n\t\tforeach($this->step->menuExtra as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\n\t\t$html .= <<<HTML\n<li><a href=\"$prevUrl\"><span>Previous Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/previcon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\"><span>Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/nexticon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\" class=\"cl-step-completed-next\"><span>Mark Completed and Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/checknext.png\" width=\"40\" /></a></li>\n<li class=\"cl-step-progress\"></li>\nHTML;\n\n\t\t// Appended menu items here\n\t\tforeach($this->step->menuAppend as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\t\t\n\t\t/*\n\t\t * End of menu bar \n\t\t */\n\t\t$html .= <<<HTML\n</ul></div>\n</nav></div>\nHTML;\n\t\n\t\treturn $html;\n\t}",
"function nav_main_sub() {\n\t\t\t$this->nav('main');\n\t\t}",
"function drawMenu() {\n\n system(\"clear\");\n mainHeader();\n\n echo \"(1) import file\\n\";\n echo \"(2) drop word indexes\\n\";\n echo \"(3) create word index\\n\";\n echo \"(0) Exit!\\n\";\n echo \"----------------------------\\n\\n\";\n\n \n}",
"protected function generateMenu() {}",
"function buildApplicationPersonalMenu($stop = NULL){\r\n return buildMenu('Temporary Employee Job Application', '1', STUDENTMENU, $stop);\r\n}",
"function lr_main_menu() {\n\n\t$menu_items = lr_get_menu('main-menu');\n\n\tif ($menu_items) {\n\t\tforeach ($menu_items as $n => $menu_item) {\n\t\t\techo '<li>';\n\t\t\techo '<a href=\"' . $menu_item->url . '\">' . $menu_item->title . '</a>';\n\t\t\techo lr_is_current_page($menu_item)? lr_strike_through($menu_item->title) : NOTHING ;\n\t\t\techo '</li>';\n\t\t}\n\t}\n}",
"public function menuAction()\n {\n return $this->render('PumWoodworkBundle:Project:menu.html.twig', array(\n 'projects' => $this->get('pum')->getAllProjects()\n ));\n }",
"function projectactivity_menu2($args) {\n global $_lib;\n\n $query = \"select ProjectActivityID, Description from projectactivity where Active='1' and ProjectID='$args[project_id]' order by ProjectID\";\n $result = $_lib['db']->db_query($query);\n\n if(!$conf['num_letters']) {\n $num_letters = '20';\n } else {\n $num_letters = $conf['num_letters'];\n }; #Default number of letters in menu\n\n\n if($args['pk']) {\n print \"<select name=\\\"$args[table].$args[field].$args[pk]\\\" tabindex=\\\"$args[tabindex]\\\" accesskey=\\\"$args[accesskey]\\\">\\n\";\n } else {\n print \"<select name=\\\"$args[table].$args[field]\\\" tabindex=\\\"$args[tabindex]\\\" accesskey=\\\"$args[accesskey]\\\">\\n\";\n }\n if($conf['value']) {\n print \"<option value=\\\"\\\">\" . substr(\"Finnes ikke: . $conf[value]\",0, $num_letters);\n } else {\n print \"<option value=\\\"\\\">\" . substr('Velg aktivitet',0, $num_letters);\n }\n while($_row = $_lib['db']->db_fetch_object($result)) {\n if($_row->ProjectActivityID == $args[value])\n print \"<option value=\\\"$_row->ProjectActivityID\\\" selected>$_row->ProjectActivityID - \" . substr($_row->Description,0,$num_letters) . \"\\n\";\n else\n print \"<option value=\\\"$_row->ProjectActivityID\\\">$_row->ProjectActivityID - \" . substr($_row->Description,0,$num_letters) . \"\\n\";\n }\n\n print \"</select>\\n\";\n #$_lib['db']->db_free_result($result);\n ?>\n <? }",
"function mainmenu()\n\t{\n\t\t$data['menus'] = $this->admin_model->Menuutama();\n\t\t$this->template->load('adminweb/media','adminweb/mod_mainmenu/menuutama',$data);\n\t}",
"function ict_projects_admin_menu(){\n\tadd_menu_page('Projects Page','All Projects',\n\t\t'manage_options','ict-projects-main-page','ict_render_projects_page',\n\t\t'dashicons-portfolio');\n\n add_submenu_page('ict-projects-main-page','Teams','Teams',\n 'manage_options','ict-projects-teams-page','ict_render_projects_teams_page');\n\n add_submenu_page('ict-projects-main-page','Project Types','Project Types',\n 'manage_options','ict-project-types-page','ict_render_project_types_page');\n\n\tadd_submenu_page('ict-projects-main-page','Settings','Settings',\n\t\t'manage_options','ict-projects-settings-page','ict_render_projects_settings_page');\n\n\tadd_submenu_page('','New Project','New Project',\n\t\t'manage_options','ict-new-project-page','ict_render_new_projects_page');\n\n add_submenu_page('','Edit Project','Edit Project',\n 'manage_options','ict-edit-project-page','ict_render_edit_projects_page');\n\n add_submenu_page('','New Team Member','New Team Member',\n 'manage_options','ict-new-team-member-page','ict_render_new_team_member_page');\n\n add_submenu_page('','Edit Team Member','Edit Team Member',\n 'manage_options','ict-edit-team-member-page','ict_render_edit_team_member_page');\n\n add_submenu_page('','Project Team Members','Project Team Members',\n 'manage_options','ict-project-team-members','ict_render_project_team_page');\n\n add_submenu_page('','New Project Team Member','New Project Team Member',\n 'manage_options','ict-new-project-team-member-page','ict_render_new_project_team_member_page');\n\n add_submenu_page('','Edit Project Type','Edit Project Type',\n 'manage_options','ict-edit-project-type-page','ict_render_edit_project_type_page');\n\n \n}",
"function _EDITPROJECT() {\r\t\tglobal $task;\r\r\t\tif ($task == 'newproject') {\r\t\t\tJMenuBar::title( JText::_( 'New Project Entry'), 'addedit.png' );\t\t\t\r\t\t} else {\r\t\t\tJMenuBar::title( JText::_( 'Edit Project Entry'), 'addedit.png' );\t\t\t\r\t\t}\r\t\tJMenuBar::save('saveproject');\r\t\tJMenuBar::cancel('cancelproject');\r\t}",
"function main(){\n\t\t\t// mysql enabled?\n\t\t\t\t$this->zajlib->variable->mysql_enabled = $GLOBALS['zaj_mysql_enabled'];\n\t\t\t// load menu\n\t\t\t\t$this->zajlib->variable->title = \"app update\";\n\t\t\t\t$this->zajlib->template->show(\"update/update-menu.html\");\t\t\t\t\t\t\n\t\t}",
"function deal_with_current_project_phase_cookies(&$current_project, &$current_phase) {\n if (isset($_POST['setcurrentprojectphase'])) {\n\n $current_project = lookupfield('project', 'Name', 'ID', $_POST['projectID']);\n $current_phase = lookupfield('phase', 'Name', 'ID', $_POST['phaseID']);\n\n $project_names = get_names_of_objects(\"project\", NULL);\n\n //set cookies\n setcookie(\"current_project\", $current_project, time()+3600*24*30);\n setcookie(\"current_phase\", $current_phase, time()+3600*24*30);\n \n } else {\n\n if (isset($_COOKIE['current_project'])) {\n $current_project = $_COOKIE['current_project'];\n } else {\n $project_names = get_names_of_objects(\"project\", NULL);\n if (count($project_names) == 0) {\n $current_project = \"none\";\n } else {\n $current_project = $project_names[0];\n setcookie(\"current_project\", $current_project, time()+3600*24*30);\n } \n }\n \n if ($current_project == \"none\") {\n $current_phase = \"none\";\n } else {\n if (isset($_COOKIE['current_phase'])) {\n $current_phase = $_COOKIE['current_phase'];\n } else {\n if ($current_project == \"none\") {\n $current_phase = \"none\";\n } else {\n $phase_names = get_names_of_phases_in_project($current_project);\n if (count($phase_names) == 0) {\n $current_phase = \"none\";\n } else {\n $current_phase = $phase_names[0];\n setcookie(\"current_phase\", $current_phase, time()+3600*24*30);\n } \n }\n }\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the receiver's maxlength attribute. | public function getMaxlength() {
return $this->maxlength;
} | [
"public function getMaxLength() { return $this->_maxLength; }",
"public function getMaxLength()\n {\n return $this->_maxLength;\n }",
"function getMaxLength()\n\t{\n\t\treturn $this->maxLength;\n\t}",
"public function getMaxLength()\r\r\n {\r\r\n return $this->maxLength;\r\r\n }",
"public function getMaxLength()\n\t{\n\t\treturn $this->_maxLength;\n\t}",
"public function getMaxAttributeLength()\n {\n return (int)$this->floatValue('recorded.value.max.length', 1200);\n }",
"public function getMaxLength()\n\t{\n\t\treturn $this->maxValue;\n\t}",
"public function getMaxLengthRule() {\n\t\treturn $this->maxLength;\n\t}",
"public function getMaxLength() {\n return $this->forgot_pass['maxLength'];\n }",
"public function getLengthLimit()\n {\n }",
"public function getValueMaxLength() {\n\t\treturn $this->valueMaxLength;\n\t}",
"public function getMaxLength()\n {\n return 254;\n }",
"public function fieldMaxlength()\n {\n return $this->nameMaxLength();\n }",
"public function get_maxlength( $length = '' ) {\n\t\treturn 'maxlength=\"' . esc_attr( $length ) . '\"';\n\t}",
"public function getMaxPasswordLength()\n {\n\t return $this->_maxPasswordLength;\n }",
"public function has_maxlength(): bool {\n\t\treturn $this->has_attribute( 'maxlength' );\n\t}",
"public function getMaxLength()\n {\n $dbConfig = Kernel::getDb()->config;\n\n $default_varchar_length = $dbConfig->default_varchar_length;\n $default_decimal_length = $dbConfig->default_decimal_length;\n\n $length = 0;\n\n if ($this->type === DBModelField::TINYINT)\n $length = 3;\n\n elseif ($this->type === DBModelField::SMALLINT)\n $length = 5;\n\n elseif ($this->type === DBModelField::MEDIUMINT)\n $length = ($this->attr === DBModelField::ATTR_UNSIGNED) ? 8 : 7;\n\n elseif ($this->type === DBModelField::INT)\n $length = 10;\n\n elseif ($this->type === DBModelField::BIGINT)\n $length = ($this->attr === DBModelField::ATTR_UNSIGNED) ? 20 : 19;\n\n elseif ($this->type === DBModelField::DECIMAL)\n $length = ($this->getLength() === false) ? $default_decimal_length : $this->getLength();\n\n elseif ($this->type === DBModelField::BOOLEAN)\n $length = 1;\n\n elseif ($this->type === DBModelField::DATE)\n $length = 10;\n\n elseif ($this->type === DBModelField::DATETIME)\n $length = 19;\n\n elseif ($this->type === DBModelField::TIME)\n $length = 9;\n\n elseif ($this->type === DBModelField::YEAR)\n $length = 4;\n\n elseif ($this->type === DBModelField::VARCHAR)\n $length = ($this->getLength() === false) ? $default_varchar_length : $this->getLength();\n\n elseif ($this->type === DBModelField::TINYTEXT)\n $length = 255;\n\n elseif ($this->type === DBModelField::TEXT)\n $length = 65535;\n\n elseif ($this->type === DBModelField::MEDIUMTEXT)\n $length = 16777215;\n\n elseif ($this->type === DBModelField::LONGTEXT)\n $length = 4294967295;\n\n elseif ($this->type === DBModelField::ENUM) {\n $longestValue = '';\n\n foreach ($this->length as $value) {\n if (strlen(strval($value)) > strlen($longestValue))\n $longestValue = $value;\n }\n\n $length = strlen($longestValue);\n }\n\n return $length;\n }",
"public function set_maxlength($value)\r\n\t{\r\n\t\treturn $this->set_attr('maxlength', $value);\r\n\t}",
"public function getMaxCharactersPerValue()\n {\n return $this->maxCharactersPerValue;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the password Private keys can be encrypted with a password. To unset the password, pass in the empty string or false. Or rather, pass in $password such that empty($password) && !is_string($password) is true. | function setPassword($password = false)
{
$this->password = $password;
} | [
"public function setPassword($password = false)\n {\n $this->password = $password;\n }",
"public function setPassword( $password );",
"public function setPlainPassword($password);",
"public function setTestPassword($password);",
"public function setLivePassword($password);",
"function setPassword($_password)\r\n {\r\n if(strlen($_password) >= 6)\r\n {\r\n $this->_password = $_password;\r\n }\r\n }",
"public function setPassword($password, $encryptionMethod = self::ENCRYPTION_METHOD_WINZIP_AES_256);",
"public function setValidPassword() {\n //check if we have a password\n if ($this->getUserPassword()) {\n //hash the password\n $this->setPassword($this->hashPassword($this->getUserPassword()));\n } else {\n //check if the object is new\n if ($this->getId() === NULL) {\n //new object set a random password\n $this->setRandomPassword();\n //hash the password\n $this->setPassword($this->hashPassword($this->getUserPassword()));\n }\n }\n }",
"private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPlainPassword());\n $this->user->setPassword($password);\n }",
"function setAPIPassword($password)\n {\n $this->_password = $password;\n }",
"function setPassword($owner_password, $user_password){}",
"private function SetPassword($password)\n {\n $this->password = md5($password);\n }",
"public function setPassword($password, $channel, $layer = 'user');",
"public function setPassword()\n {\n if (!empty($this->password)) {\n $this->password_hash = Yii::$app->security->generatePasswordHash($this->password);\n }\n }",
"public function setPlainPassword($password)\r\n {\r\n $this->plainPassword = $password;\r\n }",
"public function setPassword($password){\n $this->password = mb_convert_encoding($password, \"UTF-16LE\", \"UTF-8\");// tested to match aescrypt format for passwd\n }",
"public function setPaypalPassword($value);",
"public function setPlainPassword($password)\n {\n $this->plainPassword = $password;\n }",
"protected function _getEncryptionKeyByUserPassword($password = '') {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all tagged versions for the repository. | public function getAllVersions(): Collection
{
$guzzleClient = new Client(['base_uri' => config('bitbucket.api_base_url')]);
$response = $guzzleClient
->get("2.0/repositories/" . config('bitbucket.vendor') . "/" . config('bitbucket.repo') . "/refs/tags", [
'auth' => [config('bitbucket.username'), config('bitbucket.password')]
])->getBody();
return collect(\GuzzleHttp\json_decode($response)->values);
} | [
"public function getVersions();",
"function project_qa_get_all_tags($repo_path) {\n\n $command = 'show-ref';\n $parameters = array(\n '--tags',\n '-d',\n );\n $tags = project_qa_execute_git($repo_path, $command, $parameters);\n\n return $tags;\n}",
"public function getVersions() {}",
"public function tags()\n {\n return $this->client->get('/repositories/'.$this->name().'/tags');\n }",
"public function fetchVersions()\n {\n $this->output->writeln('Fetching versions from remote...');\n\n $command = 'git fetch --tag';\n return $this->runCommand($command);\n }",
"public function getVersions()\n {\n return $this->versions;\n }",
"public function getVersions () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getversions'));\r\n\t}",
"private function getVersions()\n {\n $cachedVersions = $this->getCachedVersions();\n if (!isset($cachedVersions['versions'])) {\n return $this->versions;\n }\n\n return $cachedVersions['versions'];\n }",
"public function getVersions(): array\n {\n return $this->client->getGameVersions($this->game->getId());\n }",
"public function getVersions()\n {\n return $this->getAdapter()->getVersions();\n }",
"protected function fetchTags()\n {\n $tags = array();\n\n try {\n $response = $this->github->read('git/refs/tags?per_page=100');\n } catch (\\RuntimeException $e) {\n if ($e->getCode() == 404) {\n return $tags;\n } else {\n throw $e;\n }\n }\n\n foreach ($response as $info) {\n if (!preg_match('/^refs\\/tags\\/(\\d\\d\\d\\d-\\d\\d-\\d\\d)$/', $info['ref'], $m)) continue;\n $tags[$m[1]] = $info['object']['sha'];\n }\n\n krsort($tags);\n return $tags;\n }",
"public function getVersions() {\n DB_DAO::connectDatabase();\n $handler = DB_DAO::getDB()->prepare(\"SELECT version, id, isObsolete FROM version ORDER BY version DESC LIMIT 0,100\");\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n $data = array();\n $it = 0;\n while ($row = $handler->fetch(PDO::FETCH_ASSOC)) {\n $data[$it] = new Version($row['id'], $row['version'], $row['isObsolete']);\n $it++;\n }\n return $data;\n }",
"public function fetchVersions($path)\n {\n try {\n //Fetch all contents from repo tree\n $this->setClient(new Client($this));\n $contents = $this->getClient()->createRequest(\"GET\", $this->model_repo_endpoint . '/' . rawurlencode($path));\n $versions = array();\n foreach($contents as $entry) {\n if($entry['type'] === 'dir')\n array_push($versions, $entry);\n }\n\n return $versions;\n\n } catch (\\Exception $e) {\n $this->emError($e->getMessage());\n }\n exit;\n }",
"public function getTags()\n\t{\n\t\t$tags = array();\n\t\tforeach(explode(\"\\n\",$this->repository->run(\"ls-remote --tags \" . $this->name)) as $i => $ref) {\n\t\t\tif($i == 0) { continue; } //ignore first line \"From: repository...\"\n\t\t\tif(substr_count($ref, '^{}')){ continue; } //ignore dereferenced tag objects for annotated tags\n\t\t\t$ref = explode('refs/tags/', trim($ref), 2);\n\t\t\t$tagName = $ref[1];\n\t\t\t$tag = new AGitTag($tagName,$this->repository,$this);\n\t\t\t$tags[$tagName] = $tag;\n\t\t}\n\t\treturn $tags;\n\t}",
"public function getValidVersionTags()\n {\n $validator = new TagValidator();\n return $validator->filtrateList($this->getVCS()->getTags());\n }",
"public function getAllVersions(string $planetIdentifier): array;",
"public function getAll()\n {\n $query = $this->db->prepare('SELECT * FROM ' . CodePax_DbVersions::TABLE_NAME\n . ' ORDER BY date_added DESC');\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"protected function getVersions() {\n\t\t$versions = array();\n\t\t$directory = new DirectoryIterator(t3lib_extMgm::extPath('extjs', 'versions'));\n\n\t\tforeach ($directory as $entry) {\n\t\t\tif ($entry->isDir() && !$entry->isDot() && is_numeric(substr($entry->getFilename(), 0, 1))) {\n\t\t\t\t$versions[] = $entry->getFilename();\n\t\t\t}\n\t\t}\n\n\t\tsort($versions);\n\t\treturn $versions;\n\t}",
"function _versioncontrol_git_log_get_tags() {\n //TODO: incorporate a --dereference and parse better, saves one git call for tags\n $logs = _versioncontrol_git_log_exec('git show-ref --tags'); // Query tags.\n $tags = _versioncontrol_git_log_parse_tags($logs); // Parse output.\n return $tags;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return collector classes available. | protected function getCollectorClasses()
{
if (is_null($this->collectorClasses)) {
$config = config('sule.bank-statements.collector');
$type = $config['type'];
if ( ! isset($config[$type])) {
throw new RuntimeException('No collector type available');
}
if (empty($config[$type])) {
throw new RuntimeException('No collectors available');
}
$this->collectorClasses = $config[$type];
}
return $this->collectorClasses;
} | [
"public function &getClasses();",
"public function getClasses();",
"public function getUsedClasses(): array;",
"public function getClasses() {\n return $this->info['classes'];\n }",
"public function getReportingClasses();",
"public static function classes()\n\t{\n\t\treturn static::dump(get_declared_classes());\n\t}",
"public function getClasses() {\n\t\treturn $this->classes;\n\t}",
"public function getClasses() {\n return $this->robot->getIndexedClasses();\n }",
"public function getClasses()\n {\n return array();\n }",
"function getClasses() {\n\t\treturn $this->_AutoloadArray;\n\t}",
"public function getLoadedClasses()\n {\n return $this->loadedClasses;\n }",
"public function getClassesToSearch()\n {\n return $this->classesToSearch;\n }",
"public function getUsedClasses(): array\n {\n return [$this->getBeanClassName()];\n }",
"public function getDeclaredClasses() : Collection\n {\n $this->findAndLoadClasses();\n // We should filter out common classes\n // - std_class\n // - ? Exception\n $classes = collect(get_declared_classes());\n\n $filtered = $classes->reject(function ($value, $key) {\n return starts_with($value, 'Illuminate'); // Ignore Illuminate Packages\n })->reject(function ($value, $key) {\n return starts_with($value, 'Symfony');\n });\n\n return $filtered;\n }",
"private function getDocumentClasses()\n {\n $classes = [];\n foreach ($this->managers as $manager) {\n $documents = $this->metadataCollector->getMappings($manager['mappings']);\n foreach ($documents as $document) {\n $classes[] = sprintf('%s:%s', $document['bundle'], $document['class']);\n }\n }\n\n return $classes;\n }",
"protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }",
"public function drivingClasses()\n\t{\n return DrivingClasses::all();\n\t}",
"protected static function get_extractor_classes()\n {\n // Check cache\n if (self::$sorted_extractor_classes) {\n return self::$sorted_extractor_classes;\n }\n\n // Generate the sorted list of extractors on demand.\n $classes = ClassInfo::subclassesFor(__CLASS__);\n array_shift($classes);\n $classPriorities = [];\n\n foreach ($classes as $class) {\n $classPriorities[$class] = Config::inst()->get($class, 'priority');\n }\n arsort($classPriorities);\n\n // Save classes\n $sortedClasses = array_keys($classPriorities ?? []);\n return self::$sorted_extractor_classes = $sortedClasses;\n }",
"public static function get_classes_in_registry() {\n return array_keys(self::$_registry);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds and displays a AutonomousSystem entity. | public function showAction($id) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('MccASMemberBundle:AutonomousSystem')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find AutonomousSystem entity.');
}
$ranges = $em->getRepository('MccASMemberBundle:IpRange')->findByAsid($entity);
$deleteForm = $this->createDeleteForm($id);
//będę miał czas to przesniosę tę część do odrębnej metody -Konrad
$qb = $em->createQueryBuilder();
$qb->select('r')
->from('Mcc\ASMemberBundle\Entity\Ip', 'r')
->where('r.asidentifier = :asidentifier')
->setParameter('asidentifier', $entity->getId());
$representatives = $qb->getQuery()->getResult();
$paginator = $this->get('knp_paginator');
$paginatedRanges = $paginator->paginate(
$ranges, $this->get('request')->query->get('page', 1)/* page number */, 20/* limit per page */
);
$paginatedResult = $paginator->paginate(
$representatives, $this->get('request')->query->get('page', 1)/* page number */, 20/* limit per page */
);
return $this->render('MccASMemberBundle:AutonomousSystem:show.html.twig', array(
'entity' => $entity,
'representatives' => $paginatedResult,
/* 'ranges' => $ranges, */
'rangeslist' => $paginatedRanges,
'delete_form' => $deleteForm->createView(),));
} | [
"public function indexAction() {\n $searchForm = $this->createSearchForm();\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MccASMemberBundle:AutonomousSystem')->findAll();\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $entities, $this->get('request')->query->get('page', 1)/* page number */, 50/* limit per page */\n );\n return $this->render('MccASMemberBundle:AutonomousSystem:index.html.twig', array(\n 'entities' => $pagination,\n 'search_form' => $searchForm->createView(),\n ));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MccASMemberBundle:AutonomousSystem')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find AutonomousSystem entity.');\n }\n\n $editForm = $this->createForm(new AutonomousSystemType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MccASMemberBundle:AutonomousSystem:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function createAction(Request $request) {\n $entity = new AutonomousSystem();\n $form = $this->createForm(new AutonomousSystemType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('autonomoussystem_show', array('id' => $entity->getId())));\n }\n\n return $this->render('MccASMemberBundle:AutonomousSystem:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function displayEntityBrowser();",
"public function System(): void {\r\n $this->verifyAuthorization();\r\n\r\n $view = new AdminSystemView();\r\n $view->Render('adminSystem');\r\n }",
"public function getSystemEntity()\n {\n return $this->entity;\n }",
"public function view($systemName=NULL) {\n\t\t$systemName = rawurldecode($systemName);\t\t\n\t\tif($systemName == NULL) {\n\t\t\t$this->_error(\"No system specified for viewing\");\n\t\t}\n\t\t\n\t\t// System Object\n\t\ttry {\n\t\t\tself::$sys = $this->_load_system($systemName);\n\t\t}\n\t\tcatch (ObjectNotFoundException $oNFE) {\n\t\t\t$this->_error(\"System not found!\");\n\t\t}\n\t\tcatch(DBException $dbE) {\n\t\t\t$this->_error(\"Error viewing system: \".$dbE->getMessage());\n\t\t}\n\t\t\n\t\t// Navbar information\n\t\t$navModes = array();\n\t\t$navOptions['Interfaces'] = \"/interfaces/view/\".rawurlencode(self::$sys->get_system_name());\n\t\t\n\t\tif($this->impulselib->get_username() == self::$sys->get_owner() || $this->api->isadmin() == TRUE) {\n\t\t\t$navOptions['Renew'] = \"/system/renew/\".rawurlencode(self::$sys->get_system_name());\n\t\t\t$navModes['EDIT'] = \"/system/edit/\".rawurlencode(self::$sys->get_system_name());\n\t\t\t$navModes['DELETE'] = \"/system/delete/\".rawurlencode(self::$sys->get_system_name());\n\t\t}\n\t\t\n\t\tif(self::$sys->get_family() == \"Network\") {\n\t\t\t$navOptions['Switchports'] = '/switchports/view/'.rawurlencode(self::$sys->get_system_name());\n\t\t\t$navOptions['Switchview'] = '/switchview/settings/'.rawurlencode(self::$sys->get_system_name());\n\t\t}\n\t\t\n\t\t$navbar = new Navbar(self::$sys->get_system_name(), $navModes, $navOptions);\n\n\t\t// Load the view data\n\t\t$info['header'] = $this->load->view('core/header',\"\",TRUE);\n\t\t$info['sidebar'] = $this->load->view('core/sidebar',array(\"sidebar\"=>self::$sidebar),TRUE);\n\t\t$info['navbar'] = $this->load->view('core/navbar',array(\"navbar\"=>$navbar),TRUE);\n\t\t$info['title'] = \"System - \".self::$sys->get_system_name();\n\t\t$info['data'] = $this->load->view('systems/system',array('system'=>self::$sys),TRUE);\n\t\t\n\t\t// Load the main view\n\t\t$this->load->view('core/main',$info);\n\t\t\n\t\t// Set the system object\n\t\t$this->impulselib->set_active_system(self::$sys);\n\t}",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n \n $entity = $em->getRepository('IntoPeopleDatabaseBundle:Organization')->find($id);\n \n if (! $entity) {\n throw $this->createNotFoundException('Unable to find Organization entity.');\n }\n \n $deleteForm = $this->createDeleteForm($id);\n \n return $this->render('IntoPeopleDatabaseBundle:Organization:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView()\n ));\n }",
"public function setAutonomousSystem($val)\n {\n $this->_propDict[\"autonomousSystem\"] = $val;\n return $this;\n }",
"function simple_entity_view($simple_entity) {\n drupal_set_title(entity_label('simple_entity', $simple_entity));\n return entity_view('simple_entity', array(entity_id('simple_entity', $simple_entity) => $simple_entity), 'full');\n}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $userSystems = $em->getRepository('EvaluationsBundle:UserSystem')->findAll();\n\n return $this->render('usersystem/index.html.twig', array(\n 'userSystems' => $userSystems,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //$entities = $em->getRepository('RegistryBundle:System')->findAll();\n $entities = $em->getRepository('RegistryBundle:System')->findAllOrderedBySystemKey();\n //$entities = $em->getRepository('RegistryBundle:System')->findAllWhere('type', '<>', 'bln');\n \n return array(\n 'entities' => $entities,\n );\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('PersonalBundle:avisos')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find avisos entity.');\n }\n\n return $this->render('PersonalBundle:avisos:show.html.twig', array(\n 'entity' => $entity,\n ));\n }",
"public function editSystem(System $system){\n $prepared = $this->connection->prepare(\"UPDATE systems \n SET full_name=:full_name,\n short_name=:short_name,\n company=:company,\n color_bg=:color_bg,\n color_text=:color_text \n WHERE id=:id\");\n $prepared->execute(array(\n 'id' => $system->getId(),\n 'full_name' => $system->getFull_name(),\n 'short_name' => $system->getShort_name(),\n 'company' => $system->getCompany(),\n 'color_bg' => $system->getColor_bg(),\n 'color_text' => $system->getColor_text()\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n /*var_dump(1);\n die(1);\n $organizations =null;*/\n $organisms=$em->getRepository('Swe\\Compenent\\Core\\Model\\Organism')->findAll();\n\n return $this->render('SweCoreBundle:Organism:index.html.twig', array(\n 'organizations' => $organisms,\n ));\n }",
"public function setSystemEntity($value)\n {\n $this->entity = $value;\n return $this;\n }",
"public function operating_system(){\n\n $data = $this->get_session_data();\n\n $data['title'] = 'ALS - Operating_system';\n $this->parser->parse('templates/header.php', $data);\n\n $this->load->model('Operating_system_model');\n $data['records'] = $this->Operating_system_model->select_all();\n $this->parser->parse('masters/operating_systems/index.php', $data);\n\n $this->parser->parse('templates/footer.php', $data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SistemaBundle:Sistema')->findAll();\n\n return $this->render('BackendBundle:Sistema:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"function present(){\n //\n //Show this entity only if it is not ignored.\n if ($this->visible()){\n //\n //\n //Draw the elipse to represent the entity\n echo \"<g>\"\n . \"<ellipse \" \n .\"cx='$this->cx'\" \n .\"cy='$this->cy'\" \n .\"rx='150'\" \n .\"ry='50'\"\n .\"style='fill:$this->color'\" \n .\"id='$this->name'\"\n .'onclick=\"$page_graph.select(this)\"'\n . 'class=\"draggable\"'\n .\"/>\"\n \n . \" <text \" \n .\"x='$this->cx'\" \n .\"y='$this->cy'\"\n .\"text-anchor='middle'\" \n .\"fill='white'>$this->name\"\n .\"</text>\"\n .\"<g>\"; \n //\n //Draw the ;ines to represent the relations starting from this entity\n foreach($this->columns as $column){\n $column->present_relation();\n } \n }\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sentiment analysis on sentence base phpInsight & SentimentAnalysis | function sentiment_analysis_post($text){
$sentenceArray = explode(". ", $text);
// insight & SA
// require_once __DIR__ . '/sentiment/src/test/style.php';
require_once __DIR__ . '/insight/autoload.php';
$sentiment= new \PHPInsight\Sentiment();
//foreach ($strings as $string) {
// calculations:
$sentences=explode(". ",$text);
$counter=0;
foreach($sentences as $sentence){
$counter++;
if(strlen(trim($sentence))) {
$scores = $sentiment->score($sentence);
$class = $sentiment->categorise($sentence);
// output:
if($class=="pos")
$result+=3+$scores[pos]*5;
else{
$result+=$scores[pos]*5;
}
//echo $result/$counter;
return $result/$counter;
}
}
} | [
"function analyze_sentiment($text)\r\n {\r\n // Create the Natural Language client\r\n $serviceAccountPath =\"ENTER YOUR GOOGLE PROJECT FILE\";\r\n $projectId = \"PROJECT ID\";\r\n\r\n # Instantiates a client\r\n $language = new LanguageClient([\r\n 'projectId' => $projectId,\r\n 'keyFilePath' => $serviceAccountPath,\r\n\r\n ]);\r\n\r\n \r\n // Call the analyzeSentiment function\r\n $annotation = $language->analyzeSentiment($text);\r\n \r\n // Print document and sentence sentiment information\r\n $sentiment = $annotation->sentiment();\r\n echo \"<br>\";\r\n printf(' Score: %s' . PHP_EOL, $sentiment['score']);\r\n printf(PHP_EOL);\r\n foreach ($annotation->sentences() as $sentence) {\r\n printf('Sentence: %s' . PHP_EOL, $sentence['text']['content']);\r\n /*printf('Sentence Sentiment:' . PHP_EOL);\r\n printf(' Magnitude: %s' . PHP_EOL, $sentence['sentiment']['magnitude']);\r\n printf(' Score: %s' . PHP_EOL, $sentence['sentiment']['score']);*/\r\n printf(PHP_EOL);\r\n }\r\n }",
"protected function transformSentimentResults()\n {\n }",
"public function TwitterSentimentAnalysis($text) {\n $parameters=array(\n 'text'=>$text,\n );\n\n $result = null;\n foreach ($this->keys as $key){\n $jsonreply=$this->CallWebService($key, 'TwitterSentimentAnalysis',$parameters);\n $result=$this->ParseReply($jsonreply);\n if ($result != false) {\n break;\n }\n }\n\n return $result;\n }",
"function analyze_all($text)\n{\n $language = new NaturalLanguageClient();\n $annotation = $language->annotateText($text, [\n 'features' => ['entities', 'syntax', 'sentiment']\n ]);\n return $annotation;\n}",
"function produceAnalysis($tweets){\n $sentimentcount = array(\"neg\"=>0,\"pos\"=>0,\"neu\"=>0);\n //Initialize Analyzer\n $analyzer = new Analyzer(); \n //loop thorugh each tweets and evaluate whether it's positive,negative or neutral\n foreach($tweets->statuses as $key => $value){\n \n //use getSentiment method to evaluate the tweets\n $sentiment = $analyzer->getSentiment($value->text);\n if($sentiment['compound'] > 0){\n $sentimentcount[\"pos\"]++;\n }else if($sentiment['compound'] < 0){\n $sentimentcount[\"neg\"]++;\n }else{\n $sentimentcount['neu']++;\n }\n \n }\n //convert the final array into json format\n $jsonsentiment = json_encode($sentimentcount);\n //return the json format\n return $jsonsentiment;\n}",
"public function testComAdobeCqSocialUgcbaseModerationImplSentimentProcess() {\n\n }",
"public function return_sentiment_analysis() {\n return $this->output_mention;\n }",
"public function postOperations($sentence)\n {\n\t// localized traits\n\trequire_once(TRAITS_PATH.'PosTagging/BrillsRules_'.$this->language.'.php');\n\t\n\t\n\t$PosByFrequency = new PosByFrequency();\n\n\t// suspended, too many problems with italian language :(\n\t// $sentence = $NaiWordsToNumbers->prepareWordsToNumbers($sentence);\n\t// $sentence = $NaiWordsToNumbers->wordsToNumbers($sentence);\n\n\n\t// FROM SENTENCE STRING TO ARRAY POS_ARR\n\tNaiPosArr::$language = $this->language;\n\t$pos_arr = NaiPosArr::sentenceToPosArray($sentence);\n//\tdiex($pos_arr);\n\n\t\n\t// RESTORE PRESERVED TOKENS\n\t$pos_arr = NaiSentence::unpreservePosArr($pos_arr);\n\t\n\t\n // ADD TAIL SENT\n\t$pos_arr = NaiPosArr::addTailSent($pos_arr);\n//\tdiex($pos_arr);\n\n\t\n\t/**\n\t * @todo place here some filters for join multiple parts to compose \n\t * amounts and dates, measures values eg. 230 km , percentages, and others.\n\t */\n\t\n\t\n\t// TO SOME MOST COMMON TERMS, ASSIGN TEMPORARILY MORE COMMON FEATURE\n\tif($this->language != 'en')\n\t{\n\t $NaiCommonSimplifier = new NaiCommonSimplifier();\n\t NaiDictionary::$pos_dictionary = $NaiCommonSimplifier->simplify(NaiDictionary::$pos_dictionary);\n\t}\n//\tdiex(NaiDictionary::$pos_dictionary);\n\n\t\n\t// FILL POS ARRAY PARTS FROM THE DICTIONARY, AND FIXING FEATS OF PARTICIPLES\n\t$pos_arr = NaiPosArr::populateFromDictionary($pos_arr, NaiDictionary::$pos_dictionary);\n//\tdiex($pos_arr);\n\n\n\t// REMOVE PONS AND OTHER FASTIDIOUSLY OR UNUSEFUL\n\t$pos_arr = NaiPosArr::hideUnwantedTags($pos_arr, [], ['\"']); //, \"'\", \"<\", \">\"]);\n\n\t\n\t// IDENTIFY AND APPLY NGRAMS BY FORMS\n\tPosNgrams::$language = $this->language;\n\t$pos_arr = PosNgrams::transform($pos_arr);\n//\tdiex($pos_arr);\n\n\t\n\t// FIX ABBREVIATIONS WHERE \"ABL + .\"\n\t$pos_arr = NaiAbbreviationsFilter::fix($pos_arr);\n//\tdiex($pos_arr);\n\n\t\n\t// TIME TAGS NEEDS _ IN FORM AND LEMMAS\n\t$pos_arr = NaiTimeFilter::fix($pos_arr);\n\n\t\n\t// SCORING: BY COMBINATIONS OF DIFFERENT TIME, PERSON AND SEX\n//\tPosPersonAndSex::$dbgme = true;\n\tPosPersonAndSex::$language = $this->language;\n\tPosPersonAndSex::resetDoneIndex();\n\t$pos_arr = PosPersonAndSex::exclude($pos_arr);\n//\tdiex($pos_arr);\n\n\t\n\t// RECREATE NOUNS FOR ADJECTIVES SUBSTANTIVATED\n\t$pos_arr = PosNounAdj::transform($pos_arr);\n\t\n\t\n\t// TRY TO DETECT PROPER NAMES\n\t$pos_arr = PosProperNames::transform($pos_arr);\n//\tdiex($pos_arr);\n\t\n\t\n\t// TRY SOLVE UNKNOWN OR MISPELLED WORDS\n\tUnknownWords::$language = $this->language;\n\t$pos_arr = UnknownWords::solveUnknownWorks($pos_arr);\n\t\n\t\n\t// ENGLISH GENITIVES\n\tif($this->language == 'en')\n\t{\n\t $pos_arr = PosApostropheAndS::detect($pos_arr);\n\t}\n//\tdiex($pos_arr);\n\t\n // SCORING: BY BRILL RULES\n\t$PosBrillsClass = \"\\\\NaiPosTagger\\\\PosTagging\\\\NaiBrillsRulesTrait\";\n\t$PosBrillsClass::$language = $this->language;\n//\t$PosBrillsClass::$dbgme = true;\n\t$PosBrillsClass::$update_brill_hits = FALSE;\n\t$brill_subscores = $PosBrillsClass::applyRules($pos_arr);\n\t$pos_arr = $PosBrillsClass::applyScore($pos_arr, $brill_subscores);\n//\t\t echox($brill_subscores);\n//diex($pos_arr);\n\t\n // SCORING: BY FREQUENCIES IN METADATA\n\t$pos_arr = $PosByFrequency->transform($pos_arr);\n\n\t\n\t// APPLY SCORES\n\t$pos_arr = NaiPosArr::sortByScore($pos_arr);\n\t\n\t\t\n\t// RESTORE PARTS HIDDEN TO HELP BRILL RULES ETC.\n\t$pos_arr = NaiPosArr::unhideUnwantedTags($pos_arr);\n\t\n//diex($pos_arr);\n // TAG PRENOUNS\n\tif($this->language != 'en')\n\t{\n\t $pos_arr = PosPrenouns::transform($pos_arr);\n\t}\n\t\n \n\t// SOLVE COMBOS OF AUX E VER, FIXING WHERE POSSIBLE PPAST TAGS\n\t$PosAuxVerbs = new PosAuxVerbs();\n $PosAuxVerbs->language = $this->language;\n\t$pos_arr = $PosAuxVerbs->preserveAuxPatterns($pos_arr);\n\t\n // FIX PAST PARTICIPLES (unnecessary for english)\n//\tPosParticiples::$dbgme = true;\n\tif($this->language != 'en')\n\t{\n\t $pos_arr = PosParticiples::fixPartPast($pos_arr);\n\t}\n\n // DETECTING PHONE NUMBERS\n\t$pos_arr = NaiPhonesFilter::transform($pos_arr);\n\t\n\t\n\t// TAG AS PLACE terms with a ref \"plc\" inside metadata\n\t// no, because it interferes with later nouns associations...\n//\t$pos_arr = NaiAddressesFilter::tagPlaces($pos_arr);\n\t\n\n\t// @todo ROMAN NUMBERS \n\t// $pos_sentence = NaiRomanNumbersFilter::convertRomanNumbers($pos_sentence);\n//\tdiex($pos_arr);\n\n//\techox(NaiMyThoughts::$thoughts);\n\t\n\t// LAST REORDER BY SCORE\n\t$pos_arr = NaiPosArr::sortByScore($pos_arr);\n\t\n\treturn $pos_arr;\n\t\n }",
"function sentence_annotation() {\n global $set,$id,$dir,$biconcor;\n\n // load data\n $data = file(\"$dir/evaluation/$set.analysis.$id/bleu-annotation\");\n for($i=0;$i<count($data);$i++) {\n $item = split(\"\\t\",$data[$i]);\n $line[\"bleu\"] = $item[0]; \n $line[\"id\"] = $item[1]; \n $line[\"system\"] = $item[2];\n $line[\"reference\"] = \"\"; \n for($j=3;$j<count($item);$j++) {\n if ($j>3) { $line[\"reference\"] .= \"<br>\"; };\n $line[\"reference\"] .= $item[$j];\n } \n $bleu[] = $line;\n }\n\n $coverage_id = get_coverage_analysis_version($dir,$set,$id);\n if (file_exists(\"$dir/evaluation/$set.analysis.$coverage_id/input-annotation\")) {\n $input = file(\"$dir/evaluation/$set.analysis.$coverage_id/input-annotation\");\n }\n\n if (file_exists(\"$dir/evaluation/$set.analysis.$id/segmentation-annotation\")) {\n $data = file(\"$dir/evaluation/$set.analysis.$id/segmentation-annotation\");\n for($i=0;$i<count($data);$i++) {\n $segment = 0;\n foreach (split(\" \",$data[$i]) as $item) {\n\tlist($in_start,$in_end,$out_start,$out_end) = split(\":\",$item);\n\t$segment++;\n $segmentation[$i][\"input_start\"][$in_start] = $segment;\n $segmentation[$i][\"input_end\"][$in_end] = $segment;\n $segmentation[$i][\"output_start\"][$out_start] = $segment;\n $segmentation[$i][\"output_end\"][$out_end+0] = $segment;\n }\n }\n }\n\n // hierarchical data\n $hierarchical = 0;\n if (file_exists(\"$dir/evaluation/$set.analysis.$id/input-tree\")) {\n $data = file(\"$dir/evaluation/$set.analysis.$id/input-tree\");\n $span = 0;\n $last_sentence = -1;\n $nt_count = array();\n for($i=0;$i<count($data);$i++) {\n\t list($sentence,$brackets,$nt,$words) = split(\"\\t\",$data[$i]);\n\t if ($sentence != $last_sentence) { $span = 0; }\n\t $last_sentence = $sentence;\n\t $segmentation[$sentence][$span][\"brackets\"] = $brackets;\n#\t $segmentation[$sentence][$span][\"nt\"] = $nt;\n\t $segmentation[$sentence][$span][\"words\"] = rtrim($words);\n\t if ($nt != \"\") { $nt_count[$nt]++; }\n\t $span++;\n }\n $hierarchical = 1;\n# if (count($nt_count) <= 2) {\n#\t foreach ($segmentation as $sentence => $segmentation_span) {\n#\t foreach ($segmentation_span as $span => $type) {\n#\t\t $segmentation[$sentence][$span][\"nt\"]=\"\";\n#\t }\n#\t }\n# }\n }\n if (file_exists(\"$dir/evaluation/$set.analysis.$id/output-tree\")) {\n $data = file(\"$dir/evaluation/$set.analysis.$id/output-tree\");\n $span = 0;\n $last_sentence = -1;\n $nt_count = array();\n for($i=0;$i<count($data);$i++) {\n\t list($sentence,$brackets,$nt,$words) = split(\"\\t\",$data[$i]);\n\t if ($sentence != $last_sentence) { $span = 0; }\n\t $last_sentence = $sentence;\n\t $segmentation_out[$sentence][$span][\"brackets\"] = $brackets;\n\t $segmentation_out[$sentence][$span][\"nt\"] = $nt;\n\t $segmentation_out[$sentence][$span][\"words\"] = rtrim($words);\n\t if ($nt != \"\") { $nt_count[$nt]++; }\n\t $span++;\n }\n if (count($nt_count) <= 2) {\n\t foreach ($segmentation_out as $sentence => $segmentation_span) {\n\t foreach ($segmentation_span as $span => $type) {\n\t\t $segmentation_out[$sentence][$span][\"nt\"]=\"\";\n\t }\n\t }\n }\n }\n if (file_exists(\"$dir/evaluation/$set.analysis.$id/node\")) {\n $data = file(\"$dir/evaluation/$set.analysis.$id/node\");\n $n = 0;\n $last_sentence = -1;\n for($i=0;$i<count($data);$i++) {\n\t list($sentence,$depth,$start_div,$end_div,$start_div_in,$end_div_in,$children) = split(\" \",$data[$i]);\n\t if ($sentence != $last_sentence) { $n = 0; }\n\t $last_sentence = $sentence;\n\t $node[$sentence][$n]['depth'] = $depth;\n\t $node[$sentence][$n]['start_div'] = $start_div;\n\t $node[$sentence][$n]['end_div'] = $end_div;\n\t $node[$sentence][$n]['start_div_in'] = $start_div_in;\n\t $node[$sentence][$n]['end_div_in'] = $end_div_in;\n\t $node[$sentence][$n]['children'] = rtrim($children);\n\t $n++;\n }\n } \n\n $biconcor = get_biconcor_version($dir,$id);\n\n // sort\n global $sort;\n $sort = $_GET['sort'];\n if ($sort == '') {\n $sort = \"order\";\n }\n function cmp($a, $b) {\n global $sort;\n if ($sort == \"order\") {\n $a_idx = $a[\"id\"];\n $b_idx = $b[\"id\"];\n }\n else if ($sort == \"worst\") {\n $a_idx = $a[\"bleu\"];\n $b_idx = $b[\"bleu\"];\n if ($a_idx == $b_idx) { \n $a_idx = $b[\"id\"];\n $b_idx = $a[\"id\"];\n }\n }\n else if ($sort == \"best\") {\n $a_idx = -$a[\"bleu\"];\n $b_idx = -$b[\"bleu\"];\n if ($a_idx == $b_idx) { \n $a_idx = $a[\"id\"];\n $b_idx = $b[\"id\"];\n }\n }\n\n if ($a_idx == $b_idx) {\n return 0;\n }\n return ($a_idx < $b_idx) ? -1 : 1;\n }\n\n usort($bleu, 'cmp');\n\n $count = $_GET['count'];\n if ($count == 0) { $count = 5; }\n\n // display\n //print \"<div id=\\\"debug\\\"></div>\";\n for($i=0;$i<$count && $i<count($bleu);$i++) {\n $line = $bleu[$i]; \n if ($hierarchical) {\n\t annotation_hierarchical($line[\"id\"],$segmentation[$line[\"id\"]],$segmentation_out[$line[\"id\"]],$node[$line[\"id\"]]);\n }\n if ($input) {\n print \"<div id=\\\"info-$i\\\" style=\\\"border-color:black; background:#ffff80; opacity:0; width:100%; border:1px;\\\">8364 occ. in corpus, 56 translations, entropy: 5.54</div>\\n\";\n if ($biconcor) {\n\t //print \"<div id=\\\"biconcor-$i\\\" style=\\\"display: none;\\\">xxx</div>\";\n\t print \"<div id=\\\"biconcor-$i\\\" class=\\\"biconcor\\\">xxx</div>\";\n }\n if ($hierarchical) {\n sentence_annotation_hierarchical(\"#\".$line[\"id\"],$line[\"id\"],$input[$line[\"id\"]],$segmentation[$line[\"id\"]],\"in\");\n }\n else {\n\t print \"<font size=-2>[#\".$line[\"id\"].\"]</font> \";\n input_annotation($line[\"id\"],$input[$line[\"id\"]],$segmentation[$line[\"id\"]]);\n }\n }\n //else {\n // print \"<font size=-2>[\".$line[\"id\"].\":\".$line[\"bleu\"].\"]</font> \";\n //}\n if ($hierarchical) {\n sentence_annotation_hierarchical($line[\"bleu\"],$line[\"id\"],$line[\"system\"],$segmentation_out[$line[\"id\"]],\"out\");\n }\n else {\n print \"<font size=-2>[\".$line[\"bleu\"].\"]</font> \";\n output_annotation($line[\"id\"],$line[\"system\"],$segmentation[$line[\"id\"]]);\n }\n print \"<br><font size=-2>[ref]</font> \".$line[\"reference\"].\"<hr>\";\n }\n}",
"function sentimentAnalysis($obj){\n\n $post_data = json_encode($obj);\n\n //CURL request\n $url = \"http://www.sentiment140.com/api/bulkClassifyJson?appid=holygeezx@gmail.com\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_URL, $url);\n\n //receive server response\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n //execute CURL request\n $server_output = curl_exec ($ch);\n\n //close CURL\n curl_close ($ch);\n\n // parse returned object\n returnResult($server_output);\n }",
"public function testNewsSentiment()\n {\n }",
"private function analyse_single_words() {\n\n foreach ($this->lexicon_array as $word) {\n $wild_card_match = false;\n $check_word = str_replace(\"*\",\"\",$word['word']);\n if (strpos($word['word'],\"*\")) { $wild_card_match = true; } // check if the word in the lexion is a wild card match or not.\n $rating = floatval($word['rating']);\n\n $i = count($this->output_mention);\n $mention_i = 0;\n\n foreach ($this->mention as $mention_word) {\n if ($wild_card_match) { $regex = \"^$check_word\"; } else { $regex = \"\\b^$check_word\\b\"; } //check if we need to apply the wild card check or not.\n preg_match(\"/$regex/\", $mention_word, $matches); // check the word to the lexicon\n if (!$matches) {\n // look if it is perhaps an emoticon\n foreach ($this->emoticon_array as $emoticon) {\n if ($emoticon['word'] == $mention_word) {\n\n }\n }\n }\n\n if ($matches) {\n $this->output_mention[$i]['matched'] = $mention_word;\n $this->output_mention[$i]['rating'] = $rating;\n $this->output_mention[$i]['type'] = 'single_word';\n $this->number_sentiment_words++;\n \n\n /* LOOK FOR ENHANCERS */\n // check if there are any enhancers before (or after) the word\n $enhancer_rating = 0;\n if (isset($this->mention[$mention_i-1])) {\n $enhancer_rating = floatval($this->determine_enhancer($this->mention[$mention_i-1]));\n if ($enhancer_rating) {\n //echo \"found enhancer (\".$this->mention[$i-1].\") $enhancer_rating \\n\";\n\n if ($enhancer_rating > 0) { $this->number_positive_words++; }\n if ($enhancer_rating < 0) { $this->number_negative_words++; }\n\n $this->output_mention[$i+1]['matched'] = $this->mention[$mention_i-1];\n $this->output_mention[$i+1]['rating'] = $enhancer_rating;\n $this->output_mention[$i+1]['type'] = 'enhancer';\n $this->output_mention[$i+1]['enhancer'] = true;\n $this->number_sentiment_words++;\n }\n }\n\n /* LOOK FOR POLARITY CHANGERS */\n if (isset($this->mention[$mention_i-1])) {\n $polarised = $this->determine_negative_polarity($this->mention[$mention_i-1]);\n if ($polarised) {\n $this->output_mention[$i+1]['matched'] = $this->mention[$mention_i-1];\n /* change the rating to negative */\n $rating = -$this->output_mention[$i]['rating'];\n $this->output_mention[$i]['rating'] = $rating;\n $this->output_mention[$i+1]['type'] = 'polarity_changer';\n $this->output_mention[$i+1]['polarity'] = true;\n }\n }\n\n if ($rating > 0) { $this->number_positive_words++; }\n if ($rating < 0) { $this->number_negative_words++; }\n\n $this->alter_sentiment($rating,$enhancer_rating); // increase/decrease sentiment score\n }\n $mention_i++;\n $i++;\n }\n }\n }",
"public function getAnalyzeQueryTextSentiment()\n {\n return $this->analyze_query_text_sentiment;\n }",
"function _sift_sentiment_scores($sentiments){\r\n $pos_sum = 0.0;\r\n $neg_sum = 0.0;\r\n $neu_count = 0;\r\n foreach($sentiments as $sentiment_score){\r\n if($sentiment_score > 0){\r\n $pos_sum += $sentiment_score +1; # compensates for neutral words that are counted as 1\r\n\t\t\t}\r\n if ($sentiment_score < 0){\r\n $neg_sum += $sentiment_score -1; # when used with math.fabs(), compensates for neutrals\r\n\t\t\t}\r\n if ($sentiment_score == 0){\r\n $neu_count += 1;\r\n\t\t\t}\r\n\t\t}\r\n return [$pos_sum, $neg_sum, $neu_count];\r\n\t}",
"public function getAnnotationSentiment()\n {\n return $this->annotation_sentiment;\n }",
"public function sentiment ($text) {\n $text = $this->_normalizeText($text);\n\n $response = $this->instance->request('sentiment-analysis', [\n 'text' => $text\n ]);\n\n if (!isset($response['sentiment'])) {\n throw new InvalidRequestException('Unknown error');\n }\n\n return $response['sentiment'];\n }",
"public function sentimentAnalysisText(string $text): array\n {\n V::doValidate(V::stringType()::length(1, 1000), $text);\n\n return $this->options\n ->getSync()\n ->setFormParams(['text' => $text])\n ->setHeaderParams($this->options->getAuthorizationHeader())\n ->put(API::LIST['neuralSment']);\n }",
"public function sentimentAnalysis($facebookSearchParams) {\n $posts=$this->getPosts($facebookSearchParams);\n \n return $this->findSentiment($posts);\n }",
"function analyze_sentiment_from_file($bucketName, $objectName, $projectId = null)\n{\n // Create the Cloud Storage object\n $storage = new StorageClient();\n $bucket = $storage->bucket($bucketName);\n $storageObject = $bucket->object($objectName);\n\n // Create the Natural Language client\n $language = new LanguageClient([\n 'projectId' => $projectId,\n ]);\n\n // Call the analyzeSentiment function\n $annotation = $language->analyzeSentiment($storageObject);\n\n // Print document and sentence sentiment information\n $sentiment = $annotation->sentiment();\n printf('Document Sentiment:' . PHP_EOL);\n printf(' Magnitude: %s' . PHP_EOL, $sentiment['magnitude']);\n printf(' Score: %s' . PHP_EOL, $sentiment['score']);\n printf(PHP_EOL);\n foreach ($annotation->sentences() as $sentence) {\n printf('Sentence: %s' . PHP_EOL, $sentence['text']['content']);\n printf('Sentence Sentiment:' . PHP_EOL);\n printf(' Magnitude: %s' . PHP_EOL, $sentence['sentiment']['magnitude']);\n printf(' Score: %s' . PHP_EOL, $sentence['sentiment']['score']);\n printf(PHP_EOL);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count Gists Counts the number of each tag occurences, of Gists with no tag, of public, private, user own, starred and all Gists together. | private function countGists()
{
foreach ($this->gists as $gist) {
if ($gist->isPublic()) {
$this->public += 1;
}
else {
$this->private += 1;
}
if (!$gist->getTags()) {
$this->withoutTag += 1;
}
if ($gist->getOwner()['id'] === $this->ownerId) {
$this->owned += 1;
}
if ($gist->isStarred() === true) {
$this->starred += 1;
}
$this->all += 1;
$this->countTags($gist->getTags());
}
} | [
"public function getGists();",
"public function gists()\n {\n return $this->client->api('gists')->all();\n }",
"function venture_group_get_counts($gid) {\n static $counts = array();\n if (!$counts[$gid]) {\n // Get fast counts (unlike original query, do NOT rewrite the SQL\n // in order to see the counts for moderated groups)\n $query = 'SELECT COUNT(DISTINCT n.nid) AS fast_topic_count, COUNT(c.cid) AS fast_comment_count, \n MAX(ncs.last_comment_timestamp) AS fast_last_updated FROM {node} n\n INNER JOIN {og_ancestry} oga ON n.nid = oga.nid LEFT JOIN {comments} c ON n.nid = c.nid\n LEFT JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid WHERE n.status = 1 AND oga.group_nid = %d';\n $counts[$gid] = db_fetch_array(db_query($query, $gid));\n \n // Get the member count\n $query = preg_replace(array('/SELECT.*?FROM /As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM ', ''),\n og_list_users_sql());\n $counts[$gid]['fast_member_count'] = db_result(db_query($query, $gid));\n }\n return $counts[$gid];\n}",
"abstract public function CountUsersInGroup(int $gid) : int;",
"public function countTag($tag);",
"function get_all_guru_count()\n {\n $this->db->from('guru');\n return $this->db->count_all_results();\n }",
"private function countTags()\n {\n //$count = substr_count($this->html, $this->tag);\n $countOneBracket = substr_count($this->html, \"<\" . $this->tag);\n $countTwoBrackets = substr_count($this->html, \"<\" . $this->tag . \">\");\n $this->tagsNumber = $countOneBracket + $countTwoBrackets;\n }",
"function computeTagsNumber(){\n\n return Tag::count();\n}",
"public function countMeta();",
"public function count() : int\n\t{\n\t\treturn count( $this->tags );\n\t}",
"private function countTags() {\n\t\t\t$content = new DOMDocument();\n\t\t\t$content->loadHTMLFile($this->contentPath);\n\t\t\t// Create an array with all tags that exist in content.\n\t\t\t$tags = $content->getElementsByTagName('*');\n\t\t\t// Count the occurence of each tag.\n\t\t\tforeach($tags as $tag) {\n\t\t\t\tif(array_key_exists($tag->tagName, $this->tagCountArray)) {\n\t\t\t\t\t$this->tagCountArray[$tag->tagName] += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->tagCountArray[$tag->tagName] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function countGroupe(){\n\t\t\t\t\t return count($this->listeGroupe());\n\t\t\t\t\t }",
"function venture_deal_get_group_counts($gids) {\n $placeholders = implode(',', array_fill(0, count($gids), \"'%s'\"));\n $query = \"SELECT field_deal_groups_value AS gid, COUNT(nid) AS deal_count\n FROM {content_field_deal_groups} WHERE field_deal_groups_value IN ($placeholders) GROUP BY field_deal_groups_value\";\n $result = db_query($query, $gids);\n \n while ($group = db_fetch_object($result)) {\n $counts[$group->gid] = $group->deal_count;\n }\n \n return $counts;\n}",
"public function tagCount()\n {\n return $this->tags->count();\n }",
"public function countUsersInGroup($gid, $search = ''): int {\n return 0;\n }",
"public function get_group_count();",
"public function getStarGoodsCount()\n {\n return $this->count(self::_STAR_GOODS);\n }",
"function countTag($tagname = null)\n {\n if ($tagname == null) {\n $tagname = \"__total\";\n }\n if (isset($this->_tags[$tagname])) {\n return $this->_tags[$tagname];\n }\n return $this->raiseError('Tag {$tagname} not found.', XML_STATISTICS_ERROR_TAG_NOT_FOUND);\n }",
"public function count() {\n\t\treturn count($this->_facets) ;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AJAX: Get logs files | public function ajaxProcessGetLogFiles()
{
/** @var LoggerFileFinder $loggerFileFinder */
$loggerFileFinder = $this->module->getService('ps_checkout.logger.file.finder');
header('Content-type: application/json');
$this->ajaxDie(json_encode($loggerFileFinder->getLogFileNames()));
} | [
"public function ajaxProcessGetLogs()\n {\n header('Content-type: application/json');\n\n $filename = Tools::getValue('file');\n $offset = (int) Tools::getValue('offset');\n $limit = (int) Tools::getValue('limit');\n\n if (empty($filename) || false === Validate::isFileName($filename)) {\n http_response_code(400);\n $this->ajaxDie(json_encode([\n 'status' => false,\n 'errors' => [\n 'Filename is invalid.',\n ],\n ]));\n }\n\n /** @var LoggerDirectory $loggerDirectory */\n $loggerDirectory = $this->module->getService('ps_checkout.logger.directory');\n /** @var LoggerFileReader $loggerFileReader */\n $loggerFileReader = $this->module->getService('ps_checkout.logger.file.reader');\n $fileData = [];\n\n try {\n $fileData = $loggerFileReader->read(\n new SplFileObject($loggerDirectory->getPath() . $filename),\n $offset,\n $limit\n );\n } catch (Exception $exception) {\n http_response_code(500);\n $this->ajaxDie(json_encode([\n 'status' => false,\n 'errors' => [\n $exception->getMessage(),\n ],\n ]));\n }\n\n $this->ajaxDie(json_encode([\n 'status' => true,\n 'file' => $fileData['filename'],\n 'offset' => $fileData['offset'],\n 'limit' => $fileData['limit'],\n 'currentOffset' => $fileData['currentOffset'],\n 'eof' => (int) $fileData['eof'],\n 'lines' => $fileData['lines'],\n ]));\n }",
"public function showlogs()\n {\n $data = array();\n if (isset($_POST['displaylog']) && $_POST['displaylog']) {\n\n $selected_log = $_POST['displaylog'];\n if (file_exists($this->logs_dir.$selected_log)) {\n $selected_dir = $this->logs_dir.$selected_log;\n $selected_files = scandir($selected_dir);\n $data['files'][$selected_log] = $selected_files;\n } else {\n $data['log_not_found'] = true;\n }\n }\n if (isset($_GET['log_file']) && $_GET['log_file']) {\n $filename = $_GET['log_file'];\n $file = $this->logs_dir.$filename;\n if (file_exists($file)) {\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Disposition: attachment; filename=$filename\");\n header(\"Content-Type: text/plain\");\n header(\"Content-Transfer-Encoding: binary\");\n // read the file from disk\n readfile($file);\n die;\n }\n }\n load_views('service/showlogs', $data);\n }",
"public function getLogfiles()\n {\n $url = sprintf(\n 'http://%s/fog/status/getfiles.php?path=%s',\n $this->get('ip'),\n '%s'\n );\n $paths = array(\n '/var/log/nginx',\n '/var/log/httpd',\n '/var/log/apache2',\n '/var/log/fog',\n '/var/log/php7.0-fpm',\n '/var/log/php-fpm',\n '/var/log/php5-fpm',\n '/var/log/php5.6-fpm',\n );\n $url = sprintf(\n $url,\n urlencode(implode(':', $paths))\n );\n $paths = self::$FOGURLRequests->process($url);\n foreach ((array) $paths as $index => &$response) {\n $tmppath = self::fastmerge(\n (array) $tmppath,\n (array) json_decode($response, true)\n );\n unset($response);\n }\n $paths = array_filter($tmppath);\n $paths = array_values($paths);\n natcasesort($paths);\n $this->set('logfiles', $paths);\n }",
"function get_log_file_list($userId) {\n\t $log_files = _get_log_file_list($userId);\n\t return json_encode($log_files, JSON_UNESCAPED_SLASHES);\n}",
"protected function getFileLogs() {\r\n\t\t$list = new FileLogList();\r\n\t\t$list->readObjects(false);\r\n\t\t\r\n\t\treturn $list->getObjects();\r\n\t}",
"public function getLogs();",
"public function get_logs()\n\t{\n\t\t$this->post_logs();\n\t}",
"protected function http_receive_logs(){\n\t\t\n\t\tif (isset($_POST[\"evt\"]))\n\t\t\t$this->evt = json_decode($_POST[\"evt\"], true);\n\n\t\tif ($this->evt != \"\"){\n\n\t\t\t// single log\n\n\t\t\t$evt = $this->evt;\n\n\t\t\t$topic = $this->sanitize($evt[0]);\n\t\t\t\n\t\t\t$data = array($evt[1]);\n\n\t\t\t$headers = \"\";\n\t\t\tif (isset($evt[4]))\n\t\t\t\t$headers = $evt[4];\t\t// should be a string containing a json array\n\n\t\t\t$mysql_data_types = \"\";\n\t\t\tif (isset($evt[5]))\n\t\t\t\t$mysql_data_types = $evt[5];\t// should be a string containing a json array\n\n\t\t\t$remark = \"\";\n\t\t\tif (isset($evt[6]))\n\t\t\t\t$remark = $evt[6];\t\t// should be a string\n\n\t\t\tif (isset($evt[7]))\n\t\t\t\t$logs_basedir_vol_id = intval($evt[7]);\n\t\t\telse\n\t\t\t\t$logs_basedir_vol_id = \"\";\n\n\t\t\t$is_save_to_file = PHPWSConfig::$is_auto_save_log_to_file;\n\n\t\t\t// check for subscriptions\n\t\t\tif (array_key_exists($topic, PHPWSConfig::$subscriptions)){\n\t\t\t\t\n\t\t\t\t$sub = PHPWSConfig::$subscriptions[$topic];\n\t\t\t\t$ctrl_classname = get_ctrl_classname($sub[0], $sub[1]);\n\n\t\t\t\ttry {\n\t\t\t\t\t$reflectionMethod = new ReflectionMethod($ctrl_classname, $sub[2]);\n\t\t\t\t\t$is_save_to_file_local = $reflectionMethod->invokeArgs(new $ctrl_classname(), $data);\n\n\t\t\t\t\tif ($is_save_to_file_local === false)\n\t\t\t\t\t\t$is_save_to_file = false;\n\t\t\t\t\telseif ($is_save_to_file_local === true)\n\t\t\t\t\t\t$is_save_to_file = true;\n\n\t\t\t\t} catch (Exception $ex){\n\t\t\t\t\t$this->rolling_file_logger(\"phpws_errors\", array(array($ex->getMessage())));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($is_save_to_file)\n\t\t\t\treturn $this->rolling_file_logger($topic, $data, $headers, $remark, $logs_basedir_vol_id, $mysql_data_types) ? 1 : 0;\n\n\t\t\treturn 1;\n\n\t\t} elseif (isset($_POST[\"evts\"])) {\n\t\t\t\n\t\t\t// multiple logs\n\n\t\t\tif (strlen($_POST[\"evts\"]) == 0)\n\t\t\t\treturn 0;\n\n\t\t\t$evts = json_decode($_POST[\"evts\"], true);\n\n\t\t\tif (!is_array($evts))\n\t\t\t\t$evts = array($evts);\n\n\t\t\t$fails = array();\n\n\t\t\t$is_all_ok = true;\n\n\t\t\tforeach ($evts as $k => $v){\n\t\t\t\t$evt = $evts[$k];\n\n\t\t\t\t$this->evt = $evt;\n\n\t\t\t\tif ($this->http_receive_logs() == 0){\n\t\t\t\t\t// log failed\n\t\t\t\t\t$fails[] = array($evt[2], $evt[3]);\n\t\t\t\t\t$is_all_ok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($is_all_ok)\n\t\t\t\treturn 1;\n\n\t\t\tif (count($fails) == count($evts))\n\t\t\t\treturn 0;\n\n\t\t\treturn json_encode($fails);\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function getLogFiles()\n {\n // Check if path exists\n $path = Mage::getBaseDir('var') . DS . 'log' . DS;\n if (!file_exists($path)) {\n return array();\n }\n\n // Return file list\n $io = new Varien_Io_File();\n $io->open(\n array(\n 'path' => $path\n )\n );\n return $io->ls(Varien_Io_File::GREP_FILES);\n }",
"public static function getLogs() {\n $result = array();\n\n $it = new GlobIterator(DIR_FS_WORK . 'logs/update-*.txt');\n\n foreach ( $it as $f ) {\n $result[] = $f->getFilename();\n }\n\n return $result;\n }",
"public function serve_log_downloads() {\n\t\tif ( empty( $_GET['tribe-common-log'] ) || 'download' !== $_GET['tribe-common-log'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! wp_verify_nonce( @$_GET['check'], 'download_log' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $_GET['log'] ) || ! in_array( $_GET['log'], $this->get_available_logs() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$log_name = sanitize_file_name( $_GET['log'] );\n\t\t$this->current_logger()->use_log( $log_name );\n\n\t\t/**\n\t\t * Provides an opportunity to modify the recommended filename for a downloaded\n\t\t * log file.\n\t\t *\n\t\t * @param string $log_name\n\t\t */\n\t\t$log_name = apply_filters( 'tribe_common_log_download_filename', $log_name );\n\n\t\theader( 'Content-Disposition: attachment; filename=\"tribe-log-' . $log_name . '\"' );\n\t\t$output = fopen( 'php://output', 'w' );\n\n\t\tforeach ( $this->current_logger()->retrieve() as $log_entry ) {\n\t\t\tfputcsv( $output, $log_entry );\n\t\t}\n\n\t\tfclose( $output );\n\t\texit();\n\t}",
"public function get_download_logs( $args = array() );",
"public static function get_log_files()\n\t{\n\t\t$files = array();\n\n\t\t$logs = Kohana::list_files('logs');\n\n\t\tforeach($logs as $year => $months)\n\t\t{\n\t\t\tforeach($months as $month => $day)\n\t\t\t{\n\t\t\t\tforeach($day as $log)\n\t\t\t\t{\n\t\t\t\t\t$files[] = $log;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}",
"public static function getLogfiles() {\n\t\t\t$logfiles = glob(Config::get('iis_log_path') . \"*.log\");\n\t\t\tLogger::log(\"Info: Found a total of \" . count($logfiles) . \" logfiles.\");\n\t\t\treturn $logfiles;\n\t\t}",
"public function getLogs() {\n $file = './app-info.log';\n $content = file_get_contents($file);\n\n return response($content)->header('Content-Type', 'text/plain');\n }",
"public function downloadLogFileAction()\n {\n /** @var Ingenico_Connect_Model_ConfigInterface $config */\n $config = Mage::getSingleton('ingenico_connect/config');\n\n $fileToDownload = Mage::getBaseDir('var') . DS . 'log' . DS . $config->getLogAllRequestsFile();\n if (is_file($fileToDownload)) {\n $this->_prepareDownloadResponse(\n basename($fileToDownload),\n array(\n 'value' => $fileToDownload,\n 'type' => 'filename'\n )\n );\n }\n\n $this->_redirectReferer();\n }",
"public function collect_logs()\n {\n $body = file_get_contents(\"php://input\");\n $r = @file_get_contents('/tmp/apple.push.log');\n file_put_contents('/tmp/apple.push.log', $r . $body);\n return 'success'; \n }",
"function get_audit_trail_logs(){\n\t\t$pagepointer = '';\n\t\tif(isset($_SESSION['temp_storage']['pagepointer']) && $_SESSION['temp_storage']['pagepointer']){\n\t\t\t$pagepointer = $_SESSION['temp_storage']['pagepointer'];\n\t\t}\n\t\t\n\t\t$oldurl = 'tmp/audit_logs/';\n\t\t\n\t\t$array_to_return = array();\n\t\t\n\t\tif(is_dir($pagepointer.$oldurl)){\n\t\t\t//3. Open & Read all files in directory\n\t\t\t$cdir = opendir($pagepointer.$oldurl);\n\t\t\twhile($cfile = readdir($cdir)){\n\t\t\t\tif(!($cfile=='.' || $cfile=='..')){\n\t\t\t\t\t//Check if report exists\n\t\t\t\t\t$get_name = explode('.',$cfile);\n\t\t\t\t\tif(isset($get_name[0]) && $get_name[0]){\n\t\t\t\t\t\t$array_to_return[$get_name[0]] = date('j-M-Y',($get_name[0]/1)).' Log';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($cdir);\n\t\t}\n\t\t\n\t\treturn $array_to_return;\n\t}",
"private function loadLogFiles()\n {\n $files = [];\n if ($handle = opendir($this->logPath)) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n $filename = explode('.', $entry);\n if ($filename[count($filename) - 1] == 'log') {\n $files[] = $entry;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take a preprepared query and modify it to only show the given attendance types. null can be in the array. | private function eventQueryShowByAttendance($query, String $table_name, array $attendances) {
$singular = Str::singular($table_name);
//TODO: Nicer query building.
$query = $query->where (function($q) use ($singular, $attendances) {
foreach ($attendances as $attendance) {
if (null === $attendance) {
$q->orWhereNull($singular . '_attendances.attendance');
} else {
$q->orWhere($singular . '_attendances.attendance', '=', \Config::get('enums.attendances')[$attendance]);
}
}
});
return $query;
} | [
"public function get_all_major_activities($target_type){ \n if( $target_type == \"\" ) return FALSE;\n $sql = \"SELECT * FROM mis_major_activities WHERE target_type IN (\". $target_type .\")\";//show($sql); \n $resutl = $this->db->prepare($sql);\n $resutl->execute();\n return $resutl->fetchAll();\n }",
"public function getExamTypes(){\n \t$sql = \"SELECT id, type FROM exam_type\";\n \t$query = $this->db->prepare($sql);\n \t$query->execute();\n \t\n \treturn $query->fetchAll();\n }",
"public function attendanceList() {\n\t\t$type = array();\n\t\t$type[1] = __('Full Day');\n\t\t$type[2] = __('Half Day');\n\t\t$type[3] = __('Leave');\n\t\t\n\t\treturn $type;\n\t}",
"function filterMulti($con, $filterArr, $filterType)\r\n{\r\n // Add name to filter type\r\n $filterType = $filterType . 'Name';\r\n $sql =\r\n \"\r\n SELECT * FROM PV_ASSET_REPORTS\r\n WHERE\r\n \";\r\n\r\n // Prepare sql based on how many elements are in the filter array\r\n foreach($filterArr as $item)\r\n {\r\n $sql .= $filterType . ' = ? OR ';\r\n }\r\n\r\n // Remove the last OR from sql\r\n $sql = substr_replace($sql, \"\", -3);\r\n $sql = trim($sql);\r\n\r\n // Prepare sql statement\r\n $query = $con->prepare($sql);\r\n $query->execute($filterArr);\r\n\r\n // Return result\r\n return $query->fetchAll(PDO::FETCH_ASSOC);\r\n}",
"function getClassAttendance($classes, $tableCols = array('name' => 'Name'))\n {\n $results = $class_attendance = array();\n foreach ($classes as $key => $class) {\n $attn = $class->attendance->lists('member_id', 'member_id')->toArray();\n $tableCols[$class->name] = $class->class_date->format('d M Y');\n foreach ($attn as $key => $value) {\n $class_attendance[$key][] = $class->name; \n }\n }\n $tableCols['status'] = 'Status';\n $results['attendance'] = $class_attendance;\n $results['table'] = $tableCols;\n return $results;\n }",
"function show_select_types_de_films(){\n global $data;\n $types = array();\n foreach ($data as $row) {\n if (!in_array($row[3],$types) && $row[3] !=\"Type\"){\n $types[] = $row[3];\n echo \"<li role='type'><a role='menuitem' href='/?type=\" . urlencode($row[3]) .\"'>\" . $row[3] . \"</a></li>\";\n }\n }\n}",
"function check_attendance($kwds) {\n $kwds = mysqli_real_escape_string($this->connection, $kwds); \n return $this->query(\"SELECT DISTINCT class.id as id FROM class\n INNER JOIN coteacher ON class.id = coteacher.class_id\n INNER JOIN attendance ON attendance.user_id = coteacher.user_id\n WHERE class.kwds_id = $kwds\n AND (arrival > day or departure < ADDTIME(day, SEC_TO_TIME(hours*60)))\");\n }",
"function getAttendance($staff, $date){\n\t$rows = array();\n\t\t\t$query = \"select * from attendance\";\n\t\t$link = Utility::getDefaultDBConnection();\n\t\tif(isset($staff) and isset($date)){\n\t\t\t$query = \"select * from attendance where staff_id='\".$staff.\"' and day<='$date'\";\n\t\t}\n\t\telseif(isset($date)){\n\t\t\t$query = \"select * from attendance where day<='$date'\";\n\t\t}\n\t\telseif(isset($staff)){\n\t\t\t$query = \"select * from attendance where staff_id='\".$staff.\"'\";\n\t\t}\n\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\n\t\tif($result){\n\t\t\twhile($row = mysqli_fetch_array($result)){\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t}\n return $rows;\n}",
"public function gainEmplInfoByType($emplid,$type=null){\n $code = md5(serialize(func_get_args()));\n static $stc_empl_info_rows = array();\n if(isset($stc_empl_info_rows[$code])){\n return $stc_empl_info_rows[$code];\n }\n\n $emplid = intval($emplid);\n $order_data = array();\n $order_data = array('ID'=>'ASC');\n $wheres = array();\n $wheres['EMPL_ID'] = $emplid;\n if($type!==null){\n $wheres['TYPE'] = intval($type);\n }\n $info_list = $this->where($wheres)\n ->order($order_data)\n ->select();\n $info_list = is_array($info_list)?$info_list:array();\n\n $stc_empl_info_rows[$code]=$info_list;\n return $info_list;\n }",
"function get_ActivityList($typeId,$orderBy)\n\t{\n\t\t$strplue = \"activity.aid as aid, activity.name as name,activity.start_time as start_time,\n\t\t\t\t\tactivity.end_time as end_time,activity.location as location,\n\t\t\t\t\tactivity.type_id as type_id,activity.leader_id as leader_id,\n\t\t\t\t\tactivity.care_num as care_num, activity.join_num as join_num,\n\t\t\t\t\tuser.rrid as rrid,user.uname as uname,user.uid as uid,post.url as url\";\n\t\t$strTime = \"end_time>=NOW()\";\n\t\tif($typeId==0)\n\t\t{\n\t\t\tswitch($orderBy)\n\t\t\t{\n\t\t\tcase null:\n\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and $strTime;\";\n\t\t\t\tbreak;\n\t\t\tcase \"time\":\n\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and $strTime order by aid desc;\";\n\t\t\t\tbreak;\n\t\t\tcase \"care_num\":\n\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and $strTime order by order_num desc where $strTime;\";\n\t\t\t\tbreak;\n\t\t\tcase \"join_num\":\n\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and $strTimeorder by join_num desc;\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and $strTime;\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch($orderBy)\n\t\t\t{\n\t\t\t\tcase null:\n\t\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and type_id=$typeId and $strTime;\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"time\":\n\t\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and type_id=$typeId and $strTime order by aid desc;\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"care_num\":\n\t\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and type_id=$typeId and $strTime order by order_num desc;\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"join_num\":\n\t\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and type_id=$typeId and $strTime order by join_num desc;\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$sqlstr = \"select $strplue from activity,user,post where post.pid=activity.pic_id and activity.leader_id=user.uid and type_id=$typeId and $strTime;\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//echo $sqlstr;\n\t\t//echo $sqlstr;\n\t\t$result = doQuery($sqlstr);\n\t\t$rows = mysql_num_rows($result);\n\t\tif(!$result && $rows==0)\n\t\t{\n\t\t\treturn array();\n\t\t}\t\n\t\t$activities=array();\n\t\twhile($activity = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tarray_push($activities, $activity);\n\t\t}\n\t\treturn $activities;\n\t}",
"function get_sql_hazard_filter($dept = NULL, $date_start = NULL, $date_end = NULL, $type_restriction = NULL, $mitigated = NULL) {\n $filters = array();\n if ($dept != NULL) {\n $filters[] = \"dept = '\" . $dept . \"'\";\n }\n if ($date_start != NULL) {\n $filters[] = \"date >= '\" . $date_start . \"'\";\n }\n if ($date_end != NULL) {\n $filters[] = \"date <= '\" . $date_end . \"'\";\n }\n if ($type_restriction != NULL) {\n $filters[] = \"audit_type = '\" . $type_restriction . \"'\";\n }\n if ($mitigated != NULL) {\n $filters[] = \"mitigated = \" . $mitigated;\n }\n $filter_str = join(\" AND \", $filters);\n return \" WHERE \" . ($filter_str != \"\" ? $filter_str : \"1\") . \" \";\n}",
"public function getAllUserAwards($type){\n \n global $DB; \n \n $sqlParams = array($this->id, $type);\n \n $sql = \"SELECT * FROM {bcgt_user_qual_awards}\n WHERE userid = ? AND type = ? \";\n \n $records = $DB->get_records_sql($sql, $sqlParams);\n $return = array();\n \n if ($records)\n {\n foreach($records as $record)\n {\n \n // Check that the student is still on this qualificaiton\n if ($this->isOnQual($record->qualid))\n {\n \n $arr = array();\n $arr['record'] = $record;\n\n if (!is_null($record->qualid) && is_numeric($record->awardid))\n {\n $award = $DB->get_record(\"bcgt_qual_build_awards\", array(\"id\" => $record->awardid));\n if ($award)\n {\n $obj = new \\GT\\QualificationAward($award->id);\n if ($obj->isValid())\n {\n $arr['grade'] = $obj;\n $return[] = $arr;\n }\n }\n }\n \n }\n \n }\n }\n \n return $return;\n \n }",
"function select_all_from_type(){\n\t\t\n\t global $db; \n\t\t$query = \"SELECT * FROM \";\n\t\t$query .= \" type ;\";\n\t\t$employee = $db->query($query);\n\t\t \n\t return $employee;\n\t\t\t\n\t\t}",
"function get_stats_activity_types()\n {\n return sql_array(\"SELECT DISTINCT activity_type `value` FROM daily_stat ORDER BY activity_type\");\n }",
"function getQuestionsByType($questiontype){\n\t\t$stmt = $this->con->prepare(\"SELECT questionid, questionbody, questioncategory, questiontype, datecreated, expirationdate, usefulcount, visible, userid FROM question WHERE questiontype = ? AND (ExpirationDate >= CURRENT_DATE OR Visible = 1) ORDER BY questionid DESC\");\n\t\t$stmt->bind_param(\"s\", $questiontype);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($questionid, $questionbody, $questioncategory, $questiontype, $datecreated, $expirationdate, $usefulcount, $visible, $userid);\n\t\t\n\t\t$questions = array(); \n\t\t\n\t\twhile($stmt->fetch()){\n\t\t\t$question = array();\n\t\t\t$question['questionid'] = $questionid; \n\t\t\t$question['questionbody'] = $questionbody;\n\t\t\t$question['questioncategory'] = $questioncategory;\n\t\t\t$question['questiontype'] = $questiontype;\n\t\t\t$question['datecreated'] = $datecreated;\n\t\t\t$question['expirationdate'] = $expirationdate;\n\t\t\t$question['usefulcount'] = $usefulcount; \n\t\t\t$question['visible'] = $visible; \n\t\t\t$question['userid'] = $userid; \n\t\t\tarray_push($questions, $question); \n\t\t}\n\t\t\n\t\treturn $questions; \n\t}",
"function getAttendance($cun){\n \n $eun = $this -> db -> quote($cun['un']);\n \n $qs = \"SELECT * FROM viv_cust_att_en WHERE _cust_att_un = \". $eun.\" SORT BY _cust_att_addedon\";\n $qr = $this -> db -> query($qs);\n return $qr -> fetchAll(PDO::FETCH_ASSOC);\n \n }",
"function print_event_type_filter($cattype = '', $fieldname = 'project_details', $disabled = false)\r\n {\r\n global $ilance, $ilconfig, $phrase, $onload, $js, $invitelist, $memberinvitelist, $show;\r\n $event1 = $event3 = $event4 = $event5 = '';\r\n if (!empty($ilance->GPC['project_details']) AND $ilance->GPC['project_details'] == 'public')\r\n {\r\n $event1 = 'checked=\"checked\"';\r\n }\r\n else if (!empty($ilance->GPC['project_details']) AND $ilance->GPC['project_details'] == 'invite_only')\r\n {\r\n $event3 = 'checked=\"checked\"';\r\n $onload .= 'duration_switch(3); ';\r\n // at this point, the auction poster could be adding new members\r\n // to the currently selected invitation list so lets find out\r\n $invitemessage = isset($ilance->GPC['invitemessage']) ? handle_input_keywords($ilance->GPC['invitemessage']) : '';\r\n }\r\n else if (!empty($ilance->GPC['project_details']) AND $ilance->GPC['project_details'] == 'realtime')\r\n {\r\n $event4 = 'checked=\"checked\"';\r\n $onload .= 'duration_switch(2); toggle_show(\\'scheduledate\\'); ';\r\n }\r\n else\r\n {\r\n $event1 = 'checked=\"checked\"';\r\n $event3 = $event4 = $event5 = '';\r\n }\r\n // populate realtime bidding scheduled date pulldown data\r\n $ilance->GPC['year'] = isset($ilance->GPC['year']) ? intval($ilance->GPC['year']) : '';\r\n $ilance->GPC['month'] = isset($ilance->GPC['month']) ? intval($ilance->GPC['month']) : '';\r\n $ilance->GPC['day'] = isset($ilance->GPC['day']) ? intval($ilance->GPC['day']) : '';\r\n $ilance->GPC['hour'] = isset($ilance->GPC['hour']) ? intval($ilance->GPC['hour']) : '';\r\n $ilance->GPC['min'] = isset($ilance->GPC['min']) ? intval($ilance->GPC['min']) : '';\r\n $ilance->GPC['sec'] = isset($ilance->GPC['sec']) ? intval($ilance->GPC['sec']) : '';\r\n\t\t$html = '<table cellpadding=\"' . $ilconfig['table_cellpadding'] . '\" cellspacing=\"' . $ilconfig['table_cellspacing'] . '\" border=\"0\" width=\"100%\" dir=\"' . $ilconfig['template_textdirection'] . '\">\r\n<tr class=\"alt1\">\r\n\t<td width=\"3%\" valign=\"top\"><input ' . ($disabled ? 'disabled=\"disabled\"' : '') . ' type=\"radio\" name=\"' . $fieldname . '\" id=\"public\" value=\"public\" ' . $event1 . ' onclick=\"duration_switch(1); fetch_js_object(\\'showsellingformat\\').style.display=\\'\\'; toggle_show(\\'enableescrowrow\\'); toggle_show(\\'donations\\');\" /></td>\r\n\t<td width=\"97%\"><label for=\"public\"><strong><span id=\"public_title\">{_public_event}</span></strong> : <span class=\"gray\"><span id=\"public_help\">{_publically_available_auction}</span></span></label></td>\r\n</tr>';\r\n if ($cattype == 'service')\r\n {\r\n $html .= '<tr class=\"alt1\">\r\n\t<td valign=\"top\"><input ' . ($disabled ? 'disabled=\"disabled\"' : '') . ' type=\"radio\" name=\"' . $fieldname . '\" id=\"invite_only\" value=\"invite_only\" ' . $event3 . ' onclick=\"duration_switch(3); toggle_tr(\\'ivnitetog\\'); toggle_show(\\'enableescrowrow\\'); toggle_show(\\'donations\\');\" /></td>\r\n\t<td width=\"100%\"><label for=\"invite_only\"><strong>{_invitation_event}</strong> : <!-- <img src=\"' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/invite.gif\" border=\"0\" alt=\"\" />--><span class=\"gray\">{_invite_vendors_to_place_bids_on_your_auction}</span></label>\r\n\t<div id=\"ivnitetog\" style=\"display:none\">\r\n\t\t<div style=\"padding-top:7px\"></div>\r\n\t\t<div>\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding:0px 2px 15px 0px;\" dir=\"' . $ilconfig['template_textdirection'] . '\">\r\n\t\t<tr>\r\n\t\t<td>\r\n\t\t<div class=\"grayborder\" style=\"background:url(' . $ilconfig['template_relativeimagepath'] . $ilconfig['template_imagesfolder'] . 'icons/bg_gradient_gray_1x1000.gif) repeat-x;\"><div class=\"n\"><div class=\"e\"><div class=\"w\"></div></div></div><div id=\"tempinvite\" style=\"margin-left:20px;\">\r\n\t\t\r\n\t\t</div><div class=\"s\"><div class=\"e\"><div class=\"w\"></div></div></div></div>\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t</div>\r\n\t\t</div>\r\n\r\n\t</td>\r\n</tr>';\r\n }\r\n if ($ilconfig['product_scheduled_bidding_block'])\r\n\t\t{\r\n\t\t\t$year = $month = $day = $hour = $min = $sec = '';\r\n\t\t\tif (isset($ilance->GPC['date_starts']))\r\n\t\t\t{\r\n\t\t\t $arr = explode(\" \", $ilance->GPC['date_starts']);\r\n\t\t\t $date = explode(\"-\", $arr[0]);\r\n\t\t\t $time = explode(\":\", $arr[1]);\r\n\t\t\t $year = isset($date[0]) ? intval($date[0]) : '';\r\n\t\t\t $month = isset($date[1]) ? intval($date[1]) : '';\r\n\t\t\t $day = isset($date[2]) ? intval($date[2]) : '';\r\n\t\t\t $hour = isset($time[0]) ? intval($time[0]) : '';\r\n\t\t\t $min = isset($time[1]) ? intval($time[1]) : '';\r\n\t\t\t $sec = isset($time[2]) ? intval($time[2]) : '';\r\n\t\t\t}\r\n\t\t\t$html .= '<tr>';\r\n\t\t\t$html .= '<td valign=\"top\"><input ' . ($disabled ? 'disabled=\"disabled\"' : '') . ' type=\"radio\" name=\"' . $fieldname . '\" id=\"realtime\" value=\"realtime\" ' . $event4 . ' onclick=\"duration_switch(2); toggle_tr(\\'scheduledate\\'); fetch_js_object(\\'showsellingformat\\').style.display=\\'\\'; toggle_show(\\'enableescrowrow\\'); toggle_show(\\'donations\\');\" /></td>\r\n\t<td><label for=\"realtime\"><div style=\"height:20px;margin-top:4px\"><strong><span id=\"realtime_title\">{_invitation_event_realtime}</span></strong> : <span class=\"gray\"><span id=\"realtime_help\">{_invite_vendors_to_place_bids_on_your}</span></span></div></label>\r\n\t\t<div id=\"scheduledate\" style=\"display:none\">\r\n\t\t<table style=\"width:400px;margin-left:-10px\" border=\"0\" cellspacing=\"3\" cellpadding=\"2\" dir=\"' . $ilconfig['template_textdirection'] . '\">\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" dir=\"' . $ilconfig['template_textdirection'] . '\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->year($year) . ' </td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->month($month) . ' </td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->day($day) . '</td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\"> </td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->hour($hour) . ' </td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->min($min) . ' </td>\r\n\t\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">' . $this->sec($sec) . '</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_year}</td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_month}</td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_day}</td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\"> </td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_hour}</td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_min}</td>\r\n\t\t\t\t\t<td align=\"center\" class=\"smaller litegray\" nowrap=\"nowrap\">{_sec}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t</div>\r\n\t</td>\r\n</tr>';\r\n\t\t}\r\n \r\n $html .= '</table>';\r\n \r\n ($apihook = $ilance->api('print_event_type_filter')) ? eval($apihook) : false;\r\n \r\n return $html;\r\n }",
"function filterPendingRideAdmin($data, $conn)\n {\n $row = array();\n\n if ($data == 'week') {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `ride_date` > DATE_SUB(NOW(), INTERVAL 7 DAY) AND `status` = 1 ORDER BY `ride_date`\";\n } else if ($data == 'month') {\n // $sql = \"SELECT * FROM `tbl_ride` WHERE MONTH(`ride_date`) = MONTH(DATE_ADD(NOW(), INTERVAL -1 MONTH))\";\n $sql = \"SELECT * FROM `tbl_ride` WHERE `ride_date` > DATE_SUB(NOW(), INTERVAL 30 DAY) AND `status` = 1 ORDER BY `ride_date`\";\n } else if ($data == 'cedmicro') {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `cab` = 'cedmicro' AND `status` = 1 \";\n } else if ($data == 'cedmini') {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `cab` = 'cedmini' AND `status` = 1 \";\n } else if ($data == 'cedroyal') {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `cab` = 'cedroyal' AND `status` = 1 \";\n } else if ($data == 'cedsuv') {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `cab` = 'cedsuv' AND `status` = 1 \";\n } else {\n $sql = \"SELECT * FROM `tbl_ride` WHERE `status` = 1 \";\n }\n // return $sql;\n // exit();\n $res = mysqli_query($conn, $sql);\n while ($data = mysqli_fetch_assoc($res)) {\n $row[] = $data;\n }\n return $row;\n }",
"function makeprofiletypequery(){\n $tempstr = \"\";\n $ptypes = TableRegistry::get('profile_types')->find()->where(['placesorders' => 1])->all();\n foreach($ptypes as $ptype){\n if($tempstr){\n $tempstr .= \" OR profile_type = \" . $ptype->id;\n }else{\n $tempstr = \"(profile_type = \" . $ptype->id;\n }\n }\n return $tempstr . \")\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional location to store findings. Generated from protobuf field .google.privacy.dlp.v2beta1.OutputStorageConfig request_output_config = 7; | public function setRequestOutputConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2beta1\OutputStorageConfig::class);
$this->request_output_config = $var;
return $this;
} | [
"public function setOutputConfig(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Privacy\\Dlp\\V2beta1\\OutputStorageConfig::class);\n $this->output_config = $var;\n }",
"public function setOutputConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2beta1\\OutputStorageConfig::class);\n $this->output_config = $var;\n\n return $this;\n }",
"public function setOutputConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Optimization\\V1\\OutputConfig::class);\n $this->output_config = $var;\n\n return $this;\n }",
"public function setOutputConfig($var)\n {\n GPBUtil::checkMessage($var, \\Clarifai\\Internal\\_OutputConfig::class);\n $this->output_config = $var;\n\n return $this;\n }",
"public function getOutputConfig()\n {\n return isset($this->output_config) ? $this->output_config : null;\n }",
"public function getOutputConfig()\n {\n return $this->output_config;\n }",
"public function setOutputConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DocumentAI\\V1beta1\\OutputConfig::class);\n $this->output_config = $var;\n\n return $this;\n }",
"public function getGcsOutputConfig()\n {\n return $this->readOneof(1);\n }",
"public function setOutputConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Asset\\V1\\IamPolicyAnalysisOutputConfig::class);\n $this->output_config = $var;\n\n return $this;\n }",
"public function setOutputSchema($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dlp\\V2\\OutputStorageConfig\\OutputSchema::class);\n $this->output_schema = $var;\n\n return $this;\n }",
"public function getOutputAudioConfig()\n {\n return $this->output_audio_config;\n }",
"public function getOutputPath()\n\t{\n\t\treturn $this->config[\"output_path\"];\n\t}",
"public function setStorageConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2beta1\\StorageConfig::class);\n $this->storage_config = $var;\n\n return $this;\n }",
"public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_FILE,\n\t\t\t'path' => $this->path,\n\t\t\t'storePlainText' => $this->storePlainText,\n\t\t\t'filePrefix' => $this->filePrefix,\n\t\t\t'fileSuffix' => $this->fileSuffix,\n\t\t\t'fileMode' => $this->fileMode,\n\t\t\t'hashKey' => $this->hashKey,\n\t\t\t'readOnly' => $this->readOnly,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n//\t\t\t'path',\n//\t\t\t'storePlainText',\n//\t\t\t'filePrefix',\n//\t\t\t'fileSuffix',\n//\t\t\t'fileMode',\n//\t\t\t'hashKey',\n//\t\t\t'readOnly',\n//\t\t\t'debuggerDisabled'\n\n\t}",
"private function configUsedBy() {\n $config_path = $_GET['config'] ?? null;\n if (!$config_path == null) {\n $inuse_config = array();\n foreach ($this->core->getQueries()->getGradeableConfigs(null) as $gradeable) {\n if (strpos($gradeable->getAutogradingConfigPath(), $config_path) !== false) {\n $inuse_config[] = $gradeable->getId();\n }\n }\n $this->core->getOutput()->renderJson($inuse_config);\n }\n }",
"private function get_output_settings() {\n $options = array();\n $output_formats = array(\n array(\n 'title' => __('Generated files', 'wpd'),\n 'desc' => __('PDF', 'wpd'),\n 'id' => 'wpc-output-options[wpc-generate-pdf]',\n //\t\t\t\t'default'\t=> 'yes',\n 'type' => 'checkbox',\n 'checkboxgroup' => '',\n ),\n array(\n 'desc' => __('Zip output folder', 'wpd'),\n 'id' => 'wpc-output-options[wpc-generate-zip]',\n //\t\t\t\t'default'\t=> 'yes',\n 'type' => 'checkbox',\n 'checkboxgroup' => 'end'\n ),\n );\n \n $pdf_format = array(\n 'title' => __('PDF Format', 'wpd'),\n 'id' => 'wpc-output-options[pdf-format]',\n 'type' => 'groupedselect',\n 'options'=>array('ISO 216 A Series + 2 SIS 014711 extensions'=>array('A0'=>'A0 (841x1189 mm ; 33.11x46.81 in)','A1'=>'A1 (594x841 mm ; 23.39x33.11 in)','A2'=>'A2 (420x594 mm ; 16.54x23.39 in)','A3'=>'A3 (297x420 mm ; 11.69x16.54 in)','A4'=>'A4 (210x297 mm ; 8.27x11.69 in)','A5'=>'A5 (148x210 mm ; 5.83x8.27 in)','A6'=>'A6 (105x148 mm ; 4.13x5.83 in)','A7'=>'A7 (74x105 mm ; 2.91x4.13 in)','A8'=>'A8 (52x74 mm ; 2.05x2.91 in)','A9'=>'A9 (37x52 mm ; 1.46x2.05 in)','A10'=>'A10 (26x37 mm ; 1.02x1.46 in)','A11'=>'A11 (18x26 mm ; 0.71x1.02 in)','A12'=>'A12 (13x18 mm ; 0.51x0.71 in)',),'ISO 216 B Series + 2 SIS 014711 extensions'=>array('B0'=>'B0 (1000x1414 mm ; 39.37x55.67 in)','B1'=>'B1 (707x1000 mm ; 27.83x39.37 in)','B2'=>'B2 (500x707 mm ; 19.69x27.83 in)','B3'=>'B3 (353x500 mm ; 13.90x19.69 in)','B4'=>'B4 (250x353 mm ; 9.84x13.90 in)','B5'=>'B5 (176x250 mm ; 6.93x9.84 in)','B6'=>'B6 (125x176 mm ; 4.92x6.93 in)','B7'=>'B7 (88x125 mm ; 3.46x4.92 in)','B8'=>'B8 (62x88 mm ; 2.44x3.46 in)','B9'=>'B9 (44x62 mm ; 1.73x2.44 in)','B10'=>'B10 (31x44 mm ; 1.22x1.73 in)','B11'=>'B11 (22x31 mm ; 0.87x1.22 in)','B12'=>'B12 (15x22 mm ; 0.59x0.87 in)',),'ISO 216 C Series + 2 SIS 014711 extensions + 2 EXTENSION'=>array('C0'=>'C0 (917x1297 mm ; 36.10x51.06 in)','C1'=>'C1 (648x917 mm ; 25.51x36.10 in)','C2'=>'C2 (458x648 mm ; 18.03x25.51 in)','C3'=>'C3 (324x458 mm ; 12.76x18.03 in)','C4'=>'C4 (229x324 mm ; 9.02x12.76 in)','C5'=>'C5 (162x229 mm ; 6.38x9.02 in)','C6'=>'C6 (114x162 mm ; 4.49x6.38 in)','C7'=>'C7 (81x114 mm ; 3.19x4.49 in)','C8'=>'C8 (57x81 mm ; 2.24x3.19 in)','C9'=>'C9 (40x57 mm ; 1.57x2.24 in)','C10'=>'C10 (28x40 mm ; 1.10x1.57 in)','C11'=>'C11 (20x28 mm ; 0.79x1.10 in)','C12'=>'C12 (14x20 mm ; 0.55x0.79 in)','C76'=>'C76 (81x162 mm ; 3.19x6.38 in)','DL'=>'DL (110x220 mm ; 4.33x8.66 in)',),'SIS 014711 E Series'=>array('E0'=>'E0 (879x1241 mm ; 34.61x48.86 in)','E1'=>'E1 (620x879 mm ; 24.41x34.61 in)','E2'=>'E2 (440x620 mm ; 17.32x24.41 in)','E3'=>'E3 (310x440 mm ; 12.20x17.32 in)','E4'=>'E4 (220x310 mm ; 8.66x12.20 in)','E5'=>'E5 (155x220 mm ; 6.10x8.66 in)','E6'=>'E6 (110x155 mm ; 4.33x6.10 in)','E7'=>'E7 (78x110 mm ; 3.07x4.33 in)','E8'=>'E8 (55x78 mm ; 2.17x3.07 in)','E9'=>'E9 (39x55 mm ; 1.54x2.17 in)','E10'=>'E10 (27x39 mm ; 1.06x1.54 in)','E11'=>'E11 (19x27 mm ; 0.75x1.06 in)','E12'=>'E12 (13x19 mm ; 0.51x0.75 in)',),'SIS 014711 G Series'=>array('G0'=>'G0 (958x1354 mm ; 37.72x53.31 in)','G1'=>'G1 (677x958 mm ; 26.65x37.72 in)','G2'=>'G2 (479x677 mm ; 18.86x26.65 in)','G3'=>'G3 (338x479 mm ; 13.31x18.86 in)','G4'=>'G4 (239x338 mm ; 9.41x13.31 in)','G5'=>'G5 (169x239 mm ; 6.65x9.41 in)','G6'=>'G6 (119x169 mm ; 4.69x6.65 in)','G7'=>'G7 (84x119 mm ; 3.31x4.69 in)','G8'=>'G8 (59x84 mm ; 2.32x3.31 in)','G9'=>'G9 (42x59 mm ; 1.65x2.32 in)','G10'=>'G10 (29x42 mm ; 1.14x1.65 in)','G11'=>'G11 (21x29 mm ; 0.83x1.14 in)','G12'=>'G12 (14x21 mm ; 0.55x0.83 in)',),'ISO Press'=>array('RA0'=>'RA0 (860x1220 mm ; 33.86x48.03 in)','RA1'=>'RA1 (610x860 mm ; 23.02x33.86 in)','RA2'=>'RA2 (430x610 mm ; 16.93x23.02 in)','RA3'=>'RA3 (305x430 mm ; 12.01x16.93 in)','RA4'=>'RA4 (215x305 mm ; 8.46x12.01 in)','SRA0'=>'SRA0 (900x1280 mm ; 35.43x50.39 in)','SRA1'=>'SRA1 (640x900 mm ; 25.20x35.43 in)','SRA2'=>'SRA2 (450x640 mm ; 17.72x25.20 in)','SRA3'=>'SRA3 (320x450 mm ; 12.60x17.72 in)','SRA4'=>'SRA4 (225x320 mm ; 8.86x12.60 in)',),'German DIN 476'=>array('4A0'=>'4A0 (1682x2378 mm ; 66.22x93.62 in)','2A0'=>'2A0 (1189x1682 mm ; 46.81x66.22 in)',),'Variations on the ISO Standard'=>array('A2_EXTRA'=>'A2_EXTRA (445x619 mm ; 17.52x24.37 in)','A3+'=>'A3+ (329x483 mm ; 12.95x19.02 in)','A3_EXTRA'=>'A3_EXTRA (322x445 mm ; 12.68x17.52 in)','A3_SUPER'=>'A3_SUPER (305x508 mm ; 12.01x20.00 in)','SUPER_A3'=>'SUPER_A3 (305x487 mm ; 12.01x19.17 in)','A4_EXTRA'=>'A4_EXTRA (235x322 mm ; 9.25x12.68 in)','A4_SUPER'=>'A4_SUPER (229x322 mm ; 9.02x12.68 in)','SUPER_A4'=>'SUPER_A4 (227x356 mm ; 8.94x13.02 in)','A4_LONG'=>'A4_LONG (210x348 mm ; 8.27x13.70 in)','F4'=>'F4 (210x330 mm ; 8.27x12.99 in)','SO_B5_EXTRA'=>'SO_B5_EXTRA (202x276 mm ; 7.95x10.87 in)','A5_EXTRA'=>'A5_EXTRA (173x235 mm ; 6.81x9.25 in)',),'ANSI Series'=>array('ANSI_E'=>'ANSI_E (864x1118 mm ; 33.00x43.00 in)','ANSI_D'=>'ANSI_D (559x864 mm ; 22.00x33.00 in)','ANSI_C'=>'ANSI_C (432x559 mm ; 17.00x22.00 in)','ANSI_B'=>'ANSI_B (279x432 mm ; 11.00x17.00 in)','ANSI_A'=>'ANSI_A (216x279 mm ; 8.50x11.00 in)',),'Traditional \"Loose\" North American Paper Sizes'=>array('LEDGER, USLEDGER'=>'LEDGER, USLEDGER (432x279 mm ; 17.00x11.00 in)','TABLOID, USTABLOID, BIBLE, ORGANIZERK'=>'TABLOID, USTABLOID, BIBLE, ORGANIZERK (279x432 mm ; 11.00x17.00 in)','LETTER, USLETTER, ORGANIZERM'=>'LETTER, USLETTER, ORGANIZERM (216x279 mm ; 8.50x11.00 in)','LEGAL, USLEGAL'=>'LEGAL, USLEGAL (216x356 mm ; 8.50x13.00 in)','GLETTER, GOVERNMENTLETTER'=>'GLETTER, GOVERNMENTLETTER (203x267 mm ; 8.00x10.50 in)','JLEGAL, JUNIORLEGAL'=>'JLEGAL, JUNIORLEGAL (203x127 mm ; 8.00x5.00 in)',),'Other North American Paper Sizes'=>array('QUADDEMY'=>'QUADDEMY (889x1143 mm ; 35.00x45.00 in)','SUPER_B'=>'SUPER_B (330x483 mm ; 13.00x19.00 in)','QUARTO'=>'QUARTO (229x279 mm ; 9.00x11.00 in)','FOLIO, GOVERNMENTLEGAL'=>'FOLIO, GOVERNMENTLEGAL (216x330 mm ; 8.50x13.00 in)','EXECUTIVE, MONARCH'=>'EXECUTIVE, MONARCH (184x267 mm ; 7.25x10.50 in)','MEMO, STATEMENT, ORGANIZERL'=>'MEMO, STATEMENT, ORGANIZERL (140x216 mm ; 5.50x8.50 in)','FOOLSCAP'=>'FOOLSCAP (210x330 mm ; 8.27x13.00 in)','COMPACT'=>'COMPACT (108x171 mm ; 4.25x6.75 in)','ORGANIZERJ'=>'ORGANIZERJ (70x127 mm ; 2.75x5.00 in)',),'Canadian standard CAN 2-9.60M'=>array('P1'=>'P1 (560x860 mm ; 22.05x33.86 in)','P2'=>'P2 (430x560 mm ; 16.93x22.05 in)','P3'=>'P3 (280x430 mm ; 11.02x16.93 in)','P4'=>'P4 (215x280 mm ; 8.46x11.02 in)','P5'=>'P5 (140x215 mm ; 5.51x8.46 in)','P6'=>'P6 (107x140 mm ; 4.21x5.51 in)',),'North American Architectural Sizes'=>array('ARCH_E'=>'ARCH_E (914x1219 mm ; 36.00x48.00 in)','ARCH_E1'=>'ARCH_E1 (762x1067 mm ; 30.00x42.00 in)','ARCH_D'=>'ARCH_D (610x914 mm ; 23.00x36.00 in)','ARCH_C, BROADSHEET'=>'ARCH_C, BROADSHEET (457x610 mm ; 18.00x23.00 in)','ARCH_B'=>'ARCH_B (305x457 mm ; 12.00x18.00 in)','ARCH_A'=>'ARCH_A (229x305 mm ; 9.00x12.00 in)',),'Announcement Envelopes'=>array('ANNENV_A2'=>'ANNENV_A2 (111x146 mm ; 4.37x5.75 in)','ANNENV_A6'=>'ANNENV_A6 (121x165 mm ; 4.75x6.50 in)','ANNENV_A7'=>'ANNENV_A7 (133x184 mm ; 5.25x7.25 in)','ANNENV_A8'=>'ANNENV_A8 (140x206 mm ; 5.50x8.12 in)','ANNENV_A10'=>'ANNENV_A10 (159x244 mm ; 6.25x9.62 in)','ANNENV_SLIM'=>'ANNENV_SLIM (98x225 mm ; 3.87x8.87 in)',),'Commercial Envelopes'=>array('COMMENV_N6_1/4'=>'COMMENV_N6_1/4 (89x152 mm ; 3.50x6.00 in)','COMMENV_N6_3/4'=>'COMMENV_N6_3/4 (92x165 mm ; 3.62x6.50 in)','COMMENV_N8'=>'COMMENV_N8 (98x191 mm ; 3.87x7.50 in)','COMMENV_N9'=>'COMMENV_N9 (98x225 mm ; 3.87x8.87 in)','COMMENV_N10'=>'COMMENV_N10 (105x241 mm ; 4.12x9.50 in)','COMMENV_N11'=>'COMMENV_N11 (114x263 mm ; 4.50x10.37 in)','COMMENV_N12'=>'COMMENV_N12 (121x279 mm ; 4.75x11.00 in)','COMMENV_N14'=>'COMMENV_N14 (127x292 mm ; 5.00x11.50 in)',),'Catalogue Envelopes'=>array('CATENV_N1'=>'CATENV_N1 (152x229 mm ; 6.00x9.00 in)','CATENV_N1_3/4'=>'CATENV_N1_3/4 (165x241 mm ; 6.50x9.50 in)','CATENV_N2'=>'CATENV_N2 (165x254 mm ; 6.50x10.00 in)','CATENV_N3'=>'CATENV_N3 (178x254 mm ; 7.00x10.00 in)','CATENV_N6'=>'CATENV_N6 (191x267 mm ; 7.50x10.50 in)','CATENV_N7'=>'CATENV_N7 (203x279 mm ; 8.00x11.00 in)','CATENV_N8'=>'CATENV_N8 (210x286 mm ; 8.25x11.25 in)','CATENV_N9_1/2'=>'CATENV_N9_1/2 (216x267 mm ; 8.50x10.50 in)','CATENV_N9_3/4'=>'CATENV_N9_3/4 (222x286 mm ; 8.75x11.25 in)','CATENV_N10_1/2'=>'CATENV_N10_1/2 (229x305 mm ; 9.00x12.00 in)','CATENV_N12_1/2'=>'CATENV_N12_1/2 (241x318 mm ; 9.50x12.50 in)','CATENV_N13_1/2'=>'CATENV_N13_1/2 (254x330 mm ; 10.00x13.00 in)','CATENV_N14_1/4'=>'CATENV_N14_1/4 (286x311 mm ; 11.25x12.25 in)','CATENV_N14_1/2'=>'CATENV_N14_1/2 (292x368 mm ; 11.50x14.50 in)','Japanese'=>'Japanese (JIS P 0138-61) Standard B-Series','JIS_B0'=>'JIS_B0 (1030x1456 mm ; 40.55x57.32 in)','JIS_B1'=>'JIS_B1 (728x1030 mm ; 28.66x40.55 in)','JIS_B2'=>'JIS_B2 (515x728 mm ; 20.28x28.66 in)','JIS_B3'=>'JIS_B3 (364x515 mm ; 14.33x20.28 in)','JIS_B4'=>'JIS_B4 (257x364 mm ; 10.12x14.33 in)','JIS_B5'=>'JIS_B5 (182x257 mm ; 7.17x10.12 in)','JIS_B6'=>'JIS_B6 (128x182 mm ; 5.04x7.17 in)','JIS_B7'=>'JIS_B7 (91x128 mm ; 3.58x5.04 in)','JIS_B8'=>'JIS_B8 (64x91 mm ; 2.52x3.58 in)','JIS_B9'=>'JIS_B9 (45x64 mm ; 1.77x2.52 in)','JIS_B10'=>'JIS_B10 (32x45 mm ; 1.26x1.77 in)','JIS_B11'=>'JIS_B11 (22x32 mm ; 0.87x1.26 in)','JIS_B12'=>'JIS_B12 (16x22 mm ; 0.63x0.87 in)',),'PA Series'=>array('PA0'=>'PA0 (840x1120 mm ; 33.07x43.09 in)','PA1'=>'PA1 (560x840 mm ; 22.05x33.07 in)','PA2'=>'PA2 (420x560 mm ; 16.54x22.05 in)','PA3'=>'PA3 (280x420 mm ; 11.02x16.54 in)','PA4'=>'PA4 (210x280 mm ; 8.27x11.02 in)','PA5'=>'PA5 (140x210 mm ; 5.51x8.27 in)','PA6'=>'PA6 (105x140 mm ; 4.13x5.51 in)','PA7'=>'PA7 (70x105 mm ; 2.76x4.13 in)','PA8'=>'PA8 (52x70 mm ; 2.05x2.76 in)','PA9'=>'PA9 (35x52 mm ; 1.38x2.05 in)','PA10'=>'PA10 (26x35 mm ; 1.02x1.38 in)',),'Standard Photographic Print Sizes'=>array('PASSPORT_PHOTO'=>'PASSPORT_PHOTO (35x45 mm ; 1.38x1.77 in)','E'=>'E (82x120 mm ; 3.25x4.72 in)','3R, L'=>'3R, L (89x127 mm ; 3.50x5.00 in)','4R, KG'=>'4R, KG (102x152 mm ; 3.02x5.98 in)','4D'=>'4D (120x152 mm ; 4.72x5.98 in)','5R, 2L'=>'5R, 2L (127x178 mm ; 5.00x7.01 in)','6R, 8P'=>'6R, 8P (152x203 mm ; 5.98x7.99 in)','8R, 6P'=>'8R, 6P (203x254 mm ; 7.99x10.00 in)','S8R, 6PW'=>'S8R, 6PW (203x305 mm ; 7.99x12.01 in)','10R, 4P'=>'10R, 4P (254x305 mm ; 10.00x12.01 in)','S10R, 4PW'=>'S10R, 4PW (254x381 mm ; 10.00x15.00 in)','11R'=>'11R (279x356 mm ; 10.98x13.02 in)','S11R'=>'S11R (279x432 mm ; 10.98x17.01 in)','12R'=>'12R (305x381 mm ; 12.01x15.00 in)','S12R'=>'S12R (305x456 mm ; 12.01x17.95 in)',),'Common Newspaper Sizes'=>array('NEWSPAPER_BROADSHEET'=>'NEWSPAPER_BROADSHEET (750x600 mm ; 29.53x23.62 in)','NEWSPAPER_BERLINER'=>'NEWSPAPER_BERLINER (470x315 mm ; 18.50x12.40 in)','NEWSPAPER_COMPACT, NEWSPAPER_TABLOID'=>'NEWSPAPER_COMPACT, NEWSPAPER_TABLOID (430x280 mm ; 16.93x11.02 in)',),'Business Cards'=>array('CREDIT_CARD, BUSINESS_CARD, BUSINESS_CARD_ISO7810'=>'CREDIT_CARD, BUSINESS_CARD, BUSINESS_CARD_ISO7810 (54x86 mm ; 2.13x3.37 in)','BUSINESS_CARD_ISO216'=>'BUSINESS_CARD_ISO216 (52x74 mm ; 2.05x2.91 in)','BUSINESS_CARD_IT, BUSINESS_CARD_UK, BUSINESS_CARD_FR, BUSINESS_CARD_DE, BUSINESS_CARD_ES'=>'BUSINESS_CARD_IT, BUSINESS_CARD_UK, BUSINESS_CARD_FR, BUSINESS_CARD_DE, BUSINESS_CARD_ES (55x85 mm ; 2.17x3.35 in)','BUSINESS_CARD_US, BUSINESS_CARD_CA'=>'BUSINESS_CARD_US, BUSINESS_CARD_CA (51x89 mm ; 2.01x3.50 in)','BUSINESS_CARD_JP'=>'BUSINESS_CARD_JP (55x91 mm ; 2.17x3.58 in)','BUSINESS_CARD_HK'=>'BUSINESS_CARD_HK (54x90 mm ; 2.13x3.54 in)','BUSINESS_CARD_AU, BUSINESS_CARD_DK, BUSINESS_CARD_SE'=>'BUSINESS_CARD_AU, BUSINESS_CARD_DK, BUSINESS_CARD_SE (55x90 mm ; 2.17x3.54 in)','BUSINESS_CARD_RU, BUSINESS_CARD_CZ, BUSINESS_CARD_FI, BUSINESS_CARD_HU, BUSINESS_CARD_IL'=>'BUSINESS_CARD_RU, BUSINESS_CARD_CZ, BUSINESS_CARD_FI, BUSINESS_CARD_HU, BUSINESS_CARD_IL (50x90 mm ; 1.97x3.54 in)',),'Billboards'=>array('4SHEET'=>'4SHEET (1016x1524 mm ; 40.00x60.00 in)','6SHEET'=>'6SHEET (1200x1800 mm ; 47.24x70.87 in)','12SHEET'=>'12SHEET (3048x1524 mm ; 120.00x60.00 in)','16SHEET'=>'16SHEET (2032x3048 mm ; 80.00x120.00 in)','32SHEET'=>'32SHEET (4064x3048 mm ; 160.00x120.00 in)','48SHEET'=>'48SHEET (6096x3048 mm ; 240.00x120.00 in)','64SHEET'=>'64SHEET (8128x3048 mm ; 320.00x120.00 in)','96SHEET'=>'96SHEET (12192x3048 mm ; 480.00x120.00 in)','Old Imperial English'=>'Old Imperial English (some are still used in USA)','EN_EMPEROR'=>'EN_EMPEROR (1219x1829 mm ; 48.00x72.00 in)','EN_ANTIQUARIAN'=>'EN_ANTIQUARIAN (787x1346 mm ; 31.00x53.00 in)','EN_GRAND_EAGLE'=>'EN_GRAND_EAGLE (730x1067 mm ; 28.75x42.00 in)','EN_DOUBLE_ELEPHANT'=>'EN_DOUBLE_ELEPHANT (679x1016 mm ; 26.75x40.00 in)','EN_ATLAS'=>'EN_ATLAS (660x864 mm ; 26.00x33.00 in)','EN_COLOMBIER'=>'EN_COLOMBIER (597x876 mm ; 23.50x34.50 in)','EN_ELEPHANT'=>'EN_ELEPHANT (584x711 mm ; 23.00x28.00 in)','EN_DOUBLE_DEMY'=>'EN_DOUBLE_DEMY (572x902 mm ; 22.50x35.50 in)','EN_IMPERIAL'=>'EN_IMPERIAL (559x762 mm ; 22.00x30.00 in)','EN_PRINCESS'=>'EN_PRINCESS (546x711 mm ; 21.50x28.00 in)','EN_CARTRIDGE'=>'EN_CARTRIDGE (533x660 mm ; 21.00x26.00 in)','EN_DOUBLE_LARGE_POST'=>'EN_DOUBLE_LARGE_POST (533x838 mm ; 21.00x33.00 in)','EN_ROYAL'=>'EN_ROYAL (508x635 mm ; 20.00x25.00 in)','EN_SHEET, EN_HALF_POST'=>'EN_SHEET, EN_HALF_POST (495x597 mm ; 19.50x23.50 in)','EN_SUPER_ROYAL'=>'EN_SUPER_ROYAL (483x686 mm ; 19.00x27.00 in)','EN_DOUBLE_POST'=>'EN_DOUBLE_POST (483x775 mm ; 19.00x30.50 in)','EN_MEDIUM'=>'EN_MEDIUM (445x584 mm ; 17.50x23.00 in)','EN_DEMY'=>'EN_DEMY (445x572 mm ; 17.50x22.50 in)','EN_LARGE_POST'=>'EN_LARGE_POST (419x533 mm ; 16.50x21.00 in)','EN_COPY_DRAUGHT'=>'EN_COPY_DRAUGHT (406x508 mm ; 16.00x20.00 in)','EN_POST'=>'EN_POST (394x489 mm ; 15.50x19.25 in)','EN_CROWN'=>'EN_CROWN (381x508 mm ; 15.00x20.00 in)','EN_PINCHED_POST'=>'EN_PINCHED_POST (375x470 mm ; 14.75x18.50 in)','EN_BRIEF'=>'EN_BRIEF (343x406 mm ; 13.50x16.00 in)','EN_FOOLSCAP'=>'EN_FOOLSCAP (343x432 mm ; 13.50x17.00 in)','EN_SMALL_FOOLSCAP'=>'EN_SMALL_FOOLSCAP (337x419 mm ; 13.25x16.50 in)','EN_POTT'=>'EN_POTT (318x381 mm ; 12.50x15.00 in)',),'Old Imperial Belgian'=>array('BE_GRAND_AIGLE'=>'BE_GRAND_AIGLE (700x1040 mm ; 27.56x40.94 in)','BE_COLOMBIER'=>'BE_COLOMBIER (620x850 mm ; 24.41x33.46 in)','BE_DOUBLE_CARRE'=>'BE_DOUBLE_CARRE (620x920 mm ; 24.41x36.22 in)','BE_ELEPHANT'=>'BE_ELEPHANT (616x770 mm ; 24.25x30.31 in)','BE_PETIT_AIGLE'=>'BE_PETIT_AIGLE (600x840 mm ; 23.62x33.07 in)','BE_GRAND_JESUS'=>'BE_GRAND_JESUS (550x730 mm ; 21.65x28.74 in)','BE_JESUS'=>'BE_JESUS (540x730 mm ; 21.26x28.74 in)','BE_RAISIN'=>'BE_RAISIN (500x650 mm ; 19.69x25.59 in)','BE_GRAND_MEDIAN'=>'BE_GRAND_MEDIAN (460x605 mm ; 18.11x23.82 in)','BE_DOUBLE_POSTE'=>'BE_DOUBLE_POSTE (435x565 mm ; 17.13x22.24 in)','BE_COQUILLE'=>'BE_COQUILLE (430x560 mm ; 16.93x22.05 in)','BE_PETIT_MEDIAN'=>'BE_PETIT_MEDIAN (415x530 mm ; 16.34x20.87 in)','BE_RUCHE'=>'BE_RUCHE (360x460 mm ; 14.17x18.11 in)','BE_PROPATRIA'=>'BE_PROPATRIA (345x430 mm ; 13.58x16.93 in)','BE_LYS'=>'BE_LYS (317x397 mm ; 12.48x15.63 in)','BE_POT'=>'BE_POT (307x384 mm ; 12.09x15.12 in)','BE_ROSETTE'=>'BE_ROSETTE (270x347 mm ; 10.63x13.66 in)',),'Old Imperial French'=>array('FR_UNIVERS'=>'FR_UNIVERS (1000x1300 mm ; 39.37x51.18 in)','FR_DOUBLE_COLOMBIER'=>'FR_DOUBLE_COLOMBIER (900x1260 mm ; 35.43x49.61 in)','FR_GRANDE_MONDE'=>'FR_GRANDE_MONDE (900x1260 mm ; 35.43x49.61 in)','FR_DOUBLE_SOLEIL'=>'FR_DOUBLE_SOLEIL (800x1200 mm ; 31.50x47.24 in)','FR_DOUBLE_JESUS'=>'FR_DOUBLE_JESUS (760x1120 mm ; 29.92x43.09 in)','FR_GRAND_AIGLE'=>'FR_GRAND_AIGLE (750x1060 mm ; 29.53x41.73 in)','FR_PETIT_AIGLE'=>'FR_PETIT_AIGLE (700x940 mm ; 27.56x37.01 in)','FR_DOUBLE_RAISIN'=>'FR_DOUBLE_RAISIN (650x1000 mm ; 25.59x39.37 in)','FR_JOURNAL'=>'FR_JOURNAL (650x940 mm ; 25.59x37.01 in)','FR_COLOMBIER_AFFICHE'=>'FR_COLOMBIER_AFFICHE (630x900 mm ; 24.80x35.43 in)','FR_DOUBLE_CAVALIER'=>'FR_DOUBLE_CAVALIER (620x920 mm ; 24.41x36.22 in)','FR_CLOCHE'=>'FR_CLOCHE (600x800 mm ; 23.62x31.50 in)','FR_SOLEIL'=>'FR_SOLEIL (600x800 mm ; 23.62x31.50 in)','FR_DOUBLE_CARRE'=>'FR_DOUBLE_CARRE (560x900 mm ; 22.05x35.43 in)','FR_DOUBLE_COQUILLE'=>'FR_DOUBLE_COQUILLE (560x880 mm ; 22.05x34.65 in)','FR_JESUS'=>'FR_JESUS (560x760 mm ; 22.05x29.92 in)','FR_RAISIN'=>'FR_RAISIN (500x650 mm ; 19.69x25.59 in)','FR_CAVALIER'=>'FR_CAVALIER (460x620 mm ; 18.11x24.41 in)','FR_DOUBLE_COURONNE'=>'FR_DOUBLE_COURONNE (460x720 mm ; 18.11x28.35 in)','FR_CARRE'=>'FR_CARRE (450x560 mm ; 17.72x22.05 in)','FR_COQUILLE'=>'FR_COQUILLE (440x560 mm ; 17.32x22.05 in)','FR_DOUBLE_TELLIERE'=>'FR_DOUBLE_TELLIERE (440x680 mm ; 17.32x26.77 in)','FR_DOUBLE_CLOCHE'=>'FR_DOUBLE_CLOCHE (400x600 mm ; 15.75x23.62 in)','FR_DOUBLE_POT'=>'FR_DOUBLE_POT (400x620 mm ; 15.75x24.41 in)','FR_ECU'=>'FR_ECU (400x520 mm ; 15.75x20.47 in)','FR_COURONNE'=>'FR_COURONNE (360x460 mm ; 14.17x18.11 in)','FR_TELLIERE'=>'FR_TELLIERE (340x440 mm ; 13.39x17.32 in)','FR_POT'=>'FR_POT (310x400 mm ; 12.20x15.75 in)',)),\n 'class' => 'chosen_select_nostd',\n 'css' => 'min-width:300px;',\n 'desc_tip' => true,\n );\n \n $pdf_margin_top_bottom = array(\n 'title' => __('PDF Margin Top & Bottom', 'wpd'),\n 'id' => 'wpc-output-options[pdf-margin-tb]',\n 'type' => 'text',\n 'default' => '20',\n 'class' => 'chosen_select_nostd',\n 'css' => 'min-width:300px;',\n 'desc_tip' => true,\n );\n \n $pdf_margin_left_right = array(\n 'title' => __('PDF Margin Left & Right', 'wpd'),\n 'id' => 'wpc-output-options[pdf-margin-lr]',\n 'type' => 'text',\n 'default' => '20',\n 'class' => 'chosen_select_nostd',\n 'css' => 'min-width:300px;',\n 'desc_tip' => true,\n );\n \n $pdf_orientation = array(\n 'title' => __('PDF Orientation', 'wpd'),\n 'id' => 'wpc-output-options[pdf-orientation]',\n 'default' => 'P',\n 'type' => 'select',\n 'options' => array(\n 'P' => __('Portrait', 'wpd'),\n 'L' => __('Landscape', 'wpd')\n )\n );\n \n $output_options_begin = array('type' => 'title',\n 'id' => 'wpc_output',\n 'title' => __('Output Settings')\n );\n\n $output_options_end = array('type' => 'sectionend',\n 'id' => 'wpc_output'\n );\n\n array_push($options, $output_options_begin);\n $options = array_merge($options, $output_formats);\n array_push($options, $pdf_format);\n array_push($options, $pdf_orientation);\n array_push($options, $pdf_margin_top_bottom);\n array_push($options, $pdf_margin_left_right);\n array_push($options, $output_options_end);\n return $options;\n }",
"public function getGcsOutputDirectory()\n {\n return $this->readOneof(1);\n }",
"public function setOutputAudioConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\OutputAudioConfig::class);\n $this->output_audio_config = $var;\n\n return $this;\n }",
"public function setOutputUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->output_uri = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a given route schema contains unnamed wildcards | public function hasUnnamedWildcard($route)
{
return strpos($route, '*') !== false;
} | [
"private function match_wild_cards()\n {\n $exp_request = explode('/', $this->inbound);\n foreach (RouteStore::$routes[strtoupper($this->method)] as $route => $value) {\n $exp_route = explode('/', $route);\n $matched = false;\n if (count($exp_request) == count($exp_route)) {\n foreach ($exp_route as $key => $value) {\n if ($value == $exp_request[$key]) {\n // So far the routes are matching\n continue;\n } elseif ($value && $value[0] && $value[0] == ':') {\n // A wild card has been supplied in the route at this position\n $strip = str_replace(':', '', $value);\n\n // A variable was supplied, let's assign it\n $this->params[$strip] = $exp_request[$key];\n\n // We have a matching pattern\n if ($key == count($exp_route) - 1) {\n $matched = $route;\n } else {\n continue;\n }\n } else {\n // There is a mis-match\n break;\n }\n }\n\n // All segments match\n if ($matched !== false) {\n return $matched;\n }\n }\n }\n\n return false;\n }",
"public function hasNamedWildcard($route)\n {\n return strpos($route, '{') !== false;\n }",
"public function hasWildcard() : bool;",
"public function testRouteDoesNotMatchResourceWithWildcard()\n {\n $resource = '/hello';\n $route = new \\Slim\\Route('/hello/:path+', function () {});\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }",
"private function checkWildcards()\n {\n foreach ($this->routes[Request::method()] as $route => $action) {\n\n // If the route handler is a Closure or wildcard symbols don't exist,\n // Then proceed to check next route.\n if (is_callable($action) || !$pos = strpos($route, '{')) {\n continue;\n }\n\n $clean = substr($route, 0, $pos);\n\n // This far we found a wildcard,\n // Check if it actually contains the route we're looking for.\n if (strpos(Request::uri(), $clean) === false) {\n continue;\n }\n\n $actual = substr(Request::uri(), strpos(Request::uri(), $clean));\n\n $controller = explode('/', $action)[0];\n $method = explode('/', $action)[1];\n $parameter = str_replace($clean, '', $actual);\n\n // Since wildcards accept a parameter,\n // We will inject it automatically,\n // Providing it's a non built in type.\n $injector = new Injector('\\\\kiwi\\\\Http\\\\' . $controller, $method, $parameter);\n $resolve = $injector->resolve() ?? $parameter;\n\n return $this->fire($controller, $method, $resolve);\n }\n\n throw new HttpException('Route not defined.');\n }",
"private function _match_wild_cards($route) {\n\t\t$variables = array();\n\n\t\t$exp_request = explode('/', $this->request_uri);\n\t\t$exp_route = explode('/', $route);\n\n\t\tif (count($exp_request) == count($exp_route)) {\n\t\t\tforeach ($exp_route as $key => $value) {\n\t\t\t\tif ($value == $exp_request[$key]) {\n\t\t\t\t\t// So far the routes are matching\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telseif ($value[0] == '(' && substr($value, -1) == ')') {\n\t\t\t\t\t// A wild card has been supplied in the route at this position\n\t\t\t\t\t$strip = str_replace(array('(', ')'), '', $value);\n\t\t\t\t\t$exp = explode(':', $strip);\n\n\t\t\t\t\t$wc_type = $exp[0];\n\n\t\t\t\t\tif (array_key_exists($wc_type, $this->wild_cards)) {\n\t\t\t\t\t\t// Check if the regex pattern matches the supplied route segment\n\t\t\t\t\t\t$pattern = $this->wild_cards[$wc_type];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (preg_match($pattern, $exp_request[$key])) {\n\t\t\t\t\t\t\tif (isset($exp[1])) {\n\t\t\t\t\t\t\t\t// A variable was supplied, let's assign it\n\t\t\t\t\t\t\t\t$variables[$exp[1]] = $exp_request[$key];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We have a matching pattern\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// There is a mis-match\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// All segments match\n\t\t\treturn $variables;\n\t\t}\n\n\t\treturn false;\n\t}",
"function haswildcard($text){\n\tif (strpos($text,'*') === False && strpos($text,'?') === False\n\t\t\t&& strpos($text,'%') === False && strpos($text,'_') === False)\n \treturn False;\n else\n \treturn True;\n}",
"function route_contain($uri, array $except = array())\n{\n if (call_user_func_array('route_except', $except) === false) {\n return false;\n }\n\n $args = is_array($uri) ? $uri : array($uri);\n foreach ($args as $uri) {\n if ($uri) {\n $uri = trim($uri, '/');\n }\n\n if (stristr(_rr(), $uri)) {\n return true;\n }\n }\n\n return false;\n}",
"public function testMatchGreedyNamedExcludesPrefixes() {\n\t\tConfigure::write('Routing.prefixes', array('admin'));\n\t\tRouter::reload();\n\n\t\t$route = new CakeRoute('/sales/*', array('controller' => 'sales', 'action' => 'index'));\n\t\t$this->assertFalse($route->match(array('controller' => 'sales', 'action' => 'index', 'admin' => 1)), 'Greedy named consume routing prefixes.');\n\t}",
"protected function hasWildcards($subject)\n {\n return false !== strpos($subject, '*') || false !== strpos($subject, '#');\n }",
"public function hasRequestPatterns();",
"public function isWildcard()\n {\n return $this->value == '*/*';\n }",
"public function testRouteMatchesResourceWithWildcard()\n {\n $resource = '/hello/foo/bar/world';\n $route = new \\Slim\\Route('/hello/:path+/world', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('path'=>array('foo', 'bar')), $route->getParams());\n }",
"public function get(string $wildcardName): RouteWildcardInterface;",
"protected function isWildcard($tag)\n\t{\n\t\treturn Str::contains($tag, '*');\n\t}",
"public function setWildcard($wildcard);",
"public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }",
"function GetWildcard(){}",
"public function testRequestMatchWithWildcart() {\n\t\t$result = SeoUtil::requestMatch('/wildcard/awwyiss', '/wildcard*');\n\n\t\t$this->assertTrue($result);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for performaing email addresss to ID translation. | function Auth_Yadis_Email_getID($email, $site_name = '') {
list($user, $domain) = split('@', $email, 2);
$fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
$services = Auth_Yadis_Email_getServices($domain, $fetcher);
if (empty($services)) {
$services = Auth_Yadis_Email_getServices(Auth_Yadis_Default_Email_Mapper, $fetcher);
}
foreach ($services as $s) {
$types = $s->getTypes();
$uris = $s->getURIs();
if (empty($types) || empty($uris)) {
continue;
}
foreach ($types as $t) {
switch ($t) {
case Auth_Yadis_EAUT_Template_Type:
// TODO verify valid EAUT Template
$id = preg_replace('/'.preg_quote(Auth_Yadis_EAUT_Wildcard_Username).'/', $user, $uris[0]);
break;
case Auth_Yadis_EAUT_Mapper_Type:
$url_parts = parse_url($uris[0]);
if (empty($url_parts['query'])) {
$id = $uris[0] . '?email=' . $email;
} else {
$id = $uris[0] . '&email=' . $email;
}
if ($site_name) {
$id .= "&site_name=$site_name";
}
break;
}
if ($id) {
return $id;
}
}
}
} | [
"private function convertIdn($email)\n {\n list($local, $domain) = explode('@', $email);\n $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);\n\n return sprintf('%s@%s', $local, $domain);\n }",
"function phorum_email_user($addresses, $data)\r\n{\r\n $PHORUM = $GLOBALS['PHORUM'];\r\n\r\n if(!isset($data['from_address'])) {\r\n $data['from_address'] = \"\\\"\".$PHORUM['system_email_from_name'].\"\\\" <\".$PHORUM['system_email_from_address'].\">\";\r\n }\r\n\r\n // Allow modules to pre-process the mail message.\r\n if (isset($PHORUM[\"hooks\"][\"email_user_start\"]))\r\n list($addresses,$data)=phorum_hook(\"email_user_start\",array($addresses,$data));\r\n\r\n // Clear some variables that meant for use by the email_user_start hook.\r\n unset($data['mailmessagetpl']);\r\n unset($data['mailsubjecttpl']);\r\n unset($data['language']);\r\n\r\n // Extract message body and subject.\r\n $mailmessage = $data['mailmessage'];\r\n unset($data['mailmessage']);\r\n $mailsubject = $data['mailsubject'];\r\n unset($data['mailsubject']);\r\n\r\n // Replace template variables.\r\n if(is_array($data) && count($data)) {\r\n foreach(array_keys($data) as $key){\r\n if ($data[$key] === NULL || is_array($data[$key])) continue;\r\n $mailmessage = str_replace(\"%$key%\", $data[$key], $mailmessage);\r\n $mailsubject = str_replace(\"%$key%\", $data[$key], $mailsubject);\r\n }\r\n }\r\n\r\n $num_addresses = count($addresses);\r\n $from_address = $data['from_address'];\r\n\r\n // Compose an RFC compatible Message-ID header.\r\n if(isset($data[\"msgid\"]))\r\n {\r\n # Try to find a useful hostname to use in the Message-ID.\r\n $host = \"\";\r\n if (isset($_SERVER[\"HTTP_HOST\"])) {\r\n $host = $_SERVER[\"HTTP_HOST\"];\r\n } else if (function_exists(\"posix_uname\")) {\r\n $sysinfo = @posix_uname();\r\n if (!empty($sysinfo[\"nodename\"])) {\r\n $host .= $sysinfo[\"nodename\"];\r\n }\r\n if (!empty($sysinfo[\"domainname\"])) {\r\n $host .= $sysinfo[\"domainname\"];\r\n }\r\n } else if (function_exists(\"php_uname\")) {\r\n $host = @php_uname(\"n\");\r\n } else if (($envhost = getenv(\"HOSTNAME\")) !== false) {\r\n $host = $envhost;\r\n }\r\n if (empty($host)) {\r\n $host = \"webserver\";\r\n }\r\n\r\n $messageid = \"<{$data['msgid']}@$host>\";\r\n $messageid_header=\"\\nMessage-ID: $messageid\";\r\n } else {\r\n $messageid = \"\";\r\n $messageid_header=\"\";\r\n }\r\n\r\n // Allow modules to send the mail message. A module can either\r\n // remove the recipients for which they did send a mail from the\r\n // addresses list or return 0 (zero) if the mail was sent\r\n // to all recipients.\r\n $send_messages = 1;\r\n if (isset($PHORUM[\"hooks\"][\"send_mail\"]))\r\n {\r\n $hook_data = array(\r\n 'addresses' => $addresses,\r\n 'from' => $from_address,\r\n 'subject' => $mailsubject,\r\n 'body' => $mailmessage,\r\n 'bcc' => $PHORUM['use_bcc'],\r\n 'messageid' => $messageid\r\n );\r\n\r\n $send_messages = phorum_hook(\"send_mail\", $hook_data);\r\n }\r\n\r\n if($send_messages != 0 && $num_addresses > 0){\r\n $phorum_major_version = substr(PHORUM, 0, strpos(PHORUM, '.'));\r\n $mailer = \"Phorum\" . $phorum_major_version;\r\n $mailheader =\"Content-Type: text/plain; charset={$PHORUM[\"DATA\"][\"CHARSET\"]}\\nContent-Transfer-Encoding: {$PHORUM[\"DATA\"][\"MAILENCODING\"]}\\nX-Mailer: $mailer$messageid_header\\n\";\r\n\r\n if(isset($PHORUM['use_bcc']) && $PHORUM['use_bcc'] && $num_addresses > 3){\r\n mail(\" \", $mailsubject, $mailmessage, $mailheader.\"From: $from_address\\nBCC: \" . implode(\",\", $addresses));\r\n } else {\r\n foreach($addresses as $address){\r\n mail($address, $mailsubject, $mailmessage, $mailheader.\"From: $from_address\");\r\n }\r\n }\r\n }\r\n\r\n return $num_addresses;\r\n}",
"public function getNewsletterRecipientIDs();",
"function email_to_id($user)\n\t{\n\t\treturn select(self::$table)->where('user_email = \"'.$user.'\"')->limit(1)->result('user_id');\t\t\n\t}",
"function makeEmailId( $nameRef, $emailRef )\n{\n\t$firstName = retrieveData( $nameRef );\n\t$lastName = retrieveData( $lastNameRef );\n\t$email = retrieveData( $emailRef );\n\t\n\t$person = $firstName . ' ' . $lastName . ' <' . $email . '>';\n\treturn $person;\n}",
"private function convertEmail()\n\t{\n\t\tif(!(strstr($this->email, '@')))\n\t\t$this->email = $this->ucinetid.'@uci.edu';\n\t}",
"public function actionReplaceContactsStringOnId()\n {\n $company_id = Company::getCompanyIdBySubdomain();\n $company_id = ($company_id == 'main') ? 0 : $company_id;\n\n $query = \"update `contacts`\n set `contacts`.assigned_to = (select `user`.id from `user` where concat(`user`.first_name, ' ', `user`.last_name) = `contacts`.assigned_to and `user`.company_id = '$company_id')\n where `contacts`.company_id = '$company_id'\";\n\n $db = Yii::$app->db->createCommand($query);\n if ($db->execute()) {\n return 'Contacts assigned_to updated!';\n } else {\n return 'Some error';\n }\n }",
"public function emailRecipient();",
"protected function setEmailId(){\n\t\t$this -> emailId = $this -> $name . ' <' . $this -> $emailAddress . '>';\n\t}",
"function getCustomerInfoFromEmails($sup_ids)\n {\n }",
"protected function addCustomerIdentifierEntityIdMapping($email, $website)\n {\n $this->getSubject()->addCustomerIdentifierEntityIdMapping($email, $website);\n }",
"public function testPunycodeEmail(): void\n {\n $addresses = array(\n 'user@österreich.icom.museum' => 'user@xn--sterreich-z7a.icom.museum',\n 'user@србијаицрнагора.иком.museum' => 'user@xn--80aaabm1ab4blmeec9e7n.xn--h1aegh.museum',\n 'user@価格.com' => 'user@xn--1sqt31d.com',\n 'user@example.org' => 'user@example.org'\n );\n foreach ($addresses as $idn => $expected) {\n $actual = \\AWonderPHP\\PluggableUnplugged\\PunycodeStatic::punycodeEmail($idn);\n $this->assertEquals($expected, $actual);\n }\n }",
"function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'reply')\n{\n $a_recipients = array();\n $a_names = array();\n\n if ($identities === null) {\n $identities = rcmail::get_instance()->user->list_identities(null, true);\n }\n\n // extract all recipients of the reply-message\n if (is_object($MESSAGE->headers) && in_array($compose_mode, array('reply', 'forward'))) {\n $a_to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, true, $MESSAGE->headers->charset);\n foreach ($a_to as $addr) {\n if (!empty($addr['mailto'])) {\n $a_recipients[] = strtolower($addr['mailto']);\n $a_names[] = $addr['name'];\n }\n }\n\n if (!empty($MESSAGE->headers->cc)) {\n $a_cc = rcube_mime::decode_address_list($MESSAGE->headers->cc, null, true, $MESSAGE->headers->charset);\n foreach ($a_cc as $addr) {\n if (!empty($addr['mailto'])) {\n $a_recipients[] = strtolower($addr['mailto']);\n $a_names[] = $addr['name'];\n }\n }\n }\n }\n\n // decode From: address\n $from = rcube_mime::decode_address_list($MESSAGE->headers->from, null, true, $MESSAGE->headers->charset);\n $from = array_shift($from);\n $from['mailto'] = strtolower($from['mailto']);\n\n $from_idx = null;\n $found_idx = array('to' => null, 'from' => null);\n $check_from = in_array($compose_mode, array('draft', 'edit', 'reply'));\n\n // Select identity\n foreach ($identities as $idx => $ident) {\n // use From: header when in edit/draft or reply-to-self\n if ($check_from && $from['mailto'] == strtolower($ident['email_ascii'])) {\n // remember first matching identity address\n if ($found_idx['from'] === null) {\n $found_idx['from'] = $idx;\n }\n // match identity name\n if ($from['name'] && $ident['name'] && $from['name'] == $ident['name']) {\n $from_idx = $idx;\n break;\n }\n }\n // use replied/forwarded message recipients\n else if (($found = array_search(strtolower($ident['email_ascii']), $a_recipients)) !== false) {\n // remember first matching identity address\n if ($found_idx['to'] === null) {\n $found_idx['to'] = $idx;\n }\n // match identity name\n if ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name']) {\n $from_idx = $idx;\n break;\n }\n }\n }\n\n // If matching by name+address didn't find any matches,\n // get first found identity (address) if any\n if ($from_idx === null) {\n $from_idx = $found_idx['from'] !== null ? $found_idx['from'] : $found_idx['to'];\n }\n\n // Try Return-Path\n if ($from_idx === null && ($return_path = $MESSAGE->headers->others['return-path'])) {\n $return_path = array_map('strtolower', (array) $return_path);\n\n foreach ($identities as $idx => $ident) {\n // Return-Path header contains an email address, but on some mailing list\n // it can be e.g. <pear-dev-return-55250-local=domain.tld@lists.php.net>\n // where local@domain.tld is the address we're looking for (#1489241)\n $ident1 = strtolower($ident['email_ascii']);\n $ident2 = str_replace('@', '=', $ident1);\n $ident1 = '<' . $ident1 . '>';\n $ident2 = '-' . $ident2 . '@';\n\n foreach ($return_path as $path) {\n if ($path == $ident1 || stripos($path, $ident2)) {\n $from_idx = $idx;\n break 2;\n }\n }\n }\n }\n\n // See identity_select plugin for example usage of this hook\n $plugin = rcmail::get_instance()->plugins->exec_hook('identity_select',\n array('message' => $MESSAGE, 'identities' => $identities, 'selected' => $from_idx));\n\n $selected = $plugin['selected'];\n\n // default identity is always first on the list\n return $identities[$selected !== null ? $selected : 0];\n}",
"function mailto()\r\n {\r\n $people_to_email = $this->input->post('ids');\r\n\r\n if ($people_to_email != false)\r\n {\r\n $mailto_url = 'mailto:';\r\n foreach ($this->Person->get_multiple_info($people_to_email)->result() as $person)\r\n {\r\n $mailto_url.=$person->email . ',';\r\n }\r\n //remove last comma\r\n $mailto_url = substr($mailto_url, 0, strlen($mailto_url) - 1);\r\n\r\n echo $mailto_url;\r\n exit;\r\n }\r\n echo '#';\r\n }",
"function associateEmail($usr_id, $issue_id, $items)\n {\n $stmt = \"UPDATE\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"support_email\n SET\n sup_iss_id=$issue_id\n WHERE\n sup_id IN (\" . @implode(\", \", Misc::escapeInteger($items)) . \")\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n for ($i = 0; $i < count($items); $i++) {\n $full_email = self::getFullEmail($items[$i]);\n self::extractAttachments($issue_id, $full_email);\n }\n Issue::markAsUpdated($issue_id, \"email\");\n // save a history entry for each email being associated to this issue\n $stmt = \"SELECT\n sup_subject\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"support_email\n WHERE\n sup_id IN (\" . @implode(\", \", Misc::escapeInteger($items)) . \")\";\n $res = DB_Helper::getInstance()->getCol($stmt);\n for ($i = 0; $i < count($res); $i++) {\n History::add($issue_id, $usr_id, History::getTypeID('email_associated'),\n ev_gettext('Email (subject: \\'%1$s\\') associated by %2$s', $res[$i], User::getFullName($usr_id)));\n }\n return 1;\n }\n }",
"function ContactEmailAddresses( $contactid=0, $sendinvoicehere=false, $addconid=0 )\n{\nglobal $db;\nif ( !$contactid > 0 )\n\treturn false;\n\nif ( $db->db_connect_id )\n\t{\n\tif ( $addconid > 0 )\n\t\t$extra = \" and conAdditionalContacts.AdditionalContactID = \".$addconid;\n\telse\n\t\t$extra = '';\n\t//TKS 04.16.2013 Noel helped me with this query and it is optimized.\n\t//TKS 08.17.2015 #71423 removed reference to conAdditionalEmailAddresses\n\t$query\t= \"select AdditionalContactID, FirstName, LastName, EmailAddress, PrimaryContact \n\t\t\t\t\tfrom conAdditionalContacts where ContactID = $contactid and EmailAddress != ''\n\t\t\t\t\tand EmailAddress is not null $extra\";\n\t//TKS 04.17.2014 added new parameter to only grab for send invoices here flag\n\tif ( $sendinvoicehere )\n\t\t$query .= \" and conAdditionalContacts.SendInvoiceHere = 1 \";\n\n\t$query .= \" order by LastName, FirstName, EmailAddress\";\n\tif ( !$result = $db->sql_query( $query ) )\n\t\t{\n\t\tLogError( 12437, $query.\"<br>\".$db->sql_error() );\n\t\treturn false;\n\t\t}\n\tif ( $db->sql_numrows( $result ) == 0 )\n\t\treturn false;\n\n\t$i = 0;\t\n\twhile( $row\t= $db->sql_fetchrow( $result ) )\n\t\t{\n\t\tif ( validEmail( $row[ \"EmailAddress\" ] ) )\n\t\t\t{\n\t\t\t$Email[ $i ][ \"EmailAddress\" ]\t\t\t= $row[ \"EmailAddress\" ]; \n\t\t\t$Email[ $i ][ \"Name\" ]\t\t\t\t\t\t= stripslashes( $row[ \"FirstName\" ].\" \".$row[ \"LastName\" ] ); \n\t\t\t$Email[ $i ][ \"AdditionalContactID\" ]\t= $row[ \"AdditionalContactID\" ]; \n\t\t\t$Email[ $i ][ \"PrimaryContact\" ]\t\t\t= $row[ \"PrimaryContact\" ]; \n\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}\nif ( count( $Email ) == 0 )\n\treturn false;\nreturn $Email;\n}",
"function getEmailId($mailAddr)\n\t{\n\t\tpreg_match(EMAIL_REG_EXP,$mailAddr,$emailId);\n\t\treturn $emailId[0];\n\t}",
"function getEmailAddressFromOrderID($orderID) {\r\n\tglobal $DBTABLEPREFIX;\r\n\t\r\n\t$sql = \"SELECT orders_user_id FROM `\" . $DBTABLEPREFIX . \"orders` WHERE orders_id='\" . $orderID . \"'\";\r\n\t$result = mysql_query($sql);\r\n\t\r\n\tif ($result && mysql_num_rows($result) > 0) {\r\n\t\twhile ($row = mysql_fetch_array($result)) {\r\n\t\t\treturn getEmailAddressFromID($row['orders_user_id']);\r\n\t\t}\t\r\n\t\tmysql_free_result($result);\r\n\t}\r\n}",
"public function user_email_as_per_id($id)\n {\n $this->db->select('*');\n $this->db->where('id', $id);\n $r = $this->db->get('contact_us');\n return $r->result_array();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds a new invoice This method should do any additional work related to invoiced creation. It is called at time of Invoice creation. | function buildInvoice(Invoice $invoice); | [
"protected function makeInvoice()\n {\n $order = $this->getCurrentOrder();\n if ($order) {\n $invoice = $order->prepareInvoice()\n ->setTransactionId($order->getId())\n ->addComment(\"Invoice created by Paymentwall Brick\")\n ->register()\n ->pay();\n\n $transactionSave = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n $transactionSave->save();\n $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();\n }\n }",
"protected function _createInvoice()\n {\n if (!$this->_order->canInvoice()) {\n return;\n }\n $invoice = $this->_order->prepareInvoice();\n $invoice->register()->capture();\n $this->_order->addRelatedObject($invoice);\n }",
"public function createInvoice() {\n\t\treturn new Invoice(array(), $this);\n\t}",
"function NewInvoice() {\n\t\t$this -> Set('LocalesQ', $this -> Locales -> index());\n\t\t$this -> Set('ClientsQ', $this -> Clients -> index());\n\t\t$this -> Set('CurrencyQ', $this -> Currencies -> index());\n\t\t$this -> Set('InvoiceLogQ', array());\n\t}",
"public function generateInvoice()\n {\n $i = new Invoice();\n // Get Invoice column mapping and intersect with Recurring one\n // to remove non common columns. Unset id and type columns.\n \n $iKeys = array_flip(array_keys($i->getTable()->getColumns()));\n $data = $this->toArray(false);\n unset($data['id'], $data['type'], $data['must_occurrences'], $data['created_at'], \n $data['last_execution_date'], $data['occurrences']);\n $data = array_intersect_key($data, $iKeys);\n \n // Add specific fields for Invoice and hydrate.\n $data = array_merge($data, array(\n 'recurring_invoice_id' => $this->getId(),\n 'issue_date' => sfDate::getInstance()->format('Y-m-d'),\n 'due_date' => sfDate::getInstance()->addDay($this->getDaysToDue())->format('Y-m-d'),\n 'draft' => false\n ));\n $i->fromArray($data);\n \n // Copy Items and taxes\n foreach ($this->Items as $item)\n {\n $iTmp = $item->copy(false);\n foreach ($item->Taxes as $tax)\n {\n $iTmp->Taxes[] = $tax;\n }\n $i->Items[] = $iTmp;\n }\n // copy tags\n foreach ($this->getTags() as $tag)\n {\n $i->addTag($tag);\n }\n \n if($i->trySave())\n {\n $this->setLastExecutionDate(sfDate::getInstance()->format('Y-m-d'));\n $this->save();\n }\n \n return $i;\n }",
"public function buildInvoice(Invoice $invoice)\n {\n $invoice->setStatus(new InvoiceStatus(InvoiceStatus::NOT_SENT));\n\n return $invoice;\n }",
"public function createInvoice()\n {\n //only create invoice if no pending invoice\n if ($this->invoices()->pending()->count()) {\n throw new Exception(\"Can not create invoice for a transaction that has a pending invoice.\");\n }\n\n $this->invoices()->create([\n 'user_id' => $this->payer->id,\n 'currency' => $this->invoiceCurrency,\n 'amount' => $this->invoiceAmount,\n ]);\n }",
"public function createInvoice(Invoice $invoice): Invoice;",
"private function new()\n {\n $invoice = new Invoice();\n $invoice->number = Random::consecutive();\n $invoice->subvalue = 0.0;\n $invoice->taxes = 0.0;\n $invoice->discount = 0.0;\n $invoice->value = 0.0;\n $invoice->status = true;\n $invoice->user()->associate(Id::parent());\n\n return $invoice;\n }",
"function createInvoice();",
"public function build(): InvoicePaymentRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function create(): Invoice;",
"public function create_invoice() {\n\t\t$company = $this->CompanyModel->view();\n\n $invoice = array(\n \t'number' => 'INV/'.date(\"Y\").'/'.date(\"m\").'/',\n 'payment_type' => $this->input->post('invoice_payment'),\n 'date' => $this->input->post('invoice_date'),\n 'total_untax' => $this->input->post('invoice_total_amount'),\n 'total_discount' => $this->input->post('invoice_total_discount'),\n 'total_tax' => $this->input->post('invoice_total_tax'),\n 'total_amount' => $this->input->post('invoice_subtotal'),\n 'customers_id' => $this->input->post('invoice_customer'),\n 'company_id' => $company[0]->id,\n );\n\n $last_invoice = $this->InvoiceModel->create($invoice);\n\n $invoice_lines = array();\n $line = array();\n for($i = 0; $i < count($this->input->post('invoice_product')); $i++) {\n $line['product_id'] = $this->input->post('invoice_product')[$i];\n $line['price'] =$this->input->post('invoice_price')[$i];\n $line['quantity'] = $this->input->post('invoice_qty')[$i];\n $line['discount'] = $this->input->post('invoice_discount')[$i];\n $line['tax'] = $this->input->post('invoice_tax')[$i];\n $line['total'] = $this->input->post('invoice_total')[$i];\n $line['invoice_id'] = $last_invoice[0]->id;\n $line['unit_of_measures_id'] = $this->input->post('invoice_uom_id')[$i];\n array_push($invoice_lines, $line);\n unset($lines);\n }\n\n $last_invoice_lines = $this->InvoiceModel->create_lines($last_invoice, $invoice_lines);\n $this->create_delivery_order($last_invoice, $last_invoice_lines);\n\n redirect('invoice/invoice/single_invoice?id='.$last_invoice[0]->id);\n }",
"function toInvoice($iv=null)\n\t{\n\t\t// Add Invoice Items\n\t\t$w = null;\n\t\tswitch ($this['kind']) {\n\t\tcase 'Monthly':\n\t\tcase 'Quarterly':\n\t\tcase 'Yearly':\n\t\t\t$w = array(\n\t\t\t\t'woi.kind = ? ' => array('Subscription'),\n\t\t\t\t'woi.status = ?' => array('Active')\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$w = array(\n\t\t\t\t'woi.status in (?)' => array('Active','Complete')\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\n\t\t$woi_list = $this->getWorkOrderItems($w);\n\t\tif ( (empty($woi_list)) || (!is_array($woi_list)) ) {\n\t\t\tthrow new Exception('No WorkOrder Items to Generate Invoice');\n\t\t}\n\n\t\t// Add to Existing Invoice or Create a New one\n\t\tif (!empty($iv)) {\n\t\t\tif ($iv instanceof Invoice) {\n\t\t\t\t// All Good\n\t\t\t} elseif (is_numeric($iv)) {\n\t\t\t\t$iv = new Invoice($iv);\n\t\t\t}\n\t\t} else {\n\t\t\t$iv = new Invoice();\n\t\t\t$iv['auth_user_id'] = $this['auth_user_id'];\n\t\t\t$iv['contact_id'] = $this['contact_id'];\n\t\t\t$iv['workorder_id'] = $this['id'];\n\t\t\t$iv['note'] = $this['note'];\n\t\t\t$iv->save();\n\t\t}\n\n\t\t// Add Items\n\t\t$ivi_c = 0;\n\t\tforeach ($woi_list as $woi) {\n\n\t\t\t$ivi = new InvoiceItem(); // array();\n\t\t\t$ivi['workorder_item_id'] = $woi['id'];\n\t\t\t$ivi['kind'] = $woi['kind'];\n\t\t\t$ivi['quantity'] = $woi['a_quantity'];\n\t\t\t$ivi['rate'] = $woi['a_rate'];\n\t\t\t$ivi['unit'] = $woi['a_unit'];\n\t\t\t$ivi['tax_rate'] = $woi['a_tax_rate'];\n\t\t\t$ivi['name'] = $woi['name'];\n\t\t\t$ivi['note'] = $woi['note'];\n\n\t\t\t$iv->addInvoiceItem($ivi);\n\t\t\t$ivi_c++;\n\n\t\t\t// If Complete then Mark as Billed\n\t\t\t// @todo needs to come from a workflow type list\n\t\t\t// @todo Handle WorkOrder Kind/Status too\n\t\t\tif ($woi['status'] == 'Complete') {\n\t\t\t\t$woi['status'] = 'Billed';\n\t\t\t\t$woi->save();\n\t\t\t}\n\t\t}\n\t\t$iv->save();\n\n\t\t// Close Single Job Work Orders\n\t\tif ($this['kind'] == 'Single') {\n\t\t\t$this['status'] = 'Closed';\n\t\t\t// Base_Diff::note($this,'Closed & converted to Invoice');\n\t\t}\n\n\t\t$this->save();\n\n\t\t// Add History\n\t\t$msg = sprintf('Invoice #%d created from Work Order #%d with %d items', $iv['id'], $this['id'], $ivi_c);\n\t\t// Base_Diff::note($this,$msg);\n\t\t// Base_Diff::note($iv,$msg);\n\t\t// $this->_d->commit();\n\n\t\treturn $iv;\n\t}",
"function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }",
"public function invoiceAction() {\n /**\n * Get order id.\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Load order details.\n */\n $order = Mage::getModel ( \"sales/order\" )->load ( $orderId );\n } else {\n /**\n * Error message for the when unwanted person access these request.\n *\n * Redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n \n try {\n /**\n * Check invoice create status.\n */\n if (! $order->canInvoice ()) {\n /**\n * Set error meesage\n *\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"Cannot create an invoice.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n /**\n * Create Invoice.\n */\n $invoice = Mage::getModel ( 'sales/service_order', $order )->prepareInvoice ();\n $invoice->setRequestedCaptureCase ( Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE );\n /**\n * Register invoice.\n */\n $invoice->register ();\n $transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () );\n $transactionSave->save ();\n /**\n * Send invoice email.\n */\n $invoice->getOrder ()->setCustomerNoteNotify ( true );\n $invoice->getOrder ()->setIsInProcess ( true );\n /**\n * Send invoice email.\n */\n $invoice->sendEmail ();\n /**\n * Set Invoice created success message\n * And product view order page.\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Invoice created sucessfully.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n }",
"public function create()\n {\n // require __DIR__.'/../bootstrap.php';\n // Replace these values by entering your own ClientId and Secret by visiting https://developer.paypal.com/developer/applications/\n $clientId = 'AQd3X2Y2LadGNIGSqHQLtY5usuDctqrHvMiLZC9B-AvFe_3hF7xHY32ah2J3FoKowTAQQClv4SaKB_dt';\n $clientSecret = 'EOZBGcv62-HA2EXuRrLyxlhu0Qsc8Xs72XhJzc10QWGsfVHRXUf-fhdkCZE-MDATcX-MuviBWlfnRuOQ';\n $user_secret_code = 'test'; // from config -> from database.\n\n $apiContext = $this->getApiContext($clientId, $clientSecret);\n\n $invoice = new Invoice();\n\n $invoice\n ->setMerchantInfo(new MerchantInfo())\n ->setBillingInfo(array(new BillingInfo()))\n ->setNote('Medical Invoice 16 Jul, 2013 PST')\n ->setPaymentTerm(new PaymentTerm())\n ->setShippingInfo(new ShippingInfo());\n\n $invoice->getMerchantInfo()\n ->setEmail('jaypatel512-facilitator@hotmail.com')\n ->setFirstName('Dennis')\n ->setLastName('Doctor')\n ->setbusinessName('Medical Professionals, LLC')\n ->setPhone(new Phone())\n ->setAddress(new Address());\n\n $invoice->getMerchantInfo()->getPhone()\n ->setCountryCode('001')\n ->setNationalNumber('5032141716');\n\n $invoice->getMerchantInfo()->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $billing = $invoice->getBillingInfo();\n $billing[0]->setEmail('example@example.com');\n\n $billing[0]->setBusinessName('Jay Inc')\n ->setAdditionalInfo('This is the billing Info')\n ->setAddress(new InvoiceAddress());\n\n $billing[0]->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $items = array();\n $items[0] = new InvoiceItem();\n $items[0]\n ->setName('Sutures')\n ->setQuantity(100)\n ->setUnitPrice(new Currency());\n\n $items[0]->getUnitPrice()\n ->setCurrency('USD')\n ->setValue(5);\n\n $tax = new \\PayPal\\Api\\Tax();\n $tax->setPercent(1)->setName('Local Tax on Sutures');\n $items[0]->setTax($tax);\n\n $items[1] = new InvoiceItem();\n\n $item1discount = new Cost();\n $item1discount->setPercent('3');\n $items[1]\n ->setName('Injection')\n ->setQuantity(5)\n ->setDiscount($item1discount)\n ->setUnitPrice(new Currency());\n\n $items[1]->getUnitPrice()\n ->setCurrency('USD')\n ->setValue(5);\n\n $tax2 = new \\PayPal\\Api\\Tax();\n $tax2->setPercent(3)->setName('Local Tax on Injection');\n $items[1]->setTax($tax2);\n\n $invoice->setItems($items);\n\n $cost = new Cost();\n $cost->setPercent('2');\n $invoice->setDiscount($cost);\n\n $invoice->getPaymentTerm()\n ->setTermType('NET_45');\n\n $invoice->getShippingInfo()\n ->setFirstName('Sally')\n ->setLastName('Patient')\n ->setBusinessName('Not applicable')\n ->setPhone(new Phone())\n ->setAddress(new InvoiceAddress());\n\n $invoice->getShippingInfo()->getPhone()\n ->setCountryCode('001')\n ->setNationalNumber('5039871234');\n\n $invoice->getShippingInfo()->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $invoice->setLogoUrl('https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg');\n\n $request = clone $invoice;\n\n try {\n $invoice->create($apiContext);\n } catch (Exception $ex) {\n dd($ex->getMessage());\n // ResultPrinter::printError('Create Invoice', 'Invoice', null, $request, $ex);\n exit(1);\n }\n // ResultPrinter::printResult('Create Invoice', 'Invoice', $invoice->getId(), $request, $invoice);\n\n return $invoice;\n }",
"public function createInvoice($data) {\n return $this->post('/invoices/', $data);\n }",
"public function buildSalesInvoiceEntity()\n {\n return new SalesInvoice(\n $this->id,\n $this->customerId,\n $this->batchId,\n $this->date,\n $this->buildSalesInvoiceLinesCollection(),\n $this->buildSalesInvoicePaymentsCollection()\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation portalsIdDesignsNkCommentersFkGet Find a related item by id for commenters. | public function portalsIdDesignsNkCommentersFkGet($id, $nk, $fk)
{
list($response) = $this->portalsIdDesignsNkCommentersFkGetWithHttpInfo($id, $nk, $fk);
return $response;
} | [
"public function designsIdCommentersFkGet($id, $fk)\n {\n list($response) = $this->designsIdCommentersFkGetWithHttpInfo($id, $fk);\n return $response;\n }",
"public function getByIdWithRelations($commentId);",
"public function findComment($id);",
"public function findCommentById($id);",
"public function comments()\n\t{\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = item_id, localKey = id)\n\t\treturn $this->hasMany(Comment::class);\n\t}",
"private function GetCommentPoster($id){\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t}",
"public function comments()\n {\n \treturn $this->hasMany('App\\Comment','customer_id','id');\n }",
"public function commenter()\n\t{\n\t\treturn $this->belongsTo('Employee', 'commenter', 'id');\n\t}",
"public function getComments ()\n\t{\n\t\treturn $this->hasMany(Comment::className(), ['review_id' => 'id']);\n\t}",
"public function comments()\n\t{\n\t\treturn $this->hasMany(\\App\\Comment::class, 'admin_id', 'id');\n\t}",
"public function findCommentaireById($id);",
"public function comments() \n\t{\n\t\treturn\t$this->hasMany('App\\Comment', 'product_id'); // FK in APP/COMMENT table :: hasMANY\n\t}",
"public function comments()\n {\n return $this->hasMany(Comment::class, 'company_id', 'id');\n }",
"public function getCommentsList($id);",
"public function designsIdCommentsNkRepliesGet($id, $nk, $filter = null)\n {\n list($response) = $this->designsIdCommentsNkRepliesGetWithHttpInfo($id, $nk, $filter);\n return $response;\n }",
"public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }",
"public function comments()\n {\n return $this->hasMany('App\\Comments', 'user_id', 'id');\n }",
"public function getIdComment()\n {\n return $this->idComment;\n }",
"public function getCommentId()\n {\n return $this->comment_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override query so no filtering happens if the user doesn't select options. | public function query() {
if (!empty($this->value)) {
parent::query();
}
} | [
"protected function customizeFieldQuery()\n {\n }",
"public function query() {\n \t if (!empty($this->value)) {\n parent::query();\n }\n }",
"public function asQueriesOnly();",
"public function isSelectQuery()\n {\n return false;\n }",
"function _prepare_for_query()\r\n\t{\r\n\t\t// Overload this in your inheriting models\r\n\t}",
"function DoQuery()\n {\n parent::DoQuery();\n }",
"function query() {\n $this->query->add_filter($this);\n }",
"public function updatedQuery()\n {\n\t\t$query = $this->query;\n\t\t$term = $this->term;\n\n $this->filteredOptions = $this->options->filter(function($value, $key) use($query, $term) {\n\t\t\tif($query == null)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn Str::contains(strtolower($value[$term]), strtolower($query));\n\t\t})->take($this->amount);\n\n\t\t$this->emitUp('selectedSearch', $query);\n\t}",
"public function newQueryWithoutScopes();",
"abstract public function supportsQuerying();",
"public function getBaseQuery();",
"function disable_main_query( &$query ) {\n // var_dump($query); die();\n if(in_array( $query->get('archive'), ['series', 'speakers', 'topics', 'podcasts']))\n $query->set('p', 1);\n}",
"public function getFilterQueries() {}",
"public function getFilterQueries(){}",
"private function applyQueryFilters()\n {\n if (is_array($this->queryFilter())) {\n $this->createQueryFilter();\n } else {\n $this->queryFilter();\n }\n\n $this->queryFilterRequest();\n }",
"public abstract function get_query();",
"function clearDefaultQuery() {\n // TODO\n }",
"public function buildQuery();",
"private function setStandardQueryFields()\n {\n $this->guest\n ? $this->setQueryField('guest', 'true')\n : $this->setQueryField('alf_ticket', $this->token->getAuthenticationTicket());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'usersUuidScopeGet' | protected function usersUuidScopeGetRequest($uuid, $scope, $authorization = null)
{
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $uuid when calling usersUuidScopeGet'
);
}
// verify the required parameter 'scope' is set
if ($scope === null || (is_array($scope) && count($scope) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $scope when calling usersUuidScopeGet'
);
}
$resourcePath = '/users/{uuid}/scope';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($scope !== null) {
$queryParams['scope'] = ObjectSerializer::toQueryValue($scope);
}
// header params
if ($authorization !== null) {
$headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);
}
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
'{' . 'uuid' . '}',
ObjectSerializer::toPathValue($uuid),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json;charset=utf-8']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json;charset=utf-8'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function getPresencesByUserId(): GetPresencesByUserIdRequestBuilder {\n return new GetPresencesByUserIdRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function getUserOwnedObjects(): GetUserOwnedObjectsRequestBuilder {\n return new GetUserOwnedObjectsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceScope(): UserExperienceAnalyticsDeviceScopeRequestBuilder {\n return new UserExperienceAnalyticsDeviceScopeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function uuids()\n {\n $request = $this->createRequest(\n '/_uuids',\n Request::HTTP_METHOD_GET\n );\n\n return $request;\n }",
"public function retrieveUserUUIDRequest($uid)\n {\n // verify the required parameter 'uid' is set\n if ($uid === null || (is_array($uid) && count($uid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uid when calling retrieveUserUUID'\n );\n }\n\n $resourcePath = '/users/queries/user-uuids-by-email/v1';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($uid !== null) {\n if('form' === 'form' && is_array($uid)) {\n foreach($uid as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['uid'] = $uid;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getOidcUserInfoRequest()\n {\n\n $resourcePath = '/userinfo';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function retrieveUserRequest($ids)\n {\n // verify the required parameter 'ids' is set\n if ($ids === null || (is_array($ids) && count($ids) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ids when calling retrieveUser'\n );\n }\n\n $resourcePath = '/users/entities/users/v1';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($ids !== null) {\n if('form' === 'form' && is_array($ids)) {\n foreach($ids as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['ids'] = $ids;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function userExperienceAnalyticsDeviceScopes(): UserExperienceAnalyticsDeviceScopesRequestBuilder {\n return new UserExperienceAnalyticsDeviceScopesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"protected function subuserListRequest()\n {\n\n $resourcePath = '/subuser-list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('identifier');\n if ($apiKey !== null) {\n $headers['identifier'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function availableTenantUserMembersOperationsRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling availableTenantUserMembersOperations'\n );\n }\n\n $resourcePath = '/tenant/{id}/user-members';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function getScopeString($get) {\r\r\r\n\t$scope = '';\r\r\r\n\tif(isset($get['scope'])) {\r\r\r\n\t\t$scope = \"?scope=\".$get['scope'];\r\r\r\n\t\tif(isset($get['more'])) {\r\r\r\n\t\t\t$scope .= \"&more=\".$get['more'];\r\r\r\n\t\t\tif(isset($get['even_more'])) {\r\r\r\n\t\t\t\t$scope .= \"&even_more=\".$get['even_more'];\r\r\r\n\t\t\t\treturn $scope;\r\r\r\n\t\t\t}\r\r\r\n\t\t\treturn $scope;\r\r\r\n\t\t}\r\r\r\n\t\treturn $scope;\r\r\r\n\t} else {\r\r\r\n\t\t$user = wp_get_current_user();\r\r\r\n\t\t$user_id = $user->data->ID;\r\r\r\n\t\t$scope = get_field('code_postal', 'user_'.$user_id );\r\r\r\n\t\treturn $scope;\r\r\r\n\t}\r\r\r\n}",
"public function availableOperationsRequest()\n {\n\n $resourcePath = '/user';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getOrgsIDOwnersRequest($org_id, $zap_trace_span = null)\n {\n // verify the required parameter 'org_id' is set\n if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $org_id when calling getOrgsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/orgs/{orgID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($org_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orgID' . '}',\n ObjectSerializer::toPathValue($org_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getUserCountryRequest()\n {\n\n $resourcePath = '/accounts/{clientId}/country';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTelegrafsIDOwnersRequest($telegraf_id, $zap_trace_span = null)\n {\n // verify the required parameter 'telegraf_id' is set\n if ($telegraf_id === null || (is_array($telegraf_id) && count($telegraf_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $telegraf_id when calling getTelegrafsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/telegrafs/{telegrafID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($telegraf_id !== null) {\n $resourcePath = str_replace(\n '{' . 'telegrafID' . '}',\n ObjectSerializer::toPathValue($telegraf_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function scopeUserId($query, $user_id)\n {\n return $query->whereHas('chatBotUser', function (Builder $query) use($user_id) {\n $query->whereIn('user_id', $user_id);\n });\n }",
"public function ScopeSearchParticipantBookings($query, $request)\n {\n // return $query::all();\n\n $user = \\Auth::user();\n // pr($request->all(),1);\n $members = DB::table('users')\n ->where('first_name', 'like',$request->input('member'))\n ->orWhere('last_name', 'like',$request->input('member'))\n ->orWhere('email', 'like',$request->input('member'))\n ->select('id')\n ->get();\n\n // pr($members->pluck('id')->toArray());\n\n return $query->whereDate('booking_orders.starts_at', '>=', $request->get('start_date'))\n ->whereDate('booking_orders.ends_at', '<=', $request->get('end_date'))\n ->where('provider_id', '=', $user->id)\n ->where(function ($query) use ($members){\n $query->whereIn('participant_id', $members->pluck('id')->toArray());\n }) \n ->get();\n\n \n }",
"public function scopeWithUuids($query, array $uuids)\n {\n return $query->whereIn('uuid', $uuids);\n }",
"public function scopeOwnedBy($query, $userId)\n {\n return $query->where('user_id',$userId);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field store_collect | public function setStoreCollect($store_collect)
{
$this->store_collect = $store_collect;
return $this;
} | [
"public function setStore(Valuestore $store)\n {\n $this->store = $store;\n }",
"public function setStoreId($value);",
"public function setStore($value) { $this->_store = self::forceBool($value); }",
"public function setCollectRecipientDetails($collect)\r\n {\r\n if (is_bool($collect))\r\n {\r\n $this->_collectRecipientDetails = $collect;\r\n }\r\n else\r\n {\r\n trigger_error(\"Invalid Collect Recipient Details value, boolean expected, \" . gettype($collect) . \" given\", E_USER_WARNING);\r\n }\r\n }",
"public function setStore(Store $store);",
"public function setStoreIds($value);",
"public function setStoreId($store_id);",
"public function setStoreLabel($storeLabel);",
"function set( )\n\t{\n\t\treturn call_user_func_array( array($this->store, 'set'), func_get_args() );\n\t}",
"protected function collect()\n {\n // The event is triggered only once.\n if ($this->collected) {\n return;\n }\n\n // Dispatch the data_collect event, in order to let other bundles alter the final data set.\n $event = new DataCollectEvent($this->dataCollector);\n $this->eventDispatcher->dispatch($event, Events::DATA_COLLECT);\n\n $this->collected = true;\n }",
"private function setLastCollect() {\n \n $repository = $this->entityManager->getRepository('OSMComCollectBundle:LastCollect');\n \n $lastCollect = $repository->findOneBy(['channel' => 'wikipage']);\n $lastCollect->setTime(new \\DateTime('NOW'));\n \n $this->entityManager->persist($lastCollect);\n }",
"private function setLastCollect() {\n \n $repository = $this->entityManager->getRepository('OSMComCollectBundle:LastCollect');\n \n $lastCollect = $repository->findOneBy(['channel' => 'wikitalk']);\n $lastCollect->setTime(new \\DateTime('NOW')); \n \n $this->entityManager->persist($lastCollect);\n }",
"protected function collect(): void\n {\n // The event is triggered only once.\n if ($this->collected) {\n return;\n }\n\n // Dispatch the data_collect event, in order to let other bundles alter the final data set.\n $this->eventDispatcher->dispatch(new DataCollectEvent($this->dataCollector));\n\n $this->collected = true;\n }",
"public function store() {\n if ($this->allowRun() && ($data = $this->_collector->disable())) {\n $this->_storage->saveRun($data, $this->_type);\n }\n }",
"public function doStore() {\n }",
"private function set_logstore() {\n set_config('enabled_stores', '', 'tool_log');\n // Enable logging plugin.\n set_config('enabled_stores', 'logstore_last_viewed_course_module', 'tool_log');\n set_config('logguests', 1, 'logstore_last_viewed_course_module');\n // Force reload.\n get_log_manager(true);\n }",
"public function setMagentoStores(array $magentoStores);",
"public function setStoreId($id)\r\n\t\t{\r\n\t\t\t$this->storeId = $id;\r\n\t\t}",
"protected function _addStoreInfo()\n {\n\n $this->_getFieldSet()->addField(\n 'store_id',\n 'select',\n [\n 'label' => __(\"Store\"),\n 'title' => __(\"Store\"),\n 'values' => $this->_systemStore->getStoreValuesForForm(),\n 'name' => 'store_id',\n 'required' => true\n ]\n );\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NAME: send_SMS() PURPOSE: sends an SMS to a customer using Exetel's API ARGUEMENTS: mobile number, total of job, customer id number, job id number RETURNS: string, message from Exetel API | function send_SMS($mobnum, $total, $custno, $jobno) {
if(!$mobnum || !$total || !$custno || !$jobno) {return "0||||Invalid Input";}
// if $total has a '$' in front, strip that out.
if(substr($total,0)=='$'){ $total = substr($total,1); }
$mobnum = str_replace(" ","",$mobnum); // remove spaces (if any) from mobile number
$msg = htmlentities("Your system is ready to pickup.Total $".$total." inc GST. Q? Call xxxxxxxx. Thx :)");
$msg = str_replace(" ","%20",$msg);
// set ourref value
$ourref = "c".$custno."j".$jobno; //maximum of 50 characters, will allow for a 24 character customer number and a 24 character job number
// ie: customer or job number from 1 up to 999,999,999,999,999,999,999,999 (not including commas)
$gourl = "https://smsgw.exetel.com.au/sendsms/api_sms.php"; // base URL
$gourl .= "?username=EXETELUSERNAME&password=EXETELUSERPASSWORD"; // company username/password (NOT ACCOUNT, BUT SPECIAL SMS ONES)
$gourl .= "&mobilenumber=".$mobnum; // home numbers dont work
$gourl .= "&message=".$msg; // the message
$gourl .= "&sender=04xxxxxxxx"; // this is the company authorised sending mobile number
$gourl .= "&messagetype=Text"; // type is ALWAYS Text (capital T is required)
$gourl .= "&referencenumber=".$ourref; // our reference which _may_ appear on the bill. This gets recorded in the SMS Client step comment
// going to use cURL
$ch = curl_init($gourl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // return as string
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // since we are accessing a https page
$rawr = curl_exec($ch); // get the output into a string
curl_close($ch); // close the connection
// $rawr holds the raw output. We will pass this output back to the requesting page for processing
return $rawr;
} | [
"public function sendSMS($mobileNumber, $messageContent);",
"public function sendSmsAction()\n {\n $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n\n $id = $this->getRequest()->getParam(\"id\");\n\n $ret = array(\n \"error\" => false,\n \"successRows\" => array(),\n \"errorRows\" => array(),\n );\n try{\n Mage::helper('breadcheckout/Customer')->sendCartActivationSmsToCustomer($quote, $id);\n $ret[\"successRows\"][] = $this->__(\"A Bread Cart SMS was successfully sent to the customer.\");\n }catch (Exception $e){\n $ret[\"error\"] = true;\n $ret[\"errorRows\"][] = $this->__(\"An error occurred while sending SMS:\");\n $ret[\"errorRows\"][] = $e->getMessage();\n }\n\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($ret));\n }",
"public static function sendSMS(){\n }",
"public function send(SMS $message) : string;",
"function sendSms($phone,$sms_body){ \n $url \t= 'http://alerts.solutionsinfini.com/api/v3/index.php';\n\t\t$fields = array(\n\t\t\t\t\t'method' => 'sms',\n\t\t\t\t\t'to' => $phone,\n\t\t\t\t\t'api_key' => 'Aea9a647ffb66d139975b3a0fad6253e0',\n\t\t\t\t\t'sender' => 'rocket',\n\t\t\t\t\t'message' => $sms_body,\n\t\t\t\t\t'format' => 'json'\n\t\t\t\t);\n\n $ch \t= curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n $result = curl_exec($ch);\n\t\tcurl_close($ch);// Close connection\t\t\n $this->addToLog($phone,$sms_body);\n\t }",
"public function sendSMS()\n {\n }",
"public function send_sms() {\n\n if ($this->request->is('post')) {\n if (empty($this->request->data['SmsMessage']['from'])) {\n $this->request->data['SmsMessage']['from'] = $this->Auth->user(\n 'caller_id_number');\n }\n //Send using Component\n //if ($this->Twilio->sendSMS($this->request->data['SmsMessage']['from'],$this->request->data['SmsMessage']['to'],$this->request->data['SmsMessage']['message'])) {\n //Send using Datasource\n if ($this->SmsMessage->save($this->request->data)) {\n $message = __('Your SMS Message has been sent.');\n } else {\n $message = __('There was an error sending your SMS Message.');\n }\n $this->layout = 'ajax';\n $this->set('value', $message);\n $this->render('/Elements/ajax_return');\n \n }\n \n $this->autoRender = false;\n }",
"public static function sendSmsAction($phone_number, $order_info)\n\t{\t\n\t\t$_str = '';\n\t\t\n\t\t$sms_api_name = self::getSmsApi();\n\t\t$sms_api_path = VAPADMIN . DIRECTORY_SEPARATOR . 'smsapi' . DIRECTORY_SEPARATOR . $sms_api_name;\n\t\t\n\t\tif (!self::getSmsApiEnabled() || !file_exists($sms_api_path) || !strlen($sms_api_name))\n\t\t{\n\t\t\t// SMS framework is probably not configured\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// require SMS gateway\n\t\trequire_once $sms_api_path;\n\n\t\t$dbo = JFactory::getDbo();\n\n\t\t/**\n\t\t * Fixed an issue that was retrieving the employee ID\n\t\t * from an undefined variable ($order_details).\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn('phone'))\n\t\t\t->from($dbo->qn('#__vikappointments_employee'))\n\t\t\t->where($dbo->qn('id') . ' = ' . (int) $order_info[0]['id_employee']);\n\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif ($dbo->getNumRows())\n\t\t{\n\t\t\t$emp_number = $dbo->loadResult();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$emp_number = '';\n\t\t}\n\t\t\n\t\t// array with the entities to notify\n\t\t$sms_api_to = array(\n\t\t\tself::getSmsApiToCustomer(),\n\t\t\tself::getSmsApiToEmployee(),\n\t\t\tself::getSmsApiToAdmin(),\n\t\t);\n\n\t\t// array with the phone number of the entities\n\t\t$sms_api_to_phone = array(\n\t\t\t$phone_number,\n\t\t\t$emp_number,\n\t\t\tself::getSmsApiAdminPhoneNumber(),\n\t\t);\n\n\t\t// SMS messages\n\t\t$sms_api_to_text = array(\n\t\t\tself::getSmsCustomerTextMessage($order_info),\n\t\t\tself::getSmsAdminTextMessage($order_info),\n\t\t);\n\t\t$sms_api_to_text[] = $sms_api_to_text[1];\n\t\t\n\t\t// get API params\n\t\t$sms_api_params = self::getSmsApiFields();\n\t\t\n\t\t$sms_api = new VikSmsApi($order_info, $sms_api_params);\n\t\t\n\t\t$response_obj = null;\n\t\t$result \t = true;\n\t\t\n\t\tfor ($i = 0; $i < count($sms_api_to); $i++)\n\t\t{\n\t\t\t// check if this entity (customer, employee or admin) should receive a SMS notification\n\t\t\tif ($sms_api_to[$i] && !empty($sms_api_to_phone[$i]))\n\t\t\t{\n\t\t\t\t// invoke the gateway to send the message\n\t\t\t\t$response_obj = $sms_api->sendMessage($sms_api_to_phone[$i], $sms_api_to_text[$i]);\n\t\t\t\t\n\t\t\t\tif (!$sms_api->validateResponse($response_obj))\n\t\t\t\t{\n\t\t\t\t\t// an error occurred, notify the administrator via mail\n\t\t\t\t\tself::sendAdminMailSmsFailed($sms_api->getLog());\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function send_enquiry_sms() {\n\t\t// Get user data.\n\t\t$this->db->select('contact');\n\t\t$this->db->from('admin');\n\t\t$ObjUser = $this->db->get()->row();\n\t\t// Get Enquiry date,time,details and sms count.\n\t\t$this->db->select('enq_date,enq_time,details,sms_count');\n\t\t$this->db->from('customer_enquiries_tbl');\n\t\t$this->db->where('sms_notify',1);\n\t\t$this->db->where('isdelete',0);\n\t\t$ArrEnqSms = $this->db->get()->result_array();\n\t\tif (isset($ArrEnqSms) && !empty($ArrEnqSms)) {\n\t\t\tforeach ($ArrEnqSms as $value) {\n\t\t\t\t$a \t\t= explode('-',$value['enq_date']);\n\t\t\t\t$day \t= date('d');\n\t\t\t\t$month \t= date('m');\n\t\t\t\t// match today's date with DB stored date.\n\t\t\t\tif ($day == $a[0] && $month == $a[1]) { \n\t\t\t\t\t\t// match current time with DB stored\n\t\t\t\t\tif (date('h:i A',$value['enq_time']) == date('h:i A')) { \n\t\t\t\t\t\t$nos = explode(' ', $ObjUser->contact);\n\t\t\t\t\t\t$sent_date = date('d-m-Y');\n\t\t\t\t\t\t$time = strtotime(date('h:i:s'));\n\t\t\t\t\t\t$user = \"chlorodots\"; \n\t\t\t\t\t\t$api_key = \"70651465-1dfb-4f53-9d5b-6b8786ff073e\"; \n\t\t\t\t\t\t$baseurl = \"http://sms.hspsms.com\";\n\t\t\t\t\t\t$message = urlencode($value['details']);\n\t\t\t\t\t\t$to = $ObjUser->contact;\n\t\t\t\t\t\t$sender = \"CHLORO\";\n\t\t\t\t\t\t$url = \"$baseurl/sendSMS?username=$user&message=$message&sendername=$sender&smstype=TRANS&numbers=$to&apikey=$api_key\"; \n\t\t\t\t\t\t// Send SMS \n\t\t\t\t\t\t$ret = file_get_contents($url); \n\t\t\t\t\t\tif(isset($ret) && !empty($ret)) {\n\t\t\t\t\t\t\tforeach ($nos as $row) {\n\t\t\t\t\t\t\t\t$data =\tarray('sms_recepients'=>$row,'no_of_sms'=>$value['sms_count'],'sms_body'=>$value['details'],'time'=>$time,'sms_sent_date'=>$sent_date);\n\t\t\t\t\t\t\t\t\t// store sent sms record in DB.\n\t\t\t\t\t\t\t\t$this->db->insert('sent_sms_data',$data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo 'SMS not sent.';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo 'time not matched'.'<br/>';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo 'date not match';\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}",
"function sendsms($mobilenumbers, $message)\n {\n // echo \"mobiile\". $mobilenumbers;\n // echo \"message\".$message;\n\n\n\n\n\n // $data = \"username=\".$username.\"&hash=\".$hash.\"&message=\".$message.\"&sender=\".$sender.\"&numbers=\".$numbers.\"&test=\".$test;\n // $ch = curl_init('http://api.textlocal.in/send/?');\n // curl_setopt($ch, CURLOPT_POST, true);\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n // $result = curl_exec($ch); // This is the result from the API\n // curl_close($ch);\n // return $response;\n\n $profile_id = 't5umdaa';\n $api_key = '010km0X150egpk3lD9dQ';\n $sender_id = 'UMDAAO';\n $mobile = $mobilenumbers;\n $sms_text = urlencode($message);\n\n //Submit to server\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://www.nimbusit.info/api/pushsms.php?\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"user=\" . $profile_id . \"&key=\" . $api_key . \"&sender=\" . $sender_id . \"&mobile=\" . $mobile . \"&text=\" . $sms_text);\n $response = curl_exec($ch);\n return $response;\n curl_close($ch);\n }",
"public function send_sms() {\n\t\t$vars = array();\n\t\t$vars['length_blog_name'] = strlen( get_bloginfo( 'name' ) );\n\t\t$vars['length_blog_url'] = strlen( home_url() );\n\n\t\t$this->render_admin( 'send-sms.php', $vars);\n\t}",
"function scheduleTransactionalSMS($tempid,$mobile,$message,$time)\n\t{\n\t\t\n\t\t$uid=urlencode($this->uid);\n\t\t$pin=urlencode($this->pin);\n\t\t$route=$this->transactional_route;\n\t\t$tempid=urlencode($tempid);\n\t\t$message=urlencode($message);\n\t\t$mobile=urlencode($mobile);\n\t\t$domain=$this->domain;\n\t\t$parameters=\"uid=$uid&pin=$pin&sender=$sender&rtype=json&route=$route&tempid=$tempid&mobile=$mobile&message=$message&time=$time\";\n\t\t$url=\"http://$domain/api/sms.php\";\n\t\t$get_url=$url.\"?\".$parameters;\n\t\t$ch=curl_init();\n\t\tcurl_setopt($ch, CURLOPT_POST,0);\n\t\tcurl_setopt($ch, CURLOPT_URL, $get_url);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_HEADER,0); // DO NOT RETURN HTTP HEADERS\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // RETURN THE CONTENTS OF THE CALL\n\t\t$return_val = curl_exec($ch);\n\t\treturn $return_val;\n\t}",
"function schedulePromotionalSMS($mobile,$message,$time)\n\t{\n\t\t//http://yourdomain.com/api/sms.php?uid=your_uid&pin=your_pin&sender=SENDER&route=0&mobile=MOBILE1&message=MESSAGE&time=dd-mm-yyyy-24h- min\n\t\t$uid=urlencode($this->uid);\n\t\t$pin=urlencode($this->pin);\n\t\t$sender=urlencode($this->sender);\n\t\t$route=$this->promotional_route;\n\t\t$message=urlencode($message);\n\t\t$mobile=urlencode($mobile);\n\t\t$domain=$this->domain;\n\t\t$parameters=\"uid=$uid&pin=$pin&sender=$sender&rtype=json&route=$route&mobile=$mobile&message=$message&time=$time\";\n\t\t$url=\"http://$domain/api/sms.php\";\n\t\t$get_url=$url.\"?\".$parameters;\n\t\t$ch=curl_init();\n\t\tcurl_setopt($ch, CURLOPT_POST,0);\n\t\tcurl_setopt($ch, CURLOPT_URL, $get_url);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_HEADER,0); // DO NOT RETURN HTTP HEADERS\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // RETURN THE CONTENTS OF THE CALL\n\t\t$return_val = curl_exec($ch);\n\t\treturn $return_val;\n\t}",
"public function sms($msg, $phone){\n //username\n $username = \"canaanland@lfcww.org\";\n //API Key\n $APIKey = \"5E68F254539B8FA8F01FBC0E2F273FD4\";\n //Mime mode\n $dataformat = \"xml\";\n //Derivative URL\n $APIUrl = \"http://smsprime.com/api.module/canaanland@lfcww.org/xml\";\n //Compute a signature for the user by concatenating the username and the api key\n $signature = md5($username . $APIKey);\n\n //Build an xml request for method send, with an auxillary instruction to get the balance\n $xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\n <Request>\n <header>\n <auth>\n <signature>$signature</signature>\n </auth>\n </header>\n <body>\n <auxillary>\n <balance>1</balance>\n </auxillary>\n <method>send</method>\n <parameters>\n <type>default</type>\n <destination>\".$phone.\"</destination>\n <source>LFC Procure</source>\n <header>LFC Procure</header>\n <shortmessage>\".$msg.\"</shortmessage>\n </parameters>\n </body>\n </Request>\";\n\n\n //Use CURL to post\n //You could as well easily use fsockopen and its family of functions\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $APIUrl ); \n curl_setopt($ch, CURLOPT_POST, 1 );\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $postResult = curl_exec($ch);\n if (curl_errno($ch)) {\n // print curl_error($ch);\n }\n curl_close($ch);\n //print htmlentities(\"$postResult\");\n }",
"public function sendMessage()\r\n {\r\n $soap_client_handle = $this->soap_wrapper->createSoapClient();\r\n\r\n if($soap_client_handle !== false){\r\n $soap_function = 'sendMessage';\r\n $webservice_call_parameters = [\r\n $this->username,\r\n $this->password,\r\n $this->deviceMsisdn,\r\n $this->message_content,\r\n true,\r\n 'SMS',\r\n\r\n ];\r\n try{\r\n $soap_result = $this->soap_wrapper->performSoapCall($soap_client_handle, $soap_function, $webservice_call_parameters);\r\n }catch (\\SoapFault $exception){\r\n $soap_result = $exception->getCode();\r\n }\r\n $this->result = $soap_result;\r\n }\r\n }",
"function singleSms($msisdn, $messageBody, $csmsId)\n{\n $params = [\n \"api_token\" => API_TOKEN,\n \"sid\" => SID,\n \"msisdn\" => $msisdn,\n \"sms\" => $messageBody,\n \"csms_id\" => $csmsId\n ];\n $url = trim(DOMAIN, '/').\"/api/v3/send-sms\";\n $params = json_encode($params);\n\n return callApi($url, $params);\n}",
"function schedulesms() {\n \t\t\n \t\tConfigure::write('debug', 0);\n \t\t\n \t\t$this->send(true, $_REQUEST['message'], $_REQUEST['mobile'], $_REQUEST['skey'], $_REQUEST['senderid'], \n \t\t\t\t\t\t\t$_REQUEST['group'], $_REQUEST['tag'], $_REQUEST['date'], $_REQUEST['response']);\n \t\t\n \t}",
"public function enquiry_converted_sms_send($enquiry_id,$name)\n{\n global $app_contact_no,$app_name;\n $sq_enquiry = mysql_fetch_assoc(mysql_query(\"select * from enquiry_master where enquiry_id='$enquiry_id'\"));\n $mobile_no = $sq_enquiry['mobile_no'];\n $assigned_emp_id = $sq_enquiry['assigned_emp_id'];\n $sq_emp = mysql_fetch_assoc(mysql_query(\"select * from emp_master where emp_id='$assigned_emp_id'\"));\n $first_name = $sq_emp['first_name'];\n $last_name = $sq_emp['last_name']; \n\n\n $message = \"We're thank you for enquiry with us and interested in providing the best services to make your journey awesome. Contact : \".$app_contact_no.\"\";\n global $model;\n\n $model->send_message($mobile_no, $message);\n}",
"public function sendSms($message,$number){\r\n\r\n $link = curl_init();\r\n\r\n curl_setopt($link , CURLOPT_URL, \"http://api.esms.kerala.gov.in/fastclient/SMSclient.php?username=portsms2&password=portsms1234&message=\".$message.\"&numbers=\".$number.\"&senderid=PORTDR\");\r\n\r\n curl_setopt($link , CURLOPT_RETURNTRANSFER, 1);\r\n\r\n curl_setopt($link , CURLOPT_HEADER, 0);\r\n\r\n return $output = curl_exec($link);\r\n\r\n curl_close($link );\r\n\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests heighten with 0 as width | public function testHeightenWithZeroWidth()
{
$this->box->setWidth(0);
static::setExpectedExceptionRegExp('InvalidArgumentException');
$this->box->heighten(20);
} | [
"public function testWidenWithZeroHeight()\n {\n $this->box->setHeight(0);\n static::setExpectedExceptionRegExp('InvalidArgumentException');\n $this->box->widen(50);\n }",
"public function testHeighten()\n {\n $box = new UndefinedBox();\n\n $this->assertEquals(new UndefinedBox(), $box->heighten(100));\n }",
"public function testMinHeight() {\n\t\t$this->assertTrue($this->object->minHeight(400));\n\t\t$this->assertFalse($this->object->minHeight(900));\n\t}",
"public function heightTopLeft();",
"public function testHeighten()\n {\n $box = new RelativeBox(100, 100);\n\n $this->assertEquals(new RelativeBox(200, 200), $box->heighten(200));\n }",
"public function testGetHeight()\n {\n $this->assertEquals(0, $this->image->getHeight(), 'Failed to return a height value of zero for an unset height');\n\n $height = 480;\n self::setProperty($this->image, 'height', $height);\n $this->assertEquals($height, $this->image->getHeight(), 'Failed to retrieve height');\n }",
"public function testHeight() {\n $png = new Png();\n $png->isMatch($this->pngFile);\n $this->assertEquals(1, $png->getHeight());\n }",
"public function testGetProductHeight() {\n $this->assertGreaterThan(0, $this->parser->height());\n }",
"public function hasWidth(): bool;",
"public function testMaxHeight() {\n $this->assertTrue(Validate::maxHeight($this->image, 267));\n $this->assertTrue(Validate::maxHeight($this->image, 300));\n $this->assertFalse(Validate::maxHeight($this->image, 265));\n $this->assertFalse(Validate::maxHeight($this->image, 144));\n }",
"public function testResizeWithUnknownHeight()\n {\n $image = Image::create( 100, 100 );\n $image->resize( 50, null, Image::RESIZE_DEFAULT );\n }",
"public function getHeightS();",
"public function hasHeight() {\n return $this->getHeight() !== false;\n }",
"public function testRandomHeight()\n {\n $star = new Tree();\n $this->assertContains($star->getHeight(), [5, 7, 11, 15]);\n }",
"public function get_height();",
"public function getHeightSq();",
"public function hasHeight(): bool {\n return $this->attributes()->exists('height');\n }",
"public function getHeightO();",
"public function testLandscapeLessBothResizeOnHeight()\n {\n // \"landscape\"\n $width = 10;\n $height = 5;\n\n $maxWidth = 20;\n $maxHeight = 8;\n\n $resize = new ImageResize();\n list($newWidth, $newHeight) = $resize->getCalculatedSize($width, $height, $maxWidth, $maxHeight);\n\n $this->assertEquals(16, $newWidth);\n $this->assertEquals(8, $newHeight);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the vir fonction publique. | public function getVirFonctionPublique() {
return $this->virFonctionPublique;
} | [
"public function getContenu_pub()\n {\n return $this->contenu_pub;\n }",
"public function getVirFonctionPublique(): ?bool {\n return $this->virFonctionPublique;\n }",
"public function getPubFarebasis()\n {\n return isset($this->PubFarebasis) ? $this->PubFarebasis : null;\n }",
"function publiHAL_extraction_publisher($texte){\n\tif(preg_match('@\\<a\\s*rel=\\'publisher\\'\\s*\\>((?U).*)\\</a\\>@uis', $texte, $matches)) return $matches[1];\n\treturn '';\t\n}",
"public function getIdPub()\n {\n return $this->idPub;\n }",
"public function getTextePourPublication() {\n\t\n\t\t$this->log->debug(\"ItemTexteLacunaire::getTextePourPublication() Début\");\n\t\t\n\t\t$contenu = $this->get(\"solution\");\n\t\t\n\t\t// Remplacer les fins de ligne\n\t\t$contenu = preg_replace(\"/\\r\\n|\\r|\\n/\",'<br>', $contenu);\n\t\t$contenu = preg_replace(\"/<br \\/>/\",'<br>', $contenu);\n\t\t\n\t\t// Localiser les lacunes\n\t\tpreg_match_all('/<span id=\"(.*?)\".*?>(.+?)<\\/span>/', $contenu, $matches, PREG_SET_ORDER);\n\t\t\n\t\t// Traiter chacune des lacunes\n\t\t$idx = 0;\n\t\t$nbLacunes = 0;\n\t\t\n\t\tforeach ($matches as $lacuneInfos) {\n\t\t\t$idx++;\n\t\t\t\n\t\t\t$match = $lacuneInfos[0];\n\t\t\t$idLacuneSrc = $lacuneInfos[1];\n\t\t\t\n\t\t\t$blankTag = \"%blank\" . $idx;\n\t\t\t\n\t\t\t// Remplacer dans le texte\n\t\t\t$contenu = str_replace($match, $blankTag, $contenu);\n\t\t}\t\t\n\t\t\n\t\t$this->log->debug(\"ItemTexteLacunaire::getTextePourPublication() Début\");\n\n\t\t// Enlever caractère html et UTF8\n\t\t$contenu = html_entity_decode($contenu, ENT_NOQUOTES, \"UTF-8\");\n\t\t\n\t\t// Escape pour Javascript\n\t\t$contenu = Web::nettoyerChainePourJS($contenu);\n\t\t\n\t\treturn $contenu;\n\t}",
"public function getPublicar()\n {\n return $this->publicar;\n }",
"public function getPubId()\n {\n return $this->pub_id;\n }",
"public function getPublierWeb() {\n return $this->publierWeb;\n }",
"public function getVelocidadPublicacion(){\n\t\treturn $this->velocidad_publicacion;\n\t}",
"public function getPublico()\n {\n return $this->publico;\n }",
"public function getAPublierWeb() {\n return $this->aPublierWeb;\n }",
"public function getPubkey()\n {\n return $this->pubkey;\n }",
"public function getPrix_prov_midi_enfant() {\n\t\t\treturn $this->prix_prov_midi_enfant;\n\t\t}",
"function get_pubchem($substance)\r\n {\r\n $data = $this->get_identifiers($substance->inchikey);\r\n\r\n if(!$data)\r\n {\r\n return false;\r\n }\r\n\r\n return $data->pubchem;\r\n }",
"public function getPubnub()\n {\n return $this->pubnub;\n }",
"function get_publication()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_PUBLICATION);\r\n }",
"public function getPublicationTitle();",
"public function getNode2Pub()\n {\n return $this->node2_pub;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates true or false using the given probability percentage | public function probabilityCalculator($probability) {
$modifier = rand(1, 100);
return ($modifier <= $probability);
} | [
"public static function ProbabilityCheck($probability=100) {\n\t\tif (rand(1, 100) <= $probability) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasPercentage(): bool;",
"private function variantByPercentage()\n {\n $n = 100 * $this->randomish();\n foreach ($this->percentages as $v) {\n // === 100 check may not be necessary but I'm not good\n // enough numerical analyst to be sure.\n if ($n < $v[0] || $v[0] === 100) return $v[1];\n }\n return false;\n }",
"public function userPercentage($percentage) {\n\t\t$username = $this->securityContext->getAccount()->getAccountIdentifier();\n\t\t$chance = hexdec(substr(sha1($username . $this->feature), 0, 4)) / pow(2,16);\n\t\tif ($percentage > 1) {\n\t\t\t$percentage = $percentage / 100;\n\t\t}\n\t\treturn $chance > $percentage;\n\t}",
"public function isPercentage(): bool\n {\n return data_get($this->discount, 'amount') === 'percent';\n }",
"static function chance(float $chance): bool\n {\n return round(mt_rand(1, (1 / $chance) * 100)) === 1;\n }",
"protected function determineShowSurvey($probability)\n {\n return($probability > rand(0, 99));\n }",
"function ting_search_context_evalute_condition($number_of_terms, $total_number, $pass_ratio) {\n if ($total_number != 0) {\n $term_ratio = $number_of_terms/$total_number;\n return ($term_ratio > $pass_ratio);\n } else {\n return false;\n }\n}",
"private function isRefreshNeededByProbability(): bool\n {\n if ($this->refreshMode == self::MODE_PROBABILITY) {\n if ($this->refreshRate == 0) {\n return false;\n }\n $rand = ((float) mt_rand() / (float) mt_getrandmax()) * 100;\n if ($this->refreshRate == 100 || $rand <= $this->refreshRate) {\n return true;\n }\n }\n return false;\n }",
"public function predict_probability($data){}",
"protected function valueContainsPercentage()\n {\n return (preg_match('/%/', $this->condition->value) == 1);\n }",
"public function calculateGeneralProbability(bool $update_property=true): float\r\n {\r\n $calculation = 0;\r\n\r\n foreach($this->Probabilities as $probability)\r\n {\r\n $calculation += $probability;\r\n }\r\n\r\n $resulted_calculation = ($calculation / count($this->Probabilities));\r\n\r\n if($update_property)\r\n {\r\n $this->CalculatedProbability = $resulted_calculation;\r\n }\r\n\r\n return $resulted_calculation;\r\n }",
"public function checkProbabilityModel(){}",
"private function showSupportArea(int $probabilityInPercent = 10): bool\n {\n if (!$this->getBackendUser()->isAdmin()) {\n return false;\n }\n\n if (mt_rand() % 100 <= $probabilityInPercent) {\n return true;\n }\n\n return false;\n }",
"private function isRefreshNeededByProbability()\n {\n if (is_null($this->refreshProbability)) {\n return false;\n }\n $rand = (float) mt_rand() / (float) mt_getrandmax();\n if ($this->refreshProbability == 1.0 || $rand <= $this->refreshProbability) {\n return true;\n }\n return false; // @codeCoverageIgnore\n }",
"function calculate_percentage($correct_answers, $total_questions){\n return ceil(($correct_answers / $total_questions) * 100);\n}",
"function jam_percent($n,$p){\n$one = $n / 100;\n$two = $one * $p;\nreturn $two + $n;\n}",
"public function getDesiredProbabilityDistribution();",
"function getBoolean($favorTrue = 5000);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Snap to \ Defines the snap applied on points, possible values are: "grid", "ticks" or a numeric value \ | public function get_snap_to() {
return $this->snap_to;
} | [
"public function getSnapType()\n {\n return $this->snapType;\n }",
"public function getSnapin()\n {\n return $this->get('snapin');\n }",
"function get_snapped_point ($lat, $lng)\n{\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json\",\n 'method' => 'GET' \n )\n );\n \n //ATTENTION :Replace your own api_key\n $api_key=\"key\";\n $url_arr = array(\"https://roads.googleapis.com/v1/nearestRoads?points=$lat,$lng&key=\".$api_key,\n \"https://roads.googleapis.com/v1/snapToRoads?path=$lat,$lng&key=\".$api_key);\n\n $url= $url_arr[array_rand($url_arr)];\n $context = stream_context_create($options);\n\n $result = file_get_contents($url, false, $context);\n $result_arr=json_decode($result,true);\n\n \n return ($result_arr[\"snappedPoints\"][0][\"location\"]);\n}",
"public function getGridPoint() {\n return $this->gridPoint;\n }",
"public function getHasSnap()\n {\n return $this->hasSnap;\n }",
"function swf_posround($round)\n{\n}",
"public function snapToMinute(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->minute()->startDate(),\n DatePoint::fromDate($this->endDate)->minute()->endDate(),\n $this->bounds\n );\n }",
"public function getPointsDraw();",
"public function give_land ()\n\t{\n\t\treturn ceil((1 / ($this->e_land * 0.00022 + 0.25)) * 20 * $this->getModifier('explore'));\n\t}",
"public function setRange( $tpx, $tpy, $psx, $psy ) {\n //echo 'setRange(), psx: '.$psx.', psy: '.$psy.PHP_EOL;\n $this->mTiepoint[0] = $tpx;\n $this->mTiepoint[1] = $tpy;\n $this->mPixelScale[0] = $psx;\n $this->mPixelScale[1] = $psy;\n /*\n if ( $GLOBALS['dev'] ) {\n echo $this->mTiepoint[1].','.$this->mTiepoint[0].PHP_EOL;\n echo ($this->mTiepoint[1] + $this->mHeight * $this->mPixelScale[1]).','.($this->mTiepoint[0] + $this->mWidth * $this->mPixelScale[0]).PHP_EOL;\n }\n */\n }",
"public function GridClipPath()\n {\n if(isset($this->grid_clip_id))\n return $this->grid_clip_id;\n\n $rect = array(\n 'x' => $this->pad_left, 'y' => $this->pad_top,\n 'width' => $this->width - $this->pad_left - $this->pad_right,\n 'height' => $this->height - $this->pad_top - $this->pad_bottom\n );\n $clip_id = $this->NewID();\n $this->defs[] = $this->Element('clipPath', array('id' => $clip_id),\n NULL, $this->Element('rect', $rect));\n return ($this->grid_clip_id = $clip_id);\n }",
"public function getPointHelper()\n {\n return $this->pointHelper;\n }",
"public function setSnapStatus($var)\n {\n GPBUtil::checkInt32($var);\n $this->snapStatus = $var;\n\n return $this;\n }",
"public function point();",
"public function getShipsOnGridCoordinates()\n {\n return $this->ships;\n }",
"public function roundDataProvider() : array {}",
"public function getPoints();",
"public function getIsRoadSnapped()\n {\n return isset($this->is_road_snapped) ? $this->is_road_snapped : null;\n }",
"public function getStartingAndEndingPoints()\n\t{\n\t\t// Get Tour Ending Point\n\t\tforeach ($this->destinations as $location) {\n if (!in_array($location, $this->sources)) {\n $this->tourEndingPoint = $location;\n }\n }\n // Get Tour Starting Point\t\n foreach ($this->sources as $location) {\n if (!in_array($location, $this->destinations)) {\n $this->tourStartingPoint = $location;\n }\n }\t\n\n $this->currentLocation = $this->tourStartingPoint;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// Return a random row from a database query | function tep_random_select($query) {
$random_product = '';
$random_query = tep_db_query($query);
$num_rows = tep_db_num_rows($random_query);
if ($num_rows > 0) {
$random_row = tep_rand(0, ($num_rows - 1));
tep_db_data_seek($random_query, $random_row);
$random_product = tep_db_fetch_array($random_query);
}
return $random_product;
} | [
"function give_random_row($sql) \r\n {\r\n \r\n $random_product = \"\";\r\n $result = mysql_query($sql) or die(mysql_error());\r\n $num_of_rows = mysql_num_rows($result);\r\n\t\r\n if ($num_of_rows > 0) \r\n {\r\n $random_row = give_rand(0, ($num_of_rows - 1));\r\n mysql_data_seek($result, $random_row);\r\n $random_product = mysql_fetch_array($result) or die(mysql_error()); \r\n }\r\n\r\n return $random_product;\r\n \r\n }",
"function tep_random_select($query) {\n\t$random_product = '';\n\n\t$Random = Doctrine_Manager::getInstance()\n\t\t->getCurrentConnection()\n\t\t->fetchAssoc($query);\n\n\tif (sizeof($Random) > 0){\n\t\t$random_row = tep_rand(0, (sizeof($Random) - 1));\n\t\t$random_product = $Random[$random_row];\n\t}\n\n\treturn $random_product;\n}",
"function runRandom($query);",
"public function getRandomRow(): array\n {\n $query = \"SELECT * FROM $this->table ORDER BY RANDOM() LIMIT 1;\";\n $statement = $this->pdo->prepare($query);\n if (!$statement) {\n die(var_dump($this->pdo->errorInfo()));\n }\n $statement->execute();\n $randomRow = $statement->fetch(PDO::FETCH_ASSOC);\n\n return $randomRow;\n }",
"public function selectRandomRow($table_name) {\n\t\t$sql = \"SELECT COUNT(*) FROM $table_name\";\n\t\t$stm = $this->pdo->prepare($sql);\n\t\t$stm->execute();\n\t\t$row_count = (int) $stm->fetch()['COUNT(*)'];\n\n\t\t$rand_row = rand(0,$row_count-1);\n\n\t\t$sql = \"SELECT * FROM $table_name LIMIT $rand_row, 1\";\n\t\t$stm = $this->pdo->prepare($sql);\n\t\t$stm->execute();\n\t\treturn $stm->fetch();\n\t}",
"private function Get_Random_Daily_Quest()\n{\n $Item_Array = array();\n $Item_SQL = \"SELECT * FROM base_daily_quests\";\n $Random_Results = $this->Connection->Custom_Query($Item_SQL, $Item_Array, true);\n\n shuffle($Random_Results);\n\n $Results = array_pop($Random_Results);\n\n return $Results;\n}",
"public function getRandomRow($colName) {\r\n\t\t$sql = \"SELECT $colName FROM $this->tableName ORDER BY RAND() LIMIT 1;\";\r\n\t\t$getRandRow = $this->mysql->prepare($sql);\r\n\t\t$getRandRow->execute();\r\n\t\t\r\n\t\tif($result = $getRandRow->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\t$row = $result;\r\n\t\t} else {\r\n\t\t\t$row = \"\";\r\n\t\t}\r\n\t\t \r\n\t\treturn $row;\r\n\t}",
"function getRandomAd() \n {\n $query = \"select * from Ads order by rand() limit 1\";\n $result = mysqli_query($this->db, $query);\n return mysqli_fetch_array($result, MYSQLI_ASSOC);\n }",
"public function executeRandom() {\n return $this->query_handler = $this->db_class->randomQuery($this->sql_query);\n }",
"private function getRandomAnswer(){\n\t $res = $this->db->query(\"Select answer from tbl_question ORDER BY RAND() LIMIT 1;\");//note the \"$this->db->query...\"\n\t $ary = mysql_fetch_assoc($res) or die('cant fetch assoc getRandomAnswer');\n\t return $ary['answer'];\n\n\t}",
"public function getRandAdvertisment() {\n // SELECT `a`.*, `b`.* FROM `advertisment` AS `a` INNER JOIN `business` AS `b` ON a.aid = b.bid ORDER BY RAND() ASC LIMIT 1\n $res = $this->select()\n ->setIntegrityCheck(false) // rows become read only, cannot save updated result\n ->from(array('a' => 'advertisment'))\n ->join(array('b' => 'business'), 'a.aid = b.bid')\n ->order('RAND()')\n ->limit(1)\n ->query();\n //exit(var_dump($res));\n return $res->fetch();\n }",
"function fixtures_fetch_random_value( string $table ,\n string $field ) : mixed\n{\n // Fetch an entry in the database\n $drand = mysqli_fetch_array(query(\" SELECT $table.$field AS 'u_value'\n FROM $table\n ORDER BY RAND()\n LIMIT 1 \"));\n\n // Return the ID\n return $drand['u_value'];\n}",
"public static function getQuerySampleRandom(){\n $samples = self::getQuerySamples();\n return $samples && count($samples)?$samples[array_rand($samples)]:'';\n }",
"public function selectQueryWithRand() {\n\t\t\t// Replace markers in the condition\n\t\t$condition = self::finalizeCondition(self::$fullConditionForTable);\n\t\t$additionalSelectFields = $this->prepareAdditionalFields('tt_content');\n\t\t$expectedResult = 'SELECT tt_content.uid, tt_content.header, tt_content.pid, tt_content.sys_language_uid' . $additionalSelectFields . ' FROM tt_content AS tt_content WHERE ' . $condition . 'ORDER BY RAND() ';\n\n\t\t$query = 'SELECT uid, header FROM tt_content ORDER BY RAND()';\n\t\t$this->sqlParser->parseQuery($query);\n\t\t$this->sqlParser->setProviderData($this->settings);\n\t\t$this->sqlParser->addTypo3Mechanisms();\n\t\t$actualResult = $this->sqlParser->buildQuery();\n\n\t\t$this->assertEquals($expectedResult, $actualResult);\n\t}",
"public function getRandomQuiz() {\n\t\t$sql = \"SELECT * from {$this->_dbName}.{$this->_tableName} ORDER BY RAND()\";\n\t\treturn $this->getRecord($sql);\n\t}",
"function get_random_cluster() {\n global $mysqli;\n\n $stmt = $mysqli->prepare(\"SELECT Cluster_id, Clustering_id FROM Clusters ORDER BY RAND() LIMIT 0,1\");\n $stmt->execute();\n $res = $stmt->get_result();\n if ($row = $res->fetch_assoc()) {\n return $row;\n }\n}",
"function findRandom() {\n\t\treturn $this->first(array('order' => 'RAND()'));\n\t}",
"public function GetRandomQuestion()\n {\n /*CREATES VARIABLE CONTAINING THE CALL GETRANDOMQUESTION PROCEDURE*/\n $SQL = \"Call GetRandomQuestion()\";\n /*SENDS VARIABLE CONTAINING GETRANDOMQUESTION PROCEDURE CALL TO DATABASE*/\n $this->aDB->query($SQL);\n /*COLLECTS ROW FROM GETRANDOMQUESTION PROCEDURE*/\n $row = $this->aDB->next();\n /*RETURNS COLLECTED ROW FROM GETRANDOMQUESTION PROCEDURE*/\n \n return $row;\n \n }",
"public function random_question($id)\r\n\t{\r\n\t\t//$sql = \"SELECT * FROM questions where id='$id' ORDER BY RAND() LIMIT 1\";\r\n $sql = \"SELECT * FROM questions where id='$id'\";\t\t\r\n\t\r\n\t\treturn $this->dbObj->ExecuteQuery($sql, 1);\r\n\t\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines the value of the toggleTitle attribute. | public function setToggleTitle($toggleTitle)
{
$this->toggleTitle = (string) $toggleTitle;
return $this;
} | [
"public function get_title() {\n return __( 'EA Toggle', 'essential-addons-elementor' );\n }",
"public function setShowTitleAttribute($show_title)\n {\n $this->attributes['show_title'] = $show_title == 1 || $show_title === 'true' || $show_title === true ? true : false;\n }",
"public function title($title=false) {\r\n\t\t\tif($title) $this->title = $title;\r\n\t\t\treturn $this->title;\r\n\t\t}",
"public function set_title($title);",
"protected function set_title()\n {\n }",
"public function setGenerateTitle($generate_title);",
"public function title($title) {\n $this->title = $title;\n $this->forcetitle = true;\n }",
"public function getButtonTitle()\n {\n return trans($this->getConfig($this->value ? 'titleTrue' : 'titleFalse'));\n }",
"public function getShowTitleAttribute($show_title)\n {\n return $show_title == 1 ? true : false;\n }",
"function set_title ($title) {\r\n\t\r\n\t\t$this->title = $title;\r\n\t}",
"public function setTitle( $title )\n\t{\n\t\t$this->setAttribute( \"title\", $title );\n\t}",
"public function getTitleAttribute($title)\n {\n return $this->attributes['title'] = ucwords($title);\n\n }",
"function setHeaderTitle($value) {\n $this->header_title = $value;\n}",
"public function setTitle($title) {\n $this->setOption('title', $title);\n }",
"public function set_Title($Title)\n\t{\n\t\t\t$this->Title = $Title;\n\t}",
"function show_title()\n {\n return ($this->show_title==1);\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"function setTitle($newTitle) {\n $this->title = $newTitle;\n }",
"public function setTitle($title)\r\n {\r\n $this->_title = $title;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Admin notice HTML for successfully obtained tokens | public function display_access_token_success() {
$this->display_admin_notice( "Access token successfully obtained!", "success" );
} | [
"public function tokenPage() {\n $content = [\n '#theme' => 'brapi_token',\n '#title' => t('User Access Token.'),\n ];\n\n return $content;\n }",
"function envato_toolkit_credentials_admin_notices() {\n $message = sprintf( __( \"To enable theme update notifications, please enter your Envato Marketplace credentials in the %s\", \"codeless\" ),\n \"<a href='\" . admin_url() . \"admin.php?page=envato-wordpress-toolkit'>Envato WordPress Toolkit Plugin</a>\" );\n echo \"<div id='message' class='updated below-h2'><p>{$message}</p></div>\";\n }",
"public function display_token_page() {\n\t\t// Now grab the options based on what we're looking for\n\t\t$opts = get_option( 'emcl_settings' );\n\t\t$emc_token_page = isset( $opts['emc_token_page'] ) ? $opts['emc_token_page'] : '';\n\t\t// And display the view\n\t\tinclude_once $this->views . 'settings-server-token-page.php';\n\t}",
"public function show_admin_notice() {\n\n if( $this->statusmESSAGE!=='Active'){\n $class = 'notice notice-error';\n \t$message = 'Invalid license. Response: ' . $this->statusmESSAGE;\n\n \tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', esc_attr( $class ), $message );\n }\n }",
"public function display_token_url_call_error() {\n $this->display_admin_notice( \"Call to token URL failed, please try again!\", \"error\" );\n }",
"public function getTokenInfo() {\n $output = [];\n // Get a list of the available fields and arguments for token replacement.\n $options = [];\n\n foreach ($this->view->display_handler->getHandlers('field') as $field => $handler) {\n $options[(string) $this->t('Fields')][\"{{ raw_fields.$field }}\"] = $handler->adminLabel() . ' (' . $this->t('raw') . ')';\n $options[(string) $this->t('Fields')][\"{{ fields.$field }}\"] = $handler->adminLabel() . ' (' . $this->t('rendered') . ')';\n // We only use fields up to (and including) this one.\n if ($field == $this->options['id']) {\n break;\n }\n }\n\n // This lets us prepare the key as we want it printed.\n $count = 0;\n\n foreach ($this->view->display_handler->getHandlers('argument') as $id => $handler) {\n $options[(string) $this->t('Arguments')][\"{{ arguments.$id }}\"] = $this->t('@argument title', ['@argument' => $handler->adminLabel()]);\n $options[(string) $this->t('Arguments')][\"{{ raw_arguments.$id }}\"] = $this->t('@argument input', ['@argument' => $handler->adminLabel()]);\n }\n\n $this->documentSelfTokens($options[(string) $this->t('Fields')]);\n\n // We have some options, so make a list.\n if (!empty($options)) {\n $items = [];\n foreach (array_keys($options) as $type) {\n if (!empty($options[$type])) {\n foreach ($options[$type] as $key => $value) {\n $items[] = $key . ' == ' . $value;\n }\n }\n }\n $output = [\n '#theme' => 'item_list',\n '#items' => $items,\n '#type' => $type,\n '#prefix' => '<p>' . $this->t('The following tokens are available\n for this field. Note that due to rendering order, you cannot use\n fields that come after this field; if you need a field that is not\n listed here, re-arrange your fields.') . '</p>',\n '#suffix' => '<p><em>' . $this->t('Using rendered tokens (\"fields\" / \"arguments\") can\n cause unexpected behaviour, as this will use the last output of\n the field. This could be re written output also. If no prefix is\n used in the token pattern, \"raw_fields\" / \"raw_arguments\" will be used as a default.') .\n '</em></p>',\n ];\n }\n else {\n $output = [\n '#markup' => '<p>' . $this->t('You must add some additional fields to\n this display before using this field. These fields may be marked as\n <em>Exclude from display</em> if you prefer. Note that due to\n rendering order,you cannot use fields that come after this field; if\n you need a field not listed here, rearrange your fields.') . '</p>',\n ];\n }\n\n return $output;\n }",
"public function _adminPage()\n\t{\t\t\n\t\t// Render notice\n\t\tif($error = $this->error)\n\t\t{\t\n\t\t\t$this->notice = is_array($error) ? implode('<br />', array_unique($error)) : $error;\n\t\t\t$this->notice = '<div class = \"error\"><p>' . $this->notice . '</p></div>';\n\t\t}\n\t\t\n\t\tif($note = $this->notice)\n\t\t\techo $note[0] != '<' ? '<div class = \"updated\"><p>' . $note . '</p></div>' : $note;\n\t\t\n\t\trequire_once dirname(dirname(__FILE__)) . '/resource/view.admin.phtml';\n\t}",
"function initlab_section_mailman_token_callback($args) {\n ?>\n <p><?php _e('Please input the correct settings so the [initlab_mailman_token] shortcode can operate properly.', 'initlab-addons'); ?></p>\n <?php\n}",
"public function insert_form_token_field()\n\t{\n\t\techo '<input type=\"hidden\" name=\"token\" value=\"' . \n\t\t\t$this->token . \n\t\t\t'\" />';\n\t}",
"function renderToken(){\n if($this->useValidationToken == true){\n //Generate token and place it in a session\n $token = md5(uniqid());\n Session::put(\"form_token\", $token);\n \n //Render the token code out to use on forms\n return '<input type=\"hidden\" name=\"form_token\" value=\"'.$token.'\" />';\n }\n }",
"public function DisplayFormToken(){\n\t\t//creer vue\n\t\t$v = new ViewGenerateTokenApi();\n\t\t$v->display();\n\t}",
"function protectForm() {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"spack_token\\\" value=\\\"\".$this->token.\"\\\" />\";\n\t}",
"public static function protect()\n {\n return '<input type=\"hidden\" name=\"token\" value=\"' .\n Utility::generateToken() . '\" />';\n }",
"public function admin_notices() {\n\t\t$user = wp_get_current_user();\n\n\t\t// Return if the provider is not enabled.\n\t\tif ( ! in_array( __CLASS__, Two_Factor_Core::get_enabled_providers_for_user( $user->ID ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if we are not out of codes.\n\t\tif ( $this->is_available_for_user( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"error\">\n\t\t\t<p>\n\t\t\t\t<span><?php printf( // WPCS: XSS OK.\n\t\t\t\t\t__( 'Two-Factor: You are out of backup codes and need to <a href=\"%s\">regenerate!</a>', 'it-l10n-ithemes-security-pro' ),\n\t\t\t\t\tesc_url( get_edit_user_link( $user->ID ) . '#two-factor-backup-codes' )\n\t\t\t\t); ?><span>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}",
"function keativa_dashboard_messages() {\n\t\techo \"<p>Administrasi website resmi Khalifah Umroh & Tour.</p>\";\n\t}",
"public function showTokenPage(){\n return view('token');\n }",
"function token_field(){\n\t\tstatic $_token;\n\t\tif(!isset($_token)){\n\t\t\t$_token = md5($this->generate_salt(10));\n\t\t\t$this->option('_token',$_token);\n\t\t}\n\t\treturn '<input type=\"hidden\" name=\"_token\" id=\"_token\" value=\"'.$_token.'\" />';\n\t}",
"public function bot_token_callback()\n {\n printf(\n '<input type=\"text\" id=\"bot_token\" name=\"telegram_bot_options[bot_token]\" value=\"%s\" />',\n isset($this->options['bot_token']) ? esc_attr($this->options['bot_token']) : ''\n );\n }",
"public static function print_token(){\n\t\t\t$output = \"<script>console.log(' Token = \" . $_SESSION['csrf_token'] . \" ');</script>\";\n\t\t\techo $output;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
public function getImagePath() Returns the image file path defined for the field 'media_image_file' | public function getImagePath() {
return $this->uploadPathPrefix . $this->mediaUploadFieldOptions['media_image_file']['dir'];
} | [
"public function getImagePath()\n {\n return $this->imagePath;\n }",
"public function getImagePath()\n {\n\n if (!$this->hasImage()) {\n return null;\n }\n\n return self::$images_storage_path . '/' . $this->promo_banner_pic_src;\n }",
"function getImagePath() \n\t{\n\t\treturn CLIENT_WEB_DIR . \"/survey/$this->obj_id/$this->id/images/\";\n\t}",
"public function getImagePath()\n {\n $testimonialId = $this->getRequest()->getParam('testimonial_id');\n\n $testimonail = $this->_testimonialFactory->addFieldToFilter('testimonial_id', ['eq' => $testimonialId]);\n $testimonail = $testimonail->getData();\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $storeManager = $objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n $currentStore = $storeManager->getStore();\n $media_url = $currentStore->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n $imagePath = $media_url . 'testimonial/' . $testimonail[0]['image'];\n\n return array('fullPath'=>$imagePath,'name'=>$testimonail[0]['image']);\n\n }",
"public function getMediaPath()\n {\n return $this->_media_file_path;\n }",
"public function getImg_path()\n {\n return $this->img_path;\n }",
"public function getImgPath()\n {\n return $this->imgPath;\n }",
"public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }",
"function _getImagePath(){\n if($this->_isOutsideSource()){\n return $this->fileName;\n }\n else {\n return '/' . $this->_getUploadPath();\n }\n }",
"public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }",
"public function get_image_url() {\n global $CFG;\n\n if (!$file = $this->get_stored_file()) {\n return null;\n }\n\n $path = \\moodle_url::make_pluginfile_url($this->get_context()->id,\n 'mod_swipe', 'card', $this->record->id, '/', $file->get_filename());\n\n return $path;\n }",
"public function getPathImagesUpload()\n {\n $mediaUrl = $this->storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n return $mediaUrl . self::PATH_IMAGES_UPLOAD;\n }",
"public function getImagePath()\n {\n $path = Zend_Registry::get('app_config')->lifelog->image->large->uploadPath;\n return $this->_imagePath($path);\n }",
"public function getPicturePathAttribute()\n {\n return ($this->banner_image) ? URL::to('storage/app/public/staticpages/'.$this->banner_image) : NULL;\n }",
"public function getImageSrc()\n {\n return sprintf($this->getRelativePath(), $this->image_file_name);\n }",
"abstract public function getImagesPath();",
"public function getPathToImage()\n {\n $path = $this->getPath('origin');\n if(!file_exists($path)){\n $path = false;\n }\n return $path;\n }",
"public function getImageFile()\n {\n return $this->imageFile;\n }",
"public function getAuctionImagePath()\n {\n return $this->auctionImagesPath;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get a Pix receipt. | public function receipt($id)
{
try {
$this->validateGetPixReceiptData([
'id' => $id
]);
return $this->http->get('/pix/' . $id . '/receipt');
} catch (\Exception $e) {
return [
'code' => $e->getCode(),
'response' => $e->getMessage()
];
}
} | [
"function GetPaperRect(){}",
"public function getReceiptReference();",
"public function print_receipt() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_payment_receipt($data);\n }",
"public function receipt()\n {\n return $this->transaction['receipt_url'];\n }",
"public function getReceipt()\n {\n return $this->basket->receipt()->firstOrFail();\n }",
"public function read( &$receipt ) {\n\t\t$receipt->set_defaults();\n\n\t\t$post_object = get_post( $receipt->get_id() );\n\n\t\tif ( ! $receipt->get_id() || ! $post_object || 'pos_host_receipt' !== $post_object->post_type ) {\n\t\t\tthrow new Exception( __( 'Invalid receipt.', 'woocommerce-pos-host' ) );\n\t\t}\n\n\t\t$receipt_id = $receipt->get_id();\n\t\t$receipt->set_props(\n\t\t\tarray(\n\t\t\t\t'name' => $post_object->post_title,\n\t\t\t\t'slug' => $post_object->post_name,\n\t\t\t\t'date_created' => 0 < $post_object->post_date_gmt ? wc_string_to_timestamp( $post_object->post_date_gmt ) : null,\n\t\t\t\t'date_modified' => 0 < $post_object->post_modified_gmt ? wc_string_to_timestamp( $post_object->post_modified_gmt ) : null,\n\t\t\t\t'show_title' => 'yes' === get_post_meta( $receipt_id, 'show_title', true ),\n\t\t\t\t'title_position' => get_post_meta( $receipt_id, 'title_position', true ),\n\t\t\t\t'no_copies' => (int) get_post_meta( $receipt_id, 'no_copies', true ),\n\t\t\t\t'width' => (int) get_post_meta( $receipt_id, 'width', true ),\n\t\t\t\t'type' => get_post_meta( $receipt_id, 'type', true ),\n\t\t\t\t'logo' => get_post_meta( $receipt_id, 'logo', true ),\n\t\t\t\t'logo_position' => get_post_meta( $receipt_id, 'logo_position', true ),\n\t\t\t\t'logo_size' => get_post_meta( $receipt_id, 'logo_size', true ),\n\t\t\t\t'outlet_details_position' => get_post_meta( $receipt_id, 'outlet_details_position', true ),\n\t\t\t\t'show_shop_name' => 'yes' === get_post_meta( $receipt_id, 'show_shop_name', true ),\n\t\t\t\t'show_outlet_name' => 'yes' === get_post_meta( $receipt_id, 'show_outlet_name', true ),\n\t\t\t\t'show_outlet_address' => 'yes' === get_post_meta( $receipt_id, 'show_outlet_address', true ),\n\t\t\t\t'show_outlet_contact_details' => 'yes' === get_post_meta( $receipt_id, 'show_outlet_contact_details', true ),\n\t\t\t\t'social_details_position' => get_post_meta( $receipt_id, 'social_details_position', true ),\n\t\t\t\t'show_social_twitter' => 'yes' === get_post_meta( $receipt_id, 'show_social_twitter', true ),\n\t\t\t\t'show_social_facebook' => 'yes' === get_post_meta( $receipt_id, 'show_social_facebook', true ),\n\t\t\t\t'show_social_instagram' => 'yes' === get_post_meta( $receipt_id, 'show_social_instagram', true ),\n\t\t\t\t'show_social_snapchat' => 'yes' === get_post_meta( $receipt_id, 'show_social_snapchat', true ),\n\t\t\t\t'show_wifi_details' => 'yes' === get_post_meta( $receipt_id, 'show_wifi_details', true ),\n\t\t\t\t'show_tax_number' => 'yes' === get_post_meta( $receipt_id, 'show_tax_number', true ),\n\t\t\t\t'tax_number_label' => get_post_meta( $receipt_id, 'tax_number_label', true ),\n\t\t\t\t'tax_number_position' => get_post_meta( $receipt_id, 'tax_number_position', true ),\n\t\t\t\t'show_order_date' => 'yes' === get_post_meta( $receipt_id, 'show_order_date', true ),\n\t\t\t\t'order_date_format' => get_post_meta( $receipt_id, 'order_date_format', true ),\n\t\t\t\t'order_time_format' => get_post_meta( $receipt_id, 'order_time_format', true ),\n\t\t\t\t'show_customer_name' => 'yes' === get_post_meta( $receipt_id, 'show_customer_name', true ),\n\t\t\t\t'show_customer_email' => 'yes' === get_post_meta( $receipt_id, 'show_customer_email', true ),\n\t\t\t\t'show_customer_phone' => 'yes' === get_post_meta( $receipt_id, 'show_customer_phone', true ),\n\t\t\t\t'show_customer_shipping_address' => 'yes' === get_post_meta( $receipt_id, 'show_customer_shipping_address', true ),\n\t\t\t\t'show_cashier_name' => 'yes' === get_post_meta( $receipt_id, 'show_cashier_name', true ),\n\t\t\t\t'show_register_name' => 'yes' === get_post_meta( $receipt_id, 'show_register_name', true ),\n\t\t\t\t'product_details_layout' => get_post_meta( $receipt_id, 'product_details_layout', true ),\n\t\t\t\t'cashier_name_format' => get_post_meta( $receipt_id, 'cashier_name_format', true ),\n\t\t\t\t'show_product_image' => 'yes' === get_post_meta( $receipt_id, 'show_product_image', true ),\n\t\t\t\t'show_product_sku' => 'yes' === get_post_meta( $receipt_id, 'show_product_sku', true ),\n\t\t\t\t'show_product_cost' => 'yes' === get_post_meta( $receipt_id, 'show_product_cost', true ),\n\t\t\t\t'show_product_discount' => 'yes' === get_post_meta( $receipt_id, 'show_product_discount', true ),\n\t\t\t\t'show_no_items' => 'yes' === get_post_meta( $receipt_id, 'show_no_items', true ),\n\t\t\t\t'show_tax_summary' => 'yes' === get_post_meta( $receipt_id, 'show_tax_summary', true ),\n\t\t\t\t'show_order_barcode' => 'yes' === get_post_meta( $receipt_id, 'show_order_barcode', true ),\n\t\t\t\t'barcode_type' => get_post_meta( $receipt_id, 'barcode_type', true ),\n\t\t\t\t'text_size' => get_post_meta( $receipt_id, 'text_size', true ),\n\t\t\t\t'header_text' => get_post_meta( $receipt_id, 'header_text', true ),\n\t\t\t\t'footer_text' => get_post_meta( $receipt_id, 'footer_text', true ),\n\t\t\t\t'custom_css' => get_post_meta( $receipt_id, 'custom_css', true ),\n\t\t\t)\n\t\t);\n\t\t$receipt->read_meta_data();\n\t\t$receipt->set_object_read( true );\n\t\tdo_action( 'pos_host_receipt_loaded', $receipt );\n\t}",
"public function getReceiptDocflow()\n {\n return $this->get(self::RECEIPTDOCFLOW);\n }",
"public function getPrintImage()\n\t{\n\t\treturn $this->_printImage;\n\t}",
"public function getReceipt()\n {\n $value = $this->get(self::receipt);\n return $value === null ? (integer)$value : $value;\n }",
"public function receipt($receipt = null)\n\t{\n\t\tif (empty($receipt) and !empty($this->lastReceipt)) {\n\t\t\t$receipt = $this->lastReceipt;\n\t\t}\n\n\t\t// Check the receipt is 30 alphanumerical characters\n\t\tif (!preg_match('/[A-Za-z0-9]{30}/', $receipt)) {\n\t\t\tthrow new PushoverException('Receipt string in incorrect format.');\n\t\t}\n\n\t\t$resource = $this->api('GET', sprintf(self::API_RECEIPT_ENDPOINT, $receipt), [\n\t\t\t'query' => [\n\t\t\t\t'token' => $this->params['token'],\n\t\t\t],\n\t\t]);\n\n\t\t$response = json_decode((string) $resource->getBody());\n\n\t\treturn $response;\n\t}",
"public function getReceipt()\n {\n return isset($this->receipt) ? $this->receipt : null;\n }",
"public function getPrintItem()\n {\n return $this->printItem;\n }",
"public function getPic12() {\n return $this->get(self::PIC12);\n }",
"public function receipt()\n {\n return $this->hasOne(Receipt::class, 'message_id');\n }",
"public function getPencil();",
"final public function getImage() {\n\t\t\tif(strlen($this->text) === 0)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$data = $this->getTCPDFBarcode()->getBarcodeArray();\n\t\t\tif($data === false)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$image = new Image($data['maxw'], $data['maxh']);\n\t\t\t\n\t\t\t$x = 0;\n\t\t\tforeach($data['bcode'] as $bar) {\n\t\t\t\tfor($i = 0; $i < $bar['w']; ++$i) {\n\t\t\t\t\tfor($y = 0; $y < $bar['h']; ++$y)\n\t\t\t\t\t\t$image->setPixel($x + $i, $bar['p'] + $y, (int)$bar['t']);\n\t\t\t\t}\n\t\t\t\t$x += $bar['w'];\n\t\t\t}\n\t\t\t\n\t\t\treturn $image;\n\t\t}",
"function GetStipple(){}",
"public function getPic()\n {\n\n $file = DO_spaces::getFile('SEAKA/PROFILE/xtF4eO7htlESuemnbObErsYQ8L5TSpfQu06PjBGu.png');\n return Storage::disk('do_spaces')->response('SEAKA/PROFILE/xtF4eO7htlESuemnbObErsYQ8L5TSpfQu06PjBGu.png');\n\n\n }",
"function wb_get_pixel($source, $xpos, $ypos) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build ajax hash for current (object/node) properties | function getAjaxHash()
{
return self::buildAjaxHash($this->node_type, $this->node_id, $this->obj_type,
$this->obj_id, $this->sub_type, $this->sub_id);
} | [
"private function build_js_data() {\n\n\t\t$types_settings_action = Types_Ajax::get_instance()->get_action_js_name( Types_Ajax::CALLBACK_SETTINGS_ACTION );\n\n\t\treturn array(\n\t\t\t'ajaxInfo' => array(\n\t\t\t\t'fieldAction' => array(\n\t\t\t\t\t'name' => $types_settings_action,\n\t\t\t\t\t'nonce' => wp_create_nonce( $types_settings_action )\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}",
"protected function hashOptions()\n {\n $this->_encodedOptions = Json::encode($this->_options);\n $this->_hashVar = self::WIDGET_NAME . '_' . hash('crc32', $this->_encodedOptions);\n }",
"public function trumansign_ajaxcontenthash() {\r\n\t\techo $this->get_content_hash();\r\n\t\twp_die();\r\n\t}",
"function getHash(){\r\n\r\n\t\t$hash = array();\r\n \r\n\t\t$hash['id'] = $this->id;\r\n\t\t$hash['user_id'] = $this->user_id;\r\n\t\t$hash['username'] = $this->username;\r\n\t\t$hash['gender'] = $this->gender;\r\n\t\t$hash['dob'] = $this->dob;\r\n\t\t$hash['country_id'] = $this->country_id;\r\n\t\t$hash['picture'] = $this->picture;\r\n\t\t$hash['link'] = $this->link;\r\n\t\t$hash['phone'] = $this->phone;\r\n\t\t$hash['likes'] = $this->likes;\r\n\t\t$hash['dislikes'] = $this->dislikes;\r\n\t\t$hash['hobbies'] = $this->hobbies;\r\n\t\t$hash['is_active'] = $this->is_active;\r\n\t\t$hash['created_on'] = $this->created_on;\r\n\t\t$hash['last_modified_on'] = $this->last_modified_on;\r\n\r\n\t\treturn $hash;\r\n\t}",
"protected function build_view_props()\n\t{\n\t\t$g = new stdClass;\n\n\t\t$g->url = $this->_construct_url();\n\t\t$g->width = $this->config['size'];\n\t\t$g->height = $this->config['size'];\n\t\t$g->alt = ( $this->config['alt'] ) ? $this->config['alt'] : '';\n\t\t$g->class = ( $this->config['class'] ) ? $this->config['class'] : '';\n\n\t\treturn $g;\n\t}",
"public function getParamHash ()\r\n\t{\r\n\t\t$hash=\"\";\r\n\t\t$_ignore = Array(\"PHPSESSID\",\"cache\",\"id\",\"smartURL\",\"smartURLParams\",\"smartParam1\",\"smartParam2\",\"smartParam3\",\"smartParam4\",\"smartParam5\",\"smartParam6\",\"smartParam7\",\"smartParam8\",\"smartParam9\",\"smartParam10\",\"smartPATH\");\r\n\t\tforeach ($this->_props AS $k => $v)\r\n\t\t{\r\n\t\t\tif (!in_array($k,$_ignore))\r\n\t\t\t{\r\n\t\t\t\tif (mb_substr($k,0,2)!=\"__\") // Additionally ignore keys starting with \"__\" It's ver unlinkely to have them on purpose, but not ignoring them might diable the include cache when using Google Analytics\r\n\t\t\t\t{\r\n\t\t\t\t\t$hash .= $k.\"#\".$v.\"#\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $hash;\r\n\t}",
"function createHash() \n\t{\n\t\tforeach ($this->_data as $group => $css) \n\t\t{\n\t\t\tif ($group[0] == '_') continue;\n\t\t\t$this->set('hash', md5(json_encode($css)), $group);\n\t\t}\n\t}",
"function __cacheControllerAttrs() {\n\t\t// min, required for /nav/header\n\t\t$controllerAttr = array(\n\t\t\t'name'=>$this->name,\n\t\t\t'alias'=>$this->getControllerAlias(),\n\t\t\t'action'=>$this->action,\n\t\t\t'here'=>$this->here,\n\t\t\t'userid'=>AppController::$userid,\n\t\t\t'isXhr'=>$this->RequestHandler->isAjax(),\t\t\t\n\t\t);\n\t\t$extended_controllerAttr = $extras = array();\t\n\t\tAppController::$uuid = isset($this->passedArgs[0]) ? $this->passedArgs[0] : null;\n\t\tif (in_array($this->name, array('Assets', 'Groups', 'Users', 'Collections', 'Tags', 'Workorders'))) {\n\t\t\t/*\n\t\t\t * sluggable processing. this method requires 2 DB calls. (cached)\n\t\t\t */\n//\t\t\t$slug = isset($this->passedArgs[0]) ? $this->passedArgs[0] : null;\n//\t\t\tAppController::$uuid = $this->__getFromSlug($slug);\n//\t\t\t$this->passedArgs[0] = AppController::$uuid;\n\t\t\t$extended_controllerAttr = array(\n\t\t\t\t// deprecate keyName, use label/displayName instead \n\t\t\t\t'keyName'=>Configure::read(\"lookup.keyName.{$this->name}\"), \n\t\t\t\t'label'=>$this->displayName, \n\t\t\t\t'titleName'=>isset($this->titleName) ? $this->titleName : '',\n//\t\t\t\t'uuid'=>AppController::$uuid, // see ['xhrFrom']['uuid'] or PAGE.jsonData.controller.xhrFrom.uuid\n\t\t\t);\n\t\t}\t\t\t\n\t\t$extras = array( \n\t\t\t'class'=>Inflector::singularize($this->name),\t\t \n\t\t\t// 'label'=>isset($this->displayName) ? $this->displayName : '', \n\t\t\t'isWide'=>!empty($this->params['named']['wide']),\n\t\t);\n\t\tif (!empty($this->params['url']['forcexhr'])) $controllerAttr['isXhr'] = 1; \n\t\t$controllerAttr = array_merge( $controllerAttr , $extended_controllerAttr, $extras);\n\n\t\tif (in_array(AppController::$role, array('EDITOR','MANAGER','ADMIN','ROOT'))) {\n\t\t\tif (!AppController::$ownerid) AppController::$ownerid = AppController::$userid;\n\t\t\t$controllerAttr['userid'] = AppController::$ownerid;\n\t\t\t$controllerAttr['ROLE'] = AppController::$role;\n\t\t} else AppController::$ownerid = AppController::$userid; \t\n\t\tConfigure::write('controller', $controllerAttr);\n\t}",
"public function hash()\n\t{\n\t\t$string = '';\n\t\tforeach(self::$properties as $property)\n\t\t\tif($property == 'time')\n\t\t\t\t$string .= $this->time->format('U');\n\t\t\telseif($property == 'aspects')\n\t\t\t\t$string .= json_encode($this->aspects);\n\t\t\telse\n\t\t\t\t$string .= $this->$property;\n\n\t\treturn md5($string);\n\t}",
"function _json_data() {\n $WidgetWrangler = array();\n $WidgetWrangler['data'] = array(\n 'ajaxURL' => admin_url( 'admin-ajax.php' ),\n 'allWidgets' => $this->ww->get_all_widgets(),\n );\n return json_encode($WidgetWrangler);\n }",
"private function request_prop() {\n\t\t// HTTP method:\n\t\t$this->http_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t$this->prop[$this->http_method] = true;\n\n\t\t// check if this is an AJAX request:\n\t\t$is_ajax = false;\n\t\tif (!is_null($this->params->ajax)) {\n\t\t\t$is_ajax = true;\n\t\t}\n\t\telseif (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {\n\t\t\tif (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n\t\t\t\t$is_ajax = true;\n\t\t\t}\n\t\t}\n\t\t$this->prop['ajax'] = $is_ajax;\n\n\t\t// extract request path:\n\t\tlist($path) = explode('?', $_SERVER['REQUEST_URI'], 2);\n\t\t$script = basename($_SERVER['SCRIPT_NAME']);\n\t\t$path = substr($path, strlen($this->frwk->cfg['BASE_URL']));\n\t\t$path = preg_replace(\"/^\\/$script/\", '', $path);\n\t\t$path = preg_replace('/\\/+/', '/', $path);\n\t\t$this->path = preg_replace('/^\\/|\\/$/', '', $path);\n\t}",
"public function serialize()\n {\n // Get serialized data from Meta\n $serialized = parent::serialize();\n\n $serialized->recursiveTopLevelResourceProp = $this->recursiveTopLevelResourceProp->serialize();\n\n $serialized->stringProp = $this->stringProp;\n\n $serialized->topLevelCollectionProp = $this->topLevelCollectionProp->serialize();\n\n return $serialized;\n }",
"public function jsParams() {\n\t\tglobal $SITEURL;\n\t\t$s=\"{\";\n\t\tif( !empty($this->_userID) ) { $s.=\"userID:'\".$this->_userID.\"',\"; } \n\n \n $d=\"\";\n\t\t//if( !empty($this->_displayCaption) ) { $s.=\"'displayCaption':\".$this->_displayCaption.\",\"; }\n\t\tif( !empty($this->_displayCaption) ) { $d.=\"display:\".$this->_displayCaption.\",\"; }\n\t\tif( !empty($this->_displayDescription) ) { $d.=\"displayDescription:\".$this->_displayDescription.\",\"; }\n\n\t\tif( !empty($this->_thumbnailLabelPosition) ) {\n $d.=\"position:'\".$this->_thumbnailLabelPosition.\"',\";\n\t\t\t// if( !empty($this->_displayCaption) ) {\n\t\t\t\t// $s.=\"'thumbnailLabel':{'position':'\".$this->_thumbnailLabelPosition.\"','display':\".$this->_displayCaption.\"},\";\n\t\t\t// }\n\t\t\t// else {\n\t\t\t\t// $s.=\"'thumbnailLabel':{'position':'\".$this->_thumbnailLabelPosition.\"'},\";\n\t\t\t// }\n\t\t}\n\t\t// else {\n\t\t\t// if( !empty($this->_displayCaption) ) {\n\t\t\t\t// $s.=\"'thumbnailLabel':{'display':\".$this->_displayCaption.\"},\";\n\t\t\t// }\n\t\t// }\n \n if( !empty($d) ) {\n $d=substr($d,0,strlen($d)-1);\n $s.=\"'thumbnailLabel':{\".$d.\"},\";\n }\n\n\t\tif( !empty($this->_thumbnailHoverEffect) ) { $s.=\"'thumbnailHoverEffect':'\".$this->_thumbnailHoverEffect.\"',\"; } \n\t\tif( !empty($this->_viewer) ) { $s.=\"'viewer':'\".$this->_viewer.\"',\"; } \n\t\tif( !empty($this->_colorScheme) ) { $s.=\"'colorScheme':'\".$this->_colorScheme.\"',\"; } \n\t\tif( !empty($this->_colorSchemeViewer) ) { $s.=\"'colorSchemeViewer':'\".$this->_colorSchemeViewer.\"',\"; } \n\t\t// if( !empty($this->_thumbnailHeight) ) { $s.=\"'thumbnailHeight':'\".$this->_thumbnailHeight.\"',\"; } \n\t\tif( !empty($this->_thumbnailHeight) ) {\n if( $this->_thumbnailHeight == 'auto' ) {\n $s.=\"'thumbnailHeight':'\".$this->_thumbnailHeight.\"',\";\n }\n else {\n $s.=\"'thumbnailHeight':\".$this->_thumbnailHeight.\",\";\n }\n }\n\t\tif( !empty($this->_thumbnailWidth) ) {\n if( $this->_thumbnailWidth == 'auto' ) {\n $s.=\"'thumbnailWidth':'\".$this->_thumbnailWidth.\"',\";\n }\n else {\n $s.=\"'thumbnailWidth':\".$this->_thumbnailWidth.\",\";\n }\n } \n\t\tif( !empty($this->_blackList) ) { $s.=\"'blackList':'\".$this->_blackList.\"',\"; } \n\t\tif( !empty($this->_whiteList) ) { $s.=\"'whiteList':'\".$this->_whiteList.\"',\"; } \n\t\tif( !empty($this->_kind) ) { $s.=\"'kind':'\".$this->_kind.\"',\"; } \n\t\tif( !empty($this->_theme) ) { $s.=\"'theme':'\".$this->_theme.\"',\"; } \n\t\tif( !empty($this->_displayBreadcrumb) ) { $s.=\"'displayBreadcrumb':\".$this->_displayBreadcrumb.\",\"; } \n\t\tif( !empty($this->_album) ) { $s.=\"'album':'\".$this->_album.\"',\"; } \n\t\tif( !empty($this->_photoset) ) { $s.=\"'photoset':'\".$this->_photoset.\"',\"; } \n\t\tif( !empty($this->_maxItemsPerLine) ) { $s.=\"'maxItemsPerLine':'\".$this->_maxItemsPerLine.\"',\"; } \n\t\tif( !empty($this->_maxWidth) ) { $s.=\"'maxWidth':'\".$this->_maxWidth.\"',\"; } \n\t\t\n\t\tif ( strlen($s) == 1 ) { return \"\"; }\n\t\t\n\t\t$s.=\"'pluginURL':'\".$SITEURL.\"/plugins/nanogallery3',\";\n\t\t\n\t\t$s=substr($s,0,strlen($s)-1).\"}\";\n\t\treturn $s;\n\t}",
"protected function _addHashInfo(&$result)\n {\n $currentHash = Mage::getSingleton('ecomdev_checkitout/hash')->getHash(\n $this->getOnepage()->getQuote()\n );\n $result['stepHash'] = $currentHash;\n\n foreach ($currentHash as $key => $value) {\n if (isset($result['goto_section'])\n && $result['goto_section'] === $key\n && isset($result['update_section'])) {\n $result['stepHtml'][$key] = $result['update_section']['html'];\n unset($result['update_section']);\n unset($result['goto_section']);\n } elseif (isset($this->_hashInfoBeforeSave[$key])\n && $value !== $this->_hashInfoBeforeSave[$key]) {\n $result['stepHtml'][$key] = $this->_getHandleStepHtml($key);\n } elseif (isset($this->_hashInfoBeforeSave[$key])) {\n $result['stepHtml'][$key] = false;\n }\n }\n\n\n return $this;\n }",
"public function generateHash()\n {\n $hash = '';\n $dontHash = $this->dontHash();\n\n $vars = get_object_vars($this);\n foreach ($vars as $name => $member) {\n\n if (in_array($name, $dontHash) || in_array($name, $this->reservedHash)) {\n continue;\n }\n\n if ($member instanceof HashableModel) {\n $hash .= $member->generateHash();\n } elseif (is_scalar($member)) {\n $hash .= (string)$member;\n } elseif (is_null($member)) {\n continue;\n } else {\n $hash .= serialize($member);\n }\n }\n\n return md5($hash);\n }",
"public function __toString () {\n \n $data = array();\n \n // Only add property accessible\n foreach ($this->accessible as $key) {\n $data[$key] = $this->$key;\n }\n \n return json_encode($data);\n }",
"public function serializeProperties()\n {\n }",
"function property_element_ajax_build($entity_type, $entity, $name, $form_id, $widget = NULL, $options = array()) {\n $ajax = array(\n 'callback' => 'property_ajax_process',\n //@todo evaluate the type of property, widget to define which event to set\n 'event' => '',\n 'effect' => !empty($options['effect']) ? $options['effect'] : 'fade',\n 'method' => 'replace',\n //@todo add property_element_get_ajax_wrapper() function.\n 'wrapper' => '',\n //@todo add ajax progress\n );\n\n return $ajax;\n}",
"function dumpJavascript()\r\n {\r\n parent::dumpJavascript();\r\n\r\n $this->dumpJSEvent($this->_jsonchange);\r\n $this->dumpJSEvent($this->_jsonerror);\r\n\r\n //Component identifier for use in watchPosition function\r\n echo $result = \"var \" . $this->Name . \"_ID = null;\\n\";\r\n\r\n $this->DumpJSFunctions($this->getjsOptions());\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation listCouponsByCouponCampaignDeprecatedAsync List Coupons [DEPRECATED] | public function listCouponsByCouponCampaignDeprecatedAsync($couponCampaignId, $paginationLimit = null, $paginationOffset = null, $paginationFilterField = null, $paginationFilterValue = null, $paginationFilterOperator = null, $paginationOrderBy = null, $paginationOrderAsc = null)
{
return $this->listCouponsByCouponCampaignDeprecatedAsyncWithHttpInfo($couponCampaignId, $paginationLimit, $paginationOffset, $paginationFilterField, $paginationFilterValue, $paginationFilterOperator, $paginationOrderBy, $paginationOrderAsc)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function listCouponsByCouponCampaignDeprecated($couponCampaignId, $paginationLimit = null, $paginationOffset = null, $paginationFilterField = null, $paginationFilterValue = null, $paginationFilterOperator = null, $paginationOrderBy = null, $paginationOrderAsc = null)\n {\n list($response) = $this->listCouponsByCouponCampaignDeprecatedWithHttpInfo($couponCampaignId, $paginationLimit, $paginationOffset, $paginationFilterField, $paginationFilterValue, $paginationFilterOperator, $paginationOrderBy, $paginationOrderAsc);\n return $response;\n }",
"public function countCouponsByCouponCampaignDeprecatedAsync($couponCampaignId, $paginationLimit = null, $paginationOffset = null, $paginationFilterField = null, $paginationFilterValue = null, $paginationFilterOperator = null, $paginationOrderBy = null, $paginationOrderAsc = null)\n {\n return $this->countCouponsByCouponCampaignDeprecatedAsyncWithHttpInfo($couponCampaignId, $paginationLimit, $paginationOffset, $paginationFilterField, $paginationFilterValue, $paginationFilterOperator, $paginationOrderBy, $paginationOrderAsc)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getCoupons(): array\n {\n return $this->coupons;\n }",
"public function listCouponsByCouponCampaignDeprecatedWithHttpInfo($couponCampaignId, $paginationLimit = null, $paginationOffset = null, $paginationFilterField = null, $paginationFilterValue = null, $paginationFilterOperator = null, $paginationOrderBy = null, $paginationOrderAsc = null)\n {\n $returnType = 'object';\n $request = $this->listCouponsByCouponCampaignDeprecatedRequest($couponCampaignId, $paginationLimit, $paginationOffset, $paginationFilterField, $paginationFilterValue, $paginationFilterOperator, $paginationOrderBy, $paginationOrderAsc);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 0:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PkIo\\Model\\RuntimeError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getCoupons()\n {\n return $this->coupons;\n }",
"protected function listCouponsByCouponCampaignDeprecatedRequest($couponCampaignId, $paginationLimit = null, $paginationOffset = null, $paginationFilterField = null, $paginationFilterValue = null, $paginationFilterOperator = null, $paginationOrderBy = null, $paginationOrderAsc = null)\n {\n // verify the required parameter 'couponCampaignId' is set\n if ($couponCampaignId === null || (is_array($couponCampaignId) && count($couponCampaignId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $couponCampaignId when calling listCouponsByCouponCampaignDeprecated'\n );\n }\n\n $resourcePath = '/coupon/singleUse/coupons/{couponCampaignId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($paginationLimit !== null) {\n $queryParams['pagination.limit'] = ObjectSerializer::toQueryValue($paginationLimit);\n }\n // query params\n if ($paginationOffset !== null) {\n $queryParams['pagination.offset'] = ObjectSerializer::toQueryValue($paginationOffset);\n }\n // query params\n if (is_array($paginationFilterField)) {\n $paginationFilterField = ObjectSerializer::serializeCollection($paginationFilterField, 'multi', true);\n }\n if ($paginationFilterField !== null) {\n $queryParams['pagination.filterField'] = ObjectSerializer::toQueryValue($paginationFilterField);\n }\n // query params\n if (is_array($paginationFilterValue)) {\n $paginationFilterValue = ObjectSerializer::serializeCollection($paginationFilterValue, 'multi', true);\n }\n if ($paginationFilterValue !== null) {\n $queryParams['pagination.filterValue'] = ObjectSerializer::toQueryValue($paginationFilterValue);\n }\n // query params\n if (is_array($paginationFilterOperator)) {\n $paginationFilterOperator = ObjectSerializer::serializeCollection($paginationFilterOperator, 'multi', true);\n }\n if ($paginationFilterOperator !== null) {\n $queryParams['pagination.filterOperator'] = ObjectSerializer::toQueryValue($paginationFilterOperator);\n }\n // query params\n if ($paginationOrderBy !== null) {\n $queryParams['pagination.orderBy'] = ObjectSerializer::toQueryValue($paginationOrderBy);\n }\n // query params\n if ($paginationOrderAsc !== null) {\n $queryParams['pagination.orderAsc'] = ObjectSerializer::toQueryValue($paginationOrderAsc);\n }\n\n // path params\n if ($couponCampaignId !== null) {\n $resourcePath = str_replace(\n '{' . 'couponCampaignId' . '}',\n ObjectSerializer::toPathValue($couponCampaignId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function fetchCoupons()\n {\n return $this->fetch(self::ENDPOINT_COUPON);\n }",
"public function viewAllCoupons() {\n return $this->db->get_where('wrh_coupon', array('is_deleted' => 0))->result_array();\n }",
"public function listCouponCampaignsDeprecatedWithHttpInfo($limit = null, $offset = null, $filterField = null, $filterValue = null, $filterOperator = null, $orderBy = null, $orderAsc = null)\n {\n $returnType = 'object';\n $request = $this->listCouponCampaignsDeprecatedRequest($limit, $offset, $filterField, $filterValue, $filterOperator, $orderBy, $orderAsc);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 0:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PkIo\\Model\\RuntimeError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getAvailableCouponsAt($offset)\n {\n return $this->get(self::available_coupons, $offset);\n }",
"public function appendAvailableCoupons(\\service\\message\\common\\Coupon $value)\n {\n return $this->append(self::available_coupons, $value);\n }",
"function getCoupons()\r\n {\r\n // TODO Attempt to set this if it is empty\r\n if(@$this->_coupons)\r\n return $this->_coupons;\r\n else\r\n return array();\r\n }",
"public function listSubscriptionCouponCampaigns($criteria, $offset, $limit)\n {\n $distributorToken = $this->getDistributorToken();\n if (!$distributorToken) {\n throw new Cleeng_Exception_RuntimeException(\"Cannot call \" . __FUNCTION__ . \": setDistributorToken must be used first.\");\n }\n\n $collection = new Cleeng_Entity_Collection('Cleeng_Entity_ListSubscriptionCouponCampaign');\n\n return $this->api(\n 'listSubscriptionCouponCampaigns',\n array(\n 'distributorToken' => $distributorToken,\n 'criteria' => $criteria,\n 'offset' => $offset,\n 'limit' => $limit\n ),\n $collection\n );\n }",
"public function appendAvailableCoupons(\\message\\common\\Coupon $value)\n {\n return $this->append(self::available_coupons, $value);\n }",
"function coupon_do_list_shortcode() {\n\t\n\t$coupons = wp_coupon_get_coupons();\n\tif ( $coupons && is_array( $coupons ) && count( $coupons ) > 0 ) {\n\t\t\n\t\t$r = \"<ul class=\\\"couponlist\\\">\\n\";\n\t\t\n\t\tforeach( $coupons as $coupon ) {\n\t\t\n\t\t\t$r .= '<li><a href=\"' . wp_coupon_link( $coupon->guid ) . '\">' . htmlspecialchars( $coupon->name ) . '</a></li>';\n\t\t\n\t\t}\n\t\t\n\t\t$r .= '</ul>';\n\t\t\n\t\treturn $r;\n\t}\n\t\n}",
"public function get_coupons()\n {\n return $this->__ws_call('get_coupons', Array(\n \n ));\n }",
"public function coupons()\n {\n return $this->belongsToMany(Coupon::class)->withPivot('used_at');\n }",
"function getCouponCategoryList()\n\t\t{\n\t\t\t$coupons = $this->manageContent->getValue(\"coupon_category\",\"*\");\n\t\t\tforeach($coupons as $coupon)\n\t\t\t{\n\t\t\t\tif($coupon['status'] == 1)\n\t\t\t\t{\n\t\t\t\t\t$status = 'Yes';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$status = 'No';\n\t\t\t\t}\n\t\t\t\techo '<tr>\n\t\t\t\t\t <td>'.$coupon['category'].'</td>\n\t\t\t\t\t <td>'.$this->changeDateFormat($coupon['date']).'</td>\n\t\t\t\t\t <td>'.$status.'</td>\n\t\t\t\t\t <td><a href=\"editCouponCategory.php?c_id='.$coupon['id'].'\">\n\t\t\t\t\t <button class=\"btn btn-warning\" type=\"button\">\n\t\t\t\t\t\t\t<span class=\"icon-pencil\"></span> EDIT</button></a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td><a href=\"v-includes/functions/function.deleteCouponCategory.php?c_id='.$coupon['id'].'\">\n\t\t\t\t\t<button class=\" btn btn-danger\" type=\"button\">\n\t\t\t\t\t\t<span class=\" icon-trash\"></span> DELETE</button></a>\n\t\t\t\t\t</td></tr/>';\n\t\t\t\t\n\t\t\t}\n\t\t}",
"public static function get_all_coupon(){\n return Coupon::where('deleted_at' , '=' , NULL)->orderBy('created_at' , 'DESC')->paginate(10);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getTestWebhookPayloadNewContact Get webhook test payload for new contact event. | public function testGetTestWebhookPayloadNewContact()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
} | [
"public function testContactSubmission()\n {\n $response = $this->json('POST', '/contact', ['name' => 'Sally', 'email' => 'test@test.com', 'number' => '123456789', 'message' => 'A test message']);\n\n $response->assertStatus(200);\n }",
"public function test_create_webhook_custom_action() {\n\n\t\t$data = array(\n\t\t\t'llms_rest_webhook_nonce' => wp_create_nonce( 'create-update-webhook' ),\n\t\t\t'llms_rest_webhook_name' => 'Webhook Name',\n\t\t\t'llms_rest_webhook_topic' => 'action',\n\t\t\t'llms_rest_webhook_secret' => 'myawesomesecret',\n\t\t\t'llms_rest_webhook_delivery_url' => 'https://mock.tld',\n\t\t\t'llms_rest_webhook_status' => 'active',\n\t\t);\n\n\t\t$this->mockPostRequest( $data );\n\t\t$ret = $this->obj->handle_events();\n\t\t$this->assertIsWPError( $ret );\n\t\t$this->assertWPErrorCodeEquals( 'llms_rest_webhook_invalid_topic', $ret );\n\n\t\t$data['llms_rest_webhook_action'] = 'mock';\n\t\t$this->mockPostRequest( $data );\n\n\t\t$this->expectException( LLMS_Unit_Test_Exception_Redirect::class );\n\t\t$this->expectExceptionMessage( 'http://example.org/wp-admin/admin.php?page=llms-settings&tab=rest-api§ion=webhooks&edit-webhook=1 [301] YES' );\n\n\t\ttry {\n\t\t\t$this->obj->handle_events();\n\t\t} catch ( LLMS_Unit_Test_Exception_Redirect $exception ) {\n\n\t\t\t$hook = LLMS_REST_API()->webhooks()->get( 1 );\n\n\t\t\t$this->assertEquals( 'action.mock', $hook->get( 'topic' ) );\n\n\t\t\tthrow $exception;\n\n\t\t}\n\n\t}",
"public function testPutContactCustomFields()\n {\n }",
"public function testWebhookCreate()\n {\n }",
"public function testGetContact()\n {\n $client = $this->getMockClient('getContact.json');\n $contact = $client->getContact(1373034);\n\n $this->assertInstanceOf('\\CultuurNet\\ProjectAanvraag\\Insightly\\Item\\Contact', $contact, 'It correctly returns an Insightly contact');\n $this->assertEquals('my-id', $contact->getId());\n $this->assertEquals('my-first-name', $contact->getFirstName());\n $this->assertEquals('my-last-name', $contact->getLastName());\n }",
"public function testSubscribeNewContact() {\n $list = ['id' => 'a1234', 'name' => 'mocknewsletters'];\n $list_o = NewsletterList::fromData([\n 'identifier' => $list['id'],\n 'title' => $list['name'],\n 'source' => 'MailChimp-testname',\n 'data' => (object) ($list + ['merge_vars' => []]),\n ]);\n list($api, $provider) = $this->mockChimp(['put']);\n $item = new QueueItem([\n 'email' => 'test@example.com',\n 'args' => ['send_optin' => FALSE],\n 'data' => [\n 'merge_fields' => ['FNAME' => 'Test', 'LNAME' => 'Test'],\n 'interests' => [],\n ],\n ]);\n $post_data = [\n 'email_address' => 'test@example.com',\n 'status' => 'subscribed',\n 'merge_fields' => (object) ['FNAME' => 'Test', 'LNAME' => 'Test'],\n 'interests' => (object) [],\n ];\n $api->expects($this->once())->method('put')\n ->with($this->anything(), $this->anything(), $post_data, $this->anything());\n $provider->subscribe($list_o, $item);\n }",
"public function testGetTestWebhookPayloadForWebhook()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testCreateContactUsingPost()\n {\n }",
"public function test_update_webhook_custom_action() {\n\n\t\t$hook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://mock.com',\n\t\t\t'topic' => 'course.created',\n\t\t) );\n\n\t\t$data = array(\n\t\t\t'llms_rest_webhook_nonce' => wp_create_nonce( 'create-update-webhook' ),\n\t\t\t'llms_rest_webhook_id' => $hook->get( 'id' ),\n\n\t\t\t'llms_rest_webhook_topic' => 'action',\n\t\t);\n\n\t\t$this->mockPostRequest( $data );\n\t\t$ret = $this->obj->handle_events();\n\t\t$this->assertIsWPError( $ret );\n\t\t$this->assertWPErrorCodeEquals( 'llms_rest_webhook_invalid_topic', $ret );\n\n\t\t$data['llms_rest_webhook_action'] = 'mock';\n\t\t$this->mockPostRequest( $data );\n\n\t\t$this->obj->handle_events();\n\n\t\t$hook = LLMS_REST_API()->webhooks()->get( $hook->get( 'id' ) );\n\n\t\t$this->assertEquals( 'action.mock', $hook->get( 'topic' ) );\n\n\t}",
"public function testSendContact()\n {\n }",
"public function testCreateContact()\n {\n $name = 'Test Contact';\n $email = 'test@test.com';\n\n $client = new ClinchPadClient('api-key');\n $resource = new ClinchPadContacts($client);\n $resource->createContact($name, $email);\n\n $this->assertEquals('POST', $client->getClient()->method);\n $this->assertEquals($client->getEndpoint() . '/contacts', $client->getClient()->uri);\n\n $this->assertNotEmpty($client->getClient()->options['json']);\n\n $request_body = $client->getClient()->options['json'];\n\n $this->assertEquals($name, $request_body->name);\n }",
"public function testCreateWebhookForPhoneNumber()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testStoreSuccess()\n {\n $input = factory(Contacts::class)->make();\n $this->contactService->shouldReceive('store')->once()->with($input);\n $this->app->instance('Contact',$this->contact);\n $response=$this->post(route('contact_store'),$input->toArray());\n\n $response->assertRedirect(route('contact_index'));\n\n\n }",
"public function testPfsWebhookPost()\n {\n }",
"public function test_insert_contact_form_data()\n {\n $id = (new SeedRandom())->userSeedRuin();\n $contact = factory(Contact::class)->create([\n 'id' => $id, \n 'posted_at' => Carbon::now(),\n 'ip' => request()->ip(), \n ]);\n\n $this->assertDatabaseHas('contacts', [\n 'id' => $id,\n 'name' => 'Contact Testing',\n 'email' => 'moviet@simply-interact.com',\n 'division' => 'Customer Service',\n 'token' => 'abcdefgh-ijkl-yayayay-yayaya',\n 'message' => 'Helloow, This is just test',\n 'posted_at' => Carbon::now(),\n 'ip' => request()->ip(), \n ]);\n }",
"public function testCreateWebhook()\n {\n }",
"public function testAddressBookInsertContact()\n {\n }",
"function onValidateContact(&$contact, &$data) {\n $session = JFactory::getSession();\n $submit_time = $this->submit_time_test();\n\n $checkjs = $this->get_ct_checkjs();\n\n $sender_info = $this->get_sender_info();\n $sender_info = json_encode($sender_info);\n if ($sender_info === false) {\n $sender_info = '';\n }\n\n $ver = new JVersion();\n // Converts $data Array into an Object\n $obj = new JObject($data);\n // sets 'sender_email' ONLY if not already set. Also checks to see if 'email' was not provided instead\n $obj->def('sender_email',$obj->get('email',$obj->get('contact_email',null)));\n // sets 'sender_nickname' ONLY if not already set. Also checks to see if 'name' was not provided instead\n $obj->def('sender_nickname',$obj->get('name',$obj->get('contact_name',null)));\n // sets 'message' ONLY if not already set. Also checks to see if 'comment' was not provided instead\n $obj->def('subject',$obj->get('subject',$obj->get('contact_subject',null)));\n // sets 'message' ONLY if not already set. Also checks to see if 'comment' was not provided instead\n $obj->def('message',$obj->get('text',$obj->get('contact_message',null)));\n\n if (strcmp($ver->RELEASE, '1.5') <= 0) { // 1.5 and lower\n $sendAlarm = TRUE;\n }\n\n $post_info['comment_type'] = 'feedback';\n $post_info = json_encode($post_info);\n if ($post_info === false)\n $post_info = '';\n\n self::getCleantalk();\n $ctResponse = self::ctSendRequest(\n 'check_message', array(\n 'example' => null,\n 'sender_nickname' => $obj->get('sender_nickname'),\n 'sender_email' => $obj->get('sender_email'),\n 'sender_ip' => self::$CT->ct_session_ip($_SERVER['REMOTE_ADDR']),\n 'message' => $obj->get('subject') . \"\\n\" . $obj->get('message'),\n 'js_on' => $checkjs,\n 'submit_time' => $submit_time,\n 'post_info' => $post_info,\n 'sender_info' => $sender_info,\n )\n );\n \n $app = JFactory::getApplication();\n if (!empty($ctResponse) && is_array($ctResponse)) {\n if ($ctResponse['errno'] != 0) {\n $this->sendAdminEmail(\"CleanTalk. Can't verify feedback message!\", $ctResponse['comment']);\n } else {\n if ($ctResponse['allow'] == 0) {\n $session->set($this->form_load_label, time()); // update session 'formtime'\n $res_str = $ctResponse['comment'];\n $app->setUserState('com_contact.contact.data', $data); // not used in 1.5 :(\n $stub = JRequest::getString('id');\n // Redirect back to the contact form.\n // see http://docs.joomla.org/JApplication::redirect/11.1 - what does last param mean?\n // but it works! AZ\n $app->redirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false), $res_str, 'warning');\n return new Exception($res_str); // $res_str not used in com_contact code - see source :(\n }\n }\n }\n $session->clear($this->form_load_label); // clear session 'formtime'\n }",
"public function testClientAddContactLog()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Persiste el RequestKey en la DB | private function _persistRequestKey($order_id, $request_key){
update_post_meta( $order_id, 'request_key', $request_key);
} | [
"public function employee_key_store(EmployeeKeyRequest $request)\n {\n $key_id = $request->get('key_id');\n $employee_id = $request->get('employee_id');\n $employee = Employee::findOrFail($employee_id);\n $employee->keys()->attach($key_id);\n\n return response()->json([\n 'message' => 'Ключ сотрудника создан!'\n ]);\n }",
"public function store(Request $request, Key $key)\n {\n $this->authorize('update', $key);\n\n $key->used = true;\n $key->save();\n\n return response()->json([\n 'value' => $key->used\n ]);\n }",
"public function addKey(Request $request, $id) {\n $propertyId = $request->Input('property_id');\n $pin = $request->Input('pin');\n\n $contractor = User::find($id);\n\n $key = new Key();\n\n $key->pin = $pin;\n $key->user_id = $id;\n $key->property_id = $propertyId;\n $key->taken_at = \"0000-00-00 00:00:00\";\n $key->returned_at = \"0000-00-00 00:00:00\";\n\n $key->save();\n\n return Redirect::route('contractors.show', $id);\n }",
"public function save()\r\n {\r\n // Serialize request and save to session '_REQ'\r\n Session::set('_REQ', serialize($this));\r\n }",
"public function setPushKey(Request $request){\n if( $request->ajax() && $request->has('key') ){\n $postPushKey = \\App\\Utils\\HttpRequestUtil::getInstance()\n ->post_data('set_push_key',[\n 'token' => Session::get('user')->token,\n 'client' => 3,\n 'key' => $request->input('key')\n ],\n $this->app->app_app_secret); \n $responsePushKey = json_decode($postPushKey);\n \n if( $responsePushKey->code == 1000 ){\n Session::put('setpushkey', true );\n return response()->json(['msg' => 'Set push key success' ]);\n }\n }\n \n }",
"public function createUserKey(Request $request){\n return $this->createNewApiKey(true); \n }",
"public function createKey($name){\n $this->name=$name;\n\t\t\n //in case the form has an already saved key then save it\n if(session_class::exists($this->name))\n\t\t\t$this->old_key = session_class::get($this->name);\n\t\t\n\t\t// generate the key and save it to a session\n $this->current_key=md5($_SERVER['REMOTE_ADDR'].mt_rand());\t\n $_SESSION[$this->name] = $this->current_key;\n }",
"public function storeCacheKey();",
"public static function addKey(){\r\n $ra = (time())*(rand());\r\n @ $conn = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASSWORD,MYSQL_DATABASE_NAME); //Conn to database\r\n $query = \"insert into ke values (NULL,sha1(\".$ra.\"))\";\r\n $result = $conn->query($query);\r\n $conn->close();//close database conn\r\n }",
"public function save() {\n\n if (empty($this->life)) {\n $this->life = self::DEFAULT_SHARE_KEY_LIFE;\n } else {\n $this->life = max(min($this->life, self::MAX_SHARE_KEY_LIFE), 0);\n }\n $this->expires = time() + ($this->life * 60 * 60);\n if (empty($this->id)) {\n if (empty($this->length) || !is_numeric($this->length)) {\n $this->length = self::MAX_SHARE_KEY_LENGTH;\n } else {\n $this->length = max(min($this->length, self::MAX_SHARE_KEY_LENGTH), self::MIN_SHARE_KEY_LENGTH);\n }\n $this->id = LTI_Data_Connector::getRandomString($this->length);\n }\n\n return $this->data_connector->Resource_Link_Share_Key_save($this);\n\n }",
"public function create() {\n\t\t$key = $this->check_new_key();\n\t\tif ($key) {\n\t\t\t$stmt = $this->dbpdo->prepare('INSERT INTO `users` VALUES (null, :new_key);');\n\t $stmt->bindParam(':new_key', $key, PDO::PARAM_INT);\n\n\t\t\tif ($stmt->execute()) {\n\t\t\t\t$this->u_key = $key;\n\t\t\t\treturn $this->u_key;\n\t\t\t} else {\n\t\t\t\techo $this->generateError(201);\n\t\t\t\texit();\n\t\t\t}\n\t\t} else {\n\t\t\techo $this->generateError(201);\n\t\t\texit();\n\t\t}\n\t}",
"function AddKey($key)\n {\n $this->CleanUp();\n $ip = $_SERVER[\"REMOTE_ADDR\"];\n $dbargs['keys_key'] = $key;\n $dbargs['keys_ip'] = $ip;\n $dbargs['keys_time'] = date('Y-m-d H:i');\n $this->Insert($dbargs);\n $id = $this->QueryKey(\"keys_key = '$key' AND keys_ip = '$ip'\");\n return($id);\n }",
"abstract protected function generateRequestCacheKey(): string;",
"public function store(Request $request)\n {\n try {\n $data = $this->getData($request);\n\n NameserverTsigkey::create($data);\n\n return redirect()->route('nameserver_tsigkeys.nameserver_tsigkey.index')->with('success_message', 'Nameserver Tsigkey was successfully added!');\n } catch (Exception $exception) {\n return back()->withInput()->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request!']);\n }\n }",
"function setFormKey($key);",
"function set_key($key)\r\r\n\t{\r\r\n\r\r\n\t\t$data['uploadify_key'] = $key;\r\r\n\r\r\n\t\t$this->db->where('id', 1);\r\r\n\t\t$this->db->update('settings', $data);\r\r\n\r\r\n\t}",
"function save($key) {\n\t\t$referer = PHP::getServerParameter('HTTP_REFERER');\n\t\t$y = parse_url($referer);\n\t\tSession::setAttribute(_FORM_REMINDER_SESSION . $key, array($this, $y['path']));\n\t}",
"public function save()\n {\n // ensure autheticated user is loaded\n if ($this->isAuthenticated()) {\n // get from session\n foreach($this->getPersistKeys() as $key) {\n $this->Session->$key = $this->$key;\n }\n }\n parent::save();\n }",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get The Whole Discount Percentage | public function discountPercentage()
{
$total = $this->totalActualPrice();
$discount = $total - $this->totalNetPrice();
$discount_pct = ($discount / $total) * 100;
return $discount_pct;
} | [
"function getDiscountPercent() ;",
"public function getDiscountPercent();",
"public function getPercentageDiscount();",
"public function getDiscountPercent(): float;",
"public function getPercentage();",
"public function getDiscountPercentage() {\n return $this->discountPercentage;\n }",
"public function percent() {\n return $this->percent_off / 100;\n }",
"public function getPercent()\r\n {\r\n// $denominator = TaskItem::find()->where(['task_id' => $this->id])->count();\r\n $denominator = $this->getItems()->count();\r\n // add STATUS_IN_PROGRESS and STATUS_COMPLETED\r\n $denominator += 2;\r\n // handle special status STATUS_PENDING_REVIEW\r\n if ($this->review) {\r\n $denominator += 1;\r\n }\r\n if ($denominator == 0)\r\n return 0;\r\n\r\n\r\n $counter = $this->getConfirmedCount();\r\n if (self::isInProgress())\r\n $counter += 1;\r\n elseif (self::isCompleted() && !$this->review)\r\n $counter += 2;\r\n elseif (self::isPendingReview() && $this->review)\r\n $counter += 2;\r\n elseif (self::isCompleted() && $this->review)\r\n $counter += 3;\r\n\r\n return $counter / $denominator * 100;\r\n }",
"public function percent()\n\t{\n\t\t$total = $this->num2 * 100 / $this->num1;\n\t\treturn $total;\n\t}",
"public function getAllDistractingPercentage()\n {\n return $this->all_distracting_percentage;\n }",
"public function getFillingPercentage();",
"private function get_discount_percentage() : float {\n\t\tpreg_match( '/runParams\\.discount=\"(.*?)\";/si', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn floatval( $matches[1] );\n\t}",
"public function getPricePercentPerItem();",
"public function getPercentageRate()\n {\n return 0;\n }",
"public function getPercentage()\n {\n return $this->percentage;\n }",
"public function getMaximumDiscountPercent();",
"public function get_percentage() {\n $id = intval($this->get_post_value('user_id'));\n\t $nasabah = $this->db->get_where('nasabah', array(\n\t 'user_id' => $id\n\t ))->row_array();\n\t $noAnggota = $nasabah['no_anggota'];\n\t $investor = $this->db->get_where('investor', array(\n\t 'no_anggota' => $noAnggota\n\t ))->row_array();\n\t $modal = intval($investor['porsi_modal']);\n $cmd = \"SUM(porsi_modal)\";\n\t $totalModal = intval($this->db->query(\"SELECT \" . $cmd . \" FROM investor\")->row_array()[$cmd]);\n\t //echo \"\" . $modal . \",\" . $totalModal;\n\t echo intval($modal*100/$totalModal);\n\t}",
"public function getPercentCovered()\n {\n $this->_process();\n return round(($this->getCoveredLineCount() / $this->getLineCount()) * 100, 2);\n }",
"function getPercentage()\n\t{\n\t\treturn $this->percentage;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all reactions on a published experience. | function getReactions() {
$experienceId = $_POST['id'];
if (!is_numeric($experienceId)) {
return printResult([],405,'Not allowed call: Invalid request value for id: ' . $experienceId);
}
printResult(dbgetReactions($experienceId), 200);
} | [
"public function getReactions(){\n\t\t\t\n\t\t\t// LOGIC\n\t\t\t\n\t\t\t// load the document\t\t\t\n\t\t\t$htmlfile = $this->getDomDoc(); \t\t\t\n\t\t\t// find the approptiate nodes\n\t\t\t$xpath = new DOMXPath($htmlfile);\n\t\t\t$nodes = $xpath->query(\"//*[@class='reactie']|//*[@class='reactie ownreply']\");\n\t\t\t\n\t\t\t// here will we store the result\n\t\t\t$results = Array();\n\t\t\t// loop over reactions\n\t\t\tforeach ($nodes as $item) {\n\t\t\t\t// create an xpath so that querys can be run\n\t\t\t\t$newdoc = new DOMDocument();\n\t\t \t$cloned = $item->cloneNode(TRUE);\n\t\t \t$newdoc->appendChild($newdoc->importNode($cloned,TRUE));\n\t\t\t\t$xpath = new DOMXPath($newdoc);\n\t\t\t\t\n\t\t\t\t// get username\n\t\t\t\t// TODO instead of using these dirty hack, find the appropriate content in a nice way\n\t\t\t\t$node = $xpath->query(\"//*[@rel='nofollow']\");\n\t\t\t\t$usr = $node->item(0)->textContent;\n\t\t\t\t// get reaction\n\t\t\t\t$node = $xpath->query(\"//*[@class='reactieContent']\");\n\t\t\t\t$msg = $node->item(0)->textContent;\n\t\t\t\t$results[] = new TweakBlogReaction($usr, $msg);\n\t\t\t}\n\t\t\t\n\t\t\treturn $results;\n\t\t}",
"public function reactions() {\n return $this->hasMany(Reaction::class);\n }",
"public function getAllReactions()\n {\n $options = $this->Site->parseRequestQuery($this->request->query);\n $data['rows'] = $this->Comment->findAllReactions($this->user_id, $this->user_role, $options);\n\n $this->set($data);\n $this->set('_serialize', array_keys($data));\n }",
"function getCorrectiveActions() {\n\n //sql to return all correctiveAction objects\n $sql = \"SELECT * from corrective_action\";\n $correctiveActions = array();\n $result = mysqli_query($this->plink, $sql);\n\n while ($row = mysqli_fetch_assoc($result)) {\n $correctiveActions[] = $this->correctiveAction($row);\n }\n\n return $correctiveActions;\n }",
"public function getActives()\n {\n return $this->copier->copy($this->actives);\n }",
"public function getActions();",
"public function experiences()\n {\n return $this->hasMany('App\\Models\\Experience')->orderBy('date_from', 'desc');\n }",
"public function getAllPublished();",
"public function getRecentActions()\n {\n return $this->recent_actions;\n }",
"public function getPublishResults(): array\n {\n return $this->publishResults;\n }",
"public function all()\n {\n return $this->work_experience->all();\n }",
"public function getInteractions() {\n\t\treturn $this->interactions;\n\t}",
"public function getAllPublished()\n {\n return $this->cache->rememberForever('articles.published', function () {\n return $this->repository->getAllPublished();\n });\n }",
"public function interviews() {\n if (empty($this->pub_interviews) && $this->pilot_imdbfill==FULL_ACCESS) $this->pub_interviews = $this->imdb->interviews();\n return $this->pub_interviews;\n }",
"public function allPublished()\n {\n return $this->model->where('published', true)->orderBy('start_datetime')->get();\n }",
"public function getExperiences()\n {\n return $this->experiences;\n }",
"public function get_reactions($network) {\n \n // Create reactions array\n $reactions = array();\n \n // Get comments\n $get_comments = $this->get_comments($network);\n \n // Add comments to $reactions\n $reactions[0] = array(\n 'name' => '<i class=\"icon-speech\"></i> ' . $this->CI->lang->line('comments'),\n 'slug' => 'comments',\n 'response' => $get_comments,\n 'placeholder' => $this->CI->lang->line('enter_comment'),\n 'post_id' => $network[0]->post_id,\n 'form' => true,\n 'delete' => false,\n 'reply' => false\n );\n \n // Get reactions\n $get_reactions = $this->get_likes($network);\n \n // Add reactions to $reactions\n $reactions[1] = array(\n 'name' => '<i class=\"icon-people\"></i> ' . $this->CI->lang->line('reactions'),\n 'slug' => 'reactions',\n 'response' => $get_reactions,\n 'placeholder' => '',\n 'post_id' => $network[0]->post_id,\n 'form' => false,\n 'delete' => false,\n 'reply' => false\n );\n \n return $reactions;\n \n }",
"public function createComponentReactions()\n {\n return $this->reactions;\n }",
"public function get_reactions($network) {\n \n // Create reactions array\n $reactions = array();\n \n // Get comments\n $get_comments = $this->get_comments($network);\n \n // Add comments to $reactions\n $reactions[0] = array(\n 'name' => '<i class=\"icon-speech\"></i> ' . $this->CI->lang->line('comments'),\n 'slug' => 'comments',\n 'response' => $get_comments,\n 'placeholder' => $this->CI->lang->line('enter_comment'),\n 'post_id' => $network[0]->post_id,\n 'form' => true,\n 'delete' => true,\n 'reply' => true\n );\n \n // Get reactions\n $get_reactions = $this->get_likes($network);\n \n // Add reactions to $reactions\n $reactions[1] = array(\n 'name' => '<i class=\"icon-people\"></i> ' . $this->CI->lang->line('reactions'),\n 'slug' => 'reactions',\n 'response' => $get_reactions,\n 'placeholder' => '',\n 'post_id' => $network[0]->post_id,\n 'form' => false,\n 'delete' => false,\n 'reply' => false\n );\n \n return $reactions;\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as botBlockUrl This string value is a URL to an image that eBay generates and returns in the PlaceOffer call response when eBay is requiring that the user supply an authentication token and URL in order for eBay to process the PlaceOffer call. As soon as a user gets a BotBlock container returned in the PlaceOffer call response, that user should grab the authentication token and this BotBlockUrl and then run another PlaceOffer call, but this time using the BotBlock container and passing in the authentication token and this URL value in the BotBlockUserInput field. For siteimpaired users, the BotBlockAudioUrl field might be returned instead, in which case, the BotBlockAudioUrl value should be passed into theBotBlockUserInput field instead. | public function getBotBlockUrl()
{
return $this->botBlockUrl;
} | [
"public function setBotBlockUrl($botBlockUrl)\n {\n $this->botBlockUrl = $botBlockUrl;\n return $this;\n }",
"public function getBotBlock()\n {\n return $this->botBlock;\n }",
"public function setBotBlock(\\Nogrod\\eBaySDK\\MerchantData\\BotBlockResponseType $botBlock)\n {\n $this->botBlock = $botBlock;\n return $this;\n }",
"public function getBlockUser()\n {\n return $this->block_user;\n }",
"public function getLoadBlockUrl()\n {\n return $this->getUrl('*/*/loadBlock');\n }",
"abstract public function get_blocked_url_string();",
"public function getBlockLoader()\n {\n return $this['pantono.service.blocks'];\n }",
"public function getBlockHelper() {\n return $this->block;\n }",
"private function getBlock()\n {\n\n return $this->block;\n }",
"public function getBunqmeShareUrl()\n {\n return $this->bunqmeShareUrl;\n }",
"public function getBlock()\n {\n return $this->block;\n }",
"function _get_block_path($block)\n{\n $block_path = get_file_base() . '/sources_custom/blocks/' . filter_naughty($block) . '.php';\n if ((in_safe_mode()) || (!is_file($block_path))) {\n $block_path = get_file_base() . '/sources/blocks/' . filter_naughty($block) . '.php';\n if (!is_file($block_path)) {\n $block_path = get_file_base() . '/sources_custom/miniblocks/' . filter_naughty($block) . '.php';\n }\n }\n return $block_path;\n}",
"function naked_get_ad_block( $the_block ) \n{\n\t$ad_blocks = naked_ad_blocks::get_instance();\n\t$ad_block = $ad_blocks->get_ad_block( $the_block );\n\n\tif( !isset( $ad_block ) ) {\n\t\t$text = \"Ad block $the_block does not exist.\";\n\t\techo $text;\n\t\treturn;\n\t}\n\n\t$ad_units = $ad_block->get_ad_units_to_display();\n\t$mobile_ad_units = $ad_block->get_mobile_ad_units_to_display();\n\n\t// template variables\n\t$ad_unit_id_base = $ad_block->delta;\n\n\t$classes = 'ad-block';\n\n\t// get the view\n\t$tpl_path = dirname(__DIR__) . '/views/widgets/ad_block.php';\n\tinclude( $tpl_path );\n}",
"public function getAnotherBlock()\n {\n $data = $this->_coreRegistry->registry('imagetoolbox');\n if ($data) {\n if (!empty($data['additional-block-name'])) {\n return $data['blocks'][$data['additional-block-name']];\n }\n $skip = true;\n foreach ($data['blocks'] as $name => $block) {\n if ($name == 'product.info.media.image360') {\n $skip = false;\n continue;\n }\n if ($skip) {\n continue;\n }\n if ($block) {\n return $block;\n }\n }\n }\n return null;\n }",
"public function block_user(Request $request){\n $validator = Validator::make($request->all(), $this->ruleSet['block']);\n if($validator->fails()){\n return response()->json(['status'=>Statuscodes::InvalidRequestFormat,'message'=>$validator->errors()->first()]);\n }\n $store=array(\n 'user_id'=>$request->from_user_id,\n 'block_user_id'=>$request->block_user_id,\n 'reason_for_block'=>$request->reason_for_block,\n 'status'=>$request->status,\n );\n\n $check=Block::where('user_id',$request->from_user_id)->where('block_user_id',$request->block_user_id)->first();\n if(! empty($check)){\n $insert=Block::where('id',$check->id)->update($store);\n }else{\n $insert=Block::create($store);\n }\n \n if($request->status==1){\n $b_status='block';\n\n }else{\n $b_status='unblock';\n\n }\n \n if($insert || $insert==1){\n return response()->json(['status' => Statuscodes::Okay,'message'=> 'Profile bas been '.$b_status.' successfully','data'=>$store]);\n }else{\n return response()->json(['status' => Statuscodes::InvalidRequestFormat,'message'=> 'Failed to '.$b_status.' profile']);\n }\n \n }",
"public function getBlockKitBuilderUri() : string {\n return 'https://api.slack.com/tools/block-kit-builder?'.http_build_query([\n 'mode' => $this->builderType,\n 'view' => json_encode($this, JSON_THROW_ON_ERROR, 512)\n ]);\n }",
"protected function _getBlock()\n {\n return $this->block;\n }",
"public function getBlock() {\n\t\treturn $this->block;\n\t}",
"public static function setSocialUserBlock(\n Template $template,\n $userId,\n $groupBlock = '',\n $groupId = 0,\n $show_full_profile = true\n ) {\n if (api_get_setting('allow_social_tool') != 'true') {\n return '';\n }\n\n $currentUserId = api_get_user_id();\n $userId = intval($userId);\n $userRelationType = 0;\n\n $socialAvatarBlock = SocialManager::show_social_avatar_block(\n $groupBlock,\n $groupId,\n $userId\n );\n\n $profileEditionLink = null;\n\n if ($currentUserId === $userId) {\n $profileEditionLink = Display::getProfileEditionLink($userId);\n } else {\n $userRelationType = SocialManager::get_relation_between_contacts(\n $currentUserId,\n $userId\n );\n }\n\n $vCardUserLink = Display::getVCardUserLink($userId);\n\n $userInfo = api_get_user_info($userId, true, false, true, true);\n\n $template->assign('user', $userInfo);\n $template->assign('social_avatar_block', $socialAvatarBlock);\n $template->assign('profile_edition_link', $profileEditionLink);\n //Added the link to export the vCard to the Template\n\n //If not friend $show_full_profile is False and the user can't see Email Address and Vcard Download Link\n if ($show_full_profile) {\n $template->assign('vcard_user_link', $vCardUserLink);\n }\n\n if (api_get_setting('gamification_mode') === '1') {\n $gamificationPoints = GamificationUtils::getTotalUserPoints(\n $userId,\n $userInfo['status']\n );\n\n $template->assign('gamification_points', $gamificationPoints);\n }\n $chatEnabled = api_is_global_chat_enabled();\n $template->assign('chat_enabled', $chatEnabled);\n $template->assign('user_relation', $userRelationType);\n $template->assign('user_relation_type_friend', USER_RELATION_TYPE_FRIEND);\n $template->assign('show_full_profile', $show_full_profile);\n $templateName = $template->get_template('social/user_block.tpl');\n\n if (in_array($groupBlock, ['groups', 'group_edit', 'member_list'])) {\n $templateName = $template->get_template('social/group_block.tpl');\n }\n\n $template->assign('social_avatar_block', $template->fetch($templateName));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Requests models. | public function actionIndex()
{
$searchModel = new RequestsSearch();
$dataProvider = $searchModel->search($this->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"public function getAllRequests()\n {\n $requests = Requests::all();\n\n return response()->json($requests, 200);\n }",
"public function getAllRequest()\n {\n $this->db->order_by(\"req_status\", \"ASC\");\n $this->db->order_by(\"created_at\", \"DESC\");\n return $this->db->get('request');\n }",
"public static function getAll()\n {\n return RequestStatus::with('monthRequests', 'yearRequests')->get();\n }",
"public function actionIndex()\n {\n $searchModel = new RequestSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort = ['defaultOrder' => ['id' => SORT_DESC]];\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getRequests()\n {\n return $this->hasMany(Request::className(), ['users_id' => 'id']);\n }",
"public static function models()\n {\n return self::fetch(\"models\");\n }",
"public static function all()\n {\n return static::$models;\n }",
"public function getRequests();",
"public static function all(): ModelCollection\n {\n return self::paginate(1, -1);\n }",
"public function getModels();",
"public function getModels()\r\n {\r\n $query = $this->getQuery();\r\n $models = $query->all();\r\n return $models;\r\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function seeAllRequests(){\n $requests=Settle::latest()->paginate(20);\n return view('admin.credit.settle.show',compact('requests'))->with(['title'=>'Settle Requests']);\n }",
"public static function List() {\n\t\t$models = array();\n\n\t\t// Get models from the database ordered.\n\t\t$dbh = Database::connect();\n\t\t$query = $dbh->prepare(\"SELECT id FROM device_models\");\n\t\t$query->execute();\n\t\t$rows = $query->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t// Go through the results creating Model objects.\n\t\tforeach ($rows as $model)\n\t\t\tarray_push($models, Model::FromID($model[\"id\"]));\n\n\t\treturn $models;\n\t}",
"function GetAllModels()\n\t{\n\t}",
"public static function all()\n {\n $url = \"/lists\";\n $response = self::_staticRequest('get', $url);\n \n return $response;\n }",
"public function getAllModel()\n {\n $this->_setQueryModel();\n return $this->getQuery();\n }",
"public function actionIndex()\n {\n $searchModel = new RequestTypeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize Duty Fee and IOR Tax order total | public function initTotals(): DutyFee
{
if ($this->getOrder()->getDrDutyFee() === null &&
$this->getOrder()->getDrIorTax() === null) {
return $this;
}
$total = new DataObject(
[
'code' => $this->getNameInLayout(),
'block_name' => $this->getNameInLayout(),
'area' => $this->getArea(),
]
);
$after = $this->getAfterTotal();
if (!$after) {
$after = 'tax';
}
$this->getParentBlock()->addTotal($total, $after);
return $this;
} | [
"protected function calculate_fee_totals()\n {\n }",
"public function __construct()\n {\n $this->calculatedAmount = [\n 'subtotal' => 0,\n 'tax' => 0,\n 'total' => 0\n ];\n }",
"private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }",
"private function _initInvoiceFee()\n {\n\t\t$helper = Mage::helper('sisow/paymentfee');\n\t\t$fee = $helper->getPaymentFeeArray(\n\t\t\t\t$this->payment->getMethodInstance()->getCode(), \n\t\t\t\t$this->quote\n\t\t\t);\n\t\t\n $this->address->setBaseInvoiceFee($fee['base_incl']);\n $this->address->setInvoiceFee($fee['incl']);\n $this->address->setBaseInvoiceFeeExcludedVat($fee['base_excl']);\n $this->address->setInvoiceFeeExcludedVat($fee['excl']);\n $this->address->setBaseInvoiceTaxAmount($fee['base_taxamount']);\n $this->address->setInvoiceTaxAmount($fee['taxamount']);\n $this->address->setInvoiceFeeRate($fee['rate']);\n\n // Add our invoice fee to the address totals\n $this->address->setBaseGrandTotal(\n $this->address->getBaseGrandTotal() + $fee['base_incl']\n );\n $this->address->setGrandTotal(\n $this->address->getGrandTotal() + $fee['incl']\n );\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 getTaxFreeTotal();",
"public function initTotals()\n {\n $parent = $this->getParentBlock();\n $this->_order = $parent->getOrder();\n $this->_source = $parent->getSource();\n $order = $this->_order;\n\n $store = $this->getStore();\n\n $transiteoTotalTaxes = $order->getTransiteoTotalTaxes();\n $baseTransiteoTotalTaxes = $order->getBaseTransiteoTotalTaxes();\n\n if ($transiteoTotalTaxes) {\n $totals = [];\n $transiteoDuty = $order->getTransiteoDuty();\n $baseTransiteoDuty = $order->getBaseTransiteoDuty();\n $transiteoVat = $order->getTransiteoVat();\n $baseTransiteoVat = $order->getBaseTransiteoVat();\n $transiteoSpecialTaxes = $order->getTransiteoSpecialTaxes();\n $baseTransiteoSpecialTaxes = $order->getBaseTransiteoSpecialTaxes();\n $included = $order->getTransiteoIncoterm();\n if ($included === \"ddp\") {\n $included = ' ' . __('(included)');\n } else {\n $included = ' ' . __('(not included)');\n }\n\n $totalSetted = 0;\n if (isset($transiteoVat)) {\n $totalSetted++;\n }\n if (isset($transiteoDuty)) {\n $totalSetted++;\n }\n if (isset($transiteoSpecialTaxes)) {\n $totalSetted++;\n }\n\n if (($totalSetted > 1)) {\n $totals['transiteo_total_taxes'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'transiteo_total_taxes',\n 'field' => 'transiteo_total_taxes_amount',\n 'strong' => true,\n 'value' => $transiteoTotalTaxes,\n 'base_value' => $baseTransiteoTotalTaxes,\n 'label' => __('Duty & Taxes Total' . $included),\n ]\n );\n }\n\n if (isset($transiteoSpecialTaxes)) {\n $totals['transiteo_special_taxes'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'transiteo_special_taxes',\n 'field' => 'transiteo_special_taxes_amount',\n 'value' => $transiteoSpecialTaxes,\n 'base_value' => $baseTransiteoSpecialTaxes,\n 'label' => __('Special Taxes SubTotal' . $included),\n ]\n );\n }\n\n if (isset($transiteoVat)) {\n $totals['transiteo_vat'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'transiteo_vat',\n 'field' => 'transiteo_vat_amount',\n 'value' => $transiteoVat,\n 'base_value' => $baseTransiteoVat,\n 'label' => __('VAT/GST SubTotal' . $included),\n ]\n );\n }\n\n if (isset($transiteoDuty)) {\n $totals['transiteo_duty'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'transiteo_duty',\n 'field' => 'transiteo_duty_amount',\n 'value' => $transiteoDuty,\n 'base_value' => $baseTransiteoDuty,\n 'label' => __('Duty SubTotal' . $included),\n ]\n );\n }\n\n foreach ($totals as $value) {\n $parent->addTotal($value, \"shipping\");\n }\n }\n return $this;\n }",
"function calculateTaxTotals()\n {\n\t\t$t = new J2StoreTax();\n\t\t$tax_total = 0.00;\n\n $items= $this->getItems();\n if (!is_array($items))\n {\n $this->order_tax = $tax_total;\n return;\n }\n\n foreach ($items as $key=>$item)\n {\n $orderitem_tax = 0;\n\n //$product_tax_rate = J2StorePrices::getItemTax($item->product_id);\n //$orderitem_tax += $product_tax_rate * $item->orderitem_final_price;\n // track the total tax for this item\n $orderitem_tax += $t->getProductTax($item->orderitem_final_price, $item->product_id);\n $item->orderitem_tax = $orderitem_tax;\n // track the running total\n $tax_total += $item->orderitem_tax;\n }\n \t $this->order_tax = $tax_total;\n }",
"protected function addTax()\n {\n $this->fullCost = $this->purchased + ($this->purchased * .07);\n }",
"public function __construct(){\n $this->taxes = array();\n }",
"protected function calculate()\n {\n $fee = 0;\n $amount = 0;\n //Loop though the transactionlines to get the amount and fee\n foreach ($this->transactionlines as $transactionline) {\n $fee += $transactionline->fee;\n $amount += $transactionline->amount;\n }\n $this->fee = $fee;\n $this->amount = $amount;\n }",
"private function setTax()\n {\n if($this->taxIncluded){\n $this->tax = $this->calculateTaxIncluded();\n $this->setTotalBeforeTax();\n }else{\n $this->tax = $this->calculateTaxAddOn();\n } \n }",
"protected function _initTotals($order) {\n $source = $order;\n\n $this->_totals = [];\n $this->_totals['Subtotal'] = $source->getSubtotal();\n\n /**\n * Add shipping\n */\n if (!$source->getIsVirtual() && ((double) $source->getShippingAmount() || $source->getShippingDescription())) {\n $this->_totals['Shipping & Handling'] = $source->getShippingAmount();\n }else{\n $this->_totals['Shipping & Handling'] =\"\";\n }\n\n /**\n * Add COD fee\n */\n $paymentFee = null ;\n try{\n /** @var \\Amasty\\CashOnDelivery\\Model\\PaymentFee $paymentFee */\n $paymentFee = $this->codPaymentFeeRepository->getByQuoteId($source->getQuoteId());\n } catch ( \\Exception $e ){\n // do nothing\n }\n $label= $this->codConfigProvider->getPaymentFeeLabel();\n $label= (string)$label;\n if(!is_null( $paymentFee )){\n if ($paymentFee->getAmount()) {\n // $label= \"Cash on Delivery Fee\" ;\n $amount = $paymentFee->getAmount();\n $baseAmount = $paymentFee->getBaseAmount();\n $this->_totals[ $label ] = $amount;\n }\n }else{\n $this->_totals[ $label ] = \"\";\n }\n\n /**\n * Add discount\n */\n if ($source->getDiscountDescription()) {\n // $discountLabel = __('Discount (%1)', $source->getDiscountDescription());\n $discountLabel = sprintf('Discount (%1)', $source->getDiscountDescription());\n } else {\n// $discountLabel = __('Discount');\n $discountLabel = 'Discount';\n }\n $discountLabel = (string) $discountLabel;\n if ((double) $source->getDiscountAmount() != 0) {\n $this->_totals[$discountLabel] = $source->getDiscountAmount();\n }else{\n $this->_totals[$discountLabel] = \"\";\n }\n\n $this->_totals['Grand Total'] = $source->getGrandTotal();\n\n /**\n * Base grandtotal\n */\n if ($source->isCurrencyDifferent()) {\n $this->_totals['Grand Total to be Charged'] = $source->formatBasePrice($source->getBaseGrandTotal());\n }\n return $this->_totals;\n }",
"private function setup_total() {\n\t\t$amount = $this->get_meta( '_give_payment_total', true );\n\n\t\treturn round( floatval( $amount ), give_get_price_decimals( $this->ID ) );\n\t}",
"public function getTotalTax();",
"function setTaxes()\n {\n $this->taxes = round($this->subtotal*TAX_RATE/100, 2);\n }",
"protected function amount_include_tax(){}",
"public function getTaxTotal();",
"private function setRefundTotal()\n {\n $organiserTaxRate = $this->organiserTaxRate;\n $currency = $this->currency;\n\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 ($organiserTaxRate, $currency) {\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\n Log::debug(sprintf(\"Requested Refund should include Tax: %s\", $this->refundAmount->display()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the status of the slave database | public static function get_slave_status() {
try{
$db = self::get_instance();
$current_adapter = $db->_db;
$db->use_slave_db(false);
$result =$db->query_row('SHOW SLAVE STATUS');
$db->_db = $current_adapter;
} catch(Agel_Db_DbException $e) {
$result = FALSE;
}
return $result;
} | [
"public function getSlave(): int\n {\n return $this->slave;\n }",
"public static function getSlaveDb()\n\t{\n\t\treturn self::getDb(ECash_Config::DB_SLAVE_ID);\n\t}",
"public function getDbStatus(){\n\n return $this->db_status;\n }",
"private function getSlave()\n {\n if (count($this->dbSlaves) > 0) {\n $slaveId = rand(0, count($this->dbSlaves) - 1);\n return $this->dbSlaves[$slaveId];\n } else {\n return $this->dbMaster;\n }\n }",
"function slave()\n {\n if(!$this->isValidResource($this->resources['slave'])) {\n return $this->connect('slave');\n }\n\n return $this->resources['slave'];\n }",
"public static function getMasterServerInfo()\n {\n return Shanty_Mongo::getWriteConnection(static::$_connectionGroup)->getServerInfo();\n }",
"private function get_slave_replication_info($master)\t{\n\t\t$db = $master;\n\t\tif ($db->sources->count() == 0) {\n\t\t\treturn Array();\n\t\t}\n\t\t$slave = Array();\n\t\t$cursor = $db->sources->find();\n\t\twhile ($cursor->hasNext()) {\n\t\t\t$source = $cursor->getNext();\t\t\t\t\t\t\n\t\t\t$arr = Array();\n\t\t\t$arr['host'] = $source['host'];\n\t\t\t$now = new MongoDate();\n\t\t\t$ago = ($now->sec - $source['syncedTo']->inc);\t\t\t\n\t\t\t$hrs = round($ago / 36) / 100;\t\t\t\n\t\t\t$arr['synced_hours'] = $hrs;\n\t\t\t$arr['synced_secs'] = round($ago);\n\t\t\t\n\t\t\t$slave[] = $arr;\n\t\t}\n\t\treturn $slave;\n\t}",
"function GetDatabaseStatus()\r\n{\r\n\t$returnStatus = \"\";\r\n\t\r\n\t$db = systemData::GetInstance();\r\n\r\n\tif($db)\r\n\t{\r\n\t\t$returnStatus = $db->GetStatus();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/*\r\n\t\t\tSend a raw message. Something is seriously amiss.\r\n\t\t*/\r\n\t\t$returnStatus = \"invalid object\";\r\n\t}\r\n\t\r\n\treturn $returnStatus;\r\n}",
"public function getReplicationStatus()\n {\n return $this->get(self::RESULT_REPLICATION_STATUS);\n }",
"public function status()\n {\n if(!$this->mysql) return 0;\n if(!$this->selected_database) return -1;\n return 1;\n }",
"private static function getMasterSlave() {\n return self::getRandomPDOLB(self::MASTER_SLAVE);\n }",
"public function getSlave() {\n\t\tif (!isset($this->_slave)) {\n shuffle($this->slaves);\n\t\t\tforeach ($this->slaves as $slaveConfig) {\n\t\t\t\tif (!isset($slaveConfig['class']))\n\t\t\t\t\t$slaveConfig['class']='CDbConnection';\n\t\t\t\ttry {\n\t\t\t\t\tif ($slave=Yii::createComponent($slaveConfig)) {\n\t\t\t\t\t\tYii::app()->setComponent('dbslave',$slave);\n\t\t\t\t\t\t$this->_slave=$slave;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tYii::log('Create slave database connection failed!','warn');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$this->_slave) {\n\t\t\t\t$this->_slave=$this;\n\t\t\t\t$this->_slave->enableSlave=false;\n\t\t\t}\n\t\t}\n\t\treturn $this->_slave;\n\t}",
"protected function db_master() {\r\n // Start timer\r\n $timer = new Timer();\r\n\r\n // Check master\r\n require '/gsr/systems/db.master.php';\r\n\r\n try {\r\n new PDO( \"mysql:host=$db_host;dbname=$db_name\", $db_username, $db_password );\r\n $message = 'OK';\r\n } catch( PDOException $e ) {\r\n $message = 'FAIL';\r\n }\r\n\r\n // Create XML\r\n $xml = new SimpleXMLElement('<pingdom_http_custom_check/>');\r\n $xml->addChild( 'status', $message );\r\n $xml->addChild( 'response_time', round( $timer->stop() * 1000000, 3 ) );\r\n\r\n // Spit out XML\r\n return new XmlResponse( $xml->asXML() );\r\n }",
"public function recoverySlaveHealth()\n {\n $sql = 'UPDATE slave_user SET health=health+1 WHERE health<10 ';\n return $this->_wdb->query($sql);\n }",
"public function getSSDBSlaveResource()\n {\n return $this->SSDBSlaveResource;\n }",
"public function status ()\n {\n return mysql_stat();\n }",
"protected function getSlaveDb()\n {\n if (!$this->db_slave) {\n $this->db_slave = DBManagerFactory::getInstance('reports');\n }\n return $this->db_slave;\n }",
"public function getSlavePdo();",
"public function get_server_status() {\r\n\t\t\r\n\t\treturn json_decode($this->send_request('get', 'server_status', 1));\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Joins a stock table | public function scopeJoinStock($query)
{
$stock = '('.
'SELECT `bedard_shop_inventories`.`product_id`, SUM(`bedard_shop_inventories`.`quantity`) AS `stock` '.
'FROM `bedard_shop_inventories` '.
'GROUP BY `bedard_shop_inventories`.`product_id`'.
') AS `stocks`';
return $query
->leftJoin(DB::raw($stock), 'stocks.product_id', '=', 'bedard_shop_products.id');
} | [
"public function joinStockItems()\n {\n $stockItemTable = array('cataloginventory/stock_item' => $this->getTable('cataloginventory/stock_item'));\n\n $fromPart = $this->getSelect()->getPart(Zend_Db_Select::FROM);\n if (! isset($fromPart['cataloginventory/stock_item'])) {\n $this->getSelect()->joinLeft(\n $stockItemTable,\n '`cataloginventory/stock_item`.item_id = main_table.item_id'\n );\n }\n return $this;\n }",
"public function used_stock(){\n // ->join\n // ->where('item_id', $this->id)\n // ->where('source', 'purchase')\n // ->groupBy('item_id')->first();\n $used_stock = DB::table('order_items as a')\n ->join('orders as b', 'a.order_id', 'b.id')\n ->join('stocks as c', 'a.id', 'c.source_id') \n ->selectRaw(\"SUM(c.quantity) as quantity, c.item_id\")\n ->where('c.item_id', $this->id)\n ->whereIn('c.source', ['sale','return'])\n ->whereIn('b.status_id', [4,5])\n ->groupBy('c.item_id')->first();\n\n return $used_stock;\n }",
"public function joinSalesOrder(): void {\n $carrierCodesImploded = $this->createSalesOrderCarrierCodeCondition();\n $this->join(['sales_order' => 'sales_order'], \"`main_table`.`order_number` = `sales_order`.`increment_id` AND ($carrierCodesImploded)\", '');\n }",
"public function stocks()\n {\n return $this->hasMany(Stock::class);\n }",
"public function fixProductCollectionStockJoin(Varien_Event_Observer $observer)\n {\n if (Mage::registry('product_grid_block_loading')) {\n $collection = $observer->getEvent()->getCollection();\n /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */\n\n if ($collection->getStoreId()) {\n $fromPart = $collection->getSelect()->getPart(Zend_Db_Select::FROM);\n foreach ($fromPart as &$from) {\n if ($from['tableName'] == $collection->getTable('cataloginventory/stock_item') && isset($from['joinCondition'])) {\n $from['joinCondition'] = str_replace(\n 'stock_id=1',\n 'stock_id=' . Mage::app()->getStore($collection->getStoreId())->getWebsite()->getStockId(),\n $from['joinCondition']\n );\n }\n }\n $collection->getSelect()->setPart(Zend_Db_Select::FROM, $fromPart);\n }\n }\n\n return $this;\n }",
"public function stocks() {\n return $this->hasMany('App\\Productable');\n }",
"public function stock()\n {\n return $this->hasMany('App\\Guild\\Bank\\Stock');\n }",
"private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }",
"public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }",
"function orderOnLowStock(){\n\n\t\t$q1 = \"SELECT * FROM sbl_beer INNER JOIN stock ON nr=beer_id WHERE in_stock<threshold\";\n\t\t$result= $this -> mysqli -> query($q1) or die (\"query failed!\");\n\n\t\t$this->makeOrderTable($result);\n\t\t$result -> close();\n\t}",
"public function stock() {\n return $this->belongsTo('App\\StockCode', 'stock_id');\n }",
"public function joinFoo()\n {\n $this->db->join($this->M_foo->table, \"{$this->M_foo->table}.{$this->M_foo->primaryKey} = {$this->table}.foo_id\");\n }",
"public function getProductStockInformation()\n {\n $stockSelect = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'value'=>'is_in_stock')\n );\n\n $childrenSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.child_id']\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_p_r.parent_id',\n ['c_p_e.entity_id']\n )\n ->join(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.child_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $parentSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.parent_id', 'entity_id' => 'c_p_r.child_id']\n )\n ->joinLeft(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.parent_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $childCountSql = $this->adapter->select()\n ->from(\n [\"child_select\"=> new \\Zend_Db_Expr(\"( \". $childrenSelect->__toString() . ' )')],\n [\"child_count\" => new \\Zend_Db_Expr(\"COUNT(child_select.child_id)\"), 'entity_id']\n )\n ->group(\"child_select.entity_id\");\n\n $parentCountSql = $this->adapter->select()\n ->from(\n [\"parent_select\"=> new \\Zend_Db_Expr(\"( \". $parentSelect->__toString() . ' )')],\n [\"parent_count\" => new \\Zend_Db_Expr(\"COUNT(parent_select.parent_id)\"), 'entity_id']\n )\n ->group(\"parent_select.entity_id\");\n\n $select = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'qty', 'is_in_stock')\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_s_i.product_id',\n ['c_p_e.type_id']\n )\n ->joinLeft(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n 'c_s_i.product_id = c_p_r.child_id',\n ['c_p_r.parent_id']\n );\n\n if($this->isDelta)$select->where('product_id IN(?)', $this->exportIds);\n\n $configurableType = Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE;\n $groupedType = Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE;\n $finalSelect = $this->adapter->select()\n ->from(\n [\"entity_select\" => new \\Zend_Db_Expr(\"( \". $select->__toString() . \" )\")],\n [\n \"entity_select.entity_id\",\n \"entity_select.qty\",\n \"is_in_stock\" => new \\Zend_Db_Expr(\"\n (CASE \n WHEN (entity_select.type_id = '{$configurableType}' OR entity_select.type_id = '{$groupedType}') AND entity_select.is_in_stock = '1' THEN IF(child_count.child_count > 0, 1, 0)\n WHEN entity_select.parent_id IS NOT NULL AND entity_select.is_in_stock = '1' THEN IF(parent_stock.parent_count > 0, 1, 0)\n ELSE entity_select.is_in_stock\n END\n )\"\n )\n ]\n )\n\n ->joinLeft(\n [\"child_count\"=> new \\Zend_Db_Expr(\"( \". $childCountSql->__toString() . \" )\")],\n \"child_count.entity_id = entity_select.entity_id\",\n []\n )\n ->joinLeft(\n [\"parent_stock\"=> new \\Zend_Db_Expr(\"( \". $parentCountSql->__toString() . \" )\")],\n \"parent_stock.entity_id = entity_select.entity_id\",\n []\n );\n\n return $this->adapter->fetchAll($finalSelect);\n }",
"public function getStocks()\n {\n return $this->hasMany(Stock::className(), ['measure_unit_id' => 'id']);\n }",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.quantity,p.stock_min,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image,pr.nombre AS proveedor\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" LEFT JOIN proveedores pr ON pr.id = p.proveedor_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"public function stock()\n {\n return $this->belongsTo(InventoryStock::class, 'stock_id', 'id');\n }",
"public function stock(){\n return $this->belongsToMany(\n ProductVariation::class,'product_variation_stock_view' ///product variation asbe.mirror tai stock r ekti table ja connected\n )->withPivot([ //product_variation_stock_view theke stock and in_stock\n 'stock',\n 'in_stock'\n ]);\n }",
"private function addSubProductsStockStatusJoin(Select $select, $stockValues, $mainTableAlias, $showOutOfStockFlag)\n {\n $catalogInventoryTable = $this->resourceConnection->getTableName('cataloginventory_stock_status');\n $select->joinInner(\n ['sub_products_stock_index' => $catalogInventoryTable],\n $this->conditionManager->combineQueries(\n [\n sprintf('sub_products_stock_index.product_id = %s.source_id', $mainTableAlias),\n $this->conditionManager->generateCondition(\n 'sub_products_stock_index.website_id',\n '=',\n $this->stockConfiguration->getDefaultScopeId()\n ),\n $showOutOfStockFlag\n ? ''\n : $this->conditionManager->generateCondition(\n 'sub_products_stock_index.stock_status',\n is_array($stockValues) ? 'in' : '=',\n $stockValues\n ),\n $this->conditionManager->generateCondition(\n 'sub_products_stock_index.stock_id',\n '=',\n (int) $this->stockRegistry->getStock()->getStockId()\n ),\n ],\n Select::SQL_AND\n ),\n []\n );\n }",
"public function getVariantStocks()\n {\n return $this->getProductStocks()\n ->joinWith('stock');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
User filter threads by popular. | public function test_user_filter_threads_by_popular()
{
$threadWithThreeReplies = create('App\Thread');
create('App\Reply', ['thread_id' => $threadWithThreeReplies->id], 3);
$threadWithTwoReplies = create('App\Thread');
create('App\Reply', ['thread_id' => $threadWithTwoReplies->id], 2);
$threadWithNoReplies = $this->thread;
$response = $this->getJson('threads?popular=1')->json();
$this->assertEquals([3, 2, 0], array_column($response, 'replies_count'));
} | [
"public function popular_tags() {\n\t\tif ($this->request->is('requested')) {\n\t\t\treturn $this->Post->getPopularTagsList();\n\t\t}\n\t}",
"public function filterByMore();",
"public function popularAction()\n\t{\n\t\t$entries = $this->computeStatistics('popular');\n\t\t$this->view->assign('entries', $entries);\n\t}",
"protected function _getTopViewThreads($all, $count = 5) {\n usort($all, array($this, 'sortThreads'));\n // Return top 5 based on the number of views after sorting\n return array_slice($all, 0, $count);\n }",
"public function a_user_can_filter_threads_by_any_username()\n {\n $user = $this->signIn(create('App\\User', ['name' => 'JohnDoe']));\n $threadByJohn = create('App\\Thread', ['user_id' => auth()->id(), 'channel_id' => 3]);\n $threadNotByJohn = create('App\\Thread', ['channel_id' => 3]);\n $this->get('threads?by=JohnDoe')->assertSee($threadByJohn->title)->assertDontSee($threadNotByJohn->title);\n }",
"function phorum_mod_limit_threaded_views_page_read()\n{\n global $PHORUM;\n\n // Check if we have a thread id in the request.\n if (!isset($PHORUM['args'][1]) || !is_numeric($PHORUM['args'][1]))\n return;\n\n // No action needed if we're in flat mode already.\n if (!$PHORUM['threaded_read']) return;\n\n // Check if a limit is configured for the current view mode.\n $setting = $PHORUM['threaded_read'] == 2\n ? 'read_hybrid' : 'read_threaded';\n if (empty($PHORUM['mod_limit_threaded_views'][$setting])) return;\n $limit = $PHORUM['mod_limit_threaded_views'][$setting];\n\n // Find out how many messages there are in the current thread.\n $thread_id = (int) $PHORUM['args'][1];\n $thread = phorum_db_get_message($thread_id, 'message_id');\n if ($thread && !empty($thread['thread_count']) &&\n $thread['thread_count'] > $limit) {\n $PHORUM['threaded_read'] = 0;\n $PHORUM['mod_limit_threaded_views']['limited'] = 1;\n }\n}",
"public static function getPopular($num) {\n $t1 = static::TABLE_NAME;\n $t2 = Favorite::TABLE_NAME;\n $result = Charity::join($t2, \"{$t2}.charity_id\", '=', \"{$t1}.charity_id\")\n ->select(DB::raw(\"count(*) AS num_favorites, {$t2}.charity_id, name\"))\n ->groupBy(\"{$t2}.charity_id\")\n ->orderBy('num_favorites', 'DESC')\n ->limit($num)\n ->get();\n return $result;\n }",
"function limitthreads_run()\r\n{\n\tglobal $mybb, $db, $lang;\n\t$lang->load(\"limitthreads\");\n\n\t// Check group limits\n\tif($mybb->usergroup['maxthreadsday'] > 0)\n\t{\n\t\t$query = $db->simple_select(\"threads\", \"COUNT(*) AS thread_count\", \"uid='\".intval($mybb->user['uid']).\"' AND dateline >='\".(TIME_NOW - (60*60*24)).\"'\");\n\t\t$thread_count = $db->fetch_field($query, \"thread_count\");\n\t\tif($thread_count >= $mybb->usergroup['maxthreadsday'])\n\t\t{\n\t\t\t$lang->error_max_threads_day = $lang->sprintf($lang->error_max_threads_day, $mybb->usergroup['maxthreadsday']);\n\t\t\terror($lang->error_max_threads_day);\n\t\t}\n\t}\n}",
"function task_statistics_get_all_top_users($task_id,\n $round_id,\n $max_top_size) {\n $criterias = array('memory', 'time', 'size');\n $result = array();\n foreach ($criterias as $criteria) {\n $current_result = task_statistics_get_top_users($task_id,\n $criteria,\n $round_id,\n $max_top_size);\n unset($current_result['username']);\n unset($current_result['full_name']);\n unset($current_result['rating']);\n $result[$criteria] = $current_result;\n }\n return $result;\n}",
"public function userLatestSubmissions($user, $count = 10);",
"public function mostPopular(){\n $this->_curl->get( $this->_path.'discover/movie',[\n 'sort_by' => 'popularity.desc',\n 'page' => 1,\n 'year' => date('Y'),\n 'api_key' => $this->_key\n ]);\n\n if ($this->_curl->error) {\n echo $this->_curl->error_code;\n }\n else {\n echo $this->_curl->response;\n }\n }",
"function get_top_users($limit_count = 10, $criteria = 'posts', $order = 'DESC', $recent_posts_limit_days = 10)\n{\n\tglobal $db;\n\t$return_ary = array();\n\tswitch ($criteria)\n\t{\n\t\tcase 'posts':\n\t\t\t$sql = 'SELECT user_id AS u_id, username, user_colour AS u_colour, user_posts AS count\n\t\t\t\t\t\tFROM ' . USERS_TABLE . '\n\t\t\t\t\t\tWHERE user_posts > 1 \n\t\t\t\t\t\tORDER BY user_posts ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($current_user = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $current_user;\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\tbreak;\n\t\t\n\t\tcase 'topics':\n\t\t\t$sql = 'SELECT u.user_id AS u_id, u.username AS username, u.user_colour AS u_colour, COUNT(t.topic_id) AS count\n\t\t\t\t\t\tFROM ' . TOPICS_TABLE. ' t, ' . USERS_TABLE . ' u \n\t\t\t\t\t\tWHERE t.topic_approved = 1 \n\t\t\t\t\t\t\tAND t.topic_poster = u.user_id \n\t\t\t\t\t\tGROUP BY u_id\n\t\t\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($current_user = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $current_user;\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\tbreak;\n\t\t\n\t\tcase 'recent_posts':\n\t\t\t$sql = 'SELECT p.poster_id AS u_id, u.username AS username, u.user_colour AS u_colour, COUNT(p.post_id) AS count\n\t\t\t\t\t\tFROM ' . POSTS_TABLE. ' p, ' . USERS_TABLE . ' u \n\t\t\t\t\t\tWHERE p.post_approved = 1 \n\t\t\t\t\t\t\tAND p.poster_id = u.user_id \n\t\t\t\t\t\t\tAND p.post_time > ' . (time() - $recent_posts_limit_days * 86400) . ' \n\t\t\t\t\t\tGROUP BY u_id\n\t\t\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($current_user = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $current_user;\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\tbreak;\n\t\t\n\t\tcase 'attachments':\n\t\t\t$sql = 'SELECT u.user_id AS u_id, u.username, u.user_colour AS u_colour, COUNT(at.attach_id) AS count\n\t\t\t\t\t\tFROM ' . ATTACHMENTS_TABLE . ' at, ' . USERS_TABLE . ' u \n\t\t\t\t\t\tWHERE at.poster_id = u.user_id\n\t\t\t\t\t\tGROUP BY u_id\n\t\t\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($current_user = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $current_user;\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t}\n\treturn $return_ary;\n}",
"public function getThreadSummary() {\n $threadData = $this->discuss->hooks->load('post/getthread',array(\n 'post' => &$this->post,\n 'controller' => &$this,\n 'thread' => $this->post->get('thread'),\n 'limit' => 5,\n ));\n $this->setPlaceholder('thread_posts',$threadData['results']);\n }",
"static public function popular() {\n\t\t$items = new ListObjects('Post', array('fields'=>'*',\n\t\t\t\t\t\t\t\t\t\t\t\t'where'=>'active=\"1\"',\n\t\t\t\t\t\t\t\t\t\t\t\t'order'=>'views DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t'limit'=>'3'));\n\t\tif (!$items->isEmpty()) {\n\t\t\treturn '<h2>'.__('popularPosts').'</h2>\n\t\t\t\t\t<div class=\"itemsSide\">\n\t\t\t\t\t\t'.$items->showList(array('function'=>'Side')).'\n\t\t\t\t\t</div>';\n\t\t}\n\t}",
"function ub_get_popular_dataset() {\n\n\t// Get posts that match tags and categories, but are not part of the dataset.\n\t$PopularPostsArgs = array(\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'ub_post_engagement',\n\t\t\t\t'value' => 0,\n\t\t\t\t'compare' => '>',\n\t\t\t)\n\t\t),\n\t);\n\n\t$popular_posts = [];\n\t$PopularPosts = new WP_Query( $PopularPostsArgs );\n\twhile ( $PopularPosts->have_posts() ) : $PopularPosts->the_post();\n\n\t\t$currentPostEngagement = get_post_meta( get_the_id(), 'ub_post_engagement', true )[ 'total' ];\n\n\t\t// Add post to reccomended posts array with id and engagement value\n\t\t$popular_posts[] = array( 'id' => get_the_ID(), 'total' => $currentPostEngagement, 'name' => get_the_title(), );\n\n\tendwhile;\n\twp_reset_query();\n\n\t// Sort $popular_posts from most total engagement to lowest\n\tusort( $popular_posts, function ( $a, $b ) {\n\t\treturn $b[ 'total' ] <=> $a[ 'total' ];\n\t});\n\n\t// Limit popular posts to $limit\n\t$popular = [];\n\tfor( $i = 0; $i < 10; $i++ ) {\n\t\t$popular[ $i ] = $popular_posts[ $i ];\n\t}\n\n\t// Return array\n\treturn $popular;\n\n}",
"public function getLikedThreads($limit = 0)\n {\n $visitor = XenForo_Visitor::getInstance();\n\n $exclforums = XenForo_Application::get('options')->exluded_liked_threads_fids;\n\t\t\n $conditions = array(\n 'deleted' => false,\n 'moderated' => false\n );\n\n $fetchOptions = array(\n 'join' => XenForo_Model_Thread::FETCH_USER,\n 'permissionCombinationId' => $visitor['permission_combination_id'],\n 'readUserId' => $visitor['user_id'],\n 'watchUserId' => $visitor['user_id'],\n 'postCountUserId' => $visitor['user_id'],\n 'order' => 'like_count',\n 'orderDirection' => 'desc',\n 'limit' => $limit,\n );\n\n\n $whereConditions = $this->getModelFromCache('XenForo_Model_Thread')->prepareThreadConditions($conditions, $fetchOptions);\n $sqlClauses = $this->getModelFromCache('XenForo_Model_Thread')->prepareThreadFetchOptions($fetchOptions);\n $limitOptions = $this->getModelFromCache('XenForo_Model_Thread')->prepareLimitFetchOptions($fetchOptions);\n\n if (!empty($exclforums))\n {\n $whereConditions .= ' AND thread.node_id NOT IN (' . $this->_getDb()->quote($exclforums) . ')';\n }\n\t\t\n\t\t$whereConditions .= ' AND thread.like_count > 0';\n\n $sqlClauses['joinTables'] = str_replace('(user.user_id = thread.user_id)', '(user.user_id = thread.user_id)', $sqlClauses['joinTables']);\n\n $threads = $this->fetchAllKeyed($this->limitQueryResults('\n\t\t\t\tSELECT thread.*\n\t\t\t\t\t' . $sqlClauses['selectFields'] . '\n\t\t\t\tFROM kmk_thread AS thread\n\t\t\t\t' . $sqlClauses['joinTables'] . '\n\t\t\t\tWHERE ' . $whereConditions . '\n\t\t\t\t' . $sqlClauses['orderClause'] . '\n\t\t\t', $limitOptions['limit'], $limitOptions['offset']\n ), 'thread_id');\n\n foreach($threads AS $threadId => &$thread)\n {\n if ($this->getModelFromCache('XenForo_Model_Thread')->canViewThreadAndContainer($thread, $thread))\n {\n $thread = $this->getModelFromCache('XenForo_Model_Thread')->prepareThread($thread, $thread);\n $thread['canInlineMod'] = false;\n }\n else\n {\n unset($threads[$threadId]);\n }\n }\n\n return $threads;\n }",
"public function threadsByUserTotal(): int {\n [$cond, $args] = $this->configure();\n return self::$db->scalar(\"\n SELECT count(*)\n FROM forums AS f\n INNER JOIN forums_topics AS t ON (t.ForumID = f.ID)\n WHERE t.AuthorID = ?\n AND \" . implode(' AND ', $cond),\n $this->user->id(), ...$args\n );\n }",
"function popularTags() {\n if (!Schema::hasTable('article_tag')) {\n return false;\n }\n\n $tags = Cache::remember('popular_tags_' . app()->locale, 300, function () {\n\n return DB::select(\"SELECT `tag_id`, count(`tag_id`) as `tc`, `tags`.* FROM `article_tag`\n\t\t\t\t\tLEFT JOIN `tags` ON `tags`.`id` = `article_tag`.`tag_id`\n\t\t\t\t\tWHERE `article_tag`.`locale` = '\" . app()->getLocale() . \"'\n\t\t\t\t\tGROUP BY `tag_id`\n\t\t\t\t\tORDER BY `tc` DESC\n\t\t\t\t\tLIMIT 10\");\n\n });\n\n return $tags;\n}",
"function get_top_topics($limit_count = 10, $criteria = 'posts', $order = 'DESC', $no_forum_ary = array())\n{\n\tglobal $db;\n\t$return_ary = array();\n\t\n\t$forum_sql = '';\n\tif (sizeof($no_forum_ary))\n\t{\n\t\t$forum_sql = ' AND ' . $db->sql_in_set('f.forum_id', $no_forum_ary, true);\n\t}\t\n\t\n\tswitch ($criteria)\n\t{\n\t\tcase 'posts':\n\t\t\t$sql = 'SELECT f.forum_id AS f_id, f.forum_name AS f_name, (t.topic_replies_real + 1) AS count, t.topic_id AS t_id, t.topic_title AS t_title \n\t\t\t\t\t\tFROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t \t\t\t\t\t\t\n\t\t\t\t\t\tWHERE t.forum_id = f.forum_id\n\t\t\t\t\t\t\tAND t.topic_approved = 1' . $forum_sql . '\n\t\t\t\t\t\tORDER BY count ' . $order;\t\t\t\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($temp_row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $temp_row;\n\t\t\t}\t\t\t\n\t\t\t$db->sql_freeresult($result);\t\t\t\n\t\tbreak;\n\t\t\n\t\tcase 'views':\n\t\t\t$sql = 'SELECT f.forum_id AS f_id, f.forum_name AS f_name, t.topic_views AS count, t.topic_id AS t_id, t.topic_title AS t_title \n\t\t\t\t\t\tFROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t \t\t\t\t\t\t\n\t\t\t\t\t\tWHERE t.forum_id = f.forum_id\n\t\t\t\t\t\t\tAND t.topic_approved = 1' . $forum_sql . '\t\t\t\t\t\t\n\t\t\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($temp_row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $temp_row;\n\t\t\t}\t\t\t\n\t\t\t$db->sql_freeresult($result);\t\t\t\n\t\tbreak;\n\t\t\n\t\tcase 'participation':\n\t\t\t$sql = 'SELECT COUNT(DISTINCT p.poster_id) AS count, t.topic_id as t_id, t.topic_title as t_title, f.forum_id AS f_id, f.forum_name AS f_name \n\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f \n\t\t\t\tWHERE p.topic_id = t.topic_id\n\t\t\t\t\tAND t.forum_id = f.forum_id\n\t\t\t\t\tAND p.post_approved = 1' . $forum_sql . '\n\t\t\t\tGROUP BY t_id \n\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($temp_row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $temp_row;\n\t\t\t}\t\t\t\n\t\t\t$db->sql_freeresult($result);\t\t\t\n\t\tbreak;\n\t\t\n\t\tcase 'attachments':\n\t\t\t$sql = 'SELECT COUNT(at.attach_id) AS count, at.topic_id as t_id, t.topic_title as t_title, f.forum_id AS f_id, f.forum_name AS f_name \n\t\t\t\tFROM ' . ATTACHMENTS_TABLE . ' at, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f \n\t\t\t\tWHERE at.topic_id = t.topic_id\n\t\t\t\t\tAND t.forum_id = f.forum_id\n\t\t\t\t\tAND t.topic_approved = 1' . $forum_sql . '\n\t\t\t\tGROUP BY t_id \n\t\t\t\tORDER BY count ' . $order;\n\t\t\t$result = $db->sql_query_limit($sql, $limit_count);\n\t\t\twhile ($temp_row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$return_ary[] = $temp_row;\n\t\t\t}\t\t\t\n\t\t\t$db->sql_freeresult($result);\t\t\t\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t}\n\t\n\treturn $return_ary;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get base for links from the request object. | protected function get_link_base( $request ) {
return add_query_arg( $request->get_query_params(), rest_url( $request->get_route() ) );
} | [
"protected function get_base_url(){\n\t\treturn $this->request->path;\n\t}",
"private function getBase() {\n $current_request = $this->requestStack->getCurrentRequest();\n return $current_request->getSchemeAndHttpHost() . $current_request->getBasePath();\n }",
"public function getUrlBase()\n\t{\n\t\treturn $this->_getUrl();\n\t}",
"public function getLinkRoot()\n {\n return $this->request->getLinkRoot();\n }",
"private function getBaseUrl ()\n\t{\n\t\t# If the base_url isn't given: use the request's root\n\t\tif(is_null($this->config['base_url']) || trim($this->config['base_url']) == '')\n\t\t{\n\t\t\treturn Request::root();\n\t\t}\n\n\t\t# Return the base_url from the config\n\t\treturn $this->config['base_url'];\n\t}",
"private function base_url() {\n global $config;\n if(isset($config['base_url']) && $config['base_url']) return $config['base_url'];\n\n $url = '';\n $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';\n $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';\n if($request_url != $script_url) {\n $url = trim(preg_replace('/'. str_replace('/', '\\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/');\n }\n\n $protocol = $this->get_protocol();\n return rtrim(str_replace($url, '', $protocol . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/');\n }",
"public function get_base_uri()\n\t{\n\t\treturn $this->base_url;\n\t}",
"public function getBase() {\n $headNode = $this->getDocument()->getHeadNode();\n\n return $headNode->getBaseURL();\n }",
"protected function getBaseUrl()\n {\n // Base URL is different for author searches:\n if ($this->searchType == 'author') {\n if ($this->searchSubType == 'home') {\n return $this->serverUrl.\"/Author/Home?\";\n }\n if ($this->searchSubType == 'search') {\n return $this->serverUrl.\"/Author/Search?\";\n }\n } else if ($this->searchType == 'newitem') {\n return $this->serverUrl . '/Search/NewItem?';\n } else if ($this->searchType == 'reserves') {\n return $this->serverUrl . '/Search/Reserves?';\n } else if ($this->searchType == 'favorites') {\n return $this->serverUrl . '/MyResearch/Favorites?';\n } else if ($this->searchType == 'list') {\n return $this->serverUrl . '/MyResearch/MyList/' .\n urlencode($_GET['id']) . '?';\n }\n\n // If none of the special cases were met, use the default from the parent:\n return parent::getBaseUrl();\n }",
"protected function baseUri(): string\n {\n return $this->url;\n }",
"protected function getBaseUri(): string\n {\n $baseUri = '';\n\n $routeSuffixPatterns = [\n '(api|widgets|modules|include)\\/.+',\n 'main(\\.get)?\\.php',\n '(?<!administration\\/)authentication\\/.+',\n ];\n if ($this->httpServerBag?->has('REQUEST_URI')) {\n /**\n * @var string\n */\n $requestUri = $this->httpServerBag->get('REQUEST_URI');\n if (preg_match('/^(.+?)\\/?(' . implode('|', $routeSuffixPatterns) . ')/', $requestUri, $matches)) {\n $baseUri = $matches[1];\n }\n }\n\n return rtrim($baseUri, '/');\n }",
"protected function detectBaseUri()\n {\n $baseUri = clone $this->uri;\n $baseUri = $baseUri->withQuery('')->withFragment('')->withPath(RequestInformationHelper::getScriptRequestPath($this));\n\n return $baseUri;\n }",
"function get_base_url($protocol=true)\n{\n return Request::GetBaseUrl($protocol);\n}",
"private function getBaseUri()\n {\n return $this->baseUris[$this->config['environment']];\n }",
"function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }",
"private function get_base() {\n\t\tif (preg_match('/\\<base\\shref\\s?=\\s?[\"\\']?([^\"\\'\\>\\s]+)/', $this->page, $match)) {\n\t\t\treturn rtrim($match[1],'/').'/';\n\t\t}\n\t\treturn false;\n\t}",
"public static function urlBase ()\n {\n return ESys_Application::get('config')->get('urlBase');\n }",
"public static function getBaseUrl() {\n\t\treturn base_url();\n\t}",
"public static function base_url()\n\t\t{\n\t\t\treturn rtrim(self::get_setting('base_url'), '/') . '/';\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.