query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
func Replace placeholder template ($tpl) _MSG_ variables by respective's line KEY $longopts VALUES. EXAMPLE OF $tpl fragment for getopt_msg() formating: f file= _MSG_ | function getopt_msg($tpl,$longopts) {
// falta str_replace do __DESCRIPTION__ e __PARAMETERS__ que já montam tudo.
return preg_replace_callback(
'/\-\-([a-zA-Z_0-9]+)(.+?)(_MSG_)/s',
function($m) use ($longopts) {
if (isset($longopts[$m[1]]))
$s = $longopts[$m[1]];
elseif (isset($longopts["$m[1]:"]))
$s = $longopts["$m[1]:"];
if ($s)
return "--$m[1]$m[2]$s";
else
return $m[1].$m[0];
},
$tpl
);
} | [
"function getopt_msg($tpl,$longopts,$sp1=' ',$descNameRef='_DESCR_OPTIONS_') {\n\t$tpl = preg_replace_callback(\n\t\t'/\\-\\-([a-zA-Z_0-9]+)(.+?)(_MSG_)/s',\n\t\tfunction($m) use (&$longopts) {\n\t\t\tif (isset($longopts[$m[1]])) {\n\t\t\t\t$s = $longopts[$m[1]];\n\t\t\t\tunset($longopts[$m[1]]);\n\t\t\t} elseif (isset($longopts[\"$m[1]:\"])) {\n\t\t\t\t$s = $longopts[\"$m[1]:\"];\n\t\t\t\tunset($longopts[\"$m[1]:\"]);\t\t\t\t\n\t\t\t}\n\t\t\tif ($s)\n\t\t\t\treturn \"--$m[1]$m[2]$s\";\t\t\t\n\t\t\telse\n\t\t\t\treturn $m[1].$m[0];\n\t\t},\n\t\t$tpl\n\t); // if remain longopts, continue...\n\tif ( strpos ($tpl,$descNameRef)!==false ){ // placeholder exists?\n\t\t$DESCR = '';\n\t\t$fill = 16;\n\t\tforeach ($longopts as $k=>$v) if ($k) {\n\t\t\t//if (preg_match('/^([a-z0-9])\\|([^:\\*]+)(:[^\\*]+)?(\\*)?$/i',$k,$m)) {\n\t\t\t// $DESCR.=\"\\n$sp1-$m[1]\\n\\t--\".str_pad($m[2],$fill ,' ');\n\t\t\t$DESCR.=\"\\n$sp1--\".str_pad($k,$fill ,' ');\n\t\t\t$DESCR.=$v;\n\t\t}\n\t\t$tpl = str_replace($descNameRef,$DESCR,$tpl);\n\t}\n\treturn $tpl;\n}",
"function replaceTxt($txt, $v, $tname)\r\n\t{\r\n\t\t$this->tmpl[$tname] = str_replace( \"<!-- TVAR:{$v} -->\", $txt, $this->tmpl[$tname] );\r\n\t}",
"function replaceVariables( $mail_tpl )\n\t{\n\t\tglobal $account_info, $lang, $config;\n\t\t\n\t\t$tpl_vars = array(\n\t\t\t'{site_name}' => $lang['pages+title+home'],\n\t\t\t'{site_url}' => '<a href=\"'. RL_URL_HOME .'\">'. RL_URL_HOME .'</a>',\n\t\t\t'{site_email}' => '<a href=\"mailto:'.$config['site_main_email'].'\">'.$config['site_main_email'].'</a>'\n\t\t);\n\t\t\n\t\tif ( !empty($account_info['Full_name']) && !defined('REALM') )\n\t\t{\n\t\t\t$tpl_vars['{username}'] = $account_info['Full_name'];\n\t\t\t//$tpl_vars['{name}'] = $account_info['Full_name'];\n\t\t}\n\t\t\n\t\t$mail_tpl['body'] = str_replace( PHP_EOL, '<br />', $mail_tpl['body'] );\n\t\tforeach ($tpl_vars as $key => $value)\n\t\t{\n\t\t\t$mail_tpl['subject'] = str_replace( $key, $value, $mail_tpl['subject'] );\n\t\t\t$mail_tpl['body'] = str_replace( $key, $value, $mail_tpl['body'] );\n\t\t}\n\t\t\n\t\treturn $mail_tpl;\n\t}",
"function expandShorthandPhpVariableSubstitution($tpl) {\n $tokens = token_get_all($tpl);\n $fixed = array_map(\n function($t) {\n if (is_array($t) && $t[0] == T_INLINE_HTML)\n return array($t[0], expandVariablesInTextPart($t[1]), $t[2]);\n else return $t;\n },\n $tokens);\n return reconstructPhpFromTokens($fixed);\n}",
"function templateReplace(&$TITLE,&$MENUBAR,&$ACTIONBARMODULE,&$ACTIONBARPAGE,&$BREADCRUMB,&$SEARCHBAR,&$PAGEKEYWORDS,&$INHERITEDINFO,&$CONTENT,&$FOOTER,&$DEBUGINFO,&$ERRORSTRING,&$WARNINGSTRING,&$INFOSTRING,&$STARTSCRIPTS,&$LOGINFORM) {\n\tglobal $cmsFolder;\n\tglobal $sourceFolder;\n\tglobal $templateFolder;\n\tglobal $moduleFolder;\n\tglobal $urlRequestRoot;\n\tglobal $TEMPLATEBROWSERPATH;\n\tglobal $TEMPLATECODEPATH;\n\tglobal $SITEDESCRIPTION;\n\tglobal $SITEKEYWORDS;\n\tglobal $STARTSCRIPTS;\n\tglobal $LOGINFORM;\n\tglobal $WIDGETS;\n\n\t$SITEDESCRIPTION=safe_html($SITEDESCRIPTION);\n\t$SITEKEYWORDS=safe_html($SITEKEYWORDS);\n\n\t$TEMPLATEBROWSERPATH = \"$urlRequestRoot/$cmsFolder/$templateFolder/\".TEMPLATE;\n\t$TEMPLATECODEPATH = \"$sourceFolder/$templateFolder/\".TEMPLATE;\n\tinclude ($TEMPLATECODEPATH.\"/index.php\");\n}",
"private function logWithSubstitution($msg)\n {\n $args = array($msg);\n $styleMono = 'font-family:monospace; opacity:0.8;';\n $styleReset = 'font-family:inherit; white-space:pre-wrap;';\n $cCount = \\substr_count($msg, '%c');\n for ($i = 0; $i < $cCount; $i += 2) {\n $args[] = $styleMono;\n $args[] = $styleReset;\n }\n $args[] = $this->debug->meta(array(\n 'detectFiles' => false,\n 'file' => null,\n 'line' => null,\n ));\n \\call_user_func_array(array($this->debug, 'warn'), $args);\n }",
"function mf_parse_template_variables($dbh,$form_id,$entry_id,$template_content){\n \t$mf_settings = mf_get_settings($dbh);\n\n\t\t$template_data_options = array();\n\t\t$template_data_options['strip_download_link'] = false; \n\t $template_data_options['as_plain_text']\t\t = true;\n\t $template_data_options['target_is_admin'] \t = true;\n\t\t$template_data_options['machform_path'] \t = $mf_settings['base_url'];\n\t\t\t\n\t\t$template_data = mf_get_template_variables($dbh,$form_id,$entry_id,$template_data_options);\n\t\t\t\n\t\t$template_variables = $template_data['variables'];\n\t\t$template_values = $template_data['values'];\n\n\t\t//parse the form success message with the template variables\n\t\t$template_content = str_replace($template_variables,$template_values,$template_content);\n\n\t\treturn $template_content; \t\n }",
"private function var_repl($tpl, $vars)\n {\n foreach ($vars as $k => $v) {\n $tpl = str_replace('{{$'.$k.'}}', $v, $tpl);\n }\n return $tpl;\n }",
"function tpl_do_replace($str)\r\n\t{\r\n\t\tglobal $vars, $no_eval_vars;\r\n\r\n\t\tif (is_array($vars))\r\n\t\t{\r\n\t\t\tforeach ($vars as $varname=>$varvalue)\r\n\t\t\t{\r\n\t\t\t\tif ($no_eval_vars[$varname] == false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$str = mb_ereg_replace('{' . $varname . '}', $varvalue, $str);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$replave_var_name = 'tpl_replace_var_' . $varname;\r\n\r\n\t\t\t\t\tglobal $$replave_var_name;\r\n\t\t\t\t\t$$replave_var_name = $varvalue;\r\n\r\n\t\t\t\t\t//replace using php-echo\r\n\t\t\t\t\t$str = mb_ereg_replace('{' . $varname . '}', '<?php global $' . $replave_var_name . '; echo $tpl_replace_var_' . $varname . '; ?>', $str);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $str;\r\n\t}",
"public function formatSwitch(){\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+switch \\$'.'(\\w+)'.' case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{switch \\$'.'(\\w+)'.' case (\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'}\\' near '.$matches[2].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+switch @key case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'{\\' near @key in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{switch @key case (\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'}\\' near @key in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+switch @value case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'{\\' near @value in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(preg_match('/{switch \\$key case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = '@key format error: Please use @key instead of $key near $key in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{switch \\$value case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = '@value format error: Please use @value instead of $value near $value in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(preg_match('/{switch @value case (\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'}\\' near @value in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+case (\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{case (\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{switch \\$'.'(\\w+)'.' case (\\w+)}/', $v, $matches)){\r\n\t\t\t\tif(!preg_match('/{\\/switch}/', implode('\\n', $this->template))){\r\n\t\t\t\t\t$this->switch_lines = ($k+1);\r\n\t\t\t\t\t$this->error_notice[($k+1)] = 'Switch format error: The switch tag is not close near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function vp_theme_preprocess_simplenews_multi_block(&$vars) {\n $vars['message'] = t($vars['message']);\n}",
"function _ChangePlaceholders()\n\t{\n\t\tif ($this->placeholders_changed) {\n\t\t\treturn;\n\t\t}\n\t\t$this->body['h'] = str_replace(array('%BASIC:ARCHIVELINK%', '%basic:archivelink%'), '%%mailinglistarchive%%', $this->body['h']);\n\n\t\t/**\n\t\t * This is a fix for DevEdit where it prefixed non-absolute link to make it an absolute link. (This only happens in IE6)\n\t\t *\n\t\t * This create a problem where SendStudio insert a \"customfield\" link, such as: <a href=\"%%unsubscribelink%%\">Unsubscribe me</a>,\n\t\t * and DevEdit replace it with something like: <a href=\"http://beta/ssnx/admin/de/%%unsubscribelink%%/\">Unsubscribe me</a>\n\t\t *\n\t\t * In order to fix this, I modified SendStudio insert. So insetead of inserting a \"relative link\", I insert a base-h link.\n\t\t * So the link will look like this: <a href=\"http://%%unsubscribelink%%/\">Unsubscribe me</a>.\n\t\t * This changes are made in javascript.php under InsertLink function.\n\t\t */\n\t\t$this->body['h'] = preg_replace('~<a(.*?)href=[\"|\\']http://%%(unsubscribelink|modifydetails_|sendfriend_)(\\d*?)%%/[\"|\\']>(.*?)</a>~i', '<a${1}href=\"%%${2}${3}%%\">${4}</a>',$this->body['h']);\n\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%mailinglistarchive%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace('%%mailinglistarchive%%', '<a href=\"%%mailinglistarchive%%\">%%mailinglistarchive%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%webversion%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace('%%webversion%%', '<a href=\"%%webversion%%\">%%webversion%%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = str_replace(array('%BASIC:UNSUBLINK%', '%basic:unsublink%'), '%%unsubscribelink%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%unsubscribelink%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%unsubscribelink%%', '%%UNSUBSCRIBELINK%%'), '<a href=\"%%unsubscribelink%%\">%%unsubscribelink%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%unsubscribe%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%unsubscribe%%', '%%UNSUBSCRIBE%%'), '<a href=\"%%unsubscribe%%\">%%unsubscribe%%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = str_replace(array('%BASIC:CONFIRMLINK%', '%basic:confirmlink%'), '%%confirmlink%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%confirmlink%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = str_replace(array('%%confirmlink%%','%CONFIRMLINK%'),'%confirmlink%',$this->body['h']);\n\t\t\t$this->body['h'] = str_replace('%confirmlink%', '<a href=\"%%confirmlink%%\">%%confirmlink%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%modifydetails_(.*?)%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%%MODIFYDETAILS_(.*?)%%/i', '<a href=\"%%MODIFYDETAILS_\\\\1%%\">%%MODIFYDETAILS_\\\\1%%</a>', $this->body['h']);\n\t\t}\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%basic:modifydetails_(.*?)%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%BASIC:MODIFYDETAILS_(.*?)%/i', '<a href=\"%BASIC:MODIFYDETAILS_\\\\1%\">%BASIC:MODIFYDETAILS_\\\\1%</a>', $this->body['h']);\n\t\t}\n\n\t\t$this->body['h'] = preg_replace('/%BASIC:MODIFYDETAILS_(.*?)%/i', '%%modifydetails_\\\\1%%', $this->body['h']);\n\n\t\tif (!preg_match('/<a(.+)href=[\"\\']*%%sendfriend_(.*?)%%[\"\\']*(.*)>/i', $this->body['h'])) {\n\t\t\t$this->body['h'] = preg_replace('/%%sendfriend_(.*?)%%/i', '<a href=\"%%sendfriend_\\\\1%%\">%%sendfriend_\\\\1%%</a>', $this->body['h']);\n\t\t}\n\t\t$this->placeholders_changed = true;\n\t}",
"function _setErrMsg ($_errMsgKey = '', $_SQL = NULL)\n {\n\n $_lang = $this->_CURRENT_LANG;\n\n if (!isSet($this->_ERR_MSGS[$_errMsgKey][$_lang])) {\n\n if (isSet($this->_ERR_MSGS[$_errMsgKey][$this->_DEFAULT_LANG])) {\n // Error message not found in current lang; switching to def.\n $_lang = $this->_DEFAULT_LANG;\n } else {\n // Could not find the supplied key of error message\n $this->_errors .= '$_ERR[\\'' . $_errMsgKey . \"']\\n\";\n return FALSE;\n }\n }\n\n if (@func_num_args() > 2) { // Do we have extra argument values?\n\n $_arg = @func_get_args();\n\n array_shift($_arg); // Remove $_errMsgKey value passed\n array_shift($_arg); // Remove $_SQL value passed\n\n $_cnt = count($_arg);\n\n /**\n * Create a pattern for the number of arguments passed\n */\n $_patterns = str_repeat('/%s/i,', $_cnt);\n $_patterns = explode(',', $_patterns);\n array_pop($_patterns); // Remove extra entry created by explode\n\n /**\n * When no detail requested, replace argument values with [xxx]\n */\n for ($i = 0; $i < $_cnt; $i++) {\n if ($this->_DETAIL_ERR_MSGS)\n // Slash $ signs that's in the data for displaying correctly\n $_arg[$i] = str_replace('$', '\\$', $_arg[$i]);\n else\n $_arg[$i] = '[xxx]';\n\n }\n\n /**\n * Replace the '%s' place holder with argument values passed\n * sprintf() doesn't allow array arguments.\n */\n $_err = @preg_replace($_patterns,\n $_arg,\n $this->_ERR_MSGS[$_errMsgKey][$_lang],\n 1\n );\n\n } else { // No extra arguments were passed\n\n $_err = $this->_ERR_MSGS[$_errMsgKey][$_lang];\n }\n\n if (!empty($_SQL)) {\n\n switch ($this->_DETAIL_ERR_MSGS) {\n\n case TRUE:\n\n $_err .= \"SQL: $_SQL\\nErr # \" .\n @mysql_errno($this->_dbh) . ': ' .\n @mysql_error($this->_dbh) . \"\\n\";\n\n break;\n\n default:\n\n $_err .= \"SQL Err # \" .\n @mysql_errno($this->_dbh) . ': ' .\n @mysql_error($this->_dbh) . \"\\n\";\n }\n\n }\n\n $this->_errors .= $_err;\n\n return TRUE;\n }",
"function replace_placeholders( $content, $demo_message = true ) {\r\n\r\n\t\t$placeholders = $this->list_placeholders( $content );\r\n\t\t$current_blog_id = get_current_blog_id();\r\n\t\t$blog_url = get_option( 'siteurl' );\r\n\t\t$admin_email = get_option( 'admin_email' );\r\n\t\t$blog_name = get_option( 'blogname' );\r\n\t\t$blog_description = get_option( 'blogdescription' );\r\n\t\t$date = date_i18n( get_option( 'date_format' ) );\r\n\t\t$time = date_i18n( get_option( 'time_format' ) );\r\n\r\n\t\t$message = \"This is a test message I want to try out to see if it works. This will be replaced with wordpress email content.\r\n Is it working well?\";\r\n\r\n\t\t$from_email = get_option( 'admin_email' );\r\n\t\t$user_info = get_userdata( $from_email );\r\n\t\tif ( $user_info ) {\r\n\t\t\t$display_name = $user_info->display_name;\r\n\t\t} else {\r\n\t\t\t$display_name = '';\r\n\t\t}\r\n\r\n\t\t$bg_image = defined( 'BUILDER_DEFAULT_BG_IMAGE' ) ? $this->theme_url . '/' . constant( 'BUILDER_DEFAULT_BG_IMAGE' ) : '';\r\n\t\t$header_image = defined( 'BUILDER_DEFAULT_HEADER_IMAGE' ) ? '<img src=\"' . $this->theme_url . '/' . constant( 'BUILDER_DEFAULT_HEADER_IMAGE' ) . '\" />' : '';\r\n\r\n\t\t//Sidebar\r\n\t\t$posts_list = $this->htmlemail_recent_posts();\r\n\t\t/**\r\n\t\t * Filter the post list displayed in email sidebar\r\n\t\t *\r\n\t\t * @since 2.0\r\n\t\t *\r\n\t\t * @param array $posts_list , An array of posts, containing ID and post_title for each post\r\n\t\t */\r\n\t\t$posts_list = apply_filters( 'htmlemail_sidebar_posts', $posts_list );\r\n\t\t/**\r\n\t\t * Filter the sidebar title in email template\r\n\t\t *\r\n\t\t * @since 2.0\r\n\t\t *\r\n\t\t * @param string $title , Title to be displayed in email\r\n\t\t */\r\n\t\t$sidebar_title = apply_filters( 'htmlemail_sidebar_title', $title = \"What's new\" );\r\n\r\n\t\t//Placeholder for posts\r\n\t\t$count = 1;\r\n\t\t$placeholder_posts = array();\r\n\t\tforeach ( $posts_list as $post ) {\r\n\t\t\tif ( $count > 4 ) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$placeholder_posts[\"{POST_$count}\"] = $this->short_str( $post['post_title'], '...', 10 );\r\n\t\t\t//Jugaad, to keep the template styling and links\r\n\t\t\t$placeholder_posts[ \"%7BPOST_\" . $count . \"_LINK%7D\" ] = esc_url( get_permalink( $post['ID'] ) );\r\n\t\t\t$count ++;\r\n\t\t}\r\n\t\t//Show for preview only\r\n\t\tif ( $demo_message ) {\r\n\t\t\t//Removed as it conflicts\r\n//\t\t\t$content = preg_replace( \"/({MESSAGE})/\", $message, $content );\r\n//\t\t\t$content = preg_replace( \"/(MESSAGE)/\", $message, $content );\r\n\r\n\t\t\tif ( strpos( $content, '{MESSAGE}' ) !== false ) {\r\n\t\t\t\t//Replace {MESSAGE} in template with actual email content\r\n\t\t\t\t$key = '{MESSAGE}';\r\n\t\t\t} else {\r\n\t\t\t\t//Compatibility with previous version of the plugin, as it used MESSAGE instead of {MESSAGE}\r\n\t\t\t\t$key = 'MESSAGE';\r\n\t\t\t}\r\n\t\t\t$content = str_replace( $key, $message, $content );\r\n\r\n\t\t\t$content = preg_replace( \"/({USER_NAME})/\", 'Jon', $content );\r\n\t\t}\r\n\t\t$placeholders_list = array(\r\n\t\t\t'{}' => '',\r\n\t\t\t'{SIDEBAR_TITLE}' => $sidebar_title,\r\n\t\t\t'{CONTENT_HEADER}' => '',\r\n\t\t\t'{CONTENT_FOOTER}' => '',\r\n\t\t\t'{FOOTER}' => '',\r\n\t\t\t'{FROM_NAME}' => $display_name,\r\n\t\t\t'{FROM_EMAIL}' => $from_email,\r\n\t\t\t'{BLOG_URL}' => $blog_url,\r\n\t\t\t'{BLOG_NAME}' => $blog_name,\r\n\t\t\t'{EMAIL_TITLE}' => $blog_name,\r\n\t\t\t'{ADMIN_EMAIL}' => $admin_email,\r\n\t\t\t'{BG_IMAGE}' => $bg_image,\r\n\t\t\t'{HEADER_IMAGE}' => $header_image,\r\n\t\t\t'{BLOG_DESCRIPTION}' => $blog_description,\r\n\t\t\t'{DATE}' => $date,\r\n\t\t\t'{TIME}' => $time\r\n\t\t);\r\n\t\t$placeholders_list = $placeholders_list + $placeholder_posts;\r\n\t\tforeach ( $placeholders as $placeholder ) {\r\n\t\t\tif ( ! isset( $placeholders_list [ $placeholder ] ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$content = preg_replace( \"/($placeholder)/\", $placeholders_list[ $placeholder ], $content );\r\n\t\t}\r\n\t\t//Replace admin email, left out due to escaped html\r\n\t\t$content = preg_replace( \"/(%7BADMIN_EMAIL%7D)/\", $admin_email, $content );\r\n\r\n\t\treturn $content;\r\n\t}",
"function replaceFields($tpl,$restype,$item){\n $fields = $GLOBALS[\"fields\"][$restype];\n for($i=0;$i<count($fields);$i++)\n $tpl = str_replace(\"~\".$fields[$i].\"~\",$item[$fields[$i]],$tpl);\n return $tpl;\n}",
"function ReplaceLanguageVariables($template='')\n\t{\n\t\t// Parse out the language pack variables in the template file\n\t\tpreg_match_all(\"/(?siU)(%%LNG_[a-zA-Z0-9_]{1,}%%)/\", $template, $matches);\n\n\t\tforeach ($matches[0] as $p => $match) {\n\t\t\t$langvar = str_replace(array('%', 'LNG_'), '', $match);\n\t\t\t$template = str_replace($match, GetLang($langvar), $template);\n\t\t}\n\t\tunset($matches);\n\t\treturn $template;\n\t}",
"function em_placeholder_targets($replace,$placeholder,$target){\r\n\tif( ($placeholder == \"#_EXCERPT\" || $placeholder == \"#_LOCATIONEXCERPT\") && $target == 'html' ){\r\n\t\t$replace = apply_filters('dbem_notes_excerpt', $replace);\r\n\t}elseif( $placeholder == \"#_NOTES\" || $placeholder == \"#_EXCERPT\" || $placeholder == \"#_LOCATIONEXCERPT\" ){\r\n\t\tif($target == 'html'){\r\n\t\t\t$replace = apply_filters('dbem_notes', $replace);\r\n\t\t}elseif($target == 'map'){\r\n\t\t\t$replace = apply_filters('dbem_notes_map', $replace);\r\n\t\t}else{\r\n\t\t\t$replace = apply_filters('dbem_notes_rss', $replace);\r\n\t\t\t$replace = apply_filters('the_content_rss', $replace);\r\n\t\t}\r\n\t}elseif( in_array($placeholder, array(\"#_NAME\",'#_ADDRESS','#_LOCATION','#_TOWN')) ){\r\n\t\tif ($target == \"html\"){ \r\n\t\t\t$replace = apply_filters('dbem_general', $replace); \r\n\t \t}else{\r\n\t\t\t$replace = apply_filters('dbem_general_rss', $replace);\r\n\t \t}\t\t\t\t\r\n\t}\r\n\treturn $replace;\r\n}",
"function mmrpg_prototype_option_message_markup($player_token, $subject, $lineone, $linetwo, $sprites = ''){\n $temp_optiontext = '<span class=\"multi\"><span class=\"maintext\">'.$subject.'</span><span class=\"subtext\">'.$lineone.'</span><span class=\"subtext2\">'.$linetwo.'</span></span>';\n return '<a class=\"option option_1x4 option_this-'.$player_token.'-select option_message \"><div class=\"chrome\"><div class=\"inset\"><label class=\"'.(!empty($sprites) ? 'has_image' : '').'\">'.$sprites.$temp_optiontext.'</label></div></div></a>'.\"\\n\";\n}",
"public function parseMessagePlaceholders(&$message, array &$context);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the fallback functionality when a real theme is exist | public function testFallbackOnExistingTheme()
{
// Default theme
$this->manager->addTheme($this->createThemeMock('default'));
// Prepare the request
$request = $this->createDesktopRequest();
// Sets the fallback theme resolver
$this->selector->setFallback(new InMemoryThemeResolver('default'));
$this->selector->select($request);
// Assert
$this->assertNotEquals('default', $this->holder->getTheme()->getName());
} | [
"public function testFallbackOnExistingTheme()\n {\n // Default theme\n $this->source->addTheme($this->createThemeMock('default'));\n\n // Prepare the request\n $request = $this->createDesktopRequest();\n\n // Sets the fallback theme resolver\n $this->setUpFallbackResolver('default');\n\n // Execute\n $theme = $this->selector->select($request);\n\n // Assert\n $this->assertEquals('footheme', $theme->getName());\n }",
"public function testFallbackOnEmptyTheme()\n {\n // Default theme\n $this->manager->addTheme($this->createThemeMock('default'));\n\n // Prepare the request\n $request = $this->createDesktopRequest();\n $this->resolver->setThemeName(null, $request);\n\n // Sets the fallback theme resolver\n $this->selector->setFallback(new InMemoryThemeResolver('default'));\n $theme = $this->selector->select($request);\n\n // Assert\n $this->assertEquals('default', $theme->getName());\n }",
"function test_switch_theme_bogus() {\n\t\t$template = rand_str();\n\t\t$style = rand_str();\n\t\tupdate_option('template', $template);\n\t\tupdate_option('stylesheet', $style);\n\n\t\t$theme = wp_get_theme();\n\t\t$this->assertEquals( $style, (string) $theme );\n\t\t$this->assertNotSame( false, $theme->errors() );\n\t\t$this->assertFalse( $theme->exists() );\n\n\t\t// these return the bogus name - perhaps not ideal behaviour?\n\t\t$this->assertEquals($template, get_template());\n\t\t$this->assertEquals($style, get_stylesheet());\n\t}",
"public function testOnExistingTheme()\r {\r $request = $this->createDesktopRequest();\r $this->selector->select($request);\r\r $this->assertEquals('footheme', $this->holder->getTheme()->getName());\r }",
"protected function theme_exists($theme)\n {\n }",
"protected function should_show_theme()\n {\n }",
"function testActiveTheme() {\n $this->assertTrue(wp_get_theme() == 'Project Osaka');\n\t}",
"public function test_theme_can_be_stantiated()\n {\n $theme = \\IoC::resolve('Theme');\n\n $this->assertEquals('base', $theme->_theme_name);\n\n $this->assertNotEmpty($theme);\n }",
"public function testLoadActualTheme()\n {\n $key = Keys::Generate();\n\n $this->assertNotEquals(FALSE, $key);\n }",
"function fr_theme_fallback($file)\n{\n\tif (file_exists('./themes/'.fr_selected_theme().'/'.$file)) include('./themes/'.fr_selected_theme().'/'.$file);\n\telse include('./themes/default/'.$file);\n}",
"static function themeExists($flavor='',$only_active=False){\n $reply = False;\n if (empty($flavor)) $flavor = b_cnf::get('flavor');\n if(!empty($flavor)){\n switch(HOSTED_BY_CMS){\n case 'drupal':\n\tif (function_exists('drupal_bootstrap') && function_exists('list_themes')){\n\t drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);\n\t $themes = list_themes();\n\t $reply = ($only_active\n\t\t ? !empty($themes[$flavor]->status) \n\t\t : !empty($themes[$flavor]));\n\t}\n }\n }\n return $reply;\n }",
"public function testFallbackOnNullThemeWithNullThemesIgnore()\n {\n $request = $this->createDesktopRequest();\n\n $this->resolver->setThemeName('missing_theme', $request);\n $this->selector->setFallback(new InMemoryThemeResolver(null));\n $this->selector->setOption('ignore_null_themes', true);\n\n try {\n $this->selector->select($request);\n } catch (NullThemeException $e) {\n $this->fail('When the option \"ignore null themes\" is enabled the NullThemeException should not be thrown.');\n }\n }",
"public function test_extend_theme_support_non_core_themes(): void {\n\t\tupdate_option( 'stylesheet', '' );\n\n\t\t$this->instance->register();\n\n\t\t$this->assertFalse( get_theme_support( 'web-stories' ) );\n\t}",
"public function doesThemeExist($project, $theme);",
"function _su_humsci_profile_is_legacy_theme() {\n $current_theme = \\Drupal::config('system.theme')->get('default');\n $new_themes = \\Drupal::config('su_humsci_profile.settings')\n ->get('new_themes');\n return !in_array($current_theme, $new_themes);\n}",
"public function testThemeDoesNotExist(): void {\n $install_command = [\n $this->php,\n 'core/scripts/drupal',\n 'generate-theme',\n 'test_custom_theme',\n '--name=\"Test custom starterkit theme\"',\n '--description=\"Custom theme generated from a starterkit theme\"',\n '--starterkit',\n 'foobarbaz',\n ];\n $process = new Process($install_command, NULL);\n $process->setTimeout(60);\n $result = $process->run();\n $this->assertStringContainsString('Theme source theme foobarbaz cannot be found.', trim($process->getErrorOutput()));\n $this->assertSame(1, $result);\n }",
"function test_default_theme_in_default_theme_list() {\n\t\t$latest_default_theme = WP_Theme::get_core_default_theme();\n\t\tif ( ! $latest_default_theme->exists() || 'twenty' !== substr( $latest_default_theme->get_stylesheet(), 0, 6 ) ) {\n\t\t\t$this->fail( 'No Twenty* series default themes are installed' );\n\t\t}\n\t\t$this->assertContains( $latest_default_theme->get_stylesheet(), $this->default_themes );\n\t}",
"function get_broken_themes()\n {\n }",
"public static function unsupported_theme_init() {\n\t\tif ( 0 < self::$shop_page_id ) {\n\t\t\tif ( is_product_taxonomy() ) {\n\t\t\t\tself::unsupported_theme_tax_archive_init();\n\t\t\t} elseif ( is_product() ) {\n\t\t\t\tself::unsupported_theme_product_page_init();\n\t\t\t} else {\n\t\t\t\tself::unsupported_theme_shop_page_init();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
actionLaporanMutasiIntern laporan mutasi obat alkes | public function actionLaporanMutasiIntern(){
$model = new GFMutasioaruanganT;
$format = new MyFormatter();
$model->unsetAttributes();
$model->jns_periode = "hari";
$model->tgl_awal = date('Y-m-d', strtotime('first day of this month'));
$model->tgl_akhir = date('Y-m-d');
$model->bln_awal = date('Y-m', strtotime('first day of january'));
$model->bln_akhir = date('Y-m');
$model->thn_awal = date('Y');
$model->thn_akhir = date('Y');
if (isset($_GET['GFMutasioaruanganT'])) {
$format = new MyFormatter;
$model->attributes = $_GET['GFMutasioaruanganT'];
$model->jns_periode = $_GET['GFMutasioaruanganT']['jns_periode'];
$model->tgl_awal = $format->formatDateTimeForDb($_GET['GFMutasioaruanganT']['tgl_awal']);
$model->tgl_akhir = $format->formatDateTimeForDb($_GET['GFMutasioaruanganT']['tgl_akhir']);
$model->bln_awal = $format->formatMonthForDb($_GET['GFMutasioaruanganT']['bln_awal']);
$model->bln_akhir = $format->formatMonthForDb($_GET['GFMutasioaruanganT']['bln_akhir']);
$model->thn_awal = $_GET['GFMutasioaruanganT']['thn_awal'];
$model->thn_akhir = $_GET['GFMutasioaruanganT']['thn_akhir'];
$bln_akhir = $model->bln_akhir."-".date("t",strtotime($model->bln_akhir));
$thn_akhir = $model->thn_akhir."-".date("m-t",strtotime($model->thn_akhir."-12"));
switch($model->jns_periode){
case 'bulan' : $model->tgl_awal = $model->bln_awal."-01"; $model->tgl_akhir = $bln_akhir; break;
case 'tahun' : $model->tgl_awal = $model->thn_awal."-01-01"; $model->tgl_akhir = $thn_akhir; break;
default : null;
}
$model->tgl_awal = $model->tgl_awal." 00:00:00";
$model->tgl_akhir = $model->tgl_akhir." 23:59:59";
}
$this->render('mutasiIntern/index',array(
'model'=>$model,'format'=>$format
));
} | [
"public function actionUpdate($no_surat_p38) {\n $sysMenu = PdmSysMenu::findOne(['kd_berkas' => GlobalConstMenuComponent::P38 ]);\n $session = new Session();\n $id_perkara = $session->get('id_perkara');\n $no_register = $session->get('no_register_perkara');\n $kode_kejati = $session->get('kode_kejati');\n $kode_kejari = $session->get('kode_kejari');\n $kode_cabjari = $session->get('kode_cabjari');\n $model = PdmP38::findOne(['no_surat_p38'=>$no_surat_p38]);\n $vw_saksi = PdmMsSaksi::findAll(['no_register_perkara'=>$no_register, 'jenis'=>1]);\n $vw_ahli = PdmMsSaksi::findAll(['no_register_perkara'=>$no_register, 'jenis'=>2]);\n $vw_terdakwa = VwTerdakwaT2::findAll(['no_register_perkara'=>$no_register]);\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n// $model->id_kejati = $kode_kejati;\n// $model->id_kejari = $kode_kejari;\n// $model->id_cabjari = $kode_cabjari;\n// $model->updated_by = $session->get(\"nik_user\"); \n// $model->updated_ip = $_SERVER['REMOTE_ADDR'];\n// $model->created_ip = $_SERVER['REMOTE_ADDR'];\n// $model->created_by = $session->get(\"nik_user\");\n $model->no_register_perkara = $no_register;\n// echo '<pre>';print_r($model);exit();\n $model->save();\n \n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Simpan',\n 'title' => 'Ubah Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['index']);\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'danger',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Simpan',\n 'title' => 'Error',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect('update', [\n 'model' => $model,\n 'sysMenu' => $sysMenu,\n 'no_register' => $no_register,\n 'vw_saksi' => $vw_saksi,\n 'vw_ahli' => $vw_ahli,\n 'vw_terdakwa' => $vw_terdakwa,\n ]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'sysMenu' => $sysMenu,\n 'no_register' => $no_register,\n 'vw_saksi' => $vw_saksi,\n 'vw_ahli' => $vw_ahli,\n 'vw_terdakwa' => $vw_terdakwa,\n ]);\n }\n }",
"public function addoffreurprojetsouscriptionoldAction() {\n\t $sessionmcnp = new Zend_Session_Namespace('mcnp');\n\t //$this->_helper->layout->disableLayout();\n \t $this->_helper->layout()->setLayout('layoutpublicesmc');\n \t $t_canton = new Application_Model_DbTable_EuCanton();\n $m_ville = new Application_Model_EuVilleMapper();\n\t $ville = new Application_Model_EuVille();\n\t $m_filiere = new Application_Model_EuFiliereMapper();\n\t $t_region = new Application_Model_DbTable_EuRegion();\n $t_prefecture = new Application_Model_DbTable_EuPrefecture();\n $t_pays = new Application_Model_DbTable_EuPays();\n $t_zone = new Application_Model_DbTable_EuZone();\n\n $cantons = $t_canton->fetchAll();\n\t $regions = $t_region->fetchAll();\n $pays = $t_pays->fetchAll();\n $zones = $t_zone->fetchAll();\n $prefectures = $t_prefecture->fetchAll();\n $villes = $m_ville->fetchAll();\n\t $filieres = $m_filiere->fetchAll();\n\n\t $this->view->regions = $regions;\n $this->view->zones = $zones;\n $this->view->pays = $pays;\n $this->view->prefectures = $prefectures;\n $this->view->cantons = $cantons;\n $this->view->villes = $villes;\n\t $this->view->filieres = $filieres;\n\t $request = $this->getRequest();\n\t \n\t $param = (int) $this->_request->getParam('param');\n\t \n\t $typeoffreur = new Application_Model_EuTypeOffreurProjet();\n $typeoffreurM = new Application_Model_EuTypeOffreurProjetMapper();\n $typeoffreurM->find($param,$typeoffreur);\n\t \n\t $this->view->param = $param;\n\t $this->view->souscription_montant = $typeoffreur->montant_param;\n\t \n\t if($request->isPost()) {\n\t if(isset($_POST['souscription_email']) && $_POST['souscription_email']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_type']) && $_POST['offreur_projet_type']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_membre']) && $_POST['offreur_projet_membre']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_produit']) && $_POST['offreur_projet_produit']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_nom_entrepot']) && $_POST['offreur_projet_nom_entrepot']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_adresse_entrepot']) && $_POST['offreur_projet_adresse_entrepot'] !=\"\"\n\t\t\t && isset($_POST['offreur_projet_attestation']) && $_POST['offreur_projet_attestation'] == 1) {\n\t\t\t\t $db = Zend_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\t\t try {\n\t\t\t\t $param = (int) $this->_request->getParam('param');\n\t\t\t\t $id_utilisateur_acnev = 1;\n $id_utilisateur_filiere = 2;\n $id_utilisateur_technopole = 3;\n\n\t\t\t\t $membremorale = new Application_Model_EuMembreMorale();\n\t $m_mapmorale = new Application_Model_EuMembreMoraleMapper();\n\n $compte = new Application_Model_EuCompte();\n $map_compte = new Application_Model_EuCompteMapper();\n\n\t\t\t $contrat = new Application_Model_EuContrat();\n $map_contrat = new Application_Model_EuContratMapper();\n\n\t\t\t\t $m_depotvente = new Application_Model_EuDepotVenteMapper();\n\t\t\t\t $depotvente = new Application_Model_EuDepotVente();\n\t\t\t\t \n\t\t\t\t $typeoffreur = new Application_Model_EuTypeOffreurProjet();\n $m_typeoffreur = new Application_Model_EuTypeOffreurProjetMapper();\n $m_typeoffreur->find($param,$typeoffreur);\n\t\t\t\t \n\t\t\t\t $m_mstiers = new Application_Model_EuMstiersMapper();\n $mstiers = new Application_Model_EuMstiers();\n\t\t\t\t\t\t\t \n //$m_dmscm = new Application_Model_EuDetailMscmMapper();\n //$dmscm = new Application_Model_EuDetailMscm();\n\n\t\t\t\t $finddepot = $m_depotvente->fetchAllByMembre($request->getParam(\"offreur_projet_membre\"));\n $findmstiers = $m_mstiers->fetchAllByMembre($request->getParam(\"offreur_projet_membre\"));\n\n $date_id = Zend_Date::now();\n\n\t\t\t\t $bon_neutre = new Application_Model_EuBonNeutre();\n $bon_neutre_mapper = new Application_Model_EuBonNeutreMapper();\n\n $id_type_acteur = \"\";\n\t\t\t $id_type_creneau = \"\";\n\t\t\t\t \n\t\t\t\t $souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t $statut = $request->getParam(\"liste\");\n\n\t\t\t\t $findmembre = $m_mapmorale->find($_POST['offreur_projet_membre'],$membremorale);\n\t\t\t\t if($findmembre == false) {\n\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmcnp->error = \"Le numéro du membre offreur de projet ou de Biens,Produits et Service est introuvable ...\";\n\t\t\t\t\t return;\n\t\t\t\t }\n\n\t\t\t\t $souscription_type_candidat= $request->getParam(\"souscription_type_candidat\");\n\t\t\t\t if(($souscription_type_candidat != 6 && $souscription_type_candidat != 7)) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmcnp->error = \"Le type de CMFH doit être celui d'un CMFH Offreur de projet ou d'un Offreur de BPS ...\";\n\t\t\t\t\t return;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if($typeoffreur->montant_param < $souscription_montant) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmcnp->error = \"Le montant de souscription ne doit pas etre inferieur au montant predefini ...\";\n\t\t\t\t\t return; \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $offreur_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t $offreur_code_membre = '';\n\t\t\t\t \n\t\t\t\t $bon_neutre = $bon_neutre_mapper->fetchAllByCode($request->getParam(\"code_BAn\"));\n\t\t\t\t if(count($bon_neutre) == 0) {\n\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmcnp->error = \"Votre Code BAn incorrect ...\";\n\t\t\t\t\t return; \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if(($bon_neutre->bon_neutre_montant_solde < $souscription_montant)) {\n\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Montant restant du BAn est insuffisant ...\";\n return; \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t if((count($bon_neutre) > 0) && ($bon_neutre->bon_neutre_montant_solde >= $souscription_montant)) {\n\t\t\t\t $bon_neutre2 = new Application_Model_EuBonNeutre();\n\t\t\t\t\t $bon_neutre2M = new Application_Model_EuBonNeutreMapper();\n\t\t\t\t\t $bon_neutre2M->find($bon_neutre->bon_neutre_id,$bon_neutre2);\n\t\t\t\t\t\t \n\t\t\t\t\t $offreur_code_membre = $bon_neutre2->bon_neutre_code_membre;\n\t\t\t\t\t \n\t\t\t\t\t $bon_neutre_detail = new Application_Model_EuBonNeutreDetail();\n\t\t\t\t\t $bon_neutre_detailM = new Application_Model_EuBonNeutreDetailMapper();\n\t\t\t\t\t\t\t \n\t\t\t\t\t $lignesdetbon = $bon_neutre_detailM->fetchAllByBonNeutreValide($bon_neutre->bon_neutre_id);\n\t\t\t\t\t $cumulbon = $bon_neutre_detailM->getSumByBonNeutre($bon_neutre->bon_neutre_id);\n\t\t\t\t\t \n\t\t\t\t\t if(($lignesdetbon == NULL) || ($bon_neutre->bon_neutre_montant_solde < $souscription_montant) || ($cumulbon < $souscription_montant)) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Montant restant du BAn est insuffisant ...\";\n return; \n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if(($offreur_membre != $offreur_code_membre)) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Le code membre du CMFH doit être celui du bon neutre ...\";\n return; \n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t $i = 0;\n\t\t\t\t\t $reste = $souscription_montant;\n\t\t\t\t\t $nbre_lignesdetbon = count($lignesdetbon);\n\t\t\t\t\t while($reste > 0 && $i < $nbre_lignesdetbon) {\n $lignedetbon = $lignesdetbon[$i];\n $id = $lignedetbon->getBon_neutre_detail_id();\n\t\t\t\t\t\t $finddetbon = $bon_neutre_detailM->find($id,$bon_neutre_detail);\n\t\t\t\t\t\t if($reste >= $lignedetbon->getBon_neutre_detail_montant_solde()) {\n\t\t\t\t\t\t $reste = $reste - $lignedetbon->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\tif($bon_neutre_detail->bon_neutre_appro_id > 0) {\n $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $bon_neutre_detail->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\t\t\t \n foreach($appro_detail as $appro) {\n\t\t\t\t\t\t\t $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id,$appro->bon_neutre_detail_id,$bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n\t\t\t\t\t\t\t\t\t\t \n }\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $lignedetbon->getBon_neutre_detail_montant_solde())\n\t\t ->setBon_neutre_detail_montant_solde(0);\n $bon_neutre_detailM->update($lignedetbon);\n\n\n\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t \n\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t }\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($lignedetbon->getBon_neutre_detail_montant_solde());\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n \t\t $bon_neutre_utilise->setUsertable(\"utilisateur\");\n \t\t $bon_neutre_utilise->setUser_id(1);\n\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\t\t\t\t\t \n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t if($bon_neutre_detail->bon_neutre_appro_id > 0) {\n $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $reste;\n foreach ($appro_detail as $appro) {\n $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id, $appro->bon_neutre_detail_id, $bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n }\t\t\t\t\t\t\t\t \n }\n\t\t\t\t\t\t\t\t \n //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t\t\t$lignedetbon->setBon_neutre_detail_montant_solde($lignedetbon->getBon_neutre_detail_montant_solde() - $reste);\n\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $reste);\n $bon_neutre_detailM->update($lignedetbon);\n\t\t\t\t\t\t \n\n\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t \n\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t }\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($reste);\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n \t\t $bon_neutre_utilise->setUsertable(\"utilisateur\");\n \t\t $bon_neutre_utilise->setUser_id(1);\n\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\t\t\t\t\t \n\t\t\t\t\t\t $reste = 0;\n\t\t\t\t\t\t }\n $i++;\t\t\t\t\t\t\n\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\n\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_utilise($bon_neutre->bon_neutre_montant_utilise + $souscription_montant);\n\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_solde($bon_neutre->bon_neutre_montant_solde - $souscription_montant);\n\t\t\t\t\t //$bon_neutre2->setBon_neutre_code_membre($offreur_membre);\n\t\t\t\t\t $bon_neutre2M->update($bon_neutre2);\n\t\t\t\t\t\t \n\t\t\t\t\t /*$bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t \n\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t }\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($souscription_montant);\n\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);*/\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t\t\t\t\t $select = $eusouscription->select();\n\n $select->where(\"LOWER(REPLACE(souscription_raison, ' ', '')) = ? \", strtolower(str_replace(\" \", \"\",$membremorale->raison_sociale)));\n\t\t\t\t\t $select->order(array(\"souscription_id ASC\"));\n\t $select->limit(1);\n\t $rowseusouscription = $eusouscription->fetchRow($select);\n\t\t if(count($rowseusouscription) > 0) {\n\t\t\t $souscription_ok = 1;\n\t\t\t $souscription_first = $rowseusouscription->souscription_id;\n\t\t\t } else {\n\t\t\t $souscription_ok = 0;\n\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t $select = $eusouscription->select()->where('souscription_login = ?',$request->getParam(\"souscription_login\"));\n\t\t\t\t\t \n\t\t\t\t\t if($rowseusouscription = $eusouscription->fetchRow($select) && $request->getParam(\"souscription_login\") != \"\" && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Login déjà existant ...\";\n\t\t\t\t\t\t return;\n\t } else if($request->getParam(\"souscription_passe\") != $request->getParam(\"confirme\") && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Mot de passe incorret ...\";\n\t\t\t\t\t\t return;\n\t }\n\t\t\t\t\t \n\t\t\t\t\t $date_id = Zend_Date::now();\n\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n $souscription_mapper = new Application_Model_EuSouscriptionMapper();\t\n\n $compteur_souscription = $souscription_mapper->findConuter() + 1;\n\t\t\t\t\t $souscription->setSouscription_id($compteur_souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_raison($membremorale->raison_sociale);\n $souscription->setCode_type_acteur($membremorale->code_type_acteur);\n $souscription->setCode_statut($membremorale->code_statut);\n\t\t\t\t\t $souscription->setSouscription_mobile($membremorale->portable_membre);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_membreasso(1);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_type(\"BAn\");\n $souscription->setSouscription_numero($bon_neutre->bon_neutre_code);\n $souscription->setSouscription_date_numero($bon_neutre->bon_neutre_date);\n\t\t\t \n $souscription->setSouscription_banque(null);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_montant($souscription_montant);\n $souscription->setSouscription_nombre(null);\n $souscription->setSouscription_programme(\"CMFH\");\n $souscription->setSouscription_type_candidat($request->getParam(\"souscription_type_candidat\"));\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $souscription->setSouscription_vignette(null);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setCode_activite(null);\n $souscription->setId_metier(null);\n $souscription->setId_competence(null);\n\t\t\t\t\t $m_ville->find($request->getParam(\"offreur_projet_ville\"),$ville);\n $souscription->setSouscription_ville($ville->lib_ville);\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_quartier($request->getParam(\"offreur_projet_quartier\"));\n\t\t\t \n\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n $souscription->setSouscription_login($request->getParam(\"souscription_login\"));\n $souscription->setSouscription_passe($request->getParam(\"souscription_passe\"));\n\t\t\t\t\t } else {\n $souscription->setSouscription_login(null);\n $souscription->setSouscription_passe(null);\n }\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t if($souscription_ok == 1) {\n $souscription->setSouscription_souscription($souscription_first);\n\t\t\t\t } else {\n $souscription->setSouscription_souscription($compteur_souscription);\n\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setSouscription_autonome(0);\n\t\t\t $souscription->setPublier(0);\n\t\t\t\t\t $souscription->setErreur(0);\n\t\t\t\t\t $souscription->setId_canton($request->getParam(\"id_canton\"));\n $souscription_mapper->save($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t ///////////////////////////////////////////// validation acnev //////////////////////////////////\n\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setPublier(1);\n\t\t\t\t\t $souscriptionM->update($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_acnev);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t ///////////////////////////////////////////// validation filiere //////////////////////////////////\n\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setPublier(2);\n\t\t\t\t\t $souscriptionM->update($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_filiere);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t\t\n\t\t\t\t\t ///////////////////////////////////////////// validation technopole //////////////////////////////////\n\t\t\t\t\t\t\n\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setPublier(3);\n\t\t\t\t\t $souscriptionM->update($souscription);\n\n\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_technopole);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t \n\t\t\t\t\t // --- Faire la demande de configuration ----///////\n\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $date_idd = clone $date_id;\n\t\t\t\t\t $demande = new Application_Model_EuDemandeConfigte();\n $m_demande = new Application_Model_EuDemandeConfigteMapper();\n\t\t\t\t\t $finddemande = $m_demande->findbymembre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t \n\t\t\t\t\t if($finddemande == false) {\n\t\t\t\t\t $compteur_demande = $m_demande->findConuter() + 1;\n\t\t\t $demande->setId_demande($compteur_demande);\n $demande->setNom_produit($request->getParam(\"offreur_projet_produit\"));\n $demande->setCode_membre_morale($request->getParam(\"offreur_projet_membre\"));\n\t\t\t $demande->setValider(3);\n\t\t\t $demande->setId_canton($request->getParam(\"id_canton\"));\n\t\t\t $demande->setDate_demande($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $demande->setProduit_special(1);\n\t\t\t\t\t\t $demande->setProduit_ordinaire(0);\n\t\t\t $m_demande->save($demande);\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //--- Début de l'opération de mise sur chaine ---\n\t\t\t\t\t $code = $_POST['offreur_projet_membre'];\n\t\t\t\t\t $code_zone = $request->getParam(\"code_zone\");\n\t\t\t\t\t $id_filiere = $_POST['offreur_projet_filiere'];\n\t\t\t\t\t $code_agence = substr($code,0,12);\n\t\t\t\t $table = new Application_Model_DbTable_EuActeur();\n\t\t\t\t\t $model_acteur = new Application_Model_EuActeur();\n\t\t\t\t\t $mapper_acteur = new Application_Model_EuActeurMapper();\n $selection = $table->select();\n $selection->where('code_membre like ?',$code_agence.'%');\n $selection->where('type_acteur like ?','gac_surveillance');\n $resultat = $table->fetchAll($selection);\n $trouvacteursur = $resultat->current();\n $code_acteur = $trouvacteursur->code_acteur;\n $acteur = $code_acteur;\n\t\t\t\t\t \n\t\t\t\t\t $findacteur = $mapper_acteur->findByActeur($code);\n\t\t\t\t\t \n\t\t\t\t\t if($findacteur == false) {\n\t\t\t\t\t if(($param == 1) || ($param == 4) || ($param == 7)) {\n\t\t\t\t\t\t $id_type_acteur = 1;\n\t\t\t\t\t\t }\t\t \n\t\t\t\t\t\t if(($param == 2) || ($param == 5) || ($param == 8)) {\n\t\t\t\t\t\t $id_type_acteur = 2;\n\t\t\t\t\t\t } \n\t\t\t\t\t\t if(($param == 3) || ($param == 6) || ($param == 9)) {\n\t\t\t\t\t\t $id_type_acteur = 3;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t if(($param == 1) || ($param == 2) || ($param == 3)) {\n\t\t\t\t\t\t $id_type_creneau = 3;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t if(($param == 4) || ($param == 5) || ($param == 6)) {\n\t\t\t\t\t\t $id_type_creneau = 2;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t if(($param == 7) || ($param == 8) || ($param == 9)) {\n\t\t\t\t\t\t $id_type_creneau = 1;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// insertion dans la table eu_acteur_creneau\n\t\t\t\t\t\t\t$cm = new Application_Model_EuActeurCreneauMapper();\n $acren = new Application_Model_EuActeurCreneau();\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$rep_mapper = new Application_Model_EuRepresentationMapper();\n\t\t\t\t $rep = $rep_mapper->findbyrep($code);\n\t\t\t\t\t\t\n\t\t\t\t\t\t $acren->setNom_acteur($membremorale->getRaison_sociale());\n $acren->setCode_membre($code);\n $acren->setId_type_acteur($id_type_acteur);\n \n $acren->setCode_membre_gestionnaire($rep->getCode_membre());\n $acren->setDate_creation($date_idd->toString('yyyy-MM-dd'));\n $acren->setId_utilisateur(null);\n $acren->setGroupe(null);\n $acren->setCode_creneau(NULL);\n $acren->setCode_gac_filiere(NULL);\n $acren->setCode_gac(NULL);\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t $code_acteur = $cm->getLastActeurByCrenau($code_zone);\n if($code_acteur == NULL) {\n $code_acteur = 'A' . $code_zone . '0001';\n } else {\n $num_ordre = substr($code_acteur, -4);\n $num_ordre++;\n $code_acteur = 'A' . $code_zone . str_pad($num_ordre, 4, 0, STR_PAD_LEFT);\n }\n\t\t\t\t\t\t\n $acren->setCode_acteur($code_acteur);\n $acren->setId_filiere($id_filiere);\n $cm->save($acren);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t // Insertion dans la table eu_acteur\n\t\t\t\t $t_acteur = new Application_Model_DbTable_EuActeur();\n\t\t\t\t $c_acteur = new Application_Model_EuActeur();\n\t\t\t\t\t\t\t\t $count = $c_acteur->findConuter() + 1;\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t // Mise à jour des tables\n\t\t\t\t $filiere = new Application_Model_EuFiliere();\n $map_filiere = new Application_Model_EuFiliereMapper();\n $find_filiere = $map_filiere->find($id_filiere,$filiere);\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $c_acteur->setId_acteur($count)\n ->setCode_acteur(NULL)\n ->setCode_division($filiere->getCode_division())\n ->setCode_membre($code)\n ->setId_utilisateur(NULL)\n ->setDate_creation($date_idd->toString('yyyy-MM-dd'));\n\t\t\t\t if($id_type_acteur == 3) {\n\t\t\t\t\t $c_acteur->setCode_activite('DETAILLANT');\n\t\t\t } else if($id_type_acteur == 2) {\n\t\t\t\t\t $c_acteur->setCode_activite('SEMI-GROSSISTE');\n\t\t\t } else if($id_type_acteur == 1) {\n\t\t\t\t\t $c_acteur->setCode_activite('GROSSISTE');\n\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t $c_acteur->setCode_source_create('SOURCE');\n $c_acteur->setCode_monde_create('MONDE');\n $c_acteur->setCode_zone_create($code_zone);\n $c_acteur->setId_pays($request->getParam(\"id_pays\"));\n $c_acteur->setId_region($request->getParam(\"id_region\"));\n $c_acteur->setCode_secteur_create($request->getParam(\"id_prefecture\"));\n $c_acteur->setCode_agence_create($request->getParam(\"id_canton\"));\n \n\t\t\t\t\t\t\t\tif($id_filiere == 4) {\n\t\t\t\t\t\t\t\t $c_acteur->setType_acteur('PBF');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $c_acteur->setType_acteur(NULL);\n\t\t\t\t\t\t\t\t}\n \n $c_acteur->setCode_gac_chaine($acteur);\n $t_acteur->insert($c_acteur->toArray());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Mise à jour de la table eu_utilisateur\n $user_mapper = new Application_Model_EuUtilisateurMapper();\n $userin = new Application_Model_EuUtilisateur();\n\t\t\t\t $trouveuser = false;\n\t\t\t\t $code_type_acteur = $membremorale->getCode_type_acteur();\n\t\t\t\t\n\t\t\t\t $finduser = $user_mapper->findByMembre($code,\"personne_morale\");\n\t\t\t\t if($finduser != false) {\n\t\t\t\t $trouveuser = $user_mapper->find($finduser->id_utilisateur,$userin);\n\t\t\t\t }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($trouveuser) {\n\t\t\t\t\t\t\t\t if($id_filiere == 4) {\n\t\t\t\t\t\t\t\t if($id_type_acteur == 3) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_detaillant');\n $userin->setCode_gac_filiere('pbf_detaillant');\n $userin->setCode_groupe_create('pbf_detaillant');\n\t\t\t\t\t\t\t\t\t } elseif($id_type_acteur == 2) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('pbf_semi_grossiste');\n\t\t\t\t\t\t\t\t\t } elseif($id_type_acteur == 1) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('pbf_grossiste');\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t if($id_type_acteur == 3 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } \n elseif($id_type_acteur == 3 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n }\n\t\t\t\t\t\t\t\t elseif($id_type_acteur == 2 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t $userin->setId_filiere($id_filiere);\n $user_mapper->update($userin);\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t/*if($trouveuser) {\n\t\t\t\t\t\t\t if($id_type_acteur == 3 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } \n elseif($id_type_acteur == 3 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n } \n elseif($id_type_acteur == 1 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n }\n\t\t\t\t $userin->setId_filiere($id_filiere);\n $user_mapper->update($userin);\t\t\t \n\t\t }*/\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t // Mise à jour de la table eu_membre_morale\n\t\t\t\t $membremorale->setId_filiere($id_filiere);\n\t\t\t\t $m_mapmorale->update($membremorale);\n\t\t\t\t\t \n\t\t\t\t\t\t\t //script de creation de TE des vendeurs ou offreurs de projet\n\t\t\t\t\t\t\t $prk = new Application_Model_EuPrk();\n $m_prk = new Application_Model_EuPrkMapper();\n\t\t\t\t\t\t\t \t \n $te = new Application_Model_EuTegc();\n\t\t\t\t\t\t\t $m_te = new Application_Model_EuTegcMapper();\n\t\t\t\t\t\t\t $code_te = \"\";\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $nom_tegc = $membremorale->raison_sociale;\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $eutegc = new Application_Model_DbTable_EuTegc();\n $select = $eutegc->select();\n\t\t\t\t\t\t\t $select->where(\"code_membre like ? \", $code);\n $rowseutegc = $eutegc->fetchAll($select);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t if(count($rowseutegc) <= 0) {\n\t\t\t\t\t\t\t $code_te = $m_te->getLastTegcByMembre($code);\n\t\t\t\t\t\t\t\t if($code_te == NULL) {\n\t\t\t $code_te = 'TEGCP'.$id_filiere.$code. '00001'; \n\t\t\t } else {\n\t\t\t $num_ordre = substr($code_te, -5);\n $num_ordre++;\n $code_te = 'TEGCP'.$id_filiere.$code.str_pad($num_ordre,5,0,STR_PAD_LEFT); \n\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $te->setCode_tegc($code_te);\n\t\t\t $te->setId_filiere($id_filiere);\n\t\t\t $te->setMdv(12);\n\t\t\t $te->setTranche_payement(1);\n\t\t\t $te->setCode_membre($code);\n $te->setCode_membre_physique(null);\t\t\t\t\t\t\t\t \n\t\t\t $te->setMontant(0);\n\t\t\t $te->setMontant_utilise(0);\n\t\t\t $te->setSolde_tegc(0);\n\t\t\t $te->setId_utilisateur(NULL);\n\t\t\t $te->setNom_tegc($nom_tegc);\n\t\t\t $te->setNom_produit($request->getParam(\"offreur_projet_produit\"));\n\t\t\t $te->setDate_tegc($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $te->setType_tegc(\"DISTRIBUTEUR\");\n\t\t\t\t\t\t\t\t $te->setRecurrent_illimite(0);\n\t\t\t\t\t\t\t\t $te->setRecurrent_limite(0);\n\t\t\t\t\t\t\t\t $te->setNonrecurrent(1);\n\t\t\t\t\t\t\t\t $te->setPeriode1(0);\n\t\t\t\t\t\t\t\t $te->setPeriode2(0);\n\t\t\t\t\t\t\t\t $te->setPeriode3(0);\n\t\t\t\t\t\t\t\t $te->setFormel(0);\n\t\t\t\t\t\t\t\t $te->setRegime_tva(0);\n\t\t\t\t\t\t\t\t $te->setSpecial(0);\n\t\t\t\t\t\t\t\t $te->setOrdinaire(0);\n\t\t\t\t\t\t\t\t $te->setSubvention(0);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t $te->setCode_zone($request->getParam(\"code_zone\"));\n\t\t\t\t $te->setId_pays($request->getParam(\"id_pays\"));\n\t\t\t\t $te->setId_region($request->getParam(\"id_region\"));\n\t\t\t\t $te->setId_prefecture($request->getParam(\"id_prefecture\"));\n\t\t\t\t $te->setId_canton($request->getParam(\"id_canton\"));\n\n $m_te->save($te);\n\n $id_prk = $m_prk->findConuter() + 1;\n\t\t\t\t\t $prk->setId_prk($id_prk);\n\t\t\t\t\t $prk->setCode_tegc($code_te);\n\t\t\t\t\t $prk->setValeur(null);\n\t\t\t\t\t $m_prk->save($prk);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $code_compte = 'NB-TPAGCP-'.$code;\n\t\t\t\t $res = $map_compte->find($code_compte,$compte);\n\t\t\t\t\n\t\t\t\t if(!$res) {\n $compte->setCode_cat('TPAGCP')\n ->setCode_compte($code_compte)\n ->setCode_membre(NULL)\n ->setCode_membre_morale($code)\n ->setCode_type_compte('NB')\n ->setDate_alloc($date_idd->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TPAGCP')\n ->setSolde(0);\n $map_compte->save($compte); \n }\n\t\t\t\t\n\t\t\t\t $code_comptets = 'NB-TSGCP-'.$code;\n\t\t\t\t $rests = $map_compte->find($code_comptets,$compte);\n\t\t\t\t\n\t\t\t\t if(!$rests) {\n $compte->setCode_cat('TSGCP')\n ->setCode_compte($code_comptets)\n ->setCode_membre(NULL)\n ->setCode_membre_morale($code)\n ->setCode_type_compte('NB')\n ->setDate_alloc($date_idd->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TSGCP')\n ->setSolde(0);\n $map_compte->save($compte); \n }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t // Fin script de creation des TE vendeurs ou offreurs de projet\n\t\t\t\t\n // Mise à jour de la table eu_contrat\n\t\t\t\t $findcontrat = $map_contrat->findByMembre($code);\n\t\t\t\t $trouvecontrat = $map_contrat->find($findcontrat->id_contrat,$contrat);\n\t\t\t\t $contrat->setId_type_creneau($id_type_creneau);\n\t\t\t\t $contrat->setId_type_acteur($id_type_acteur);\n\t\t\t\t $map_contrat->update($contrat);\n\t\t\t\t\t }\n\t\t\t\t\t //--- Fin de l'opération de mise sur chaine ---\n\t\t\t\t\t \n\t\t\t\t\t // Mise à jour du type de fournisseur\n\t\t\t\t\t $membremoral = new Application_Model_EuMembreMorale();\n\t $m_mapmoral = new Application_Model_EuMembreMoraleMapper();\n\t\t\t\t\t $trouvermembre = $m_mapmoral->find($_POST['offreur_projet_membre'],$membremoral);\n\t\t\t\t $membremoral->setType_fournisseur($_POST['type_fournisseur']);\n\t\t\t\t $m_mapmoral->update($membremoral);\n\t\t\t\t\t \n\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuOffreurProjet();\n $ma = new Application_Model_EuOffreurProjetMapper();\t\n\t\t\t\t\t \n\t\t\t\t\t $compteur = $ma->findConuter() + 1;\n\t\t\t\t\t $id_souscription = $compteur_souscription;\n \n $a->setOffreur_projet_id($compteur);\n $a->setOffreur_projet_type($request->getParam(\"offreur_projet_type\"));\n $a->setOffreur_projet_souscription($id_souscription);\n $a->setOffreur_projet_raison_sociale($membremorale->getRaison_sociale());\n\t\t\t\t\t $a->setOffreur_projet_code_membre($request->getParam(\"offreur_projet_membre\"));\n $a->setOffreur_projet_adresse($request->getParam(\"offreur_projet_adresse\"));\n $a->setOffreur_projet_produit($request->getParam(\"offreur_projet_produit\"));\n $a->setOffreur_projet_operationnel($_POST['offreur_projet_operationnel']);\n\t\t\t\t\t if($param >= 4) {\n\t $a->setOffreur_projet_capacite_production($request->getParam(\"offreur_projet_capacite_production\"));\n }\n\t\t\t\t\t\t\t\n\t\t\t\t\t $a->setOffreur_projet_stock_disponible($request->getParam(\"offreur_projet_stock_disponible\"));\n $a->setOffreur_projet_qte_max($request->getParam(\"offreur_projet_qte_max\"));\n $a->setOffreur_projet_qte_moyen($request->getParam(\"offreur_projet_qte_moyen\"));\n $a->setOffreur_projet_qte_min($request->getParam(\"offreur_projet_qte_min\"));\n $a->setOffreur_projet_nom_entrepot($request->getParam(\"offreur_projet_nom_entrepot\"));\n $a->setOffreur_projet_adresse_entrepot($request->getParam(\"offreur_projet_adresse_entrepot\"));\n $a->setOffreur_projet_description_projet($request->getParam(\"offreur_projet_description_projet\"));\n $a->setOffreur_projet_membreasso(0);\n $a->setOffreur_projet_date($date_id->toString('yyyy-MM-dd'));\n $a->setOffreurProjetCanton($request->getParam(\"id_canton\"));\n $a->setOffreurProjetVille($request->getParam(\"offreur_projet_ville\"));\n\t\t\t $a->setPublier($_POST['publier']);\n $ma->save($a);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////\n $offreur_projet = new Application_Model_EuOffreurProjet();\n $offreur_projetM = new Application_Model_EuOffreurProjetMapper();\n $offreur_projetM->find($compteur,$offreur_projet);\n\t\t\n $offreur_projet->setPublier(1);\n\t\t $offreur_projetM->update($offreur_projet);\n\t\t\t\t\t\t\t\n\t\t\t\t\t $id_offreur_projet = $offreur_projet->offreur_projet_id;\n\t\t\t\t\t $detailoffreur = new Application_Model_EuDetailOffreurProjet();\n $m_detailoffreur = new Application_Model_EuDetailOffreurProjetMapper();\n\t\t\t\t\t\t\t\n\t\t\t\t\t $cpte = $m_detailoffreur->findConuter() + 1;\n\t\t\t\t\t $detailoffreur->setId_detail_offreur_projet($cpte);\n\t\t\t\t\t $detailoffreur->setOffreur_projet_id($id_offreur_projet);\n\t\t\t\t\t $detailoffreur->setSouscription_id($id_souscription);\n\t\t\t\t\t $detailoffreur->setDate_detail_offreur_projet($date_id->toString('yyyy-MM-dd'));\n\t\t\t\t\t $m_detailoffreur->save($detailoffreur);\n\t\t\t\t\t\t\t \n\t\t\t\t\t /////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t $code_agence = \"\";\n\t\t\t\t\t\t\t \n\t\t\t\t\t // Création du compte utilisateur intégrateur\n $souscription = new Application_Model_EuSouscription();\n $m_souscription = new Application_Model_EuSouscriptionMapper();\n\t\t $m_souscription->find($id_souscription,$souscription);\n\t\t\t\t\t\t\t \n\t\t\t\t\t $date_id = Zend_Date::now();\n $association = new Application_Model_EuAssociation();\n $association_mapper = new Application_Model_EuAssociationMapper();\n\n $login = \"\";\n\t\t\t\t\t $password = \"\";\n\t\t\t\t\t\t\t \n\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n $compteur_association = $association_mapper->findConuter() + 1;\n $association->setAssociation_id($compteur_association);\n $association->setAssociation_mobile($souscription->souscription_mobile);\n $association->setAssociation_nom($souscription->souscription_raison);\n $association->setAssociation_numero($compteur_association.\"INT\");\n $association->setAssociation_date_agrement($date_id->toString('yyyy-MM-dd'));\n $association->setAssociation_email($souscription->souscription_email);\n $association->setAssociation_recepisse(NULL);\n $association->setAssociation_adresse($souscription->souscription_quartier.\" - \".$souscription->souscription_ville);\n $association->setAssociation_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $association->setId_filiere(NULL);\n $association->setCode_type_acteur(NULL);\n $association->setCode_statut(NULL);\n $association->setCode_agence($code_agence);\n $association->setPublier(1);\n $association_mapper->save($association);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$date_id = Zend_Date::now();\n\n $membreasso = new Application_Model_EuMembreasso();\n $membreasso_mapper = new Application_Model_EuMembreassoMapper();\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t if(($souscription->souscription_login == NULL) or ($souscription->souscription_login == '')) {\n\t\t\t\t\t\t\t //$liste = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $liste = \"abcdefghjkmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWXYZ\";\n $login = \"\";\n while(strlen($login) != 8) {\n $login .= $liste[rand(0,61)]; \n }\n\t\t\t\t\t\t\t\t $password = $login.$login; \n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t $login = $souscription->souscription_login;\n\t\t\t\t\t\t\t\t $password = $souscription->souscription_passe;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$compteur_membreasso = $membreasso_mapper->findConuter() + 1;\n $membreasso->setMembreasso_id($compteur_membreasso);\n $membreasso->setMembreasso_mobile($souscription->souscription_mobile);\n $membreasso->setMembreasso_nom($souscription->souscription_raison);\n $membreasso->setMembreasso_prenom($souscription->souscription_prenom);\n $membreasso->setMembreasso_association($compteur_association);\n $membreasso->setMembreasso_email($souscription->souscription_email);\n $membreasso->setMembreasso_login($login);\n $membreasso->setMembreasso_passe($password);\n $membreasso->setMembreasso_type(1);\n $membreasso->setMembreasso_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $membreasso->setPublier(1);\n\t\t\t\t\t\t\t\t$membreasso->setSouscription_id($souscription->souscription_id);\n\t\t\t\t\t\t\t $membreasso->setIntegrateur_id(null);\n $membreasso_mapper->save($membreasso);\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\t//insertion dans les tables eu_mscm et eu_detail_mscm\n\t\t\t\t\t //$id_souscription = $compteur_souscription;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$id_mstiers = $m_mstiers->findConuter() + 1;\n\t\t\t\t\t\t$code_ban = $request->getParam(\"code_BAn\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mstiers->setId_mstiers($id_mstiers);\n\t\t\t\t\t $mstiers->setCode_membre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t $mstiers->setMontant_souscris($souscription_montant);\n\t\t\t\t\t\t$mstiers->setMontant_utilise(0);\n\t\t\t\t\t $mstiers->setMontant_restant($souscription_montant);\n\t\t\t\t\t $mstiers->setType_souscription(\"CAPS\");\n\t\t\t\t\t\t$mstiers->setId_souscription($id_souscription);\n\t\t\t\t\t\t$mstiers->setDate_mstiers($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t$mstiers->setBon_neutre_code($code_ban);\n\t\t\t\t\t\t$mstiers->setStatut_mstiers($statut);\n $m_mstiers->save($mstiers);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription_id = $compteur_souscription;\n\t\t\t\t\t\t$code_tegc = \"\";\n\t\t\t\t\t\t$typeOpi = \"BNP\";\n\t\t\t\t\t\t$type_bnp = \"CAPS\";\n\t\t\t\t\t\t$code_banque = $request->getParam(\"code_banque\");\n\t\t\t\t\t\t$referencepaie = $request->getParam(\"num_compte\");\n\t\t\t\t\t\t$montant = $souscription_montant;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($_POST[\"code_te\"])) {\n\t\t\t\t\t\t $code_tegc = $request->getParam(\"code_te\"); \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t $eutegc = new Application_Model_DbTable_EuTegc();\n $select = $eutegc->select();\n\t\t\t\t\t\t $select->where(\"code_membre like ? \",$code);\n $select->limit(1);\n $rowseutegc = $eutegc->fetchRow($select);\n $code_tegc = $rowseutegc->code_tegc;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$url = curl_init();\n $resultjson = array();\n\t\t\t\t\t curl_setopt_array(\n\t\t\t\t\t $url,\n\t\t\t\t\t\tarray( \n CURLOPT_URL => \"http://tom.gacsource.net/jmcnpApi/souscriptionOpi/emission\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n\t\t\t\t\t\t\t CURLOPT_POSTFIELDS => \"{\n\t\t\t\t\t\t\t \\n\\t\\\"codeMembre\\\":\\\"$code\\\",\n\t\t\t\t\t\t\t \\n\\t\\\"modePaiement\\\":\\\"$code_banque\\\",\n\t\t\t\t\t\t\t\t\\n\\t\\\"referencePaiement\\\":\\\"$referencepaie\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"montant\\\":\\\"$montant\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"codeTegc\\\":\\\"$code_tegc\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"typeOpi\\\":\\\"$typeOpi\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"souscriptionId\\\":\\\"$souscription_id\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"typeBnp\\\":\\\"$type_bnp\\\"\n\t\t\t\t\t\t\t }\",\n\t\t\t\t\t\t\t CURLOPT_HTTPHEADER => array(\n \"authorization: Basic bWFub3U6a2F0YWJhbGU=\",\n \"content-type: application/json\",\n ),\n\t\t\t\t\t\t )\n\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t $response = json_decode(curl_exec($url));\n\t\t\t\t\t\t $error = curl_error($url);\n\t\t\t\t\t\t\n\t\t\t\t\t\t if(($error === '') && ($reponse->resultat == 0)) {\n\t\t\t\t\t\t $db->commit();\n\t\t\t\t\t\t\tif($finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t\t $sessionmcnp->error = \"Operation bien effectuee ... Voici votre Login et Mot de passe pour acceder a votre espace integrateur : LOGIN : \".$login.\" MOT DE PASSE : \".$password;\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $sessionmcnp->error = \"Operation bien effectuee ...\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->_redirect('/index/addoffreurprojet/param/'.$_POST['offreur_projet_type']);\n\t\t\t\t } else {\n\t\t\t\t\t\t\t$db->rollback();\n\t\t\t\t\t\t\t$this->view->param = $param;\n\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t\t\t$sessionmcnp->error = \"Echec operation ...\".$error;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t }\n\t\t\t\t curl_close($url);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t } catch(Exception $exc) {\n\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = $exc->getMessage() . ': ' . $exc->getTraceAsString();\n return;\n }\n\t\n\t } else {\n\t\t\t $this->view->param = $param;\n\t\t\t\t$this->view->souscription_montant = $souscription_montant;\n\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmcnp->error = \"Veuillez renseigner les champs obligatoires (*)\";\n\t\t\t\treturn;\n\t\t\t }\n\t\n\t }\n\t\n\t}",
"public function actionUpdateGrafik(){\n\t\tif(Yii::app()->request->isAjaxRequest) {\n\t\t\t$model = new PPLaporanindikatordokterV();\n\t\t\t$format = new MyFormatter();\n\t\t\t\tif (isset($_GET['PPLaporanindikatordokterV'])) {\n\t\t\t\t\t\t$model->attributes = $_GET['PPLaporanindikatordokterV'];\n\t\t\t\t\t\t$model->jns_periode = $_REQUEST['PPLaporanindikatordokterV']['jns_periode'];\n\t\t\t\t\t\t$model->tgl_awal = $format->formatDateTimeForDb($_REQUEST['PPLaporanindikatordokterV']['tgl_awal']);\n\t\t\t\t\t\t$model->tgl_akhir = $format->formatDateTimeForDb($_REQUEST['PPLaporanindikatordokterV']['tgl_akhir']);\n\t\t\t\t\t\t$model->bln_awal = $format->formatMonthForDb($_REQUEST['PPLaporanindikatordokterV']['bln_awal']);\n\t\t\t\t\t\t$model->bln_akhir = $format->formatMonthForDb($_REQUEST['PPLaporanindikatordokterV']['bln_akhir']);\n\t\t\t\t\t\t$model->thn_awal = $_GET['PPLaporanindikatordokterV']['thn_awal'];\n\t\t\t\t\t\t$model->thn_akhir = $_GET['PPLaporanindikatordokterV']['thn_akhir'];\n\t\t\t\t\t\t$bln_akhir = $model->bln_akhir.\"-\".date(\"t\",strtotime($model->bln_akhir));\n\t\t\t\t\t\t$thn_akhir = $model->thn_akhir.\"-\".date(\"m-t\",strtotime($model->thn_akhir.\"-12\"));\n\t\t\t\t\t\tswitch($model->jns_periode){\n\t\t\t\t\t\t\tcase 'bulan' : $model->tgl_awal = $model->bln_awal.\"-01\"; $model->tgl_akhir = $bln_akhir; break;\n\t\t\t\t\t\t\tcase 'tahun' : $model->tgl_awal = $model->thn_awal.\"-01-01\"; $model->tgl_akhir = $thn_akhir; break;\n\t\t\t\t\t\t\tdefault : null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$model->tgl_awal = $model->tgl_awal.\" 00:00:00\";\n\t\t\t\t\t\t$model->tgl_akhir = $model->tgl_akhir.\" 23:59:59\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t$index_garis = array();\n\t\t\t$result_garis = array();\n\t\t\t$periodeGrafik = $format->formatDateTimeId(date('Y-m-d',(strtotime($model->tgl_awal)))).\" s.d \".$format->formatDateTimeId(date('Y-m-d',(strtotime($model->tgl_akhir))));\n\t\t\t$return['title'] = \"Grafik Laporan Indikator Dokter <br> Periode: \".$periodeGrafik;\n\n\t\t\t$dataProviderGaris = $model->searchGrafik();\n\t\t\t$dataProviderSpeedo = $model->searchGrafik();\n\t\t\t$hasilGaris = $dataProviderGaris->getData(); \n\t\t\tforeach ($hasilGaris as $i=>$v){\n\t\t\t\tif(strlen($v['data']) > 2){\n\t\t\t\t\t$index_garis[] = $format->formatDateTimeForUser($v['data']);\n\t\t\t\t}else{\n\t\t\t\t\t$index_garis[] = $format->getMonthUser((int)$v['data']).\" \".$v['data_2'];\n\t\t\t\t}\n\t\t\t\t$result_garis[] = array($i+1,(int)$v['jumlah']);\n\t\t\t}\n\t\t\t$return['garis']['result'] = $result_garis;\n\t\t\t$return['garis']['index'] = $index_garis;\n\t\t\t$return['speedo']['result'] = (int)$dataProviderSpeedo->getTotalItemCount();\n\n\t\t\techo json_encode($return);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"public function actionPrintLaporanMutasiIntern(){\n $model = new GFMutasioaruanganT('searchLaporanMutasiIntern');\n $format = new MyFormatter();\n $model->unsetAttributes();\n $model->jns_periode = \"hari\";\n $model->tgl_awal = date('Y-m-d', strtotime('first day of this month'));\n $model->tgl_akhir = date('Y-m-d');\n $model->bln_awal = date('Y-m', strtotime('first day of january'));\n $model->bln_akhir = date('Y-m');\n $model->thn_awal = date('Y');\n $model->thn_akhir = date('Y');\n $judulLaporan = 'Laporan Mutasi Obat Alkes';\n //Data Grafik\n $data['title'] = 'Grafik Mutasi Obat Alkes';\n $data['type'] = (isset($_REQUEST['type']) ? $_REQUEST['type'] : null);\n if (isset($_REQUEST['GFMutasioaruanganT'])) {\n $model->attributes = $_REQUEST['GFMutasioaruanganT'];\n $model->jns_periode = $_REQUEST['GFMutasioaruanganT']['jns_periode'];\n $model->tgl_awal = $format->formatDateTimeForDb($_REQUEST['GFMutasioaruanganT']['tgl_awal']);\n $model->tgl_akhir = $format->formatDateTimeForDb($_REQUEST['GFMutasioaruanganT']['tgl_akhir']);\n $model->bln_awal = $format->formatMonthForDb($_REQUEST['GFMutasioaruanganT']['bln_awal']);\n $model->bln_akhir = $format->formatMonthForDb($_REQUEST['GFMutasioaruanganT']['bln_akhir']);\n $bln_akhir = $model->bln_akhir.\"-\".date(\"t\",strtotime($model->bln_akhir));\n $thn_akhir = $model->thn_akhir.\"-\".date(\"m-t\",strtotime($model->thn_akhir.\"-12\"));\n switch($model->jns_periode){\n case 'bulan' : $model->tgl_awal = $model->bln_awal.\"-01\"; $model->tgl_akhir = $bln_akhir; break;\n case 'tahun' : $model->tgl_awal = $model->thn_awal.\"-01-01\"; $model->tgl_akhir = $thn_akhir; break;\n default : null;\n }\n $model->tgl_awal = $model->tgl_awal.\" 00:00:00\";\n $model->tgl_akhir = $model->tgl_akhir.\" 23:59:59\";\n }\n\n $caraPrint = (isset($_REQUEST['caraPrint']) ? $_REQUEST['caraPrint'] : null);\n $target = 'mutasiIntern/Print';\n\n $this->printFunction($model, $data, $caraPrint, $judulLaporan, $target);\n }",
"public function addoffreurprojetsouscriptionoldAction() {\n\t $sessionmembreasso = new Zend_Session_Namespace('membreasso');\n\t\t //$this->_helper->layout->disableLayout();\n \t\t $this->_helper->layout()->setLayout('layoutpublicesmcint');\n\t\t if (!isset($sessionmembreasso->login)) {$this->_redirect('/integrateur/login');}\n \t\t $t_canton = new Application_Model_DbTable_EuCanton();\n $m_ville = new Application_Model_EuVilleMapper();\n\t\t $ville = new Application_Model_EuVille();\n\t\t $m_filiere = new Application_Model_EuFiliereMapper();\n\t\t $t_region = new Application_Model_DbTable_EuRegion();\n $t_prefecture = new Application_Model_DbTable_EuPrefecture();\n $t_pays = new Application_Model_DbTable_EuPays();\n $t_zone = new Application_Model_DbTable_EuZone();\n\t\t \n\t\t $param = (int) $this->_request->getParam('param');\n\t $typeoffreur = new Application_Model_EuTypeOffreurProjet();\n $typeoffreurM = new Application_Model_EuTypeOffreurProjetMapper();\n $typeoffreurM->find($param,$typeoffreur);\n\n $cantons = $t_canton->fetchAll();\n\t\t $regions = $t_region->fetchAll();\n $pays = $t_pays->fetchAll();\n $zones = $t_zone->fetchAll();\n $prefectures = $t_prefecture->fetchAll();\n $villes = $m_ville->fetchAll();\n\t\t $filieres = $m_filiere->fetchAll();\n\n\t\t $this->view->regions = $regions;\n $this->view->zones = $zones;\n $this->view->pays = $pays;\n $this->view->prefectures = $prefectures;\n $this->view->cantons = $cantons;\n $this->view->villes = $villes;\n\t\t $this->view->filieres = $filieres;\n\t\t $this->view->param = $param;\n\t $this->view->souscription_montant = $typeoffreur->montant_param;\n\t\t $request = $this->getRequest();\n\t\t \n\t\t if($request->isPost()) {\n\t\t $db = Zend_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\t\t\t try {\n\t\t\t if(isset($_POST['souscription_email']) && $_POST['souscription_email']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_type']) && $_POST['offreur_projet_type']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_membre']) && $_POST['offreur_projet_membre']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_produit']) && $_POST['offreur_projet_produit']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_nom_entrepot']) && $_POST['offreur_projet_nom_entrepot']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_adresse_entrepot']) && $_POST['offreur_projet_adresse_entrepot']!=\"\"\n\t\t\t && isset($_POST['offreur_projet_attestation']) && $_POST['offreur_projet_attestation'] == 1) { \n\t\t\t \n\t\t\t\t\t\t $param = (int)$this->_request->getParam('param');\n\t\t\t\t\t\t \n\t\t\t\t\t\t $id_utilisateur_acnev = 1;\n $id_utilisateur_filiere = 2;\n $id_utilisateur_technopole = 3;\n\n\t\t\t\t\t\t $membremorale = new Application_Model_EuMembreMorale();\n\t $m_mapmorale = new Application_Model_EuMembreMoraleMapper();\n\n $compte = new Application_Model_EuCompte();\n $map_compte = new Application_Model_EuCompteMapper();\n\n\t\t\t $contrat = new Application_Model_EuContrat();\n $map_contrat = new Application_Model_EuContratMapper();\n\n\t\t\t\t\t\t $m_depotvente = new Application_Model_EuDepotVenteMapper();\n\t\t\t\t $depotvente = new Application_Model_EuDepotVente();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $typeoffreur = new Application_Model_EuTypeOffreurProjet();\n $m_typeoffreur = new Application_Model_EuTypeOffreurProjetMapper();\n $m_typeoffreur->find($param,$typeoffreur);\n\t\t\t\t \n\t\t\t\t $m_mstiers = new Application_Model_EuMstiersMapper();\n $mstiers = new Application_Model_EuMstiers();\n\n\t\t\t\t\t\t $finddepot = $m_depotvente->fetchAllByMembre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t\t $findmstiers = $m_mstiers->fetchAllByMembre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t\t \n\t\t\t\t\t\t $date_id = Zend_Date::now();\n\n\t\t\t\t\t\t $bon_neutre = new Application_Model_EuBonNeutre();\n $bon_neutre_mapper = new Application_Model_EuBonNeutreMapper();\n\n\t\t\t\t\t\t $id_type_acteur = \"\";\n\t\t\t $id_type_creneau = \"\";\n\t\t\t\t\t\t \n\t\t\t\t\t\t $offreur_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t\t $souscription_montant = $request->getParam(\"souscription_montant\");\n\n\t\t\t\t\t\t $findmembre = $m_mapmorale->find($_POST['offreur_projet_membre'],$membremorale);\n\t\t\t\t\t if($findmembre == false) {\n\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t\t $this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmembreasso->error = \"Le numéro du membre offreur de projet ou de Biens,Produits et Service est introuvable ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $souscription_type_candidat= $request->getParam(\"souscription_type_candidat\");\n\t\t\t\t\t\t if(($souscription_type_candidat != 6 && $souscription_type_candidat != 7)) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmembreasso->error = \"Le type de CMFH doit être celui d'un CMFH Offreur de projet ou d'un Offreur de Bien,Produit et Service ...\";\n\t\t\t\t\t\t return;\n\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t if($typeoffreur->montant_param < $souscription_montant) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmembreasso->error = \"Le montant de souscription ne doit pas etre inferieur au montant predefini ...\";\n\t\t\t\t\t return; \n\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t $bon_neutre = $bon_neutre_mapper->fetchAllByCode($request->getParam(\"code_BAn\"));\n\t\t\t\t\t\t if(count($bon_neutre) == 0) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t\t$this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n\t\t\t\t\t $sessionmembreasso->error = \"Votre Code BAn incorrect ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(($bon_neutre->bon_neutre_montant_solde < $souscription_montant)) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t\t$this->view->souscription_montant = $souscription_montant;\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Montant restant du BAn est insuffisant ...\";\n return;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if((count($bon_neutre) > 0) && ($bon_neutre->bon_neutre_montant_solde >= $souscription_montant)) {\n\t\t\t\t\t\t $bon_neutre2 = new Application_Model_EuBonNeutre();\n\t\t\t\t\t\t $bon_neutre2M = new Application_Model_EuBonNeutreMapper();\n\t\t\t\t\t\t $bon_neutre2M->find($bon_neutre->bon_neutre_id,$bon_neutre2);\n\n\t\t\t\t\t\t $offreur_code_membre = $bon_neutre2->bon_neutre_code_membre;\n\n\t\t\t\t\t $bon_neutre_detail = new Application_Model_EuBonNeutreDetail();\n\t\t\t\t\t\t $bon_neutre_detailM = new Application_Model_EuBonNeutreDetailMapper();\n\n\t\t\t\t\t\t $lignesdetbon = $bon_neutre_detailM->fetchAllByBonNeutreValide($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t $cumulbon = $bon_neutre_detailM->getSumByBonNeutre($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t if(($lignesdetbon == NULL) || ($bon_neutre->bon_neutre_montant_solde < $souscription_montant) || ($cumulbon < $souscription_montant)) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t\t\t$this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Montant restant du BAn est insuffisant ...\";\n return;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($offreur_membre != $offreur_code_membre)) {\n\t\t\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t\t\t\t\t$this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Le code membre du CMFH doit être celui du bon neutre ...\";\n return;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t\t $i = 0;\n\t\t\t\t\t $reste = $souscription_montant;\n\t\t\t\t\t $nbre_lignesdetbon = count($lignesdetbon);\n\t\t\t\t\t\t\t while($reste > 0 && $i < $nbre_lignesdetbon) {\n $lignedetbon = $lignesdetbon[$i];\n $id = $lignedetbon->getBon_neutre_detail_id();\n\t\t\t\t\t\t $finddetbon = $bon_neutre_detailM->find($id,$bon_neutre_detail);\n\t\t\t\t\t\t\t if($reste >= $lignedetbon->getBon_neutre_detail_montant_solde()) {\n\t\t\t\t\t\t\t $reste = $reste - $lignedetbon->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\t\t if($bon_neutre_detail->bon_neutre_appro_id > 0) {\n $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $bon_neutre_detail->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\t\t\t \n foreach ($appro_detail as $appro) {\n\t\t\t\t\t\t\t\t\t $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id,$appro->bon_neutre_detail_id,$bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n\t\t\t\t\t\t\t\t\t\t \n } \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $lignedetbon->getBon_neutre_detail_montant_solde())\n\t\t ->setBon_neutre_detail_montant_solde(0);\n $bon_neutre_detailM->update($lignedetbon);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($lignedetbon->getBon_neutre_detail_montant_solde());\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n $bon_neutre_utilise->setUsertable(\"membreasso\");\n $bon_neutre_utilise->setUser_id($sessionmembreasso->membreasso_id);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\n } else {\n\t\t\t\t\t\t\t\t if($bon_neutre_detail->bon_neutre_appro_id > 0) {\n $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $reste;\n foreach ($appro_detail as $appro) {\n $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id, $appro->bon_neutre_detail_id, $bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n }\t\t\t\t\t\t\t\t \n }\n\t\t\t\t\t\t\t\t \n //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_solde($lignedetbon->getBon_neutre_detail_montant_solde() - $reste);\n\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $reste);\n $bon_neutre_detailM->update($lignedetbon);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($reste);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n $bon_neutre_utilise->setUsertable(\"membreasso\");\n $bon_neutre_utilise->setUser_id($sessionmembreasso->membreasso_id);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\n\t\t\t\t\t\t $reste = 0;\n }\n $i++;\n }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_utilise($bon_neutre->bon_neutre_montant_utilise + $souscription_montant);\n\t\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_solde($bon_neutre->bon_neutre_montant_solde - $souscription_montant);\n\t\t\t\t\t\t $bon_neutre2M->update($bon_neutre2);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t /*$bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($offreur_membre,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($souscription_montant);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);*/\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t\t\t\t\t\t $select = $eusouscription->select();\n\n $select->where(\"LOWER(REPLACE(souscription_raison, ' ', '')) = ? \", strtolower(str_replace(\" \", \"\",$membremorale->raison_sociale)));\n\t\t\t\t\t\t $select->order(array(\"souscription_id ASC\"));\n\t $select->limit(1);\n\t $rowseusouscription = $eusouscription->fetchRow($select);\n\t\t if(count($rowseusouscription) > 0) {\n\t\t\t $souscription_ok = 1;\n\t\t\t $souscription_first = $rowseusouscription->souscription_id;\n\t\t\t } else {\n\t\t\t $souscription_ok = 0;\n\t\t\t }\n\n $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t $select = $eusouscription->select()->where('souscription_login = ?',$request->getParam(\"souscription_login\"));\n\n\t\t\t\t\t\t\t if($rowseusouscription = $eusouscription->fetchRow($select) && $request->getParam(\"souscription_login\") != \"\" && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t\t\t$this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Login déjà existant ...\";\n\t\t\t\t\t\t\t return;\n\t } else if($request->getParam(\"souscription_passe\") != $request->getParam(\"confirme\") && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t\t\t$this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Mot de passe incorret ...\";\n\t\t\t\t\t\t\t return;\n\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $date_id = Zend_Date::now();\n\t\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n $souscription_mapper = new Application_Model_EuSouscriptionMapper();\n\n $compteur_souscription = $souscription_mapper->findConuter() + 1;\n\t\t\t\t\t\t $souscription->setSouscription_id($compteur_souscription);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t $souscription->setSouscription_raison($membremorale->raison_sociale);\n $souscription->setCode_type_acteur($membremorale->code_type_acteur);\n $souscription->setCode_statut($membremorale->code_statut);\n\t\t\t\t\t\t $souscription->setSouscription_mobile($membremorale->portable_membre);\n\n\t\t\t\t\t\t $souscription->setSouscription_membreasso($sessionmembreasso->membreasso_id);\n\n\t\t\t\t\t\t $souscription->setSouscription_type(\"BAn\");\n $souscription->setSouscription_numero($bon_neutre->bon_neutre_code);\n $souscription->setSouscription_date_numero($bon_neutre->bon_neutre_date);\n\n $souscription->setSouscription_banque(null);\n\n\t\t\t\t\t\t $souscription->setSouscription_montant($montant_souscription);\n $souscription->setSouscription_nombre($request->getParam(\"souscription_nombre\"));\n $souscription->setSouscription_programme(\"CMFH\");\n $souscription->setSouscription_type_candidat($request->getParam(\"souscription_type_candidat\"));\n\n\t\t\t\t\t\t $souscription->setSouscription_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $souscription->setSouscription_vignette(null);\n\n\t\t\t\t\t\t $souscription->setCode_activite(null);\n $souscription->setId_metier(null);\n $souscription->setId_competence(null);\n\t\t\t\t\t\t $m_ville->find($request->getParam(\"offreur_projet_ville\"),$ville);\n $souscription->setSouscription_ville($ville->lib_ville);\n\n\t\t\t\t\t\t $souscription->setSouscription_quartier($request->getParam(\"offreur_projet_quartier\"));\n\n\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n $souscription->setSouscription_login($request->getParam(\"souscription_login\"));\n $souscription->setSouscription_passe($request->getParam(\"souscription_passe\"));\n\t\t\t\t\t\t } else {\n $souscription->setSouscription_login(null);\n $souscription->setSouscription_passe(null);\n }\n\n\t\t\t\t\t\t if($souscription_ok == 1) {\n $souscription->setSouscription_souscription($souscription_first);\n\t\t\t\t } else {\n $souscription->setSouscription_souscription($compteur_souscription);\n\t\t\t\t\t }\n\n\t\t\t\t\t\t $souscription->setSouscription_autonome(0);\n\t\t\t $souscription->setPublier(0);\n\t\t\t\t\t $souscription->setErreur(0);\n\t\t\t\t\t $souscription->setId_canton($request->getParam(\"id_canton\"));\n $souscription_mapper->save($souscription);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t ///////////////////////////////////////////// validation acnev //////////////////////////////////\n\t\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\n\t\t\t\t\t $souscription->setPublier(1);\n\t\t\t\t\t\t $souscriptionM->update($souscription);\n\n\t\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\n\t\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_acnev);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\n\n\t\t\t\t\t\t ///////////////////////////////////////////// validation filiere //////////////////////////////////\n\t\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\n\t\t\t\t\t\t $souscription->setPublier(2);\n\t\t\t\t\t\t $souscriptionM->update($souscription);\n\n\t\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\n\t\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_filiere);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\n\t\t\t\t\t\t ///////////////////////////////////////////// validation technopole //////////////////////////////////\n\n\t\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t $souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t $souscriptionM->find($compteur_souscription, $souscription);\n\n\t\t\t\t\t\t $souscription->setPublier(3);\n\t\t\t\t\t\t $souscriptionM->update($souscription);\n\n\t\t\t\t\t\t $validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t $validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\n\t\t\t\t\t\t $compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_technopole);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t $validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $validation_quittance->setPublier(1);\n\t\t\t\t\t\t $validation_quittance_mapper->save($validation_quittance);\n\n // --- Faire la demande de configuration ----///////\n\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $date_idd = clone $date_id;\n\t\t\t\t\t $demande = new Application_Model_EuDemandeConfigte();\n $m_demande = new Application_Model_EuDemandeConfigteMapper();\n\t\t\t\t\t $finddemande = $m_demande->findbymembre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t \n\t\t\t\t\t if($finddemande == false) {\n\t\t\t\t\t $compteur_demande = $m_demande->findConuter() + 1;\n\t\t\t $demande->setId_demande($compteur_demande);\n $demande->setNom_produit($request->getParam(\"offreur_projet_produit\"));\n $demande->setCode_membre_morale($request->getParam(\"offreur_projet_membre\"));\n\t\t\t $demande->setValider(3);\n\t\t\t $demande->setId_canton($request->getParam(\"id_canton\"));\n\t\t\t $demande->setDate_demande($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $demande->setProduit_special(1);\n\t\t\t\t\t\t $demande->setProduit_ordinaire(0);\n\t\t\t $m_demande->save($demande);\n\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n ////////////////////////////////////////////////////////////////////////////////////////////////\n //--- Début de l'opération de mise sur chaine ---\n\t\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $date_idd = clone $date_id;\n\t\t\t\t\t\t $code = $_POST['offreur_projet_membre'];\n\t\t\t\t\t $code_zone = $request->getParam(\"code_zone\");\n\t\t\t\t\t\t $id_filiere = $_POST['offreur_projet_filiere'];\n\t\t\t\t\t\t $code_agence = substr($code,0,12);\n\t\t\t\t $table = new Application_Model_DbTable_EuActeur();\n\t\t\t\t\t $model_acteur = new Application_Model_EuActeur();\n\t\t\t\t\t $mapper_acteur = new Application_Model_EuActeurMapper();\n $selection = $table->select();\n $selection->where('code_membre like ?',$code_agence.'%');\n $selection->where('type_acteur like ?','gac_surveillance');\n $resultat = $table->fetchAll($selection);\n $trouvacteursur = $resultat->current();\n $code_acteur = $trouvacteursur->code_acteur;\n $acteur = $code_acteur;\n\t\t\t\t\t $findacteur = $mapper_acteur->findByActeur($code);\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($findacteur == false) {\n\t\t\t\t\t\t if(($param == 1) || ($param == 4) || ($param == 7)) {\n\t\t\t\t\t\t $id_type_acteur = 1;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($param == 2) || ($param == 5) || ($param == 8)) {\n\t\t\t\t\t\t $id_type_acteur = 2;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($param == 3) || ($param == 6) || ($param == 9)) {\n\t\t\t\t\t\t $id_type_acteur = 3;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($param == 1) || ($param == 2) || ($param == 3)) {\n\t\t\t\t\t\t $id_type_creneau = 3;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($param == 4) || ($param == 5) || ($param == 6)) {\n\t\t\t\t\t\t $id_type_creneau = 2;\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t if(($param == 7) || ($param == 8) || ($param == 9)) {\n\t\t\t\t\t\t $id_type_creneau = 1;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t //insertion dans la table eu_acteur_creneau\n\t\t\t\t\t\t $cm = new Application_Model_EuActeurCreneauMapper();\n $acren = new Application_Model_EuActeurCreneau();\n\n\t\t\t\t\t\t\t$rep_mapper = new Application_Model_EuRepresentationMapper();\n\t\t\t\t $rep = $rep_mapper->findbyrep($code);\n\n\t\t\t\t\t\t $acren->setNom_acteur($membremorale->getRaison_sociale());\n $acren->setCode_membre($code);\n $acren->setId_type_acteur($id_type_acteur);\n\n $acren->setCode_membre_gestionnaire($rep->getCode_membre());\n $acren->setDate_creation($date_idd->toString('yyyy-MM-dd'));\n $acren->setId_utilisateur(null);\n $acren->setGroupe(null);\n $acren->setCode_creneau(NULL);\n $acren->setCode_gac_filiere(NULL);\n $acren->setCode_gac(NULL);\n\n\t\t\t\t\t\t $code_acteur = $cm->getLastActeurByCrenau($code_zone);\n if($code_acteur == NULL) {\n $code_acteur = 'A' . $code_zone . '0001';\n } else {\n $num_ordre = substr($code_acteur, -4);\n $num_ordre++;\n $code_acteur = 'A' . $code_zone . str_pad($num_ordre, 4, 0, STR_PAD_LEFT);\n }\n\n $acren->setCode_acteur($code_acteur);\n $acren->setId_filiere($id_filiere);\n $cm->save($acren);\n\n\t\t\t\t\t\t // Insertion dans la table eu_acteur\n\t\t\t\t $t_acteur = new Application_Model_DbTable_EuActeur();\n\t\t\t\t $c_acteur = new Application_Model_EuActeur();\n\t\t\t\t\t\t\t$count = $c_acteur->findConuter() + 1;\n\n\t\t\t\t\t\t // Mise à jour des tables\n\t\t\t\t $filiere = new Application_Model_EuFiliere();\n $map_filiere = new Application_Model_EuFiliereMapper();\n $find_filiere = $map_filiere->find($id_filiere,$filiere);\n\n\t\t\t\t\t\t\t$c_acteur->setId_acteur($count)\n ->setCode_acteur(NULL)\n ->setCode_division($filiere->getCode_division())\n ->setCode_membre($code)\n ->setId_utilisateur(NULL)\n ->setDate_creation($date_idd->toString('yyyy-MM-dd'));\n\t\t\t\t if($id_type_acteur == 3) {\n\t\t\t\t\t $c_acteur->setCode_activite('DETAILLANT');\n\t\t\t } else if($id_type_acteur == 2) {\n\t\t\t\t\t $c_acteur->setCode_activite('SEMI-GROSSISTE');\n\t\t\t } else if($id_type_acteur == 1) {\n\t\t\t\t\t $c_acteur->setCode_activite('GROSSISTE');\n\t\t\t\t }\n\n\t\t\t $c_acteur->setCode_source_create('SOURCE');\n $c_acteur->setCode_monde_create('MONDE');\n $c_acteur->setCode_zone_create($code_zone);\n $c_acteur->setId_pays($request->getParam(\"id_pays\"));\n $c_acteur->setId_region($request->getParam(\"id_region\"));\n\t\t\t\t\t\t $c_acteur->setId_prefecture($request->getParam(\"id_prefecture\"));\n\t\t\t\t\t\t $c_acteur->setId_canton($request->getParam(\"id_canton\"));\n $c_acteur->setCode_secteur_create($request->getParam(\"id_prefecture\"));\n $c_acteur->setCode_agence_create($request->getParam(\"id_canton\"));\n \n\t\t\t\t\t\t\tif($id_filiere == 4) {\n\t\t\t\t\t\t\t $c_acteur->setType_acteur('PBF');\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $c_acteur->setType_acteur(NULL);\n\t\t\t\t\t\t };\n\n $c_acteur->setCode_gac_chaine($acteur);\n $t_acteur->insert($c_acteur->toArray());\n\n\t\t\t\t\t\t\t//Mise à jour de la table eu_utilisateur\n $user_mapper = new Application_Model_EuUtilisateurMapper();\n $userin = new Application_Model_EuUtilisateur();\n\t\t\t\t $trouveuser = false;\n\t\t\t\t $code_type_acteur = $membremorale->getCode_type_acteur();\n\n\t\t\t\t $finduser = $user_mapper->findByMembre($code,\"personne_morale\");\n\t\t\t\t if($finduser != false) {\n\t\t\t\t $trouveuser = $user_mapper->find($finduser->id_utilisateur,$userin);\n\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($trouveuser) {\n\t\t\t\t\t\t\t if($id_filiere == 4) {\n\t\t\t\t\t\t\t\t if($id_type_acteur == 3) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_detaillant');\n $userin->setCode_gac_filiere('pbf_detaillant');\n $userin->setCode_groupe_create('pbf_detaillant');\n\t\t\t\t\t\t\t\t\t } elseif($id_type_acteur == 2) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('pbf_semi_grossiste');\n\t\t\t\t\t\t\t\t\t } elseif($id_type_acteur == 1) {\n\t\t\t\t\t\t\t\t\t $userin->setCode_groupe('pbf_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('pbf_grossiste');\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t if($id_type_acteur == 3 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n } \n elseif($id_type_acteur == 3 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n } elseif($id_type_acteur == 3 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n }\n\t\t\t\t\t\t\t\t elseif($id_type_acteur == 2 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'PEI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'OE') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n } elseif($id_type_acteur == 1 && $code_type_acteur == 'POSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t $userin->setId_filiere($id_filiere);\n $user_mapper->update($userin);\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t }\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t if($trouveuser) {\n\t\t\t\t\t\t\t if($id_type_acteur == 3 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_detaillant');\n $userin->setCode_gac_filiere('oe_detaillant');\n $userin->setCode_groupe_create('oe_detaillant');\n }\n elseif($id_type_acteur == 3 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_detaillant');\n $userin->setCode_gac_filiere('ose_detaillant');\n $userin->setCode_groupe_create('ose_detaillant');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_semi_grossiste');\n } elseif($id_type_acteur == 2 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_semi_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_semi_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'EI') {\n $userin->setCode_groupe('oe_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('oe_grossiste');\n }\n elseif($id_type_acteur == 1 && $code_type_acteur == 'OSE') {\n $userin->setCode_groupe('ose_grossiste');\n $userin->setCode_gac_filiere(NULL);\n $userin->setCode_groupe_create('ose_grossiste');\n }\n\t\t\t\t $userin->setId_filiere($id_filiere);\n $user_mapper->update($userin);\n\t\t\t\t\t\t \n\t\t\t\t\t\t }*/\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t //Mise à jour de la table eu_membre_morale\n\t\t\t\t $membremorale->setId_filiere($id_filiere);\n\t\t\t\t $m_mapmorale->update($membremorale);\n\t\t\t\t\t\t\t \n $code_compte = 'NB-TPAGCP-'.$code;\n\t\t\t\t $res = $map_compte->find($code_compte,$compte);\n\n\t\t\t\t if(!$res) {\n $compte->setCode_cat('TPAGCP')\n ->setCode_compte($code_compte)\n ->setCode_membre(NULL)\n ->setCode_membre_morale($code)\n ->setCode_type_compte('NB')\n ->setDate_alloc($date_idd->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TPAGCP')\n ->setSolde(0);\n $map_compte->save($compte);\n }\n\n\t\t\t\t $code_comptets = 'NB-TSGCP-'.$code;\n\t\t\t\t $rests = $map_compte->find($code_comptets,$compte);\n\n\t\t\t\t if(!$rests) {\n $compte->setCode_cat('TSGCP')\n ->setCode_compte($code_comptets)\n ->setCode_membre(NULL)\n ->setCode_membre_morale($code)\n ->setCode_type_compte('NB')\n ->setDate_alloc($date_idd->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TSGCP')\n ->setSolde(0);\n $map_compte->save($compte);\n }\n\n // Mise à jour de la table eu_contrat\n\t\t\t\t $findcontrat = $map_contrat->findByMembre($code);\n\t\t\t\t $trouvecontrat = $map_contrat->find($findcontrat->id_contrat,$contrat);\n\t\t\t\t $contrat->setId_type_creneau($id_type_creneau);\n\t\t\t\t $contrat->setId_type_acteur($id_type_acteur);\n\t\t\t\t $map_contrat->update($contrat);\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t // --- Fin de l'opération de mise sur chaine ---\n\t\t\t\t\t\t \n\t\t\t\t\t\t //Mise à jour du type de fournisseur\n\t\t\t\t\t\t $membremoral = new Application_Model_EuMembreMorale();\n\t $m_mapmoral = new Application_Model_EuMembreMoraleMapper();\n\t\t\t\t\t\t $trouvermembre = $m_mapmoral->find($request->getParam(\"offreur_projet_membre\"),$membremoral);\n\t\t\t\t $membremoral->setType_fournisseur($request->getParam(\"type_fournisseur\"));\n\t\t\t\t $m_mapmoral->update($membremoral);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuOffreurProjet();\n $ma = new Application_Model_EuOffreurProjetMapper();\n\n\t\t\t\t\t $compteur = $ma->findConuter() + 1;\n\t\t\t\t\t $id_souscription = $compteur_souscription;\n\n $a->setOffreur_projet_id($compteur);\n $a->setOffreur_projet_type($request->getParam(\"offreur_projet_type\"));\n $a->setOffreur_projet_souscription($id_souscription);\n $a->setOffreur_projet_raison_sociale($membremorale->getRaison_sociale());\n\t\t\t\t\t $a->setOffreur_projet_code_membre($request->getParam(\"offreur_projet_membre\"));\n $a->setOffreur_projet_adresse($request->getParam(\"offreur_projet_adresse\"));\n $a->setOffreur_projet_produit($request->getParam(\"offreur_projet_produit\"));\n $a->setOffreur_projet_operationnel($request->getParam(\"offreur_projet_operationnel\"));\n\t\t\t\t\t if($param >= 4) {\n\t $a->setOffreur_projet_capacite_production($request->getParam(\"offreur_projet_capacite_production\"));\n }\n\n\t\t\t\t\t $a->setOffreur_projet_stock_disponible($request->getParam(\"offreur_projet_stock_disponible\"));\n $a->setOffreur_projet_qte_max($request->getParam(\"offreur_projet_qte_max\"));\n $a->setOffreur_projet_qte_moyen($request->getParam(\"offreur_projet_qte_moyen\"));\n $a->setOffreur_projet_qte_min($request->getParam(\"offreur_projet_qte_min\"));\n $a->setOffreur_projet_nom_entrepot($request->getParam(\"offreur_projet_nom_entrepot\"));\n $a->setOffreur_projet_adresse_entrepot($request->getParam(\"offreur_projet_adresse_entrepot\"));\n $a->setOffreur_projet_description_projet($request->getParam(\"offreur_projet_description_projet\"));\n $a->setOffreur_projet_membreasso($sessionmembreasso->membreasso_id);\n $a->setOffreur_projet_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $a->setOffreurProjetCanton($request->getParam(\"id_canton\"));\n $a->setOffreurProjetVille($request->getParam(\"offreur_projet_ville\"));\n\t\t\t $a->setPublier($_POST['publier']);\n $ma->save($a);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////\n $offreur_projet = new Application_Model_EuOffreurProjet();\n $offreur_projetM = new Application_Model_EuOffreurProjetMapper();\n $offreur_projetM->find($compteur,$offreur_projet);\n\n $offreur_projet->setPublier(1);\n\t\t $offreur_projetM->update($offreur_projet);\n\n\t\t\t\t\t $id_offreur_projet = $offreur_projet->offreur_projet_id;\n\t\t\t\t\t $detailoffreur = new Application_Model_EuDetailOffreurProjet();\n $m_detailoffreur = new Application_Model_EuDetailOffreurProjetMapper();\n\n\t\t\t\t\t $cpte = $m_detailoffreur->findConuter() + 1;\n\t\t\t\t\t $detailoffreur->setId_detail_offreur_projet($cpte);\n\t\t\t\t\t $detailoffreur->setOffreur_projet_id($id_offreur_projet);\n\t\t\t\t\t $detailoffreur->setSouscription_id($id_souscription);\n\t\t\t\t\t $detailoffreur->setDate_detail_offreur_projet($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $m_detailoffreur->save($detailoffreur);\n\t\t\t\t\t\t \n\t\t\t\t\t\t /////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t $code_agence = \"\";\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // Création du compte utilisateur intégrateur\n $souscription = new Application_Model_EuSouscription();\n $m_souscription = new Application_Model_EuSouscriptionMapper();\n\t\t $m_souscription->find($id_souscription,$souscription);\n\n\t\t\t\t\t $date_id = Zend_Date::now();\n $association = new Application_Model_EuAssociation();\n $association_mapper = new Application_Model_EuAssociationMapper();\n\n $login = \"\";\n\t\t\t\t\t\t $password = \"\";\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $compteur_association = $association_mapper->findConuter() + 1;\n $association->setAssociation_id($compteur_association);\n $association->setAssociation_mobile($souscription->souscription_mobile);\n $association->setAssociation_nom($souscription->souscription_raison);\n $association->setAssociation_numero($compteur_association.\"INT\");\n $association->setAssociation_date_agrement($date_id->toString('yyyy-MM-dd'));\n $association->setAssociation_email($souscription->souscription_email);\n $association->setAssociation_recepisse(NULL);\n $association->setAssociation_adresse($souscription->souscription_quartier.\" - \".$souscription->souscription_ville);\n $association->setAssociation_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $association->setId_filiere(NULL);\n $association->setCode_type_acteur(NULL);\n $association->setCode_statut(NULL);\n $association->setCode_agence($code_agence);\n $association->setPublier(1);\n $association_mapper->save($association);\n\n\t\t\t\t\t\t\t$date_id = Zend_Date::now();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$membreasso = new Application_Model_EuMembreasso();\n $membreasso_mapper = new Application_Model_EuMembreassoMapper();\n\n\t\t\t\t\t\t\tif(($souscription->souscription_login == NULL) or ($souscription->souscription_login == '')) {\n\t\t\t\t\t\t\t //$liste = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $liste = \"abcdefghjkmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWXYZ\";\n $login = \"\";\n while(strlen($login) != 8) {\n $login .= $liste[rand(0,61)];\n }\n\t\t\t\t\t\t $password = $login.$login;\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $login = $souscription->souscription_login;\n\t\t\t\t\t\t\t $password = $souscription->souscription_passe;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$compteur_membreasso = $membreasso_mapper->findConuter() + 1;\n $membreasso->setMembreasso_id($compteur_membreasso);\n $membreasso->setMembreasso_mobile($souscription->souscription_mobile);\n $membreasso->setMembreasso_nom($souscription->souscription_raison);\n $membreasso->setMembreasso_prenom($souscription->souscription_prenom);\n $membreasso->setMembreasso_association($compteur_association);\n $membreasso->setMembreasso_email($souscription->souscription_email);\n $membreasso->setMembreasso_login($login);\n $membreasso->setMembreasso_passe($password);\n $membreasso->setMembreasso_type(1);\n $membreasso->setMembreasso_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $membreasso->setPublier(1);\n\t\t\t\t\t\t $membreasso->setSouscription_id($souscription->souscription_id);\n\t\t\t\t\t\t\t$membreasso->setIntegrateur_id(null);\n $membreasso_mapper->save($membreasso);\n\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t//insertion dans les tables eu_mscm et eu_detail_mscm\n\t\t\t\t\t //$id_souscription = $compteur_souscription;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$id_mstiers = $m_mstiers->findConuter() + 1;\n\t\t\t\t\t\t$code_ban = $request->getParam(\"code_BAn\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mstiers->setId_mstiers($id_mstiers);\n\t\t\t\t\t $mstiers->setCode_membre($request->getParam(\"offreur_projet_membre\"));\n\t\t\t\t\t $mstiers->setMontant_souscris($souscription_montant);\n\t\t\t\t\t\t$mstiers->setMontant_utilise(0);\n\t\t\t\t\t $mstiers->setMontant_restant($souscription_montant);\n\t\t\t\t\t $mstiers->setType_souscription(\"CAPS\");\n\t\t\t\t\t\t$mstiers->setId_souscription($id_souscription);\n\t\t\t\t\t\t$mstiers->setDate_mstiers($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t$mstiers->setBon_neutre_code($code_ban);\n\t\t\t\t\t\t$mstiers->setStatut_mstiers($statut);\n $m_mstiers->save($mstiers);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Emission des OPI\n\t\t\t\t\t\t$souscription_id = $compteur_souscription;\n\t\t\t\t\t\t$code_tegc = \"\";\n\t\t\t\t\t\t$typeOpi = \"BNP\";\n\t\t\t\t\t\t$type_bnp = \"CAPS\";\n\t\t\t\t\t\t$code_banque = $request->getParam(\"code_banque\");\n\t\t\t\t\t\t$referencepaie = $request->getParam(\"num_compte\");\n\t\t\t\t\t\t$montant = $souscription_montant;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($_POST[\"code_te\"])) {\n\t\t\t\t\t\t $code_tegc = $request->getParam(\"code_te\"); \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t $eutegc = new Application_Model_DbTable_EuTegc();\n $select = $eutegc->select();\n\t\t\t\t\t\t $select->where(\"code_membre like ? \",$code);\n $select->limit(1);\n $rowseutegc = $eutegc->fetchRow($select);\n $code_tegc = $rowseutegc->code_tegc;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$url = curl_init();\n $resultjson = array();\n\t\t\t\t\t curl_setopt_array(\n\t\t\t\t\t $url,\n\t\t\t\t\t\tarray(\n CURLOPT_URL => \"http://tom.gacsource.net/jmcnpApi/souscriptionOpi/emission\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n\t\t\t\t\t\t CURLOPT_POSTFIELDS => \"{\n\t\t\t\t\t\t \\n\\t\\\"codeMembre\\\":\\\"$code\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"modePaiement\\\":\\\"$code_banque\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"referencePaiement\\\":\\\"$referencepaie\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"montant\\\":\\\"$montant\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"codeTegc\\\":\\\"$code_tegc\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"typeOpi\\\":\\\"$typeOpi\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"souscriptionId\\\":\\\"$souscription_id\\\",\n\t\t\t\t\t\t\t\\n\\t\\\"typeBnp\\\":\\\"$type_bnp\\\"\n\t\t\t\t\t\t }\",\n\t\t\t\t\t\t CURLOPT_HTTPHEADER => array(\n \"authorization: Basic bWFub3U6a2F0YWJhbGU=\",\n \"content-type: application/json\",\n ),\n\t\t\t\t\t\t)\n\t\t\t\t\t );\n\t\t\t\t\t\t\t\n\t\t\t\t $response = json_decode(curl_exec($url));\n\t\t\t\t\t $error = curl_error($url);\n\t\t\t\t\t \n\t\t\t\t\t if(($error === '') && ($reponse->resultat == 0)) {\n\t\t\t\t\t $db->commit();\n\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n $sessionmembreasso->error = \"Operation bien effectuee ... Voici votre Login et Mot de passe pour acceder à votre espace integrateur : LOGIN : \".$login.\" MOT DE PASSE : \".$password;\n\t\t } else {\n\t\t\t\t\t $sessionmembreasso->error = \"Operation bien effectuee ...\";\n\t\t\t\t\t }\n\t\t\t\t\t $this->_redirect('/integrateur/addoffreurprojet/param/'.$_POST['offreur_projet_type']); \n\t\t\t\t\t } else {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t $this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Echec Operation ...\".$error;\n\t\t\t\t\t return;\n\t\t\t\t\t } \t \n\t\t\t\t }\n\t\t\t \n\t\t\t } else {\n\t\t\t\t\t$db->rollback();\n\t\t\t\t\t$this->view->param = $param;\n\t\t\t\t $this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = \"Veuillez saisir les champs obligatoires (*) ...\";\n\t\t\t\t\treturn;\n\t\t\t\t }\n\t\t\t \n\t\t\t } catch (Exception $exc) {\n\t\t\t\t $db->rollback();\n\t $this->view->param = $param;\n\t\t\t\t $this->view->souscription_montant = $request->getParam(\"souscription_montant\");\n\t\t\t\t $this->view->souscription_email = $request->getParam(\"souscription_email\");\n\t\t\t\t $this->view->code_membre = $request->getParam(\"offreur_projet_membre\");\n $sessionmembreasso->error = $exc->getMessage() . ': ' . $exc->getTraceAsString();\n return;\n }\n\t\n\t }\n\t\n\t}",
"public function actionSelectionPiutang()\n\t{\n\t\t$menuid = 29;\n\t\t$userid_actor = Yii::app()->request->getParam('userid_actor');\n\n\t\t$allow_edit = FHelper::AllowMenu($menuid, FHelper::GetGroupId($userid_actor), 'edit');\n\t\tif ($allow_edit) {\n\t\t\t$action_type = Yii::app()->request->getParam('cboActionType');\n\t\t\t$item_list = Yii::app()->request->getParam('chkSelectedItem');\n\t\t\t//echo \"action_type = $action_type\";\n\t\t\t//echo \"<pre>\".print_r($item_list).\"</pre>\";\n\t\t\t//exit();\n\n\t\t\t$Criteria = new CDbCriteria();\n\t\t\t$Criteria->condition = 'piutang_id = :idpiutang';\n\n\t\t\tif(!empty($action_type))\n\t\t\t{\n\t\t\t\tforeach($item_list as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$Criteria->params = array(':idpiutang' => $value);\n\t\t\t\t\t$piutang = Piutang::model()->find($Criteria);\n\n\t\t\t\t\t$piutang['is_del'] = $action_type;\n\t\t\t\t\t//echo \"<pre>\".print_r($piutang).\"</pre>\";\n\t\t\t\t\t//exit();\n\n\t\t\t\t\t$piutang->update();\n\n\t\t\t\t\t//AuditLog\n\t\t\t$data = \"$piutang[piutang_id], $piutang[tgl], $piutang[faktur_no], $piutang[so_no], $piutang[nama_piutang], $piutang[total], \".\n\t\t\t\t \"$piutang[note], $piutang[is_paid], $piutang[payment_date], $piutang[status_input], \".\n\t\t\t\t\t\"$piutang[status_payment], $piutang[date_created], $piutang[created_by], $piutang[date_update], $piutang[update_by], \". \"$piutang[version]\";\n\n\t\t\t\t\tFAudit::add('KEUANGANPIUTANG', 'Del', FHelper::GetUserName($userid_actor), $data);\n\t\t\t\t}\n\n\t\t\t\t$this->success_message =\n\t\t\t\t'Data yang dipilih berhasil diupdate';\n\n\t\t\t\t$this->actionListPiutang();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bread_crumb_list = '\n\t\t\t\t\t<li>Not Authorize</li>';\n\n\t\t\t\t$this->layout = 'layout-baru';\n\n\t\t\t\t$TheContent = $this->renderPartial(\n\t\t\t\t\t'not_auth',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'userid_actor' => $userid_actor\n\t\t\t\t\t),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\techo CJSON::encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'html' => $TheContent,\n\t\t\t\t\t\t'bread_crumb_list' => $bread_crumb_list\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function actionUpdate()\n {\n\t\t$session = new Session();\n\t\t$id = $session->get('id_perkara');\n\t\t$model = $this->findModel($id);\n\t\t\n\t\tif($model == null){\n $model = new PdmBA3();\n\t\t}\n\t\t\n\t\t$modelMsSaksi = new PdmMsSaksiAhli();\n\t\n\t\t$modelTersangka = $this->findModelTersangka($id);\n $modelSpdp = $this->findModelSpdp($id);\n\t\t\n\t\t//$model->id_ms_saksi_ahli=$_POST['PdmMsSaksiAhli']['id_ms_saksi_ahli'];\n\t\t\n //Jaksa Penyidik\n $modelpenyidik = PdmJaksaPenerima::findAll(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::BA3, 'id_table' => $model->id_ba3]);\n\n if ($modelpenyidik == null) {\n $modelpenyidik = new PdmJaksaPenerima();\n }\n\t\t\n\t\t//Jaksa saksi\n\t\t$modeljaksi = PdmJaksaSaksi::findAll(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::BA3, 'id_table' => $model->id_ba3]);\n\n if ($modeljaksi == null) {\n $modeljaksi = new PdmJaksaSaksi();\n }\n\t\t\n\t\t$searchJPU = new VwJaksaPenuntutSearch();\n $dataJPU = $searchJPU->search2(Yii::$app->request->queryParams);\n $dataJPU->pagination->pageSize = 5;\n\t\t\n\t\t$modelMsSaksi = PdmMsSaksiAhli::findOne(['id_saksi_ahli' => $model->id_ms_saksi_ahli]);\n\t\tif ($modelMsSaksi == null) {\n $modelMsSaksi = new PdmMsSaksiAhli();\n }\n\t\t\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t$id_ba3 = Pdmba3::findOne(['id_perkara' => $id]);\n\t\t$seq = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_ba3', 'id_ba3', '\".\\Yii::$app->globalfunc->getSatker()->inst_satkerkd.\"', '\".date('Y').\"')\")->queryOne();\n\t\n\t\t$id_MsSaksiAhli = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_ms_saksi_ahli', 'id_saksi_ahli', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n\t\t\t\n\t\t\tif($model->id_perkara != null){\n\t\t\t$model->update();\n\t\t\t\t$modelMsSaksi->flag = '2';\n\t\t\t\t$modelMsSaksi->nama = $_POST['PdmMsSaksiAhli']['nama'];\n\t\t\t\t$modelMsSaksi->tmpt_lahir = $_POST['PdmMsSaksiAhli']['tmpt_lahir'];\n\t\t\t\t$modelMsSaksi->tgl_lahir = $_POST['PdmMsSaksiAhli']['tgl_lahir'];\n\t\t\t\t$modelMsSaksi->id_jkl = $_POST['PdmMsSaksiAhli']['id_jkl'];\n\t\t\t\t$modelMsSaksi->alamat = $_POST['PdmMsSaksiAhli']['alamat'];\n\t\t\t\t$modelMsSaksi->warganegara = $_POST['PdmMsSaksiAhli']['warganegara'];\n\t\t\t\t$modelMsSaksi->id_agama = $_POST['PdmMsSaksiAhli']['id_agama'];\n\t\t\t\t$modelMsSaksi->pekerjaan = $_POST['PdmMsSaksiAhli']['pekerjaan'];\n\t\t\t\t$modelMsSaksi->id_pendidikan = $_POST['PdmMsSaksiAhli']['id_pendidikan'];\n\t\t\t\t$modelMsSaksi->save();\n\t\t\t\n }else{\n\t\t\t\t\n\t\t\t\t$modelMsSaksi = new PdmMsSaksiAhli();\n\t\t\t\t$modelMsSaksi->id_saksi_ahli = $id_MsSaksiAhli['generate_pk'];\n\t\t\t\t$modelMsSaksi->nama = $_POST['PdmMsSaksiAhli']['nama'];\n\t\t\t\t$modelMsSaksi->tmpt_lahir = $_POST['PdmMsSaksiAhli']['tmpt_lahir'];\n\t\t\t\t$modelMsSaksi->tgl_lahir = $_POST['PdmMsSaksiAhli']['tgl_lahir'];\n\t\t\t\t$modelMsSaksi->id_jkl = $_POST['PdmMsSaksiAhli']['id_jkl'];\n\t\t\t\t$modelMsSaksi->alamat = $_POST['PdmMsSaksiAhli']['alamat'];\n\t\t\t\t$modelMsSaksi->warganegara = $_POST['PdmMsSaksiAhli']['warganegara'];\n\t\t\t\t$modelMsSaksi->id_agama = $_POST['PdmMsSaksiAhli']['id_agama'];\n\t\t\t\t$modelMsSaksi->pekerjaan = $_POST['PdmMsSaksiAhli']['pekerjaan'];\n\t\t\t\t$modelMsSaksi->id_pendidikan = $_POST['PdmMsSaksiAhli']['id_pendidikan'];\n\t\t\t\t$modelMsSaksi->save();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$model->id_ms_saksi_ahli = $id_MsSaksiAhli['generate_pk'];\n\t\t\t\t$modelMsSaksi->id_pendidikan = $_POST['PdmMsSaksiAhli']['id_pendidikan'];\n\t\t\t\t$modelMsSaksi = new PdmMsSaksiAhli();\n\t\t\t\t$modelMsSaksi->id_saksi_ahli = $idMsSaksiAhli;\n\t\t\t\t$modelMsSaksi->nama = $_POST['PdmMsSaksiAhli']['nama'];\n\t\t\t\t$modelMsSaksi->tmpt_lahir = $_POST['PdmMsSaksiAhli']['tmpt_lahir'];\n\t\t\t\t$modelMsSaksi->tgl_lahir = $_POST['PdmMsSaksiAhli']['tgl_lahir'];\n\t\t\t\t$modelMsSaksi->id_jkl = $_POST['PdmMsSaksiAhli']['id_jkl'];\n\t\t\t\t$modelMsSaksi->alamat = $_POST['PdmMsSaksiAhli']['alamat'];\n\t\t\t\t$modelMsSaksi->warganegara = $_POST['PdmMsSaksiAhli']['warganegara'];\n\t\t\t\t$modelMsSaksi->id_agama = $_POST['PdmMsSaksiAhli']['id_agama'];\n\t\t\t\t$modelMsSaksi->pekerjaan = $_POST['PdmMsSaksiAhli']['pekerjaan'];\n\t\t\t\t$modelMsSaksi->id_pendidikan = $_POST['PdmMsSaksiAhli']['id_pendidikan'];\n\t\t\t\t$modelMsSaksi->save();\n }\n\t\t\n\t\tif ($model->id_ba3 != null) {\n $model->lokasi = $_POST['PdmBa3']['lokasi'];\n $model->flag ='2';\n $model->update();\n } else {\n $model->id_perkara = $id_perkara;\n $model->id_ba3 = $seq['generate_pk'];\n $model->id_ms_saksi_ahli = $modelMsSaksi->id_saksi_ahli;\n $model->save();\n\n Yii::$app->globalfunc->getSetStatusProcces($model->id_perkara, GlobalConstMenuComponent::BA3);\n }\n\t\t\n\t\t//Jaksa Penyidik\n\t\tPdmJaksaPenerima::deleteAll(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::BA3, 'id_table' => $model->id_ba3]);\n if (isset($_POST['nip'])) {\n foreach ($_POST['nip'] as $key) {\n $query = new Query;\n $query->select('*')\n ->from('pidum.vw_jaksa_penuntut')\n ->where(\"peg_instakhir='\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"' and peg_nik='\" . $key . \"'\");\n $command = $query->createCommand();\n $data = $command->queryAll();\n $seqjpp = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_jaksa_penerima', 'id_jpp', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n\t\t\t\t\t\n\t\t\t\t\t$modelpenyidik = new PdmJaksaPenerima();\n\t\t\t\t $modelpenyidik ->id_jpp = $seqjpp['generate_pk'];\n\t\t\t\t\t$modelpenyidik ->id_perkara = $id;\n $modelpenyidik ->code_table = GlobalConstMenuComponent::BA3;\n\t\t\t\t\t$modelpenyidik ->id_table = $model->id_ba3;\n\t\t\t\t\t$modelpenyidik ->flag = '1';\n $modelpenyidik ->nama = $data[0]['peg_nama'];\n\t\t\t\t\t$modelpenyidik ->nip = $data[0]['peg_nip'];\n $modelpenyidik ->jabatan = $data[0]['jabatan'];\n $modelpenyidik ->pangkat = $data[0]['pangkat'];\n\t\t\t\t\t$modelpenyidik->save();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Jaksa Saksi\n\t\t PdmJaksaSaksi::deleteAll(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::BA3, 'id_table' => $model->id_ba3]);\n if (isset($_POST['txtnip'])) {\n foreach ($_POST['txtnip'] as $key) {\n $query = new Query;\n $query->select('*')\n ->from('pidum.vw_jaksa_penuntut')\n ->where(\"peg_instakhir='\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"' and peg_nik='\" . $key . \"'\");\n $command = $query->createCommand();\n $data = $command->queryAll();\n $seqjpp = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_jaksa_saksi', 'id_jpp', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n\t\t\t\t\t\n $modeljaksi = new PdmJaksaSaksi();\n\t\t\t\t $modeljaksi->id_jpp = $seqjpp['generate_pk'];\n\t\t\t\t\t$modeljaksi->id_perkara = $id;\n $modeljaksi->code_table = GlobalConstMenuComponent::BA3;\n $modeljaksi->id_table = $model->id_ba3;\n $modeljaksi->flag = '1';\n $modeljaksi->nama = $data[0]['peg_nama'];\n $modeljaksi->nip = $data[0]['peg_nip'];\n $modeljaksi->jabatan = $data[0]['jabatan'];\n $modeljaksi->pangkat = $data[0]['pangkat'];\n\t\t\t\t\t\n $modeljaksi->save();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Saksi\t\t\t\n\t\t\tif($modelMsSaksi->id_saksi_ahli == null){\n\t\t\t}else{\n\t\t\t}\n\t\t\t\t\n\t\t\t/* $trxPemroresan = PdmTrxPemrosesan::findOne(['id_perkara' => $id]);\n $trxPemroresan->id_perkara = $id;\n $trxPemroresan->id_sys_menu = \"61\";\n $trxPemroresan->id_user_login = Yii::$app->user->identity->username;\n $trxPemroresan->update(); */\n\t\t\t\n\t\t\t//notifkasi simpan\n\t\t\tYii::$app->getSession()->setFlash('success', [\n 'type' => 'success', //String, can only be set to danger, success, warning, info, and growl\n 'duration' => 5000, //Integer //3000 default. time for growl to fade out.\n 'icon' => 'glyphicon glyphicon-ok-sign', //String\n 'message' => 'Data Berhasil Disimpan', // String\n 'title' => 'Save', //String\n 'positonY' => 'top', //String // defaults to top, allows top or bottom\n 'positonX' => 'center', //String // defaults to right, allows right, center, left\n 'showProgressbar' => true,\n ]);\n\t\t\t\n\t\t\t//return $this->redirect(['update','id'=>$model->id_perkara]);\n\t\t\treturn $this->redirect(['update','id'=>$id]);\n\t\t\t//return $this->redirect(['view', 'id' => $model->id_ba3]);\n\t\t\t\n\t\t\t} else {\n return $this->render('update', [\n 'model' => $model,\n\t\t\t\t'searchJPU' => $searchJPU,\n\t\t\t\t'dataJPU' => $dataJPU,\n\t\t\t\t'modeljaksi' => $modeljaksi, \n\t\t\t\t'modelpenyidik' =>$modelpenyidik,\n\t\t\t\t'modelTersangka' => $modelTersangka,\n\t\t\t\t'modelSpdp' => $modelSpdp,\n\t\t\t\t'modelMsSaksi'=>$modelMsSaksi,\n\t\t\t\t'sysMenu' => $this->sysMenu,\n\t\t\t\t'id' => $id,\n\t\t\t\t]);\n }\n\t\n\t}",
"public function editcentreAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n\tif (isset($_POST['ok']) && $_POST['ok']==\"ok\") {\n\tif (isset($_POST['centre_ville']) && $_POST['centre_ville']!=\"\" && isset($_POST['centre_quartier']) && $_POST['centre_quartier']!=\"\" && isset($_POST['centre_libelle']) && $_POST['centre_libelle']!=\"\" && isset($_POST['id_pays']) && $_POST['id_pays']!=\"\") {\n\t\t\n\t\t\t\n $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuCentre();\n $ma = new Application_Model_EuCentreMapper();\n\t\t$ma->find($_POST['centre_id'], $a);\n\t\t\t\n $a->setCentre_description($_POST['centre_description']);\n $a->setCentre_quartier($_POST['centre_quartier']);\n $a->setCentre_libelle($_POST['centre_libelle']);\n $a->setCentre_ville($_POST['centre_ville']);\n $a->setId_pays($_POST['id_pays']);\n $ma->update($a);\n\t\t\t\n\t\t\t\n\t\t\t\n$centremembreM = new Application_Model_EuCentreMembreMapper();\n$centremembre = $centremembreM->fetchAll2($a->centre_id);\nforeach ($centremembre as $membre):\n $centremembreM->delete($membre->centre_membre_id);\nendforeach;\t\t\t\n\n\n\n for ($i = 0; $i < sizeof($_POST['code_membre']); $i++) {\n $centre_membre = new Application_Model_EuCentreMembre();\n $m_centre_membre = new Application_Model_EuCentreMembreMapper();\n\n $compt_centre_membre = $m_centre_membre->findConuter() + 1;\n\n $m_centre = new Application_Model_EuCentreMapper();\n $compt_centre = $a->centre_id;\n\n\n $centre_membre->setCentre_membre_id($compt_centre_membre);\n $centre_membre->setCentre_id($compt_centre);\n $centre_membre->setCode_membre($_POST['code_membre'][$i]);\n $m_centre_membre->save($centre_membre);\n }/**/\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t$this->_redirect('/administration/listcentre');\n\t\t} else { $this->view->error = \"Champs * obligatoire ...\"; \n\t\t \n $id = (int)$this->_request->getParam('id');\n if ($id != 0) {\n $a = new Application_Model_EuCentre();\n $ma = new Application_Model_EuCentreMapper();\n\t\t$ma->find($id, $a);\n\t\t$this->view->centre = $a;\n }\n\t}\n\t\t \n\t} else {\n\n $id = (int)$this->_request->getParam('id');\n if ($id != 0) {\n $a = new Application_Model_EuCentre();\n $ma = new Application_Model_EuCentreMapper();\n\t\t$ma->find($id, $a);\n\t\t$this->view->centre = $a;\n }\n\t}\n\t}",
"function modifyanalyseAction(){\r\n \r\n // ACL\r\n if(! $this->_acl->isAllowed($this->_role,'prospection','modifyanalyse')){\r\n \r\n $this->_helper->redirector('interdit','bzerror',null,array(\"format\"=>\"html\"));\r\n $this->renderScript(\"/bzerror/index.tpl\");\r\n exit();\r\n }\r\n \r\n $checked=$this->getRequest()->getParam(\"checked\")?1:0;\r\n $criteres=$this->getRequest()->getParam(\"criteres\")?$this->getRequest()->getParam(\"criteres\"):null;\r\n $idLot=$this->getRequest()->getParam(\"idLot\")?$this->getRequest()->getParam(\"idLot\"):null;\r\n $idAna=$this->getRequest()->getParam(\"idAna\")?$this->getRequest()->getParam(\"idAna\"):null;\r\n \r\n //itere les criteres pour les concaténer dans une chaine\r\n $strCriteres=\"\";\r\n \r\n if(isset($criteres)){\r\n\r\n foreach ($criteres as $k => $v) {\r\n \r\n if($v==\"\"){\r\n \r\n $strCriteres.=$k.\";null;\"; \r\n continue;\r\n }\r\n\r\n $strCriteres.=$k.\";\".$v.\";\"; \r\n }\r\n //}\r\n //retire le dernier ;\r\n $strCriteres=substr($strCriteres,0,-1);\r\n \r\n } \r\n \r\n\r\n try {\r\n $stmt = $this->_db->prepare(\"execute ps_ExtWAnalyseMod @idgrgc='$this->_idBzUser',@idwtrl='$idLot',@idgra='$idAna',@checked='$checked',@criteres='$strCriteres',@ip='$this->_ip'\");\r\n $stmt->execute();\r\n $result=$stmt->fetchAll();\r\n //traitement des erreurs\r\n if(!$result[0]['erreur']==0){\r\n $this->view->result=$result[0]['erreur'];\r\n $this->_forward('notice','bzerror',null,array(\"message\"=>\"Une erreur est survenue. code:PR_index_18<br/>\".$this->_msgErrorSuff1,\"format\"=>\"json\",\"ps\"=>\"ps_ExtWAnalyseMod\",\"@idgrgc\"=>$this->_idBzUser,\"@idwtrl\"=>$idLot,\"@idgra\"=>$idAna,\"@checked\"=>$checked,\"@criteres\"=>$strCriteres,\"@ip\"=>$this->_ip));\r\n return;\r\n }else{\r\n \r\n $xml=$result[0][\"\"];\r\n \r\n $this->view->result=Zend_Json::fromXml($xml,false);\r\n return;\r\n \r\n }\r\n\r\n } catch (Exception $exc) {\r\n //echo $exc->getTraceAsString();\r\n $this->_forward('notice','bzerror',null,array(\"message\"=>\"Une erreur est survenue. code:PR_index_19<br/>\".$this->_msgErrorSuff1,\"format\"=>\"json\",\"ps\"=>\"ps_ExtWAnalyseMod\",\"@idgrgc\"=>$this->_idBzUser,\"@idwtrl\"=>$idLot,\"@idgra\"=>$idAna,\"@checked\"=>$checked,\"@criteres\"=>$strCriteres,\"@ip\"=>$this->_ip));\r\n return;\r\n }\r\n\r\n }",
"public function actionUpdateKategoriKelompok(){\r\n\t\t$allDataKelpmpok=Yii::$app->ppobh2h->ArrayKelompokAllType();\r\n\t\t$rslt=self::simpanKategoriKelompok($allDataKelpmpok);\r\n\t\t// print_r($rslt);\r\n\t\treturn $rslt;\r\n\t}",
"public function actionUpdate() {\n $session = new Session();\n $id = $session->get('id_perkara');\n $model = PdmB21::findOne(['id_perkara' => $id]);\n $sysMenu = PdmSysMenu::findOne(['kd_berkas' => GlobalConstMenuComponent::B21]);\n if ($model == null) {\n $model = new PdmB21();\n }\n $spdp = PdmSpdp::findOne(['id_perkara' => $id]);\n $model->wilayah = Yii::$app->globalfunc->getNamaSatker($spdp->wilayah_kerja)->inst_nama;\n $model->dikeluarkan = Yii::$app->globalfunc->getNamaSatker($spdp->wilayah_kerja)->inst_lokinst;\n $modelJaksa = PdmJaksaPenerima::findOne(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::B21, 'id_table' => $model->id_b21]);\n if ($modelJaksa == null) {\n $modelJaksa = new PdmJaksaPenerima();\n }\n $searchJPU = new VwJaksaPenuntutSearch();\n $dataJPU = $searchJPU->search2(Yii::$app->request->queryParams);\n $dataJPU->pagination->pageSize = 5;\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($model->id_perkara == null) {\n $seq = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_b21', 'id_b21', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n $model->id_perkara = $id;\n $model->id_b21 = $seq['generate_pk'];\n $model->save();\n Yii::$app->globalfunc->getSetStatusProcces($model->id_perkara, GlobalConstMenuComponent::B21);\n } else {\n $model->update();\n }\n $modelJaksa->load(Yii::$app->request->post());\n if ($modelJaksa->id_perkara == null) {\n $seqjpp = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_jaksa_penerima', 'id_jpp', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n $modelJaksa->id_jpp = $seqjpp['generate_pk'];\n $modelJaksa->id_perkara = $model->id_perkara;\n $modelJaksa->code_table = GlobalConstMenuComponent::B21;\n $modelJaksa->id_table = $model->id_b21;\n $modelJaksa->flag = '1';\n $modelJaksa->save();\n } else {\n $modelJaksa->update();\n }\n PdmTembusan::deleteAll(['id_perkara' => $model->id_perkara, 'id_table' => $model->id_b21, 'kode_table' => GlobalConstMenuComponent::B21]);\n if (!empty($_POST['new_tembusan'])) {\n for ($i = 0; $i < count($_POST['new_tembusan']); $i++) {\n $modelNewTembusan = new PdmTembusan();\n $seqTembusan = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_tembusan', 'id_tembusan', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n $modelNewTembusan->id_tembusan = $seqTembusan['generate_pk'];\n $modelNewTembusan->id_table = $model->id_b21;\n $modelNewTembusan->kode_table = GlobalConstMenuComponent::B21;\n $modelNewTembusan->keterangan = $_POST['new_tembusan'][$i];\n $modelNewTembusan->tembusan = $_POST['new_tembusan'][$i];\n $modelNewTembusan->no_urut = $_POST['new_no_urut'][$i];\n $modelNewTembusan->id_perkara = $model->id_perkara;\n $modelNewTembusan->nip = null;\n $modelNewTembusan->save();\n }\n }\n $transaction->commit();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Simpan',\n 'title' => 'Simpan Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect('update');\n } catch (Exception $ex) {\n $transaction->rollback();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'danger',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Simpan',\n 'title' => 'Error',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect('update');\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'sysMenu' => $sysMenu,\n 'modelJaksa' => $modelJaksa,\n 'searchJPU' => $searchJPU,\n 'dataJPU' => $dataJPU,\n ]);\n }\n }",
"public function modifiertechnicienAction() \n {\n $this->_helper->actionStack('header', 'index', 'default', array('head' => $this->headStyleScript));\n\n $tableTech = new Table_Technicien;\n\n $espaceSession = new Zend_Session_Namespace('ModifTechnicienChoisi');\n $test = $espaceSession->test;\n $matricule = $this->_getParam('matricule');\n $espaceSession->matricule = $matricule;\n \n $infosTech = $tableTech->getInfos($matricule); \n\n if ($test != \"echoue\") {\n $nom = $infosTech['nomTechnicien'];\n $pnom = $infosTech['prenomTechnicien'];\n $adresse = $infosTech['adresseTechnicien'];\n $date = $infosTech['dateNaissanceTechnicien']; \n } else { \n $nom = $espaceSession->nom;\n $pnom = $espaceSession->pnom;\n $adresse = $espaceSession->adresse;\n $date = $espaceSession->date;\n }\n\n $monform = new Zend_Form;\n\n // parametrer le formulaire\n $monform->setMethod('post');\n $monform->setAttrib('class', 'form');\n\n $monform->setAction($this->view->baseUrl().'/drh/modifsqltechnicien');\n\n $eNomTech = new Zend_Form_Element_Text('NomTech');\n $eNomTech->setValue($nom);\n $eNomTech->setLabel('Nom du technicien: ');\n\n $ePrenomTech = new Zend_Form_Element_Text('PrenomTech');\n $ePrenomTech->setValue($pnom);\n $ePrenomTech->setLabel('Premom du technicien : ');\n\n $eAdresseTech = new Zend_Form_Element_Text('AdresseTech');\n $eAdresseTech->setValue($adresse);\n $eAdresseTech->setLabel('Adresse du technicien: ');\n\n $eDateTech = new Zend_Form_Element_Text('dateNaissTech');\n $eDateTech->setValue($date);\n $eDateTech->setLabel('Date de naissance (AAAA-MM-JJ): ');\n\n $eSubmit = new Zend_Form_Element_Submit('bt_sub'); \n $eSubmit->setLabel('Valider');\n $eSubmit->setAttrib('class', 'valider');\n\n $monform->addElement($eNomTech);\n $monform->addElement($ePrenomTech);\n $monform->addElement($eAdresseTech);\n $monform->addElement($eDateTech);\n $monform->addElement($eSubmit); \n\n $this->view->leform = $monform;\n }",
"public function addintegrateursouscriptionAction() {\n\t $sessionmcnp = new Zend_Session_Namespace('mcnp');\n \t $this->_helper->layout()->setLayout('layoutpublicesmc');\n\t\t\n\t $param = (int) $this->_request->getParam('param');\n\t \n\t\t$typeintegrateur = new Application_Model_EuTypeIntegrateur();\n $typeintegrateurM = new Application_Model_EuTypeIntegrateurMapper();\n $typeintegrateurM->find($param,$typeintegrateur);\n\t\t\n\t\t$t_zone = new Application_Model_DbTable_EuZone();\n\t\t$t_pays = new Application_Model_DbTable_EuPays();\n\t\t$t_region = new Application_Model_DbTable_EuRegion();\n\t\t$t_prefecture = new Application_Model_DbTable_EuPrefecture();\n\t\t$t_canton = new Application_Model_DbTable_EuCanton(); \n\t\t$t_ville = new Application_Model_DbTable_EuVille();\n\t\t \n\t\t$zones = $t_zone->fetchAll();\n\t\t$pays = $t_pays->fetchAll();\n\t\t$regions = $t_region->fetchAll();\n\t\t$prefectures = $t_prefecture->fetchAll();\n\t\t$cantons = $t_canton->fetchAll();\n\t\t$selection = $t_ville->select();\n\t $selection->order('lib_ville asc');\n $villes = $t_ville->fetchAll($selection);\n\t\t \n\t\t$this->view->param = $param;\n\t\t$this->view->integrateur_montant = $typeintegrateur->montant_param;\n\t\t$this->view->zones = $zones;\n $this->view->pays = $pays;\n\t\t$this->view->regions = $regions;\n\t\t$this->view->prefectures = $prefectures;\n\t\t$this->view->cantons = $cantons;\n\t\t$this->view->villes = $villes;\n\t\t \n\t\t$request = $this->getRequest();\n\t\tif($request->isPost()) {\n\t\t if(isset($_POST['integrateur_type']) && $_POST['integrateur_type']!=\"\" \n\t\t\t && isset($_POST['code_activite']) && $_POST['code_activite']!=\"\" \n && isset($_POST['integrateur_montant']) && $_POST['integrateur_montant']!=\"\"\t\t\t \n\t\t\t && isset($_POST['integrateur_attestation']) && $_POST['integrateur_attestation'] == 1) { \n \n\t\t\t\t$db = Zend_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n try {\n\t\t\t\t\t$membre = new Application_Model_EuMembre();\n\t $m_map = new Application_Model_EuMembreMapper();\n\t\t\t\t\t$membremoral = new Application_Model_EuMembreMorale();\n\t $m_mapmoral = new Application_Model_EuMembreMoraleMapper();\n\t\t\t\t\t$typeintegrateur = new Application_Model_EuTypeIntegrateur();\n $m_typeintegrateur = new Application_Model_EuTypeIntegrateurMapper();\n\t\t\t\t\t\n\t\t\t\t\t$ville = new Application_Model_EuVille();\n\t $m_ville = new Application_Model_EuVilleMapper();\n\t\t\t\t\t\n\t\t\t\t\t$param = (int) $this->_request->getParam('param');\n\t\t\t\t\t$m_typeintegrateur->find($param,$typeintegrateur);\n\t\t\t\t\t\t\n\t\t\t\t\t$date_id = Zend_Date::now();\n\t\t\t\t\t$id_utilisateur_acnev = 1;\n $id_utilisateur_filiere = 2;\n $id_utilisateur_technopole = 3;\n\t\t\t\t\t\n\t\t\t\t\t$bon_neutre = new Application_Model_EuBonNeutre();\n $bon_neutre_mapper = new Application_Model_EuBonNeutreMapper();\n\t\t\t\t\t\n\t\t\t\t\t$membre_integrateur = $request->getParam(\"integrateur_membre\");\n\t\t\t\t\t$code_membre_integrateur = ''; \n\t\t\t\t\t$integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t\t\t\t$statut = $request->getParam(\"liste\");\n\t\t\t\t\t$programme = $request->getParam(\"programme\");\n\t\t\t\t\t$multiple = \"\";\n\t\t\t\t\t$mont_msbcm=\"\";\n\t\t\t\t\t$type_souscription = \"\";\n\t\t\t\t\t\n\t\t\t\t\t$mont_caps = floor(Util_Utils::getParametre('CAPS','valeur'));\n\t\t\t\t\t$mont_bc = 30000;\n\t\t\t\t\t$bnpmps = Util_Utils::getParametre('BNPMPS','valeur');\n\t\t\t\t\t$bnpnmps = Util_Utils::getParametre('BNPNMPS','valeur');\n\t\t\t\t\t\n\t\t\t\t\tif($programme == \"CM\" && $statut == \"AvecListe\") {\n\t\t\t\t\t $multiple = $integrateur_montant/$mont_caps;\t\t\n\t\t\t\t } elseif($programme == \"BC\" && $statut == \"AvecListe\") {\n\t\t\t\t\t $type_souscription = $request->getParam(\"type_souscription\");\n if($type_souscription == \"CMIT\" || $type_souscription == \"CAPU\") {\n\t\t\t\t\t\t $mont_msbcm = $mont_bc * $bnpmps;\n $multiple = $integrateur_montant/$mont_msbcm;\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t $mont_msbcm = $mont_bc * $bnpnmps;\n $multiple = $integrateur_montant/$mont_msbcm;\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(substr($membre_integrateur,19,1) == 'P') {\n\t\t\t\t\t $findmembre = $m_map->find($membre_integrateur,$membre);\n\t\t\t\t\t if($findmembre == false) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t $this->view->error = \"Le numéro membre du CMFH saisi \".$membre_integrateur.\" est introuvable ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$findmembre = $m_mapmoral->find($_POST['integrateur_membre'],$membremoral);\n\t\t\t\t\t\tif($findmembre == false) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t $this->view->error = \"Le numéro membre du CMFH saisi \".$membre_integrateur.\" est introuvable ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\tif($typeintegrateur->montant_param < $integrateur_montant) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t $this->view->error = \"Le montant de souscription ne doit pas etre inferieur au montant predefini ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(is_int($multiple) == false && $statut == \"AvecListe\" && $programme == \"CM\") {\n\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t\t\t $this->view->error = \"Le montant de souscription \".$integrateur_montant.\" n'est pas un multiple du capital d'achat du compte marchand prédéfini \".$mont_caps;\n\t\t\t\t return;\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\tif(is_int($multiple) == false && $statut == \"AvecListe\" && $programme == \"BC\") {\n\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t\t\t $this->view->error = \"Le montant de souscription \".$integrateur_montant.\" n'est pas un multiple du capital du bon de consommation prédéfini \".$mont_msbcm;\n\t\t\t\t return;\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\tif(($param == 23) && (substr($membre_integrateur,19,1) == 'M')) {\n\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t $this->view->error = \"Seuls les membres personnes physiques sont autorises a effectuer cette operation ...\";\n\t\t\t\t\t return;\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t$bon_neutre = $bon_neutre_mapper->fetchAllByCode($request->getParam(\"code_BAn\"));\n\t\t\t\t\tif(count($bon_neutre) == 0) {\n\t\t\t\t\t\t$db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t$this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Votre Code BAn incorrect ...\";\n return; \n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\tif(($bon_neutre->bon_neutre_montant_solde < $integrateur_montant)) {\n\t\t\t\t\t\t$db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t$this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Montant restant du BAn est insuffisant ...\";\n return; \n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\tif((count($bon_neutre) > 0) && ($bon_neutre->bon_neutre_montant_solde >= $integrateur_montant)) {\n\t\t\t\t\t \n\t\t\t\t\t\t$bon_neutre2 = new Application_Model_EuBonNeutre();\n\t\t\t\t\t\t$bon_neutre2M = new Application_Model_EuBonNeutreMapper();\n\t\t\t\t\t\t$bon_neutre2M->find($bon_neutre->bon_neutre_id,$bon_neutre2);\n\t\t\t\t\t\t \n\t\t\t\t\t\t$code_membre_integrateur = $bon_neutre2->bon_neutre_code_membre;\n\t\t\t\t\t \n\t\t\t\t\t $bon_neutre_detail = new Application_Model_EuBonNeutreDetail();\n\t\t\t\t\t\t$bon_neutre_detailM = new Application_Model_EuBonNeutreDetailMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t$lignesdetbon = $bon_neutre_detailM->fetchAllByBonNeutreValide($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t$cumulbon = $bon_neutre_detailM->getSumByBonNeutre($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\tif(($lignesdetbon == NULL) || ($bon_neutre->bon_neutre_montant_solde < $integrateur_montant) || ($cumulbon < $integrateur_montant)) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t\t$this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Montant restant du BAn est insuffisant ...\";\n return; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\tif($membre_integrateur != $code_membre_integrateur) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t\t$this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Le code membre du souscripteur doit être celui du bon neutre ...\";\n return; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t $reste = $integrateur_montant;\n\t\t\t\t\t $nbre_lignesdetbon = count($lignesdetbon);\n while($reste > 0 && $i < $nbre_lignesdetbon) {\n $lignedetbon = $lignesdetbon[$i];\n $id = $lignedetbon->getBon_neutre_detail_id();\n\t\t\t\t\t\t $finddetbon = $bon_neutre_detailM->find($id,$bon_neutre_detail);\n\t\t\t\t\t\t\t if($reste >= $lignedetbon->getBon_neutre_detail_montant_solde()) {\n\t\t\t\t\t\t\t $reste = $reste - $lignedetbon->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\t\t if($bon_neutre_detail->bon_neutre_appro_id > 0) {\n\t\t\t\t\t\t\t\t $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $bon_neutre_detail->getBon_neutre_detail_montant_solde();\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t foreach ($appro_detail as $appro) {\n\t\t\t\t\t\t\t\t\t $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id,$appro->bon_neutre_detail_id,$bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n\t\t\t\t\t\t\t\t\t\t \n }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $lignedetbon->getBon_neutre_detail_montant_solde())\n\t\t ->setBon_neutre_detail_montant_solde(0);\n $bon_neutre_detailM->update($lignedetbon);\n\n\n\t\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($lignedetbon->getBon_neutre_detail_montant_solde());\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n \t\t $bon_neutre_utilise->setUsertable(\"utilisateur\");\n \t\t $bon_neutre_utilise->setUser_id(1);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n } else {\n\t\t\t\t\t\t\t if($bon_neutre_detail->bon_neutre_appro_id > 0) {\n $appro_detail_mapper = new Application_Model_EuBonNeutreApproDetailMapper();\n $appro_detail = $appro_detail_mapper->fetchAllByAppro($bon_neutre_detail->bon_neutre_appro_id);\n $appro_montant_solde = $reste;\n foreach ($appro_detail as $appro) {\n $bnad = new Application_Model_EuBonNeutreApproDetail();\n $bnad_M = new Application_Model_EuBonNeutreApproDetailMapper();\n $bnad_M->findByApproDetail($appro->bon_neutre_appro_id, $appro->bon_neutre_detail_id, $bnad);\n\n if($bnad->getBon_neutre_appro_detail_solde() < $appro_montant_solde) {\n $appro_montant_solde = $appro_montant_solde - $bnad->getBon_neutre_appro_detail_solde();\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $bnad->getBon_neutre_appro_detail_solde());\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $bnad->getBon_neutre_appro_detail_solde());\n $bnad_M->update($bnad);\n } else {\n $bnad->setBon_neutre_appro_detail_mont_utilise($bnad->getBon_neutre_appro_detail_mont_utilise() + $appro_montant_solde);\n $bnad->setBon_neutre_appro_detail_solde($bnad->getBon_neutre_appro_detail_solde() - $appro_montant_solde);\n $bnad_M->update($bnad);\n break;\n }\n }\t\t\t\t\t\t\t\t \n }\n\t\t\t\t\t\t\t \n //Mise à jour des lignes d'enrégistrement\n\t\t\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_solde($lignedetbon->getBon_neutre_detail_montant_solde() - $reste);\n\t\t\t\t\t\t $lignedetbon->setBon_neutre_detail_montant_utilise($lignedetbon->getBon_neutre_detail_montant_utilise() + $reste);\n $bon_neutre_detailM->update($lignedetbon);\n\t\t\t\t\t\n\n\t\t\t\t\t\t $bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($reste);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_detail_id($lignedetbon->bon_neutre_detail_id);\n \t\t $bon_neutre_utilise->setUsertable(\"utilisateur\");\n \t\t $bon_neutre_utilise->setUser_id(1);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t $reste = 0;\n }\t\t\t\t\t\t\t \n $i++;\n }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_utilise($bon_neutre->bon_neutre_montant_utilise + $integrateur_montant);\n\t\t\t\t\t\t $bon_neutre2->setBon_neutre_montant_solde($bon_neutre->bon_neutre_montant_solde - $integrateur_montant);\n\t\t\t\t\t\t $bon_neutre2M->update($bon_neutre2);\n\t\t\t\t\t\t \n\t\t\t\t\t\t /*$bon_neutre_utilise = new Application_Model_EuBonNeutreUtilise();\n\t\t\t\t\t\t $bon_neutre_utiliseM = new Application_Model_EuBonNeutreUtiliseMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $compteur_bon_neutre_utilise = $bon_neutre_utiliseM->findConuter() + 1;\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_id($compteur_bon_neutre_utilise);\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_id($bon_neutre->bon_neutre_id);\n\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PP\");\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_type(\"PM\");\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_libelle(\"CMFH\");\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t $bon_neutre_utilise->setBon_neutre_utilise_montant($integrateur_montant);\n\t\t\t\t\t\t $bon_neutre_utiliseM->save($bon_neutre_utilise);*/\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $m_depotvente = new Application_Model_EuDepotVenteMapper();\n\t\t\t\t $depotvente = new Application_Model_EuDepotVente();\n\n $m_mstiers = new Application_Model_EuMstiersMapper();\n\t\t\t\t $mstiers = new Application_Model_EuMstiers();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t //$m_dmscm = new Application_Model_EuDetailMscmMapper();\n\t\t\t\t //$dmscm = new Application_Model_EuDetailMscm();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t $finddepot = $m_depotvente->fetchAllByMembre($membre_integrateur);\n\t\t\t\t\t\t\t $findmstiers = $m_mstiers->fetchAllByMembre($membre_integrateur);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t\t\t\t\t\t $select = $eusouscription->select();\n\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n\t\t\t\t\t\t $select->where(\"LOWER(REPLACE(souscription_nom, ' ', '')) = ? \", strtolower(str_replace(\" \", \"\",$membre->nom_membre)));\n\t $select->where(\"LOWER(REPLACE(souscription_prenom, ' ', '')) = ? \", strtolower(str_replace(\" \", \"\",$membre->prenom_membre)));\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t $select->where(\"LOWER(REPLACE(souscription_raison, ' ', '')) = ? \", strtolower(str_replace(\" \", \"\",$membremoral->raison_sociale)));\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t\t\t $select->order(array(\"souscription_id ASC\"));\n\t $select->limit(1);\n\t $rowseusouscription = $eusouscription->fetchRow($select);\n\t\t if(count($rowseusouscription) > 0) {\n\t\t\t $souscription_ok = 1;\n\t\t\t $souscription_first = $rowseusouscription->souscription_id;\n\t\t\t } else {\n\t\t\t $souscription_ok = 0;\n\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t $eusouscription = new Application_Model_DbTable_EuSouscription();\n\t $select = $eusouscription->select()->where('souscription_login = ?',$request->getParam(\"integrateur_login\"));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($rowseusouscription = $eusouscription->fetchRow($select) && $request->getParam(\"integrateur_login\") != \"\" && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Login déjà existant ...\";\n\t\t\t\t\t\t return;\n\t } else if($request->getParam(\"integrateur_passe\") != $request->getParam(\"confirme\") && $request->getParam(\"integrateur_passe\") != \"\" && $finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Mot de passe incorret ...\";\n\t\t\t\t\t\t return;\n\t }\n\t\t\t\t\t\t\n\t\t\t\t\t\t$date_id = Zend_Date::now();\n\t\t\t\t\t\t$souscription = new Application_Model_EuSouscription();\n $souscription_mapper = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$compteur_souscription = $souscription_mapper->findConuter() + 1;\n\t\t\t\t\t\t$souscription->setSouscription_id($compteur_souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(substr($membre_integrateur,19,1) == 'P') {\n $souscription->setSouscription_nom($membre->nom_membre);\n $souscription->setSouscription_prenom($membre->prenom_membre);\n\t\t\t\t\t\t $souscription->setSouscription_mobile($membre->portable_membre);\n\t\t\t\t\t\t $souscription->setSouscription_personne(\"PP\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t $souscription->setSouscription_raison($membremoral->raison_sociale);\n $souscription->setCode_type_acteur($membremoral->code_type_acteur);\n $souscription->setCode_statut($membremoral->code_statut);\n\t\t\t\t\t\t $souscription->setSouscription_mobile($membremoral->portable_membre);\n\t\t\t\t\t\t $souscription->setSouscription_personne(\"PM\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$souscription->setSouscription_membreasso(1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription->setSouscription_type(\"BAn\");\n $souscription->setSouscription_numero($bon_neutre->bon_neutre_code);\n $souscription->setSouscription_date_numero($bon_neutre->bon_neutre_date);\n\t\t\t \n $souscription->setSouscription_banque(null);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription->setSouscription_montant($request->getParam(\"integrateur_montant\"));\n $souscription->setSouscription_nombre($request->getParam(\"integrateur_nombre\"));\n $souscription->setSouscription_programme(\"CMFH\");\n $souscription->setSouscription_type_candidat($request->getParam(\"integrateur_type_candidat\"));\n \n $souscription->setSouscription_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $souscription->setSouscription_vignette(null);\n $souscription->setCode_activite($request->getParam(\"code_activite\"));\n $souscription->setId_metier($request->getParam(\"id_metier\"));\n $souscription->setId_competence($request->getParam(\"id_competence\"));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$m_ville->find($request->getParam(\"integrateur_ville\"),$ville);\n\t\t\t\t\t\t\n $souscription->setSouscription_ville($ville->lib_ville);\n $souscription->setSouscription_quartier($request->getParam(\"integrateur_quartier\"));\n\t\t\t \n $souscription->setSouscription_email($request->getParam(\"integrateur_email\"));\n if($finddepot == NULL && $findmstiers == NULL) {\t\t\t\t\t\t\n $souscription->setSouscription_login($request->getParam(\"integrateur_login\"));\n $souscription->setSouscription_passe($request->getParam(\"integrateur_passe\"));\n\t\t\t\t\t\t} else {\n $souscription->setSouscription_login(null);\n $souscription->setSouscription_passe(null);\n }\t\t\t\t\t\t\n\t\t\t \n\t\t\t if($souscription_ok == 1) {\n $souscription->setSouscription_souscription($souscription_first);\n\t\t\t\t } else {\n $souscription->setSouscription_souscription($compteur_souscription);\n\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription->setSouscription_autonome(0);\n\t\t\t $souscription->setPublier(0);\n\t\t\t\t\t $souscription->setErreur(0);\n\t\t\t\t\t $souscription->setId_canton($request->getParam(\"id_canton\"));\n $souscription_mapper->save($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t\t///////////////////////////////////////////// validation acnev //////////////////////////////////\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t$souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t$souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t $souscription->setPublier(1);\n\t\t\t\t\t\t$souscriptionM->update($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t$validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_acnev);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t$validation_quittance->setPublier(1);\n\t\t\t\t\t\t$validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t///////////////////////////////////////////// validation filiere //////////////////////////////////\n\t\t\t\t\t\t$souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t$souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t$souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription->setPublier(2);\n\t\t\t\t\t\t$souscriptionM->update($souscription);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t$validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_filiere);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t$validation_quittance->setPublier(1);\n\t\t\t\t\t\t$validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t\t\n\t\t\t\t\t\t///////////////////////////////////////////// validation technopole //////////////////////////////////\n\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription = new Application_Model_EuSouscription();\n\t\t\t\t\t\t$souscriptionM = new Application_Model_EuSouscriptionMapper();\n\t\t\t\t\t\t$souscriptionM->find($compteur_souscription, $souscription);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$souscription->setPublier(3);\n\t\t\t\t\t\t$souscriptionM->update($souscription);\n\n\t\t\t\t\t\t$validation_quittance = new Application_Model_EuValidationQuittance();\n\t\t\t\t\t\t$validation_quittance_mapper = new Application_Model_EuValidationQuittanceMapper();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$compteur_validation_quittance = $validation_quittance_mapper->findConuter() + 1;\n\t\t\t\t\t $validation_quittance->setValidation_quittance_id($compteur_validation_quittance);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_utilisateur($id_utilisateur_technopole);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_souscription($souscription->souscription_id);\n\t\t\t\t\t\t$validation_quittance->setValidation_quittance_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t$validation_quittance->setPublier(1);\n\t\t\t\t\t\t$validation_quittance_mapper->save($validation_quittance);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\tinclude(\"Transfert.php\");\n\t\t if(isset($_FILES['integrateur_diplome']['name']) && $_FILES['integrateur_diplome']['name']!=\"\") {\n\t\t $chemin = \"integrateurs\";\n\t\t $file = $_FILES['integrateur_diplome']['name'];\n\t\t $file1='integrateur_diplome';\n\t\t $integrateur_diplome = $chemin.\"/\".transfert($chemin,$file1);\n\t\t } else { $integrateur_diplome = \"\"; }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(isset($_FILES['integrateur_document']['name']) && $_FILES['integrateur_document']['name']!=\"\") {\n\t\t $chemin = \"integrateurs\";\n\t\t $file = $_FILES['integrateur_document']['name'];\n\t\t $file1='integrateur_document';\n\t\t $integrateur_document = $chemin.\"/\".transfert($chemin,$file1);\n\t\t } else {$integrateur_document = \"\";}\n\t\t\t\t\t\t \n\t\t\t\t\t\t $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuIntegrateur();\n $ma = new Application_Model_EuIntegrateurMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $compteur = $ma->findConuter() + 1;\n\t\t\t\t\t\t $a->setIntegrateur_id($compteur);\n $a->setIntegrateur_type($request->getParam(\"integrateur_type\"));\n $a->setIntegrateur_souscription($compteur_souscription);\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($param == 1 || $param == 2 || $param == 3|| $param == 4 || $param == 5 || $param == 6 || $param == 7 || $param == 8\n\t\t\t\t\t\t\t || $param == 25 || $param == 26 || $param == 27 || $param == 28) {\n $a->setIntegrateur_critere1($request->getParam(\"integrateur_critere1\"));\n $a->setIntegrateur_critere2($request->getParam(\"integrateur_critere2\"));\n $a->setIntegrateur_critere3($request->getParam(\"integrateur_critere3\"));\n }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($param == 15 || $param == 16 || $param == 17|| $param == 18 || $param == 19 || $param == 20 || $param == 22) {\n if($param == 15 || $param == 16 || $param == 17 || $param == 18 || $param == 22 || $param == 29 || $param == 30) {\n $a->setIntegrateur_poste($request->getParam(\"integrateur_poste\"));\n }\n $a->setIntegrateur_education($request->getParam(\"integrateur_education\"));\n if($param == 15 || $param == 16 || $param == 17 || $param == 18 || $param == 22 || $param == 29 || $param == 30) {\n $a->setIntegrateur_affiliation($request->getParam(\"integrateur_affiliation\"));\n }\n $a->setIntegrateur_formation($request->getParam(\"integrateur_formation\"));\n $a->setIntegrateur_langue($request->getParam(\"integrateur_langue\"));\n $a->setIntegrateur_experience($request->getParam(\"integrateur_experience\"));\n $a->setIntegrateur_document($integrateur_document);\n $a->setIntegrateur_diplome($integrateur_diplome);\n }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $a->setIntegrateur_attestation($request->getParam(\"integrateur_attestation\"));\n $a->setIntegrateur_membreasso(0);\n $a->setIntegrateur_date($date_id->toString('yyyy-MM-dd'));\n\t\t\t $a->setPublier($_POST['publier']);\n $a->setIntegrateurAdresse($request->getParam(\"integrateur_quartier\"));\n $a->setIntegrateurCanton($request->getParam(\"id_canton\"));\n $a->setIntegrateurVille($request->getParam(\"integrateur_ville\"));\n\t\t\t\t\t\t $a->setCode_membre($request->getParam(\"integrateur_membre\"));\n $ma->save($a);\n\t\t\t\t\t\t \n\t\t\t\t\t\t ///////////////////////////////////////////////////////////////////////////////////////////////////////\n $integrateur = new Application_Model_EuIntegrateur();\n $integrateurM = new Application_Model_EuIntegrateurMapper();\n $integrateurM->find($compteur,$integrateur);\n\t\t\n $integrateur->setPublier(1);\n\t\t $integrateurM->update($integrateur);\n\t\t\t\t\t\t \n\t\t\t\t\t\t $id_integrateur = $integrateur->integrateur_id;\n\t\t\t\t\t\t $complement = new Application_Model_EuComplementQuittance();\n $m_complement = new Application_Model_EuComplementQuittanceMapper();\n\t\t\t\t\t\t \n\t\t\t\t\t\t $cpte = $m_complement->findConuter() + 1;\n\t\t\t\t\t\t $complement->setId_complement_quittance($cpte);\n\t\t\t\t\t\t $complement->setIntegrateur_id($id_integrateur);\n\t\t\t\t\t\t $complement->setSouscription_id($compteur_souscription);\n\t\t\t\t\t\t $complement->setDate_complement_quittance($date_id->toString('yyyy-MM-dd'));\n\t\t\t\t\t\t $m_complement->save($complement);\n\n // Création du compte utilisateur intégrateur\n\t\t\t\t\t\t $souscription = new Application_Model_EuSouscription();\n $m_souscription = new Application_Model_EuSouscriptionMapper();\n\t\t $m_souscription->find($compteur_souscription,$souscription);\n\t\t\t\t\t\t $integrateur_souscription = $compteur_souscription;\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t $date_id = Zend_Date::now();\n $association = new Application_Model_EuAssociation();\n $association_mapper = new Application_Model_EuAssociationMapper();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t $login = \"\";\n\t\t\t\t\t\t $password = \"\";\n\t\t\t\t\t\t $code_agence = \"\";\n\n if($finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t\t $compteur_association = $association_mapper->findConuter() + 1;\n $association->setAssociation_id($compteur_association);\n $association->setAssociation_mobile($souscription->souscription_mobile);\n\t\t\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n $association->setAssociation_nom($souscription->souscription_nom.\" \".$souscription->souscription_prenom);\n\t\t\t\t\t\t\t\t } else {\n $association->setAssociation_nom($souscription->souscription_raison);\n }\n\t\t\t\t\t\t\t\t \n $association->setAssociation_numero($compteur_association.\"INT\");\n $association->setAssociation_date_agrement($date_id->toString('yyyy-MM-dd'));\n $association->setAssociation_email($souscription->souscription_email);\n $association->setAssociation_recepisse(NULL);\n $association->setAssociation_adresse($souscription->souscription_quartier.\" - \".$souscription->souscription_ville);\n $association->setAssociation_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $association->setId_filiere(NULL);\n $association->setCode_type_acteur(NULL);\n $association->setCode_statut(NULL);\n $association->setCode_agence($code_agence);\n $association->setPublier(1);\n $association_mapper->save($association);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $date_id = Zend_Date::now();\n\n $membreasso = new Application_Model_EuMembreasso();\n $membreasso_mapper = new Application_Model_EuMembreassoMapper();\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t if(($souscription->souscription_login == NULL) or ($souscription->souscription_login == '')) {\n\t\t\t\t\t\t\t\t //$liste = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $liste = \"abcdefghjkmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWXYZ\";\n $login = \"\";\n while(strlen($login) != 8) {\n $login .= $liste[rand(0,61)]; \n }\n\t\t\t\t\t\t\t\t $password = $login.$login; \n\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t $login = $souscription->souscription_login;\n\t\t\t\t\t\t\t\t $password = $souscription->souscription_passe;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $compteur_membreasso = $membreasso_mapper->findConuter() + 1;\n $membreasso->setMembreasso_id($compteur_membreasso);\n $membreasso->setMembreasso_mobile($souscription->souscription_mobile);\n\t\t\t\t\t\t\t\t if(substr($membre_integrateur,19,1) == 'P') {\n $membreasso->setMembreasso_nom($souscription->souscription_nom);\n\t\t\t\t\t\t\t\t\t $membreasso->setMembreasso_prenom($souscription->souscription_prenom);\n\t\t\t\t\t\t\t\t } else {\n $membreasso->setMembreasso_nom($souscription->souscription_raison);\n\t\t\t\t\t\t\t\t\t $membreasso->setMembreasso_prenom($souscription->souscription_prenom);\n }\t\t\t\t\t\t\t\t \n \n $membreasso->setMembreasso_association($compteur_association);\n $membreasso->setMembreasso_email($souscription->souscription_email);\n $membreasso->setMembreasso_login($login);\n $membreasso->setMembreasso_passe($password);\n $membreasso->setMembreasso_type(1);\n $membreasso->setMembreasso_date($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n $membreasso->setPublier(1);\n\t\t\t\t\t\t\t\t $membreasso->setSouscription_id($souscription->souscription_id);\n\t\t\t\t\t\t\t $membreasso->setIntegrateur_id($integrateur->integrateur_id);\n $membreasso_mapper->save($membreasso);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t // insertion dans les tables eu_mstiers\n\t\t\t\t\t\t\t $id_souscription = $compteur_souscription;\n $id_mstiers = $m_mstiers->findConuter() + 1;\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $code_ban = $request->getParam(\"code_BAn\");\n\t\t\t\t\t\t\t $code_integrateur = $request->getParam(\"integrateur_membre\");\n\t\t\t\t\t\t\t $montant_souscris = $request->getParam(\"integrateur_montant\");\n\t\t\t\t\t\t\t\t \n $mstiers->setId_mstiers($id_mstiers);\n\t\t\t\t\t\t\t $mstiers->setCode_membre($code_integrateur);\n\t\t\t\t\t\t\t $mstiers->setMontant_souscris($montant_souscris);\n\t\t\t\t\t\t\t $mstiers->setMontant_utilise(0);\n\t\t\t\t\t\t\t $mstiers->setMontant_restant($montant_souscris);\n\t\t\t\t\t\t\t if($programme == \"CM\"){\n\t\t\t\t\t\t\t\t$mstiers->setType_souscription(\"CAPS\"); \n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t$mstiers->setType_souscription($request->getParam(\"type_souscription\")); \n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t $mstiers->setId_souscription($id_souscription);\n\t\t\t\t\t\t\t $mstiers->setDate_mstiers($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t\t\t $mstiers->setBon_neutre_code($code_ban);\n\t\t\t\t\t\t\t $mstiers->setType_mstiers($programme);\n\t\t\t\t\t\t\t $mstiers->setStatut_mstiers($statut);\n\t\t\t\t\t\t\t \n\t\t\t\t\t if($param == 21 || $param == 24) {\n\t\t\t\t\t\t\t $mstiers->setType_souscripteur(\"ODD\");\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $mstiers->setType_souscripteur(\"CMFH\");\n $m_mstiers->save($mstiers); \t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t \n // script de creation de TE de prestation\n\t\t\t\t\t\t\t $eucompte = new Application_Model_EuCompte();\n\t\t\t\t\t\t\t $m_compte = new Application_Model_EuCompteMapper();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $prk = new Application_Model_EuPrk();\n $m_prk = new Application_Model_EuPrkMapper();\n\t\t\t\t\t\t\t\t\t\n $te = new Application_Model_EuTegc();\n\t\t\t\t\t\t\t $m_te = new Application_Model_EuTegcMapper();\n\t\t\t\t\t\t\t $code_te = \"\";\n\t\t\t\t\t\t\t $nom_tegc = \"\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $code_membre = $request->getParam(\"integrateur_membre\");\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t if(substr($code_membre,19,1)=='P') {\n\t\t\t\t\t\t\t\t $nom_tegc = $membre->nom_membre.\" \".$membre->prenom_membre;\n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t $nom_tegc = $membremoral->raison_sociale;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $code_zone = $request->getParam(\"code_zone\");\n\t\t\t $id_pays = $request->getParam(\"id_pays\");\n\t\t\t $id_region = $request->getParam(\"id_region\");\n\t\t\t $id_prefecture = $request->getParam(\"id_prefecture\");\n\t\t\t $id_canton = $request->getParam(\"id_canton\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $num_compte = 'NB-TPAGCP-'.$code_membre;\n\t\t\t\t $res = $m_compte->find($num_compte,$eucompte);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t if(!$res) {\n\t\t\t\t\t\t\t\t $eucompte->setCode_cat('TPAGCP')\n ->setCode_compte($num_compte)\n\t\t\t\t\t\t\t\t\t\t ->setCode_type_compte('NB')\n ->setDate_alloc($date_id->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TPAGCP')\n ->setSolde(0);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t if(substr($code_membre,19,1)=='P') {\t\t \n $eucompte->setCode_membre($code_membre)\n ->setCode_membre_morale(NULL);\n\t\t\t\t\t\t\t\t } else {\n $eucompte->setCode_membre(NULL)\n ->setCode_membre_morale($code_membre);\n }\t\t\t\t\t\t\t\t\t\t \n $m_compte->save($eucompte);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t $code_te = $m_te->getLastTegcByMembre($code_membre);\n\t\t\t\t\t\t\t\t if($code_te == NULL) {\n\t\t\t $code_te = 'TEGCP'.$code_membre. '00001'; \n\t\t\t } else {\n\t\t\t $num_ordre = substr($code_te, -5);\n $num_ordre++;\n $code_te = 'TEGCP'.$code_membre.str_pad($num_ordre,5,0,STR_PAD_LEFT); \n\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t $te->setCode_tegc($code_te);\n\t\t\t $te->setId_filiere(NULL);\n\t\t\t $te->setMdv(12);\n\t\t\t $te->setTranche_payement(1);\n\t\t\t\t\t\t\t\t if(substr($code_membre,19,1)=='M') {\n\t\t\t $te->setCode_membre($code_membre);\n\t\t\t\t\t\t\t\t } else {\n $te->setCode_membre_physique($code_membre);\n }\t\t\t\t\t\t\t\t\t\t\n\t\t\t $te->setMontant(0);\n\t\t\t $te->setMontant_utilise(0);\n\t\t\t $te->setSolde_tegc(0);\n\t\t\t $te->setId_utilisateur(NULL);\n\t\t\t $te->setNom_tegc($nom_tegc);\n\t\t\t $te->setNom_produit(\"Prestation\");\n\t\t\t $te->setDate_tegc($date_id->toString('yyyy-MM-dd HH:mm:ss'));\n\t\t\t\t\t $te->setType_tegc(\"PRESTATAIRE\");\n\t\t\t\t\t\t\t\t $te->setRecurrent_illimite(0);\n\t\t\t\t\t\t\t\t $te->setRecurrent_limite(0);\n\t\t\t\t\t\t\t\t $te->setNonrecurrent(1);\n\t\t\t\t\t\t\t\t $te->setPeriode1(0);\n\t\t\t\t\t\t\t\t $te->setPeriode2(0);\n\t\t\t\t\t\t\t\t $te->setPeriode3(0);\n\t\t\t\t\t\t\t\t $te->setFormel(0);\n\t\t\t\t\t\t\t\t $te->setRegime_tva(0);\n\t\t\t\t\t\t\t\t $te->setSpecial(0);\n\t\t\t\t\t\t\t\t $te->setOrdinaire(0);\n\t\t\t\t\t\t\t\t $te->setSubvention(0);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t $te->setCode_zone($code_zone);\n\t\t\t\t $te->setId_pays($id_pays);\n\t\t\t\t $te->setId_region($id_region);\n\t\t\t\t $te->setId_prefecture($id_prefecture);\n\t\t\t\t $te->setId_canton($id_canton);\n\n $m_te->save($te);\n\n $id_prk = $m_prk->findConuter() + 1;\n\t\t\t\t\t $prk->setId_prk($id_prk);\n\t\t\t\t\t $prk->setCode_tegc($code_te);\n\t\t\t\t\t $prk->setValeur(null);\n\t\t\t\t\t $m_prk->save($prk);\n \t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$num_comptets = 'NB-TSGCP-'.$code_membre;\n\t\t\t\t $rests = $m_compte->find($num_comptets,$eucompte);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$rests) {\n\t\t\t\t\t\t\t\t$eucompte->setCode_cat('TSGCP')\n ->setCode_compte($num_comptets)\n\t\t\t\t\t\t\t\t\t\t ->setCode_type_compte('NB')\n ->setDate_alloc($date_id->toString('yyyy-MM-dd'))\n ->setDesactiver(0)\n ->setLib_compte('TSGCP')\n ->setSolde(0);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tif(substr($code_membre,19,1)=='P') {\t\t \n $eucompte->setCode_membre($code_membre)\n ->setCode_membre_morale(NULL);\n\t\t\t\t\t\t\t\t} else {\n $eucompte->setCode_membre(NULL)\n ->setCode_membre_morale($code_membre);\n }\t\t\t\t\t\t\t\t\t\t \n $m_compte->save($eucompte);\n\t\t\t\t\t\t\t\t\t\n }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t // fin script de creation TE \n\t\t\t\t\t\t\tif(isset($_POST[\"code_te\"])) {\n\t\t\t\t\t\t $code_tegc = $request->getParam(\"code_te\"); \n\t\t\t\t\t\t } else {\n $eutegc = new Application_Model_DbTable_EuTegc();\n $select = $eutegc->select();\n\t\t\t\t\t\t\t if(substr($code_membre,19,1)=='P') {\n $select->where(\"code_membre_physique like ? \", $code_membre);\n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $select->where(\"code_membre like ? \", $code_membre);\n\t\t\t\t\t\t\t }\n $select->limit(1);\n $rowseutegc = $eutegc->fetchRow($select);\n $code_tegc = $rowseutegc->code_tegc;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$type_bnp = \"\";\n $code_banque = $request->getParam(\"code_banque\");\n $referencepaie = $request->getParam(\"num_compte\");\n\t\t\t\t\t\t\tif($programme == \"CM\"){\n $type_bnp = \"CAPS\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t $type_bnp = $request->getParam(\"type_souscription\");;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n $montant = $request->getParam(\"integrateur_montant\");\n\t\t\t\t\t\t\t$souscription_id = $compteur_souscription;\n\t\t\t\t\t\t\t$typeOpi = \"BNP\";\n\n $url = curl_init();\n $resultjson = array();\n\t\t\t\t\t\t\tcurl_setopt_array(\n\t\t\t\t\t\t\t $url,\n\t\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t CURLOPT_PORT => \"9001\",\n CURLOPT_URL => \"http://10.10.20.7:9001/jmcnpApi/souscriptionOpi/emission\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30000000,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n\t\t\t\t\t\t\t\t CURLOPT_POSTFIELDS => \"{\n\t\t\t\t\t\t\t\t \\n\\t\\\"codeMembre\\\":\\\"$code_membre\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"modePaiement\\\":\\\"$code_banque\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"referencePaiement\\\":\\\"$referencepaie\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"montant\\\":\\\"$montant\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"codeTegc\\\":\\\"$code_tegc\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"typeOpi\\\":\\\"$typeOpi\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"souscriptionId\\\":\\\"$souscription_id\\\",\n\t\t\t\t\t\t\t\t \\n\\t\\\"typeBnp\\\":\\\"$type_bnp\\\"\n\t\t\t\t\t\t\t\t }\",\n\t\t\t\t\t\t\t\tCURLOPT_HTTPHEADER => array(\n \"authorization: Basic bWFub3U6a2F0YWJhbGU=\",\n \"content-type: application/json\",\n ),\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$response = json_decode(curl_exec($url));\n\t\t\t\t\t\t\t$error = curl_error($url);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(($error === '') && ($response->resultat == 1)) {\n\t\t\t\t\t\t\t $db->commit();\n\t\t\t\t\t\t\t if($finddepot == NULL && $findmstiers == NULL) {\n\t\t\t\t\t\t\t $sessionmcnp->error = \"Operation bien effectuee ... Voici votre Login et Mot de passe pour acceder a votre espace integrateur : LOGIN : \".$login.\" MOT DE PASSE : \".$password;\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $sessionmcnp->error = \"Operation bien effectuee ...\";\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t $this->_redirect('/index/addintegrateur/param/'.$_POST['integrateur_type']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t $db->rollback();\n\t\t\t\t\t\t\t $this->view->param = $param;\n\t\t\t\t\t $this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t $this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t $this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n\t\t\t\t\t\t\t $sessionmcnp->error = \"Echec operation ... : \".$error;\n\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcurl_close($url);\t\t\t\t\t\t\t \t \n\t\t\t\t\t }\n\t\t\t\t\n\t\t\t\t} catch (Exception $exc) {\t\t\t\t \n\t\t\t\t $db->rollback();\n\t\t\t\t\t$this->view->param = $param;\n\t\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t\t\t$this->view->code_membre = $membre_integrateur;\n\t\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = $exc->getMessage() . ': ' . $exc->getTraceAsString(); \n return;\n\t\t\t }\n \t\t\t \n\t\t } else {\n\t\t\t $this->view->param = $param;\n\t\t\t\t$this->view->id_ville = $request->getParam(\"integrateur_ville\");\n\t\t\t\t$this->view->integrateur_quartier = $request->getParam(\"integrateur_quartier\");\n\t\t\t $this->view->code_membre = $membre_integrateur;\n\t\t\t\t$this->view->integrateur_montant = $request->getParam(\"integrateur_montant\");\n $this->view->error = \"Veuillez renseigner les champs obligatoires (*)\";\n\t\t\t}\n\t\t\n\t\t}\n\t\n }",
"public function operationopAction() \n\t{\n\n\t\t$sessionmembre = new Zend_Session_Namespace('membre');\n\t\t//$this->_helper->layout->disableLayout();\n\t\t$this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n\t\tif (!isset($sessionmembre->code_membre)) {\n\t\t\t$this->_redirect('/');\n\t\t}\n\tif (!isset($sessionmembre->code_membre)) {$this->_redirect('/');}\nif($sessionmembre->confirmation_envoi != \"\"){$this->_redirect('/espacepersonnel/confirmation');}\n\n\t\t$cc = (string) $this->_request->getParam('cc');\n\t\t$ctc = (string) $this->_request->getParam('ctc');\n\t\t$tc = (string) $this->_request->getParam('tc');\n\t\tif (isset($cc) && $cc != \"\") {\n\n\t\t\t$gcp = new Application_Model_EuOperationMapper();\n\t\t\t$this->view->entries = $gcp->fetchAll3($sessionmembre->code_membre, $tc);\n\t\t\t$this->view->code_cat = $cc;\n\t\t\t$this->view->ctc = $ctc;\n\t\t\t$this->view->type_op = $tc;\n\t\t}\n\t\t$this->view->tabletri = 1;\n\t}",
"public function edittariflivraisonAction()\n {\n\n $sessionterminal = new Zend_Session_Namespace('terminal');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcint');\n \n if (!isset($sessionterminal->login)) {$this->_redirect('/terminal/login');}\n//if($sessionterminal->confirmation != \"\"){$this->_redirect('/terminal/confirmation');}\n\n $t_zone = new Application_Model_DbTable_EuZone();\n $zones = $t_zone->fetchAll();\n $this->view->zones = $zones;\n $t_pays = new Application_Model_DbTable_EuPays();\n $pays = $t_pays->fetchAll();\n $this->view->pays = $pays;\n $t_region = new Application_Model_DbTable_EuRegion();\n $regions = $t_region->fetchAll();\n $this->view->regions = $regions;\n $t_prefecture = new Application_Model_DbTable_EuPrefecture();\n $prefectures = $t_prefecture->fetchAll();\n $this->view->prefectures = $prefectures;\n $t_canton = new Application_Model_DbTable_EuCanton();\n $cantons = $t_canton->fetchAll();\n $this->view->cantons = $cantons;\n\n if (isset($_POST['ok']) && $_POST['ok'] == \"ok\") {\n if (isset($_POST['code_zone']) && $_POST['code_zone'] != \"\" && isset($_POST['id_pays']) && $_POST['id_pays'] != \"\" && isset($_POST['id_region']) && $_POST['id_region'] != \"\" && isset($_POST['id_prefecture']) && $_POST['id_prefecture'] != \"\" && isset($_POST['montant_tarif_livraison']) && $_POST['montant_tarif_livraison'] != \"\") {\n\n $date_id = new Zend_Date(Zend_Date::ISO_8601);\n\n $tarif_livraison = new Application_Model_EuTarifLivraison();\n $m_tarif_livraison = new Application_Model_EuTarifLivraisonMapper();\n\n $m_tarif_livraison->find($_POST['id_tarif_livraison'], $tarif_livraison);\n\n $tarif_livraison->setCode_zone($_POST['code_zone']);\n $tarif_livraison->setId_pays($_POST['id_pays']);\n $tarif_livraison->setId_region($_POST['id_region']);\n $tarif_livraison->setId_prefecture($_POST['id_prefecture']);\n $tarif_livraison->setMontant_tarif_livraison($_POST['montant_tarif_livraison']);\n //$tarif_livraison->setCode_membre($sessionterminal->code_membre);\n //$tarif_livraison->setStatut(1);\n $m_tarif_livraison->update($tarif_livraison);\n\n $this->_redirect('/terminal/listtariflivraison');\n } else { $this->view->error = \"Les champs * sont obligatoires ...\";\n\n $id = (int)$this->_request->getParam('id');\n if ($id > 0) {\n $a = new Application_Model_EuTarifLivraison();\n $ma = new Application_Model_EuTarifLivraisonMapper();\n $ma->find($id, $a);\n $this->view->tariflivraison = $a;\n }\n }\n\n } else {\n\n $id = (int)$this->_request->getParam('id');\n if ($id > 0) {\n $a = new Application_Model_EuTarifLivraison();\n $ma = new Application_Model_EuTarifLivraisonMapper();\n $ma->find($id, $a);\n $this->view->tariflivraison = $a;\n }\n }\n }",
"public function ancienppmcnpAction() {\n\n $sessionmcnp = new Zend_Session_Namespace('mcnp');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublic');\n \n\n if (isset($_POST['ok']) && $_POST['ok']==\"ok\") {\n if (isset($_POST['code_membre']) && $_POST['code_membre']!=\"\") {\n $tabela = new Application_Model_DbTable_EuAncienMembre();\n $select = $tabela->select();\n $select->where('ancien_code_membre like ?', '%'.$_POST['code_membre'].'%')\n\t\t\t\t ->where('type_membre like ?', 'P')\n ->where('(etat_contrat = 0')->orwhere('etat_contrat IS NULL)'); \n $memb = $tabela->fetchAll($select);\n if(count($memb) > 0) {\n $trouvmembre = $memb->current(); \n $souscription = new Application_Model_DbTable_EuSouscription();\n $selection = $souscription->select();\n $selection->from($souscription)\n ->where('souscription_ancien_membre like ?',$trouvmembre->ancien_code_membre);\n $sous = $souscription->fetchAll($selection);\n if(count($sous) == 0) { \n $this->_redirect('/index/reactivationsouscriptionmcnppp/id/'.$trouvmembre->ancien_code_membre);\n } else { \n $this->view->message = \"Quittance de Réactivation déjà effectuée ...\";\n } \n } else { $this->view->message = \"Votre ancien code membre est introuvable ou est déjà réactivé ... \";}//Déjà Activé\n } else { $this->view->message = \"Champs * obligatoire ...\";}\n \n } \n }",
"public function actionEditDalamKampus($id)\n {\n $model = $this->findModel($id);\n $modelPegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->id])->andWhere('deleted!=1')->one();\n $modelAtasan = InstApiModel::getAtasanByPegawaiId($modelPegawai->pegawai_id);\n $modelAssigned = AtasanSuratTugas::find()->select(['id_pegawai'])->where(['surat_tugas_id' => $id])->andWhere('deleted!=1')->all();\n $modelSisaAtasan = $this->getSisaAtasan($modelPegawai->pegawai_id, $id);\n $modelAssignee = SuratTugasAssignee::find()->where(['surat_tugas_id' => $id])->andWhere('deleted!=1')->all();\n $modelLampiran = SuratTugasFile::find()->where(['surat_tugas_id' => $id])->andWhere('deleted!=1')->all();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n $model->save();\n\n //Atasan Handler\n if($model->atasan != null){\n foreach($model->atasan as $data){\n $modelAtasanSuratTugas = new AtasanSuratTugas();\n $modelAtasanSuratTugas->id_pegawai = $data;\n $modelAtasanSuratTugas->surat_tugas_id = $model->surat_tugas_id;\n if($modelAtasanSuratTugas->validate()){\n $modelAtasanSuratTugas->save();\n }else{\n $errors = $modelAtasanSuratTugas->errors;\n print_r(array_values($errors));\n die();\n }\n }\n }\n\n //Participants Handler\n foreach(Yii::$app->request->post()['Peserta'] as $data){\n if($data['id_pegawai'] == \"empty\"){\n continue;\n }else{\n $modelAssignee = new SuratTugasAssignee();\n $modelAssignee->id_pegawai = $data['id_pegawai'];\n $modelAssignee->surat_tugas_id = $model->surat_tugas_id;\n $modelAssignee->deleted = 0;\n if($modelAssignee->validate()){\n $modelAssignee->save();\n }else{\n $errors = $modelAssignee->errors;\n print_r(array_values($errors));\n die();\n }\n }\n }\n\n //Files Handler\n $status = \\Yii::$app->fileManager->saveUploadedFiles();\n if($status != null && $status->status == 'success'){\n $total = count($status->fileinfo);\n for ($i=0;$i<$total;$i++)\n {\n $modelFile = new SuratTugasFile();\n $modelFile->surat_tugas_id = $model->surat_tugas_id;\n $modelFile->nama_file = $status->fileinfo[$i]->name;\n //$modelFile->lokasi_file = $fileDir;\n $newFiles->kode_file = $status->fileinfo[$i]->id;\n if($modelFile->validate()){\n //Save file to directory $fileDir\n //$file->saveAs($fileDir);\n\n $modelFile->save();\n }else{\n $errors = $modelFile->errors;\n print_r(array_values($errors));\n die();\n }\n }\n }\n // if($model->files != null){\n // $model->files = UploadedFile::getInstances($model, 'files');\n // foreach($model->files as $file){\n // $modelFile = new SuratTugasFile();\n // $fileDir = 'uploads/attachments/' . $file->baseName . '.' . $file->extension;\n // $modelFile->surat_tugas_id = $model->surat_tugas_id;\n // $modelFile->nama_file = $file->baseName;\n // $modelFile->lokasi_file = $fileDir;\n // $modelFile->deleted = 0;\n // if($modelFile->validate()){\n // //Save file to directory $fileDir\n // $file->saveAs($fileDir);\n\n // $modelFile->save();\n // }else{\n // $errors = $modelFile->errors;\n // print_r(array_values($errors));\n // die();\n // }\n // }\n // }\n\n return $this->redirect(['view-pegawai', 'id' => $model->surat_tugas_id]);\n }else{\n $errors = $model->errors;\n print_r(array_values($errors));\n }\n } else {\n return $this->render('EditDalamKampus', [\n 'model' => $model,\n 'modelAtasan' => $modelAtasan,\n 'modelAssigned' => $modelAssigned,\n 'modelSisaAtasan' => $modelSisaAtasan,\n 'modelAssignee' => $modelAssignee,\n 'modelLampiran' => $modelLampiran,\n ]);\n }\n }",
"function action_onClickBoutonModifier(){\n\t\n\t\t$v = $this->useVue(\"organismePayeurModifierSupprimer\");\n\t\t\n\t\t$numOrganisme = $this->persist->get(\"NUM_ORGANISME\");\n\t\t\n\t\tif($this->controle($v)==false){\n\t\t\treturn;\n\t\t};\n\t\t\n\t\t$this->modele->updateOrganismePayeur($numOrganisme,\n\t\t\t\t\t\t\t\t\t\t\t\t$v->data->nomOrganisme, \n\t\t\t\t\t\t\t\t\t\t\t\t$v->data->adresseOrganisme);\n\t\t\t\n\t}",
"public function ancienpmmcnpAction()\n {\n\n $sessionmcnp = new Zend_Session_Namespace('mcnp');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublic');\n \n\n if (isset($_POST['ok']) && $_POST['ok']==\"ok\") {\n if (isset($_POST['code_membre']) && $_POST['code_membre']!=\"\") {\n \n $tabela = new Application_Model_DbTable_EuAncienMembre();\n $select = $tabela->select();\n $select->from($tabela,array('eu_ancien_membre.*',\"date_identification as dateidentif\"))\n ->where('ancien_code_membre LIKE ?', '%'.$_POST['code_membre'].'%')\n ->where('etat_contrat != 1'); \n $memb = $tabela->fetchAll($select);\n if(count($memb) > 0){\n $trouvmembre = $memb->current(); \n \n $this->_redirect('/index/ancienpmmcnpedit/id/'.$trouvmembre->ancien_code_membre);\n } else { $this->view->message = \"Pas de resultat ...\";}\n } else { $this->view->message = \"Champs * obligatoire ...\";}\n \n } \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Removes a course in the list of courses. \param $courseToRemove The course to remove. | public function removeCourse(Course $courseToRemove)
{
$aSubject = $courseToRemove();
if ($this->containsCourse($courseToRemove))
{
$query = "DELETE FROM " . Course::belongsToTABLENAME . " WHERE id_course = " . $courseToRemove->getSqlId() . " AND id_calendar = " . $this->sqlId . ";";
if (Database::currentDB()->executeQuery($query))
{
unset($this->coursesList[array_search($courseToRemove, $this->coursesList)]);
// The two next blocs remove the course from all calendars related to this one
if (!empty($aSubject))
{
$T=new Timetable();
$T->loadFromDB($aSubject->getTimetable());
$T->removeCourse($courseToRemove); // REMOVE course from calendar of the course’s subject
foreach ($aSubject->getTeachedByList() as $oneSpeaker) // for all speakers of this course
{
$aTeacher = new Teacher();
if ($aTeacher->loadFromDB($oneSpeaker)) // We check that $oneSpeaker is a user
{
//$aTeacher->getTimetable()->removeCourse($courseToRemove); // REMOVE course from teacher’s calendar
$T=new Timetable();
$T->loadFromDB($aTeacher->getTimetable());
$T->removeCourse($courseToRemove); // REMOVE course from calendar of the course’s subject
}
}
}
if (!empty($this->group)) // REMOVE course from all dependingCalendars
{
//Issue#3: DO NOTHING
}
}
else
{
Database::currentDB()->showError("ligne n°" . __LINE__ . " classe :" . __CLASS__);
}
}
} | [
"public function removeBook(Book $removedBook) {\n }",
"public function removeCourse() {\r\n\t\t\r\n\t\t$studentModel = new StudentModel();\r\n\t\t$view = new StudentView();\r\n\t\t$Adminview = new AdminView();\r\n\t\t$result = $studentModel->removeCourse($_SESSION['studentId'],$_POST['courseOfferingID']);\r\n\t\t\r\n\t\tif ($result == true) {\r\n\t\t\t$Adminview->set('error','Course Successfully Dropped');\r\n \t\t\t$_SESSION['siteMessage'] = $Adminview->sUseTemplate('/components/main/views/success.tpl.php');\r\n\t\t} else {\r\n\t\t\t$Adminview->set('error','Unable to drop course. Please contact an administrator');\r\n \t\t\t$_SESSION['siteMessage'] = $Adminview->sUseTemplate('/components/main/views/error.tpl.php');\r\n\t\t}\r\n\t\t\r\n\t\tglobal $_CORE;\r\n\t\t$_CORE->redirect();\r\n\t}",
"public function removeCurriculumCourseSlot($curriculumCourseSlot)\n {\n\tif(isset($this->curriculumCourseSlots[$curriculumCourseSlot->getCurriculumIndex()]))\n {\n\t unset($this->curriculumCourseSlots[$curriculumCourseSlot->getCurriculumIndex()]);\n }\n }",
"public function removeUsages(Tx_WineTreatment_Domain_Model_Usage $usageToRemove) {\n\t\t$this->usages->detach($usageToRemove);\n\t}",
"public function removeCourse($coursecode){\r\n $sql = \"DELETE FROM \".Dao::TABLE_COURSES.\" WHERE coursecode = ?;\";\r\n $params = array($coursecode);\r\n return $this->delete($sql, $params);\r\n }",
"public function remove_course($cid = FALSE)\n\t{\n\t if_not_logged_in_redirect();\n\t $uid = $this->input->cookie('uid');\n\t \n\t if($cid === FALSE)\n\t {\n\t show_404();\n\t }\n\t \n\t $this->users_model->remove_course($uid,$cid);\n\t redirect('courses/course/'.$cid);\n\t}",
"public function removeDealer(Tx_ZefuegDealer_Domain_Model_Dealer $dealerToRemove) {\n\t\t$this->dealers->detach($dealerToRemove);\n\t}",
"function removeComponent(IComponent $component);",
"public function removeCourse(\\ClassCentral\\SiteBundle\\Entity\\User $user, CourseEntity $course, $listId)\n {\n $em = $this->container->get('doctrine')->getManager();\n $userCourseId = $this->getUserCourseId($user,$course,$listId);\n if($userCourseId)\n {\n $uc = $em->find('ClassCentralSiteBundle:UserCourse', $userCourseId);\n $em->remove($uc);\n $em->flush();\n\n return true;\n }\n\n // Course was not added before\n return false;\n\n }",
"public function remove_instructor_from_course($course_id, $instructor_id) {\n\n\t\tif ($this->course_model->update_course_info($course_id, array('instructor_id' => 0, 'instructor_share' => 0))) {\n\n\t\t\t$this->logger\n\t\t\t ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n\t\t\t ->user_details($this->user_model->getUserInfoByIpAddress())\n\t\t\t ->type('remove_instructor_from_course') //Entry type like, Post, Page, Entry\n\t\t\t ->id($course_id) //Entry ID\n\t\t\t ->token('DELETE') //Token identify Action\n\t\t\t ->comment($this->session->userdata('name'). ' removed instructor in a course.')\n\t\t\t ->log(); //Add Database Entry\n\n\n\t\t\t$this->session->set_flashdata('success', 'Instructor in this course has been removed.');\n\t\t} else {\n\t\t\t$this->session->set_flashdata('danger', 'Failed to removed!');\n\t\t}\n\n\t\tredirect(site_url('users/' . $instructor_id . '/instructor_enrollment'));\n\t}",
"function on_remove_handler()\n{\n\tglobal $g_obj_assign_ta_manager, $g_str_ta_id;\n\t\n\t$arr_course_list = PageHandler::get_post_value( 'CourseId' );\t\n\t\n\tif ( $arr_course_list == null )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, \"Please select at least one professor\" );\n\t\treturn;\n\t}\n\t\n\t$arr_success = array();\n\t$arr_fail = array();\n\t\n\tforeach( $arr_course_list as $int_course_id )\n\t{\n\t\tif ( $g_obj_assign_ta_manager->unassign_TA( $g_str_ta_id, $int_course_id ) )\n\t\t{\n\t\t\tarray_push( $arr_success, $int_course_id );\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tarray_push( $arr_fail, $int_course_id );\n\t\t}\n\t}\n\t\n\tif ( count( $arr_success ) != 0 )\n\t{\n\t\tMessageHandler::add_message( MSG_SUCCESS, 'Successfully removed the TA from ' . count( $arr_success ) . ' course(s)' );\n\t}\n\t\n\tif ( count( $arr_fail ) != 0 )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Failed to remove the TA from ' . count( $arr_fail ) . ' course(s)' );\n\t}\n}",
"public function removeCourse(\\ClassCentral\\SiteBundle\\Entity\\User $user, Course $course, $listId)\n {\n $em = $this->container->get('doctrine')->getManager();\n $userCourseId = $this->getUserCourseId($user,$course,$listId);\n if($userCourseId)\n {\n $uc = $em->find('ClassCentralSiteBundle:UserCourse', $userCourseId);\n $em->remove($uc);\n $em->flush();\n\n return true;\n }\n\n // Course was not added before\n return false;\n\n }",
"public function removeCourt($court) {\n\t\t$result = false;\n\t\tif(isset($court)) {\n\t\t\t$i=0;\n\t\t\tforeach($this->getCourts() as $cl) {\n\t\t\t\tif($court == $cl) {\n\t\t\t\t\t$this->courtsToBeDeleted[] = $court->getCourtNumber();\n\t\t\t\t\tunset($this->courts[$i]);\n\t\t\t\t\t$result = $this->setDirty();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"function removeComponent(IComponent $component): void;",
"public function delete_course()\n {\n $course = Course::findOrFail($this->selected_course_id);\n if ($course->user_id == Auth::id() && Auth::user()->is_teacher())\n {\n $course_content_list = CourseContent::where('course_id', $course->course_id)->get();\n foreach ($course_content_list as $course_content)\n {\n try\n {\n Storage::delete($course_content->course_content_file_path);\n }\n catch (\\Throwable $e)\n {\n // Do something\n }\n \n $course_content->delete();\n }\n $course->delete();\n \n $this->selected_course_id = null;\n $this->confirming_course_deletion = false;\n \n $this->emit('course-deleted');\n }\n }",
"public function delete_course()\n {\n $course = \\Chamilo\\Application\\Weblcms\\Course\\Storage\\DataManager::retrieve_by_id(\n Course::class_name(), \n $this->get_course_id());\n \n if (! $course->delete())\n {\n throw new \\Exception(Translation::get('CourseDeleteFailed'));\n }\n else\n {\n $this->redirect(\n Translation::get('CourseDeleted'), \n false, \n array(\n \\Chamilo\\Application\\Weblcms\\Manager::PARAM_ACTION => \\Chamilo\\Application\\Weblcms\\Manager::ACTION_VIEW_WEBLCMS_HOME));\n }\n }",
"public function removeCourseRequisite($course)\n\t{\n\t\t$this->db->where('CourseID', $this->courseID);\n\t\t$this->db->where('RequisiteCourseID', $course->courseID);\n\t\t$this->db->delete('CourseRequisites');\n\t\t\n\t\t$num = $this->db->affected_rows();\n\t\t\n\t\t$this->db->where('CourseID', $course->courseID);\n\t\t$this->db->where('RequisiteCourseID', $this->courseID);\n\t\t$this->db->delete('CourseRequisites');\n\t\t\n\t\treturn ($num + $this->db->affected_rows()) > 0;\n\t}",
"public function removeComponent(LabComponent $lab_component)\n {\n // If the lab test is not already in the database, simply \"make it so\"\n if (! $this->labTestInDatabase()) {\n throw new Exception(\"Lab components can't be removed from a lab test not stored in the database\");\n }\n\n // If the lab component is not already in the database, simply \"make it so\"\n if (! $lab_component->inDatabase()) {\n throw new Exception(\"Lab component is not in the database and can't be removed from the lab\");\n }\n\n // Lab component is already a part of the lab test, don't duplicate\n if (! $this->labHasLabComponent($lab_component)) {\n throw new Exception(\"The lab test doesn't have the component that was attempted to be removed\");\n }\n\n // Grab ID's for deletion\n $lab_test_id = $this->getLabTestId();\n $lab_component_id = $lab_component->getId();\n\n // Query to delete the lab component from the lab test\n $query = \"DELETE FROM `LabComponentsAssociation` WHERE `LabTestId` = :LabTestId AND `LabTestComponentId` = :LabTestComponentId;\";\n $stmt_delete_component = $this->con->prepare($query);\n $stmt_delete_component->bindParam(\":LabTestId\", $lab_test_id);\n $stmt_delete_component->bindParam(\":LabTestComponentId\", $lab_component_id);\n $stmt_delete_component->execute();\n\n // TODO: test\n unset($this->lab_components[array_search($lab_component)]);\n }",
"public function removeSubscriberRole($subscriberRole);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test get_feedback_access_information for site feedback. | public function test_get_feedback_access_information_for_site_feedback() {
$sitefeedback = $this->getDataGenerator()->create_module('feedback', array('course' => SITEID));
$this->setUser($this->student);
// Access the site feedback via the site activity.
$result = mod_feedback_external::get_feedback_access_information($sitefeedback->id);
$result = external_api::clean_returnvalue(mod_feedback_external::get_feedback_access_information_returns(), $result);
$this->assertTrue($result['cancomplete']);
$this->assertTrue($result['cansubmit']);
// Access the site feedback via course where I'm enrolled.
$result = mod_feedback_external::get_feedback_access_information($sitefeedback->id, $this->course->id);
$result = external_api::clean_returnvalue(mod_feedback_external::get_feedback_access_information_returns(), $result);
$this->assertTrue($result['cancomplete']);
$this->assertTrue($result['cansubmit']);
// Access the site feedback via course where I'm not enrolled.
$othercourse = $this->getDataGenerator()->create_course();
$this->expectException('moodle_exception');
mod_feedback_external::get_feedback_access_information($sitefeedback->id, $othercourse->id);
} | [
"public function test_get_feedback_access_information_student() {\n\n self::setUser($this->student);\n $result = mod_feedback_external::get_feedback_access_information($this->feedback->id);\n $result = external_api::clean_returnvalue(mod_feedback_external::get_feedback_access_information_returns(), $result);\n\n $this->assertFalse($result['canviewanalysis']);\n $this->assertFalse($result['candeletesubmissions']);\n $this->assertFalse($result['canviewreports']);\n $this->assertFalse($result['canedititems']);\n $this->assertTrue($result['cancomplete']);\n $this->assertTrue($result['cansubmit']);\n $this->assertTrue($result['isempty']);\n $this->assertTrue($result['isopen']);\n $this->assertTrue($result['isanonymous']);\n $this->assertFalse($result['isalreadysubmitted']);\n }",
"public static function get_feedback_access_information($feedbackid, $courseid = 0) {\n global $PAGE;\n\n $params = array(\n 'feedbackid' => $feedbackid,\n 'courseid' => $courseid,\n );\n $params = self::validate_parameters(self::get_feedback_access_information_parameters(), $params);\n\n list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],\n $params['courseid']);\n $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);\n\n $result = array();\n // Capabilities first.\n $result['canviewanalysis'] = $feedbackcompletion->can_view_analysis();\n $result['cancomplete'] = $feedbackcompletion->can_complete();\n $result['cansubmit'] = $feedbackcompletion->can_submit();\n $result['candeletesubmissions'] = has_capability('mod/feedback:deletesubmissions', $context);\n $result['canviewreports'] = has_capability('mod/feedback:viewreports', $context);\n $result['canedititems'] = has_capability('mod/feedback:edititems', $context);\n\n // Status information.\n $result['isempty'] = $feedbackcompletion->is_empty();\n $result['isopen'] = $feedbackcompletion->is_open();\n $anycourse = ($course->id == SITEID);\n $result['isalreadysubmitted'] = $feedbackcompletion->is_already_submitted($anycourse);\n $result['isanonymous'] = $feedbackcompletion->is_anonymous();\n\n $result['warnings'] = [];\n return $result;\n }",
"function feedback_details($feedback_id){\n\t\n\tif (isset($_SESSION['admin_id'])) {\n\t//check user authentication\n\tif($this->MDashboard->getRoalAuth($path='feedback',$_SESSION['user_role_id'])){\n\t//if true do nothing\n\t}else{\n\t$this->session->set_userdata('erroruseraccess', ' The user cannot access feedback page.');\t\n\tredirect('/admin/','location');\t\n\t}\n\t$this->Admin_feedback->feedbackread($feedback_id);\n\t$data['main'] = 'admin/feedback/feedback_details';\n\t$data['title'] = \"Property Mgt System | Admin Dashboard\";\n\t$data['logo']=$this-> CompanyDetails-> getLogo(); //get company logo\n\t$data['feedcount'] = $this-> Admin_feedback-> feedbackCount();\n\t$data['feedhead'] = $this-> Admin_feedback-> feedheader();\n\t$data['orderscount'] = $this-> Admin_orders-> ordersCount();\n $data['reviewscount'] = $this-> Admin_store-> reviewsCount();\t\n\t$data['designordercount'] = $this-> Admin_design_orders-> designordersCount();\t\t\n\t\t//get the \"log in\" admin informations\n $data['user_data'] = $this-> MDashboard-> getUserInfo($_SESSION['admin_id']);\n\t\n\t$data['admin_feedback_details'] = $this->Admin_feedback-> onefeedDetails($feedback_id);\n\n\t\n\t$this-> load-> vars($data);\n\t$this -> load -> view('admin/dashboard_template');\n\t}else{\n\tredirect('admin/login', 'location');\n\t}\n }",
"public function show_site_feedback()\n\t{\n\t\tif (!$this->ion_auth->logged_in()) // Check if user is logged in\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('auth/login', 'refresh');\n\t\t}\n\t\telseif (!$this->ion_auth->is_admin()) // Check if user is admin\n\t\t{\t\n\t\t\t$this->sprite_class->load('master/access_denied');\n\t\t}\n\t\telse\n\t\t{\n\t\t$data['notes'] = $this->sprites_model->get_site_feedback();\n\t\t$data['adminArray'] = $data;\n\t\t$this->sprite_class->load('master/show_site_feedback',$data);\n\t\t\n\t\t}\n\t}",
"public static function get_feedback_access_information_parameters() {\n return new external_function_parameters (\n array(\n 'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id.'),\n 'courseid' => new external_value(PARAM_INT, 'Course where user completes the feedback (for site feedbacks only).',\n VALUE_DEFAULT, 0),\n )\n );\n }",
"public function displayFeedbackAction()\n\t{\n\t\t$feedback_id = Extended\\feedback_requests::displayFeedback( Auth_UserAdapter::getIdentity ()->getId (), $this->getRequest()->getparam('feedback_req_id'), \\Extended\\feedback_requests::VISIBILITY_CRITERIA_DISPLAYED);\n\t\tif($feedback_id)\n\t\t{\n\t\t\t$this->view->feedback_visible=$feedback_id;\n\t\t\techo Zend_Json::encode( 1 );\n\t\t}\n\t\tdie;\n\t}",
"function getFeedback()\n\t{\n\t\treturn $this->feedback;\n\t}",
"public function test_get_data_access_information_student() {\n global $DB;\n // Modify the database to add access restrictions.\n $this->database->timeavailablefrom = time() + DAYSECS;\n $this->database->requiredentries = 2;\n $this->database->requiredentriestoview = 2;\n $DB->update_record('data', $this->database);\n\n // Test user with full capabilities.\n $this->setUser($this->student1);\n\n $result = mod_data_external::get_data_access_information($this->database->id);\n $result = external_api::clean_returnvalue(mod_data_external::get_data_access_information_returns(), $result);\n\n $this->assertEquals($this->group1->id, $result['groupid']);\n\n $this->assertFalse($result['canmanageentries']);\n $this->assertFalse($result['canapprove']);\n $this->assertTrue($result['canaddentry']); // It return true because it doen't check time restrictions.\n $this->assertFalse($result['timeavailable']);\n $this->assertFalse($result['inreadonlyperiod']);\n $this->assertEquals(0, $result['numentries']);\n $this->assertEquals($this->database->requiredentries, $result['entrieslefttoadd']);\n $this->assertEquals($this->database->requiredentriestoview, $result['entrieslefttoview']);\n }",
"function feedback() {\n\t\tif(isset($_POST['feedback'])) {\n\t\t\t$arrArgs=array(\n\t\t\t\t\"feedback\"=>$_POST['feedback'],\n\t\t\t\t);\n\t\t\t$arrData=$this->loadModel(\"test\",\"insertFeedback\",$arrArgs);\n\t\t}\n\t\t$this->finishTest();\n\t}",
"public function getTradeInfo($feedback, $data)\n {\n $aio = $this->getAio();\n $aio->MerchantID = $this->merchantId;\n $aio->HashKey = $data['hashKey'];\n $aio->HashIV = $data['hashIv'];\n $aio->ServiceURL = $this->getUrl('queryTrade');\n $aio->EncryptType = $this->encryptType;\n $aio->Query['MerchantTradeNo'] = $feedback['MerchantTradeNo'];\n $info = $aio->QueryTradeInfo();\n if (count($info) < 1) {\n throw new Exception($this->provider . ' trade info is empty.');\n }\n return $info;\n }",
"public function apn_feedback()\n {\n $this->mockPushNotification = Mockery::mock(PushNotification::class, ['apn'])->makePartial()->shouldAllowMockingProtectedMethods();\n $message = [\n 'aps' => [\n 'alert' => [\n 'title' => 'New Notification test',\n 'body' => 'Just for testing purposes'\n ],\n 'sound' => 'default'\n ]\n ];\n $this->mockPushNotification->setMessage($message)\n ->setDevicesToken([\n 'asdfasdf'\n ]);\n $this->mockPushNotification->send();\n $this->assertInstanceOf('stdClass', $this->mockPushNotification->getFeedback());\n $this->assertIsArray($this->mockPushNotification->getUnregisteredDeviceTokens());\n }",
"public function getAccessInformation() {\n $fields = array(\n 'accessInformation' => array(\n 'accessUrl',\n 'accessUrlDescriptor',\n 'accessUrlDisplay',\n )\n );\n return TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n }",
"public function getFeedback()\n {\n return isset($this->data['feedback']) ? $this->data['feedback'] : $this->getData('feedback');\n }",
"public function test_specific_feedback_subtest_partially_correct_AON_ADMIN() {\n $expected =\n '<p>'.\n $this->render_title('title1').\n $this->render_general_log('Fake Result', 'html').\n '<p></p>'.\n $this->render_title('title2').\n $this->render_general_log('Teacher Message 1').\n '</p>'.\n $this->render_collapsible_region_score(1, 0, null, 'TEST 1', 'DESCRIPTION 1', self::LOGS_2_1_TEACHER).\n $this->render_collapsible_region_subtests(2, 0.5, null, 'TEST 2', 'DESCRIPTION 2', self::SUBTEST_2_1_TEACHER).\n $this->render_graderinfo(3, 'praktomat 5.6.7', self::RESPONSE_2);\n\n $this->setAdminUser();\n $this->assert_same_feedback(self::RESPONSE_2, '', null, $expected);\n }",
"public static function get_workshop_access_information($workshopid) {\n global $USER;\n\n $params = self::validate_parameters(self::get_workshop_access_information_parameters(), array('workshopid' => $workshopid));\n\n list($workshop, $course, $cm, $context) = self::validate_workshop($params['workshopid']);\n\n $result = array();\n // Return all the available capabilities.\n $capabilities = load_capability_def('mod_workshop');\n foreach ($capabilities as $capname => $capdata) {\n // Get fields like cansubmit so it is consistent with the access_information function implemented in other modules.\n $field = 'can' . str_replace('mod/workshop:', '', $capname);\n $result[$field] = has_capability($capname, $context);\n }\n\n // Now, specific features access information.\n $result['creatingsubmissionallowed'] = $workshop->creating_submission_allowed($USER->id);\n $result['modifyingsubmissionallowed'] = $workshop->modifying_submission_allowed($USER->id);\n $result['assessingallowed'] = $workshop->assessing_allowed($USER->id);\n $result['assessingexamplesallowed'] = $workshop->assessing_examples_allowed();\n if (is_null($result['assessingexamplesallowed'])) {\n $result['assessingexamplesallowed'] = false;\n }\n $result['examplesassessedbeforesubmission'] = $workshop->check_examples_assessed_before_submission($USER->id);\n list($result['examplesassessedbeforeassessment'], $code) = $workshop->check_examples_assessed_before_assessment($USER->id);\n\n $result['warnings'] = array();\n return $result;\n }",
"public function getProvideFeedback()\n {\n return $this->provide_feedback;\n }",
"public function getAccessInfo() {\n return $this->accessInfo;\n }",
"public function feedback(){ return $this->feedback; }",
"public function testReadFeedback() {\n\t\t\t$db_conn = $this->connectToDatabase();\n\n\t\t\t// First, add a piece of feedback we can read\n\t\t\t$fid = $this->addFeedback(0, $db_conn);\n\t\t\t\n\t\t\t// Test setting the question to answered\n\t\t\t$this->sendTestValues($fid, \"F\", \"true\"); \t\t\t\n\t\n\t\t\t// Now run a query to ensure that the flag is set to true\n\t\t\t$query = \"SELECT isread FROM Feedback WHERE fid = \" . $fid . \";\";\n\t\t\t$results = mysql_query($query, $db_conn);\n\t\t\t\t\n\t\t\t// Error check\n\t\t\tif (!$results) {\n\t\t\t\tdie(\"Error: \" . mysql_error($db_conn));\n\t\t\t}\n\t\t\t\t\n\t\t\t$row = mysql_fetch_row($results);\n\t\t\t\t\n\t\t\t$this->assertEquals(1, (int)$row[0]);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation restNewslettersRecipientsRecipientIdGetAsyncWithHttpInfo List recipient | public function restNewslettersRecipientsRecipientIdGetAsyncWithHttpInfo($recipient_id)
{
$returnType = '\OpenAPI\Client\Model\Recipient';
$request = $this->restNewslettersRecipientsRecipientIdGetRequest($recipient_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function getRecipient($id);",
"public function restNewslettersRecipientsGetWithHttpInfo($email = null, $folder_id = null, $recipient_id = null)\n {\n $request = $this->restNewslettersRecipientsGetRequest($email, $folder_id, $recipient_id);\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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Recipient[]' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Recipient[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Recipient[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Recipient[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function restNewslettersRecipientsDeleteWithHttpInfo()\n {\n $request = $this->restNewslettersRecipientsDeleteRequest();\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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Recipient[]' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Recipient[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Recipient[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Recipient[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function restNewslettersRecipientsRecipientIdGetRequest($recipient_id)\n {\n // verify the required parameter 'recipient_id' is set\n if ($recipient_id === null || (is_array($recipient_id) && count($recipient_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $recipient_id when calling restNewslettersRecipientsRecipientIdGet'\n );\n }\n\n $resourcePath = '/rest/newsletters/recipients/{recipientId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($recipient_id !== null) {\n $resourcePath = str_replace(\n '{' . 'recipientId' . '}',\n ObjectSerializer::toPathValue($recipient_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAllRecipients() {}",
"public function getNewsletterRecipientIDs();",
"public function getRecipients(array $criteria = array())\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/recipients\n }",
"public function restNewslettersRecipientsGetAsyncWithHttpInfo($email = null, $folder_id = null, $recipient_id = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Recipient[]';\n $request = $this->restNewslettersRecipientsGetRequest($email, $folder_id, $recipient_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\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 }",
"public function getRecipientId();",
"public function getRecipientId()\n {\n return $this->data['recipient']['id'];\n }",
"public function getRecipientIds();",
"public function retrieveRecipient($recipientId)\n {\n return $this->createRequest(\"recipients/{$recipientId}\");\n }",
"public function get_recipients() {\n\t\tglobal $wpdb, $bp;\n\n\t\t$recipients = array();\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d\", $this->thread_id ) );\n\n\t\tforeach ( (array) $results as $recipient )\n\t\t\t$recipients[$recipient->user_id] = $recipient;\n\n\t\treturn $recipients;\n\t}",
"public function get_recipients() {\n\t\treturn $this->recipients;\n\t}",
"abstract public function getRecipient();",
"public function getTextRecipientsByTextIdWithHttpInfo($textId, $range = null)\n {\n // verify the required parameter 'textId' is set\n if ($textId === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $textId when calling getTextRecipientsByTextId');\n }\n // parse inputs\n $resourcePath = \"/service/text/{TextId}/recipients\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));\n\n // header params\n if ($range !== null) {\n $headerParams['Range'] = $this->apiClient->getSerializer()->toHeaderValue($range);\n }\n // path params\n if ($textId !== null) {\n $resourcePath = str_replace(\n \"{\" . \"TextId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($textId),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('X-Auth-ApiKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['X-Auth-ApiKey'] = $apiKey;\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n 'object',\n '/service/text/{TextId}/recipients'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 206:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 402:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 404:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getRecipientId()\n {\n return $this->recipient->getId();\n }",
"public function getRecipients()\n {\n return $this->recipients;\n }",
"protected function restNewslettersRecipientsRecipientIdDeleteRequest($recipient_id)\n {\n // verify the required parameter 'recipient_id' is set\n if ($recipient_id === null || (is_array($recipient_id) && count($recipient_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $recipient_id when calling restNewslettersRecipientsRecipientIdDelete'\n );\n }\n\n $resourcePath = '/rest/newsletters/recipients/{recipientId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($recipient_id !== null) {\n $resourcePath = str_replace(\n '{' . 'recipientId' . '}',\n ObjectSerializer::toPathValue($recipient_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if thie Groupable can send a message to the group. | public function canSendMessageToGroup(Group $group): bool
{
return true;
} | [
"public function isSendMessage()\n {\n global $account_info;\n\n $allow_send_message = false;\n\n if (!$account_info && $_SESSION['account']) {\n $account_info = $_SESSION['account'];\n }\n\n if (!$GLOBALS['config']['membership_module'] || !$this->isServiceActive('contact_owner')) {\n $allow_send_message = true;\n } elseif ($GLOBALS['rlAccount']->isLogin() && $account_info['Payment_status'] == 'paid' && isset($account_info['plan']['Services']['contact_owner'])) {\n $allow_send_message = true;\n }\n\n $this->is_send_message_allowed = $allow_send_message;\n if (is_object($GLOBALS['rlSmarty'])) {\n $GLOBALS['rlSmarty']->assign_by_ref('allow_send_message', $this->is_send_message_allowed);\n }\n }",
"public function canSend()\n {\n return !$this->sendfriend->isExceedLimit();\n }",
"public static function can_request( $group_id = false ) {\n \t$limit = 0;\n\n\t // Do not stop super admin.\n\t if ( is_super_admin() ) {\n\t\t return true;\n\t }\n \n // Check if group override is allowed.\n $override_allowed = self::get_override();\n\n\t if ( $override_allowed ) {\n\n\t\t // Check if the group has disabled restriction.\n\t\t if ( groups_get_groupmeta( $group_id, 'group-disable-membership-limit' ) ) {\n\t\t\t return true;\n\t\t }\n\t\t // Anyone can join, we don't have any issue.\n\n\t\t \t// Otherwise let us check the limit.\n\t\t $limit = groups_get_groupmeta( $group_id, 'limit_membership_count' );\n\t }\n\n\t if ( ! $limit ) {\n\t\t $limit = self::get_limit();\n\t }\n \n // Check for the allowed.\n $member_count = groups_get_groupmeta( $group_id, 'total_member_count');\n\n\t if ( $limit <= $member_count ) {\n\t\t return false;\n\t }\n\n\t return true;\n }",
"public function getCanSendOtherMessages(): bool {\n\t\treturn $this->canSendOtherMessages;\n\t}",
"public function isGroupChat()\r\r\n {\r\r\n return $this->getType() === 'group' || $this->getId() < 0;\r\r\n }",
"protected function checkPermission(): bool\n {\n // Must be the owner or the administrator in the group\n if ($this->message instanceof GroupMessage && $this->message->sender->permission == \"MEMBER\") {\n $this->setReply(\"deckDenied\");\n\n return false;\n }\n\n return true;\n }",
"public function sendable(): bool\n {\n if (empty($this->screenshots)) {\n $this->errors[] = 'No failure screenshots to send.';\n }\n\n if (empty($this->recipients)) {\n $this->errors[] = 'No recipients are specified - set DUSK_FAILURES_RECIPIENT in your environment file.';\n }\n\n return $this->errors ? false : true;\n }",
"public function isMemberOfAnyGroup()\n\t{\n\t\treturn $this->Group->isMemberOfAnyGroup($this->userData['groups'], $this->to['id']);\n\t}",
"public static function isAbleToSend(){\n $mailer = self::getOrCreateMailer();\n if($mailer->send < self::maxPerHour())\n return true;\n return false;\n }",
"public function groupCanWrite()\n {\n return $this->groupIsOwner() && ($this->node->mode() & self::MODE_GROUP_WRITE);\n }",
"public function canAddToGroup(Group $group): bool;",
"public function canSendPrivateMessage()\n {\n return $this->strInterface;\n }",
"public function canCreateGroup() {\n\t}",
"public function hasGroup()\n {\n return $this->group_id > 0;\n }",
"public function isJoinedToGroup()\n { \n return $this->isJoined;\n }",
"protected function checkGroup(): bool\n {\n // If sender is friend, put back group must be set\n if ($this->message instanceof FriendMessage && $this->chatSettings->getInt(\"putBackGroup\") < 0) {\n $this->setReply(\"putBackGroupNotSet\");\n\n return false;\n }\n\n return true;\n }",
"public function canHaveGroups()\n {\n return in_array($this->type, [\n TypeGuesser::TYPE_GROUP,\n TypeGuesser::TYPE_USER\n ]);\n }",
"public function getIsSenderAllowed()\n {\n return $this->IsSenderAllowed;\n }",
"public function isGroupable()\n\t{\n\t\tif ($this->group_field) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the output of a client SELECT query This function requires one arg: the result of a prior query Displayed columns are ordered: First,Middle,Last,ID | function show_client_list_result($result)
{
echo "<TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0>\n";
echo "<TR>" .
"<TH>First Name</TH>" .
"<TH>Middle Name</TH>" .
"<TH>Last Name</TH>" .
"<TH>Client<BR>ID</TH>" .
"</TR>\n";
while ($row = mysqli_fetch_array($result))
{
echo "<TR>" .
"<TD>" . $row['FName'] . "</TD>" .
"<TD>" . $row['MName'] . "</TD>" .
"<TD>" . $row['LName'] . "</TD>" .
"<TD>" . $row['ID'] . "</TD>" .
"</TR>\n";
}
echo "</TABLE>\n";
} | [
"function display_horiz($query,$db) {\n $output = '';\n $returned = get_query($query,$db);\n $result = $returned[0];\n $fields = $returned[1];\n $max_row = mysql_num_rows($result);\n\n # STORE THE ANSWERS\n $row_count = 0;\n $nums = '';\n while($row_count<$max_row){\n $row = mysql_fetch_array($result);\n $i = 0;\n while ($i<$fields) {\n $nums[$row_count][$i] = $row[$i];\n $i++;\n } # end going through fields in 1 row\n $row_count++;\n } # end going through rows\n\n# NOW DISPLAY THE ANSWERS\n $i = 0;\n while ($i<$fields) {\n $row_count = 0;\n while($row_count<$max_row){\n if ($row_count != 0){ $output.= \",\"; }\n $output.= $nums[$row_count][$i];\n $row_count++;\n } # end going through 1 column\n $output.= $nums[$row_count][$i];\n $i++;\n $output .= \"\\n\";\n } # end going through all columns\n $output .= \"\\n\";\n return $output;\n}",
"public function debug() {\n\n echo \"<blockquote>\";\n\n if ($this->last_error) {\n echo \"<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>$this->last_error</b></font>]<p>\";\n }\n\n echo \"<font face=arial size=2 color=000099><b>Query</b> [$this->num_queries] <b>--</b> \";\n echo \"[<font color=000000><b>$this->last_query</b></font>]</font><p>\";\n\n echo \"<font face=arial size=2 color=000099><b>Query Result..</b></font>\";\n echo \"<blockquote>\";\n\n if ($this->col_info || $this->col_info === false) {\n\n // =====================================================\n // Results top rows\n\n echo \"<table cellpadding=5 cellspacing=1 bgcolor=555555>\";\n echo \"<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>\";\n\n if ($this->col_info) {\n for ($i = 0; $i < count($this->col_info); $i++) {\n echo \"<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type} {$this->col_info[$i]->max_length}</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$this->col_info[$i]->name}</span></td>\";\n }\n }\n elseif ($this->last_result) {\n $first_row = reset($this->last_result);\n if (is_object($first_row)) { $first_row = get_object_vars($first_row); }\n foreach (array_keys($first_row) as $name) {\n echo \"<td nowrap align=left valign=top><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$name}</span></td>\";\n }\n }\n\n echo \"</tr>\";\n\n // ======================================================\n // print main results\n\n if ($this->last_result) {\n\n $i = 0;\n foreach ($this->get_results(null, ARRAY_N) as $one_row) {\n $i++;\n echo \"<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>\";\n\n foreach ($one_row as $item) {\n echo \"<td nowrap><font face=arial size=2>$item</font></td>\";\n }\n\n echo \"</tr>\";\n }\n } // if last result\n else {\n echo \"<tr bgcolor=ffffff><td colspan=\" . (count($this->col_info) + 1) . \"><font face=arial size=2>No Results</font></td></tr>\";\n }\n\n echo \"</table>\";\n } // if col_info\n else {\n echo \"<font face=arial size=2>No Results</font>\";\n }\n\n echo \"</blockquote></blockquote><hr noshade color=dddddd size=1>\";\n\n $this->debug_called = true;\n }",
"public function show_list()\r\n {\r\n try\r\n {\r\n //Put the select statement here\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n\t\t\tshow_error($err_obj->getMessage());\r\n } \r\n }",
"function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"NID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n\n echo \"</table>\";\n }",
"public function sampleDisplay()\n\t{\n\t\t$sql = \"\";\n\t\t//$this is a reference of this class as well as Db\n\t\t$result = $this->connect()->query($sql);\n\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\t//\n\t\t\twhile ($row = $result->fetch())\n\t\t\t{\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t}",
"function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"ID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n\n echo \"</table>\";\n }",
"function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \" \") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}",
"function show_client_result($result)\n\t{\n\t$row = mysqli_fetch_array($result);\n\tif (!$row)\n\t\t{\n\t\treturn FALSE;\n\t\t}\n\techo \"<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0>\\n\" .\n\t\t\"<TR> <TH ALIGN=right>Client ID:</TH> <TD>\" . $row['ID'] . \"</TD> </TR>\\n\" .\n\t\t\"<TR> <TH ALIGN=right>First Name:</TH> <TD>\" . $row['FName'] . \"</TD> </TR>\\n\" .\n\t\t\"<TR> <TH ALIGN=right>Middle Name:</TH><TD>\" . $row['MName'] . \"</TD> </TR>\\n\" .\n\t\t\"<TR> <TH ALIGN=right>Last Name:</TH> <TD>\" . $row['LName'] . \"</TD> </TR>\\n\" .\n\t\t\"</TABLE>\\n\";\n\treturn TRUE;\n\t}",
"function showRow($conn, $id, $search, $title, $url, $pub, $date, $awards) {\n $res = $conn->query('select R.Name, R.Undergraduate ' .\n 'from ProductResearcher PR, Researchers R ' .\n 'where PR.ResearcherID = R.ID and PR.ProductID = '.$id.' ' .\n 'order by PR.AuthorOrder');\n $i = 0;\n while ($row = $res->fetch_assoc()) {\n if ($i !== 0)\n echo ', ';\n $i = 1;\n showName($row['Name'], $row['Undergraduate'], $search);\n }\n echo '. ';\n showTitle($title, $url);\n echo '. ';\n echo '<i>' . $pub . '</i>. ';\n echo $date . '. ';\n if (isset($awards) and strlen($awards) > 0)\n echo '(' . $awards . ')';\n \n echo '<br/>';\n}",
"function printResult($result) {\n echo \"result from SQL:\";\n echo \"<table>\";\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \" \") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}",
"function showQuery($result = 0) {\n if (!$result) $result = $this->result;\n if (!$result) {\n $this->_handleError(\"No result set to show!\");\n return;\n }\n\n // Convert column names to table headings\n $html = \"<table border>\\n\";\n $html .= \"<tr>\\n\";\n $count = mysql_num_fields($result);\n for ($i = 0; $i < $count; $i++) {\n $html .= \"<th>\".mysql_field_name($result, $i).\"</th>\\n\";\n }\n $html .= \"</tr>\\n\";\n\n // Convert data to table cells\n @mysql_data_seek($result, 0);\n $count = 0;\n while ($row = mysql_fetch_row($result)) {\n $html .= \"<tr>\\n\";\n foreach ($row as $item) {\n $html .= \"<td> $item</td>\\n\";\n }\n $html .= \"</tr>\\n\";\n $count++;\n }\n echo $html;\n }",
"function echoResultSet($rs)\n{\n\t$nRows = $rs->getRowCount();\n\tfor($r = 0; $r < $nRows; $r++){\n\t\t$rs->moveToRow($r);\n\t\techo \"Record no. $r:\\n\";\n\t\tfor( $c = 0; $c < $rs->getColumnCount(); $c++ ){\n\t\t\techo \" \", $rs->getColumnName($c), \" = \", $rs->getStringByIndex($c), \"\\n\";\n\t\t}\n\t}\n}",
"function print_user_name_results($display_count, $count, $query_result) {\n // Get the total number of matches\n $count_row = pg_fetch_row($count);\n $total_count = $count_row[0];\n // Update the display count to be the minimum between display count and total count.\n $display_count = $total_count < $display_count ? $total_count : $display_count; \n\n // Print results table.\n echo \"<table class=\\\"pop-over-table pure-table pure-table-bordered\\\">\";\n echo \"<thead><tr>\";\n echo \"<td>UID</td>\";\n echo \"<td>First Name</td>\";\n echo \"<td>Last Name</td>\";\n echo \"</tr></thead><tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n // echo\"<td>\".$row[$i].\"</td>\";\n if ($i == 0) {\n echo '<td class=\"userinfo_uid\">'.$row[$i].'</td>';\n } else if ($i == 1) {\n echo '<td class=\"userinfo_first_name\">'.$row[$i].'</td>';\n } else if ($i == 2) {\n echo '<td class=\"userinfo_last_name\">'.$row[$i].'</td>';\n } else {\n echo\"<td>\".$row[$i].\"</td>\";\n }\n }\n echo \"<tr>\";\n }\n echo \"</tbody></table>\";\n\n // Echo display count summary.\n echo \"<p class=\\\"count_summary\\\">Showing: \".$display_count.\" of \".$total_count.\"</p>\";\n }",
"public function displayAllImageInfo() {\n $this->query(\"select id, subject, description, data, created from $this->table\");\n\n // Get the headers first\n \n $row = $this->fetchrow('assoc');\n \n $body = \"<tr>\\n\";\n foreach($row as $key=>$value) {\n $body .= \"<th>$key</th>\\n\";\n }\n $body .= \"</tr>\\n</thead>\\n<tbody>\\n$line</tr>\\n\";\n \n do {\n $body .= \"<tr>\\n\";\n foreach($row as $value) {\n $item = $value ?? \" \";\n $body .= \"<td>$item</td>\\n\";\n }\n $body .= \"</tr>\\n\";\n } while($row = $this->fetchrow('assoc'));\n \n return <<<EOF\n<table id=\"displayAllImageInfo\">\n<thead>\n<tr>\n$body\n</tbody>\n</table>\nEOF;\n }",
"function displayQuery($question,$sql,$cols,$pads){\n global $mysqli;\n $parts = explode('.',$question);\n if($parts[0]%2==0){\n $color=\"#C0C0C0\";\n }else{\n $color = \"\";\n }\n echo\"<pre style='background-color:{$color}'>\";\n echo printHeader($question,$pads,$cols);\n $response = runQuery($mysqli,$sql);\n if($response['success']){\n foreach($response['result'] as $id => $row){\n $id++;\n $row['id'] = $id;\n $row['name'] = getPlayer($row['playerid']);\n $row[0] = $row[$cols[0]];\n $row[1] = $row[$cols[1]];\n $row[2] = $row[$cols[2]];\n $row[3] = $row[$cols[3]];\n $row[4] = $row[$cols[4]];\n echo formatRows($row,$pads);\n }\n }\n echo\"</pre>\";\n f();\n}",
"public function displayQueries()\n\t{\n\t\tglobal $conf;\n\t\t$html = \"<table cellspacing='2' cellpadding='2' border='0' class='query_list'>\n\t\t\t<tr style='background:#BBB;'><th>#</th><th>Query</th><th>Rows</th><th>Time (sec)</th></tr>\";\n\t\t\n\t\t// $i = 0;\n\t\t$total_chrono = 0;\n\t\twhile ($q = array_shift($this->query_list)) {\n\t\t\t$this->nb_query_displayed++;\n\t\t\tif ($q['error']) {\n\t\t\t\t$html .= \"\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='4' style='background:#333;color:white;'>{$q['error']}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t// we get the color\n\t\t\tif (stripos(' '.$q['origin']['file'],$conf['mods'])) {\n\t\t\t\t// file in local site\n\t\t\t\t$color = '#009';\t// dark blue\n\t\t\t\t$q['origin']['file'] = str_replace($conf['mods'],'',$q['origin']['file']);\n\t\t\t} else {\n\t\t\t\t// file in FFW Framework\n\t\t\t\t$color = '#900';\t// dark red\n\t\t\t\t$q['origin']['file'] = str_replace($conf['ffw'],'',$q['origin']['file']);\n\t\t\t}\n\t\t\t$html .= \"\n\t\t\t\t<tr align='left' valign='top' style='background:#CCC;'>\n\t\t\t\t\t<td rowspan='2' align='right'>$this->nb_query_displayed</td>\n\t\t\t\t\t<td colspan='3' style='color:$color'>/{$q['origin']['file']} line {$q['origin']['line']}<br/>\n\t\t\t\t\t<strong>{$q['origin']['class']}{$q['origin']['type']}{$q['origin']['function']}</strong>(<span style='color:#300;'>\".implode('</span>,<span style=\"color:#300;\">',$q['origin']['args']).\"</span>)</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr align='right' style='background:#DDD;'>\n\t\t\t\t\t<td align='left'>\".str_replace('#900',$color,$this->pretty_sql($q['query'])).\"</td>\n\t\t\t\t\t<td>{$q['nb_rows']}</td>\n\t\t\t\t\t<td>{$q['time']}</td>\n\t\t\t\t</tr>\";\n\t\t\t$total_chrono += $q['time'];\n\t\t}\n\t\t\n\t\t$html .= \"\n\t\t\t<tr style='background:#BBB;' class='last' align='right'>\n\t\t\t\t<th> </th>\n\t\t\t\t<th>total nb of queries: $this->nb_query_displayed</th>\n\t\t\t\t<th></th>\n\t\t\t\t<th style='text-align:right'>$total_chrono</th>\n\t\t\t</tr>\";\n\t\t \n\t\t$html .= '</table>';\n\t\treturn $html;\n\t}",
"function TableResults($formatstring, $mysqliobject/*, column names*/)\n{\n if (!method_exists($mysqliobject, 'fetch_assoc'))\n {\n return;\n }\n if (!DebugOutputEnabled())\n {\n return;\n }\n $args = func_get_args();\n $arr = array_values($args);\n $thing = '';\n # Start the table\n echo \"<div style='$formatstring'>\";\n echo \"<table>\n <tr>\";\n // Skip first two elements as they are format string and mysqliobject\n for ($i = 2; $i < sizeof($arr); $i++)\n {\n $title = strtoupper($arr[$i]);\n echo \"<th>$title .</th>\";\n }\n echo \"</tr>\";\n\n # While the next row isn't null, print it\n # Assuming the row has columns equivalent to the column names supplied\n while (!is_null($thing = $mysqliobject->fetch_assoc()))\n {\n echo \"<tr>\";\n foreach ($thing as $i)\n {\n # token database contains binary datatypes, which output incorrectly unless converted to hex\n if (isBinary($i)) { $i = bin2hex($i); }\n echo \"<td>$i</td>\";\n }\n echo \"</tr>\";\n }\n # Close table\n echo \"</table>\";\n echo \"</div>\";\n}",
"function show_table_rows_result($db, $class=\"\")\n {\n global $debug;\n \n if ($debug)\n printf(\"<p>show_table_rows_result()<br>\\n\");\n\n if (!$this->verify_db($db))\n return 0;\n \n $row = 0;\n \n if ($this->heading) # We already retrieved the first row of data to get the col names\n {\n $this->table_row($row, $row, $db->Record, $class);\t// better show that first row\n $row++;\n }\n \n while($db->next_record($this->map_rels))\t\t\t\t\t// show the rest of the rows\n {\n ## Process a table row\n $this->table_row($row, $row, $db->Record, $class);\n $row++;\n }\n \n return $row;\n }",
"function display_table($result){\n\t\t\t$num_rows = pg_num_rows($result);\n\t\t\techo \"<p class='help-block text-center'>There were <strong>$num_rows</strong> rows returned.</p>\";\n\t\t\techo '<table class=\"table\">';\n\t\t\t$row = pg_fetch_array($result, NULL, PGSQL_ASSOC);\n\t\t\t// First create table headers\n\t\t\techo '<thead><tr>';\n\t\t\tforeach ($row as $key => $value){\n\t\t\t\t\techo '<th>'.$key.'</th>';\n\t\t\t}\n\t\t\techo '</tr></thead>';\n\t\t\t// Create rows of data\n\t\t\techo '<tbody>';\n\t\t\tdo {\n\t\t\t\techo '<tr>';\n\t\t\t\tforeach ($row as $key => $value){\n\t\t\t\t\t\techo '<td>'.$value.'</td>';\n\t\t\t\t}\n\t\t\t\techo '</tr>';\n\t\t\t} while($row = pg_fetch_array($result, NULL, PGSQL_ASSOC));\n\t\t\techo '</tbody></table>';\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the resource link share key to the database | public function Resource_Link_Share_Key_save($share_key) {
if ($share_key->auto_approve) {
$approve = 1;
} else {
$approve = 0;
}
$expires = date("{$this->date_format} {$this->time_format}", $share_key->expires);
$id = $share_key->getId();
$sql = 'INSERT INTO ' . $this->dbTableNamePrefix . LTI_Data_Connector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME . ' ' .
'(share_key_id, primary_consumer_key, primary_context_id, auto_approve, expires) ' .
'VALUES (:id, :primary_consumer_key, :primary_context_id, :approve, :expires)';
$query = $this->db->prepare($sql);
$query->bindValue('id', $id, PDO::PARAM_STR);
$query->bindValue('primary_consumer_key', $share_key->primary_consumer_key, PDO::PARAM_STR);
$query->bindValue('primary_context_id', $share_key->primary_resource_link_id, PDO::PARAM_STR);
$query->bindValue('approve', $approve, PDO::PARAM_INT);
$query->bindValue('expires', $expires, PDO::PARAM_STR);
return $query->execute();
} | [
"public function saveResourceLinkShareKey($shareKey)\n {\n\n $id = $shareKey->getId();\n $expires = date(\"{$this->dateFormat} {$this->timeFormat}\", $shareKey->expires);\n $sql = \"INSERT INTO {$this->dbTableNamePrefix}\" . DataConnector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME . ' ' .\n '(share_key_id, resource_link_pk, auto_approve, expires) ' .\n 'VALUES (:id, :prlid, :approve, :expires)';\n $query = $this->db->prepare($sql);\n $query->bindValue('id', $id, PDO::PARAM_STR);\n $query->bindValue('prlid', $shareKey->resourceLinkId, PDO::PARAM_INT);\n $query->bindValue('approve', $shareKey->autoApprove, PDO::PARAM_INT);\n $query->bindValue('expires', $expires, PDO::PARAM_STR);\n $ok = $query->execute();\n\n return $ok;\n\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 }",
"abstract public function Resource_Link_save($resource_link);",
"public function save() {\n\n $ok = $this->consumer->getDataConnector()->Resource_Link_save($this);\n if ($ok) {\n $this->settings_changed = FALSE;\n }\n\n return $ok;\n\n }",
"public function saveLink($a_link)\n {\n //if the row already exists, return success\n if ($this->linkExists($a_link->getHashKey()))\n {\n return DV2_SUCCESS;\n }\n\n $row = array(\n $this->m_hashKeyFieldName => $a_link->getHashKey(),\n $this->m_sourceFieldName => $a_link->getSource(),\n $this->m_loadDateFieldName => date(\"Y-m-d H:i:s\")\n );\n\n $links = $a_link->getLinks();\n\n //loop through all known linked hubs\n foreach (array_values($this->m_fieldMap) as $field)\n {\n //if this link has a hash for the hub set\n if (isset($links[$field]))\n {\n //...and the link is valid\n if ($links[$field] == \"\")\n {\n continue;\n }\n\n //add the hash for the link to the row to insert\n $row[$field] = $links[$field];\n }\n }\n \n //insert the row into the db\n $result = $this->m_bigQuery->dataset($this->m_datasetID)->table($this->m_tableName)->insertRow($row, array(\"insertId\" => $a_link->getHashKey()));\n\n //if redis is not being used\n if ($this->m_redis == false)\n {\n $this->m_dbHashKeys[$a_link->getHashKey()] = true;\n return DV2_SUCCESS;\n }\n\n //redis is being used. store the key in redis\n if (!$this->m_redis->select($this->m_redisDb))\n {\n return DV2_ERROR;\n }\n\n $this->m_redis->set($a_link->getHashKey(), \"y\");\n return DV2_SUCCESS;\n }",
"private function load() {\n\n $this->initialise();\n $this->data_connector->Resource_Link_Share_Key_load($this);\n if (!is_null($this->id)) {\n $this->length = strlen($this->id);\n }\n if (!is_null($this->expires)) {\n $this->life = ($this->expires - time()) / 60 / 60;\n }\n\n }",
"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 Resource_Link_Share_Key_load($share_key) {\n\n// Clear expired share keys\n $now = date(\"{$this->date_format} {$this->time_format}\", time());\n $sql = 'DELETE FROM ' . $this->dbTableNamePrefix . LTI_Data_Connector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME . ' WHERE expires <= :now';\n $query = $this->db->prepare($sql);\n $query->bindValue('now', $now, PDO::PARAM_STR);\n $query->execute();\n\n// Load share key\n $id = $share_key->getId();\n $sql = 'SELECT share_key_id, primary_consumer_key, primary_context_id, auto_approve, expires ' .\n 'FROM ' . $this->dbTableNamePrefix . LTI_Data_Connector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME . ' ' .\n 'WHERE share_key_id = :id';\n $query = $this->db->prepare($sql);\n $query->bindValue('id', $id, PDO::PARAM_STR);\n $ok = $query->execute();\n if ($ok) {\n $row = $query->fetch(PDO::FETCH_ASSOC);\n $ok = ($row !== FALSE);\n }\n\n if ($ok) {\n $row = array_change_key_case($row);\n $share_key->primary_consumer_key = $row['primary_consumer_key'];\n $share_key->primary_resource_link_id = $row['primary_context_id'];\n $share_key->auto_approve = ($row['auto_approve'] == 1);\n $share_key->expires = strtotime($row['expires']);\n }\n\n return $ok;\n\n }",
"function _addShare(&$share)\n {\n return $share->save();\n }",
"function after_save(&$sharedresource_entry){\n \n return true;\n }",
"protected function _saveUniqueId()\n {\n if ($this->getUniqueId() && $this->getLongUrl()) {\n $url = new Url();\n $url->saveUrl($this->getLongUrl(), $this->getUniqueId());\n } \n }",
"public function testUpdateAchBankLinkUsingPut()\n {\n }",
"public function saveKeyRing(KeyRing $keyRing, &$resource): void;",
"function save() {\n\t\tparent::save();\n\t\tif (null !== $this->_relation && null !== ($relation = $this->_storage->getInstance($this->_relation)))\n\t\t\t$relation->save();\n\t}",
"private function saveCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!isset($this->cacheItem) || !isset($this->cache) || empty($this->cache)) {\n return;\n }\n //====================================================================//\n // Save Links are In Cache\n $this->cacheItem->set($this->cache);\n $this->cacheAdapter->save($this->cacheItem);\n }",
"public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }",
"public function saveKey($public, $private);",
"public function testUpdateBrokerageBankLinkUsingPut()\n {\n }",
"function link_storeData($page_id, $identifier) {\n\tglobal $Auth;\n\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t$return_value = false;\t\n\t\n\t$text = $_POST[$identifier.\"name\"];\n\t$link = $_POST[$identifier.\"link\"];\n\t## for security and convenience reasons we have to convert the supplied string\n\t$text = convert_general($text);\n\n\t## prepare the db-object\n\t$db_connectionStore = new DB_Sql();\n\n\t## first we need to find out if the entry already exists\n\t$select_query = \"SELECT content_id FROM \".PAGE_LINK.\" WHERE page_id = '$page_id' AND identifier = '$identifier' AND client_id='$client_id'\";\n\t$result_pointer = $db_connectionStore->query($select_query);\t\n\t\n\tif($db_connectionStore->num_rows() == 0) { \n\t\t## no entry found\n\t\t$insert_query = \"INSERT INTO \".PAGE_LINK.\" (page_id, identifier, text, link, client_id) values ('$page_id', '$identifier', '$text', '$link','$client_id')\";\n\t\t$result_pointer = $db_connectionStore->query($insert_query);\n\t} else {\n\t\t$db_connectionStore->next_record();\n\t\t$content_id = $db_connectionStore->Record[\"content_id\"];\n\t\t$update_query = \"UPDATE \".PAGE_LINK.\" SET text = '$text', link = '$link' WHERE content_id = '$content_id' AND client_id='$client_id'\";\n\t\t$result_pointer = $db_connectionStore->query($update_query);\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[CAnswers]]. | public function getCAnswers()
{
return $this->hasMany(AnswerOptions::className(), ['id' => 'c_answer'])->viaTable('correct_answers', ['question_id' => 'id']);
} | [
"public function getAnswer(array $query);",
"public function getAnswers(){\n return $this->_applicant->findAnswersByPage($this->_applicationPage->getPage());\n }",
"public function getAllAnswers()\n {\n return $this->answers;\n }",
"public function getQuestions();",
"function getQuery() {\n\t\treturn $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);\n\t}",
"public function getQuestions()\r\n {\r\n $query_string = $this->sql_queries->retrieveQuestions();\r\n $this->databaseConnectWithoutParams($query_string);\r\n\r\n $result = $this->database_wrapper->safeFetchAll();\r\n return $result;\r\n }",
"public function retrieveQuestions()\r\n {\r\n $query_string = $this->sql_queries->retrieveQuestions();\r\n $this->databaseConnectWithoutParams($query_string);\r\n\r\n $result = $this->database_wrapper->safeFetchAll();\r\n return $result;\r\n }",
"public function getAnswersByConfig()\n {\n return $this->hasMany(CategoryFunctionAnswer::class, ['base_data_id' => 'base_data_id',])->andWhere(['answer_id' => $this->arrAnswersToPrint]);\n }",
"public function getAnswers()\n\t{\n\t\treturn Answer::getByQuestion($this);\n\t}",
"public function getAnswers() {\n return $this->answers;\n }",
"public function getAnswers()\n {\n return $this->_answers;\n }",
"public function getAnswer();",
"function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}",
"public function getAnswers()\n {\n return $this->hasMany(Answers::className(), ['question_id' => 'id']);\n }",
"public function getQuery();",
"public function getAnswers()\n {\n return $this->hasMany(Answer::className(), ['questionId' => 'id']);\n }",
"public function getAnswers()\n {\n return new ArrayCollection();\n }",
"final public function getAnswers(): Answers\n {\n return $this->answers;\n }",
"function get_answers_from_exam($qid){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_answers` WHERE `question_id` = '$qid'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns totals for specified rows | function getRowTotals($fields){
$sum=array();
foreach($fields as $field){
$sum[$field]=0;
}
$rows=$this->getRows($fields);
foreach($rows as $row){
foreach($fields as $field){
$sum[$field]+=$row[$field];
}
}
return $sum;
} | [
"public function getRowTotal();",
"public function getTotalRows();",
"public function getBaseRowTotal();",
"public function setRowTotal($amount);",
"public function buildTotalsRow()\n {\n $line = '';\n foreach ($this->Columns as $field => $Column) {\n if (in_array($field, $this->tableOptions['totals'])) {\n $line .= $this->Html->tag('td', $Column->sum(), array('class' => 'cell-number'));\n } else {\n $line .= $this->Html->tag('td', ' ');\n }\n }\n\n return $this->Html->tag('tr', $line, array('class' => 'totalsrow'));\n }",
"function _calculateTotals()\n {\n if (!empty($this->_calculateTotals)) {\n\n $this->addSeparator();\n\n $totals = array();\n\n foreach ($this->_data as $row) {\n if (is_array($row)) {\n foreach ($this->_calculateTotals as $columnID) {\n $totals[$columnID] += $row[$columnID];\n }\n }\n }\n\n $this->_data[] = $totals;\n $this->_updateRowsCols();\n }\n }",
"private function calculateTotals() {\n if (empty($this->calculateTotals)) {\n return;\n }\n\n $this->addSeparator();\n\n $totals = array();\n foreach ($this->data as $row) {\n if (is_array($row)) {\n foreach ($this->calculateTotals as $columnID) {\n $totals[$columnID] += $row[$columnID];\n }\n }\n }\n\n $this->data[] = $totals;\n $this->updateRowsCols();\n }",
"public function calculateItemsTotal();",
"public function getRowTotal() {\n return $this->item->getRowTotal();\n }",
"public function getRowTotalWithDiscount();",
"public function calcRowTotal()\n {\n $invoice = $this->getInvoice();\n $orderItem = $this->getOrderItem();\n $orderItemQty = $orderItem->getQtyOrdered();\n\n $rowTotal = $orderItem->getRowTotal() - $orderItem->getRowInvoiced();\n $baseRowTotal = $orderItem->getBaseRowTotal() - $orderItem->getBaseRowInvoiced();\n $rowTotalInclTax = $orderItem->getRowTotalInclTax();\n $baseRowTotalInclTax = $orderItem->getBaseRowTotalInclTax();\n\n if (!$this->isLast()) {\n $availableQty = $orderItemQty - $orderItem->getQtyInvoiced();\n $rowTotal = $invoice->roundPrice($rowTotal / $availableQty * $this->getQty());\n $baseRowTotal = $invoice->roundPrice($baseRowTotal / $availableQty * $this->getQty(), 'base');\n }\n\n $this->setRowTotal($rowTotal);\n $this->setBaseRowTotal($baseRowTotal);\n\n if ($rowTotalInclTax && $baseRowTotalInclTax) {\n $this->setRowTotalInclTax($invoice->roundPrice($rowTotalInclTax / $orderItemQty * $this->getQty(), 'including'));\n $this->setBaseRowTotalInclTax($invoice->roundPrice($baseRowTotalInclTax / $orderItemQty * $this->getQty(), 'including_base'));\n }\n return $this;\n }",
"function total_rows ($total_rows) {\n \t$this->total_rows = $total_rows;\n\n \treturn;\n }",
"public function getCartTotals();",
"private function sum_hits( $rows )\n {\n // Get the label for the hit field\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n\n // Init sum hits\n $sum_hits = 0;\n\n // Tree view flag\n $bTreeView = false;\n list( $table ) = explode( '.', $this->curr_tableField );\n // #i0117, 141223, dwildt, 1-/+\n //if ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n if ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n $bTreeView = true;\n }\n // Tree view flag\n // Tree view : get lowest uid_parent\n if ( $bTreeView )\n {\n // Get the field label\n $treeParentField = $this->sql_filterFields[ $this->curr_tableField ][ 'treeParentField' ];\n // Set lowest uid_parent 'unlimited'\n $lowestPid = 9999999;\n // LOOP all rows : set lowest pid\n foreach ( ( array ) $rows as $row )\n {\n if ( ( $row[ $treeParentField ] < $lowestPid ) && ( $row[ $treeParentField ] !== null ) )\n {\n $lowestPid = $row[ $treeParentField ];\n }\n }\n // LOOP all rows : set lowest pid\n }\n // Tree view : get lowest uid_parent\n // LOOP all rows : count hits\n foreach ( ( array ) $rows as $row )\n {\n // Default case : count each row\n if ( !$bTreeView )\n {\n $sum_hits = $sum_hits + $row[ $hitsField ];\n }\n // Default case : count each row\n // Tree view case : count top level rows only\n if ( $bTreeView )\n {\n if ( $row[ $treeParentField ] == $lowestPid )\n {\n $sum_hits = $sum_hits + $row[ $hitsField ];\n }\n }\n // Tree view case : count top level rows only\n }\n // LOOP all rows : count hits\n // Set class var $this->hits_sum\n $this->hits_sum[ $this->curr_tableField ] = ( int ) $sum_hits;\n\n return;\n }",
"public function FetchTotalRows() {\n\t\t\n\t\t$db = Database::GetDB();\n\t\treturn $db->FetchTotalRows($this->mTableName)->total;\n\t}",
"function RowSum($table,$where,$field)\n {\n //return $this->RowFunc(\"SUM\",$table,$where,$field);\n\n\n if ($table==\"\") { $table=$this->SqlTableName($table); }\n if (!$this->Sql_Table_Exists($table)) { return 0; }\n if (is_array($where)) { $where=$this->Hash2SqlWhere($where); }\n\n if (!is_array($field)) { $field=array($field); }\n\n $sums=array();\n foreach ($field as $rfield) { array_push($sums,\"SUM(\".$rfield.\")\"); }\n\n\n $query=\n \"SELECT \".join(\"+\",$sums).\n \" FROM `\".$table.\"` WHERE \".$where;\n $result = $this->QueryDB($query);\n\n $res=$this->DB_Fetch_FirstEntry($result);\n\n $this->DB_FreeResult($result);\n\n if (empty($res)) { $res=0; }\n\n return $res;\n }",
"public function updateTotals()\n {\n foreach ($this->totals_plan as $key=>$val) {\n\n // if value is array, then we treat it as built-in or callable aggregate method\n if (is_array($val)) {\n $f = $val[0]; // shortcut\n\n // initial value is always 0\n if (!isset($this->totals[$key])) {\n $this->totals[$key] = 0;\n }\n\n // closure support\n // arguments - current value, key, \\atk4\\ui\\Table object\n if ($f instanceof \\Closure) {\n $this->totals[$key] += ($f($this->model[$key], $key, $this) ?: 0);\n }\n // built-in methods\n elseif (is_string($f)) {\n switch ($f) {\n case 'sum':\n $this->totals[$key] += $this->model[$key];\n break;\n case 'count':\n $this->totals[$key] += 1;\n break;\n case 'min':\n if ($this->model[$key] < $this->totals[$key]) {\n $this->totals[$key] = $this->model[$key];\n }\n break;\n case 'max':\n if ($this->model[$key] > $this->totals[$key]) {\n $this->totals[$key] = $this->model[$key];\n }\n break;\n default:\n throw new Exception(['Aggregation method does not exist', 'method'=>$f]);\n }\n }\n }\n }\n }",
"public function sglcd_total(){\n\t\t$sql = \"\n\t\tSelect\n\t\tsum(cd_trans_dr) as totdr,\n\t\tsum(cdt.cd_trans_cr) as totcr\n\t\tfrom tb_journal_cd_trans cdt\n\t\tinner join tb_journal_cd cd on cdt.cd_id=cd.cd_id\n\t\twhere cd.project_id=\".$this->session->userdata('project_id').\"\n\t\t\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data;\n\t}",
"public function getTotals()\n {\n return $this->get(self::totals);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the public base directory | public function getPublicDirectory(): string
{
return $this->public_directory;
} | [
"public function getPublicDir()\n {\n return $this->getProjectDir() . \"/public\";\n }",
"public function getPublicDirectory():string\n {\n return $this->publicDir;\n }",
"public function get_base_path() {\n return $this->base_path . '/';\n }",
"public function get_base_path() {\n\t\treturn self::$_base_path;\n\t}",
"public function baseDir()\n {\n return Config::get('f-sgallery::config.gallery_file_path');\n }",
"function base_path()\n\t\t{\n\t\t\treturn dirname(__DIR__);\n\t\t}",
"public function publicPath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . env('APP_PUBLIC');\n }",
"public function getPublicPath();",
"public static function getBaseDirectory()\n {\n return self::$sBaseDirectory;\n }",
"function public_base_directory()\n{\n $public_directory = dirname($_SERVER['PHP_SELF']);\n //place each directory into array\n $directory_array = explode('/', $public_directory);\n //get highest or top level in array of directory strings\n $public_base = max($directory_array);\n \n return $public_base;\n}",
"public static function basedir() {\n\t\t$directory = trim($_SERVER['SUBDIRECTORY'], '/');\n\t\t$directory = str_replace('\\\\', '/', $directory);\n\n\t\treturn '/' . $directory;\n\t}",
"public function public_path();",
"static public function base_url()\n\t{\n\t\treturn dirname(rawurldecode($_SERVER['SCRIPT_NAME'])) . '/';\n\t}",
"public function getBasepath(): string\n {\n return $this->basepath;\n }",
"public static function getPublicCacheDir()\n {\n return self::$public_cache_dir;\n }",
"public static function GetWebRoot()\n {\n return dirname(Yii::app()->getBasePath());\n }",
"public function getBaseDir()\n {\n return $this->baseDir();\n }",
"public function getPublicImgDir(){\n return $this->getPublicStaticDir() . 'img/';\n }",
"protected function getHtmlBaseDir(){ \n $parts = explode('/',__DIR__);\n unset($parts[count($parts)-1]);\n return implode('/',$parts); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the secured hidden fields have been rendered | protected function hasSecuredHiddenFieldsRendered() {} | [
"protected function should_print_hidden_sub_fields() {\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Missing\n\t\treturn FrmAppHelper::is_form_builder_page() || FrmAppHelper::doing_ajax() && isset( $_POST['action'] ) && 'frm_insert_field' === $_POST['action'];\n\t}",
"private function show_hidden() {\n\n if (!empty($this->_hiddenfields)) {\n\n foreach ($this->_hiddenfields as $name => $value) {\n ?>\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\">\n <?php\n }\n\n // Clear the array\n $this->_hiddenfields = array();\n\n }\n }",
"protected function render_hidden_fields()\n {\n }",
"public function isHidden();",
"public function canDisplayed()\r\n {\r\n if (!$this->allowAccess())\r\n return false;\r\n if ($this->getHidden() == \"Y\")\r\n return false;\r\n return true;\r\n }",
"public function isDisplayed(): bool\n\t{\n\t\treturn !in_array(\\CCrmFieldInfoAttr::NotDisplayed, $this->getAttributes(), true);\n\t}",
"private function verifyInvisibleCAPTCHA()\n {\n self::sanitizePOST($this->invisibleCAPTCHA);\n\n if(empty($_POST[$this->invisibleCAPTCHA]))\n {\n return TRUE;\n }\n\n //Form is not verified. Save error to log.\n $logMessage = new \\Curator\\Application\\Log(__CLASS__, __METHOD__);\n $logMessage ->saveHazard(LANG\\HAZARD_VALIDATE_INVISIBLE_CAPTCHA . ' invisibleCAPTCHA: \"' . $_POST[$this->invisibleCAPTCHA] . '\"');\n\n return FALSE;\n }",
"public function isHidden(): bool\n {\n return $this->type === 'hidden';\n }",
"private function isValidHiddenData()\n {\n foreach ($this->hidden as $hidden) {\n if (null === $hidden['value'] || !is_string($hidden['value'])) {\n return false;\n }\n }\n\n return true;\n }",
"function isHidden()\n {\n return $this->_hidden;\n }",
"function displays_exposed() {\n $conf = $this->get_option('allow');\n // If this is set, the exposed form is part of pane configuration, not\n // rendered normally.\n return empty($conf['exposed_form']);\n }",
"public function is_hidden()\n\t{\n\t\tif ($this->hidden == TRUE OR in_array($this->name, $this->fuel->layouts->hidden))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"private function isAuthorisedDisplayDebug(): bool\n\t{\n\t\tstatic $result = null;\n\n\t\tif ($result !== null)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t// If the user is not allowed to view the output then end here.\n\t\t$filterGroups = (array) $this->params->get('filter_groups', []);\n\n\t\tif (!empty($filterGroups))\n\t\t{\n\t\t\t$userGroups = $this->app->getIdentity()->get('groups');\n\n\t\t\tif (!array_intersect($filterGroups, $userGroups))\n\t\t\t{\n\t\t\t\t$result = false;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$result = true;\n\n\t\treturn true;\n\t}",
"public function isHidden(): bool\n {\n return $this->is('visible', false);\n }",
"public function isFormVisible() {\n return $this->definition['form_visible'];\n }",
"abstract public function getHiddenFields();",
"function isHiddenField($field) {\n\n if (isset($this->hidden[$field])) {\n return true;\n }\n return false;\n }",
"public function render_hidden_fields()\n\t{\n\t\tif (!empty($this->hidden_fields)) {\n\t\t\tforeach ($this->hidden_fields as $hidden) {\n\t\t\t\t$hidden->render();\n\t\t\t}\n\t\t}\n\t}",
"function addHiddenSecurityFields ()\r\n\t{\r\n\t\t# Firstly (since username may be in use as a key) create a hidden username if required and a username is supplied\r\n\t\t$userCheckInUse = ($this->settings['user'] && $this->settings['userKey']);\r\n\t\tif ($userCheckInUse) {\r\n\t\t\t$securityFields['user'] = $this->settings['user'];\r\n\t\t}\r\n\t\t\r\n\t\t# Create a hidden timestamp if necessary\r\n\t\tif ($this->settings['timestamping']) {\r\n\t\t\t$securityFields['timestamp'] = $this->timestamp;\r\n\t\t}\r\n\t\t\r\n\t\t# Create a hidden IP field if necessary\r\n\t\tif ($this->settings['ipLogging']) {\r\n\t\t\t$securityFields['ip'] = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\t\r\n\t\t# Make an internal call to the external interface\r\n\t\t#!# Add security-verifications as a reserved word\r\n\t\tif (isSet ($securityFields)) {\r\n\t\t\t$this->hidden (array (\r\n\t\t\t 'name'\t=> 'security-verifications',\r\n\t\t\t\t'values'\t=> $securityFields,\r\n\t\t\t));\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set PHP directives: execution_time time for script executions internal_encoding encoding for multibyte extension memory_limit limit script memory usage Note: Some of php directives can not be set here. Thus php user config(.user.ini) used. Look for it in application root folder. | private function phpSetup()
{
set_time_limit($this->executionTime);
mb_internal_encoding($this->mbEncoding);
//todo Something wrong if memory_limit set here.
// http://php.net/manual/en/ini.core.php#ini.memory-limit
ini_set('memory_limit', $this->memoryLimit);
} | [
"public function set_php_timeout() {\n\t\t\tini_set( 'max_execution_time' , $this->SmartOptions->php_max_execution_time->value );\n\t\t\tif ( $this->is_func_available( 'set_time_limit' ) ) {\n\t\t\t\tset_time_limit( $this->SmartOptions->php_max_execution_time->value );\n\t\t\t}\n\t\t}",
"public function overridePhpSettings($params=null)\r\n {\r\n if (isset($params['max_execution_time'])) {\r\n $maxExecutionTime = $params['max_execution_time'];\r\n } else {\r\n $maxExecutionTime = Mage::getStoreConfig('jirafe_analytics/php/max_execution_time');\r\n }\r\n\r\n if (isset($params['memory_limit'])) {\r\n $memoryLimit = $params['memory_limit'];\r\n } else {\r\n $memoryLimit = Mage::getStoreConfig('jirafe_analytics/php/memory_limit');\r\n }\r\n\r\n if (isset($params['proc_nice'])) {\r\n $procNice = $params['proc_nice'];\r\n } else {\r\n $procNice = Mage::getStoreConfig('jirafe_analytics/php/proc_nice');\r\n }\r\n\r\n /**\r\n * Set PHP max_execution_time in seconds\r\n * Excessively large numbers or 0 (infinite) will hurt server performance\r\n */\r\n if (is_numeric($maxExecutionTime)) {\r\n ini_set('max_execution_time', $maxExecutionTime);\r\n $this->log('DEBUG', __METHOD__, 'max_execution_time = ' . $maxExecutionTime);\r\n }\r\n\r\n /**\r\n * Set PHP memory_limit: Number + M (megabyte) or G (gigabyte)\r\n * Excessively large numbers will hurt server performance\r\n * Format: 1024M or 1G\r\n */\r\n if (strlen($memoryLimit) > 1) {\r\n\r\n ini_set(\"memory_limit\", $memoryLimit);\r\n\r\n if (Mage::getStoreConfig('jirafe_analytics/debug/logging')) {\r\n $this->log('DEBUG', __METHOD__, 'memory_limit = ' . $memoryLimit);\r\n }\r\n }\r\n\r\n /**\r\n * Set PHP nice value.\r\n * Lower numbers = lower priority\r\n */\r\n\r\n if (is_numeric($procNice)) {\r\n proc_nice($procNice);\r\n if (Mage::getStoreConfig('jirafe_analytics/debug/logging')) {\r\n $this->log('DEBUG', __METHOD__, 'proc_nice = ' . $procNice);\r\n }\r\n }\r\n }",
"private static function configurePhpSettings(): void\n {\n /**\n * Set utf-8 encoding for PHP\n */\n ini_set('default_charset', 'utf-8');\n mb_internal_encoding('utf-8');\n\n /**\n * Set precision to sane value, with higher values\n * things behave slightly unexpectedly, for example\n * round(1.2, 2) returns 1.199999999999999956.\n */\n ini_set('precision', '14');\n\n /**\n * check timezone setting\n * this could produce an E_WARNING - but only once,\n * if not done here it will produce E_WARNING on every date/time function\n */\n date_default_timezone_set(@date_default_timezone_get());\n }",
"protected function setup_system_data()\n\t{\n\t\t// Query maximum runtime from php.ini\n\t\t$execution_time = $this->php_ini->getNumeric('max_execution_time');\n\t\t$execution_time = min(15, $execution_time / 2);\n\t\t$this->system_data['max_execution_time'] = $execution_time;\n\n\t\t// Set start time\n\t\t$this->system_data['start_time'] = microtime(true);\n\n\t\t// Get memory limit\n\t\t$this->system_data['memory_limit'] = $this->php_ini->getBytes('memory_limit');\n\t}",
"public static function set_init_params() {\n\t\t@ignore_user_abort( true );\n\t\t$timeout = 10 * 60 * 60;\n\t\t@set_time_limit( $timeout );\n\t\t$mem\t = '1024M';\n\t\t@ini_set( 'memory_limit', $mem );\n\t\t@ini_set( 'max_execution_time', 0 );\n\t}",
"protected function _configPhpTimeout() {\n $timeLimit = (int) Config::defaultPhpTimeout();\n\n $this->_configWorkerTimeout();\n\n if (!$timeLimit) {\n $timeLimit = $this->getWorkerTimeout() * 2;\n } else if ($timeLimit < $this->getWorkerTimeout()) {\n $timeLimit += $this->getWorkerTimeout();\n }\n\n $this->setPhpTimeout($timeLimit);\n\n try {\n set_time_limit($timeLimit);\n ini_set(\"set_time_limit\", \"$timeLimit\");\n ini_set(\"max_execution_time\", \"$timeLimit\");\n } catch (Throwable $ex) {\n \n } catch (Exception $ex) {\n \n }\n }",
"function maxout()\n\t{\n\t\tini_set('max_execution_time', '300'); //300 seconds = 5 minutes\n\t\tini_set('memory_limit', '1024'); //1024 MB = 1 GB\n\t\techo \"Temporal Max Execution Time: \" . ini_get('max_execution_time') . \" seconds\";\n\t\techo \"<br>\";\n\t\techo \"Temporal Max Memory Limit: \" . ini_get('memory_limit') . \" MB\";\n\n\t}",
"public function set_max_execution_time($time_in_seconds=3600){\n\t\tini_set('max_execution_time',$time_in_seconds);\n\t}",
"private function setupPHPSettings() {\n\t\t\t// Default timezone of server\n\t\t\t//date_default_timezone_set('UTC');\n\n\t\t\t// iconv encoding\n\t\t\t// iconv_set_encoding(\"internal_encoding\", \"UTF-8\");\n\n\t\t\t// multibyte encoding\n\t\t\tif(function_exists('mb_internal_encoding')) {\n\t\t\t\tmb_internal_encoding('UTF-8');\n\t\t\t}\n\t\t}",
"private function setExecutionTime(): void\n {\n $this->executionTime = round(microtime(true) - $this->timeStart);\n }",
"public function getSystemLimits() {\n\t\t/* Set the start time of the script */\n\t\t$this->_starttime = time();\n\t\t\n\t\t/* Get the logger */\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t$template = JRequest::getVar('template');\n\t\t\n\t\t/* Set the user generated limits */\n\t\t$csvilog->AddMessage('debug', '<hr />');\n\t\t\n\t\t/* See if we need to use th new limits */\n\t\tif ($template->use_system_limits) {\n\t\t\t$csvilog->AddMessage('debug', 'Setting system limits:');\n\t\t\t/* Apply the new memory limits */\n\t\t\t$csvilog->AddMessage('debug', 'Setting max_execution_time to '.$template->max_execution_time.' seconds');\n\t\t\t@ini_set('max_execution_time', $template->max_execution_time);\n\t\t\t$csvilog->AddMessage('debug', 'Setting max_input_time to '.$template->max_input_time.' seconds');\n\t\t\t@ini_set('max_input_time', $template->max_input_time);\n\t\t\t$csvilog->AddMessage('debug', 'Setting memory_limit to '.$template->memory_limit.'M');\n\t\t\t@ini_set('memory_limit', $template->memory_limit.'M');\n\t\t\t$csvilog->AddMessage('debug', 'Setting post_max_size to '.$template->post_max_size.'M');\n\t\t\t@ini_set('post_max_size', $template->post_max_size.'M');\n\t\t\t$csvilog->AddMessage('debug', 'Setting upload_max_filesize to '.$template->upload_max_filesize.'M');\n\t\t\t@ini_set('upload_max_filesize', $template->upload_max_filesize.'M');\n\t\t}\n\t}",
"public function getExecutionTimeLimit()\n {\n return (int) ini_get('max_execution_time');\n }",
"function drupal_set_time_limit($time_limit) {\n if (function_exists('set_time_limit')) {\n $current = ini_get('max_execution_time');\n // Do not set time limit if it is currently unlimited.\n if ($current != 0) {\n @set_time_limit($time_limit);\n }\n }\n}",
"protected function setPhpTimeout(): void {\n\t\t$timeLimit = (int)Configure::readOrFail('Queue.workermaxruntime') * 100;\n\t\tif (Configure::read('Queue.workertimeout') !== null) {\n\t\t\t$timeLimit = (int)Configure::read('Queue.workertimeout');\n\t\t}\n\n\t\tset_time_limit($timeLimit);\n\t}",
"protected function _initPhpSettings ()\n {\n $options = $this->getOptions();\n date_default_timezone_set($options ['phpSettings'] ['timezone']);\n\n // Turn on the display of errors\n if (APPLICATION_ENV != 'production')\n {\n @ini_set('display_errors', 1);\n }\n }",
"protected function _applyPhpVariables()\n {\n $htaccess = $this->_getRootPath() . '.htaccess';\n if (file_exists($htaccess)) {\n // parse htaccess file\n $data = file_get_contents($htaccess);\n $matches = array();\n preg_match_all('#^\\s+?php_value\\s+([a-z_]+)\\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);\n if ($matches) {\n foreach ($matches as $match) {\n @ini_set($match[1], str_replace(\"\\r\", '', $match[2]));\n }\n }\n preg_match_all('#^\\s+?php_flag\\s+([a-z_]+)\\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);\n if ($matches) {\n foreach ($matches as $match) {\n @ini_set($match[1], str_replace(\"\\r\", '', $match[2]));\n }\n }\n }\n }",
"public static function resetTimeLimit() \n {\n static $orig_limit;\n \n self::$_time_limit_start_time = time();\n \n if (!isset($orig_limit)) {\n VWP::noWarn();\n $orig_limit = @ ini_get('max_execution_time');\n VWP::noWarn(false);\n if (empty($orig_limit)) {\n $orig_limit = 45;\n } \n }\n set_time_limit($orig_limit);\n self::$_time_limit = $orig_limit; \n }",
"private static function checkForSlowPHPOptions(): void\n {\n static $did_check = false;\n if ($did_check) {\n // Only perform this check once (e.g. in unit tests\n return;\n }\n $did_check = true;\n if (Config::getValue('skip_slow_php_options_warning')) {\n return;\n }\n $warned = false;\n // Unless debugging Phan itself, these two configurations are unnecessarily adding slowness.\n if (PHP_DEBUG) {\n CLI::printHelpSection(\"WARNING: Phan is around twice as slow when php is compiled with --enable-debug (That option is only needed when debugging Phan itself).\\n\", false, true);\n $warned = true;\n }\n // We warn about Xdebug in src/codebase.php, so skip that check here.\n if ($warned) {\n // @phan-suppress-next-line PhanPluginRemoveDebugCall\n fwrite(STDERR, \"(The above warning(s) about slow PHP settings can be disabled by setting 'skip_slow_php_options_warning' to true in .phan/config.php)\\n\");\n }\n }",
"public static function phpMaxExecutionTime()\n\t{\n\t\treturn intval(ini_get('max_execution_time'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set OtherDiscountAgreementPrev value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setOtherDiscountAgreementPrev($otherDiscountAgreementPrev = null)
{
// validation for constraint: string
if (!is_null($otherDiscountAgreementPrev) && !is_string($otherDiscountAgreementPrev)) {
throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherDiscountAgreementPrev)), __LINE__);
}
if (is_null($otherDiscountAgreementPrev) || (is_array($otherDiscountAgreementPrev) && empty($otherDiscountAgreementPrev))) {
unset($this->OtherDiscountAgreementPrev);
} else {
$this->OtherDiscountAgreementPrev = $otherDiscountAgreementPrev;
}
return $this;
} | [
"public function setOtherDiscountAgreement($otherDiscountAgreement = null)\n {\n // validation for constraint: string\n if (!is_null($otherDiscountAgreement) && !is_string($otherDiscountAgreement)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($otherDiscountAgreement)), __LINE__);\n }\n if (is_null($otherDiscountAgreement) || (is_array($otherDiscountAgreement) && empty($otherDiscountAgreement))) {\n unset($this->OtherDiscountAgreement);\n } else {\n $this->OtherDiscountAgreement = $otherDiscountAgreement;\n }\n return $this;\n }",
"public function setPrev($prev)\n\t{\n\t\t$this->prev = $prev;\n\t}",
"public function setPrev(Library_Node $p=null){\r\n $this->prev = $p;\r\n return $this;\r\n }",
"final public function setPrev(Chainable $chainable) {\n $this->prev = $chainable;\n }",
"public function setPrevSibling(NodeObject $node = null);",
"public function getPreviousAmount()\n {\n return $this->previous_amount;\n }",
"public function setHonoPrev($honoPrev) {\n $this->honoPrev = $honoPrev;\n return $this;\n }",
"public function setPrevious(\\Data\\IDoublyLinkedNode &$previous)\n {\n $this->previous = $previous;\n }",
"public function setDateDebutPrevue(DateTime $dateDebutPrevue = null) {\n $this->dateDebutPrevue = $dateDebutPrevue;\n return $this;\n }",
"public function set_unpaid_previous_bill_amount( $value ) {\n\t\tif ( ! is_numeric( $value ) ) {\n\t\t\tthrow new Exception( esc_html__( 'Invalid unpaid previous bill amount.', 'credits-for-woocommerce' ) ) ;\n\t\t}\n\n\t\t$this->set_prop( 'unpaid_previous_bill_amount', wc_format_decimal( $value ) ) ;\n\t}",
"public function prev(): void\n {\n if ($this->current instanceof TerminalBucket) {\n return;\n }\n\n $this->current = $this->current->prev();\n $this->offset--;\n }",
"public function setValorPrevisto($valor_previsto)\n {\n $this->valor_previsto = $valor_previsto;\n\n return $this;\n }",
"public function unsetRefundedInclusiveTax(): void\n {\n $this->refundedInclusiveTax = [];\n }",
"public function setPrevious($value) {\n try {\n if (!self::_checkTrustline($value)) throw new Exception(\"\");\n $this->_Previous = self::_fromTrustline($value);\n } catch(Exception $e) {\n throw new Exception(\"Cannot convert \" . ((string)$value) . \" to \" . \"RippleRestTrustline\");\n }\n }",
"public function setReqothercomment($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->reqothercomment !== $v) {\n\t\t\t$this->reqothercomment = $v;\n\t\t\t$this->modifiedColumns[] = RpCampPassengersPeer::REQOTHERCOMMENT;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function setPreviousPosition($prev) {\r\n $this->prevpos = $prev;\r\n }",
"public function getValorPrevisto()\n {\n return $this->valor_previsto;\n }",
"public function setPreviousOrderChangeReferencedDocument(?\\horstoeko\\orderx\\entities\\basic\\ram\\ReferencedDocumentType $previousOrderChangeReferencedDocument = null)\n {\n $this->previousOrderChangeReferencedDocument = $previousOrderChangeReferencedDocument;\n return $this;\n }",
"public function getPreviousPrice()\n {\n return $this->previousPrice;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation searchesResetSelectWithHttpInfo This call deletes a possible custom select for the user | public function searchesResetSelectWithHttpInfo()
{
$returnType = '';
$request = $this->searchesResetSelectRequest();
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
}
throw $e;
}
} | [
"public function searchesResetSelect()\n {\n $this->searchesResetSelectWithHttpInfo();\n }",
"public function searchesV2ResetSelect()\n {\n $this->searchesV2ResetSelectWithHttpInfo();\n }",
"public function searchesV3ResetSelectAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->searchesV3ResetSelectRequest();\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 }",
"public function testSearchesV2ResetSelect()\n {\n }",
"protected function searchesV3ResetSelectRequest()\n {\n\n $resourcePath = '/api/v3/searches/Reset';\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 []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function searchesGetSelectWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\SelectDTO';\n $request = $this->searchesGetSelectRequest();\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 ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SelectDTO',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function resetSelectField();",
"public function searchesV2GetSelectWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\SelectDTO';\n $request = $this->searchesV2GetSelectRequest();\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 ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SelectDTO',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function searchesV2PostSelectAsyncWithHttpInfo($select_dto)\n {\n $returnType = '';\n $request = $this->searchesV2PostSelectRequest($select_dto);\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 }",
"public function searchesV2PostSelectWithHttpInfo($select_dto)\n {\n $returnType = '';\n $request = $this->searchesV2PostSelectRequest($select_dto);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function taskWorkGetDefaultSelectAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\SelectDTO';\n $request = $this->taskWorkGetDefaultSelectRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n 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 }",
"public function testSearchesV3GetSelect0()\n {\n }",
"public function testSearchesV2GetSelect0()\n {\n }",
"public function searchesV2PostSelect($select_dto)\n {\n $this->searchesV2PostSelectWithHttpInfo($select_dto);\n }",
"public function iClearSearchTypes()\n {\n $typeSelectElement = $this->createElement('TypeSelectElement');\n self::assertTrue($typeSelectElement->isValid());\n\n $clearIcon = $typeSelectElement->find('css', \".select2-search-choice-close\");\n\n self::assertTrue($clearIcon->isValid(), \"Clear icon is not found in entities select element\");\n\n $clearIcon->click();\n }",
"public function resetOptions();",
"protected function resetSelect()\n {\n $this->select = '';\n $this->where = '';\n $this->join = '';\n $this->groupBy = '';\n $this->orderBy = '';\n $this->orWhere = '';\n $this->andWhere = '';\n $this->limit = '';\n }",
"protected function _unsetselect()\n {\n unset($this->settings['table']);\n unset($this->settings['query']);\n unset($this->settings['option']);\n unset($this->settings['exclude']);\n unset($this->settings['include']);\n unset($this->settings['order']);\n unset($this->settings['selectedKey']);\n unset($this->settings['selectedValue']);\n }",
"public function clearSelectFlags()\n\t{\n\t\t$this->selectFlags = array();\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a media collection for the featured Case Study image | public function registerMediaCollections()
{
$this->addMediaCollection('featured_image')->singleFile();
$this->addMediaCollection('screenshots');
} | [
"public function registerMediaCollections(): void\n {\n $this\n ->addMediaCollection('healthworker_images')\n ->singleFile();\n }",
"public function registerMediaCollections()\n {\n $this->addMediaCollection('image')->singleFile();\n }",
"public function registerMediaCollections()\n {\n $this->addMediaCollection('cover')\n ->singleFile();\n }",
"public function registerMediaCollections(): void\n {\n $this->addMediaCollection('avatar')\n ->singleFile();\n\n $this->addMediaCollection('cover')\n ->singleFile();\n\n $this->addMediaCollection('cover.post')\n ->singleFile();\n }",
"public function registerMediaCollections()\n {\n $this->addMediaCollection('photo')->singleFile();\n }",
"public function registerMediaCollections()\n {\n $this->addMediaCollection('thumbnail')\n ->useFallbackUrl(MediaService::BLANK_IMAGE_PATH)\n ->useFallbackPath(public_path(MediaService::BLANK_IMAGE_PATH))\n ->singleFile();\n }",
"public function registerMediaCollections(): void\n {\n $this->addMediaCollection('my-space-general-terms');\n }",
"public function registerMediaCollections(): void\n {\n $this\n ->addMediaCollection('default');\n $this\n ->addMediaCollection('identityFace')\n ->singleFile();\n $this\n ->addMediaCollection('identityBack')\n ->singleFile();\n $this\n ->addMediaCollection('licenceFace')\n ->singleFile();\n $this\n ->addMediaCollection('licenceBack')\n ->singleFile();\n //->useFallbackUrl('/url/to/default')\n //->singleFile()\n\n }",
"private function addFeaturedMedia() {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'featured_media_url', [\n 'get_callback' => function ($post) {\n if ($post instanceof WP_POST) {\n return get_the_post_thumbnail_url($post->ID);\n } elseif (is_array($post)) {\n return get_the_post_thumbnail_url($post['id']);\n }\n },\n ]);\n }\n }",
"function snax_ajax_get_collection_featured_media() {\n\t// Sanitize input.\n\t$collection_id = filter_input( INPUT_GET, 'snax_collection_id', FILTER_SANITIZE_STRING );\n\n\tif ( empty( $collection_id ) ) {\n\t\tsnax_ajax_response_error( 'Collection id not set!' );\n\t\texit;\n\t}\n\n\t$user_id = get_current_user_id();\n\n\tif ( is_numeric( $collection_id ) ) {\n\t\t$collection = snax_get_collection_by_id( $collection_id );\n\t} else {\n\t\t$collection = snax_get_collection_by_user( $user_id, $collection_id );\n\t}\n\n\tif ( ! $collection ) {\n\t\tsnax_ajax_response_error( sprintf( 'Collection with id %s not found!', $collection_id ) );\n\t\texit;\n\t}\n\n\t// Is user the collection's owner?\n\tif ( $user_id !== $collection->get_owner_id() ) {\n\t\tsnax_ajax_response_error( sprintf( 'User %s is not the collection owner!', $user_id ) );\n\t\texit;\n\t}\n\n\t$html = get_the_post_thumbnail( $collection_id, 'thumbnail' );\n\n\tsnax_ajax_response_success( 'Collection featured media generated.', array(\n\t\t'html' => $html,\n\t) );\n\texit;\n}",
"function addMedia(MediaInterface $media);",
"public function initSeMediaObjects()\n {\n $this->collSeMediaObjects = new PropelObjectCollection();\n $this->collSeMediaObjects->setModel('SeMediaObject');\n }",
"public function hasMedia($collectionMedia = 'default');",
"public function registerMediaConversions(Media $media = null)\n {\n $this->addMediaConversion('thumbnail')\n ->width(368)\n ->height(232)\n ->sharpen(10)\n ->performOnCollections('photos');\n }",
"function features_image() {\n//Add featured image\nregister_rest_field( \n 'post', \n 'my_features', \n array(\n 'get_callback' => 'get_image_src',\n 'update_callback' => null,\n 'schema' => null,\n )\n );\n}",
"public function createMedia();",
"public function addMediaOnchallenge()\n\t{\t\n\t\t$chal_id = $this->f3->get('PARAMS.id');\n\t\t$this->upload('challenges', $chal_id);\n\t\t\n\t}",
"public function addMedia()\n\t{\n\t\tif(Phpfox::getService('medialibrary')->CanUseTheAPI('add', 3))\n\t\t{\n\t\t\t$sType = strtolower($this->get('t'));\n\t\t\tif(in_array($sType, Phpfox::getService('medialibrary')->getAllowedTypes()))\n\t\t\t{\n\t\t\t\t$sId = $this->get('id');\n\t\t\t\t$cId = (int)$this->get('c');\n\t\t\t\t$aOutput = Phpfox::getService('medialibrary')->addData($sId, $sType, $cId);\n\t\t\t\tif(!isset($aOutput['exists']))\n\t\t\t\t{\n\t\t\t\t\t$gameAddJS = '';\n\t\t\t\t\tif($sType == 'game')\n\t\t\t\t\t\t$gameAddJS = 'tb_show(oTranslations[\\'medialibrary.popup_platforms\\'], $.ajaxBox(\\'medialibrary.loadGameSettings\\', \\'id='.$aOutput['media_id'].'\\'));';\n\t\t\t\t\tPhpfox::getLib('template')->assign(array('sType' => $sType, 'bIsCategory' => true, 'aItem' => $aOutput, 'iUserId' => Phpfox::getUserId(), 'aSource' => Phpfox::getService('medialibrary')->getSource($sType)))->getTemplate('medialibrary.block.item-entry-each');\t\n\t\t\t\t\t$this->call('$(\"#like_content\").prepend(\"<li class=\\\"mediathek_item_holder\\\" id=\\\"js_item_id_'.$aOutput['media_id'].'\\\" ref=\\\"'.$aOutput['media_id'].'\\\">' . $this->getContent() . '</li>\").highlightFade();elementsLoaded+=1;waitingOperation(false);resetItemsActions();$(\"#selectMedia\").val(\"\");addCategoryNumber();modifyMediaNumber(\"'.$sType.'\", 1);'.$gameAddJS);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->call('alert(oTranslations[\\'medialibrary.exists\\']);waitingOperation(false);');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->call('setTimeout(function(){$.ajaxCall(\\'medialibrary.addMedia\\', \\'id='.$this->get('id').'&t='.$this->get('t').'\\');},2000);');\n\t\t}\n\t}",
"public function getMedia(): Collection\n {\n return $this->media;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Wincache Adapter for Cache | protected function getWincacheAdapter()
{
} | [
"protected function createWincacheDriver()\n {\n return $this->createCacheBased('wincache');\n }",
"private function getCacheAdapter()\n\t{\n\t\treturn Business_Ws_VideoDetail_Cache_Factory::factory('memcache');\n\t}",
"public function getCacheAdapter()\n {\n return $this->cache_item_pool->getCacheAdapter();\n }",
"public function getCacheAdapter()\n {\n return $this->cacheAdapter;\n }",
"protected function getCacheAdapterBackend() {\n /* @var Config $cacheConfig */\n $cacheConfig = $this->config->cache->backend;\n $frontendAdapter = $this->getCacheAdapterFrontend();\n return $this->backendFactory->getAdapter($cacheConfig->adapter, $frontendAdapter, $cacheConfig->toArray());\n }",
"public function getCacheService(string $name): CacheAdapterInterface;",
"protected function autoConnectToAvailableCacheSystem()\n {\n static $adapterCache;\n\n if (is_object($adapterCache) && $adapterCache instanceof iAdapter) {\n return $adapterCache;\n }\n\n $memcached = null;\n $isMemcachedAvailable = false;\n if (extension_loaded('memcached')) {\n $memcached = new \\Memcached();\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n $isMemcachedAvailable = @$memcached->addServer('127.0.0.1', 11211);\n }\n\n if ($isMemcachedAvailable === false) {\n $memcached = null;\n }\n\n $adapterMemcached = new AdapterMemcached($memcached);\n if ($adapterMemcached->installed() === true) {\n\n // -------------------------------------------------------------\n // \"Memcached\"\n // -------------------------------------------------------------\n $adapter = $adapterMemcached;\n\n } else {\n\n $memcache = null;\n $isMemcacheAvailable = false;\n if (class_exists('\\Memcache')) {\n $memcache = new \\Memcache;\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n $isMemcacheAvailable = @$memcache->connect('127.0.0.1', 11211);\n }\n\n if ($isMemcacheAvailable === false) {\n $memcache = null;\n }\n\n $adapterMemcache = new AdapterMemcache($memcache);\n if ($adapterMemcache->installed() === true) {\n\n // -------------------------------------------------------------\n // \"Memcache\"\n // -------------------------------------------------------------\n $adapter = $adapterMemcache;\n\n } else {\n\n $redis = null;\n $isRedisAvailable = false;\n if (\n extension_loaded('redis')\n &&\n class_exists('\\Predis\\Client')\n ) {\n /** @noinspection PhpUndefinedNamespaceInspection */\n /** @noinspection PhpUndefinedClassInspection */\n $redis = new \\Predis\\Client(\n array(\n 'scheme' => 'tcp',\n 'host' => '127.0.0.1',\n 'port' => 6379,\n 'timeout' => '2.0',\n )\n );\n try {\n $redis->connect();\n $isRedisAvailable = $redis->getConnection()->isConnected();\n } catch (\\Exception $e) {\n // nothing\n }\n }\n\n if ($isRedisAvailable === false) {\n $redis = null;\n }\n\n $adapterRedis = new AdapterPredis($redis);\n if ($adapterRedis->installed() === true) {\n\n // -------------------------------------------------------------\n // Redis\n // -------------------------------------------------------------\n $adapter = $adapterRedis;\n\n } else {\n\n $adapterXcache = new AdapterXcache();\n if ($adapterXcache->installed() === true) {\n\n // -------------------------------------------------------------\n // \"Xcache\"\n // -------------------------------------------------------------\n $adapter = $adapterXcache;\n\n } else {\n\n $adapterApc = new AdapterApc();\n if ($adapterApc->installed() === true) {\n\n // -------------------------------------------------------------\n // \"APC\"\n // -------------------------------------------------------------\n $adapter = $adapterApc;\n\n } else {\n\n $adapterApcu = new AdapterApcu();\n if ($adapterApcu->installed() === true) {\n\n // -------------------------------------------------------------\n // \"APCu\"\n // -------------------------------------------------------------\n $adapter = $adapterApcu;\n\n } else {\n\n $adapterFile = new AdapterFile();\n if ($adapterFile->installed() === true) {\n\n // -------------------------------------------------------------\n // File-Cache\n // -------------------------------------------------------------\n $adapter = $adapterFile;\n\n } else {\n\n // -------------------------------------------------------------\n // Static-PHP-Cache\n // -------------------------------------------------------------\n $adapter = new AdapterArray();\n }\n }\n }\n }\n }\n }\n }\n\n // save to static cache\n $adapterCache = $adapter;\n\n return $adapter;\n }",
"public static function getCache() : CacheDriver\n {\n return static::$cacheDriver;\n }",
"protected function getCacheDriver() {\n //Driver\n $cacheDriver = array_get(static::$config, 'driver');\n\n //Available drivers\n $availableDrivers = array(\n 'file' => function () {\n return new FilesystemCache(array_get(static::$config, 'dir', 'cache'));\n }\n );\n\n if (extension_loaded('apc')) {\n $availableDrivers['apc'] = function () {\n return new ApcCache();\n };\n }\n\n if (extension_loaded('wincache')) {\n $availableDrivers['wincache'] = function () {\n return new WincacheCache();\n };\n }\n\n if (extension_loaded('xcache')) {\n $availableDrivers['xcache'] = function () {\n return new XcacheCache();\n };\n }\n\n if (class_exists('Memcache')) {\n $availableDrivers['memcache'] = function () {\n $memcache = new \\Memcache();\n $memcache->connect(\n array_get(static::$config, 'memcache.server', 'localhost'),\n array_get(static::$config, 'memcache.port', 11211)\n );\n\n $driver = new MemcacheCache();\n $driver->setMemcache($memcache);\n\n return $driver;\n };\n }\n\n if (class_exists('Memcached')) {\n $availableDrivers['memcached'] = function () {\n $memcached = new \\Memcached();\n $memcached->addServer(\n array_get(static::$config, 'memcached.server', 'localhost'),\n array_get(static::$config, 'memcached.port', 11211)\n );\n\n $driver = new MemcachedCache();\n $driver->setMemcached($memcached);\n\n return $driver;\n };\n }\n\n if (class_exists('Mongo')) {\n $availableDrivers['mongodb'] = function () {\n $mongo = new \\MongoClient(\n array_get(static::$config, 'mongodb.server', 'mongodb://localhost:27017'),\n array_get(static::$config, 'mongodb.options', array()),\n array_get(static::$config, 'mongodb.driver_options', array())\n );\n $mongo->selectDB(array_get(static::$config, 'mongodb.database', 'webim'));\n\n\n $driver = new MongoDBCache();\n $driver->setMongoCache(new \\MongoCollection(new \\MongoDB($mongo, 'webim'), 'webim'));\n\n return $driver;\n };\n }\n\n $driverName = 'file';\n\n if (!$cacheDriver || ($cacheDriver == 'auto')) {\n $driverName = array_first(array_keys($availableDrivers));\n } elseif (isset($availableDrivers[$cacheDriver])) {\n $driverName = $cacheDriver;\n }\n\n return $availableDrivers[$driverName]();\n }",
"protected function getCacheDriver()\n {\n return app('cache')->driver($this->cacheDriver);\n }",
"public function getCacheDriver()\n {\n return app('cache')->driver($this->cacheDriver);\n }",
"public function select()\n {\n if (extension_loaded('apc') && ini_get(\"apc.enabled\") && @apc_cache_info()) {\n return new APCCache;\n }\n\n return new MemoryCache;\n }",
"public function _cache() {\n list($type, $host, $port, $compress) = @explode(':', SQ_TEMPLATE_CACHE_TYPE) + array(null, null, null, null);\n $cache = new DALMP_Cache($type);\n return $cache->host($host)->port($port)->compress($compress);\n }",
"public function getCacheDriver()\n {\n return $this->_cacheDriver;\n }",
"protected function getCacheAdapterFrontend() {\n /* @var Config $cacheConfig */\n $cacheConfig = $this->config->cache->frontend;\n return $this->frontendFactory->getAdapter($cacheConfig->adapter, $cacheConfig->toArray());\n }",
"protected function getXCacheAdapter()\n {\n }",
"public function getCacheDriver()\n {\n return $this->cacheDriver;\n }",
"private function getSelectedAdapter()\n {\n return config()->app->cache_adapter;\n }",
"protected function _getCache()\n {\n if (!$this->_cache instanceof \\Yana\\Data\\Adapters\\IsDataAdapter) {\n $this->_cache = new \\Yana\\Data\\Adapters\\SessionAdapter(__CLASS__);\n }\n return $this->_cache;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the from address to use for the default identity. | function getDefaultFromAddress($fullname = false)
{
$from_addr = '';
if ($fullname) {
$name = $this->getValue('fullname');
if (!empty($name)) {
$from_addr = $name . ' ';
}
}
$addr = $this->getValue('from_addr');
if (empty($addr)) {
$addr = $this->_user;
if (empty($from_addr)) {
return $addr;
}
}
return $from_addr . '<' . $addr . '>';
} | [
"public function getDefaultAddress(): string|null;",
"public abstract function getDefaultIdentity();",
"abstract function createNewAddress();",
"public function getDefaultBillingAddress();",
"public function getDefaultAddress()\n {\n return $this->defaultAddress;\n }",
"public function createAddress()\n {\n }",
"public function getDefaultInvoiceAddress(): string|null;",
"public function getDefaultInvoiceAddress() : ?string;",
"public function getAddressDefault() {\n return (new ShopUserAddress)->where('user_id', $this->id)\n ->where('id', $this->address_id)\n ->first();\n }",
"public function getDefaultBillingAddress($customerId);",
"function build_from_header($identity = 0) {\n\n global $domain;\n\n $idents = get_identities();\n\n if (! isset($idents[$identity]) ) $identity = 0;\n\n if ( !empty($idents[$identity]['full_name']) ) {\n $from_name = $idents[$identity]['full_name'];\n }\n\n $from_mail = $idents[$identity]['email_address'];\n if (strpos($from_mail, '@') === FALSE)\n $from_mail .= '@' . $domain;\n \n if ( isset($from_name) ) {\n $from_name_encoded = encodeHeader('\"' . $from_name . '\"');\n if ($from_name_encoded != $from_name) {\n return $from_name_encoded . ' <' . $from_mail . '>';\n }\n return '\"' . $from_name . '\" <' . $from_mail . '>';\n }\n return $from_mail;\n}",
"function createPartnerAddress();",
"protected function createEmptyAddress()\n {\n return $this->createAddress([]);\n }",
"public function getFromAddress()\n {\n return $this->from_address;\n }",
"function gen_eth_addr($serno) {\n\n\t\t$ethaddr_hgh = (mt_rand(0, 65535) & 0xfeff) | 0x0200;\n\t\t$ethaddr_mid = mt_rand(0, 65535);\n\t\t$ethaddr_low = mt_rand(0, 65535);\n\n\t\treturn sprintf(\"%02lx:%02lx:%02lx:%02lx:%02lx:%02lx\",\n\t\t\t$ethaddr_hgh >> 8, $ethaddr_hgh & 0xff,\n\t\t\t$ethaddr_mid >> 8, $ethaddr_mid & 0xff,\n\t\t\t$ethaddr_low >> 8, $ethaddr_low & 0xff);\n\t}",
"private function ___intAddrFrom() {\n\n return $this->___IPv4_dotquadA_to_intA($this->_network);\n }",
"public function getFromAddress()\n {\n return $this->fromAddress;\n }",
"public function getDefaultAddressId()\n {\n // Ensure we have the `default_address_id` set from API\n // We will use that if there is no locally chosen Setting for it\n if (empty($this->auth_data)) {\n $this->authenticate();\n }\n\n $cacheKey = 'default_address_id.'.$this->client_id;\n\n return (int) $this->getCache($cacheKey) ?: $this->auth_data['default_address_id'];\n }",
"public function getDefaultAddress()\n {\n if ($this->cached_address) {\n return $this->cached_address;\n } else {\n $address = $this\n ->owner\n ->Addresses()\n ->sort(\"Default\", \"DESC\")\n ->first();\n \n $this->cached_address = $address;\n \n return $address;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
relacio 1 a 1 una cita solo tendra un detalle de cancelacion cuando es una relacion 1 a 1 de un lado es hasOne y del otro belongsTo | public function cancellation(){
return $this->hasOne(CancelledAppointment::class);
} | [
"public function cancelledpayment(): HasOne\n {\n return $this->hasOne(CancelledPayment::class);\n }",
"public function cancelation()\n {\n return $this->hasOne(OrderCancelation::class);\n }",
"public function cancelled_by() //Busca automaticamente cancelled_by\n {\n return $this->belongsTo(User::class);\n }",
"public function cancelled_by() //cancelled_by_id\n {\n \treturn $this->belongsTo(User::class);\n }",
"public function conferenceCancellationReason()\n {\n return $this->belongsTo(ConferenceCancelreason::class, 'cancellation_reason_id');\n }",
"public function cancels()\n {\n return $this->hasMany(TravelCancel::class, 'flight_number', 'flight_number');\n }",
"function contrato()\n\t{\n\t\treturn $this->belongsTo(\n\t\t\tContrato::class,\n\t\t\t'Contrato_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getIdCarrera0()\n {\n return $this->hasOne(Carrera::className(), ['idCarrera' => 'idCarrera']);\n }",
"public function pAmbientalCorreo()\n {\n return $this->hasOne('App\\Models\\PAmbientalCorreo','bnd_responsable','id');\n }",
"public static function hasOne($related, $foreignKey = null){}",
"function cancelSelfDelete(){\n $this->self_delete_initiated_at=null;\n if($this->save()){\n return true;\n }else{\n return false;\n }\n }",
"public function userDestinatario()\n {\n return $this->belongsTo(User::class, 'user_id_transaction');//relacionamento da ordem 1\n }",
"public function parent() {\n return $this->hasOne('App\\service_catalog', 'id', 'parentID');\n }",
"public function getTipoConvocatoria()\n {\n return $this->hasOne(TipoConvocatoria::className(), ['id_conv' => 'tipo_convocatoria']);\n }",
"public function cancelFromUser() {\n if($this->num == 1) {\n $this->delete();\n } else {\n $this->num--;\n if(!$this->save()) {\n // @TODO Something exceptional..\n }\n\n // This part can be in another model, but... This is \"transaction\"\n $prize = Prize::findOne($this->prize_id);\n if($prize) {\n $prize->count++;\n $prize->save();\n }\n }\n }",
"public function getNoAgenda()\n {\n return $this->hasOne(SuratMasuk::className(), ['no_agenda' => 'no_agenda']);\n }",
"public function finContasBancaria()\n {\n return $this->belongsTo('Serbinario\\Entities\\FinContasBancaria','conta_bancaria_id','id');\n }",
"public function sProcedimiento()\n {\n return $this->hasOne('App\\Models\\SProcedimiento','cia_id','id');\n }",
"public function getFkPessoalDependenteExcluido()\n {\n return $this->fkPessoalDependenteExcluido;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert every element in the set of matched elements to the end of the target. | public function appendTo($target)
{
foreach ($target->nodes as $t) {
foreach ($this->nodes as $node) {
$t->appendChild($node);
}
}
return $this;
} | [
"public function insertBefore($target);",
"public function insertAfter($selector) {\r\n $result = $this->spawn();\r\n $targetNodes = $this->_getTargetNodes($selector);\r\n if (!empty($targetNodes)) {\r\n $result->push(\r\n $this->_applyContentToNodes(\r\n $targetNodes,\r\n $this->_array,\r\n array($this->_getHandler(), 'insertNodesAfter')\r\n )\r\n );\r\n $this->_removeNodes($this->_array);\r\n }\r\n return $result;\r\n }",
"public function prependTo($target);",
"function simplexml_insert_after(SimpleXMLElement $insert, SimpleXMLElement $target)\n{\n $target_dom = dom_import_simplexml($target);\n $insert_dom = $target_dom->ownerDocument->importNode(dom_import_simplexml($insert), true);\n if ($target_dom->nextSibling) {\n return $target_dom->parentNode->insertBefore($insert_dom, $target_dom->nextSibling);\n } else {\n return $target_dom->parentNode->appendChild($insert_dom);\n }\n}",
"public function insert_as_next_sibling($target)\n\t{\t\n\t\treturn $this->insert($target, $this->right_column, 1, 0);\n\t}",
"public function insert_as_next_sibling($target)\n\t{\n\t\treturn $this->insert($target, $this->right_column, 1, 0);\n\t}",
"public function merge()\n {\n $args = func_get_args();\n foreach ($args as &$array) {\n foreach ($array as $i => &$v) {\n if (ctype_digit((string)$i)) {\n $this[] = $v;\n } else {\n $this->offsetSet($i, $v);\n }\n }\n }\n }",
"public function insert_range( $index, array $elements );",
"public function insert_as_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->right_column, 1, 0);\n }",
"public function addAll($elements);",
"public function insertAfter($element, $new);",
"abstract public function append(iterable $that): self;",
"public function from(array $target, $append = true);",
"public function prependTargetCollection(Blackbox_ITarget $target)\n\t{\n\t\treturn $this->target_collection->prependTarget($target);\n\t}",
"public function insert_as_last_child($target)\n {\n return $this->insert($target, 'right', 0, 1);\n }",
"public function insert_as_last_child($target)\n {\n $target = $this->parent_from($target, $this->primary_column);\n return $this->insert($target, $this->right_column, 0, 1);\n }",
"function array_insert_after( array $array, $key, array $new ) {\n\t$keys = array_keys( $array );\n\t$index = array_search( $key, $keys );\n\t$pos = false === $index ? count( $array ) : $index + 1;\n\treturn array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) );\n}",
"function addAllAt( $index, Collection $elements );",
"function ig_es_array_insert_after( $array, $key, $new ) {\n\t\t$keys = array_keys( $array );\n\t\t$index = array_search( $key, $keys );\n\t\t$pos = false === $index ? count( $array ) : $index + 1;\n\n\t\treturn array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does this voter support the given attribute? | public function supportsAttribute($attribute); | [
"function supportsAttribute($attribute);",
"protected function supports($attribute, $subject)\r\n {\r\n if ($attribute != 'TEAM_PILOT') {\r\n return false;\r\n }\r\n\r\n // if true call voteOnAttribute\r\n return true;\r\n }",
"abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool;",
"protected function supports($attribute, $subject)\n {\n if (!\\in_array($attribute, [self::VIEW], true)) {\n return false;\n }\n\n // The voter is used only for Strain object, else return false\n if (!$subject instanceof Strain) {\n return false;\n }\n\n // Else the voter support the vote\n return true;\n }",
"public function supportsAttribute($attribute)\n {\n // TODO: Implement supportsAttribute() method.\n }",
"abstract protected function voteOnAttribute($attribute, $object, TokenInterface $token);",
"protected function voteOnAttribute($attribute, $subject, TokenInterface $token)\n {\n $user = $token->getUser();\n\n if (!$user instanceof User) {\n // the user must be logged in; if not, deny access\n return false;\n }\n switch ($attribute) {\n case self::CAN_SEE_INVOICE:\n return $this->canSeeInvoice($subject, $user);\n case self::CAN_DOWNLOAD_BILL:\n return $this->canDownloadBill($subject, $user);\n case self::CAN_DOWNLOAD_SEPA:\n return $this->canDownloadSepa($subject, $user);\n }\n return false;\n }",
"private function has_attribute($attribute){\n //this fetchs all the variables(attributes)of the object [private or public]\n $object_vars= $this->attributes();\n //checks if the attribute is part of the object_vars\n return array_key_exists($attribute, $object_vars);\n }",
"public function attributeProperty(string $attribute): bool;",
"public function has_attribute($attr){\n $item = $this->get_info('robot_item');\n $skill = $this->get_info('robot_skill');\n if ($attr === 'quick-charge'){\n if ($item === 'charge-module'){ return true; }\n elseif ($skill === 'charge-submodule'){ return true; }\n elseif ($this->has_flag('has_quick-charge')){ return $this->get_flag('has_quick-charge'); }\n elseif ($this->has_counter('has_quick-charge')){ return $this->get_counter('has_quick-charge') ? true : false; }\n } elseif ($attr === 'extended-range'){\n if ($item === 'target-module'){ return true; }\n elseif ($skill === 'target-submodule'){ return true; }\n elseif ($this->has_flag('has_extended-range')){ return $this->get_flag('has_extended-range'); }\n elseif ($this->has_counter('has_extended-range')){ return $this->get_counter('has_extended-range') ? true : false; }\n }\n return false;\n }",
"private function has_attribute($attribute){\n $object_vars=$this->attributes();\n return array_key_exists($attribute,$object_vars);\n }",
"public function hasParameter(string $attribute): bool;",
"public function attributeExists($attribute);",
"public function isProperty($attribute);",
"abstract protected function doAttributeVote(TokenInterface $token, $object, $attribute);",
"abstract protected function isSafe(Attribute $attribute);",
"public function hasAttributes();",
"public function hasAttributes () {}",
"public function isRegistrantAttribute($attribute);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Behave like valueForKey but throw an exception on an invalid key. | public function valueForKeyWithException($key) {
if ($this->hasValueForKey($key)) {
return $this->store[$key];
}
throw new ELSWAK_Array_InvalidKey_Exception;
} | [
"function valueForUndefinedKey($key) {\n throw( new WFUndefinedKeyException(\"Unknown key '$key' requested for object '\" . get_class($this) . \"'.\") );\n }",
"function valueForUndefinedKey($key)\n {\n throw( new WFUndefinedKeyException(\"Unknown key '$key' (\" . gettype($key) . \") requested for object '\" . get_class($this) . \"'.\") );\n }",
"public function testGetValueWithInvalidCondition()\n {\n $expected = null;\n $result = $this->db->getValue('settings', 'value', ['key' => 'invalid']);\n $this->assertSame($expected, $result);\n }",
"public function getValue(string $key);",
"public function getValue( $key );",
"public function testArrayInvalidKeyException()\n\t{\n\t\t$object = new TestObject();\n\n\t\tVarAtPath::get($object, 'getPrivateProperty.invalidKey');\n\t}",
"abstract protected function _fetchRawValue($key);",
"function getValue($key);",
"public function test_getParameter_throwsOutOfBoundsException_ifKeyDoesNotExist()\n\t{\n\t\t$this->setExpectedException('OutOfBoundsException');\n\t\t\n\t\t$query = new Query();\n\t\t$query->getParameter('foo');\n\t\t\n\t\treturn;\n\t}",
"public function invalidException($value, string $key=null);",
"public function fetchValue($key);",
"public static function getValue(string $key);",
"static function valueForUndefinedStaticKey($key) {\n throw( new WFUndefinedKeyException(\"Unknown key '$key' requested for object '\" . __CLASS__ . \"'.\") );\n }",
"public function testMagicCallMethodThrowsExceptionWhenAccessingGetByKeyMethod() {\n\n\t\t$value = new ObjectValue(new stdClass(), $this->valueContext, $this->config);\n\t\t/** @noinspection PhpUndefinedMethodInspection */\n\t\t$value->getByKey();\n\t}",
"public function testKeyNotFound()\n {\n $context = Context::createEmpty();\n $this->assertNull($context->getValue(self::class, 'key'));\n $context->withValue(self::class, 'anotherkey', 'value');\n $this->assertNull($context->getValue(self::class, 'key'));\n }",
"static function valueForUndefinedStaticKey($key);",
"public function checkKey($key) {}",
"public function removeValueForKeyWithException($key) {\n\t\tif ($this->hasValueForKey($key)) {\n\t\t\t$value = $this->store[$key];\n\t\t\tunset($this->store[$key]);\n\t\t\treturn $value;\n\t\t}\n\t\tthrow new ELSWAK_Array_InvalidKey_Exception('Unable to remove value. Invalid key provided.');\n\t}",
"public function testKeyInvalid() {\n $valid = EnumValueObjectExample::isValid('InvalidValue');\n self::assertFalse($valid);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies the load of a page by checking the HTTP code and possible CakePHP warnings. | function verify_page_load() {
$this->assertResponse(200);
$this->assertMime(array('text/plain', 'text/html'));
$this->assertNoPattern("/Missing Controller/");
} | [
"protected function verifyPage()\n {\n }",
"public function checkSuccessfulPageOpening() :void\n {\n $response = $this->get(route('news'));\n $response->assertStatus(200);\n $response->assertViewIs('web.news.index');\n }",
"public function testPageLoad()\n {\n // MainPage\n $response = $this->get('/');\n $response->assertStatus(200);\n\n // Contact\n $response = $this->get('/contact');\n $response->assertStatus(200);\n\n // login\n $response = $this->get('/login');\n $response->assertStatus(200);\n\n // About\n $response = $this->get('/about');\n $response->assertStatus(200);\n\n //checks to make sure you can't access profile pages\n //without logging in. Check status 302 (redirect) and\n $response = $this->get('/profile');\n $response->assertRedirect('/login');\n\n }",
"protected function handleHttpRequest() \n {\n $pagevar = $this->getPage();\n $page = $this->pageController($this->helper->specChars($pagevar));\n if ($page)\n {\n $page->show();\n }\n else\n {\n echo \"Gnomes have stolen the webpage, we apologize for their natural behaviour\";\n }\n }",
"public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}",
"public static function check_page(){NJIMEDIA_WP_Utils::page_check();}",
"public function testPageLoad()\n\t{\n\t\t$this->client->request('GET', '/');\n\n\t\t// Check of we hier zijn aangekomen\n\t\t$this->assertTrue(true);\n\t}",
"function assertServerErrors() {\n // TODO: Add more server checks!\n $source = strtolower($this->selenium->getHtmlSource());\n $err = strpos($source, 'page not found');\n $this->selenium->assertTrue($err === false, 'There was an 404 here:' . $this->selenium->getLocation());\n }",
"public function page_check_version()\n\t{\n\t\tif (!$content = Http::get_file_on_server(FSB_REQUEST_SERVER, FSB_REQUEST_VERSION, 10))\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\t$content = explode(\"\\n\", $content);\n\n\t\tif (count($content) < 3)\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\tif (strpos('http', $content[2]) === false)\n\t\t{\n\t\t\tarray_shift($content);\n\t\t}\n\n\t\t@list($last_version, $url, $level) = $content;\n\t\t$last_version = trim($last_version);\n\n\t\t// Aucune redirection\n\t\tFsb::$session->data['u_activate_redirection'] = 2;\n\n\t\tif (!is_last_version(Fsb::$cfg->get('fsb_version'), $last_version))\n\t\t{\n\t\t\tDisplay::message(sprintf(Fsb::$session->lang('adm_old_version'), $last_version, Fsb::$cfg->get('fsb_version'), $url, $url, Fsb::$session->lang('adm_version_' . trim($level))) . '<br /><br />' . sprintf(Fsb::$session->lang('adm_click_view_newer'), $url));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::message('adm_version_ok', 'index.' . PHPEXT, 'index_adm');\n\t\t}\n\t}",
"public function verifyPage() {\n return $this->getDriver()->getCurrentUrl()\n ===\n $this->getParameter('base_url') . $this->path;\n }",
"public function testViewWarnings() {\n $response = $this->call('GET', '/viewwarnings');\n\n $this->assertEquals(200, $response->status());\n }",
"function validate_page()\n {\n }",
"function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t$this->load->view('page/verify_document', $data);\n\t}",
"private static function checkRequest() {\n\t\t// Copyright (c) Drupal\n\t\tif (!isset($_SERVER['HTTP_REFERER'])) {\n \t\t$_SERVER['HTTP_REFERER'] = '';\n \t\t}\n \t\tif (!isset($_SERVER['SERVER_PROTOCOL']) || ($_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.0' && $_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.1')) {\n \t\t$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';\n \t\t}\n \t\tif (isset($_SERVER['HTTP_HOST'])) {\n \t\t// As HTTP_HOST is user input, ensure it only contains characters allowed\n \t\t// in hostnames. See RFC 952 (and RFC 2181).\n \t\t// $_SERVER['HTTP_HOST'] is lowercased here per specifications.\n \t\t\t$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);\n \t\tif (!preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $_SERVER['HTTP_HOST'])) {\n \t\t\t// HTTP_HOST is invalid, e.g. if containing slashes it may be an attack.\n \t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');\n \t \t\texit;\n \t\t}\n \t\t} else {\n\t\t\t// Some pre-HTTP/1.1 clients will not send a Host header. Ensure the key is\n \t\t\t// defined for E_ALL compliance.\n \t\t$_SERVER['HTTP_HOST'] = '';\n \t\t}\n \t\t\n\t}",
"public function testThatAOnlineHostWithBadUrlReturnsNotA200()\n {\n $url = 'http://www.google.com/ughhhh.htm';\n $status = $this->checker->check($url);\n\n $this->assertTrue($status->isRespondingButNotOk());\n $this->assertNotEquals($status->getStatusCode(), 200);\n }",
"function testWebpageExists() {\n\t\t$this->get('http://www.ug.it.usyd.edu.au/~dbro8182/lnm/');\n $this->assertTitle('Administration :: Local Network Monitor');\n\t\t$this->setField('username', 'admin');\n\t\t$this->setField('passwd', 'admin');\n\t\t$this->click('Submit');\n\t\t$this->click('Conflicts');\n\t\t$this->assertText('Below displays all conflicting devices that are connected to the network. Conflicting Devices share IP addresses.');\n }",
"function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}",
"public function testBlogPageResponseCode()\n {\n $response = $this->call('GET', '/');\n $this->assertEquals(200, $response->status());\n }",
"private function warning_page() {\n\t\tif ( $this->result->getImpact() < $this->warning_threshold ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// End user's session if they are in the wp admin\n\t\tif ( is_admin() AND $this->warning_wp_admin == true ) {\n\t\t\twp_logout();\n\t\t\twp_safe_redirect( '/wp-login.php?loggedout=true' );\n\t\t\texit;\n\t\t}\n\n\t\t// Load custom error page\n\t\tadd_action( 'template_redirect', array( $this, 'load_template' ) );\n\n\t\t// Catch wp-login.php requests\n\t\tadd_action( 'mscr_wp_login', array( $this, 'load_template' ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if tranaction is a buy. | public function getIsBuyAttribute(): bool
{
return $this->type == self::TYPE_BUY;
} | [
"public function canBuy(){\r\n $cur_time = self::currentServerTime();\r\n if(\r\n ($this->status == 20 || $this->status == 30)\r\n && ($this->start_time < $cur_time)\r\n && ($this->end_time > $cur_time)\r\n && ($this->current_sold < $this->max_sold)\r\n && ($this->is_delete = 0)\r\n && ($this->stop = 0)\r\n && ($this->published == 20)\r\n ){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function isIsBuyable()\n {\n return !is_null($this->_fields['IsBuyable']['FieldValue']) && $this->_fields['IsBuyable']['FieldValue'];\n }",
"public function isBuyOut()\n {\n if ($this->getData('listing_type') == 'product') {\n return true;\n }\n else {\n $buyoutPrice = $this->getData('buyout_price');\n\n if ($buyoutPrice > 0) {\n $settings = $this->getSettings();\n\n if ($settings['enable_buyout']) {\n $maximumBid = $this->currentBid();\n\n if ($settings['always_show_buyout'] && $maximumBid < $buyoutPrice) {\n return true;\n }\n else if (!$this->countDependentRowset('\\Ppb\\Db\\Table\\Bids') || $maximumBid < $this->getData('reserve_price')) {\n return true;\n }\n }\n }\n }\n\n return false;\n }",
"private function itemContainsABuyable(array $item)\n {\n return isset($item['product']) && $item['product'] instanceof Buyable;\n }",
"public function canBeTraded()\n\t{\n\t\t$walletAccount = $this->walletAccount;\n\t\t$available = $walletAccount->getAvailableObject()->getPrice($this->currency);\n\t\t$minAmount = $this->min_amount;\n\t\t$maxAmount = $this->max_amount;\n\n\t\tswitch ($this->type) {\n\t\t\tcase \"sell\":\n\t\t\t\tif ($maxAmount) {\n\t\t\t\t\treturn ($maxAmount + $this->calcPercentageFee($maxAmount)) <= $available;\n\t\t\t\t} else {\n\t\t\t\t\treturn ($available - $this->calcPercentageFee($available) > $minAmount);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"buy\":\n\t\t\t\treturn !!$maxAmount;\n\t\t}\n\t}",
"public function isUnderTransaction();",
"public function isPurchase()\n {\n return $this->purchase;\n }",
"public function isUnderTransaction(){ }",
"public function isTradeable() {\n return $this->tradeable;\n }",
"public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}",
"public function is_sell_order ()\n\t{\n\t\treturn $this->data['type'] === self::SELL_ORDER;\n\t}",
"public function isPayment();",
"public function supportsCompletePurchase(): bool\n {\n }",
"public function isPurchaseNeeded()\n {\n return $this->purchaseNeeded;\n }",
"public function buy()\n {\n return $this->buy;\n }",
"public function shouldNotPurchase()\n {\n return ! $this->shouldPurchase();\n }",
"public function getIsBuyable()\n {\n return $this->_fields['IsBuyable']['FieldValue'];\n }",
"abstract public function isPayableViaCredits();",
"function is_purchased($song){\n if (in_array($song, $this->purchased_songs)){\n return True;\n }\n return False;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the microphoneConfiguration property value. The microphone configuration. Applicable only for Teams Roomsenabled devices. | public function setMicrophoneConfiguration(?TeamworkMicrophoneConfiguration $value): void {
$this->getBackingStore()->set('microphoneConfiguration', $value);
} | [
"public function setMicrophonesAndSpeakers($val)\n {\n $this->_propDict[\"microphonesAndSpeakers\"] = $val;\n return $this;\n }",
"public function setMicrotime($microtime) {\n $this->microtime = $microtime;\n }",
"public function setMicrophone($on) {\n return $this->client->request(\"mic&on=\" . ($on ? \"1\" : \"0\")) == \"OK\";\n }",
"public function setMobileMedia()\n {\n }",
"public function SetCustomConfiguration($customConfiguration);",
"public function setMicrophoneForceMute(?bool $value): void {\n $this->getBackingStore()->set('microphoneForceMute', $value);\n }",
"public function set_mobile_phone($mobile_phone) {\r\n $this->mobile_phone = $mobile_phone;\r\n }",
"public function setMicrophoneForceMute($val)\n {\n $this->_propDict[\"microphoneForceMute\"] = boolval($val);\n return $this;\n }",
"public function setMediaConfig($val)\n {\n $this->_propDict[\"mediaConfig\"] = $val;\n return $this;\n }",
"public function setMicroPost($microPost)\n {\n $this->microPost = $microPost;\n\n return $this;\n }",
"public static function setMicroAdjustment($microseconds) \n {\n self::$microadjustment = $microseconds % 1000000;\n }",
"public function getMicrophone()\n {\n if (array_key_exists(\"microphone\", $this->_propDict)) {\n if (is_a($this->_propDict[\"microphone\"], \"\\Beta\\Microsoft\\Graph\\Model\\Enablement\") || is_null($this->_propDict[\"microphone\"])) {\n return $this->_propDict[\"microphone\"];\n } else {\n $this->_propDict[\"microphone\"] = new Enablement($this->_propDict[\"microphone\"]);\n return $this->_propDict[\"microphone\"];\n }\n }\n return null;\n }",
"protected function setMobile($value=true) { $this->_is_mobile = $value; }",
"public function setMicro($value)\n {\n return $this->set(self::MICRO, $value);\n }",
"public function setUrlMobilephone($value) {\n return $this->set(self::URL_MOBILEPHONE, $value);\n }",
"public function setMobilePhone(?string $value): void {\n $this->getBackingStore()->set('mobilePhone', $value);\n }",
"public function getMicrophone() {\n return $this->client->request(\"mic\") == \"1\";\n }",
"public function setLinkMobilephone($value) {\n return $this->set(self::LINK_MOBILEPHONE, $value);\n }",
"protected function setMobile($value = true)\n {\n $this->_is_mobile = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the value of $_trashed | public function settrashed($trashed) {
$this->_settrashed($trashed);
return $this;
} | [
"public function _settrashed($trashed) {\n\t\t$this->_trashed = $trashed;\n\t}",
"private function _reset_trashed()\n {\n $this->_trashed = 'without';\n return $this;\n }",
"public function only_trashed()\n {\n $this->_trashed = 'only';\n return $this;\n }",
"public function only_trashed()\n {\n $this->trashed = 'only';\n return $this;\n }",
"public function restore()\n\t{\n\t\t$t = str_replace('t.', '', $this->trashFlagField);\n\t\treturn $this->setTrashFlag($this->restoredFlag)->save(false,array($t));\n\t}",
"public function without_trashed()\n {\n $this->_trashed = 'without';\n return $this;\n }",
"public function is_trashed() {\n\t\t\treturn get_post_status( $this->get_id() ) === 'trash';\n\t\t}",
"public function moveToTrash()\n {\n $this->status = self::STATUS_TRASH;\n $this->save(false);\n }",
"public function sendToTrash(){\n $flags = $this->flags | self::FLAG_TRASH;\n DL::update(\"UPDATE page SET flags = '$flags' WHERE idpage = '$this->idpage'\");\n }",
"private function sauver(){\n $this->session->set(\"panier\", serialize($this->panier));\n $this->session->set(\"panierTraite\", serialize($this->traite));\n }",
"public function restore()\n {\n if($this->transactionId){\n $stickinessTransactionData = $this->tblStickinessTransaction->get($this->transactionId);\n if($stickinessTransactionData){\n $this->stickinessTransactionId = $stickinessTransactionData['StickinessTransaction_Id'];\n $this->stickinessId = $stickinessTransactionData['Stickiness_Id'];\n $this->transactionId = $stickinessTransactionData['Transaction_Id'];\n $this->verificationId = $stickinessTransactionData['Verification_Id'];\n $this->verification = $stickinessTransactionData['Verification'];\n }\n }\n }",
"function _untrashed_post($post_id){\n \n if(get_post_type($post_id) !== $this->post_type)\n return;\n \n $this->_save_post($post_id);\n $this->untrashed_post($post_id);\n \n }",
"public function setValueFromStorage($value)\n {\n //$this->setValue(is_serialized($value) ? unserialize($value) : $this->getEmptyValue());\n }",
"private static function set_is_trash( $is_trash ) {\n\t\tself::$is_trash->setAccessible( true );\n\t\tself::$is_trash->setValue( self::$list_table, $is_trash );\n\t\tself::$is_trash->setAccessible( false );\n\t}",
"function bbp_trashed_forum($forum_id = 0)\n{\n}",
"protected function is_trashed_page() {\n\t\treturn 'trashed' === Param::get( 'status' );\n\t}",
"private function restoreBasket()\n {\n if ($$this->getFrontendUser()->user) {\n $userSessionId = $this->getFrontendUser()->getKey('user', 'txCommercePersistantSessionId');\n if ($userSessionId && $userSessionId != $this->sessionId) {\n $this->loadPersistentDataFromDatabase($userSessionId);\n $this->loadDataFromDatabase();\n $this->getFrontendUser()->setKey('user', 'txCommercePersistantSessionId', $this->sessionId);\n $this->storeDataToDatabase();\n } else {\n $this->loadDataFromDatabase();\n }\n } else {\n $this->loadDataFromDatabase();\n }\n }",
"public function setTranscripts(?array $value): void {\n $this->getBackingStore()->set('transcripts', $value);\n }",
"function set_transient($transient, $value, $expiration = 0)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new record from the row data provided, recording the new recordID (or failure) into the $restfmData object. Success will result in: a new 'meta' section row containing a 'recordID' field. Failure will result in: a new 'multistatus' row containing 'index', 'Status', and 'Reason' | protected function _createRecord (RESTfmDataSimple $restfmData, $index, $row) {
$FM = $this->_backend->getFileMaker();
$FM->setProperty('database', $this->_database);
$valuesRepetitions = $this->_convertValuesToRepetitions($row);
$addCommand = $FM->newAddCommand($this->_layout, $valuesRepetitions);
// Script calling.
if ($this->_postOpScriptTrigger) {
$addCommand->setScript($this->_postOpScript, $this->_postOpScriptParameter);
$this->_postOpScriptTrigger = FALSE;
}
if ($this->_preOpScriptTrigger) {
$addCommand->setPreCommandScript($this->_preOpScript, $this->_preOpScriptParameter);
$this->_preOpScriptTrigger = FALSE;
}
// Commit to database.
// NOTE: We add the '@' to suppress PHP warnings in the FileMaker
// PHP API when non-existent fields are provided. We still catch
// the error OK.
$result = @ $addCommand->execute();
if (FileMaker::isError($result)) {
if ($this->_isSingle) {
throw new FileMakerResponseException($result);
}
$restfmData->setSectionData('multistatus', NULL, array(
'index' => $index,
'Status' => $result->getCode(),
'Reason' => $result->getMessage(),
));
return; // Nothing more to do here.
}
// Query the result for the created records.
foreach ($result->getRecords() as $record) {
if ($this->_suppressData) {
// Insert just the recordID into the 'meta' section.
$recordID = $record->getRecordId();
$restfmData->pushDataRow(NULL, $recordID);
} else {
// Parse full record.
$this->_parseRecord($restfmData, $record);
}
}
} | [
"protected function _parseRecord (\\RESTfm\\Message\\Message $restfmMessage, \\FileMaker_Record $record) {\n $fieldNames = $record->getFields();\n\n // Only extract field meta data if we haven't done it yet.\n if ($restfmMessage->getMetaFieldCount() < 1) {\n // Dig out field meta data from field objects in layout object\n // returned by record object!\n $layoutResult = $record->getLayout();\n foreach ($fieldNames as $fieldName) {\n $fieldResult = $layoutResult->getField($fieldName);\n\n $restfmMessageRow = new \\RESTfm\\Message\\Row();\n\n $restfmMessageRow['name'] = $fieldName;\n $restfmMessageRow['autoEntered'] = $fieldResult->isAutoEntered() ? 1 : 0;\n $restfmMessageRow['global'] = $fieldResult->isGlobal() ? 1 : 0;\n $restfmMessageRow['maxRepeat'] = $fieldResult->getRepetitionCount();\n $restfmMessageRow['resultType'] = $fieldResult->getResult();\n //$restfmMessageRow['type'] = $fieldResult->getType();\n\n $restfmMessage->setMetaField($fieldName, $restfmMessageRow);\n }\n }\n\n $FM = $this->_backend->getFileMaker();\n $FM->setProperty('database', $this->_database);\n\n // Process record and store data.\n $metaFields = $restfmMessage->getMetaFields();\n $restfmMessageRecord = new \\RESTfm\\Message\\Record($record->getRecordId());\n foreach ($fieldNames as $fieldName) {\n $metaFieldRow = NULL; // @var \\RESTfm\\Message\\Row\n $metaFieldRow = $metaFields[$fieldName];\n\n // Field repetitions are expanded into multiple fields with\n // an index operator suffix; fieldName[0], fieldName[1] ...\n $fieldRepeat = $metaFieldRow['maxRepeat'];\n for ($repetition = 0; $repetition < $fieldRepeat; $repetition++) {\n $fieldNameRepeat = $fieldName;\n\n // Apply index suffix only when more than one $fieldRepeat.\n if ($fieldRepeat > 1) {\n $fieldNameRepeat .= '[' . $repetition . ']';\n }\n\n // Get un-mangled field data, usually this is all we need.\n $fieldData = $record->getFieldUnencoded($fieldName, $repetition);\n\n // Handle container types differently.\n if ($metaFieldRow['resultType'] == 'container') {\n switch ($this->_containerEncoding) {\n case self::CONTAINER_BASE64:\n $filename = '';\n $matches = array();\n if (preg_match('/^\\/fmi\\/xml\\/cnt\\/([^\\?]*)\\?/', $fieldData, $matches)) {\n $filename = $matches[1] . ';';\n }\n $containerData = $FM->getContainerData($record->getField($fieldName, $repetition));\n\t\t\t\t\t\t\tif (gettype($containerData) !== 'string') {\n\t\t\t\t\t\t\t\t$containerData = \"\";\n\t\t\t\t\t\t\t}\n $fieldData = $filename . base64_encode($containerData);\n break;\n case self::CONTAINER_RAW:\n // TODO\n break;\n case self::CONTAINER_DEFAULT:\n default:\n if (method_exists($FM, 'getContainerDataURL')) {\n // Note: FileMaker::getContainerDataURL() only exists in the FMSv12 PHP API\n $fieldData = $FM->getContainerDataURL($record->getField($fieldName, $repetition));\n }\n }\n }\n\n // Store this field's data for this row.\n $restfmMessageRecord[$fieldNameRepeat] = $fieldData;\n }\n }\n $restfmMessage->addRecord($restfmMessageRecord);\n }",
"protected function _updateRecord (\\RESTfm\\Message\\Message $restfmMessage, \\RESTfm\\Message\\Record $requestRecord, $index) {\n $recordID = $requestRecord->getRecordId();\n\n $readMessage = NULL; // May be re-used for appending data.\n\n if (strpos($recordID, '=')) { // This is a unique-key-recordID, will\n // need to find the real recordID.\n $readMessage = new \\RESTfm\\Message\\Message();\n\n // $this->_readRecord() will throw an exception if $this->_isSingle.\n try {\n $this->_readRecord($readMessage, new \\RESTfm\\Message\\Record($recordID));\n } catch (\\RESTfm\\ResponseException $e) {\n // Check for 404 Not Found in exception.\n if ($e->getCode() == \\RESTfm\\ResponseException::NOTFOUND && $this->_updateElseCreate) {\n // No record matching this unique-key-recordID,\n // create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n // Not 404, re-throw exception.\n throw $e;\n }\n\n // Check if we have an error.\n $readStatus = $readMessage->getMultistatus(0);\n if ($readStatus !== NULL) {\n\n // Check for FileMaker error 401: No records match the request\n if ($readStatus->getStatus() == 401 && $this->_updateElseCreate) {\n // No record matching this unique-key-recordID,\n // create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n // Some other error, set our own multistatus.\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $readStatus->getStatus(),\n $readStatus->getReason(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n\n // We now have the real recordID.\n $recordID = $readMessage->getRecord(0)->getRecordId();\n }\n\n $fmDataApi = $this->_backend->getFileMakerDataApi(); // @var FileMakerDataApi\n\n // Allow appending to existing data.\n if ($this->_updateAppend) {\n if ($readMessage == NULL) {\n $readMessage = new \\RESTfm\\Message\\Message();\n $this->_readRecord($readMessage, new \\RESTfm\\Message\\Record($recordID));\n\n // Check if we have an error.\n $readStatus = $readMessage->getMultistatus(0);\n if ($readStatus !== NULL) {\n // Set our own multistatus for this error.\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $readStatus->getStatus(),\n $readStatus->getReason(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n }\n\n $readRecord = $readMessage->getRecord(0);\n\n // Rebuild $requestRecord field values by appending to the field\n // values in $readRecord.\n foreach ($requestRecord as $fieldName => $value) {\n $requestRecord[$fieldName] = $readRecord[$fieldName] . $value;\n }\n }\n\n /*\n $updatedValuesRepetitions = $this->_convertValuesToRepetitions($requestRecord);\n */\n\n $params = array();\n\n // Script calling.\n $this->_scriptPropertiesToParams($params);\n\n // Commit edit back to database.\n $result = $fmDataApi->editRecord($this->_layout, $recordID, $requestRecord->_getDataReference(), $params);\n\n if ($result->isError()) {\n // Check for FileMaker error 401: No records match the request\n if ($result->getCode() == 401 && $this->_updateElseCreate) {\n // No record matching this recordID, create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n if ($this->_isSingle) {\n throw new FileMakerDataApiResponseException($result);\n }\n // Store result codes in multistatus section\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $result->getCode(),\n $result->getMessage(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n\n // Script results.\n $this->_scriptResultsToInfo($restfmMessage, $result);\n }",
"protected function _updateRecord (\\RESTfm\\Message\\Message $restfmMessage, \\RESTfm\\Message\\Record $requestRecord, $index) {\n $recordID = $requestRecord->getRecordId();\n\n $readMessage = NULL; // May be re-used for appending data.\n\n if (strpos($recordID, '=')) { // This is a unique-key-recordID, will\n // need to find the real recordID.\n $readMessage = new \\RESTfm\\Message\\Message();\n\n // $this->_readRecord() will throw an exception if $this->_isSingle.\n try {\n $this->_readRecord($readMessage, new \\RESTfm\\Message\\Record($recordID));\n } catch (\\RESTfm\\ResponseException $e) {\n // Check for 404 Not Found in exception.\n if ($e->getCode() == \\RESTfm\\ResponseException::NOTFOUND && $this->_updateElseCreate) {\n // No record matching this unique-key-recordID,\n // create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n // Not 404, re-throw exception.\n throw $e;\n }\n\n // Check if we have an error.\n $readStatus = $readMessage->getMultistatus(0);\n if ($readStatus !== NULL) {\n\n // Check for FileMaker error 401: No records match the request\n if ($readStatus->getStatus() == 401 && $this->_updateElseCreate) {\n // No record matching this unique-key-recordID,\n // create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n // Some other error, set our own multistatus.\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $readStatus->getStatus(),\n $readStatus->getReason(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n\n // We now have the real recordID.\n $recordID = $readMessage->getRecord(0)->getRecordId();\n }\n\n $FM = $this->_backend->getFileMaker();\n $FM->setProperty('database', $this->_database);\n\n // Allow appending to existing data.\n if ($this->_updateAppend) {\n if ($readMessage == NULL) {\n $readMessage = new \\RESTfm\\Message\\Message();\n $this->_readRecord($readMessage, new \\RESTfm\\Message\\Record($recordID));\n\n // Check if we have an error.\n $readStatus = $readMessage->getMultistatus(0);\n if ($readStatus !== NULL) {\n // Set our own multistatus for this error.\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $readStatus->getStatus(),\n $readStatus->getReason(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n }\n\n $readRecord = $readMessage->getRecord(0);\n\n // Rebuild $requestRecord field values by appending to the field\n // values in $readRecord.\n foreach ($requestRecord as $fieldName => $value) {\n $requestRecord[$fieldName] = $readRecord[$fieldName] . $value;\n }\n }\n\n $updatedValuesRepetitions = $this->_convertValuesToRepetitions($requestRecord);\n\n // New edit command on record with values to update.\n $editCommand = $FM->newEditCommand($this->_layout, $recordID, $updatedValuesRepetitions);\n\n // Script calling.\n if ($this->_postOpScriptTrigger) {\n $editCommand->setScript($this->_postOpScript, $this->_postOpScriptParameter);\n $this->_postOpScriptTrigger = FALSE;\n }\n if ($this->_preOpScriptTrigger) {\n $editCommand->setPreCommandScript($this->_preOpScript, $this->_preOpScriptParameter);\n $this->_preOpScriptTrigger = FALSE;\n }\n\n // Commit edit back to database.\n // NOTE: We add the '@' to suppress PHP warnings in the FileMaker\n // PHP API when non-existent fields are provided. We still catch\n // the error OK.\n $result = @ $editCommand->execute();\n if (\\FileMaker::isError($result)) {\n // Check for FileMaker error 401: No records match the request\n if ($result->getCode() == 401 && $this->_updateElseCreate) {\n // No record matching this recordID, create new record instead.\n return $this->_createRecord($restfmMessage, $requestRecord, $index);\n }\n\n if ($this->_isSingle) {\n throw new FileMakerResponseException($result);\n }\n // Store result codes in multistatus section\n $restfmMessage->addMultistatus(new \\RESTfm\\Message\\Multistatus(\n $result->getCode(),\n $result->getMessage(),\n $requestRecord->getRecordId()\n ));\n return; // Nothing more to do here.\n }\n }",
"public function &create(&$record);",
"public function create($record) {\n self::$debug[] = ['create' => $record];\n $url = '/services/data/v27.0/sobjects/' . $record->type . '/';\n $content = json_encode($record->fields);\n $response = $this->apiCall($url, ['content' => $content, 'encoding' => 'json', 'method' => 'POST', 'is_full_url' => FALSE]);\n \n \n if( !empty($response['response']['success']) ){\n return $response['response']['id'];\n }\n var_dump($record, $response);\n foreach($response['response']['errors'] as $error){\n throw new SfException($error->message);\n }\n }",
"public function createNewSampleRecord(){\n // associative array of field name => field value pairs\n $values = array($this->_name => $this->name, $this->_surname => $this->surname);\n return $result = parent::insertInformation($this->_tableName, $values);\n }",
"public function NewRecord()\n {\n global $g_BizSystem;\n $this->SetDisplayMode(MODE_N);\n $recArr = $this->GetNewRecord();\n if (!$recArr)\n return $this->ProcessDataObjError();\n $this->UpdateActiveRecord($recArr);\n // TODO: popup message of new record successful created\n return $this->ReRender();\n }",
"public function testCreateRecord()\n {\n\n $exhibit = $this->_exhibit();\n\n $this->request->setMethod('POST')->setRawBody(\n Zend_Json::encode(array(\n 'exhibit_id' => $exhibit->id,\n 'field4' => '1',\n 'field5' => '2',\n 'field6' => '3'\n )\n ));\n\n $this->dispatch('neatline/records');\n $record = $this->_records->find($this->_getResponseArray()['id']);\n\n // Should update fields.\n $this->assertEquals(1, $record->field4);\n $this->assertEquals(2, $record->field5);\n $this->assertEquals(3, $record->field6);\n\n }",
"public function newRecord() {}",
"public function testCreateOrGetRecordWithRecord()\n {\n\n // Create item, exhibit, and record.\n $item = $this->_createItem();\n $neatline = $this->_createNeatline();\n $record1 = new NeatlineDataRecord($item, $neatline);\n $record1->save();\n $record2 = new NeatlineDataRecord(null, $neatline);\n $record2->save();\n\n // 2 records.\n $this->assertEquals($this->_recordsTable->count(), 2);\n\n // Get the record and check identity.\n $retrievedRecord = $this->_recordsTable->createOrGetRecord($item, $neatline);\n $this->assertEquals($retrievedRecord->id, $record1->id);\n\n // Still 2 records.\n $this->assertEquals($this->_recordsTable->count(), 2);\n\n }",
"function create($scaffold, $record) {\n $result = $this->post($this->endpointUrl.$scaffold.\"/create.json\", array(\"record\" => $record));\n return $result;\n }",
"abstract protected function createRecord(ResourceObject $resource);",
"public function NewRecord()\n {\n // auto generated SYSID\n $sysid = $this->GenerateId();\n if ($sysid === false)\n return false;\n $recArr = $this->m_BizRecord->GetEmptyRecordArr();\n\n // if association is 1-M, set the field (pointing to the column) value as the FieldRefVal\n if ($this->m_Association[\"Relationship\"] == \"1-M\") {\n foreach ($this->m_BizRecord as $fld) {\n if ($fld->m_Column == $this->m_Association[\"Column\"] && !$fld->m_Join) {\n $recArr[$fld->m_Name] = $this->m_Association[\"FieldRefVal\"];\n break;\n }\n }\n }\n if ($sysid)\n $recArr[\"Id\"] = $sysid;\n\n return $recArr;\n }",
"private function create_record($record_array){\n\t\tglobal $wpdb;\n\t\t// http://codex.wordpress.org/Class_Reference/wpdb\n\t\t//will return false on fail\n\t\treturn $wpdb->insert(\n\t\t\t$this->table_name,\n\t\t\t$this->col_val_array($record_array),\n\t\t\tself::$db_formats\n\t\t);\n\t}",
"public function testSaveRecordStatusWithRecord()\n {\n\n // Create item, exhibit, and record.\n $item = $this->helper->_createItem();\n $neatline = $this->helper->_createNeatline();\n $record = new NeatlineDataRecord($item, $neatline);\n $record->save();\n\n // At the start, no records.\n $this->assertEquals($this->_recordsTable->count(), 1);\n\n // Save form data for a non-existent record.\n $this->_recordsTable->saveRecordStatus($item, $neatline, 'space', true);\n\n // After the save, there should be 1 record.\n $this->assertEquals($this->_recordsTable->count(), 1);\n\n // Re-get the record.\n $record = $this->_recordsTable->getRecordByItemAndExhibit($item, $neatline);\n\n // Check that the parameter was set.\n $this->assertEquals($record->space_active, 1);\n\n }",
"public function CopyRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n foreach ($rec as $k=>$v)\n $rec[$k] = addslashes($v);\n global $g_BizSystem;\n // get new record array\n $recArr = $this->GetDataObj()->NewRecord();\n\n $rec[\"Id\"] = $recArr[\"Id\"]; // replace with new Id field\n $this->m_RecordRow->SetRecordArr($rec);\n $ok = $this->GetDataObj()->InsertRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n return $this->ReRender();\n }",
"public static function add_meta($record){\r\n $record['meta_user'] = argent_uauth::session_user();\r\n $record['meta_ip'] = $_SERVER['REMOTE_ADDR'];\r\n $record['meta_timestamp'] = date('Y-m-d H:i:s');\r\n $record['meta_guid'] = argent_identifier::meta_guid();\r\n \r\n return $record;\r\n }",
"protected function createNewRecords()\n {\n /** @var $modelClassName string holds name of model class */\n $modelClassName = $this->getTableModelClassName();\n $newItemId = $modelClassName::getLastId() + 1;\n\n $publishAt = strtotime( $this->publish_at );\n $publishAt = ( $publishAt === FALSE ) ? NULL : $publishAt;\n\n // create set of catalog records with the same catalog_id\n foreach( $this->getLanguages() as $lang )\n {\n $titleField = 'title_' . $lang;\n $textField = 'text_' . $lang;\n $metaDescriptionField = 'meta_description_' . $lang;\n $metaKeywordsField = 'meta_keywords_' . $lang;\n\n /** @var $model BaseArticleTableML */\n $model = new $modelClassName;\n $model->article_id = $newItemId;\n $model->catalog_id = $this->catalog_id;\n $model->title = $this->{$titleField};\n $model->text = $this->{$textField};\n $model->lang = $lang;\n $model->publish_at = $publishAt;\n $model->meta_description = $this->{$metaDescriptionField};\n $model->meta_keywords = $this->{$metaKeywordsField};\n $model->image = $this->image;\n $model->save();\n }\n\n if ( static::USE_TAGS )\n {\n $this->addTags( $newItemId, $this->tags );\n }\n\n if ( static::USE_IMAGE )\n {\n $this->saveImage();\n }\n }",
"public function CreateRecord()\r\n\t{\r\n\t\t$form = new pranaform();\r\n\t\t$dbio = new dbio();\r\n\t\t$html = '';\r\n\t\t$html .= '<h2>'. jtext::_($this->textfile,\"FORM_CREATE\").'</h2>';\r\n\t\t$html .= '<div class=\"prana-display\">';\r\n\t\t$html .= '<br>';\r\n\t\t$html .='<form action=' . $this->action . ' method=\"post\" name=\"createform\">';\r\n\t\t#\r\n\t\t# read record just for testing\r\n\t\tif($_POST[\"createrecord\"] > 0) #new record is a copy (copyrecord pressed)\r\n\t\t{\r\n\t\t\t$row=$dbio->ReadRecord(array(\"table\"=>$this->table,\"id\"=>$_POST[\"createrecord\"]));\r\n\t\t\t$row->id=\"\";\r\n\t\t\t$html .= $this->RawRecordForm(array(\"record\"=>$row));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$html .= $this->RawRecordForm(0);\r\n\t\t}\r\n\t\t#\r\n\t\t$html .= '<br><button class=\"prana-btnhigh\" name=\"create\" >'. jtext::_($this->textfile,\"BUTTON_MODIFY\") . '</button>';\r\n\t\t$html .= '<button class=\"prana-btnhigh\">'. jtext::_($this->textfile,\"BUTTON_CANCEL\") . '</button>';\r\n\t\t$html .= $this->PostValues();\t# save modified variables\r\n\t\t$html .= '</form>';\r\n\t\t$html .= '</div>';\r\n\r\n\t\treturn($html);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////////////////////////////////////////////////////////////////////////////// / / \fn XMLRPCblockAllocation($imageid, $start, $end, $requestcount, / $usergroupid, $ignoreprivileges) / / \param $imageid id of the image to be used / \param $start mysql datetime for the start time (i.e. requests should be / prep'd and ready by this time) / \param $end mysql datetime for the end time / \param $requestcount number of computers to allocate / \param $usergroupid id of user group for checking user access to machines / \param $ignoreprivileges (optional, default=0) 0 (false) or 1 (true) set / to 1 to select computers from any that are mapped to be able to run the / image; set to 0 to only select computers from ones that are both mapped and / that users in the usergroup assigned to this block request have been granted / access to through the privilege tree / / \return an array with blockTimesid as an index with the value of the newly / created block time and at least one other index named 'status' which will / have one of these values:\n / \b error error occurred; there will be 2 additional elements in the array: / \li \b errorcode error number / \li \b errormsg error string / / \b success blockTimesid was processed; there will be two additional / elements in this case: / \li \b allocated total number of desired requests that have been allocated / \li \b unallocated total number of desired requests that have not been / allocated / / \b warning there was a nonfatal issue that occurred while processing / the call; there will be four additional elements in this case: / \li \b warningcode warning number / \li \b warningmsg warning string / \li \b allocated total number of desired requests that have been allocated / \li \b unallocated total number of desired requests that have not been / allocated / / note that status may be warning, but allocated may be 0 indicating there / were no errors that occurred, but there simply were not any machines / available / / \brief creates and processes a block reservation according to the passed / in criteria / ////////////////////////////////////////////////////////////////////////////// | function XMLRPCblockAllocation($imageid, $start, $end, $requestcount,
$usergroupid, $ignoreprivileges=0) {
global $user, $xmlrpcBlockAPIUsers;
if(! in_array($user['id'], $xmlrpcBlockAPIUsers)) {
return array('status' => 'error',
'errorcode' => 34,
'errormsg' => 'access denied for managing block allocations');
}
$ownerid = getUserlistID('vclreload@Local');
$name = "API:$start";
$managementnodes = getManagementNodes('future');
if(empty($managementnodes)) {
return array('status' => 'error',
'errorcode' => 12,
'errormsg' => 'could not allocate a management node to handle block allocation');
}
$mnid = array_rand($managementnodes);
$query = "INSERT INTO blockRequest "
. "(name, "
. "imageid, "
. "numMachines, "
. "groupid, "
. "repeating, "
. "ownerid, "
. "admingroupid, "
. "managementnodeid, "
. "expireTime) "
. "VALUES "
. "('$name', "
. "$imageid, "
. "$requestcount, "
. "$usergroupid, "
. "'list', "
. "$ownerid, "
. "0, "
. "$mnid, "
. "'$end')";
doQuery($query, 101);
$brid = dbLastInsertID();
$query = "INSERT INTO blockTimes "
. "(blockRequestid, "
. "start, "
. "end) "
. "VALUES "
. "($brid, "
. "'$start', "
. "'$end')";
doQuery($query, 101);
$btid = dbLastInsertID();
$return = XMLRPCprocessBlockTime($btid, $ignoreprivileges);
$return['blockTimesid'] = $btid;
return $return;
} | [
"function XMLRPCprocessBlockTime($blockTimesid, $ignoreprivileges=0) {\n\tglobal $requestInfo, $user, $xmlrpcBlockAPIUsers;\n\tif(! in_array($user['id'], $xmlrpcBlockAPIUsers)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 34,\n\t\t 'errormsg' => 'access denied for managing block allocations');\n\t}\n\n\t# validate $blockTimesid\n\tif(! is_numeric($blockTimesid)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 77,\n\t\t 'errormsg' => 'Invalid blockTimesid specified');\n\t}\n\n\t# validate ignoreprivileges\n\tif(! is_numeric($ignoreprivileges) ||\n\t $ignoreprivileges < 0 ||\n\t\t$ignoreprivileges > 1) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 86,\n\t\t 'errormsg' => 'ignoreprivileges must be 0 or 1');\n\t}\n\n\t$return = array('status' => 'success');\n\t$query = \"SELECT bt.start, \"\n\t . \"bt.end, \"\n\t . \"br.imageid, \"\n\t . \"br.numMachines, \"\n\t . \"br.groupid, \"\n\t . \"br.expireTime \"\n\t . \"FROM blockRequest br, \"\n\t . \"blockTimes bt \"\n\t . \"WHERE bt.blockRequestid = br.id AND \"\n\t . \"bt.id = $blockTimesid\";\n\t$qh = doQuery($query, 101);\n\tif(! $rqdata = mysqli_fetch_assoc($qh)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 8,\n\t\t 'errormsg' => 'unknown blockTimesid');\n\t}\n\tif(datetimeToUnix($rqdata['expireTime']) < time()) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 9,\n\t\t 'errormsg' => 'expired block allocation');\n\t}\n\n\t$images = getImages(0, $rqdata['imageid']);\n\tif(empty($images)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 10,\n\t\t 'errormsg' => 'invalid image associated with block allocation');\n\t}\n\n\t$unixstart = datetimeToUnix($rqdata['start']);\n\t$unixend = datetimeToUnix($rqdata['end']);\n\t$revisionid = getProductionRevisionid($rqdata['imageid']);\n\t$imgLoadTime = getImageLoadEstimate($rqdata['imageid']);\n\tif($imgLoadTime == 0)\n\t\t$imgLoadTime = $images[$rqdata['imageid']]['reloadtime'] * 60;\n\t$vclreloadid = getUserlistID('vclreload@Local');\n\t$groupmembers = getUserGroupMembers($rqdata['groupid']);\n\t$userids = array_keys($groupmembers);\n\n\t# add any computers from future reservations users in the group made\n\tif(! empty($groupmembers)) {\n\t\t## find reservations by users\n\t\t$allids = implode(',', $userids);\n\t\t$query = \"SELECT rq.id AS reqid, \"\n\t\t . \"UNIX_TIMESTAMP(rq.start) AS start, \"\n\t\t . \"rq.userid \"\n\t\t . \"FROM request rq, \"\n\t\t . \"reservation rs \"\n\t\t . \"WHERE rs.requestid = rq.id AND \"\n\t\t . \"rq.userid IN ($allids) AND \"\n\t\t . \"rq.start < '{$rqdata['end']}' AND \"\n\t\t . \"rq.end > '{$rqdata['start']}' AND \"\n\t\t . \"rs.imageid = {$rqdata['imageid']} AND \"\n\t\t . \"rs.computerid NOT IN (SELECT computerid \"\n\t\t . \"FROM blockComputers \"\n\t\t . \"WHERE blockTimeid = $blockTimesid)\";\n\t\t$qh = doQuery($query);\n\t\t$donereqids = array();\n\t\t$blockCompVals = array();\n\t\t$checkstartbase = $unixstart - $imgLoadTime - 300;\n\t\t$reloadstartbase = unixToDatetime($checkstartbase);\n\t\t$rows = mysqli_num_rows($qh);\n\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\tif(array_key_exists($row['reqid'], $donereqids))\n\t\t\t\tcontinue;\n\t\t\t$donereqids[$row['reqid']] = 1;\n\t\t\tif($row['start'] < datetimeToUnix($rqdata['start'])) {\n\t\t\t\t$checkstart = $row['start'] - $imgLoadTime - 300;\n\t\t\t\t$reloadstart = unixToDatetime($checkstart);\n\t\t\t\t$reloadend = unixToDatetime($row['start']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$checkstart = $checkstartbase;\n\t\t\t\t$reloadstart = $reloadstartbase;\n\t\t\t\t$reloadend = $rqdata['start'];\n\t\t\t}\n\t\t\t# check to see if computer is available for whole block\n\t\t\t$rc = isAvailable($images, $rqdata['imageid'], $revisionid, $checkstart,\n\t\t\t $unixend, 1, $row['reqid'], $row['userid'],\n\t\t\t $ignoreprivileges, 0, '', '', 1);\n\t\t\t// if not available for whole block, just skip this one\n\t\t\tif($rc < 1)\n\t\t\t\tcontinue;\n\t\t\t$compid = $requestInfo['computers'][0];\n\t\t\t# create reload reservation\n\t\t\t$reqid = simpleAddRequest($compid, $rqdata['imageid'], $revisionid,\n\t\t\t $reloadstart, $reloadend, 19, $vclreloadid);\n\t\t\tif($reqid == 0)\n\t\t\t\tcontinue;\n\t\t\t# add to blockComputers\n\t\t\t$blockCompVals[] = \"($blockTimesid, $compid, {$rqdata['imageid']}, $reqid)\";\n\t\t\t# process any subimages\n\t\t\tfor($key = 1; $key < count($requestInfo['computers']); $key++) {\n\t\t\t\t$subimageid = $requestInfo['images'][$key];\n\t\t\t\t$subrevid = getProductionRevisionid($subimageid);\n\t\t\t\t$compid = $requestInfo['computers'][$key];\n\t\t\t\t$mgmtnodeid = $requestInfo['mgmtnodes'][$key];\n\t\t\t\t$blockCompVals[] = \"($blockTimesid, $compid, $subimageid, $reqid)\";\n\n\t\t\t\t$query = \"INSERT INTO reservation \"\n\t\t\t\t . \"(requestid, \"\n\t\t\t\t . \"computerid, \"\n\t\t\t\t . \"imageid, \"\n\t\t\t\t . \"imagerevisionid, \"\n\t\t\t\t . \"managementnodeid) \"\n\t\t\t\t . \"VALUES \"\n\t\t\t\t . \"($reqid, \"\n\t\t\t\t . \"$compid, \"\n\t\t\t\t . \"$subimageid, \"\n\t\t\t\t . \"$subrevid, \"\n\t\t\t\t . \"$mgmtnodeid)\";\n\t\t\t\tdoQuery($query, 101);\n\t\t\t}\n\t\t}\n\t\tif(count($blockCompVals)) {\n\t\t\t$blockComps = implode(',', $blockCompVals);\n\t\t\t$query = \"INSERT INTO blockComputers \"\n\t\t\t . \"(blockTimeid, computerid, imageid, reloadrequestid) \"\n\t\t\t . \"VALUES $blockComps\";\n\t\t\tdoQuery($query);\n\t\t}\n\t\tcleanSemaphore();\n\t}\n\n\t# check to see if all computers have been allocated\n\t$query = \"SELECT COUNT(computerid) AS allocated \"\n\t . \"FROM blockComputers \"\n\t . \"WHERE blockTimeid = $blockTimesid\";\n\t$qh = doQuery($query, 101);\n\tif(! $row = mysqli_fetch_assoc($qh)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 15,\n\t\t 'errormsg' => 'failure to communicate with database');\n\t}\n\t$compCompleted = $row['allocated'];\n\tif(array_key_exists('subimages', $images[$rqdata['imageid']]))\n\t\t$compsPerAlloc = 1 + count($images[$rqdata['imageid']]['subimages']);\n\telse\n\t\t$compsPerAlloc = 1;\n\t$toallocate = ($rqdata['numMachines'] * $compsPerAlloc) - $compCompleted;\n\tif($toallocate == 0) {\n\t\tif(count($blockCompVals)) {\n\t\t\treturn array('status' => 'success',\n\t\t\t 'allocated' => $rqdata['numMachines'],\n\t\t\t 'unallocated' => 0);\n\t\t}\n\t\treturn array('status' => 'completed');\n\t}\n\t$reqToAlloc = $toallocate / $compsPerAlloc;\n\n\tif(! $ignoreprivileges) {\n\t\t# get userids in user group\n\t\tif(empty($groupmembers)) {\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 11,\n\t\t\t 'errormsg' => 'empty user group and ignoreprivileges set to 0');\n\t\t}\n\t\t# make length of $userids match $reqToAlloc by duplicating or trimming some users\n\t\twhile($reqToAlloc > count($userids))\n\t\t\t$userids = array_merge($userids, $userids);\n\t\tif($reqToAlloc < count($userids))\n\t\t\t$userids = array_splice($userids, 0, $reqToAlloc);\n\t}\n\n\t# staggering: stagger start times for this round (ie, do not worry about\n\t# previous processing of this block time) such that there is 1 minute\n\t# between the start times for each allocation\n\t$stagExtra = $reqToAlloc * 60;\n\n\t# determine estimated load time\n\t$loadtime = $imgLoadTime + (10 * 60); # add 10 minute fudge factor\n\tif((time() + $loadtime + $stagExtra) > $unixstart) {\n\t\t$return['status'] = 'warning';\n\t\t$return['warningcode'] = 13;\n\t\t$return['warningmsg'] = 'possibly insufficient time to load machines';\n\t}\n\t$start = unixToDatetime($unixstart - $loadtime);\n\n\t$userid = 0;\n\t$allocated = 0;\n\t$blockCompVals = array();\n\t# FIXME (maybe) - if some subset of users in the user group have available\n\t# computers, but others do not, $allocated will be less than the desired\n\t# number of machines; however, calling this function enough times will\n\t# result in enough machines being allocated because they will continue to be\n\t# allocated based on the ones with machines available; this seems like odd\n\t# behavior\n\t$stagCnt = 0;\n\t$stagTime = 60; # stagger reload reservations by 1 min\n\tif($imgLoadTime > 840) // if estimated load time is > 14 min\n\t\t$stagTime = 120; # stagger reload reservations by 2 min\n\tfor($i = 0; $i < $reqToAlloc; $i++) {\n\t\t$stagunixstart = $unixstart - $loadtime - ($stagCnt * $stagTime);\n\t\t$stagstart = unixToDatetime($stagunixstart);\n\t\tif(! $ignoreprivileges)\n\t\t\t$userid = array_pop($userids);\n\t\t# use end of block time to find available computers, but...\n\t\t$rc = isAvailable($images, $rqdata['imageid'], $revisionid, $stagunixstart,\n\t\t $unixend, 1, 0, $userid, $ignoreprivileges);\n\t\tif($rc < 1)\n\t\t\tcontinue;\n\n\t\t$compid = $requestInfo['computers'][0];\n\t\t# ...use start of block time as end of reload reservation\n\t\t$reqid = simpleAddRequest($compid, $rqdata['imageid'], $revisionid,\n\t\t $stagstart, $rqdata['start'], 19, $vclreloadid);\n\t\tif($reqid == 0)\n\t\t\tcontinue;\n\n\t\t$stagCnt++;\n\t\t$allocated++;\n\t\t$blockCompVals[] = \"($blockTimesid, $compid, {$rqdata['imageid']}, $reqid)\";\n\n\t\t# process any subimages\n\t\tfor($key = 1; $key < count($requestInfo['computers']); $key++) {\n\t\t\t$subimageid = $requestInfo['images'][$key];\n\t\t\t$subrevid = getProductionRevisionid($subimageid);\n\t\t\t$compid = $requestInfo['computers'][$key];\n\t\t\t$mgmtnodeid = $requestInfo['mgmtnodes'][$key];\n\t\t\t$blockCompVals[] = \"($blockTimesid, $compid, $subimageid, $reqid)\";\n\n\t\t\t$query = \"INSERT INTO reservation \"\n\t\t\t . \"(requestid, \"\n\t\t\t . \"computerid, \"\n\t\t\t . \"imageid, \"\n\t\t\t . \"imagerevisionid, \"\n\t\t\t . \"managementnodeid) \"\n\t\t\t . \"VALUES \"\n\t\t\t . \"($reqid, \"\n\t\t\t . \"$compid, \"\n\t\t\t . \"$subimageid, \"\n\t\t\t . \"$subrevid, \"\n\t\t\t . \"$mgmtnodeid)\";\n\t\t\tdoQuery($query, 101);\n\t\t}\n\t\t$blockComps = implode(',', $blockCompVals);\n\t\t$query = \"INSERT INTO blockComputers \"\n\t\t . \"(blockTimeid, computerid, imageid, reloadrequestid) \"\n\t\t . \"VALUES $blockComps\";\n\t\tdoQuery($query, 101);\n\t\tcleanSemaphore();\n\t\t$blockCompVals = array();\n\t}\n\tif($allocated == 0) {\n\t\t$return['status'] = 'warning';\n\t\t$return['warningcode'] = 14;\n\t\t$return['warningmsg'] = 'unable to allocate any machines';\n\t}\n\t$return['allocated'] = ($compCompleted / $compsPerAlloc) + $allocated;\n\t$return['unallocated'] = $rqdata['numMachines'] - $return['allocated'];\n\treturn $return;\n}",
"function processBlockAllocationInput() {\n\tglobal $user;\n\t$return = array();\n\t$method = getContinuationVar('method');\n\t$return['name'] = processInputVar('name', ARG_STRING);\n\t$return['owner'] = processInputVar('owner', ARG_STRING);\n\t$return['imageid'] = processInputVar('imageid', ARG_NUMERIC);\n\t$return['seats'] = processInputVar('seats', ARG_NUMERIC);\n\t$return['groupid'] = processInputVar('groupid', ARG_NUMERIC);\n\t$override = getContinuationVar('override', 0);\n\t$type = processInputVar('type', ARG_STRING);\n\t$err = 0;\n\tif($method != 'request' && ! preg_match('/^([-a-zA-Z0-9\\. \\(\\)]){3,80}$/', $return['name'])) {\n\t\t$errmsg = i(\"The name can only contain letters, numbers, spaces, dashes(-), and periods(.) and can be from 3 to 80 characters long\");\n\t\t$err = 1;\n\t}\n\t$resources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"));\n\t$resources[\"image\"] = removeNoCheckout($resources[\"image\"]);\n\tif(! array_key_exists($return['imageid'], $resources['image'])) {\n\t\t$errmsg = i(\"The submitted image is invalid.\");\n\t\t$err = 1;\n\t}\n\tif(! $err && $method != 'request' && ! validateUserid($return['owner'])) {\n\t\t$errmsg = i(\"The submitted owner is invalid.\");\n\t\t$err = 1;\n\t}\n\telse\n\t\t$return['ownerid'] = getUserlistID($return['owner']);\n\t$groups = getUserGroups(0, $user['affiliationid']);\n\t$extragroups = getContinuationVar('extragroups');\n\tif(! $err && ! array_key_exists($return['groupid'], $groups) &&\n\t ! array_key_exists($return['groupid'], $extragroups) &&\n\t $return['groupid'] != 0) {\n\t\t$errmsg = i(\"The submitted user group is invalid.\");\n\t\t$err = 1;\n\t}\n\tif(! $err && $return['groupid'] == 0)\n\t\t$return['groupid'] = 'NULL';\n\tif(! $err && ($return['seats'] < MIN_BLOCK_MACHINES || $return['seats'] > MAX_BLOCK_MACHINES)) {\n\t\t$errmsg = sprintf(i(\"The submitted number of seats must be between %d and %d.\"), MIN_BLOCK_MACHINES, MAX_BLOCK_MACHINES);\n\t\t$err = 1;\n\t}\n\tif(! $err) {\n\t\t$imgdata = getImages(0, $return['imageid']);\n\t\t$concur = $imgdata[$return['imageid']]['maxconcurrent'];\n\t\tif(! is_null($concur) && $concur != 0 && $return['seats'] > $concur) {\n\t\t\t$errmsg = sprintf(i(\"The selected image can only have %d concurrent reservations. Please reduce the number of requested seats to %d or less.\"), $concur, $concur);\n\t\t\t$err = 1;\n\t\t}\n\t}\n\t$dooverride = 0;\n\t# check user group access to image\n\tif(($method == 'new' || $method == 'edit') && ! $err && ! $override) {\n\t\t$groupresources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"),\n\t\t array(\"available\"), 0, 0, 0,\n\t\t $return['groupid']);\n\t\tif(! array_key_exists($return['imageid'], $groupresources['image'])) {\n\t\t\t$dooverride = 1;\n\t\t\t$errmsg = i(\"WARNING - The selected user group does not currently have access to the selected environment. You can submit the Block Allocation again to ignore this warning.\");\n\t\t\t$err = 1;\n\t\t}\n\t}\n\tif(! $err && $type != 'weekly' && $type != 'monthly' && $type != 'list') {\n\t\t$errmsg = i(\"You must select one of \\\"Repeating Weekly\\\", \\\"Repeating Monthly\\\", or \\\"List of Dates/Times\\\".\");\n\t\t$err = 1;\n\t}\n\tif(! $err) {\n\t\tif($type == 'list') {\n\t\t\t$slots = processInputVar('slots', ARG_STRING);\n\t\t\tif(! preg_match('/^(\\d{8}\\|\\d{2}:\\d{2}\\|\\d{2}:\\d{2})(,(\\d{8}\\|\\d{2}:\\d{2}\\|\\d{2}:\\d{2}))*$/', $slots)) {\n\t\t\t\t$errmsg = i(\"Invalid time slot submitted.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t\t$return['times'] = array();\n\t\t\tif(! $err) {\n\t\t\t\t$return['slots'] = explode(',', $slots);\n\t\t\t\t$lastdate = array('day' => '', 'ts' => 0);\n\t\t\t\tforeach($return['slots'] as $slot) {\n\t\t\t\t\t$tmp = explode('|', $slot);\n\t\t\t\t\tif(count($tmp) != 3) {\n\t\t\t\t\t\t$errmsg = i(\"Invalid date/time submitted.\");\n\t\t\t\t\t\t$err = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$date = $tmp[0];\n\t\t\t\t\tif(! $err) {\n\t\t\t\t\t\t$datets = strtotime($date);\n\t\t\t\t\t\tif($method != 'edit' && $datets < (time() - SECINDAY)) {\n\t\t\t\t\t\t\t$errmsg = i(\"The date must be today or later.\");\n\t\t\t\t\t\t\t$err = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$return['times'][] = \"{$tmp[1]}|{$tmp[2]}\";\n\t\t\t\t\tif($datets > $lastdate['ts']) {\n\t\t\t\t\t\t$lastdate['ts'] = $datets;\n\t\t\t\t\t\t$lastdate['day'] = $date;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(! $err) {\n\t\t\t\t\t$expirets = strtotime(\"{$lastdate['day']} 23:59:59\");\n\t\t\t\t\t$return['expiretime'] = unixToDatetime($expirets);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($type == 'weekly' || $type == 'monthly') {\n\t\t\t$return['startdate'] = processInputVar('startdate', ARG_NUMERIC);\n\t\t\t$return['enddate'] = processInputVar('enddate', ARG_NUMERIC);\n\t\t\t$times = processInputVar('times', ARG_STRING);\n\n\t\t\t$return['startts'] = strtotime($return['startdate']);\n\t\t\t$return['endts'] = strtotime($return['enddate']);\n\t\t\tif($return['startts'] > $return['endts']) {\n\t\t\t\t$errmsg = i(\"The Last Date of Usage must be the same or later than the First Date of Usage.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t\telseif($method != 'edit' && $return['startts'] < (time() - SECINDAY)) {\n\t\t\t\t$errmsg = i(\"The start date must be today or later.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t\t$expirets = strtotime(\"{$return['enddate']} 23:59:59\");\n\t\t\t$return['expiretime'] = unixToDatetime($expirets);\n\t\t\t$return['times'] = explode(',', $times);\n\t\t}\n\t\tforeach($return['times'] as $time) {\n\t\t\t$tmp = explode('|', $time);\n\t\t\tif(count($tmp) != 2) {\n\t\t\t\t$errmsg = i(\"Invalid start/end time submitted\");\n\t\t\t\t$err = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$start = explode(':', $tmp[0]);\n\t\t\tif(count($start) != 2 || ! is_numeric($start[0]) || ! is_numeric($start[1]) ||\n\t\t\t $start[0] < 0 || $start[0] > 23 || $start[1] < 0 || $start[1] > 59) {\n\t\t\t\t$errmsg = i(\"Invalid start time submitted\");\n\t\t\t\t$err = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$end = explode(':', $tmp[1]);\n\t\t\tif(count($end) != 2 || ! is_numeric($end[0]) || ! is_numeric($end[1]) ||\n\t\t\t $end[0] < 0 || $end[0] > 23 || $end[1] < 0 || $end[1] > 59) {\n\t\t\t\t$errmsg = i(\"Invalid end time submitted\");\n\t\t\t\t$err = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$start = minuteOfDay($start[0], $start[1]);\n\t\t\t$end = minuteOfDay($end[0], $end[1]);\n\t\t\tif($start >= $end) {\n\t\t\t\t$errmsg = i(\"Each start time must be less than the corresponding end time.\");\n\t\t\t\t$err = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($type == 'weekly') {\n\t\t\t$validdays = 0;\n\t\t\t$errmsg = '';\n\t\t\tfor($day = $return['startts'], $i = 0;\n\t\t\t $i < 7, $day < ($return['endts'] + SECINDAY); \n\t\t\t $i++, $day += SECINDAY) {\n\t\t\t\t$daynum = date('w', $day);\n\t\t\t\t$validdays |= (1 << $daynum);\n\t\t\t}\n\t\t\t$days = processInputVar('days', ARG_STRING);\n\t\t\t$dayscheck = processInputVar('days', ARG_NUMERIC);\n\t\t\tif($days == '' && $dayscheck == '0')\n\t\t\t\t$days = 0;\n\t\t\t$return['daymask'] = 0;\n\t\t\tif(! $err) {\n\t\t\t\tforeach(explode(',', $days) as $day) {\n\t\t\t\t\tif($day == '' || $day < 0 || $day > 6) {\n\t\t\t\t\t\t$errmsg = i(\"Invalid day submitted.\");\n\t\t\t\t\t\t$err = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$return['daymask'] |= (1 << $day);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(! $err && ($return['daymask'] & $validdays) == 0) {\n\t\t\t\t$errmsg = i(\"No valid days submitted for the specified date range.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t}\n\t\tif($type == 'monthly') {\n\t\t\t$return['weeknum'] = processInputVar('weeknum', ARG_NUMERIC);\n\t\t\t$return['day'] = processInputVar('day', ARG_NUMERIC);\n\t\t\tif(! $err && ($return['weeknum'] < 1 || $return['weeknum'] > 5)) {\n\t\t\t\t$errmsg = i(\"Invalid week number submitted.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t\tif(! $err && ($return['day'] < 1 || $return['day'] > 7)) {\n\t\t\t\t$errmsg = i(\"Invalid day of week submitted.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t\t$times = getMonthlyBlockTimes('', $return['startts'], $return['endts'],\n\t\t\t $return['day'], $return['weeknum'], $return['times']);\n\t\t\tif(! $err && empty($times)) {\n\t\t\t\t$errmsg = i(\"Specified day of month not found in date range.\");\n\t\t\t\t$err = 1;\n\t\t\t}\n\t\t}\n\t}\n\tif($method == 'request') {\n\t\t$return['comments'] = processInputVar('comments', ARG_STRING);\n\t\tif(get_magic_quotes_gpc())\n\t\t\t$return['comments'] = stripslashes($return['comments']);\n\t\tif(! $err && preg_match('/[<>]/', $return['comments'])) {\n\t\t\t$errmsg = i(\"<>\\'s are not allowed in the comments.\");\n\t\t\t$err = 1;\n\t\t}\n\t}\n\tif($err) {\n\t\tprint \"clearHideConfirmForm();\";\n\t\tprint \"alert('$errmsg');\";\n\t\t$data = array('extragroups' => $extragroups,\n\t\t 'method' => $method);\n\t\tif($method == 'edit')\n\t\t\t$data['blockid'] = getContinuationVar('blockid');\n\t\t$cont = addContinuationsEntry('AJblockAllocationSubmit', $data, SECINWEEK, 1, 0);\n\t\tprint \"dojo.byId('submitcont').value = '$cont';\";\n\t\tif($dooverride) {\n\t\t\t$data['override'] = 1;\n\t\t\t$cont = addContinuationsEntry('AJblockAllocationSubmit', $data, SECINWEEK, 1, 0);\n\t\t\tprint \"dojo.byId('submitcont2').value = '$cont';\";\n\t\t}\n\t\telse\n\t\t\tprint \"dojo.byId('submitcont2').value = '';\";\n\t}\n\t$return['type'] = $type;\n\t$return['err'] = $err;\n\treturn $return;\n}",
"function XMLRPCautoCapture($requestid) {\n\tglobal $user, $xmlrpcBlockAPIUsers;\n\tif(! in_array($user['id'], $xmlrpcBlockAPIUsers)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 47,\n\t\t 'errormsg' => 'access denied to XMLRPCautoCapture');\n\t}\n\t$query = \"SELECT id FROM request WHERE id = $requestid\";\n\t$qh = doQuery($query, 101);\n\tif(! mysqli_num_rows($qh)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 52,\n\t\t 'errormsg' => 'specified request does not exist');\n\t}\n\t$reqData = getRequestInfo($requestid);\n\t# check state of reservation\n\tif($reqData['stateid'] != 14 || $reqData['laststateid'] != 8) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 51,\n\t\t 'errormsg' => 'reservation not in valid state');\n\t}\n\t# check that not a cluster reservation\n\tif(count($reqData['reservations']) > 1) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 48,\n\t\t 'errormsg' => 'cannot image a cluster reservation');\n\t}\n\trequire_once(\".ht-inc/image.php\");\n\t$imageid = $reqData['reservations'][0]['imageid'];\n\t$imageData = getImages(0, $imageid);\n\t$captime = unixToDatetime(time());\n\t$comments = \"start: {$reqData['start']}<br>\"\n\t . \"end: {$reqData['end']}<br>\"\n\t . \"computer: {$reqData['reservations'][0]['reservedIP']}<br>\"\n\t . \"capture time: $captime\";\n\t# create new revision if requestor is owner and not a kickstart image\n\tif($imageData[$imageid]['installtype'] != 'kickstart' &&\n\t $reqData['userid'] == $imageData[$imageid]['ownerid']) {\n\t\t$rc = Image::AJupdateImage($requestid, $reqData['userid'], $comments, 1);\n\t\tif($rc == 0) {\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 49,\n\t\t\t 'errormsg' => 'error encountered while attempting to create new revision');\n\t\t}\n\t}\n\t# create a new image if requestor is not owner or a kickstart image\n\telse {\n\t\t$ownerdata = getUserInfo($reqData['userid'], 1, 1);\n\t\t$desc = \"This is an autocaptured image.<br>\"\n\t\t . \"captured from image: {$reqData['reservations'][0]['prettyimage']}<br>\"\n\t\t . \"captured on: $captime<br>\"\n\t\t . \"owner: {$ownerdata['unityid']}@{$ownerdata['affiliation']}<br>\";\n\t\t$connectmethods = getImageConnectMethods($imageid, $reqData['reservations'][0]['imagerevisionid']);\n\t\t$data = array('requestid' => $requestid,\n\t\t 'desc' => $desc,\n\t\t 'usage' => '',\n\t\t 'owner' => \"{$ownerdata['unityid']}@{$ownerdata['affiliation']}\",\n\t\t 'name' => \"Autocaptured ({$ownerdata['unityid']} - $requestid)\",\n\t\t 'ram' => 64,\n\t\t 'cores' => 1,\n\t\t 'cpuspeed' => 500,\n\t\t 'networkspeed' => 10,\n\t\t 'concurrent' => '',\n\t\t 'checkuser' => 1,\n\t\t 'rootaccess' => 1,\n\t\t 'checkout' => 1,\n\t\t 'sysprep' => 1,\n\t\t 'basedoffrevisionid' => $reqData['reservations'][0]['imagerevisionid'],\n\t\t 'platformid' => $imageData[$imageid]['platformid'],\n\t\t 'osid' => $imageData[$imageid][\"osid\"],\n\t\t 'ostype' => $imageData[$imageid][\"ostype\"],\n\t\t 'sethostname' => $imageData[$imageid][\"sethostname\"],\n\t\t 'reload' => 20,\n\t\t 'comments' => $comments,\n\t\t 'connectmethodids' => implode(',', array_keys($connectmethods)),\n\t\t 'adauthenabled' => $imageData[$imageid]['adauthenabled'],\n\t\t 'autocaptured' => 1);\n\t\tif($data['adauthenabled']) {\n\t\t\t$data['addomainid'] = $imageData[$imageid]['addomainid'];\n\t\t\t$data['baseou'] = $imageData[$imageid]['baseOU'];\n\t\t}\n\t\t$obj = new Image();\n\t\t$imageid = $obj->addResource($data);\n\t\tif($imageid == 0) {\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 50,\n\t\t\t 'errormsg' => 'error encountered while attempting to create image');\n\t\t}\n\n\t\t$query = \"UPDATE request rq, \"\n\t\t . \"reservation rs \"\n\t\t . \"SET rs.imageid = $imageid, \"\n\t\t . \"rs.imagerevisionid = {$obj->imagerevisionid}, \"\n\t\t . \"rq.stateid = 16 \"\n\t\t . \"WHERE rq.id = $requestid AND \"\n\t\t . \"rq.id = rs.requestid\";\n\t\tdoQuery($query);\n\t}\n\treturn array('status' => 'success');\n}",
"function XMLRPCaddRequest($imageid, $start, $length, $foruser='',\n $nousercheck=0) {\n\tglobal $user;\n\t$imageid = processInputData($imageid, ARG_NUMERIC);\n\t$start = processInputData($start, ARG_STRING, 1);\n\t$length = processInputData($length, ARG_NUMERIC);\n\t#$foruser = processInputData($foruser, ARG_STRING, 1);\n\n\t// make sure user didn't submit a request for an image he\n\t// doesn't have access to\n\t$resources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"));\n\t$validImageids = array_keys($resources['image']);\n\tif(! in_array($imageid, $validImageids)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 3,\n\t\t 'errormsg' => \"access denied to $imageid\");\n\t}\n\n\t# validate $start\n\tif($start != 'now' && ! is_numeric($start)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 4,\n\t\t 'errormsg' => \"received invalid input for start\");\n\t}\n\n\t# validate $length\n\t$maxtimes = getUserMaxTimes();\n\tif($maxtimes['initial'] < $length) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 6,\n\t\t 'errormsg' => \"max allowed initial length is {$maxtimes['initial']} minutes\");\n\t}\n\n\t$nowfuture = 'future';\n\tif($start == 'now') {\n\t\t$start = time();\n\t\t$nowfuture = 'now';\n\t}\n\telse\n\t\tif($start < (time() - 30))\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 5,\n\t\t\t 'errormsg' => \"start time is in the past\");\n\t$start = unixFloor15($start);\n\t$end = $start + $length * 60;\n\tif($end % (15 * 60))\n\t\t$end = unixFloor15($end) + (15 * 60);\n\n\t$max = getMaxOverlap($user['id']);\n\tif(checkOverlap($start, $end, $max)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 7,\n\t\t 'errormsg' => \"reservation overlaps with another one you \"\n\t\t . \"have, and you are allowed $max \"\n\t\t . \"overlapping reservations at a time\");\n\t}\n\n\tif($nousercheck == 1) {\n\t\t$groupid = getUserGroupID('Allow No User Check', 1);\n\t\t$members = getUserGroupMembers($groupid);\n\t\tif(! array_key_exists($user['id'], $members))\n\t\t\t$nousercheck = 0;\n\t}\n\telse\n\t\t$nousercheck = 0;\n\n\t$images = getImages();\n\t$revisionid = getProductionRevisionid($imageid);\n\t$rc = isAvailable($images, $imageid, $revisionid, $start, $end, 1);\n\tif($rc < 1) {\n\t\taddLogEntry($nowfuture, unixToDatetime($start),\n\t\t unixToDatetime($end), 0, $imageid);\n\t\treturn array('status' => 'notavailable');\n\t}\n\t$return['requestid']= addRequest(0, array(), (1 - $nousercheck));\n\t$return['status'] = 'success';\n\treturn $return;\n}",
"function AJacceptBlockAllocationSubmit() {\n\tglobal $mysqli_link_vcl, $user;\n\t$blockid = getContinuationVar('blockid');\n\t$comments = getContinuationVar('comments');\n\t$validemail = getContinuationVar('validemail');\n\t$emailuser = getContinuationVar('emailuser');\n\t$imageid = getContinuationVar('imageid');\n\t$setusergroup = getContinuationVar('setusergroup');\n\tif($setusergroup)\n\t\t$usergroupid = processInputVar('groupid', ARG_NUMERIC);\n\t$name = processInputVar('brname', ARG_STRING);\n\t$emailtext = processInputVar('emailtext', ARG_STRING);\n\t$override = getContinuationVar('override', 0);\n\n\t$err = 0;\n\tif(! preg_match('/^([-a-zA-Z0-9\\. ]){3,80}$/', $name)) {\n\t $errmsg = i(\"The name can only contain letters, numbers, spaces, dashes(-), and periods(.) and can be from 3 to 80 characters long\");\n\t\t$err = 1;\n\t}\n\tif($validemail) {\n\t\tif(get_magic_quotes_gpc())\n\t\t\t$emailtext = stripslashes($emailtext);\n\t\tif(! $err && preg_match('/[<>|]/', $emailtext)) {\n\t\t\t$errmsg = i(\"<>\\'s and pipes (|) are not allowed in the email text.\");\n\t\t\t$err = 1;\n\t\t}\n\t\tif(! $err && ! preg_match('/[A-Za-z]{2,}/', $emailtext)) {\n\t\t\t$errmsg = i(\"Something must be filled in for the email text.\");\n\t\t\t$err = 1;\n\t\t}\n\t}\n\t$groups = getUserGroups(0, $user['affiliationid']);\n\tif(! $err && $setusergroup && ! array_key_exists($usergroupid, $groups)) {\n\t\t$errmsg = i(\"Invalid user group submitted.\");\n\t\t$err = 1;\n\t}\n\t$managementnodes = getManagementNodes('future');\n\tif(! $err && empty($managementnodes)) {\n\t\t$errmsg = i(\"Error encountered while trying to create block allocation:\") . \"\\\\n\\\\n\";\n\t\t$errmsg .= i(\"No active management nodes were found. Please try accepting the block allocation at a later time.\");\n\t\t$err = 1;\n\t}\n\t$dooverride = 0;\n\tif(! $err && ! $override && $setusergroup) {\n\t\t$groupresources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"),\n\t\t array(\"available\"), 0, 0, 0,\n\t\t $usergroupid);\n\t\tif(! array_key_exists($imageid, $groupresources['image'])) {\n\t\t\t$errmsg = i(\"Warning: The selected user group does not currently have access to the requested image. You can accept the Block Allocation again to ignore this warning.\");\n\t\t\t$err = 1;\n\t\t\t$dooverride = 1;\n\t\t}\n\t}\n\t$mnid = array_rand($managementnodes);\n\tif(! $err) {\n\t\t# update values for block allocation\n\t\tif($validemail)\n\t\t\t$esccomments = vcl_mysql_escape_string(\"COMMENTS: $comments|EMAIL: $emailtext\");\n\t\telse\n\t\t\t$esccomments = vcl_mysql_escape_string(\"COMMENTS: $comments|USER NOT EMAILED\");\n\t\t$query = \"UPDATE blockRequest \"\n\t\t\t\t . \"SET name = '$name', \";\n\t\tif($setusergroup)\n\t\t\t$query .= \"groupid = $usergroupid, \";\n\t\t$query .= \"status = 'accepted', \"\n\t\t\t . \"comments = '$esccomments', \"\n\t\t\t . \"managementnodeid = '$mnid' \"\n\t\t . \"WHERE id = $blockid\";\n\t\tdoQuery($query, 101);\n\t\tif(! mysqli_affected_rows($mysqli_link_vcl)) {\n\t\t\t$errmsg = i(\"Error encountered while updating status of block allocation.\");\n\t\t\t$err = 1;\n\t\t}\n\t\telse {\n\t\t\t$repeating = getContinuationVar('repeating');\n\t\t\tif($repeating == 'weekly') {\n\t\t\t\t$startts = getContinuationVar('startts');\n\t\t\t\t$endts = getContinuationVar('endts');\n\t\t\t\t$daymask = getContinuationVar('daymask');\n\t\t\t\t$times = getContinuationVar('times');\n\t\t\t\tcreateWeeklyBlockTimes($blockid, $startts, $endts, $daymask, $times);\n\t\t\t}\n\t\t\telseif($repeating == 'monthly') {\n\t\t\t\t$startts = getContinuationVar('startts');\n\t\t\t\t$endts = getContinuationVar('endts');\n\t\t\t\t$day = getContinuationVar('day');\n\t\t\t\t$weeknum = getContinuationVar('weeknum');\n\t\t\t\t$times = getContinuationVar('times');\n\t\t\t\tcreateMonthlyBlockTimes($blockid, $startts, $endts, $day, $weeknum, $times);\n\t\t\t}\n\t\t\telseif($repeating == 'list') {\n\t\t\t\t$slots = getContinuationVar('slots');\n\t\t\t\tcreateListBlockData($blockid, $slots, 'accept');\n\t\t\t}\n\t\t}\n\t}\n\tif($err) {\n\t\tprint \"alert('$errmsg');\";\n\t\t$cdata = getContinuationVar();\n\t\t$cont = addContinuationsEntry('AJacceptBlockAllocationSubmit', $cdata, SECINDAY, 1, 0);\n\t\tprint \"dojo.byId('submitacceptcont').value = '$cont';\";\n\t\tif($dooverride) {\n\t\t\t$cdata['override'] = 1;\n\t\t\t$cont = addContinuationsEntry('AJacceptBlockAllocationSubmit', $cdata, SECINDAY, 1, 0);\n\t\t\tprint \"dojo.byId('submitacceptcont2').value = '$cont';\";\n\t\t}\n\t\telse\n\t\t\tprint \"dojo.byId('submitacceptcont2').value = '';\";\n\t\tprint \"document.body.style.cursor = 'default';\";\n\t\treturn;\n\t}\n\n\t# send accept email to requestor\n\t$message = $emailtext . \"\\n\\nVCL Admins\";\n\t$mailParams = \"-f\" . HELPEMAIL;\n\tmail($emailuser, i(\"VCL Block Allocation Accepted\"), $message, '', $mailParams);\n\n\tprint \"clearHideConfirmAccept();\";\n\n\t$html = getPendingBlockHTML(1);\n\t$html = str_replace(\"\\n\", '', $html);\n\t$html = str_replace(\"'\", \"\\'\", $html);\n\t$html = preg_replace(\"/>\\s*</\", \"><\", $html);\n\tprint setAttribute('pendinglist', 'innerHTML', $html);\n\tprint \"AJdojoCreate('pendinglist');\";\n\n\t$html = getCurrentBlockHTML(1);\n\t$html = str_replace(\"\\n\", '', $html);\n\t$html = str_replace(\"'\", \"\\'\", $html);\n\t$html = preg_replace(\"/>\\s*</\", \"><\", $html);\n\tprint setAttribute('blocklist', 'innerHTML', $html);\n\tprint \"AJdojoCreate('blocklist');\";\n}",
"function viewBlockStatus() {\n\t$blockid = getContinuationVar('id');\n\tprint \"<H2>\" . i(\"Block Allocation\") . \"</H2>\\n\";\n\t$data = getBlockAllocationStatus($blockid);\n\tif(is_null($data)) {\n\t\tprint i(\"The selected Block Allocation no longer exists.\");\n\t\treturn;\n\t}\n\t$startunix = datetimeToUnix($data['start']);\n\t$endunix = datetimeToUnix($data['end']);\n\t$start = strftime('%x %l:%M %P %Z', $startunix);\n\t$end = strftime('%x %l:%M %P %Z', $endunix);\n\tprint \"<div id=statusdiv>\\n\";\n\tprint \"<table class=blockStatusData summary=\\\"lists attributes of block allocation\\\">\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Name\") . \":</th>\\n\";\n\tprint \" <td>{$data['name']}</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Environment\") . \":</th>\\n\";\n\tprint \" <td>{$data['image']}</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Resources\") . \":</th>\\n\";\n\tif($data['subimages'])\n\t\tprint \" <td>{$data['numMachines']} clusters</td>\\n\";\n\telse\n\t\tprint \" <td>{$data['numMachines']} computers</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Starting\") . \":</th>\\n\";\n\tprint \" <td>$start</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Ending\") . \":</th>\\n\";\n\tprint \" <td>$end</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \"</table><br>\\n\";\n\tif(! $data['subimages']) {\n\t\t$available = 0;\n\t\t$reloading = 0;\n\t\t$used = 0;\n\t\tforeach($data['comps'] as $id => $comp) {\n\t\t\tif($comp['state'] == 'available')\n\t\t\t\t$available++;\n\t\t\telseif($comp['state'] == 'reloading')\n\t\t\t\t$reloading++;\n\t\t\telseif($comp['state'] == 'reserved' ||\n\t\t\t $comp['state'] == 'inuse')\n\t\t\t\t$used++;\n\t\t}\n\t\t$failed = $data['numMachines'] - $available - $reloading - $used;\n\t\tprint i(\"Current status of computers\") . \":<br>\\n\";\n\t}\n\telse {\n\t\t$imgdata = getImages(0, $data['imageid']);\n\t\t$imageids = $imgdata[$data['imageid']]['subimages'];\n\t\tarray_unshift($imageids, $data['imageid']);\n\t\t$imgavailable = array();\n\t\t$imgreloading = array();\n\t\t$imgused = array();\n\t\t$imgfailed = array();\n\t\tforeach($imageids AS $id) {\n\t\t\t$imgavailable[$id] = 0;\n\t\t\t$imgreloading[$id] = 0;\n\t\t\t$imgused[$id] = 0;\n\t\t\t$imgfailed[$id] = 0;\n\t\t}\n\t\tforeach($data['comps'] as $id => $comp) {\n\t\t\tif($comp['state'] == 'available')\n\t\t\t\t$imgavailable[$comp['designatedimageid']]++;\n\t\t\telseif($comp['state'] == 'reloading')\n\t\t\t\t$imgreloading[$comp['designatedimageid']]++;\n\t\t\telseif($comp['state'] == 'reserved' ||\n\t\t\t $comp['state'] == 'inuse')\n\t\t\t\t$imgused[$comp['designatedimageid']]++;\n\t\t}\n\t\t$failed = 0;\n\t\t$available = $data['numMachines'];\n\t\t$used = $imgused[$data['imageid']];\n\t\tforeach($imageids AS $id) {\n\t\t\t$imgfailed[$id] = $data['numMachines'] - $imgavailable[$id] - $imgreloading[$id] - $used;\n\t\t\tif($failed < $imgfailed[$id])\n\t\t\t\t$failed = $imgfailed[$id];\n\t\t\tif($available > $imgavailable[$id])\n\t\t\t\t$available = $imgavailable[$id];\n\t\t}\n\t\t$reloading = $data['numMachines'] - $available - $used - $failed;\n\t\tprint i(\"Current status of clusters:\") . \"<br>\\n\";\n\t}\n\tprint \"<table class=blockStatusData summary=\\\"lists status of block allocation\\\">\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th><font color=green>\" . i(\"Available\") . \":</th>\\n\";\n\tprint \" <td id=available>$available</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th>\" . i(\"Reloading\") . \":</th>\\n\";\n\tprint \" <td id=reloading>$reloading</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th nowrap><font color=#e58304>\" . i(\"Reserved/In use\") . \":</th>\\n\";\n\tprint \" <td id=used>$used</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \" <tr>\\n\";\n\tprint \" <th><font color=red>\" . i(\"Failed\") . \":</th>\\n\";\n\tprint \" <td id=failed>$failed</td>\\n\";\n\tprint \" </tr>\\n\";\n\tprint \"</table>\\n\";\n\tprint \"</div>\\n\";\n\t$cont = addContinuationsEntry('AJupdateBlockStatus', array('id' => $blockid));\n\tprint \"<input type=hidden id=updatecont value=\\\"$cont\\\">\\n\";\n}",
"function blockAllocations() {\n\tglobal $user;\n\tif(! checkUserHasPerm('Manage Block Allocations (global)') &&\n\t ! checkUserHasPerm('Manage Block Allocations (affiliation only)')) {\n\t\tprint \"<H2>\" . i(\"Block Allocations\") . \"</H2>\\n\";\n\t\tprint i(\"Block Allocations are a way to have a set of machines preloaded with a particular environment at specified times and made available to a specific group of users. This is very useful for classroom use and for workshops. They can be made available on a repeating schedule such as when a course meets each week. Block Allocations only allocate machines for the group of users - they do not create the actual, end user reservations for the machines. All users still must log in to the VCL web site and make their own reservations DURING the period a block allocation is active. The forms here provide a way for you to submit a request for a Block Allocation for review by a sysadmin. If you just need to use a machine through VCL, use the New Reservation page for that.\");\n\t\tprint \"<br><br>\";\n\t\tprint i(\"Please submit Block Allocation requests at least one full business day in advance to allow time for them to be approved.\") . \"<br><br>\\n\";\n\t\tprint \"<button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t\tprint i( \"Request New Block Allocation\") . \"\\n\";\n\t\tprint \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t\tprint \" location.href = '\" . BASEURL . SCRIPT . \"?mode=requestBlockAllocation';\\n\";\n\t\tprint \" </script>\\n\";\n\t\tprint \"</button>\\n\";\n\t\tprint getUserCurrentBlockHTML();\n\t}\n\telse {\n\t\tprint \"<h2>\" . i(\"Manage Block Allocations\") . \"</h2>\\n\";\n\t\t$cont = addContinuationsEntry('viewBlockAllocatedMachines');\n\t\tprint \"<a href=\\\"\" . BASEURL . SCRIPT . \"?continuation=$cont\\\">\";\n\t\tprint i(\"View Block Allocated Machines\") . \"</a>\\n\";\n\t\tprint \"<div id=\\\"blocklist\\\">\\n\";\n\t\tprint getCurrentBlockHTML();\n\t\tprint \"</div>\\n\";\n\t\tprint \"<button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t\tprint \" \" . i(\"Create New Block Allocation\") . \"\\n\";\n\t\tprint \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t\t$cont = addContinuationsEntry('newBlockAllocation');\n\t\tprint \" location.href = '\" . BASEURL . SCRIPT . \"?continuation=$cont';\\n\";\n\t\tprint \" </script>\\n\";\n\t\tprint \"</button>\\n\";\n\t\tprint \"<h2>\" . i(\"Block Allocation Requests\") . \"</h2>\\n\";\n\t\tprint \"<div id=\\\"pendinglist\\\">\\n\";\n\t\tprint getPendingBlockHTML();\n\t\tprint \"</div>\\n\";\n\t}\n\t$blockids = getBlockAllocationIDs($user);\n\tif(! count($blockids))\n\t\treturn;\n\t$inids = implode(',', $blockids);\n\t$query = \"SELECT id, \"\n\t . \"name \"\n\t . \"FROM blockRequest \"\n\t . \"WHERE id in ($inids) AND \"\n\t . \"status = 'accepted'\";\n\t$qh = doQuery($query, 101);\n\twhile($row = mysqli_fetch_assoc($qh))\n\t\t$blocks[$row['id']] = $row['name'];\n\tprint \"<hr>\\n\";\n\tprint \"<h2>\" . i(\"Your Active Block Allocations\") . \"</h2>\\n\";\n\tprint i(\"You are currently a member of the following Block Allocations.\") . \"<br>\\n\";\n\tprint i(\"Click an item to view its current status.\") . \"<br>\\n\";\n\tforeach($blocks as $id => $name) {\n\t\t$cont = addContinuationsEntry('viewBlockStatus', array('id' => $id));\n\t\tprint \"<a href=\\\"\" . BASEURL . SCRIPT . \"?continuation=$cont\\\">\";\n\t\tprint \"$name</a><br>\\n\";\n\t}\n}",
"function getBlockAllocationData($blockid) {\n\tglobal $days;\n\t$rt = array('name' => '',\n\t 'imageid' => '',\n\t 'seats' => MIN_BLOCK_MACHINES,\n\t 'ownerid' => '',\n\t 'owner' => '',\n\t 'usergroupid' => '',\n\t 'repeating' => '',\n\t 'swdate' => '',\n\t 'ewdate' => '',\n\t 'wdayschecked' => array(),\n\t 'smdate' => '',\n\t 'emdate' => '',\n\t 'mnweeknumid' => '',\n\t 'mndayid' => '');\n\tforeach($days as $day)\n\t\t$rt['wdayschecked'][$day] = '';\n\t$rt['type'] = array('weekly' => 'checked',\n\t 'monthly' => '',\n\t 'list' => '');\n\t$rt['type2'] = array('weekly' => 'selected',\n\t 'monthly' => '',\n\t 'list' => '');\n\tif(empty($blockid))\n\t\treturn $rt;\n\t$query = \"SELECT b.name, \"\n\t . \"b.imageid, \"\n\t . \"b.numMachines AS seats, \"\n\t . \"b.ownerid, \"\n\t . \"CONCAT(u.unityid, '@', a.name) AS owner, \"\n\t . \"b.groupid AS usergroupid, \"\n\t . \"b.repeating, \"\n\t . \"d.start AS swdate, \"\n\t . \"d.end AS ewdate, \"\n\t . \"d.start AS smdate, \"\n\t . \"d.end AS emdate, \"\n\t . \"d.days AS mndayid, \"\n\t . \"d.weeknum AS mnweeknumid \"\n\t . \"FROM blockWebDate d, \"\n\t . \"blockRequest b \"\n\t . \"LEFT JOIN user u ON (b.ownerid = u.id) \"\n\t . \"LEFT JOIN affiliation a ON (u.affiliationid = a.id) \"\n\t . \"WHERE b.id = d.blockRequestid AND \"\n\t . \"b.id = $blockid\";\n\t$qh = doQuery($query, 101);\n\t$row = mysqli_fetch_assoc($qh);\n\tif(empty($row))\n\t\treturn $rt;\n\t$row['wdayschecked'] = $rt['wdayschecked'];\n\tif($row['repeating'] == 'weekly') {\n\t\t$row['smdate'] = '';\n\t\t$row['emdate'] = '';\n\t\tfor($i = 0; $i < 7; $i++) {\n\t\t\tif($row['mndayid'] & (1 << $i))\n\t\t\t\t$row['wdayschecked'][$days[$i]] = 'checked';\n\t\t}\n\t\t$row['type'] = $rt['type'];\n\t\t$row['type2'] = $rt['type2'];\n\t}\n\telseif($row['repeating'] == 'monthly') {\n\t\t$row['swdate'] = '';\n\t\t$row['ewdate'] = '';\n\t\t$row['type'] = array('weekly' => '',\n\t\t 'monthly' => 'checked',\n\t\t 'list' => '');\n\t\t$row['type2'] = array('weekly' => '',\n\t\t 'monthly' => 'selected',\n\t\t 'list' => '');\n\t}\n\telseif($row['repeating'] == 'list') {\n\t\t$row['smdate'] = '';\n\t\t$row['emdate'] = '';\n\t\t$row['swdate'] = '';\n\t\t$row['ewdate'] = '';\n\t\t$row['type'] = array('weekly' => '',\n\t\t 'monthly' => '',\n\t\t 'list' => 'checked');\n\t\t$row['type2'] = array('weekly' => '',\n\t\t 'monthly' => '',\n\t\t 'list' => 'selected');\n\t}\n\treturn $row;\n}",
"function XMLRPCdeployServer($imageid, $start, $end, $admingroup='',\n $logingroup='', $ipaddr='', $macaddr='',\n $monitored=0, $foruser='', $name='',\n $userdata='') {\n\tglobal $user, $remoteIP;\n\tif(! in_array(\"serverCheckOut\", $user[\"privileges\"])) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 60,\n\t\t 'errormsg' => \"access denied to deploy server\");\n\t}\n\t$imageid = processInputData($imageid, ARG_NUMERIC);\n\t$resources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"));\n\t$images = removeNoCheckout($resources[\"image\"]);\n\t#$extraimages = getServerProfileImages($user['id']);\n\tif(! array_key_exists($imageid, $images) /*&&\n\t\t! array_key_exists($imageid, $extraimages)*/) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 3,\n\t\t 'errormsg' => \"access denied to $imageid\");\n\t}\n\tif($admingroup != '') {\n\t\t$admingroup = processInputData($admingroup, ARG_STRING);\n\t\tif(get_magic_quotes_gpc())\n\t\t\t$admingroup = stripslashes($admingroup);\n\t\tif(preg_match('/@/', $admingroup)) {\n\t\t\t$tmp = explode('@', $admingroup);\n\t\t\t$escadmingroup = vcl_mysql_escape_string($tmp[0]);\n\t\t\t$affilid = getAffiliationID($tmp[1]);\n\t\t\tif(is_null($affilid)) {\n\t\t\t\treturn array('status' => 'error',\n\t\t\t\t 'errorcode' => 51,\n\t\t\t\t 'errormsg' => \"unknown affiliation for admin user group: {$tmp[1]}\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$escadmingroup = vcl_mysql_escape_string($admingroup);\n\t\t\t$affilid = DEFAULT_AFFILID;\n\t\t}\n\t\t$admingroupid = getUserGroupID($escadmingroup, $affilid, 1);\n\t\tif(is_null($admingroupid)) {\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 52,\n\t\t\t 'errormsg' => \"unknown admin user group: $admingroup\");\n\t\t}\n\t}\n\telse\n\t\t$admingroupid = '';\n\tif($logingroup != '') {\n\t\t$logingroup = processInputData($logingroup, ARG_STRING);\n\t\tif(get_magic_quotes_gpc())\n\t\t\t$logingroup = stripslashes($logingroup);\n\t\tif(preg_match('/@/', $logingroup)) {\n\t\t\t$tmp = explode('@', $logingroup);\n\t\t\t$esclogingroup = vcl_mysql_escape_string($tmp[0]);\n\t\t\t$affilid = getAffiliationID($tmp[1]);\n\t\t\tif(is_null($affilid)) {\n\t\t\t\treturn array('status' => 'error',\n\t\t\t\t 'errorcode' => 54,\n\t\t\t\t 'errormsg' => \"unknown affiliation for login user group: {$tmp[1]}\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$esclogingroup = vcl_mysql_escape_string($logingroup);\n\t\t\t$affilid = DEFAULT_AFFILID;\n\t\t}\n\t\t$logingroupid = getUserGroupID($esclogingroup, $affilid, 1);\n\t\tif(is_null($logingroupid)) {\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 55,\n\t\t\t 'errormsg' => \"unknown login user group: $logingroup\");\n\t\t}\n\t}\n\telse\n\t\t$logingroupid = '';\n\t$ipaddr = processInputData($ipaddr, ARG_STRING);\n\t$ipaddrArr = explode('.', $ipaddr);\n\tif($ipaddr != '' && (! preg_match('/^(([0-9]){1,3}\\.){3}([0-9]){1,3}$/', $ipaddr) ||\n\t\t$ipaddrArr[0] < 1 || $ipaddrArr[0] > 255 ||\n\t\t$ipaddrArr[1] < 0 || $ipaddrArr[1] > 255 ||\n\t\t$ipaddrArr[2] < 0 || $ipaddrArr[2] > 255 ||\n\t\t$ipaddrArr[3] < 0 || $ipaddrArr[3] > 255)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 57,\n\t\t 'errormsg' => \"Invalid IP address. Must be w.x.y.z with each of \"\n\t\t . \"w, x, y, and z being between 1 and 255 (inclusive)\");\n\t}\n\t$macaddr = processInputData($macaddr, ARG_STRING);\n\tif($macaddr != '' && ! preg_match('/^(([A-Fa-f0-9]){2}:){5}([A-Fa-f0-9]){2}$/', $macaddr)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 58,\n\t\t 'errormsg' => \"Invalid MAC address. Must be XX:XX:XX:XX:XX:XX \"\n\t\t . \"with each pair of XX being from 00 to FF (inclusive)\");\n\t}\n\t$monitored = processInputData($monitored, ARG_NUMERIC);\n\tif($monitored != 0 && $monitored != 1)\n\t\t$monitored = 0;\n\t$start = processInputData($start, ARG_STRING, 1);\n\t$end = processInputData($end, ARG_STRING, 1);\n\t#$foruser = processInputData($foruser, ARG_STRING, 1);\n\n\t$name = processInputData($name, ARG_STRING);\n\tif(get_magic_quotes_gpc())\n\t\t$name = stripslashes($name);\n\tif(! preg_match('/^([-a-zA-Z0-9_\\. ]){0,255}$/', $name)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 58,\n\t\t\t\t\t\t 'errormsg' => \"Invalid name. Can only contain letters, numbers, \"\n\t\t . \"spaces, dashes(-), underscores(_), and periods(.) \"\n\t\t . \"and be up to 255 characters long\");\n\t}\n\t$name = vcl_mysql_escape_string($name);\n\n\t# validate $start\n\tif($start != 'now' && ! is_numeric($start)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 4,\n\t\t 'errormsg' => \"received invalid input for start\");\n\t}\n\t# validate $end\n\tif($end != 'indefinite' && ! is_numeric($end)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 59,\n\t\t 'errormsg' => \"received invalid input for end\");\n\t}\n\n\t$nowfuture = 'future';\n\tif($start == 'now') {\n\t\t$start = unixFloor15(time());\n\t\t$nowfuture = 'now';\n\t}\n\telse\n\t\tif($start < (time() - 30))\n\t\t\treturn array('status' => 'error',\n\t\t\t 'errorcode' => 5,\n\t\t\t 'errormsg' => \"start time is in the past\");\n\tif($end == 'indefinite')\n\t\t$end = datetimeToUnix(\"2038-01-01 00:00:00\");\n\telseif($end % (15 * 60))\n\t\t$end = unixFloor15($end) + (15 * 60);\n\telseif($end < ($start + 900))\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 88,\n\t\t 'errormsg' => \"end time must be at least 15 minutes after start time\");\n\n\t$max = getMaxOverlap($user['id']);\n\tif(checkOverlap($start, $end, $max)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 7,\n\t\t 'errormsg' => \"reservation overlaps with another one you \"\n\t\t . \"have, and you are allowed $max \"\n\t\t . \"overlapping reservations at a time\");\n\t}\n\n\t$images = getImages();\n\t$revisionid = getProductionRevisionid($imageid);\n\t$rc = isAvailable($images, $imageid, $revisionid, $start, $end,\n\t 1, 0, 0, 0, 0, $ipaddr, $macaddr);\n\tif($rc < 1) {\n\t\taddLogEntry($nowfuture, unixToDatetime($start),\n\t\t unixToDatetime($end), 0, $imageid);\n\t\treturn array('status' => 'notavailable');\n\t}\n\t$return['requestid']= addRequest();\n\t$query = \"UPDATE reservation \"\n\t . \"SET remoteIP = '$remoteIP' \"\n\t . \"WHERE requestid = {$return['requestid']}\";\n\tdoQuery($query);\n\tif($userdata != '') {\n\t\tif(get_magic_quotes_gpc())\n\t\t\t$userdata = stripslashes($userdata);\n\t\t$esc_userdata = vcl_mysql_escape_string($userdata);\n\t\t$query = \"INSERT INTO variable \"\n\t\t . \"(name, \"\n\t\t . \"serialization, \"\n\t\t . \"value, \"\n\t\t . \"setby, \"\n\t\t . \"timestamp) \"\n\t\t . \"SELECT CONCAT('userdata|', id), \"\n\t\t . \"'none', \"\n\t\t . \"'$esc_userdata', \"\n\t\t . \"'webcode', \"\n\t\t . \"NOW() \"\n\t\t . \"FROM reservation \"\n\t\t . \"WHERE requestid = {$return['requestid']}\";\n\t\tdoQuery($query);\n\t}\n\t$fields = array('requestid');\n\t$values = array($return['requestid']);\n\tif($name != '') {\n\t\t$fields[] = 'name';\n\t\t$values[] = \"'$name'\";\n\t}\n\tif($ipaddr != '') {\n\t\t$fields[] = 'fixedIP';\n\t\t$values[] = \"'$ipaddr'\";\n\t}\n\tif($macaddr != '') {\n\t\t$fields[] = 'fixedMAC';\n\t\t$values[] = \"'$macaddr'\";\n\t}\n\tif($admingroupid != 0) {\n\t\t$fields[] = 'admingroupid';\n\t\t$values[] = $admingroupid;\n\t}\n\tif($logingroupid != 0) {\n\t\t$fields[] = 'logingroupid';\n\t\t$values[] = $logingroupid;\n\t}\n\tif($monitored != 0) {\n\t\t$fields[] = 'monitored';\n\t\t$values[] = 1;\n\t}\n\t$allfields = implode(',', $fields);\n\t$allvalues = implode(',', $values);\n\t$query = \"INSERT INTO serverrequest ($allfields) VALUES ($allvalues)\";\n\tdoQuery($query, 101);\n\t$return['status'] = 'success';\n\treturn $return;\n}",
"function AJacceptBlockAllocationConfirm() {\n\tglobal $days;\n\t$data = getContinuationVar();\n\tif($data['repeating'] == 'weekly') {\n\t\t$rt = array('image' => $data['image'],\n\t\t 'seats' => $data['numMachines'],\n\t\t 'usergroup' => $data['group'],\n\t\t 'repeating' => $data['repeating'],\n\t\t 'startdate' => $data['swdate'],\n\t\t 'lastdate' => $data['ewdate'],\n\t\t 'days' => $data['wdays']);\n\t\t$rt['times'] = array();\n\t\tforeach(array_keys($data['swhour']) as $key) {\n\t\t\t$rt['times'][] = sprintf(\"%d:%02d %s - %d:%02d %s\", $data['swhour'][$key],\n\t\t\t $data['swminute'][$key], $data['swmeridian'][$key],\n\t\t\t $data['ewhour'][$key], $data['ewminute'][$key],\n\t\t\t $data['ewmeridian'][$key]);\n\t\t}\n\t\t$rt['email'] = sprintf(i(\"The VCL Block Allocation you requested for %d seats of %s repeating on a weekly schedule has been accepted.\"), $data['numMachines'], $data['image']);\n\t}\n\telseif($data['repeating'] == 'monthly') {\n\t\t$rt = array('image' => $data['image'],\n\t\t 'seats' => $data['numMachines'],\n\t\t 'usergroup' => $data['group'],\n\t\t 'repeating' => $data['repeating'],\n\t\t 'startdate' => $data['smdate'],\n\t\t 'lastdate' => $data['emdate']);\n\t\t$weeknumArr = array(1 => i(\"1st\"),\n\t\t 2 => i(\"2nd\"),\n\t\t 3 => i(\"3rd\"),\n\t\t 4 => i(\"4th\"),\n\t\t 5 => i(\"5th\"));\n\t\t$rt['date1'] = \"{$weeknumArr[$data['weeknum']]} {$days[($data['day'] - 1)]}\";\n\t\t$rt['times'] = array();\n\t\tforeach(array_keys($data['smhour']) as $key) {\n\t\t\t$rt['times'][] = sprintf(\"%d:%02d %s - %d:%02d %s\", $data['smhour'][$key],\n\t\t\t $data['smminute'][$key], $data['smmeridian'][$key],\n\t\t\t $data['emhour'][$key], $data['emminute'][$key],\n\t\t\t $data['emmeridian'][$key]);\n\t\t}\n\t\t$rt['email'] = sprintf(i(\"The VCL Block Allocation you requested for %d seats of %s repeating on a monthly schedule has been accepted.\"), $data['numMachines'], $data['image']);\n\t}\n\telseif($data['repeating'] == 'list') {\n\t\t$rt = array('image' => $data['image'],\n\t\t 'seats' => $data['numMachines'],\n\t\t 'usergroup' => $data['group'],\n\t\t 'repeating' => $data['repeating']);\n\t\t$slots = array();\n\t\tforeach($data['date'] as $key => $val) {\n\t\t\t$slots[] = sprintf(\"%s %d:%02d %s - %d:%02d %s\", $val, $data['slhour'][$key],\n\t\t\t $data['slminute'][$key], $data['slmeridian'][$key],\n\t\t\t $data['elhour'][$key], $data['elminute'][$key],\n\t\t\t\t\t\t\t\t\t $data['elmeridian'][$key]);\n\t\t}\n\t\t$rt['slots'] = $slots;\n\t\t$rt['email'] = sprintf(i(\"The VCL Block Allocation you requested for %d seats of %s during the following time periods has been accepted:\") . \"\\n\" . implode(\"\\n\", $slots) . \"\\n\", $data['numMachines'], $data['image']);\n\t}\n\t$rt['comments'] = preg_replace(\"/\\n/\", \"<br>\", $data['comments']);\n\tif($rt['comments'] == '')\n\t\t$rt['comments'] = '(none)';\n\t$rt['validemail'] = 1;\n\tif(! empty($data['firstname']) && ! empty($data['lastname']) && ! empty($data['email']))\n\t\t$rt['emailuser'] = \"{$data['firstname']} {$data['lastname']} ({$data['email']})\";\n\telseif(! empty($data['email']))\n\t\t$rt['emailuser'] = \"{$data['email']}\";\n\telse\n\t\t$rt['validemail'] = 0;\n\tif(! is_null($rt['usergroup'])) {\n\t\t$groupresources = getUserResources(array(\"imageAdmin\", \"imageCheckOut\"),\n\t\t array(\"available\"), 0, 0, 0,\n\t\t $data['usergroupid']);\n\t\tif(! array_key_exists($data['imageid'], $groupresources['image']))\n\t\t\t$rt['warnmsg'] = i(\"Warning: The requested user group does not currently have access to the requested image.\");\n\t}\n\t$cdata = array('blockid' => $data['id'],\n\t 'imageid' => $data['imageid']);\n\tif(empty($data['group']))\n\t\t$cdata['setusergroup'] = 1;\n\telse\n\t\t$cdata['setusergroup'] = 0;\n\t$cdata['validemail'] = $rt['validemail'];\n\t$cdata['emailuser'] = $data['email'];\n\t$cdata['repeating'] = $data['repeating'];\n\t$cdata['comments'] = $data['comments'];\n\tif($data['repeating'] == 'weekly') {\n\t\t$cdata['startts'] = $data['startts'];\n\t\t$cdata['endts'] = $data['endts'];\n\t\t$cdata['daymask'] = $data['days'];\n\t\t$cdata['times'] = $data['times'];\n\t}\n\telseif($data['repeating'] == 'monthly') {\n\t\t$cdata['startts'] = $data['startts'];\n\t\t$cdata['endts'] = $data['endts'];\n\t\t$cdata['day'] = $data['day'];\n\t\t$cdata['weeknum'] = $data['weeknum'];\n\t\t$cdata['times'] = $data['times'];\n\t}\n\telseif($data['repeating'] == 'list') {\n\t\t$cdata['slots'] = $data['slots'];\n\t}\n\t$cont = addContinuationsEntry('AJacceptBlockAllocationSubmit', $cdata, SECINDAY, 1, 0);\n\t$rt['cont'] = $cont;\n\tsendJSON($rt);\n}",
"function getUserCurrentBlockHTML($listonly=0) {\n\tglobal $user, $days;\n\t$query = \"SELECT b.id, \"\n\t . \"b.name AS blockname, \"\n\t . \"b.ownerid, \"\n\t . \"CONCAT(u.unityid, '@', ua.name) AS owner, \"\n\t . \"i.prettyname AS image, \"\n\t . \"b.numMachines AS machinecnt, \"\n\t . \"CONCAT(g.name, '@', a.name) AS `group`, \"\n\t . \"b.repeating AS available, \"\n\t . \"b.status \"\n\t . \"FROM image i, \"\n\t . \"blockRequest b \"\n\t . \"LEFT JOIN user u ON (b.ownerid = u.id) \"\n\t . \"LEFT JOIN affiliation ua ON (u.affiliationid = ua.id) \"\n\t . \"LEFT JOIN usergroup g ON (b.groupid = g.id) \"\n\t . \"LEFT JOIN affiliation a ON (g.affiliationid = a.id) \"\n\t . \"WHERE b.ownerid = {$user['id']} AND \"\n\t . \"b.imageid = i.id AND \"\n\t . \"b.status IN ('accepted', 'requested') \"\n\t . \"ORDER BY b.name\";\n\t$qh = doQuery($query, 101);\n\t$blocks = array();\n\twhile($row = mysqli_fetch_assoc($qh))\n\t\t$blocks[$row['id']] = $row;\n\tif(empty($blocks))\n\t\treturn;\n\n\tforeach($blocks as $id => $request) {\n\t\tif($blocks[$id]['group'] == '')\n\t\t\t$blocks[$id]['group'] = i('(unspecified)');\n\t\tif($request['available'] == 'weekly') {\n\t\t\t$query = \"SELECT DATE_FORMAT(start, '%m/%d/%y') AS swdate, \"\n\t\t\t . \"DATE_FORMAT(end, '%m/%d/%y')AS ewdate, \" \n\t\t\t . \"days \"\n\t\t\t . \"FROM blockWebDate \"\n\t\t\t . \"WHERE blockRequestid = $id\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\tif(! $row = mysqli_fetch_assoc($qh))\n\t\t\t\tabort(101);\n\t\t\t$blocks[$id] = array_merge($request, $row);\n\t\t\t$wdays = array();\n\t\t\tfor($i = 0; $i < 7; $i++) {\n\t\t\t\tif($row['days'] & (1 << $i))\n\t\t\t\t\tarray_push($wdays, $days[$i]);\n\t\t\t}\n\t\t\tunset($blocks[$id]['days']);\n\t\t\t$blocks[$id]['wdays'] = $wdays;\n\t\t\t$query = \"SELECT starthour, \"\n\t\t\t . \"startminute, \"\n\t\t\t . \"startmeridian, \"\n\t\t\t . \"endhour, \"\n\t\t\t . \"endminute, \"\n\t\t\t . \"endmeridian, \"\n\t\t\t . \"`order` \"\n\t\t\t . \"FROM blockWebTime \"\n\t\t\t . \"WHERE blockRequestid = {$request['id']} \"\n\t\t\t . \"ORDER BY startmeridian, starthour, startminute\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\t$blocks[$id]['swhour'][$row['order']] = $row['starthour'];\n\t\t\t\t$blocks[$id]['swminute'][$row['order']] = $row['startminute'];\n\t\t\t\t$blocks[$id]['swmeridian'][$row['order']] = $row['startmeridian'];\n\t\t\t\t$blocks[$id]['ewhour'][$row['order']] = $row['endhour'];\n\t\t\t\t$blocks[$id]['ewminute'][$row['order']] = $row['endminute'];\n\t\t\t\t$blocks[$id]['ewmeridian'][$row['order']] = $row['endmeridian'];\n\t\t\t}\n\t\t}\n\t\telseif($request['available'] == 'monthly') {\n\t\t\t$query = \"SELECT DATE_FORMAT(start, '%m/%d/%y') AS smdate, \"\n\t\t\t . \"DATE_FORMAT(end, '%m/%d/%y')AS emdate, \" \n\t\t\t . \"days AS day, \"\n\t\t\t . \"weeknum \"\n\t\t\t . \"FROM blockWebDate \"\n\t\t\t . \"WHERE blockRequestid = $id\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\tif(! $row = mysqli_fetch_assoc($qh))\n\t\t\t\tabort(101);\n\t\t\t$blocks[$id] = array_merge($request, $row);\n\t\t\t$query = \"SELECT starthour, \"\n\t\t\t . \"startminute, \"\n\t\t\t . \"startmeridian, \"\n\t\t\t . \"endhour, \"\n\t\t\t . \"endminute, \"\n\t\t\t . \"endmeridian, \"\n\t\t\t . \"`order` \"\n\t\t\t . \"FROM blockWebTime \"\n\t\t\t . \"WHERE blockRequestid = {$request['id']} \"\n\t\t\t . \"ORDER BY startmeridian, starthour, startminute\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\t$blocks[$id]['smhour'][$row['order']] = $row['starthour'];\n\t\t\t\t$blocks[$id]['smminute'][$row['order']] = $row['startminute'];\n\t\t\t\t$blocks[$id]['smmeridian'][$row['order']] = $row['startmeridian'];\n\t\t\t\t$blocks[$id]['emhour'][$row['order']] = $row['endhour'];\n\t\t\t\t$blocks[$id]['emminute'][$row['order']] = $row['endminute'];\n\t\t\t\t$blocks[$id]['emmeridian'][$row['order']] = $row['endmeridian'];\n\t\t\t}\n\t\t}\n\t\telseif($request['available'] == 'list') {\n\t\t\t$query = \"SELECT DATE_FORMAT(start, '%m/%d/%y') AS date, \"\n\t\t\t . \"days AS `order` \"\n\t\t\t . \"FROM blockWebDate \"\n\t\t\t . \"WHERE blockRequestid = $id \"\n\t\t\t . \"ORDER BY start\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\tif($row['date'] == '00/00/00')\n\t\t\t\t\t$blocks[$id]['date'][$row['order']] = '';\n\t\t\t\telse\n\t\t\t\t\t$blocks[$id]['date'][$row['order']] = $row['date'];\n\t\t\t}\n\t\t\t$query = \"SELECT starthour, \"\n\t\t\t . \"startminute, \"\n\t\t\t . \"startmeridian, \"\n\t\t\t . \"endhour, \"\n\t\t\t . \"endminute, \"\n\t\t\t . \"endmeridian, \"\n\t\t\t . \"`order` \"\n\t\t\t . \"FROM blockWebTime \"\n\t\t\t . \"WHERE blockRequestid = {$request['id']}\";\n\t\t\t$qh = doQuery($query, 101);\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\t$blocks[$id]['slhour'][$row['order']] = $row['starthour'];\n\t\t\t\t$blocks[$id]['slminute'][$row['order']] = $row['startminute'];\n\t\t\t\t$blocks[$id]['slmeridian'][$row['order']] = $row['startmeridian'];\n\t\t\t\t$blocks[$id]['elhour'][$row['order']] = $row['endhour'];\n\t\t\t\t$blocks[$id]['elminute'][$row['order']] = $row['endminute'];\n\t\t\t\t$blocks[$id]['elmeridian'][$row['order']] = $row['endmeridian'];\n\t\t\t}\n\t\t}\n\t}\n\t$rt = '';\n\t$rt .= \"<h2>\" . i(\"Manage Block Allocations\") . \"</h2>\\n\";\n\t$rt .= \"<div id=\\\"blocklist\\\">\\n\";\n\t$rt .= \"<table summary=\\\"lists current block allocations\\\">\\n\";\n\t$rt .= \" <TR align=center>\\n\";\n\t$rt .= \" <TD colspan=2></TD>\\n\";\n\t$rt .= \" <TH>\" . i(\"Name\") . \"</TH>\\n\";\n\t$rt .= \" <TH>\" . i(\"Environment\") . \"</TH>\\n\";\n\t$rt .= \" <TH>\" . i(\"Reserved<br>Machines\") . \"</TH>\\n\";\n\t$rt .= \" <TH>\" . i(\"Reserved<br>For\") . \"</TH>\\n\";\n\t$rt .= \" <TH>\" . i(\"Repeating\") . \"</TH>\\n\";\n\t$rt .= \" </TR>\\n\";\n\tforeach($blocks as $block) {\n\t\t$rt .= \" <TR align=center>\\n\";\n\t\t$rt .= \" <TD>\\n\";\n\t\t$rt .= \" <button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t\t$rt .= i( \"View\") . \"\\n\";\n\t\t$rt .= \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t\t$cont = addContinuationsEntry('AJviewBlockAllocation', $block, SECINDAY);\n\t\t$rt .= \" viewBlockAllocation('$cont');\\n\";\n\t\t$rt .= \" </script>\\n\";\n\t\t$rt .= \" </button>\\n\";\n\t\t$rt .= \" </TD>\\n\";\n\t\t$rt .= \" <TD>\\n\";\n\t\tif($block['status'] == 'accepted') {\n\t\t\t$rt .= \" <button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t\t\t$rt .= i( \"View Times\") . \"\\n\";\n\t\t\t$rt .= \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t\t\t$cont = addContinuationsEntry('AJviewBlockAllocationTimes', array('blockid' => $block['id']), SECINDAY);\n\t\t\t$rt .= \" viewBlockTimes('$cont');\\n\";\n\t\t\t$rt .= \" </script>\\n\";\n\t\t\t$rt .= \" </button>\\n\";\n\t\t}\n\t\t$rt .= \" </TD>\\n\";\n\t\t$rt .= \" <TD>{$block['blockname']}</TD>\\n\";\n\t\t$rt .= \" <TD>{$block['image']}</TD>\\n\";\n\t\t$rt .= \" <TD>{$block['machinecnt']}</TD>\\n\";\n\t\t$rt .= \" <TD>{$block['group']}</TD>\\n\";\n\t\t$rt .= \" <TD>\" . i($block['available']) . \"</TD>\\n\";\n\t\t$rt .= \" </TR>\\n\";\n\t}\n\t$rt .= \"</table>\\n\";\n\t$rt .= \"</div>\\n\";\n\tif($listonly)\n\t\treturn $rt;\n\n\t$rt .= \"<div id=\\\"viewDialog\\\" dojoType=\\\"dijit.Dialog\\\" title=\\\"\";\n\t$rt .= i(\"Block Allocation\") . \"\\\">\\n\";\n\t$rt .= \"<table summary=\\\"\\\">\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"Name\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confname\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"Owner\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confowner\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"Environment\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confimage\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"User group\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confgroup\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"Seats\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confseats\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr>\\n\";\n\t$rt .= \" <th align=\\\"right\\\">\" . i(\"Repeating\") . \":</th>\\n\";\n\t$rt .= \" <td><span id=\\\"confrepeat\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr valign=\\\"top\\\">\\n\";\n\t$rt .= \" <th align=\\\"right\\\"><span id=\\\"conftitle1\\\"></span></th>\\n\";\n\t$rt .= \" <td><span id=\\\"confvalue1\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr valign=\\\"top\\\">\\n\";\n\t$rt .= \" <th align=\\\"right\\\"><span id=\\\"conftitle2\\\"></span></th>\\n\";\n\t$rt .= \" <td><span id=\\\"confvalue2\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr valign=\\\"top\\\">\\n\";\n\t$rt .= \" <th align=\\\"right\\\"><span id=\\\"conftitle3\\\"></span></th>\\n\";\n\t$rt .= \" <td><span id=\\\"confvalue3\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \" <tr valign=\\\"top\\\">\\n\";\n\t$rt .= \" <th align=\\\"right\\\"><span id=\\\"conftitle4\\\"></span></th>\\n\";\n\t$rt .= \" <td><span id=\\\"confvalue4\\\"></span></td>\\n\";\n\t$rt .= \" </tr>\\n\";\n\t$rt .= \"</table>\\n\";\n\t$rt .= \"<div align=\\\"center\\\">\\n\";\n\t$rt .= \"<button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t$rt .= i( \"Close\") . \"\\n\";\n\t$rt .= \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t$rt .= \" clearHideView();\\n\";\n\t$rt .= \" </script>\\n\";\n\t$rt .= \"</button>\\n\";\n\t$rt .= \"</div>\\n\";\n\t$rt .= \"</div>\\n\"; # confirm dialog\n\n\t$rt .= \"<div id=\\\"viewtimesDialog\\\" dojoType=\\\"dijit.Dialog\\\" title=\\\"\";\n\t$rt .= i(\"Block Allocation Times\") . \"\\\">\\n\";\n\t$rt .= \"<h2>\" . i(\"Block Allocation Times\") . \"</h2>\\n\";\n\t$rt .= \"<table dojoType=\\\"dojox.grid.DataGrid\\\" jsId=\\\"blockTimesGrid\\\" sortInfo=1 \";\n\t$rt .= \"style=\\\"width: 328px; height: 200px;\\\">\\n\";\n\t$rt .= \"<script type=\\\"dojo/method\\\" event=\\\"onStyleRow\\\" args=\\\"row\\\">\\n\";\n\t$rt .= \"blockTimeRowStyle(row);\\n\";\n\t$rt .= \"</script>\\n\";\n\t$rt .= \"<thead>\\n\";\n\t$rt .= \"<tr>\\n\";\n\t$rt .= \"<th field=\\\"start\\\" width=\\\"70px\\\" formatter=\\\"blockTimesGridDate\\\">\";\n\t$rt .= i(\"Date\") . \"</th>\\n\";\n\t$rt .= \"<th field=\\\"start\\\" width=\\\"85px\\\" formatter=\\\"blockTimesGridStart\\\">\";\n\t$rt .= i(\"Start\") . \"</th>\\n\";\n\t$rt .= \"<th field=\\\"end\\\" width=\\\"85px\\\" formatter=\\\"blockTimesGridEnd\\\">\";\n\t$rt .= i(\"End\") . \"</th>\\n\";\n\t$rt .= \"<th field=\\\"delbtn\\\" width=\\\"60px\\\">\" . i(\"Skip\") . \"</th>\\n\";\n\t$rt .= \"</tr>\\n\";\n\t$rt .= \"</thead>\\n\";\n\t$rt .= \"</table>\\n\";\n\t$rt .= \"<div align=\\\"center\\\">\\n\";\n\t$rt .= \"<button dojoType=\\\"dijit.form.Button\\\" type=\\\"button\\\">\\n\";\n\t$rt .= i( \"Close\") . \"\\n\";\n\t$rt .= \" <script type=\\\"dojo/method\\\" event=\\\"onClick\\\">\\n\";\n\t$rt .= \" dijit.byId('viewtimesDialog').hide();\\n\";\n\t$rt .= \" </script>\\n\";\n\t$rt .= \"</button>\\n\";\n\t$rt .= \"</div>\\n\";\n\t$rt .= \"<input type=hidden id=toggletimecont>\\n\";\n\t$rt .= \"</div>\\n\"; # times dialog\n\treturn $rt;\n}",
"function createblocks ($problem, $resources, $ismultitask, $isgrouped) {\n $blocksarray = array();\n for ($i = 0; $i < sizeof ($resources); $i++) {\n $resourcename = $resources[$i];\n $result = mysql_db_query (\"vishnu_prob_\" . $problem,\n \"select * from \" . (($isgrouped || $ismultitask) ? \"multitask\" : \"\") .\n \"assignments where resource_key = \\\"\" .\n $resourcename . \"\\\";\");\n\n $blocks = array();\n while ($value = mysql_fetch_array ($result)) {\n if ($isgrouped) {\n $cap_used = explode (\"*%*\", $value[\"capacities_used\"]);\n $cap = explode (\"*%*\", $value[\"capacities\"]); \n }\n $blocks[$value[\"setup_time\"]] =\n array (\"start_time\"=>$value[\"setup_time\"],\n \"end_time\"=>$value[\"wrapup_time\"],\n \"cap_used\"=>($isgrouped ? $cap_used[0] : 1),\n \"cap\"=>($isgrouped ? $cap[0] : 1));\n }\n mysql_free_result ($result);\n ksort ($blocks);\n $blocksarray[$resourcename] = $blocks;\n }\n ksort ($blocksarray);\n\n return $blocksarray;\n }",
"function makeblock($start_time, $end_time, $cap_used, $cap) {\n $a = array (\"start_time\"=>$start_time,\n\t \"end_time\"=>$end_time,\n\t \"cap_used\"=>$cap_used,\n\t \"cap\"=>$cap);\n\n return $a;\n }",
"function XMLRPCgetRequestConnectData($requestid, $remoteIP) {\n\tglobal $user;\n\t$requestid = processInputData($requestid, ARG_NUMERIC);\n\t$remoteIP = processInputData($remoteIP, ARG_STRING, 1);\n\tif(! preg_match('/^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/', $remoteIP, $matches) ||\n\t $matches[1] < 1 || $matches[1] > 223 ||\n\t $matches[2] > 255 ||\n\t $matches[3] > 255 ||\n\t $matches[4] > 255) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 2,\n\t\t 'errormsg' => 'invalid IP address');\n\t}\n\t$userRequests = getUserRequests('all', $user['id']);\n\t$found = 0;\n\tforeach($userRequests as $req) {\n\t\tif($req['id'] == $requestid) {\n\t\t\t$request = $req;\n\t\t\t$found = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(! $found)\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 1,\n\t\t 'errormsg' => 'unknown requestid');\n\n\t// FIXME - add support for cluster requests\n\tif(requestIsReady($request)) {\n\t\t$requestData = getRequestInfo($requestid);\n\t\t$query = \"UPDATE reservation \"\n\t\t . \"SET remoteIP = '$remoteIP' \"\n\t\t . \"WHERE requestid = $requestid\";\n\t\t$qh = doQuery($query, 101);\n\t\taddChangeLogEntry($requestData[\"logid\"], $remoteIP);\n\t\t$serverIP = $requestData[\"reservations\"][0][\"connectIP\"];\n\t\t$passwd = $requestData[\"reservations\"][0][\"password\"];\n\t\t$connectMethods = getImageConnectMethodTexts(\n\t\t $requestData[\"reservations\"][0][\"imageid\"],\n\t\t $requestData[\"reservations\"][0][\"imagerevisionid\"]);\n\t\tif(preg_match('/(.*)@(.*)/', $user['unityid'], $matches))\n\t\t\t$thisuser = $matches[1];\n\t\telse\n\t\t\t$thisuser = $user['unityid'];\n\t\t$natports = getNATports($requestData['reservations'][0]['reservationid']);\n\t\t$portdata = array();\n\t\tforeach($connectMethods as $key => $cm) {\n\t\t\t$connecttext = $cm[\"connecttext\"];\n\t\t\t$connecttext = preg_replace(\"/#userid#/\", $thisuser, $connecttext);\n\t\t\t$connecttext = preg_replace(\"/#password#/\", $passwd, $connecttext);\n\t\t\t$connecttext = preg_replace(\"/#connectIP#/\", $serverIP, $connecttext);\n\t\t\tforeach($cm['ports'] as $port) {\n\t\t\t\tif(! empty($natports) && array_key_exists($port['key'], $natports[$key])) {\n\t\t\t\t\t$connecttext = preg_replace(\"/{$port['key']}/\", $natports[$key][$port['key']]['publicport'], $connecttext);\n\t\t\t\t\t$connectMethods[$key]['connectports'][] = \"{$port['protocol']}:{$port['port']}:{$natports[$key][$port['key']]['publicport']}\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif((preg_match('/remote desktop/i', $cm['description']) ||\n\t\t\t\t\t preg_match('/RDP/i', $cm['description'])) &&\n\t\t\t\t\t $port['key'] == '#Port-TCP-3389#') {\n\t\t\t\t\t\t$connecttext = preg_replace(\"/{$port['key']}/\", $user['rdpport'], $connecttext);\n\t\t\t\t\t\t$connectMethods[$key]['connectports'][] = \"{$port['protocol']}:{$port['port']}:{$user['rdpport']}\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$connecttext = preg_replace(\"/{$port['key']}/\", $port['port'], $connecttext);\n\t\t\t\t\t\t$connectMethods[$key]['connectports'][] = \"{$port['protocol']}:{$port['port']}:{$port['port']}\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$connectMethods[$key][\"connecttext\"] = $connecttext;\n\t\t\t$portdata[$key] = $connectMethods[$key]['ports'];\n\t\t\tunset($connectMethods[$key]['ports']);\n\t\t}\n\t\t$tmp = array_keys($portdata);\n\t\t$cmid = $tmp[0];\n\t\tif(empty($natports))\n\t\t\tif((preg_match('/remote desktop/i', $connectMethods[$cmid]['description']) ||\n\t\t\t preg_match('/RDP/i', $connectMethods[$cmid]['description'])) &&\n\t\t\t\t$portdata[$cmid][0]['port'] == 3389)\n\t\t\t\t$connectport = $user['rdpport'];\n\t\t\telse\n\t\t\t\t$connectport = $portdata[$cmid][0]['port'];\n\t\telse {\n\t\t\t$key = $portdata[$cmid][0]['key'];\n\t\t\t$connectport = $natports[$cmid][$key]['publicport'];\n\t\t}\n\t\treturn array('status' => 'ready',\n\t\t 'serverIP' => $serverIP,\n\t\t 'user' => $thisuser,\n\t\t 'password' => $passwd,\n\t\t 'connectport' => $connectport,\n\t\t 'connectMethods' => $connectMethods);\n\t}\n\treturn array('status' => 'notready');\n}",
"abstract protected function _blockStart();",
"protected function _addVacationBlocks()\n {\n if (!$this->_validRule(Ingo_Storage::ACTION_VACATION)) {\n return;\n }\n\n $vacation = $this->_params['storage']\n ->retrieve(Ingo_Storage::ACTION_VACATION);\n $vacation_addr = $vacation->getVacationAddresses();\n if (!count($vacation_addr)) {\n return;\n }\n\n $vals = array(\n 'subject' => $vacation->getVacationSubject(),\n 'days' => $vacation->getVacationDays(),\n 'addresses' => $vacation_addr,\n 'start' => $vacation->getVacationStart(),\n 'start_year' => $vacation->getVacationStartYear(),\n 'start_month' => $vacation->getVacationStartMonth(),\n 'start_day' => $vacation->getVacationStartDay(),\n 'end' => $vacation->getVacationEnd(),\n 'end_year' => $vacation->getVacationEndYear(),\n 'end_month' => $vacation->getVacationEndMonth(),\n 'end_day' => $vacation->getVacationEndDay(),\n 'reason' => $vacation->getVacationReason(),\n );\n\n $action = $tests = array();\n $action[] = new Ingo_Script_Sieve_Action_Vacation($vals);\n\n if ($vacation->getVacationIgnorelist()) {\n $mime_headers = new Horde_Mime_Headers();\n $headers = $mime_headers->listHeaders();\n $headers['Mailing-List'] = null;\n foreach (array_keys($headers) as $h) {\n $tests[] = new Ingo_Script_Sieve_Test_Not(\n new Ingo_Script_Sieve_Test_Exists(array('headers' => $h))\n );\n }\n $vals = array('headers' => 'Precedence',\n 'match-type' => ':is',\n 'strings' => \"list\\nbulk\\njunk\",\n 'comparator' => 'i;ascii-casemap');\n $tmp = new Ingo_Script_Sieve_Test_Header($vals);\n $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);\n $vals = array('headers' => 'To',\n 'match-type' => ':matches',\n 'strings' => 'Multiple recipients of*',\n 'comparator' => 'i;ascii-casemap');\n $tmp = new Ingo_Script_Sieve_Test_Header($vals);\n $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);\n }\n\n $addrs = array();\n foreach ($vacation->getVacationExcludes() as $addr) {\n $addr = trim($addr);\n if (!empty($addr)) {\n $addrs[] = $addr;\n }\n }\n\n if ($addrs) {\n $tmp = new Ingo_Script_Sieve_Test_Address(array('headers' => \"From\\nSender\\nResent-From\", 'addresses' => implode(\"\\n\", $addrs)));\n $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);\n }\n\n $this->_addItem(Ingo::RULE_VACATION, new Ingo_Script_Sieve_Comment(_(\"Vacation\")));\n\n if ($tests) {\n $test = new Ingo_Script_Sieve_Test_Allof($tests);\n $if = new Ingo_Script_Sieve_If($test);\n $if->setActions($action);\n $this->_addItem(Ingo::RULE_VACATION, $if);\n } else {\n $this->_addItem(Ingo::RULE_VACATION, $action[0]);\n }\n }",
"private function processBlocklistAction(): void\n {\n $ip_address = \\filter_input(INPUT_POST, 'ip-address', FILTER_VALIDATE_IP);\n $duration_length = \\filter_input(INPUT_POST, 'duration-length', FILTER_VALIDATE_INT);\n $duration_unit = \\filter_input(INPUT_POST, 'duration-unit', FILTER_VALIDATE_INT);\n $scope_value = \\filter_input(INPUT_POST, 'scope', FILTER_VALIDATE_INT);\n $comment = \\strip_tags(\\filter_input(INPUT_POST, 'comment'));\n\n // Check whether input is formally valid.\n if (empty($ip_address) || empty($duration_length) || empty($duration_unit) || empty($scope_value)) {\n return;\n }\n\n $duration = $duration_length * $duration_unit;\n\n // Check whether input is semantically valid.\n if (($duration <= 0) || (($access_scope = Scope::tryFrom($scope_value)) === null)) {\n return;\n }\n\n if ($this->ib_manager->lock($ip_address, $duration, $access_scope, BanReason::MANUALLY_BLOCKED, $comment)) {\n AdminNotices::add(\n \\sprintf(__('IP address %s has been added to internal blocklist.', 'bc-security'), $ip_address),\n AdminNotices::SUCCESS\n );\n } else {\n AdminNotices::add(\n __('Failed to add IP address to internal blocklist.', 'bc-security'),\n AdminNotices::ERROR\n );\n }\n }",
"function XMLRPCaddUserGroup($name, $affiliation, $owner, $managingGroup,\n $initialMaxTime, $totalMaxTime, $maxExtendTime) {\n\tglobal $user;\n\tif(! in_array('groupAdmin', $user['privileges'])) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 16,\n\t\t 'errormsg' => 'access denied for managing user groups');\n\t}\n\t$validate = array('name' => $name,\n\t 'affiliation' => $affiliation,\n\t 'owner' => $owner,\n\t 'managingGroup' => $managingGroup,\n\t 'initialMaxTime' => $initialMaxTime,\n\t 'totalMaxTime' => $totalMaxTime,\n\t 'maxExtendTime' => $maxExtendTime);\n\t$rc = validateAPIgroupInput($validate, 0);\n\tif($rc['status'] == 'error')\n\t\treturn $rc;\n\t$data = array('type' => 'user',\n\t 'owner' => $owner,\n\t 'name' => $name,\n\t 'affiliationid' => $rc['affiliationid'],\n\t 'editgroupid' => $rc['managingGroupID'],\n\t 'initialmax' => $initialMaxTime,\n\t 'totalmax' => $totalMaxTime,\n\t 'maxextend' => $maxExtendTime,\n\t 'overlap' => 0);\n\tif(! addGroup($data)) {\n\t\treturn array('status' => 'error',\n\t\t 'errorcode' => 26,\n\t\t 'errormsg' => 'failure while adding group to database');\n\t}\n\treturn array('status' => 'success');\n}",
"function setQuotaUserBulk($blocks, $inodes, $savedfsblocksize, $savedvolumemountpoint, $blockval, $inodeval, $userid){\n\n $objResponse = new tinkerAjaxResponse();\n\n\t\t\tif ((intval($blocks) < 0) || !ctype_digit($blocks))\n\t\t\t\t$blocks = 0;\n\t\t\tif ((intval($inodes) < 0) || !ctype_digit($inodes))\n\t\t\t\t$inodes = 0;\n\n for ($j = 0; $j < count($userid); $j++){\n\t\t\tif(intval($blockval[$j]) != intval($blocks)){\n $objResponse->addScript(\"Fat.fade_element(\\\"ublocksvaltd\" . $userid[$j] . \"\\\")\");\n\t\t $objResponse->addScript(\"var elem = document.getElementById('ublocksvaltd\" .$userid[$j] . \"'); elem.removeChild(elem.childNodes.item(1));\");\n\n\t\t\t}\n\n\t\t\tif(intval($inodeval[$j]) != intval($inodes)){\n\t\t\t\t$objResponse->addScript(\"Fat.fade_element(\\\"uinodesvaltd\" . $userid[$j] . \"\\\")\");\n $objResponse->addScript(\"var elem = document.getElementById('uinodesvaltd\" .$userid[$j] . \"'); elem.removeChild(elem.childNodes.item(1));\");\n\n\t\t\t}\n\n\t\t$objResponse->addScript(\"document.userquotaform.check\". $userid[$j] . \".checked = false\");\n\n\t\texec(\"/usr/bin/sudo /usr/sbin/setquota -u \" . escapeshellarg($userid[$j]) . \" \" . escapeshellarg(intval(round($blocks * $savedfsblocksize))) . \" \" . escapeshellarg(intval(round($blocks * $savedfsblocksize))) . \" \" . escapeshellarg($inodes) . \" \" . escapeshellarg($inodes) . \" \" . escapeshellarg($savedvolumemountpoint));\n\n\t\t$objResponse->addAssign(\"ublocksval\".$userid[$j], \"innerHTML\", $blocks);\n\t\t$objResponse->addAssign(\"uinodesval\".$userid[$j], \"innerHTML\", $inodes);\n\t\t$objResponse->addAssign(\"ubval\".$userid[$j], \"value\", $blocks);\n $objResponse->addAssign(\"uival\".$userid[$j], \"value\", $inodes);\n\n\t\t$objResponse->addScript(\"s\" . $userid[$j] . \".setValue(parseInt($blocks))\");\n $objResponse->addScript(\"s2_\" . $userid[$j] . \".setValue(parseInt($inodes))\");\n\t\t$objResponse->addScript(\"disableButtons(document.getElementById('request\" . $userid[$j] . \"'), document.getElementById('reset\" . $userid[$j] . \"'))\");\n\t\t$objResponse->addScript(\"disableButton(document.getElementById('requestusers'));\");\n }\n return $objResponse->getXML();\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ handles image messages param $postObj: an xml object parsed from the post string param $conn: the mysql connection | function imageHandler($postObj,$conn)
{
$toUsername = $postObj->ToUserName;
$fromUsername = $postObj->FromUserName;
$createTime = $postObj-> CreateTime;
$msgType = $postObj-> MsgType;
$picUrl = $postObj-> PicUrl;
$mediaId = $postObj-> MediaId;
$msgId = $postObj-> MsgId;
//Now saving to database
$picUrl_mysqlescaped = mysqli_real_escape_string($conn, $picUrl);
$sql = "REPLACE INTO msg_incoming (ToUserName, FromUserName, CreateTime, MsgType,PicUrl,MediaId, MsgId) VALUES ('".$toUsername."','".$fromUsername."',".$createTime.",'".$msgType."','".$picUrl_mysqlescaped."','".$mediaId."',".$msgId.")";
$result = $conn->query($sql);
$time = time();
$textTpl = "<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[%s]]></MsgType>
<Content><![CDATA[%s]]></Content>
<FuncFlag>0</FuncFlag>
</xml>";
if (!empty($picUrl)) {
$msgType = "text";
$contentStr = "尺度君谢谢你的图图!:)";
$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
echo $resultStr;
} else {
echo "Input something...";
}
} | [
"private function bbImg(){\n if($this->img === TRUE OR $this->action === NULL){\n if($this->action === 'pre'){\n $match = array('#\\[img=(.*?)\\]\\[/img\\]#si',\n \t\t\t '#\\[img\\](.*?)\\[/img\\]#si');\n $replace = array('[img=$1:'.$this->uid.'][/img:'.$this->uid.']',\n \t\t\t\t '[img:'.$this->uid.']$1[/img:'.$this->uid.']');\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n }\n\n if($this->action === 'post' OR $this->action === NULL){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t \t '#\\[img=(.*?):'.$this->uid.'\\]\\[/img:'.$this->uid.'\\]#si');\n $replace = '<img src=\"$1\" />';\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n } \n\n if($this->action === 'reset'){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t\t '#\\[img=(.*?):'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si');\n \t\t\t \n $replace = array('[img]$1[/img]',\n \t\t\t\t '[img=$1]$2[/img]');\n\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n \n $this->str = str_replace('"', '', $this->str);\n } \n }\n }",
"private function bbImg(){\n\t\tif($this->img === TRUE OR $this->action === NULL){\n\t\t\tif($this->action === 'pre'){\n\t\t\t\t$match = '#\\[img\\](.*?)\\[\\/img\\]#si';\n\t\t\t\t$replace = '[img:'.$this->uid.']$1[/img:'.$this->uid.']';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t}\n\n\t\t\tif($this->action === 'post' OR $this->action === NULL){\n\t\t\t\t$match = '#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si';\n\t\t\t\t$replace = '<img src=\"$1\" />';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t} \n\t\t}\n\t}",
"function shortvideoHandler($postObj,$conn)\n {\n \t$toUsername = $postObj->ToUserName;\n $fromUsername = $postObj->FromUserName;\n $createTime = $postObj-> CreateTime;\n $msgType = $postObj-> MsgType;\n $thumbMediaId = $postObj-> ThumbMediaId;\n $mediaId = $postObj-> MediaId;\n $msgId = $postObj-> MsgId;\n \n //Now saving to database\n \n $sql = \"REPLACE INTO msg_incoming (ToUserName, FromUserName, CreateTime, MsgType,ThumbMediaId,MediaId, MsgId) VALUES ('\".$toUsername.\"','\".$fromUsername.\"',\".$createTime.\",'\".$msgType.\"','\".$thumbMediaId.\"','\".$mediaId.\"',\".$msgId.\")\";\n $result = $conn->query($sql);\n \n \n $time = time();\n $textTpl = \"<xml>\n\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t</xml>\";\n if (!empty($thumbMediaId)) {\n $msgType = \"text\";\n $contentStr = \"尺度君谢谢你的小视频!:)\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n }",
"public function upload_image($post=null, $files=null) {\r\n \t global $Database, $Settings;\r\n \r\n \t $upload_type = $Database->clean_data($post['type']);\r\n \t $file_name = $Database->clean_data($files['file']['name']);\r\n $file_size = (int)$files['file']['size'];\r\n $ext = $this->get_file_extension($file_name);\r\n \r\n if(!in_array($ext, $this->allowed_images_extensions)) return \"Image file extension is not supported\";\r\n if($file_size > $Settings->max_upload_size()) return \"File size must not be more than \".$Settings->gen_size_unit($Settings->max_upload_size());\r\n \r\n $new_name = $this->generate_file_name($ext);\r\n $tmp_name = $files['file']['tmp_name'];\r\n $file_error = $files['file']['error'];\r\n if(empty($tmp_name)) return \"No Temp Dir was set\";\r\n\r\n // Process images based on upload type: post, capture, events, etc\r\n \tswitch ($upload_type) {\r\n \t \tcase 'post':\r\n \t \t\t $post_id = (int)$Database->clean_data($post['post_id']);\r\n \t \t\t $column = (int)$Database->clean_data($post['column']);\r\n\r\n $dir = $this->get_dir(\"post\");\r\n if(!is_dir($dir)) mkdir($dir, 0755, true);\r\n $path = $dir.DS.$new_name;\r\n\r\n if(!$this->update_db_post_info($post_id, $column, $new_name)) return \"Oops!, error updating file in the database\";\r\n if(!move_uploaded_file($tmp_name, $path)) return \"Oops!, error uploading file\";\r\n return $this->upload_errors[$file_error];\r\n \t \t\t break;\r\n\r\n case \"capture\":\r\n $caption = $Database->clean_data($post['caption'], \"<a>\");\r\n $dir = $this->get_dir(\"capture\");\r\n if(!is_dir($dir)) mkdir($dir, 0755, true);\r\n $path = $dir.DS.$new_name;\r\n\r\n if(!$this->update_db_capture_info($new_name, $caption)) return \"Oops!, error saving file info into DB\";\r\n if(!move_uploaded_file($tmp_name, $path)) return \"Oops!, error uploading image file\";\r\n return $this->upload_errors[$file_error];\r\n break;\r\n\r\n case \"event\":\r\n $event_id = (int)$Database->clean_data($post['event_id']);\r\n $column = (int)$Database->clean_data($post['column']);\r\n\r\n \t \t $dir = $this->get_dir(\"event\");\r\n if(!is_dir($dir)) mkdir($dir, 0744, true);\r\n $path = $dir.DS.$new_name;\r\n \r\n if(!$this->update_db_event_info($event_id, $column, $new_name)) return \"Oops!, error updating file in the database\";\r\n if(!move_uploaded_file($tmp_name, $path)) return \"Oops!, error uploading file\";\r\n return $this->upload_errors[$file_error];\r\n break;\r\n \t \tdefault:\r\n \t return false;\r\n \t \t\tbreak;\r\n \t}\r\n }",
"function process(){\n if ( isset($this->data[1]) && $this->data[1] ){\n // We got the image from a plugin, it follows our api....\n $this->image = (object) $this->data[0];\n } else{\n // We got the image from wordpress gallery, fit it to our API\n $attachment_id = $this->data[0]->ID;\n $image = wp_get_attachment_image_src($attachment_id, 'wiziapp-iphone');\n $thumb = wp_get_attachment_image_src($attachment_id, 'wiziapp-thumbnail');\n $imageDetails = get_post($attachment_id);\n $caption = $imageDetails->post_excerpt;\n if ( empty($caption) ){\n $caption = str_replace('&', '&', $imageDetails->post_title);\n }\n $this->image = new wiziappImage($thumb[0],$image[0], $imageDetails->post_content,$attachment_id,$imageDetails->post_parent,$caption);\n } \n parent::process();\n }",
"public function ajax_get_img_object() {\n\t\t\tcheck_ajax_referer( 'photonfill_get_img_object', 'nonce' );\n\t\t\tif ( ! empty( $_POST['attachment'] ) ) {\n\t\t\t\t$attachment_id = absint( $_POST['attachment'] );\n\t\t\t\techo wp_kses_post( $this->get_attachment_image( $attachment_id, 'full', array(\n\t\t\t\t\t'style' => 'max-width:100%',\n\t\t\t\t) ) );\n\t\t\t}\n\t\t\texit();\n\t\t}",
"protected function processImage() {}",
"public function imagesAction() {\n if ($this->_isAjaxRequest) {\n $jsons = array();\n try {\n $request = $this->getRequest();\n $username = trim($request->getUserParam('username'));\n $post_id = (int) $request->getUserParam('post_id');\n\n $params = $request->getParams();\n $_from = (int) $params['from'];\n $_to = (int) $params['to'];\n\n // Получим сообщение\n $posts = Default_Model_DbTable_BlogPost::GetPosts($this->db, array('post_id' => array($post_id)));\n if ($posts) {\n $images = $posts[$post_id]->images;\n $images = array_values($images);\n $indexMax = count($images) - 1;\n\n // Создадим обьект шаблона\n $templater = Default_Plugin_SysBox::createViewSmarty();\n\n //Установим параметры шаблона\n $templater->images = $images;\n $templater->username = $username;\n $templater->_from = $_from;\n $templater->_to = $_to;\n\n // Получим результат шаблона\n $html = $templater->render('user/images.tpl');\n $jsons['html'] = $html;\n $more = $indexMax > $_to;\n $jsons['more'] = $more;\n if ($_to > $indexMax) {\n $_to = $indexMax;\n }\n $jsons['to'] = $_to;\n $jsons['from'] = $_from;\n }\n $this->sendJson($jsons);\n } catch (Exception $exc) {\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => array(\n '<em>' . $this->Translate('Ошибка получения изображений') . '</em>',\n Default_Plugin_SysBox::getMessageError($exc)\n )\n );\n $this->sendJson($jsons);\n return;\n }\n }\n }",
"public function save_post_image($post_id,array $data){\n\n \t\n }",
"abstract protected function processJpeg();",
"public function addImgPost($imgName) {\n\n if(!get_magic_quotes_gpc()) {\n $this -> sanitizeInput();\n }\n\n extract($_POST);\n\n $qry = \"INSERT INTO posts VALUES (NULL, '$postName', '$postContent', '$imgName', '$postMediaType', NOW())\";\n\n $rs = $this -> db -> query($qry);\n\n if($rs) {\n if($this -> db -> affected_rows > 0) {\n $result['ok'] = true;\n return $result;\n } else {\n return false;\n }\n } else {\n // echo 'Error executing query \"addImgPost\"';\n return true;\n }\n\n }",
"function verify_image_count()\r\n\t{\r\n\t\tglobal $mybb, $db;\r\n\r\n\t\t$post = &$this->data;\r\n\r\n\t\t// Get the permissions of the user who is making this post or thread\r\n\t\t$permissions = user_permissions($post['uid']);\r\n\r\n\t\t// Fetch the forum this post is being made in\r\n\t\t$forum = get_forum($post['fid']);\r\n\r\n\t\t// Check if this post contains more images than the forum allows\r\n\t\tif($post['savedraft'] != 1 && $mybb->settings['maxpostimages'] != 0 && $permissions['cancp'] != 1)\r\n\t\t{\r\n\t\t\trequire_once MYBB_ROOT.\"inc/class_parser.php\";\r\n\t\t\t$parser = new postParser;\r\n\r\n\t\t\t// Parse the message.\r\n\t\t\t$parser_options = array(\r\n\t\t\t\t\"allow_html\" => $forum['allowhtml'],\r\n\t\t\t\t\"allow_mycode\" => $forum['allowmycode'],\r\n\t\t\t\t\"allow_imgcode\" => $forum['allowimgcode'],\r\n\t\t\t\t\"allow_videocode\" => $forum['allowvideocode'],\r\n\t\t\t\t\"filter_badwords\" => 1\r\n\t\t\t);\r\n\r\n\t\t\tif($post['options']['disablesmilies'] != 1)\r\n\t\t\t{\r\n\t\t\t\t$parser_options['allow_smilies'] = $forum['allowsmilies'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$parser_options['allow_smilies'] = 0;\r\n\t\t\t}\r\n\r\n\t\t\t$image_check = $parser->parse_message($post['message'], $parser_options);\r\n\r\n\t\t\t// And count the number of image tags in the message.\r\n\t\t\t$image_count = substr_count($image_check, \"<img\");\r\n\t\t\tif($image_count > $mybb->settings['maxpostimages'])\r\n\t\t\t{\r\n\t\t\t\t// Throw back a message if over the count with the number of images as well as the maximum number of images per post.\r\n\t\t\t\t$this->set_error(\"too_many_images\", array(1 => $image_count, 2 => $mybb->settings['maxpostimages']));\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function postManualImage($data, $sender) {\n\t$snapchat = $GLOBALS['snapchat'];\n\t$story = $snapchat->upload(Snapchat::MEDIA_IMAGE, $data);\n\t$snapchat->setStory($story, Snapchat::MEDIA_IMAGE, $GLOBALS['config']['picturetime']);\n\t$snap = $snapchat->upload(Snapchat::MEDIA_IMAGE, file_get_contents('media/accept.jpg'));\n\t$snapchat->send($snap, array($sender), 10);\n}",
"private function imagesHandler(): void\n {\n $imagesParser = new ChapterImages($this->getXmlElement());\n $imagesParser->setAttributes($this->getAttributes());\n $this->setXmlElement($imagesParser->parse());\n }",
"function insert_file_into_image(){\n\t\t// Set parameters and execute\n\t\t/*\n\t\t$name = \"demo_img_1\";\n\t\t$url = \"/images/$name\";\n\t\t$location = 1;\n\t\t*/\n\t\tglobal $app, $conn;\n\t\t$req = $app->request();\n\t\t$body = json_decode($req->getBody());\n\t\t$sql = \"INSERT INTO image (name, url) VALUES (?, ?)\";\n\t\t$stmt = $conn->prepare($sql);\n\t\tif($stmt === false) {\n\t\t echo json_encode('Wrong SQL: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);\n\t\t return;\n\t\t}\n\t\telse {\n\t\t // Bind parameters. Types: s = string, i = integer, d = double, b = blob \n\t\t $stmt->bind_param(\"ss\", $body->name, $body->url);\n\t\t $stmt->execute();\n\t\t\t//echo \"New records created successfully\\n\";\n\t\t}\n\t}",
"function ava_post(){ \n $this->_imgdir='ava';\n $this->image_post();\n }",
"private function parsePost($post){\n\t\n\t\t//set username (hc svnt dracones)\n\t\t$username = \"atlefren\";\n\t\t\n\t\t//create array of images\n\t\t$images = array();\n\t\tforeach ($post[\"id\"] as $key=>$value) {\n\t\t\t$data = array(\n\t\t\t\t'lat' => $post[\"lat\"][$key], \n\t\t\t\t'lon' => $post[\"lon\"][$key],\n\t\t\t\t'title' => $post[\"title\"][$key], \n\t\t\t\t'filename' => $post[\"filename\"][$key],\n\t\t\t\t'user' => $username, \n\t\t\t\t'season' => $post[\"season\"][$key]\n\t\t\t);\t\n\t\t\tarray_push($images,new GeoRefImage($data));\n\t\t}\n\t\treturn $images;\n\t}",
"function sendImage() {\n\n switch ($this->type) {\n\n case 1:\n header ('Content-Type: image/jpg');\n imagejpeg($this->image,null,80);\n break;\n default:\n header ('Content-Type: image/png');\n imagepng($this->image);\n }\n imagedestroy($this->image);\n }",
"function submitImage($conn, $planID, $levelFourID, $image, $caption){\n\t\n\t$target_dir = \"uploads/report\" . $planID . \"/\";\n\tif(!(is_dir($target_dir))){\n\t\tmkdir($target_dir);\n\t}\n\t\n\t$target_file = $target_dir . basename($image[\"name\"]);\n\t$uploadOk = 1;\n\t$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);\n\n\t// Check if image file is a actual image or fake image\n\tif(isset($_POST[\"submit\"])) {\n\t\t$check = getimagesize($image[\"tmp_name\"]);\n\t\tif($check !== false) {\n\t\t\t$uploadOk = 1;\n\t\t} else {\n\t\t\t$return = ['message' => \"File is not an image.\"];\n\t\t\treturn $return;\n\t\t\t$uploadOk = 0;\n\t\t}\n\t}\n\t\n\t// Check if file already exists\n\tif (file_exists($target_file)) {\n\t\t$return = ['message' => \"File already exists.\"];\n\t\treturn $return;\n\t\t$uploadOk = 0;\n\t}\n\n\t// Allow only jpg, png, gif and jpeg\n\tif($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\"\n\t&& $imageFileType != \"gif\" ) {\n\t\t$return = ['message' => \"Sorry, only JPG, JPEG, PNG & GIF files can be uploaded.\"];\n\t\treturn $return;\n\t\t$uploadOk = 0;\n\t}\n\n\t// Check if $uploadOk is set to 0 by an error\n\tif ($uploadOk == 0) {\n\t\t$return = ['message' => \"Sorry, there was an error in the upload process.\"];\n\t\treturn $return;\n\n\t// if everything is ok, try to upload file\n\t} else {\n\t\tif (move_uploaded_file($image[\"tmp_name\"], $target_file)) {\n\t\t\t$return = ['message' => \"The file \". basename( $image[\"name\"]). \" has been uploaded.\"];\n\t\t\t$sql = \"INSERT INTO componentpicture (PlanId, LevelFourId, PictureURI, Caption) VALUES (:planID, :levelFourID, :pictureURI, :caption)\";\t\n\t\t\t$sth = $conn->prepare($sql);\n\n\t\t\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\t\t$sth->bindParam(':levelFourID', $levelFourID, PDO::PARAM_INT, 11);\n\t\t\t$sth->bindParam(':pictureURI', $target_file, PDO::PARAM_STR, 45);\n\t\t\t$sth->bindParam(':caption', $caption, PDO::PARAM_STR, 255);\n\n\t\t\t$sth->execute();\n\t\t\t$sth->closeCursor();\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t$return = ['message' => \"Sorry, there was an error uploading your file.\"];\n\t\t}\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement findById() method. | public function findById()
{
} | [
"abstract public function findOne(int $id);",
"public function getById()\n {\n }",
"public function find(Identity $id);",
"public function findOne();",
"public function getOneById()\n {\n }",
"abstract protected function findForGetOne();",
"function findByIdTest()\n {\n $accessoryDao = new AccessoryDao();\n return $accessoryDao->findById(2);\n }",
"public function find($id) {\n\t\treturn $this->model->find($id);\n\t}",
"function findByIdTest()\n {\n $productDao = new ProductDao();\n return $productDao->findById(2);\n }",
"function find($id) {\n\t\treturn $this->userMapper->find($id);\t\n\t}",
"function testFindById()\r\n {\r\n $this->id = $this->roleModel->create($this->modelArray);\r\n $entity = $this->roleModel->findById($this->id);\r\n $this->assertNotNull($entity);\r\n }",
"public function getByID($id)\n {\n }",
"public function findOneByID($identifier);",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => 'mail@example.com' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function findByID($id, $fail = true);",
"public function fetchEntityById($id);",
"public function find($id)\n {\n return $this->model->filterById($id)->first();\n }",
"public function findOne()\r\n {\r\n return $this->adapter->findOne();\r\n }",
"function findById($data)\n\t{\n\t\t$parameter = array('type' => 'read', 'tblname' => $this->name , 'findby' => 'id', 'target' => $data['id']);\n\t\treturn $this->query($parameter);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a frustum matrix. $m = Matrix4::frustum($left, $right, $bottom, $top, $near, $far); | static function frustum($left, $right, $bottom, $top, $near, $far)
{
$temp1 = 2 * $near;
$temp2 = $right - $left;
$temp3 = $top - $bottom;
$temp4 = $far - $near;
$m = [];
$m[0] = $temp1 / $temp2;
$m[1] = 0;
$m[2] = 0;
$m[3] = 0;
$m[4] = 0;
$m[5] = $temp1 / $temp3;
$m[6] = 0;
$m[7] = 0;
$m[8] = ($right + $left) / $temp2;
$m[9] = ($top + $bottom) / $temp3;
$m[10] = (-$far - $near) / $temp4;
$m[11] = -1;
$m[12] = 0;
$m[13] = 0;
$m[14] = (-$temp1 * $far) / $temp4;
$m[15] = 0;
return $m;
} | [
"function glUniformMatrix4f(int $location, bool $transpose, \\GL\\Math\\Mat4 $matrix) : void {}",
"static function perspectiveFovLH($fovY, $aspect, $near, $far)\r\n {\r\n // https://github.com/thetinyspark/tomahawk/blob/master/tomahawk/core/geom/Matrix4x4.js\r\n//$top = $near * tan($fovY*0.5);\r\n//$right = $top * $aspect;\r\n//return self::frustum(-$right, $right, -$top, $top, $near, $far);\r\n // https://msdn.microsoft.com/de-de/library/windows/desktop/bb281727%28v=vs.85%29.aspx\r\n $yScale = cot($fovY*0.5);\r\n $xScale = $yScale / $aspect;\r\n return [\r\n $xScale, 0, 0, 0,\r\n 0, $yScale, 0, 0,\r\n 0, 0, $far/($far-$near), 1,\r\n 0, 0, $near*$far/($far-$near), 0\r\n ];\r\n }",
"public function getViewMatrix()\n {\n return \\glm\\lookAt($this->position, $this->position->add($this->front), $this->up);\n }",
"public static function fromMat4(Mat4 $matrix) : Quat {}",
"public function CreateRouteMatrix()\n\t{\n\t\t$form = $this->form_builder->create_form();\n\n\t\tif ($form->validate())\n\t\t{\n\t\t\t//echo \"========>>>>>>>> <pre>\"; print_r($_POST); exit;\n\t\t\t$this->generate_route_matrix($_POST['routes'], $_POST['operator_id'], $_POST['vehicle_types']);\n\t\t}\n\n\t\t// get list of Frontend user groups\n\t\t$this->load->model('group_model', 'groups');\n\t\t$this->mViewData['groups'] = $this->groups->get_all();\n\t\t$this->mViewData['operators'] = $this->db->get('vehicle_operators')->result();\n\n\n\t\t$this->mPageTitle = 'Generate Route Fare Matrix';\n\n\t\t$this->mViewData['form'] = $form;\n\t\t$this->render('route_fare_matrix');\n\t}",
"public static function glVertexAttrib4f(int $indx, float $x, float $y, float $z, float $w)\n {\n\n }",
"public function fakeplanning4($planning4Fields = [])\n {\n return new planning4($this->fakeplanning4Data($planning4Fields));\n }",
"public function far(float $far): CameraCMPTIF;",
"function glDepthRange(float $n, float $f) : void {}",
"public function create()\n {\n $overrides = [];\n\n if ($this->name) {\n $overrides['name'] = $this->name;\n $overrides['slug'] = Str::slug($this->name, '-');\n $overrides['handle'] = Str::slug($this->name, '_');\n }\n\n if ($this->route) {\n $overrides['route'] = $this->route;\n }\n\n if ($this->template) {\n $overrides['template'] = $this->template;\n }\n\n if ($this->asCollection) {\n $overrides['type'] = 'collection';\n }\n\n if ($this->asPage) {\n $overrides['type'] = 'page';\n }\n\n if (! $this->fieldset) {\n $this->fieldset = factory(Fieldset::class)->create();\n }\n\n $matrix = factory(Matrix::class)->create($overrides);\n\n $matrix->attachFieldset($this->fieldset);\n\n return $matrix;\n }",
"function GenMeshPlane(float $width, float $length, int $resX, int $resZ): \\raylib\\Mesh { return new \\raylib\\Mesh; }",
"public function fakeNfr($nfrFields = [])\n {\n return new Nfr($this->fakeNfrData($nfrFields));\n }",
"function swf_pushmatrix() {}",
"function normalize()\n\t\t{\n\t\t\t$m = $this->magnitude();\n\t\t\t$res = new Vector(array('dest' => new Vertex(array(\n\t\t\t\t'x' => $this->_x / $m,\n\t\t\t\t'y' => $this->_y / $m,\n\t\t\t\t'z' => $this->_z / $m\n\t\t\t))));\n\t\t\treturn ($res);\n\t\t}",
"public static function glUniformMatrix3fv(int $location, int $count, bool $transpose, ArrayMemoryFloat $value, int $offset)\n {\n\n }",
"function surface($r) {\r\n\treturn $a=4 * 3.14 * $r**2;\r\n}",
"public function getMFLFacilities() {\n return $this->hasMany(MFLFacility::className(), ['administrative_unit_id' => 'id']);\n }",
"public static function createCubeVBO()\n {\n $verticies = new FloatBuffer([ \n -0.5, -0.5, -0.5, 0.0, 0.0,\n 0.5, -0.5, -0.5, 1.0, 0.0,\n 0.5, 0.5, -0.5, 1.0, 1.0,\n 0.5, 0.5, -0.5, 1.0, 1.0,\n -0.5, 0.5, -0.5, 0.0, 1.0,\n -0.5, -0.5, -0.5, 0.0, 0.0,\n \n -0.5, -0.5, 0.5, 0.0, 0.0,\n 0.5, -0.5, 0.5, 1.0, 0.0,\n 0.5, 0.5, 0.5, 1.0, 1.0,\n 0.5, 0.5, 0.5, 1.0, 1.0,\n -0.5, 0.5, 0.5, 0.0, 1.0,\n -0.5, -0.5, 0.5, 0.0, 0.0,\n \n -0.5, 0.5, 0.5, 1.0, 0.0,\n -0.5, 0.5, -0.5, 1.0, 1.0,\n -0.5, -0.5, -0.5, 0.0, 1.0,\n -0.5, -0.5, -0.5, 0.0, 1.0,\n -0.5, -0.5, 0.5, 0.0, 0.0,\n -0.5, 0.5, 0.5, 1.0, 0.0,\n \n 0.5, 0.5, 0.5, 1.0, 0.0,\n 0.5, 0.5, -0.5, 1.0, 1.0,\n 0.5, -0.5, -0.5, 0.0, 1.0,\n 0.5, -0.5, -0.5, 0.0, 1.0,\n 0.5, -0.5, 0.5, 0.0, 0.0,\n 0.5, 0.5, 0.5, 1.0, 0.0,\n \n -0.5, -0.5, -0.5, 0.0, 1.0,\n 0.5, -0.5, -0.5, 1.0, 1.0,\n 0.5, -0.5, 0.5, 1.0, 0.0,\n 0.5, -0.5, 0.5, 1.0, 0.0,\n -0.5, -0.5, 0.5, 0.0, 0.0,\n -0.5, -0.5, -0.5, 0.0, 1.0,\n \n -0.5, 0.5, -0.5, 0.0, 1.0,\n 0.5, 0.5, -0.5, 1.0, 1.0,\n 0.5, 0.5, 0.5, 1.0, 0.0,\n 0.5, 0.5, 0.5, 1.0, 0.0,\n -0.5, 0.5, 0.5, 0.0, 0.0,\n -0.5, 0.5, -0.5, 0.0, 1.0\n ]);\n \n // create a vertex array object and upload the vertices\n glGenVertexArrays(1, $VAO);\n glGenBuffers(1, $VBO);\n \n glBindVertexArray($VAO);\n glBindBuffer(GL_ARRAY_BUFFER, $VBO);\n glBufferData(GL_ARRAY_BUFFER, $verticies, GL_STATIC_DRAW);\n \n // declare the vertex attributes\n // positions\n glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, GL_SIZEOF_FLOAT * 5, 0);\n glEnableVertexAttribArray(0);\n \n // uv\n glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, GL_SIZEOF_FLOAT * 5, GL_SIZEOF_FLOAT * 3);\n glEnableVertexAttribArray(1);\n \n // unbind\n glBindBuffer(GL_ARRAY_BUFFER, 0); \n glBindVertexArray(0); \n\n return [$VAO, $VBO];\n }",
"public function frand_triangle()\n {\n $v = $this->frand();\n // =POWER(LOG(1+1000*B1),2)/9.00260465329917\n $v = log10(1.0 + 1000.0 * $v);\n $v = ($v * $v) / 9.00260465329917; // 9.00260465329917 == power(log10(1+1000), 2)\n return $v;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a given key pair as the account key pair (the global key pair used to interact with the ACME server). | public function storeAccountKeyPair(KeyPair $keyPair); | [
"public function registerAccount($key, Account $account);",
"public function loadAccountKeyPair(): KeyPair;",
"function save_account() {\n\t\t$crypt = new encryption();\n\t\t$this->account = $crypt->encrypt($this->account);\n\t\tunset($crypt);\t\t\n\t}",
"public function setDefaultAccount($key);",
"public function loadAccountKeyPair();",
"abstract public function createNewKeyPair() ;",
"public function setAuthKey();",
"public function saveKey($public, $private);",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }",
"function _store_key()\n {\n if ($this->_current_key === false) return;\n $this->_current_value = str_replace('\\\\n', \"\\n\", $this->_current_value);\n $this->_hash[$this->_current_key] = $this->_current_value;\n $this->_current_key = false;\n $this->_current_value = \"\";\n }",
"function SetKey($strKey) {\n $this->merchantInfo->enckey = $strKey;\n }",
"final private function saveKeypair( $keypair = array() ) {\n\n\t\ttry {\n\n\t\t\tclearstatcache();\n\n\t\t\t$filename = $this->get( 'defaultSaveFile' );\n\t\t\t$directory = trim( $this->get( 'keyfile_dir' ) );\n\n\t\t\tif ( trim( $filename ) == '' || is_null( $filename ) ||\n\t\t\t\ttrim( $directory ) == '' || is_null( $directory ) ) {\n\n\t\t\t\t\t/* we have no directory or filename information */\n\t\t\t\t\t$this->addError( 'Error in saveKeypair(): No filename or directory name provided. ' .\n\t\t\t\t\t\t\t\t\t'Cannot save key data.' );\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ( substr( $directory, -1 ) != '/' )\n\t\t\t\t\t$directory .= '/';\n\n\t\t\t\tif ( !is_writable( $directory ) ) {\n\t\t\t\t\t$this->addError( 'Error in saveKeypair(): Directory \"' .\n\t\t\t\t\t\t\t\t\t$directory . '\" is not writable. Cannot save key data.' );\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$savefile = $directory . $filename;\n\n\t\t\t\t$data = '524d524d524d3002' .\n\t\t\t\t\t\t\t$keypair['private_key_hex'] . '02' .\n\t\t\t\t\t\t\t$keypair['public_key']\t . '02';\n\n\t\t\t\tif ( file_put_contents( $savefile,\n\t\t\t\t\t\t\t\t\t\t\t\tbase64_encode(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->gmp_binconv( $data . hash( 'sha256', $data ) )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t LOCK_EX ) === false ) {\n\n\t\t\t\t\t/* could not save our keypair data */\n\t\t\t\t\t$this->addError( 'Error in saveKeypair(): Error writing keyfile data to disk. Check file permissions and disk space.' );\n\t\t\t\t\treturn false;\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->addNotice( 'Successfully wrote keypair data to \"' . $savefile . '\".' );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->addError( 'Error in saveKeypair(): ' . $e->getMessage() );\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getAccountKey()\n {\n return $this->accountKey;\n }",
"public function generateKeypair() {\n\t $this->key = hash('sha256', mt_rand() . microtime(true) . $this->getTitle());\n\t $this->secret = hash('sha256', mt_rand() . microtime(true) . $this->key);\n\t}",
"public function setAccountkey($value = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY)\n\t{\n\t\t$this->_accountKey = base64_decode($value);\n\t\treturn $this;\n\t}",
"public function generateKey()\n {\n $account = Account::findByPk($this->accountId);\n $token = [\n 'uid' => (string)$this->accountId,\n 'scopes' => [],\n 'app' => (string)$this->_id\n ];\n $this->privateKey = \\JWT::encode($token, $account->secretKey, self::DEFAULT_ALG, $account->accessKey);\n }",
"public function setAccountkey($value)\n {\n $this->_azureTableUtil->setAccountkey($value);\n }",
"function saveKeyRing(KeyRing $keyRing);",
"protected static function storePrivateKey($key)\n {\n // insert key if none exists, or replace if it already does\n $sql = \"INSERT INTO \" . Common::prefixTable(static::KEY_TABLE) . \" (\n id,\n key_content,\n gen_time\n ) VALUES (?, ?, NOW())\n ON DUPLICATE KEY UPDATE\n key_content = VALUES(key_content),\n gen_time = VALUES(gen_time)\";\n Db::get()->query($sql, array(static::KEY_TABLE_PRIVATE_KEY_ID, $key));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the topic archive slug | function bbp_get_topic_archive_slug($default = 'topics')
{
} | [
"public function getArchiveSlug()\n\t{\n\t\tif (!$this->hasArchive()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (((string)$slug = $this->getHasArchive()) !== '1') {\n\t\t\treturn $slug;\n\t\t}\n\t\t\n\t\tif ($slug = $this->getSlug()) {\n\t\t\tif (strpos($slug, '%') !== false) {\n\t\t\t\t$slug = trim(substr($slug, 0, strpos($slug, '%')), '%/');\n\t\t\t}\n\t\t\t\n\t\t\tif ($slug) {\n\t\t\t\treturn $slug;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->getPostType();\n\t}",
"public static function get_archive_slug() {\n\n // Default archive slug\n $archive_slug = __('knowledgebase', 'archive slug', 'ejo-kb');\n\n // Get archive page\n if ($archive_page = Options::get_archive_page()) {\n\n // Get page slug of frontpage\n if ( \\get_option('page_on_front') == $archive_page ) {\n $archive_slug = '';\n }\n\n // Get page slug (including parent pages)\n elseif ($page_slug = get_page_uri($archive_page)) {\n $archive_slug = $page_slug;\n }\n }\n\n return $archive_slug;\n }",
"public function getTopicSlug()\n {\n return Topic::where('id', $this->content_id)->first()->slug;\n }",
"public function get_archive_link(){\n\t\t/*We want a single object returned - with template always as news_archive*/\n\t\t$page = parent::get_by(array('template' => 'news_archive'), TRUE);\n\t\treturn isset($page->slug) ? $page->slug : '';\n\n\t}",
"function bp_get_the_topic_object_slug() {\n\t\tglobal $forum_template;\n\n\t\treturn apply_filters( 'bp_get_the_topic_object_slug', $forum_template->topic->object_slug );\n\t}",
"public function getSlug();",
"function bbp_get_topic_archive_title($title = '')\n{\n}",
"public function getSlug(ContentfulEntry $contentfulEntry): string;",
"function the_slug(){\n\tglobal $blog;\n\treturn $blog->the_slug();\n}",
"function bbp_admin_setting_callback_topic_slug()\n{\n}",
"function the_slug( $id ) {\n\t\t$post_data = get_post($id, ARRAY_A);\n\t\t$slug = $post_data['post_name'];\n\t\treturn $slug; \n\t}",
"private function getSlug()\n\t{\n\t\treturn $this->post_type_repo->getMenuSlug($this->post_type);\n\t}",
"function sfput_default_post_type_archive_slug( $post_type ) {\n\tif ( is_object( $post_type ) ) {\n\t\t$post_type = $post_type->name;\n\t}\n\n\tif ( ! $post_type || ! is_string( $post_type ) ) {\n\t\treturn false;\n\t}\n\n\t$slug = sf_cache_data( 'sfput_original_slugs-pt-' . $post_type );\n\t// Return original || current.\n\treturn $slug ? $slug['archive'] : sfput_get_post_type_archive_slug( $post_type );\n}",
"protected function slug()\r\n {\r\n $slug = '';\r\n \r\n if (!empty($this->report)) \r\n {\r\n return $this->report->slug;\r\n }\r\n \r\n $path = $this->app->hive()['PATH'];\r\n $path = str_replace('/admin/shop/reports/', '', $path);\r\n $pieces = explode( '/', $path);\r\n $slug = $pieces[0];\r\n \r\n return $slug;\r\n }",
"function getPostSlug($fileName) {\n return substr($fileName, 0, -3);\n }",
"public function generateSlug();",
"public function get_slug() {\n\t\treturn $this->get_field( 'post_name' );\n\t}",
"abstract public function getTaxonomySlug();",
"public function get_slug() {\n\t\treturn $this->slug?$this->slug:$this->post_type;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a locale file. | function addLocale($fileName) {
try {
$jsonString = file_get_contents('../locales/en_US.json');
file_put_contents('../locales/' . $fileName . '.json', $jsonString);
return true;
} catch (Exception $e) {
return false;
}
} | [
"function l10n_add_file($filename)\n{\n\tglobal $translators;\n\tif (is_readable($filename))\n\t\t$translators[] = $filename;\n\n}",
"function addLanguageFiles($locale_path)\n {\n // scan the /Locale directory and add all available languages\n try {\n if (false === ($lang_files = scandir($locale_path)))\n throw new \\Exception(sprintf(\"Can't read the /Locale directory %s!\", $locale_path));\n $ignore = array('.', '..', 'index.php', 'README.md');\n foreach ($lang_files as $lang_file) {\n if (!is_file($locale_path.'/'.$lang_file)) continue;\n if (in_array($lang_file, $ignore) || (pathinfo($locale_path.'/'.$lang_file, PATHINFO_EXTENSION) != 'php')) continue;\n $lang_name = pathinfo($locale_path.'/'.$lang_file, PATHINFO_FILENAME);\n // get the array from the desired file\n $lang_array = include_once $locale_path.'/'.$lang_file;\n // add the locale resource file\n $this->app['translator'] = $this->app->share($this->app->extend('translator', function ($translator) use ($lang_array, $lang_name) {\n $translator->addResource('array', $lang_array, $lang_name);\n return $translator;\n }));\n $this->app['monolog']->addDebug('Added language file: '.substr($locale_path, strlen(FRAMEWORK_PATH)).'/'.$lang_file);\n }\n }\n catch (\\Exception $e) {\n throw new \\Exception(sprintf('Error scanning the /Locale directory %s.', $locale_path));\n }\n }",
"function addLanguageFiles($locale_path)\n {\n // load the language files for all extensions\n $locales = new Finder();\n $locales->name('*.php')->in($locale_path);\n $locales->depth('== 0');\n foreach ($locales as $locale) {\n // add the locale resource file\n $this->app['translator'] = $this->app->share($this->app->extend('translator', function ($translator) use ($locale) {\n $lang_array = include_once $locale->getRealpath();\n $translator->addResource('array', $lang_array, $locale->getBasename('.php'));\n return $translator;\n }));\n $this->app['monolog']->addDebug('Added language file: '.$locale->getRealpath());\n }\n }",
"public function forFile($file, $locale);",
"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}",
"public function load($locale, $filename);",
"public function addPageLangFile($page){\n //Add the default language file (EN)\n $path = __APPLICATION_PATH.\"pages/$page/languages/EN.php\";\n $this->addLangFile($path);\n\n //Add the configured language file\n $lang = OPC_Settings::get('language');\n $path = __APPLICATION_PATH.\"pages/\".$page.\"/languages/\".$lang.\".php\";\n $this->addLangFile($path);\n }",
"public function addFile($file);",
"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 addLocale($locale) {\n\t\t$this->localeData[$locale] = array();\n\t}",
"function MyLanguage_Messages_File_Add($file)\n {\n if (empty($this->ApplicationObj()->MessagesFiles[ $file ]))\n {\n $this->ApplicationObj()->MessagesFiles[ $file ]=$file;\n\n foreach ($this->ReadPHPArray($file) as $key => $value)\n {\n $this->ApplicationObj()->Messages[ $key ]=$value;\n }\n }\n\n return $file;\n }",
"public function addFile($file) { }",
"private function addTranslatorResources(): void {\n foreach( $this->translations_files_paths as $file_path) {\n $this->translator->addResource(static::TRANSLATIONS_EXTENSION, $file_path, $this->user_defined_locale);\n }\n }",
"function add_terms_file($languageFileName) {\n if (file_exists($languageFileName)) {\n $languageFilePath = $languageFileName;\n }\n else {\n $languageFilePath = SB_LANG_DIR . Config::get('site_lang') . \"/{$languageFileName}\";\n }\n $LanguageHelper = Singleton::getInstance('LanguageHelper');\n $LanguageHelper->parse_file($languageFilePath);\n}",
"function i18n($file, $locale = NULL){\n $archivo_cargado= NULL;\n if($locale != NULL){\n if(file_exists(PATHAPP . 'source/content/' . $file . \"_$locale\" . '.ini')){\n $archivo_cargado= load_application_file('source/content/' . $file . \"_$locale\" . '.ini');\n $archivo_cargado= parse_properties($archivo_cargado);\n $GLOBALS['i18n_locale']= $locale;\n }\n }\n if($archivo_cargado == NULL){\n $archivo_cargado= load_application_file('source/content/' . $file . '.ini');\n $archivo_cargado= parse_properties($archivo_cargado);\n $GLOBALS['i18n_locale']= 'Default';\n }\n $GLOBALS['i18n_language_file']= $archivo_cargado;\n $GLOBALS['i18n_file']= $file;\n }",
"function add_translation_source($dir)\n{\n try {\n $translate = Zend_Registry::get('Zend_Translate');\n } catch (Zend_Exception $e) {\n return;\n }\n\n $locale = $translate->getAdapter()->getOptions('localeName');\n\n try {\n $translate->addTranslation(array(\n 'content' => \"$dir/$locale.mo\",\n 'locale' => $locale\n ));\n } catch (Zend_Translate_Exception $e) {\n // Do nothing, allow the user to set a locale or dir without a\n // translation.\n }\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}",
"private function addResources(Application $app, $locale)\n {\n $paths = $app['resources']->getPaths();\n\n // Directory to look for translation file(s)\n $transDir = $paths['apppath'] . '/resources/translations/' . $locale;\n\n if (is_dir($transDir)) {\n $iterator = new \\DirectoryIterator($transDir);\n /**\n * @var \\SplFileInfo $fileInfo\n */\n foreach ($iterator as $fileInfo) {\n if ($fileInfo->isFile() && (Lib::getExtension($fileInfo->getFilename()) == 'yml')) {\n $fnameParts = explode('.', $fileInfo->getFilename());\n $domain = $fnameParts[0];\n $app['translator']->addResource('yml', $fileInfo->getRealPath(), $locale, $domain);\n }\n }\n } elseif (strlen($locale) == 5) {\n $this->addResources($app, substr($locale, 0, 2));\n }\n }",
"public function onAddLocale(Event $event)\n\t{\n\t\t$this->raiseEvent('onAddLocale', $event);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve information about the currently installed GD library | function gd_info()
{
} | [
"function gd_info()\n{\n\treturn array();\n}",
"function getGDInfo($justVersion = false)\n {\n $gdinfo = array();\n\n if (function_exists('gd_info')) {\n $gdinfo = gd_info();\n } else {\n $gd = array(\n 'GD Version' => '',\n 'FreeType Support' => false,\n 'FreeType Linkage' => '',\n 'T1Lib Support' => false,\n 'GIF Read Support' => false,\n 'GIF Create Support' => false,\n 'JPG Support' => false,\n 'PNG Support' => false,\n 'WBMP Support' => false,\n 'XBM Support' => false\n );\n ob_start();\n phpinfo();\n $buffer = ob_get_contents();\n ob_end_clean();\n foreach (explode(\"\\n\", $buffer) as $line) {\n $line = array_map('trim', (explode('|', strip_tags(str_replace('</td>', '|', $line)))));\n if (isset($gd[$line[0]])) {\n if (strtolower($line[1]) == 'enabled') {\n $gd[$line[0]] = true;\n } else {\n $gd[$line[0]] = $line[1];\n }\n }\n }\n $gdinfo = $gd;\n }\n\n if (isset($gdinfo['JIS-mapped Japanese Font Support'])) {\n unset($gdinfo['JIS-mapped Japanese Font Support']);\n }\n if (function_exists('imagecreatefromgd')) {\n $gdinfo['GD Support'] = true;\n }\n if (function_exists('imagecreatefromgd2')) {\n $gdinfo['GD2 Support'] = true;\n }\n if (preg_match('/^(bundled|2)/', $gdinfo['GD Version'])) {\n $gdinfo['Truecolor Support'] = true;\n } else {\n $gdinfo['Truecolor Support'] = false;\n }\n if ($gdinfo['GD Version'] != '') {\n $match = array();\n if (preg_match('/([0-9\\.]+)/', $gdinfo['GD Version'], $match)) {\n $foo = explode('.', $match[0]);\n $gdinfo['Version'] = array('major' => $foo[0], 'minor' => $foo[1], 'patch' => $foo[2]);\n }\n }\n\n return ($justVersion) ? $gdinfo['Version'] : $gdinfo;\n }",
"private function getGD() {\n\t\treturn (extension_loaded('gd') && function_exists('gd_info'))? true : false;\n\t}",
"protected function _getImgLib() {\n\t\tif (extension_loaded ( 'imagick' )) {\n\t\t\treturn 'imagick';\n\t\t} elseif (function_exists ( 'exec' )) {\n\t\t\texec ( 'mogrify --version', $o, $c );\n\t\t\tif ($c == 0) {\n\t\t\t\treturn 'mogrify';\n\t\t\t}\n\t\t}\n\t\treturn function_exists ( 'gd_info' ) ? 'gd' : '';\n\t}",
"function check_gd()\n\t{\n\t\t$testGD = get_extension_funcs(\"gd\");\n\t\tif (!$testGD)\n\t\t{\n\t\t\t// gd not installed\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tob_start();\n\t\t\tphpinfo(8);\n\t\t\t$grab = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t$version = strpos ($grab,\"2.0\");\n\n\t\t\tif ( $version )\n\t\t\t{\n\t\t\t\t// gd2 available\n\t\t\t\treturn \"gd2\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 'old' gd available\n\t\t\t\treturn \"gd\";\n\t\t\t}\n\t\t}\n\t}",
"function describeGDdyn() {\n echo \"\\n<ul><li>GD support: \";\n if(function_exists(\"gd_info\")){\n echo \"<span style=\\\"color:#00ff00\\\">yes</span>\";\n $info = gd_info();\n $keys = array_keys($info);\n for($i=0; $i<count($keys); $i++) {\n\t if(is_bool($info[$keys[$i]])) {\n\t\techo \"</li>\\n<li>\" . $keys[$i] .\": \" . yesNo($info[$keys[$i]]);\n\t } else {\n\t\techo \"</li>\\n<li>\" . $keys[$i] .\": \" . $info[$keys[$i]];\n\t }\n }\n } else { \n echo \"<span style=\\\"color:#ff0000\\\">NO</span>\"; \n }\n echo \"</li></ul>\\n\";\n}",
"static function graphic_library() {\n\n\t\t$ngg_options = get_option('ngg_options');\n\n\t\tif ( $ngg_options['graphicLibrary'] == 'im')\n\t\t\treturn NGGALLERY_ABSPATH . '/lib/imagemagick.inc.php';\n\t\telse\n\t\t\treturn NGGALLERY_ABSPATH . '/lib/gd.thumbnail.inc.php';\n\n\t}",
"function image_get_available_toolkits() {\n $toolkits = file_scan_directory('includes', 'image\\..*\\.inc$');\n\n $output = array();\n foreach ($toolkits as $file => $toolkit) {\n include_once($file);\n $function = str_replace('.', '_', $toolkit->name) .'_info';\n if (function_exists($function)) {\n $info = $function();\n $output[$info['name']] = $info['title'];\n }\n }\n $output['gd'] = t('Built-in GD2 toolkit');\n return $output;\n}",
"public static function checkGd()\n {\n return extension_loaded(\"gd\");\n }",
"private function _checkGdLibrary(){\n if (extension_loaded('gd') && function_exists('gd_info')) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"function getGdVersion()\n {\n if (! extension_loaded('gd')) { return '0'; }\n // Use the gd_info() function if possible.\n if (function_exists('gd_info'))\n {\n $versionInfo = gd_info();\n preg_match(\"/[\\d\\.]+/\", $versionInfo['GD Version'], $matches);\n return $matches[0];\n }\n // If phpinfo() is disabled return false...\n if (preg_match('/phpinfo/', ini_get('disable_functions')))\n {\n return '0';\n }\n // ...otherwise use phpinfo().\n ob_start();\n @phpinfo(8);\n $moduleInfo = ob_get_contents();\n ob_end_clean();\n if (preg_match(\"/\\bgd\\s+version\\b[^\\d\\n\\r]+?([\\d\\.]+)/i\", $moduleInfo,$matches))\n {\n $gdVersion = $matches[1];\n }\n else\n {\n $gdVersion = '0';\n }\n return $gdVersion;\n }",
"function gd_version()\n{\n\tstatic $gd_version;\n\n\tif($gd_version)\n\t{\n\t\treturn $gd_version;\n\t}\n\tif(!extension_loaded('gd'))\n\t{\n\t\treturn;\n\t}\n\n\tif(function_exists(\"gd_info\"))\n\t{\n\t\t$gd_info = gd_info();\n\t\tpreg_match('/\\d/', $gd_info['GD Version'], $gd);\n\t\t$gd_version = $gd[0];\n\t}\n\telse\n\t{\n\t\tob_start();\n\t\tphpinfo(8);\n\t\t$info = ob_get_contents();\n\t\tob_end_clean();\n\t\t$info = stristr($info, 'gd version');\n\t\tpreg_match('/\\d/', $info, $gd);\n\t\t$gd_version = $gd[0];\n\t}\n\n\treturn $gd_version;\n}",
"function getCurrentGraphicTool() {\n\tglobal $gallery;\n\n\tif(isset($gallery->app->graphics)) {\n\t\treturn $gallery->app->graphics;\n\t}\n\telse {\n\t\treturn default_graphics();\n\t}\n}",
"function getGDversion()\n {\n static $gd_version_number = null;\n if ($gd_version_number === null)\n {\n ob_start();\n phpinfo(8);\n $module_info = ob_get_contents();\n ob_end_clean();\n if (preg_match(\"/\\bgd\\s+version\\b[^\\d\\n\\r]+?([\\d\\.]+)/i\", $module_info,$matches))\n {\n $gd_version_number = $matches[1];\n }\n else\n {\n $gd_version_number = 0;\n }\n }\n return $gd_version_number;\n }",
"public function get_gdpr_version();",
"function gd_loaded()\n\t{\n\t\tif ( ! extension_loaded('gd'))\n\t\t{\n\t\t\tif ( ! @dl('gd.so'))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}",
"function GDEnabled()\n\t{\n\t\tstatic $gd_enabled = null;\n\n\t\tif (is_null($gd_enabled)) {\n\t\t\t$gd_enabled =\tfunction_exists('imagecreate')\n\t\t\t\t\t\t\t&& (\tfunction_exists('imagegif')\n\t\t\t\t\t\t\t\t\t|| function_exists('imagepng')\n\t\t\t\t\t\t\t\t\t|| function_exists('imagejpeg'));\n\t\t}\n\n\t\treturn $gd_enabled;\n\t}",
"function image_imagemagick_info() {\r\n return array('name' => 'imagemagick', 'title' => 'ImageMagick Toolkit.');\r\n}",
"function gd_support(){\n \t\treturn in_array($this->getGDType(), we_image_edit::supported_image_types());\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates attribute 'use_product_image_for_swatch' flag. | private function updateAttributeUseProductImageFlag(): void
{
$this->configurableAttribute->setData('use_product_image_for_swatch', 1);
$this->configurableAttribute = $this->productAttributeRepository->save($this->configurableAttribute);
} | [
"function action_woocommerce_attribute_updated( $attribute_id, $attribute, $old_attribute_name ) { \n\t$imagedata = array('attribute_id' => $attribute_id, 'attribute_image' => $_POST['attribute_image']);\n update_option('product_attributes_image_'.$attribute_id, $imagedata);\n}",
"function setProduct_image($product_image) { $this->product_image = $product_image; }",
"function showImageProduct()\n {\n if ($this->getStoreConfig('onestepcheckout/addfield/showimageproduct')) {\n return true;\n }\n\n return false;\n }",
"private function setMainVisualSwatchCode(\\Magento\\Catalog\\Model\\Product $product)\n {\n foreach ($product->getTypeInstance()->getConfigurableAttributes($product) as $attribute) {\n $eavAttribute = $attribute->getProductAttribute();\n if ($this->swatchHelper->isVisualSwatch($eavAttribute)) {\n $this->visualSwatchCode = $eavAttribute->getAttributeCode();\n }\n }\n }",
"public function assignProductSwatchToProduct()\r\n {\r\n\r\n $created_user_id = $this->user_id;\r\n $client_product_id = $this->data_arr['client_product_id'];\r\n $product_swatch_id = $this->data_arr['product_swatch_id'];\r\n\t\t\r\n\t\tif (empty($product_swatch_id)) {\t\t// no swatch selected - can't add it\r\n\t\t\treturn array('product_product_swatch_id' => -1);\r\n\t\t}\r\n\r\n $sql_str = \"CALL \" . $this->db . \"._product_x_product_swatchAdd(%d, %d, %d)\";\r\n\r\n return $this->db_conn->SafeQuery($sql_str, array($client_product_id, $product_swatch_id, $created_user_id), 'single');\r\n }",
"public function setProduct_img ($product_img) {\n\t$this->product_img = $product_img;\n\treturn $this;\n}",
"public function loadFirstVariationWithSwatchImage(Product $configurableProduct, array $requiredAttributes)\n {\n return $this->loadFirstVariation('swatch_image', $configurableProduct, $requiredAttributes);\n }",
"public function isShowProductImage()\n {\n return $this->scopeConfig->isSetFlag(\n 'magepow_ajaxcart/success_popup/product_image',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function wvg_woocommerce_show_product_images() {\n\tglobal $product;\n\n\tif ($product->get_type() == 'variable') {\n\t\t// error_log('[WVG] Main product is '.$product->get_sku());\n\t\t$attributes = $product->get_default_attributes();\n\n\t\tforeach ( $attributes as $key => $value ) {\n\t\t\tif (strpos('attribute_', $key) == false) {\n\t\t\t\t$attributes['attribute_'.$key] = $value;\n\t\t\t\tunset($attributes[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// error_log('[WVG] Main product default attributes:');\n\t\t// error_log(print_r($attributes, true));\n\n\t\t// Try to get matching variation\n\t\t$variatoins = $product->get_available_variations();\n\t\tif ($variatoins) {\n\t\t\tforeach ($variatoins as $variation) {\n\t\t\t\t// error_log('[WVG] Variation '.$variation['variation_id'].' attributes:');\n\t\t\t\t// error_log(print_r($variation['attributes'], true));\n\t\t\t\tif ($variation['attributes'] === $attributes) {\n\t\t\t\t\t// error_log('[WVG] FOUND MATCHING VARIATION :'.$variation['variation_id'].'.');\n\t\t\t\t\t$parent_product = $product;\n\t\t\t\t\t$product = wc_get_product($variation['variation_id']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\twc_get_template( 'single-product/product-image.php' );\n\tif (isset($parent_product)) $product = $parent_product;\n}",
"function getswatchimage_custom($productid,$count='0'){\n$get_image_assoc = get_post_meta($productid,'_swatch_type_options',true);\nif(!empty($get_image_assoc))\n{\nif($count == '1'){\n\t$swatchimage = sizeof($get_image_assoc['pa_color']['attributes'])-1;\n}else{\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\tforeach($get_image_assoc['pa_color']['attributes'] as $key=>$value)\n\t\t\t{\n\t\t\t $i=0;\n\t\t\t\t\tforeach($get_image_assoc['pa_color']['attributes'] as $keyattr=>$valueattr){\n\t\t\t\t\t\t\t$postimageid=$valueattr['image'];\n\t\t\t\t\t\t\t$imagedetail= get_post_meta($postimageid,'_wp_attachment_metadata');\n\t\t\t\t\t\t\t$swatchimage[$i]=$upload_dir['url'].'/'.$imagedetail[0]['sizes']['swatches_image_size']['file'];\n\t\t\t\t\t\t\t\t\tif($imagedetail == NULL){\n\t\t\t\t\t\t\t\t\t\t\t$imagedetail=get_post_meta($postimageid,'_wp_attached_file');\n\t\t\t\t\t\t\t\t\t\t\t$swatchimage[$i]=$upload_dir['url'].'/'.$imagedetail[0];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t}\n\n}\n}\nreturn $swatchimage;\n}",
"public function swatch_list() {\n\t\t\t$options = Woostify_Variation_Swatches::get_instance()->get_options();\n\t\t\tif ( '0' === $options['shop_page'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobal $product;\n\n\t\t\t$pid = $product->get_id();\n\t\t\t$output = '';\n\t\t\t$color_output = '';\n\t\t\t$image_output = '';\n\t\t\t$label_output = '';\n\n\t\t\tif ( ! $pid || ! $product->is_type( 'variable' ) ) {\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$settings = Woostify_Variation_Swatches::get_instance()->get_options();\n\t\t\t$default_attr = method_exists( $product, 'get_default_attributes' ) ? $product->get_default_attributes() : array();\n\t\t\t$vars = $product->get_available_variations();\n\t\t\t$attributes = $product->get_attributes();\n\n\t\t\tif ( ! $attributes ) {\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\tforeach ( $attributes as $key ) {\n\t\t\t\t// Swatch type, ex: pa_size, pa_color, pa_image.\n\t\t\t\t$attr_name = $key['name'];\n\t\t\t\t$terms = wc_get_product_terms( $pid, $attr_name, array( 'fields' => 'all' ) );\n\n\t\t\t\t// Get type of product attribute by ID.\n\t\t\t\t$attr_type = wc_get_attribute( $key['id'] );\n\n\t\t\t\tif ( empty( $terms ) || is_wp_error( $terms ) ) {\n\t\t\t\t\treturn $output;\n\t\t\t\t}\n\n\t\t\t\t$id_slug = array();\n\t\t\t\t$id_name = array();\n\n\t\t\t\tforeach ( $terms as $val ) {\n\t\t\t\t\t$id_slug[ $val->term_id ] = $val->slug;\n\t\t\t\t\t$id_name[ $val->name ] = $val->slug;\n\t\t\t\t}\n\n\t\t\t\t$color = '';\n\t\t\t\t$img_id = '';\n\t\t\t\t$label = '';\n\t\t\t\t$empty_arr = array();\n\n\t\t\t\tforeach ( $vars as $key ) {\n\t\t\t\t\t$slug = isset( $key['attributes'][ 'attribute_' . $attr_name ] ) ? $key['attributes'][ 'attribute_' . $attr_name ] : '';\n\n\t\t\t\t\tif ( ! in_array( $slug, $empty_arr, true ) ) {\n\t\t\t\t\t\tarray_push( $empty_arr, $slug );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( empty( $slug ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$_id = array_search( $slug, $id_slug, true );\n\t\t\t\t\t$name = array_search( $slug, $id_name, true );\n\t\t\t\t\t$src = wp_get_attachment_image_src( $key['image_id'], 'woocommerce_thumbnail' );\n\t\t\t\t\t$_class = ( isset( $default_attr[ $attr_name ] ) && $slug === $default_attr[ $attr_name ] ) ? 'selected swatch-' . $slug : 'swatch-' . $slug;\n\t\t\t\t\t$tooltip = '1' === $settings['tooltip'] ? '<span class=\"swatch-tooltip\">' . esc_attr( $name ) . '</span>' : '';\n\n\t\t\t\t\tswitch ( $attr_type->type ) {\n\t\t\t\t\t\tcase 'color':\n\t\t\t\t\t\t\t$color = get_term_meta( $_id, 'color', true );\n\t\t\t\t\t\t\t$color_output .= '<span class=\"swatch swatch-color ' . esc_attr( $_class ) . '\" data-slug=\"' . esc_attr( $src[0] ) . '\" style=\"background-color: ' . esc_attr( $color ) . '\">' . $tooltip . '</span>';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t$img_id = get_term_meta( $_id, 'image', true );\n\t\t\t\t\t\t\t$img_alt = woostify_image_alt( $img_id, esc_attr__( 'Swatch image', 'woostify-pro' ) );\n\t\t\t\t\t\t\t$image_output .= '<span class=\"swatch swatch-image ' . esc_attr( $_class ) . '\" data-slug=\"' . esc_attr( $src[0] ) . '\"><img src=\"' . wp_get_attachment_url( $img_id ) . '\" alt=\"' . esc_attr( $img_alt ) . '\">' . $tooltip . '</span>';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'label':\n\t\t\t\t\t\t\t$label = get_term_meta( $_id, 'label', true );\n\t\t\t\t\t\t\t$label_output .= '<span class=\"swatch swatch-label ' . esc_attr( $_class ) . '\" data-slug=\"' . esc_attr( $src[0] ) . '\">' . esc_html( $label ) . $tooltip . '</span>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $color_output ) ) {\n\t\t\t\t$output .= $color_output;\n\t\t\t} elseif ( ! empty( $image_output ) ) {\n\t\t\t\t$output .= $image_output;\n\t\t\t} else {\n\t\t\t\t$output .= $label_output;\n\t\t\t}\n\n\t\t\tif ( ! $output ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"swatch-list variation-<?php echo esc_attr( $settings['style'] ); ?>\"><?php echo wp_kses_post( $output ); ?></div>\n\t\t\t<?php\n\t\t}",
"public function set_product_image($p_product_image){\n\t\t$this->v_product_image = $p_product_image;\n\t}",
"function fn_product_variations_apply_options_rules_post(&$product)\n{\n if ($product['product_type'] === ProductManager::PRODUCT_TYPE_CONFIGURABLE) {\n $product['options_update'] = true;\n }\n}",
"function fe_show_product_image() {\n // wc_get_template( 'single-product/product-image.php' );\n include_once(FESTIVAL_EVENTS_PLUGIN_PATH . 'templates/single-product/product-image.php');\n }",
"private function updateImgThumbnail(): void\n {\n //====================================================================//\n // Load Object Images List\n $allImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->ProductId,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Walk on Object Images List\n foreach ($allImages as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }",
"protected function _updateConfigurableProductAttributes(Mage_Core_Model_Abstract $product)\n\t{\n\t\tif (\n\t\t\t$product->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE ||\n\t\t\t! $product->getBcpDefaultProductSku()\n\t\t)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($product->getBcpDefaultProductSku() != $product->getBcpDefaultLoaded())\n\t\t{\n\t\t\t$simpleProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $product->getBcpDefaultProductSku());\n\n\t\t\t$this->_prepareProducts($product, $simpleProduct);\n\n\t\t\tif ($simpleProduct->getId())\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * Update Price Data\n\t\t\t\t */\n\t\t\t\t$product\n\t\t\t\t\t->setPrice($simpleProduct->getPrice())\n\t\t\t\t\t->setSpecialPrice($simpleProduct->getSpecialPrice())\n\t\t\t\t\t->setSpecialFromDate($simpleProduct->getSpecialFromDate())\n\t\t\t\t\t->setSpecialToDate($simpleProduct->getSpecialToDate())\n\t\t\t\t\t->setFinalPrice($simpleProduct->getFinalPrice())\n\t\t\t\t;\n\n\t\t\t\tif (Mage::helper('bcp')->checkUpdateDocumentPart('images', $product))\n\t\t\t\t{\n\t\t\t\t\t$product->setImage($simpleProduct->getImage())\n\t\t\t\t\t\t->setThumbnail($simpleProduct->getThumbnail())\n\t\t\t\t\t\t->setSmallImage($simpleProduct->getSmallImage())\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t\tif (Mage::helper('bcp')->checkUpdateDocumentPart('short_desc', $product))\n\t\t\t\t{\n\t\t\t\t\t$product->setShortDescription($simpleProduct->getShortDescription());\n\t\t\t\t}\n\t\t\t\tif (Mage::helper('bcp')->checkUpdateDocumentPart('collateral', $product) && ! Mage::helper('bcp')->getConfig('keep_configurable_description'))\n\t\t\t\t{\n\t\t\t\t\t$product->setDescription($simpleProduct->getDescription());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMage::dispatchEvent('bcp_update_defaults_on_configurable_product', array('product' => $product, 'simple_product' => $simpleProduct));\n\t\t\t}\n\t\t\t$product->setBcpDefaultLoaded($simpleProduct->getSku());\n\t\t}\n\t}",
"private function setShowBrandIcon()\n {\n if ($this->scopeConfig->isSetFlag('amshopby_brand/general/product_icon')) {\n $attributeCode = $this->scopeConfig->getValue('amshopby_brand/general/attribute_code');\n $filterCode = \\Amasty\\ShopbyBase\\Helper\\FilterSetting::ATTR_PREFIX . $attributeCode;\n $filterCollection = $this->filterCollectionFactory->create();\n /** @var \\Amasty\\ShopbyBase\\Api\\Data\\FilterSettingInterface $filter */\n $filter = $filterCollection\n ->addFieldToFilter(FilterSettingInterface::FILTER_CODE, $filterCode)\n ->getFirstItem();\n if ($filter && $filter->getId()) {\n $filter->setShowIconsOnProduct(true);\n $this->filterSettingRepository->save($filter);\n }\n }\n }",
"private function appendProductImageCover(&$product) {\n $softpath = '/images/products';\n $hardpath = public_path($softpath);\n $pid = $product->id;\n $product->image_cover = url(\"/assets/product.png\");\n $search = glob(\"$hardpath/$pid.0.*\");\n if ($search) {\n $image = basename($search[0]);\n $product->image_cover = url(\"$softpath/$image\");\n }\n }",
"public function compose(Product $product): void\n {\n parent::compose($product);\n\n $this->addImageUrlForProduct($product);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a transactioning boolean. | public function setTransactioning( $val ) {
$this->transactioning = $val;
} | [
"function setTransaction($bool){\n\n\t\tif($bool){\n\t\t\t$this->db_instance->autocommit(false);\n\t\t\t$this->setTransaction = true;\n\t\t}\n\t}",
"public function setIsTransaction($status)\n {\n $this->isTransaction = $status;\n }",
"public function setIsTransactionPending($flag)\n {\n $this->setData('is_transaction_pending', (bool)$flag);\n\n return $this;\n }",
"protected function _setBoolean($name, $value) {}",
"public function setTranslation($boolean){\n\t\t$this->attributes['is_translation'] = $boolean;\n\t}",
"public function setAllowTranscription(?bool $value): void {\n $this->getBackingStore()->set('allowTranscription', $value);\n }",
"public function set_transactions($flag)\n {\n if (true === $flag || false === $flag) {\n $this->_transactions = $flag;\n return;\n }\n throw new \\InvalidArgumentException();\n }",
"public function setOn($flag = true);",
"protected function setBool(){\n $this->bool = array(\n\t 'true'=>1,\n\t 'false'=>0,\n\t 'yes'=>1,\n\t 'no'=>0,\n\t\t'on'=>1,\n\t\t'off'=>0,\n\t);\n }",
"public function set_boolean_values($true = true, $false = false){\r\n $this->true_val = $true;\r\n $this->false_val = $false;\r\n }",
"public function setLockable($bool)\n {\n $this->isLockable = $bool;\n }",
"public function writeBoolean($boolean);",
"public function setIsTransf($isTransf) {\n $this->isTransf = $isTransf;\n return $this;\n }",
"public function setBooleanTest($test)\n {\n $this->setRecordPropertyBoolean('test', $test);\n }",
"public function setTutorStatus($bool)\r\n {\r\n $this->_isTutor = $bool;\r\n }",
"public function setAutocommit($bool) {\n\t\t$this->dbo->autocommit($bool);\n\t}",
"public function setTemporary(bool $temporary);",
"public function setFlag() {\n $this->attributes['test_flag'] = TRUE;\n }",
"public function setTasTransferFly ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n\n if ( $this->tas_transfer_fly !== $v || $v === 'FALSE' )\n {\n $this->tas_transfer_fly = $v;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logs a message warning a routing process had end. | protected function logRouteCompletion()
{
$executionTime = microtime(true) - $this->executionStart;
$logger = Strata::app()->getLogger();
if ($logger) {
$logger->logContextEnd(sprintf("Done in %s seconds", round($executionTime, 4)), "<green>Route</green>");
}
} | [
"protected function logRouteCancellation()\n {\n $message = sprintf(\"<warning>Canceled routing to</warning> -> <info>%s#%s</info>\", get_class($this->controller), $this->action);\n\n $logger = Strata::app()->getLogger();\n if ($logger) {\n $logger->log($message, \"<green>Route</green>\");\n }\n }",
"public static function routeError() {\n\t\tself::getHookable()->raiseEvent('error');\n\t\tdie('Routing error.');\n\t}",
"public function end() {\n\t\t$this->request->route->clear();\n\t}",
"abstract protected function endLog();",
"function endLogging(){}",
"public function onAfterRoute()\n\t{\n\t\tif ($this->isLdap)\n\t\t{\n\t\t\tSHLdapHelper::triggerEvent('onAfterRoute');\n\t\t}\n\t}",
"public function logEnd()\n {\n $this->end = microtime(true);\n }",
"protected function logCommandEnd(): void\n {\n $seconds = $this->runner->getElapsedTime();\n\n if ($this->getConnection()->isTimeout()) {\n $this->notice('Command timed out after {seconds} seconds', [\n 'seconds' => $seconds,\n ]);\n } else {\n $this->info('Command completed in {seconds} seconds', [\n 'seconds' => $seconds,\n ]);\n }\n }",
"function onAfterRoute()\n {\n }",
"public function progressEnd() {\n self::writeLine(String::build(' Done with {percent}% (elapsed time: {elapsed_time} sec)', array(\n 'percent' => ceil(($this->_progressStepCurrent / $this->_progressTotal) * 100),\n 'elapsed_time' => time() - $this->_progressStartTime,\n )));\n }",
"function finish()\n {\n // echo \"task finished {$this->pid}\\n\";\n }",
"function log_end() {\n\t\t$t = microtime(true) - $this->ts_start;\n\t\t$this->output_log_item( array(\"total_time\" => $t) );\n\n\t\t$this->current_section = null;\n\t}",
"protected function endProcess() {\n $this->statusHandler->SetStatus(StatusHandler::STOPPED, FALSE);\n $this->statusHandler->logStatus('ok', 'The @drush-cmd daemon has stopped.');\n }",
"public function callbackFail()\n {\n $this->AddOutput(\"<p><i>\" . $this->logoutMessage . \"</i></p>\");\n $this->redirectTo();\n }",
"public function finishRoute(Request $request){\n return self::changeRouteStatus($request,'3','Route finished successfully. Congratulations.');\n }",
"public function onAfterRoute()\n\t{\n\t\tif ($this->adapterUser)\n\t\t{\n\t\t\tSHAdapterEventHelper::triggerEvent($this->adapterUser, 'onAfterRoute');\n\t\t}\n\t}",
"public function flowEnd();",
"protected function terminate(): void {\n http_response_code(404);\n die($this->error_message);\n }",
"public function endFailure()\n {\n $this->endRequest('FAIL');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve HTML markup of travel_better_penci_slider shortcode | public static function travel_better_penci_slider( $atts, $content = null ) {
$return = '';
// start element markup
ob_start();
if( get_theme_mod( 'penci_enable_featured_video_bg' ) && get_theme_mod( 'penci_featured_video_url' ) ) {
get_template_part( 'inc/featured_slider/featured_video' );
} else {
if ( get_theme_mod( 'penci_featured_slider' ) == true ) :
$slider_style = get_theme_mod( 'penci_featured_slider_style' ) ? get_theme_mod( 'penci_featured_slider_style' ) : 'style-1';
if( ( $slider_style == 'style-33' || $slider_style == 'style-34' ) && get_theme_mod( 'penci_feature_rev_sc' ) ) {
$rev_shortcode = get_theme_mod( 'penci_feature_rev_sc' );
echo '<div class="tb-penci-slider-vc featured-area featured-' . $slider_style . '">';
if( $slider_style == 'style-34' ): echo '<div class="container">'; endif;
echo do_shortcode( $rev_shortcode );
if( $slider_style == 'style-34' ): echo '</div>'; endif;
echo '</div>';
} else {
if ( get_theme_mod( 'penci_body_boxed_layout' ) ) {
if( $slider_style == 'style-3' ) {
$slider_style == 'style-1';
} elseif( $slider_style == 'style-5' ) {
$slider_style == 'style-4';
} elseif( $slider_style == 'style-7' ) {
$slider_style == 'style-8';
} elseif( $slider_style == 'style-9' ) {
$slider_style == 'style-10';
} elseif( $slider_style == 'style-11' ) {
$slider_style == 'style-12';
} elseif( $slider_style == 'style-13' ) {
$slider_style == 'style-14';
} elseif( $slider_style == 'style-15' ) {
$slider_style == 'style-16';
} elseif( $slider_style == 'style-17' ) {
$slider_style == 'style-18';
} elseif( $slider_style == 'style-29' ) {
$slider_style == 'style-30';
}
}
$slider_class = $slider_style;
if( $slider_style == 'style-5' ) {
$slider_class = 'style-4 style-5';
} elseif ( $slider_style == 'style-30' ) {
$slider_class = 'style-29 style-30';
}
$data_auto = 'false';
$data_loop = 'true';
$data_res = '';
if( $slider_style == 'style-7' || $slider_style == 'style-8' ){
$data_res = ' data-item="4" data-desktop="4" data-tablet="2" data-tabsmall="1"';
} elseif( $slider_style == 'style-9' || $slider_style == 'style-10' ){
$data_res = ' data-item="3" data-desktop="3" data-tablet="2" data-tabsmall="1"';
} elseif( $slider_style == 'style-11' || $slider_style == 'style-12' ){
$data_res = ' data-item="2" data-desktop="2" data-tablet="2" data-tabsmall="1"';
} elseif( $slider_style == 'style-31' || $slider_style == 'style-32' ) {
$data_res = ' data-dots="true" data-nav="false"';
if( get_theme_mod( 'penci_enable_next_prev_penci_slider' ) ):
$data_res = ' data-dots="true" data-nav="true"';
endif;
}
if( get_theme_mod( 'penci_featured_autoplay' ) ): $data_auto = 'true'; endif;
if( get_theme_mod( 'penci_featured_loop' ) ): $data_loop = 'false'; endif;
$auto_time = get_theme_mod( 'penci_featured_slider_auto_time' );
if( !is_numeric( $auto_time ) ): $auto_time = '4000'; endif;
$auto_speed = get_theme_mod( 'penci_featured_slider_auto_speed' );
if( !is_numeric( $auto_speed ) ): $auto_speed = '600'; endif;
$open_container = '';
$close_container = '';
if( in_array( $slider_style, array( 'style-1', 'style-4', 'style-6', 'style-8', 'style-10', 'style-12', 'style-14', 'style-16', 'style-18', 'style-19', 'style-20', 'style-21', 'style-22', 'style-23', 'style-24', 'style-25', 'style-26', 'style-27', 'style-30', 'style-32' ) ) ):
$open_container = '<div class="container">';
$close_container = '</div>';
endif;
echo '<div class="tb-penci-slider-vc featured-area featured-' . $slider_class . '">' . $open_container;
echo '<div class="penci-owl-carousel penci-owl-featured-area"'. $data_res .'data-style="'. $slider_style .'" data-auto="'. $data_auto .'" data-autotime="'. $auto_time .'" data-speed="'. $auto_speed .'" data-loop="'. $data_loop .'">';
get_template_part( 'inc/featured_slider/' . $slider_style );
echo '</div>';
echo $close_container. '</div>';
}
endif;
}
$return = ob_get_clean();
return $return;
} | [
"protected function get_html() {\n $return_value = \"<div id='\" . $this->get_identifier() . \"' class='coin-slider'>\";\n\n foreach ( $this->slides as $slide ) {\n $return_value .= \"\\n\" . $slide;\n }\n\n $return_value .= \"\\n </div>\";\n\n return apply_filters( 'metaslider_coin_slider_get_html', $return_value, $this->id, $this->settings ); $retVal;\n }",
"function x_get_slider_shortcode( $string ) {\n\n //\n // Conditionals.\n //\n\n $is_new_slug = strpos( $string, 'x-slider-' ) !== false;\n $is_new_layerslider_slug = strpos( $string, 'x-slider-ls-' ) !== false;\n\n\n //\n // Get shortcode.\n //\n\n $shortcode = ( $is_new_layerslider_slug ) ? 'layerslider' : 'rev_slider';\n\n\n //\n // Get shortcode parameter.\n //\n\n $parameter = ( $is_new_layerslider_slug ) ? 'id' : 'alias';\n\n\n //\n // Get shortcode parameter value.\n //\n\n if ( $is_new_slug ) {\n $string_pieces = explode( '-', $string );\n $slider_id = end( $string_pieces );\n $parameter_value = $slider_id;\n } else {\n $parameter_value = $string;\n }\n\n\n //\n // Return shortcode format.\n //\n\n return \"[{$shortcode} {$parameter}=\\\"{$parameter_value}\\\"]\";\n\n}",
"function sf_return_slider($revslider_shortcode) {\n\t ob_start();\n\t putRevSlider($revslider_shortcode);\n\t return ob_get_clean();\n\t}",
"function ss_shortcode( $atts ) {\n\textract( shortcode_atts( array(\n\t\t'posts_per_page' => '1',\n\t\t'orderby' => 'none',\n\t\t'post_id' => '',\n\t\t'owlc_opts' => '',\n\t), $atts ) );\n\n\treturn ss_get_slide($posts_per_page, $orderby, $post_id, $owlc_opts);\n}",
"function wp_swiper_shortcode_caption($atts = array(), $content = \"\") {\n $html_atts = array('id', 'class');\n $options = array();\n\n $atts = shortcode_atts(array(\n 'class' => 'swiper-slide-caption',\n 'before_content' => \"\",\n 'after_content' => '',\n ), $atts, 'swiper_caption');\n\n $json = json_encode($options, JSON_UNESCAPED_SLASHES);\n\n // Create output\n $output = \"\";\n $output.= \"<div\";\n foreach ($atts as $name => $value) {\n if (in_array($name, $html_atts)) {\n $output.= ' ' . $name . '=\"' . $value . '\"';\n } else {\n $options[$name] = $value;\n }\n }\n $output.= \">\";\n\n $output.= $options['before_content'];\n $output.= do_shortcode( $content );\n $output.= $options['after_content'];\n\n $output.= \"</div>\";\n return $output;\n}",
"function client_say_slider_shortcode ($atts, $content=null) {\n \n $output = '<ul class=\"client-say-slider\">';\n $output .= do_shortcode($content);\n $output .= '</ul>';\n \n \t$output .= '<script>\n\tjQuery(document).ready(function($) {\n\t\t$(\".client-say-slider\").bxSlider({\n pager: false,\n minSlides: 1,\n maxSlides: 1,\n slideWidth: 1200\n });\n\t});';\n\t$output .= '</script>';\n \n return $output;\n}",
"function themerex_sc_slider($atts, $content=null){\t\n\tif (themerex_sc_in_shortcode_blogger()) return '';\n extract(themerex_sc_html_decode(shortcode_atts(array(\n\t\t// Individual params\n\t\t\"engine\" => themerex_get_custom_option('substitute_slider_engine'),\n\t\t\"custom\" => \"no\",\n\t\t\"alias\" => \"\",\n\t\t\"post_type\" => \"post\",\n\t\t\"ids\" => \"\",\n\t\t\"cat\" => \"\",\n\t\t\"count\" => \"0\",\n\t\t\"offset\" => \"\",\n\t\t\"orderby\" => \"date\",\n\t\t\"order\" => 'desc',\n\t\t\"controls\" => \"no\",\n\t\t\"pagination\" => \"no\",\n\t\t\"titles\" => \"no\",\n\t\t\"descriptions\" => themerex_get_custom_option('slider_info_descriptions'),\n\t\t\"links\" => \"no\",\n\t\t\"align\" => \"\",\n\t\t\"interval\" => \"\",\n\t\t\"date_format\" => \"\",\n\t\t\"crop\" => \"yes\",\n\t\t\"autoheight\" => \"no\",\n\t\t// Common params\n\t\t\"id\" => \"\",\n\t\t\"class\" => \"\",\n\t\t\"animation\" => \"\",\n\t\t\"css\" => \"\",\n\t\t\"width\" => \"\",\n\t\t\"height\" => \"\",\n\t\t\"top\" => \"\",\n\t\t\"bottom\" => \"\",\n\t\t\"left\" => \"\",\n\t\t\"right\" => \"\"\n ), $atts)));\n\n\tif (empty($width) && $pagination!='full') $width = \"100%\";\n\tif (empty($height) && ($pagination=='full' || $pagination=='over')) $height = 250;\n\tif (!empty($height) && themerex_sc_param_is_on($autoheight)) $autoheight = \"off\";\n\tif (empty($interval)) $interval = mt_rand(5000, 10000);\n\t\n\tglobal $THEMEREX_GLOBALS;\n\t$THEMEREX_GLOBALS['sc_slider_engine'] = $engine;\n\t$THEMEREX_GLOBALS['sc_slider_width'] = themerex_prepare_css_value($width);\n\t$THEMEREX_GLOBALS['sc_slider_height'] = themerex_prepare_css_value($height);\n\t$THEMEREX_GLOBALS['sc_slider_links'] = themerex_sc_param_is_on($links);\n\t$THEMEREX_GLOBALS['sc_slider_bg_image'] = false;\n\t$THEMEREX_GLOBALS['sc_slider_crop_image'] = $crop;\n\n\tif (empty($id)) $id = \"sc_slider_\".str_replace('.', '', mt_rand());\n\t\n\t$ms = themerex_get_css_position_from_values($top, $right, $bottom, $left);\n\t$ws = themerex_get_css_position_from_values('', '', '', '', $width);\n\t$hs = themerex_get_css_position_from_values('', '', '', '', '', $height);\n\n\t$css .= (!in_array($pagination, array('full', 'over')) ? $ms : '') . ($hs) . ($ws);\n\t\n\tif ($engine!='swiper' && in_array($pagination, array('full', 'over'))) $pagination = 'yes';\n\t\n\t$output = (in_array($pagination, array('full', 'over')) \n\t\t\t\t? '<div class=\"sc_slider_pagination_area sc_slider_pagination_'.esc_attr($pagination)\n\t\t\t\t\t\t. ($align!='' && $align!='none' ? ' align'.esc_attr($align) : '')\n\t\t\t\t\t\t. '\"'\n\t\t\t\t\t. (!themerex_sc_param_is_off($animation) ? ' data-animation=\"'.esc_attr(themerex_sc_get_animation_classes($animation)).'\"' : '')\n\t\t\t\t\t. (($ms).($hs) ? ' style=\"'.esc_attr(($ms).($hs)).'\"' : '') \n\t\t\t\t\t.'>' \n\t\t\t\t: '')\n\t\t\t. '<div' . ($id ? ' id=\"'.esc_attr($id).'\"' : '') \n\t\t\t. ' class=\"sc_slider sc_slider_' . esc_attr($engine)\n\t\t\t\t. ($engine=='swiper' ? ' swiper-slider-container' : '')\n\t\t\t\t. (!empty($class) ? ' '.esc_attr($class) : '')\n\t\t\t\t. (themerex_sc_param_is_on($autoheight) ? ' sc_slider_height_auto' : '')\n\t\t\t\t. ($hs ? ' sc_slider_height_fixed' : '')\n\t\t\t\t. (themerex_sc_param_is_on($controls) ? ' sc_slider_controls' : ' sc_slider_nocontrols')\n\t\t\t\t. (themerex_sc_param_is_on($pagination) ? ' sc_slider_pagination' : ' sc_slider_nopagination')\n\t\t\t\t. (!in_array($pagination, array('full', 'over')) && $align!='' && $align!='none' ? ' align'.esc_attr($align) : '')\n\t\t\t\t. '\"'\n\t\t\t. (!in_array($pagination, array('full', 'over')) && !themerex_sc_param_is_off($animation) ? ' data-animation=\"'.esc_attr(themerex_sc_get_animation_classes($animation)).'\"' : '')\n\t\t\t. (!empty($width) && themerex_strpos($width, '%')===false ? ' data-old-width=\"' . esc_attr($width) . '\"' : '')\n\t\t\t. (!empty($height) && themerex_strpos($height, '%')===false ? ' data-old-height=\"' . esc_attr($height) . '\"' : '')\n\t\t\t. ((int) $interval > 0 ? ' data-interval=\"'.esc_attr($interval).'\"' : '')\n\t\t\t. ($css!='' ? ' style=\"'.esc_attr($css).'\"' : '')\n\t\t. '>';\n\n\tthemerex_enqueue_slider($engine);\n\n\tif ($engine=='revo') {\n\t\tif (themerex_exists_revslider() && !empty($alias))\n\t\t\t$output .= do_shortcode('[rev_slider '.esc_attr($alias).']');\n\t\telse\n\t\t\t$output = '';\n\t} else if ($engine=='swiper') {\n\t\t\n\t\t$caption = '';\n\n\t\t$output .= '<div class=\"slides'\n\t\t\t.($engine=='swiper' ? ' swiper-wrapper' : '').'\"'\n\t\t\t.($engine=='swiper' && $THEMEREX_GLOBALS['sc_slider_bg_image'] ? ' style=\"'.esc_attr($hs).'\"' : '')\n\t\t\t.'>';\n\n\t\t$content = do_shortcode($content);\n\t\t\n\t\tif (themerex_sc_param_is_on($custom) && $content) {\n\t\t\t$output .= $content;\n\t\t} else {\n\t\t\tglobal $post;\n\t\n\t\t\tif (!empty($ids)) {\n\t\t\t\t$posts = explode(',', $ids);\n\t\t\t\t$count = count($posts);\n\t\t\t}\n\t\t\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'posts_per_page' => $count,\n\t\t\t\t'ignore_sticky_posts' => true,\n\t\t\t\t'order' => $order=='asc' ? 'asc' : 'desc',\n\t\t\t);\n\t\n\t\t\tif ($offset > 0 && empty($ids)) {\n\t\t\t\t$args['offset'] = $offset;\n\t\t\t}\n\t\n\t\t\t$args = themerex_query_add_sort_order($args, $orderby, $order);\n\t\t\t$args = themerex_query_add_filters($args, 'thumbs');\n\t\t\t$args = themerex_query_add_posts_and_cats($args, $ids, $post_type, $cat);\n\n\t\t\t$query = new WP_Query( $args );\n\n\t\t\t$post_number = 0;\n\t\t\t$pagination_items = '';\n\t\t\t$show_image \t= 1;\n\t\t\t$show_types \t= 0;\n\t\t\t$show_date \t\t= 1;\n\t\t\t$show_author \t= 0;\n\t\t\t$show_links \t= 0;\n\t\t\t$show_counters\t= 'views';\t//comments | rating\n\t\t\t\n\t\t\twhile ( $query->have_posts() ) { \n\t\t\t\t$query->the_post();\n\t\t\t\t$post_number++;\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t$post_type = get_post_type();\n\t\t\t\t$post_title = get_the_title();\n\t\t\t\t$post_link = get_permalink();\n\t\t\t\t$post_date = get_the_date(!empty($date_format) ? $date_format : 'd.m.y');\n\t\t\t\t$post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));\n\t\t\t\tif (themerex_sc_param_is_on($crop)) {\n\t\t\t\t\t$post_attachment = $THEMEREX_GLOBALS['sc_slider_bg_image']\n\t\t\t\t\t\t? themerex_get_resized_image_url($post_attachment, !empty($width) && (float) $width.' ' == $width.' ' ? $width : null, !empty($height) && (float) $height.' ' == $height.' ' ? $height : null)\n\t\t\t\t\t\t: themerex_get_resized_image_tag($post_attachment, !empty($width) && (float) $width.' ' == $width.' ' ? $width : null, !empty($height) && (float) $height.' ' == $height.' ' ? $height : null);\n\t\t\t\t} else if (!$THEMEREX_GLOBALS['sc_slider_bg_image']) {\n\t\t\t\t\t$post_attachment = '<img src=\"'.esc_url($post_attachment).'\" alt=\"\">';\n\t\t\t\t}\n\t\t\t\t$post_accent_color = '';\n\t\t\t\t$post_category = '';\n\t\t\t\t$post_category_link = '';\n\n\t\t\t\tif (in_array($pagination, array('full', 'over'))) {\n\t\t\t\t\t$old_output = $output;\n\t\t\t\t\t$output = '';\n\t\t\t\t\trequire(themerex_get_file_dir('templates/parts/widgets-posts.php'));\n\t\t\t\t\t$pagination_items .= $output;\n\t\t\t\t\t$output = $old_output;\n\t\t\t\t}\n\t\t\t\t$output .= '<div' \n\t\t\t\t\t. ' class=\"'.esc_attr($engine).'-slide\"'\n\t\t\t\t\t. ' data-style=\"'.esc_attr(($ws).($hs)).'\"'\n\t\t\t\t\t. ' style=\"'\n\t\t\t\t\t\t. ($THEMEREX_GLOBALS['sc_slider_bg_image'] ? 'background-image:url(' . esc_url($post_attachment) . ');' : '') . ($ws) . ($hs)\n\t\t\t\t\t\t. '\"'\n\t\t\t\t\t. '>' \n\t\t\t\t\t. (themerex_sc_param_is_on($links) ? '<a href=\"'.esc_url($post_link).'\" title=\"'.esc_attr($post_title).'\">' : '')\n\t\t\t\t\t. (!$THEMEREX_GLOBALS['sc_slider_bg_image'] ? $post_attachment : '')\n\t\t\t\t\t;\n\t\t\t\t$caption = $engine=='swiper' ? '' : $caption;\n\t\t\t\tif (!themerex_sc_param_is_off($titles)) {\n\t\t\t\t\t$post_hover_bg = themerex_get_custom_option('link_color', null, $post_id);\n\t\t\t\t\t$post_bg = '';\n\t\t\t\t\tif ($post_hover_bg!='' && !themerex_is_inherit_option($post_hover_bg)) {\n\t\t\t\t\t\t$rgb = themerex_hex2rgb($post_hover_bg);\n\t\t\t\t\t\t$post_hover_ie = str_replace('#', '', $post_hover_bg);\n\t\t\t\t\t\t$post_bg = \"background-color: rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.8);\";\n\t\t\t\t\t}\n\t\t\t\t\t$caption .= '<div class=\"sc_slider_info' . ($titles=='fixed' ? ' sc_slider_info_fixed' : '') . ($engine=='swiper' ? ' content-slide' : '') . '\"'.($post_bg!='' ? ' style=\"'.esc_attr($post_bg).'\"' : '').'>';\n\t\t\t\t\t$post_descr = themerex_get_post_excerpt();\n\t\t\t\t\tif (themerex_get_custom_option(\"slider_info_category\")=='yes') { // || empty($cat)) {\n\t\t\t\t\t\t// Get all post's categories\n\t\t\t\t\t\t$post_tax = themerex_get_taxonomy_categories_by_post_type($post_type);\n\t\t\t\t\t\tif (!empty($post_tax)) {\n\t\t\t\t\t\t\t$post_terms = themerex_get_terms_by_post_id(array('post_id'=>$post_id, 'taxonomy'=>$post_tax));\n\t\t\t\t\t\t\tif (!empty($post_terms[$post_tax])) {\n\t\t\t\t\t\t\t\tif (!empty($post_terms[$post_tax]->closest_parent)) {\n\t\t\t\t\t\t\t\t\t$post_category = $post_terms[$post_tax]->closest_parent->name;\n\t\t\t\t\t\t\t\t\t$post_category_link = $post_terms[$post_tax]->closest_parent->link;\n\t\t\t\t\t\t\t\t\t//$post_accent_color = themerex_taxonomy_get_inherited_property($post_tax, $post_terms[$post_tax]->closest_parent->term_id, 'link_color');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tif ($post_accent_color == '' && !empty($post_terms[$post_tax]->terms)) {\n\t\t\t\t\t\t\t\t\tfor ($i = 0; $i < count($post_terms[$post_tax]->terms); $i++) {\n\t\t\t\t\t\t\t\t\t\t$post_accent_color = themerex_taxonomy_get_inherited_property($post_tax, $post_terms[$post_tax]->terms[$i]->term_id, 'link_color');\n\t\t\t\t\t\t\t\t\t\tif ($post_accent_color != '') break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\tif ($post_category!='') {\n\t\t\t\t\t\t\t\t\t$caption .= '<div class=\"sc_slider_category\"'.(themerex_substr($post_accent_color, 0, 1)=='#' ? ' style=\"background-color: '.esc_attr($post_accent_color).'\"' : '').'><a href=\"'.esc_url($post_category_link).'\">'.($post_category).'</a></div>';\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\t$output_reviews = '';\n\t\t\t\t\tif (themerex_get_custom_option('show_reviews')=='yes' && themerex_get_custom_option('slider_info_reviews')=='yes') {\n\t\t\t\t\t\t$avg_author = themerex_reviews_marks_to_display(get_post_meta($post_id, 'reviews_avg'.((themerex_get_theme_option('reviews_first')=='author' && $orderby != 'users_rating') || $orderby == 'author_rating' ? '' : '2'), true));\n\t\t\t\t\t\tif ($avg_author > 0) {\n\t\t\t\t\t\t\t$output_reviews .= '<div class=\"sc_slider_reviews post_rating reviews_summary blog_reviews' . (themerex_get_custom_option(\"slider_info_category\")=='yes' ? ' after_category' : '') . '\">'\n\t\t\t\t\t\t\t\t. '<div class=\"criteria_summary criteria_row\">' . trim(themerex_reviews_get_summary_stars($avg_author, false, false, 5)) . '</div>'\n\t\t\t\t\t\t\t\t. '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (themerex_get_custom_option(\"slider_info_category\")=='yes') $caption .= $output_reviews;\n\t\t\t\t\t$caption .= '<h3 class=\"sc_slider_subtitle\"><a href=\"'.esc_url($post_link).'\">'.($post_title).'</a></h3>';\n\t\t\t\t\tif (themerex_get_custom_option(\"slider_info_category\")!='yes') $caption .= $output_reviews;\n\t\t\t\t\tif ($descriptions > 0) {\n\t\t\t\t\t\t$caption .= '<div class=\"sc_slider_descr\">'.trim(themerex_strshort($post_descr, $descriptions)).'</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$caption .= '</div>';\n\t\t\t\t}\n\t\t\t\t$output .= ($engine=='swiper' ? $caption : '') . (themerex_sc_param_is_on($links) ? '</a>' : '' ) . '</div>';\n\t\t\t}\n\t\t\twp_reset_postdata();\n\t\t}\n\n\t\t$output .= '</div>';\n\t\tif ($engine=='swiper') {\n\t\t\tif (themerex_sc_param_is_on($controls))\n\t\t\t\t$output .= '<div class=\"sc_slider_controls_wrap\"><a class=\"sc_slider_prev\" href=\"#\"></a><a class=\"sc_slider_next\" href=\"#\"></a></div>';\n\t\t\tif (themerex_sc_param_is_on($pagination))\n\t\t\t\t$output .= '<div class=\"sc_slider_pagination_wrap\"></div>';\n\t\t}\n\t\n\t} else\n\t\t$output = '';\n\t\n\tif (!empty($output)) {\n\t\t$output .= '</div>';\n\t\tif ($pagination_items) {\n\t\t\t$output .= '\n\t\t\t\t<div class=\"sc_slider_pagination widget_area\"'.($hs ? ' style=\"'.esc_attr($hs).'\"' : '').'>\n\t\t\t\t\t<div id=\"'.esc_attr($id).'_scroll\" class=\"sc_scroll sc_scroll_vertical swiper-slider-container scroll-container\"'.($hs ? ' style=\"'.esc_attr($hs).'\"' : '').'>\n\t\t\t\t\t\t<div class=\"sc_scroll_wrapper swiper-wrapper\">\n\t\t\t\t\t\t\t<div class=\"sc_scroll_slide swiper-slide\">\n\t\t\t\t\t\t\t\t'.($pagination_items).'\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"'.esc_attr($id).'_scroll_bar\" class=\"sc_scroll_bar sc_scroll_bar_vertical\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\t}\n\n\treturn apply_filters('themerex_shortcode_output', $output, 'trx_slider', $atts, $content);\n}",
"function slider_shortcode($atts, $content){\nextract( shortcode_atts (array( // a few default values\n )\n , $atts));\n\n\t$q = new WP_Query(\n\t\n\t\tarray('posts_per_page' => -1, 'post_type' => 'slider', 'order' => 'ASC', )\n\t);\n\t$list = '<figure class=\"banner\">\n <div id=\"owl-slider\" class=\"owl-carousel owl-theme\">';\n\t\n\twhile($q->have_posts()) : $q->the_post();\n\t\t\t$idd = get_the_ID();\n\t\n\t\t\t$list .= '\n \n \n \n <div class=\"item\">\n '.get_the_post_thumbnail( get_the_ID(), 'slider', array( 'class' => 'img-responsive' ) ).'\n <div class=\"carousel-caption\">\n \t <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-xs-12 col-sm-11 col-md-12 col-lg-9 text-left\">\n \t<h1 class=\"white light lg m-b-30\">'.get_the_title().'</h1><br>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"'.get_the_permalink().'\" class=\"btn-warning\">Contact Us Now</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\t\n\t\n\t';\n\t\t\n\tendwhile;\n\t$list.= ' </div>\n \n <!--jump-to-bottom-->\n <a href=\"#myAnchor\" rel=\"\" id=\"anchor1\" class=\"anchorLink hidden-xs\"><div class=\"jump-bottom\"><img src=\"'.get_template_directory_uri().'/images/bottom-doen-arrow.png\" alt=\"\"/></div></a>\n <!--end-jump-to-bottom-->\n </figure>';\n\twp_reset_query();\n\treturn $list;\n}",
"function get_opco_slider()\n {\n $block = array(\n 'blockName' => \"acf/opco-slider\",\n 'attrs' => array(\n \"id\" => \"block_62a8958a78d139\",\n \"name\" => \"acf/opco-slider\",\n \"data\" => [],\n \"align\" => \"full\",\n \"mode\" => \"preview\"\n ),\n 'blockName' => \"acf/opco-slider\",\n 'innerBlocks' => [],\n 'innerHTML' => \"\",\n 'innerContent' => [],\n );\n return render_block($block);\n }",
"public function getSliderId() {\n\t\t$id = get_theme_mod( 'slider_setting', '' );\n\n\t\t$slider = do_shortcode( '[smartslider3 slider=' . $id . ']' );\n\n\t\treturn $slider;\n\t}",
"private function get_coin_slider_markup( $slide ) {\n\n $attributes = apply_filters( 'metaslider_coin_slider_image_attributes', array(\n 'src' => $slide['src'],\n 'height' => $slide['height'],\n 'width' => $slide['width'],\n 'alt' => $slide['alt'],\n 'rel' => $slide['rel'],\n 'class' => $slide['class'],\n 'title' => $slide['title'],\n 'style' => 'display: none;'\n ), $slide, $this->slider->ID );\n\n $html = $this->build_image_tag( $attributes );\n\n if ( strlen( $slide['caption'] ) ) {\n $html .= \"<span>{$slide['caption']}</span>\";\n }\n\n $attributes = apply_filters( 'metaslider_coin_slider_anchor_attributes', array(\n 'href' => strlen( $slide['url'] ) ? $slide['url'] : 'javascript:void(0)'\n ), $slide, $this->slider->ID );\n\n $html = $this->build_anchor_tag( $attributes, $html );\n\n return apply_filters( 'metaslider_image_coin_slider_markup', $html, $slide, $this->settings );\n\n }",
"function wellies_plugin_carousel($atts, $content = null){\n extract(shortcode_atts(array(\n\t \"id\"=> '',\n\t \"class\" => 'slide',\n ), $atts));\n return '<div id=\"'.$id.'\" rel=\"Carousel\" class=\"thumbnail carousel '.$class.'\">'.\"\\n\".\n\t'<div class=\"carousel-inner\">'.\"\\n\".\n\t do_shortcode($content).\"\\n\".\n\t'</div>'.\"\\n\".\n\t'<a class=\"left nav\" href=\"#'.$id.'\" data-slide=\"prev\">«</a>'.\"\\n\".\n\t'<a class=\"right nav\" href=\"#'.$id.'\" data-slide=\"next\">»</a>'.\"\\n\".\n\t'</div>';\n}",
"function alchem_get_page_slider($slider_type,$alchem_css_class=\"\"){\n\t global $alchem_page_meta;\n\t\n\t $return = '';\n\t switch($slider_type){\n\t\t case \"layer\":\n\t\t if(isset($alchem_page_meta['layer_slider']) && is_numeric($alchem_page_meta['layer_slider']) && $alchem_page_meta['layer_slider']>0 )\n\t\t $return .= do_shortcode('[layerslider id=\"'.$alchem_page_meta['layer_slider'].'\"]');\n\t\t break;\n\t\t case \"rev\":\n\t\t \n\t\t if(isset($alchem_page_meta['rev_slider']) && $alchem_page_meta['rev_slider'] !=\"\" )\n\t\t $return .= do_shortcode('[rev_slider '.$alchem_page_meta['rev_slider'].']');\n\t\t break;\n\t\t case \"magee_slider\":\n\t\t if(isset($alchem_page_meta['magee_slider']) && is_numeric($alchem_page_meta['magee_slider']) && $alchem_page_meta['magee_slider']>0 )\n\t\t $return .= do_shortcode('[ms_slider id=\"'.$alchem_page_meta['magee_slider'].'\"]');\t \n\t\t break;\n\t\t default:\n\t\t return;\n\t\t break;\n\t\t }\n\t echo '<div class=\"slider-wrap\"><div class=\"page-top-slider '.$alchem_css_class.'\">'.$return.'</div></div>';\n\t }",
"public function shortcode(){\n return \"add your image and html here...\";\n }",
"function h5vbas_shortcode($atts) {\n\n wp_enqueue_style('h5vbas', plugins_url() . '/html5-video-before-after-slider/css/default.css');\n wp_enqueue_script('h5vbas', plugins_url() . '/html5-video-before-after-slider/js/default.js', array('jquery'), null, true);\n\n $template_path = 'h5vbas/';\n $default_path = plugin_dir_path(__FILE__) . 'templates/';\n $template_name = 'default.php';\n\n // Enable to let Theme generate its own HTML structure\n $template = locate_template(array(\n $template_path . $template_name,\n\t));\n if ( ! $template ) {\n\t\t$template = $default_path . $template_name;\n }\n\n $output = '';\n if (file_exists($template)) {\n ob_start();\n include $template;\n $output = ob_get_contents();\n ob_end_clean();\n }\n\n return $output;\n}",
"function hse_insert_slider($atts, $content=null){\r\n\r\n$slider= hse_get_slider();\r\n\r\nreturn $slider;\r\n\r\n}",
"public function output_sc_string() {\n\t\trequire_once( Torque_Slideshow_PATH . 'shortcode/torque-slideshow-shortcode-class.php' );\n\n\t\tglobal $post;\n\n\t\t?>\n\t\t<p>To use this slideshow anywhere on your site, copy and paste this shortcode: <code>[<?php echo Torque_Slideshow_Shortcode::$SHORTCODE_SLUG; ?> id=\"<?php echo $post->ID; ?>\"]</code></p>\n\t\t<?php\n\t}",
"function slider_button($atts, $content = null) {\n extract(shortcode_atts(array('url' => '#'), $atts));\n return '<a class=\"btn\" href=\"'.$url.'\"><span>' . do_shortcode($content) . '</span></a>';\n}",
"function rht_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Backs up an image file | function backup_image($image, $save = TRUE)
{
$retval = FALSE;
$image_path = $this->object->get_image_abspath($image);
if ($image_path && @file_exists($image_path)) {
$retval = copy($image_path, $this->object->get_backup_abspath($image));
// Store the dimensions of the image
if (function_exists('getimagesize')) {
$mapper = C_Image_Mapper::get_instance();
if (!is_object($image)) {
$image = $mapper->find($image);
}
if ($image) {
if (!property_exists($image, 'meta_data')) {
$image->meta_data = array();
}
$dimensions = getimagesize($image_path);
$image->meta_data['backup'] = array('filename' => basename($image_path), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime());
if ($save) {
$mapper->save($image);
}
}
}
}
return $retval;
} | [
"public function saveImage() {\n $fp = fopen($this->imageFile, \"wb\");\n fwrite($fp, $this->content);\n fclose($fp);\n }",
"function save($destImagePath);",
"public function saveMiniBack($dest)\r\n {\r\n // Skin image\r\n $skin = $this->skin2d->backImage();\r\n // Result resized image with skin\r\n $result = $this->skin2d->wrapper(90, 180);\r\n\r\n // Copy skin image on the result\r\n imagecopyresized($result, $skin, 0, 0, 0, 0, imagesx($result), imagesy($result), imagesx($skin),\r\n imagesy($skin));\r\n\r\n // Save result image to the destination folder\r\n imagepng($result, $dest);\r\n\r\n // Free memory\r\n imagedestroy($result);\r\n imagedestroy($skin);\r\n }",
"public function saveImage()\n {\n $imageType = $this->bitmapFormat->getFormatFromMimeType($this->getMimeType(), BitmapFormat::FORMAT_PNG);\n $imageOptions = $this->bitmapFormat->getFormatImagineSaveOptions($imageType);\n if ($imageType === BitmapFormat::FORMAT_GIF && $this->image->layers()->count() > 1) {\n $imageOptions['animated'] = true;\n }\n $this->image->save($this->getLocalFilename(), $imageOptions);\n }",
"public function save()\n {\n $this->getHolder()->setImageCompressionQuality($this->getQuality());\n\n return $this->getHolder()->writeImage($this->getFilename());\n }",
"public function saveImageFile() {\n move_uploaded_file($_FILES[$this->uploadedFileKey]['tmp_name'], $this->filePath);\n }",
"public function saveFullBack($dest)\r\n {\r\n // Skin image\r\n $skin = $this->skin2d->backImage();\r\n // Result resized image with skin\r\n $result = $this->skin2d->wrapper(200, 400);\r\n\r\n // Copy skin image on the result\r\n imagecopyresized($result, $skin, 0, 0, 0, 0, imagesx($result), imagesy($result), imagesx($skin),\r\n imagesy($skin));\r\n\r\n // Save result image to the destination folder\r\n imagepng($result, $dest);\r\n\r\n // Free memory\r\n imagedestroy($result);\r\n imagedestroy($skin);\r\n }",
"private function createFinalImage()\r\n\t{\t\r\n\r\n\t\tif($this->finalFileName != 'overwrite')\r\n\t\t{\r\n\t\t\timagejpeg($this->finalResource, $this->finalFileName);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tunlink($this->originalFileName);\r\n\t\t\timagejpeg($this->finalResource, $this->originalFileName);\r\n\t\t}\r\n\t\t\r\n\t\t// free up RAM\r\n\t\timagedestroy($this->originalResource);\r\n\t\timagedestroy($this->finalResource); \r\n\t}",
"protected function _save()\n\t{\n\t\timagepng(\n\t\t\t$this->_resource,\n\t\t\t$this->getSavePath(),\n\t\t\tround($this->getCompression() * 9 / 100)\n\t\t);\n\t}",
"protected function saveOriginalPicture()\n {\n if (Config::get('ReSmushIt.original')) {\n $original = File::dirname($this->file) . DIRECTORY_SEPARATOR . File::name($this->file) . '_original.' . File::extension($this->file);\n File::copy($this->file, $original);\n }\n }",
"function save($filename){\n\t\tif ($this->fileextension == 'jpg' || $this->fileextension == 'jpeg'){\n\t\t\timagejpeg($this->dst_img,$filename,75); \t\t\n\t\t} else if ($this->fileextension == 'png'){\n\t\t\timagepng($this->dst_img,$filename); \n\t\t} else if ($this->fileextension == 'gif'){\n\t\t\timagegif($this->dst_img,$filename); \n\t\t}\n\t\t\n\t\t// Sett permissions\n\t\t/*\n\t\t$old = umask(0);\n\t\tchmod($filename, 0666);\n\t\tumask($old);\n\t\t*/\n\t}",
"public function save()\n {\n global $_CMAPP;\n\n $dm = $this->getSize();\n $s = round($this->size/1024);\n $this->metadata = \"$dm[x]|$dm[y]|$s\";\n\t\t\n $old_state = $this->state;\n \t \n try{\n \tparent::save();\n }catch(CMException $e) {\n \tnew AMErrorReport($e, 'AMImage::save', AMLog::LOG_CORE);\n \tthrow $e;\n }\n\n\t //we must delete all the existing thumbnails of this image if the save was sucessfull\n \t//see AMThumb for more information about thumbnail generation\n if($old_state==CMObj::STATE_DIRTY) {\n $p = AMThumb::getImagesPattern($this->codeFile);\n\n $_conf = $_CMAPP['config'];\n $path = (string) $_conf->app[0]->paths[0]->thumbnails;\n $handle = opendir($path);\n\n while (($file = readdir($handle))!==false) {\n if(ereg($p,$file)) {\n unlink($path.'/'.$file);\n }\n }\n }\n }",
"private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }",
"public function saveImage(){\n \n $this->setImageName($this->genRandName($this->file[\"name\"])); \n\n if ($this->checkUpload()){\n\n } else {\n\n if ($this->saveImageDir($this->file)){\n return $this->writeInDataBase();\n \n } else {\n echo \"You must to fill all the formulary...\";\n }\n\n }\n\n }",
"protected function backupFile()\n {\n $carbonNow = Carbon::now()->format('Y_m_d_H_i_s');\n\n $backupFilePath = $this->filepath.\"_\".$carbonNow.$this->backupSuffix;\n\n File::copy($this->filepath, $backupFilePath);\n }",
"public function save()\n {\n $image = $this->transformImage(\\Image::forge(null, $this->_image->file()));\n\n $destination = APPPATH.$this->url(false);\n $dir = dirname($destination);\n\n if (!is_dir($dir)) {\n if (!@mkdir($dir, 0755, true)) {\n error_log(\"Can't create dir \".$dir);\n exit(\"Can't create dir \".$dir);\n }\n }\n $image->save($destination);\n return $destination;\n }",
"public function persist_image(){\n\t\tif(empty($this->Controller->request->data['Image']['img']['name']) && !empty($this->Controller->request->data['Image']['image_storage'])){\n\t\t\t// No new file was uploaded so lets persist the old one.\n\t\t\t// If they made transformations, we will catch that too.\n\t\t\t$file = str_replace('http://'.$_SERVER['SERVER_NAME'], '', $this->Controller->request->data['Image']['image_storage']);\n\t\t\t// We replace because without it the system would continuously attache -1appened to the file names making them super long.\n\t\t\t$name = str_replace('-1appended', '', basename($this->Controller->request->data['Image']['image_storage']));\n\t\t\tcopy(APP.'webroot/'.$file, TMP.$name);\n\t\t\t$this->Controller->request->data['Image']['img'] = TMP.$name;\n\t\t}\n\t}",
"public function save()\n {\n $image = $this->realEntity->addImage($this->makeimage()); // add image \n\n $this->file->storeAs($this->realEntity->slug . '/', $image->name, 'dropbox'); // move to directory \n\n $client = new DropboxClient(config('filesystems.disks.dropbox.token'));\n \n $imageData = $client->getMetadata($this->realEntity->slug . '/' . $image->name); \n \n $image->update(['dropbox_id' => $imageData['id']]); \n\n }",
"private function savethumb() {\r\n\t\r\n\t\tif ($this->Thumbsaveas!='') {\r\n\t\t\tswitch (strtolower($this->Thumbsaveas)) {\r\n\t\t\t\tcase \"gif\":\r\n\t\t\t\t\t$this->image=substr($this->image,0,strrpos($this->image,'.')).\".gif\";\r\n\t\t\t\t\t$this->size[2]=1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"jpg\":\r\n\t\t\t\t\t$this->image=substr($this->image,0,strrpos($this->image,'.')).\".jpg\";\r\n\t\t\t\t\t$this->size[2]=2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"jpeg\":\r\n\t\t\t\t\t$this->image=substr($this->image,0,strrpos($this->image,'.')).\".jpeg\";\r\n\t\t\t\t\t$this->size[2]=2;\r\n\t\t\t\t\tbreak;\t\t\t\r\n\t\t\t\tcase \"png\":\r\n\t\t\t\t\t$this->image=substr($this->image,0,strrpos($this->image,'.')).\".png\";\r\n\t\t\t\t\t$this->size[2]=3;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tswitch($this->size[2]) {\r\n\t\t\tcase 1:\r\n\t\t\t\timagegif($this->thumb,$this->Thumblocation.$this->Thumbprefix.$this->image);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\timagejpeg($this->thumb,$this->Thumblocation.$this->Thumbprefix.$this->image,$this->Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\timagepng($this->thumb,$this->Thumblocation.$this->Thumbprefix.$this->image);\r\n\t\t\t\tbreak;\r\n\t\t}\t\t\r\n\t\tif ($this->Chmodlevel!='') {chmod($this->Thumblocation.$this->Thumbprefix.$this->image,octdec($this->Chmodlevel));}\r\n\t\timagedestroy($this->im);\r\n\t\timagedestroy($this->thumb);\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Payment models. | public function actionIndex()
{
$searchModel = new PaymentSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function allAction()\n {\n $em = $this->getDoctrine()->getManager();\n $payments = $em->getRepository(PaymentInfos::class)->findAll();\n\n return $this->render(\n 'PaymentBundle:admin:list.html.twig',\n [\n 'payments' => $payments,\n 'menu_level' => 'payment_admin'\n ]\n );\n }",
"public function showPaymentList()\n\t\t{\n\t\t\treturn $this->payments;\n\t\t}",
"public function readPaymentMethods()\n {\n return PaymentMethod::all(['id', 'name']);\n }",
"public function getAllPaymentMethods()\n {\n try {\n $query = '\n SELECT \n id, name \n FROM \n paymentMethods\n\t\t\t';\n return $this->db->fetchAll($query);\n } catch (Exception $exception) {\n echo 'Caught exception: ' . $exception->getMessage() . \"\\n\";\n }\n }",
"public function actionIndex()\n {\n $searchModel = new PaymentTransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all()\n {\n $items = array();\n\n // Get all customer payments\n $resp = $this->api->request->getAll(\"/customers/{$this->customer}/payments\");\n\n if (!empty($resp) && is_array($resp)) {\n foreach ($resp as $item) {\n $items[] = new Payment($this->api, $item);\n }\n }\n\n return $items;\n }",
"public function getPaymentsAction()\n {\n $builder = Shopware()->Models()->createQueryBuilder();\n $data = $builder->select('a.id, a.description, a.name')\n ->from('Shopware\\Models\\Payment\\Payment', 'a')\n ->where('a.name LIKE \\'mopt_payone__%\\'')\n ->getQuery()->getArrayResult();\n\n foreach ($data as $dataKey => $dataValue) {\n $data[$dataKey]['description'] = $dataValue['description'] . ' - ' . $dataValue['name'];\n if ($this->moptDoesSeparateConfigExists($dataValue['id'])) {\n $data[$dataKey]['configSet'] = 1;\n } else {\n $data[$dataKey]['configSet'] = 0;\n }\n }\n\n array_unshift($data, array('id' => null, 'description' => 'Alle (global)', 'name' => '', 'configSet' => 1));\n $this->View()->assign(array(\n \"success\" => true,\n \"data\" => $data,\n \"totalCount\" => count($data)));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ORFSStoreBundle:PaymentMethods')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function listPayments(){\n return new ObtieneListadoDePagosRealizadosApi($this->client, $this->config, $this->headerSelector);\n }",
"public function view_all_payment()\n\t{\n\t\t$data['main_content']='view_payment';\n\t\t$data['allbatch']=$this->Batch_model->view_all_running_batch();\n\t\t$data['all_payment']=$this->Payment_model->view_all_payment();\n\t\t$this->load->view('page', $data);\n\t}",
"public function actionIndex()\n {\n $searchModel = new StudentsPaymentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllPayments()\n {\n return $this->payment->getPaymentMethods();\n }",
"public function payments() {\n \n return $this->hasMany(Payment::class);\n \n }",
"public function actionIndex() {\n $searchModel = new PaymentReceivedSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => PaymentGateway::find()->where(['IDuser'=>Yii::$app->user->getId()]),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function payments()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = bill_id, localKey = bill_id)\n return $this->hasMany('App\\Payment','bill_id','bill_id');\n }",
"public function getAll() \n {\n $charges = $this->em->getRepository('ApiPaymentBundle:Charge')\n ->findAll();\n \n $allCharge = [];\n if(count($charges) > 0) {\n foreach($charges as $charge) {\n $data = [\n 'id' => $charge->getId(),\n 'amount' => $charge->getAmount() + $charge->getFee(),\n 'payment_id' => $charge->getPayments()->getId()\n ];\n $allCharge[] = new ChargeModel($data);\n }\n }\n return $allCharge;\n }",
"public function getPaymentModules()\n {\n $t = Payment::getTable();\n $objPayment = Payment::findBy(array(\"$t.tstamp>0\"), null);\n\n if (null === $objPayment) {\n return array();\n }\n\n return $objPayment->fetchEach('name');\n }",
"public function payments() {\n return $this->hasMany('App\\Models\\Payment', 'payment_invoiceid', 'bill_invoiceid');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Migrate Down Create `users` table More information on writing migrations is available here: | public function down(){
$this->dropTable('users');
} | [
"private function createUsersTableDown(): void\n\t{\n\t\tSchema::create('users', function (Blueprint $table) {\n\t\t\t$table->increments('id');\n\t\t\t$table->dateTime('created_at')->nullable(false);\n\t\t\t$table->dateTime('updated_at')->nullable(false);\n\t\t\t$table->string('username', 100)->nullable(false)->unique();\n\t\t\t$table->string('password', 100)->nullable(true);\n\t\t\t$table->string('email', 100)->nullable()->unique();\n\t\t\t$table->boolean('upload')->nullable(false)->default(false);\n\t\t\t$table->boolean('lock')->nullable(false)->default(false);\n\t\t\t$table->rememberToken();\n\t\t});\n\t}",
"public function migrateDown()\n\t{\n\t\tTracker::getMigrator()->down();\n\t}",
"public function userTableMigrate()\r\n\t{\r\n\t\t$isUserTableExist = $this->schema->tableExist('users');\r\n\t\tif (!$isUserTableExist) {\r\n\r\n\t\t\t$fileName = \"20210408051901_create_users_table.php\";\r\n\t\t\t$dir = $this->migrationFiles . $fileName;\r\n\t\t\t$content = file_get_contents($this->stubsPath . \"user_migration.stubs\");\r\n\r\n\t\t\tif (!file_exists($dir)) {\r\n\t\t\t\t$handle = fopen($dir, 'w+');\r\n\t\t\t\tfwrite($handle, $content);\r\n\t\t\t\tfclose($handle);\r\n\t\t\t\tchmod($dir, 0777);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function migrationDown()\n {\n $this->reverse()->migrationUp();\n }",
"abstract public function migrationDown();",
"private function migrateAuthTables()\n {\n if (!Schema::hasTable('users')) {\n Schema::create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name');\n $table->string('email')->unique();\n $table->string('password');\n $table->string('remember_token', 100)->nullable();\n $table->timestamps();\n });\n }\n\n if (!Schema::hasTable('password_resets')) {\n Schema::create('password_resets', function (Blueprint $table) {\n $table->string('email')->index();\n $table->string('token');\n $table->dateTime('created_at')->nullable();\n });\n }\n }",
"public function down()\n\t{\n\t\tSchema::drop('role_user');\n\t}",
"public function up()\n\t{ // eliminamos el campo active.\n /* Schema::table('users',function(Blueprint $table){\n $table->dropColumn('active');\n });*/\n\t\t//\n\t}",
"private function createUserAlbumTableDown(): void\n\t{\n\t\tSchema::create('user_album', function (Blueprint $table) {\n\t\t\t// Column definitions\n\t\t\t$table->bigIncrements('id')->nullable(false);\n\t\t\t$table->unsignedInteger('user_id')->nullable(false);\n\t\t\t$table->unsignedBigInteger('album_id')->nullable(false);\n\t\t\t// Indices and constraint definitions\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->cascadeOnUpdate()->cascadeOnDelete();\n\t\t\t$table->foreign('album_id')->references('id')->on('albums')->cascadeOnUpdate()->cascadeOnDelete();\n\t\t});\n\t}",
"public function upgradeUsers() : void {\n $callback = function ($row) {\n $entry = new User();\n $entry->setEmail($row['username']);\n $entry->setActive((bool) $row['enabled']);\n $entry->setPassword($row['password']);\n $entry->setRoles(unserialize($row['roles']));\n $entry->setFullname($row['fullname']);\n $entry->setAffiliation($row['institution']);\n $entry->setLogin($row['last_login'] ? new DateTimeImmutable($row['last_login']) : null);\n\n return $entry;\n };\n $this->upgradeTable('appuser', $callback);\n }",
"public function upgradeUsers() : void {\n $callback = function ($row) {\n if ('admin@example.com' === $row['username']) {\n return;\n }\n $entry = new User();\n $entry->setUsername($row['username']);\n $entry->setEmail($row['username']);\n $entry->setEnabled(true);\n $entry->setSalt($row['salt']);\n $entry->setPassword($row['password']);\n $entry->setLastLogin(new DateTimeImmutable($row['last_login']));\n $entry->setRoles(unserialize($row['roles']));\n $entry->setFullname($row['fullname']);\n $entry->setInstitution($row['institution']);\n\n return $entry;\n };\n $this->upgradeTable('lom_user', $callback);\n }",
"public function up()\n {\n Schema::create('rol_user', function (Blueprint $table) {\n $table->bigIncrements('id');\n $table->unsignedBigInteger('rol_id');\n $table->unsignedBigInteger('user_id');\n $table->timestamps();\n $table->foreign('rol_id')\n ->references('id')\n ->on('rols')\n ->onDelete('cascade');\n $table->foreign('user_id')\n ->references('id')\n ->on('users')\n ->onDelete('cascade');\n });\n }",
"public function actionMigrateDown()\n {\n $this->askForInteraction();\n\n $this->db->createCommand('SET foreign_key_checks = 0;')->execute();\n\n /***************************************************************************************************************\n * Reverting application migrations.\n **************************************************************************************************************/\n\n $migrations = explode(',', env('APP_MIGRATION_LOOKUP', '@console/migrations'));\n\n // Migrations should be reverted in reversed order.\n $migrations = array_reverse($migrations);\n\n foreach ($migrations as $migrationPath) {\n $count = $this->countMigrations($migrationPath);\n if ($count > 0) {\n Yii::$app->runAction('migrate/down', [\n $count,\n 'migrationPath' => $migrationPath,\n 'interactive' => $this->interactive,\n ]);\n }\n }\n\n $this->db->createCommand('SET foreign_key_checks = 1;')->execute();\n\n /***************************************************************************************************************\n * Clearing all cache\n **************************************************************************************************************/\n\n Yii::$app->runAction('cache/flush-all');\n\n return Controller::EXIT_CODE_NORMAL;\n }",
"private function migrateTables()\n {\n $this->loadMigrationsFrom(__DIR__.'/database/migrations');\n }",
"public function up() {\n Schema::create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name');\n $table->string('email')->unique();\n $table->string('password');\n $table->dateTime(\"dob\");\n $table->enum(\"sex\", ['0', '1', '2'])->default('2'); // 0->male , 1->female , 2->unknown\n $table->rememberToken();\n $table->timestamps();\n $table->enum('is_operator', ['0', '1'])->default('0');\n $table->string('passcode', 255);\n $table->softDeletes();\n });\n }",
"public function up()\n {\n Schema::create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('firstname');\n $table->string('lastname'); \n $table->boolean('gender'); /*0:f,1:m*/\n $table->string('email')->unique();\n $table->string('username')->unique();\n $table->string('password');\n $table->string('img');\n $table->date('birthday');\n $table->string('country');\n $table->string('city');\n $table->string('adress');\n $table->string('phone');\n $table->string('facebook');\n $table->string('twitter');\n $table->string('github');\n $table->string('youtube');\n $table->string('web');\n $table->dateTime('last_login');\n $table->dateTime('last_logout'); \n $table->integer('role');/*0:user,1:admin*/\n $table->integer('bloque');/*0:bloque,1:active,2:pas encore vérifié */\n $table->rememberToken();\n $table->timestamps();\n });\n }",
"public function up()\n\t{\n\t\tSchema::create('users', function(Blueprint $table)\n\t\t{\n\t\t\t$table->increments('id')->unique();\n\t\t\t$table->string('name',150);\n\t\t\t$table->string('email',100)->unique();\n\t\t\t$table->string('egerarquico',100);\n\t\t\t$table->string('cargo',100);\n\t\t\t$table->string('telefono',100);\n\t\t\t$table->string('password', 60);\n\t\t\t$table->integer('cc_id');\n\t\t\t$table->foreign('cc_id')->references('cc_id')->on('centro_costo');//$table->integer('cc_id')->unsigned();\n\t\t\t//$table->foreign('cc_id')->references('cc_id')->on('centro_costos');\n\t\t\t$table->rememberToken();\n\t\t\t$table->timestamps();\n\n\n\n\t\t\t//$table->integer('id_director')->unsigned();//unsigned, hace referencia a que procede de otra tabla//identificador del director a la cualpertenece\n\t\t\t\n\t\t\t/*Relaciones*/\n\n\t\t});\n\t}",
"public function down()\n {\n Schema::dropIfExists('tbl_member_datas');\n }",
"final public function down(): void\n {\n // This will provide a runtime catch for any legacy migration classes that are doing the wrong thing.\n throw new \\BadMethodCallException(\n 'Unexpected call to '.__METHOD__.' - migration classes should only use `up()`'\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Manages logic for moving values from form state to items. | public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state); | [
"function _restore_POST (&$items) {\n\t\tforeach ($items as $name => $value) {\n\t\t\tunset ($_POST[$name]);\n\t\t\t$_POST[$name]=$this->POST[$name];\n\t\t}\n\t}",
"function PostProcessItemData()\n {\n $this->ItemData[ \"State\" ][ \"Values\" ]=$this->ApplicationObj()->States_Short;\n $this->ItemData[ \"State\" ][ \"Default\" ]=9;//GO...\n \n $this->InscriptionsObj()->ItemData(\"ID\");\n $this->InscriptionsObj()->ItemDataGroups(\"Basic\");\n $this->InscriptionsObj()->Actions(\"Search\");\n\n\n $this->Unit2ItemData();\n $this->Today2ItemData();\n \n $this->ItemData[ \"HtmlIcon1\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"HtmlIcon2\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"Initials\" ][ \"Coordinator\" ]=2;\n }",
"protected function storeStateValues(array &$form, FormStateInterface $form_state) {\n $form_state->cleanValues();\n $values = $form_state->getValues();\n $this->setStateValues($values);\n }",
"public function processAddItemForm(Form $form)\r\n\t{\r\n\t\t$values = $form->values;\r\n\r\n\t\t$item = new Item;\r\n\t\t$item->assign($values, array('title', 'price', 'remaining'));\r\n\t\t$item->user = $this->user->getLoggedUser();\r\n\r\n\t\t$images = array();\r\n\t\t$images[] = new Image($values->image->getTemporaryFile(), null, $values->image->getName());\r\n\r\n\t\t$this->shop->addItem($item, $images);\r\n\t}",
"function setValuesByPost()\n\t{\n\t foreach($this->items as $item)\n\t\t{\n\t\t\t$item->setValueByArray($_POST);\n\t\t}\n\t}",
"function PostProcessItemData()\n {\n $this->ItemData[ \"State\" ][ \"Values\" ]=$this->ApplicationObj->States_Short;\n $this->ItemData[ \"State\" ][ \"Default\" ]=9;//GO...\n\n $this->AddMails2ItemData(\"../EventApp/System/Units/Data.Mails.php\");\n $this->AddMailTypes2ItemData(\"../EventApp/System/Units/Emails/Data.php\");\n\n $this->MailTypesObj()->Sql_Table_Structure_Update();\n }",
"protected function setValues()\n {\n $itemValues = $this->getEntity()->getItemFields();\n $valuesArray = array();\n foreach($itemValues as $valItemField) \n\t\t{ \n\t\t $fieldEntity = $valItemField->getField();\t\t\t\n\t\t\t\n switch ($fieldEntity->getType()) \n\t\t\t{\n\t\t\t\t\t\t \n case 'text':\n\t\t\t \n\t\t\tcase 'textarea':\n $value = $valItemField->getValue();\n break;\n\t\t\n\t\t\tcase 'pageselect':\n\t\t\t\n\t\t /*OLD METHOD STARTS*/ /*COMMENTED FOR TESTING*/\t\n\t\t\t//$value = unserialize($valItemField->getValue());\n\t\t\t//break;\n /*OLD METHOD ENDS*/\t\t\t\n\t\t\t\n\t\t\t//NEW METHOD IN PLACE STARTS 20 OCT 2014, 1:21 PM \n\t\t\t//print_r($valItemField->getPageId());\n\t\t // NEW METHOD IN PLACE STARTS 20 OCT 2014, 1:21 PM \n\t\t\t$value1 = $valItemField->getitemId();\n\t\t\tprint_r(\"Item Id :\");\n\t\t\tprint_r($this->getId());\n\t\t\tprint_r(\" \");\n\t\t\t/*\n\t\t\t//echo \"<br>\";\n\t\t\t//print_r(\"Page Id:\");\n\t\t\t//$value = $valItemField->getPageId();\t\t\t\n\t\t\t//print_r($value);\n\t\t\t//echo \"<br>\";\n\t\t\t//$result=array();\n\t\t\t//$result = $this->getDefaultEntityManager()->getRepository(‘DynamicListModule\\Entity\\DynamicListModulePages’)->findBy(array(‘itemId’ => $this->getId())); \n\t\t\t\t \n\t\t\t foreach($result as &$currentvalue)\n\t\t\t\t{\t\t\t\n\t\t\t\tprint_r(\"Page Id: \"); \n\t\t\t\tprint_r($currentvalue);\n $value=$valItemField->getItemsByPage();\t\t\t\t\n echo '<br/>';\n echo '<br/>';\t\n\t\t\t\t}\n\t\t\t */\t\t\t\n\t\t\tbreak;\n\t\t \n case 'multiselect':\n\t\t $value = unserialize($valItemField->getValue());\n\t\t\t\t $value1 = $valItemField->getitemId();\n\t\t\t print_r(\"Item Id :\");\n\t\t\t print_r($this->getId());\n\t\t\t print_r(\" \");\n\t\t\t\t//$result = $this->getDefaultEntityManager()->getRepository(‘DynamicListModule\\Entity\\DynamicListModulePages’)->findBy(array(‘itemId’ =>$this->getId())); \n\t\t\t\t//print_r($result);\n\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t\n default:$value = unserialize($valItemField->getValue());\n break;\n }\n $valuesArray[$fieldEntity->getName()] = $value;\n }\n $this->values = $valuesArray;\n }",
"function ItemForm_Update()\n {\n if (!empty($this->Args[ \"Item\" ]))\n {\n $this->Args[ \"Item\" ]=$this->MyMod_Item_Update_CGI\n (\n $this->Args[ \"Item\" ],\n $this->ItemForm_SGroupsDatas(1,TRUE)\n );\n\n $this->ItemsForm_FromUpdated=$this->FormWasUpdated;\n }\n }",
"protected function populateState()\n\t{\n\t\tparent::populateState();\n\t}",
"function PostProcessItemList(&$items)\n {\n foreach (array_keys($items) as $id)\n {\n $items[$id]=$this->PostProcessItem($items[$id]);\n }\n }",
"function voer_collection_creation_wizard_next_submit($form, &$form_state) {\n $current_step = &$form_state['step'];\n $form_state['step_information'][$current_step]['stored_values'] = $form_state['values'];\n\n if ($current_step < count($form_state['step_information'])) {\n $current_step++;\n if (!empty($form_state['step_information'][$current_step]['stored_values'])) {\n $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];\n }\n else {\n $form_state['values'] = array();\n }\n $form_state['rebuild'] = TRUE; // Force rebuild with next step.\n return;\n }\n}",
"private function transferSavedElementValues() {\r\n if(!$this->getIdListToSave()->isEmpty()) {\r\n foreach($this->getIdListToSave() as $item) {\r\n $value = $this->dataSaverAdapter->getItemValue($this->formId, $item);\r\n if($value !== false && ($element = $this->getElementById($item)) !== false) {\r\n $element->fillElement($value);\r\n }\r\n }\r\n }\r\n }",
"function property_default_extract_form_values($entity_type, $entity, $name, &$items, $langcode = NULL, $form, &$form_state) {}",
"function store_values() {\n // Kill the old form_values session.\n unset($_SESSION['form_values']);\n\n $fields = $this->form['fields'];\n\n foreach ($fields as $k => $field) {\n $_SESSION['form_values'][$k] = $_POST[$k];\n\n // And we add that to this form as well as to the session.\n $this->form['fields'][$k]['value'] = $_POST[$k];\n }\n }",
"function _lightshop_basket_update($form, &$form_state) {\n $values = $form_state['values']['items'];\n $updated = FALSE;\n foreach ($values as $key => $val) {\n if ($val['del']) {\n drupal_set_message(t('\"%title\" was removed from your basket', array(\n '%title' => $_SESSION['basket']['items'][$key]['title'],\n )));\n unset($_SESSION['basket']['items'][$key]);\n if (isset($_SESSION['basket']['store'][$key])) {\n unset($_SESSION['basket']['store'][$key]);\n }\n $updated = TRUE;\n }\n elseif (variable_get('lightshop_show_qty', TRUE) && $_SESSION['basket']['items'][$key]['qty'] != $val['qty']) {\n $_SESSION['basket']['items'][$key]['qty'] = $val['qty'];\n if (variable_get('lightshop_show_price', FALSE)) {\n $_SESSION['basket']['items'][$key]['price'] = $val['qty'] * $_SESSION['basket']['store'][$key]['unit_price'];\n }\n drupal_set_message(t('\"%title\": successfully updated', array(\n '%title' => $_SESSION['basket']['items'][$key]['title'],\n )));\n $updated = TRUE;\n }\n }\n if ($updated) {\n $form_state['rebuild'] = TRUE;\n _lightshop_update_total();\n }\n}",
"public function SaveActionItems() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtAction) $this->objActionItems->Action = $this->txtAction->Text;\n\t\t\t\tif ($this->lstStrategy) $this->objActionItems->StrategyId = $this->lstStrategy->SelectedValue;\n\t\t\t\tif ($this->lstScorecard) $this->objActionItems->ScorecardId = $this->lstScorecard->SelectedValue;\n\t\t\t\tif ($this->lstWhoObject) $this->objActionItems->Who = $this->lstWhoObject->SelectedValue;\n\t\t\t\tif ($this->calWhen) $this->objActionItems->When = $this->calWhen->DateTime;\n\t\t\t\tif ($this->lstStatusTypeObject) $this->objActionItems->StatusType = $this->lstStatusTypeObject->SelectedValue;\n\t\t\t\tif ($this->txtComments) $this->objActionItems->Comments = $this->txtComments->Text;\n\t\t\t\tif ($this->lstCategory) $this->objActionItems->CategoryId = $this->lstCategory->SelectedValue;\n\t\t\t\tif ($this->txtCount) $this->objActionItems->Count = $this->txtCount->Text;\n\t\t\t\tif ($this->lstModifiedByObject) $this->objActionItems->ModifiedBy = $this->lstModifiedByObject->SelectedValue;\n\t\t\t\tif ($this->chkRank) $this->objActionItems->Rank = $this->chkRank->Checked;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the ActionItems object\n\t\t\t\t$this->objActionItems->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }",
"protected function populateState()\n\t{\n // Заказ\n $this->setState('order.id', JRequest::getInt('id',JRequest::getInt('order_id',0)));\n\t}",
"function processData() \n {\n\n $this->dataManager->loadFromArray( $this->formValues );\n $this->dataManager->createNewEntry();\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate "CDF" for normal distribution of some range of numbers | public function getNormalCDF(array $range = [], float $mu = 0, float $sigma = 1, float $step = 0.2): array
{
if ($step <= 0) {
throw new ServiceException('Param "step" must be bigger than 0', ServiceException::CODE_INVALID_PARAMS);
}
if (!isset($range[0])) {
$range[0] = -5;
}
if (!isset($range[1])) {
$range[1] = 5;
}
list($from, $to) = [$range[0], $range[1]];
$result = [];
for ($i = $from; $i <= $to; $i += $step) {
$i = floatval(number_format($i, 2));
$result[] = ['index' => $i, 'value' => $this->calc->normalCDF($i, $mu, $sigma)];
}
return $result;
} | [
"function normal_cdf($z) {\n\t\t\n\t\treturn (1+erf($z/sqrt(2)))/2;\n\t}",
"function stdnormcdf($z) {\n if ($z < 0) {\n return 1 - stdnormcdf(-$z);\n }\n $n = max(10, floor(10 * $z));\n $h = $z / $n;\n $res = stdnormpdf(0) + stdnormpdf($z);\n for ($i = 1; $i < $n; $i++) {\n $res += 2 * stdnormpdf($i * $h);\n $res += 4 * stdnormpdf(($i - 0.5) * $h);\n }\n $res += 4 * stdnormpdf(($n - 0.5) * $h);\n $res *= $h / 6;\n return $res + 0.5;\n}",
"function sn_cdf($x, $location, $scale, $shape)\r\n{\r\n $f = 0.5 * (1 + erf(($x - $location) / ($scale * M_SQRT2)));\r\n \r\n $t = t_func(($x - $location) / $scale, $shape);\r\n\r\n return ($f - 2 * $t);\r\n}",
"public function test_normcdf() {\n // Test if function is accepted and parsed.\n $qv = new variables;\n $errmsg = null;\n try {\n $v = $qv->vstack_create();\n $result = $qv->evaluate_assignments($v, 'a=normcdf(1, 1, 1);');\n } catch (Exception $e) {\n $errmsg = $e->getMessage();\n }\n $this->assertNull($errmsg);\n\n // Test if function works correctly.\n $testcases = array(\n array(normcdf(1, 1, 5), 0.5),\n array(normcdf(3, 3, 5), 0.5),\n array(normcdf(7, 10, 30), 0.46017),\n array(normcdf(-8, 10, 30), 0.27425),\n array(normcdf(15, 5, 10), 0.84134),\n array(normcdf(-5, 5, 10), 0.15866)\n );\n foreach ($testcases as $case) {\n $this->assertEqualsWithDelta($case[1], $case[0], .00001);\n }\n }",
"public function ecdf($value) {\n $n = $this->length();\n $count = 0;\n for ($i=0; $i<$n; $i++) {\n if ($this->value[$i] <= $value) {\n $count++;\n }\n }\n return $count / $n;\n }",
"public function normCDF ($z)\n {\n $max = 6;\n\n if ($z == 0) {\n $x = 0;\n } else {\n $y = abs($z) / 2;\n if ($y >= ($max / 2)) {\n $x = 1;\n } elseif ($y < 1) {\n $w = $y * $y;\n $x = ((((((((0.000124818987 * $w\n - 0.001075204047) * $w + 0.005198775019) * $w\n - 0.019198292004) * $w + 0.059054035642) * $w\n - 0.151968751364) * $w + 0.319152932694) * $w\n - 0.531923007300) * $w + 0.797884560593) * $y * 2;\n } else {\n $y -= 2;\n $x = (((((((((((((-0.000045255659 * $y\n + 0.000152529290) * $y - 0.000019538132) * $y\n - 0.000676904986) * $y + 0.001390604284) * $y\n - 0.000794620820) * $y - 0.002034254874) * $y\n + 0.006549791214) * $y - 0.010557625006) * $y\n + 0.011630447319) * $y - 0.009279453341) * $y\n + 0.005353579108) * $y - 0.002141268741) * $y\n + 0.000535310849) * $y + 0.999936657524;\n }\n }\n\n if ($z > 0) {\n $result = ($x + 1) / 2;\n } else {\n $result = (1 - $x) / 2;\n }\n\n return $result;\n }",
"public function cdf(int $r): float\n {\n Support::checkLimits(self::SUPPORT_LIMITS, ['r' => $r]);\n\n $cdf = 0;\n for ($i = $r; $i >= 0; $i--) {\n $cdf += $this->pmf($i);\n }\n return $cdf;\n }",
"function stats_cdf_negative_binomial (float $par1, float $par2, float $par3, int $which): float {\n}",
"function chiDist ($x, $df)\n {\n define(LOG_SQRT_PI, log(sqrt(pi())));\n define(I_SQRT_PI, 1 / sqrt(pi()));\n\n if ($x <= 0 || $df < 1) {\n $result = 1;\n }\n\n $a = $x / 2;\n\n if ($df % 2 == 0) {\n $even = true;\n } else {\n $even = false;\n }\n\n if ($df > 1) {\n $y = exp(-1 * $a);\n }\n\n if ($even) {\n $s = $y;\n } else {\n $s = 2 * normCDF(-1 * sqrt($x));\n }\n\n if ($df > 2) {\n $x = ($df - 1) / 2;\n\n if ($even) {\n $z = 1;\n } else {\n $z = 0.5;\n }\n\n if ($a > 20) {\n if ($even) {\n $e = 0;\n } else {\n $e = LOG_SQRT_PI;\n }\n\n $c = log($a);\n\n while ($z <= $x) {\n $e += log($z);\n $s += exp($c * $z - $a - $e);\n $z += 1;\n }\n\n $result = $s;\n } else {\n if ($even) {\n $e = 1;\n } else {\n $e = I_SQRT_PI / sqrt($a);\n }\n\n $c = 0;\n\n while ($z <= $x) {\n $e *= ($a / $z);\n $c += $e;\n $z += 1;\n }\n\n $result = $c * $y + $s;\n }\n } else {\n $result = $s;\n }\n\n return $result;\n }",
"private static function _inverse_ncdf($p) {\n\t\t//\tInverse ncdf approximation by Peter J. Acklam, implementation adapted to\n\t\t//\tPHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as\n\t\t//\ta guide. http://home.online.no/~pjacklam/notes/invnorm/index.html\n\t\t//\tI have not checked the accuracy of this implementation. Be aware that PHP\n\t\t//\twill truncate the coeficcients to 14 digits.\n\n\t\t//\tYou have permission to use and distribute this function freely for\n\t\t//\twhatever purpose you want, but please show common courtesy and give credit\n\t\t//\twhere credit is due.\n\n\t\t//\tInput paramater is $p - probability - where 0 < p < 1.\n\n\t\t//\tCoefficients in rational approximations\n\t\tstatic $a = array(\t1 => -3.969683028665376e+01,\n\t\t\t\t\t\t\t2 => 2.209460984245205e+02,\n\t\t\t\t\t\t\t3 => -2.759285104469687e+02,\n\t\t\t\t\t\t\t4 => 1.383577518672690e+02,\n\t\t\t\t\t\t\t5 => -3.066479806614716e+01,\n\t\t\t\t\t\t\t6 => 2.506628277459239e+00\n\t\t\t\t\t\t );\n\n\t\tstatic $b = array(\t1 => -5.447609879822406e+01,\n\t\t\t\t\t\t\t2 => 1.615858368580409e+02,\n\t\t\t\t\t\t\t3 => -1.556989798598866e+02,\n\t\t\t\t\t\t\t4 => 6.680131188771972e+01,\n\t\t\t\t\t\t\t5 => -1.328068155288572e+01\n\t\t\t\t\t\t );\n\n\t\tstatic $c = array(\t1 => -7.784894002430293e-03,\n\t\t\t\t\t\t\t2 => -3.223964580411365e-01,\n\t\t\t\t\t\t\t3 => -2.400758277161838e+00,\n\t\t\t\t\t\t\t4 => -2.549732539343734e+00,\n\t\t\t\t\t\t\t5 => 4.374664141464968e+00,\n\t\t\t\t\t\t\t6 => 2.938163982698783e+00\n\t\t\t\t\t\t );\n\n\t\tstatic $d = array(\t1 => 7.784695709041462e-03,\n\t\t\t\t\t\t\t2 => 3.224671290700398e-01,\n\t\t\t\t\t\t\t3 => 2.445134137142996e+00,\n\t\t\t\t\t\t\t4 => 3.754408661907416e+00\n\t\t\t\t\t\t );\n\n\t\t//\tDefine lower and upper region break-points.\n\t\t$p_low = 0.02425;\t\t\t//Use lower region approx. below this\n\t\t$p_high = 1 - $p_low;\t\t//Use upper region approx. above this\n\n\t\tif (0 < $p && $p < $p_low) {\n\t\t\t//\tRational approximation for lower region.\n\t\t\t$q = sqrt(-2 * log($p));\n\t\t\treturn ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /\n\t\t\t\t\t(((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);\n\t\t} elseif ($p_low <= $p && $p <= $p_high) {\n\t\t\t//\tRational approximation for central region.\n\t\t\t$q = $p - 0.5;\n\t\t\t$r = $q * $q;\n\t\t\treturn ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q /\n\t\t\t\t ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1);\n\t\t} elseif ($p_high < $p && $p < 1) {\n\t\t\t//\tRational approximation for upper region.\n\t\t\t$q = sqrt(-2 * log(1 - $p));\n\t\t\treturn -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /\n\t\t\t\t\t (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);\n\t\t}\n\t\t//\tIf 0 < p < 1, return a null value\n\t\treturn self::$_errorCodes['null'];\n\t}",
"function stats_cdf_poisson($par1, $par2, $which)\n{\n}",
"public function chiDist ($x, $df)\n {\n \n$LOG_SQRT_PI=log(sqrt(pi()));\n$I_SQRT_PI=1 / sqrt(pi());\n\n\t // define(LOG_SQRT_PI, log(sqrt(pi())));\n // define(I_SQRT_PI, 1 / sqrt(pi()));\n\n if ($x <= 0 || $df < 1) {\n $result = 1;\n }\n\n $a = $x / 2;\n\n if ($df % 2 == 0) {\n $even = true;\n } else {\n $even = false;\n }\n\n if ($df > 1) {\n $y = exp(-1 * $a);\n }\n\n if ($even) {\n $s = $y;\n } else {\n $s = 2 * $this->normCDF(-1 * sqrt($x));\n }\n\n if ($df > 2) {\n $x = ($df - 1) / 2;\n\n if ($even) {\n $z = 1;\n } else {\n $z = 0.5;\n }\n\n if ($a > 20) {\n if ($even) {\n $e = 0;\n } else {\n $e = $LOG_SQRT_PI;\n }\n\n $c = log($a);\n\n while ($z <= $x) {\n $e += log($z);\n $s += exp($c * $z - $a - $e);\n $z += 1;\n }\n\n $result = $s;\n } else {\n if ($even) {\n $e = 1;\n } else {\n $e = $I_SQRT_PI / sqrt($a);\n }\n\n $c = 0;\n\n while ($z <= $x) {\n $e *= ($a / $z);\n $c += $e;\n $z += 1;\n }\n\n $result = $c * $y + $s;\n }\n } else {\n $result = $s;\n }\n\n return $result;\n }",
"public function cdf(int $a, int $b=null){\r\n\t\t$q=1-$this->p;\r\n\t\t$n=pow($q,$a);\r\n\t\treturn $a<1?1-1/$n:$n/$q-($b>$a?pow($q,$b):0);\r\n\r\n\t}",
"function cosfade( $number, $start, $end )\r\n{\r\n if ( $number <= $start )\r\n {\r\n $result = 1.0;\r\n }\r\n else\r\n {\r\n if ( $number >= $end )\r\n {\r\n $result = 0.0;\r\n }\r\n else\r\n {\r\n $result = 0.5 * ( cos( pi() * ( $number - $start ) / ( $end - $start ) ) + 1.0 );\r\n }\r\n }\r\n\r\n return $result;\r\n}",
"function normdist($X, $mean, $sdev) {\n\t\t// I did not \"write\" this... nor do I fully understand it...\n\t\t// it is math that uses seemingly random floats\n\t\t// to give me probabilities. Yay Math-Heads!\n\t\t$res = 0;\n\t\t$x = ($X - $mean) / $sdev;\n\t\tif ($x == 0) {\n\t\t\t$res = 0.5;\n\t\t} else {\n\t\t\t$odsqrt2pi = 1 / ( sqrt( 2 * pi() ) );\n\t\t\t// One divided the square root of pi times two? ... ?? ... Thats not real math... thats crazy talk you say when you are trying to confuse someone or make a math joke.\n\t\t\t$t = 1 / (1 + 0.2316419 * abs($x));\n\t\t\t$t *= $odsqrt2pi * exp(-0.5 * $x * $x) * (0.31938153 + $t * (-0.356563782 + $t * (1.781477937 + $t * (-1.821255978 + $t * 1.330274429))));\n\t\t\t// Part of me wants to know where those numbers come from. Part of me is scared of the answer.\n\t\t\tif ($x >= 0) {\n\t\t\t $res = 1 - $t;\n\t\t\t} else {\n\t\t\t $res = $t;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}",
"public function inverseNormalCDF(float $p, float $mu = 0, float $sigma = 1, float $tolerance = 0.00001)\n {\n // If this is not a standard distribution - standardize\n if ($mu != 0 || $sigma != 1) {\n return $mu + $sigma * $this->inverseNormalCDF($p, 0, 1, $tolerance);\n }\n\n $lowZ = -10; // normalCDF(-10) is very close to 0\n $hiZ = 10; // normalCDF(10) is very close to 1\n\n $midZ = 0;\n $i = 0;\n while ($hiZ - $lowZ > $tolerance) {\n $midZ = ($lowZ + $hiZ) / 2; // Get the middle\n $midP = $this->normalCDF($midZ); // adn the \"CDF\" in of this point\n if ($midP < $p) {\n // The value of the middle point is very low, keep searching up...\n $lowZ = $midZ;\n } else {\n $hiZ = $midZ;\n }\n $i++;\n }\n\n return $midZ;\n }",
"function stats_cdf_beta (float $par1, float $par2, float $par3, int $which): float {\n}",
"function normal_random($min, $max, $std_dev, $step=1){\n\t$rand1 = (float)mt_rand()/(float)mt_getrandmax();\n\t$rand2 = (float)mt_rand()/(float)mt_getrandmax();\n\t$guassian_num = sqrt(-2 * log($rand1)) * cos(2 * M_PI * $rand2);\n\t$mean = ($max + $min) / 2;\n\t$random_num = ($guassian_num * $std_dev) + $mean;\n\t$random_num = round($random_num / $step) * $step;\n\tif($random_num < $min || $random_num > $max) $random_num = normal_random($min, $max, $std_dev, $step);// make sure in the range\n\treturn $random_num;\n}",
"public function testRangeFloats() {\n $values = [11, 13, 4.3, 15.5, 14];\n $result = Stats::range($values);\n $expected = 11.2;\n ok($expected, $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the placeholder text for the search form in the header | function psb_form_search_api_page_search_form_default_search_alter(&$form, &$form_state, $form_id) {
$form['keys_1']['#attributes']['placeholder'] = 'Search website';
} | [
"function captogov_form_alter( &$form, &$form_state, $form_id )\n{\n if ($form_id == 'search_api_page_search_form_default_search') { \n $form['keys_1']['#attributes']['placeholder'] = t( 'Search our website' );\n }\n}",
"public function searchTextPlaceholder()\r\n\t{\r\n\t\treturn $this->_v('searchable.input.placeholder', 'Search Data');\r\n\t}",
"function electro_header_search_box() {\n\n\t}",
"function pivot_global_form_alter(&$form, &$form_state, $form_id) {\n // removed per PIV-285, but left this here in case this comes back\n // if ($form_id == 'search_block_form') {\n // // Add HTML5 placeholder attribute\n // $form['search_block_form']['#attributes']['placeholder'] = t('Search');\n // }\n}",
"public function setPlaceholder($placeholder);",
"function elm_Page_ReplacePlaceholder($placeholder, $value)\n{\n global $elm_Page_HTML;\n $elm_Page_HTML = str_replace($placeholder, $value, $elm_Page_HTML);\n}",
"public function setPlaceholder($placeholder) {\n $this->addPlaceholder($placeholder);\n }",
"function tutv_header_search() {\n echo '<div class=\"header-search\">';\n get_search_form();\n echo '</div> <!-- end .header-search -->';\n}",
"function reload_search_result_body() {\n $page_data['search_key'] = $this->input->post('search_key');\n $this->load->view('backend/admin/search_result', $page_data);\n }",
"public static function headerSearch() {\n $html = \"<form id='search' action='movies.php#anchor'>\\n\";\n $html .= \"<input type='search' name='title' placeholder='Sök efter film'/><input type='submit' name='submit' value='Sök'/>\\n\";\n $html .= \"</form>\\n\"; \n return $html;\n }",
"function pi_list_searchBox($divParams='',$header=false) {\n\t\t// the $sBox search-form gets displayed on the result-page of the search accomplished by $this->do_search\n\t\t// searchword is run against white list (here and in do_search) by $this->check_searchword\n\n\n\t\t// Search box design:\n\t\tif ($this->piVars['sword'] <= '') {\n\t\t\t $this->piVars['sword'] = $this->pi_getLL('pi_list_searchBox_defaultValue','search item');\n\t\t}\n\t\t// changed action tag according to instructions from security review:\n\t\t// dropped:\t\t<form method=\"post\" action=\"'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'\" style=\"margin: 0 0 0 0;\" >\n\t\t// introduced:\t<form method=\"post\" action=\"'.htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1)).'\" style=\"margin: 0 0 0 0;\" >\n\n\n\n\t\t// $this->pi_classParam('searchbox-sword') contains the markup for css: 'class=\"tx-civserv-pi1-searchbox-sword\"'\n\t\t$search_word=$this->check_searchword(strip_tags($this->piVars['sword'])); //strip and check to avoid xss-exploits\n\n\t\tif(\t\t$GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] == 'utf-8' ||\n\t\t\t\t$GLOBALS['TSFE']->metaCharset == 'utf-8' ||\n\t\t\t\t$GLOBALS['TSFE']->renderCharset == 'utf-8' ){\n\t\t\t$search_word = htmlentities($search_word, ENT_COMPAT, 'UTF-8');\n\t\t}else{\n\t\t\t$search_word = htmlentities($search_word);\n\t\t}\n\n\n\t\t$sBox = '\n\n\t\t<!--\n\t\t\tList search box:\n\t\t-->\n\n\t\t<div' . $this->pi_classParam('searchbox') . '>\n\t\t\t<form method=\"post\" action=\"'.htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1)).'\" style=\"margin: 0 0 0 0;\" >\n\t\t\t\t<fieldset>\n \t\t\t\t<legend>' . $this->pi_getLL('pi_list_searchBox_searchform','Search form') . '</legend>\n \t\t\t\t<div class=\"searchform\" ' . trim($divParams) . '>\n \t\t\t\t<p><label for=\"query\" title=\"' . $this->pi_getLL('pi_list_searchBox_searchkey','Please enter here your search key') . '\">' .\n \t\t\t\t\t($header?'<strong>' . $this->pi_getLL('pi_list_searchBox_header','Keyword search') . ':</strong><br />':'') .\n \t\t\t\t'</label></p>\n \t\t\t\t\t<input type=\"text\" name=\"' . $this->prefixId . '[sword]\" id=\"query\" class=\"searchkey\" size=\"16\" maxlength=\"60\" value=\"' . $search_word . '\"' . $this->pi_classParam('searchbox-sword') . ' onblur=\"if(this.value==\\'\\') this.value=\\'' . $search_word . '\\';\" onfocus=\"if(this.value==\\'' . $this->pi_getLL('pi_list_searchBox_defaultValue','search item') . '\\') this.value=\\'\\';\" />\n \t\t\t\t<input type=\"submit\" value=\"' . $this->pi_getLL('pi_list_searchBox_search','Search',TRUE) . '\"' . $this->pi_classParam('searchbox-button') . ' accesskey=\"S\" title=\"' . $this->pi_getLL('pi_list_searchBox_submit','Klick here, to submit the search query') . '\"/>\n \t\t\t\t<input type=\"hidden\" name=\"no_cache\" value=\"1\" />\n \t\t\t\t<input type=\"hidden\" name=\"'.$this->prefixId.'[pointer]\" value=\"\" />\n \t\t\t\t</div>\n \t\t\t</fieldset>\n \t\t </form>\n\t\t</div>';\n\t\treturn $sBox;\n\t}",
"function widget_gajaxsearch_control() {\n\n\t\t// Get our options and see if we're handling a form submission.\n\t\t$options = get_option('widget_gajaxsearch');\n\t\tif ( !is_array($options) )\n\t\t\t$options = array('title'=>'', 'buttontext'=>__('Google AJAX Search', 'widgets'));\n\t\tif ( $_POST['gajaxsearch-submit'] ) {\n\n\t\t\t// Remember to sanitize and format use input appropriately.\n\t\t\t$options['title'] = strip_tags(stripslashes($_POST['gajaxsearch-title']));\n\t\t\tupdate_option('widget_gajaxsearch', $options);\n\t\t\t$buttontext = htmlspecialchars($options['buttontext'], ENT_QUOTES);\n\t\t}\n\n\t\t// Be sure you format your options to be valid HTML attributes.\n\t\n\t\t\n\t\t\t// Here is our little form segment. Notice that we don't need a\n\t\t\t// complete form. This will be embedded into the existing form.\n\t\t\techo '<p style=\"text-align:right;\"><label for=\"gajaxsearch-title\">' . __('Title:') . ' <input style=\"width: 200px;\" id=\"gajaxsearch-title\" name=\"gajaxsearch-title\" type=\"text\" value=\"'.$title.'\" /></label></p>';\n\t\t\t\n\t\t\techo '<input type=\"hidden\" id=\"gajaxsearch-submit\" name=\"gajaxsearch-submit\" value=\"1\" />';\n\t}",
"private function outputSearch() {\n?>\n <form\n action=\"<?php $this->text( 'wgScript' ) ?>\"\n role=\"search\"\n class=\"mw-portlet\"\n id=\"p-search\"\n >\n <input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\" />\n <h3>\n <label for=\"searchInput\"><?php echo $this->getMsg( 'search' )->escaped() ?></label>\n </h3>\n <?php echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ) ?>\n <?php echo $this->makeSearchButton( 'go', array( 'id' => 'searchGoButton', 'class' => 'searchButton' ) ) ?>\n <input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\"/>\n </form>\n<?php\n }",
"function pmp_dist_search_after_primary() { ?>\n\t<!-- Distributor search -->\n\t<label for=\"distributor\">Search by distributor GUID:</label>\n\t<input type=\"text\" name=\"distributor\" placeholder=\"Search by distributor GUID\"></input><?php\n}",
"public function placeholder($placeholder){ $this->attributes['placeholder']=$placeholder; return $this; }",
"public function printSearchBox() {}",
"public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"function wpex_search_header_replace() {\n\tif ( 'header_replace' == wpex_header_menu_search_style() ) {\n\t\twpex_get_template_part( 'header_search_replace' );\n\t}\n}",
"function wsf_add_search_input() { ?>\n<div id=\"available-widgets-filter\">\n\t<label class=\"screen-reader-text\" for=\"widgets-search\"><?php _e( 'Search Widgets', 'widget-search-filter' ); ?></label>\n\t<input type=\"search\" id=\"widgets-search\" placeholder=\"<?php esc_attr_e( 'Search widgets…', 'widget-search-filter' ) ?>\" />\n</div>\n<?php }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new education record for a user's profile | function createEducation(Request $request)
{
$this->logger->info("UserProfileController::createEducation");
try {
// validate request input follows rules
$this->validateEducation($request);
// get inputs
$inputInstitution = $request->input('institution');
$inputLevel = $request->input('level');
$inputDegree = $request->input('degree');
// get user from session
/* @var $user UserModel */
$user = session('user');
// create model (set id to -1 to indicate a new record to insert)
$model = new EducationModel(-1, $user->getId(), $inputInstitution, $inputLevel, $inputDegree);
// commit changes
$profileSvc = new EducationBusinessService();
$profileSvc->updateEducation($model);
// render user profile page
return redirect()->action("UserProfileController@show");
} catch (ValidationException $ve) {
$this->logger->warning("UserProfileController validation exception");
throw $ve;
} catch (\PDOException $e) {
$this->logger->error("UserProfileController::createEducation error");
return view("error");
}
} | [
"function createEducation(Education $education)\n {\n Log::info(\"Entering EducationDataService::createEducation()\");\n try{\n /* Insert user information to User\n * STATUS is set to be active when registered\n */\n $statement = $this->connection->prepare(\"INSERT INTO EDUCATION ( SCHOOL, DEGREE, FIELD, GRADUATION_YEAR, USER_ID) VALUES (:school, :degree, :field, :graduationyear, :user_id)\");\n \n if(!$statement){\n echo \"Something wrong in the binding process.sql error?\";\n exit;\n }\n \n $school = $education->getSchool();\n $degree = $education->getDegree();\n $field = $education->getField();\n $graduationyear = $education->getGraduationyear();\n $user_id = $education->getUser_id();\n \n //bindParam properties\n $statement->bindParam(':school', $school);\n $statement->bindParam(':degree', $degree);\n $statement->bindParam(':field', $field);\n $statement->bindParam(':graduationyear', $graduationyear);\n $statement->bindParam(':user_id', $user_id);\n $statement->execute();\n \n // if statement succeses return true, else return false\n if($statement->rowCount() > 0)\n {\n \n Log::info(\"Exit EducationDataService.createEducation with true\");\n return true;\n \n }else{\n Log::info(\"Exit EducationDataService.createEducation with false\");\n return false;\n }\n }catch(PDOException $e)\n {\n // catch exception and throw DatabaseException\n Log::error(\"Exception: \", array(\"message \" => $e->getMessage()));\n throw new DatabaseException(\"Database Exception: \". $e->getMessage(), 0, $e);\n }\n }",
"public function createEducation(EducationModel $education)\n {\n //Establishing connection to the database.\n $link = new Database();\n $database = $link->getConnection();\n \n //Retrieving values of passed Education Model object.\n $id = $education->getID();\n $school = $education->getSchool();\n $degree = $education->getDegree();\n $study = $education->getStudy();\n $startDate = $education->getStartDate();\n $endDate = $education->getEndDate();\n $grade = $education->getGrade();\n $description = $education->getDescription();\n $userID = $education->getUserID();\n \n //Creating query to insert values into education table.\n $sql = \"INSERT INTO education(school, degree, field_of_study, start_date, end_date, grade, description, user_id) \n VALUES ('$school', '$degree', '$study', '$startDate', '$endDate', '$grade', '$description', '$userID')\";\n \n //Checking results of operation. Returning true or false based on the result.\n if(mysqli_query($database, $sql))\n {\n echo \"Created education for \" . $userID . \"<br>\";\n return true;\n }\n else\n {\n echo \"Failed to create education for \" . $userID . \"<br>\";\n echo \"Error description: \" . $database->error . \"<br>\";\n return false;\n }\n }",
"public function createEducation(Request $request)\n {\n $this->logger->info(\"Entering ProfileController.createEducation()\");\n try{\n $va = new ValidationModel();\n // run data validation rules\n $this->validate($request, $va->validateEducation());\n $edSchool = $request->input('school');\n $edDesc = $request->input('description');\n //new instance of business servic\n $profileBS = new EducationBusinessService();\n $this->logger->info(\" Parameters: \", array(\"School\" => $edSchool, \"Description\" => $edDesc));\n $education = new EducationModel(null, $edSchool, $edDesc, session()->get('users_id'));\n $userEducation = $profileBS->insertEducation($education);\n //checks if education variable has information\n if($userEducation)\n {\n $this->logger->info(\"Exiting ProfileController.createEducation() with education passed\");\n //call getAllUsers method from sevice and store in new users variable\n $educations = $profileBS->retrieveAllEducations(session()->get('users_id'));\n //if statement checking if $users returns true\n \n //store value of users into new variable\n $data = ['model' => $educations];\n //if role == 1\n //return userstable view with data holding users\n return view(\"education.educationTable\")->with($data);\n \n }\n } catch (ValidationException $e1) {\n throw $e1;\n } catch (Exception $e2) {\n // display our Global Exception Handler page\n $this->logger->error(\"Exiting ProfileController.createEducation() with education failed \");\n return view(\"error\");\n }\n }",
"public function onCreateUserEducation(Request $request)\n {\n $this->logger->info(\"\\Entering \" . substr(strrchr(__METHOD__, \"\\\\\"), 1));\n try {\n // Creates a ValidationRules and validates the request with the user education rules\n $vr = new ValidationRules();\n $this->validate($request, $vr->getUserEducationRules());\n\n // Sets variables from the request inputs\n $school = $request->input('school');\n $degree = $request->input('degree');\n $years = $request->input('years');\n\n // Creates UserEducation model from the variables\n $education = new UserEducationModel(0, $school, $degree, $years, Session::get('sp')->getUser_id());\n\n // Creates UserEducation business service\n $bs = new UserEducationBusinessService();\n\n // Calls createEducation bs method\n // flag is rows affected\n $flag = $bs->createEducation($education);\n\n // If flag equals 0, returns error page\n if ($flag == 0) {\n $this->logger->info(\"/Exiting \" . substr(strrchr(__METHOD__, \"\\\\\"), 1) . \" to error view. Flag: \" . $flag);\n $data = [\n 'process' => \"Create Education\",\n 'back' => \"createUserEducation\"\n ];\n return view('error')->with($data);\n }\n // Creates a new account controller and returns its onGetProfile method\n $this->logger->info(\"/Exiting \" . substr(strrchr(__METHOD__, \"\\\\\"), 1) . \" with \" . $flag);\n return app('App\\Http\\Controllers\\AccountController')->onGetProfile();\n } catch (ValidationException $e2) {\n throw $e2;\n } catch (Exception $e) {\n $this->logger->error(\"Exception \", array(\n \"message\" => $e->getMessage()\n ));\n $data = [\n 'errorMsg' => $e->getMessage()\n ];\n $this->logger->info(\"/Exiting \" . substr(strrchr(__METHOD__, \"\\\\\"), 1) . \" to exception view\");\n return view('exception')->with($data);\n }\n }",
"public function create(EducationModel $education){\n \n $this->logger->info(\"Entering EducationDAO.create()\");\n \n //Gets all of the information from the education model\n $school = $education->getSchool();\n $degree = $education->getDegree();\n $field = $education->getField();\n $gpa = $education->getGpa();\n $startyear = $education->getStartyear();\n $endyear = $education->getEndyear();\n $userID = $education->getUserID();\n \n try{\n $statement = $this->conn->prepare(\"INSERT INTO EDUCATION (IDEDUCATION, SCHOOL, DEGREE, FIELD, GPA, STARTYEAR, ENDYEAR, USERS_IDUSERS) VALUE (NULL, :school, :degree, :field, :gpa, :startyear, :endyear, :userID)\");\n //Binds information from the education model to the database query\n $statement->bindParam(':school', $school);\n $statement->bindParam(':degree', $degree);\n $statement->bindParam(':field', $field);\n $statement->bindParam(':gpa', $gpa);\n $statement->bindParam(':startyear', $startyear);\n $statement->bindParam(':endyear', $endyear);\n $statement->bindParam(':userID', $userID);\n $statement->execute();\n } catch (\\PDOException $e){\n $this->logger->error(\"Exception: \", ['message', $e->getMessage()]);\n throw new DatabaseException(\"Database Exception: \" . $e->getMessage(), 0, $e);\n }\n \n $this->logger->info(\"Exiting EducationDAO.create()\");\n \n //Returns the results of the database query\n return $statement->rowCount();\n }",
"public function store()\n {\n // Sets end year to NULL if not set\n if((int)$_POST['end_year'] === 0) {\n\t $_POST['end_year'] = NULL;\n }\n \n // Saves post data in education var\n $education = $_POST;\n \n // Links with a user ID, set created by ID and set created date\n if (!isset($education['user_id'])) {\n $education['user_id'] = Helper::getUserIdFromSession();\n }\n $education['created_by'] = Helper::getUserIdFromSession();\n $education['created'] = date('Y-m-d H:i:s');\n \n // Save the record to the database\n EducationModel::load()->store($education);\n View::redirect('education');\n }",
"public function postSaveEducation()\n\t{\n\t\t$_inputs = array();\n\t\tfor ($k = 0; $k < count(Input::get('type')); $k++)\n\t\t{\n\t\t\t$_inputs[] = array(\n\t\t\t\t'type' => Input::get('type')[$k],\n\t\t\t\t'degree' => Input::get('degree')[$k],\n\t\t\t\t'education_id' => (int) Input::get('education_id')[$k],\n\t\t\t\t'from' => (int) Input::get('from')[$k],\n\t\t\t\t'to' => (int) Input::get('to')[$k],\n\t\t\t\t'major_id' => (int) Input::get('major_id')[$k]\n\t\t\t);\n\t\t}\n\n\t\tforeach ($_inputs as $_input)\n\t\t{\n\t\t\t$validator = Validator::make(\n\t\t\t\t$_input,\n\t\t\t\tUserEducation::$education_rules\n\t\t\t);\n\n\t\t\tif ($validator->passes()\n\t\t\t\t&& $_input['from'] < $_input['to'])\n\t\t\t{\n\t\t\t\t$education = new UserEducation;\n\t\t\t\t$education->user_id = Auth::user()->id;\n\t\t\t\t$education->type = $_input['type'];\n\t\t\t\t$education->degree = $_input['degree'];\n\t\t\t\t$education->education_id = $_input['education_id'];\n\t\t\t\t$education->from = $_input['from'];\n\t\t\t\t$education->to = $_input['to'];\n\t\t\t\t$education->major_id = $_input['major_id'];\n\t\t\t\t$education->save();\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::back();\n\t}",
"private function create_profile($user_id) {\n }",
"function createSocialProfile() {\n\t\t// get and decode JSON request body\n\t\tglobal $app;\n\t\t//echo \"CreateUser Called<br>\";\n\t\t$request = $app->request();\n\t\t$body = $request->getBody();\n\t\t$input = json_decode($body, true); \n\t\t$DEBUG_LEVEL = 2;\n\t\tif ($DEBUG_LEVEL == 2) {\n\t\t\techo \"<pre>\";print_r($input); echo \"</pre>\";\n\t\t}\n\t\t// store article record\n\t\t$userCols = array( 'socialType', 'identifier', 'username', 'profileURL', 'websiteURL', 'photoURL', 'displayName', 'description', 'firstName', 'lastName', 'gender', 'language', 'age',\n\t\t\t'birthDay', 'birthMonth', 'birthYear', 'email', 'emailVerified', 'phone', 'address', 'country', 'region', 'city', 'zip', 'dateAdded');\n\t\t$user = R::dispense('social');\n\t\t\n\t\tforeach ($userCols as $key) {\n\t\t\t$user[$key] = $input[$key];\n\t\t}\n\t\t$id = R::store($user); \n\t\t//echo \"store Called<br>\";\n\t\t// return JSON-encoded response body\n\t\t$app->response()->header('Content-Type', 'application/json');\n\t\techo json_encode(R::exportAll($user));\n\t}",
"public function education(){\n return $this->hasOne(UserEducation::class, 'user_id', 'id');\n }",
"public function education()\n {\n return $this->hasOne('App\\Models\\Education','user_id','id');\n }",
"public function handleCreateProfile() {\n $onid = $this->getFromBody('onid');\n $fname = $this->getFromBody('fname');\n $lname = $this->getFromBody('lname');\n $type = $this->getFromBody('type');\n\n $user = new User();\n $user->setType(new UserType($type, ''))\n ->setAuthProvider(new UserAuthProvider(UserAuthProvider::ONID, 'ONID'))\n ->setOnid($onid)\n ->setFirstName($fname)\n ->setLastName($lname);\n\n $ok = $this->usersDao->addNewUser($user);\n if (!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Failed to create new user profile'));\n }\n\n $profile = new ShowcaseProfile($user->getId(), true);\n $ok = $this->profilesDao->addNewShowcaseProfile($profile);\n if (!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Failed to create user showcase profile'));\n }\n\n $this->respond(new Response(\n Response::OK,\n 'Successfully create new user'\n ));\n }",
"function addEducation($education){\n \n Log::info(\"Entering EducationBusinessService.createEducation()\");\n \n // create connection to database\n $database = new Database();\n $db = $database->getConnection();\n \n $dbService = new EducationDataService($db);\n $flag = $dbService->createEducation($education);\n \n // close the connection\n $db = null;\n \n // return the finder result\n Log::info(\"Exit EducationBusinessService.createEducation()\");\n return $flag;\n }",
"public function createAction(Request $request)\n {\n\n $user = $this->get('security.context')->getToken()->getUser();\n\n $entity = new Education();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $entity->upload();\n $entity->setUser($user);\n\n $em->persist($entity);\n $em->flush();\n $this->get('session')->getFlashBag()->add(\n 'success',\"Data has been inserted successfully\"\n );\n return $this->redirect($this->generateUrl('education_show', array('id' => $entity->getId())));\n }\n\n return $this->render('SyndicateComponentBundle:Education:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function updateSupervisionEducation(Request $request)\n {\n $result = DB::table('users_educations')->where('user_id', '=', $request->supervisionId)->get();\n if ($result->isEmpty()) {\n DB::table('users_educations')->insert(['user_id' => $request->supervisionId,\n 'primary_education' => $request->primary_education,\n 'secondary_education' => $request->secondary_education,\n 'third_education' => $request->third_education,\n 'created_at' => \\Carbon\\Carbon::now()]);\n } else {\n DB::table('users_educations')\n ->where('user_id', '=', $request->supervisionId)\n ->update([\n 'primary_education' => $request->primary_education,\n 'secondary_education' => $request->secondary_education,\n 'third_education' => $request->third_education,\n ]);\n }\n }",
"private function _mainEducation(){\n if(isset($this->page_options[2]))\n {\n $education_id = $this->page_options[2];\n\n } else {\n\n $msg = \"What no education specified! How did that happen?\";\n throw new \\RuntimeException($msg);\n\n }\n\n if($education_id == 'new')\n {\n $this->education = array(\n 'education_id' => '',\n 'from_date' => '',\n 'to_date' => '',\n 'institution' => '',\n 'countryCode_id' => '',\n 'website' => '',\n 'email' => '',\n 'phone' => '',\n 'qualification' => '',\n 'type' => '',\n 'description' => '',\n 'level' => '',\n 'attended_countryCode_id' => '',\n 'active' => '',\n 'english' => '',\n 'certificate_date' => '',\n 'certificate_number' => '',\n 'certificate_expiry' => '',\n 'filename' => '',\n 'view_from' => '',\n 'view_to' => '',\n 'certificate_from' => '',\n 'certificate_to' => ''\n );\n\n } else {\n\n //get the existing information (if any)\n $personal_db = new \\core\\modules\\personal\\models\\common\\db;\n $this->education = $personal_db->getEducation($education_id);\n if(empty($this->education))\n {\n $msg = \"What no education information! How did that happen?\";\n throw new \\RuntimeException($msg);\n }\n }\n }",
"public function create()\n\t{\n\t\t$this->auth->restrict('Students.Users.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_students())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('students_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'students');\n\n\t\t\t\tTemplate::set_message(lang('students_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/users/students');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('students_create_failure') . $this->students_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('students', 'students.js');\n\n\t\tTemplate::set('toolbar_title', lang('students_create') . ' Students');\n Template::set_view('users/edit');\n\t\tTemplate::render();\n\t}",
"public function saveUserProfile(UserProfile $userProfile);",
"public function createEducation(Request $request)\n {\n try\n {\n //validate form by calling validateCreateForm\n $this->validateCreateForm($request);\n \n //Get posted form data\n $school = $request->input('school');\n $degree = $request->input('degree');\n $field = $request->input('field');\n $graduationyear = $request->input('graduationyear');\n $user_id = $request->input('user_id');\n \n // Save posted data to Education object model\n $education = new Education(0, $school, $degree, $field, $graduationyear, $user_id);\n \n $jhbs = new JobHistoryBusinessService();\n $sbs = new SkillBusinessService();\n $eds = new EducationBusinessService();\n $gbs = new GroupBusinessService();\n \n // if addEducation sucesses call findGroupsByUserId,\n // findJobHistoryByUserId, findSkillByUserId and findEducationByUserId\n // to return user portfolio with jobhistorys, skills, educations, groups objects\n if($result = $eds->addEducation($education))\n {\n $groups = $gbs->findGroupsByUserId($user_id);\n $jobhistorys = $jhbs->findJobHistoryByUserId($user_id);\n $skills = $sbs->findSkillByUserId($user_id);\n $educations = $eds->findEducationByUserId($user_id);\n \n //pass groups user is apart of to portfolio\n if($groups)\n {\n for ($i = 0; $i < count($groups); $i++) {\n $groupNames[$i] = $gbs->findById($groups[$i]->getId());\n }\n }\n else\n {\n $groupNames = array();\n }\n \n // return to userPortfolio Form with jobhistorys, skills, educations, groups objects\n return view(('userPortfolio'),compact(['jobhistorys'],['skills'], ['educations'], ['groupNames']));\n }\n }catch(ValidationException $e1){\n throw ($e1);\n }catch(Exception $e2){\n $this->logger->error(\"Exception \". array(\"message\" => $e2->getMessage()));\n //Display Global Namespace Handler Page\n return view('SystemException');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a series of ReflectionParameter objects for the static 'create' method of the given tag handler class name. | private function fetchParametersForHandlerFactoryMethod($handler): array
{
$handlerClassName = is_object($handler) ? get_class($handler) : $handler;
if (!isset($this->tagHandlerParameterCache[$handlerClassName])) {
$methodReflection = new ReflectionMethod($handlerClassName, 'create');
$this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters();
}
return $this->tagHandlerParameterCache[$handlerClassName];
} | [
"private function fetchParametersForHandlerFactoryMethod(string $handlerClassName): array {}",
"private function getReflectionParametersFromReflectionClass()\n {\n return collect($this->handlerReflectionClass->getConstructor()->getParameters());\n }",
"public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createGET'),\n new ReflectionMethod(get_called_class(), 'createHEAD'),\n new ReflectionMethod(get_called_class(), 'createPOST')\n );\n }",
"public function getReflectionParameters(): array;",
"protected function getParams(\\ReflectionMethod $mirror, $single=false)\n\t{\n\t\t$params = [];\n\n\t\tforeach ($mirror->getParameters() as $param)\n\t\t{\n\t\t\t$alias = strtolower($param->name);\n\n\t\t\t// Is this a mapped alias?\n\t\t\tif (! empty($this->services[$alias]))\n\t\t\t{\n\t\t\t\t$params[] = $single ? $this->single($alias) : $this->make($alias);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Is this a normal class we can give them?\n\t\t\t$class = $param->getClass()->name;\n\n\t\t\tif (class_exists($class))\n\t\t\t{\n\t\t\t\t$params[] = new $class();\n\t\t\t}\n\n\t\t\t$params[] = null;\n\t\t}\n\n\t\treturn $params;\n\t}",
"public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createHeaders'),\n new ReflectionMethod(get_called_class(), 'createPage'),\n new ReflectionMethod(get_called_class(), 'createStatusPage'),\n new ReflectionMethod(get_called_class(), 'createTimeoutPage'),\n new ReflectionMethod(get_called_class(), 'createUnknownPage')\n );\n }",
"public function toPhpReflectionParameter();",
"public function getConstruct(): ReflectionMethod;",
"private function parameters(): array\n {\n try {\n $reflection = new \\ReflectionClass($this->class);\n }\n\n catch (\\ReflectionException $e) {\n return [];\n }\n\n $constructor = $reflection->getConstructor();\n\n return is_null($constructor) ? [] : $constructor->getParameters();\n }",
"public function getConstructorParams(string|object $class);",
"public static function createParams(array $data)\n\t{\n\t\t$params = array();\n\t\t\n\t\tforeach ($data AS $args)\n\t\t{\n\t\t\t$params[] = call_user_func_array(array('XfCli_ClassGenerator', 'createParam'), $args);\n\t\t}\n\t\t\n\t\treturn $params;\n\t}",
"public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createRead'),\n new ReflectionMethod(get_called_class(), 'createWrite')\n );\n }",
"public function getConstructorParams(): array;",
"private function getControllerReflectionParametersByName(): array\n\t{\n\t\t$controllerReflectionParameters = array_merge(\n\t\t\tarray_slice(\n\t\t\t\t$this->reflectionController->getConstructor()->getParameters(),\n\t\t\t\tself::ARGS_DEFAULT_CONSTRUCTOR\n\t\t\t),\n\t\t\t$this->reflectionMethod->getParameters()\n\t\t);\n\t\t\n\t\t/** @var \\ReflectionParameter[] $controllerReflectionParametersByName */\n\t\t$controllerReflectionParametersByName = [];\n\t\tforeach ($controllerReflectionParameters as $reflectionParameter)\n\t\t\t$controllerReflectionParametersByName[$reflectionParameter->getName()] = $reflectionParameter;\n\t\treturn $controllerReflectionParametersByName;\n\t}",
"public function getCtorParams(string $class): ?array;",
"public function create()\n\t{\n\t\t$scope = new \\ReflectionClass( $this -> className );\n\t\t$new_scope = $scope -> newInstanceArgs( $this -> arguments );\n\t\treturn $new_scope;\n\t}",
"public function getClassifyCreateHelper();",
"function getParameters() {\n $params = $this->docParser->getParamAnnotations();\n $extParams = array();\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n $apiParams = $this->reflectionSource->getParameters();\n } else {\n $apiParams = parent::getParameters();\n }\n foreach ($apiParams as $param) {\n $type = null;\n foreach ($params as $annotation) {\n if (\n $annotation instanceof ezcReflectionAnnotationParam\n and $annotation->getParamName() == $param->getName()\n ) {\n $type = $annotation->getTypeName();\n break;\n }\n }\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n $extParams[] = new ezcReflectionParameter(\n null,\n $param,\n $type\n );\n } else {\n // slightly increase performance and save some memory\n $extParams[] = new ezcReflectionParameter(\n $this->getName(),\n $param->getPosition(),\n $type\n );\n }\n }\n return $extParams;\n }",
"function getParameters() {\n\t\t$extendedParameters = [];\n\t\tforeach (parent::getParameters() as $parameter) {\n\t\t\t$extendedParameters[] = new ReflectionParameter([$this->getDeclaringClass()->getName(), $this->getName()], $parameter->getName());\n\t\t}\n\t\treturn $extendedParameters;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finalizes version part of the asset URL. | protected function finalizeVersion(): ?string
{
$version = $this->asset->version;
if (empty($version) && $this->urlConfig->forceVersion
&& ! empty($this->asset->location)
&& ! preg_match("/^https?:\//", $this->asset->publicId())
&& ! preg_match('/^v\d+/', $this->asset->publicId())
) {
$version = '1';
}
return $version ? 'v' . $version : null;
} | [
"function remove_assets_version( $src ){\n $parts = explode( '?ver', $src );\n\n return $parts[0];\n}",
"function wbkn_remove_wp_assets_version( $src ) {\n\tif ( strpos( $src, 'ver=' ) ) {\n\t\t$src = remove_query_arg( 'ver', $src );\n\t}\n\n\treturn $src;\n}",
"private function shareAssetVersion(): void\n {\n Inertia::version(static function () {\n return md5_file(public_path('mix-manifest.json'));\n });\n }",
"function asset_version($source) {\n $version = $this->get_asset_version_string();\n\n if (isset($version))\n $source .= sprintf(\"?ver=%s\", $version);\n return $source;\n }",
"function remove_wp_assets_version($src)\n{\n if (strpos($src, 'ver=')) {\n $src = remove_query_arg('ver', $src);\n }\n\n return $src;\n}",
"public static function assets_version ($script = '') {\n\t\tif (! self::$assets_version) {\n\t\t\treturn $script;\n\t\t}\n\n\t\tif ($script !== '') {\n\t\t\tif (! preg_match ('/\\.(js|css)$/i', $script)) {\n\t\t\t\treturn $script; // make sure script ends in .js or .css\n\t\t\t}\n\n\t\t\tif (strpos ($script, '/') !== 0) {\n\t\t\t\treturn $script; // make sure script begins with /\n\t\t\t}\n\t\t\n\t\t\tif (preg_match ('/^\\/\\//', $script)) {\n\t\t\t\treturn $script; // ignore protocol-relative URLs beginning with //\n\t\t\t}\n\t\t}\n\n\t\treturn $script . '?v=' . self::$assets_version;\n\t}",
"public static function exportAssetsVersion()\n {\n $process = new Process('git log -n 1');\n\n if (0 !== $process->run()) {\n return;\n }\n\n $output = $process->getOutput();\n\n if (empty($output)) {\n return;\n }\n\n putenv(self::ENV_ASSETS_VERSION.'='.md5($output));\n }",
"public function assetsAssetGetTargetUriJsVersioning(UnitTester $I)\n {\n $I->wantToTest('Assets\\Asset - getTargetUri() - js versioning');\n\n $source = dataDir('assets/assets/assets-version-1.js');\n\n $asset = new Asset(\n 'js',\n $source,\n true,\n false,\n [],\n '1.0.0'\n );\n\n $expected = 'js/jquery.js?ver=1.0.0';\n\n $asset->setTargetUri($expected);\n\n $I->assertEquals(\n $expected,\n $asset->getTargetUri()\n );\n }",
"public static function getVersionedAsset(string $assetPath): string\n {\n $index = strrpos($assetPath, \".\");\n return substr_replace($assetPath, '-' . Scribe::VERSION, $index, 0);\n }",
"protected function reinitialiseUrl(): void\n {\n if ($this->url\n && $this->url->scheme === 'blob'\n && $this->url->cannotBeABaseUrl\n ) {\n // Terminate these steps\n return;\n }\n\n $this->setURL();\n }",
"public function assetsAssetGetTargetUriJsVersioning(UnitTester $I)\n {\n $I->wantToTest('Assets\\Asset - getTargetUri() - js versioning');\n\n $source = dataDir('assets/assets/assets-version-1.js');\n $asset = new Asset(\n 'js',\n $source,\n true,\n false,\n [],\n '1.0.0'\n );\n\n $expected = 'js/jquery.js?ver=1.0.0';\n $asset->setTargetUri($expected);\n $this->assetGetTargetUri($I, $asset, $expected);\n }",
"public function assetsAssetGetTargetUriJsAutoVersioning(UnitTester $I)\n {\n $I->wantToTest('Assets\\Asset - getTargetUri() - js automatic versioning');\n\n $source = dataDir('assets/assets/assets-version-1.js');\n\n $asset = new Asset(\n 'js',\n $source,\n true,\n false,\n [],\n null,\n true\n );\n\n $modificationTime = filemtime($source);\n $expected = $source . '?ver=' . $modificationTime;\n\n $asset->setTargetUri($expected);\n\n $I->assertEquals(\n $expected,\n $asset->getTargetUri()\n );\n }",
"public function getFinalUrl()\n {\n return $this->final_url;\n }",
"function remove_staticfiles_version($src)\n{\n if (strpos($src, '?ver=')) {\n $src = remove_query_arg('ver', $src);\n }\n\n return $src;\n}",
"public function actionInvalidate() {\n echo \"\\nInvalidating assets on CloudFront\\n\";\n\n /** @var Manager $manager */\n $manager = Yii::app()->getComponent($this->manager);\n $manager->invalidateAssets();\n echo \"\\nDone invalidation process\\n\";\n }",
"public function refreshAssetPaths()\n {\n Cache::forget(self::ASSET_PATH_CACHE_KEY);\n }",
"public function get_url() {\n\t\treturn $this->version_url . time();\n\t}",
"public function testUpdateURL()\n {\n // Test resampled file is served when force_resample = true\n Config::modify()->set(Image::class, 'force_resample', true);\n\n $imageHQ = $this->objFromFixture(Image::class, 'highQualityJPEG');\n\n // File needs to be in draft and users need to be anonymous to test the access\n $this->logOut();\n $imageHQ->doUnpublish();\n\n $url = '';\n $imageHQ->updateURL($url);\n\n /** @var AssetStore assetStore */\n $assetStore = Injector::inst()->get(AssetStore::class);\n $this->assertFalse(\n $assetStore->isGranted('folder/a870de278b/test-image-high-quality__Resampled.jpg'),\n 'Current user should not automatically be granted access to resampled image'\n );\n }",
"static public function get_asset_version() {\n\t\t$post_id = self::get_post_id();\n\t\t$active\t = self::is_builder_active();\n\t\t$preview = self::is_builder_draft_preview();\n\n\t\tif ( $active || $preview ) {\n\t\t\treturn md5( uniqid() );\n\t\t} else {\n\t\t\treturn md5( get_post_modified_time( 'U', false, $post_id ) );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the current interval does not contain a given time in between the start and end times. | public function notContains($time): bool
{
return !$this->contains($time);
} | [
"public function unlessBetween(string $startTime, string $endTime): self;",
"public function hasTimeInterval(TimeInterval $interval);",
"public function timeOverlap($start_time, $end_time, array $times){\r\n $ustart = strtotime($start_time);\r\n $uend = strtotime($end_time);\r\n foreach($times as $time){\r\n $start = strtotime($time[\"start\"]);\r\n $end = strtotime($time[\"end\"]);\r\n if($ustart <= $end && $uend >= $start){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public function startsAfterNonDisjoint(Interval $other) : bool\r\n\t{\r\n\t\treturn $this->start > $other->start && $this->start <= $other->stop; // this.b>=other.b implied\r\n\t}",
"public function isNowInRange()\n {\n $now = (new \\DateTime())->format('H:i:s');\n return $this->start->__toString() <= $now\n && $this->end->__toString() >= $now;\n }",
"function doesTimeslotConflict($t){\n\t\tif($t->day != $this->day) return false;\n\t\t$start1 = $t->startTime->toUnscaledInteger();\n\t\t$start2 = $this->startTime->toUnscaledInteger();\n\t\t$end1 = $t->endTime->toUnscaledInteger();\n\t\t$end2 = $this->endTime->toUnscaledInteger();\n\n\t\tif($start1 <= $end2 && $end1 >= $end2) return true;\n\t\tif($start1 <= $start2 && $end1 >= $start2) return true;\n\t\tif($start2 <= $end1 && $end2 >= $end1) return true;\n\t\tif($start2 <= $start1 && $end2 >= $start1) return true;\n\t\treturn false;\n\t}",
"function isBetweenTwoTimes($start , $end, $checkTime){\n if(is_null($start) || is_null($end))\n return false;\n if(($checkTime >= $start && $checkTime < $end))\n return true;\n return false;\n}",
"function intersectCheck($from, $from_compare, $to, $to_compare)\n\t{\n\t\tif ($from == $from_compare AND $to == $to_compare) {\n\t\t\treturn true;\n\t\t}\n\n $from \t\t\t= strtotime($from);\n $from_compare \t= strtotime($from_compare);\n $to \t\t\t= strtotime($to);\n $to_compare \t= strtotime($to_compare);\n $intersect \t\t= min($to, $to_compare) - max($from, $from_compare);\n\n if ( $intersect < 0 ) $intersect = 0;\n $overlap = $intersect / 3600;\n if ( $overlap <= 0 ):\n // There are no time conflicts\n return FALSE;\n else:\n // There is a time conflict\n // echo '<p>There is a time conflict where the times overlap by ' , $overlap , ' hours.</p>';\n return TRUE;\n endif;\n }",
"private function is_valid_range($start_time, $end_time)\r\n\t\t{\r\n\t\t\treturn strtotime($start_time) < strtotime($end_time);\r\n\t\t}",
"public function overlaps(self $interval): bool\n {\n return !$this->abuts($interval)\n && $this->startDate < $interval->endDate\n && $this->endDate > $interval->startDate;\n }",
"public function isNotEqualTo(Time $time): bool\n {\n return !$this->isEqualTo($time);\n }",
"public function timestamps_overlap($used_start,$used_end,$new_start,$new_end)\n {\n\t\tif( $used_start <= $new_start \n && $new_start < $used_end )\n {\n return true;//found a conflict \n }//else check if game starts in between the used timeslot\n else if( $used_start < $new_end\n && $new_end <= $used_end )\n {\n return true;//found a conflict \n }\n //otherwise\n\t\treturn false;\n }",
"public static function checkDatesDontOverlap($start_date_hour, $ending_date_hour) {\n $results = DB::select(\n 'SELECT * FROM events \n\t\t\tWHERE ( start_date_hour BETWEEN ? AND ? OR\n\t\t\tending_date_hour BETWEEN ? AND ? ) OR\n\t\t\t( start_date_hour < ? AND ending_date_hour > ? )', array(\n $start_date_hour, $ending_date_hour,\n $start_date_hour, $ending_date_hour,\n $start_date_hour, $ending_date_hour,\n ));\n if ($results != NULL) {\n $response['fail'] = array(\n 'event' => [trans('fail.event.overlap')],\n );\n } else {\n $response = true;\n }\n return $response;\n }",
"public function validTime()\n {\n $startTime = new Carbon($this->start_time);\n $endTime = new Carbon($this->end_time);\n $appointmentStartTime = $startTime->copy()->subMinutes(Appointment::EXTRA_TIME);\n $appointmentEndTime = $endTime->copy()->addMinutes(Appointment::EXTRA_TIME);\n return $appointmentStartTime->lte(Carbon::now()) && $appointmentEndTime->gte(Carbon::now());\n }",
"private function checkDateTimesPresent(){\n return $this->start_time != \"\" && $this->end_time != \"\";\n }",
"public function testOutsideTimeRange()\n {\n // outside of time-range, hidden\n $blob = <<<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:foobar6\nDTSTART:20110101T090000Z\nDTEND:20110101T100000Z\nEND:VEVENT\nEND:VCALENDAR\nICS;\n\n $this->assertFreeBusyReport(\n '',\n $blob\n );\n }",
"public function testOverlapWithDateTimeParameter()\n {\n $timerange = new TimeRange('2013-01-01 00:00:00', '2013-01-01 23:30:30');\n $datetime = new DateTime('2013-01-01 23:30:31');\n $this->assertFalse($timerange->overlaps($datetime));\n $this->assertTrue($timerange->overlaps($datetime, TimeRange::MINUTE));\n }",
"public function startsBeforeDisjoint(Interval $other) : bool\r\n\t{\r\n\t\treturn $this->start < $other->start && $this->stop < $other->start;\r\n\t}",
"function currentInTimeRange($start, $end)\n{\n return strtotime($start) <= time() && time() <= strtotime($end);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new temporary directory. | public function createTempDirectory()
{
unlink($file = $this->createTempFile());
mkdir($file);
return $file;
} | [
"public static function createTempDir()\n {\n self::removeTempDir();\n $tmpDir = self::getTempDir();\n @mkdir($tmpDir) or die('cannot create temp directory');\n }",
"public function createTempFolder()\n {\n if( ! is_dir($this->getTempFolder())) {\n mkdir($this->getTempFolder(), 0777);\n }\n }",
"protected function createTmpDir()\n {\n mkdir($this->getTargetPath());\n }",
"public function createTemporaryDirectory() {\n if (function_exists('sys_get_temp_dir')) {\n $baseDirectory = sys_get_temp_dir();\n } elseif (file_exists('/tmp') &&\n is_dir('/tmp') &&\n is_writeable('/tmp')\n ) {\n $baseDirectory = '/tmp';\n } elseif (is_writeable(dirname(__FILE__))) {\n $baseDirectory = dirname(__FILE__);\n } elseif (is_writeable('./')) {\n $baseDirectory = realpath('./');\n } else {\n $this->skipTest('Can not get writeable directory for file system functions.');\n }\n $counter = 0;\n do {\n $rand = substr(base64_encode(rand()), 0, -2);\n if (substr($baseDirectory, -1) == DIRECTORY_SEPARATOR) {\n $temporaryDirectory = $baseDirectory.'testfs.'.$rand;\n } else {\n $temporaryDirectory = $baseDirectory.DIRECTORY_SEPARATOR.'testfs.'.$rand;\n }\n } while (++$counter < 10 &&\n file_exists($temporaryDirectory) &&\n is_dir($temporaryDirectory));\n $this->_temporaryDirectory = $temporaryDirectory;\n if (file_exists($this->_temporaryDirectory) &&\n is_dir($this->_temporaryDirectory)\n ) {\n $directory = $this->_temporaryDirectory;\n $this->_temporaryDirectory = '';\n $this->fail('Test directory \"'.$directory.'\" did already exists.');\n return FALSE;\n } else {\n $oldMask = umask(0);\n mkdir($this->_temporaryDirectory, 0777, TRUE);\n $this->_temporaryDirectories[] = $this->_temporaryDirectory;\n umask($oldMask);\n return $this->_temporaryDirectory;\n }\n }",
"public function createTemporaryDirectoryPath();",
"public function createTemporaryDirectoryPath()\n {\n return $this->factoryByPlatform()\n ->create(sys_get_temp_dir());\n }",
"private function createTmpPath() {\n $this->message->update(\"Creating a working directory.\");\n\n $dir = md5(mktime());\n mkdir($this->getUploadPath() . '/' . $dir);\n $this->tmpPath = $this->getUploadPath() . '/' . $dir;\n copy($this->file, $this->tmpPath . '/' . basename($this->file));\n $this->workingFile = $this->tmpPath . '/' . basename($this->file);\n }",
"protected function createTmpDir()\n {\n $filesystem = $this->getFileSystem();\n $tmpDir = $filesystem->createTmpDir($this->getTempRootDir(), 'zip');\n\n register_shutdown_function(\n function () use ($tmpDir, $filesystem) {\n $filesystem->remove($tmpDir);\n }\n );\n\n return $tmpDir;\n }",
"protected function createTempDirectory()\n {\n $ds = DIRECTORY_SEPARATOR;\n $tmp = sys_get_temp_dir() . $ds . \"Semvertest\" . mt_rand(0, 1000);\n if (file_exists($tmp) && is_dir($tmp)) {\n `rm $tmp -r`;\n }\n mkdir($tmp);\n if (is_dir($tmp)) {\n $this->tmps[] = $tmp;\n return $tmp;\n }\n throw new \\AccessDeniedException(\"Could not create tmp directory $tmp\");\n }",
"private function prepareTempDirectory()\n {\n $path = $this->getTempDirPath();\n if (!is_dir($path)) \n mkdir($path, 0777, true);\n }",
"private function createTempFolder()\n {\n if (!is_dir($this->passRealPath)) {\n Storage::disk('passgenerator')->makeDirectory($this->passRelativePath);\n }\n }",
"protected function createTemporaryDirectory()\n {\n $prefix = (\n 'configwriter-'\n . (new \\ReflectionClass($this))->getShortName()\n . '-'\n . $this->getName()\n );\n $attemps = 5;\n $path = sprintf(\n \"%s%s%s.%d\",\n sys_get_temp_dir(),\n DIRECTORY_SEPARATOR,\n $prefix,\n random_int(10000000, 99999999)\n );\n\n do {\n if (@mkdir($path)) {\n return $path;\n }\n } while (0 < --$attemps);\n\n throw new RuntimeException(\n sprintf('Failed to create temporary directory [%s]', $path)\n );\n }",
"private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }",
"private function makeTmpDir()\n {\n $tmpDir = $this->getTempDir();\n\n // Directory already exists, return true\n if (is_dir($tmpDir)) {\n return true;\n }\n\n // dir doesn't exist, make it\n return mkdir($tmpDir);\n }",
"private function generateTempDirectory()\n {\n $dirname = uniqid();\n\n $fs = new Filesystem();\n\n $fs->mkdir($this->report_dir.$dirname);\n\n return $this->report_dir.$dirname;\n }",
"private function createTemporaryDirectory() {\n\n\t\tdo {\n\t\t\t$path = sprintf(\"%s/%s\",self::$temporary_directory_prefix,uniqid(\"mysqld-\"));\n\t\t} while(file_exists($path) && $tries++ < 10);\n\n\t\tif(file_exists($path)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\"failed to create a temporary directory after %s attempts\",$tries));\n\t\t}\n\n\t\tif(mkdir($path)) {\n\t\t\tchmod($path,0777);\n\t\t\tif(posix_getuid() === 0) {\n\t\t\t\tchown($path,\"mysql\");\n\t\t\t}\n\t\t\treturn $path;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function createTemplateDirectory()\n {\n Storage::disk($this->templateDisk)->makeDirectory($this->template_directory);\n }",
"protected function generateTempDirectory()\n\t{\n\t\t$tempdir = vsprintf('%s/media-generate-%s', [\n\t\t\tsys_get_temp_dir(),\n\t\t\tmicrotime(true),\n\t\t]);\n\n\t\tif (! wp_mkdir_p($tempdir)) {\n\t\t\tWP_CLI::error(\"Failed to create the temp directory $tempdir\");\n\t\t}\n\n\t\tadd_action('shutdown', function() use ($tempdir) {\n\t\t\tWP_CLI::debug(\"Cleaning up $tempdir\");\n\t\t\tforeach(glob(\"$tempdir/*\") as $file) {\n\t\t\t\tunlink($file);\n\t\t\t}\n\t\t\trmdir($tempdir);\n\t\t});\n\n\t\treturn $tempdir;\n\t}",
"protected function createTestDirectory(): void\n {\n if (file_exists($this->testDirectory)) {\n $this->cleanTestDirectory();\n }\n\n $this->localFilesystem->mkdir($this->testDirectory);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make an array of all duplicate redirections. | public static function get_duplicates() {
if ( is_null( self::$_all_redirections ) ) {
self::load_all_redirections();
}
$duplicates = array();
foreach ( self::$_all_redirections as $redirection ) {
if ( $redirection->is_duplicate() ) {
$duplicates[ $redirection->get_redirection_id() ] = $redirection;
}
}
return $duplicates;
} | [
"function get_all_redirects($url){\r\n $redirects = array();\r\n while ($newurl = get_redirect_url($url)){\r\n if (in_array($newurl, $redirects)){\r\n break;\r\n }\r\n $redirects[] = $newurl;\r\n $url = $newurl;\r\n }\r\n return $redirects;\r\n}",
"function get_all_redirects($url){\n $redirects = array();\n while ($newurl = get_redirect_url($url)){\n if (in_array($newurl, $redirects)){\n break;\n }\n $redirects[] = $newurl;\n $url = $newurl;\n }\n return $redirects;\n}",
"function get_all_redirects($url){\n\t\t$redirects = array();\n\t\twhile ($newurl = get_redirect_url($url)){\n\t\t\tif (in_array($newurl, $redirects)){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$redirects[] = $newurl;\n\t\t\t$url = $newurl;\n\t\t}\n\t\treturn $redirects;\n\t}",
"function get_all_redirects($url)\n{\n\t$redirects = array();\n\twhile ($newurl = get_redirect_url($url)) {\n\t\tif (in_array($newurl, $redirects)) {\n\t\t\tbreak;\n\t\t}\n\t\t$redirects[] = $newurl;\n\t\t$url = $newurl;\n\t}\n\treturn $redirects;\n}",
"function get_all_redirects($url)\n {\n $redirects = [];\n\n while ($newurl = get_redirect_url($url)) {\n if (in_array($newurl, $redirects)) {\n break;\n }\n\n $redirects[] = $newurl;\n $url = $newurl;\n }\n\n return $redirects;\n }",
"public function getRegisteredRedirects()\n {\n return $this->registeredRedirects ?? [];\n }",
"public function getRedirections()\n {\n return $this->redirections;\n }",
"public function getRedirections(){\n return $this->_redirections;\n }",
"public function getRedirectsHistory(): array\n {\n return $this->redirectsHistory;\n }",
"public function duplicateUrlProvider(): array\n {\n return [\n ['test', 'test'],\n ['/test', '/test'],\n ['test/', 'test/'],\n ['test', 'test/']\n ];\n }",
"public static function get_circulars() {\n if ( is_null( self::$_all_redirections ) ) {\n self::load_all_redirections();\n }\n $circulars = array();\n foreach ( self::$_all_redirections as $redirection ) {\n if ( $redirection->is_circular() ) {\n $circulars[ $redirection->get_redirection_id() ] = $redirection;\n }\n }\n return $circulars;\n }",
"public function get_all_redirections() {\n\t\t$is_sitewide = is_multisite() && defined( 'SMARTCRAWL_SITEWIDE' ) && SMARTCRAWL_SITEWIDE;\n\t\t$redirections = $is_sitewide\n\t\t\t? get_site_option( self::OPTIONS_KEY )\n\t\t\t: get_option( self::OPTIONS_KEY );\n\t\tif ( ! is_array( $redirections ) ) {\n\t\t\t$redirections = array();\n\t\t}\n\n\t\treturn (array) apply_filters(\n\t\t\t$this->get_filter( 'get-all' ),\n\t\t\tarray_filter( $redirections )\n\t\t);\n\t}",
"public function return_redirects() {\n\t\t$manager = new \\WPSEO_Redirect_Manager();\n\t\t$redirects = $manager->get_all_redirects();\n\n\t\t$data = [];\n\t\tforeach ( $redirects as $redirect ) {\n\t\t\t$data[] = sprintf( '/%s/ /%s/ %d', $redirect->get_origin(), $redirect->get_target(), $redirect->get_type() );\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function getLinks(): array\n {\n return array_values(array_unique($this->_links));\n }",
"public function duplicates()\n {\n $cached = \\Cache::get('stache::duplicates', []);\n\n return collect($cached)->map(function ($paths, $id) {\n $item = $this->ids()->get($id);\n $path = explode('::', $item)[1];\n array_unshift($paths, $path);\n return $paths;\n });\n }",
"public function getVisitedUrls()\n {\n return array_values($this->visitedUrls);\n }",
"public function getRedirectionUrls()\n {\n return $this->redirectionUrls;\n }",
"protected function uniquePaths()\n {\n return [\n $this->newPath,\n ];\n }",
"public static function getRedirects()\n {\n return self::$redirects;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method listens new messages from MQ exchange 'messages', which have been routed with 'sms.' | public function listen(): void {
$connection = new AMQPStreamConnection(MQ_HOST, MQ_PORT, MQ_USER, MQ_PASSWORD);
$channel = $connection->channel();
$channel->exchange_declare(
'messages',
'topic',
false,
true,
false
);
list($queueName, ,) = $channel->queue_declare("", false, false, true, false);
$bindingKey = 'sms.#';
$channel->queue_bind($queueName, 'messages', $bindingKey);
echo ' [*] Waiting for messages. CTRL-C to exit.' . "\n";
$channel->basic_consume(
$queueName,
'',
false,
true,
false,
false,
array($this, 'processSmsQueueMessage')
);
while(count($channel->callbacks)) {
$channel->wait();
}
$channel->close();
$connection->close();
} | [
"public static function getMessages(){\n try{\n $connection = new AMQPStreamConnection($_ENV['RMQ_HOST'], $_ENV['RMQ_PORT'], $_ENV['RMQ_USERNAME'], $_ENV['RMQ_PASSWORD']);\n $channel = $connection->channel();\n $channel->queue_declare($_ENV['RMQ_KEY'], false, false, false, false);\n echo \"Waiting for messages. To exit press CTRL+C\\n\";\n $callback = function($msg){\n Mail::SendMsg($msg->body);\n };\n \n $channel->basic_consume($_ENV['RMQ_KEY'], '', false, true, false, false, $callback);\n while($channel->is_open()){\n $channel->wait();\n }\n }catch(\\Exception $e){\n die($e->getMessage());\n }\n }",
"private function sendSmsNotification()\n {\n // TODO: Not yet implemented since we have no transport/Gateway for SMS in Netric\n }",
"public function _incoming_sms()\n\t{\n\t\t$sms = Event::$data;\n\t\t\n\t\t//get all of the whitelisted numbers and see if there's a match\n\t\t$numbers = ORM::factory(\"simplegroups_groups_number\")->find_all();\n\t\tforeach($numbers as $number)\n\t\t{\n\t\t\tif($number->number)\n\t\t\t{\n\t\t\t\t//makes it a fuzzy search\n\t\t\t\tif( !(strpos($sms->message_from, $number->number) === false) ||\n\t\t\t\t\t($number->number == $sms->message_from))\n\t\t\t\t{\n\t\t\t\t\t$group_message = ORM::factory(\"simplegroups_groups_message\");\n\t\t\t\t\t$group_message->simplegroups_groups_id = $number->simplegroups_groups_id;\n\t\t\t\t\t$group_message->message_id = $sms->id;\n\t\t\t\t\t$group_message->number_id = $number->id;\n\t\t\t\t\t$group_message->save();\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//check and see if it needs to be forwarded\n\t\t\t\t\tgroups::forward_message_to_own_instance($sms->message, $sms->message_from, $number->simplegroups_groups_id);\n\t\t\t\t\t\n\t\t\t\t\t//check and see if we need to assign some categories to this\n\t\t\t\t\t$group_categories = ORM::factory(\"simplegroups_category\")\n\t\t\t\t\t\t->where(\"simplegroups_groups_id\", $number->simplegroups_groups_id)\n\t\t\t\t\t\t->where(\"applies_to_message\", \"1\")\n\t\t\t\t\t\t->where(\"selected_by_default\", \"1\")\n\t\t\t\t\t\t->find_all();\n\t\t\t\t\tforeach($group_categories as $group_category)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_instance = ORM::factory(\"simplegroups_message_category\");\n\t\t\t\t\t\t$category_instance->simplegroups_category_id = $group_category->id;\n\t\t\t\t\t\t$category_instance->message_id = $sms->id;\n\t\t\t\t\t\t$category_instance->save();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//break; //more than one number can match? good or bad?\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function getMessageQueueManager();",
"public function obtainSMSMessages()\n {\n return $this->performRequest('GET', 'sms-messages');\n }",
"public function testDirectListen()\n {\n go(function () {\n MqQueue::getInstance($this->driver);\n MqQueue::getInstance()->consumer()->setConfig('kd_sms_send_ex', 'hello', 'direct')->listen(function (MqJob $job) {\n var_dump($job->getJobData());\n });\n });\n }",
"private function registerInboundEvents()\n {\n // Handle requests from queue via SUBSCRIBER\n $this->zmqInboundQueue->on('message', function ($msg) {\n $this->runtimeStatistics->incrementAddedObjectCount();\n\n try {\n $message = RequestMessage::fromStringToArray($msg);\n $this->getQueue()->push($message['key'], $message['data'], round(microtime(true) * 1000000) + $message['timeout'], $message['type']);\n\n if ($this->isInLogLevel(Logger::DEBUG)) {\n $this->logger->debug(\"[OnMessage] Data for key '{$message['key']}' [type '{$message['type']}', exp {$message['timeout']} ms]: \".str_replace(\"\\n\", \"\", var_export($message['data'], true)));\n }\n } catch (\\Exception $e) {\n $this->logger->error($e);\n }\n });\n }",
"function uplink_hook_getsmsinbox() {\n\t// global $uplink_param;\n\t// $sms_datetime\t: incoming sms datetime\n\t// $message\t\t: incoming sms message\n\t// setsmsincomingaction($sms_datetime,$sms_sender,$message,$sms_receiver)\n\t// you must retrieve all informations needed by setsmsincomingaction()\n\t// from incoming sms, have a look uplink gateway module\n\t// fixme anton - uplink will receive incoming sms by using callback/push url\n\t/*\n\tglobal $uplink_param;\n\t$handle = @opendir($uplink_param['path']);\n\twhile ($sms_in_file = @readdir($handle)) {\n\tif (eregi(\"^ERR.in\",$sms_in_file) && !eregi(\"^[.]\",$sms_in_file)) {\n\t$fn = $uplink_param['path'].\"/$sms_in_file\";\n\t// logger_print(\"infile:\".$fn, 2, \"uplink incoming\");\n\t$tobe_deleted = $fn;\n\t$lines = @file ($fn);\n\t$sms_datetime = trim($lines[0]);\n\t$sms_sender = trim($lines[1]);\n\t$message = \"\";\n\tfor ($lc=2;$lc<count($lines);$lc++) {\n\t$message .= trim($lines[$lc]);\n\t}\n\t// collected:\n\t// $sms_datetime, $sms_sender, $message\n\tsetsmsincomingaction($sms_datetime,$sms_sender,$message,$sms_receiver);\n\tlogger_print(\"sender:\".$sms_sender.\" dt:\".$sms_datetime.\" msg:\".$message, 2, \"uplink incoming\");\n\t@unlink($tobe_deleted);\n\t}\n\t}\n\t*/\n}",
"public function listen()\n {\n $this->open();\n $callback = function(AMQPMessage $message) {\n $job = $this->unserialize($message->body);\n if ($this->getQueue()->run($job)) {\n $message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);\n }\n };\n $this->_channel->basic_qos(null, 1, null);\n $this->_channel->basic_consume($this->queueName, '', false, false, false, false, $callback);\n while(count($this->_channel->callbacks)) {\n $this->_channel->wait();\n }\n }",
"public function onMessage(MessageEvent $event);",
"function message($msg){\r\n\t\t \t$tlen = (ord($msg{0})<<8) + ord($msg{1});\r\n\t\t\t$topic = substr($msg,2,$tlen);\r\n\t\t\t$msg = substr($msg,($tlen+2));\r\n\t\t\t$found = 0;\r\n\t\t\tforeach($this->topics as $key=>$top){\r\n\t\t\t\tif( preg_match(\"/^\".str_replace(\"#\",\".*\",\r\n\t\t\t\t\t\tstr_replace(\"+\",\"[^\\/]*\",\r\n\t\t\t\t\t\t\tstr_replace(\"/\",\"\\/\",\r\n\t\t\t\t\t\t\t\tstr_replace(\"$\",'\\$',\r\n\t\t\t\t\t\t\t\t\t$key)))).\"$/\",$topic) ){\r\n\t\t\t\t\tif(is_callable($top['function'])){\r\n\t\t\t\t\t\tcall_user_func($top['function'],$topic,$msg);\r\n\t\t\t\t\t\t$found = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($this->debug && !$found) echo \"msg recieved but no match in subscriptions\\n\";\r\n\t}",
"function message($msg){\n\t\t \t$tlen = (ord($msg{0})<<8) + ord($msg{1});\n\t\t\t$topic = substr($msg,2,$tlen);\n\t\t\t$msg = substr($msg,($tlen+2));\n\t\t\t$found = 0;\n\t\t\tforeach($this->topics as $key=>$top){\n\t\t\t\tif( preg_match(\"/^\".str_replace(\"#\",\".*\",\n\t\t\t\t\t\tstr_replace(\"+\",\"[^\\/]*\",\n\t\t\t\t\t\t\tstr_replace(\"/\",\"\\/\",\n\t\t\t\t\t\t\t\tstr_replace(\"$\",'\\$',\n\t\t\t\t\t\t\t\t\t$key)))).\"$/\",$topic) ){\n\t\t\t\t\tif(is_callable($top['function'])){\n\t\t\t\t\t\tcall_user_func($top['function'],$topic,$msg);\n\t\t\t\t\t\t$found = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->debug && !$found) echo \"msg recieved but no match in subscriptions\\n\";\n\t}",
"public function receiveMms() {\n try {\n // check client IP address\n $this->checkRemoteAddress();\n\n // check request type\n if (self::getRequestType() != self::REQ_TYPE_MMS) {\n throw new GwServerException(null, \"Invalid MMS message request\");\n }\n\n // create MMS message\n $mmsMessage = new MmsMessage();\n\n // set MMS message sender\n $sender = $_REQUEST['source'];\n $mmsMessage->setSender($sender);\n\n // set MMS message operator\n $operator = $_REQUEST['operator'];\n $mmsMessage->setOperator($operator);\n\n // add MMS message recipient\n $recipient = $_REQUEST['dest'];\n $mmsMessage->addRecipient($recipient);\n\n // set MMS message keyword(s)\n $keywords = Utils::stripMagicQuotes($_REQUEST['keyword']);\n $mmsMessage->setKeywords($keywords);\n\n // set MMS message parameters\n $parameters = explode(\" \", Utils::stripMagicQuotes($_REQUEST['params']));\n $mmsMessage->setParameters($parameters);\n \n // set timestamp\n $timestamp = $_REQUEST['timestamp'];\n $mmsMessage->setTimestamp($timestamp);\n\n // set MMS message subject (optional)\n if (isset($_REQUEST['subject'])) {\n $subject = Utils::stripMagicQuotes($_REQUEST['subject']);\n $mmsMessage->setSubject($subject);\n }\n\n // read attached files and create MMS objects out of them\n $objects = MmsObjectUtils::readMmsObjectsFromRequest();\n\n // add created MMS objects to message\n foreach ($objects as $object) {\n // set first plain text object as message text\n if (is_null($mmsMessage->getText()) && strpos($object->getContentType(), \"text/plain\") !== false) {\n $mmsMessage->setText($object->getContent());\n }\n\n // add MMS object to MMS message\n $mmsMessage->addObject($object);\n }\n\n return $mmsMessage;\n } catch (GwServerException $e) {\n // respond with error response and rethrow the exception for user\n $this->respondError($e->getHttpStatusCode(), $e->getMessage());\n throw $e;\n }\n }",
"function onMessage($from, $channel, $msg) {\n if($channel != $this->channel) return;\n $tmp = explode(\" \", $msg);\n $cmd = array_shift($tmp);\n if($cmd == \"!help\") $this->cmdHelp($from);\n else if($cmd == \"!rules\") $this->cmdRules($from);\n else if($cmd == \"!start\") $this->cmdStart($from, $tmp);\n else if($cmd == \"!join\") $this->cmdJoin($from);\n else if($cmd == \"!bid\") $this->cmdBid($from, $tmp);\n else if($cmd == \"!call\") $this->cmdCall($from);\n else if($cmd == \"!table\") $this->cmdTable($from, true);\n }",
"public function receiveSMS()\n {\n\n Log::info('Incoming SMS request');\n\n\n $inbound = SMS::receive();\n $incomingMessage = new Message();\n $incomingMessage->content = $inbound->message();\n $incomingMessage->sender = '+' . $inbound->from();\n $incomingMessage->receiver = '+' . $inbound->to();\n $incomingMessage->external_id = $inbound->id();\n $incomingMessage->meta_info = json_encode($inbound->raw());\n $incomingMessage->source = 'nexmo';\n\n\n Log::info('Message ID ' . $inbound->id());\n\n Log::info('JSON' . json_encode($incomingMessage));\n\n $success = $incomingMessage->save();\n\n event(new IncomingMessageEvent($incomingMessage));\n\n if (!$success) {\n Log::warning('Message saving failed: ' . json_encode($incomingMessage));\n\n $response = new Response();\n return $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);\n\n }\n\n $response = new Response();\n return $response->setStatusCode(Response::HTTP_OK);\n\n\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 onMessage(Connection $conn, Message $msg);",
"public function getMessageQueue();",
"public function chat_message () {\r\n //for client 2 example only\r\n $this->socket->event->addEvent('chat message', function ($socket,$data,$sender) {\r\n $socket->event->broadcastMessage('chat message', $data,true);\r\n });\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create report and save to file | public function createReport(string $file)
{
$report = new Export($this->results);
$report->saveTo($file);
} | [
"function save_report()\n\t{\n\t\t$content='<? $report_fields=Array(';\n\t\tfor($i=0; $i<count($this->report_fields); $i++)\n\t\t{\t\t\t\t\t\n\t\t\t//get number of elements\n\t\t\t$total=count($this->report_fields[$i]);\n\t\t\t$counter=0;\n\n\t\t\t$content.='Array(';\n\t\t\tforeach($this->report_fields[$i] as $report_field => $value) \n\t\t\t{\n\t\t\t\t$counter++;\n\n\t\t\t\tif($total!=$counter)\n\t\t\t\t{\n\t\t\t\t\t$content.='\"'.$report_field.'\" => \"'.$value.'\", ';\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content.='\"'.$report_field.'\" => \"'.$value.'\"';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(($i+1)==count($this->report_fields)) \n\t\t\t{\n\t\t\t\t$content.=')';\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$content.='), ';\n\t\t\t}\n\t\t}\n\t\t$content.=');'; \n\t\t\n\t\t$content.='$order_by=\"'.$this->order_by.'\";';\n\t\t$content.='$report_name=\"'.$this->report_name.'\"; ?>';\n\t\t\n\t\t//Create directory if specified one does not already exist\n\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$this->path))\n\t\t{ \n\t\t\tmkdir($_SERVER['DOCUMENT_ROOT'].$this->path);\n\t\t}\n\n\t\t$file_name = $this->report_name.\".php\"; \n\t\t$handle = fopen($_SERVER['DOCUMENT_ROOT'].$this->path.$file_name, 'w');\n\t\tfwrite($handle, $content);\n\t\tfclose($handle); \n\t}",
"protected abstract function generateReport();",
"public function save(){\r\n\t\t$statementCoverage = ($this->includeCoverage) ? $this->results['statementCoveragePercentage'] : '';\r\n\t\t$functionalCoverage = ($this->includeCoverage) ? $this->results['functionCoveragePercentage'] : '';\r\n\t\t$avgComplexity = ($this->includeMetrics) ? $this->results['avgComplexity'] : '';\r\n\t\t$refactor = ($this->includeMetrics) ? $this->results['refactorPercentage'] : '';\r\n\t\t$readability = ($this->includeMetrics) ? $this->results['readabilityPercentage'] : '';\r\n\t\t$readability = ($readability > 100) ? 100 : $readability;\r\n\t\t$totalLoc = ($this->includeMetrics) ? $this->results['metricsLoc'] : '';\r\n\t\t\r\n\t\t$data = array(\r\n\t\t\t'datetime'=>date(\"M d, Y, H:i\"),\r\n\t\t\t'numTestCases'=>$this->results['numTestCases'],\r\n\t\t\t'numUnitTests'=>$this->results['numUnitTests'],\r\n\t\t\t'statementCoveragePercentage'=>$statementCoverage,\r\n\t\t\t'functionCoveragePercentage'=>$functionalCoverage,\r\n\t\t\t'avgComplexity'=>$avgComplexity,\r\n\t\t\t'refactorPercentage'=>$refactor,\r\n\t\t\t'readabilityPercentage'=>$readability,\r\n\t\t\t'loc'=>$totalLoc,\r\n\t\t\t'totalTime'=>$this->results['totalTime']\r\n\t\t);\r\n\r\n\t\tif (file_exists('Test/Reports/Suite/'.$this->fileName)){\r\n\t\t\t$directive = 'a';\r\n\t\t\t$data = \"\\n\".json_encode($data);\r\n\t\t} else {\r\n\t\t\t$directive = 'w';\r\n\t\t\t$data = $this->getReportData().\"\\n\".json_encode($data);\r\n\t\t}\r\n\r\n\t\t$handle = fopen('Test/Reports/Suite/'.$this->fileName, $directive);\r\n\t\tfwrite($handle, $data);\r\n\t\tfclose($handle);\t\t\t\r\n\t}",
"public function saveReport()\n {\n /* Append the diff info for failed scripts. */\n if(count($this->failedScripts) > 0)\n {\n $this->reportInfo .= \"\\n\";\n foreach($this->failedScripts as $script)\n {\n $expect = isset($script->expectx) ? $script->expectx : $script->expect;\n $this->reportInfo .= \"\\n{{===\\nfailed $script->script <$script->title>}}\\n\";\n $this->reportInfo .= \"[expect]\\n$expect\\n\\n\";\n $this->reportInfo .= \"[output]\\n$script->output\\n\\n\";\n $this->reportInfo .= \"[diff]\\n$script->diff\";\n $this->reportInfo .= \"\\n===}}\\n\";\n }\n }\n\n file_put_contents($this->reportFile, $this->removeColor($this->reportInfo));\n echo 'Report: ' . $this->colorString($this->reportFile, COLOR_YELLOW) . \" .\\n\";\n }",
"private function saveReport()\n {\n $reports = $this->loadReports();\n $reports[] = $this->getReportInfo();\n\n if (count($reports) > $this->maxReportsCount) {\n array_shift($reports);\n }\n\n $reportsFile = \"{$this->getReportSavePath()}/reports.json\";\n file_put_contents($reportsFile, CJSON::encode($reports));\n }",
"public function generateReport()\n {\n }",
"public function run()\n { \n $report = $this->generateReport();\n if ($this->filename !== null) {\n $file = fopen($this->filename, \"wb\");\n if ($file === false) { \n throw new \\Exception(\"File \".$file.\" could not be opened for writing.\");\n }\n fwrite($file, $report);\n fclose($file);\n }\n return $report;\n }",
"public function makeReport()\n {\n }",
"public function generateReport()\n {\n // Set the start time\n $this->report->setBeganTimestamp(time());\n\n // Save that timestamp\n $this->report->save();\n\n // Execute the report\n $this->report->execute();\n\n /*\n * Generate the report's full pathname (with a file extension),\n * so that each output file type will have the same file name.\n */\n $this->getFileName();\n\n /*\n * For each of the views we have, check to see if this controller\n * implements the necessary interface. If so, call those methods\n * to generate and save the view.\n */\n // HTML\n if($this instanceof iHtmlReportView){\n $this->htmlView = $this->getHtmlView();\n // Save the HTML output\n $this->saveHtmlOutput($this->htmlView);\n }\n\n // PDF\n if($this instanceof iPdfReportView){\n $this->pdfView = $this->getPdfView();\n // Save the PDF output\n $this->savePdfOutput($this->pdfView);\n }\n\n // CSV\n if($this instanceof iCsvReportView){\n $this->csvView = $this->getCsvView();\n $this->saveCsvOutput($this->csvView);\n }\n\n // Set the completion time\n $this->report->setCompletedTimestamp(time());\n\n // Save the report to save the completed timestamp\n $this->report->save();\n }",
"public function createReport ()\n {\n $user = auth()->user();\n\n $paid = $this->paid ? 'Yes' : 'No';\n\n $imageFileName = str_replace('storage//', '', $this->trip->image);\n $imagePath = storage_path('app/public') . '/' . $imageFileName;\n\n $template = new TemplateProcessor('template.docx');\n\n $template->setValue('name', $user->name);\n $template->setValue('surname', $user->surname);\n $template->setValue('orderId', $this->id);\n $template->setValue('hotelName', $this->trip->hotel->name);\n $template->setValue('hotelCountry', $this->trip->hotel->country);\n $template->setValue('dateIn', $this->trip->date_in);\n $template->setValue('dateOut', $this->trip->date_out);\n $template->setValue('orderCreatedAt', $this->created_at);\n $template->setValue('price', $this->price);\n $template->setValue('paid', $paid);\n $template->setImageValue('image', $imagePath);\n\n $filename = \"dummy_order_{$user->name}_{$user->surname}_{$this->id}_\" . Carbon::now()->format('Y-m-d_H-i-s');\n $dir = storage_path('app\\public\\ordersReports');\n $fileFullPath = $dir . '\\\\' . $filename . '.docx';\n $template->saveAs($fileFullPath);\n return $fileFullPath;\n }",
"public function testItCanCreateReports()\n {\n $this->analyzer = new Analyzer(10);\n $this->analyzer->analyzeAlgorithms();\n $this->analyzer->createReport(self::REPORT_FILE);\n\n $this->assertFileExists(self::REPORT_FILE);\n\n $content = file_get_contents(self::REPORT_FILE);\n $this->assertContains(\"arrayToDataTable([[\", $content);\n \n if (file_exists(self::REPORT_FILE)) {\n unlink(self::REPORT_FILE);\n }\n }",
"public function generateReport()\n {\n $jasper =new jasperPHP();\n// $jasper->compile(base_path('storage/reporting/example.jrxml'))->execute();\n \n }",
"function memory_report_to_file()\n{\n\tif (!err()) return;\n\t\n\tif ($file = fopen('memory_report.txt', 'a+'))\n\t{\n\t\tfwrite($file, memory_report());\n\t\tfclose($file);\n\t}\n}",
"public function saveReportInfo() {\n\t\t$string = $this->reportName . ',' . $this->reportId . ',' . $this->date['start'] . ',' . \n\t\t\t $this->date['end'] . \"\\n\";\n\n\t\tif ( $fp = @fopen( '/var/log/fundraising/contrib_audit/log', 'a' )) {\n\t\t\tfwrite( $fp , $string );\n\t\t\tfclose( $fp );\n\t\t}\n\t}",
"public function generateReportTes()\n {\n\n // Compile a JRXML to Jasper\n JasperPHP::compile(base_path('/vendor/cossou/jasperphp/examples/inspection.jrxml'))->execute();\n$output = base_path('/report/Test');\n // Process a Jasper file to PDF and RTF (you can use directly the .jrxml)\n JasperPHP::process(base_path('/vendor/cossou/jasperphp/examples/inspection.jasper'),\n 'C:\\Users\\suresh\\Desktop',\n array(\"pdf\", \"rtf\"),\n array(\"propid\" => \"7.1\") )->execute();\n\n\n // return view('welcome');\n\n }",
"function report()\n{\n $page = (new HtmlPage())\n ->withTitle('Conference audit')\n ->withInlineStyle(new StyleElement(file_get_contents('styles.css')));\n\n // Generate the results page.\n $page = $page->withContent($page->getContent() . reportNewSpeakersPerCon());\n\n $page = $page->withContent($page->getContent() . reportTopSpeakers());\n\n file_put_contents('results.html', $page);\n}",
"public function storeReport()\n {\n Utils::log(LOG_DEBUG, \"Storing report to the DB\", __FILE__, __LINE__);\n\n $this->_report->setProcessedOn(time());\n\n $this->_report = $this->getPakiti()->getManager(\"ReportsManager\")->createReport($this->_report, $this->_host);\n }",
"private function create_output_file()\n {\n if($this->app == 'specimen_image_export') {\n $this->labels['Sheet1'] = array('Lab Sheet' => $this->labels_Lab_Sheet, 'Sheet1' => $this->labels['Sheet1']['MOOP']);\n // print_r($this->labels); exit;\n }\n require_library('MarineGEO_XLSParser');\n $parser = new MarineGEO_XLSParser($this->labels, $this->resource_id, $this->app);\n if($this->app == 'specimen_export') $parser->create_specimen_export(); //creates to final xls\n elseif($this->app == 'specimen_image_export') $parser->create_specimen_image_export(); //creates the final xls\n }",
"public function generateAction()\n {\n $report = $this->_helper->db->findById();\n \n $reportFile = new Reports_File();\n $reportFile->report_id = $report->id;\n $reportFile->type = $_GET['format'];\n $reportFile->status = Reports_File::STATUS_STARTING;\n \n // Send the base URL to the background process for QR Code\n // This should be abstracted out to work more generally for\n // all generators.\n if ($reportFile->type == 'PdfQrCode') {\n $reportFile->options = serialize(array('baseUrl' => WEB_ROOT));\n }\n \n $errors = array();\n if (!$reportFile->canStore($errors)) {\n $errorMessage = __('The report cannot be saved. Please check your report storage settings.');\n foreach($errors as $error) {\n $errorMessage .= ' ' . $error;\n }\n $this->_helper->flashMessenger($errorMessage, 'error');\n } else {\n $reportFile->save();\n\n $this->_jobDispatcher->setQueueName('reports');\n $this->_jobDispatcher->sendLongRunning('Reports_GenerateJob',\n array(\n 'fileId' => $reportFile->id,\n )\n );\n }\n \n $this->_helper->redirector->gotoRoute(\n array(\n 'module' => 'reports',\n 'id' => $report->id,\n 'action' => 'show',\n ),\n 'default'\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define Relation with ProductUnit Model | public function product_units()
{
return $this->hasMany(ProductUnit::class);
} | [
"public function testCreateUnitRelationships()\n {\n }",
"public function YbrMembership1Product()\n {\n return $this->belongsTo(\"App\\Models\\Admin\\Membership\\ybr_membership1_product\", \"product_id\", 'id');\n }",
"protected function lazyLoadRelation()\n {\n //do nothing for simple product\n }",
"public function units()\n {\n return $this->hasMany(\"Unit\");\n }",
"function getProductUnit() {return $this->_productUnit; }",
"private function makeRelationBetweenCategoryAndDummyTable() {}",
"public function productType(){\n return $this->belongsTo('App\\ProductType');\n }",
"public function products() {\n return $this->hasMany(\\Util::buildNamespace('organizations', 'product', 2), 'product_id');\n }",
"public function testCreateUsingRelationViaRelation()\n {\n $test = new Test;\n $test = $this->useRelationViaRelation($test);\n $this->testCreate($test);\n }",
"public function product_standard()\n {\n return $this->hasOneThrough(Product::class,ProductVariation::class,'product_id','id','ref_id','id')->withoutGlobalScopes();\n }",
"public function getBuildingUnit(){\n return $this->hasMany(BuildingUnit::classname(), ['unitid' => 'unitid']);\n }",
"public function units()\n {\n return $this->hasMany(Unit::class);\n }",
"public function testCreateProductStore()\n {\n\n }",
"public function testCreateProduct()\n {\n }",
"public function products()\n {\n return $this->hasMany(Product::class, 'organisation_id');\n }",
"public function createProduct();",
"public function testUpdateUnitRelationshipSource()\n {\n }",
"public function getProductSuperAttributeRepository();",
"public function products()\n {\n return $this->hasManyThrough(Product::class, BOMItem::class, 'product_bom_id', 'id', 'id', 'product_id')->with('measureunit');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send a voice call to the target phone_number. See for detailed API documentation. | function call ($phone_number, $message, $message_type, array $other = []) {
return $this->post(self::VOICE_RESOURCE, array_merge($other, [
"phone_number" => $phone_number,
"message" => $message,
"message_type" => $message_type
]));
} | [
"public function actionCall()\n {\n $req = Yii::$app->request;\n \n $phoneTo = (int)$req->get('phoneTo');\n if (!is_numeric($phoneTo)) return 'Phone must be a number';\n\n $phoneFrom = self::PHONE_ADMIN;\n $sid = $req->get('sid');\n $token = $req->get('token');\n \n $twiloiSet = (isset($sid) && isset($token));\n if (!$twiloiSet) return \"Twilio API call. From: $phoneFrom To: $phoneTo\";\n\n $client = new Client($sid, $token);\n\n $call = $client->calls->create(\n $phoneTo,\n $phoneFrom,\n [\"url\" => \"http://demo.twilio.com/docs/voice.xml\"]\n );\n echo $call->sid;\n }",
"public function voiceCall($data = array())\n {\n $this->init($data);\n $this->contents = view('kandy-laravel::button.voiceCall', $this->data)->render();\n\n return $this;\n }",
"public function sendGame()\n {\n $phone = trim(Input::get('phone_number'));\n //check for malformed input.\n if(intval($phone) === 0)\n return view('welcome')->with(['error' => 'This is not a phone number']);\n if(strlen($phone) > 10)\n return view('welcome')->with(['error' => 'This phone number is too long. I can only call numbers in the USA']);\n if(strlen($phone) < 10)\n return view('welcome')->with(['error' => 'This is not a valid phone number. It is to short for me to understand']);\n\n\n $account_sid = env('ACCOUNT_SID');\n $auth_token = env('AUTH_TOKEN');\n $client = new Services_Twilio($account_sid, $auth_token);\n\n $client->account->calls->create(env('APP_PHONE'), $phone, env('APP_URL').'/buzzphone/voice/initiateGame', array(\n 'Method' => 'POST',\n 'FallbackUrl' => env('APP_URL').'/buzzphone/voice/intro',\n 'FallbackMethod' => 'GET',\n 'StatusCallbackMethod' => 'GET',\n 'Record' => 'false',\n ));\n\n return $this->success();\n }",
"public function sendSMS($number, $message) {\n\t\t// Login to the service if not already done.\n\t\t$this->_logIn();\n\n\t\t// Send HTTP POST request.\n\t\tcurl_setopt($this->_ch, CURLOPT_URL, 'https://www.google.com/voice/sms/send/');\n\t\tcurl_setopt($this->_ch, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($this->_ch, CURLOPT_POSTFIELDS, array(\n\t\t\t'_rnr_se' => $this->_rnr_se,\n\t\t\t'phoneNumber' => '+1'.$number,\n\t\t\t'text' => $message\n\t\t\t));\n\t\tcurl_exec($this->_ch);\n\t}",
"public function sendContact($chat_id,$phone_number,$first_name,$last_name=null,$reply_to_message_id=null,$reply_markup=null,$disable_notification=null)\n {\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }",
"public function sendMessage($phone, $message);",
"public function sendVoice($message, $to = null)\n {\n return $this->send(self::MSG_TYPE_VOICE, $message, $to);\n }",
"function send_message($to_phone_id, $message)\n\t{\n\t\t//LOAD TWILIO CONSTANTS\n\t\tglobal $AccountSid, $AuthToken, $TwilioNumber, $ApiVersion;\n\t\t\n\t\t//CHOP OFF TEXT OVER 160\n\t\tif(strlen($message) > 160)\n\t\t\t$message = substr($message, 0, 160);\n\t\t\n\t\t//FIND PHONE NUMBER\n\t\t$to_phone_number = get_phone_number($to_phone_id);\n\n\t\t//SEND MESSAGE\n\t\t$client = new TwilioRestClient($AccountSid, $AuthToken);\n\t\t\n\t\t$response = $client->request(\"/$ApiVersion/Accounts/$AccountSid/SMS/Messages\",\n\t\t\t\"POST\", array(\n\t\t\t\"To\" => $to_phone_number,\n\t\t\t\"From\" => $TwilioNumber,\n\t\t\t\"Body\" => $message\n\t\t));\n\n\t\t//TWILIO ERRORS\n\t\tif($response->IsError)\n\t\t{\n\t\t\techo \"Error: \".$response->ErrorMessage.\"File: \".__FILE__. \"\\n<br />\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"Message to $to_phone_number:\\n<br />\";\n\t\t\techo '<pre>';\n\t\t\techo \"$message\\n\";\n\t\t\techo '</pre>';\n\t\t}\n\t\t\t\t\n\t}",
"function start_AdVoiceCall($msisdn, $msisdn_2, $demo=null)\n\t {\n\t \n\n\t // $loggerObj->LogInfo(\"======================== ADVOICE API STARTING CALL =======================\");\n\n\t $params = array(\n\t 'username' => 'Versatel',\n\t 'password' => '193jmgR)23',\n\t array(\n\t \"contact\" => $msisdn,\n\t \"status\" => '1',\n\t \"additional_vars\" => '{\"transfer_phonenumber\":\"'.$msisdn_2.'\"}',\n\t // \"phonebook\" => 'http://129.232.209.250/rest-api/phonebook/907/'\n\t 'phonebook' => 'http://129.232.209.250/rest-api/phonebook/935/'\n\t )\n\t );\n\n\t if ($demo) {\n\t // $loggerObj->LogInfo(print_r($params[0], true));\n\t // $loggerObj->LogInfo(\"======================== ADVOICE API RESPONSE =======================\");\n\t // $loggerObj->LogInfo(\"ADVOICE API - CALL INITIATED SUCCESSFULLY - DEMO \");\n\t // $result = true;\n\t } else {\n\t // $loggerObj->LogInfo(print_r($params[0], true));\n\t $curl = curlHTTPRequest('http://129.232.209.250/rest-api/contact/', $params, 'JSON');\n\t // $loggerObj->LogInfo(\"======================== ADVOICE API RESPONSE =======================\");\n\t // $loggerObj->LogInfo(print_r($curl, true));\n\t /* check the return result */\n\t if (!is_array($curl)){\n\t if (strpos($curl, 'Error') !== false){\n\t $result = null;\n\t } else {\n\t $result = true;\n\t }\n\t } else if (is_array($curl) && !empty($curl)) {\n\t $result = $curl;\n\t }\n\n\t }\n\t return $result;\n\t // $loggerObj->LogInfo( \"LOG CURL RESULT\" );\n \t\t // $loggerObj->LogInfo( print_r($result) );\n\t }",
"public function telLink($phoneNumber, $text = null);",
"public function setVoiceMethod($value)\n {\n return $this->set('VoiceMethod', $value);\n }",
"public function sendCall($leadID)\n {\n $this->lead = Lead::findOrFail($leadID);\n\n //getting messages for lead\n $account_sid = getenv(\"TWILIO_SID\");\n $auth_token = getenv(\"TWILIO_AUTH_TOKEN\");\n $twilio_number = getenv(\"TWILIO_NUMBER\");\n $client = new Client($account_sid, $auth_token);\n $call = $client->calls\n ->create($this->lead->mobile, // to\n $twilio_number, // from\n array(\"url\" => \"http://demo.twilio.com/docs/voice.xml\")\n );\n \n return response()->json(['status'=>$call->status,'display_status'=>ucwords($call->status),'sid'=>$call->sid]); \n \n }",
"public function toSIPPhone($number, $timeout) {\n\t\t$target = new \\stdClass;\n\t\t$target->application = \"call_phone\";\n\t\t$target->params = Array(\"extension\" => $number, \"timeout\" => $timeout);\n\t\t$this->routingData[] = $target;\n\t}",
"public function sendSMS($mobileNumber, $messageContent);",
"public function extensionMessage(Request $request)\n {\n $response = new VoiceResponse();\n\n // Lookup the extension using the number entered by the caller\n $extension = Extension::where('number', $request->Digits)->first();\n\n // Play the message and then the transfer prompt\n if ($extension !== null)\n {\n // Get the current call\n $call = Call::where('sid', $request->CallSid)->first();\n\n // Associate the call with the extension called\n if ($call !== null)\n {\n $call->extension()->associate($extension);\n $call->save();\n }\n\n // Get the agent (User) that owns the extension\n $agent = $extension->agents()->first();\n\n $caller = $call->caller;\n\n // If this is the first time the caller has called in\n // with an extension number, assign the caller to the\n // agent of the extension.\n\n if($caller->agent === null)\n {\n // dump($caller);\n $caller->agent()->associate($agent);\n //$caller->user_id = $agent->id;\n $caller->save();\n }\n // dump($caller->agent);\n\n // Call the agent and get the conference room\n // friendly name for use later.\n $conferenceRoom = $this->createConferenceWithAgent($call);\n\n // Now we are done recording the call data, play the extension message\n // to the caller and\n $response->say(\n 'Thank you. Please wait while I gather information for extension number ' . $extension->number,\n ['voice' => 'Polly.Salli', 'language' => 'en-GB']\n );\n $response->pause();\n $response->say(\n 'Here\\'s the information you requested.',\n ['voice' => 'Polly.Salli', 'language' => 'en-GB']\n );\n $response->pause();\n\n // Play the message to the caller\n $response->say( $extension->message, ['voice' => 'Polly.Matthew', 'language' => 'en-US']);\n $response->pause();\n\n $gather = $response->gather([\n 'input' => 'dtmf speech',\n 'hints' => 'Yes, No',\n 'numDigits' => 1,\n //pass along the conference room name that the agent is waiting in.\n 'action' => route('connect-agent',['confRoom' => $conferenceRoom], true),\n ]);\n $gather->say( $extension->transfer_prompt, ['voice' => 'Polly.Salli', 'language' => 'en-GB']);\n\n $response->say(\n 'I\\'m sorry, I did not get a response. Please call again. Goodbye!',\n ['voice' => 'Polly.Matthew', 'language' => 'en-US']\n );\n }\n else // If extension doesn't exist\n {\n $response->say(\n 'Sorry, we could not find an active property that matched the code you entered. '.\n 'I\\'m returning you to the main menu so you can try again.',\n ['voice' => 'Polly.Matthew', 'language' => 'en-US']\n );\n $response->redirect(route('greeting', [], false));\n }\n\n return response($response)->header('Content-Type', 'application/xml');\n }",
"public function request_phone_number($value)\n\t{\n\t\t$this->request_buyer_phone_number = $value ? 'true' : 'false';\n\n\t\treturn $this;\n\t}",
"public function makeCall($fromNumber = null, $toNumber = null, $twimlUrl = null,$accountSid = null, $authToken = null) {\n if (!$this->Client) {\n $this->getClient($accountSid = null, $authToken = null);\n }\n \n $call = $this->Client->account->calls->create($fromNumber,$toNumber,$twimlUrl);\n \n return $call->sid;\n }",
"public function sendVoice(array $content)\n {\n return $this->endpoint('sendVoice', $content);\n }",
"public function sendVerifyCode($phone);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds custom apartment classes to the array of header classes. | function hemma_apartment_header_classes( $classes ) {
global $post;
$header_position = get_theme_mod( 'header_position', 'header-position-1' );
// Add hero class
if ( ( is_singular( array( 'apartment' ) ) || is_page_template( 'template-apartment.php' ) ) && ( $header_position != 'header-position-2' ) ) {
$classes[] = 'is-hero-on';
}
return $classes;
} | [
"function quadro_header_extras_class($classes) {\n\t\t$classes[] = 'header-extras-on';\n\t\treturn $classes;\n\t}",
"function affinity_mikado_header_class($classes) {\n\t\t$header_type = affinity_mikado_get_meta_field_intersect('header_type', affinity_mikado_get_page_id());\n\n\t\t$classes[] = 'mkd-'.$header_type;\n\n\t\treturn $classes;\n\t}",
"function add_hentry_class( $classes ) {\n\n $classes[] = 'hentry';\n\n return $classes;\n \n}",
"public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}",
"public function add_preheader_body_class( $classes ) {\n\n $temp = g1_get_theme_option( 'ta_preheader', 'open_type', 'expand' );\n $classes[] = 'g1-preheader-open-' . $temp;\n\n $temp = g1_get_theme_option( 'ta_preheader', 'open_on_startup', 'none' );\n if ($temp !== 'none') {\n $classes[] = 'g1-preheader-open-on-startup';\n }\n\n // Space after\n $temp = g1_get_theme_option( 'ta_preheader', 'space', 'none' );\n switch ( $temp ) {\n case 'before':\n $classes[] = 'g1-preheader-space-before';\n break;\n\n case 'after':\n $classes[] = 'g1-preheader-space-after';\n break;\n\n case 'before_after':\n $classes[] = 'g1-preheader-space-before';\n $classes[] = 'g1-preheader-space-after';\n break;\n\n default:\n break;\n }\n\n // Layout\n $temp = g1_get_theme_option( 'ta_preheader', 'layout', 'semi-standard' );\n if ( strlen( $temp ) ) {\n $classes[] = 'g1-preheader-layout-' . sanitize_html_class( $temp );\n }\n\n // Corners\n $temp = (array) g1_get_theme_option( 'ta_preheader', 'layout_corners', array() );\n // Merge with defaults\n $temp = array_merge(\n array(\n 'tl' => 'square',\n 'tr' => 'square',\n 'br' => 'square',\n 'bl' => 'square',\n ),\n $temp\n );\n\n $classes[] = 'g1-preheader-tl-' . sanitize_html_class( $temp['tl'] );\n $classes[] = 'g1-preheader-tr-' . sanitize_html_class( $temp['tr'] );\n $classes[] = 'g1-preheader-br-' . sanitize_html_class( $temp['br'] );\n $classes[] = 'g1-preheader-bl-' . sanitize_html_class( $temp['bl'] );\n\n return $classes;\n }",
"function acetravel_add_home_body_class( $classes ) {\n\t$classes[] = 'acetravel-home';\n\treturn $classes;\n}",
"function hemma_excursion_header_classes( $classes ) {\n\tglobal $post;\n\t$header_position = get_theme_mod( 'header_position', 'header-position-1' );\n\n\t// Add hero class\n\tif ( ( is_singular( array( 'excursion' ) ) || is_page_template( 'template-excursion.php' ) ) && ( $header_position != 'header-position-2' ) ) {\n\t\t$classes[] = 'is-hero-on';\n\t}\n\n\treturn $classes;\n}",
"function astra_entry_header_class() {\r\n\r\n\t\t$post_id = astra_get_post_id();\r\n\t\t$classes = array();\r\n\t\t$title_markup = astra_the_title( '', '', $post_id, false );\r\n\t\t$thumb_markup = astra_get_post_thumbnail( '', '', false );\r\n\t\t$post_meta_markup = astra_single_get_post_meta( '', '', false );\r\n\t\t$blog_single_post_structure = astra_get_option( 'blog-single-post-structure' );\r\n\r\n\t\tif ( ! $blog_single_post_structure || ( 'single-image' === astra_get_prop( $blog_single_post_structure, 0 ) && empty( $thumb_markup ) && 'single-title-meta' !== astra_get_prop( $blog_single_post_structure, 1 ) ) ) {\r\n\t\t\t$classes[] = 'ast-header-without-markup';\r\n\t\t} elseif ( empty( $title_markup ) && empty( $thumb_markup ) && ( is_page() || empty( $post_meta_markup ) ) ) {\r\n\t\t\t$classes[] = 'ast-header-without-markup';\r\n\t\t} else {\r\n\r\n\t\t\tif ( empty( $title_markup ) ) {\r\n\t\t\t\t$classes[] = 'ast-no-title';\r\n\t\t\t}\r\n\r\n\t\t\tif ( empty( $thumb_markup ) ) {\r\n\t\t\t\t$classes[] = 'ast-no-thumbnail';\r\n\t\t\t}\r\n\r\n\t\t\tif ( is_page() || empty( $post_meta_markup ) ) {\r\n\t\t\t\t$classes[] = 'ast-no-meta';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$classes = array_unique( apply_filters( 'astra_entry_header_class', $classes ) );\r\n\t\t$classes = array_map( 'sanitize_html_class', $classes );\r\n\r\n\t\techo esc_attr( join( ' ', $classes ) );\r\n\t}",
"function add_body_class_for_custom_site_header( array $body_classes ) {\n//\t$body_classes[] = 'go-pro';\n\t$body_classes[] = 'custom-site-header';\n\n\treturn $body_classes;\n}",
"function thyme_add_body_class( $classes ) {\n\n\t$classes[] = 'landing-page';\n\treturn $classes;\n\n}",
"public function add_metabox_classes(){\n if( is_array($this->metabox_settings['classes']) ){\n $admin_pages = $this->get_admin_pages();\n foreach($admin_pages as $admin_page){\n add_filter( \"postbox_classes_{$admin_page}_{$this->meta_id}\", function( $classes = array() ){\n foreach ( $this->metabox_settings['classes'] as $class ) {\n if ( ! in_array( $class, $classes ) ) {\n $classes[] = sanitize_html_class( $class );\n }\n }\n return $classes;\n });\n }\n }\n }",
"function neve_add_page_header_menu_classes( $args ) {\n\tif ( $args['theme_location'] !== 'page-header' ) {\n\t\treturn $args;\n\t}\n\n\t$args['menu_class'] .= ' nav-ul';\n\n\treturn $args;\n}",
"function custom_nav_class( $classes ) {\n $classes[] = 'nav__item';\n return $classes;\n}",
"function magicpi_header_title_classes() {\n\t// Add / remove hooked classes.\n\techo implode( ' ', apply_filters( 'magicpi_header_title_class', array() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n}",
"function setActiveHeaderClass($a_h_class)\n\t{\n\t\t$this->active_headerclass = $a_h_class;\n\t}",
"function template_preprocess_ting_agency_library(&$variables) {\n if (isset($variables['add_classes'])) {\n $variables['classes_array'] = array_merge($variables['classes_array'], $variables['add_classes']);\n }\n}",
"private function setClasses()\n {\n $classes = array();\n\n if ($this->card) {\n $classes[] = \"w3-card\";\n }\n if ($this->border) {\n $classes[] = \"w3-border\";\n }\n if ($this->round) {\n $classes[] = \"w3-round\";\n }\n\n $this->classes = $classes;\n }",
"abstract public function setupClassInfo();",
"function pxlz_edgtf_include_custom_walker_navigation_for_header_types() {\n foreach (glob(EDGE_FRAMEWORK_HEADER_ROOT_DIR . '/types/*/nav-menu/*.php') as $module_load) {\n include_once $module_load;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will read the ONTOLOGY Stream from an object and add relations to matching CMODEL objects PIDS to owl:classes Work in progress...not used nor implemented | function islandora_ontologies_mapowlclasses_to_cmodels(AbstractObject $islandora_object)
{
$module_path = drupal_get_path('module', 'islandora_ontologies');
if (empty($islandora_object['ONTOLOGY']) || !islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $islandora_object['ONTOLOGY'])) {
return array();
}
//islandora_ontologies_parse_vocabulary($islandora_object);
return array();
} | [
"private function parseOpenGraphObjects()\n {\n foreach ($this->getOpenGraphObjectTypes() as $objectType => $objectTypeClass) {\n /** @var \\Illuminate\\Support\\Collection $tags */\n $tags = $this->getAllByNamespace($objectType);\n if ($tags->isEmpty()) {\n continue;\n }\n\n $this->openGraph['objects'][$objectType] = new $objectTypeClass($tags);\n }\n }",
"public function parseObjectDependencies()\n\t{\n\t\tlibxml_use_internal_errors(true);\n\t\t$root = simplexml_load_string(trim($this->xml));\n\t\tif(!$root instanceof SimpleXMLElement)\n\t\t{\n\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': XML is: '. $this->xml. (string) $root);\n\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': Error parsing objective xml: '.$this->parseXmlErrors());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tforeach($root->Objective as $obj)\n\t\t{\n\t\t\t$mapped_objective_id = $this->getMapping()->getMapping('Modules/Course', 'objectives', (string) $obj->attributes()->id);\n\t\t\tif($mapped_objective_id)\n\t\t\t{\n\t\t\t\t$this->parseMaterials($obj, $mapped_objective_id);\n\t\t\t\t$this->parseTests($obj, $mapped_objective_id);\n\t\t\t}\n\t\t}\n\t}",
"public function parse() {\r\n\t\ttry {\r\n //need to first parse the header.\r\n $numberOfObjects = stream.getInt( \"N\" );\r\n $objectNumbers = array_pad( numberOfObjects );\r\n $this->streamObjects = array_pad( numberOfObjects );\r\n for( $i=0; $i<$numberOfObjects; $i++ ) {\r\n $objectNumber = $this->readObjectNumber();\r\n // skip offset\r\n $this->readLong();\r\n $objectNumbers[$i]=$objectNumber;\r\n }\r\n $objectCounter = 0;\r\n while( !is_null($this->cosObject = $this->parseDirObject()) ) {\r\n $object = new COSObject($this->cosObject);\r\n $object->setGenerationNumber(0);\r\n if ($objectCounter >= count($objectNumbers)) {\r\n print('/ObjStm (object stream) has more objects than /N ' + $numberOfObjects);\r\n break;\r\n }\r\n $object->setObjectNumber( $objectNumbers[$objectCounter] );\r\n $this->streamObjects[$objectCounter] = $object;\r\n // According to the spec objects within an object stream shall not be enclosed \r\n // by obj/endobj tags, but there are some pdfs in the wild using those tags \r\n // skip endobject marker if present\r\n if (!$this->seqSource->isEOF() && $this->seqSource->peek() == 'e') {\r\n $this->readLine();\r\n }\r\n $objectCounter++;\r\n }\r\n\t\t\t$this->seqSource->close();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->seqSource->close();\r\n\t\t} // finally is not supported in PHP until version 5.5.\r\n\t}",
"protected function processObjectModels()\n {\n $directory = new RecursiveDirectoryIterator(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'classes');\n $iterator = new RecursiveIteratorIterator($directory);\n\n $list = [];\n foreach ($iterator as $path) {\n $list[] = \"$path\";\n }\n sort($list);\n\n foreach ($list as $path) {\n $file = basename($path);\n if (preg_match(\"/^.+\\.php$/i\", $file)) {\n $className = str_replace(\".php\", \"\", $file);\n if ($className !== \"index\") {\n $namespace = $this->resolveNamespace($path);\n if ($namespace) {\n $className = $namespace . $className;\n }\n if (! class_exists($className)) {\n require_once($path);\n }\n if (class_exists($className)) {\n $reflection = new ReflectionClass($className);\n if ($reflection->isSubclassOf('ObjectModel') && !$reflection->isAbstract()) {\n $definition = ObjectModel::getDefinition($className);\n if ($definition && isset($definition['table'])) {\n $this->processModel($className, $definition);\n }\n }\n }\n }\n }\n }\n }",
"function build_oai_objects($record, $namespace, $collection_pid, $content_model) {\n set_time_limit(0);\n module_load_include('inc', 'fedora_repository', 'api/fedora_utils');\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $thumbnail_file = drupal_get_path('module', 'islandora_harvester') . '/images/Crystal_Clear_action_filenew.png';\n\n $pid = fedora_item::get_next_PID_in_namespace($namespace);\n $dcStream = $record['dc'];\n $modsStream = oai_create_mods($dcStream);\n preg_match('/<dc:title>.*<\\/dc:title>/', $dcStream, $matches);\n $title = preg_replace('/<\\/?dc:title>/', \"\", $matches[0]);\n $item = fedora_item::ingest_new_item($pid, 'A', $title, 'Owner');\n $item->modify_datastream_by_value($dcStream, 'DC', \"Dublin Core\", 'text/xml');\n $item->add_datastream_from_string($modsStream, 'MODS', \"MODS\", 'text/xml');\n $item->add_relationship('isMemberOfCollection', $collection_pid, 'info:fedora/fedora-system:def/relations-external#');\n $item->add_relationship('hasModel', $content_model, 'info:fedora/fedora-system:def/model#');\n $item->add_datastream_from_file($thumbnail_file, 'TN');\n}",
"function writeObjects($xmlObj,$depth=0) {\n\t\t\n\t\t$objectList = array(\n\t\t\n\t\t\t'project' => 'project',\n\t\t\t'event' => 'event',\n\t\t\t'training' => 'training',\n\t\t\t'service' => 'service',\n \t\t\t'tool' => 'tool',\n\t\t\t'tool-portrait' => 'toolportraiteto',\n\t\t\t'contact' => 'contact',\n\t\t\t'university-data' => 'university',\n\t\t\t'hs-contacts' => '##SUB##',\n\t\t);\n\t\t\n\t\n\t\tforeach($xmlObj->children() as $key => $child) {\n\t\t\t$name = $child->getName();\n\t\t\t$castName = $objectList[$name];\n\t\t\tif($castName == '##SUB##'){\n\t\t\t\t$this->writeObjects($child,$depth+1);\n\t\n\t\t\t}elseif($castName != ''){\n\t\t\t\t// echo str_repeat('-',$depth).\">\".$objectname.\": \".$child->title.\" \\n\\r\";\n\t\t\t\t\n\t\t\t\t$object = new $castName();\n\t\t\t\t$object->setProcessMode('import','');\n\t\t\t\t$object->setSyncId($this->syncId);\n\t\t\t\t$objectconf = $object->fields['import'];\n\t\t\t\t$data = $this->getObjectData($child,$objectconf);\n\n\t\t\t\tif($name == 'tool-portrait'){\n\t\t\t\t\t//TODO\n\n\t\t\t\t\t// echo \"XNU8\";\n\t\t\t\t\t// print_r($child);\n\t\t\t\t}\n\n\n\t\t\t\tif($this->isOwnObject($data['objectid'])){\n\t\t\t\t\t$object->setPid($this->conf['ownPid']);\n\t\t\t\t\t$objectSourceType = 'own';\n\t\t\t\t}else{\n\t\t\t\t\t$object->setPid($this->conf['etoPid']);\n\t\t\t\t\t$objectSourceType = 'eto';\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$object->importData = $data;\n\t\t\t\t$object->processImportFields();\n\t\t\t\t$objectId = $object->getImportFieldValue('objectid');\n\t\t\t\t\n\t\t\t\t$objectUid = $this->getUidByUuid($objectId,$object->objectTable);\n\t\t\t\t// echo \"OBJECT UID $objectUid \\n\\r\";\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$object->loadByUuid($objectId);\n\n\t\t\t\t\t// Check if import object has higher tstamp as current db object one\n\t\t\t\t\t// Only write Data if import object has a bigger tstamp for own data or is eto data - cause here i allways update the syncid and eto feed has\n\t\t\t\t\t// allways the current data.\n\n\t\t\t\t\tif(!$this->isOwnObject($objectId) || ($object->processedImportData['tstamp'] > $object->getFieldValue('tstamp')) ){\n\t\t\t\t\t\t$msg = \"\\n\".'Updating '.$objectSourceType.' object '.$castName.' with objectid '.$objectId.\"\\n\";\n\t\t\t\t\t\t$this->writeLog($msg,1);\t\n\t\t\t\t\t\t$object->setData($object->processedImportData,'update');\n\t\t\t\t\t\t$this->writeMMOptions($object);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}catch(Exception $ex){\n\t\t\t\t\t\n\t\t\t\t\t$msg = 'Inserting '.$objectSourceType.' object '.$castName.' with objectid '.$objectId;\n $this->writeLog($msg,1);\n\t\t\t\t\t$object->setData($object->processedImportData,'insert');\n\t\t\t\t\t$this->writeMMOptions($object);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t\tif($name != 'contact')\n \t\t\t\t$this->writeObjects($child,$depth+1);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t// echo \"$name NOT IN LIST\";\n\t\t\t\t\n\t\t\t}\n \t\t}\n\t}",
"function uwsdora_create_object($repo, $pid, &$context) {\n module_load_include('inc', 'islandora', 'includes/utilities');\n\n drush_print(dt('Processing @pid @count/@total ', array(\n '@pid' => $pid,\n '@total' => count($context['results']['pids']),\n '@count' => $context['results']['success_count'],)));\n\n try {\n if (!islandora_object_load($pid)) {\n // Get the old object from the remote fedora.\n $object = $repo->repository->getObject(urldecode($pid));\n\n // Set the default parent collection.\n $parent_collection = 'uws:researchCollection';\n\n // Determine the MARCXML record.\n $marc_dsid = uwsdora_determine_marc_record($repo, $object);\n\n if ($marc_dsid != 'no_marc') {\n // Determine the parent collection.\n $parent_collection = uwsdora_determine_collection($object[$marc_dsid]->content);\n\n // Transforms MARC to MODS.\n $xml_doc = new DOMDocument();\n $xml_doc->loadXML($object[$marc_dsid]->content);\n $path_to_marc_to_mods_xsl_file = drupal_get_path('module', 'uwsdora') . '/transforms/MARC21slim2MODS3-4.xsl';\n $mods_xml = uwsdora_transform($xml_doc, $path_to_marc_to_mods_xsl_file);\n\n // Get the handle from the old DC datastream.\n $dc = new SimpleXMLElement($object['DC']->content);\n $dc->registerXPathNamespace('dc', \"http://purl.org/dc/elements/1.1/\");\n $handles = $dc->xpath('//dc:identifier');\n $matches = '';\n $handle_found = FALSE;\n // There could be multiple identifier fields that come back.\n if (count($handles) > 0) {\n $pattern = '/http:\\/\\/handle/';\n foreach ($handles as $handle) {\n preg_match($pattern, (string) $handle, $matches);\n // If we get a match then set the handle to be tha element in the\n // array.\n if (count($matches) > 0) {\n $handle = (string) $handle;\n $handle_found = TRUE;\n break;\n }\n }\n }\n // If there is no handle we need to log the pid.\n if (!$handle_found) {\n $handle = '';\n // Log pid for no handle.\n uwsdora_log_errors('has no object handle', $pid);\n }\n\n // Create identifier for mods.\n $xml_doc->loadXML($mods_xml);\n $mods_doc = $xml_doc->getElementsByTagName('mods');\n $mods_doc = $mods_doc->item(0);\n $xml_identifier = $xml_doc->createElement('identifier', $handle);\n $xml_identifier->setAttribute(\"type\", \"hdl\");\n $mods_doc->appendChild($xml_identifier);\n $mods_xml = $xml_doc->saveXML();\n\n // Transforms MODS to DC.\n $xml_doc->loadXML($mods_xml);\n $path_to_mods_to_dc_xsl_file = drupal_get_path('module', 'uwsdora') . '/transforms/mods_to_dc.xsl';\n $dc_xml = uwsdora_transform($xml_doc, $path_to_mods_to_dc_xsl_file);\n\n // Get the title out of the MODS xml.\n $mods = new SimpleXMLElement($mods_xml);\n $mods->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');\n $title = $mods->xpath('//mods:mods/mods:titleInfo/mods:title');\n if (count($title) > 0) {\n $title = (string) reset($title);\n }\n else {\n $title = $object->label;\n }\n }\n else {\n uwsdora_log_errors('There is no MARCXML', $pid);\n }\n\n // Create new object stub.\n $new_object = islandora_prepare_new_object($pid, $title, array(), array('ir:citationCModel'), array(array('relationship' => 'isMemberOfCollection', 'pid' => $parent_collection)));\n\n // Copy over all other datastreams to new object.\n // Get all the dsids.\n $all_dsids = uwsdora_get_all_dsids($repo, $pid);\n\n // Iterate through array and copy datastreams.\n foreach ($all_dsids as $dsid) {\n if ($dsid == 'DC') {\n uwsdora_create_datastream($new_object, 'OLD_DC', 'DC Record', 'text/xml', $object[$dsid]->content);\n }\n else {\n\n $new_object->ingestDatastream($object[$dsid]);\n }\n // Log all of the handles for this datastream.\n $alt_id_found = FALSE;\n $ds = $repo->api->m->getDatastream($pid, $dsid);\n // We need to determine which of the alt ids is the handle. and if it is\n // an array or just a string.\n $pattern = '/http:\\/\\/handle/';\n if (isset($ds['dsAltID']) && is_array($ds['dsAltID'])) {\n foreach ($ds['dsAltID'] as $handle) {\n preg_match($pattern, $handle, $matches);\n // If we get a match then replace the node with the new node.\n if (count($matches) > 0) {\n uwsdora_log_handle($handle, $pid, $dsid);\n $alt_id_found = TRUE;\n break;\n }\n }\n }\n elseif (isset($ds['dsAltID'])) {\n // If the altid is just a string.\n preg_match($pattern, $ds['dsAltID'], $matches);\n // If we get a match then replace the node with the new node.\n if (count($matches) > 0) {\n uwsdora_log_handle($ds['dsAltID'], $pid, $dsid);\n $alt_id_found = TRUE;\n }\n }\n // If not handle is found log it.\n if (!$alt_id_found) {\n uwsdora_log_errors(\"$dsid has no handle\", $pid);\n }\n }\n\n // Create MODS datastream.\n // If there is no MARCXML did not do a transform to MODS then do a\n // transform from DC to MODS.\n if (empty($mods_xml)) {\n $xml_doc = new DOMDocument();\n $xml_doc->loadXML($object['DC']->content);\n $path_to_dc_to_mods_xsl_file = drupal_get_path('module', 'uwsdora') . '/transforms/DC_MODS3-4_XSLT1-0.xsl';\n $mods_xml = uwsdora_transform($xml_doc, $path_to_dc_to_mods_xsl_file);\n\n // Create identifier for mods.\n $xml_doc->loadXML($mods_xml);\n $mods_doc = $xml_doc->getElementsByTagName('mods');\n $mods_doc = $mods_doc->item(0);\n\n // Remove the location.\n $locations = $xml_doc->getElementsByTagName('location');\n // Remove all of the locations.\n foreach ($locations as $location) {\n $mods_doc->removeChild($location);\n }\n // We need to find out which identifier we need to replace.\n $identifiers = $xml_doc->getElementsByTagName('identifier');\n $pattern = '/http:\\/\\/handle/';\n $identfier_found = FALSE;\n foreach ($identifiers as $identifier) {\n preg_match($pattern, $identifier->nodeValue, $matches);\n // If we get a match then replace the node with the new node.\n if (count($matches) > 0) {\n // Replace old identifier with new identifier.\n $xml_identifier = $xml_doc->createElement('identifier', $identifier->nodeValue);\n $xml_identifier->setAttribute(\"type\", \"hdl\");\n $mods_doc->replaceChild($xml_identifier, $identifier);\n $mods_xml = $xml_doc->saveXML();\n $identfier_found = TRUE;\n break;\n }\n }\n if (!$identfier_found) {\n uwsdora_log_errors(\"no handle identifier in mods\", $pid);\n }\n }\n\n // Create MODS datastream.\n uwsdora_create_datastream($new_object, 'MODS', 'MODS Record', 'text/xml', $mods_xml);\n\n // Create DC datastream.\n if (isset($dc_xml)) {\n uwsdora_create_datastream($new_object, 'DC', 'DC Record', 'text/xml', $dc_xml);\n }\n else {\n uwsdora_log_errors(\"no new DC datastream created\", $pid);\n }\n // Create PDF datastream.\n $pdf_list = uwsdora_get_mimetype_dsids($repo, $object->id, \"application/pdf\");\n\n if (count($pdf_list) > 0) {\n // Merge all PDF files.\n $pdf_final_file_path = uwsdora_merge_pdfs($repo, $object, $pdf_list);\n // Create stub PDF datastream.\n if ($pdf_final_file_path) {\n uwsdora_create_datastream($new_object, 'PDF', 'PDF Record', 'application/pdf', '');\n // Set the content fo be the merged pdf file.\n $new_object['PDF']->setContentFromFile($pdf_final_file_path);\n // Delete the combined PDF file.\n file_unmanaged_delete($pdf_final_file_path);\n }\n else {\n uwsdora_log_errors(\"Failed to merge PDF and create derivatives\", $pid);\n }\n\n }\n\n try {\n // Add object to fedora.\n islandora_add_object($new_object);\n $context['results']['success_count']++;\n $message = t(\"Object: @pid, message: @message @count/@total \\n\", array(\n '@pid' => $pid,\n '@message' => 'successful ingest ',\n '@total' => count($context['results']['pids']),\n '@count' => $context['results']['success_count'],\n ));\n\n file_put_contents(drupal_realpath('public://uwsdora_migration_log.txt'), $message, FILE_APPEND);\n\n }\n catch (RepositoryException $e) {\n // Failed to import.\n uwsdora_log_errors('Failed to ingest', $pid);\n }\n }\n else {\n drush_print(\"Object: $pid already exists\");\n $context['results']['success_count']++;\n }\n }\n catch (Exception $e) {\n // Failed to import.\n $message = t(\"@pid \\n\", array(\n '@pid' => $pid,\n ));\n\n file_put_contents(drupal_realpath(\"public://uwsdora_migration_failed_pids.txt\"), $message, FILE_APPEND);\n }\n}",
"function loadOntologyToPlainList($ontologyOwl, $ancestors) {\n\t//variables\n\t$resource = \"\";\n\t$graph = \"\";\n\t$classArray = array();\n\t$subClassArray = array();\n\t$array_gen;\n\t$block_json=\"{}\";\n\t$label;\n\n\tif (in_array($ontologyOwl ,array_values($GLOBALS['oeb_dataModels']))) {\n\n\t\t//get the effective url of the ontology => the last url used\n\t\t$ch = curl_init($ontologyOwl);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, TRUE);\n\t\t$curl_data = curl_exec($ch);\n\t\t$url_effective = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\n\t\t//create a hash \n\t\t$hash_ontologyDir = md5($url_effective . '_' . $ancestors);\n\n\t\t//directory in which ontology lists are saved\n\t\t$ontologyDir = $GLOBALS['oeb_tmp'] . $hash_ontologyDir;\n\t\t$ontologyFile = $ontologyDir . \"/plain_list.txt\";\n\t\t\n\t\tif (!is_dir($ontologyDir) || filesize($ontologyFile) == 0) {\n\t\t\t//ontology-general\n\t\t\t//we use the link of .owl and not the pURLs because this function does not accepted it\n\n\t\t\t$graph = EasyRdf_Graph::newAndLoad($GLOBALS['oeb_general_ontology_reasoner'],\"rdfxml\");\n\t\t\t\n\t\t\t$resource = $graph->resource($ancestors);\n\n\t\t\t//get all the classes that are subclass of the uri 'https://w3id.org/oebDataFormats/FormatDatasets'\n\t\t\t$classes = $graph->resourcesMatching(\"rdfs:subClassOf\",$resource);\n\n\t\t\t//get the first classes (without showing the childrens)\n\t\t\tforeach ($classes as $class) {\n\t\t\t\t//get the label of first classes (without showing the childrens)\n\t\t\t\t$label = $class->getLiteral('rdfs:label');\n\t\t\t\t$label = (string)$label; \n\n\t\t\t\t//get the uri of classes that extends from the previous class find\n\t\t\t\t$resourceClassesInherited = $graph->resource($class);\n\n\t\t\t\t//get all the classes that are subclass of the uri found in the previous step (all the uris of classes that extends from the first classes found)\n\t\t\t\t$classesInherited = $graph->resourcesMatching(\"rdfs:subClassOf\",$resourceClassesInherited);\n\n\t\t\t\t$URILabel = (string)$resourceClassesInherited->getUri();\n\n\t\t\t\t$ClassPair = array(\"label\" => $label, \"URI\" => $URILabel);\n\t\t\t\tarray_push($classArray, $ClassPair);\n\n\t\t\t\t//if there are not any format inherited in the first classes do not do it\n\t\t\t\t$subClassArray = array();\n\t\t\t\tif ($classesInherited != null) {\n\t\t\t\t\t//get the classes inherited (the childrens)\n\t\t\t\t\tforeach($classesInherited as $classInherited) {\n\t\t\t\t\t\t//get the label of the classes inherited (the childrens)\n\t\t\t\t\t\t$labelClassInherited = (string)$classInherited->getLiteral('rdfs:label');\n\t\t\t\t\t\t$URIClassInherited = (string)$classInherited->getUri();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$subClassPair = array(\"label\" => $labelClassInherited, \"URI\" => $URIClassInherited);\n\t\t\t\t\t\tif (!in_array($subClassPair, $classArray)) {\n\t\t\t\t\t\t\tarray_push($classArray, $subClassPair);\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$block_json = json_encode($classArray, JSON_PRETTY_PRINT);\n\t\t\tmkdir($ontologyDir, 0777, true);\n\t\t\tfile_put_contents($ontologyFile, $block_json);\n\t\t} else {\n\t\t\t$block_json = file_get_contents($ontologyFile, FILE_USE_INCLUDE_PATH);\n\t\t}\n\t\treturn $block_json;\n\t} else {\n\t\treturn $block_json;\n\t}\n}",
"protected function addGPXtoObject() {\n\t\tif (!$this->GPXImporter->failed())\n\t\t\tforeach ($this->GPXImporter->object()->getArray() as $key => $value)\n\t\t\t\tif ($this->TrainingObject->get($key) == '' || $this->TrainingObject->get($key) == 0)\n\t\t\t\t\t$this->TrainingObject->set($key, $value);\n\n\t\tif (!$this->TrainingObject->Splits()->areEmpty())\n\t\t\t$this->fillSplitsFromGPX();\n\t}",
"protected function initRelationships() {\n\t\t// Get the contents of document.xml.rels\n\t\t$originalRels = $this->zip->getFromName('word/_rels/document.xml.rels');\n\t\t$originalRels = simplexml_load_string($originalRels);\n\t\t// Create a SimpleXMLElement to store the Relationship elements\n\t\t$this->docRels = new \\SimpleXMLElement('<Relationships></Relationships>');\n\t\t$this->docRels->addAttribute('xmlns' , self::RELATIONSHIPS_NS);\n\t\t// Initialize an array for Relationship elements to be added after images\n\t\t$this->relsToAdd = array();\n\t\t// Get the rId number of the first image, and check for header and footer\n\t\tforeach ($originalRels->Relationship as $rel) {\n\t\t\tif ($rel['Type'] == self::IMAGE_NS) {\n\t\t\t\t$this->imageStart = isset($this->imageStart) ? $this->imageStart : substr($rel['Id'], 3);\n\t\t\t} elseif ($rel['Type'] == self::HEADER_NS) {\n\t\t\t\t$this->header = true;\n\t\t\t} elseif ($rel['Type'] == self::FOOTER_NS) {\n\t\t\t\t$this->footer = true;\n\t\t\t}\n\t\t}\n\t\t// Add the Relationship elements to different lists depending on whether\n\t\t// their rId number is lower or higher than the first image\n\t\tforeach ($originalRels->Relationship as $rel) {\n\t\t\t// Omit images from either list\n\t\t\tif ($rel['Type'] == self::IMAGE_NS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = substr($rel['Id'], 3);\n\t\t\tif ($id < $this->imageStart) {\n\t\t\t\t$newRel = $this->docRels->addChild('Relationship');\n\t\t\t\t$newRel->addAttribute('Id', $rel['Id']);\n\t\t\t\t$newRel->addAttribute('Type', $rel['Type']);\n\t\t\t\t$newRel->addAttribute('Target', $rel['Target']);\n\t\t\t} elseif ($id > $this->imageStart) {\n\t\t\t\t$this->relsToAdd[$id] = array('Type' => $rel['Type'], 'Target' => $rel['Target']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// Arrange the Relationships after the images in ascending order\n\t\tksort($this->relsToAdd);\n\t}",
"function atom_to_object($atom_string){\n\t\n\t\t $allResults = array();\n\t\t $host = OpenContext_OCConfig::get_host_config();\t\n\t \n\t\t @$atomXML = simplexml_load_string($atom_string);\n\t \n\t\t if($atomXML){\n\t \n\t\t\t\t$atomXML->registerXPathNamespace(\"default\", \"http://www.w3.org/2005/Atom\");\n\t\t\t\t$atomXML->registerXPathNamespace(\"opensearch\", \"http://a9.com/-/spec/opensearch/1.1/\");\n\t\t\t\t\n\t\t\t\t$resultCount = $this->numFound;\n\t\t\t\t\n\t\t\t\t$resultSubTitle = OpenContext_ResultAtom::get_xml_string($atomXML, \"/default:feed/default:subtitle\");\n\t\t\t\t$first_PageURI = $this->firstPage_XHTML;\n\t\t\t\t$last_PageURI = $this->lastPage_XHTML;\n\t\t\t\t$next_PageURI = $this->nextPage_XHTML;\n\t\t\t\t$prev_PageURI = $this->prevPage_XHTML;\n\t\t\t\t\n\t\t\t\t$docTypeArray = $this->docTypeArray;\n\t\t\t\t$resultArrayURIKey = array();\n\t\t\t\tif(is_array($this->documentsArray)){\n\t\t\t\t\t foreach($this->documentsArray as $doc){\n\t\t\t\t\t\t $uriKey = $host.$docTypeArray[\"spatial\"][\"href\"].$doc[\"uuid\"];\n\t\t\t\t\t\t $resultArrayURIKey[$uriKey] = $doc;\n\t\t\t\t\t }//end loop\n\t\t\t\t}\n\t\t\t \n\t\t\t \n\t\t\t $eee = count($resultArrayURIKey);\n\t\t\t $iii = 0;\n\t\t\t if($eee>0){\n\t\t\t\t \n\t\t\t\t\t foreach ($atomXML->xpath(\"/default:feed/default:entry\") as $AtomEntry) {\n\t\t\t\t\t\t $AtomEntry->registerXPathNamespace(\"default\", \"http://www.w3.org/2005/Atom\");\n\t\t\t\t\t\t $AtomEntry->registerXPathNamespace(\"xhtml\", \"http://www.w3.org/1999/xhtml\");\n\t\t\t\t\t\t $AtomEntry->registerXPathNamespace(\"geo\", OpenContext_OCConfig::get_namespace(\"georss\"));\n\t\t\t\t\t\t $AtomEntry->registerXPathNamespace(\"kml\", OpenContext_OCConfig::get_namespace(\"kml\"));\n\t\t\t\t\t\t \n\t\t\t\t\t\t $geoLat = false;\n\t\t\t\t\t\t $geoLon = false;\n\t\t\t\t\t\t $kmlBegin = false;\n\t\t\t\t\t\t $kmlEnd = false;\n\t\t\t\t\t\t \n\t\t\t\t\t\t $entryURI = false;\n\t\t\t\t\t\t foreach($AtomEntry->xpath(\"./default:id\") as $idNode){\n\t\t\t\t\t\t\t $entryURI = (string)$idNode;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($AtomEntry->xpath(\"./geo:point\")){\n\t\t\t\t\t\t\t\tforeach($AtomEntry->xpath(\"./geo:point\") as $geoNode){\n\t\t\t\t\t\t\t\t\t$geo = (string)$geoNode;\n\t\t\t\t\t\t\t\t\t$geoData = explode(\" \", $geo);\n\t\t\t\t\t\t\t\t\t$geoLat = $geoData[0] +0;\n\t\t\t\t\t\t\t\t\t$geoLon = $geoData[1] +0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$resultArrayURIKey[$entryURI] = $doc;\n\t\t\t\t\t\t\t\tif(stristr($doc[\"geo_point\"], \",\")){\n\t\t\t\t\t\t\t\t\t$geoData = explode(\",\", $doc[\"geo_point\"]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$geoData = explode(\" \", $doc[\"geo_point\"]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$geoLat = $geoData[0] +0;\n\t\t\t\t\t\t\t\t$geoLon = $geoData[1] +0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(isset($doc[\"time_span\"])){\n\t\t\t\t\t\t\t $timeData = explode(\" \", $doc[\"time_span\"]);\n\t\t\t\t\t\t\t $kmlBegin = $timeData[0] +0;\n\t\t\t\t\t\t\t $kmlEnd = $timeData[1] +0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t $kmlBegin = false;\n\t\t\t\t\t\t\t $kmlEnd = false;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t foreach ($AtomEntry->xpath(\"./default:content\") as $entry) {\n\t\t\t\t\t\t\t $entry->registerXPathNamespace(\"default\", \"http://www.w3.org/2005/Atom\");\n\t\t\t\t\t\t\t $entry->registerXPathNamespace(\"xhtml\", \"http://www.w3.org/1999/xhtml\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach ($entry->xpath(\"./xhtml:div\") AS $act_content){\n\t\t\t\t\t\t\t\t\t $act_content->registerXPathNamespace(\"xhtml\", \"http://www.w3.org/1999/xhtml\");\n\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='class_name']\") as $act_class){\n\t\t\t\t\t\t\t\t\t\t $itemCat = $act_class.\"\";\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='project_name']\") as $act_proj){\n\t\t\t\t\t\t\t\t\t\t $itemProject = $act_proj.\"\";\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='class_icon']/xhtml:img/@src\") as $act_icon){\n\t\t\t\t\t\t\t\t\t\t $itemIcon = $act_icon.\"\";\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='item_label']\") as $act_label){\n\t\t\t\t\t\t\t\t\t\t $itemLabel = $act_label.\"\";\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='context']\") as $itemContextXML){\n\t\t\t\t\t\t\t\t\t\t $itemContext = $itemContextXML->asXML();\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t $itemThumb = false;\n\t\t\t\t\t\t\t\t\t if($act_content->xpath(\".//xhtml:div[@class='item_thumb']//xhtml:img/@src\")){\n\t\t\t\t\t\t\t\t\t\t foreach($act_content->xpath(\".//xhtml:div[@class='item_thumb']//xhtml:img/@src\") as $act_thumb){\n\t\t\t\t\t\t\t\t\t\t\t $itemThumb = $act_thumb.\"\";\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t if(!$itemThumb){\n\t\t\t\t\t\t\t\t\t\t $itemThumb = $itemIcon;\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\t\t$var_vals = false;\n\t\t\t\t\t\t\t\t$entryIDarray = explode(\"/\", $entryURI);\n\t\t\t\t\t\t\t\t$entryUUID = $entryIDarray[count($entryIDarray)-1];\n\t\t\t\t\t\t\t\tif(is_array($this->documentsArray)){\n\t\t\t\t\t\t\t\t\t foreach($this->documentsArray as $doc){\n\t\t\t\t\t\t\t\t\t\t if(isset($doc[\"href\"])){\n\t\t\t\t\t\t\t\t\t\t\t\tif(strstr($doc[\"href\"],$entryUUID)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(isset($doc[\"var_vals\"])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t //$var_vals = Zend_json::decode($doc[\"var_vals\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $var_vals = $doc[\"var_vals\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t\t\t\t$var_vals = \"no href\";\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t $var_vals = \"no docs\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $resultItem = array(\"uri\"=>$entryURI,\n\t\t\t\t\t\t\t\t\t\t \"category\"=>$itemCat,\n\t\t\t\t\t\t\t\t\t\t \"catIcon\"=>$itemIcon,\n\t\t\t\t\t\t\t\t\t\t \"project\"=>$itemProject,\n\t\t\t\t\t\t\t\t\t\t \"label\"=>$itemLabel,\n\t\t\t\t\t\t\t\t\t\t \"context\"=> $itemContext,\n\t\t\t\t\t\t\t\t\t\t \"thumbIcon\"=>$itemThumb,\n\t\t\t\t\t\t\t\t\t\t \"var_vals\" => $var_vals,\n\t\t\t\t\t\t\t\t\t\t \"geoTime\" => array(\"geoLat\" => $geoLat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"geoLong\" => $geoLon,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"timeBegin\" => $kmlBegin,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"timeEnd\" => $kmlEnd\n\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t }//end loop through entries\n\t\t\t\t \n\t\t\t\t\t $allResults[] = $resultItem;\n\t\t\t\t\t $iii++;\n\t\t\t\t }//Atom Entries\n\t\t }//end case with entries\n\t\t \n\t }//end case with atom content\n\t \n\t \n\t $resultObject = array(\"resultCount\"=>$resultCount,\n\t\t\t\t\t \"firstURI\"=>$first_PageURI,\n\t\t\t\t\t \"lastURI\"=>$last_PageURI,\n\t\t\t\t\t \"prevURI\"=>$prev_PageURI,\n\t\t\t\t\t \"nextURI\"=>$next_PageURI,\n\t\t\t\t\t \"items\"=>$allResults\n\t\t\t\t\t );\n\t \n\t return $resultObject;\n }",
"public function processData() {\n\t\t$start = \"<feed xmlns='http://www.w3.org/2005/Atom'></feed>\";\n\t\t$this->atom = new SimpleXMLElement($start);\n\t\t$feed = $this->atom;\n\t\t//$feed->addChild(\"title\", $this->query);\n\t\t//add link to exist xml representation\n\t\t//$feed->addChild();\n\t\t\n\t\tforeach($this->responseXml->recipe as $recipe) {\n\t\t\t$entry = $feed->addChild(\"entry\");\n\t\t\t$entry->addAttribute(\"xmlns\", \"http://www.w3.org/2005/Atom\");\n\t\t\t$entry->addChild(\"title\", $recipe->title[0]);\n\t\t\t$link = $entry->addChild(\"link\");\n\t\t\t$link->addAttribute(\"href\", $recipe->href[0]);\n\t\t\t\n\t\t\t$ingredients = explode(\",\", $recipe->ingredients);\n\t\t\t$recipe->addChild(\"name\", $recipe->title[0]);\n\t\t\t\n\t\t\t$ingredientData = $recipe->addChild(\"ingredientData\");\n\t\t\t$atomingredients = $entry->addChild(\"ingredientData\");\n\t\t\t$atomingredients->addAttribute(\"xmlns\", \"http://ingredientdata.com\");\n\t\t\t\n\t\t\tforeach($ingredients as $ingredient) {\n\t\t\t\t\n\t\t\t\t$data = $this->getIngredientData($ingredient);\n\t\t\t\t\n\t\t\t\t$ingchild = $ingredientData->addChild(\"ingredient\");\n\t\t\t\t$atomingchild = $atomingredients->addChild(\"ingredient\");\n\n\t\t\t\t$ingchild->addAttribute(\"name\", str_replace(\" \", \"\", $ingredient));\n\t\t\t\t$atomingchild->addAttribute(\"name\", str_replace(\" \", \"\", $ingredient));\n\t\t\t\t\t\t\t\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t $ic = $ingchild->addChild(\"nutrient\", $value);\n\t\t\t\t\t$ic->addAttribute(\"name\", $key);\n\n\t\t\t\t\t$ic2 = $atomingchild->addChild(\"nutrient\", $value);\n\t\t\t\t\t$ic2->addAttribute(\"name\", $key);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->atom = $feed;\n\t}",
"public function readObj( $obj ){\n if ( $obj ){\n $this->label->read($obj->label); \n $this->publicationStatus = $obj->publicationStatus; \n $this->templateID = $obj->templateID;\n $this->data = $obj->data;\n $this->seo->read( $bson->seo, $this->getID() );\n } \n }",
"public function packageObject($dir)\n {\n // Get the compound object's label from the MODS.xml file. If there\n // is no MODS.xml file in the input directory, move on to the\n // next directory.\n $mods_path = realpath($dir) . DIRECTORY_SEPARATOR . 'MODS.xml';\n if (!$label = get_value_from_mods($mods_path, '//mods:titleInfo/mods:title', $this->log)) {\n $this->log->addWarning(realpath($dir) . \" appears to be empty, skipping.\");\n return;\n }\n\n $cpd_pid = $this->ingestObject($dir, $label);\n\n // If ingestObject() was successful (you have a PID), move on to\n // adding the object's relatinships. Most top-level objects only\n // have two, the content model relationship and the collection\n // relationship. However, you can add any additional relationships\n // here that apply to all objects of your content type. Relationships\n // specific to individual objects can always be added using the\n // object-level relationships.json file, which is done in the Ingester\n // base class.\n\n $cmodel = get_cmodel_from_cmodel_txt(realpath($dir)) ?\n get_cmodel_from_cmodel_txt(realpath($dir)) : $this->command['m'];\n $cmodel_params = array(\n 'uri' => 'info:fedora/fedora-system:def/model#',\n 'predicate' => 'hasModel',\n 'object' => $cmodel,\n 'type' => 'uri',\n );\n $this->addRelationship($cpd_pid, $cmodel_params);\n\n $parent_params = array(\n 'uri' => 'info:fedora/fedora-system:def/relations-external#',\n 'predicate' => $this->command['r'],\n 'object' => $this->command['p'],\n 'type' => 'uri',\n );\n $this->addRelationship($cpd_pid, $parent_params);\n\n // If you are ingesting datastreams with this object, make sure\n // that ingestDatastreams() comes after the object's content\n // model is set. Otherwise, Islandora will not generate any\n // derivatives from the datastreams (the content model sets the\n // rules for derivative generation).\n $this->ingestDatastreams($child_pid, $child_dir);\n\n if ($cpd_pid) {\n $message = \"Object $cpd_pid ingested from \" . realpath($dir);\n $this->log->addInfo($message);\n print $message . \"\\n\";\n }\n\n // If your custom content model does not have any children, you do not need\n // to use any of the code below.\n\n // We track the child PIDs in order to generate a thumbnail for the parent;\n // by convention, it gets the TN of its first child.\n $child_pids = array();\n // Since each child is an object in its own right, you can pass off its\n // ingestion to another Ingester. In this example, we assume that the child\n // objects are single-file objects.\n $child_ingester = new \\islandora_rest_ingester\\ingesters\\Single($this->log, $this->command);\n\n // Iterate through subdirectories of the parent's input and create a child for each.\n // Note that recursing the parent object's directory to get its children is not\n // necessarily the only approach; for example, you could fetch them from remote URLs\n // if you wanted to. If you did this, you would need to come up with a way in your\n // custom class to find and parse those URLs.\n\n $child_dirs = new \\FilesystemIterator(realpath($dir));\n foreach ($child_dirs as $child_dir) {\n $child_dir = $child_dir->getPathname();\n\n if (!is_dir($child_dir)) {\n continue;\n }\n\n // Get sequence number from directory name.\n $child_dir_name = pathinfo($child_dir, PATHINFO_FILENAME);\n\n $obj_files = glob($child_dir . DIRECTORY_SEPARATOR . 'OBJ.*');\n $obj_file_path = $child_dir . DIRECTORY_SEPARATOR . $obj_files[0];\n\n if (!$obj_file_cmodel = get_cmodel_from_cmodel_txt($child_dir)) {\n $obj_file_ext = pathinfo($obj_file_path, PATHINFO_EXTENSION);\n if (!$obj_file_cmodel = get_cmodel_from_extension($obj_file_ext)) {\n $this->log->addWarning(\"Cannot determine content model for child object \" .\n \"at \" . realpath($dir) . \", skipping.\");\n continue;\n }\n }\n\n $child_mods_path = realpath($child_dir) . DIRECTORY_SEPARATOR . 'MODS.xml';\n $child_label = get_value_from_mods($child_mods_path, '//mods:titleInfo/mods:title', $this->log);\n $child_pid = $child_ingester->ingestObject($child_dir, $child_label);\n\n // If $child_pid is FALSE, log error and move on to next object.\n if (!$child_pid) {\n $this->log->addError(\"Child object at \" . realpath($child_dir) . \" not ingested\");\n continue;\n }\n\n // Keep track of child PIDS so we can get the first one's TN later.\n array_push($child_pids, $child_pid);\n\n $cmodel_params = array(\n 'uri' => 'info:fedora/fedora-system:def/model#',\n 'predicate' => 'hasModel',\n 'object' => $obj_file_cmodel,\n 'type' => 'uri',\n );\n $child_ingester->addRelationship($child_pid, $cmodel_params);\n\n $parent_params = array(\n 'uri' => 'info:fedora/fedora-system:def/relations-external#',\n 'predicate' => 'isConstituentOf',\n 'object' => $cpd_pid,\n 'type' => 'uri',\n );\n $child_ingester->addRelationship($child_pid, $parent_params);\n\n $uri_safe_parent_pid = preg_replace('/:/', '_', $cpd_pid);\n $is_sequence_number_of_params = array(\n 'uri' => 'http://islandora.ca/ontology/relsext#',\n 'predicate' => 'isSequenceNumberOf' . $uri_safe_parent_pid,\n 'object' => $child_dir_name,\n 'type' => 'none',\n );\n $child_ingester->addRelationship($child_pid, $is_sequence_number_of_params);\n\n // ingestDatastreams() must come after the object's content\n // model is set in order to derivatives to be generated.\n $child_ingester->ingestDatastreams($child_pid, $child_dir);\n\n if ($child_pid) {\n $message = \"Object $child_pid ingested from \" . realpath($child_dir);\n $this->log->addInfo($message);\n print $message . \"\\n\";\n }\n // This is the end of the loop that gets the childrens' input files and ingests them.\n }\n\n // Give the parent compound object the TN from its first child.\n if ($path_to_tn_file = download_datastream_content($child_pids[0], 'TN', $this->command, $this->log)) {\n $this->ingestDatastreams($cpd_pid, $dir, 'TN', $path_to_tn_file);\n unlink($path_to_tn_file);\n } else {\n $this->log->addWarning(\"TN for compound object $cpd_pid not replaced with TN for first child\");\n }\n\n // packageObject() should return the top-level object's PID, if the object was ingested,\n // false otherwise.\n if ($cpd_pid) {\n return $cpd_pid;\n } else {\n return false;\n }\n }",
"protected function serialiseRecords()\n\t{\n\t\t//\n\t\t// Init local storage.\n\t\t//\n\t\t$offsets = Array();\n\t\t\n\t\t//\n\t\t// Set columns in dictionary.\n\t\t//\n\t\t$this->setColumns();\n\t\t\n\t\t//\n\t\t// Set collection.\n\t\t//\n\t\t$collection = $this->mIterator->collection()[ kTAG_CONN_COLL ];\n\t\t$this->mDictionary[ kAPI_DICTIONARY_COLLECTION ] = $collection;\n\t\t\n\t\t//\n\t\t// Set collection reference count offset.\n\t\t//\n\t\t$this->mDictionary[ kAPI_DICTIONARY_REF_COUNT ]\n\t\t\t= PersistentObject::ResolveRefCountTag( $collection );\n\t\t\n\t\t//\n\t\t// Iterate objects.\n\t\t//\n\t\tforeach( $this->mIterator as $object )\n\t\t{\n\t\t\t//\n\t\t\t// Save current object.\n\t\t\t//\n\t\t\t$this->mCurrentUnit = $object;\n\t\t\t\n\t\t\t//\n\t\t\t// Set excluded offsets.\n\t\t\t//\n\t\t\t$this->setHiddenTags( $object );\n\t\t\t\n\t\t\t//\n\t\t\t// Set identifier.\n\t\t\t//\n\t\t\t$this->mDictionary[ kAPI_DICTIONARY_IDS ][] = $object[ kTAG_NID ];\n\t\t\t\n\t\t\t//\n\t\t\t// Set record.\n\t\t\t//\n\t\t\t$this->setRecord( $this->mData, $object );\n\t\t\t\n\t\t\t//\n\t\t\t// Check tag offsets.\n\t\t\t//\n\t\t\t$class = $object[ kTAG_CLASS ];\n\t\t\tif( $class::kSEQ_NAME == Tag::kSEQ_NAME )\n\t\t\t\t$this->CollectOffsetTags( $offsets, $object );\n\t\t\n\t\t} // Iterating objects.\n\t\t\n\t\t//\n\t\t// Handle tag offsets.\n\t\t//\n\t\tforeach( $offsets as $object )\n\t\t{\n\t\t\t//\n\t\t\t// Save current object.\n\t\t\t//\n\t\t\t$this->mCurrentUnit = $object;\n\t\t\t\n\t\t\t//\n\t\t\t// Set excluded offsets.\n\t\t\t//\n\t\t\t$this->setHiddenTags( $object );\n\t\t\t\n\t\t\t//\n\t\t\t// Set record.\n\t\t\t//\n\t\t\t$this->setRecord( $this->mData, $object );\n\t\t\t\n\t\t\t//\n\t\t\t// Set dictionary xref.\n\t\t\t//\n\t\t\t$this->mDictionary[ kAPI_DICTIONARY_TAGS ]\n\t\t\t\t\t\t\t [ $object[ kTAG_ID_HASH ] ]\n\t\t\t\t= $object[ kTAG_NID ];\n\t\t\n\t\t} // Iterating tag offsets.\n\t\t\n\t\t//\n\t\t// Cluster tags.\n\t\t//\n\t\t$this->clusterTags();\n\t\t\n\t}",
"public function readObj( $obj ){\n if ( $obj ){\n $this->label->read($obj->label); \n $this->alt = $bson->alt;\n $this->description = $bson->description;\n\t\t\t$this->credits = $bson->credits;\n\t\t\t$this->file = $bson->file;\n $this->filename = $bson->filename;\n $this->readTaxonomy($bson->taxonomy);\n } \n }",
"function processOsmItems() {\n\t\t$sql = 'SELECT lang_origin, article_origin, languages, geojson FROM ( SELECT lang_ref,'.self::simplifyGeoJSON.' FROM (SELECT lang_ref,(ST_Dump(way)).geom AS way FROM wiwosm WHERE lang_ref != -1 ) AS geomdump GROUP BY lang_ref ) AS wiwosm_refs, wiwosm_wiki_ll WHERE wiwosm_refs.lang_ref = wiwosm_wiki_ll.lang_id';\n\n\t\t// this consumes just too mutch memory:\n\t\t/*\n\t\t$result = pg_query($conn, $sql);\n\t\tif (!$result) {\n\t\techo \"Fail to fetch results from postgis \\n\";\n\t\texit;\n\t\t}\n\t\t*/\n\n\t\t// so we have to use a cursor because its too much data:\n\t\tif (!pg_query($this->conn,'BEGIN WORK') || !pg_query($this->conn,'DECLARE osmcur NO SCROLL CURSOR FOR '.$sql)) {\n\t\t\techo 'Could not declare cursor'. \"\\n\" . pg_last_error() . \"\\n\";\n\t\t\t$this->exithandler();\n\t\t}\n\n\n\t\t$count = 0;\n\n\t\t// fetch from osmcur in steps of 1000 elements\n\t\t$result = pg_prepare($this->conn,'fetch_osmcur','FETCH 1000 FROM osmcur');\n\t\tif ($result === false) $this->exithandler();\n\n\t\t$result = pg_execute($this->conn,'fetch_osmcur',array());\n\n\t\t$fetchcount = pg_num_rows($result);\n\n\t\techo 'Get the first '.$fetchcount.' rows.'.\"\\n\";\n\n\t\t//damn cursor loop:\n\t\twhile ($fetchcount > 0) {\n\t\t\twhile ($row = pg_fetch_assoc($result)) {\n\n\t\t\t\t$this->createlinks($row['lang_origin'], $row['article_origin'], $row['geojson'], $row['languages'],true);\n\t\t\t\t// free the memory\n\t\t\t\tunset($row);\n\t\t\t}\n\t\t\t$count += $fetchcount;\n\t\t\techo $count.' results processed'.\"\\n\";\n\t\t\t$result = pg_execute($this->conn,'fetch_osmcur',array());\n\t\t\t$fetchcount = pg_num_rows($result);\n\t\t}\n\n\t\tpg_query($this->conn,'CLOSE osmcur');\n\t\tpg_query($this->conn,'COMMIT WORK');\n\t}",
"public function __construct($xmlfile)\n\t{\n\t\t//get XML String\n\t\t$xmlstring = file_get_contents($xmlfile);\n\t\t$xmlstring = preg_replace_callback('#<includeconfig(.*?)file=\"(.*?)\"(.*?)/>#',function ($match) use ($xmlfile){return file_get_contents(dirname($xmlfile).\"/\".$match[2]);},$xmlstring);\n\t\t$xmlobject = simplexml_load_string($xmlstring);\n\n\t\t//get all object types and their fields\n\t\t$this->objectTypes = Array();\n\t\t$this->objectFields = Array();\n\t\t$this->objectStatic = Array();\n\t\t$this->objectExternalLinks = Array();\n\t\tforeach($xmlobject->xpath('//object-type') as $objectType)\n\t\t{\n\t\t\t//save object type\n\t\t\t$objectName = (string)$objectType['name'];\n\t\t\t$this->objectTypes[] = $objectName;\n\n\n\t\t\t//save object fields\n\t\t\tforeach($objectType[0]->fields->fieldgroup as $fieldGroup)\n\t\t\t{\n\t\t\t\t$fieldGroupName = (string)$fieldGroup['name'];\n\t\t\t\tforeach($fieldGroup->field as $field)\n\t\t\t\t{\n\t\t\t\t\t$fieldName = (string)$field['name'];\n\t\t\t\t\t$fieldType = (string)$field['type'];\n\t\t\t\t\t$fieldLabel = (string)$field['label'];\n\t\t\t\t\t$fieldDefaultValue = (string)$field['default'];\n\t\t\t\t\t$fieldIsSummary = false;\n\t\t\t\t\tif(isset($field['summaryfield']) && $field['summaryfield'] == \"true\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldIsSummary = true;\n\t\t\t\t\t}\n\t\t\t\t\t$fieldIsLabel = false;\n\t\t\t\t\tif(isset($field['labelfield']) && $field['labelfield'] == \"true\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldIsLabel = true;\n\t\t\t\t\t}\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['name'] = $fieldName;\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['type'] = $fieldType;\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['label'] = $fieldLabel;\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['default'] = $fieldDefaultValue;\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['summary'] = $fieldIsSummary;\n\t\t\t\t\t$this->objectFields[$objectName][$fieldGroupName][$fieldName]['labelfield'] = $fieldIsLabel;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//save static object information\n\t\t\tif(isset($objectType[0]->static[0]))\n\t\t\t{\n\t\t\t\tforeach($objectType[0]->static[0] as $staticField)\n\t\t\t\t{\n\t\t\t\t\t$staticFieldName = $staticField->getName();\n\t\t\t\t\t$staticFieldValue = (string) $staticField;\n\t\t\t\t\t$this->objectStatic[$objectName][$staticFieldName] = $staticFieldValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//save external links for object\n\t\t\tif(isset($objectType[0]->links[0]))\n\t\t\t{\n\t\t\t\tforeach($objectType[0]->links[0] as $objectLink)\n\t\t\t\t{\n\t\t\t\t\t$linkName = (string)$objectLink['name'];\n\t\t\t\t\t$linkHref = (string)$objectLink['href'];\n\t\t\t\t\t$this->objectExternalLinks[$objectName][] = Array('name' => $linkName, 'href' => $linkHref);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//save custom event definitions for object\n\t\t\tif(isset($objectType[0]->eventdefs[0]))\n\t\t\t{\n\t\t\t\tforeach($objectType[0]->eventdefs[0] as $objectEvent)\n\t\t\t\t{\n\t\t\t\t\t$eventName = (string)$objectEvent['name'];\n\t\t\t\t\t$eventLabel = (string)$objectEvent['label'];\n\t\t\t\t\t$this->objectCustomEvents[$objectName][] = Array('name' => $eventName, 'label' => $eventLabel);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t//get object type groups\n\t\t$this->groups = Array();\n\t\tforeach($xmlobject->xpath('//group') as $group)\n\t\t{\n\t\t\t//get group name\n\t\t\t$groupName = (string)$group['name'];\n\n\n\t\t\t//get all object types of the group\n\t\t\tforeach($group[0]->{'object-type'} as $groupObjectType)\n\t\t\t{\n\t\t\t\t$groupObjectTypeName = (string)$groupObjectType['name'];\n\t\t\t\t$this->groups[$groupName][] = $groupObjectTypeName;\n\t\t\t}\n\t\t}\n\t}",
"public function doSomething()\n {\n foreach ($this->documents as $document) {\n $path = \"\";\n\n $schema = ($this->schema != null) ? $this->schema : $this->getDocumentSchemaFromX12($document);\n // look for a schema file at path + schema + .json\n $schema_path = __DIR__ . \"/X12/schemas/\" . $schema . \".json\";\n // TODO: create grammar lookup object to match user-provided\n // schema against schemas registered in the EDI/X12/schemas folder\n\n // initialize x12 schema validator tree\n $this->edi_schema_tree = new SchemaTree($schema_path);\n // get handle to root of tree for use in x12 processing\n $this->tree_root = $this->edi_schema_tree->root();\n \n if($this->debug) {\n print \"/\" . str_repeat(\"*\", 20) . \" DEBUG EDI DOCUMENT PARSE\" . str_repeat(\"*\", 20) . \"/\\n\";\n }\n\n // we start at 2 so we skip ISA and GS segments\n for ($i = 2; $i < count($document->segments); $i++) {\n\n $current_element = $document->segments[$i][0];\n // terminate loop if we've made it past ST/SE -> GE\n if ($current_element === \"GE\") {\n break;\n }\n\n // update path so we can use it to query the schema tree\n $path .= $current_element . \"/\";\n //print \"Try to find a node @ path: \" . $path . \"\\n\";\n $node = $this->findNodeByPath($this->tree_root, $path);\n \n if ($node != null) {\n if($this->debug) {\n print $i-1 . \". Found Node \" . $path . \"\\n\";\n print \"\\t\" . $path .\" can be used: \" . $node['max'] . \" time(s)\\n\";\n }\n \n // need to count occurrences for basic validation\n if(!array_key_exists($path, $this->counter)) {\n\n $this->counter[$path] = 1;\n\n } \n else {\n // if($path = \"ST/CTT/\")\n $this->counter[$path]++;\n \n }\n \n //print_r($node);\n\n // TODO: change into actual class\n // create new node\n $nod = new \\stdClass;\n $nod->name = $document->segments[$i][0];\n $nod->data = array_slice($document->segments[$i], 1);\n $nod->children = [];\n \n // set prev node = $tree on start\n // we add the ST element node as tree root, \n // set prev = st\n \n // * create a pointer to the parent of a node\n if (count($this->tree) < 1) {\n\n array_push($this->tree, $nod);\n\n } else {\n // if( $this->prev == NULL) {\n // print \"was null\\n\";\n // array_push($this->tree[0]->children, $nod);\n // } else {\n\n // array_push($this->prev->children, $nod);\n\n // }\n\n array_push($this->prev->children, $nod);\n \n }\n\n $nod->parent = $this->prev;\n $this->prev = $nod;\n \n //addDataToNodeByPath($tree_root, $path, array_splice($document->segments[$i], 1));\n //array_push($node['data'], array_splice($document->segments[$i], 1));\n\n //look ahead:\n if ($i + 1 < count($document->segments)) {\n\n if( $this->debug) {\n print \"\\t[Looking ahead in file] next segment: \" . $document->segments[$i + 1][0] . \"\\n\";\n }\n\n $next = $document->segments[$i + 1][0];\n if ($this->hasChild($node, $next)) {\n\n if( $this->debug) {\n print \"\\t\" . $path . \" has a \" . $next . \" as a child.\\n\";\n }\n\n continue;\n } else {\n //pop current node from path\n $path = str_replace($document->segments[$i][0] . \"/\", '', $path);\n if( $this->debug) {\n print \"\\t\" . $next . \" is NOT a child element of node: \" . $document->segments[$i][0] . \"\\n\\tGo back a level to: \" . $path . \"\\n\";\n }\n $this->prev = $this->prev->parent;\n }\n }\n\n } \n else {\n \n $tmp = explode('/', $path);\n $tmp2 = array_splice($tmp, -3);\n $path = implode('/', $tmp) . \"/\";\n\n if( $this->debug) {\n print \"\\t\" . $current_element . \" is NOT a child node! So we POP back a level to: \" . $path . \"\\n\";\n }\n\n $this->prev = $this->prev->parent;\n $i--;\n \n // if ($this->prev) {\n // $this->prev = $this->prev->parent;\n // $i--;\n // } else {\n // print \"we have to skip this bad element - its out of place: \" . $current_element . \"\\n\";\n // //$current_element = $document->segments[$i+1][0];\n // $path = \"ST/\";\n // // print $current_element . \" fuck \" . $path . \"\\n\";\n // //continue;\n // }\n\n }\n \n }\n\n if($this->debug) {\n print \"/\" . str_repeat(\"*\", 20) . \" END EDI DOCUMENT PARSE\" . str_repeat(\"*\", 20) . \"/\\n\\n\";\n }\n\n //print_r($this->tree_root);\n if( $this->debug) {\n print \"\\n\\n/\" . str_repeat(\"*\",20) . \"/\";\n print \" Printing EDI Schema \";\n print \"/\" . str_repeat(\"*\",20) . \"/\\n\";\n print $this->edi_schema_tree;\n print \"/\" . str_repeat(\"*\",20) . \"/\";\n print \" End of EDI Schema \";\n print \"/\" . str_repeat(\"*\",20) . \"/\\n\\n\\n\";\n\n //print_r($this->counter);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the numero label. | public function getNumeroLabel() {
return $this->numeroLabel;
} | [
"public function getLabel() {\n return $this->cntLabels;\n }",
"public function getCarLabelNumber(){\r\n\t\t$this->car_label_number = getValue(\"SELECT label_number FROM tbl_car WHERE car_id=\".$this->car_id);\r\n\t\treturn $this->car_label_number;\r\n\t}",
"public function label() {\n if (!$label = $this->get('label')) {\n $label = $this->id();\n }\n return $label;\n }",
"public function getLabelCode()\r\n {\r\n return $this->getAdapter()->getLabelCode();\r\n }",
"public function getIdLabel()\n {\n return $this->id_label;\n }",
"function _make_nom() {\n $info = $this->_make_label();\n return $info['nom'];\n }",
"public function getLabelId()\n {\n return $this->labelId;\n }",
"public function getLabelText() {\n return $this->label;\n }",
"public function getLabel() {\n\t\treturn $this->rootPage['title'] . ', Root Page ID: ' . $this->rootPage['uid'];\n\t}",
"public function getLabel() {\n return wb_get_text($this->controlID);\n }",
"public function getLabel()\n {\n $label = $this->label;\n if ($this->label === self::AUTO_LABEL) {\n $label = $this->text;\n if ($this->displayChecksum === true && ($checksum = $this->processChecksum()) !== false) {\n $label .= $checksum;\n }\n }\n\n return $label;\n }",
"public function getLabel() {\n\t\t// TODO: remove second argument after deprecation phase ends for cropping.\n\t\treturn $this->getNodeType()->getNodeLabelGenerator()->getLabel($this, FALSE);\n\t}",
"public function getIdentifierLabel() {\n\t\treturn $this->identifierLabel;\n\t}",
"public function getLabel() {\n\t\t$label = $this->_getData('label');\n\t\tif (is_null($label)) {\n\t\t\t$label = $this->_getData('page_title');\n\t\t}\n\t\treturn $label;\n\t}",
"public function getTreeLabel()\n\t{\n\t\t$ret = $this->label;\n\t\t$prefix = Module::getInstance()->params['treeLevelPrefix'];\n\t\t$ret = sprintf('%s %s', str_repeat($prefix, $this->depth), $ret);\n\t\treturn $ret;\n\t}",
"private function attrLabel($num)\n {\n switch ($num) {\n case 0:\n $label = 'field';\n break;\n case 1:\n $label = 'type';\n break;\n case 2:\n $label = 'access';\n break;\n case 3:\n $label = 'value';\n break;\n }\n\n return $label;\n }",
"public function getLabel() : TLabel {\n return $this->label;\n }",
"public function getLabel() : string {\n return $this->segmentLabel;\n }",
"public function getLabel()\n {\n $label = $this->_getData('label');\n if (is_null($label)) {\n $label = $this->_getData('page_title');\n }\n return $label;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the currently checked values | public function get_value()
{
$array = array();
foreach($this->options as $id => $opt)
{
// Return the options that are checked
($opt[1] === TRUE) and $array[] = $id;
}
return $array;
} | [
"public function getValues() {\n\t\t$vals = array();\n\t\tforeach ($this->controls as $control) {\n\t\t\tif ($control instanceof Checker && $control->isChecked()) {\n\t\t\t\t$vals[] = $control->getValue();\n\t\t\t}\n\t\t}\n\t\treturn $vals;\n\t}",
"public function getChecked()\n {\n return $this->getValue();\n }",
"public function getCheckedValue()\n {\n return $this->checkedValue;\n }",
"function getGoodValues()\n\t{\n\t\treturn $this->good_values;\n\t}",
"public function getValidValues();",
"public function getCheckedValue() {\n return $this->getAttribute('checked_value');\n }",
"public function getCheckedPredictions() {}",
"protected function getCheckedState()\n\t{\n\t\treturn $this->get('checked');\n\t}",
"function getCheckboxState(){\r\n\t\tif ($this->person['tx_x4epublication_displayselected']) {\r\n\t\t\t$mArr['###displaySelected0###'] = '';\r\n\t\t\t$mArr['###displaySelected1###'] = 'checked=\"checked\"';\r\n\t\t} else {\r\n\t\t\t$mArr['###displaySelected0###'] = 'checked=\"checked\"';\r\n\t\t\t$mArr['###displaySelected1###'] = '';\r\n\t\t}\r\n\t\treturn $mArr;\r\n\t}",
"private function getCheckedIds(): array\n {\n if (($checkedIds = post('checked'))\n && is_array($checkedIds)\n && count($checkedIds)\n ) {\n return $checkedIds;\n }\n\n return [];\n }",
"public function getCorrectedValues()\n {\n return $this->get(self::CORRECTEDVALUES);\n }",
"protected static function getTrueValues()\n {\n return static::$trueValues ?? [\n 'affirmative',\n 'all right',\n 'aye',\n 'indubitably',\n 'most assuredly',\n 'ok',\n 'of course',\n 'oui',\n 'okay',\n 'sure thing',\n 'y',\n 'yes',\n 'yea',\n 'yep',\n 'sure',\n 'yeah',\n 'true',\n 't',\n 'on',\n '1',\n 'vrai',\n 'да',\n 'д',\n '+',\n '++',\n '+++',\n '++++',\n '+++++',\n '*',\n ];\n }",
"public function get_value() {\n return (bool)$this->field->getAttribute('checked');\n }",
"function getTmaSlideSopPermissibleValues() {\r\n\t\treturn $this->getAllSopPermissibleValues();\t\t\r\n\t}",
"function checked_array( $values, $current ) {\n\tif ( ! is_array( $values ) ) {\n\t\treturn;\n\t}\n\n\tif ( in_array( $current, $values, true ) ) {\n\t\techo \"checked='checked'\";\n\t}\n}",
"public function getAllInputValues() {\n return $this->inputValues;\n }",
"public function getValues() {\n\t\treturn Mage::getSingleton('bricks_checkout/field_value')\n\t\t\t->getCollection()\n\t\t\t->addFieldToFilter( 'field_id', $this->getId() );\n\t}",
"public function getCheckboxesData()\n {\n return $this->checkboxes;\n }",
"public static function getRequiredValues():array {\n\n # Set result\n $result = self::REQUIRED_VALUES;\n\n # Return result\n return $result;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the Services_AMEE_API::validPath() method with an invalid POST path. | public function testValidPathPostBadPostPath7()
{
$oAPI = new Services_AMEE_API();
// Test invalud POST path: /profiles/1234567890A/transport
try {
$bResult = $oAPI->validPath('/profiles/1234567890A/transport', 'post');
} catch (Exception $oException) {
$this->assertEquals(
$oException->getMessage(),
'Invalid AMEE REST API POST path specified: /profiles/1234567890A/transport'
);
return;
}
// If we get here, the test has failed
$this->fail('Test failed because expected Exception was not thrown');
} | [
"public function testValidPathPostBadPostPath8()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud POST path: /profiles/1234567890ABB/transport\n try {\n $bResult = $oAPI->validPath('/profiles/1234567890ABB/transport', 'post');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API POST path specified: /profiles/1234567890ABB/transport'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadGetPath1()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud GET path: /auth\n try {\n $bResult = $oAPI->validPath('/auth', 'get');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API GET path specified: /auth'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadGetPath7()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud GET path: /profiles/1234567890AB@/transport\n try {\n $bResult = $oAPI->validPath('/profiles/1234567890A@/transport', 'get');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API GET path specified: /profiles/1234567890A@/transport'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadPostPath5()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud POST path: /profiles/1234567890AB\n try {\n $bResult = $oAPI->validPath('/profiles/1234567890AB', 'post');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API POST path specified: /profiles/1234567890AB'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadPostPath3()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud POST path: /profile\n try {\n $bResult = $oAPI->validPath('/profile', 'post');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API POST path specified: /profile'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadGetPath2()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud GET path: /profile\n try {\n $bResult = $oAPI->validPath('/profile', 'get');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API GET path specified: /profile'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testPostValidPathError()\n {\n // Prepare testing Exception to return\n $oPathException = new Exception('Valid Path Test Exception');\n\n // Create the mocked version of the Services_AMEE_API class, with the\n // validPath() method mocked\n $aMockMethods = array(\n 'validPath'\n );\n $oMockAPI = $this->getMock('Services_AMEE_API', $aMockMethods);\n\n // Set the expectation on the mocked object that the validPath()\n // method will be called exactly once with the path paramter\n // \"/invalidpath\" and type parameter \"post\", and set the Exception that\n // will be thrown by the method call.\n $oMockAPI->expects($this->once())\n ->method('validPath')\n ->with(\n $this->equalTo('/invalidpath'),\n $this->equalTo('post')\n )\n ->will($this->throwException($oPathException));\n\n // Call the post() method\n try {\n $oMockAPI->post('/invalidpath');\n } catch (Exception $oException) {\n // Test the Exception was correctly bubbled up\n $this->assertSame($oException, $oPathException);\n return;\n }\n \n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadDeletePath6()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud DELETE path: /profiles/1234567890ABB/transport\n try {\n $bResult = $oAPI->validPath('/dat', 'delete');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API DELETE path specified: /dat'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadDeletePath1()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud DELETE path: /profiles\n try {\n $bResult = $oAPI->validPath('/profiles', 'delete');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API DELETE path specified: /profiles'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testValidPathPostBadPutPath3()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test invalud PUT path: /profile\n try {\n $bResult = $oAPI->validPath('/profile', 'put');\n } catch (Exception $oException) {\n $this->assertEquals(\n $oException->getMessage(),\n 'Invalid AMEE REST API PUT path specified: /profile'\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testIsValidWithNotExistingPath() {\n $this->account->expects($this->once())\n ->method('hasPermission')\n ->with('link to any page')\n ->willReturn(FALSE);\n $this->accessUnawareRouter->expects($this->never())\n ->method('match');\n $this->accessAwareRouter->expects($this->once())\n ->method('match')\n ->with('/not-existing-path')\n ->willThrowException(new ResourceNotFoundException());\n $this->pathProcessor->expects($this->once())\n ->method('processInbound')\n ->willReturnArgument(0);\n\n $this->assertFalse($this->pathValidator->isValid('not-existing-path'));\n }",
"public function validatepathAction()\r\n {\r\n $helper = Mage::helper('link');\r\n $response = array(\r\n 'status' => 'error',\r\n 'message' => 'unknown',\r\n );\r\n\r\n try {\r\n $path = $this->getRequest()->getParam('request_path');\r\n\r\n // Check against CMS pages\r\n if (Mage::getSingleton('cms/page')->checkIdentifier($path, Mage::app()->getStore()->getStoreId())) {\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a CMS page with this identifier already exists.');\r\n } else if ($this->_checkUrlRewrite($path)) { // Check against URL rewrites\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a URL rewrite with this path already exists.');\r\n } else {\r\n $response['status'] = 'success';\r\n $response['message'] = $helper->__('Request path is unique in the system.');\r\n }\r\n } catch (Exception $error) {\r\n $response['status'] = 'error';\r\n $response['message'] = $error->getMessage();\r\n }\r\n\r\n $this->getResponse()\r\n ->setHeader('Content-type', 'application/json')\r\n ->setBody(Mage::helper('core')->jsonEncode($response));\r\n }",
"public function testValidPathPut()\n {\n $oAPI = new Services_AMEE_API();\n\n // Test valid PUT path: /profiles/1234567890AB\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/business\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/business', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/embodied\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/embodied', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/home\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/home', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/metadata\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/metadata', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/planet\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/planet', 'put');\n $this->assertTrue($bResult);\n\n // Test valid PUT path: /profiles/1234567890AB/transport\n unset($bResult);\n $bResult = $oAPI->validPath('/profiles/1234567890AB/transport', 'put');\n $this->assertTrue($bResult);\n }",
"public function testFromRoutedPathWithInvalidRoute() {\n $this->pathValidator->expects($this->once())\n ->method('getUrlIfValidWithoutAccessCheck')\n ->with('invalid-path')\n ->willReturn(FALSE);\n $url = Url::fromUri('internal:/invalid-path');\n $this->assertFalse($url->isRouted());\n $this->assertSame('base:invalid-path', $url->getUri());\n }",
"public function testGetValidPathError()\n {\n // Prepare testing Exception to return\n $oPathException = new Exception('Valid Path Test Exception');\n\n // Create the mocked version of the Services_AMEE_API class, with the\n // validPath() method mocked\n $aMockMethods = array(\n 'validPath'\n );\n $oMockAPI = $this->getMock('Services_AMEE_API', $aMockMethods);\n\n // Set the expectation on the mocked object that the validPath()\n // method will be called exactly once with the path paramter\n // \"/invalidpath\" and type parameter \"get\", and set the Exception that\n // will be thrown by the method call.\n $oMockAPI->expects($this->once())\n ->method('validPath')\n ->with(\n $this->equalTo('/invalidpath'),\n $this->equalTo('get')\n )\n ->will($this->throwException($oPathException));\n\n // Call the get() method\n try {\n $oMockAPI->get('/invalidpath');\n } catch (Exception $oException) {\n // Test the Exception was correctly bubbled up\n $this->assertSame($oException, $oPathException);\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testSaveRewriteWithInvalidRequestPath() : void\n {\n $requestPath = 'admin';\n $reservedWords = 'admin, soap, rest, graphql, standard';\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->getRequest()->setPostValue(\n [\n 'description' => 'Some URL rewrite description',\n 'options' => 'R',\n 'request_path' => 'admin',\n 'target_path' => \"target_path\",\n 'store_id' => 1,\n ]\n );\n $this->dispatch('backend/admin/url_rewrite/save');\n\n $this->assertSessionMessages(\n $this->containsEqual(__(sprintf(\n 'URL key \"%s\" matches a reserved endpoint name (%s). Use another URL key.',\n $requestPath,\n $reservedWords\n ))),\n \\Magento\\Framework\\Message\\MessageInterface::TYPE_ERROR\n );\n }",
"public function testPutValidPathError()\n {\n // Prepare testing Exception to return\n $oPathException = new Exception('Valid Path Test Exception');\n\n // Create the mocked version of the Services_AMEE_API class, with the\n // validPath() method mocked\n $aMockMethods = array(\n 'validPath'\n );\n $oMockAPI = $this->getMock('Services_AMEE_API', $aMockMethods);\n\n // Set the expectation on the mocked object that the validPath()\n // method will be called exactly once with the path paramter\n // \"/invalidpath\" and type parameter \"put\", and set the Exception that\n // will be thrown by the method call.\n $oMockAPI->expects($this->once())\n ->method('validPath')\n ->with(\n $this->equalTo('/invalidpath'),\n $this->equalTo('put')\n )\n ->will($this->throwException($oPathException));\n\n // Call the put() method\n try {\n $oMockAPI->put('/invalidpath');\n } catch (Exception $oException) {\n // Test the Exception was correctly bubbled up\n $this->assertSame($oException, $oPathException);\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }",
"public function testFromRoutedPathWithValidRoute() {\n $url = Url::fromRoute('test_route');\n $this->pathValidator->expects($this->once())\n ->method('getUrlIfValidWithoutAccessCheck')\n ->with('valid-path')\n ->willReturn($url);\n $result_url = Url::fromUri('internal:/valid-path');\n $this->assertSame($url, $result_url);\n }",
"public function testCreatePathParametersMismatching(): void\n {\n $this->expectException(PathCreatingException::class);\n $this->expectExceptionMessage('The passed parameters don\\'t match the parameters in the pattern');\n\n ($this->routesFactory->createRoute(null, '/categories/{categoryId}/posts/{postId}', null))\n ->createPath(['categoryId' => 1, 'pstId' => 1]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Helper function to get my array back from the cookie Input | function getCookieArr($cookie) {
return get_magic_quotes_gpc() ? unserialize(stripslashes($cookie)) : unserialize($cookie);
} | [
"public function cookieToArray(){\n\t\tif(strlen(Cookie::get('session_select_id'))>0){\n\t\t\t$arr = explode(\", \",Cookie::get('session_select_id')); //convert the cookie into an array\n\t\t}\n\n\t\t$returnArray = array_unique($arr); //remove all duplicate characters from the array\n\t\treturn $this->goToLoginPage();\n\t}",
"function getPageCookie(){\n\t\t$result = array();\n\t\tif (isset($_COOKIE['edu_rms'])) {\n\t\t\t$content = $_COOKIE['edu_rms'];\n\t\t\t$result = explode('-', $content);\n\t\t}\n\t\treturn $result;\n\t}",
"protected function cookies() : array {\n return (array) ($this->options['cookies'] ?? $_COOKIE);\n }",
"function cookiesData() {\n\t\tif (isset($_COOKIE['shopping_cart'])) {\n\t\t\t$cookie_data = stripslashes($_COOKIE['shopping_cart']);\n\t\t\t$cart_items = json_decode($cookie_data, true);\n\n\t\t\treturn $cart_items;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getRestrictionsFromCookie() {\n $restrictionArray = array();\n if (isset ($_COOKIE[\"UserRestr\"])) { // parse coolie\n\n if(Zend_Registry::isRegistered('currentRestrictions')) {\n $restrictionArray = Zend_Registry::get('currentRestrictions');\n\n } else {\n $restrictions_cookie = explode(\"$\",$_COOKIE[\"UserRestr\"]);\n foreach($restrictions_cookie as $key=>$restriction)\n {\n $restrictionArray[$key] = explode(\"|\", $restriction);\n $splited = explode(\"#\", $restrictionArray[$key][0]);\n if(count($splited) > 1) {\n $restrictionArray[$key][0] = $splited[1];\n }\n\n }\n Zend_Registry::set('currentRestrictions', $restrictionArray);\n\n\n }\n\n return $restrictionArray;\n\n }\n\n }",
"public function cookiesAssoc(): array\n {\n $this->processHeaders();\n $cookies = [];\n foreach ($this->headers['cookie'] as $key => $values) {\n $cookies[$key] = $values[1];\n }\n return $cookies;\n }",
"public static function getRememberCookieData()\n\t{\n\t\t// Create the cookie name\n\t\t$cookieName = static::getShortHashedUserAgent();\n\n\t\t// Fetch the cookie value\n\t\t$app = JFactory::getApplication();\n\t\t$cookieValue = $app->input->cookie->get($cookieName);\n\n\t\tif (!empty($cookieValue))\n\t\t{\n\t\t\treturn explode('.', $cookieValue);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function CookiesLikeGetVarsFromPost($post_var_name)\r\n{\r\n\t$posted_data=\"\";\r\n\tglobal $CookiesLikeArrayData;\r\n\tglobal $CookiesLikeVarSeparator;\r\n\tglobal $CookiesLikeVarValSeparator;\r\n\tif (array_key_exists($post_var_name, $_POST))\r\n\t{\r\n\t\t$posted_data=$_POST[$post_var_name];\r\n\t\t// get all var=value\r\n\t\t$posted_array=explode($CookiesLikeVarSeparator,$posted_data);\r\n\t\tforeach($posted_array as $var_value)\r\n\t\t{\r\n\t\t\t$var_value_array=explode($CookiesLikeVarValSeparator,$var_value);\r\n\t\t\tif (count($var_value_array)==2)\r\n\t\t\t\tarray_push($CookiesLikeArrayData,array(\"Name\"=>$var_value_array[0],\"Value\"=>$var_value_array[1]));\r\n\t\t}\r\n\t}\r\n}",
"public function getBasket()\n {\n //if the basket is empty return false\n if (!isset($_COOKIE[\"basket\"])) {\n return false;\n }\n //assign the cookie to a string variable\n $str = $_COOKIE[\"basket\"];\n //separate the string by its commas (into each item+quantity)\n $arr = explode(\",\", $str, 99);\n $basket = array(); //create array to store results\n foreach ($arr as $value) {\n //for each item and quantity, divide by \"!\" and store in array\n $item = explode(\"!\", $value, 2);\n array_push($basket, $item); //push small array to big array\n }\n //remove the last entry in the array because it's empty \n unset($basket[count($basket) - 1]);\n return $basket;\n }",
"public function extractCookies($string) {\n$cookies= array(); \r\n $lines= explode(\"\\n\",$string); \r\nforeach($lines as $line){ \r\nif(isset($line[0]) && substr_count($line,\"\\t\") == 6) { \r\n$tokens = explode(\"\\t\",$line); \r\n$tokens = array_map('trim',$tokens);\r\n$cookie= array(); \r\n$cookie['domain'] = $tokens[0]; $cookie['flag'] = $tokens[1];\n$cookie['path'] = $tokens[2]; $cookie['secure'] = $tokens[3];\n$cookie['expiration'] = date('Y-m-d h:i:s',$tokens[4]); \r\n$cookie['name'] = $tokens[5]; $cookie['value'] = $tokens[6];\r\n$cookies[]=$cookie;\n}\n}\nreturn$cookies;\n}",
"public function getHttpCookies(): array\n {\n return $_COOKIE;\n }",
"private static function getData() {\n if ( isset( $_COOKIE[ INIT::$AUTHCOOKIENAME ] ) and !empty( $_COOKIE[ INIT::$AUTHCOOKIENAME ] ) ) {\n $data = json_decode( $_COOKIE[ INIT::$AUTHCOOKIENAME ], true );\n } else {\n $data = false;\n }\n\n return $data;\n }",
"public function getCookies()\n\t{\t\n\t\treturn array($this->Cookie->read('commentName'), $this->Cookie->read('commentEmail'), $this->Cookie->read('commentWebsite'));\n\t}",
"public static function getCookies () {\n\t\treturn Lib::hashOfAssociativeArray($_COOKIE);\n\t}",
"private function setArrayCookie() {\n\t\tsetcookie(WTC_COOKIE_PREFIX . $this->name, serialize($this->value), $this->expire, $this->path, $this->domain);\n\t}",
"private function parse_cookie( $value ) {\n\n\t\tif( !$value || $value == 'null' )\n\t\t\treturn array();\n\n\t\tif( $array = json_decode( stripslashes( $value ), true ) ) // strip slashes and return array\n\t\t\treturn $array;\n\n\t\treturn array();\n\t}",
"protected function getCookies()\n\t{\n\t\treturn $this->removePasswords((new Serializer)->normalizeEach($_COOKIE));\n\t}",
"public function grab_array_from_storage()\n {\n $array = $this->storage_for_array();\n return $array;\n }",
"public static function parseCookie($cookie)\n {\n $cookieAry = [];\n foreach (explode(\"; \", $cookie) as $ps) {//parse_str(str_replace('; ', '&', $cookie), $cookieAry);\n list($k, $v) = explode(\"=\", $ps, 2);\n $cookieAry[trim($k)] = trim($v);\n }\n return $cookieAry;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for logging a class's static properties | public static function _log_() {
return [
'entity_type' => static::$entity_type,
'default_properties' => static::$default_attributes,
];
} | [
"abstract protected function getLogClass();",
"public function getStaticProperties()\n {\n return array();\n }",
"public static function static_method(){\n //$message = \"Static attribute: \" . $this->static_attribute . \"\\n\";\n //$message = \"Normal attribute: \" . Self::$normal_attribute . \"\\n\";//\n $message = \"Static attribute: \" . Self::$static_attribute . \"\\n\";\n return $message;\n }",
"function printprop(){\n echo\"this is from Mainclass\";\n echo \"<br>\";\n echo $this->a;\n echo \"<br>\";\n echo self::B; //for constnats and static value we should use \"self::\" {only inside self::}\n echo \"<br>\";\n echo self::$c; //for public static variables we should use \"self::$c\" {only inside self::}\n echo \"<br>\";\n }",
"public function exportStatic($class, $prefix = null)\n {\n if(is_null($prefix)) $prefix = strtoupper($class);\n\n $Reflector = new ReflectionClass($class);\n $properties = $Reflector->getStaticProperties();\n foreach($properties as $name => $value)\n {\n if($prefix) echo \"var $prefix\", '_', \"$name = \", json_encode($value), \";\\n\";\n else echo \"var $name = \", json_encode($value), \";\\n\";\n }\n }",
"abstract public function getLogType();",
"public function getStaticProperties()\n {\n return $this->getProperties(ReflectionProperty::IS_STATIC);\n }",
"function toDebug($nl = '<br>')\n {\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n echo \"$k [\" . $this->$k . \"]{$nl}\";\n }\n }",
"public function getLogLabel() {\n\t\treturn get_class($this).': '.$this->type.': '.$this->path;\n\t}",
"function __get($name){\n\t\tif($is_debug)\n\t\t\techo 'Your val is '.$name.',and is not exsit in this class!';\n\t}",
"public function __toString(): string\n {\n if ($this->isPrivate()) {\n $visibility = 'private';\n } elseif ($this->isProtected()) {\n $visibility = 'protected';\n } else {\n $visibility = 'public';\n }\n\n $static = $this->isStatic() ? ' static' : '';\n $eol = \"\\n\";\n\n return sprintf(\n 'Property [ %s%s $%s ]%s',\n $visibility,\n $static,\n $this->getName(),\n $eol\n );\n }",
"public function __construct()\n {\n // The __CLASS__ constant holds the class name, in our case \"Foo\".\n // Therefore this creates a logger named \"Foo\" (which we configured in the config file)\n $this->log = Logger::getLogger(__CLASS__);\n // var_dump($this->log);\n }",
"public function defineLoggingAndExceptionConstants() {}",
"public function __debugInfo(): array\n {\n return $this->properties;\n // return iterator_to_array((\n // function (): Generator {\n // foreach (ClassProperty::getProperties(static::class) as $prop) {\n // try {\n // yield $prop->Name => $this->{$prop->Name};\n // } catch (\\Exception $e) {\n // yield $prop->Name => \"<<<Recieved \" . get_class($e) . \": \" . $e->getMessage() . \">>>\";\n // }\n // }\n // })());\n }",
"function toDebugStr()\n {\n $str = \"\";\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if ($k != \"con\") {\n $str = $str . \"$k [\" . $this->$k . \"]\\n\";\n }\n\n }\n return $str;\n }",
"public function testGetPrivateProperty_Static()\n {\n $this->assertSame(910, get_private_property(TestClass::class, 'statPriv'));\n $this->assertSame(920, get_private_property(TestClass::class, 'statProt'));\n $this->assertSame(940, get_private_property(TestClass::class, 'statPub'));\n }",
"public static function getInstanceOperationsForAutomaticClosure() : Phoenix_Log\r\n {\r\n return Phoenix_Logger::getInstance('operationsforautomaticclosure');\r\n }",
"public static function debug_class()\n {\n if ( isset(self::$plugins_pool) )\n {\n echo \"<h2>Found plugins</h2>\";\n echo \"<p>All plugins found in the plugins directory.</p>\";\n echo \"<pre>\";\n print_r(self::$plugins_pool);\n echo \"</pre>\";\n echo \"<br />\";\n echo \"<br />\";\n }\n \n if ( isset(self::$plugins_active) )\n {\n echo \"<h2>Activated plugins</h2>\";\n echo \"<p>Activated plugins that have already been included and are usable.</p>\";\n echo \"<pre>\";\n print_r(self::$plugins_active);\n echo \"</pre>\";\n echo \"<br />\";\n echo \"<br />\";\n }\n \n if ( isset(self::$actions) )\n {\n echo \"<h2>Register action hooks</h2>\";\n echo \"<p>Action hooks that have been registered by the application and can be called via plugin files.</p>\";\n echo \"<pre>\";\n print_r(self::$actions);\n echo \"</pre>\";\n echo \"<br />\";\n echo \"<br />\";\n } \n \n if ( isset(self::$run_actions) )\n {\n echo \"<h2>Previously run action hooks</h2>\";\n echo \"<p>Hooks that have been called previously.</p>\";\n echo \"<pre>\";\n print_r(self::$run_actions);\n echo \"</pre>\";\n echo \"<br />\";\n echo \"<br />\";\n } \n }",
"function log( $props ) {\n\t\t$this->output_log_item($props);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wpsc has pages function | function wpsc_has_pages() {
global $wpsc_query;
if($wpsc_query->page_count > 0) {
return true;
} else {
return false;
}
} | [
"public function hasPage();",
"public function hasVisiblePages() {}",
"function wpsc_have_pages() {\n\t_wpsc_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');\n\treturn false;\n}",
"public static function check_page(){NJIMEDIA_WP_Utils::page_check();}",
"public function has_published_pages() {}",
"public function hasPages() {\n return $this->countPages() > 1;\n }",
"public function hasWizardPages();",
"protected function currentPageHasSubPages() {}",
"public function has_pages() {\n global $DB;\n $pagecount = $DB->count_records('languagelesson_pages', array('lessonid'=>$this->properties->id));\n return ($pagecount>0);\n }",
"public function has_published_pages()\n {\n }",
"public function hasPages()\n {\n return !empty($this->pagination) && array_key_exists('next_url', $this->pagination);\n }",
"function is_page() {\n\tglobal $app;\n\n\treturn $app['registry']->had('page');\n}",
"private function isPageCounterAllowed()\r\n {\r\n $allowedPages = explode(\"\\n\", $this->getConfig('CounterPages'));\r\n $allowedPages = array_map(\"trim\", $allowedPages);\r\n for ($i = 0; $i < sizeof($allowedPages); $i++)\r\n {\r\n if ($allowedPages[$i] == '')\r\n {\r\n unset($allowedPages[$i]);\r\n }\r\n }\r\n shuffle($allowedPages);\r\n\r\n if (empty($allowedPages) || in_array(THIS_SCRIPT, $allowedPages))\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"private function isPageCounterAllowed()\n {\n $allowedPages = explode(\"\\n\", $this->getConfig('CounterPages'));\n $allowedPages = array_map(\"trim\", $allowedPages);\n for ($i = 0; $i < sizeof($allowedPages); $i++)\n {\n if ($allowedPages[$i] == '')\n {\n unset($allowedPages[$i]);\n }\n }\n shuffle($allowedPages);\n\n if (empty($allowedPages) || in_array(THIS_SCRIPT, $allowedPages))\n {\n return true;\n }\n\n return false;\n }",
"function pts_allowed_pages($pages)\n {\n }",
"function google_analytics_visibility_pages()\n{\n\t$prefs = e107::getPlugConfig('google_analytics')->getPref();\n\t$cusPagePref = explode(PHP_EOL, varset($prefs['pages'], ''));\n\n\t$match = false;\n\n\tif(is_array($cusPagePref) && count($cusPagePref) > 0)\n\t{\n\t\t$c_url = str_replace(array('&'), array('&'), e_REQUEST_URL);\n\t\t$c_url = rtrim(rawurldecode($c_url), '?');\n\n\t\tforeach($cusPagePref as $cusPage)\n\t\t{\n\t\t\tif($cusPage == 'FRONTPAGE' && ($c_url == SITEURL || rtrim($c_url, '/') == SITEURL . 'index.php'))\n\t\t\t{\n\t\t\t\t$match = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$matchPath = google_analytics_match_path($c_url, $cusPage);\n\t\t\tif(!empty($cusPage) && $matchPath)\n\t\t\t{\n\t\t\t\t$match = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// The listed pages only.\n\tif((int) varset($prefs['visibility_pages'], 0) === 1)\n\t{\n\t\tif($match === true)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Every page except the listed pages.\n\tif((int) varset($prefs['visibility_pages'], 0) === 0)\n\t{\n\t\tif($match === true)\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}\n\t}\n\n\treturn false;\n}",
"protected function currentPageHasSubPages()\n {\n /** @var QueryBuilder $queryBuilder */\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class))\n ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));\n\n // get workspace id\n $workspaceId = (int)$this->getBackendUser()->workspace;\n $comparisonExpression = $workspaceId === 0 ? 'neq' : 'eq';\n\n $count = $queryBuilder\n ->count('uid')\n ->from('pages')\n ->where(\n $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->id, \\PDO::PARAM_INT)),\n $queryBuilder->expr()->eq(\n 't3ver_wsid',\n $queryBuilder->createNamedParameter($workspaceId, \\PDO::PARAM_INT)\n ),\n $queryBuilder->expr()->{$comparisonExpression}(\n 'pid',\n $queryBuilder->createNamedParameter(-1, \\PDO::PARAM_INT)\n )\n )\n ->execute()\n ->fetchColumn(0);\n\n return (bool)$count;\n }",
"function is_page_available($vcita_widget) {\r\n\tif (!isset($vcita_widget['page_id']) || empty($vcita_widget['page_id'])) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t$page_id = $vcita_widget['page_id'];\r\n\t$page = get_page($page_id);\r\n\r\n\treturn !empty($page) && $page->{\"post_status\"} == \"publish\";\r\n}",
"private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function to update MP3 file | public function updateMP3($file_data){
$getID3 = new getID3;
$getID3->setOption(array('encoding'=>$this->_textEncoding));
$tagwriter = new getid3_writetags;
$tagwriter->filename = $file_data["path"];
$tagwriter->tagformats = array('id3v2.3');
$tagwriter->overwrite_tags = true;
$tagwriter->remove_other_tags = false;
$tagwriter->tag_encoding = $this->_textEncoding;
$tagwriter->remove_other_tags = true;
$format_data = array();
foreach($file_data as $key => $value){
if($key == "action" or $key == "path"){
continue;
}
$format_data[$key] = array($value);
}
$tagwriter->tag_data = $format_data;
if ($tagwriter->WriteTags()) {
if (!empty($tagwriter->warnings)) {
echo 'There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings);
}
} else {
echo 'Failed to write tags!<br>'.implode('<br><br>', $tagwriter->errors);
}
$this->createView($file_data["path"]);
} | [
"private function addInfoFromFileMp3Info()\n {\n $audio = new Mp3Info($this->fileManager->realPath($this->song->getPath()));\n $this->song->setDuration(gmdate(\"H:i:s\",$audio->duration));\n $this->song->setSize(round($audio->audioSize/1048576));\n $this->song->setBitRate($audio->bitRate/1000);\n }",
"function addMP3($pathToFile){\n\tglobal $db;\n\t$id3Tags = getID3Tags($pathToFile);\n\t$cover = getID3CoverBytes($pathToFile);\n\t\n\tif($id3Tags==false||$cover==false){return false;}\n\t$type=$cover[1];\n\tif($type==\"image/png\"||$type==\"image/jpeg\"){\n\t\t$mp3_mimes = array('audio/mpeg','audio/mpeg3', 'audio/x-mpeg-3', 'application/octet-stream');\n\t\tif(in_array(mime_content_type($pathToFile), $mp3_mimes)){\n\t\t\tif(count($db->getAllInformationFrom('tracks', array('title', 'artist', 'album', 'track_number'), array($id3Tags['title'], $id3Tags['artist'], $id3Tags['album'], $id3Tags['track_number']))<0)){\n\t\t\t\tif($db->addToDatabase('tracks', array('title', 'artist', 'album', 'track_number'), array($id3Tags['title'], $id3Tags['artist'], $id3Tags['album'], $id3Tags['track_number']))==true){\n\t\t\t\t\t$track = $db->getAllInformationFrom('tracks', array('title', 'artist', 'album', 'track_number'), array($id3Tags['title'], $id3Tags['artist'], $id3Tags['album'], $id3Tags['track_number']))[0];\n\t\t\t\t\t$fileName=$track['id'].\".mp3\";\n\t\t\t\t\tif(copy($pathToFile, MUSIC_DIR.$fileName)){\n\t\t\t\t\t\t$path=MUSIC_DIR.\"coverCache/\".$track['id'].\".png\";\n\t\t\t\t\t\tif($type==\"image/jpeg\"){\n\t\t\t\t\t\t\t$uuidPath = TMP_DIR.uniqid(\"cover\");/*workaround*/\n\t\t\t\t\t\t\tfile_put_contents($uuidPath, $cover[0]);\n\t\t\t\t\t\t\t$img = imagecreatefromjpeg($uuidPath);\n\t\t\t\t\t\t\timagepng($img, $path);\n\t\t\t\t\t\t\timagedestroy($img);\n\t\t\t\t\t\t\tunlink($uuidPath);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfile_put_contents($path, $cover[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cover=null;\n\t\t\t\t\t\trequire_once(LIB_DIR.\"colorExtract/colors.inc.php\");\n\t\t\t\t\t\t$colors = new GetMostCommonColors();\n\t\t\t\t\t\t$cl = $colors->Get_Color($path, 2, true, true, 80);\n\t\t\t\t\t\t$c1=\"#\".key($cl).\"\";\n\t\t\t\t\t\tend($cl);\n\t\t\t\t\t\t$c2=\"#\".key($cl);\n\t\t\t\t\t\t$db->updateInDatabase('tracks', array('color1', 'color2'), array($c1, $c2), array('id'), array($track['id']));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(file_exists(MUSIC_DIR.$fileName)){\n\t\t\t\t\t\t\tunlink(MUSIC_DIR.$fileName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$db->removeFromDatabase('tracks', array('id'), array($track['id']));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n\treturn false;\n}",
"function wpfc_mp3_duration($mp3_url) {\r\n\tif ( ! class_exists( 'getID3' ) ) {\r\n\t\trequire_once WPFC_SERMONS . '/includes/getid3/getid3.php'; \r\n\t}\r\n\t$filename = tempnam('/tmp','getid3');\r\n\tif (file_put_contents($filename, file_get_contents($mp3_url, false, null, 0, 300000))) {\r\n\t\t $getID3 = new getID3;\r\n\t\t $ThisFileInfo = $getID3->analyze($filename);\r\n\t\t unlink($filename);\r\n\t}\r\n\r\n\t$bitratez=$ThisFileInfo[audio][bitrate]; // get the bitrate from the audio file\r\n\r\n\t$headers = get_headers($mp3_url, 1); // Get the headers from the remote file\r\n\t\t\t\tif ((!array_key_exists(\"Content-Length\", $headers))) { return false; } // Get the content length from the remote file\r\n\t\t\t\t$content_length = (int)$headers[\"Content-Length\"]; \r\n\t\t\t\t$filesize= round($content_length/1000); // Make the filesize into kilobytes & round it\r\n\r\n\t$contentLengthKBITS=$filesize*8; // make kbytes into kbits\r\n\t$bitrate=$bitratez/1000; //convert bits/sec to kbit/sec\r\n\t$seconds=$contentLengthKBITS/$bitrate; // Calculate seconds in song\r\n\r\n\t$playtime_mins = floor($seconds/60); // get the minutes of the playtime string\r\n\t$playtime_secs = $seconds % 60; // get the seconds for the playtime string\r\n\tif(strlen($playtime_secs)=='1'){$zero='0';} // if the string is a multiple of 10, we need to add a 0 for visual reasons\r\n\t$playtime_secs = $zero.$playtime_secs; // add the zero if necessary\r\n\t$playtime_string=$playtime_mins.':'.$playtime_secs; // create the playtime string\r\n\r\n\t\treturn $playtime_string;\r\n}",
"function UpdateMusicStream(\\raylib\\Music $music): void { }",
"function DownloadMP3($file)\r\n\t\t{\r\n\t\t\t$filepath = parent::_SONGFILEDIR . urldecode($file);\r\n\t\t\t$filename = urldecode($file);\r\n\t\t\tif (parent::_ENABLE_CONCURRENCY_CONTROL)\r\n\t\t\t{\r\n\t\t\t\t$filename = preg_replace('/((_uuid-)(\\w{13})(\\.mp3))$/', \"$4\", $filename);\r\n\t\t\t}\r\n\t\t\tif (is_file($filepath))\r\n\t\t\t{\r\n\t\t\t\theader('Content-Type: audio/mpeg3');\r\n\t\t\t\theader('Content-Length: ' . filesize($filepath));\r\n\t\t\t\theader('Content-Disposition: attachment; filename=\"'.$filename.'\"');\r\n\t\t\t\tob_clean();\r\n\t\t\t\tflush();\r\n\t\t\t\treadfile($filepath);\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$redirect = explode(\"?\", $_SERVER['REQUEST_URI']);\r\n\t\t\t\theader('Location: ' . $redirect[0]);\r\n\t\t\t}\r\n\t\t}",
"function wpfc_mp3_duration($mp3_url) {\n\trequire_once plugin_dir_path( __FILE__ ) . '/includes/getid3/getid3.php'; \n\t$filename = tempnam('/tmp','getid3');\n\tif (file_put_contents($filename, file_get_contents($mp3_url, false, null, 0, 300000))) {\n\t\t $getID3 = new getID3;\n\t\t $ThisFileInfo = $getID3->analyze($filename);\n\t\t unlink($filename);\n\t}\n\n\t$bitratez=$ThisFileInfo[audio][bitrate]; // get the bitrate from the audio file\n\n\t$headers = get_headers($mp3_url, 1); // Get the headers from the remote file\n\t\t\t\tif ((!array_key_exists(\"Content-Length\", $headers))) { return false; } // Get the content length from the remote file\n\t\t\t\t$filesize= round($headers[\"Content-Length\"]/1000); // Make the failesize into kilobytes & round it\n\n\t$contentLengthKBITS=$filesize*8; // make kbytes into kbits\n\t$bitrate=$bitratez/1000; //convert bits/sec to kbit/sec\n\t$seconds=$contentLengthKBITS/$bitrate; // Calculate seconds in song\n\n\t$playtime_mins = floor($seconds/60); // get the minutes of the playtime string\n\t$playtime_secs = $seconds % 60; // get the seconds for the playtime string\n\tif(strlen($playtime_secs)=='1'){$zero='0';} // if the string is a multiple of 10, we need to add a 0 for visual reasons\n\t$playtime_secs = $zero.$playtime_secs; // add the zero if nessecary\n\t$playtime_string=$playtime_mins.':'.$playtime_secs; // create the playtime string\n\n\t\treturn $playtime_string;\n}",
"function create_m3u8($ID){\n\t$file = 'playlist/' . $ID . '.m3u8';\n\t$current = file_get_contents($file);\n\t$txt=\"#EXTM3U\\n#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=700000\\n../uploads/\" . $ID . \"/\" . $ID;\n\t$txt .=\"-low.m3u8\\n#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1000000\\n../uploads/\";\n\t$txt .= $ID . \"/\" . $ID . \"-medium.m3u8\\n#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=2000000\\n../uploads/\" . $ID . \"/\" . $ID . \"-high.m3u8\\n\";\n\t$current .= $txt;\n\tfile_put_contents($file, $current);\n}",
"function mp3File($string) {\n\t$charsToNothing = array('\\'', '(', ')', '[', ']', '!', '?', '#', ',', '...', ':');\n\t$charsToHyphen = array(' ', '/', '.');\n\t$string = strtolower($string);\n\t$string = preg_replace('/d&w/', 'd-and-w', $string); # husband&wife = husband-and-wife\n\t$string = preg_replace('/\\.$/', '', $string);\n\t$string = str_replace($charsToNothing, '', $string);\n\t$string = str_replace($charsToHyphen, '-', $string);\n\t$string = str_replace(array('---', '--', '----'), '-', $string);\n\t$string = str_replace(array('&', '&'), 'and', $string);\n\t\n\treturn 'http://media.daytrotter.com/audio/dt/' . $string . '.mp3';\n}",
"function updateSound($sound,$delete)\r\n\t{\r\n\t\tglobal $audioPath, $documentPath,$_course, $_user;\r\n $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);\r\n $TBL_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);\r\n\r\n\t\tif($sound['size'] && (strstr($sound['type'],'audio') || strstr($sound['type'],'video')))\r\n\t\t{\r\n\t\t\t$this->sound=$sound['name'];\r\n\r\n\t\t\tif(@move_uploaded_file($sound['tmp_name'],$audioPath.'/'.$this->sound))\r\n\t\t\t{\r\n\t\t\t\t$query=\"SELECT 1 FROM $TBL_DOCUMENT \"\r\n .\" WHERE path='\".str_replace($documentPath,'',$audioPath).'/'.$this->sound.\"'\";\r\n\t\t\t\t$result=api_sql_query($query,__FILE__,__LINE__);\r\n\r\n\t\t\t\tif(!mysql_num_rows($result))\r\n\t\t\t\t{\r\n /*$query=\"INSERT INTO $TBL_DOCUMENT(path,filetype) VALUES \"\r\n .\" ('\".str_replace($documentPath,'',$audioPath).'/'.$this->sound.\"','file')\";\r\n api_sql_query($query,__FILE__,__LINE__);*/\r\n $id = add_document($_course,str_replace($documentPath,'',$audioPath).'/'.$this->sound,'file',$sound['size'],$sound['name']);\r\n\r\n //$id = Database::get_last_insert_id();\r\n //$time = time();\r\n //$time = date(\"Y-m-d H:i:s\", $time);\r\n // insert into the item_property table, using default visibility of \"visible\"\r\n /*$query = \"INSERT INTO $TBL_ITEM_PROPERTY \"\r\n .\"(tool, ref, insert_user_id,to_group_id, insert_date, lastedit_date, lastedit_type) \"\r\n .\" VALUES \"\r\n .\"('\".TOOL_DOCUMENT.\"', $id, $_user['user_id'], 0, '$time', '$time', 'DocumentAdded' )\";\r\n api_sql_query($query,__FILE__,__LINE__);*/\r\n api_item_property_update($_course, TOOL_DOCUMENT, $id, 'DocumentAdded',$_user['user_id']);\r\n item_property_update_on_folder($_course,str_replace($documentPath,'',$audioPath),$_user['user_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($delete && is_file($audioPath.'/'.$this->sound))\r\n\t\t{\r\n\t\t\t$this->sound='';\r\n\t\t}\r\n\t}",
"function saveID3($file) {\n\t global $config;\n\t $fileInfo = $file->allInfo;\n\t //----------------- CHANGED BY BUDDHAFLY 06-05-12\n\t $id3 = $fileInfo['id3v1'];\n\n\trequire_once($config['getid3dir'] . \"/write.php\");\n\t $tagwriter = new getid3_writetags;\n\t $tagwriter->filename = $file->path;\n\t $TagData['comment'][] = \"id: \" . $this->id;\n\t debug(\"writing ID3V1\", $id3);\t\n\n\t// write tags\n\tif ($tagwriter->WriteTags()) {\n\t\t//echo 'Successfully wrote tags<br>';\n\t\tif (!empty($tagwriter->warnings)) {\n\t\t\tlogError('Wrtiting ID3V1 Tags: There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings));\n\t\t}\n\t} else {\n\t\tlogError(\"Could not change ID3V1 tags in file \". $file->path);\n\t}\n\t\n\t//---------------------------------------------------\t\n\t\n\t\n\t/*\n\t//$id3['comment'] = substr(substr($config['rootUrl'], 7), 0, 30);\n\t $id3['comment'] = \"id: \" . $this->id;\n\t //$id3['album'] = \"id: \" . $this->id;\n\t //if(!$id3['title'])\n\t // $id3['title'] = substr($this->get('title'), 0, 30);\n\t //if(!$id3['artist'])\n\t //\t$id3['artist'] = substr($this->getCreatorNames(), 0, 30);\n\t debug(\"writing ID3V1\", $id3);\n\t //$succ = WriteID3v1($file->path, $id3['title'], $id3['artist'], $id3['album'], $id3['year'], $id3['comment'], $id3['genre'], NULL /*track*//*);\n\t $succ = WriteID3v1($file->path, $id3['comment'], NULL /*track*//*);\n\t if(!$succ)\n\t\tlogError(\"Could not change ID3V1 tags in file \". $file->path);\n\t*/\n }",
"function convertToMp4($mp3_file_path, $mp4_file_path, $album_id, $patch_name)\r\n {\r\n if (!file_exists($mp4_file_path))\r\n {\r\n $log = new Logs($patch_name, $album_id);\r\n $command = '/usr/local/bin/ffmpeg -y -i ' . $mp3_file_path . ' -vn -strict -2 -b:a 96k ' . $mp4_file_path . ' &';\r\n $log->writeAlbumLog($command, $album_id);\r\n\r\n $status = exec($command, $output, $serverResponse);\r\n if ($serverResponse > 0)\r\n {\r\n $log->writeAlbumLog(\"Error : $serverResponse & error : $status & output : \" . serialize($output), $upc);\r\n }\r\n unset($output);\r\n }\r\n }",
"public function updateFiles();",
"public function add_audio()\n {\n $course_info = api_get_course_info();\n $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/';\n\n if (!is_dir($filepath . 'audio')) {\n mkdir(\n $filepath . 'audio',\n api_get_permissions_for_new_directories()\n );\n $audio_id = add_document(\n $course_info,\n '/audio',\n 'folder',\n 0,\n 'audio'\n );\n api_item_property_update(\n $course_info,\n TOOL_DOCUMENT,\n $audio_id,\n 'FolderCreated',\n api_get_user_id(),\n null,\n null,\n null,\n null,\n api_get_session_id()\n );\n api_item_property_update(\n $course_info,\n TOOL_DOCUMENT,\n $audio_id,\n 'invisible',\n api_get_user_id(),\n null,\n null,\n null,\n null,\n api_get_session_id()\n );\n }\n\n $key = 'file';\n\n if (!isset($_FILES[$key]['name']) || !isset($_FILES[$key]['tmp_name'])) {\n return false;\n }\n $result = DocumentManager::upload_document(\n $_FILES,\n '/audio',\n null,\n null,\n 0,\n 'rename',\n false,\n false\n );\n $file_path = null;\n\n if ($result) {\n $file_path = basename($result['path']);\n\n // Store the mp3 file in the lp_item table.\n $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);\n $sql = \"UPDATE $tbl_lp_item SET\n audio = '\" . Database::escape_string($file_path) . \"'\n WHERE\n c_id = {$course_info['real_id']} AND\n id = '\" . intval($this->db_id) . \"'\";\n Database::query($sql);\n }\n\n return $file_path;\n }",
"public function convertMP3ToWav()\n\t{\n\t\t$file_name= $this->temp_path.$this->json_file_name;\n\t\t//return exec(self::$LAME_PATH . \" {$filename}_o.mp3 -m m -S -f -b 16 --resample 8 {$filename}.mp3 && \" . self::$LAME_PATH . \" -S --decode {$filename}.mp3 {$filename}.wav\");\n //andy\n $command = \"lame \".$file_name.\"_o.mp3 -m m -S -f -b 16 --resample 8 $file_name.mp3 && lame -S --decode $file_name.mp3 $file_name.wav\";\n $result = exec($command);\n //var_dump ($command);\n \n return $result;\n\t}",
"function fixUp($new_base_folder, $artist, $album){\n// print \"Artist : {$artist}, Album : {$album}\\n\";\n if(!is_dir($new_base_folder . '/' . $artist)){\n logp(\"error\", \"ERROR: {$new_base_folder}/{$artist} does not exist\");\n return;\n }\n chdir($new_base_folder . '/' . $artist);\n // fixes the album directory name by removing $artist -\n rename($artist . \" - \" . $album, $album);\n\n // checks if $album directory exists\n if(!is_dir($album)){\n logp(\"error\", \"ERROR: {$new_base_folder}/{$artist}/{$album} does not exist\");\n return;\n }\n // fixes .mp3 files\n $dir = opendir($album);\n while(($file = readdir($dir)) !== false){\n if($file != \".\" && $file != \"..\"){\n $snip = \"\";\n if(preg_match(\"/^\\d\\d/\", $file)){\n $snip = substr($file, 0, 2);\n $newName = preg_replace(\"/^\\d\\d\\./\", $snip, $file);\n rename(\"{$new_base_folder}/{$artist}/{$album}/{$file}\", \"{$new_base_folder}/{$artist}/{$album}/{$newName}\");\n }else if(preg_match(\"/^\\d\\d\\d/\", $file)){\n $snip = substr($file, 0, 3);\n $newName = preg_replace(\"/^\\d\\d\\d\\./\", $snip, $file);\n rename(\"{$new_base_folder}/{$artist}/{$album}/{$file}\", \"{$new_base_folder}/{$artist}/{$album}/{$newName}\");\n }\n }\n\n }\n}",
"function getMp3FromM3u8($url) {\n // Not a m3u8 url\n if (!strpos($url, \"index.m3u8?\")) {\n return $url;\n }\n if (strpos($url, \"/audios/\")) {\n return preg_replace('~^(.+?)/[^/]+?/audios/([^/]+)/.+$~', '\\\\1/audios/\\\\2.mp3', $url);\n } else {\n return preg_replace('~^(.+?)/(p[0-9]+)/[^/]+?/([^/]+)/.+$~', '\\\\1/\\\\2/\\\\3.mp3', $url);\n }\n}",
"function _asa_convert_sound_file_to_upload($in_file, &$out_file, &$mime_type) {\n global $asa_tmp_dir, $asa_lame;\n\n // create new file name\n $out_file = tempnam($asa_tmp_dir, 'vu_upload_');\n if (!$out_file) {\n \teh_error('Error creating temporary file.');\n \treturn FALSE;\n }\n \n // convert file to .mp3\n // Note: Due to a bug, Flash can only play MP3 files with either 11, 22 or 44 kHz (check LAME forum). \n // The only problem is that resampling audio files takes a long time...\n // TODO: add ID3 information to new MP3 file? Use lame --tt --ta --tl --tc --tg etc.\n\neh_log(\"String to be processed: \" . escapeshellcmd(\"$asa_lame --quiet --resample 11 '$in_file' '$out_file' \"));\n system(escapeshellcmd(\"$asa_lame --quiet --resample 11 '$in_file' '$out_file' \"));\n $mime_type = 'audio/mpeg';\n \n // add a .mp3 suffix to file name\n $r = rename($out_file, $out_file . '.mp3');\n if (!$r) {\n \teh_error(\"Error renaming file: $out_file.\");\n \treturn FALSE;\n }\n $out_file = $out_file . '.mp3';\n \n return TRUE;\n \n}",
"public function updateMusic($aData)\n {\n $prepared = mysqli_prepare($this->dbConn, \"UPDATE music SET m_title = ?, m_description = ?, m_singers = ?, m_cover = ?, m_music_file = ?, m_video_embed = ?, m_genre = ?, m_updated = ? WHERE m_id = ?\");\n $prepared->bind_param('sssssssss',\n $aData['mTitle'],\n $aData['mDesc'],\n $aData['mSinger'],\n $aData['mCover'],\n $aData['mAudio'],\n $aData['mVideo'],\n $aData['mGenre'],\n date('Y-m-d h:i:s'),\n $aData['id']);\n $prepared->execute();\n }",
"function update_stream() {\n global $db;\n\n # Clean-up in case last import went bad\n $db->query(\"DELETE FROM stream WHERE 1=1;\");\n $db->query(\"ALTER TABLE stream AUTO_INCREMENT=1\");\n\n # Query DB for all songs that have been played on air\n # These include duplicates\n $old_rows = $db->query(\"SELECT * FROM songs\");\n\n while ($old_row = $old_rows->fetch_assoc()) {\n\n $old_artist = $db->real_escape_string($old_row[\"artist\"]);\n $old_song = $db->real_escape_string($old_row[\"song\"]);\n $old_time = $old_row[\"created_at\"];\n\n # Get the ID of this song\n $query_string = \"SELECT id FROM unique_songs WHERE `artist`='$old_artist' AND `song`='$old_song'\";\n $query = $db->query($query_string);\n \n $result = $query->fetch_assoc();\n $id = $result[\"id\"];\n \n # Insert the info into `stream`\n $query = $db->prepare(\"INSERT INTO stream(song_id, created_at) VALUES (?, ?)\");\n $query->bind_param('is', $id, $old_time);\n $query->execute();\n $query->close();\n\n }\n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all ServicesAgreement models. | public function actionAgreementIndex()
{
$searchModel = new ServicesAgreementSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('agreementindex', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function listService()\n {\n $purchase = new Purchase_Model_PurchaseMapper();\n $vehicles = $purchase->fetchAll();\n return $vehicles;\n }",
"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 actionIndex() {\n $searchModel = new TabSociosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $this->titulo = 'Gerenciar Socios';\n $this->subTitulo = '';\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all()\n {\n \treturn $this->licenseRepo->all();\n }",
"public function actionIndex()\n {\n $searchModel = new CalificarServicioSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function allAction()\n {\n $em = $this->getDoctrine()->getManager();\n $payments = $em->getRepository(PaymentInfos::class)->findAll();\n\n return $this->render(\n 'PaymentBundle:admin:list.html.twig',\n [\n 'payments' => $payments,\n 'menu_level' => 'payment_admin'\n ]\n );\n }",
"public function actionIndex()\n {\n $searchModel = new ServiciosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new AuditoriaContratosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllAgencesAction( ){\r\n\t\t\r\n\t\t $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('ComDaufinBundle:Agence')->findAll();\r\n\r\n $response = array(\"agences\" => $entities,);\r\n \r\n \r\n return $response;\r\n\t}",
"public function actionIndex()\n {\n\t\tif(!Yii::$app->user->can('VendorInvoices.Index')){\n\t\t\tthrow new \\yii\\web\\ForbiddenHttpException(Yii::t('app', 'You dont have permissions to view this page.'));\n\t\t}\n $searchModel = new VendorInvoicesSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new ClinicServicesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all($params)\n {\n $company = $this->getCompanyUser($params['user_id']);\n return Client::where('company_id', $company->id)->orderBy('name')->get();\n }",
"public function actionIndex()\n {\n $searchModel = new StudentsPaymentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function get_all_license()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/license/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n }\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $entities = $em->getRepository('NvCargaBundle:Adservice')->findByMaincompany($maincompany);\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function index()\n {\n $services = Service::all();\n\n return view('admin.services.index',compact('services'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fieldsComtrads = $em->getRepository('SGIBundle:FieldsComtrad')->findAll();\n\n return $this->render('fieldscomtrad/index.html.twig', array(\n 'fieldsComtrads' => $fieldsComtrads,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new StudentsPaySearch();\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"
]
]
}
} |
Updates an existing ProductColumns model. If update is successful, the browser will be redirected to the 'view' page. | public function actionProductColumnUpdate($id)
{
$model = $this->findProductColumnModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['product-column-view', 'id' => $model->id]);
} else {
return $this->render('updateProductColumn', [
'model' => $model,
]);
}
} | [
"public function update_product()\r\n {\r\n // Update the product based on this objects ID.\r\n return $this->db->update('products', $this, ['id' => $this->get_id()]);\r\n }",
"public function actionUpdate()\n {\n $model = $this->findModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->getSession()->setFlash('success', $this->getFlashMsg('success'));\n return $this->redirect(ArrayHelper::merge(['view'], $model->getPrimaryKey(true)));\n } else {\n if ($model->hasErrors()) {\n \\Yii::$app->getSession()->setFlash('error', $this->getFlashMsg('error'));\n }\n return $this->render($this->viewID, [\n 'model' => $model,\n ]);\n }\n }",
"public function update() {\n\t\t// Does the Product object have an ID?\n\t\tif(is_null($this->id)) trigger_error(\"Product::update(): Attempt to update a product object that does not have its ID property set.\", E_USER_ERROR);\n\t\t\n\t\t// Update the Product\n\t\t$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"UPDATE products SET name=:name, description=:description, price=:price, stock=:stock, available=:available, category=:category, images=:images WHERE id=:id\";\n\t\t$st = $conn->prepare($sql);\n\t\t$st->bindValue(\":name\", $this->name, PDO::PARAM_STR);\n\t\t$st->bindValue(\":description\", $this->description, PDO::PARAM_STR);\n\t\t$st->bindValue(\":price\", $this->price, PDO::PARAM_INT);\n\t\t$st->bindValue(\":stock\", $this->stock, PDO::PARAM_INT);\n\t\t$st->bindValue(\":available\", $this->available, PDO::PARAM_INT);\n\t\t$st->bindValue(\":category\", $this->category, PDO::PARAM_STR);\n\t\t$st->bindValue(\":images\", $this->images, PDO::PARAM_STR);\n\t\t$st->bindValue(\":id\", $this->id, PDO::PARAM_STR);\n\t\t$st->execute();\n\t\t$conn = null;\n\t}",
"public function actionUpdate($id) {\n $request = Yii::$app->request;\n $model = $this->findModel($id);\n $db = Yii::$app->getDb();\n\n if ($request->isAjax) {\n /**\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n $transaction = $db->beginTransaction();\n if ($request->isGet) {\n return [\n 'title' => \"Update Product #\" . $id,\n 'content' => $this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer' => Html::button('Close', ['class' => 'btn btn-default pull-left', 'data-dismiss' => \"modal\"]) .\n Html::button('Save', ['class' => 'btn btn-primary', 'type' => \"submit\"])\n ];\n }\n\n $model->load($request->post());\n $model->save();\n\n if (!$model->hasErrors()) {\n $transaction->commit();\n $model->refresh();\n return [\n 'forceReload' => '#crud-datatable-pjax',\n 'title' => \"Product #\" . $id,\n 'content' => $this->renderAjax('view', [\n 'model' => $model,\n ]),\n 'footer' => Html::button('Close', ['class' => 'btn btn-default pull-left', 'data-dismiss' => \"modal\"]) .\n Html::a('Edit', ['update', 'id' => $id], ['class' => 'btn btn-primary', 'role' => 'modal-remote'])\n ];\n }\n\n $transaction->rollBack();\n return [\n 'title' => \"Update Product #\" . $id,\n 'content' => $this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer' => Html::button('Close', ['class' => 'btn btn-default pull-left', 'data-dismiss' => \"modal\"]) .\n Html::button('Save', ['class' => 'btn btn-primary', 'type' => \"submit\"])\n ];\n }\n\n /*\n * Process for non-ajax request\n */\n $transaction = $db->beginTransaction();\n if ($model->load($request->post()) && $model->save()) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $transaction->rollBack();\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $purifier = new HtmlPurifier;\n $param = $purifier->process(Yii::$app->request->get('id'));\n $model = $this->findModel($param);\n\n //if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->idperscom]);\n //}\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function update_product() {\n\t\t$values=array(\"product_name\"=>$_POST['product_name'],\"description\"=>$_POST['description']);\t\t\t\t\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo true;\n\t\t}\n\t\telse\n\t\t\techo 'Error while updating';\n\t}",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post(),'') && $model->save()) {\n return $this->success();\n }\n\n return $this->fail();\n }",
"public function actionUpdate($id)\n {\n /* @var $modelProduct \\common\\models\\Product */\n\n $modelProduct = $this->findModel($id);\n\n if ($modelProduct->load(Yii::$app->request->post())):\n if($modelProduct->updateObject($modelProduct)):\n return $this->redirect(['view', 'id' => $modelProduct->id]);\n endif;\n endif;\n\n return $this->render('update', [\n 'modelProduct' => $modelProduct,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function updateProductListAction()\n\t{\t\n\t\t//Remove form attributes that were not set.\n\t\t$formRawData = $this->getRequest()->getPost();\n\t\t$formData = array();\n\t\tforeach ($formRawData as $key => $value) {\n\t\t\tif ($value != '') {\n\t\t\t\t$formData[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$form = $this->getModel()->getForm('add');\n\t\t\n\t\t$this->view->element = $form->updateHwProductIdElement($formData);\n\t}",
"public function edit_product(){\n if ( ! $this->ion_auth->logged_in() OR ! $this->ion_auth->is_admin())\n {\n redirect('auth', 'refresh');\n }\n else\n {\n /* Breadcrumbs */\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\n\n /*List Units*/\n $this->data['prod_types'] = $this->products_model->get_prod_types();\n \n /*List Prod Types*/\n $this->data['prod_units'] = $this->products_model->get_prod_unit();\n\n /*Product Details*/\n $this->data['prod_details'] = $this->products_model->get_product_details($this->input->get(\"prod_id\"));\n\n /*Product Invetory*/\n $this->data['prod_inventory'] = $this->products_inventory_model->get_products_inventory($this->input->get('prod_id'));\n\n /*Load Template*/\n $this->template->admin_render('admin/products/edit_product', $this->data);\n\n }\n }",
"public function updateProduct()\n\t{\n\t}",
"public function adminProductEditAction()\n {\n $this->checkAdmin();\n $id = intval($this->route['id']);\n if (isset($_POST['edit'])) {\n $product = $this->praperProduct();\n $vars['massage'] = $this->updateProduct($product, $id);\n }\n //products model\n $vars['products'] = $this->model->getById($id);\n $vars['admin'] = \"\";\n $vars['add/edit'] = \"edit\";\n $this->view->render('Admin Products Edit', $vars);\n }",
"public function updated(Products $products);",
"public function actionUpdate($id)\n {\n \t$model = new ProductSpecification();\n \t$model = $model->findOne($id);\n \tif($model->load ( Yii::$app->request->post () )){\n \t\t$model->save ();\n \t}\n \tif($model->product_id){\n \t\treturn $this->redirect ( ['/product/update','id'=>$model->product_id] );\n \t}\n \treturn $this->redirect ( ['/product/create'] );\n }",
"public function updateProduct($products);",
"public function actionInputproductupdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n \tLogs::writeLogs('更新调入品信息',$model);\r\n return $this->redirect(['inputproductview', 'id' => $model->id]);\r\n } else {\r\n return $this->render('inputproductupdate', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function updateAction(){\r\n $this->_helper->layout->disableLayout();\r\n $this->_helper->viewRenderer->setNoRender();\r\n $class = \"Model_\".$this->getRequest()->getParam('table');\r\n $id = new $class((int)$this->getRequest()->getParam('id'));\r\n $column = $this->getRequest()->getParam('column');\r\n $data = $this->getRequest()->getPost();\r\n $id->{$column} = $data['value'];\r\n $id->save();\r\n echo $data['value'];\r\n }",
"public function actionUpdate()\n\t{\n $id=Yii::app()->user->id;\n\t\t$model=$this->loadModel($id);\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','user_name'=>$model->user_name));\n\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optimizing all files inside folder test01 and then compare files. | public function testOptimizeCss01()
{
chdir(__DIR__."/test01");
exec('../../bin/phing optimize_css');
$build = $this->getFilesById('build');
$expected = $this->getFilesById('expected');
foreach ($expected as $key => $b)
{
if (isset($build[$key]) && isset($expected[$key]))
{
$this->assertFileEquals($expected[$key], $build[$key]);
}
}
} | [
"public function testOptimizeCss02()\n {\n chdir(__DIR__.\"/test02\");\n exec('../../bin/phing -verbose optimize_css');\n\n $build = $this->getFilesById('build');\n $expected = $this->getFilesById('expected');\n\n foreach ($expected as $key => $b)\n {\n if (isset($build[$key]) && isset($expected[$key]))\n {\n $this->assertFileEquals($expected[$key], $build[$key]);\n }\n }\n }",
"public function testFiles() {\n foreach (scandir(RASMUS_TEST_FILE_DIR) as $test_file_name) {\n // Skip '.' and '..'\n if (empty($test_file_name)\n || '.' === $test_file_name\n || '..' === $test_file_name\n ) {\n continue;\n }\n\n // Get the path to the test file\n $test_file_path =\n RASMUS_TEST_FILE_DIR . '/' . $test_file_name;\n\n // Get the path of the expected output file\n $expected_file_path =\n RASMUS_EXPECTED_DIR . '/' . $test_file_name . '.expected';\n\n // Read the expected output\n $expected_output =\n trim(file_get_contents($expected_file_path));\n\n // Start reading everything sent to STDOUT\n // and compare it to the expected value once\n // the analzyer finishes running\n ob_start();\n\n try {\n // Run the analyzer\n (new Phan)->analyzeFileList(\n clone($this->code_base),\n [$test_file_path]\n );\n } catch (Exception $exception) {\n // TODO: inexplicably bad things happen here\n // print \"\\n\" . $exception->getMessage() . \"\\n\";\n }\n\n $output = trim(ob_get_clean());\n $wanted_re = preg_replace('/\\r\\n/', \"\\n\", $expected_output);\n\t\t\t// do preg_quote, but miss out any %r delimited sections\n $temp = \"\";\n $r = \"%r\";\n $startOffset = 0;\n $length = strlen($wanted_re);\n while($startOffset < $length) {\n $start = strpos($wanted_re, $r, $startOffset);\n if ($start !== false) {\n // we have found a start tag\n $end = strpos($wanted_re, $r, $start+2);\n if ($end === false) {\n // unbalanced tag, ignore it.\n $end = $start = $length;\n }\n } else {\n // no more %r sections\n $start = $end = $length;\n }\n // quote a non re portion of the string\n $temp = $temp . preg_quote(substr($wanted_re, $startOffset, ($start - $startOffset)), '/');\n // add the re unquoted.\n if ($end > $start) {\n $temp = $temp . '(' . substr($wanted_re, $start+2, ($end - $start-2)). ')';\n }\n $startOffset = $end + 2;\n }\n $wanted_re = $temp;\n $wanted_re = str_replace(['%binary_string_optional%'], 'string', $wanted_re);\n $wanted_re = str_replace(['%unicode_string_optional%'], 'string', $wanted_re);\n $wanted_re = str_replace(['%unicode\\|string%', '%string\\|unicode%'], 'string', $wanted_re);\n $wanted_re = str_replace(['%u\\|b%', '%b\\|u%'], '', $wanted_re);\n // Stick to basics\n $wanted_re = str_replace('%e', '\\\\' . DIRECTORY_SEPARATOR, $wanted_re);\n $wanted_re = str_replace('%s', '[^\\r\\n]+', $wanted_re);\n $wanted_re = str_replace('%S', '[^\\r\\n]*', $wanted_re);\n $wanted_re = str_replace('%a', '.+', $wanted_re);\n $wanted_re = str_replace('%A', '.*', $wanted_re);\n $wanted_re = str_replace('%w', '\\s*', $wanted_re);\n $wanted_re = str_replace('%i', '[+-]?\\d+', $wanted_re);\n $wanted_re = str_replace('%d', '\\d+', $wanted_re);\n $wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re);\n $wanted_re = str_replace('%f', '[+-]?\\.?\\d+\\.?\\d*(?:[Ee][+-]?\\d+)?', $wanted_re);\n $wanted_re = str_replace('%c', '.', $wanted_re);\n // %f allows two points \"-.0.0\" but that is the best *simple* expression\n\n $this->assertRegExp(\"/^$wanted_re\\$/\", $output, \"Unexpected output in $test_file_path\");\n }\n }",
"public function compareFiles()\n {\n $this->collectFiles();\n $iterator = new Iterator();\n $iterator->loadList($this->objectsList);\n// $firstCursorId = 0; // it already is by default\n $secondCursorId = $iterator->addCursor();\n /** @var File $file1 */\n $file1 = null;\n $this->resultArrayItemId = -1;\n while(false !== ($firstCursorPosition = $iterator->current($file1))){\n $iterator->setCursorPosition($firstCursorPosition + 1, $secondCursorId);\n /** @var File $file2 */\n $file2 = null;\n while(false !== ($iterator->current($file2, $secondCursorId))){\n $this->resultArrayItemId++;\n// Uncomment next two lines to see comparing process (debug)\n// echo $file1->getFullFilePath() . \" ... \";\n// echo $file2->getFullFilePath() . \"\\n\";\n $this->resultArray[$this->resultArrayItemId]['files']\n = $file1->getFullFilePath() . \" ... \"\n . $file2->getFullFilePath();\n if($this->ckFileSize\n && $file1->getFileSize() !== $file2->getFileSize())\n {\n $this->resultArray[$this->resultArrayItemId]['result']\n = 'Different 1 (by size).';\n $this->resultArray[$this->resultArrayItemId]['code'] = self::DIFFERENT_0;\n continue;\n }\n if($this->firstBlockCompare &&\n $file1->readPart($this->readBlockSize) !== $file2->readPart($this->readBlockSize))\n {\n $this->resultArray[$this->resultArrayItemId]['result']\n = 'Different 2 (by first part of contents).';\n $this->resultArray[$this->resultArrayItemId]['code'] = self::DIFFERENT_1;\n continue;\n }\n if($this->fullContentCompare) {\n do {\n $partOfFile1 = $file1->readPart($this->readBlockSize);\n $partOfFile2 = $file2->readPart($this->readBlockSize);\n if ($partOfFile1 !== $partOfFile2) {\n $this->resultArray[$this->resultArrayItemId]['result']\n = 'Different (by contents).';\n $this->resultArray[$this->resultArrayItemId]['code'] = self::DIFFERENT_2;\n continue 2;\n }\n } while ($partOfFile1);\n }\n if($this->ckFullFileMd5){\n if ($file1->getMd5File() !== $file2->getMd5File()) {\n $this->resultArray[$this->resultArrayItemId]['result']\n = 'Different (by md5).';\n $this->resultArray[$this->resultArrayItemId]['code'] = self::DIFFERENT_2;\n continue;\n }\n }\n $this->resultArray[$this->resultArrayItemId]['result']\n = ' WARNING! Copy of file detected!';\n $this->resultArray[$this->resultArrayItemId]['code'] = self::SAME_CONTENT;\n $file2->setMark();\n }\n }\n return $this;\n }",
"function scanFiles(){\n $this->filesSeen = [];\n\t\t$this->filesSeenThumb = [];\n\t\t\n foreach (scandir($this->folderGrabs) as $fname){\n if (strpos($fname,\".fail.\")) continue;\n if (count(explode(\".\",$fname))<4) continue;\n $this->filesSeen[]=$fname;\n }\n sort($this->filesSeen);\n\t\t\n foreach (scandir($this->folderThumbs) as $fname){\n if (strpos($fname,\".fail.\")) continue;\n if (count(explode(\".\",$fname))<4) continue;\n $this->filesSeenThumb[]=$fname;\n }\n sort($this->filesSeenThumb);\n }",
"public static function process_combined_files()\n {\n self::backend()->processCombinedFiles();\n }",
"protected function run_comparisons()\n {\n $this->listing_last = array();\n\n if (file_exists($this->config['md5_file']))\n {\n $temp = file_get_contents($this->config['md5_file']);\n\n $this->listing_last = (array)json_decode($temp);\n }\n\n // kept Luke's old logic here\n // there are probably faster ways to do this\n // Perform Comparisons\n $keys_now = array_keys($this->listing_now);\n $keys_last = array_keys($this->listing_last);\n // New Files = Files in $now, but not in $last\n $this->files_new = array_diff($keys_now, $keys_last);\n\n // Deleted Files = Files in $last, but not in $now\n $this->files_deleted = array_diff($keys_last, $keys_now);\n\n // Changed Files = Files in $last and $now, but with Different MD5 Hashes\n $this->files_modified = array_diff_assoc(\n array_flip(array_intersect_key($this->listing_last, $this->listing_now)),\n array_flip(array_intersect_key($this->listing_now, $this->listing_last))\n );\n\n // this line must have parenthesis\n $this->there_were_differences = (count($this->files_new) OR count($this->files_modified) OR count($this->files_deleted));\n\n if($this->DEBUG) {\n echo 'Number of files_new: ' . count($this->files_new) . \"\\n\";\n echo 'Number of files_modified: ' . count($this->files_modified) . \"\\n\";\n echo 'Number of files_delete: ' . count($this->files_deleted). \"\\n\";\n\n echo ($this->there_were_differences ? 'There were differences' : 'There were not any differences') . \"\\n\";\n print_r($this->files_modified);\n }\n }",
"function s_d_compare(){\n $this->new = false;\n $this->dup = false;\n $this->disallowed = false;\n\n foreach($this->sourceFolder as $item) {\n $f = new File($item);\n $f->info();\n $name = $f->name;\n \n if (is_file($item)) {\n if (!isset($this->Behaviors->Upload->ext['.'.$f->info['extension']])) {\n $this->disallowed[$name] = $f;\n $f->reason = $f->info['extension']. ' is not allowed.';\n\n } elseif (file_exists($this->destPath.'/'.$name) && is_file($this->destPath.'/'.$name)) {\n $this->read_exif($f);\n $this->dup[$name] = $f;\n $d = new File($this->destPath.'/'.$name);\n $d->info();\n $this->read_exif($d);\n $this->dup[$name]->duplicate = $d;\n\n } else {\n $this->new[$name] = $f;\n $this->read_exif($f);\n }\n } else {\n $this->disallowed[$f->name] = $f;\n $f->reason = \"Disallowed because this is not a file\";\n }\n }\n }",
"public function testBasicMinificationWithImportedFiles()\n {\n $basePath = TESTS_ROOT . 'app' . DS . 'css' . DS;\n $this->task\n ->setDestinationsMap([\n $basePath . 'with-images.css' => $basePath . 'output.css'\n ]);\n $result = $this->task->run();\n\n $this->assertInstanceOf(Result::class, $result);\n $this->assertEquals(Result::EXITCODE_OK, $result->getExitCode());\n\n $this->assertEquals(\n file_get_contents(TESTS_ROOT . 'comparisons' . DS . __FUNCTION__ . '.css'),\n file_get_contents($basePath . 'output.css')\n );\n\n $source = $basePath . 'with-images.css';\n $dest = $basePath . 'output.css';\n $expectedLog = 'Minified CSS from <info>' . $source . '</info> to <info>' . $dest . '</info>';\n $this->assertEquals(\n $expectedLog,\n $this->task->logger()->getLogs()[0]\n );\n }",
"public function testOptimize()\n {\n // Get data from test1.json\n $original = file_get_contents(__DIR__ . '/fixtures/test1.json');\n $preOptimized = file_get_contents(__DIR__ . '/fixtures/test1-optimized.json');\n\n $original = json_decode($original, true);\n $preOptimized = json_decode($preOptimized, true);\n\n // Optimize it\n $optimized = $original;\n Collection::optimize($optimized);\n\n $this->assertNotEquals($original, $optimized);\n $this->assertEquals($preOptimized, $optimized);\n\n // Test verticalAlign\n $this->assertEquals(-0.143, $optimized['verticalAlign']);\n $this->assertFalse(isset($optimized['icons']['audio-description']['verticalAlign']));\n $this->assertFalse(isset($original['verticalAlign'])); // Make sure $data was not changed\n\n // Test width\n $this->assertEquals(1536, $optimized['width']);\n $this->assertFalse(isset($optimized['icons']['arrow-circle-left']['width']));\n $this->assertTrue(isset($optimized['icons']['arrow-up']['width']));\n\n // Test if height is set and test each item\n $this->assertEquals(1536, $optimized['height']);\n foreach ($optimized['icons'] as $key => $item) {\n $this->assertTrue(!isset($item['height']) || $item['height'] !== 1536);\n }\n\n // De-optimize it\n $final = $optimized;\n Collection::deOptimize($final);\n\n $this->assertNotEquals($optimized, $final);\n $this->assertEquals($final, $original);\n }",
"function filterDataByFile(string $folder, array $base): array\n{\n $baseData = $base;\n $fileCount = count(scandir($folder));\n printf(\"\\nStarting coverage diff...\\n\");\n $currentFile = 0;\n\n foreach (scandir($folder) as $file) {\n $currentFile+= 1;\n printf(\"\\nComparing ($currentFile/$fileCount)\\n\");\n if (!isset(pathinfo($file)['extension']) || pathinfo($file)['extension'] !== 'cov') {\n continue;\n }\n\n print_mem('filterDataByFile: ' . $file);\n $fileCoverage = readCoverage($folder . $file);\n print_mem('filterDataByFile: executed readCoverage');\n $baseData = filterData($baseData, $fileCoverage);\n print_mem('filterDataByFile: executed filterData');\n }\n\n return $baseData;\n}",
"protected function analyzeFiles()\n {\n if (!$this->paths) {\n $this->printHelp();\n return;\n }\n\n $paths = array();\n\n foreach ($this->paths as $path) {\n if (!file_exists($path) || !is_readable($path)) {\n echo \"Cannot open \" . $path . \"\\n\";\n }\n\n if (is_dir($path)) {\n $paths[] = new RegexIterator(\n new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path)\n ),\n '(\\.php$)i'\n );\n } else {\n $paths[] = $path;\n }\n }\n\n $manager = new Manager(__DIR__ . '/../../../standards', '~/.flitch/standards', $this->standard);\n $tokenizer = new Tokenizer();\n\n if (false === $this->quiet) {\n $this->reports['cli'] = new Report\\Cli();\n }\n\n if (!empty($this->checkstyleReportFilename)) {\n $this->reports['checkstyle'] = new Report\\Checkstyle($this->checkstyleReportFilename);\n }\n\n foreach ($paths as $path) {\n if (is_string($path)) {\n $file = $this->analyzeFile($path, $tokenizer, $manager);\n } else {\n foreach ($path as $fileInfo) {\n $file = $this->analyzeFile($fileInfo->getPathname(), $tokenizer, $manager);\n }\n }\n }\n }",
"public function compareCode(array &$Report){\n\t\t$this->updateProgressBar('Determining New Files And Files To Upgrade', 0);\n\t\t$Common = array();\n\t\t$RootMissing = array();\n\t\t$UpgradeNew = array();\n\n\t\t$UpgradeDir = new RecursiveDirectoryIterator($this->zipFileExtractPath);\n\t\t$UpgradeFiles = new RecursiveIteratorIterator($UpgradeDir, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach($UpgradeFiles as $File){\n\t\t\tif ($File->isDir()){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$filePath = str_replace($this->zipFileExtractPath, '', $File->getPathname());\n\t\t\t$process = true;\n\t\t\tforeach($this->ignoreFiles as $path){\n\t\t\t\tif (substr($path, 0, 1) == '*' && basename($filePath) == basename($path)){\n\t\t\t\t\t$process = false;\n\t\t\t\t}elseif (substr($filePath, 0, strlen($path)) == $path){\n\t\t\t\t\t$process = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($process === true){\n\t\t\t\t$UpgradeNew[$filePath] = $filePath;\n\t\t\t}\n\t\t}\n\n\t\t$RootDir = new RecursiveDirectoryIterator($this->rootPath);\n\t\t$RootFiles = new RecursiveIteratorIterator($RootDir, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach($RootFiles as $File){\n\t\t\tif ($File->isDir()){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$filePath = str_replace($this->rootPath, '', $File->getPathname());\n\t\t\t$process = true;\n\t\t\tforeach($this->ignoreFiles as $path){\n\t\t\t\tif (substr($path, 0, 1) == '*' && basename($filePath) == basename($path)){\n\t\t\t\t\t$process = false;\n\t\t\t\t}elseif (substr($filePath, 0, strlen($path)) == $path){\n\t\t\t\t\t$process = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($process === true){\n\t\t\t\tif (!isset($UpgradeNew[$filePath])){\n\t\t\t\t\t$RootMissing[$filePath] = $filePath;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$Common[$filePath] = $filePath;\n\t\t\t\t\tunset($UpgradeNew[$filePath]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tgc_collect_cycles();\n\n\t\t$this->updateProgressBar('Determining New Files And Files To Upgrade', 1);\n\t\tforeach($UpgradeNew as $filePath){\n\t\t\t$Report[] = array(\n\t\t\t\t'file' => $filePath,\n\t\t\t\t'message' => 'New File From Upgrade',\n\t\t\t\t'checked' => true,\n\t\t\t\t'hasDiff' => false\n\t\t\t);\n\t\t}\n\t\t$UpgradeNew = null;\n\t\tunset($UpgradeNew);\n\n\t\tforeach($RootMissing as $filePath){\n\t\t\t$Report[] = array(\n\t\t\t\t'file' => $filePath,\n\t\t\t\t'message' => 'Old Or Custom File',\n\t\t\t\t'checked' => true,\n\t\t\t\t'hasDiff' => false\n\t\t\t);\n\t\t}\n\t\t$RootMissing = null;\n\t\tunset($RootMissing);\n\n\t\tgc_collect_cycles();\n\n\t\t$numOfFiles = sizeof($Common);\n\t\t$fileCount = 0;\n\t\tforeach($Common as $idx => $filePath){\n\t\t\t$curFilePath = $this->rootPath . $filePath;\n\t\t\t$zipFilePath = $this->zipFileExtractPath . $filePath;\n\t\t\t$fileCount++;\n\t\t\t$this->updateProgressBar(\n\t\t\t\t'Comparing File<br><br>' . $filePath,\n\t\t\t\t($fileCount / $numOfFiles)\n\t\t\t);\n\t\t\t$this->updateGlobalProgressBar(\n\t\t\t\tnumber_format((30 + (30 * ($fileCount / $numOfFiles))) / 100, 2)\n\t\t\t);\n\n\t\t\tif (file_exists($zipFilePath) && file_exists($curFilePath)){\n\t\t\t\t$Result = $this->compareFiles($curFilePath, $zipFilePath, &$Report);\n\t\t\t\tif ($Result !== false){\n\t\t\t\t\t$Report[] = $Result;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$Report[] = array(\n\t\t\t\t\t'file' => $filePath,\n\t\t\t\t\t'message' => 'ERROR: Non-Existant File Slipped Through<br><br>Root Path: ' . $curFilePath . '<br>Upgrade Path: ' . $zipFilePath . '<br><br>',\n\t\t\t\t\t'checked' => true,\n\t\t\t\t\t'hasDiff' => false\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tunset($Common[$idx]);\n\t\t}\n\t\tgc_collect_cycles();\n\t\tclearstatcache();\n\t}",
"public function testBasicMinificationWithImportedFilesLimitSize()\n {\n $basePath = TESTS_ROOT . 'app' . DS . 'css' . DS;\n $this->task\n ->setDestinationsMap([\n $basePath . 'with-images.css' => $basePath . 'output.css'\n ])\n ->setMaxImportSize(10);\n $result = $this->task->run();\n\n $this->assertInstanceOf(Result::class, $result);\n $this->assertEquals(Result::EXITCODE_OK, $result->getExitCode());\n\n $this->assertEquals(\n file_get_contents(TESTS_ROOT . 'comparisons' . DS . __FUNCTION__ . '.css'),\n file_get_contents($basePath . 'output.css')\n );\n\n $source = $basePath . 'with-images.css';\n $dest = $basePath . 'output.css';\n $expectedLog = 'Minified CSS from <info>' . $source . '</info> to <info>' . $dest . '</info>';\n $this->assertEquals(\n $expectedLog,\n $this->task->logger()->getLogs()[0]\n );\n }",
"public function sortImages()\n {\n $directoryIterator = new DirectoryIterator(self::SOURCE_IMAGE_FOLDER);\n\n $this->createFoldersForMonths();\n\n foreach ($directoryIterator as $fileInfo) {\n if (!$fileInfo->isDot()) {\n // TODO write log message\n // echo 'Working on file... ' . $fileInfo->getFilename();\n\n $month = null;\n $sourcePath = self::SOURCE_IMAGE_FOLDER.'/'.$fileInfo->getFilename();\n $exifData = @exif_read_data($sourcePath, 'FILE', true);\n $month = $this->determineMonth($exifData);\n\n if ($month != null) {\n $this->succeededFiles[] = array($fileInfo->getFilename(), $month);\n $this->copyFile($sourcePath, $month, $fileInfo);\n // TODO write log info\n\n } else {\n $this->failedFiles[] = array($fileInfo->getFilename(), 'undefined');\n $this->copyFile($sourcePath, 'undefined', $fileInfo);\n // TODO write log info\n }\n }\n }\n }",
"public function mergeModifiedFiles();",
"private function testImageResizeWithSameFile()\n {\n $this->assert(\n count(glob($this->getTempDir('/*'))) === 4,\n 'The number of files in tmp directory is correct'\n );\n\n $inFile = $this->getTempDir('/2.jpeg');\n\n clearstatcache();\n $this->assert(\n filesize($inFile) === 3067348,\n 'File size is correct'\n );\n\n $command = \"php {$this->getScript()} --in={$inFile} --out-same --overwrite --size=2067348\";\n\n $this->exec($command);\n\n clearstatcache();\n $this->assert(\n filesize($inFile) === 1226994,\n \"Output file is expected size\"\n );\n\n $backupFile = glob($this->getTempDir('/*.backup'));\n $this->assert(\n count($backupFile) === 1,\n 'There is a file that was backed up'\n );\n\n $this->assert(\n filesize(current($backupFile)) === 3067348,\n \"The backup file has the same file size as it did before it was moved\"\n );\n }",
"public function _avgModified($dir)\n {\n $avg = 0;\n $tmpTotal = 0;\n $tmpCnt = 0;\n $totalFilesScanned = 0;\n $totals = array();\n // $totalsCount = array();\n $numberOfTotals = 0;\n//echo PHP_INT_MAX.\"\\n\";\n $maxIntVal = PHP_INT_MAX - time() - 1; //-1 just to ensure its still within range\n\n // skip the directory if it can't be read due to filesystem permissions\n try {\n $it = new RecursiveDirectoryIterator($dir); \n } catch (Exception $e) {\n //echo 'Caught exception: ', $e->getMessage(), \"<br />\\n\";\n //echo \"here\";\n return 0;\n }\n \n // scan through the directory and its subdirectories to determine the\n // average of .html file contained within\n try {\n //$tmp = implode(\" \", $this->_ignoredDirectories); // used to avoid implode multiple times\n foreach (new RecursiveIteratorIterator($it) as $dirLevel => $file) {\n\n // if(in_array(getcwd().\"/\".$dirLevel, $this->_ignoredDirectories) || strpos($tmp, getcwd().\"/\".$dirLevel.\"/\") === false) {\n // echo \"IGNORED \".getcwd().\"/\".$dirLevel;\n // continue;\n // }\n\n if (fnmatch('*.html', $file) && $this->_notInIgnoredFileNames($file)) {\n\n if($tmpTotal < $maxIntVal) {\n //echo filemtime($file).\"\\n\";\n $tmpTotal += filemtime($file);\n $tmpCnt ++;\n $totalFilesScanned++;\n } \n else { //echo \"YESS\\n\";\n $totals[$numberOfTotals] = $tmpTotal;\n //$totalsCount[$numberOfTotals] = $tmpCnt;\n $numberOfTotals++;\n $tmpCnt = 0;\n $tmpTotal = 0;\n }\n }\n }\n $totals[$numberOfTotals] = $tmpTotal;\n //$totalsCount[$numberOfTotals] = $tmpCnt;\n $numberOfTotals++;\n $tmpCnt = 0;\n $tmpTotal = 0;\n\n //Time to calculate the average!!!\n//var_dump($totals);\n//var_dump($totalsCount);\n//var_dump($totalFilesScanned);\n $avg = 0.0;\n\n if($totalFilesScanned != 0) {\n foreach ($totals as $i => $currentTotal) {\n //echo \"here $currentTotal $totalFilesScanned \\n\";\n $avg += $currentTotal/$totalFilesScanned;\n }\n }\n\n return intval($avg);\n\n } catch (Exception $e) { //comes here if read permission denied\n //echo 'Caught exception: ', $e->getMessage(), \"<br />\\n\"; \n }\n\n //error\n return 0;\n }",
"public function slowCheck($idx = 0)\n\t{\n\t\t$ret = array(\n\t\t\t'done'\t=> false,\n\t\t\t'files'\t=> array(),\n\t\t\t'folders'\t=> array(),\n\t\t\t'idx'\t=> $idx\n\t\t);\n\n\t\t$totalFiles = count($this->fileList);\n\t\t$totalFolders = count($this->dirList);\n\t\t$fileKeys = array_keys($this->fileList);\n\n\t\t$timer = new Timer(3.0, 75.0);\n\n\t\twhile ($timer->getTimeLeft() && (($idx < $totalFiles) || ($idx < $totalFolders)))\n\t\t{\n\t\t\tif ($idx < $totalFolders)\n\t\t\t{\n\t\t\t\t$directory = JPATH_ROOT . '/' . $this->dirList[$idx];\n\n\t\t\t\tif (!@is_dir($directory))\n\t\t\t\t{\n\t\t\t\t\t$ret['folders'][] = $directory;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($idx < $totalFiles)\n\t\t\t{\n\t\t\t\t$fileKey = $fileKeys[$idx];\n\t\t\t\t$filePath = JPATH_ROOT . '/' . $fileKey;\n\t\t\t\t$fileData = $this->fileList[$fileKey];\n\n\t\t\t\tif (!@file_exists($filePath))\n\t\t\t\t{\n\t\t\t\t\t$ret['files'][] = $fileKey . ' (missing)';\n\t\t\t\t}\n\t\t\t\telseif (@filesize($filePath) != $fileData[0])\n\t\t\t\t{\n\t\t\t\t\t$ret['files'][] = $fileKey . ' (size ' . @filesize($filePath) . ' ≠ ' . $fileData[0] . ')';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (function_exists('sha1_file'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fileSha1 = @sha1_file($filePath);\n\n\t\t\t\t\t\tif ($fileSha1 != $fileData[2])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ret['files'][] = $fileKey . ' (SHA1 ' . $fileSha1 . ' ≠ ' . $fileData[2] . ')';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif (function_exists('md5_file'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fileMd5 = @md5_file($filePath);\n\n\t\t\t\t\t\tif ($fileMd5 != $fileData[1])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ret['files'][] = $fileKey . ' (MD5 ' . $fileMd5 . ' ≠ ' . $fileData[1] . ')';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$idx++;\n\t\t}\n\n\t\tif (($idx >= $totalFiles) && ($idx >= $totalFolders))\n\t\t{\n\t\t\t$ret['done'] = true;\n\t\t}\n\n\t\t$ret['idx'] = $idx;\n\n\t\treturn $ret;\n\t}",
"public function writeOptimizedFiles() {\n\t\t$extensionDir = dirname( __FILE__ );\n\t\t$resourceDir = \"$extensionDir/resources\";\n\n\t\t// have to group styles by dirname, since they sometimes refer to resources by relative path.\n\t\t$dirStyleCombinedUrls = array();\n\t\t$dirStyleMinifiedUrls = array();\n\t\t$dirStylesMap = array();\n\t\tforeach ( $this->styles as $style ) {\n\t\t\t$dir = dirname( $style );\n\t\t\tif ( !isset( $dirStylesMap[$dir] ) ) {\n\t\t\t\t$dirStylesMap[$dir] = array();\n\t\t\t}\n\t\t\t$dirStylesMap[$dir][] = $style;\n\t\t}\n\t\tforeach ( $dirStylesMap as $dir => $styles ) {\n\t\t\t$combined = \"$dir/dir.\" . self::STYLES_COMBINED;\n\t\t\t$this->concatenateFiles( $styles, $combined );\n\t\t\t$dirStyleCombinedUrls[] = preg_replace( '/^resources\\//', '', $combined );\n\n\t\t\t$minified = \"$dir/dir.\" . self::STYLES_MINIFIED;\n\t\t\t$this->writeMinifiedCss( $combined, $minified );\n\t\t\t$dirStyleMinifiedUrls[] = preg_replace( '/^resources\\//', '', $minified );\n\t\t}\n\t\t$this->writeStyleImporter( $dirStyleCombinedUrls, $resourceDir . '/' . self::STYLES_COMBINED );\n\t\t$this->writeStyleImporter( $dirStyleMinifiedUrls, $resourceDir . '/' . self::STYLES_MINIFIED );\n\n\t\t// scripts are easy, they don't (or shouldn't) refer to other resources with relative paths\n\t\t$scriptsCombinedFile = $resourceDir . '/' . self::SCRIPTS_COMBINED;\n\t\t$this->concatenateFiles( $this->scripts, $scriptsCombinedFile );\n\t\t$this->writeMinifiedJs( $scriptsCombinedFile, $resourceDir . '/' . self::SCRIPTS_MINIFIED );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a "BCC" address. | public function addBCC($address, $name = '')
{
} | [
"public function addBCC($address, $name = '')\n {\n }",
"public function addBCC( $email, $name = '' )\r\n\t{\r\n\t\tself::addEmails( 'bcc', $email, $name );\t\r\n\t}",
"public function makeBCC()\n\t{\n\t\t$this->_isbcc = true;\n\t}",
"public function setEmailBCCAddress($value) { $this->_emailBCCAddress = $value; }",
"public function testAddBCC()\n\t{\n\t\t$recipient = 'test@example.com';\n\t\t$name = 'test_name';\n\t\t$expected = array(array('test@example.com', 'test_name'));\n\n\t\t$this->object->addBCC($recipient, $name);\n\t\t$this->assertThat($expected, $this->equalTo(ReflectionHelper::getValue($this->object, 'bcc')));\n\t}",
"public function addBCC($email, $name = '')\n {\n $this->mailObj->addBcc($email, $name);\n }",
"public final function addBcc ($email) {\n\t\tif (is_array($email) && count($email) > 0) {\n\t\t\tif (!is_array($this->mail_content['bcc'])) $this->mail_content['bcc'] = array();\n\t\t\t$this->mail_content['bcc'] = array_merge($this->mail_content['bcc'],$email);\n\t\t}\n\t\telse if (strlen(trim($email)) > 0) { $this->mail_content['bcc'][] = $email; }\n\t}",
"function Bcc( $bcc )\n {\n \tif( is_array($bcc) ) {\n \t\t$this->abcc = $bcc;\n \t} else {\n \t\t$this->abcc[]= $bcc;\n \t}\n \tif( $this->checkAddress == true )\n \t\t$this->CheckAdresses( $this->abcc );\n }",
"public function setBcc($bcc);",
"function Bcc( $bcc )\r\n\t\t{\r\n\t\tif( is_array($bcc) )\r\n\t\t\t$this->abcc = $bcc;\r\n\t\telse\r\n\t\t\t$this->abcc[]= $bcc;\r\n\r\n\t\tif( $this->checkAddress == true )\r\n\t\t\t$this->CheckAdresses( $this->abcc );\r\n\t\t}",
"public function BCC($address) {\r\n\t\t$this->listBcc[] = $address;\r\n\t}",
"public function addRecipientsBcc($recipients = array());",
"public function addBCC($xEmailAddress)\n {\n $aEmailAddress = (array)$xEmailAddress;\n\n foreach ($aEmailAddress as $sEmailAddress)\n {\n $sEmailAddress = trim($sEmailAddress);\n\n try\n {\n self::validate($sEmailAddress, false);\n $this->aBCC[] = $sEmailAddress;\n }\n catch (\\Exception $e) {}\n }\n\n $this->aBCC = array_unique($this->aBCC);\n }",
"public function testAddBcc()\n\t{\n\t\t$recipient = 'test@example.com';\n\t\t$name = 'test_name';\n\t\t$expected = array(array('test@example.com', 'test_name'));\n\n\t\t$this->object->addBcc($recipient, $name);\n\t\t$this->assertThat($expected, $this->equalTo(TestReflection::getValue($this->object, 'bcc')));\n\t}",
"function addBcc($email)\n\t{\n\t\tif (isset($this->_headers['Bcc'])) {\n\t\t\t$this->_headers['Bcc'] .= \", $email\";\n\t\t} else {\n\t\t\t$this->_headers['Bcc'] = $email;\n\t\t}\n\t}",
"public function getEmailBCCAddress() { return $this->_emailBCCAddress; }",
"public function bcc($email) \n { \n // Check if the email is valid before adding it\n if( !$this->validate($email) ) return FALSE;\n \n // Email is valid at this point, add it and return TRUE\n $this->bcc[] = $email;\n return TRUE;\n }",
"function set_bcc($mail_bcc, $name = \"\"){\n\t\tif ($this->_validate_mail($mail_bcc)){\n\t\t\t$this->mail_bcc = !empty($name) ? \"$name <$mail_bcc>\" : $mail_bcc;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getBcc()\t\t\t\t\t\t\t\t\t{return $this->getFromCustomData(self::CUSTOM_DATA_BCC);}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[ProductFeatures]]. | public function getProductFeatures()
{
return $this->hasMany(ProductFeature::className(), ['product_id' => 'id']);
} | [
"private function getProductFeatures() {\n $aShopProductFeatures = array();\n\n foreach (Feature::getFeatures(_LANG_ID_) as $aRow) {\n if ($this->isFeatureCustom($aRow['id_feature']) === false) {\n $sType = 'selectAndText';\n } else {\n $sType = 'text';\n }\n\n $aShopProductFeatures[\"f_{$aRow['id_feature']}\"] = array(\n 'name' => $aRow['name'],\n 'type' => $sType,\n );\n }\n\n return $aShopProductFeatures;\n }",
"function get_features() {\n\t\t$sql = \"SELECT `products`.* FROM `products`,`products_features` WHERE `products`.`id` = `products_features`.`product_id` and `products`.`deleted` = 0 and `products`.`status` = 1 ORDER BY `products_features`.`order` ASC LIMIT 0,12\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}",
"public function getFeatures() {\n $features = new Application_Model_DbTable_Feature();\n $select = $features->select()->setIntegrityCheck(FALSE)->from('shop_feature');\n $select->where('selectable = \"1\" AND multiple = \"0\" AND (type = \"varchar\" OR type = \"color\")');\n $result = $features->fetchAll($select);\n if ($result) {\n return $result->toArray();\n }\n return FALSE;\n }",
"public function getProductFeatures($product_id) {\n if (!empty($product_id)) {\n $statement = [];\n $statement[] = $this->select('f.name');\n $statement[] = $this->from('product_features as feature');\n $statement[] = $this->join('features as f ', 'f.id=feature.feature_id', 'INNER');\n $statement[] = $this->where(['feature.status' => 1, 'feature.product_id' => $product_id]);\n $sql = implode(' ', $statement);\n $query = $this->connection->prepare($sql);\n $query->execute();\n $result = $query->fetchAll(PDO::FETCH_OBJ);\n if (!empty($result)) {\n $feature = [];\n foreach ($result as $val) {\n $feature[] = $val->name;\n }\n return $feature;\n }\n }\n }",
"public function features(): HasMany\n {\n return $this->hasMany(ProductFeature::class, 'product_id');\n }",
"public function getproduct_feature()\n\t{\n\t\t$query = \"SELECT * FROM tbl_product \n\t\t\tWHERE type = '1'\n\t\t\torder by created_ad desc LIMIT 3 \";\n\t\t$result = $this->db->select($query);\n\t\treturn $result;\n\t}",
"public function getFeaturedProduct();",
"public function getFeatures () { }",
"function FeaturedProducts() {\n\t\treturn $this->ProductsShowable(\"`FeaturedProduct` = 1\", self::$featured_products_permissions);\n\t}",
"public function readFeaturesByProduct($id){\n\t\treturn $query = \"SELECT DISTINCT speci_value FROM \" . self::$model .\" WHERE speci_type = 1 && product_id = \".$id;\n\t}",
"public function getFeatures()\n {\n return collect($this->features);\n }",
"public function get_features() {\n return $this->features;\n }",
"public function features()\n {\n return OrderItemOption::where('item_id', $this->id)\n ->groupBy('feature_id')\n ->orderBy('feature_sort')\n ->get();\n }",
"public function getAll()\n {\n return Feature::orderBy('name', 'ASC')->get();\n }",
"private function getProducts($val_name, $feature_id, $params) {\n $product = new Application_Model_DbTable_ProductFeatures();\n $siteCurrency = Frontend_Utils::getSiteCurrency();\n if (!empty($val_name) && !empty($feature_id)) {\n\n//get feature to find out its type \n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_feature');\n $select->where('id =?', $feature_id);\n $feature = $product->fetchRow($select)->toArray();\n\n//by feature type set up table name\n $table = (($feature['type'] == 'varchar') ? 'shop_feature_values_varchar' : 'shop_feature_values_color');\n\n//find feature by name\n $select = $product->select()->setIntegrityCheck(FALSE)->from($table);\n $select->where('value =?', $val_name)->limit(1);\n $value = $product->fetchRow($select)->toArray();\n\n\n// find products by feature id and feature value id\n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_product');\n $select->join('shop_product_features', 'shop_product.id = shop_product_features.product_id', ['feature_id', 'feature_value_id', 'product_id']);\n\n//<--add filters from _get parameters \n if (!empty($params['price_max'])) {\n $price_max = Frontend_Utils::priceUA($params['price_max'], $siteCurrency);\n $select->where('shop_product.price <= ?', $price_max);\n }\n\n if (!empty($params['price_min'])) {\n $price_min = Frontend_Utils::priceUA($params['price_min'], $siteCurrency);\n $select->where('shop_product.price >= ?', $price_min);\n }\n\n if (!empty($params['category'])) {\n $categories = implode(',', $params['category']);\n $select->where('shop_product.category_id IN (' . $categories . ')');\n }\n//<--end\n\n\n $select->where('shop_product_features.feature_value_id = ?', $value['id']);\n $select->where('shop_product_features.feature_id = ?', $feature_id);\n $select->where('shop_product.status = ?', 1);\n \n//<-- add sorting filters\n if (isset($params['sort'])) {\n switch ($params['sort']) {\n case 'shop_product.name':\n $select->order('shop_product.name');\n break;\n case 'price_asc':\n $select->order('shop_product.price');\n break;\n case 'price_desc':\n $select->order('shop_product.price DESC');\n break;\n case 'rating':\n $select->order('shop_product.rating DESC');\n break;\n case 'date':\n $select->order('shop_product.create_datetime DESC');\n break;\n default:\n break;\n }\n }\n//<--end\n \n if ($result = $product->fetchAll($select)) {\n $category = new Application_Model_DbTable_Categoryes();\n $products = new Application_Model_DbTable_Products();\n\n $newResult = [];\n $result = $result->toArray();\n foreach ($result as $key => $value) {\n $newResult[$key] = $value;\n $newResult[$key]['category_name'] = $category->getCategoryById($value['category_id'])['name'];\n\n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_product_skus');\n $select->where('shop_product_skus.product_id = ?', $value['id']);\n $skus = $product->fetchAll($select)->toArray();\n foreach ($skus as $sku) {\n $newResult[$key]['skus'][$sku['id']] = $sku;\n }\n }\n return $newResult;\n }\n }\n return FALSE;\n }",
"public function get_featured_products()\n\t{\n\t\t$this->db->select('*')->from('product')->where(\"product_status = 1 AND featured = 1\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}",
"public function getProductFeature($prd_id, $feat_id) {\n \n }",
"protected function getProductFeatures($product_features_data, $features)\n {\n $product_features = array();\n foreach ($product_features_data as $feature_id => $feature_data) {\n if (empty($features[$feature_id])) {\n continue;\n }\n\n $f = $features[$feature_id];\n\n if (in_array($this->options['price_id'], $f['yml2_exclude_prices'])) {\n continue;\n }\n\n $feature = array(\n 'description' => $f['description'],\n 'feature_id' => $f['feature_id'],\n 'yml2_unit' => trim($f['yml2_variants_unit'])\n );\n\n $feature['is_visible'] = ($f['display_on_catalog'] == \"Y\" || $f['display_on_product'] == \"Y\" || $f['display_on_header'] == 'Y');\n\n $ft = $f['feature_type'];\n\n if ($ft == \"C\") {\n $feature['value'] = ($feature_data['value'] == \"Y\") ? __(\"yes\") : __(\"no\");\n\n } elseif (($ft == \"S\" || $ft == \"N\" || $ft == \"E\") && !empty($feature_data['variant_id'])) {\n\n $variant = $f['variants'][$feature_data['variant_id']];\n $feature['value'] = $variant['variant'];\n\n if (!empty($variant['yml2_unit'])) {\n $feature['yml2_unit'] = trim($variant['yml2_unit']);\n }\n\n } elseif ($ft == \"T\" && !empty($feature_data['value'])) {\n $feature['value'] = $feature_data['value'];\n\n } elseif ($ft == \"M\") {\n if (!empty($f['variants'])) {\n $_value = '';\n $counter = count($f['variants']);\n foreach ($f['variants'] as $_variant) {\n\n if (!in_array($_variant['variant_id'], $feature_data['variant_ids'])) {\n continue;\n }\n\n if ($counter > 1) {\n $_value .= $_variant['variant'] . ', ';\n } else {\n $_value = $_variant['variant'];\n }\n }\n\n $feature['value'] = ($counter > 1) ? substr($_value, 0, -2) : $_value;\n }\n\n } elseif ($ft == \"O\") {\n $feature['value'] = $feature_data['value_int'];\n\n } elseif ($ft == 'D') {\n $feature['value'] = $this->formatDate((int) $feature_data['value_int']);\n }\n\n $product_features[] = $feature;\n }\n\n return $product_features;\n }",
"public function selectProductsFeatured()\n {\n $sql = \"SELECT * FROM \" . $this->getTableName(\"images\") . \" WHERE pro_id=? AND featured=\" . self::FEATURED_YES;\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"i\", $this->getProId());\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n return $this->fetch_assoc_all($result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the user can view the perspective. | public function view(User $user, Perspective $perspective)
{
return false;
} | [
"public function canView()\n\t{\n\t\t// Assert the object is loaded.\n\t\t$this->assertIsLoaded();\n\n\t\t// Check if an access level is set.\n\t\tif (isset($this->access))\n\t\t{\n\t\t\t// Get the user's authorised view levels.\n\t\t\t$levels = $this->user->getAuthorisedViewLevels();\n\n\t\t\t// Check if the user has access.\n\t\t\treturn in_array($this->access, $levels);\n\t\t}\n\n\t\treturn null;\n\t}",
"function isViewable()\n {\n \n if (sfContext::getInstance()->getUser()->hasCredential(\"viewallcontent\"))\n { \r\n \tsfContext::getInstance()->getLogger()->info(\"You have the fu, you can see me.\");\n \treturn true;\n } \n\n // Access to approved artork is for anyone\n if ($this->isApproved()) \n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is approved, so it is viewable\");\n \treturn true;\n }\n\n // Access to removed artwork is only for admin (returned true above)\n if ($this->isRemoved())\n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is removed, and cannot be seen\");\n \treturn false;\n }\n \n // also allow access to owner of artwork - unless they have removed it\n if (sfContext::getInstance()->getUser()->isAuthenticated()\n && $this->getUserId() == sfContext::getInstance()->getUser()->getGuardUser()->getId())\n {\n sfContext::getInstance()->getLogger()->info(\"You can see this artwork since you are the owner\");\n \treturn true;\n }\n\n sfContext::getInstance()->getLogger()->info(\"This artwork is not approved, and cannot be seen\");\n return false;\n }",
"public function user_has_access() {\n\t\treturn current_user_can( 'pvm_edit_projects' );\n\t}",
"function user_can_view($user)\r\n {\r\n // Make sure a user is loaded\r\n if (!$user->is_user_loaded()) return false;\r\n // Login the current user, and check capabilities\r\n if (!$user->login()) return false;\r\n return has_capability('mod/assignment:view', get_context_instance(CONTEXT_MODULE, $this->cm->id));\r\n }",
"function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"function canView()\n\t{\n\t\tif (!is_object($this->_access) || !array_key_exists('view', $this->_access)) {\n\t\t\t$groups = JFactory::getUser()->authorisedLevels();\n\t\t\t$this->_access->view = in_array($this->getTable()->access, $groups);\n\t\t}\n\t\treturn $this->_access->view;\n\t}",
"public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }",
"public function isViewable() {\n\t\treturn $this->publicly_queryable || ($this->public && $this->isBuiltin());\n\t}",
"public function isOwnerPerspective()\n {\n return $this->ownerPerspective;\n }",
"private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_COACH',\n 'ROLE_ASSISTANT',\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function canUserView()\n\t{\n\t\tfor($i = 0; $i < sizeof($this->_nonViewers); $i++)\n\t\t{\n\t\t\tif($this->_userRole == $this->_nonViewers[$i] && $this->layout != null)\n\t\t\t{\n\t\t\t\t$this->actionIndex();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"private function canShowManagePanel() {\n module_load_include('inc','islandora_xacml_api','Xacml');\n module_load_include('inc','islandora_xacml_api','XacmlException');\n global $user;\n\n if ($user->uid == 1 || in_array('administrator', $user->roles)) {\n $show = TRUE;\n }\n else {\n try {\n $xacml = Xacml::constructFromPid($this->pid);\n if($xacml->managementRule->isPopulated()) {\n $show = $xacml->managementRule->hasPermission($user->name, $user->roles);\n }\n else {\n $show = FALSE;\n }\n }\n catch (XacmlException $e) {\n $show = FALSE;\n }\n }\n\n $show &= user_access('purge objects and datastreams')\n || user_access('add fedora datastreams')\n || user_access('edit fedora meta data');\n\n return $show;\n }",
"public function isViewAllowed() {\n\t\treturn $this->mSettingInfo->config_is_allowed();\n\t}",
"public function viewAny()\n {\n return auth()->user()->can('permission_access');\n }",
"public function isViewed()\n {\n if (!\\Auth::user()) {\n $viewed = \\Session::get($this->get_view_key());\n if (!empty($viewed)) {\n return true;\n }\n } else {\n $user_action = $this->user_counters()\n ->where('action', 'view')\n ->where('class_name', snake_case(get_class($this)))\n ->where('object_id', $this->id)\n ->where('user_id', \\Auth::user()->id)->count();\n if ($user_action > 0) {\n return true;\n }\n }\n\n return false;\n }",
"public function canShow();",
"protected function userCanView($id) {\n\t\treturn true;\n\t}",
"static public function isUserHasSomeViewAccess()\n\t{\n\t\ttry{\n\t\t\tself::checkUserHasViewAccess( $idSites );\n\t\t\treturn true;\n\t\t} catch( Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isViewable(): bool\n {\n if (!class_exists($this->getController())) {\n $this->logger->debug($this->getController() . ' controller does not exist.');\n return false;\n }\n if (!method_exists($this->getController(), $this->getMethod())) {\n $this->logger->debug(\n $this->getController() . ':' .\n $this->getMethod() . ' controller method does not exist.'\n );\n return false;\n }\n /*\n * For archived and deleted nodes\n */\n if ($this->node->getStatus() > Node::PUBLISHED) {\n /*\n * Not allowed to see deleted and archived nodes\n * even for Admins\n */\n return false;\n }\n\n /*\n * For unpublished nodes\n */\n if ($this->node->getStatus() < Node::PUBLISHED) {\n if (true === $this->previewResolver->isPreview()) {\n return true;\n }\n /*\n * Not allowed to see unpublished nodes\n */\n return false;\n }\n\n /*\n * Everyone can view published nodes.\n */\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instant search documents for a given locale, query and a max number items | public function instant(string $locale, string $query, int $maxItems): array
{
try {
$results = $this->client->getIndex($this->getIndexName($locale))->search(
json_decode($this->getInstant($query), true), $maxItems
);
} catch (ReadFileException $exception) {
$results = [];
}
$searchResults = [];
foreach ($results as $result) {
$searchResults[] = $result->getModel();
}
return $searchResults;
} | [
"function &search( &$queryText, $sortMode=time, $fetchPublished=false, $offset=0, $limit=10, $params = array(), &$SearchTotalCount )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $queryText = $db->escapeString( $queryText );\r\n\r\n // Build the ORDER BY\r\n $OrderBy = \"eZArticle_ArticleWordLink.Frequency DESC\";\r\n switch( $sortMode )\r\n {\r\n case \"alpha\" :\r\n {\r\n $OrderBy = \"eZArticle_Article.Name DESC\";\r\n }\r\n break;\r\n }\r\n\r\n if ( $fetchPublished == true )\r\n {\r\n $fetchText = \"\";\r\n }\r\n else\r\n {\r\n $fetchText = \"AND eZArticle_Article.IsPublished = '1'\";\r\n }\r\n\r\n $usePermission = true;\r\n\r\n $user =& eZUser::currentUser();\r\n\r\n // Build the permission\r\n $loggedInSQL = \"\";\r\n $groupSQL = \"\";\r\n if ( $user )\r\n {\r\n $groups =& $user->groups( false );\r\n\r\n foreach ( $groups as $group )\r\n {\r\n $groupSQL .= \" ( Permission.GroupID='$group' AND CategoryPermission.GroupID='$group' ) OR\r\n ( Permission.GroupID='$group' AND CategoryPermission.GroupID='-1' ) OR\r\n ( Permission.GroupID='-1' AND CategoryPermission.GroupID='$group' ) OR\r\n \";\r\n }\r\n $currentUserID = $user->id();\r\n $loggedInSQL = \"eZArticle_Article.AuthorID=$currentUserID OR\";\r\n\r\n if ( $user->hasRootAccess() )\r\n $usePermission = false;\r\n }\r\n\r\n $loggedInSQL = \"( ( ( $groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' ) AND Permission.ReadPermission='1' AND CategoryPermission.ReadPermission='1' ) ) AND\";\r\n\r\n if ( $usePermission )\r\n $permissionSQL = $loggedInSQL;\r\n else\r\n $permissionSQL = \"\";\r\n\r\n // stop word frequency\r\n $ini =& INIFile::globalINI();\r\n $StopWordFrequency = $ini->read_var( \"eZArticleMain\", \"StopWordFrequency\" );\r\n\r\n\r\n $query = new eZQuery( \"eZArticle_Word.Word\", $queryText );\r\n $query->setIsLiteral( true );\r\n $query->setStopWordColumn( \"eZArticle_Word.Frequency\" );\r\n $query->setStopWordPercent( $StopWordFrequency );\r\n $searchSQL = $query->buildQuery();\r\n\r\n $authorSQL = \"\";\r\n $dateSQL = \"\";\r\n $catSQL = \"\";\r\n $typeTables = \"\";\r\n $typeSQL = \"\";\r\n $sectionsSQL = \"\";\r\n $photoSQL = \"\";\r\n $photoTables = \"\";\r\n\r\n if ( isSet( $params[\"FromDate\"] ) )\r\n {\r\n $fromdate = $params[\"FromDate\"];\r\n if( is_a( $fromdate, \"eZDateTime\" ) )\r\n $fromdate = $fromdate->timeStamp();\r\n $dateSQL .= \"AND eZArticle_Article.Published >= '$fromdate'\";\r\n }\r\n if ( isSet( $params[\"ToDate\"] ) )\r\n {\r\n $todate = $params[\"ToDate\"];\r\n if( is_a( $todate, \"eZDateTime\" ) )\r\n $todate = $todate->timeStamp();\r\n $dateSQL .= \"AND eZArticle_Article.Published <= '$todate'\";\r\n }\r\n if ( isSet( $params[\"Categories\"] ) )\r\n {\r\n $cats = $params[\"Categories\"];\r\n $sql = \"\";\r\n $i = 0;\r\n foreach( $cats as $cat )\r\n {\r\n if ( $i > 0 )\r\n $sql .= \"OR \";\r\n $sql .= \"Category.ID = '$cat' \";\r\n ++$i;\r\n }\r\n if ( count( $cats ) > 0 )\r\n {\r\n $catSQL = \"AND ( $sql ) AND Category.ID=eZArticle_ArticleCategoryLink.CategoryID\r\n AND eZArticle_Article.ID=eZArticle_ArticleCategoryLink.ArticleID\";\r\n }\r\n }\r\n if ( isSet( $params[\"Type\"] ) )\r\n {\r\n $type = $params[\"Type\"];\r\n $typeSQL = \"AND eZArticle_Attribute.TypeID='$type'\r\n AND eZArticle_Attribute.ID=eZArticle_AttributeValue.AttributeID\r\n AND eZArticle_AttributeValue.ArticleID=eZArticle_Article.ID\";\r\n $typeTables = \"eZArticle_Attribute, eZArticle_AttributeValue, \";\r\n }\r\n if ( isSet( $params[\"AuthorID\"] ) )\r\n {\r\n $author = $params[\"AuthorID\"];\r\n $authorSQL = \"AND eZArticle_Article.ContentsWriterID='$author'\";\r\n }\r\n\tif ( isSet( $params[\"SectionsList\"] ) )\r\n\t{\r\n\t $sectionsList = $params[\"SectionsList\"];\r\n\t $sectionsArray = explode( \",\", $sectionsList );\r\n\t if ( is_numeric( $sectionsArray[0] ) )\r\n\t {\r\n\t\t$sectionsSQL .= \"AND ( Category.SectionID='$sectionsArray[0]'\";\r\n\t\tfor ( $i=1; $i<count( $sectionsArray ); $i++ )\r\n\t {\r\n\t\t $sectionsSQL .= \" OR Category.SectionID='$sectionsArray[$i]'\";\r\n\t\t}\r\n\t\t$sectionsSQL .= \" ) \";\r\n }\r\n }\r\n if ( isSet( $params[\"PhotographerID\"] ) )\r\n {\r\n $photo = $params[\"PhotographerID\"];\r\n $photoSQL = \"AND eZImageCatalogue_Image.PhotographerID='$photo'\r\n AND eZImageCatalogue_Image.ID=eZArticle_ArticleImageLink.ImageID\r\n AND eZArticle_Article.ID=eZArticle_ArticleImageLink.ArticleID\";\r\n $photoTables = \"eZArticle_ArticleImageLink, eZImageCatalogue_Image,\";\r\n }\r\n\r\n\r\n if ( isset($params[\"SearchExcludedArticles\"]) && $params[\"SearchExcludedArticles\"] == \"true\" )\r\n $excludeFromSearchSQL = \" \";\r\n else\r\n $excludeFromSearchSQL = \" AND Category.ExcludeFromSearch = '0' \";\r\n\r\n // special search for MySQL, mimic subselects ;)\r\n if ( $db->isA() == \"mysql\" )\r\n {\r\n $queryArray = explode( \" \", trim( $queryText ) );\r\n\r\n $db->query( \"CREATE TEMPORARY TABLE eZArticle_SearchTemp( ArticleID int )\" );\r\n\r\n $count = 1;\r\n foreach ( $queryArray as $queryWord )\r\n {\r\n $queryWord = trim( $queryWord );\r\n\r\n $searchSQL = \" ( eZArticle_Word.Word = '$queryWord' AND eZArticle_Word.Frequency < '$StopWordFrequency' ) \";\r\n\r\n $queryString = \"INSERT INTO eZArticle_SearchTemp ( ArticleID ) SELECT DISTINCT eZArticle_Article.ID AS ArticleID\r\n FROM eZArticle_Article,\r\n eZArticle_ArticleWordLink,\r\n eZArticle_Word,\r\n eZArticle_ArticleCategoryLink as Link,\r\n $typeTables\r\n $photoTables\r\n eZArticle_ArticleCategoryDefinition as Definition,\r\n eZArticle_ArticlePermission as Permission,\r\n eZArticle_Category AS Category,\r\n eZArticle_CategoryPermission as CategoryPermission\r\n\r\n WHERE\r\n $permissionSQL\r\n $searchSQL\r\n $dateSQL\r\n $catSQL\r\n $typeSQL\r\n $authorSQL\r\n $photoSQL\r\n\t\t $sectionsSQL\r\n AND\r\n ( eZArticle_Article.ID=eZArticle_ArticleWordLink.ArticleID\r\n AND Definition.ArticleID=eZArticle_Article.ID\r\n AND Definition.CategoryID=Category.ID\r\n $excludeFromSearchSQL\r\n AND eZArticle_ArticleWordLink.WordID=eZArticle_Word.ID\r\n AND Permission.ObjectID=eZArticle_Article.ID\r\n AND CategoryPermission.ObjectID=Definition.CategoryID\r\n $fetchText\r\n AND Link.ArticleID=eZArticle_Article.ID\r\n )\r\n ORDER BY $OrderBy\";\r\n\r\n $db->query( $queryString );\r\n\r\n // check if this is a stop word\r\n $queryString = \"SELECT Frequency FROM eZArticle_Word WHERE Word='$queryWord'\";\r\n\r\n $db->query_single( $WordFreq, $queryString, array( \"LIMIT\" => 1 ) );\r\n\r\n if ( $WordFreq[\"Frequency\"] <= $StopWordFrequency )\r\n $count += 1;\r\n }\r\n $count -= 1;\r\n\r\n $queryString = \"SELECT ArticleID, Count(*) AS Count FROM eZArticle_SearchTemp GROUP BY ArticleID HAVING Count>='$count'\";\r\n\r\n $db->array_query( $article_array, $queryString );\r\n\r\n// $db->array_query( $article_array, $queryString, array( \"Limit\" => $limit, \"Offset\" => $offset ) );\r\n\r\n $db->query( \"DROP TABLE eZArticle_SearchTemp\" );\r\n\r\n $SearchTotalCount = count( $article_array );\r\n if ( $limit >= 0 )\r\n $article_array =& array_slice( $article_array, $offset, $limit );\r\n }\r\n else\r\n {\r\n $queryString = \"SELECT DISTINCT eZArticle_Article.ID AS ArticleID, eZArticle_Article.Published, eZArticle_Article.Name, eZArticle_ArticleWordLink.Frequency\r\n FROM eZArticle_Article,\r\n eZArticle_ArticleWordLink,\r\n eZArticle_Word,\r\n eZArticle_ArticleCategoryLink,\r\n $catDefTable\r\n $catTable\r\n $typeTables\r\n $photoTables\r\n eZArticle_ArticlePermission\r\n WHERE\r\n $searchSQL\r\n $dateSQL\r\n $catSQL\r\n $typeSQL\r\n $authorSQL\r\n $photoSQL\r\n AND\r\n ( eZArticle_Article.ID=eZArticle_ArticleWordLink.ArticleID\r\n AND eZArticle_ArticleCategoryDefinition.ArticleID=eZArticle_Article.ID\r\n AND eZArticle_ArticleCategoryDefinition.CategoryID=eZArticle_Category.ID\r\n $excludeFromSearchSQL\r\n AND eZArticle_ArticleWordLink.WordID=eZArticle_Word.ID\r\n AND eZArticle_ArticlePermission.ObjectID=eZArticle_Article.ID\r\n $fetchText\r\n AND eZArticle_ArticleCategoryLink.ArticleID=eZArticle_Article.ID AND\r\n ( $loggedInSQL ($groupSQL eZArticle_ArticlePermission.GroupID='-1')\r\n AND eZArticle_ArticlePermission.ReadPermission='1'\r\n )\r\n )\r\n ORDER BY $OrderBy\";\r\n\r\n $db->array_query( $article_array, $queryString );\r\n\r\n $SearchTotalCount = count( $article_array );\r\n $article_array =& array_slice( $article_array, $offset, $limit );\r\n }\r\n\r\n for ( $i = 0; $i < count($article_array); $i++ )\r\n {\r\n $return_array[$i] = new eZArticle( $article_array[$i][$db->fieldName( \"ArticleID\" )], false );\r\n }\r\n\r\n return $return_array;\r\n }",
"function my_avf_relevanssi_ajax_search( $post_count, $search_query, $search_parameters, $defaults )\n{\n\t//\tchange to e.g. 25\n\treturn 25;\n}",
"public function getLatestDocs($localeId, $folderIds, $limit);",
"public abstract function search_items(\\WP_REST_Request $request);",
"public function new_search_query();",
"function tripal_pub_PMID_search_init($search_str, $retmax){\n\n // do a search for a single result so that we can establish a history, and get\n // the number of records. Once we have the number of records we can retrieve\n // those requested in the range.\n $query_url = \"http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?\" .\n \"db=Pubmed\" .\n \"&retmax=$retmax\" .\n \"&usehistory=y\".\n \"&term=\" . urlencode($search_str);\n\n //dpm($query_url);\n $rfh = fopen($query_url, \"r\");\n if (!$rfh) {\n drupal_set_message('Could not perform Pubmed query. Cannot connect to Entrez.', 'error');\n tripal_report_error('tripal_pubmed', TRIPAL_ERROR, \"Could not perform Pubmed query. Cannot connect to Entrez.\",\n array());\n return 0;\n }\n\n // retrieve the XML results\n $query_xml = '';\n while (!feof($rfh)) {\n $query_xml .= fread($rfh, 255);\n }\n fclose($rfh);\n //dpm(\"<pre>$query_xml</pre>\");\n $xml = new XMLReader();\n $xml->xml($query_xml);\n\n // iterate though the child nodes of the <eSearchResult> tag and get the count, history and query_id\n $result = array();\n while ($xml->read()) {\n $element = $xml->name;\n\n if ($xml->nodeType == XMLReader::END_ELEMENT and $element == 'WebEnv') {\n // we've read as much as we need. If we go too much further our counts\n // will get messed up by other 'Count' elements. so we're done.\n break;\n }\n if ($xml->nodeType == XMLReader::ELEMENT) {\n\n switch ($element) {\n case 'Count':\n $xml->read();\n $result['Count'] = $xml->value;\n break;\n case 'WebEnv':\n $xml->read();\n $result['WebEnv'] = $xml->value;\n break;\n case 'QueryKey':\n $xml->read();\n $result['QueryKey'] = $xml->value;\n break;\n }\n }\n }\n return $result;\n}",
"function search($term, $ll, $location) \n{\n $url_params = array();\n \n $url_params[\"term\"] = $term;\n if ($ll)\n {\n $url_params[\"ll\"] = $ll;\n }\n else\n {\n $url_params[\"location\"] = $location;\n }\n \n $url_params[\"limit\"] = $GLOBALS[\"SEARCH_LIMIT\"];\n $search_path = $GLOBALS[\"SEARCH_PATH\"] . \"?\" . http_build_query($url_params);\n \n return request($GLOBALS[\"API_HOST\"], $search_path);\n}",
"function ch_search($query)\n{\n\n\treturn ch_get(\"method=cooperhewitt.search.collection&query=$query\");\n\n}",
"public function testLimitDefaultSearch()\n {\n $client = new Elastica_Client();\n $search = new Elastica_Search($client);\n\n $index = $client->getIndex('zero');\n $index->create(array('index' => array('number_of_shards' => 1, 'number_of_replicas' => 0)), true);\n\n $docs = array();\n $docs[] = new Elastica_Document(1, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(2, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(3, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(4, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(5, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(6, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(7, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(8, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(9, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(10, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $docs[] = new Elastica_Document(11, array('id' => 1, 'email' => 'test@test.com', 'username' => 'farrelley'));\n $type = $index->getType('zeroType');\n $type->addDocuments($docs);\n $index->refresh();\n\n $search->addIndex($index)->addType($type);\n\n // default limit results (default limit is 10)\n $resultSet = $search->search('farrelley');\n $this->assertEquals(10, $resultSet->count());\n\n // limit = 1\n $resultSet = $search->search('farrelley', 1);\n $this->assertEquals(1, $resultSet->count());\n }",
"public function fetchSearchResults($input) {\n \n $inputArray = explode(\" \", $input);\n\n // these settings are for the custom LengthAwarePaginator\n $currentPage = LengthAwarePaginator::resolveCurrentPage();\n $perPage = 30;\n\n $results = [];\n $pinyinResults = [];\n $translationResults = [];\n $actualResults = [];\n\n // Actual results, items that match exactly\n foreach ($inputArray as $inputItem) {\n\n $actualResults = \\App\\Character::where('char', $inputItem)\n ->orWhere('pinyin', $inputItem)\n ->orWhere('radical', $inputItem)\n ->orWhere('pinyin_normalised', $inputItem)->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($actualResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // pinyin and char results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n \n $pinyinResults = \\App\\Character::where('char', 'like', '%' . $inputItem .'%')\n ->orWhere('pinyin', 'like', '%' . $inputItem .'%')\n ->orWhere('radical', 'like', '%' . $inputItem .'%')\n ->orWhere('pinyin_normalised', 'like', '%' . $inputItem .'%')->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($pinyinResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // translation and heisig results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n\n $translationResults = \\App\\Character::where('heisig_keyword', 'like', '%' . $inputItem .'%')\n ->orWhere('translations', 'like', '%' . $inputItem .'%')\n ->orWhere('heisig_number', 'like', '%' . $inputItem .'%')->get();\n\n // for each result in the above collections, add to results array\n foreach($translationResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n \n // return the results array as a paginatior\n $results = collect($results);\n $results = new LengthAwarePaginator($results->forPage($currentPage, $perPage), $results->count(), $perPage, $currentPage, ['path' => \"/search/$input\"]);\n return $results;\n }",
"function\t\t\t\t// O - Array of document objects\ndocument_search($search = \"\",\t\t// I - Search text\n $order = \"-modify_date\",// I - Order of objects\n $workgroup_id = -1,\t// I - Which workgroup to limit to\n $min_status = DOCUMENT_STATUS_OBSOLETE,\n $max_status = DOCUMENT_STATUS_FULL_STANDARD)\n \t\t\t// I - Min and max status\n{\n global $DOCUMENT_COLUMNS;\n\n if ($min_status != DOCUMENT_STATUS_OBSOLETE || $max_status != DOCUMENT_STATUS_FULL_STANDARD)\n {\n $keyvals = array(\"status>=\" => $min_status, \"status<=\" => $max_status);\n if ($workgroup_id >= 0)\n $keyvals[\"workgroup_id\"] = $workgroup_id;\n }\n else if ($workgroup_id >= 0)\n $keyvals = array(\"workgroup_id\" => $workgroup_id);\n else\n $keyvals = null;\n\n return (db_search(\"document\", $DOCUMENT_COLUMNS, $keyvals, $search, $order));\n}",
"function hw_getobjectbyquerycoll($link, $collid, $query, $maxhits) {}",
"function smarty_function_search($params, &$smarty) {\n global $db;\n\n $newsPage = createPath( PAGE_NEWS );\n $albumPage = createPath( PAGE_GALLERY );\n $lng = getLangInitial();\n $server = 'http://'.$_SERVER['SERVER_NAME'];\n $maxitems = isset( $params['maxitems'] )\n ? intval( $params['maxitems'] )\n : 10;\n $pager = null;\n $list = null;\n\n // search string, passed via $_GET for tracking reasons (can be logged in Google Analytics)\n $needle = strtolower( addslashes( strip_tags( $_GET['q'] ) ) );\n\n if ( isset($needle)\n && $needle != ''\n && $needle != 'cerca nel sito'\n ){\n\n // search on news, pages, album. You can add here all the relevant queries\n // don't forget to declare the 'type'!\n $qry = <<<ENDOFQUERY\n\n( SELECT n.id, t1.{$lng} AS title, t2.{$lng} AS text, 'news' AS type\n FROM news n\n LEFT JOIN aa_translation t1 ON n.title=t1.id\n LEFT JOIN aa_translation t2 ON n.text=t2.id\n WHERE ((LOWER(t1.{$lng}) LIKE '%{$needle}%') OR (LOWER(t2.{$lng}) LIKE '%{$needle}%'))\n\n) UNION (\n\n SELECT a.id, t1.{$lng} AS title, t2.{$lng} AS text, 'page' AS type\n FROM aa_page a\n LEFT JOIN aa_translation t1 ON a.title=t1.id\n LEFT JOIN aa_translation t2 ON a.text=t2.id\n WHERE a.visible=1\n AND ((LOWER(t1.{$lng}) LIKE '%{$needle}%') OR (LOWER(t2.{$lng}) LIKE '%{$needle}%'))\n\n) UNION (\n\n SELECT a.id, a.title, NULL AS text, 'album' AS type\n FROM album a\n WHERE (LOWER(a.title) LIKE '%{$needle}%')\n\n) ORDER BY title\n\nENDOFQUERY;\n // echo $qry;\n\n $pgr = new synPagerPublic($db, '', '', '', true);\n $pgr->current_template = '<li class=\"active\"><a>%s <span class=\"sr-only\">(current)</span></a></li>';\n $pgr->link_template = '<li><a href=\"%s\">%s</a></li>';\n\n $res = $pgr->Execute($qry, $maxitems, \"q={$needle}\");\n $tot = $pgr->rs->maxRecordCount();\n\n while ( $arr = $res->FetchRow() ) {\n // build the url of the item, based on its type\n switch ($arr['type']){\n case 'news':\n $path = $newsPage . createItemPath( $arr['title'], $arr['id'] );\n break;\n case 'album':\n $path = $albumPage . createItemPath( $arr['title'], $arr['id'] );\n break;\n // add types as needed\n default:\n $path = createPath( $arr['id'] );\n break;\n }\n\n // list item\n if ( !empty($arr['text']) ) {\n $abstract = strip_tags( $arr['text'] );\n if ( stripos($abstract, $needle) !== FALSE ) {\n $abstract = str_ireplace($needle, \"<mark>{$needle}</mark>\", $abstract );\n }\n $abstract = excerpt( $abstract, $needle, 500 ); // see misc.functions.php\n }\n\n $list[] = array(\n 'title' => $arr['title'],\n 'abstract' => $abstract,\n 'url' => $path,\n 'permalink' => $server.$path,\n 'type' => $arr['tipo']\n );\n }\n\n if ( $pgr->rs->LastPageNo()>1 )\n $pager = $pgr->pagerArrList();\n\n $smarty->assign('needle', $needle);\n $smarty->assign('found', $tot);\n $smarty->assign('items', $list);\n $smarty->assign('pagination', $pager);\n\n } else return;\n}",
"function build_search_results_interface($results, $start, $max, $direction, $general_search = false)\n{\n require_code('content');\n\n $out = new Tempcode();\n $i = 0;\n $tabular_results = array();\n foreach ($results as $result) {\n if (array_key_exists('restricted', $result)) {\n continue; // This has been blanked out due to insufficient access permissions or some other reason\n }\n\n $content_type = convert_composr_type_codes('search_hook', $result['type'], 'content_type');\n $id = mixed();\n if ($content_type != '') {\n require_code('content');\n $cma_ob = get_content_object($content_type);\n $cma_info = $cma_ob->info();\n $id = extract_content_str_id_from_data($result['data'], $cma_info);\n }\n\n if (($i >= $start) && ($i < $start + $max)) {\n if (array_key_exists('template', $result)) {\n $rendered_result = $result['template'];\n } else {\n $rendered_result = $result['object']->render($result['data']);\n }\n if (!is_null($rendered_result)) {\n if (is_array($rendered_result)) {\n $class = get_class($result['object']);\n if (!array_key_exists($class, $tabular_results)) {\n $tabular_results[$class] = array();\n }\n $tabular_results[$class][] = $rendered_result;\n } else {\n $out->attach(do_template('SEARCH_RESULT', array('_GUID' => '47da093f9ace87819e246f0cec1402a9', 'TYPE' => $content_type, 'ID' => $id, 'CONTENT' => $rendered_result)));\n }\n }\n } else {\n $out->attach(static_evaluate_tempcode(do_template('SEARCH_RESULT', array('_GUID' => 'd8422a971f55a8a94d090861d519ca7a', 'TYPE' => $content_type, 'ID' => $id))));\n }\n $i++;\n }\n foreach ($tabular_results as $tabular_type => $types_results) {\n // Normalisation process\n $ultimate_field_map = array();\n foreach ($types_results as $r) {\n $ultimate_field_map += $r;\n }\n $ultimate_field_map = array_keys($ultimate_field_map);\n foreach ($types_results as $i => $r) {\n $r2d2 = array();\n foreach ($ultimate_field_map as $key) {\n if (!array_key_exists($key, $r)) {\n $r[$key] = '';\n }\n $r2d2[$key] = $r[$key];\n }\n $r = $r2d2;\n $types_results[$i] = array('R' => $r);\n }\n\n // Output\n $out->attach(do_template('SEARCH_RESULT_TABLE', array('_GUID' => '816ec14dc0df432ca6e1e1014ef1f3d1', 'HEADERS' => $ultimate_field_map, 'ROWS' => $types_results)));\n }\n\n set_extra_request_metadata(array(\n 'opensearch_totalresults' => strval($i),\n 'opensearch_startindex' => strval($start),\n 'opensearch_itemsperpage' => strval($max),\n ));\n\n $SEARCH__CONTENT_BITS = null;\n\n return $out;\n}",
"function myprefix_search_posts_per_page($query) {\n if ( $query->is_search ) {\n $post_count = $_GET['posts_per_page'];\n $query->set( 'posts_per_page', $post_count );\n }\n return $query;\n}",
"function getMaxResultsPerCollection();",
"function find_institution($searchstring)\r\n{\r\n\tif ( !isset($searchstring) )\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t$offset=0;\r\n\t$cl = new SphinxClient ();\r\n\t$sql = \"\";\r\n\r\n\t$host = \"localhost\";\r\n\t$port = 9312;\r\n\t$index = \"institutions\"; // \"*\" for all\r\n\t$groupby = \"\";\r\n\t$groupsort = \"@name\";\r\n\t$filtervals = array();\r\n\t$distinct = \"\";\r\n\t$sortby = \"\";\r\n\t$sortexpr = \"\";\r\n\r\n\t$limit = 100;\r\n\t$ranker = SPH_RANK_PROXIMITY_BM25;\r\n\t$select = \"\";\r\n\t$mode = SPH_MATCH_EXTENDED2;\r\n\r\n\t$cl->SetServer ( $host, $port );\r\n\t$cl->SetConnectTimeout ( 2 );\r\n\t$cl->SetArrayResult ( true );\r\n\t$cl->SetWeights ( array ( 100, 1 ) );\r\n\t$cl->SetMatchMode ( $mode );\r\n\tif ( count($filtervals) )\t$cl->SetFilter ( $filter, $filtervals );\r\n\tif ( $groupby )\t\t\t\t$cl->SetGroupBy ( $groupby, SPH_GROUPBY_ATTR, $groupsort );\r\n\tif ( $sortby )\t\t\t\t$cl->SetSortMode ( SPH_SORT_EXTENDED, $sortby );\r\n\tif ( $sortexpr )\t\t\t$cl->SetSortMode ( SPH_SORT_EXPR, $sortexpr );\r\n\tif ( $distinct )\t\t\t$cl->SetGroupDistinct ( $distinct );\r\n\tif ( $select )\t\t\t\t$cl->SetSelect ( $select );\r\n\tif ( $limit )\t\t\t\t$cl->SetLimits ( $offset, $limit, ( $limit>1000 ) ? $limit : 1000 );\r\n\t$cl->SetRankingMode ( $ranker );\r\n\tif(strlen($searchstring)>=2) $searchstring = '*'.$searchstring.'*';\r\n\t$res = $cl->Query ( $searchstring, $index );\r\n\r\n\tif ( $res===false )\r\n\t{\r\n\t\treturn false;\r\n\t} \r\n\telse\r\n\t{\r\n\r\n\t\tif ( is_array($res[\"matches\"]) )\r\n\t\t{\r\n\t\t\t$n = 1;\r\n\t\t\t$institution_ids=array();\r\n\t\t\tforeach ( $res[\"matches\"] as $docinfo )\r\n\t\t\t{\r\n\t\t\t\tif($docinfo[weight]>1900)\r\n\t\t\t\t{\r\n\t\t\t\t\t$institution_ids[] = $docinfo[id];\r\n\t\t\t\t}\r\n\t\t\t\t$n++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $institution_ids;\r\n}",
"function pd_search_posts_per_page($query) {\n if ( $query->is_search ) {\n $query->set( 'posts_per_page', '25' );\n }\n return $query;\n}",
"function gambitMoreResults(&$search, $term, $negate)\r\n{\r\n\tglobal $config;\r\n\tif (!$negate) $search->limit($config[\"moreResults\"]);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add carbon copy recipients to the email | function addCC($cc)
{
//If the carbon copy recipient is an aray, add each recipient... otherwise just add the one
if (isset ($cc))
{
if (is_array($cc)) {
foreach ($cc as $to) {
$to = JMailHelper::cleanLine( $to );
parent::AddCC($to);
}
} else {
$cc = JMailHelper::cleanLine( $cc );
parent::AddCC($cc);
}
}
} | [
"public function getCopyRecipients(): array;",
"protected function sendCarbonCopyToCandidate()\n {\n if ($this->application->getAttributes()->getSendCarbonCopy()) {\n $this->mailService->get(\n 'Applications/CarbonCopy',\n [\n 'application' => $this->application\n ],\n /*send*/\n true\n );\n }\n }",
"public function addRecipientsBcc($recipients = array());",
"function getCcRecipients();",
"public function sendCc()\n\t{\n\t\t$this->objMessage->setCc($this->compileRecipients(func_get_args()));\n\t}",
"public function setCc(array $recipients): IMessage;",
"private function addRecipients(): void\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Collection $recipients */\n $recipients = $this->message->recipients;\n\n $to = $this->getRecipients(MessageParticipantTypes::TO, $recipients);\n\n /** @var \\App\\Components\\Messages\\Models\\MessageRecipient $recipient */\n foreach ($to as $recipient) {\n $this->to($recipient->address, $recipient->name);\n }\n\n $cc = $this->getRecipients(MessageParticipantTypes::CC, $recipients);\n if (!empty($cc)) {\n foreach ($cc as $recipient) {\n $this->cc($recipient->address, $recipient->name);\n }\n }\n\n $bcc = $this->getRecipients(MessageParticipantTypes::BCC, $recipients);\n if (!empty($bcc)) {\n foreach ($bcc as $recipient) {\n $this->bcc($recipient->address, $recipient->name);\n }\n }\n }",
"function add_destination_mail($destination, $mail) {\n $list = explode(\",\", $destination);\n foreach($list as $email) {\n $mail->AddAddress($email);\n }\n}",
"function addRecipients( $recipients ) {\r\n $recipients_list = explode(',', $recipients);\r\n foreach ($recipients_list as $recipient) {\r\n $this->mail->addAddress($recipient);\r\n }\r\n $this->recipients .= $recipients . ',';\r\n }",
"public function to(Collection $recipients): self;",
"public function getBccRecipientEmails()\n {\n return StringUtil::compileRecipients($this->objLanguage->email_recipient_bcc, $this->arrTokens);\n }",
"function addRecipientToEmailList($gapps, $html, $recipientAddress,\n $emailList)\n{\n if ($html) {echo \"<h2>Subscribe Recipient</h2>\\n\";}\n\n $gapps->addRecipientToEmailList($recipientAddress, $emailList);\n\n if ($html) {echo \"<p>Done.</p>\\n\";}\n}",
"public function clearRecipientsCc();",
"function sendToAdditional()\r\n\t{\r\n\t\tif(!$item->recipients)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\tif($item->hasField(\"additional_recipients\") && $item->additional_recipients)\r\n\t\t{\r\n\t\t\t$addl_recipients = explode(\",\", $item->additional_recipients);\r\n\t\t\t$addl_recipients = array_unique($addl_recipients);\r\n\t\t\t$addl_recipients = array_diff($addl_recipients, $recipients);\r\n\t\t\tif(!count($addl_recipients))\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t$recipients = $addl_recipients;\r\n\t\t\t$this->excludes = $recipients;\r\n\t\t\t$this->addl_recipients = $recipients;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->responses = $this->generateResponses($recipients);\r\n\t\t\r\n\t\t$this->setExcludes();\r\n\t\t\r\n\t\tif(!count($this->responses))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$rtn = $this->sendEmails();\r\n\t\t\r\n\t\t$this->moveAdditionalToRecipientList();\r\n\t\t\r\n\t\treturn $rtn;\r\n\t}",
"public function register_recipients($p)\n {\n $rcmail = rcmail::get_instance();\n \n if (!$rcmail->config->get('use_auto_collect', true)) {\n return;\n }\n \n $headers = $p['headers'];\n\n $all_recipients = array_merge(\n rcube_mime::decode_address_list($headers['To'], null, true, $headers['charset']),\n rcube_mime::decode_address_list($headers['Cc'], null, true, $headers['charset']),\n rcube_mime::decode_address_list($headers['Bcc'], null, true, $headers['charset'])\n );\n\n require_once dirname(__FILE__) . '/autocollect_address_backend.php';\n $CONTACTS = new autocollect_address_backend($rcmail->db, $rcmail->user->ID);\n \n foreach ($all_recipients as $recipient) {\n // Bcc and Cc can be empty\n if ($recipient['mailto'] != '') {\n $contact = array(\n 'email' => $recipient['mailto'],\n 'name' => $recipient['name']\n );\n\n // use email address part for name\n if (empty($contact['name']) || $contact['name'] == $contact['email']) {\n $contact['name'] = ucfirst(preg_replace('/[\\.\\-]/', ' ',\n substr($contact['email'], 0, strpos($contact['email'], '@'))));\n }\n\n /* We only want to add the contact to the collected contacts\n * address book if it is not already in an addressbook, so we\n * first lookup in every address source.\n */\n $book_types = (array)$rcmail->config->get('autocomplete_addressbooks', 'sql');\n $address_book_identifier = $rcmail->config->get('default_addressbook', 0);\n\n foreach ($book_types as $id) {\n $abook = $rcmail->get_address_book($id);\n $previous_entries = $abook->search('email', $contact['email'], false, false);\n \n if ($previous_entries->count) {\n break;\n }\n }\n if (!$previous_entries->count) {\n $plugin = $rcmail->plugins->exec_hook('contact_create', array('record' => $contact,\n 'source' => $address_book_identifier));\n if (!$plugin['abort']) {\n $CONTACTS->insert($contact, false);\n }\n }\n }\n }\n }",
"private function sendCopy() {\r\n $data = $this->_contactform->getValues();\r\n\r\n $viewParam = array(\r\n 'domain' => $_SERVER['SERVER_NAME'],\r\n 'email' => $data['contactform_email'],\r\n 'subject' => $data['contactform_subject'],\r\n 'message' => nl2br(htmlentities($data['contactform_message']))\r\n );\r\n\r\n $mail = new Portfolio_HtmlTemplateMailer();\r\n $mail->setSubject($data['contactform_subject'])\r\n ->addTo($data['contactform_email'], $data['contactform_name'])\r\n ->setViewParam($viewParam)\r\n ->sendHtmlTemplate('contact_copy.phtml');\r\n }",
"public function addCc($email);",
"public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }",
"public function getEmailCopyTo()\n {\n $data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());\n if (! empty($data)) {\n return explode(',', $data);\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if there is any bonus to award to previous Game | function checkAndAwardBonus($gameRound)
{
$thisGameNumber = $gameRound->game->number;
$allGames = $gameRound->game->match->games;
// Find previous Game
$previousGame = $allGames->firstWhere('number', ($thisGameNumber - 1));
if ($previousGame) {
$gameRoundsForPlayer = $previousGame->gameRounds->where('player_id', $gameRound->player_id);
$gameRoundsForPlayer->each(function(&$item) use ($gameRound) {
if ($item->type == 1) {
// "Spare"
if ($gameRound->number == 1) {
// Award score for this roll
$item->score += $gameRound->score;
$item->award_count += 1;
$item->save();
}
} else if ($item->type == 2) {
// "Strike"
if ($gameRound->number <= 2) {
// Award score for these roll's and keep track of times awarded
$item->score += $gameRound->score;
if ($gameRound->type != 4) $item->award_count += 1;
$item->save();
}
}
});
// Will keep tack of times awarded, if you roll a "Strike", you will need to check previous, previous game (since strike is a singel roll).
// Find previous, previous Game
$previousPreviousGame = $allGames->firstWhere('number', ($previousGame->number - 1));
if ($previousPreviousGame) {
$gameRoundsForPlayer = $previousPreviousGame->gameRounds->where('player_id', $gameRound->player_id);
$gameRoundsForPlayer->each(function(&$item) use ($gameRound, $previousGame) {
if ($item->type == 2) {
// "Strike"
if ($gameRound->number == 1) {
if ($item->award_count < 2) {
// Award score for this roll
$item->score += $gameRound->score;
$item->award_count += 1;
$item->save();
}
}
}
});
}
}
} | [
"private function eligibleForReward(): bool {\n return TRUE;\n }",
"public function checkRewardAmount() {\n\n\t\t$config = SiteConfig::current_site_config();\n\n\t\tif ($this->owner->RewardAmount >= $config->RewardThreshold && $config->RewardThreshold > 0) {\n\t\t\t//work out how many rewards they got for this order\n\t\t\t$noRewards = floor($this->owner->RewardAmount / $config->RewardThreshold);\n\t\t\t//remove the amount which got used for the reward\n\t\t\t$this->owner->RewardAmount = $this->owner->RewardAmount - ($config->RewardThreshold * $noRewards);\n\n\t\t\t$this->giveReward($noRewards);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function validEnoughRewardPointsForGifts(){\r\n $quote = Mage::getSingleton('gri_sales/quote');\r\n return $quote->validEnoughRewardPointsForGifts();\r\n }",
"public function canAddRewardPoints()\n\t{\n\t\t$exist = $this->getHistory()->isExistHistoryUpdate(\n\t\t\t$this->getReward()->getCustomerId(),$this->getAction(),$this->getReward()->getWebsiteId(),$this->getEntity()->getId()\n\t\t);\n\t\t$exceeded = $this->isRewardLimitExceeded();\n\t\treturn !$exist && !$exceeded;\n\t}",
"public function canAddRewardPoints()\n {\n return true;\n }",
"private function exit_user_from_game() {\n //increments the user account_balance, since the amount was already deducted at game start\n $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) + {$this->amount} WHERE user_id = '{$this->userID}'\");\n\n /*This gets the user current game details*/\n $this->userCurrentGameDetail = $this->fetch_data_from_table($this->games_table_name, 'game_id', $this->user_details[\"game_id_about_to_play\"])[0];\n\n /* Gets the number of players in the game */\n $number_of_players = (int)$this->userCurrentGameDetail[\"number_of_players\"];\n\n /* the new number of players will now be the previous number of players - 1*/\n $new_number_of_players = $number_of_players - 1;\n /* if the new number of players is equal to 0; meaning that he is the only one about to play; the entire game details will be deleted from the database*/\n if($new_number_of_players == 0){ $this->delete_record($this->games_table_name , \"game_id\" , $this->user_details[\"game_id_about_to_play\"] ); return true;}\n /* else set the new number of players to the one above */\n $this->update_record($this->games_table_name , \"number_of_players\" , $new_number_of_players , 'game_id' , $this->userCurrentGameDetail[\"game_id\"]);\n /* delete the game id from the user detail to avoid deduction from the when the game starts */\n $this->update_record($this->users_table_name , \"game_id_about_to_play\" , \"0\" , 'user_id' , $this->userID);\n /* finally return true */\n return true;\n }",
"public function addUserReward(){\n $state = false;\n $query = 'UPDATE `users` SET `experience` = (`experience` + (SELECT `reward` FROM `rewards` WHERE `id` = :rewardID)) WHERE `id` = :id';\n $result = Database::getInstance()->prepare($query);\n $result->bindValue(':id', $this->id, PDO::PARAM_INT);\n $result->bindValue(':rewardID', $this->rewardID, PDO::PARAM_INT);\n if ($result->execute()) { \n $state = true;\n }\n return $state;\n }",
"private static function doesUserHaveBonusHit() {\n $key = self::getBonusHitKey();\n try {\n //memcache_value_delete returns null on success and throws on failure. Didn't see that coming, did you?\n return $key && null === Api::memcache_value_delete(MEMCACHE_TYPE_ADS, $key);\n }\n catch (\\Exception $ex) {\n // Usually this is because we tried to delete a non-existant key, but in\n // any event, we don't really care. We're not going to report this\n // error and we don't have a way to log a failure.\n return false;\n }\n }",
"public function hasBonusCandyCaptureReward()\n {\n return $this->bonus_candy_capture_reward !== null;\n }",
"public function hasBonus()\n {\n return $this->bonus !== null;\n }",
"function mmrpg_game_players_unlocked(){\n // Check if this battle has been completed and return true is it was\n $session_token = mmrpg_game_token();\n return isset($_SESSION[$session_token]['values']['battle_rewards']) ? count($_SESSION[$session_token]['values']['battle_rewards']) : 0;\n}",
"private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }",
"public function isEnoughPoints()\n\t{\n\t\t$baseGrandTotal = $this->getQuote()->getBaseGrandTotal()+$this->getQuote()->getBaseRewardCurrencyAmount();\n\t\treturn $this->getReward()->isEnoughPointsToCoverAmount($baseGrandTotal);\n\t}",
"private function hasEnoughNonGiveaways()\n {\n return $this->getCartNonGiveawayProductsAmounts() >= $this->getNonGiveawaysPerCart();\n }",
"public function checkForGameWinner()\n\t{\n\t\t$x = 1;\n\t\tforeach($this->players as $player) {\n\t\t\tif (count($player->getHand()) <= 0) {\n\t\t\t\t$this->gameWinner = $x;\t\t\n\t\t\t}\n\t\t\t$x++;\n\t\t}\t\t\n\t}",
"public function unit_has_award()\n {\n return true;\n }",
"private function hasTheAdvantage()\n {\n return $this->hasEnoughPointsToBeWon() && $this->isLeadingByOne();\n }",
"public function isEnoughPoints()\n\t{\n\t\t$baseGrandTotal = df_quote()->getBaseGrandTotal() + df_quote()->getBaseRewardCurrencyAmount();\n\t\treturn $this->getReward()->isEnoughPointsToCoverAmount($baseGrandTotal);\n\t}",
"public function hasBonusCount()\n {\n return $this->bonus_count !== null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a script tag, which will be run at a later point in time. | public function addScript( $code, $extra='' )
{
if ( $this->laterScripts === null ) {
$this->laterScripts = array(
'<script ' . $extra . '>' . $code . '</script>'
);
} else {
array_push( $this->laterScripts,
'<script ' . $extra . '>' . $code . '</script>'
);
}
} | [
"public function addJavaScript($script)\n {\n array_push($this->_headscripts, \"<script type='text/javascript'><!-- \\n\" . $script . \"\\n --></script>\");\n }",
"public function attachScript(string $script): void {\n $this->scripts[] = $script;\n }",
"protected function addScript($script, $index = false) {\n\t\t\t$this->_template->addScript($script, $index);\n\t\t}",
"public function enqueueScript()\n {\n $this->scripts[] = $this->buildAsset('script');\n }",
"function script_() {\r\n d('</script>');\r\n}",
"function add_extra_script ($script_path) {\n\tglobal $extra_scripts;\n\n\tif (!isset($extra_scripts)) $extra_scripts = '';\n\t$extra_scripts .= sprintf (\"<script type='text/javascript' src='%s'>\"\n\t\t\t\t .\"</script>\\n\",\n\t\t\t\t fix_target ($script_path));\n}",
"static function scriptTag($url) {\n\t\treturn '<script type=\"text/javascript\" language=\"javascript\" src=\"' .\n\t\t\t$url . '\"></script>';\t\n\t}",
"public function addJsScript($script)\n {\n $this->elements['script']['javascript']['scripts'][] = $script;\n }",
"function set_footer_script($entry) {\n\t\t\t$this->footer_script .= $entry;\n\t\t}",
"protected function addCallbackToScript()\n {\n $this->update([\n 'script' => view('scripts.tools.callback', [\n 'task' => $this,\n 'path' => str_replace('.sh', '-script.sh', $this->scriptFile()),\n 'token' => str_random(20),\n ])->render(),\n ]);\n }",
"function addScript($sJS)\n\t{\n\t\t$this->xml .= $this->_cmdXML(array(\"n\"=>\"js\"),$sJS);\n\t}",
"public function tagScript($value) {\r\n return '<script src=\"' . $value . '\"></script>';\r\n }",
"function add($script, $attributes = array('type' => 'text/javascript')) {\n \n\t if(preg_match('/^(http|https)\\:\\/\\//i', $script)) {\n\t $url = $script;\n\t } else {\n\t \n \t\t// get path helper\n \t\t$path = $this->getHelper('path');\n $url = $path->url($script);\n\t\t\t\n\t\t\tif(empty($url)) $url = $script;\n\t\t}\n\t\t\n\t\t// add script url\n\t\t$this->_scripts[$url] = $attributes;\n\t}",
"static function add_script($attr){\n\t\t# Allow string arguments, defining source.\n\t\tif (is_string($attr)){\n\t\t\t$new = array();\n\t\t\t$new['src'] = $attr;\n\t\t\t$attr = $new;\n\t\t}\n\n\t\tif (!isset($attr['src'])){\n\t\t\tthrow new ArgumentException('add_script expects argument array to contain key \"src\"');\n\t\t}\n\t\t$default = array(\n\t\t\t'name' => self::generate_name($attr['src'], '.js'),\n\t\t\t'admin' => False,\n\t\t);\n\t\t$attr = array_merge($default, $attr);\n\n\t\t$is_admin = (is_admin() or is_login());\n\n\t\tif (\n\t\t\t($attr['admin'] and $is_admin) or\n\t\t\t(!$attr['admin'] and !$is_admin)\n\t\t){\n\t\t\t# Override previously defined scripts\n\t\t\twp_deregister_script($attr['name']);\n\t\t\twp_enqueue_script($attr['name'], $attr['src'], null, null, True);\n\t\t}\n\t}",
"public function addScript (string $scriptName) : void {\n\t\tif (!in_array ($scriptName, $this->_scripts)) {\n\t\t\t$this->_scripts [] = $scriptName;\n\t\t}\n\t}",
"public static function js_script($script){\n\t\treturn '<script>' . $script . '</script>';\n\t}",
"function enqueueScriptTags($scripttag)\n{\n $this->scripttags [] = $scripttag;\n}",
"private function add_script_data( $data ) {\n\t\t$script_data = wp_scripts()->get_data( $this->handle, 'data' ) ?: '';\n\t\t$js = sprintf(\n\t\t\t'var %s = %s;',\n\t\t\tpreg_replace( '[^\\w\\d_-]', '', $this->args['global'] ), // Ensure only a-zA-Z0-9_- are allowed.\n\t\t\twp_json_encode( $data )\n\t\t);\n\t\twp_scripts()->add_data( $this->handle, 'data', trim( \"$script_data\\n$js\" ) );\n\t}",
"public function addScript($script, $index = false) {\n\t\t\tif ($index) {\n\t\t\t\t$this->_scripts[$index] = $script;\n\t\t\t} else {\n\t\t\t\t$this->_scripts[] = $script;\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get BrandName value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getBrandName()
{
return isset($this->BrandName) ? $this->BrandName : null;
} | [
"public function getBrandName()\n {\n return isset($this->brandName) ? $this->brandName : null;\n }",
"public function getBrandName() { return $this->brandName; }",
"public function getBrand_name () {\n\t$preValue = $this->preGetValue(\"brand_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->brand_name;\n\treturn $data;\n}",
"public function getBrandName()\n {\n return $this->_fields['BrandName']['FieldValue'];\n }",
"function getBrandName() {\n\t\treturn $this->getData('brandName');\n\t}",
"public function getBrandName()\n {\n return $this->brandName;\n }",
"public function getBrand()\n {\n return isset($this->Brand) ? $this->Brand : null;\n }",
"public function get_brand()\n {\n return $this->brand;\n }",
"public function getProd_brand()\n {\n return $this->prod_brand;\n }",
"public function getBrandLabel() {\n return$this->configuration['brand_label'];\n }",
"private function getBrand() : string\n {\n return $this->brand ?? '';\n }",
"public function getBrand()\r\n {\r\n return $this->brand;\r\n }",
"public function brand()\n {\n return $this->brand;\n }",
"public function getProductBrand()\n {\n return isset($this->product_brand) ? $this->product_brand : '';\n }",
"public function getBrand()\n {\n return $this->brand;\n }",
"public function getBrand(): string {\n return $this->brand;\n }",
"public function getProductBrandUnwrapped()\n {\n return $this->readWrapperValue(\"product_brand\");\n }",
"public function getBrand()\n\t{\n\t\treturn $this->brand;\n\t}",
"function getBrand() {\n return $this->brand;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! Moves this item down one step in the order list, this means that it will swap place with the item below. | function moveDown()
{
$db =& eZDB::globalDatabase();
$db->query_single( $qry, "SELECT ID, ListOrder FROM eZAddress_AddressType
WHERE Removed=0 AND ListOrder>'$this->ListOrder' ORDER BY ListOrder ASC LIMIT 1" );
$listorder = $qry["ListOrder"];
$listid = $qry["ID"];
$db->query( "UPDATE eZAddress_AddressType SET ListOrder='$listorder' WHERE ID='$this->ID'" );
$db->query( "UPDATE eZAddress_AddressType SET ListOrder='$this->ListOrder' WHERE ID='$listid'" );
} | [
"function moveItemDown()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$next =& $li->next_sibling();\n\t\t$next_copy = $next->clone_node(true);\n\t\t$next_copy =& $li->insert_before($next_copy, $li);\n\t\t$next->unlink($next);\n\t}",
"public function moveDown()\n {\n // Moves previous lower ranked item above\n $curOrder = $this->order;\n if ($curOrder == 0) return; // This is already the lowest item, so cancel\n if ($prevItem = Group::where('order', '<', $curOrder)->first())\n {\n $this->order = $prevItem->order;\n $prevItem->order = $curOrder;\n $prevItem->save();\n $this->save();\n }\n }",
"function moveItemUp()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$prev =& $li->previous_sibling();\n\t\t$li_copy = $li->clone_node(true);\n\t\t$li_copy =& $prev->insert_before($li_copy, $prev);\n\t\t$li->unlink($li);\n\t}",
"public function moveUp()\n {\n $this->reorder(-1);\n }",
"function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}",
"function moveUp()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $qry, \"SELECT ID, Placement FROM eZLink_Attribute\r\n WHERE Placement<'$this->Placement' ORDER BY Placement DESC\",\r\n array( \"Limit\" => 1 ) );\r\n $listorder = $qry[ $db->fieldName( \"Placement\" ) ];\r\n $listid = $qry[ $db->fieldName( \"ID\" ) ];\r\n $db->begin();\r\n $db->lock( \"eZLink_Attribute\" );\r\n $res[] = $db->query( \"UPDATE eZLink_Attribute SET Placement='$listorder' WHERE ID='$this->ID'\" );\r\n $res[] = $db->query( \"UPDATE eZLink_Attribute SET Placement='$this->Placement' WHERE ID='$listid'\" );\r\n $db->unlock();\r\n\r\n if ( in_array( false, $res ) )\r\n $db->rollback();\r\n else\r\n $db->commit();\r\n }",
"function moveUp()\n {\n \n $db =& eZDB::globalDatabase();\n $db->query_single( $qry, \"SELECT ID, ListOrder FROM eZAddress_AddressType\n WHERE Removed=0 AND ListOrder<'$this->ListOrder' ORDER BY ListOrder DESC\", array( \"Limit\" => \"1\" ) );\n $listorder = $qry[ $db->fieldName( \"ListOrder\" ) ];\n $listid = $qry[ $db->fieldName( \"ID\" ) ];\n\n $db->begin();\n $res[] = $db->query( \"UPDATE eZAddress_AddressType SET ListOrder='$listorder' WHERE ID='$this->ID'\" );\n $res[] = $db->query( \"UPDATE eZAddress_AddressType SET ListOrder='$this->ListOrder' WHERE ID='$listid'\" );\n eZDB::finish( $res, $db );\n }",
"function moveUp()\n {\n $db =& eZDB::globalDatabase();\n $db->query_single( $qry, \"SELECT ID, ListOrder FROM eZAddress_PhoneType\n WHERE Removed=0 AND ListOrder<'$this->ListOrder' ORDER BY ListOrder DESC\", array( \"Limit\" => \"1\" ) );\n $listorder = $qry[$db->fieldName(\"ListOrder\")];\n $listid = $qry[$db->fieldName(\"ID\")];\n\n $db->begin();\n $res[] = $db->query( \"UPDATE eZAddress_PhoneType SET ListOrder='$listorder' WHERE ID='$this->ID'\" );\n $res[] = $db->query( \"UPDATE eZAddress_PhoneType SET ListOrder='$this->ListOrder' WHERE ID='$listid'\" );\n eZDB::finish( $res, $db );\n }",
"function order_swapdown() {\n global $DB;\n\n //Get the question that is below this one.\n $questionLater = $DB->get_record_select('evaluation_standard_question',\n 'question_order = ' . ($this->order + 1) . ' AND department = \\'' . $this->dept . '\\'');\n\n //If there is none then we can't swap this one with the one below it so \n //exit.\n if ($questionLater == null) {\n return;\n }\n\n //Make this question show up one step later.\n $updated_question = new stdClass();\n $updated_question->id = $this->id;\n $updated_question->question_order = $this->order + 1;\n\n $DB->update_record('evaluation_standard_question', $updated_question);\n\n //Make this question show up one step earlier.\n $updated_question = new stdClass();\n $updated_question->id = $questionLater->id;\n $updated_question->question_order = $this->order;\n\n $DB->update_record('evaluation_standard_question', $updated_question);\n\n //update the order of this question.\n $this->order--;\n }",
"function move_item_down($item_PK) {\n // make sure we're not trying to move the \"Home\" item\n if (isset($this->home_mode)) {\n if ($item_PK == 1) {\n $editable = 0;\n } else {\n $editable = 1; \n }\n } else {\n $editable = 1; \n }\n // make sure item is not already at the bottom\n if (!$this->_is_item_at_bottom($item_PK) && $editable == 1) {\n // get position and parent of item\n $thisPosition = $this->_get_position($item_PK);\n $thisParent = $this->_get_parent($item_PK);\n // get next item\n $this->db->where($this->parent_field, $thisParent);\n $this->db->where(\"{$this->order_field} >\", $thisPosition);\n if (isset($this->condition_field)) {\n\t\t\t $this->db->where($this->condition_field, '1'); \n }\n $this->db->order_by($this->order_field, \"asc\");\n $query = $this->db->get($this->table, 1);\n $result = $query->row_array();\n $next_PK = $result[$this->PK_field];\n // move this item down\n $this->db->where($this->PK_field, $item_PK);\n $this->db->set($this->order_field, $thisPosition + 1);\n $this->db->update($this->table);\n // move next item up\n $this->db->where($this->PK_field, $next_PK);\n $this->db->set($this->order_field, $thisPosition);\n $this->db->update($this->table); \n // set status message\n $this->session->set_flashdata('message','Item moved down');\n } \n }",
"public function move_up($item_id);",
"public function moveHigher() {\n\t\t$position = $this->_position_col();\n\t\t$prev \t = $this->prevItem();\n\t\t$prev->{$position} = $this->{$position};\n\t\t$this->{$position} = $this->{$position} - 1;\n\t\t$prev->save();\n\t\t$this->save();\n\t}",
"function order_swapup() {\n global $DB;\n\n //Get the question that is above this one.\n $questionPrior = $DB->get_record_select('evaluation_standard_question',\n 'question_order = ' . ($this->order - 1) . ' AND department = \\'' . $this->dept . '\\'');\n\n //If there is none then we can't swap this one with the one above it so \n //exit.\n if ($questionPrior == null) {\n return;\n }\n\n //Make this question show up one step earlier.\n $updated_question = new stdClass();\n $updated_question->id = $this->id;\n $updated_question->question_order = $this->order - 1;\n\n $DB->update_record('evaluation_standard_question', $updated_question);\n\n //Make the previous question show up one step later.\n $updated_question = new stdClass();\n $updated_question->id = $questionPrior->id;\n $updated_question->question_order = $this->order;\n\n $DB->update_record('evaluation_standard_question', $updated_question);\n\n //update the order of this question.\n $this->order--;\n }",
"function videoresource_item_move_down($item) {\n return move_item($item, 'down');\n}",
"public function orderdown()\n\t{\n\t\t$this->reorder($dir = 1);\n\t}",
"public function orderup()\n\t{\n\t\treturn $this->reorder(-1);\n\t}",
"public function sorterMoveUp() {\r\n\t\t$this->sorterMove(true);\r\n\t}",
"public function sorterMoveDown() {\r\n\t\t$this->sorterMove(false);\r\n\t}",
"function videoresource_item_move_up($item) {\n return move_item($item, 'up');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing _fcpoCheckSepaAgreed for debitnote payment | public function test__fcpoCheckSepaAgreed_Debitnote()
{
$aMockData = array(
'fcpo_payolution_debitnote_sepa_agreed' => 'agreed',
);
$oTestObject = oxNew('fcPayOnePaymentView');
$oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock();
$oHelper->expects($this->any())->method('fcpoGetRequestParameter')->will($this->returnValue($aMockData));
$this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper);
$this->assertEquals(true, $oTestObject->_fcpoCheckSepaAgreed('fcpopo_debitnote'));
} | [
"public function testAcceptPaymentDispute()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testRequestSepaDirectDebit()\r\n {\r\n }",
"public function testVoucherMarkAsPaid()\n {\n }",
"public function testContestPaymentDispute()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function isSepaDirectDebitPossible();",
"public function paymentCheck(){\n\t\treturn true;\n\t}",
"public function isPaid();",
"public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }",
"public function isPaid()\n {\n }",
"public function testInvoiceGetIsPartiallyPaid()\n {\n }",
"public function confirmPayment(): bool;",
"public function is_payment_need_credit_check($is_fraud = false);",
"function hasPayment(): bool;",
"public function isPaid(): bool;",
"public function isPayment();",
"public function testV1userexchangebankfiatdepositverified()\n {\n\n }",
"public function testTransferLoyaltyCard()\n {\n }",
"public function canReviewPayment()\n {\n }",
"function isPaymentPending(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes meta based on meta ID. | public function delete_meta( &$object, $meta ) {
delete_metadata_by_mid( $this->meta_type, $meta->id );
} | [
"public function delete_meta( $post_id ) {\n\t\ttry {\n\t\t\t$indexable = $this->get_indexable( $post_id, false );\n\t\t\t$indexable->delete_meta();\n\t\t\t$indexable->delete();\n\t\t} catch ( No_Indexable_Found $exception ) {\n\t\t\treturn;\n\t\t}\n\t}",
"public function delete_meta( $item_id, $meta_key, $meta_value = '' );",
"protected function delete_meta( $post_id ) {\n\t\tWPSEO_Meta::delete( self::META_NAME, $post_id );\n\t}",
"public static function removeFromID($metaid){\n\t\t$sql = new SqlManager();\n\t\t$delete = array(\"id\" => $id);\n\t\t$sql->delete(\"meta\", $delete);\n\t}",
"public function deleteSingleMeta($seo_id, $meta_name)\n {\n global $db;\n $sql = \"DELETE FROM \" . TABLE_META_DATA . \" WHERE seo_id = :seo_id AND meta_name = :meta_name\";\n $sql = $db->bindVars($sql, \":seo_id\", $seo_id, 'integer');\n $sql = $db->bindVars($sql, \":meta_name\", $meta_name, 'string');\n $db->Execute($sql);\n }",
"private function sl_delete_metadata_by_mid($meta_id){\n\n\t\tif (!$result_delete = delete_metadata_by_mid( 'post', $meta_id )){\n\n \t\tsl_debbug('## Error. Deleting item with meta_id '.$meta_id, 'mediameta');\n\t\t\t\n\t\t}\n\n\t}",
"public function deletePostMeta() {\n delete_post_meta($this->id, $this->_post_meta_name);\n }",
"private function delete_post_meta($meta_key)\n {\n }",
"public function delete_meta( &$object, $meta ) {\n\t}",
"protected function deleteMeta()\n {\n $sql = sprintf(\n 'DELETE FROM %sfaqattachment WHERE id = %d',\n PMF_Db::getTablePrefix(),\n $this->id\n );\n\n $this->db->query($sql);\n }",
"function delete_movie_meta( $id, $key ) {\r\n global $wpdb;\r\n\r\n $id = intval($id);\r\n $key = $wpdb->escape($key);\r\n\r\n return $wpdb->query(\"\r\n\tDELETE FROM\r\n {$wpdb->prefix}now_watching_meta\r\n\tWHERE\r\n\t\tm_movie = '$id'\r\n\t\tAND\r\n\t\tm_key = '$key'\r\n \");\r\n}",
"public function delete_meta() {\n\t\treturn Updraft_Task_Meta::bulk_delete_task_meta($this->id);\n\t}",
"public function deleteMeta($post_id, $key)\n {\n global $wpdb;\n $wpdb->query(\n $wpdb->prepare(\n \"DELETE FROM $wpdb->postmeta\n WHERE post_id = %d AND meta_key LIKE %s\", $post_id, $key.\"%\"\n )\n );\n\n }",
"function payswarm_database_remove_old_metadata($post_id, $meta_id, $meta_key) {\n global $wpdb;\n\n // delete the post identifier\n $wpdb->query($wpdb->prepare(\n 'DELETE FROM ' . $wpdb->postmeta . ' ' .\n 'WHERE post_id=%s AND meta_id<%s AND meta_key=%s',\n $post_id, $meta_id, $meta_key));\n}",
"function delete_post_meta($post_id, $meta_key, $meta_value = '')\n {\n }",
"public function deleteMeta($key, $value = ''){\n unset($this->meta[ $key ]);\n unset($this->meta[ $key . '_arr' ]);\n\n return self::deletePostMeta($this->getId(), $key, $value);\n }",
"function delete_site_meta_by_key($meta_key)\n{\n}",
"function clpr_delete_store_meta( $store_id, $meta_key, $meta_value = '' ) {\n\treturn delete_metadata( APP_TAX_STORE, $store_id, $meta_key, $meta_value );\n}",
"function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = \\false)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark a single thread as read using its ID. | public function markThreadRead($id)
{
$this->patch('/notifications/threads/'.$id);
} | [
"function mark_thread_read($tid, $fid)\n{\n\tglobal $mybb, $db;\n\n\t// Can only do \"true\" tracking for registered users\n\tif($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])\n\t{\n\t\t// For registered users, store the information in the database.\n\t\tswitch($db->type)\n\t\t{\n\t\t\tcase \"pgsql\":\n\t\t\tcase \"sqlite\":\n\t\t\t\t$db->replace_query(\"threadsread\", array('tid' => $tid, 'uid' => $mybb->user['uid'], 'dateline' => TIME_NOW), array(\"tid\", \"uid\"));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$db->write_query(\"\n\t\t\t\t\tREPLACE INTO \".TABLE_PREFIX.\"threadsread (tid, uid, dateline)\n\t\t\t\t\tVALUES('$tid', '{$mybb->user['uid']}', '\".TIME_NOW.\"')\n\t\t\t\t\");\n\t\t}\n\t}\n\t// Default back to cookie marking\n\telse\n\t{\n\t\tmy_set_array_cookie(\"threadread\", $tid, TIME_NOW, -1);\n\t}\n\n\t$unread_count = fetch_unread_count($fid);\n\tif($unread_count == 0)\n\t{\n\t\tmark_forum_read($fid);\n\t}\n}",
"function mark_entry_read()\n\t{\n\t\tglobal $entry;\n\t\t$id=$_REQUEST['id'];\n\t\tif(!$id){print \"No id entered\\n\";return;}\n\t\t$entry->markRead($id);\n\t\tprint \"Marked Read\\n\";\n\t}",
"public function xmlhttpMarkThread()\n {\n global $db, $mybb, $lang;\n\n if (!$mybb->user['uid'] > 0 || $mybb->input['action'] != 'unreadPosts_markThread' || !isset($mybb->input['tid']))\n {\n return;\n }\n \n $thread = get_thread($mybb->input['tid']);\n if ($thread)\n {\n require_once MYBB_ROOT.\"inc/functions_indicators.php\";\n mark_thread_read($thread['tid'], $thread['fid'], TIME_NOW);\n }\n }",
"public function markRead() {\n\t\t$this->status = 'read';\n\t}",
"public function testMarkRead()\r\n\t{\r\n\t\t$email = CAntObject::factory($this->dbh, \"email_message\", null, $this->user);\r\n\t\t$email->setGroup(\"Inbox\");\r\n\t\t$email->setHeader(\"Subject\", \"Test Message\");\r\n\t\t$email->setHeader(\"From\", \"sky.stebnicki@aereus.com\");\r\n\t\t$email->setHeader(\"To\", \"foo@bar.com\");\r\n\t\t$email->setBody(\"my test email\");\r\n\t\t$email->setValue(\"flag_seen\", 'f');\r\n\t\t$mid = $email->save();\r\n\t\t$this->assertTrue($mid > 0);\r\n\t\t$threadId = $email->getValue(\"thread\");\r\n\r\n\t\t// Open thread and remove\r\n\t\t$thread = CAntObject::factory($this->dbh, \"email_thread\", $threadId, $this->user);\r\n\t\t$this->assertEquals($thread->getValue('f_seen'), 'f'); // Make sure thread was created inheritiing the flag of the email\r\n\t\t$thread->markRead();\r\n\t\tunset($thread);\r\n\r\n\t\t// Reopen and test deleted status\r\n\t\t$email = CAntObject::factory($this->dbh, \"email_message\", $mid, $this->user);\r\n\t\t$this->assertEquals($email->getValue(\"flag_seen\"), 't');\r\n\r\n\t\t$thread = CAntObject::factory($this->dbh, \"email_thread\", $email->getValue(\"thread\"), $this->user);\r\n\t\t$this->assertEquals($thread->getValue(\"f_seen\"), 't');\r\n\t\t\r\n\t\t// Cleanup\r\n\t\t$thread->removeHard();\r\n\t}",
"public static function setRead($uid, $tid)\n\t{\n $openTask = Hapyfish2_Alchemy_HFC_TaskOpen::getInfo($uid);\n $rst = Hapyfish2_Alchemy_Cache_TaskStatus::update($uid, $openTask['list'], $tid);\n return 1;\n\t}",
"static function saveAsRead(&$thread) {\n $inbox = &$thread->MsgInbox;\n if ($inbox && $inbox->isUnread()) { \n $post = $thread->getLastPost();\n if ($post) \n $inbox->postId = $post->postId;\n $inbox->isRead = static::IS_READ;\n $inbox->save();\n }\n }",
"public function threadOfId(ThreadId $id);",
"public function markAsRead()\n {\n $this->status = self::STATUS_READ;\n $this->save();\n }",
"public static function mark_as_read($id = 0)\n {\n $id = \\DB::escape($id);\n return \\DB::query(\"UPDATE `messages` SET `has_read` = '1' WHERE id = $id\")->as_object()->execute();\n }",
"function markReceivedAsRead($uid, $id)\r\n {\r\n $uid = $this->dbh->sql_safe($uid);\r\n $id = $this->dbh->sql_safe($id);\r\n \r\n $sql = 'UPDATE private_message '\r\n . \"SET pm_status = 'Read' \"\r\n . 'WHERE pm_receiver_id = ' . $uid . ' '\r\n . 'AND pm_id = ' . $id . ' '\r\n . \"AND pm_type = 'Received'\";\r\n \r\n $this->dbh->execute($sql);\r\n \r\n return;\r\n }",
"function markAsRead($messageid) {\n // Log in to actual database \n if (!$this->dbLogin()) {\n $this->handleError(\"Login to database failed.\"); \n return false;\n }\n // update status to read\n $query = \"UPDATE $this->tablename3 SET status = 'read'\" . \n \" WHERE messageid = $messageid\";\n \n if (!mysql_query($query, $this->connection)) {\n $this->handleErrors(\"Mark as read failed.\");\n return false; \n }\n return true;\n }",
"public function lock_read() { $this->reader_writer->read_request(); }",
"protected function _markRead()\n\t{\n\t\t$blog_id\t= intval( $this->request['blogid'] );\n\t\t$blog\t\t= $this->DB->buildAndFetch( array ( 'select' => 'blog_id, blog_seo_name', 'from' => 'blog_blogs', 'where' => \"blog_id={$blog_id}\" ) );\n\n\t\tif ( !$blog['blog_id'] )\n\t\t{\n\t\t\t$this->registry->output->showError( 'incorrect_use', 10643, null, null, 404 );\n\t\t}\n\t\t\n\t\t$this->registry->classItemMarking->markRead( array( 'blogID' => $blog_id ) );\n\t\t\n\t\tif ( isset( $this->request['return'] ) AND $this->request['return'] == 'blog' )\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=blog&module=display&section=blog&blogid=' . $blog['blog_id'], $blog['blog_seo_name'], false, 'showblog' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=blog', 'false', false, 'app=blog' );\n\t\t}\n\t}",
"function MarkAsRead($id, $streamId, $auth) {\n\n // Get the token in order to make an \"edit\" call to the api\n $response = httpPost(\"http://www.google.com/reader/api/0/token\", array(), $auth, false);\n \n // Token usually has a // as a prefix, lose that\n // (TODO) use a more elegant way ;)\n $token = explode(\"//\", $response);\n $token = trim($token[1]);\n \n $request = array( \n \"a\" => \"user/-/state/com.google/read\",\n \"async\" => true,\n \"s\" => $streamId,\n \"i\" => $id,\n \"T\" => $token \n );\n\n $response = httpPost(\"http://www.google.com/reader/api/0/edit-tag?client=-\", $request, $auth, true);\n \n return (trim($response) == \"OK\");\n}",
"public function toggleReadAt()\n {\n $this->unread() ? $this->markAsRead() : $this->markAsUnread();\n }",
"public function setThreadID($value)\n {\n return $this->set('ThreadID', $value);\n }",
"public function read(Thread $thread)\n {\n cache()->forever($this->visitedThreadCacheKey($thread), \\Carbon\\Carbon::now());\n }",
"private function setThreadId( $id )\n\t{\n\t\t\n\t\tif( !empty( $id ) )\n\t\t{\t\t\t\n\t\t\tif( $id > 0 )\n\t\t\t{\n\t\t\t\tif( is_numeric( $id ) )\n\t\t\t\t\t$this->thread_data['id'] = $this->thread_id = $id;\n\t\t\t\telse\n\t\t\t\t\theader('Location: ' . BASE_URL . DS . '?page=forum');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->thread_id = $this->newThread();\n\t\t}\n\t\telse\n\t\t\t$this->thread_id = $this->newThread();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get minor league fielding stats | function get_mil_fielding_stats($player_id) {
global $db;
$query = 'SELECT f.player_id,
f.year,
f.year - YEAR(p.date_of_birth) AS age,
f.team_id,
f.league_id,
l.abbr as league,
f.level_id,
f.split_id,
po.pos_name,
f.tc,
f.a,
f.po,
f.er,
f.ip,
f.g,
f.gs,
f.e,
f.dp,
f.tp,
f.pb,
f.sba,
f.rto,
f.ipf,
f.plays,
f.plays_base,
f.roe,
f.opps_0,
f.opps_made_0,
f.opps_1,
f.opps_made_1,
f.opps_2,
f.opps_made_2,
f.opps_3,
f.opps_made_3,
f.opps_4,
f.opps_made_4,
f.opps_5,
f.opps_made_5,
f.zr,
concat(p.first_name," ",p.last_name) AS player
, t.name as city
, t.nickname
, t.abbr
FROM players_career_fielding_stats f INNER JOIN players p ON
f.player_id = p.player_id
INNER JOIN teams t ON f.team_id = t.team_id
INNER JOIN positions po ON f.position = po.position
INNER JOIN leagues l ON b.league_id = l.league_id
WHERE f.level_id <> 1 AND f.player_id = :player_id
ORDER BY f.year, f.level_id, t.abbr, po.pos_name';
$statement = $db->prepare($query);
$statement->bindValue(':player_id', $player_id);
$statement->execute();
$mil_fielding_stats = $statement->fetchAll();
$statement->closeCursor();
return $mil_fielding_stats;
} | [
"function get_ml_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON f.league_id = l.league_id\n WHERE f.level_id = 1 AND f.player_id = :player_id\n ORDER BY f.year, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $ml_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $ml_fielding_stats;\n}",
"public function getYoungestTeam(){\n \tif($this->_apc && apc_exists($this->apc_webkot_young_team)){\n \t\treturn apc_fetch($this->apc_webkot_young_team);\n \t}else{\n\t \ttry{\n\t\t \t$sql = \"SELECT W.id as id, W.name as name, W.firstname as firstname, W.nickname as nickname, T.age as age, W.mail as mail, T.function as function, T.pathimg as img, T.studies as studies,W.userid as userid, W.valuetolike as valuetolike, T.place as place FROM webkot_team_member T, webkot_webkotteur W WHERE (T.webkotteurid = W.id) and (T.year = (select max(year) from webkot_team_member)) order by T.place\";\n\t\t \t$stmt = $this->_db->prepare($sql);\n\t\t $stmt->execute();\n\t\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t $error = $stmt->errorInfo();\n\t\t\t throw new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir l'equipe la plus recente\");\n\t\t\t }\n\t\t\t\t$team = array();\n\t\t\t\twhile ($data = $stmt->fetch(PDO::FETCH_ASSOC)){ \n\t\t \t$team[] = new Webkotteur($data);\n\t\t } \n\t\t if($this->_apc){\n\t\t \tapc_store($this->apc_webkot_young_team, $team, 175000);\n\t\t }\n\t\t return $team;\t\n\t \t}catch(PDOException $e){\n\t \tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir l'equipe la plus recente\");\n\t }\n \t}\n }",
"function phpdenora_maxstats()\n{\n\tglobal $denora_maxvalues; $vals = array(); $data = array();\n\t$q = sql_query(\"SELECT * FROM \".$denora_maxvalues.\";\");\n\twhile ($r = sql_fetch_array($q)) {\n\t\t$vals[$r[0]] = array($r[1],$r[2]);\n\t}\n\t$data['value'] = array($vals['users'][0], $vals['channels'][0], $vals['opers'][0], $vals['servers'][0]);\n\t$data['time'] = array(strtotime($vals['users'][1]), strtotime($vals['channels'][1]), strtotime($vals['opers'][1]), strtotime($vals['servers'][1]));\n\treturn $data;\n}",
"function xstats_displayMaxValueListMisc($gameId) {\n echo( \"<H3>Spitzenwerte im Spiel</H3>\");\n $statsAvailablePlayerIndicies = xstats_getAvailablePlayerIndicies($gameId);\n $statsMaxTurn = xstats_getMaxTurn($gameId);\n echo( xstats_displayMaxSum( $gameId, 'coloniestakencount', $statsMaxTurn, $statsAvailablePlayerIndicies ) );\n echo( xstats_displayMaxValue( $gameId, 'planetcount') );\n echo( xstats_displayMaxValue( $gameId, 'colonistcount') );\n echo( xstats_displayMaxValue( $gameId, 'cantoxcount') );\n echo( xstats_displayMaxValue( $gameId, 'lemincount') );\n echo( xstats_displayMaxValue( $gameId, 'factorycount') );\n echo( xstats_displayMaxValue( $gameId, 'minescount') );\n xstats_displayMaxWaitTime( $gameId );\n}",
"function get_player_ml_batting_stats($player_id) {\n global $db;\n $query = 'SELECT b.player_id\n , b.year\n , b.year - YEAR(p.date_of_birth) AS age\n , b.team_id\n , b.level_id\n , b.league_id\n , l.abbr as league\n , b.g\n , b.ab\n , b.PA\n , b.r\n , b.h\n , b.d\n , b.t\n , b.hr\n , b.rbi\n , b.sb\n , b.cs\n , b.bb\n , b.k\n , b.ibb\n , b.hp\n , b.sh\n , b.sf\n , b.gdp\n , b.ci\n , b.war\n , b.ba\n , b.krate\n , b.bbrate\n , b.obp\n , b.OBPplus\n , b.woba\n , b.slg\n , b.ops\n , b.iso\n , b.babip\n , b.wRAA\n , b.wRC\n , b.`wRC+`\n , concat(p.first_name,\" \", p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM CalcBatting b INNER JOIN players p ON b.player_id = p.player_id\n INNER JOIN teams t ON b.team_id = t.team_id\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE b.level_id = 1 AND b.player_id = :player_id\n ORDER BY b.year';\n $statement = $db->prepare($query);\n $statement->bindValue('player_id', $player_id);\n $statement->execute();\n $ml_batting_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $ml_batting_stats;\n}",
"function get_player_penalty_stats($season){\n\tglobal $db;\n\t$sql = 'SELECT DISTINCT p.playerMasterRef,\n\t\t\t\tSUM(IF(pn.teamRef = p.teamRef AND pn.playerRef = p.jerseyNo, pn.duration, 0)) AS minutes,\n\t\t\t\tSUM(IF(pn.teamRef = p.teamRef AND pn.playerRef = p.jerseyNo, 1, 0)) AS penalties\n\t\t\tFROM games gm\n\t\t\tINNER JOIN players p\n\t\t\t\tON (gm.themTeamRef = p.teamRef OR gm.usTeamRef = p.teamRef)\n\t\t\tINNER JOIN playerMaster pm\n\t\t\t\tON p.playerMasterRef = pm.reference\n\t\t\tINNER JOIN teams t\n\t\t\t\tON p.teamRef = t.teamRef\n\t\t\tLEFT JOIN penalties pn\n\t\t\t\tON gm.gameRef = pn.gameRef\n\t\t\tWHERE gm.season = \"' . $season . '\"\n\t\t\t\tAND gm.final != \"F\"\n\t\t\tGROUP BY p.reference\n\t\t\tORDER BY p.reference';\n\t$r = $db->db_query($sql);\n\treturn $r;\n}",
"function get_top_gb($season){\n\tglobal $db;\n\t$sql = 'SELECT pm.reference, pm.FName, pm.LName, t.town,\n\t\t\t\tSUM(pl.gbQ1 + pl.gbQ2 + pl.gbQ3 + pl.gbQ4 + pl.gbOT) AS statistic\n\t\t\tFROM games gm\n\t\t\tINNER JOIN players p\n\t\t\t\tON (gm.themTeamRef = p.teamRef OR gm.usTeamRef = p.teamRef)\n\t\t\tINNER JOIN playerMaster pm\n\t\t\t\tON p.playerMasterRef = pm.reference\n\t\t\tINNER JOIN teams t\n\t\t\t\tON p.teamRef = t.teamRef\n\t\t\tINNER JOIN plays pl\n\t\t\t\tON gm.gameRef = pl.gameRef\n\t\t\t\tAND p.teamRef = pl.teamRef\n\t\t\t\tAND p.jerseyNo = pl.playerRef\n\t\t\tWHERE gm.season = \"' . $season . '\"\n\t\t\t\tAND gm.final != \"F\"\n\t\t\tGROUP BY p.playerMasterRef\n\t\t\tORDER BY statistic DESC\n\t\t\tLIMIT 5';\n\t$r = $db->db_query($sql);\n\treturn $r;\n}",
"function get_field($game){\n if($game == '4GEWINNT'){\n return viergewinnt_getFieldArray(db_con('get', '4gewinnt_sorted')['results']);\n }else if($game == 'TICTACTOE'){\n return tictactoe_getFieldArray(db_con('get', 'tictactoe_sorted')['results']);\n }\n return null;\n}",
"function get_top_team_gb($season){\n\tglobal $db;\n\t$sql = 'SELECT t1.town, t1.teamRef, t2.town AS opponent,\n\t\t\t\tgm.date, gm.gameRef, gm.usTeamRef,\n\t\t\t\tSUM(pl.gbQ1 + pl.gbQ2 + pl.gbQ3 + pl.gbQ4 + pl.gbOT) AS statistic\n\t\t\tFROM plays pl\n \t\t\tINNER JOIN teams t1\n \t\t\t\tON pl.teamRef = t1.teamRef\n \t\t\tINNER JOIN games gm\n \t\t\t\tON pl.gameRef = gm.gameRef\n \t\t\tINNER JOIN teams t2\n \t\t\t\tON (gm.themTeamRef = t2.teamRef OR gm.usTeamRef = t2.teamRef)\n \t\t\t\tAND t1.teamRef != t2.teamRef\n\t\t\tWHERE gm.season = \"' . $season . '\"\n\t\t\t\tAND gm.final != \"F\"\n\t\t\tGROUP BY pl.gameRef, pl.teamRef\n\t\t\tORDER BY statistic DESC, gm.date DESC\n\t\t\tLIMIT 10';\n\t$r = $db->db_query($sql);\n\treturn $r;\n}",
"function get_player_mil_batting_stats($player_id) {\n global $db;\n $query = 'SELECT b.player_id\n , b.year\n , b.year - YEAR(p.date_of_birth) AS age\n , b.team_id\n , b.level_id\n , b.league_id\n , l.abbr as league\n , b.g\n , b.ab\n , b.PA\n , b.r\n , b.h\n , b.d\n , b.t\n , b.hr\n , b.rbi\n , b.sb\n , b.cs\n , b.bb\n , b.k\n , b.ibb\n , b.hp\n , b.sh\n , b.sf\n , b.gdp\n , b.ci\n , b.war\n , b.ba\n , b.krate\n , b.bbrate\n , b.obp\n , b.OBPplus\n , b.woba\n , b.slg\n , b.ops\n , b.iso\n , b.babip\n , b.wRAA\n , b.wRC\n , b.`wRC+`\n , concat(p.first_name,\" \", p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM CalcBatting b INNER JOIN players p ON b.player_id = p.player_id\n INNER JOIN teams t ON b.team_id = t.team_id\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE b.level_id <> 1 AND b.player_id = :player_id\n ORDER BY b.year';\n $statement = $db->prepare($query);\n $statement->bindValue('player_id', $player_id);\n $statement->execute();\n $mil_batting_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $mil_batting_stats;\n}",
"public function getStatsFields(): array {}",
"function get_split_penalty_stats($playerRef, $select_param, $group_param, $sort_param){\n\tglobal $db;\n\t$sql = 'SELECT\n\t\t\t\tSUM(IF(pn.teamRef = p.teamRef AND pn.playerRef = p.jerseyNo, pn.duration, 0)) AS minutes,\n\t\t\t\tSUM(IF(pn.teamRef = p.teamRef AND pn.playerRef = p.jerseyNo, 1, 0)) AS penalties'.$select_param.'\n\t\t\tFROM players p\n\t\t\tINNER JOIN games gm\n\t\t\t\tON (p.teamRef = gm.themTeamRef OR p.teamRef = gm.usTeamRef)\n\t\t\tINNER JOIN teams t\n\t\t\t\tON (gm.themTeamRef = t.teamRef OR gm.usTeamRef = t.teamRef)\n\t\t\t\tAND p.teamRef != t.teamRef\n\t\t\tINNER JOIN sites f\n\t\t\t\tON gm.fieldRef = f.fieldRef\n\t\t\tLEFT JOIN penalties pn\n\t\t\t\tON gm.gameRef = pn.gameRef\n\t\t\t\tAND p.teamRef = pn.teamRef\n\t\t\t\tAND p.jerseyNo = pn.playerRef\n\t\t\tWHERE p.reference = \"' . $playerRef . '\"\n\t\t\t\tAND gm.final != \"F\"\n\t\t\tGROUP BY ' . $group_param . '\n\t\t\tORDER BY ' . $sort_param;\n\t$r = $db->db_query($sql);\n\treturn $r;\n}",
"public function getParagonLevelSeasonHardcore()\n {\n return $this->getData(__FUNCTION__, 0);\n }",
"function maximum_level() {\n\treturn MAX_PLAYER_LEVEL;\n}",
"function getFamilyLabourDetails() {\n \t$q = Doctrine_Query::create()->from('SeasonLabour l')->where(\"l.trackingid = '\".$this->getID().\"' AND l.type = 1 \");\n\t\t$result = $q->execute();\n\t\treturn $result;\n\t}",
"function update_league_games(){\r\n\r\n\t// Tabelle leeren\r\n\tuli_delete_record('player_league_games');\r\n\r\n\t$fields = array(\"COUNT(ID) as games\", \"leagueID\", \"playerID\", \"uliID\", \"SUM(points) as points\");\r\n\r\n\t$leagues = get_leagues();\r\n\tforeach ($leagues as $league){\r\n\t\t$ulis = get_ulis($league['ID']);\r\n\t\tforeach ($ulis as $entry){\r\n\t\t\t$uli[$entry['ID']] = $league['ID'];\r\n\t\t}\r\n\t}\r\n\r\n\t//print_r($uli);\r\n\tunset($cond);\r\n\t$cond[] = array(\"col\" => \"playerID\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"number\", \"value\" => 12, \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"round\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$result = uli_get_results('userteams', $cond, $fields, NULL, '', 'GROUP by uliID, playerID');\r\n\tif ($result){\r\n\t\tforeach($result as $result){\r\n\t\t\tunset($values);\r\n\t\t\t$values[] = array(\"col\" => \"playerID\", \"value\" => $result['playerID']);\r\n\t\t\t$values[] = array(\"col\" => \"leagueID\", \"value\" => $uli[$result['uliID']]);\r\n\t\t\t$values[] = array(\"col\" => \"uliID\", \"value\" => $result['uliID']);\r\n\t\t\t$values[] = array(\"col\" => \"games\", \"value\" => $result['games']);\r\n\t\t\t$values[] = array(\"col\" => \"status\", \"value\" => 1);\r\n\t\t\t$values[] = array(\"col\" => \"points\", \"value\" => $result['points']);\r\n\t\t\tuli_insert_record('player_league_games', $values);\r\n\t\t}\r\n\t}\r\n\r\n\tunset($cond);\r\n\t$cond[] = array(\"col\" => \"playerID\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"number\", \"value\" => 15);\r\n\t$cond[] = array(\"col\" => \"round\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$result = uli_get_results('userteams', $cond, $fields, NULL, '', 'GROUP by uliID, playerID');\r\n\tif ($result){\r\n\t\tforeach($result as $result){\r\n\t\t\tunset($values);\r\n\t\t\t$values[] = array(\"col\" => \"playerID\", \"value\" => $result['playerID']);\r\n\t\t\t$values[] = array(\"col\" => \"leagueID\", \"value\" => $uli[$result['uliID']]);\r\n\t\t\t$values[] = array(\"col\" => \"uliID\", \"value\" => $result['uliID']);\r\n\t\t\t$values[] = array(\"col\" => \"games\", \"value\" => $result['games']);\r\n\t\t\t$values[] = array(\"col\" => \"status\", \"value\" => 2);\r\n\t\t\t$values[] = array(\"col\" => \"points\", \"value\" => $result['points']);\r\n\t\t\tuli_insert_record('player_league_games', $values);\r\n\t\t}\r\n\t}\r\n\r\n\tunset($cond);\r\n\t$cond[] = array(\"col\" => \"playerID\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"number\", \"value\" => 11, \"func\" => \">\");\r\n\t$cond[] = array(\"col\" => \"number\", \"value\" => 15, \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"round\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$result = uli_get_results('userteams', $cond, $fields, NULL, '', 'GROUP by uliID, playerID');\r\n\tif ($result){\r\n\t\tforeach($result as $result){\r\n\t\t\tunset($values);\r\n\t\t\t$values[] = array(\"col\" => \"playerID\", \"value\" => $result['playerID']);\r\n\t\t\t$values[] = array(\"col\" => \"leagueID\", \"value\" => $uli[$result['uliID']]);\r\n\t\t\t$values[] = array(\"col\" => \"uliID\", \"value\" => $result['uliID']);\r\n\t\t\t$values[] = array(\"col\" => \"games\", \"value\" => $result['games']);\r\n\t\t\t$values[] = array(\"col\" => \"status\", \"value\" => 1);\r\n\t\t\t$values[] = array(\"col\" => \"points\", \"value\" => $result['points']);\r\n\t\t\tuli_insert_record('player_league_games', $values);\r\n\t\t}\r\n\t}\r\n\r\n\t$html = 'Fertig';\r\n\treturn $html;\r\n}",
"function xstats_displayMaxValueListShips($gameId) {\n echo( \"<H3>Spitzenwerte im Spiel</H3>\");\n $statsAvailablePlayerIndicies = xstats_getAvailablePlayerIndicies($gameId);\n $statsMaxTurn = xstats_getMaxTurn($gameId);\n echo( xstats_displayMaxSum( $gameId, 'lj', $statsMaxTurn, $statsAvailablePlayerIndicies ) );\n echo( xstats_displayMaxValue( $gameId, 'shipcount') );\n echo( xstats_displayMaxValue( $gameId, 'freightercount') );\n echo( xstats_displayMaxValue( $gameId, 'shipcount-freightercount') );\n echo( xstats_displayMaxValue( $gameId, 'sumcargohold') );\n}",
"public function getMaxTeams() {\n return $this->maxTeams; \n }",
"private function _getLeagueData()\n\t{\n\t // Reference global application object\n $app = JFactory::getApplication();\n // JInput object\n $jinput = $app->input;\n $option = $jinput->getCmd('option');\n $db\t= $this->getDbo();\n $query = $db->getQuery(true);\n \n $query->select('*');\n $query->from('#__sportsmanagement_league');\n $query->where('id = ' . $this->_project[0]['league_id'] );\n \n\t\t//$query = \"SELECT * FROM #__sportsmanagement_league WHERE id=\".$this->_project[0]['league_id'];\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\tif ($db->getNumRows() > 0)\n\t\t{\n\t\t\t$result = $db->loadAssocList();\n\t\t\t$result[0]['object'] = 'League';\n\n\t\t\treturn $result;\n\t\t}\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that applies validation rules to usersubmitted speaker info | public function validateSpeakerInfo()
{
$speakerInfo = filter_var(
$this->_sanitized_data['speaker_info'],
FILTER_SANITIZE_STRING
);
$validation_response = true;
$speakerInfo = strip_tags($speakerInfo);
$speakerInfo = $this->_purifier->purify($speakerInfo);
if (empty($speakerInfo)) {
$this->_addErrorMessage("You submitted speaker info but it was empty after sanitizing");
$validation_response = false;
}
return $validation_response;
} | [
"public function validateSpeakerBio()\n {\n $speaker_bio = filter_var(\n $this->_sanitized_data['speaker_bio'],\n FILTER_SANITIZE_STRING\n );\n $validation_response = true;\n $speaker_bio = strip_tags($speaker_bio);\n $speaker_bio = $this->_purifier->purify($speaker_bio);\n\n if (empty($speaker_bio)) {\n $this->_addErrorMessage(\"You submitted speaker bio information but it was empty after sanitizing\");\n $validation_response = false;\n }\n\n return $validation_response;\n }",
"public function validateSpeakerBio()\n {\n $speaker_bio = filter_var(\n $this->_cleanData['speaker_bio'],\n FILTER_SANITIZE_STRING\n );\n $validation_response = true;\n $speaker_bio = strip_tags($speaker_bio);\n $speaker_bio = $this->_purifier->purify($speaker_bio);\n\n if (empty($speaker_bio)) {\n $this->_addErrorMessage(\"You submitted speaker bio information but it was empty after sanitizing\");\n $validation_response = false;\n }\n\n return $validation_response;\n }",
"public function validateSubjectsAndTopics()\n {\n $this->validateSubjects();\n $this->validateTopics();\n }",
"public function validateInfoUser()\n { \n $this->addRule('fullname', 'string', ['min' => 3, 'max' => 555]);\n $this->addRule('phone', 'int', ['min' => 10, 'max' => 13]);\n $this->addRule('address', 'string', ['min' => 3, 'max' => 555]);\n $this->run();\n }",
"public function applyuserValidate();",
"function registerSpeaker()\n {\n $dbc = getDBC();\n\n $errors = []; // error array\n\n //check for first name\n if (empty($_POST['first_name'])) {\n $errors[] = 'Please enter your first name.';\n } else if (isset($_POST['first_name'])) {\n $fn = mysqli_real_escape_string($dbc, trim($_POST['first_name']));\n }\n\n //check for last name\n if (empty($_POST['last_name'])) {\n $errors[] = 'Please enter your last name.';\n } else if (isset($_POST['last_name'])) {\n $ln = mysqli_real_escape_string($dbc, trim($_POST['last_name']));\n }\n\n //check for email address --extra step to make sure its a valid email** note to check\n if (empty($_POST['email'])) {\n $errors[] = 'Please enter your email.';\n } else if(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {\n $errors[] = 'Invalid email provided.';\n } else if (isset($_POST['email'])) {\n $e = mysqli_real_escape_string($dbc, trim($_POST['email']));\n\n //make the query to see if email exists\n $query = \"SELECT user_id FROM users WHERE email='$e'\";\n $result = @mysqli_query($dbc, $query);\n\n if (mysqli_num_rows($result) == 1) {\n $errors[] = 'Email has already been registered in the system. Please provide a different email.';\n }\n }\n\n //check for F --extra step to make it secure** not to check Brian's suggestion\n if (empty($_POST['password'])) { //|| strlen(trim($_POST['password']) < 10)) {\n $errors[] = 'Please enter a password that is at least 10 characters long.';\n } else if (empty($_POST['confirm'])) {\n $errors[] = 'Please enter your password again for confirmation.';\n } else if($_POST['password'] != $_POST['confirm']) {\n $errors[] = 'Passwords don\\'t match. Please try again.';\n } else if (isset($_POST['password'])) {\n $pw = hash('sha512', trim($_POST['password']));\n }\n\n //capture input company/organization name (Optional can be blank)\n if (empty($_POST['company_name']) || ($_POST['company_name']) == '') {\n $cmp = NULL; // Optional field allowed to be null\n } else if (isset($_POST['company_name'])) {\n $cmp = mysqli_real_escape_string($dbc, trim($_POST['company_name']));\n }\n\n //capture input job title (Optional can be blank)\n if (empty($_POST['job_title']) || ($_POST['job_title']) == '') {\n $jt = NULL; // Optional field allowed to be null\n } else if (isset($_POST['job_title'])){\n $jt = mysqli_real_escape_string($dbc, trim($_POST['job_title']));\n }\n\n //capture input for bio (Optional can be blank)\n if (empty($_POST['bio']) || ($_POST['bio']) == '') {\n $bi = NULL; // Optional field allowed to be null\n } else if (strlen($_POST['bio']) > 560) {\n $errors[] = 'Biography can only be 560 characters.';\n } else if (isset($_POST['bio'])) {\n $bi = mysqli_real_escape_string($dbc, trim($_POST['bio']));\n }\n\n //check for expertise -- note** what are we validating here?? not null or empty string \"\"\n if ((empty($_POST['expertise']) || ($_POST['expertise']) == '')) {\n $errors[] = 'Please include at least one area of expertise.';\n } else if (isset($_POST['expertise'])) {\n $exp = mysqli_real_escape_string($dbc, trim($_POST['expertise']));\n }\n\n //check for format checkbox selections (formats[] array) at least one selection\n $num = count($_POST['formats']);\n if(empty($_POST['formats']) || $num == 0) {\n $errors[] = 'Please choose at least one format you are comfortable with presenting';\n } else {\n //set boolean true for selections sent to the db if selected format(s) in formats array\n foreach ($_POST['formats'] as $format) {\n if($format == \"Q & A / Interview\") {\n $qai = 1;\n }\n if($format == \"Formal Presentation / Lecture\") {\n $fpl = 1;\n }\n if($format == \"Panel\") {\n $pnl = 1;\n }\n if($format == \"Workshop\") {\n $ws = 1;\n }\n }\n }\n\n //check if the user would like to receive weekly speaking opportunity emails\n if(isset($_POST['weekly_email'])) {\n $wklyE = 1;\n } else {\n $wklyE = 0;\n }\n\n // If there are no errors make the query and run in db\n if (empty($errors)) {\n\n //insert data into the users db table\n $query = \"INSERT INTO users (email, first_name, last_name, password, user_type, bio, last_logon, weekly_msg) \n VALUES ('$e', '$fn', '$ln', '$pw', 'Professional', '$bi', NOW(), '$wklyE')\";\n $result = @mysqli_query($dbc, $query); //run query\n\n //grab the user_id from the db to link to FK in the pro table\n $query = \"SELECT user_id FROM users WHERE email='$e'\";\n $result = @mysqli_query($dbc, $query); //\n $row = mysqli_fetch_array($result, MYSQLI_ASSOC);\n $userid = $row['user_id'];\n\n //insert specific IT Professional data into pros db table\n $query = \"INSERT INTO pros (user_id, company, job_title, expertise, qa_interview, lecture, panel, workshop) \n VALUES ('$userid', '$cmp', '$jt', '$exp', '$qai', '$fpl', '$pnl', '$ws')\";\n $result = @mysqli_query($dbc, $query);\n\n // if the query ran ok.\n if ($result) {\n header('Location: ../');\n } else { //the form did not run ok\n echo '<h1>System Error</h1>\n <p class=\"error\">Your Account was not registered due to a system error. We apologize for any inconvenience.</p>';\n }\n\n mysqli_close($dbc); //close the db connection\n exit();\n } else {\n header('Location: ../Register_Speaker');\n }\n mysqli_close($dbc); //close the db\n }",
"function eve_api_teamspeak_user_form_validate($form, &$form_state) {\n $account = $form_state['user'];\n $uid = $account->uid;\n\n if ($account->characterID == 0) {\n drupal_goto('user/' . $uid . '/edit');\n }\n\n try {\n $ts3 = eve_api_teamspeak_connect();\n $teamspeak_name = eve_api_teamspeak_format_name($account->name);\n $teamspeak_data = eve_api_teamspeak_user_by_name($ts3, $teamspeak_name);\n unset($teamspeak_data);\n eve_api_teamspeak_disconnect($ts3);\n }\n catch (EveApiException $e) {\n form_set_error('teamspeak', check_plain($e->getMessage()));\n }\n}",
"public function testClaimTalkWithInvalidSpeakerThrowsException()\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('No speaker matching that name found');\n $this->expectExceptionCode(WebDAV::UNPROCESSABLE_ENTITY);\n\n $request = new Request(\n [],\n [\n 'REQUEST_URI' => \"http://api.dev.joind.in/v2.1/talks/9999/speakers\",\n 'REQUEST_METHOD' => 'POST'\n ]\n );\n\n $request->user_id = 2;\n $request->parameters = [\n 'username' => 'janebloggs',\n 'display_name' => 'P Sherman'\n ];\n\n $talks_controller = new TalksController(new NullSpamCheckService());\n\n $db = $this->getMockBuilder(mockPDO::class)->getMock();\n\n $this->talk_mapper = $this->createTalkMapper($db, $request);\n $this->talk_mapper\n ->expects($this->once())\n ->method('getSpeakerFromTalk')\n ->willReturn(false);\n $talks_controller->setTalkMapper($this->talk_mapper);\n\n $user_mapper = $this->createUserMapper($db, $request);\n $talks_controller->setUserMapper($user_mapper);\n\n $event_mapper = $this->createEventMapper($db, $request);\n $talks_controller->setEventMapper($event_mapper);\n\n $talks_controller->setSpeakerForTalk($request, $db);\n }",
"public function validateSaveSubscription() {\n\t\t$this->readBoolean('enableNotification');\n\t\t$this->readBoolean('subscribe');\n\t\t\n\t\t$this->validateManageSubscription();\n\t}",
"public function run() \n {\n $this->CI->load->library('wsvalidate');\n $this->CI->load->library('sendemail');\n $this->CI->load->model('user_admin_model');\n $this->CI->load->model('user_model');\n $this->CI->load->model('talks_model');\n $this->CI->load->model('event_model');\n \n $rules = array(\n 'talk_id' =>'required|istalk',\n //'reqkey' =>'required|reqkey'\n );\n\n $tid = $this->xml->action->talk_id;\n $talkSpeakerId = (int)$this->xml->action->talk_speaker_id;\n \n $ret = $this->CI->wsvalidate->validate($rules, $this->xml->action);\n if (!$ret) {\n\n if ($this->CI->wsvalidate->validate_loggedin() \n || $this->isValidLogin($this->xml)\n ) {\n $uid_session = $this->CI->session->userdata('ID');\n if (empty($uid_session)) {\n //They're not logged in, coming from the web service\n // If it is, we need to be sure they've given us the \n // user to add the claim for\n\n // can only claim talks for ourselves - use logged in user\n $username = (string)$this->xml->auth->user;\n if (!isset($username)) {\n return array(\n 'output'=>'json',\n 'data'=>array(\n 'items'=>array(\n 'msg'=>'Fail: Username required!')\n )\n );\n }\n $this->CI->load->model('user_model');\n $udata = $this->CI->user_model->getUserByUsername($username);\n if (!empty($udata)) {\n $uid = $udata[0]->ID;\n } else {\n return array(\n 'output'=>'json',\n 'data'=>array(\n 'items'=>array(\n 'msg'=>'Fail: User not found!')\n )\n );\n }\n } else {\n // They're logged in, so let's go with that user\n $uid = $this->CI->session->userdata('ID');\n }\n\n // take the currently logged in user and insert \n // them as a pending record\n $speakerClaim = array(\n 'id' => $talkSpeakerId,\n 'status' => 'pending',\n 'speaker_id' => $uid\n );\n \n // Be sure there's not one pending\n $query = $this->CI->db\n ->get_where('talk_speaker', $speakerClaim);\n $pendingClaim = $query->result();\n \n error_log(print_r($speakerClaim, true));\n error_log(print_r($pendingClaim, true));\n \n if (empty($pendingClaim)) {\n \n $talkQuery = $this->CI->talks_model->getTalks($tid);\n $talk_detail = $talkQuery[0];\n $eventAdmins = $this->CI->event_model\n ->getEventAdmins($talk_detail->event_id);\n \n // get our admin emails\n if (count($eventAdmins)>0) {\n foreach ($eventAdmins as $admin) { \n error_log($admin->email);\n $to[] = $admin->email; \n }\n }\n \n // Insert the claim\n $this->CI->db->where('ID', $talkSpeakerId);\n $this->CI->db->update('talk_speaker', $speakerClaim);\n\n $this->CI->sendemail->sendPendingClaim($talk_detail, $to);\n return $this->sendJsonMessage('Success');\n } else {\n return $this->sendJsonMessage('Fail: Duplicate Claim!');\n }\n \n } else { \n return $this->sendJsonMessage('redirect:/user/login');\n }\n } else {\n return $this->sendJsonMessage('Fail');\n }\n }",
"abstract function validate($screenname);",
"protected function getSpeakerCheckMailedAttribute()\n {\n return null;\n }",
"protected function validateSubject() {\n\t\tif (empty($this->subject)) {\n\t\t\tthrow new UserInputException('subject');\n\t\t}\n\t\t\n\t\tif (StringUtil::length($this->subject) > 255) {\n\t\t\tthrow new UserInputException('subject', 'tooLong');\n\t\t}\n\t\t\n\t\t// search for censored words\n\t\tif (ENABLE_CENSORSHIP) {\n\t\t\t$result = Censorship::getInstance()->test($this->subject);\n\t\t\tif ($result) {\n\t\t\t\tWCF::getTPL()->assign('censoredWords', $result);\n\t\t\t\tthrow new UserInputException('subject', 'censoredWordsFound');\n\t\t\t}\n\t\t}\n\t}",
"protected function initMessage()\n {\n $this->validMessage['uid'] = 'uid must only contain numeric.';\n $this->validMessage['eduid'] = 'eduid must only contain numeric.';\n $this->validMessage['schoolName'] = 'schoolName must only string and length between 1 and 32.';\n $this->validMessage['majorName'] = 'majorName must only string and length between 1 and 32.';\n $this->validMessage['majorCat'] = 'majorCat must only string and length between 1 and 32.';\n $this->validMessage['area'] = 'area must only string and length between 1 and 32.';\n $this->validMessage['schoolCountry'] = 'schoolCountry must only string and length between 1 and 32.';\n $this->validMessage['startDate'] = 'startDate must be a date and format Y-m.';\n $this->validMessage['endDate'] = 'endDate must be a date and format Y-m.';\n $this->validMessage['degreeStatus'] = 'degreeStatus must only contain numeric and length between 1 and 3.';\n }",
"private function validateInput() {\n\n /**\n * Validate and Sanitize Input\n */\n try {\n\n // First name\n // Validates against the maximum length set in the database. Validates against the minimum length\n // for most names. Validates using a regular expression to ensure that there are no special characters.\n // Does allow for a single space in the middle of the name.\n Assert::minLength($this->formData[\"firstName\"], 2, \"Must complete the first name field.\");\n Assert::maxLength($this->formData[\"firstName\"], 36, \"First name field is too long.\");\n Assert::regex($this->formData[\"firstName\"], \"/^([\\w\\d]+)( )?([\\w\\d]+)?$/\", \"First name includes invalid characters.\");\n\n\n // Last name\n // Validates against the maximum length set in the database. Validates against the minimum length\n // for most names. Validates using a regular expression to ensure that there are no special characters.\n // Does allow for a single space in the middle of the name.\n Assert::minLength($this->formData[\"lastName\"], 2, \"Must complete the last name field.\");\n Assert::maxLength($this->formData[\"lastName\"], 36, \"First last field is too long.\");\n Assert::regex($this->formData[\"lastName\"], \"/^([\\w\\d]+)( )?([\\w\\d]+)?$/\", \"Last name includes invalid characters.\");\n\n\n // Job title\n // Validates the job title against the maximum length set in the database.\n Assert::maxLength($this->formData[\"jobTitle\"], 256, \"The ob title field is too long.\");\n\n\n // Email address\n // Validates against a regular expression that checks for the presence of basic email elements such as\n // the domain name and TLD.\n Assert::regex($this->formData[\"emailAddress\"], \"/^(([\\w\\d_.-]+)(@)([\\w\\d_.-]+)([.])(com|net|org|edu))$/\", \"Provided email address is invalid.\");\n\n\n // Phone number\n // Validates against a regular expression designed to interpret normal phone numbers.\n Assert::regex($this->formData[\"phoneNumber\"], \"/^(([+]?[\\d]{1,2}[\\s-]?)([(]?[\\d]{3}[)]?)|([(]?[\\d]{3}[)]?))?[\\s-]?(\\d{3})[\\s-]?(\\d{4})$/m\", \"Provided phone number is invalid.\");\n\n\n // Message\n // Removes any HTML characters from the message. Validates the message length against the maximum\n // length set in the database.\n $this->formData[\"message\"] = htmlspecialchars($this->formData[\"message\"]);\n Assert::maxLength($this->formData[\"message\"], 65565, \"The message is too long.\");\n\n } catch(\\InvalidArgumentException $exception) {\n\n // Make the error message available as part of the object so that it can be used.\n $this->validationError = $exception->getMessage();\n\n return false;\n }\n\n return true;\n\n }",
"private function handle_wordcamp_activity() {\n\t\t\t$user = self::get_user( $_POST['user'] );\n\t\t\t$type = '';\n\n\t\t\tif ( ! $user ) {\n\t\t\t\treturn '-1 Activity reported for unrecognized user : ' . sanitize_text_field( $_POST['user'] );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['speaker_id'] ) && ! empty( $_POST['speaker_id'] ) ) {\n\t\t\t\t$type = 'wordcamp_speaker_add';\n\t\t\t\t$item_id = $_POST['speaker_id'];\n\n\t\t\t\tif ( isset( $_POST['wordcamp_date'] ) && ! empty( $_POST['wordcamp_date'] ) ) {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Confirmed as a speaker for <a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Confirmed as a speaker for <a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t} elseif ( isset( $_POST['organizer_id'] ) && ! empty( $_POST['organizer_id'] ) ) {\n\t\t\t\t$type = 'wordcamp_organizer_add';\n\t\t\t\t$item_id = $_POST['organizer_id'];\n\n\t\t\t\tif ( isset( $_POST['wordcamp_date'] ) && ! empty( $_POST['wordcamp_date'] ) ) {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Joined the organizing team for <a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Joined the organizing team for <a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t} elseif ( isset( $_POST['type'] ) && 'mentor_assign' === $_POST['type'] ) {\n\t\t\t\t$type = 'wordcamp_mentor_assign';\n\t\t\t\t$item_id = absint( $_POST['wordcamp_id'] );\n\t\t\t\t$wordcamp_name = sanitize_text_field( $_POST['wordcamp_name'] );\n\n\t\t\t\tif ( empty( $_POST['url'] ) ) {\n\t\t\t\t\t$action = 'Started mentoring ' . $wordcamp_name;\n\t\t\t\t} else {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Started mentoring <a href=\"%s\">%s</a>',\n\t\t\t\t\t\tsanitize_url( $_POST['url'] ),\n\t\t\t\t\t\t$wordcamp_name\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t} elseif ( isset( $_POST['attendee_id'] ) && ! empty( $_POST['attendee_id'] ) ) {\n\t\t\t\t$item_id = $_POST['attendee_id'];\n\n\t\t\t\tif ( 'attendee_registered' == $_POST['activity_type'] ) {\n\t\t\t\t\t$type = 'wordcamp_attendee_add';\n\n\t\t\t\t\tif ( isset( $_POST['wordcamp_date'] ) && ! empty( $_POST['wordcamp_date'] ) ) {\n\t\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t\t'Registered to attend <a href=\"%s\">%s</a>',\n\t\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t\t'Registered to attend <a href=\"%s\">%s</a>',\n\t\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t} elseif ( 'attendee_checked_in' == $_POST['activity_type'] ) {\n\t\t\t\t\t$type = 'wordcamp_attendee_checked_in';\n\t\t\t\t\t$order = absint( $_POST['checked_in_count'] );\n\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'Is the %s person to arrive at <a href=\"%s\">%s</a>',\n\t\t\t\t\t\t$this->append_ordinal_suffix( $order ),\n\t\t\t\t\t\tesc_url( $_POST['url'] ),\n\t\t\t\t\t\t$_POST['wordcamp_name']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $type ) ) {\n\t\t\t\treturn \"-1 Unrecognized WordCamp activity.\";\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'user_id' => $user->ID,\n\t\t\t\t'action' => $action,\n\t\t\t\t'content' => '',\n\t\t\t\t'primary_link' => $_POST['url'] ?? '',\n\t\t\t\t'component' => 'wordcamp',\n\t\t\t\t'type' => $type,\n\t\t\t\t'item_id' => intval( $item_id ),\n\t\t\t\t'secondary_item_id' => intval( $_POST['wordcamp_id'] ),\n\t\t\t\t'hide_sitewide' => false,\n\t\t\t);\n\n\t\t\t$ret = bp_activity_add( $args );\n\t\t\tif ( ! $ret ) {\n\t\t\t\t$ret = \"-1 Unable to save activity: \\n\";\n\t\t\t\tforeach ( $args as $k => $v ) {\n\t\t\t\t\t$ret .= \"\\t$k => $v\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $ret;\n\t\t}",
"public function handleSpeakerData($talk_id, array $speaker_data=null) {\n if (!is_array($speaker_data)) { $speaker_data=array($speaker_data); }\n $speaker_names=array();\n \n foreach ($speaker_data as $speaker) {\n \n $data=array(\n 'talk_id'\t\t=> $talk_id,\n 'speaker_name'\t=> $speaker\n );\n if (empty($speaker)) { continue; }\n \n if (!empty($speaker)) { $speaker_names[]=$speaker; }\n $speaker_row = $this->_speakerExists($talk_id, $speaker);\n if ($speaker_row) {\n //Update the current information\n $this->db->update('talk_speaker', $data, array('ID'=>$speaker_row[0]->ID));\n } else {\n // Add the new speaker\n $this->db->insert('talk_speaker', $data);\n }\n }\n \n // Now lets find the ones that aren't in our list and remove them\n // This means we can't deleet the last speaker on a talk...that's a good thing!\n if (!empty($speaker_names)) {\n $this->db->where_not_in('speaker_name', $speaker_names);\n $this->db->where('talk_id', $talk_id);\n $this->db->delete('talk_speaker');\n }\n }",
"function validate() {\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\tif ( $_POST ['repeated_event'] == \"1\" && $this->end_date == \"\" ){\r\n\t\t\t$this->errors[] = __ ( 'Since the event is repeated, you must specify an event date.', 'dbem' );\r\n\t\t}\r\n\t\tif( !$this->location->validate() ){\r\n\t\t\t$this->errors = array_merge($this->errors, $this->location->errors);\r\n\t\t}\r\n\t\t//TODO validate recurrence during event validate\r\n\t\treturn ( count($this->errors) == 0 );\r\n\t}",
"public function validate()\n {\n $this->sanitize();\n\n parent::validate();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function: checkEmailConfig args : returns: | function checkEmailConfig()
{
$common[] = lang_get('check_email_config');
$msg = null;
$idx = 1;
$key2get = array('tl_admin_email','from_email','return_path_email','smtp_host');
foreach($key2get as $cfg_key)
{
$cfg_param = config_get($cfg_key);
if(trim($cfg_param) == "" || strpos($cfg_param,'not_configured') > 0 )
{
$msg[$idx++] = $cfg_key;
}
}
return is_null($msg) ? null : $common+$msg;
} | [
"private function checkEmailSettings(): bool\n {\n return (is_array($this->properties['mail_recipients']) || is_array($this->properties['mail_bcc']));\n }",
"protected function setupCheckAdminEmail()\n {\n $adminEmail = Yii::$app->config->getIniValue(\"email.admin\");\n if (!$adminEmail) {\n $this->errors[] = \"Missing administrator email in app.conf.toml.\";\n } else {\n return 'Admininstrator email exists.';\n }\n }",
"public function verifyConfig() {\n\n $message = '';\n $metaData = $this->module->getMetadata($this->project_id);\n\n // First check that required fields are filled in\n $message = $this->checkForEmptyField($this->title, \"Project Title\", $message);\n $message = $this->checkForEmptyField($this->fk_event_id, \"Reward ID Field Event\", $message);\n $message = $this->checkForEmptyField($this->logic, \"Reward Logic\", $message);\n $message = $this->checkForEmptyField($this->fk_field, \"Reward ID Field\", $message);\n $message = $this->checkForEmptyField($this->gc_status, \"Reward ID Status Field\", $message);\n $message = $this->checkForEmptyField($this->email, \"Reward Email Address Field\", $message);\n $message = $this->checkForEmptyField($this->email_from, \"Email From Address\", $message);\n $message = $this->checkForEmptyField($this->email_subject, \"Reward Email Subject\", $message);\n $message = $this->checkForEmptyField($this->email_verification_subject, \"Verification Email Subject\", $message);\n\n if ($message !== '') {\n $message = \"<li>\" . $message . \"</li>\";\n }\n\n // Check that the forms that the required fields are on are in this event.\n // We are not including the email address field since we are now allowing that to be in a different event\n $all_forms = array();\n $all_forms[0] = $metaData[$this->fk_field]['form_name'];\n $all_forms[1] = $metaData[$this->gc_status]['form_name'];\n $diff = array_diff($all_forms, $this->Proj->eventsForms[$this->fk_event_id]);\n if (!empty($diff)) {\n if (count($diff) == 1) {\n $message .= \"<li>The project fields are not all in the same event \" . $this->Proj->eventInfo[$this->fk_event_id]['name'] .\n \". The form \" . json_encode(array_values($diff)) . \" is not in this event.</li>\";\n } else {\n $message .= \"<li>The project fields are not all in the same event \" . $this->Proj->eventInfo[$this->fk_event_id]['name'] .\n \". The forms \" . json_encode(array_values($diff)) . \" are not in this event.</li>\";\n }\n }\n\n // The email address does not need to be in the same event as the gift card fields so look for it.\n // If this is a multi-arm project, make sure it is in only one event for this arm although it might be\n // in every arm.\n $this->email_event_id = null;\n $email_form = $metaData[$this->email]['form_name'];\n\n $events_to_check = array();\n if ($this->Proj->numArms > 1) {\n\n // There is more than one arm so find the arm that the other fields are in\n // and make sure that arm only has one email field\n foreach($this->Proj->events as $arm => $info) {\n $events_in_arm = array_keys($info['events']);\n if (in_array($this->fk_event_id, $events_in_arm)) {\n $events_to_check = $events_in_arm;\n }\n }\n } else {\n\n $events_to_check = array_keys($this->Proj->eventsForms);\n }\n\n // Check through the events in this arm to make sure there is only one email field\n foreach($events_to_check as $event_id) {\n $form_list = $this->Proj->eventsForms[$event_id];\n if (in_array($email_form, $form_list)) {\n if (is_null($this->email_event_id)) {\n $this->email_event_id = $event_id;\n } else {\n $message .= \"<li>The email address is in more than 1 event: $this->email_event_id and $event_id.</li>\";\n }\n }\n }\n $this->module->emDebug(\"email event id is $this->email_event_id\");\n\n // There can only be one email field for each project so it cannot be located on a repeating form or in\n // a repeating event\n if (!empty($this->Proj->RepeatingFormsEvents[$this->email_event_id])) {\n if ($this->Proj->RepeatingFormsEvents[$this->email_event_id] == 'WHOLE' or\n !is_null($this->Proj->RepeatingFormsEvents[$this->email_event_id][$email_form])) {\n $message .= \"<li>Email address cannot be on a form that is repeating or in a repeating event.</li>\";\n $this->module->emDebug(\"Email address cannot be on a form that is repeating or in a repeating event.\");\n }\n }\n\n // If the configuration has the checkbox checked to cc either the verification or reward email, make sure we\n // have an email address specified [cc-email]\n if (($this->cc_reward_email === 'true') || ($this->cc_verification_email === 'true')) {\n if (empty($this->cc_email)) {\n $message .= \"<li>Emails should be cc'd but the CC email address is blank. Please fill in the CC email address field.</li>\";\n }\n }\n\n\n // Now check the logic which will determine when to send a gift card -- make sure it is valid\n if (!empty($this->logic)) {\n\n // To check the logic, we need a record. See if there is a record in the project\n $data = REDCap::getData($this->project_id, 'array', null, array($this->Proj->table_pk), $this->fk_event_id);\n $record = array_keys($data)[0];\n if (empty($record)) {\n $this->module->emError(\"There are no records to test the gift card logic '\" . $this->logic . \"' for pid $this->project_id\");\n $message .= \"<li>Reward logic (\" . $this->logic . \") cannot be confirmed to be valid because there are no records to check against.</li>\";\n } else {\n $valid = $this->checkRewardStatus($record);\n if ($valid === null) {\n $message .= \"<li>Reward logic (\" . $this->logic . \") is invalid.</li>\";\n }\n }\n } else {\n $message .= \"<li>Logic to determine gift card eligibility is empty.</li>\";\n }\n\n if (empty($message)) {\n return array(true, null);\n } else {\n return array(false, $message);\n }\n }",
"private function checkEmails()\n\t{\n\t\tforeach ($this->emails as &$email) {\n\t\t\t$email['is_valid'] = $this->validateEmail($email['m_mail']);\n\t\t}\n\t}",
"public function check_for_email_addresses() {\n\n // Verifies if user has email addresses\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Email_addresses)->check_for_email_addresses();\n\n }",
"protected function _getEmailConfig() {\n\t\t$configManager = $this->managers()->getManagerOf('config');\n\t\treturn $configManager->open(self::EMAIL_CONFIG);\n\t}",
"public function hook_check_email() {\n $this->check_email();\n }",
"public function validEmailValidDataProvider() {}",
"private function getEmailDetails()\n {\n $config['protocol'] = (string) ConfigXml::getInstance()->config->email->{'protocol'};\n\t\t\t$config['smtp_host'] = (string) ConfigXml::getInstance()->config->email->{'smtp-host'};\n\t\t\t$config['smtp_user'] = (string) ConfigXml::getInstance()->config->email->{'smtp-user'};\n\t\t\t$config['smtp_pass'] = (string) ConfigXml::getInstance()->config->email->{'smtp-pass'};\n\t\t\t$config['smtp_port'] = (string) ConfigXml::getInstance()->config->email->{'smtp-port'};\n\n\t\t\t$config['charset'] = 'iso-8859-1';\n\t\t\t$config['wordwrap'] = TRUE;\n $config['mailtype'] = 'html';\n\n return $config;\n }",
"function checkAdminMail(){\n\n\t\t\t// get config\n\t\t\ttry {\n\t\t\t\t$config = json_decode(file_get_contents(\"../data/config.json\"), true);\n\t \t$adminMail = $config['admin']['email'];\n\t\t\t} catch (Exception $e) {\n\t\t\t $response['mailSet'] = false;\n\t\t\t}\n\n\n\t\t\t// check for admin mail\n\t\t\tif(isset($adminMail)) {\n\t\t\t\t$response['mailSet'] = true;\n\t\t\t} else {\n\t\t\t\t$response['mailSet'] = false;\n\t\t\t}\n\n\t\t\techo json_encode($response);\n\n\t\t}",
"private function validEmailSettings()\n {\n foreach ($this->authKeyMap as $property => $value) {\n if (!isset($this->$property)) {\n throw new EmailTwigPdf_AuthException('Configurações de Email: \"' . $value . '\" não configurado!', EmailTwigPdf_ErrorsCode::AUTH_CONFIG);\n }\n }\n }",
"private function emailConfig()\n {\n $config = array(\n 'protocol' => 'smtp' , \n 'smtp_crypto' => 'tls',\n 'smtp_host' => 'smtp.gmail.com' , \n 'smtp_port' => 587, \n 'smtp_user' => 'noreply@valucart.com' ,\n 'smtp_pass' => 'noreply@VC',\n 'mailtype' => 'html', \n 'charset' => 'utf-8', \n 'newline' => \"\\r\\n\", \n 'wordwrap' => TRUE \n );\n \n // Load email library and passing configured values to email library\n $this->load->library('email',$config);\n }",
"function checkConfig() {\n $config = CRM_Core_Config::singleton( );\n\n $error = array( );\n\n if (empty($this->_paymentProcessor['user_name'])) {\n $error[] = ts('Merchant ID is not set in the Administer CiviCRM » Payment Processor.');\n }\n if (empty($this->_paymentProcessor['password'])) {\n $error[] = ts('Password is not set in the Administer CiviCRM » Payment Processor.');\n }\n \n if (!empty($error)) {\n return implode('<p>', $error);\n }\n\n return null;\n\t}",
"function isMailVerificationEnable(){\n global $view;\n $status=$view->app_config('APP_MAIL_VERIFICATION');\n if($status==\"Yes\"){\n return true;\n } else {\n return false;\n }\n }",
"function checkRegisteredEmail($email);",
"public function emailCheck() {\n if(empty($this->gift)){\n if(!empty($this->email)) {\n $email = users::getUserByEmail($this->email);\n if(!empty($email))\n $this->addError('email', 'The same email address is registered to another user');\n if($this->email != $this->email_confirm)\n $this->addError('email_confirm', 'Email confirm failed');\n }\n }\n }",
"function tep_validate_email($email) {\n $email = trim($email);\n if (strlen($email) > 255) {\n $valid_address = false;\n } elseif (function_exists('filter_var') && defined('FILTER_VALIDATE_EMAIL')) {\n\n $valid_address = (bool)filter_var($email, FILTER_VALIDATE_EMAIL);\n } else {\n if ( substr_count( $email, '@' ) > 1 ) {\n $valid_address = false;\n }\n\n if ( preg_match(\"/[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i\", $email)) {\n $valid_address = true;\n } else {\n $valid_address = false;\n }\n }\n\n if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {\n $domain = explode('@', $email);\n if (!checkdnsrr($domain[1], \"MX\") && !checkdnsrr($domain[1], \"A\")) {\n $valid_address = false;\n }\n }\n return $valid_address;\n }",
"private function emailConfig()\n\t{\n\t\t// Protocol\n\t\t$config['protocol'] = getenv('email_config_protocol');\n\t\t// Host\n\t\t$config['SMTPHost'] = getenv('email_config_SMTPHost');\n\t\t// Port\n\t\t$config['SMTPPort'] = getenv('email_config_SMTPPort');\n\t\t// User\n\t\t$config['SMTPUser'] = getenv('email_config_SMTPUser');\n\t\t// Pass\n\t\t$config['SMTPPass'] = getenv('email_config_SMTPPass');\n\t\t\n\t\treturn $config;\n\t}",
"public function validateConfig();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to check if Most Viewed right sidebar is enabled This Function will return the 0 or 1 | public function isMostViewedRightEnabled() {
return Mage::getStoreConfig ( 'superdeals/mostviewedsidebar/enable_right' );
} | [
"public function isMostViewedLeftEnabled() {\n return Mage::getStoreConfig ( 'superdeals/mostviewedsidebar/enable_left' );\n }",
"function display_right_sidebar() {\n static $display;\n\n isset($display) || $display = in_array(false, [\n // The sidebar will NOT be displayed if ANY of the following return true.\n // @link https://codex.wordpress.org/Conditional_Tags\n is_home(),\n ]);\n\n return apply_filters('mytemplate/display_right_sidebar', $display);\n}",
"public function getHasPersonalSidebar() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_hasPersonalSidebar === null)\n\t\t\t$this->load();\n\t\treturn $this->_hasPersonalSidebar;\t\n\t}",
"public function has_sidebar()\n {\n return $this->sidebar && $this->sidebar == 1;\n }",
"function hasSecondarySidebar() {\n\tglobal $post;;\n\t\n\t// Pagina home 2 barres laterals\n\tif (is_home()) return true;\n\t\n\t//Pagines que explicitament no han de mostrar segona barra\n\t$only_primary_sidebar_posts = array(73 /*Categoria cançons */); \n\tif (in_array($post->ID, $only_primary_sidebar_posts)) return false;\n\t\n\t// Resta de casos:\n\t// es mostra la barra secundaria per defecte sempre excepte per $secondary = 0 (es a dir si esta deshabilitada al template de la pagina)\n\t$secondary = get_post_meta($post->ID, '_theme_layout_template_secondary_sidebar', $single = true);\n\t$secondary = ($secondary == \"0\") ? false : true; \n\treturn $secondary;\n}",
"public function showIndexSidebarAside(): bool;",
"function display_sidebar() {\n return (new ConditionalDisplay(\n array(\n )\n ))->display ? false : true;\n}",
"function is_sidebar_page() {\n\n\t$is_sidebar_page = false;\n\t$sidebar_classes = ['sidebar-right', 'sidebar-left'];\n\t$page_classes = yb_layout_class();\n\n\tforeach ($sidebar_classes as $class) {\n\t\tif ( in_array($class, $page_classes) ) {\n\t\t\t$is_sidebar_page = true;\n\t\t}\n\t}\n\n\treturn $is_sidebar_page;\n}",
"function magpaper_is_sidebar_enable() {\n\t\t$options = magpaper_get_theme_options();\n\t\t$sidebar_position = $options['sidebar_position'];\n\n\t\tif ( is_home() ) {\n\t\t\t$post_id = get_option( 'page_for_posts' );\n\t\t\tif ( ! empty( $post_id ) )\n\t\t\t\t$post_sidebar_position = get_post_meta( $post_id, 'magpaper-sidebar-position', true );\n\t\t\telse\n\t\t\t\t$post_sidebar_position = '';\n\t\t} elseif ( is_archive() || is_search() ) {\n\t\t\t$post_sidebar_position = '';\n\t\t} else {\n\t\t\t$post_sidebar_position = get_post_meta( get_the_id(), 'magpaper-sidebar-position', true );\n\t\t\tif ( is_single() ) {\n\t\t\t\t$post_sidebar_position = ! empty( $post_sidebar_position ) ? $post_sidebar_position : $options['post_sidebar_position'];\n\t\t\t} elseif ( is_page() ) {\n\t\t\t\t$post_sidebar_position = ! empty( $post_sidebar_position ) ? $post_sidebar_position : $options['page_sidebar_position'];\n\t\t\t}\n\t\t}\n\t\tif ( ( in_array( $sidebar_position, array( 'no-sidebar', 'no-sidebar-content' ) ) && $post_sidebar_position == \"\" ) || in_array( $post_sidebar_position, array( 'no-sidebar', 'no-sidebar-content' ) ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}",
"public function hasSidebar(): bool\n {\n return Services::sidebar()->hasLinks();\n }",
"private function _has_sidebar () {\r\n\t\tglobal $wp_version;\r\n\t\t$version = preg_replace('/-.*$/', '', $wp_version);\r\n\r\n\t\tif (version_compare($version, '3.3', '>=')) return true;\r\n\t\treturn false;\r\n\t}",
"function display_sidebar() {\n static $display;\n\n isset($display) || $display = !in_array(true, [\n // The sidebar will NOT be displayed if ANY of the following return true.\n // @link https://codex.wordpress.org/Conditional_Tags\n is_404(),\n is_page()\n ]);\n\n return apply_filters('sage/display_sidebar', $display);\n}",
"function oxygen_woocommerce_get_sidebar_position() {\n\t$shop_sidebar = is_product() ? get_data( 'shop_single_sidebar' ) : get_data( 'shop_sidebar' );\n\n\tif ( in_array( $shop_sidebar, array( 'Show Sidebar on Left', 'Show Sidebar on Right' ) ) ) {\n\t\treturn 'Show Sidebar on Left' == $shop_sidebar ? 'left' : 'right';\n\t}\n\n\treturn false;\n}",
"public function getSidebar() {\n $keys = array_keys($this->modulesInTopMenu);\n foreach ($keys as $key) {\n if (in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu[$key]))\n return $key;\n }\n }",
"private function _has_sidebar() {\n\t\treturn is_active_sidebar( $this->sidebar_id ) && is_registered_sidebar( $this->sidebar_id );\n\t}",
"public function hasSidebar()\n\t{\n\t\treturn (isset($this->raw['sidebar']));\n\t}",
"function ts_check_if_two_sidebars( )\r\n{\r\n\t$single_post_sidebar_position = ts_get_single_post_sidebar_position();\r\n\tif (in_array($single_post_sidebar_position,array('left2','right2','both')))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}",
"function display_sidebar() {\n static $display;\n isset($display) || $display = !in_array(true, [\n // The sidebar will NOT be displayed if ANY of the following return true.\n // @link https://codex.wordpress.org/Conditional_Tags\n is_404(),\n is_front_page(),\n ]);\n return apply_filters('support/display_sidebar', $display);\n}",
"function is_sidebar_index_active(): bool {\n\treturn osetin_is_active_sidebar( CURRENT_SIDEBAR_INDEX );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns element from 'InitialDocumentIds' list at given offset | public function getInitialDocumentIdsAt($offset)
{
return $this->get(self::INITIALDOCUMENTIDS, $offset);
} | [
"public function getForwardedDocumentIdsAt($offset)\n {\n return $this->get(self::FORWARDEDDOCUMENTIDS, $offset);\n }",
"public function getIdsAt($offset)\n {\n return $this->get(self::IDS, $offset);\n }",
"public function getItemidAt($offset)\n {\n return $this->get(self::ITEMID, $offset);\n }",
"public function getWholesalerIdAt($offset)\n {\n return $this->get(self::wholesaler_id, $offset);\n }",
"public function getWholesalerIdsAt($offset)\n {\n return $this->get(self::wholesaler_ids, $offset);\n }",
"public function findOneByOffset($offset)\n {\n $extensions = $this->findAll();\n $extensions = array_values($extensions);\n $offset = (int)$offset;\n if (!empty($extensions[$offset])) {\n return $extensions[$offset];\n }\n return null;\n }",
"public function itemAt($offset) {\n $slice = array_slice($this->items, $offset, 1);\n return $slice[0];\n }",
"public function getIHeadImgIdsAt($offset)\n {\n return $this->get(self::IHEADIMGIDS, $offset);\n }",
"public function appendInitialDocumentIds(\\Diadoc\\Api\\Proto\\DocumentId $value)\n {\n return $this->append(self::INITIALDOCUMENTIDS, $value);\n }",
"public function getShopItemIdAt($offset)\n {\n return $this->get(self::SHOP_ITEM_ID, $offset);\n }",
"public function addInitialDocumentIds(\\AgentSIB\\Diadoc\\Api\\Proto\\DocumentId $value)\n {\n if ($this->InitialDocumentIds === null) {\n $this->InitialDocumentIds = new \\Protobuf\\MessageCollection();\n }\n\n $this->InitialDocumentIds->add($value);\n }",
"public function getFeedidAt($offset)\n {\n return $this->get(self::FEEDID, $offset);\n }",
"public function setInitialDocumentId($value)\n {\n return $this->set(self::INITIALDOCUMENTID, $value);\n }",
"public function __construct($offset='', $docs='') {\n\t\tparent::__construct('retrieve-first', $offset, $docs);\n\t}",
"public function offsetGet($offset) {\n $hash = md5($offset);\n if (isset($this->items[$hash])) {\n return $this->items[$hash];\n }\n\n $indexElement = $this->findInIndex($offset);\n\n if (!empty($indexElement)) {\n return $indexElement;\n }\n\n return $this->findElement($offset);\n }",
"public function getSelfDynaStartAt($offset)\n {\n return $this->get(self::_SELF_DYNA_START, $offset);\n }",
"public function setStartOffset($offset);",
"public function __construct($offset = '', $docs = '')\n {\n parent::__construct('retrieve-first', $offset, $docs);\n }",
"public function getNacIdsAt($offset)\n {\n return $this->get(self::NACIDS, $offset);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Returns a general pupose SQL statement for querying a MON_ table Required bind is :iov_id, the iov_id in the MON_ table Additional binds can be added to the $where clause This function takes "channelview.ID1" from the data in the RUN_DAT table NOT from the data table. This is a temporary solution while the DQM does not write the SM number This function performs no checks that the sql is valid | function build_mon_dataset_sql($table, $where = NULL, $order = NULL) {
$sql = "SELECT
riov.run_num run,
cv2.id1,
cv.id2,
cv.id3,
dat.*
FROM ( $table dat
JOIN channelview cv ON cv.logic_id = dat.logic_id AND cv.name = cv.maps_to
JOIN mon_run_iov miov ON miov.iov_id = dat.iov_id
JOIN run_iov riov ON riov.iov_id = miov.run_iov_id )
LEFT OUTER JOIN run_dat rdat ON rdat.iov_id = riov.iov_id
LEFT OUTER JOIN channelview cv2 ON cv2.logic_id = rdat.logic_id AND cv2.name = cv2.maps_to
WHERE miov.iov_id = :iov_id";
if ($where) {
$sql .= " AND ".$where;
}
if ($order) {
$sql .= " ORDER BY ".join(", ", $order);
} else {
$sql .= " ORDER BY run, id1, id2, id3";
}
return $sql;
} | [
"private function executeSRC_SQL($ids){\n\n\t\t$sql = $this->config['extraction_sql_discrete'];\n\t\n\t\t$in_valid = ($this->config['valid_recs']==null) ? null : $this->config['extraction_key'] . \" in(\".$this->config['valid_recs'].\")\";\n\t\t$in_loaded = ($this->config['recs_already_loaded']==null) ? null : $this->config['src_pkey_fld'] . \" not in(\".$this->config['recs_already_loaded'].\")\";\n\t\t$wc = null;\n\n\t\t// build where clause based upon loaded and constrain criteria present...\n\n\t\tif($in_valid != null || $in_loaded != null){ // if at least one of the 2 variables is not null...\n\t\t\n\t\t\tif($in_valid != null && $in_loaded != null){ // both vars have content...\n\t\t\t\t$wc = ' where ' . $in_valid . \" and \"\t. $in_loaded;\t\n\t\t\t}\n\n\t\t\tif($in_valid != null && $in_loaded == null){ // nothing loaded, but recs present in valid pi RC project\n\t\t\t\t$wc = ' where ' . $in_valid;\t\n\t\t\t}\n\n\t\t\tif($in_valid == null && $in_loaded != null){ // recs already loaded, no valid pi project in RC\n\t\t\t\t$wc = ' where ' . $in_loaded;\t\n\t\t\t}\n\t\t}\n\n\n\t\tif($ids==null){\n\t\t\t$sql = $sql . $wc;\n\t\t}\n\n\t\t// if no where clause, just build a simple where clause with ids passed to fcn\n\t\tif($ids != null && $wc==null){\n\t\t\t$sql = $sql . \" where \" . $this->config['src_pkey_fld'] .\" in (\" . $ids . \")\";\n\t\t}\n\t\t\n\t\t// extend where clause ids sent to fcn\n\t\tif($ids != null && $wc!=null){\n\t\t\t$sql = $sql . $wc . ' and ' . $this->config['src_pkey_fld'] .\" in (\" . $ids . \")\";\n\t\t}\n\t\t\n\t\t//apply any fimal order by clause\n\t\t$sql .= $this->config['table_order_by'];\n\t\t$res=odbc_exec($this->src_conn, $sql);\n\t\tif(!$res){\n\t\t\tthrow new Exception(\"ERR_DES_DATA_SRCSQL: Script Terminated: Could Not Extract Data From SRC System (Single) Using Query: \" . $sql);\n\t\t}\n\n\t\t$this->results_single = $res;\n\t\t\n\t\t$res = null;\n\n\t\tsrcDataDES::setConfFields();\n\t}",
"protected function compileSQL() { }",
"private function build_where_sql() {\n\n // if we used a custom where clause, we do not need to build it\n if ($this->used_custom_where || count($this->where_parameters) < 1) {\n return;\n }\n\n $sql = \"WHERE \\n\";\n\n for ($i=0; $i < count($this->where_parameters); $i++) { \n $parameter = $this->where_parameters[$i];\n\n if ($i == 0) {\n $sql .= \"\\t\";\n } else {\n $sql .= \"\\tAND \";\n }\n \n $name = $parameter->name;\n $type = $parameter->type;\n $value = $this->model_object->$name;\n\n if (is_array($value)) {\n\n if (\\PDope\\Utilities:: is_special_type($type)) {\n throw new \\Exception(\"PDopeStatement build_where_sql(), array, does not support special type [{$type}]\");\n }\n\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" IN (\";\n\n for ($j=0; $j < count($value); $j++) { \n if ($j > 0) {\n $sql .= \", \";\n }\n\n $token = \"{$name}_{$j}\";\n $token = \\PDope\\Utilities:: format_token($token);\n\n $sql .= $token;\n }\n\n $sql .= \"))\";\n } else {\n if (\\PDope\\Utilities:: is_special_type($type)) {\n $token = \\PDope\\Utilities:: translate_special_token($name, $type); \n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\"; \n } else {\n $token = \\PDope\\Utilities:: format_token($name);\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\";\n }\n }\n\n }\n $this->sql_where .= $sql;\n\n // $this->log_debug(\"build_where_sql() built \\n$sql\");\n }",
"private function _buildWhere() {\r\n\t\t\tif ( $this->_where ) { // we have where clauses to add\r\n\t\t\t\t// add where\r\n\t\t\t\t$this->_sql .= ' WHERE';\r\n\r\n\t\t\t\tforeach ( $this->_where as $where ) { // loop over where array\r\n\t\t\t\t\t// variable name\r\n\t\t\t\t\t$columnVariableName = ':' . str_replace( '.', '', $where['column'] );\r\n\r\n\t\t\t\t\t// add where column/value to sql statement\r\n\t\t\t\t\t$this->_sql .= ' ' . $where['type'] . ' ' . $where['column'] . ' = ' . $columnVariableName;\r\n\r\n\t\t\t\t\t// map where vars to values to be used on execution\r\n\t\t\t\t\t$this->_executeParams[$columnVariableName] = $where['value'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"private function processSQL()\n {\n $sql = $this->sqlobj->get();\n\n /* If the mode is magic, process the $fields and $table. */\n if($this->mode == 'magic')\n {\n if($this->fields == '') $this->fields = '*';\n if($this->table == '') $this->app->triggerError('Must set the table name', __FILE__, __LINE__, $exit = true);\n $sql = sprintf($this->sqlobj->get(), $this->fields, $this->table);\n }\n\n /* If the method if select, update or delete, set the lang condition. */\n if($this->autoLang and $this->table != '' and $this->method != 'insert' and $this->method != 'replace')\n {\n $lang = $this->app->getClientLang();\n\n /* Get the position to insert lang = ?. */\n $wherePOS = strrpos($sql, DAO::WHERE); // The position of WHERE keyword.\n $groupPOS = strrpos($sql, DAO::GROUPBY); // The position of GROUP BY keyword.\n $havingPOS = strrpos($sql, DAO::HAVING); // The position of HAVING keyword.\n $orderPOS = strrpos($sql, DAO::ORDERBY); // The position of ORDERBY keyword.\n $limitPOS = strrpos($sql, DAO::LIMIT); // The position of LIMIT keyword.\n $splitPOS = $orderPOS ? $orderPOS : $limitPOS; // If $orderPOS, use it instead of $limitPOS.\n $splitPOS = $havingPOS? $havingPOS: $splitPOS; // If $havingPOS, use it instead of $orderPOS.\n $splitPOS = $groupPOS ? $groupPOS : $splitPOS; // If $groupPOS, use it instead of $havingPOS.\n\n /* Set the conditon to be appened. */\n $tableName = !empty($this->alias) ? $this->alias : $this->table;\n\n if($this->app->config->cn2tw) $lang = str_replace('zh-tw', 'zh-cn', $lang);\n\n $langCondition = \" $tableName.lang in('{$lang}', 'all') \";\n\n /* If $spliPOS > 0, split the sql at $splitPOS. */\n if($splitPOS)\n {\n $firstPart = substr($sql, 0, $splitPOS);\n $lastPart = substr($sql, $splitPOS);\n if($wherePOS)\n {\n $sql = $firstPart . \" AND $langCondition \" . $lastPart;\n }\n else\n {\n $sql = $firstPart . \" WHERE $langCondition \" . $lastPart;\n }\n }\n else\n {\n $sql .= $wherePOS ? \" AND $langCondition\" : \" WHERE $langCondition\";\n }\n }\n\n self::$querys[] = $this->processKeywords($sql);\n return $sql;\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}",
"private function whereCmds() {\n $wheCmd = array(\"cmd\" => \"\", \"data\" => array());\n if(count(array_keys($this -> condition)) > 0) {\n $wheCmd[\"cmd\"] = \"where\";\n # represents variable count\n $index = 1;\n # contain all conditions\n $tmpCond = array();\n foreach($this -> condition as $key => $value) {\n array_push($tmpCond, $key.\" = :s\".$index);\n $wheCmd[\"data\"][\":s\".$index] = $value;\n $index += 1;\n } \n # complete the where commands\n $wheCmd[\"cmd\"] = $wheCmd[\"cmd\"].\" \".join(' and ', $tmpCond);\n }\n return $wheCmd;\n }",
"public function getWhereSQL() { \n $filter_field_id = Request::input('dx_filter_field_id', 0);\n \n if (!$filter_field_id) {\n return \"\"; // no filtering\n }\n \n $date_from = $this->getDateVal(\"dx_filter_date_from\");\n $date_to = $this->getDateVal(\"dx_filter_date_to\");\n \n $fld_row = DB::table('dx_lists_fields as lf')\n ->select('lf.db_name', 'lf.formula', 'lf.list_id', 'o.db_name as list_table_name')\n ->join('dx_lists as l', 'lf.list_id', '=', 'l.id')\n ->join('dx_objects as o', 'l.object_id', '=', 'o.id')\n ->where('lf.id', '=', $filter_field_id)->first();\n \n $field_name = $fld_row->db_name;\n if ($fld_row->formula) {\n $formula_obj = new Formula($fld_row);\n $field_name = $formula_obj->getFieldFormula();\n }\n \n $sql = \" \";\n if ($date_from) {\n $sql .= \"AND date(\" . $field_name . \") >='\" . $date_from . \"' \";\n }\n \n if ($date_to) {\n $sql .= \"AND date(\" . $field_name . \") <='\" . $date_to . \"' \";\n }\n \n return $sql;\n }",
"function BeforeQueryView(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}",
"private function getSQL()\n {\n $client = LunaClient::findCurrent();\n switch ($this->search) {\n case 'user_id':\n return \"SELECT DISTINCT `user_id`,\n CONCAT(CONCAT_WS(' ', `title_front`, `firstname`), ' ',\n CONCAT_WS(', ', `lastname`, IF(`title_rear` != '', `title_rear`, NULL)))\n FROM `luna_users`\n WHERE `client_id` = '\".$client->id.\"'\n AND (`firstname` LIKE :input\n OR `lastname` LIKE :input\n OR CONCAT_WS(' ', `firstname`, `lastname`) LIKE :input\n OR CONCAT_WS(' ', `lastname`, `firstname`) LIKE :input)\n ORDER BY `lastname`, `firstname`\";\n case 'company_id':\n return \"SELECT DISTINCT `company_id`, `name`\n FROM `luna_companies`\n WHERE `client_id` = '\".$client->id.\"'\n AND `name` LIKE :input\n ORDER BY `name`\";\n }\n }",
"abstract public function getPrepareSql();",
"private function _buildSQL(&$sql){\n\t\tUtils::debugTrace(__FILE__.\":\".__FUNCTION__.\":[\".__LINE__.\"]\", start);\n\t\t\n\t\t// --------------------------------------------------------------------\n\t\t// BUILD THE SQL STATEMENT IF NO EXISTING ALREADY\n\t\t// If we already have a fetch statement (SQL) then we use it\n\t\t// This is so that User Defined SQL can be directly passed and execute\n\t\t// instead of using the paramaters passed to build the SQL\n\t\t// --------------------------------------------------------------------\n\t\tif (empty($sql)){\n\t\t\t // -----------------------------------------------------\n\t\t\t // BUILD THE FROM CLAUSE\n\t\t\t // Get object list for the first part of the selection\n\t\t\t // -----------------------------------------------------\n\t\t\t if (isset($this->_object) && !empty($this->_object)){\n\t\t\t \t\n\t\t\t \tif (isset($this->_select)){\n\t\t\t \t\t// ------------------------------------\n\t\t\t \t\t// USER DEFINED SELECTS ARE READ ONLY\n\t\t\t \t\t// --------------------------------------\n\t\t\t \t\t$this->_readOnly = true;\n\t\t\t \t\tif (empty($top))\n\t\t\t \t\t\t$sql = $this->_addText($this->_select,\"SELECT\").\" FROM \";\n\t\t\t \t\t\telse {\n\t\t\t \t\t\t\t$pieces = explode(\" \", trim($this->_select));\n\t\t\t \t\t\t\t$firstWord = trim($pieces[0]);\n\t\t\t \t\t\t\tif (empty($firstWord)) $firstWord = trim($pieces[1]);\n\t\t\t \t\t\t\tif (strtoupper($firstWord)==\"SELECT\"){\n\t\t\t \t\t\t\t\t// @todo - this does not catch all circumstances, add array iterator\n\t\t\t \t\t\t\t\t$select = $this->_select;\n\t\t\t \t\t\t\t\t$strTxt = \"SELECT \".$top.\" \";\n\t\t\t \t\t\t\t\t$count =1;\n\t\t\t \t\t\t\t\t$select = str_replace($firstWord, $strTxt, $select, $count);\n\t\t\t \t\t\t\t\t\n\t\t\t \t\t\t\t\t$sql = $select.\"\\n\\tFROM \";\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\telse {\n\t\t\t \t\t\t\t\t$sql = \"SELECT $top \".$this->_select.\" \\n\\tFROM \";\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t}\n\t\t\t \t}\n\t\t\t \telse\n\t\t\t \t\t$sql = \"SELECT $top * \\n\\tFROM \";\n\t\t\t \t\t// ---------------------------------------------\n\t\t\t \t\t// get object list for NATURAL JOIN CONDITION\n\t\t\t \t\t// ---------------------------------------------\n\t\t\t \t\tif (is_array($this->_object)){\n\t\t\t \t\t\t// Start the sql statement here\n\t\t\t \t\t\t$separator=\"\";\n\t\t\t \t\t\tforeach ($this->_object as $table) {\n\t\t\t \t\t\t\t$sql .=$separator.$table;\n\t\t\t \t\t\t\t$separator=\", \";\n\t\t\t \t\t\t}\n\t\t\t \t\t\t// If more than one object fetched then we make this a read only object\n\t\t\t \t\t\t$this->_readOnly=TRUE;\n\t\t\t \t\t}\n\t\t\t \t\telse {\n\t\t\t \t\t\t// SINGLE TABLE SELECTION\n\t\t\t \t\t\t// this is a scalar value, only one object which is editable\n\t\t\t \t\t\tif (isset($this->_schema))\n\t\t\t \t\t\t\t$prefix = $this->_schema.\".\";\n\t\t\t \t\t\t\telse\n\t\t\t \t\t\t\t\t$prefix = \"\";\n\t\t\t \t\t\t\t\t// start creating the query to by used\n\t\t\t \t\t\t\t\t$sql .= $prefix.$this->_object;\n\t\t\t \t\t}\n\t\t\t }\n\t\t\t // -----------------------------------------\n\t\t\t // Examine all the JOIN clauses if present\n\t\t\t // -----------------------------------------\n\t\t\t if (!empty($this->_join)){\n\t\t\t \tif (is_array($this->_join)){\n\t\t\t \t\t// Let's iterate through the tables that are being JOIN'd and build the SQL\n\t\t\t \t\tforeach ($this->_join as $indx => $joinData) {\n\t\t\t \t\t\t// Lets create the join clause for the object/table\n\t\t\t \t\t\tforeach ($joinData as $table => $joinCols){\n\t\t\t \t\t\t\t$sql .= \"\\n\\t\".$this->_joinType[$indx].\" \";\n\t\t\t \t\t\t\t$sql .= $table.\" ON (\\n\\t\\t\";\n\t\t\t \t\t\t\t$delim = \" \";\n\t\t\t \t\t\t\tforeach ($joinCols as $col1 => $col2){\n\t\t\t \t\t\t\t\t$joinOperator=\" = \";\n\t\t\t \t\t\t\t\tif (is_array($col2)){\n\t\t\t \t\t\t\t\t\t$joinOperator = $col2[0];\n\t\t\t \t\t\t\t\t\t$col2 = $col[1];\n\t\t\t \t\t\t\t\t}\n\t\t\t \t\t\t\t\t$sql .= $delim.$col1.\" \".$joinOperator.\" \".$col2;\n\t\t\t \t\t\t\t\t$delim = \"\\n\\t\\t AND \";\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\t$sql .= \")\";\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \telse {\n\t\t\t \t\t$sql .= $this->_join;\n\t\t\t \t}\n\t\t\t \t$this->_readOnly = TRUE;\n\t\t\t }\n\t\t\t \n\t\t\t // ---------------------\n\t\t\t // Get the conditions\n\t\t\t // ---------------------\n\t\t\t if (isset($this->_conditions) && isset($this->_object)) {\n\t\t\t \t// Build the WHERE clause\n\t\t\t \t$this->_buildConditions(array('position'=>$this->_position));\n\t\t\t \t\n\t\t\t \t// Check if the fetch statement has been started\n\t\t\t \tif (empty($sql)){\n\t\t\t \t\tif (!empty($this->_schema))\n\t\t\t \t\t\t$sql = \"SELECT $top * FROM \".$this->_schema.\".\".$this->_object.\"\\n\".$this->_whereClause[$this->_position].\" \";\n\t\t\t \t\t\telse\n\t\t\t \t\t\t\t$sql = \"SELECT $top * FROM \".$this->_object.\"\\n\".$this->_whereClause[$this->_position].\" \";\n\t\t\t \t}\n\t\t\t \telse {\n\t\t\t \t\t// Add the WHERE clause, and place \"WHERE\" there if not already\n\t\t\t \t\t$sql .= $this->_whereClause[$this->_position]; // User defined WHERE condition that is scalar\n\t\t\t \t}\n\t\t\t \t\n\t\t\t }\n\t\t}\n\t\t\n\t\t$this->_buildSQLClause($sql);\n\t\tUtils::debugTrace(__FILE__.\":\".__FUNCTION__.\":[\".__LINE__.\"]\", end);\n\t\t\n\t\treturn;\n\t}",
"private function runStmt(xPDOQuery $c) {\r\n\t\t$results = array();\r\n\t\t$allowedTvNames = array_merge($this->tvWhereFields, $this->tvFields);\r\n\t\t$c->prepare();\r\n\t\t$sql = $c->toSQL();\r\n $patterns = array('{sql}');\r\n $replacements = array($sql);\r\n $sql = str_replace($patterns, $replacements, $this->queryHook['stmt']['execute']);\r\n\t\tif ($this->dbg) $this->modx->log(modX::LOG_LEVEL_DEBUG, 'sql: '.$sql,'','runStmt');\r\n\t\tunset($c);\r\n\t\t$c = new xPDOCriteria($this->modx,$sql);\r\n\t\tif (!empty($this->queryHook['stmt']['prepare'])) $c->bind($this->queryHook['stmt']['prepare']);\r\n $c->prepare();\r\n\t\tif ($c->stmt) {\r\n\t\t\t$exec = $c->stmt->execute();\r\n if ($exec) {\r\n if (count($allowedTvNames)) {\r\n while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {\r\n // Append & render tv fields (includeTVs, withTVs)\r\n $tvs = array();\r\n $templateVars = $this->modx->getCollection('modTemplateVar', array('name:IN' => $allowedTvNames));\r\n foreach ($templateVars as $tv) {\r\n $tvs[$tv->get('name')] = $tv->renderOutput($row['id']);\r\n }\r\n $results[] = array_merge($row,$tvs);\r\n }\r\n }\r\n else {\r\n $results = $c->stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n $c->stmt->closeCursor();\r\n }\r\n\t\t}\r\n\t\tunset($c);\r\n\t\tif ($this->dbg) $this->modx->log(modX::LOG_LEVEL_DEBUG, 'Results: '.print_r($results,true),'','runStmt');\r\n\t\treturn $results;\r\n }",
"protected function getSubfiltersQuery(): string\n {\n return\n 'SELECT slsc.`id`,\n slsc.`filters_id`,\n slsc.`minlength`,\n slsc.`maxlength`,\n slsc.`regex_case`,\n slsc.`regex_replace`\n FROM `search_v2_layer_string_case` slsc\n WHERE slsc.`filters_id` IN ({bind_params})\n AND slsc.`active` = 1\n ORDER BY slsc.`priority` DESC';\n }",
"public function getStatmentSql()\n {\n $sql = 'SELECT '; \n \n\n if (isset($this->params['select']) && $this->params['select'] && is_array($this->params['select'])) {\n $sql .= $this->getSelectSql($this->params['select']);\n } else {\n $sql .= '*';\n }\n \n $sql .= ' FROM ' . $this->tableName;\n \n\n if (isset($this->params['left join']) && $this->params['left join']) {\n $sql .= $this->getLeftJoinSql($this->params['left join']);\n }\n\n if (isset($this->params['where']) && $this->params['where']) {\n $sql .= $this->getWhereConnditionSql($this->params['where']);\n }\n\n if (isset($this->params['group']) && $this->params['group']) {\n $sql .= $this->getGroupBy($this->params['group']);\n }\n\n if (isset($this->params['order']) && $this->params['order']) {\n $sql .= $this->getOrderSql($this->params['order']);\n }\n\n if (isset($this->params['limit']) && $this->params['limit']){\n $sql .= $this->getLimitSql();\n }\n\n if (isset($this->params['offset']) && $this->params['offset']){\n $sql .= $this->getLimitSql();\n }\n\n return $sql;\n }",
"function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }",
"private function getSql1() :string {\n return \"select id,wid from weibo_footprint where id > 130000 order by id asc limit 1\";\n }",
"public function getSql()\n {\n $operators['='] = '=';\n $operators['like'] = 'like';\n $operators['>='] = '>=';\n $operators['<='] = '<=';\n\n $select = 'SELECT ';\n foreach ($this->columns as $key => $value)\n {\n $alias = '';\n //bairros::nome|bairro\n if(preg_match('/\\|/',$key) && !preg_match('/like/',$key)) \n {\n $explode_values = explode('|',$key);\n $table_field = str_replace('::', '.', $explode_values[0]);\n $alias = $explode_values[1]; \n $alias = \" as {$alias}\"; \n }\n // elseif(preg_match('/like/',$key))\n // {\n \n // $explode_values = explode('|',$key);\n // $exKey = explode('::',$explode_values[0]);\n // $alias = $explode_values[1]; \n // $alias = \" as {$alias}\";\n \n // $table_field = \"{$exKey[0]}.{$exKey[1]}\"; \n // }\n else\n {\n\n $table_field = str_replace('::', '.', $key); \n }\n \n $select.= \" {$table_field}{$alias},\";\n $table = explode('.', $table_field);\n $from[$table[0]] = $table[0];\n\n if ($value->relation)\n {\n $where.= ' ' . $value->relation . ' AND';\n }\n }\n\n if ($this->filter)\n {\n foreach ($this->filter as $key_filter => $filter)\n {\n if ($filter)\n {\n \n\n if(preg_match('/\\|/',$key_filter))\n {\n $key_filter = explode('::', $key_filter);\n $operator = $key_filter[2];\n $explode_values = explode('|',$key_filter[1]);\n $key_filter = $this->model->getTable() . '.' . $explode_values[0]; \n\n }\n else\n {\n $key_filter = explode('::', $key_filter);\n $operator = $key_filter[2];\n $key_filter = $this->model->getTable() . '.' . $key_filter[1]; \n }\n\n if ($operator)\n {\n if ($operator == 'like')\n {\n $where.= \" {$key_filter} like '%{$filter}%' AND\";\n }\n elseif ($operators[$operator])\n {\n $where.= \" {$key_filter} {$operators[$operator]} '{$filter}' AND\";\n }\n }\n else\n {\n $where.= \" {$key_filter} like '%{$filter}%' AND\";\n }\n }\n }\n }\n if ($where)\n {\n $where = ' WHERE ' . $where;\n }\n $where = substr($where, 0, -3);\n $select = substr($select, 0, -1);\n $from = implode(',', $from);\n \n return $select . ' from ' . $from . $where . ' limit 20';\n }",
"public function _add_ivr_comment_filter()\n\t {\n\t\t\t$params = $this->get_get_params();\n\t\t\tif($params['time'] != 'N/A')\n\t\t\t{\n\t\t\t\t$filter_params = Event::$data;\n\t\t\t\t\n\t\t\t\t//get the table prefix\n\t\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\t\n\t\t\t\t$sql = 'i.id IN (SELECT DISTINCT data.incident_id FROM '.$table_prefix.'ivrapi_data AS data ';\n\t\t\t\t$sql .= 'LEFT JOIN '.$table_prefix.'ivrapi_data_comments AS comments ON comments.ivr_data_id = data.id ';\n\t\t\t\t//don't bother if we don't care about time\n\t\t\t\tif($params['time'] != '2' )\n\t\t\t\t{\n\t\t\t\t\t$sql .= 'LEFT JOIN '.$table_prefix.'incident_category AS ic ON ic.incident_id = data.incident_id ';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//get the operator\n\t\t\t\t$operator = $params['operator'];\n\t\t\t\t\n\t\t\t\t//create the where text\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($params['conditions'] as $key)\n\t\t\t\t{\n\t\t\t\t\t//skip this\n\t\t\t\t\tif($key == 'undefined')\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i == 1){$sql .=' WHERE ';}\n\t\t\t\t\tif($i > 1) {$sql .= $operator;}\n\t\t\t\t\t$sql .= $this->condition_mapping[$key]. ' = 1 ';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//deal with the time component\n\t\t\t\t$sql .= $this->time_mapping[$params['time']];\n\t\t\t\t\n\t\t\t\t$sql .= ' ) ';\n\t\t\t\tarray_push($filter_params, $sql);\n\t\t\t\tEvent::$data = $filter_params;\t\t\t\n\t\t\t}\n\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends mail according to given type. | protected function sendMail($type) {
$doSend = true;
if($this->settings[$type]['disable'] == '1') {
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_disabled', $type);
$doSend = false;
}
$mailSettings = $this->settings[$type];
$template['plain'] = $this->parseTemplate($type, 'plain');
$template['html'] = $this->parseTemplate($type, 'html');
//init mailer object
require_once(PATH_t3lib . 'class.t3lib_htmlmail.php');
$emailObj = t3lib_div::makeInstance('t3lib_htmlmail');
$emailObj->start();
//set e-mail options
$emailObj->subject = $mailSettings['subject'];
$sender = $mailSettings['sender_email'];
if(isset($mailSettings['sender_email']) && is_array($mailSettings['sender_email'])) {
$sender = implode(',', $mailSettings['sender_email']);
}
$emailObj->from_email = $sender;
$emailObj->from_name = $mailSettings['sender_name'];
$replyto = $mailSettings['replyto_email'];
if(isset($mailSettings['replyto_email']) && is_array($mailSettings['replyto_email'])) {
$replyto = implode(',', $mailSettings['replyto_email']);
}
$emailObj->replyto_email = $replyto;
$emailObj->replyto_name = $mailSettings['replyto_name'];
$cc = $mailSettings['cc_email'];
if(isset($mailSettings['cc_email']) && is_array($mailSettings['cc_email'])) {
$cc = implode(',', $mailSettings['cc_email']);
}
$emailObj->recipient_copy = $cc;
$emailObj->returnPath = '';
if($mailSettings['email_header']) {
$emailObj->add_header($mailSettings['header']);
}
if($template['plain']) {
$emailObj->setPlain($template['plain']);
}
if($template['html']) {
if($mailSettings['htmlEmailAsAttachment']) {
$prefix = 'mailformplusplus_';
if(isset($mailSettings['filePrefix.']['html'])) {
$prefix = $mailSettings['filePrefix.']['html'];
} elseif(isset($mailSettings['filePrefix'])) {
$prefix = $mailSettings['filePrefix'];
}
$tmphtml = tempnam('typo3temp/', ('/' . $prefix)) . '.html';
$tmphtml = str_replace('.tmp', '', $tmphtml);
$tmphandle = fopen($tmphtml, 'wb');
if ($tmphandle) {
fwrite($tmphandle,$template['html']);
fclose($tmphandle);
F3_MailformPlusPlus_StaticFuncs::debugMessage('adding_html', $tmphtml);
$emailObj->addAttachment($tmphtml);
}
} else {
$emailObj->setHtml($template['html']);
}
}
if(!is_array($mailSettings['attachment'])) {
$mailSettings['attachment'] = array($mailSettings['attachment']);
}
foreach($mailSettings['attachment'] as $attachment) {
if(strlen($attachment) > 0) {
$emailObj->addAttachment($attachment);
}
}
if($mailSettings['attachPDF']) {
F3_MailformPlusPlus_StaticFuncs::debugMessage('adding_pdf', $mailSettings['attachPDF']);
$emailObj->addAttachment($mailSettings['attachPDF']);
}
//parse max count of mails to send
$count = 0;
$max = $this->settings['limitMailsToUser'];
if(!$max) {
$max = 2;
}
if(!is_array($mailSettings['to_email'])) {
$mailSettings['to_email'] = array($mailSettings['to_email']);
}
reset($mailSettings['to_email']);
//send e-mails
foreach($mailSettings['to_email'] as $mailto) {
if($count < $max) {
if (strstr($mailto, '@') && !eregi("\r", $mailto) && !eregi("\n", $mailto)) {
$sent = false;
if($doSend) {
$sent = $emailObj->send($mailto);
}
}
$count++;
}
if($sent) {
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_sent', $mailto);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_subject', $emailObj->subject);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_sender', ($emailObj->from_name . ' <' . $emailObj->from_email . '>'), false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_replyto', ($emailObj->replyto_name . ' <' . $emailObj->replyto_email . '>'), false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_cc', $emailObj->recipient_copy, false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_plain', $template['plain'], false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_html', $template['html'], false);
} else {
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_not_sent',$mailto);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_subject', $emailObj->subject);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_sender', ($emailObj->from_name . ' <' . $emailObj->from_email . '>'), false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_replyto', ($emailObj->replyto_name . ' <' . $emailObj->replyto_email . '>'), false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_cc', $emailObj->recipient_copy, false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_plain', $template['plain'], false);
F3_MailformPlusPlus_StaticFuncs::debugMessage('mail_html', $template['html'], false);
}
}
if($tmphtml) {
unlink($tmphtml);
}
} | [
"public function send_mail_v1($type)\n\t{\n\t\tinclude_once('includes/mail_templates.php');\n\t\t$template = new MAIL_TEMPLATES();\n\n\t\t$headers = $this->get_headers();\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase \"thank_you_mail\":\n\t\t\t\t$body = $template->getThankYouTemplate();\n\t\t\t\tbreak;\n\n\t\t\tcase \"thank_you_feedback\":\n\t\t\t\t$body = $template->getThankYouFeedbackTemplate();\n\t\t\t\tbreak;\n\t\t}\n\n\t\tmail($this->to_user, $this->subject, $body, $headers);\n\t}",
"public function mail($mailObject, $type){\n\t\t//TODO: do something with the email, like actually email it, for instance.\n\t\tLOG::info(\"{Sending an email}\");\n\t\t\n\t\t//$recipient = \"\"\n\t\t\n\t\t\n\t\t\n\t}",
"private function sendEmail($type)\n {\n // email sends only loggedIn users with active email template in form Settings\n // get template from `form_emails` table\n $email = $this->form->email($type);\n if (!$email) return false;\n if ($email->active != 1) return false;\n\n // from Template or Settings\n $from_settings = Setting::where('key', 'from_email')->first();\n $from_email = $email->from_email ? $email->from_email : $from_settings->value;\n\n $from_name = $email->from_name ? $email->from_name : 'RWAV';\n\n // to `user.email`\n $to_email = $this->user->email;\n\n // parse $email->send_to\n $send_to = [];\n if ($email->send_to) {\n $sendtoArrayy = explode(',', preg_replace('/\\s+/', '', $email->send_to));\n foreach ($sendtoArrayy as $send_to_item) {\n if ($this->emailValidate($send_to_item)) $send_to[] = $send_to_item;\n }\n }\n\n if ($type == 'admin_submit') {\n if ($send_to) {\n $to_email = $send_to;\n } else {\n // admin_submit\n $to_email = Setting::where('key', 'feedback_email')->first()->value;\n }\n }\n if ($type == 'manager_submit') {\n if ($send_to) {\n $to_email = $send_to;\n } else {\n // managers\n $to_email = [];\n $groups = $this->form->groups;\n foreach ($groups as $group) {\n foreach ($group->managers as $manager) {\n $to_email[] = $manager->email;\n }\n }\n\n }\n }\n\n // replase macros in message\n $find = false;\n $replace = false;\n $fields = $this->fields;\n $msgMacros = $email->messageFields();\n foreach ($msgMacros as $key => $item) {\n if (@$fields[$item]['value']) {\n $find[] = $key;\n $replace[] = $fields[$item]['value'];\n }\n }\n\n $message = str_replace($find, $replace, $email->message);\n\n // $view = 'email.client';\n $data = [];\n\n $data['from_email'] = $from_email;\n $data['from_name'] = $from_name;\n $data['to'] = $to_email;\n $data['subject'] = $email->subject;\n $data['message'] = $message;\n\n SendEmail::dispatch($data);\n\n return true;\n }",
"public function sendEmails(string $type, User $user): void;",
"function _send_email($type, $email, &$data)\n\t{\n\n \t$this->load->library('email');\n\t\t$this->email->from($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth'));\n\t\t$this->email->reply_to($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth'));\n\t\t$this->email->to($email);\n\t\t$this->email->subject(sprintf($this->lang->line('auth_subject_'.$type), $this->config->item('website_name', 'tank_auth')));\n\t\t$this->email->message($this->load->view('email/'.$type.'-html', $data, TRUE));\n\t\t$this->email->set_alt_message($this->load->view('email/'.$type.'-txt', $data, TRUE));\n\t\t$this->email->send();\n\t}",
"public function notify_email($type){\n\t\t// get team leader/supervisor/approver\n\t\tif($type == 'endorsers'){\n\t\t\t$person = DB::table('team')\n\t\t\t\t->join('users', 'team.team_id', '=', 'users.team_id')\n\t\t\t\t->where('users.team_id', \\Auth::user()->team_id)\n\t\t\t\t->where(function ($query) {\n\t\t\t\t\t\t$query->orWhere('users.type_id', 3)\n\t\t\t\t\t\t\t->orWhere('users.type_id', 4)\n\t\t\t\t\t\t\t->orWhere('users.type_id', 6);\n\t\t\t\t\t})\n\t\t\t\t->get();\n\t\t}\n\t\telseif($type == 'head'){\n\t\t\t$person = DB::table('users')\n\t\t\t\t\t->where('type_id', 1)\n\t\t\t\t\t->get();\n\t\t}\n\t\t\t\t\n\t\tforeach($person as $person){\t\n\t\t\ttry{\n\t\t\t\t$email = $person->email;\n\t\t\t\t$content = \"Good day!\\r\\nThis is to notify you that \".\\Auth::user()->name.\" has filed an official business request.\";\n\t\t\t\t$data = [\n\t\t\t\t 'email' => $email,\n\t\t\t\t 'subject' => 'eUP - Official Business Request',\n\t\t\t\t 'content' => $content\n\t\t\t\t];\n\t\t\t\tMail::send(\"emails.approval\", $data, function ($message) use ($data){\t\n\t\t\t\t\t$message->from('up.oboton@gmail.com', 'Do not reply to this email');\n\t\t\t\t\t$message->to($data['email']);\n\t\t\t\t\t$message->subject($data['subject']);\n\t\t\t\t});\t\t\t\n\t\t\t}\n\t\t\tcatch (\\Exception $e){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"function sendMail ( $type='' ) {\n // On envoie seulement si l'option d'envoi est activée\n if ( Erreurs_Actif ) {\n global $xham ;\n $date = new clDate ( ) ;\n // En fonction de la dernière erreur rencontrée, on fabrique\n // le sujet du message.\n if ( $type ) $subject = Erreurs_Bloquante ;\n else $subject = Erreurs_Normale ;\n\n // Préparation des informations du mail.\n $entete = \"<html><head><title>$subject</title><body>\" ;\n $fin = \"</ul></body></html>\" ;\n // print affTab ( get_object_vars ( $xham ) ) ;\n // Entête explicatif.\n if(method_exists($xham->user,'getIdentite'))\n \t$message = \"L'utilisateur <i>\".($xham?$xham->user->getIdentite ( ):\"Inconnu\").\"</i>, lors de l'exécution de la page \" ;\n else\n \t$message = \"L'utilisateur <i>erreur cougnac</i>, lors de l'exécution de la page \" ;\n $message .= ($xham?$xham->getNaviFull():\"Chemin introuvable\").\" le \".$date->getDateTextFull() ;\n if ( $this->indice > 1 ) $message .= \", a provoqué les erreurs suivantes : <br/><ul>\" ;\n else $message .= \", a provoqué l'erreur suivante : <br/><ul>\" ;\n // Liste des erreurs.\n for ( $i = 0 ; isset ( $this->liste[$i] ) ; $i++ )\n\t$message .= \"<li>\".$this->liste[$i].\"</li>\" ;\n $message .= \"</ul><br /><a href=\\\"http://\".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].\"?navi=\".($_POST['navi']?$_POST['navi']:$_GET['navi']).\"\\\">Lien vers la page d'erreur</a>\" ;\n $headers = \"MIME-Version: 1.0\\nContent-type: text/html; charset=iso-8859-1\\n\";\n $headers .= \"To: \".Erreurs_Mail.\"\\nFrom: \".Erreurs_NomApp.\"<\".Erreurs_MailApp.\">\\n\";\n //$headers .= \"Bcc: dborel@ch-hyeres.fr\\r\\n\" ;\n // Envoi du mail.\n// print $message;\n\t if(is_object($xham->user) AND method_exists($xham->user,\"getLogin\"))\n\t \t$userErreur = $xham->user->getLogin() ;\n\t else\n\t \t$userErreur = \"[impossible d'acceder à la methode getLogin]\";\n mail ( '', $subject.\" (\".$userErreur.\")\", $entete.$message.$fin, $headers ) ;\n //print \"$entete.$message.$fin\" ;\n }\n }",
"function MyMod_Mail_Typed_Send($type,$user,$item,$hrefs=array())\n {\n foreach ($hrefs as $key => $url)\n {\n $user[ $key ]=preg_replace('/index\\.php/',\"\",$url);\n }\n\n $language=$this->ApplicationObj()->GetLanguage();\n\n $mail=$this->MyMod_Mail_Type_Get($type,$language);\n \n $subject=\n $this->MyMod_Mail_Text_Filter\n (\n $user,\n $mail[ \"Subject\" ]\n );\n \n $body=\n $this->MyMod_Mail_Text_Filter\n (\n $user,\n $this->GetRealNameKey($item,\"MailHead\").\"\\n\\n\".\n $mail[ \"Body\" ].\"\\n\\n\".\n $this->GetRealNameKey($item,\"MailTail\").\n \"\\n\\n\"\n );\n\n $this->ApplicationObj()->MyApp_Email_Send\n (\n $user,\n array\n (\n \"Subject\" => $this->Html2Text($subject),\n \"Body\" => $this->Html2Text($body),\n )\n );\n \n }",
"function sendMail($email, $password, $subject, $message, $emailType)\n {\n if ($emailType == 1) {\n try {\n /*$body = \"<p>Bol Vám vytvorený nový účet</p>\n <p>Vaše prihlasovacie meno je: \" . $email . \" a Vaše prihlasovacie heslo je: \" . $password . \"</p>\n <p>Vaše heslo si môžete zmeniť na tomto odkaze: <a href='\" . DIR . \"php/subpages/Reset.php'>\" . DIR . \"php/subpages/Reset.php</a></p></p>\n <p>S pozdravom Váš super admin</p>\";*/\n\n $mail = new Mail();\n $mail->setFrom(SITEEMAIL);\n $mail->addAddress($email);\n $mail->subject($subject);\n $mail->body($message);\n $mail->send();\n } catch (PDOException $e) {\n $error[] = $e->getMessage();\n }\n }\n if ($emailType == 2) {\n try {\n $mail = new Mail();\n $mail->setFrom($email);\n $mail->addAddress(SITEEMAIL);\n $mail->subject($subject);\n $mail->body($message);\n $mail->send();\n\n } catch (PDOException $e) {\n $error[] = $e->getMessage();\n }\n }\n if ($emailType == 3) {\n try {\n $mail = new Mail();\n $mail->setFrom(SITEEMAIL);\n $mail->addAddress($email);\n $mail->subject($subject);\n $mail->body($message);\n $mail->send();\n } catch (PDOException $e) {\n $error[] = $e->getMessage();\n }\n }\n }",
"function sendEmail($to,$subject,$data,$view,$type=\"view\")\n {\n if($type == \"view\")\n {\n Mail::send($view,$data,function($message) use($to,$subject){\n $message->from('info@disenado.com.ng',\"Fundzila\");\n $message->to($to);\n $message->subject($subject);\n });\n }\n\n elseif($type == \"raw\")\n {\n Mail::raw($view,$data,function($message) use($to,$subject){\n $message->from('info@disenado.com.ng',\"Fundzila\");\n $message->to($to);\n $message->subject($subject);\n });\n }\n }",
"private function _sendNotificationAndEmail($type, $object_id) {\n $announcement = new Announcement();\n $result = $announcement->getAnnouncementForReading($object_id);\n \n if ($result->type == 'single') {\n $users_ids = array($result->to_id);\n } else if ($result->type == 'group') {\n $users_ids = explode(',', $result->to_id);\n } else {\n return true;\n }\n \n foreach ($users_ids as $id) {\n $notification = new Notification();\n $notification->type = 'N';\n $notification->notify_type = $type;\n $notification->from_id = $this->session_data->id;\n $notification->to_id = $id;\n $notification->object_id = $object_id;\n $notification->data = serialize(objectToArray($result));\n $notification->save();\n \n //get email details\n $email = new Email();\n $email->where('type', $type)->get();\n $message = $email->message;\n \n $user_details = userNameEmail($id);\n $message = str_replace('#user_name', $user_details['name'], $message);\n $message = str_replace('#announcer_name', $result->from_person, $message);\n $message = str_replace('#subject', $result->announcement, $message);\n $message = str_replace('#announcement', $result->announcement, $message);\n \n $check_privacy = unserialize($user_details['email_privacy']);\n if (is_null($check_privacy) || $check_privacy == false || !isset($check_privacy[$type]) || $check_privacy[$type] == 1) {\n \n //set option for sending mail\n $option = array();\n $option['tomailid'] = $user_details['email'];\n $option['subject'] = $email->subject;\n $option['message'] = $message;\n if (!is_null($email->attachment)) {\n $option['attachement'] = 'assets/email_attachments/' . $email->attachment;\n }\n send_mail($option);\n }\n }\n \n return true;\n }",
"public function notify_email($type){\n\t\t// get team leader/supervisor/approver\n\t\tif($type == 'endorsers'){\n\t\t\t$person = DB::table('team')\n\t\t\t\t->join('users', 'team.team_id', '=', 'users.team_id')\n\t\t\t\t->where('users.team_id', \\Auth::user()->team_id)\n\t\t\t\t->where(function ($query) {\n\t\t\t\t\t\t$query->orWhere('users.type_id', 3)\n\t\t\t\t\t\t\t->orWhere('users.type_id', 4)\n\t\t\t\t\t\t\t->orWhere('users.type_id', 6);\n\t\t\t\t\t})\n\t\t\t\t->get();\n\t\t}\n\t\telseif($type == 'head'){\n\t\t\t$person = DB::table('users')\n\t\t\t\t\t->where('type_id', 1)\n\t\t\t\t\t->get();\n\t\t}\n\t\t\t\t\n\t\tforeach($person as $person){\n\t\t\ttry{\n\t\t\t\t$email = $person->email;\n\t\t\t\t$content = \"Good day!\\r\\nThis is to notify you that \".\\Auth::user()->name.\" has filed an overnight request.\";\n\t\t\t\t$data = [\n\t\t\t\t 'email' => $email,\n\t\t\t\t 'subject' => 'eUP - Overnight Request',\n\t\t\t\t 'content' => $content\n\t\t\t\t];\n\t\t\t\tMail::send(\"emails.approval\", $data, function ($message) use ($data){\t\n\t\t\t\t\t$message->from('up.oboton@gmail.com', 'Do not reply to this email');\n\t\t\t\t\t$message->to($data['email']);\n\t\t\t\t\t$message->subject($data['subject']);\n\t\t\t\t});\t\t\t\n\t\t\t}\n\t\t\tcatch (\\Exception $e){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"public function sendemail($type='new',$recipients,$recipient_type){\n\t$subject=\"\";\n\t$message=\"\";\n\t$message_full=\"\";\n\t$hello=\"Hello \";\n\tif ($recipient_type=='del'){\n\t\t$hello.=\"Delevery person,\\n\";\n\t}elseif ($recipient_type=='sup'){\n\t\t$hello.=\"Supplier,\\n\";\n\t}\n\t\n\tif ($type=='new'){\n\t\t$subject=\"New Order Notification\";\n\t\t$message=$hello.\"New order has been made,\\n\";\n\t}\n\telseif ($type=='cancel'){\n\t\t$subject=\"Order Cancellation\";\n\t\t$message=$hello.\"Cancelled a order,\\n\";\n\t}\n\t$message_end=\"\\nPlease check the system for more details\";\n\t\n\tforeach ($recipients as $email_add=>$message_body){\n\t\t$message_full=$message.$message_body.$message_end;\n\t\t\n\t\t//echo 'xxx'.$email.'<br>'.$message_full;\n\t\t\n\t\t $email = new Email('default');\n\t\t$email->from(['spanrupasinghe11@gmail.com' => 'Direct2door.com'])\n\t\t->to($email_add)\n\t\t->subject($subject)\n\t\t->emailFormat('html')\n\t\t->send($message_full); \n\t\t$message_full=\"\";\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n}",
"abstract protected function _sendmail();",
"public function send_notification_mails($mailtype, $users, $mailvalues, $settings) {\n global $CFG;\n $noreply = \\core_user::get_noreply_user();\n $subjectkey = 'mail_' . $mailtype . '_subject';\n $bodykey = 'mail_' . $mailtype . '_body';\n $subject = new \\lang_string($subjectkey, 'block_disk_quota');\n foreach ($users as $user) {\n $lang = empty($user->lang) ? $CFG->lang : $user->lang;\n $mailvalues->signature = $this->mail_signature($lang, $settings);\n $body = new \\lang_string($bodykey, 'block_disk_quota', $mailvalues);\n email_to_user($user, $noreply, $subject->out($lang), $body->out($lang));\n }\n }",
"function sendEmail($to,$type,$message,$attachment)\n\t{\n\t\t$validTo = filter_var($to, FILTER_VALIDATE_EMAIL);\n\n\t\tif($validTo)\n\t\t{\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'internal':\n\t\t\t\tdefault:\n\t\t\t\t\t$from = INTERNAL_FROM_ADDRESS;\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\t\tcase 'external':\n\t\t\t\t\t$from= EXTERNAL_FROM_ADDRESS;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch(MAIL_TYPE)\n\t\t\t{\n\t\t\tcase 'php':\n\t\t\tdefault:\n\t\t\t$uid = md5(uniqid(time()));\n\n\t\t\t$header = \"From: \".$from.\" <\".$from.\">\\r\\n\";\n\t\t\t$header .= \"Reply-To: \".$from.\"\\r\\n\";\n\t\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\";\n\t\t\t$header .=$uid.\"\\\"\\r\\n\\r\\n\";\n\t\t\t$header .= \"This is a multi-part message in MIME format\";\n\t\t\t$header .= \".\\r\\n\";\n\t\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t\t$header .= \"Content-type:text/html; charset=iso-8859-1\";\n\t\t\t$header .=\"\\r\\n\";\n\t\t\t$header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n\t\t\t$header .= $message['data'].\"\\r\\n\\r\\n\";\n\t\t\t\n\t\t\tif($attachment)\n\t\t\t{\n\t\t\tforeach ($attachment as $filename) \n\t\t\t{ \n\t\t\t\t$file = $path.$filename;\n\t\t\t\t$name = basename($file);\n\t\t\t\t$file_size = filesize($file);\n\t\t\t\t$handle = fopen($file, \"r\");\n\t\t\t\t$content = fread($handle, $file_size);\n\t\t\t\tfclose($handle);\n\t\t\t\t$content = chunk_split(base64_encode($content));\n\n\t\t\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t\t\t// use different content types here\n\t\t\t\t$header .= \"Content-Type: \";\n\t\t\t\t$header .= \"application/octet-stream; name=\\\"\";\n\t\t\t\t$header .= $filename.\"\\\"\\r\\n\"; \n\t\t\t\t\n\t\t\t\t$header .= \"Content-Transfer-Encoding: base64\";\n\t\t\t\t$header .= \"\\r\\n\";\n\t\t\t\t$header .= \"Content-Disposition: attachment; \";\n\t\t\t\t$header .= \"filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n\t\t\t\t$header .= $content.\"\\r\\n\\r\\n\";\n\t\t\t}//end loop\n\t\t\t}//end attachment found\n\n\t\t\t$header .= \"--\".$uid.\"--\";\n\t\t\t\n\t\t\t$toReturn = mail($to,$message['subject'],\n\t\t\t\t\"\",$header);\n\t\t\tbreak; //end php mail\n\n\t\t\tcase 'smtp':\n\t\t\t//send messages via SMTP\n\t\t\tinclude('class.phpmailer.php');\n\t\t\t$mail = new PHPMailer;\n\t\t\t$mail->IsSMTP();\n\t\t\t$mail->Host = SMTP_HOST;\n\t\t\t$mail->SMTPAuth = true;\n\t\t\t$mail->Username = SMTP_USER;\n\t\t\t$mail->Password = SMTP_PASS;\n\t\t\t$mail->From = $from;\n\t\t\t$mail->FromName = $from;\n\t\t\t$mail->AddReplyTo($from,$from);\n\n\t\t\t$mail->AddAddress($to); // Add a recipient\n\t\t\t$mail->Subject = $message['subject'];\n\t\t\t$mail->Body = $message['data'];\n\n\t\t\tif($attachment)\n\t\t\t{\n\t\t\tforeach ($attachment as $filename) \n\t\t\t{ \n\t\t\t\t$mail->addAttachment($filename);\n\t\t\t} //end loop\n\t\t\t}//end attachment foudn \n\t\t\tif(!$mail->Send()) {\n\t\t\t\tlogger(\"error\",\n\t\t\t\t'Mailer Error: ' . $mail->ErrorInfo);\n\t\t\t\t$toReturn= FALSE;\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$toReturn= TRUE;\n\t\t\t}\n\t\t\tbreak; //end SMTP mail\n\t\t\t\n\n\t\t\t} //end swithc\n\t\t} //end valid TO\n\t\telse\n\t\t{\n\t\t\t//To address is invalid, return false\n\t\t\t$toReturn = FALSE;\n\t\t}\n\n\t\treturn $toReturn;\n\t}",
"function SetType($type = \"mail\")\n {\n switch($type)\n {\n case \"smtp\":\n $this->base->IsSMTP();\n break;\n case \"sendmail\":\n $this->base->IsSendmail();\n break;\n case \"qmail\":\n $this->base->IsQmail();\n break;\n case \"mail\":\n default:\n $this->base->IsMail();\n break;\n }\n }",
"function sendEmail($type, $id, $brokerID){\n\tinclude './SQL_Files/dbconnection.php';\n\t\n\t$query1 = \"select * from broker where b_id='\".$brokerID.\"'\";\n\t$result = $dbcon->query($query1);\n\t$row1 = $result->fetch_assoc();\n\t$brokerageName = $row1['brokerage'];\n\t$brokerEmail = $row1['email'];\n\t$brokerName = $row1['firstname'].\" \".$row1['lastname'];\n\t$brokerPhone = $row1['phone'];\n\n\tif($type==\"nudge\"){\n\t\t$idType = \"p_id\";\n\n\t\t$subject = 'Notification From '.$brokerName.' at '.$brokerageName;\n\t\t$query2 = \"select * from prospect where $idType='\".$id.\"'\";\n\t\t$result = $dbcon->query($query2);\t\n\t\t$numRows = $result->num_rows;\n\t\t$row = $result->fetch_assoc();\n\n\t\t$to = $row['email'];\n\n\t\t$notRec = \"\";\n\t\t$prospectName = $row['firstname'].\" \".$row['lastname'];\n\n\t\tif(is_null($row['ID_File_Loc'])){\n\t\t\t$notRec .=\"ID, \";\n\t\t}\n\n\t\tif(is_null($row['BankStatement1_File_Loc'])){\n\t\t\t$notRec .=\"Bank Statment1, \";\n\t\t}\n\n\t\tif(is_null($row['BankStatement2_File_Loc'])){\n\t\t\t$notRec .=\"Bank Statement 2, \";\n\t\t}\n\n\t\tif(is_null($row['EmploymentLetter_File_Loc'])){\n\t\t\t$notRec .=\"Employment Letter, \";\n\t\t}\n\n\t\tif(is_null($row['PayStub_File_Loc'])){\n\t\t\t$notRec .=\"Pay Stub, \";\n\t\t}\n\n\t\tif(is_null($row['References_File_Loc'])){\n\t\t\t$notRec .=\"References, \";\n\t\t}\n\n\t\tif(is_null($row['W2_File_Loc'])){\n\t\t\t$notRec .=\"W2 \";\t\n\t\t}\n\n\t\trtrim($notRec, \",\");\n\n\t\t$message = \n\t\t\"\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t <title>Notification from $brokerName at $brokerageName</title>\n\t\t\t</head>\n\t\t\t<body>\t\n\t\t\t <p>Hi $prospectName,</p>\n\t\t\t <p>Just a friendly reminder to upload your $notRec to the Rentista portal! This will ensure that we're prepared to close when we find your perfect apartment.</p>\n\t\t\t <p>As always, please feel free to contact me at $brokerEmail or $brokerPhone if you have any questions.</p>\n\t\t\t\t<p>Best,<br>\n\t\t\t\t$brokerName</p>\n\t\t\t</body>\n\t\t\t</html>\n\t\t\t\";\n\t\t\n\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= \"From: Airswoop1@gmail.com\" . \"\\r\\n\";\n\t//\t$headers .= \"From: $brokerEmail\" . \"\\r\\n\";\n\t\tif(mail($to, $subject, $message, $headers)){\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t\treturn 0;\n\t\t\t}\n\t}\n\telseif($type==\"newGroup\"){\n\t\t$idType = \"g_id\";\n\n\t\t$subject = 'Welcome to '.$brokerageName;\n\n\t\t$query2 = \"select * from prospect where $idType='\".$id.\"'\";\n\t\t$result = $dbcon->query($query2);\t\n\t\t$numRows = $result->num_rows;\n\t\t\n\n\t\tfor($i=0;$i<$numRows;$i++){\n\t\t\t$row = $result->fetch_assoc();\n\t\t\t$prospectName = $row['firstname'].\" \".$row['lastname'];\n\t\t\t$prospectID = $row['p_id'];\n\n\t\t\t$to = $row['email'];\n\t\t\t$message = \"\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t <title>Welcome to $brokerageName</title>\n\t\t\t</head>\n\t\t\t<body>\t\n\t\t\t <p>Hello $prospectName,</p>\n\t\t\t <p>Thank you for choosing to work with us at $brokerageName</p>\n\t\t\t <p>Like most things in New York City, the rental market is incredibly fast paced. This means that we have to act as quickly as possible to find and secure your dream apartment. We've recently introduced a new online system to give you an even greater advantage!</p>\n\t\t\t <p>Please follow the link below to our secure online portal, where you will be instructed to create an account and upload your real estate documents as soon as possible so that we can get started with your search! Keep in mind, apartments can be off the market in a matter of hours, so having this information online in advance will help increase your likelihood of landing your ideal place.</p>\n\t\t\t <p>Use prospect ID: $prospectID</p>\n\t\t\t\t<a href=\\\"http://localhost:8888/Rentista/Rentista_MVP/prospect.html\\\" value=\\\"Secure Online Portal\\\">Secure Online Portal</a>\t\t\n\t\t\t\t<br>\n\t\t\t\t<p>Here at $brokerageName, we strive to provide exceptional customer service, transparency of information, neighborhood expertise, and professional guidance. We look forward to working with you!</p>\n\t\t\t\t<p>Thanks,<br>\n\t\t\t\t$brokerName</p>\n\t\t\t\t<p>P.S. For more information about using this tool, go to SECURE RENTAL INFO SOURCE or call ###-###-####.</p>\n\t\t\t</body>\n\t\t\t</html>\n\t\t\t\";\n\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= \"From: Airswoop1@gmail.com\" . \"\\r\\n\";\n//\t\t$headers .= \"From: $brokerEmail\" . \"\\r\\n\";\n\t\tif(mail($to, $subject, $message, $headers)){\n\t\t\tif($i==($numRows-1)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn 0;\n\t\t}\n\t}\n\t}\n\telseif($type==\"complete\"){\n\t\t$idType = \"g_id\";\n\n\t\t//INSERT CODE FOR COMPLETION EMAIL\n\n\t}\n\n}",
"public function send_mail() {\n $scheduled = $this->scheduled->get_templates_to_send();\n if($scheduled){\n $list = get_list_by_id($scheduled[0]->list_id,$scheduled);\n $template = get_template_by_id($scheduled[0]->template_id);\n if($this->scheduled->update_send($scheduled[0]->scheduled_id)) {\n send_smtp($template,$list,$scheduled);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the file has the dynamic album suffix | function hasDynamicAlbumSuffix($path) {
return strtolower(substr(strrchr($path, "."), 1)) == 'alb';
} | [
"public function has_correct_filename() {\n\n\t\treturn preg_match( '#^envira-gallery#i', wp_unslash( $_FILES['envira_import_gallery']['name'] ) ); // @codingStandardsIgnoreLine\n\n\t}",
"function only_conventional_galleries($cat)\n{\n\treturn (substr($cat,0,9)!='download_');\n}",
"protected function inMediaLibrary()\n {\n return 'upload' == basename( $_SERVER[\"SCRIPT_FILENAME\"], '.php' );\n }",
"public function is_album() {\n return true;\n }",
"public function hasSuffix(): bool\n {\n return false !== strpos($this->getVersion(), '-');\n }",
"public function hasSuffix() {\n return $this->suffix != null;\n }",
"public function suffix($s = '') {\n\t\t$info = $this->isVariation(parent::get('basename')); \n\t\tif(strlen($s)) {\n\t\t\treturn $info ? in_array($s, $info['suffix']) : false;\n\t\t} else {\n\t\t\treturn $info ? $info['suffix'] : array();\n\t\t}\n\t}",
"public function isFileAlbumable()\n {\n return in_array(\n 'Sharenjoy\\Cmsharenjoy\\Filer\\FilealbumTrait',\n $this->getReflection()->getTraitNames()\n );\n }",
"function isValidAlbumsPath($path) {\n if (file_exists($path . 'albumdb.dat')\n && is_readable($path . 'albumdb.dat')) {\n return true;\n } else {\n return false;\n }\n }",
"function isThumb($file) \r\n\t{\r\n\t\t$len = strlen($this->config['thumbnail_prefix']);\r\n\t\tif(substr($file,0,$len)==$this->config['thumbnail_prefix'])\r\n\t\t\tReturn true;\r\n\t\telse\r\n\t\t\tReturn false;\r\n\t}",
"public function isFilename() {\n\t\treturn strtoupper($this->filename) == self::YN_TRUE;\n\t}",
"public function hasSuffix()\r\n {\r\n return is_int($this->suffix);\r\n }",
"protected function isFileNameSuffixValid($suffix)\n {\n return isset(\\SugarLogger::$filename_suffix[$suffix]);\n }",
"function isAlbumAvailable($path)\n{\n $dir = photoRoot . $path;\n $files = scandir($dir);\n $valid = false;\n foreach ($files as $key => $value) {\n $path = realpath($dir . DIRECTORY_SEPARATOR . $value);\n if (!is_dir($path)) {\n $valid = pathinfo($path, PATHINFO_EXTENSION) == \"zip\";\n if ($valid)\n break;\n }\n }\n return $valid;\n}",
"function isAlbum($album){\n return in_array($album, $this->all_album_names);\n }",
"function enclosureIsMP3($mime){\n\t$audio = array('audio/mp3','audio/mp4','audio/mpeg','audio/mpeg3','audio/mpegaudio','audio/mpg','audio/x-mp3','audio/x-mp4','audio/x-mpeg','audio/x-mpeg3','audio/x-mpegaudio','audio/x-mpg','audio/x-mp3','audio/x-mp4','audio/x-mpeg','audio/x-mpeg3','audio/x-mpegaudio','audio/x-mpg');\n\t$test = in_array($mime,$audio);\n\treturn $test;\n}",
"public function hasAlbumArt(): bool\n {\n return $this->hasTrack() && count($this->track->item->album->images) > 0;\n }",
"function checkFilenameForUniqueness($name, $suffix = \"_1\"){\n if(file_exists('media/' . $name)){\n // get filename part and extension\n $piecesName = explode('.', $name);\n $extension = array_pop($piecesName);\n $filename = implode('_', $piecesName);\n // append suffix and recheck if unique\n $uniqueName = checkFilenameForUniqueness($filename . $suffix . '.' . $extension);\n }\n else {\n $uniqueName = $name;\n }\n return $uniqueName;\n}",
"public function checkFilenameSuffix($filename, $suffix)\n {\n if (substr_compare($filename, $suffix, -strlen($suffix)) === 0) {\n return true;\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for recursively updating a page (and its children) template | function recursivelyUpdatePageTemplates($id, $template) {
$pages=Pages::getInstancesByParent($id, false);
$ids=array();
foreach ($pages->pages as $page) {
$ids[]=$page->id;
recursivelyUpdatePageTemplates($page->id, $template);
}
if (!count($ids)) {
return;
}
dbQuery(
'update pages set template="'.addslashes($template).'" where id in ('
.join(',', $ids).')'
);
} | [
"public function updatePagesBasedOnHierarchy() {\n\t\t$this->logFunctionStart(__FUNCTION__);\n\t\t$wordpressIDsToSilverstripeIDs = singleton('SiteTree')->WordpressIDToSilverstripeIDMap();\n\t\t$list = $this->applyWordpressFilter(SiteTree::get());\n\t\tforeach ($list as $record)\n\t\t{\n\t\t\t$wordpressParentID = $record->getField('WordpressParentID');\n\n\t\t\tif (isset($wordpressIDsToSilverstripeIDs[$wordpressParentID])) {\n\t\t\t\t$ssID = $wordpressIDsToSilverstripeIDs[$wordpressParentID];\n\t\t\t\tif ($record->ParentID != $ssID) {\n\t\t\t\t\t$record->ParentID = $ssID;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$this->writeAndPublishRecord($record);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\t$this->log($record, 'error', $e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->log($record, 'nochange');\n\t\t\t}\n\t\t}\n\t\t$this->logFunctionEnd(__FUNCTION__);\n\t}",
"function Pageparams_switchTemplate($n)\n{\n global $pth, $cf, $pd_router;\n\n include_once $pth['folder']['classes'] . 'Pages.php';\n $pages = new XH_Pages();\n while (true) {\n $data = $pd_router->find_page($n);\n if (isset($data['template']) && trim($data['template']) != ''\n && is_dir($pth['folder']['templates'] . $data['template'])\n ) {\n break;\n }\n $n = $pages->parent($n);\n if (!isset($n)) {\n break;\n }\n }\n if (isset($n) && $data['template'] != $cf['site']['template']) {\n $cf['site']['template'] = $data['template'];\n $dir = $pth['folder']['templates'] . $cf['site']['template'] . '/';\n $pth['folder']['template'] = $dir;\n $pth['file']['template'] = $dir . 'template.htm';\n $pth['file']['stylesheet'] = $dir . 'stylesheet.css';\n $pth['folder']['menubuttons'] = $dir . 'menu/';\n $pth['folder']['templateimages'] = $dir . 'images/';\n }\n}",
"public function createNestedPagesAndCopyDraftParentPage() {}",
"function me_rb4_give_children_parent_template() {\n\t\tglobal $post;\n\n\t\t$curr_tmp = get_post_meta( $post->ID, '_wp_page_template', true );\n\t\t$parent_tmp = get_post_meta( $post->post_parent, '_wp_page_template', true );\n\n\t\tif ( $post->post_parent ) :\n\t\t\tupdate_post_meta( $post->ID, '_wp_page_template', $parent_tmp,$curr_tmp );\n\t\tendif;\n\t}",
"abstract public function renderChild(Page $page);",
"private function update_pages() {\n // loop through loaded data\n if ( is_array( $this->data ) ) {\n foreach ( $this->data as $guid => $items ) {\n $polyLangs = array();\n foreach ( $items as $item ) {\n $args = array();\n\n // Langversion found, add existing page specific args\n if (isset($this->queried[$guid][$item['lang']])) {\n $page = $this->queried[$guid][$item['lang']];\n\n $args['ID'] = $page->ID;\n $args['menu_order'] = $page->menu_order;\n $args['post_name'] = wp_unique_post_slug( sanitize_title( $item['title'] ), $page->ID, 'publish', 'page', $parent_id );\n\n } else {\n $args['post_name'] = wp_unique_post_slug( sanitize_title( $item['title'] ), $post_id, 'publish', 'page', $parent_id );\n }\n\n // has a parent\n if ( isset( $item['parent'] ) ) {\n $parent_guid = $item['parent'];\n $parent_id = $this->queried[$parent_guid][$item['lang']]->ID;\n } else {\n $parent_id = 0;\n }\n\n // Default values for page creation/updation\n $args['post_status'] = 'publish';\n $args['post_type'] = 'page';\n $args['post_title'] = $item['title'];\n $args['post_parent'] = $parent_id;\n $args['post_content'] = isset($item['content']) ? $item['content'] : '';\n $args['page_template'] = 'models/page-' . $item['type'] . '.php';\n\n // Create the post\n $post_id = wp_insert_post( $args );\n\n $this->update_page_meta( $post_id, $guid, $item );\n if (in_array(strtolower($item['lang']), $this->site_languages)) {\n if (function_exists('pll_set_post_language')) {\n pll_set_post_language($post_id, strtolower($item['lang']));\n }\n $polyLangs[strtolower($item['lang'])] = $post_id;\n }\n\n isset($args['ID']) ? $this->updated++ : $this->created++;\n }\n }\n // Link program page different languages for polylang\n if (!empty($polyLangs)) {\n if (function_exists('pll_save_post_translations')) {\n pll_save_post_translations($polyLangs);\n }\n }\n }\n }",
"function savePageTree() {\n\t\t\t$timeNow = time();\n\t\t\t$userId = $GLOBALS['BE_USER']->user['uid'];\n\t\t\t$pageTree = $this->t3dkptw['page'];\n\t\t\t$parentId = $this->t3dkptw['parentPage'];\n\t\t\tif (is_array($pageTree)) {\n\t\t\t\t \n\t\t\t\t$saveData = array(\n\t\t\t\t\t'pid' => intval($parentId),\n\t\t\t\t\t'title' => 'TS Templates',\n\t\t\t\t\t'doktype' => 254,\n\t\t\t\t\t'crdate' => $timeNow,\n\t\t\t\t\t'tstamp' => $timeNow,\n\t\t\t\t\t'cruser_id' => $userId,\n\t\t\t\t\t'perms_userid' => $userId,\n\t\t\t\t\t'perms_user' => 31,\n\t\t\t\t\t'perms_group' => 27,\n\t\t\t\t\t'SYS_LASTCHANGED' => $timeNow,\n\t\t\t\t\t'sorting' => 100000000 );\n\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('pages', $saveData);\n\t\t\t\t$this->TScontainerID = $GLOBALS['TYPO3_DB']->sql_insert_id();\n\t\t\t\t$this->savePageTreeLevel($pageTree, $parentId, $userId, $timeNow);\n\t\t\t}\n\t\t}",
"private function refreshHierarchy() {\n\t\t\n\t\tglobal $db;\n\n\t\t// fetch tree id's that need updating\n\t\t$treeSQL = '';\n\t\t$parentSQL = '';\n\t\tif ( $this->parentID )\n\t\t\t$parentSQL = \" , '$this->parentID' \";\n\t\t$sql = \" select distinct h.tree_id\n\t\t\t\tfrom page_hierarchy h\n\t\t\t\twhere h.page_id in ( '$this->id' $parentSQL ) \";\n\t\tif ( !$res = $db->query($sql) )\n\t\t\tError::fatal( $db->getError(), Error::SYS );\n\t\twhile ( $row = $res->fetch() )\n\t\t\t$treeSQL .= \" , '$row->tree_id' \";\n\n\t\t// delete the trees that need refreshing\n\t\t$sql = \" delete from page_hierarchy\n\t\t\t\twhere tree_id in ( -1 $treeSQL ) \";\n\t\tif ( !$db->update($sql) )\n\t\t\tError::fatal( $db->getError(), Error::SYS );\n\n\t\t// fetch all pages not in the hierarchy\n\t\t$pages = array();\n\t\t$sql = \" select p.id, p.parent_id\n\t\t\t\tfrom pages p\n\t\t\t\twhere p.id not in (\n\t\t\t\t\tselect page_id\n\t\t\t\t\tfrom page_hierarchy\n\t\t\t\t) \";\n\t\tif ( !$res = $db->query($sql) )\n\t\t\tError::fatal( $db->getError(), Error::SYS );\n\t\twhile ( $row = $res->fetch() )\n\t\t\t$pages[] = $row;\n\n\t\t// fetch a new tree id to use\n\t\t$sql = \" select max(h.tree_id) as maxTreeID\n\t\t\t\tfrom page_hierarchy h \";\n\t\tif ( !$res = $db->query($sql) )\n\t\t\tError::fatal( $db->query($sql), Error::SYS );\n\t\t$row = $res->fetch();\n\t\t$treeID = $row->maxTreeID + 1;\n\n\t\t// find root nodes to build tree from\n\t\tforeach ( $pages as $page )\n\t\t\tif ( !$page->parent_id )\n\t\t\t\tPage::createHierarchyNode( $pages, $page, $treeID++, 1 );\n\n\t}",
"public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }",
"public function _edit_tree()\n {\n if (get_option('wiki_enable_children') == '0') {\n warn_exit(do_lang_tempcode('INTERNAL_ERROR'));\n }\n\n $_title = get_screen_title('WIKI_EDIT_TREE');\n\n $_id = get_param_wiki_chain('id');\n $id = $_id[0];\n\n if (!has_category_access(get_member(), 'wiki_page', strval($id))) {\n access_denied('CATEGORY_ACCESS');\n }\n\n $child_links = post_param_string('children');\n\n $member = get_member();\n check_privilege('wiki_manage_tree', array('wiki_page', $id));\n\n $hide_posts = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'hide_posts', array('id' => $id));\n $page_title = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'title', array('id' => $id));\n if (get_option('wiki_enable_content_posts') == '0') {\n $hide_posts = 1;\n }\n\n if ((substr($child_links, -1, 1) != \"\\n\") && (strlen($child_links) > 0)) {\n $child_links .= \"\\n\";\n }\n $no_children = substr_count($child_links, \"\\n\");\n if ($no_children > 300) {\n warn_exit(do_lang_tempcode('TOO_MANY_WIKI_CHILDREN'));\n }\n $start = 0;\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id));\n require_code('seo2');\n for ($i = 0; $i < $no_children; $i++) {\n $length = strpos($child_links, \"\\n\", $start) - $start;\n $new_link = trim(substr($child_links, $start, $length));\n $start = $start + $length + 1;\n if ($new_link != '') {\n // Find ID and title\n $q_pos = strpos($new_link, '=');\n $child_id_on_start = (($q_pos !== false) && ($q_pos > 0) && (is_numeric(substr($new_link, 0, $q_pos))));\n\n if ($child_id_on_start) { // Existing\n $title = substr(substr($new_link, $q_pos + 1), 0, 255);\n $child_id = intval(substr($new_link, 0, $q_pos));\n if ($child_id == $id) {\n continue;\n }\n $title_id = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $child_id));\n if (is_null($title_id)) {\n attach_message(do_lang_tempcode('BROKEN_WIKI_CHILD_LINK', strval($child_id)), 'warn');\n continue;\n }\n if ($title == '') {\n $title = get_translated_text($title_id);\n } else {\n if (get_translated_text($title_id) != $title) {\n require_code('urls2');\n suggest_new_idmoniker_for('wiki', 'browse', strval($child_id), '', $title);\n $GLOBALS['SITE_DB']->query_update('wiki_pages', lang_remap('title', $title_id, $title), array('id' => $child_id), '', 1);\n }\n }\n } else { // New\n $title = substr($new_link, 0, 255);\n $child_id = wiki_add_page($title, '', '', $hide_posts, null, null, 0, '', '', null, false);\n\n require_code('permissions2');\n set_global_category_access('wiki_page', $child_id);\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id, 'child_id' => $child_id), '', 1); // Just in case it was repeated\n $GLOBALS['SITE_DB']->query_insert('wiki_children', array('parent_id' => $id, 'child_id' => $child_id, 'the_order' => $i, 'title' => $title));\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n }\n\n log_it('WIKI_EDIT_TREE', strval($id), get_translated_text($page_title));\n\n // Show it worked / Refresh\n $url = get_param_string('redirect');\n return redirect_screen($_title, $url, do_lang_tempcode('SUCCESS'));\n }",
"public function createPageAndCopyDraftParentPage() {}",
"public function setAndMakeRoomForNewPage(Page $page)\n {\n if ( ! $page->parent->rgt) {\n $this->addToNestedSet($page->parent);\n }\n\n $parentRgt = $page->parent->rgt;\n\n $page->lft = $parentRgt;\n $page->rgt = $parentRgt + 1;\n\n $page->level = $page->parent->getLevel() + 1;\n\n $this->db->update(Page::TABLE, [Page::FIELD_RGT], [new RawValue(\"rgt + 2\")], \"rgt >= \" . $parentRgt);\n $this->db->update(Page::TABLE, [Page::FIELD_LFT], [new RawValue(\"lft + 2\")], \"lft >= \" . $parentRgt);\n }",
"abstract public function SetTemplatePage($params=[],$extra_params=[]);",
"public function updatePage($id, $data)\n\t{\n\t\t//find page\n\t\t$row = $this->find($id)->current();\n\t\tif($row)\n\t\t{\n\t\t\t//clear any cached records that are tagged to this page\n\t\t\t$cache = Zend_Registry::get('cache');\n\t\t\t$tag = \"page_\".$id;\n\t\t\t$cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array($tag));\n\t\t\t\n\t\t\t//update the columns\n\t\t\t$row->name = $data['name'];\n\t\t\t$row->parent_id = $data['parent_id'];\n\t\t\t$row->save();\n\t\t\t\n\t\t\t//unset the data pages data, leaving only \n\t\t\t//the data for the content_nodes table\n\t\t\tunset($data['id']);\n\t\t\tunset($data['name']);\n\t\t\tunset($data['parent_id']);\n\t\t\t\n\t\t\t//now loop thru the rest of the data \n\t\t\t//and set it on the content_nodes table\n\t\t\tif(count($data) > 0)\n\t\t\t{\n\t\t\t\t$contentNodeModel = new Model_ContentNode();\n\t\t\t\tforeach($data as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\t$contentNodeModel->setNode($id, $k, $v);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Zend_Exception('Could not open the page to update!');\n\t\t\t}\n\t\t}\n\t}",
"protected function runRecursive($parentPage) {\n\t\t$this->workOnTypoScriptRecordsOfPage($parentPage);\n\n\t\t/** @var t3lib_db $database */\n\t\t$database = $GLOBALS['TYPO3_DB'];\n\n\t\t$pages = $database->exec_SELECTquery(\n\t\t\t'pid, uid, title',\n\t\t\t'pages',\n\t\t\t'deleted = 0 AND pid = ' . $parentPage['uid']\n\t\t);\n\n\t\twhile (($page = $database->sql_fetch_assoc($pages))) {\n\t\t\t$this->runRecursive($page);\n\t\t}\n\t}",
"function main_page($content,$conf) {\n\t\t$this->conf =$conf;\n\n\t\t\t// Current page record which we MIGHT manipulate a little:\n\t\t$pageRecord = $GLOBALS['TSFE']->page;\n\t\t$this->tmplTFdata = unserialize($pageRecord['tx_typoflash_data']);\n\t\t$this->tmplTFdata = $this->tmplTFdata[$pageRecord['tx_typoflash_template']];\n\t\t\n\t\t\t// Find Template in root line IF there is no Data Structure set for the current page:\n\t\tif (!$pageRecord['tx_typoflash_template'])\t{\n\t\t\t\n\t\t\tforeach($GLOBALS['TSFE']->tmpl->rootLine as $pRec)\t{\n\t\t\t\t\n\t\t\t\tif ($pageRecord['uid'] != $pRec['uid'])\t{\n\t\t\t\t\tif ($pRec['tx_typoflash_template'])\t{\t// If there is a next-level DS:\n\t\t\t\t\t\t$pageRecord['tx_typoflash_template'] = $pRec['tx_typoflash_template'];\n\t\t\t\t\t\t$this->tmplTFdata = unserialize($pRec['tx_typoflash_data']);\n\t\t\t\t\t\t$this->tmplTFdata = $this->tmplTFdata[$pRec['uid']];\n\t\t\t\t\t} \n\t\t\t\t} else break;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\treturn $this->renderElement($pageRecord, 'pages');\n\n }",
"protected function getUpdatablePages() {}",
"public function pageItemTree($parent, $output = '')\n {\n $this->db->join('language', 'language.language_code = page.language_code', 'LEFT');\n $this->db->where('parent_id', $parent);\n $this->db->where('page.language_code', 'en');\n $this->db->order_by('sort_order', 'ASC');\n $query = $this->db->get('page');\n if ($query->num_rows() > 0) {\n if ($parent == 0) {\n $output .= '<ul id=\"pagetree\">' . \"\\r\\n\";\n } else {\n $output .= \"<ul style='display:block;'>\\r\\n\";\n }\n foreach ($query->result_array() as $row) {\n if ($row['page_type'] != 'system_page') {\n //var_dump($row);\n //link edit\n $edit_href = 'cms/page/edit/' . $row['page_id'] . '/2';\n\n //language\n $language = ' <span style=\"padding-left: 20px; color: #bbb\">' . $row['page_uri'] . ' ';\n if ($row['language_code'] != 'en') {\n $language = '(' . $row['language'] . ')';\n }\n $language .= '</span>';\n\n //link delete\n $del_href = 'cms/page/delete/' . $row['page_id'];\n\n //link split versions\n $splitversion_href = 'cms/page_version/index/' . $row['page_id'];\n\n //link blockd\n $block_href = 'cms/block/index/' . $row['page_id'];\n\n //link blockd\n $Pagebulider_href = 'cms/pagebuilder/index/' . $row['page_id'];\n\n //link duplicate page\n $duplicate_href = 'cms/page/duplicate/' . $row['page_id'];\n\n //link translate page\n $translate_href = 'cms/translate/index/' . $row['page_id'];\n\n //older split versions\n $olderversion_href = 'older_version/index/' . $row['page_id'];\n\n $pageBuilder_link = \"\";\n $page_arr = [1, 3, 8];\n if (in_array($row['page_template_id'], $page_arr)) {\n $pageBuilder_link = \"<a href=\\\"\" . $Pagebulider_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Page Builder'> <i class='glyphicon glyphicon-th-large'></i></a> |\";\n }\n //$output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> <a href=\\\"\" . $translate_href . \"\\\">Translate</a> | <a href=\\\"\" . $duplicate_href . \"\\\">Duplicate Page</a> | <a href=\\\"\" . $block_href . \"\\\"> Manage Blocks</a> | <a href=\\\"\" . $edit_href . \"\\\">Edit</a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\">Delete</a> | <a href=\\\"\" . $splitversion_href . \"\\\">Split Versions</a></div></div>\";\n // $output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> <a href=\\\"\" . $Pagebulider_href . \"\\\"> Page Builder </a> | <a href=\\\"\" . $block_href . \"\\\"> Manage Blocks</a> | <a href=\\\"\" . $edit_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Edit'><i class='glyph-icon icon-linecons-pencil'></i></a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Delete'><i class='glyph-icon icon-linecons-trash red-color'></i></a></div></div>\";\n $output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> $pageBuilder_link <a href=\\\"\" . $edit_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Edit'><i class='glyph-icon icon-linecons-pencil'></i></a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Delete'><i class='glyph-icon icon-linecons-trash red-color'></i></a></div></div>\";\n $output = $this->pageItemTree($row['page_id'], $output);\n $output .= \"</li>\\r\\n\";\n }\n }\n $output .= \"</ul>\\r\\n\";\n }\n return $output;\n }",
"protected function updateChildsPath($page)\n {\n $page->descendants->each(function ($child) {\n $child->path = $child->getFullPath();\n $child->save();\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse the target dom | private function parse_dom()
{
$contents = $this->acquire_contents($this->url_target); //get file contents
$this->dom = new DOMDocument();
@$this->dom->loadHTML($contents); //nothing display
return $this->dom;
} | [
"private function parse_dom()\r\n\t{\r\n\t\t$contents = $this->acquire_contents($this->url_target);\t//get file contents\r\n\t\t$this->dom = new DOMDocument();\r\n\t\t@$this->dom->loadHTML($contents);\t//nothing display\r\n\t}",
"public abstract function getParse($dom);",
"abstract protected function consumeDom();",
"private function parse() {\n $this->text = $this->iterate_over_node($this->DOM);\n }",
"function parse_dom($html) { \n return get_dom_tree($html); //domparser.php\n}",
"private function _parseHTML()\r\n {\r\n $this->_tidyHTML();\r\n $this->_domHTML = new \\DOMDocument();\r\n $this->_domHTML->preserveWhiteSpace = false;\r\n //the following option tries to recover poorly formed documents\r\n $this->_domHTML->recover = true;\r\n $this->_domHTML->preserveWhiteSpace = true;\r\n $this->_domHTML->formatOutput = false;\r\n $this->_domHTML->loadXML($this->_html);\r\n //if titles are to be in uppercase we have to preparse the HTML string\r\n if ($this->_titles == 'uppercase') {\r\n $this->_str = $this->_titlesToUppercase();\r\n }\r\n $root = $this->_domHTML->documentElement;\r\n $this->_parseHTMLNode($root);\r\n }",
"public function parse()\n {\n// $page = preg_replace('{<script>.*?</script>}i', '<script></script>', $page);\n// $page = preg_replace('{<style>.*?</style>}i', '<style></style>', $page);\n// $page = preg_replace(\"{\\r|\\n}\", ' ', $page);\n $matches = [];\n preg_match_all(self::PATTERN, $this->html, $matches);\n $this->tags = $matches[1];\n foreach ($this->tags as &$tag) {\n $tag = strtolower($tag);\n }\n }",
"protected function _domFromBody()\r\n\t{\r\n\t\t$this->_dom = Art_DOM::loadDOMFromString($this->_body);\r\n\t}",
"private function _loadDOM()\n\t {\n\t\t$this->dom = new DOMDocument();\n\t\t@$this->dom->loadHTML($this->html);\n\t\t$this->xpath = new DOMXPath($this->dom);\n\t }",
"public function parseHtmlDom( simple_html_dom $html ) {\n \n }",
"public function parse($html);",
"public function parseDom(\\DOMDocument $xml);",
"private function parse()\n {\n $matches = self::parseInput($this->source);\n foreach ($matches as $match) {\n // Get format\n switch ($match['kind']) {\n // ENTITY node\n case '!ENTITY':\n // Trim quotation marks and white space.\n $this->entities['%' . $match['name'] . ';'] =\n trim($match['value'], \" \\t\\n\\r\\0\\x0B\\\"\");\n break;\n // ATTLIST node\n case '!ATTLIST':\n $this->attrLists[$match['name']] = $match['value'];\n break;\n // ELEMENT node\n case '!ELEMENT':\n $this->elements[$match['name']] = $match['value'];\n break;\n default:\n break;\n }\n }\n }",
"public function parseTargetElements(&$data)\n {\n $result = array();\n /**\n *@uses Parsonline_Parser_Html\n */\n $parser = new Parsonline_Parser_Html();\n $parser->setContents($data);\n unset($data);\n \n if ( in_array(self::ELEMENT_STYLESHEET, $this->_targetElements) ) {\n $result[self::ELEMENT_STYLESHEET] = $parser->parseStyleSheetReferences();\n }\n \n if ( in_array(self::ELEMENT_LINK, $this->_targetElements) ) {\n $links = $parser->parseLinkReferences();\n // ignore previous style sheet link objects in the link elements\n if ( isset($result[self::ELEMENT_STYLESHEET]) ) {\n $result[self::ELEMENT_LINK] = array();\n foreach($links as $link) {\n if ( !in_array($link, $result[self::ELEMENT_STYLESHEET]) ) {\n $result[self::ELEMENT_LINK][] = $link;\n }\n }\n } else {\n $result[self::ELEMENT_LINK] = $links;\n }\n unset($links);\n }\n \n if ( in_array(self::ELEMENT_SCRIPT, $this->_targetElements) ) {\n $result[self::ELEMENT_SCRIPT] = $parser->parseScriptReferences();\n }\n \n if ( in_array(self::ELEMENT_IMAGE, $this->_targetElements) ) {\n $result[self::ELEMENT_IMAGE] = $parser->parseImageReferences();\n }\n \n return $result;\n }",
"abstract public function getDomObject();",
"public function parse(){\n $this->open();\n\n $this->_getOPF();\n $this->_getDcData();\n $this->_getManifest();\n $this->_getSpine();\n $this->_getTOC();\n\n $this->close();\n }",
"public function parse($url)\n {\n $this->url = $url;\n $this->error = null;\n $this->elements = [];\n if (!$this->urlValid($url)) {\n $this->error = 'URL указывает на несуществующую страницу';\n return;\n }\n\n // Load the url's contents into the DOM\n $source = file_get_contents($url);\n $source = mb_convert_encoding($source, 'HTML-ENTITIES', 'utf-8');\n $dom = new DOMDocument(); \n @$dom->loadHTML($source);\n\n // Find all elements by tag\n $elements = $dom->getElementsByTagName($this->tag);\n if (!$elements->length) {\n $this->error = 'Элементов не найдено';\n return;\n } \n foreach ($elements as $element)\n $this->elements[] = $element->textContent;\n }",
"private function parsePage()\n {\n if (!class_exists('DOMDocument')) {\n return;\n }\n\n $html = $this->getURL($this->__url);\n $metadata = array();\n\n // parsing begins here\n if ($this->__encoding == null || $this->__encoding == 'utf8') {\n $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');\n }\n\n $doc = new DOMDocument();\n if (!@$doc->loadHTML($html)) {\n return;\n }\n $nodes = $doc->getElementsByTagName('title');\n\n // get title & other meta\n $metadata['title'] = $nodes->item(0)->nodeValue;\n $metas = $doc->getElementsByTagName('meta');\n\n for ($i = 0; $i < $metas->length; $i++) {\n $meta = $metas->item($i);\n\n if ($meta->getAttribute('name') == 'description') {\n $metadata['description'] = $meta->getAttribute('content');\n }\n\n if ($this->__encoding === null\n && strtolower($meta->getAttribute('http-equiv')) == 'content-type'\n && $this->processContentType($meta->getAttribute('content'))\n ) {\n return $this->parsePage();\n }\n }\n\n array_walk($metadata, array($this, 'stripStr'));\n\n $this->title = ($metadata['title'] !== null) ? $metadata['title'] : null;\n $this->description = (isset($metadata['description']) && $metadata['description'] !== null)\n ? $metadata['description'] : null;\n }",
"abstract public function getHTMLNodes();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a user and an auth token from a request. | public function createUserAndAuthTokenFromRequest(Request $request)
{
$user = $this
->userFactory
->makeNewUser($request->name, $request->email, $request->password);
return $this->createAuthTokenFromRequest($request, $user);
} | [
"public function makeUser($request);",
"public function createUserWithToken(TokenInterface $token);",
"protected function createApiUser()\n {\n if (null !== static::$userId) {\n return;\n }\n\n $response = $this->getDataProvider()->client->request(\n 'GET', $this->apiUserEndpoint, [\n 'cookies' => $jar = new CookieJar,\n ]\n );\n\n foreach ($jar->toArray() as $cookie) {\n static::$cookies[$cookie['Name']] = $cookie['Value'];\n }\n\n $user = json_decode($response->getBody()->getContents());\n\n if (!$user) {\n return;\n }\n\n static::$userId = $user->userIdentifier;\n static::$CSRFToken = $response->getHeader('X-CSRF-TOKEN');\n }",
"protected function createCustomUserAndGetToken(){\n $this->post('api/users', $this->perfectCustomUser);\n $this->assertResponseStatus(201);\n $this->post('api/auth', ['email' => 'hardik.130410116061@gmail.com', 'password' => 'testing', 'authType' => 'custom']);\n $this->assertResponseStatus(200);\n $this->assertArrayHasKey('access_token', $this->lastResponse()['data']);\n return $this->lastResponse()['data']['access_token'];\n }",
"private function setAuthUserToken()\n {\n $authUser = factory(App\\User::class)->create();\n\n $this->authUser = $authUser;\n $this->authUserToken = JWTAuth::fromUser($authUser);\n }",
"private function generateUserToken()\n {\n $username = 'wecine';\n $password = 'wecine';\n $I = $this;\n\n $I->haveHttpHeader('Content-Type', 'application/json');\n $I->sendPOST('/login_check', ['username' => $username, 'password' => $password]);\n $response = $I->grabResponse();\n $responseArray = json_decode($response, true);\n\n if (is_array($responseArray) && isset($responseArray['token'])) {\n $this->userToken = $responseArray['token'];\n }\n }",
"protected function createUser()\n {\n $aResponse = $this->getResponse();\n $oUser = new User;\n if (!$oUser->getCustomerIdByPayoneUserId($aResponse['userid'])) {\n $sCustomerId = \\Context::getContext()->cart->id_customer;\n $oUser->setCustomerId($sCustomerId);\n $oUser->setPayoneUserId($aResponse['userid']);\n $oUser->save();\n }\n }",
"public function auth(){\n $this->cors();\n if($this->getRequestType() !== \"POST\") {\n $this->requestError(405);\n }\n $request = $this->getRequestParams();\n $requiredParams = [\"login\", \"password\"];\n foreach($requiredParams as $param){\n if(!isset($request[$param]) || $request[$param] == '' ){\n $this->sendResponse([\"success\" => 0, \"message\" => $param.\" parameter is message\"]);\n }\n }\n\n $user = User::model()->findByLogin($request[\"login\"]);\n if($user == null){\n $this->sendResponse([\"success\" => 0, \"message\" => 'login not found']);\n }else{\n if($user->password === md5($request[\"password\"])){\n $token = $user->generateToken();\n $user->token = $token;\n $user->save();\n }else{\n $this->requestError(401);\n }\n }\n\n $this->sendResponse([\"success\" => 1, \"data\" => [\"token\" => $token]]);\n }",
"public function post($request){\n\t\t// forwards request on to User\n\t\t$user = new UserResource($this->parameters);\n\t\treturn $user->post($request);\t\t\n\t}",
"public function store(Request $request, Token $token, User $user);",
"public function createToken() {\n\t\treturn $this->client->callMethod('auth.createToken');\n\t}",
"public function createAccessToken() {\n $this->createToken('UserTok');\n }",
"public function createOrUpdateUser()\n {\n if ($this->getSession()->has('token')) {\n $this->updateUser();\n } else {\n $this->createUser();\n }\n }",
"private function createUser(){\n\t\t\t$this->log->info(H_LINE);\n\t\t\t$this->log->info(__FUNCTION__ . SPACE . METHOD_STARTS);\n\t\t\t$userDao = new UserDao();\n\t\t\t$response = $userDao->createUser($this->inputDataMap);\n\t\t\tif($response['status'] == SUCCESS){\n\t\t\t\t$dataMap = $this->inputDataMap;\n\t\t\t\t$password = $dataMap['password'];\n\t\t\t\t$this->generateHashedPassword($response['userId'], $password);\n\t\t\t\t$this->generateOtp($response['userId'], EMAIL);\n\t\t\t\t$this->generateOtp($response['userId'], MOBILE);\n\t\t\t}\n\t\t\t$this->log->info(__FUNCTION__ . SPACE . METHOD_ENDS);\n\t\t\treturn $response;\n\t\t}",
"public function createToken();",
"public function createUser()\n {\n $body = $this->request->getParsedBody();\n\n $userValidator = Validator::arrayType()\n ->key(\n 'username',\n Validator::stringType()\n ->noWhitespace()\n ->alnum('-_')\n ->length(4, 200)\n )\n ->key(\n 'email',\n Validator::email()\n )\n ->key(\n 'password',\n Validator::stringType()\n ->notEmpty()\n ->length(6, 255)\n );\n\n if (!$userValidator->validate($body)) {\n return $this->status(400);\n }\n\n $repo = new UsersRepository();\n\n $status = $repo->create($body);\n\n if ($status === 201) {\n return $this->status(201);\n }\n\n if ($status === 409) {\n return $this->status(409);\n }\n \n if ($status === 500) {\n return $this->status(500);\n }\n }",
"public function create_personal_access_token_for_user_successfully()\n {\n $user = User::create([\n \"name\" => \"John Doe\",\n \"email\" => \"john@example.com\",\n \"password\" => bcrypt(\"test1337\")\n ]);\n\n $personalAccessTokenResult = $user->createToken(\"Personal Access Token\");\n $accessToken = $personalAccessTokenResult->accessToken; // @type string\n $token = $personalAccessTokenResult->token; // @type \\Laravel\\Passport\\Token\n\n $user->withAccessToken($token);\n\n $this->assertInternalType(\"string\", $accessToken);\n\n $headers = [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer ' . $accessToken,\n ];\n\n $this->assertNotNull($this->tokenRepository->findForUser($token->id, $user->id));\n\n // Defining scopes. This should normally be placed into\n // AuthServiceProvider->boot()\n Passport::tokensCan([\n 'can-place-orders' => 'Being able to place orders',\n 'can-destroy-world' => 'Can destroy the whole f****** world',\n ]);\n\n\n $response = $this->json('post', '/oauth/personal-access-tokens', [\n \"name\" => \"Awesome Token\",\n \"scopes\" => [\n 'can-place-orders',\n 'can-destroy-world'\n ]\n ], $headers);\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'accessToken',\n 'token' => [\n 'id',\n 'user_id',\n 'client_id',\n 'name',\n 'scopes',\n 'revoked',\n 'created_at',\n 'updated_at',\n 'expires_at'\n ]\n ]);\n }",
"public function createUser(SamlTokenInterface $token);",
"public function createUserWebAuthnAction(Request $request)\n {\n // Make sure that the client is providing something that we can consume\n $consumes = ['application/json'];\n if (!static::isContentTypeAllowed($request, $consumes)) {\n // We can't consume the content that the client is sending us\n return new Response('', 415);\n }\n\n // Figure out what data format to return to the client\n $produces = ['application/json'];\n // Figure out what the client accepts\n $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';\n $responseFormat = $this->getOutputFormat($clientAccepts, $produces);\n if ($responseFormat === null) {\n return new Response('', 406);\n }\n\n // Handle authentication\n // Authentication 'csrf' required\n // Set key with prefix in header\n $securitycsrf = $request->headers->get('X-CSRF-TOKEN');\n\n // Read out all input parameter values into variables\n $userWebAuthnCreateWithKey = $request->getContent();\n\n // Use the default value if no value was provided\n\n // Deserialize the input values that needs it\n try {\n $inputFormat = $request->getMimeType($request->getContentType());\n $userWebAuthnCreateWithKey = $this->deserialize($userWebAuthnCreateWithKey, 'OpenAPI\\Server\\Model\\UserWebAuthnCreateWithKey', $inputFormat);\n } catch (SerializerRuntimeException $exception) {\n return $this->createBadRequestResponse($exception->getMessage());\n }\n\n // Validate the input values\n $asserts = [];\n $asserts[] = new Assert\\NotNull();\n $asserts[] = new Assert\\Type(\"OpenAPI\\Server\\Model\\UserWebAuthnCreateWithKey\");\n $asserts[] = new Assert\\Valid();\n $response = $this->validate($userWebAuthnCreateWithKey, $asserts);\n if ($response instanceof Response) {\n return $response;\n }\n\n\n try {\n $handler = $this->getApiHandler();\n\n // Set authentication method 'csrf'\n $handler->setcsrf($securitycsrf);\n \n // Make the call to the business logic\n $responseCode = 200;\n $responseHeaders = [];\n $result = $handler->createUserWebAuthn($userWebAuthnCreateWithKey, $responseCode, $responseHeaders);\n\n // Find default response message\n $message = '';\n\n // Find a more specific message, if available\n switch ($responseCode) {\n case 200:\n $message = 'OK';\n break;\n case 403:\n $message = 'Unauthorized';\n break;\n }\n\n return new Response(\n $result !== null ?$this->serialize($result, $responseFormat):'',\n $responseCode,\n array_merge(\n $responseHeaders,\n [\n 'Content-Type' => $responseFormat,\n 'X-OpenAPI-Message' => $message\n ]\n )\n );\n } catch (Exception $fallthrough) {\n return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function get_time_zones_for_number Returns an array of timezones for which the PhoneNumber object supplied belongs in. | public function get_time_zones_for_number($phone_number = '', $region = NULL)
{
$inputParams = array(
'phone_number' => $phone_number,
'region' => $region
);
$this->logger->info(__FUNCTION__, 'Input Params: ', $inputParams);
if (empty($phone_number)) {
$this->logger->debug(__FUNCTION__, 'Phone Number input is Empty!');
return NULL;
}
$phone_number = trim($phone_number);
try {
$phoneNumberUtil = PhoneNumberUtil::getInstance();
$use_region = NULL !== $region ? strtoupper($region) : self::DEFAULT_REGION;
$phoneNumberObject = $phoneNumberUtil->parse(trim($phone_number), $use_region);
$timezoneMapper = PhoneNumberToTimeZonesMapper::getInstance();
$result = $timezoneMapper->getTimeZonesForNumber($phoneNumberObject);
$this->logger->debug(__FUNCTION__, 'Use REGION: ' . $use_region);
$this->logger->info(__FUNCTION__, 'Final Result: ', $result);
return $result;
}
catch (Exception $e) {
$message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
$this->logger->error(__FUNCTION__, $message);
return NULL;
}
} | [
"public function getTimeZonesForGeographicalNumber(PhoneNumber $number)\n {\n return $this->getTimeZonesForGeocodableNumber($number);\n }",
"public function list_timezones() {\n\t\t$timezones = array();\n\t\tforeach(DateTimeZone::listIdentifiers() as $ts) {\n\t\t\tif(strpos($ts,'/')) {\n\t\t\t\tlist($region, $country) = explode('/', $ts);\n\t\t\t\t$timezones[$country] = $region;\n\t\t\t} else {\n\t\t\t\t$timezones[$ts] = false;\n\t\t\t}\n\t\t}\n\t\tksort($timezones);\n\t\treturn $timezones;\n\t}",
"public function timezones() {\n\t\t$result = array();\n\t\t$timezone_array = timezone_identifiers_list();\n\t\tforeach ($timezone_array as $zone) {\n\t\t\t$result[$zone] = $zone;\n\t\t}\n\t\treturn $result;\n\t}",
"public function getTimezones() {\n\t\treturn $this->_call('timezones/list');\n\t}",
"function listTimezones(): array\n {\n return collect(\\DateTimeZone::listIdentifiers())\n ->mapWithKeys(fn ($tz) => [$tz => str_replace('_', ' ', $tz)])\n ->toArray();\n }",
"private static function getTimezones(): array\n {\n $timezones = [];\n\n foreach (\\DateTimeZone::listIdentifiers() as $timezone) {\n $parts = explode('/', $timezone);\n\n if (\\count($parts) > 2) {\n $region = $parts[0];\n $name = $parts[1] . ' - ' . $parts[2];\n } elseif (\\count($parts) > 1) {\n $region = $parts[0];\n $name = $parts[1];\n } else {\n $region = 'Other';\n $name = $parts[0];\n }\n\n $timezones[$region][str_replace('_', ' ', $name)] = $timezone;\n }\n\n return $timezones;\n }",
"public static function getTimeZones()\n {\n if (self::$timeZones === null) {\n self::$timeZones = array();\n foreach (DateTimeZone::listIdentifiers() as $timezone) {\n // Break into continent and region and ignore non-geographical zones.\n $parts = explode('/', $timezone);\n if (count($parts) == 1) {\n continue;\n }\n $continent = array_shift($parts);\n $region = str_replace('_', ' ', implode(' - ', $parts));\n self::$timeZones[ $continent ][ $timezone ] = $region;\n }\n }\n\n return self::$timeZones;\n }",
"public static function getTimeZoneList()\n\t{\n\t\treturn \\CTimeZone::getZones();\n\t}",
"static function getTimezones() {\n return self::$adapter->getTimezones();\n }",
"public function GetTimezoneTimezones()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_user_timezone\");\r\n\t}",
"function get_timezones()\n{\n return Time::GetTimeZonesList();\n}",
"public function allTimeZones()\r\n {\r\n $datetime = new \\DateTimeZone(\"EDT\");\r\n\r\n $timezones = $datetime->listIdentifiers();\r\n $timezone_list = [];\r\n foreach ($timezones as $timezone) {\r\n $timezone_list[$timezone] = $timezone;\r\n }\r\n\r\n return $timezone_list;\r\n }",
"function timeZoneList()\n {\n return \\Cache::rememberForever('timezones', function () {\n $optionsArray = timezone_identifiers_list();\n $timezones = [];\n foreach ($optionsArray as $key => $timezone) {\n $timezones[$timezone] = $timezone;\n }\n\n return $timezones;\n });\n }",
"public static function tz_list() {\n $zones_array = array();\n $timestamp = time();\n foreach(timezone_identifiers_list() as $zone) {\n date_default_timezone_set($zone);\n $zones_array[$zone] = 'UTC/GMT ' . date('P', $timestamp) .' - ' . $zone;\n \n }\n return $zones_array;\n }",
"public static function provideTimezones()\n {\n return [\n [\n SapDateTime::SAP_TIMESTAMP,\n '20200301000102',\n new \\DateTimeZone('CET'),\n '2020-03-01T00:01:02+01:00',\n '2020-02-29T23:01:02+00:00'\n ],\n [\n 'Y-m-d H:i:s',\n '2020-03-01 00:01:02',\n new \\DateTimeZone('CET'),\n '2020-03-01T00:01:02+01:00',\n '2020-02-29T23:01:02+00:00'\n ],\n [\n SapDateTime::SAP_DATE,\n '20200301',\n new \\DateTimeZone('CET'),\n '2020-03-01T00:00:00+01:00',\n '2020-02-29T23:00:00+00:00'\n ]\n ];\n }",
"public function getTimezoneList()\r\n {\r\n $request = new Zend_Service_RememberTheMilk_Request();\r\n $request->setMethod('rtm.timezones.getList');\r\n $request->useAuth(false);\r\n $request->useTimeline(false);\r\n\r\n $response = $this->_request($request);\r\n return new Zend_Service_RememberTheMilk_TimezoneList($response);\r\n }",
"function tz_list() {\n\t$zones_array = array();\n\t$timestamp = time();\n\tforeach (timezone_identifiers_list() as $key => $zone) {\n\t\tdate_default_timezone_set($zone);\n\t\t$zones_array[$key]['zone'] = $zone;\n\t\t$zones_array[$key]['diff_from_GMT'] = 'UTC/GMT ' . date('P', $timestamp);\n\t\t$zones_array[$key]['GMT'] = date('P', $timestamp);\n\t}\n\treturn $zones_array;\n}",
"public function tz_list() \n{\n $zones_array = array();\n $timestamp = time();\n foreach(timezone_identifiers_list() as $key => $zone) {\n date_default_timezone_set($zone);\n $zones_array[$key]['zone'] = $zone;\n $zones_array[$key]['diff_from_GMT'] = 'UTC/GMT ' . date('P', $timestamp);\n }\n return $zones_array;\n}",
"public function getTimezoneList()\r\r\r\n {\r\r\r\n /* \r\r\r\n if(!count($this->_timezoneList))\r\r\r\n {\r\r\r\n $options = $this->getTimezoneOptions();\r\r\r\n \r\r\r\n $timezones = $this->_getTerritoryToTimezoneList();\r\r\r\n \r\r\r\n foreach($timezones as $_key=>$_value)\r\r\r\n {\r\r\r\n if(isset($options[$_key]))\r\r\r\n {\r\r\r\n $this->_timezoneList[$_key]= $options[$_key];\r\r\r\n }\r\r\r\n else\r\r\r\n {\r\r\r\n $this->_timezoneList[$_key]= $_key; \r\r\r\n }\r\r\r\n \r\r\r\n } \r\r\r\n }\r\r\r\n \r\r\r\n return $this->_timezoneList;\r\r\r\n */\r\r\r\n return array\r\r\r\n ('Africa/Abidjan'=>'Africa/Abidjan\r\r\r\n ','Africa/Accra'=>'Africa/Accra\r\r\r\n ','Africa/Addis_Ababa'=>'Africa/Addis_Ababa\r\r\r\n ','Africa/Algiers'=>'Africa/Algiers\r\r\r\n ','Africa/Asmera'=>'Africa/Asmera\r\r\r\n ','Africa/Bamako'=>'Africa/Bamako\r\r\r\n ','Africa/Bangui'=>'Africa/Bangui\r\r\r\n ','Africa/Banjul'=>'Africa/Banjul\r\r\r\n ','Africa/Bissau'=>'Africa/Bissau\r\r\r\n ','Africa/Blantyre'=>'Africa/Blantyre\r\r\r\n ','Africa/Brazzaville'=>'Africa/Brazzaville\r\r\r\n ','Africa/Bujumbura'=>'Africa/Bujumbura\r\r\r\n ','Africa/Cairo'=>'Egypt Standard Time\r\r\r\n ','Africa/Casablanca'=>'Morocco Standard Time\r\r\r\n ','Africa/Ceuta'=>'Africa/Ceuta\r\r\r\n ','Africa/Conakry'=>'Africa/Conakry\r\r\r\n ','Africa/Dakar'=>'Africa/Dakar\r\r\r\n ','Africa/Dar_es_Salaam'=>'Africa/Dar_es_Salaam\r\r\r\n ','Africa/Djibouti'=>'Africa/Djibouti\r\r\r\n ','Africa/Douala'=>'Africa/Douala\r\r\r\n ','Africa/El_Aaiun'=>'Africa/El_Aaiun\r\r\r\n ','Africa/Freetown'=>'Africa/Freetown\r\r\r\n ','Africa/Gaborone'=>'Africa/Gaborone\r\r\r\n ','Africa/Harare'=>'Africa/Harare\r\r\r\n ','Africa/Johannesburg'=>'South Africa Standard Time\r\r\r\n ','Africa/Kampala'=>'Africa/Kampala\r\r\r\n ','Africa/Khartoum'=>'Africa/Khartoum\r\r\r\n ','Africa/Kigali'=>'Africa/Kigali\r\r\r\n ','Africa/Kinshasa'=>'Africa/Kinshasa\r\r\r\n ','Africa/Lagos'=>'W. Central Africa Standard Time\r\r\r\n ','Africa/Libreville'=>'Africa/Libreville\r\r\r\n ','Africa/Lome'=>'Africa/Lome\r\r\r\n ','Africa/Luanda'=>'Africa/Luanda\r\r\r\n ','Africa/Lubumbashi'=>'Africa/Lubumbashi\r\r\r\n ','Africa/Lusaka'=>'Africa/Lusaka\r\r\r\n ','Africa/Malabo'=>'Africa/Malabo\r\r\r\n ','Africa/Maputo'=>'Africa/Maputo\r\r\r\n ','Africa/Maseru'=>'Africa/Maseru\r\r\r\n ','Africa/Mbabane'=>'Africa/Mbabane\r\r\r\n ','Africa/Mogadishu'=>'Africa/Mogadishu\r\r\r\n ','Africa/Monrovia'=>'Africa/Monrovia\r\r\r\n ','Africa/Nairobi'=>'E. Africa Standard Time\r\r\r\n ','Africa/Ndjamena'=>'Africa/Ndjamena\r\r\r\n ','Africa/Niamey'=>'Africa/Niamey\r\r\r\n ','Africa/Nouakchott'=>'Africa/Nouakchott\r\r\r\n ','Africa/Ouagadougou'=>'Africa/Ouagadougou\r\r\r\n ','Africa/Porto-Novo'=>'Africa/Porto-Novo\r\r\r\n ','Africa/Sao_Tome'=>'Africa/Sao_Tome\r\r\r\n ','Africa/Tripoli'=>'Africa/Tripoli\r\r\r\n ','Africa/Tunis'=>'Africa/Tunis\r\r\r\n ','Africa/Windhoek'=>'Namibia Standard Time\r\r\r\n ','America/Adak'=>'America/Adak\r\r\r\n ','America/Anchorage'=>'Alaskan Standard Time\r\r\r\n ','America/Anguilla'=>'America/Anguilla\r\r\r\n ','America/Antigua'=>'America/Antigua\r\r\r\n ','America/Araguaina'=>'America/Araguaina\r\r\r\n ','America/Argentina/La_Rioja'=>'America/Argentina/La_Rioja\r\r\r\n ','America/Argentina/Rio_Gallegos'=>'America/Argentina/Rio_Gallegos\r\r\r\n ','America/Argentina/Salta'=>'America/Argentina/Salta\r\r\r\n ','America/Argentina/San_Juan'=>'America/Argentina/San_Juan\r\r\r\n ','America/Argentina/San_Luis'=>'America/Argentina/San_Luis\r\r\r\n ','America/Argentina/Tucuman'=>'America/Argentina/Tucuman\r\r\r\n ','America/Argentina/Ushuaia'=>'America/Argentina/Ushuaia\r\r\r\n ','America/Aruba'=>'America/Aruba\r\r\r\n ','America/Asuncion'=>'America/Asuncion\r\r\r\n ','America/Bahia'=>'America/Bahia\r\r\r\n ','America/Barbados'=>'America/Barbados\r\r\r\n ','America/Belem'=>'America/Belem\r\r\r\n ','America/Belize'=>'America/Belize\r\r\r\n ','America/Blanc-Sablon'=>'America/Blanc-Sablon\r\r\r\n ','America/Boa_Vista'=>'America/Boa_Vista\r\r\r\n ','America/Bogota'=>'SA Pacific Standard Time\r\r\r\n ','America/Boise'=>'America/Boise\r\r\r\n ','America/Buenos_Aires'=>'Argentina Standard Time\r\r\r\n ','America/Cambridge_Bay'=>'America/Cambridge_Bay\r\r\r\n ','America/Campo_Grande'=>'America/Campo_Grande\r\r\r\n ','America/Cancun'=>'America/Cancun\r\r\r\n ','America/Caracas'=>'Venezuela Standard Time\r\r\r\n ','America/Catamarca'=>'America/Catamarca\r\r\r\n ','America/Cayenne'=>'America/Cayenne\r\r\r\n ','America/Cayman'=>'America/Cayman\r\r\r\n ','America/Chicago'=>'Central Standard Time\r\r\r\n ','America/Chihuahua'=>'Mexico Standard Time 2\r\r\r\n ','America/Coral_Harbour'=>'America/Coral_Harbour\r\r\r\n ','America/Cordoba'=>'America/Cordoba\r\r\r\n ','America/Costa_Rica'=>'America/Costa_Rica\r\r\r\n ','America/Cuiaba'=>'America/Cuiaba\r\r\r\n ','America/Curacao'=>'America/Curacao\r\r\r\n ','America/Danmarkshavn'=>'America/Danmarkshavn\r\r\r\n ','America/Dawson'=>'America/Dawson\r\r\r\n ','America/Dawson_Creek'=>'America/Dawson_Creek\r\r\r\n ','America/Denver'=>'Mountain Standard Time\r\r\r\n ','America/Detroit'=>'America/Detroit\r\r\r\n ','America/Dominica'=>'America/Dominica\r\r\r\n ','America/Edmonton'=>'America/Edmonton\r\r\r\n ','America/Eirunepe'=>'America/Eirunepe\r\r\r\n ','America/El_Salvador'=>'America/El_Salvador\r\r\r\n ','America/Fortaleza'=>'America/Fortaleza\r\r\r\n ','America/Glace_Bay'=>'America/Glace_Bay\r\r\r\n ','America/Godthab'=>'Greenland Standard Time\r\r\r\n ','America/Goose_Bay'=>'America/Goose_Bay\r\r\r\n ','America/Grand_Turk'=>'America/Grand_Turk\r\r\r\n ','America/Grenada'=>'America/Grenada\r\r\r\n ','America/Guadeloupe'=>'America/Guadeloupe\r\r\r\n ','America/Guatemala'=>'Central America Standard Time\r\r\r\n ','America/Guayaquil'=>'America/Guayaquil\r\r\r\n ','America/Guyana'=>'America/Guyana\r\r\r\n ','America/Halifax'=>'Atlantic Standard Time\r\r\r\n ','America/Havana'=>'America/Havana\r\r\r\n ','America/Hermosillo'=>'America/Hermosillo\r\r\r\n ','America/Indiana/Knox'=>'America/Indiana/Knox\r\r\r\n ','America/Indiana/Marengo'=>'America/Indiana/Marengo\r\r\r\n ','America/Indiana/Petersburg'=>'America/Indiana/Petersburg\r\r\r\n ','America/Indiana/Tell_City'=>'America/Indiana/Tell_City\r\r\r\n ','America/Indiana/Vevay'=>'America/Indiana/Vevay\r\r\r\n ','America/Indiana/Vincennes'=>'America/Indiana/Vincennes\r\r\r\n ','America/Indiana/Winamac'=>'America/Indiana/Winamac\r\r\r\n ','America/Indianapolis'=>'America/Indianapolis\r\r\r\n ','America/Inuvik'=>'America/Inuvik\r\r\r\n ','America/Iqaluit'=>'America/Iqaluit\r\r\r\n ','America/Jamaica'=>'America/Jamaica\r\r\r\n ','America/Jujuy'=>'America/Jujuy\r\r\r\n ','America/Juneau'=>'America/Juneau\r\r\r\n ','America/Kentucky/Monticello'=>'America/Kentucky/Monticello\r\r\r\n ','America/La_Paz'=>'SA Western Standard Time\r\r\r\n ','America/Lima'=>'America/Lima\r\r\r\n ','America/Los_Angeles'=>'Pacific Standard Time\r\r\r\n ','America/Louisville'=>'America/Louisville\r\r\r\n ','America/Maceio'=>'America/Maceio\r\r\r\n ','America/Managua'=>'America/Managua\r\r\r\n ','America/Manaus'=>'Central Brazilian Standard Time\r\r\r\n ','America/Marigot'=>'America/Marigot\r\r\r\n ','America/Martinique'=>'America/Martinique\r\r\r\n ','America/Mazatlan'=>'America/Mazatlan\r\r\r\n ','America/Mendoza'=>'America/Mendoza\r\r\r\n ','America/Menominee'=>'America/Menominee\r\r\r\n ','America/Merida'=>'America/Merida\r\r\r\n ','America/Mexico_City'=>'Central Standard Time (Mexico)\r\r\r\n ','America/Miquelon'=>'America/Miquelon\r\r\r\n ','America/Moncton'=>'America/Moncton\r\r\r\n ','America/Monterrey'=>'America/Monterrey\r\r\r\n ','America/Montevideo'=>'Montevideo Standard Time\r\r\r\n ','America/Montreal'=>'America/Montreal\r\r\r\n ','America/Montserrat'=>'America/Montserrat\r\r\r\n ','America/Nassau'=>'America/Nassau\r\r\r\n ','America/New_York'=>'Eastern Standard Time\r\r\r\n ','America/Nipigon'=>'America/Nipigon\r\r\r\n ','America/Nome'=>'America/Nome\r\r\r\n ','America/Noronha'=>'America/Noronha\r\r\r\n ','America/North_Dakota/Center'=>'America/North_Dakota/Center\r\r\r\n ','America/North_Dakota/New_Salem'=>'America/North_Dakota/New_Salem\r\r\r\n ','America/Panama'=>'America/Panama\r\r\r\n ','America/Pangnirtung'=>'America/Pangnirtung\r\r\r\n ','America/Paramaribo'=>'America/Paramaribo\r\r\r\n ','America/Phoenix'=>'US Mountain Standard Time\r\r\r\n ','America/Port_of_Spain'=>'America/Port_of_Spain\r\r\r\n ','America/Port-au-Prince'=>'America/Port-au-Prince\r\r\r\n ','America/Porto_Velho'=>'America/Porto_Velho\r\r\r\n ','America/Puerto_Rico'=>'America/Puerto_Rico\r\r\r\n ','America/Rainy_River'=>'America/Rainy_River\r\r\r\n ','America/Rankin_Inlet'=>'America/Rankin_Inlet\r\r\r\n ','America/Recife'=>'America/Recife\r\r\r\n ','America/Regina'=>'Canada Central Standard Time\r\r\r\n ','America/Resolute'=>'America/Resolute\r\r\r\n ','America/Rio_Branco'=>'America/Rio_Branco\r\r\r\n ','America/Santarem'=>'America/Santarem\r\r\r\n ','America/Santiago'=>'Pacific SA Standard Time\r\r\r\n ','America/Santo_Domingo'=>'America/Santo_Domingo\r\r\r\n ','America/Sao_Paulo'=>'E. South America Standard Time\r\r\r\n ','America/Scoresbysund'=>'America/Scoresbysund\r\r\r\n ','America/Shiprock'=>'America/Shiprock\r\r\r\n ','America/St_Barthelemy'=>'America/St_Barthelemy\r\r\r\n ','America/St_Johns'=>'Newfoundland Standard Time\r\r\r\n ','America/St_Kitts'=>'America/St_Kitts\r\r\r\n ','America/St_Lucia'=>'America/St_Lucia\r\r\r\n ','America/St_Thomas'=>'America/St_Thomas\r\r\r\n ','America/St_Vincent'=>'America/St_Vincent\r\r\r\n ','America/Swift_Current'=>'America/Swift_Current\r\r\r\n ','America/Tegucigalpa'=>'America/Tegucigalpa\r\r\r\n ','America/Thule'=>'America/Thule\r\r\r\n ','America/Thunder_Bay'=>'America/Thunder_Bay\r\r\r\n ','America/Tijuana'=>'Pacific Standard Time (Mexico)\r\r\r\n ','America/Toronto'=>'America/Toronto\r\r\r\n ','America/Tortola'=>'America/Tortola\r\r\r\n ','America/Vancouver'=>'America/Vancouver\r\r\r\n ','America/Whitehorse'=>'America/Whitehorse\r\r\r\n ','America/Winnipeg'=>'America/Winnipeg\r\r\r\n ','America/Yakutat'=>'America/Yakutat\r\r\r\n ','America/Yellowknife'=>'America/Yellowknife\r\r\r\n ','Antarctica/Casey'=>'Antarctica/Casey\r\r\r\n ','Antarctica/Davis'=>'Antarctica/Davis\r\r\r\n ','Antarctica/DumontDUrville'=>'Antarctica/DumontDUrville\r\r\r\n ','Antarctica/Mawson'=>'Antarctica/Mawson\r\r\r\n ','Antarctica/McMurdo'=>'Antarctica/McMurdo\r\r\r\n ','Antarctica/Palmer'=>'Antarctica/Palmer\r\r\r\n ','Antarctica/Rothera'=>'Antarctica/Rothera\r\r\r\n ','Antarctica/South_Pole'=>'Antarctica/South_Pole\r\r\r\n ','Antarctica/Syowa'=>'Antarctica/Syowa\r\r\r\n ','Antarctica/Vostok'=>'Antarctica/Vostok\r\r\r\n ','Arctic/Longyearbyen'=>'Arctic/Longyearbyen\r\r\r\n ','Asia/Aden'=>'Asia/Aden\r\r\r\n ','Asia/Almaty'=>'Asia/Almaty\r\r\r\n ','Asia/Amman'=>'Jordan Standard Time\r\r\r\n ','Asia/Anadyr'=>'Asia/Anadyr\r\r\r\n ','Asia/Aqtau'=>'Asia/Aqtau\r\r\r\n ','Asia/Aqtobe'=>'Asia/Aqtobe\r\r\r\n ','Asia/Ashgabat'=>'Asia/Ashgabat\r\r\r\n ','Asia/Baghdad'=>'Arabic Standard Time\r\r\r\n ','Asia/Bahrain'=>'Asia/Bahrain\r\r\r\n ','Asia/Baku'=>'Azerbaijan Standard Time\r\r\r\n ','Asia/Bangkok'=>'SE Asia Standard Time\r\r\r\n ','Asia/Beirut'=>'Middle East Standard Time\r\r\r\n ','Asia/Bishkek'=>'Asia/Bishkek\r\r\r\n ','Asia/Brunei'=>'Asia/Brunei\r\r\r\n ','Asia/Calcutta'=>'India Standard Time\r\r\r\n ','Asia/Choibalsan'=>'Asia/Choibalsan\r\r\r\n ','Asia/Chongqing'=>'Asia/Chongqing\r\r\r\n ','Asia/Colombo'=>'Sri Lanka Standard Time\r\r\r\n ','Asia/Damascus'=>'Asia/Damascus\r\r\r\n ','Asia/Dhaka'=>'Central Asia Standard Time\r\r\r\n ','Asia/Dili'=>'Asia/Dili\r\r\r\n ','Asia/Dubai'=>'Arabian Standard Time\r\r\r\n ','Asia/Dushanbe'=>'Asia/Dushanbe\r\r\r\n ','Asia/Gaza'=>'Asia/Gaza\r\r\r\n ','Asia/Harbin'=>'Asia/Harbin\r\r\r\n ','Asia/Hong_Kong'=>'Asia/Hong_Kong\r\r\r\n ','Asia/Hovd'=>'Asia/Hovd\r\r\r\n ','Asia/Irkutsk'=>'North Asia East Standard Time\r\r\r\n ','Asia/Jakarta'=>'Asia/Jakarta\r\r\r\n ','Asia/Jayapura'=>'Asia/Jayapura\r\r\r\n ','Asia/Jerusalem'=>'Israel Standard Time\r\r\r\n ','Asia/Kabul'=>'Afghanistan Standard Time\r\r\r\n ','Asia/Kamchatka'=>'Asia/Kamchatka\r\r\r\n ','Asia/Karachi'=>'Pakistan Standard Time\r\r\r\n ','Asia/Kashgar'=>'Asia/Kashgar\r\r\r\n ','Asia/Katmandu'=>'Nepal Standard Time\r\r\r\n ','Asia/Krasnoyarsk'=>'North Asia Standard Time\r\r\r\n ','Asia/Kuala_Lumpur'=>'Asia/Kuala_Lumpur\r\r\r\n ','Asia/Kuching'=>'Asia/Kuching\r\r\r\n ','Asia/Kuwait'=>'Asia/Kuwait\r\r\r\n ','Asia/Macau'=>'Asia/Macau\r\r\r\n ','Asia/Magadan'=>'Asia/Magadan\r\r\r\n ','Asia/Makassar'=>'Asia/Makassar\r\r\r\n ','Asia/Manila'=>'Asia/Manila\r\r\r\n ','Asia/Muscat'=>'Asia/Muscat\r\r\r\n ','Asia/Nicosia'=>'Asia/Nicosia\r\r\r\n ','Asia/Novosibirsk'=>'N. Central Asia Standard Time\r\r\r\n ','Asia/Omsk'=>'Asia/Omsk\r\r\r\n ','Asia/Oral'=>'Asia/Oral\r\r\r\n ','Asia/Phnom_Penh'=>'Asia/Phnom_Penh\r\r\r\n ','Asia/Pontianak'=>'Asia/Pontianak\r\r\r\n ','Asia/Pyongyang'=>'Asia/Pyongyang\r\r\r\n ','Asia/Qatar'=>'Asia/Qatar\r\r\r\n ','Asia/Qyzylorda'=>'Asia/Qyzylorda\r\r\r\n ','Asia/Rangoon'=>'Myanmar Standard Time\r\r\r\n ','Asia/Riyadh'=>'Arab Standard Time\r\r\r\n ','Asia/Saigon'=>'Asia/Saigon\r\r\r\n ','Asia/Sakhalin'=>'Asia/Sakhalin\r\r\r\n ','Asia/Samarkand'=>'Asia/Samarkand\r\r\r\n ','Asia/Seoul'=>'Korea Standard Time\r\r\r\n ','Asia/Shanghai'=>'China Standard Time\r\r\r\n ','Asia/Singapore'=>'Singapore Standard Time\r\r\r\n ','Asia/Taipei'=>'Taipei Standard Time\r\r\r\n ','Asia/Tashkent'=>'West Asia Standard Time\r\r\r\n ','Asia/Tbilisi'=>'Asia/Tbilisi\r\r\r\n ','Asia/Tehran'=>'Iran Standard Time\r\r\r\n ','Asia/Thimphu'=>'Asia/Thimphu\r\r\r\n ','Asia/Tokyo'=>'Tokyo Standard Time\r\r\r\n ','Asia/Ulaanbaatar'=>'Asia/Ulaanbaatar\r\r\r\n ','Asia/Urumqi'=>'Asia/Urumqi\r\r\r\n ','Asia/Vientiane'=>'Asia/Vientiane\r\r\r\n ','Asia/Vladivostok'=>'Vladivostok Standard Time\r\r\r\n ','Asia/Yakutsk'=>'Yakutsk Standard Time\r\r\r\n ','Asia/Yekaterinburg'=>'Ekaterinburg Standard Time\r\r\r\n ','Asia/Yerevan'=>'Armenian Standard Time\r\r\r\n ','Atlantic/Azores'=>'Azores Standard Time\r\r\r\n ','Atlantic/Bermuda'=>'Atlantic/Bermuda\r\r\r\n ','Atlantic/Canary'=>'Atlantic/Canary\r\r\r\n ','Atlantic/Cape_Verde'=>'Cape Verde Standard Time\r\r\r\n ','Atlantic/Faeroe'=>'Atlantic/Faeroe\r\r\r\n ','Atlantic/Madeira'=>'Atlantic/Madeira\r\r\r\n ','Atlantic/Reykjavik'=>'Greenwich Standard Time\r\r\r\n ','Atlantic/South_Georgia'=>'Mid-Atlantic Standard Time\r\r\r\n ','Atlantic/St_Helena'=>'Atlantic/St_Helena\r\r\r\n ','Atlantic/Stanley'=>'Atlantic/Stanley\r\r\r\n ','Australia/Adelaide'=>'Cen. Australia Standard Time\r\r\r\n ','Australia/Brisbane'=>'E. Australia Standard Time\r\r\r\n ','Australia/Broken_Hill'=>'Australia/Broken_Hill\r\r\r\n ','Australia/Currie'=>'Australia/Currie\r\r\r\n ','Australia/Darwin'=>'AUS Central Standard Time\r\r\r\n ','Australia/Eucla'=>'Australia/Eucla\r\r\r\n ','Australia/Hobart'=>'Tasmania Standard Time\r\r\r\n ','Australia/Lindeman'=>'Australia/Lindeman\r\r\r\n ','Australia/Lord_Howe'=>'Australia/Lord_Howe\r\r\r\n ','Australia/Melbourne'=>'Australia/Melbourne\r\r\r\n ','Australia/Perth'=>'W. Australia Standard Time\r\r\r\n ','Australia/Sydney'=>'AUS Eastern Standard Time\r\r\r\n ','Etc/GMT'=>'Etc/GMT\r\r\r\n ','Etc/GMT-1'=>'Etc/GMT-1\r\r\r\n ','Etc/GMT-2'=>'Etc/GMT-2\r\r\r\n ','Etc/GMT-3'=>'Georgian Standard Time\r\r\r\n ','Etc/GMT-4'=>'Etc/GMT-4\r\r\r\n ','Etc/GMT-5'=>'Etc/GMT-5\r\r\r\n ','Etc/GMT-6'=>'Etc/GMT-6\r\r\r\n ','Etc/GMT-7'=>'Etc/GMT-7\r\r\r\n ','Etc/GMT-8'=>'Etc/GMT-8\r\r\r\n ','Etc/GMT-9'=>'Etc/GMT-9\r\r\r\n ','Etc/GMT-10'=>'Etc/GMT-10\r\r\r\n ','Etc/GMT-11'=>'Etc/GMT-11\r\r\r\n ','Etc/GMT-12'=>'Etc/GMT-12\r\r\r\n ','Etc/GMT-13'=>'Etc/GMT-13\r\r\r\n ','Etc/GMT-14'=>'Etc/GMT-14\r\r\r\n ','Etc/GMT+1'=>'Etc/GMT+1\r\r\r\n ','Etc/GMT+2'=>'Etc/GMT+2\r\r\r\n ','Etc/GMT+3'=>'SA Eastern Standard Time\r\r\r\n ','Etc/GMT+4'=>'Etc/GMT+4\r\r\r\n ','Etc/GMT+5'=>'US Eastern Standard Time\r\r\r\n ','Etc/GMT+6'=>'Etc/GMT+6\r\r\r\n ','Etc/GMT+7'=>'Etc/GMT+7\r\r\r\n ','Etc/GMT+8'=>'Etc/GMT+8\r\r\r\n ','Etc/GMT+9'=>'Etc/GMT+9\r\r\r\n ','Etc/GMT+10'=>'Etc/GMT+10\r\r\r\n ','Etc/GMT+11'=>'Etc/GMT+11\r\r\r\n ','Etc/GMT+12'=>'Dateline Standard Time\r\r\r\n ','Etc/Unknown'=>'Etc/Unknown\r\r\r\n ','Europe/Amsterdam'=>'Europe/Amsterdam\r\r\r\n ','Europe/Andorra'=>'Europe/Andorra\r\r\r\n ','Europe/Athens'=>'Europe/Athens\r\r\r\n ','Europe/Belgrade'=>'Europe/Belgrade\r\r\r\n ','Europe/Berlin'=>'W. Europe Standard Time\r\r\r\n ','Europe/Bratislava'=>'Europe/Bratislava\r\r\r\n ','Europe/Brussels'=>'Europe/Brussels\r\r\r\n ','Europe/Bucharest'=>'Europe/Bucharest\r\r\r\n ','Europe/Budapest'=>'Central Europe Standard Time\r\r\r\n ','Europe/Chisinau'=>'Europe/Chisinau\r\r\r\n ','Europe/Copenhagen'=>'Europe/Copenhagen\r\r\r\n ','Europe/Dublin'=>'Europe/Dublin\r\r\r\n ','Europe/Gibraltar'=>'Europe/Gibraltar\r\r\r\n ','Europe/Guernsey'=>'Europe/Guernsey\r\r\r\n ','Europe/Helsinki'=>'Europe/Helsinki\r\r\r\n ','Europe/Isle_of_Man'=>'Europe/Isle_of_Man\r\r\r\n ','Europe/Istanbul'=>'GTB Standard Time\r\r\r\n ','Europe/Jersey'=>'Europe/Jersey\r\r\r\n ','Europe/Kaliningrad'=>'Europe/Kaliningrad\r\r\r\n ','Europe/Kiev'=>'FLE Standard Time\r\r\r\n ','Europe/Lisbon'=>'Europe/Lisbon\r\r\r\n ','Europe/Ljubljana'=>'Europe/Ljubljana\r\r\r\n ','Europe/London'=>'GMT Standard Time\r\r\r\n ','Europe/Luxembourg'=>'Europe/Luxembourg\r\r\r\n ','Europe/Madrid'=>'Europe/Madrid\r\r\r\n ','Europe/Malta'=>'Europe/Malta\r\r\r\n ','Europe/Mariehamn'=>'Europe/Mariehamn\r\r\r\n ','Europe/Minsk'=>'E. Europe Standard Time\r\r\r\n ','Europe/Monaco'=>'Europe/Monaco\r\r\r\n ','Europe/Moscow'=>'Russian Standard Time\r\r\r\n ','Europe/Oslo'=>'Europe/Oslo\r\r\r\n ','Europe/Paris'=>'Romance Standard Time\r\r\r\n ','Europe/Podgorica'=>'Europe/Podgorica\r\r\r\n ','Europe/Prague'=>'Europe/Prague\r\r\r\n ','Europe/Riga'=>'Europe/Riga\r\r\r\n ','Europe/Rome'=>'Europe/Rome\r\r\r\n ','Europe/Samara'=>'Europe/Samara\r\r\r\n ','Europe/San_Marino'=>'Europe/San_Marino\r\r\r\n ','Europe/Sarajevo'=>'Europe/Sarajevo\r\r\r\n ','Europe/Simferopol'=>'Europe/Simferopol\r\r\r\n ','Europe/Skopje'=>'Europe/Skopje\r\r\r\n ','Europe/Sofia'=>'Europe/Sofia\r\r\r\n ','Europe/Stockholm'=>'Europe/Stockholm\r\r\r\n ','Europe/Tallinn'=>'Europe/Tallinn\r\r\r\n ','Europe/Tirane'=>'Europe/Tirane\r\r\r\n ','Europe/Uzhgorod'=>'Europe/Uzhgorod\r\r\r\n ','Europe/Vaduz'=>'Europe/Vaduz\r\r\r\n ','Europe/Vatican'=>'Europe/Vatican\r\r\r\n ','Europe/Vienna'=>'Europe/Vienna\r\r\r\n ','Europe/Vilnius'=>'Europe/Vilnius\r\r\r\n ','Europe/Volgograd'=>'Europe/Volgograd\r\r\r\n ','Europe/Warsaw'=>'Central European Standard Time\r\r\r\n ','Europe/Zagreb'=>'Europe/Zagreb\r\r\r\n ','Europe/Zaporozhye'=>'Europe/Zaporozhye\r\r\r\n ','Europe/Zurich'=>'Europe/Zurich\r\r\r\n ','Indian/Antananarivo'=>'Indian/Antananarivo\r\r\r\n ','Indian/Chagos'=>'Indian/Chagos\r\r\r\n ','Indian/Christmas'=>'Indian/Christmas\r\r\r\n ','Indian/Cocos'=>'Indian/Cocos\r\r\r\n ','Indian/Comoro'=>'Indian/Comoro\r\r\r\n ','Indian/Kerguelen'=>'Indian/Kerguelen\r\r\r\n ','Indian/Mahe'=>'Indian/Mahe\r\r\r\n ','Indian/Maldives'=>'Indian/Maldives\r\r\r\n ','Indian/Mauritius'=>'Mauritius Standard Time\r\r\r\n ','Indian/Mayotte'=>'Indian/Mayotte\r\r\r\n ','Indian/Reunion'=>'Indian/Reunion\r\r\r\n ','Pacific/Apia'=>'Samoa Standard Time\r\r\r\n ','Pacific/Auckland'=>'New Zealand Standard Time\r\r\r\n ','Pacific/Chatham'=>'Pacific/Chatham\r\r\r\n ','Pacific/Easter'=>'Pacific/Easter\r\r\r\n ','Pacific/Efate'=>'Pacific/Efate\r\r\r\n ','Pacific/Enderbury'=>'Pacific/Enderbury\r\r\r\n ','Pacific/Fakaofo'=>'Pacific/Fakaofo\r\r\r\n ','Pacific/Fiji'=>'Fiji Standard Time\r\r\r\n ','Pacific/Funafuti'=>'Pacific/Funafuti\r\r\r\n ','Pacific/Galapagos'=>'Pacific/Galapagos\r\r\r\n ','Pacific/Gambier'=>'Pacific/Gambier\r\r\r\n ','Pacific/Guadalcanal'=>'Central Pacific Standard Time\r\r\r\n ','Pacific/Guam'=>'Pacific/Guam\r\r\r\n ','Pacific/Honolulu'=>'Hawaiian Standard Time\r\r\r\n ','Pacific/Johnston'=>'Pacific/Johnston\r\r\r\n ','Pacific/Kiritimati'=>'Pacific/Kiritimati\r\r\r\n ','Pacific/Kosrae'=>'Pacific/Kosrae\r\r\r\n ','Pacific/Kwajalein'=>'Pacific/Kwajalein\r\r\r\n ','Pacific/Majuro'=>'Pacific/Majuro\r\r\r\n ','Pacific/Marquesas'=>'Pacific/Marquesas\r\r\r\n ','Pacific/Midway'=>'Pacific/Midway\r\r\r\n ','Pacific/Nauru'=>'Pacific/Nauru\r\r\r\n ','Pacific/Niue'=>'Pacific/Niue\r\r\r\n ','Pacific/Norfolk'=>'Pacific/Norfolk\r\r\r\n ','Pacific/Noumea'=>'Pacific/Noumea\r\r\r\n ','Pacific/Pago_Pago'=>'Pacific/Pago_Pago\r\r\r\n ','Pacific/Palau'=>'Pacific/Palau\r\r\r\n ','Pacific/Pitcairn'=>'Pacific/Pitcairn\r\r\r\n ','Pacific/Ponape'=>'Pacific/Ponape\r\r\r\n ','Pacific/Port_Moresby'=>'West Pacific Standard Time\r\r\r\n ','Pacific/Rarotonga'=>'Pacific/Rarotonga\r\r\r\n ','Pacific/Saipan'=>'Pacific/Saipan\r\r\r\n ','Pacific/Tahiti'=>'Pacific/Tahiti\r\r\r\n ','Pacific/Tarawa'=>'Pacific/Tarawa\r\r\r\n ','Pacific/Tongatapu'=>'Tonga Standard Time\r\r\r\n ','Pacific/Truk'=>'Pacific/Truk\r\r\r\n ','Pacific/Wake'=>'Pacific/Wake\r\r\r\n ','Pacific/Wallis'=>'Pacific/Wallis'\r\r\r\n );\r\r\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a store slug from name. | public static function storeSlugFromName($name)
{
return str_replace(' ', '-', strtolower($name));
} | [
"public function generateSlug($name);",
"protected function generateSlug()\n {\n $slug = Transliterator::transliterate($this->getName());\n\n return Transliterator::urlize($slug);\n }",
"static function buildSlug($name='')\n\t{\n\t\t$slug = self::convert_string_vi_to_en($name);\n $slug = strtolower(preg_replace('/[^a-zA-Z0-9]+/i', '-', str_replace('.', '', $slug)));\n return $slug;\n\t}",
"function get_slug($name = null) {\n\n if(!isset($name)) {\n\n $name = $this->post_type_name;\n\n }\n $name = strtolower($name);\n $name = str_replace(\" \", \"-\", $name);\n $name = str_replace(\"_\", \"-\", $name);\n return $name;\n\n }",
"private function createSlug($name) {\n //Strip html tags\n $name = strip_tags($name);\n //Strip html entities\n $name = preg_replace(\"/&#?[a-z0-9]{2,8};/i\",\"\", $name);\n //Replace spaces with dashes\n $name = str_replace(' ', '-', $name);\n $name = str_replace('/','-', $name);\n //Convert to lowercase\n $name = strtolower($name);\n\n return $name;\n }",
"public function generateSlug();",
"static function buildSlug($name = '')\n\t{\n\t\t$slug = self::convert_string_vi_to_en($name);\n $slug = strtolower(preg_replace('/[^a-zA-Z0-9]+/i', '-', str_replace('.', '', rtrim($slug, '-'))));\n return $slug;\n\t}",
"public static function setSlugGenerator($name);",
"protected function slug()\r\n {\r\n $slug = '';\r\n \r\n if (!empty($this->report)) \r\n {\r\n return $this->report->slug;\r\n }\r\n \r\n $path = $this->app->hive()['PATH'];\r\n $path = str_replace('/admin/shop/reports/', '', $path);\r\n $pieces = explode( '/', $path);\r\n $slug = $pieces[0];\r\n \r\n return $slug;\r\n }",
"function get_slug_name( $skin ) {\r\r\n\t\techo str_replace(' ', '-', $skin['dir'] );\r\r\n\t}",
"public function generateSlug()\n {\n $value = $this->generateRawSlug();\n $value = Inflector::urlize($value);\n\n /** @var \\Tx\\CzSimpleCal\\Domain\\Repository\\EventIndexRepository $eventIndexRepository */\n $eventIndexRepository = $this->objectManager->get('Tx\\\\CzSimpleCal\\\\Domain\\\\Repository\\\\EventIndexRepository');\n\n $slug = $eventIndexRepository->makeSlugUnique($value, $this->uid);\n $this->setSlug($slug);\n }",
"private function createSlug() {\n $slug = $this->args['page_title'];\n $slug = strtolower($slug);\n $slug = str_replace(' ','_',$slug);\n return $this->Top_Slug.'_'.$slug;\n }",
"private function slug()\n {\n $name = get_called_class();\n $name = str_replace('\\\\', '-', $name);\n $name = $this->camelToSnake($name);\n\n return $name;\n }",
"function plugin_create_slug( $route_name = '' ) {\n\n\tif ( ! empty( $route_name ) ) {\n\t\t$slug = strtolower(remove_spaces($route_name));\n\n\t\treturn $slug;\n\t}\n\n\treturn;\n}",
"protected function generate_slug(){\n\t\t$this->slug = \\StringUtils::toAscii($this->title); \t\n\t}",
"private function generateSpecificPropName(string $storeName): string\n {\n return 'specific' . ucfirst($storeName);\n }",
"public static function generate_slug($name,$venue_id=null,$show_id=null)\n {\n try {\n //lower and trim\n $name = strtolower(trim($name));\n if(!empty($name))\n {\n $show = (!empty($show_id))? Show::find($show_id) : null;\n $venue = (!empty($venue_id))? Show::find($venue_id) : null;\n //replace white spaces\n $name = preg_replace('/\\s+/','-',$name);\n //replace strange characters for \"_\"\n $name = preg_replace('/[^a-z0-9-]/','_',$name);\n //remove duplicate \"_\"\n $slug = preg_replace('/([_])\\1+/','$1',$name);\n //if show\n if(!empty($venue_id) && isset($show_id))\n $slugs = Show::pluck('slug')->toArray();\n else\n $slugs = Venue::pluck('slug')->toArray();\n //if it is existing show and the slug it's the same like slug, no change\n if(!empty($show_id))\n {\n if($show && $show->slug == $slug)\n return $slug;\n }\n else if(!empty($venue_id))\n {\n if($venue && $venue->slug == $slug)\n return $slug;\n }\n //check if the slug exists\n while (in_array($slug,$slugs))\n {\n $skip = false;\n //search if show slug\n if(!empty($venue_id) && isset($show_id))\n {\n if($venue && !empty($venue->slug))\n {\n $venue_slug = $venue->slug;\n if (strpos($slug,$venue_slug) === false)\n {\n $slug.='-'.$venue_slug;\n $skip = true;\n }\n }\n }\n //concat with numbers or if it is a venue\n if(!$skip)\n {\n $subslugs = explode('-', $slug);\n $last = end($subslugs);\n if(is_numeric($last))\n $subslugs[count($subslugs)-1] = (int)$last + 1;\n else $subslugs[] = 1;\n $slug = implode('-',$subslugs);\n }\n }\n }\n return $slug;\n } catch (Exception $ex) {\n return '';\n }\n }",
"public function uniqueSlug(): string\n {\n return \"{$this->id}-{$this->name}\";\n }",
"public static function get_store_name() {\n\t\t\tif ( self::$store_name ) {\n\t\t\t\treturn self::$store_name;\n\t\t\t}\n\t\t\t$name = trim(\n\t\t\t\tstr_replace(\n\t\t\t\t\t\"'\",\n\t\t\t\t\t\"\\u{2019}\",\n\t\t\t\t\thtml_entity_decode(\n\t\t\t\t\t\tget_bloginfo( 'name' ),\n\t\t\t\t\t\tENT_QUOTES,\n\t\t\t\t\t\t'UTF-8'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( $name ) {\n\t\t\t\tself::$store_name = $name;\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t\t// Fallback to site url\n\t\t\t$url = get_site_url();\n\t\t\tif ( $url ) {\n\t\t\t\tself::$store_name = parse_url( $url, PHP_URL_HOST );\n\t\t\t\treturn self::$store_name;\n\t\t\t}\n\t\t\t// If site url doesn't exist, fall back to http host.\n\t\t\tif ( $_SERVER['HTTP_HOST'] ) {\n\t\t\t\tself::$store_name = $_SERVER['HTTP_HOST'];\n\t\t\t\treturn self::$store_name;\n\t\t\t}\n\n\t\t\t// If http host doesn't exist, fall back to local host name.\n\t\t\t$url = gethostname();\n\t\t\tself::$store_name = $url;\n\t\t\treturn ( self::$store_name ) ? ( self::$store_name ) : 'A Store Has No Name';\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the URL for the system views helpers directory. | public static function systemViewsHelpers()
{
return self::systemViews().
DirNames::HELPERS.StrUtils::URL_SEPARATOR;
} | [
"protected function getViewHelpersDirectory()\n {\n $directories = config('helpers.directories', []);\n return $directories['root'] .'/'. $directories['view']; //TODO: Check if keys exist\n }",
"private function getViewHelpersNamespace()\n {\n $config = config('helpers.directories');\n\n // directories\n $root = $config['root'];\n $view = $config['view'];\n\n return 'App\\\\' . $root . '\\\\' . $view;\n }",
"public static function sitesSharedViewsHelpers()\n {\n return self::sitesSharedViews().\n DirNames::HELPERS.\\DIRECTORY_SEPARATOR;\n }",
"protected function getViewsPath()\n {\n return Helpers::getPathWithSlash(config('view.paths')[0]);\n }",
"protected function getHelpersDirectory()\n {\n $dirs = config('helpers.directories');\n return app_path() .'/'. $dirs['root'] .'/'. $dirs['action'];\n }",
"function getSystemHelperPath($helper_name) {\n return ANGIE_PATH . \"/controller/helpers/$helper_name.php\";\n }",
"public function getViewURL()\n\t\t{\n\t\t\treturn append($this->manager->getRootURL(), RELATIVE_ROOT, $this->moduleRelativePath, 'view') . '/';\n\t\t}",
"public static function views()\n {\n return self::dirURL() . 'views/';\n }",
"public static function sitesSharedViews()\n {\n return self::sitesShared().DirNames::VIEWS.StrUtils::URL_SEPARATOR;\n }",
"protected function getViewsPath(): string\n {\n return $this->getBasePath().DIRECTORY_SEPARATOR.'views';\n }",
"private function getPathView() {\n\t\t$view = $this->getNamespace();\n\t\tif ($this->getModule()) {\n\t\t\t$view .= DIRECTORY_SEPARATOR .\"modules\" . DIRECTORY_SEPARATOR . $this->getModule();\n\t\t}\n\t\t$view .= DIRECTORY_SEPARATOR . \"views\";\n\n\t\treturn $view;\n }",
"public static function getModuleViewDir()\n {\n return ApplicationServiceLocator::getServiceLocator()->get('Config')['paths']['module_view'];\n }",
"public static function siteViews()\n {\n return self::path(UserSites::viewsUrlPath());\n }",
"public function utils_url(){\n return $this->plugin_url() . 'utils/';\n }",
"public function getViewPath()\n {\n return $this->bootstrap->getViewPath();\n }",
"public function getViewsDir();",
"function apine_url_helper () {\n\t\n\treturn Apine\\MVC\\URLHelper::get_instance();\n\t\n}",
"public function getViewPath()\n {\n $class = new ReflectionClass($this);\n return dirname($class->getFileName()) . DIRECTORY_SEPARATOR . 'views';\n }",
"public function getViewPath()\n { \n $this->assertFileExtensionIsCompatible(self::HTML_EXTENSION, __FUNCTION__);\n\n $parts = explode('.', $this->file_name);\n $fileExtension = '.' . $parts[1];\n return str_replace(DIRECTORY_SEPARATOR, '.', ServiceProvider::VIEWS_NAMESPACE_ACCESSOR. '::' . str_replace($fileExtension, '', $this->getFileWithDirectory()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add one or multiple rulesets | public function addRuleset($set); | [
"function addRuleSet($ruleSet) {\r\n\r\n\t\t$newNamespaceURI = '';\t// later\r\n\t\t$newNamespaceURI = NULL;\r\n\t\t$debug\t= $this->log->getLog('isDebugEnabled');\t// boolean\r\n\t\tif($debug) {\r\n\t\t\tif($newNamespaceURI == NULL) {\r\n\t\t\t\t$this->log->debug(\"addRuleSet() with no namespace URI\");\r\n\t\t\t} else {\r\n\t\t\t\t$this->log->debug(\"addRuleSet() with namespace URI \".$newNamespaceURI);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$ruleSet->addRuleInstances($this);\r\n\r\n\t}",
"function addRuleSet(&$ruleSet)\r\n\t{\r\n\t\t$oldNamespaceURI = $this->getRuleNamespaceURI();\r\n\t\t$newNamespaceURI = $ruleSet->getNamespaceURI();\r\n\t\t$this->setRuleNamespaceURI($newNamespaceURI);\r\n\t\t$ruleSet->addRuleInstances($this);\r\n\t\t$this->setRuleNamespaceURI($oldNamespaceURI);\r\n\t}",
"public function addRuleset($set)\n {\n if ($set instanceof Rules\\Ruleset) {\n $this->ruleSets[] = $set;\n\n } else if (is_array($set)) {\n\n foreach($set as $rs) {\n if (!$rs instanceof Rules\\Ruleset) {\n throw new Exceptions\\InvalidTypeException(\n \"Rulesets must extend 'Maer\\Validator\\Rules\\Ruleset'\"\n );\n }\n\n $this->ruleSets[] = $rs;\n }\n }\n \n }",
"public function ruleset_add($set, $path){\n\t\tif(isset($this->ruleset[$path])){\n\t\t\t$set = array_merge($this->ruleset[$path], $set);\n\t\t}\n\t\t$this->ruleset_set($path, $set);\n\t}",
"protected function addNewRules()\n {\n foreach ($this->getRules() as $rule) {\n $this->extendValidator($rule);\n }\n }",
"public function addRules($rules) {\n foreach ($rules as $rule) {\n $this->addRule($rule);\n }\n }",
"static function addRules(array $rules){\n\n\n foreach ($rules as $rule){\n static::addRule($rule);\n }\n }",
"abstract public function buildFeedRuleSet() : RuleSet;",
"public function addRules($rules)\n {\n $ruleMode = $this->_getoptConfig['ruleMode'];\n switch ($this->_getoptConfig['ruleMode']) {\n case self::MODE_ZEND:\n if (is_array($rules)) {\n $this->_addRulesModeZend($rules);\n break;\n }\n // intentional fallthrough\n case self::MODE_GNU:\n $this->_addRulesModeGnu($rules);\n break;\n default:\n /**\n * Call addRulesModeFoo() for ruleMode 'foo'.\n * The developer should subclass Getopt and\n * provide this method.\n */\n $method = '_addRulesMode' . ucfirst($ruleMode);\n $this->$method($rules);\n }\n $this->_parsed = false;\n return $this;\n }",
"abstract protected function addRule($rule);",
"public static function addRule()\n {\n $args = func_get_args();\n if (is_array($args[0]))\n {\n foreach ($args[0] as $path => $arg_keys)\n {\n self::$router_rule_list[self::tidyPath($path)] = $arg_keys;\n }\n }\n else\n {\n self::$router_rule_list[self::tidyPath($args[0])] = $args[1];\n }\n }",
"public function add_rules($rules)\n\t{\n\t\tforeach($rules as $field => $rule_string) $this->add_rule($field, $rule_string);\n\t}",
"function addrule($x)\n {\n $x = func_get_args();\n // if (isset($this->rules) == FALSE) $this->rules = array();\n array_push($this->rules, $x);\n }",
"private function _add_rules()\n\t{\n\t\t$this->ci->db->select($this->rule_table . '.*');\n\t\t$this->ci->db->select($this->role_table . '.name AS role');\n\t\t$this->ci->db->select($this->resource_table . '.name AS resource');\n\n\t\t$this->ci->db->from($this->rule_table);\n\n\t\t$this->ci->db->join($this->role_table, $this->role_table . '.id = ' . $this->rule_table . '.role_id', 'inner');\n\t\t$this->ci->db->join($this->resource_table, $this->resource_table . '.id = ' . $this->rule_table . '.resource_id', 'inner');\n\n\t\t$query = $this->ci->db->get();\n\n\t\tif ( ! empty($query) && $query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $rule)\n\t\t\t{\n\t\t\t\t$this->rbac->getRole($rule->role)->addPermission($rule->resource . '.' . $rule->privilege);\n\n\t\t\t\tif ($this->debug)\n\t\t\t\t{\n\t\t\t\t\t$this->debug_array[] = 'getRole(' . $rule->role . ')->addPermission(' . $rule->resource . '.' . $rule->privilege . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function addrules()\n {\n $config = array(\n ['field' => 'id', 'label' => 'id', 'rules' => array(\n 'required', \n //here specify the custom rule\n //second field tells where to find the validation funcs\n array('id', array($this->fleet, 'id_add_check'))\n )\n ],\n ['field' => 'wackyid', 'label' => 'recognizedPlane', 'rules' => array( \n //here specify the custom rule\n //second field tells where to find the validation funcs\n array('wackyselect', array($this->fleet, 'recognizedPlane_check'))\n )\n ],\n );\n return $config;\n }",
"public function testCreateRuleset()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"abstract protected function setRuleList():void;",
"public function add(\\Caridea\\Validate\\Rule ...$rules): self\n {\n $this->rules = array_merge($this->rules, $rules);\n return $this;\n }",
"function addRuleInstances($digester) {\r\n\r\n\t\t;\r\n\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the subscription title. | public function getSubscriptionTitle()
{
return $this->subscriptionTitle;
} | [
"public static function subscription_page_title( $title ) {\n $query_vars = self::get_query_vars();\n\n if ( array_search( 'learndash-notifications-subscription', $query_vars, true ) !== false ) {\n $title['title'] = __( 'LearnDash Notifications Subscription', 'learndash-notifications' );\n }\n\n return $title;\n }",
"protected function getTitle() {\r\n\t\treturn $this->newsItem->getTitle();\r\n\t}",
"public function getTitle() {\n\t\treturn $this->meetingsession->Title;\n\t}",
"public function getTitle()\n {\n $title = strlen($this->_getValue('title'))\n ? $this->_getValue('title')\n : $this->getBaseId();\n\n return $title === null ?: (string) $title;\n }",
"final public function title(): string\n {\n if ($this->title === null) {\n $this->title = $this->id ? ($this->callInSiteContext('get_the_title', $this->id) ?: '') : '';\n }\n\n return $this->title;\n }",
"public function getPublicationTitle();",
"function getTitle() {\n\t\treturn $this->getResource()->getDataValue('title');\n\t}",
"public function getChannelTitle()\n {\n return $this->_rootElement->find($this->channelTitle)->getText();\n }",
"public function get_title(){\n if (is_wp_error( $this->feed ))\n return $this->error_msg;\n\n return $this->feed_item->get_title();\n }",
"public function get_title()\n {\n if (self::debug > 0) {\n error_log('learnpathItem::get_title()', 0);\n }\n if (empty($this->title)) {\n return '';\n }\n return $this->title;\n }",
"public function getTitle(){\n if( empty($this->title) ){\n return \"Calendar {$this->id}\";\n }\n return $this->title;\n }",
"public function getTitle() {\n if ( empty($this->_title) ) {\n return $this->app->getInfos()->getTitle();\n } else {\n return $this->_title;\n }\n }",
"public function getTitle() {\n\t\treturn $this->item->title;\n\t}",
"public function getTitle()\n {\n try {\n $paymentInfo = $this->getInfoInstance();\n $title = $paymentInfo->getAdditionalInformation('title');\n if ($title) return $title;\n } catch (Exception $e) {\n }\n\n return parent::getTitle();\n }",
"public function get_title() {\n\t\treturn $this->resource->post_title;\n\t}",
"public function getSubscriptionName()\n {\n if (array_key_exists(\"subscriptionName\", $this->_propDict)) {\n return $this->_propDict[\"subscriptionName\"];\n } else {\n return null;\n }\n }",
"public function getTitle() {\n\t\treturn $this->getAsString('caption');\n\t}",
"public function getTitle(){\n\t if(isset($this->response['title']))\n\t\treturn $this->response['title'];\n\t else\n\t\treturn \"\";\n\t}",
"public function getTitle() {\r\n\t\tif (array_key_exists ( 'title', $this->data )) {\r\n\t\t\treturn $this->data ['title'];\r\n\t\t}\r\n\t\t\r\n\t\t$title = $this->getExtension ( 'Atom' )->getTitle ();\r\n\t\t\r\n\t\t$this->data ['title'] = $title;\r\n\t\t\r\n\t\treturn $this->data ['title'];\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the counter field when using a pager. | public function testPager() {
$view = Views::getView('test_view');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
'counter' => [
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
],
'name' => [
'id' => 'name',
'table' => 'views_test_data',
'field' => 'name',
'relationship' => 'none',
],
]);
$view->displayHandlers->get('default')->setOption('pager', [
'type' => 'mini',
'options' => ['items_per_page' => 1],
]);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals('1', $counter);
$view->destroy();
// Go to the second page.
$view->setCurrentPage(1);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals('2', $counter);
$view->destroy();
// Go to the third page.
$view->setCurrentPage(2);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals('3', $counter);
$view->destroy();
// Test using the counter start option.
$counter_start = 1000000;
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
'counter' => [
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
'counter_start' => $counter_start,
],
'name' => [
'id' => 'name',
'table' => 'views_test_data',
'field' => 'name',
'relationship' => 'none',
],
]);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals($counter_start, $counter);
$view->destroy();
// Go to the second page.
$view->setCurrentPage(1);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals($counter_start + 1, $counter);
$view->destroy();
// Go to the third page.
$view->setCurrentPage(2);
$view->preview();
$counter = $view->style_plugin->getField(0, 'counter');
$this->assertEquals($counter_start + 2, $counter);
} | [
"public function count_pager() {\r\n\t\treturn min($this->count(), APP_SPHINX_MAX_MATCHES);\r\n\t}",
"function test_record_count_and_total_count_with_filter(){\n\t\tself::clear_get_values();\n\n\t\tadd_filter('frm_display_entry_content', 'frm_get_current_entry_num_out_of_total', 20, 7);\n\n\t\t// Check page 1, page size of 1\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\t\t$string = 'Viewing entry 1 to 1 (of 3 entries)';\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', $string ), array( 'Steph', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test' );\n\n\t\t// Check page 2, page size of 1\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 2;\n\t\t$string = 'Viewing entry 2 to 2 (of 3 entries)';\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steph', $string ), array( 'Jamie', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test 2' );\n\n\t\t// Check page 1 with a page size of 2\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 1;\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 2;\n\t\t$string = 'Viewing entry 1 to 2 (of 3 entries)';\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', 'Steph', $string ), array( 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test 3' );\n\t}",
"public function testModSelectCountPages()\n {\n $this->todo('stub');\n }",
"function pageCount()\r\n {\r\n return 1;\r\n }",
"function getCount() {\n return $this->pager_param['count'];\n }",
"public function testGetPagerInfo()\n {\n $this->todo('stub');\n }",
"public function countPages(): int;",
"public function testPager() {\n // Create nodes, each with a different creation time so that we have\n // conditions that are meaningful for the use of a pager.\n $this->drupalCreateContentType(['type' => 'page']);\n for ($i = 0; $i < 12; $i++) {\n $this->drupalCreateNode(['created' => REQUEST_TIME - $i]);\n }\n\n // Make a View that uses a pager.\n $path_with_pager = 'test-view-with-pager';\n $this->createViewAtPath($path_with_pager, TRUE);\n $this->drupalGet($path_with_pager);\n\n // This technique for finding the existence of a pager\n // matches that used in Drupal\\views_ui\\Tests\\PreviewTest.php.\n $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']);\n $this->assertNotEmpty($elements, 'Full pager found.');\n\n // Make a View that does not have a pager.\n $path_with_no_pager = 'test-view-without-pager';\n $this->createViewAtPath($path_with_no_pager, FALSE);\n $this->drupalGet($path_with_no_pager);\n $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']);\n $this->assertEmpty($elements, 'Full pager not found.');\n }",
"public function increasePageview($currentCount)\r\n{\r\nreturn $currentCount + 1;\r\n}",
"protected function initializePager() {\n if ($this->pager && !empty($this->pager['limit']) && !$this->count) {\n $page = \\Drupal::service('pager.parameters')->findPage($this->pager['element']);\n $count_query = clone $this;\n $this->pager['total'] = $count_query->count()->execute();\n $this->pager['start'] = $page * $this->pager['limit'];\n \\Drupal::service('pager.manager')->createPager($this->pager['total'], $this->pager['limit'], $this->pager['element']);\n $this->range($this->pager['start'], $this->pager['limit']);\n }\n }",
"function getItemCounterText() {\n\t\tif (!is_numeric($this->getItemCountPerPage())) {\n\t\t\treturn \"Viewing \".$this->getPageStartIndex().\" - \".$this->getItemCount(). \" of \".$this->getItemCount();\n\t\t}\n\t\treturn \"Viewing \".$this->getPageStartIndex().\" - \".$this->getPageEndIndex(). \" of \".$this->getItemCount(); \n\t}",
"public function testGetPagerId() {\n // Should return 0 if 'id' is not set.\n $this->assertEquals(0, $this->pager->getPagerId());\n\n $this->pager->options['id'] = 1;\n\n $this->assertEquals(1, $this->pager->getPagerId());\n }",
"public function testPagers() {\n // Create 51 nodes to force the pager.\n foreach (range(1, 51) as $delta) {\n Node::create([\n 'type' => 'moderated_content',\n 'uid' => $this->adminUser->id(),\n 'title' => 'Node ' . $delta,\n 'status' => 1,\n 'moderation_state' => 'published',\n ])->save();\n }\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/content');\n $element = $this->cssSelect('nav.pager li.is-active a');\n $url = $element[0]->getAttribute('href');\n $query = [];\n parse_str(parse_url($url, PHP_URL_QUERY), $query);\n $this->assertEquals(0, $query['page']);\n }",
"private function checkPage() \n {\n $count = $this->result['count'];\n $this->pageMax = ($count == 0)? 1 : ceil($count/$this->records);\n if ($this->page > $this->pageMax && $this->page != 1) {\n $this->page = $this->pageMax;\n $this->redirect('this');\n }\n }",
"function bbp_search_pagination_count()\n{\n}",
"public function testCountWithCustomCounter(): void\n {\n $table = $this->getTableLocator()->get('articles');\n $query = $table->find('all');\n $query\n ->select(['author_id', 's' => $query->func()->sum('id')])\n ->where(['id >' => 2])\n ->groupBy(['author_id'])\n ->counter(function ($q) use ($query) {\n $this->assertNotSame($q, $query);\n\n return $q->select([], true)->groupBy([], true)->count();\n });\n\n $result = $query->count();\n $this->assertEquals(1, $result);\n }",
"public function testExecuteCountQueryWithoutOffset() {\n $statement = $this->createMock('\\Drupal\\Tests\\views\\Unit\\Plugin\\pager\\TestStatementInterface');\n\n $statement->expects($this->once())\n ->method('fetchField')\n ->will($this->returnValue(3));\n\n $query = $this->getMockBuilder('\\Drupal\\Core\\Database\\Query\\Select')\n ->disableOriginalConstructor()\n ->getMock();\n\n $query->expects($this->once())\n ->method('execute')\n ->will($this->returnValue($statement));\n\n $this->pager->setOffset(0);\n $this->assertEquals(3, $this->pager->executeCountQuery($query));\n }",
"protected function checkCountLimitProcessor() {\n $this->drupalGet($this->editForm);\n\n $form = [\n 'widget_config[show_numbers]' => TRUE,\n 'facet_settings[count_limit][status]' => TRUE,\n ];\n $this->submitForm($form, 'Save');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->checkboxChecked('edit-facet-settings-count-limit-status');\n $form = [\n 'widget_config[show_numbers]' => TRUE,\n 'facet_settings[count_limit][status]' => TRUE,\n ];\n $this->submitForm($form, 'Save');\n\n $form = [\n 'widget_config[show_numbers]' => TRUE,\n 'facet_settings[count_limit][status]' => TRUE,\n 'facet_settings[count_limit][settings][minimum_items]' => 5,\n ];\n $this->submitForm($form, 'Save');\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('Displaying 10 search results');\n $this->assertFacetLabel('grape (6)');\n $this->assertSession()->pageTextNotContains('apple');\n\n $form = [\n 'widget_config[show_numbers]' => TRUE,\n 'facet_settings[count_limit][status]' => TRUE,\n 'facet_settings[count_limit][settings][minimum_items]' => 1,\n 'facet_settings[count_limit][settings][maximum_items]' => 5,\n ];\n $this->drupalGet($this->editForm);\n $this->submitForm($form, 'Save');\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('Displaying 10 search results');\n $this->assertSession()->pageTextNotContains('grape');\n $this->assertFacetLabel('apple (4)');\n\n $form = [\n 'widget_config[show_numbers]' => FALSE,\n 'facet_settings[count_limit][status]' => FALSE,\n ];\n $this->drupalGet($this->editForm);\n $this->submitForm($form, 'Save');\n }",
"public function hasPager()\n {\n return ($this->numPages() > 1);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List by tag prepend | public function listByTagPrepend($prepend = null, $since = null){
$return = array();
$rows = $this->EngagementRepository->listEngagementsEmailsByTagPrepend($prepend, $since);
if(!empty($rows)){
foreach($rows as $row){
array_push($return, CoreObjectUtils::applyRow('EngagementEmailEntryObject', $row));
}
}
return $return;
} | [
"function HtmlTagList($list,$tag,$options=array())\n {\n foreach ($list as $id => $item)\n {\n $list[ $id ]=$this->HtmlTags($tag,$item,$options);\n }\n\n return $list;\n }",
"function plugin_autotags_nexlist($op,$content='',$tag='') {\n global $_CONF,$_TABLES;\n if ($op == 'tagname' ) {\n // Supports standard formatted HTML list or return an array for the list values\n return array('list','alist');\n } elseif ($op == 'parse') {\n $parms = explode(',',$tag['parm1']);\n $listid = $parms[0];\n if (DB_count($_TABLES['nexlist'],'id',$listid) == 1) {\n if (isset($parms[1])) {\n $fieldnum = $parms[1];\n } else {\n $fieldnum = 0;\n }\n if (isset($parms[2])) {\n $selected = $parms[2];\n } else {\n $selected = 0;\n }\n if (isset($parms[3])) {\n $mode = $parms[3];\n } else {\n $mode = 'edit';\n }\n if (isset($parms[4])) {\n $varname = $parms[4]; // Used to create the edit select fieldname\n } else {\n $varname = 'nexlistfield';\n }\n if ($CONF_LL['debug']) {\n COM_errorLog(\"functions.inc => listid: $listid, fieldnum:$fieldnum, selected:$selected,mode:$mode\");\n }\n if ($tag['tag'] == 'alist') {\n return nexlistOptionList( 'alist', $varname, $listid, $fieldnum,$selected);\n } else {\n $listHTML = nexlistOptionList( $mode, $varname, $listid, $fieldnum,$selected);\n $retval = str_replace($tag['tagstr'],$listHTML,$content);\n return $retval;\n }\n } else {\n return $content;\n }\n }\n}",
"function newItemBefore()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$new_li =& $this->dom->create_element(\"ListItem\");\n\t\t$new_li =& $li->insert_before($new_li, $li);\n\t}",
"function prepend($value)\n {\n if ($this->contains($value)) return;\n $this->list = $value.($this->list ? ',' : '').$this->list;\n }",
"public function prepend($item);",
"private function generateBeforeItems()\n {\n return $this->generateElements($this->insertBefore);\n }",
"public function get_tag_list(){\n for($b=0; $b<sizeof($this->taglist); $b++){\n if($b>0) echo \", \";\n echo $this->taglist[$b];\n }\n }",
"function tag_list($tags)\n{\n\treturn join( ', ', array_map(function($tag){ return '<a href=\"/tags/' . ha($tag) . '\">' . h($tag) . '</a>'; }, $tags) );\n}",
"function transformToTagList($list){\n $newTags = array();\n foreach($list as $item){\n $tagFr = isset($item->tagFr) ? $item->tagFr : \"\";\n $tagEn = isset($item->tagEn) ? $item->tagEn : \"\";\n $tag = new Tag($item->id, $tagFr, $tagEn);\n array_push($newTags, $tag);\n }\n return $newTags;\n}",
"public function prepend($data){}",
"public function testListTagsWithPrefix()\n {\n $result = self::$adminApi->tags(['prefix' => self::$PREFIX_TAG]);\n\n self::assertObjectStructure($result, ['tags' => IsType::TYPE_ARRAY]);\n self::assertCount(1, $result['tags']);\n self::assertContains(self::$TAG_WITH_PREFIX, $result['tags']);\n }",
"function echo_all_tags($before='',$after='') {\r\n\t$tags = return_all_tags();\r\n\tif($tags) {\r\n\t\tforeach($tags as $tag) {\r\n\t\t\tif(defined('BJ_REWRITE')) {\r\n\t\t\t\techo\"<li class=\\\"list_tag\\\">\".$before.\"<a href=\\\"\".get_siteinfo('siteurl').\"tag/\".$tag['shortname'].\"\\\">\".$tag['name'].\"</a>\".$after.\"</li>\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\techo\"<li class=\\\"list_tag\\\">\".$before.\"<a href=\\\"\".get_siteinfo('siteurl').\"index.php?req=tag&name=\".$tag['shortname'].\"\\\">\".$tag['name'].\"</a>\".$after.\"</li>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"function CalmSeas_tagList($atts) {\n// styling of the list can be done by applying css rules to the CalmSeasTagList class\n\t$output = \"\";\n\t$tags = get_tags();\n\t$postCount = 0;\n foreach ($tags as $tag) {\n \tif ($tag->count > 0) {\n\t \t$postCount++;\n\t \t$output .= \"<li><a href=\\\"\" . get_tag_link($tag->term_id) . \"\\\">\" . $tag->name . \" (\" . $tag->count . \")</a></li>\";\n\t }\n }\n\n\tif ($postCount === 0) {\n\t\t$output = \"\";\n\t}\n\telse {\n\t\t$output = '<div class=\"CalmSeasTagList\"><ul>' . $output;\n\t\t$output .= '</ul></div>';\n\t}\n\n\treturn $output;\n}",
"function push_tag_list($tags, $delimiter) {\n\t\t$tags = explode($delimiter, $tags); // Explode the list to make it an array\n\t\t\n\t\t$this->push_tag_array($tags);\n\t\t\n\t}",
"public function prepend($item) : Sequence;",
"function getTags() {\n\n parent::getTags();\n\n $tags = [\n 'satisfactionsmiley.smileys' => __(\"Affichage notation avec les smileys\", \"satisfactionsmiley\"),\n ];\n\n foreach ($tags as $tag => $label) {\n $this->addTagToList([\n 'tag' => $tag,\n 'label' => $label,\n 'value' => true,\n 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS\n ]);\n }\n\n asort($this->tag_descriptions);\n }",
"private function prependContent($tag, $content)\n\t{\n\t\tpreg_match('§^<[a-zA-Z =\"0-9_-]+>§', $tag, $match);\n\t\treturn preg_replace('§^' . $match[0] . '§', $match[0] . $content, $tag);\n\t}",
"function listtag($text) {\r\n $lststyle = 'style=\"margin-top: 0px; margin-bottom: 0px;\"';\r\n\r\n if (preg_match_all('/\\[list=(.*)\\](.*)\\[\\/list\\]/siU', $text, $match)) {\r\n $return = preg_replace('/<br \\/>/', '', $match[0]);\r\n\r\n $text = str_replace($match[0], $return, $text);\r\n }\r\n \r\n $list_tags = array('/\\[list=1\\](.*)\\[\\/list\\](\\r\\n|)/siU', '/\\[list=2\\](.*)\\[\\/list\\](\\r\\n|)/siU',\r\n '/\\[list=3\\](.*)\\[\\/list\\](\\r\\n|)/siU', '/\\[\\*\\](.*)\\[\\/\\*\\]/isU');\r\n $list_html = array('<ol ' . $lststyle . '>\\\\1</ol>', '<ol ' . $lststyle . ' type=\"a\">\\\\1</ol>', \r\n '<ul ' . $lststyle . '>\\\\1</ul>', '<li>\\\\1</li>');\r\n\r\n $text = preg_replace($list_tags, $list_html, $text);\r\n $text = str_replace(\"</ul><br />\", '</ul>', $text);\r\n\r\n return $text;\r\n }",
"public function addTag();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets Partners Status of the logged in user's agency. Should only be called if the logged in user is the admin of the agency. (v2.getPartnersstatus) | public function getPartnersstatus($optParams = array())
{
$params = array();
$params = array_merge($params, $optParams);
return $this->call('getPartnersstatus', array($params), "Google_Service_Partners_GetPartnersStatusResponse");
} | [
"function _esf_tc_content_types_get_partners_projects_status() {\n return _esf_tc_content_types_get_allowed_values_list('field_fc_mas_approval_status');\n}",
"public function getVerifiedPartners()\n {\n return isset($this->VerifiedPartners) ? $this->VerifiedPartners : null;\n }",
"public function getPartners()\n {\n return $this->partners;\n }",
"public function pendingCommunityPartners() {\n if(Yii::app()->user->checkAccess('aidadmin')) {\n return CommunityPartner::model()->pending()->count();\n }\n }",
"public function getProductionPartners() {\n return $this->request(\n \"GET\",\n \"/application/shops/{$this->shop_id}/production-partners\",\n \"ProductionPartner\"\n )\n ->append(['shop_id' => $this->shop_id]);\n }",
"public function getPartnerlevel()\n {\n return $this->partnerlevel;\n }",
"public function channel_partners_list() {\n\n return $this->db->select('*')\n ->from('tbl_admin')\n ->where('user_roles', 9)\n ->get()\n ->result();\n }",
"public function hasStatusProspect()\n {\n if ($this->hasRole('ROLE_CLIENT')) {\n return $this->profile->hasStatusProspect();\n }\n\n return false;\n }",
"public function getSubUserStatus();",
"public function getAccountsPartner()\n {\n $url = config('ms_global.ms_urls.' . config('app.env') . '.accounts') . config('ms_specific.account.get_partners');\n $response = $this->guzzle->get($url);\n\n if (!$response['data']['data']) {\n return $this->prepareResponse('Account record not found.', $this->statusError, Response::HTTP_NOT_FOUND);\n }\n\n return response()->json($response['data']['data'], $response['statusCode']);\n }",
"public function getSubUserStatus()\n {\n return $this->getData(self::STATUS);\n }",
"public function getPartnersAttribute()\n {\n return $this->getPartners();\n }",
"public function is_partner()\n {\n return $this->service->isPartner($this->client);\n }",
"public function getEnrollmentStatus(): int;",
"public function getPartyStatuses(): array\n {\n $json = $this->_guzzle\n ->request('GET', '/crunchi/api/Admin/PartyStatus')\n ->getBody()\n ->getContents();\n\n $results = [];\n foreach (\\json_decode($json) as $status) {\n $results[] = new PartyStatus(\n $status->ID,\n $status->Description,\n $status->IsOfficial\n );\n }\n\n return $results;\n }",
"public function isPartner()\n {\n $user = $this::with('employee')->find( Auth::user()->id);\n\n if ($user->Emp_id === 4)\n {\n return true;\n }\n\n return false;\n }",
"public function get_license_status() {\n \n if( ! defined ('PREMIUM_PRO_ADDONS_VERSION') ) {\n return;\n }\n \n $status = Admin::get_license_status();\n \n return $status;\n \n }",
"public function get_partners() {\r\n global $db;\r\n \r\n $partners = [];\r\n \r\n $sql = \"SELECT * FROM scfr_partners_group as s LEFT JOIN testfo_groups as g ON s.group_id = g.group_id\";\r\n $result = $db->sql_query($sql);\r\n while($row = $db->sql_fetchrow($result)) {\r\n $partners[] = $row;\r\n }\r\n \r\n return $partners;\r\n }",
"function getStatus(){\r\n $user = $this->loadUser(Yii::app()->user->id);\r\n return $user->status;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the v numero deux ini. | public function getVNumeroDeuxIni() {
return $this->vNumeroDeuxIni;
} | [
"public function getVNumeroCompteIni() {\n return $this->vNumeroCompteIni;\n }",
"private function getVatNumber() {\n\n return substr($this->vatId['vatId'], 2);\n }",
"public function getNumeroVias() {\n return $this->iNumeroVias;\n }",
"public function getNoserv() : Int{\n return $this->noserv;\n }",
"public function getDictNumero()\n {\n return $this->dict_numero;\n }",
"public function getVinNumber()\n {\n return isset($this->vinNumber) ? $this->vinNumber : null;\n }",
"public function getVInt()\n {\n return $this->get(self::V_INT);\n }",
"public function getNbvisiteur()\n {\n return $this->nbvisiteur;\n }",
"public function getNumero(){\n\t\treturn $this->numero;\n\t}",
"public function getIntbconfdefinvc()\n {\n return $this->intbconfdefinvc;\n }",
"function ciform_ini_to_num($valeur){ \n\t$valeur = trim($valeur);\n $unite = substr($valeur, -1);\n $return = substr($valeur, 0, -1);\n $return = floatval($return);\n \n switch(strtoupper($unite)){\n case 'G':\n $return *= 1073741824;\n break;\n case 'M':\n $return *= 1048576;\n break;\n case 'K':\n $return *= 1024;\n break;\n }\n\n return $return;\n}",
"public function getVergiDairesi()\n {\n return $this->vergiDairesi;\n }",
"public function getNumero(){\n return $this->numero;\n }",
"public function getVIN()\n {\n return $this->vIN;\n }",
"public function getNiveauNoeud() {\n return $this->niveauNoeud;\n }",
"public function getVisaNumber()\n {\n return isset($this->VisaNumber) ? $this->VisaNumber : null;\n }",
"function nbr_rdv_heure($choix)\n {\n $nbrRDV=\"\";\n switch($choix)\n {\n case \"1\" : $nbrRDV= 1; break;\n case \"2\" : $nbrRDV= 2; break;\n case \"3\" : $nbrRDV= 3; break;\n case \"4\" : $nbrRDV= 4; break;\n \n }\n return $nbrRDV;\n }",
"public function getVatId() {\n\n return $this->vatId['vatId'];\n }",
"public function getVNumeroCompte() {\n return $this->vNumeroCompte;\n }"
] | {
"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.