query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Create Content Security Policy header from a given header line | public static function fromString($headerLine)
{
$header = new static();
$headerName = $header->getFieldName();
[$name, $value] = GenericHeader::splitHeaderLine($headerLine);
// Ensure the proper header name
if (strcasecmp($name, $headerName) !== 0) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid header line for %s string: "%s"',
$headerName,
$name
));
}
// As per http://www.w3.org/TR/CSP/#parsing
$tokens = explode(';', $value);
foreach ($tokens as $token) {
$token = trim($token);
if ($token) {
[$directiveName, $directiveValue] = array_pad(explode(' ', $token, 2), 2, null);
if (! isset($header->directives[$directiveName])) {
$header->setDirective(
$directiveName,
$directiveValue === null ? [] : [$directiveValue]
);
}
}
}
return $header;
} | [
"private function setCspHeader()\n\t{\n\t\t$cspValues = $this->params->get('contentsecuritypolicy_values', []);\n\t\t$cspReadOnly = (int) $this->params->get('contentsecuritypolicy_report_only', 0);\n\t\t$csp = $cspReadOnly === 0 ? 'Content-Security-Policy' : 'Content-Security-Policy-Report-Only';\n\t\t$newCspValues = [];\n\n\t\t$scriptHashesEnabled = (int) $this->params->get('script_hashes_enabled', 0);\n\t\t$styleHashesEnabled = (int) $this->params->get('style_hashes_enabled', 0);\n\n\t\tforeach ($cspValues as $cspValue)\n\t\t{\n\t\t\t// Handle the client settings foreach header\n\t\t\tif (!$this->app->isClient($cspValue->client) && $cspValue->client != 'both')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Append the script hashes placeholder\n\t\t\tif ($scriptHashesEnabled && strpos($cspValue->directive, 'script-src') === 0)\n\t\t\t{\n\t\t\t\t$cspValue->value .= ' {script-hashes}';\n\t\t\t}\n\t\t\t// Append the style hashes placeholder\n\t\t\tif ($styleHashesEnabled && strpos($cspValue->directive, 'style-src') === 0)\n\t\t\t{\n\t\t\t\t$cspValue->value .= ' {style-hashes}';\n\t\t\t}\n\n\t\t\t// We can only use this if this is a valid entry\n\t\t\tif (isset($cspValue->directive) && isset($cspValue->value))\n\t\t\t{\n\t\t\t\t$newCspValues[] = trim($cspValue->directive) . ' ' . trim($cspValue->value);\n\t\t\t}\n\t\t}\n\n\t\t// Add the xframeoptions directive to the CSP too when enabled\n\t\tif ($this->params->get('xframeoptions'))\n\t\t{\n\t\t\t$newCspValues[] = \"frame-ancestors 'self'\";\n\t\t}\n\n\t\tif (empty($newCspValues))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->app->setHeader($csp, implode('; ', $newCspValues));\n\t}",
"public function parsePolicy($policy_string)\n {\n // TODO: assert the policy is a string or array.\n // The directives are separated by semi-colons.\n\n // If an array, then combine into a single string for parsing.\n if (is_array($policy_string)) {\n $policy_string = implode(static::DIRECTIVE_SEP, $policy_string);\n }\n\n // Replace commas with semi-colons.\n // Un-encoded commas singnify the combining of the values of multiple CSP headers.\n // We just treat it as one header by replacing the header value separator with the\n // directive separator.\n\n $policy_string = str_replace(static::HEADER_VALUE_SEP, static::DIRECTIVE_SEP, $policy_string);\n\n // Semi-colons are not allowed anywhere else in the directive list without\n // being percentage escaped. This will only happen in SourceHost as there\n // are no semi-colons in any of the other directives.\n\n $directive_list = explode(static::DIRECTIVE_SEP, $policy_string);\n\n // The Policy object we will return.\n // TODO: use some kind of factory.\n\n $policy = new Policy();\n\n // Parse each individual directive.\n\n foreach($directive_list as $directive_string) {\n // Parse this single directive.\n // Trim any white space and empty directives.\n\n $directive = $this->parseDirective(ltrim($directive_string, static::WSP . static::DIRECTIVE_SEP));\n\n // If it was not parsable, then skip it.\n // We want to catch as many directives as we can. We probably don't\n // want to skip any completely, but perhaps add a \"raw\" directive to\n // the policy and mark it as unparsable.\n\n if ( ! isset($directive)) {\n continue;\n }\n\n // Add the directive to the policy, discarding if we already have this directive.\n $policy->addDirective($directive, Policy::DUP_DISCARD);\n }\n\n return $policy;\n }",
"protected function _sendHeader($content)\n\t{\n\t\t// default to the most recent header version\n\t\t$header = 'Content-Security-Policy';\n\t\t$agent = $this->call('/Tool/serverVal', 'HTTP_USER_AGENT');\n\n\t\t// A crude form of User-Agent based browser detection\n\t\tif (!empty($agent) && preg_match_all('/(?:(?:firefox|chrome|safari|msie|version|gecko|webkit|trident)[\\/ ][0-9\\.]+)/i', $agent, $match))\n\t\t{\n\t\t\t$version = (object) Array();\n\t\t\tforeach ($match[0] as $part)\n\t\t\t{\n\t\t\t\tlist($key, $value) = explode('/', $part, 2);\n\t\t\t\t$version->{strtolower($key)} = $value;\n\t\t\t}\n\n\t\t\t// Using the detected user-agent to determine which of the three CSP header flavors we need\n\t\t\t// based on: http://caniuse.com/contentsecuritypolicy (2013-08-09)\n\t\t\t// - X-Content-Security-Policy: MSIE versions (10+), FireFox versions 4-22 (slight differences from spec)\n\t\t\t// - X-Webkit-CSP: Safari versions (5.1+), Chrome versions 14-24\n\t\t\t// - Content-Security-Policy: Chrome 25+, FireFox 23+ (CSP spec 1.0)\n\n\t\t\t// Note that the most appropriate headers are send for browser versions which don't actually support them,\n\t\t\t// e.g. MSIE 9- and FireFox 3- will receive the X-Content-Security-Policy headers\n\t\t\t// Any user-agent unmatched by the criteria belowwill receive the Content-Security-Policy header\n\n\t\t\t// All versions of IE > 10 and Firefox up to 22 need the X- prefixed header\n\t\t\tif (isset($version->msie) || (isset($version->firefox) && $version->firefox < 23))\n\t\t\t{\n\t\t\t\t$header = 'X-' . $header;\n\t\t\t\t// As Firefox implemented their initial CSP spec, we need to reflect the original\n\t\t\t\t// policy rules (pre-w3 spec)\n\t\t\t\tif (isset($version->firefox))\n\t\t\t\t{\n\t\t\t\t\t// connect-src is called xhr-src (and only applies to XMLHTTPRequest\n\t\t\t\t\t$content = str_replace('connect-src', 'xhr-src', $content);\n\t\t\t\t\tif (preg_match('/script-src.*?;/i', $content, $scriptMatch) && preg_match_all('/(\\'unsafe-(?:eval|inline)\\')/', $scriptMatch[0], $match))\n\t\t\t\t\t{\n\t\t\t\t\t\t$options = Array();\n\t\t\t\t\t\t$script = $scriptMatch[0];\n\t\t\t\t\t\tforeach ($match[0] as $option)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$script = str_replace($option, '', $script);\n\t\t\t\t\t\t\t$options[] = preg_replace('/\\'unsafe-([a-z]+)\\'/', '\\\\1-script', $option);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$script = preg_replace('/\\s+/', ' ', $script);\n\t\t\t\t\t\t$content = str_replace($scriptMatch[0], $script, $content) . '; ' . (count($options) ? 'options ' . implode(' ', $options) : '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All versions of Safari and Chrome up to 24 need the X-Webkit-CSP header\n\t\t\telse if (isset($version->webkit) && (!isset($version->chrome) || $version->chrome < 25))\n\t\t\t{\n\t\t\t\t$header = 'X-Webkit-CSP';\n\t\t\t}\n\t\t}\n\t\tif (!headers_sent())\n\t\t\theader($header . ': ' . $content);\n\t}",
"public static function fromString($headerLine);",
"function _generateP3PHeader()\n{\n $p3p_header .= \" CP=\\\"\".\"CUR ADM OUR NOR STA NID\".\"\\\"\";\n return $p3p_header;\n}",
"private function makeHeaderValue()\n {\n $pieces = ['max-age=' . (int) $this->config['max-age']];\n\n if ($this->config['enforce'])\n {\n $pieces[] = 'enforce';\n }\n\n if ($this->config['report-uri'])\n {\n $pieces[] = 'report-uri=\"' . $this->config['report-uri'] . '\"';\n }\n\n return implode('; ', $pieces);\n }",
"function generateHeader () {\n $header = json_encode(['typ' => 'JWT', 'alg' => 'HS256']);\n // Encode header to Base64Url string\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n return $base64UrlHeader;\n}",
"public function contentSecurityPolicy( $value=\"\" )\n {\n $value = trim( $value );\n\n if( !empty( $value ) )\n {\n $this->setHeader( \"Content-Security-Policy\", $value );\n $this->setHeader( \"X-Content-Security-Policy\", $value );\n $this->setHeader( \"X-Webkit-CSP\", $value );\n }\n return $this;\n }",
"protected function getCspHeader(TestResponse $resp, string $type): string\n {\n $cspHeaders = explode('; ', $resp->headers->get('Content-Security-Policy'));\n\n foreach ($cspHeaders as $cspHeader) {\n if (strpos($cspHeader, $type) === 0) {\n return $cspHeader;\n }\n }\n\n return '';\n }",
"private function _generateAuthorizationHeader()\n\t{\n\t\t$headers = '(request-target) host date original-date digest x-request-id';\n\t\t$this->_signature = $this->_generateSignature($this->_composeSigningString());\n\t\t\n\t\t$authHeader = \"Signature keyId=\\\"$this->_key_id\\\",algorithm=\\\"$this->_sign_algorithm\\\",headers=\\\"$headers\\\", signature=\\\"$this->_signature\\\"\";\n\t\treturn $authHeader;\n\t}",
"private function crearHeader() {\n $fileSize = $this->bytesToString($this->toUint32(strlen($this->fileContents) + 4));\n $this->fileHeader = \"RIFF\" . $fileSize . \"WEBP\";\n }",
"public function secureHeader($str) {\n return trim(str_replace([\"\\r\", \"\\n\"], '', $str));\n }",
"function setSecurityHeaders()\n{\n\t$headers = new SecureHeaders();\n\t$headers->hsts();\n\t$headers->csp('default', 'self');\n\t$headers->csp('style', 'self');\n\t$headers->csp('style', 'fonts.googleapis.com');\n\t$headers->csp('font', 'self');\n\t$headers->csp('font', 'fonts.gstatic.com');\n\t$headers->csp('style', \"'nonce-\" . getNonce() . \"'\"); // Nonce for styles.\n\t$headers->apply();\n}",
"public function addCSPHeaderToResponse(FilterResponseEvent $event)\n {\n // get the Response object from the event\n $response = $event->getResponse();\n\n // create a CSP rule, using the nonce generator service\n $nonce = $this->nonceGenerator->getNonce();\n $cspHeader = \"script-src maps.googleapis.com 'nonce-\".$nonce.\"' https:;object-src 'none';img-src 'self' https:;child-src https://www.google.com;media-src 'none';frame-ancestors 'none';block-all-mixed-content;\";\n\n // set CSP header on the response object\n $response->headers->set(\"Content-Security-Policy\", $cspHeader);\n }",
"function makeHeader()\n {\n /* $cnonce should be an int between 0 and 99999. */\n $cnonce = rand(0, 99999);\n\n /* $timestamp should include milliseconds. */\n $timestamp = round(microtime(true) * 1000);\n\n $auth = array();\n $auth['Mauth realm'] = 'http://webrtc.intel.com';\n $auth['mauth_signature_method'] = 'HMAC_SHA256';\n $auth['mauth_serviceid'] = $this->config->owt->serviceId;\n $auth['mauth_cnonce'] = $cnonce;\n $auth['mauth_timestamp'] = $timestamp;\n\n /* Generate the signature and convert to base64. */\n $rawSignature = hash_hmac('sha256', $timestamp . ',' . $cnonce, $this->config->owt->serviceKey);\n $auth['mauth_signature'] = base64_encode($rawSignature);\n\n /* Implode the keys and values of the $auth array into a string connected by comma and linebreak along with contentType json. */\n return array('Authorization: ' . urldecode(http_build_query($auth, null, \",\")), 'Content-Type: application/json');\n }",
"private function makeHeaderSignatureString(string $request_line, array $headers) {\n\t\t$signature_string = \"\";\n\n\t\tforeach($headers as $name => $value) {\n\n\t\t\t$signature_string .= strtolower($name).\": \".$value.\"\\n\";\n\n\t\t}\n\n\t\treturn rtrim($signature_string,\"\\n\");\n\n\t}",
"function format_header()\n\t{\n\t\t$this->headers = str_replace(\"\\r\\n\", \"\\n\", $this->headers);\n\t\t// Cleanup multiline headers.\n\t\t$this->headers = preg_replace(\"!\\n(\\t| )+!\", ' ', $this->headers);\n\t\t$hdr = explode(\"\\n\", trim($this->headers));\n\t\t$this->headers = array();\n\t\tforeach ($hdr as $v) {\n\t\t\t$hk = substr($v, 0, ($p = strpos($v, ':')));\n\t\t\t// Skip non-valid header lines.\n\t\t\tif (!$hk || ++$p == strlen($v) || ($v{$p} != ' ' && $v{$p} != \"\\t\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$hv = substr($v, $p);\n\t\t\t$hk = strtolower(trim($hk));\n\n\t\t\tif (!isset($this->headers[$hk])) {\n\t\t\t\t$this->headers[$hk] = decode_header_value($hv);\n\t\t\t} else {\n\t\t\t\t$this->headers[$hk] .= ' '. decode_header_value($hv);\n\t\t\t}\n\t\t}\n\t}",
"public function createHeader($header, $value = null);",
"static function factoryString($headerLine)\n {\n ## extract label and value from header\n $parsed = UHeader::parseLabelValue( (string) $headerLine);\n if ($parsed === false)\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Header (%s)'\n , $headerLine\n ));\n\n return self::factory(key($parsed), current($parsed));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests if a user has done a level | public function hasDoneLevel( $levelId ); | [
"public function is($level=\"USER,MOD,ADMIN\") {\n\t\t// Are the user details loaded into the session variable?\n\t\tif( $this->isLoaded() ) {\n\t\t\t// If a session timout is defined, check it here\n\t\t\tif( SESSION_TIMEOUT != 0) {\n\t\t\t\tif(time() - $_SESSION[SESSION_VARIABLE]['time'] > SESSION_TIMEOUT) {\n\t\t\t\t\t$this->logout(\"Session Timed out\", true);\n\t\t\t\t}\n\t\t\t\t$_SESSION[SESSION_VARIABLE]['time'] = time();\t\t\t\n\t\t\t}\n\t\t\t// Check if the user exists in the database\n\t\t\t$sql = \"SELECT `{$this->table['level']}` FROM \".TBL_USERS.\" WHERE `{$this->table['id']}` = '\".$_SESSION[SESSION_VARIABLE]['id'].\"' \n\t\t\t\t\tAND `{$this->table['session']}` = '\".$_SESSION[SESSION_VARIABLE]['session'].\"'\";\n\t\t\t$res = $this->db->query($sql);\n\t\t\tif($res->num_rows != 1) {\n\t\t\t\t$this->logout(\"Session Invalid\", true);\n\t\t\t}\n\t\t\t$row = $res->fetch_assoc();\n\t\t\t$userLevel = $row[$this->table['level']];\n\t\t\t// If the user is all right, update the last active time in the db\n\t\t\t$sql = \"UPDATE \".TBL_USERS.\" SET `{$this->table['time']}` = '\".date('Y-m-d H:i:s', time()-1).\"' \n\t\t\t\t\tWHERE `{$this->table['id']}` = '\".$_SESSION[SESSION_VARIABLE]['id'].\"' \n\t\t\t\t\tAND `{$this->table['session']}` = '\".$_SESSION[SESSION_VARIABLE]['session'].\"'\";\n\t\t\t$res = $this->db->query($sql);\n\t\t\t// Check for the userlevels\n\t\t\t$level = explode(',',$level);\n\t\t\t$levels = array();\n\t\t\tforeach($level as $k) {\n\t\t\t\tarray_push($levels, constant($k));\n\t\t\t}\n\t\t\tif( in_array ($userLevel, $levels) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->error(\"Insufficient Privilege\");\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\t// Here, the user isn't logged in. So redirect him automatically to the login page\n\t\t// Some basic regex cleanup so that the user isn't redirected to a page outside the site\n\t\t$url = parse_url($this->getActualPath(true));\n\t\t$replace = '/'.preg_replace('/\\//','\\/', $url['path']).'/';\n\t\t$to = preg_replace($replace, '', $_SERVER['PHP_SELF']);\n\t\t$path = $this->actualPath.\"index.php?to=$to\";\n\t\t$this->redirect($path);\n\t}",
"public function is_level($level = 1)\n\t{\n\t\t// Get current user\n\t\t$user = $this->user();\n\n\t\t// Return if user level is high enough\n\t\treturn ($user AND $user['level'] >= $level);\n\t}",
"public function DetermineLevel(){\n\n\t $UserCompelteTasks = self::has30Task();\n\n\t foreach ($UserCompelteTasks as $key => $User) {\n\n\t if($self::GetDegreeOfTasks($User->id) >= 70){\n\n\t User::where('id',$User->id)->update(['level'=>'1']);\n\n\t }\n\t }//end foreach\n\n }",
"protected function user_has_level( $data ) {\n\t\t$result = false;\n\n\t\tif ( $this->is_active ) {\n\t\t\t$data = lib2()->array->get( $data );\n\t\t\tlib2()->array->equip( $data, 'membership_lvl' );\n\t\t\t$data['membership_lvl'] = lib2()->array->get( $data['membership_lvl'] );\n\n\t\t\tforeach ( $data['membership_lvl'] as $level ) {\n\t\t\t\tif ( current_user_on_level( $level ) ) {\n\t\t\t\t\t$result = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"function pmpmromk_pmpro_has_membership_level($haslevel, $user_id, $levels) {\n\tglobal $pmpromk_user_id;\t\t\n\t\n\tif(empty($pmpromk_user_id))\n\t\treturn $haslevel;\n\t\n\t//check if the member key user has this level\n\tremove_filter('pmpro_has_membership_level', 'pmpmromk_pmpro_has_membership_level', 10, 3);\n\tif(pmpro_hasMembershipLevel($levels, $pmpromk_user_id))\n\t\t$haslevel = true;\n\tadd_filter('pmpro_has_membership_level', 'pmpmromk_pmpro_has_membership_level', 10, 3);\n\n\treturn $haslevel;\n}",
"public function DetermineLevel(){\n $UserCompelteTasks = self::has30Task();\n \n \n foreach ($UserCompelteTasks as $key => $User) {\n\n if(self::GetDegreeOfTasks($User->id) >= 70){\n\n User::where('id',$User->id)->update(['level'=>'1']);\n\n }\n }//end foreach\n }",
"function isLevelAvailable($level)\n {\n\n // define all the global variables\n global $database, $message;\n\n // check for empty object given\n if ($level == \"\") {\n return false;\n }\n\n // check in database if exists\n $sql = \"SELECT COUNT(*) FROM \" . TBL_LEVELS . \" WHERE \" . TBL_LEVELS_LEVEL . \" = '$level'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n // grab the results\n $row = $database->getQueryEffectedRow($result, true);\n\n // check if any values has been returned\n if ($row[0] > 0) {\n return true;\n } else {\n return false;\n }\n }",
"function check_level() {\r\n\t\t$query = \"select level from users where uid=\".$_SESSION['userid'];\r\n\t\t$res = $this->mdb2->query($query);\r\n\t\tif (PEAR::isError($res)) {\r\n\t\t\tdie($res->getMessage());\r\n\t\t}\r\n\t\t$row = $res->fetchRow();\r\n\t}",
"public function userHasAccess(){\n\t\tif( !$this->user->isAuth() && !$this->user->auth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->user->hasAccessToLevel( $this->getLevelId() );\n\t}",
"public static function Check($level) {\n\t\tif (isset ( $_SESSION ['User'] )) {\n\t\t\treturn ($_SESSION ['User']->accesslevel >= $level ? true : false);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function checkUserLevelUp(int $uid) : bool\n {\n $execSql = \"update shop_member as m left join shop_member_count as mc on m.id = mc.uid set level = (case \";\n\n $levelRules = (array)$this->getSetting(\"userLevelRules\");\n foreach( array_reverse($levelRules) as $rule ) {\n $execSql .= \"when mc.consume_money >= \" . $rule[\"consume_money\"] . \" then \" . $rule[\"level\"] . \" \";\n }\n $execSql .= \" end) where uid = ?\";\n \n $this->mysqlDao->setExecuteSql($execSql)->prepare()->execute([$uid]);\n\n return $this->mysqlDao->execResult;\n }",
"public static function permission($level)\n {\n\t\t//chack session !isset($_SESSION['yuser_id']) |||||$_SESSION['yuser_level'] <=$level \n\t\t//chack _COOKIE\n\t\tif( !isset($_COOKIE['yuser_id']) ){return false;}\n\t\t//get user\n\t\t//chack user level\n\t\tif( $_COOKIE['yuser_level'] <=$level)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function pmpro_hasMembershipLevel($levels = NULL, $user_id = NULL)\n{\n\tglobal $current_user, $all_membership_levels, $wpdb;\n\n\t$return = false;\n\n\tif(empty($user_id)) //no user_id passed, check the current user\n\t{\n\t\t$user_id = $current_user->ID;\n\t\t$membership_levels = $current_user->membership_levels;\n\t}\n\telseif(is_numeric($user_id)) //get membership levels for given user\n\t{\n\t\t$membership_levels = pmpro_getMembershipLevelsForUser($user_id);\n\t}\n\telse\n\t\treturn false;\t//invalid user_id\n\n\tif($levels === \"0\" || $levels === 0) //if 0 was passed, return true if they have no level and false if they have any\n\t{\n\t\t$return = empty($membership_levels);\n\t}\n\telseif(empty($levels)) //if no level var was passed, we're just checking if they have any level\n\t{\n\t\t$return = !empty($membership_levels);\n\t}\n\telse\n\t{\n\t\tif(!is_array($levels)) //make an array out of a single element so we can use the same code\n\t\t{\n\t\t\t$levels = array($levels);\n\t\t}\n\t\t\t\t\n\t\tif(empty($membership_levels))\n\t\t{\t\t\t\n\t\t\t//user has no levels just check if 0, L, or -L was sent in one of the levels\n\t\t\tif(in_array(0, $levels, true) || in_array(\"0\", $levels))\n\t\t\t\t$return = true;\n\t\t\telseif(in_array(\"L\", $levels) || in_array(\"l\", $levels))\n\t\t\t\t$return = (!empty($user_id) && $user_id == $current_user->ID);\n\t\t\telseif(in_array(\"-L\", $levels) || in_array(\"-l\", $levels))\n\t\t\t\t$return = (empty($user_id) || $user_id != $current_user->ID);\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tforeach($levels as $level)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(strtoupper($level) == \"L\")\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t//checking if user is logged in\n\t\t\t\t\tif(!empty($user_id) && $user_id == $current_user->ID)\n\t\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t\telseif(strtoupper($level) == \"-L\")\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t//checking if user is logged out\n\t\t\t\t\tif(empty($user_id) || $user_id != $current_user->ID)\n\t\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t\telseif($level == \"0\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\t//user with levels so not a \"non-member\"\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//checking a level id\n\t\t\t\t\t$level_obj = pmpro_getLevel(is_numeric($level) ? abs(intval($level)) : $level); //make sure our level is in a proper format\n\t\t\t\t\tif(empty($level_obj)){continue;} //invalid level\n\t\t\t\t\t$found_level = false;\n\t\t\t\t\tforeach($membership_levels as $membership_level)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($membership_level->id == $level_obj->id) //found a match\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$found_level = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(is_numeric($level) && intval($level) < 0 && !$found_level) //checking for the absence of this level and they don't have it\n\t\t\t\t\t{\n\t\t\t\t\t\t$return = true;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\telseif(is_numeric($level) && intval($level) > 0 && $found_level) //checking for the presence of this level and they have it\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t$return = true;\n\t\t\t\t\t}\n\t\t\t\t\telseif(!is_numeric($level))\t//if a level name was passed\n\t\t\t\t\t\t$return = $found_level;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$return = apply_filters(\"pmpro_has_membership_level\", $return, $user_id, $levels);\n\treturn $return;\n}",
"function editMemberLevel($projectID, $user, $level)\n\t{\n\t\tglobal $database;\n\t\t\n\t\t//check if is a member\n\t\t$result = $database->query(\"SELECT userlevel FROM \".TBL_PROJECT_MEMBERS.\" WHERE projectID='$projectID' AND username='\".$this->username.\"'\");\n\t\tif(mysql_num_rows($result)<=0 && $this->userlevel<MANAGER_LEVEL)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//check if member is an admin\n\t\t$array = mysql_fetch_array($result);\n\t\tif($array['userlevel']<PROJECT_MANAGER && $this->userlevel<MANAGER_LEVEL)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//checks if change member is creator\n\t\t$result1 = $database->query(\"SELECT creator FROM \".TBL_PROJECTS.\" WHERE id='$projectID' AND creator='$user'\");\n\t\tif(mysql_num_rows($result1)>0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$database->query(\"UPDATE \".TBL_PROJECT_MEMBERS.\" SET userlevel=$level WHERE projectID='$projectID' AND username='$user'\");\n\t\treturn true;\n\t}",
"function grant($user, $level) {\n global $auth_user;\n\n $this->_requireKarma();\n\n // Abort if the karma level has already been granted to the user\n if ($this->has($user, $level)) {\n PEAR::raiseError(\"The karma level $level has already been \"\n . \"granted to the user $user.\");\n return false;\n }\n\n $id = $this->_dbh->nextId(\"karma\");\n\n $query = \"INSERT INTO karma VALUES (?, ?, ?, ?, NOW())\";\n $sth = $this->_dbh->query($query, array($id, $user, $level, $auth_user->handle));\n\n if (!DB::isError($sth)) {\n $this->_notify($auth_user->handle, $user, \"Added level \\\"\" . $level . \"\\\"\");\n return true;\n }\n\n return false;\n }",
"function pmprokm_after_change_membership_level($level_id, $user_id) {\r\n\r\n global $current_user, $pmprokm_options;\r\n\r\n if(!defined('PMPROKM_READY'))\r\n return;\r\n\r\n //switch KM identity to affected user\r\n $user = get_userdata($user_id);\r\n KM::identify($user->user_login);\r\n\r\n //user changed level\r\n if(!empty($pmprokm_options['track_pmpro_change_level']) && !empty($level_id)) {\r\n $level = pmpro_getLevel($level_id);\r\n KM::record('Membership Level Changed', array('Membership Level' => $level->name));\r\n }\r\n\r\n //user cancelled\r\n if(!empty($pmprokm_options['track_pmpro_cancel']) && pmpro_hasMembershipLevel(0, $user_id)) {\r\n KM::record('Membership Level Cancelled');\r\n }\r\n\r\n}",
"function pmproio_isInviteGivenLevel($level_id)\r\n{\r\n\tglobal $pmproio_invite_given_levels;\r\n if(empty($pmproio_invite_given_levels))\r\n $pmproio_invite_given_levels = array();\r\n\treturn in_array($level_id, $pmproio_invite_given_levels);\r\n}",
"public static function hasLevel()\n\t{\n\t\t$has_level = false;\n\n\t\tif (self::checkSession())\n\t\t{\n\t\t\t$arguments = func_get_args();\n\t\t\tif (is_array($arguments[0]))\n\t\t\t{\n\t\t\t\t$arguments = $arguments[0];\n\t\t\t}\n\n\t\t\tforeach ($arguments as $access_level)\n\t\t\t{\n\t\t\t\tif (self::checkLevel($access_level))\n\t\t\t\t{\n\t\t\t\t\tif (self::getUserLevel() >= $access_level)\n\t\t\t\t\t{\n\t\t\t\t\t\t$has_level = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $has_level;\n\t}",
"function page_require_level($require_level){\n global $session;\n $current_user = current_user();\n $login_level = find_by_groupLevel($current_user['user_level']);\n //if user not login\n if (!$session->isUserLoggedIn(true)):\n $session->msg('d','Por favor Iniciar sesión...');\n redirect('../index.php', false);\n //if Group status Deactive\n elseif($login_level['group_status'] === '0'):\n $session->msg('d','Este nivel de usaurio esta inactivo!');\n redirect('../home.php',false);\n //cheackin log in User level and Require level is Less than or equal to\n elseif($current_user['user_level'] <= (int)$require_level):\n return true;\n else:\n $session->msg(\"d\", \"¡Lo siento! no tienes permiso para ver la página.\");\n redirect('../home.php', false);\n endif;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mrim::message_auth() Sends MRIM authorization request | function message_auth($to,$text = 'Здравствуйте. Пожалуйста, добавьте меня в список ваших контактов.')
{
if(!$this->is_connected())
return false;
$nickname = ($this->nickname?$this->nickname:$this->email);
$nickname = iconv('UTF-8','UTF-16LE//IGNORE',$nickname);
$text = iconv('UTF-8','UTF-16LE//IGNORE',$text);
$text = base64_encode(pack('L2',2,strlen($nickname)).$nickname.pack('L1',strlen($text)).$text);
$data = pack('L2',$this->MESSAGE_FLAG_AUTHORIZE,strlen($to)).$to.pack('L1',strlen($text)).$text.pack('L1',0);
fwrite($this->sock,$this->make_packet($this->MRIM_CS_MESSAGE,$data));
return true;
} | [
"private function send_auth()\n {\n $this->send_command('AUTH', 'AUTH LOGIN', '334');\n $this->send_command('USR', $this->username, '334');\n $this->send_command('PWD', $this->password, '235');\n }",
"protected function _auth($method)\n {\n $user = $this->getParam('username');\n $pass = $this->getParam('password');\n\n $debug = sprintf(\"[AUTH Command - method: %s; username: %s]\\n\", $method, $user);\n\n switch ($method) {\n case 'CRAM-MD5':\n case 'CRAM-SHA1':\n case 'CRAM-SHA256':\n // RFC 2195: CRAM-MD5\n // CRAM-SHA1 & CRAM-SHA256 supported by Courier SASL library\n $this->_connection->write('AUTH ' . $method);\n $resp = $this->_getResponse(334);\n\n $this->_debug->active = false;\n $this->_connection->write(\n base64_encode($user . ' ' . hash_hmac(Horde_String::lower(substr($method, 5)), base64_decode(reset($resp)), $pass, false))\n );\n $this->_debug->active = true;\n\n $this->_debug->raw($debug);\n break;\n\n case 'DIGEST-MD5':\n // RFC 2831/4422; obsoleted by RFC 6331\n // Since this is obsolete, will only attempt if\n // Horde_Imap_Client is also present on the system.\n if (!class_exists('Horde_Imap_Client_Auth_DigestMD5')) {\n throw new Horde_Smtp_Exception('DIGEST-MD5 not supported');\n }\n\n $this->_connection->write('AUTH ' . $method);\n $resp = $this->_getResponse(334);\n\n $this->_debug->active = false;\n $this->_connection->write(\n base64_encode(new Horde_Imap_Client_Auth_DigestMD5(\n $user,\n $pass,\n base64_decode(reset($resp)),\n $this->getParam('hostspec'),\n 'smtp'\n ))\n );\n $this->_debug->active = true;\n $this->_debug->raw($debug);\n\n $this->_getResponse(334);\n $this->_connection->write('');\n break;\n\n case 'LOGIN':\n $this->_connection->write('AUTH ' . $method);\n $this->_getResponse(334);\n $this->_connection->write(base64_encode($user));\n $this->_getResponse(334);\n $this->_debug->active = false;\n $this->_connection->write(base64_encode($pass));\n $this->_debug->active = true;\n $this->_debug->raw($debug);\n break;\n\n case 'PLAIN':\n // RFC 2595/4616 - PLAIN SASL mechanism\n $auth = base64_encode(implode(\"\\0\", array(\n $user,\n $user,\n $pass\n )));\n $this->_debug->active = false;\n $this->_connection->write('AUTH ' . $method . ' ' . $auth);\n $this->_debug->active = true;\n $this->_debug->raw($debug);\n break;\n\n case 'XOAUTH2':\n // Google XOAUTH2\n $this->_debug->active = false;\n $this->_connection->write(\n 'AUTH ' . $method . ' ' . $this->getParam('xoauth2_token')\n );\n $this->_debug->active = true;\n $this->_debug->raw($debug);\n\n try {\n $this->_getResponse(235);\n return;\n } catch (Horde_Smtp_Exception $e) {\n switch ($e->getSmtpCode()) {\n case 334:\n $this->_connection->write('');\n break;\n }\n }\n break;\n\n default:\n throw new Horde_Smtp_Exception(sprintf('Authentication method %s not supported', $method));\n }\n\n $this->_getResponse(235);\n }",
"public function auth()\n {\n // Ensure AUTH has not already been initiated.\n parent::auth();\n\n $this->_send('AUTH XOAUTH2');\n $this->_expect('334');\n $this->_send(Xoauth2AuthEncoder::encodeXoauth2Sasl($this->getUsername(), $this->getAccessToken()));\n $this->_expect('235');\n $this->auth = true;\n }",
"public function process_auth() {}",
"protected function authCRAMMD5()\n {\n $this->_send('AUTH CRAM-MD5');\n $challenge = $this->_expect(334);\n $challenge = base64_decode($challenge);\n $digest = $this->hmacMD5($this->getPassword(), $challenge);\n $this->_send(base64_encode($this->getUsername() . ' ' . $digest));\n $this->_expect(235);\n $this->auth = true;\n }",
"function auth(){\n\t\tif(is_resource($this->connection)\n\t\t\t\tAND $this->send_data('AUTH LOGIN')\n\t\t\t\tAND substr(trim($error = $this->get_data()), 0, 3) === '334'\n\t\t\t\tAND $this->send_data(base64_encode($this->user))\t\t\t// Send username\n\t\t\t\tAND substr(trim($error = $this->get_data()),0,3) === '334'\n\t\t\t\tAND $this->send_data(base64_encode($this->pass))\t\t\t// Send password\n\t\t\t\tAND substr(trim($error = $this->get_data()),0,3) === '235' ){\n\n\t\t\treturn TRUE;\n\n\t\t}else{\n\t\t\t$this->errors[] = 'AUTH command failed: ' . trim(substr(trim($error),3));\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public static function setAuthMessage($message){\n self::$authmessage = $message;\n }",
"public function auth() {\n\t $this->iflychat_user_details = array_merge($this->iflychat_default_user_details, (array)$this->get_user_details());\n\t $json = (array)$this->iflychat_get_auth();\n\t $json = array_merge($this->iflychat_user_details, $json);\n header('Content-type: application/json');\n print json_encode($json);\n\t}",
"public function getMwsAuthToken();",
"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 onAuthenticationMessage(Realm $realm, Session $session, Message $msg);",
"public function doAuthentication() {\n $lRequestToken = self::getRequestToken();\n $lRequest = OAuthClient::prepareRequest($this->getConsumer(), $lRequestToken, \"GET\", \"http://www.tumblr.com/oauth/authorize\");\n // redirect\n header(\"Location: \" . $lRequest->to_url());\n // do nothing more\n exit;\n }",
"private function authWWW()\n {\n if (!$this->username) {\n throw new PhpSIPException(\"Missing auth username\");\n }\n\n if (!$this->password) {\n throw new PhpSIPException(\"Missing auth password\");\n }\n\n $qop_present = false;\n if (strpos($this->rx_msg, 'qop=') !== false) {\n $qop_present = true;\n\n // we can only do qop=\"auth\"\n if (strpos($this->rx_msg, 'qop=\"auth\"') === false) {\n throw new PhpSIPException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n\n // realm\n $m = array();\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU', $this->rx_msg, $m)) {\n throw new PhpSIPException(\"Can't find realm in www-auth\");\n }\n\n $realm = $m[1];\n\n // nonce\n $m = array();\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU', $this->rx_msg, $m)) {\n throw new PhpSIPException(\"Can't find nonce in www-auth\");\n }\n\n $nonce = $m[1];\n\n $ha1 = md5($this->username . ':' . $realm . ':' . $this->password);\n $ha2 = md5($this->method . ':' . $this->uri);\n\n if ($qop_present) {\n $cnonce = md5(time());\n\n $res = md5($ha1 . ':' . $nonce . ':00000001:' . $cnonce . ':auth:' . $ha2);\n } else {\n $res = md5($ha1 . ':' . $nonce . ':' . $ha2);\n }\n\n $this->auth = 'Authorization: Digest username=\"' . $this->username . '\", realm=\"' . $realm . '\", nonce=\"' . $nonce . '\", uri=\"' . $this->uri . '\", response=\"' . $res . '\", algorithm=MD5';\n\n if ($qop_present) {\n $this->auth .= ', qop=\"auth\", nc=\"00000001\", cnonce=\"' . $cnonce . '\"';\n }\n }",
"public function requestAuth()\n {\n if ($this->state->state != 'init') {\n // TRANS: Server exception thrown if a Yammer authentication request is already present.\n throw new ServerException(_m('Cannot request Yammer auth; already there!'));\n }\n\n $data = $this->client->requestToken();\n\n $old = clone($this->state);\n $this->state->state = 'requesting-auth';\n $this->state->oauth_token = $data['oauth_token'];\n $this->state->oauth_secret = $data['oauth_token_secret'];\n $this->state->modified = common_sql_now();\n $this->state->update($old);\n\n return $this->getAuthUrl();\n }",
"function tryImapLogin($email, $accessToken) {\n /*\n echo \"Hello I am Inn!!!\";\n echo '<br>'.$email;\n echo '<br>'.$accessToken;\n die;\n */\n /**** Get Token info ***/\n $tokenInfoSql = \"SELECT * FROM sync_details where link_email='\".$email.\"' AND oauth_access_token='\".$accessToken.\"'\";\n $tokenInfo = mysql_query($tokenInfoSql) or die(mysql_error());\n //echo '<pre>'; print_r(mysql_fetch_assoc($tokenInfo)); die;\n \n $row = mysql_fetch_assoc($tokenInfo);\n /*******************/\n \n $email = $email;\n $accessToken = $accessToken;\n //echo '======++=====<br>'.$email; echo '<br>'.$accessToken; echo '<br>=====++====='; die;\n /**\n * Make the IMAP connection and send the auth request\n */\n $imap = new Zend_Mail_Protocol_Imap('imap.gmail.com', '993', true);\n \n if (oauth2Authenticate($imap, $email, $accessToken)) {\n echo '<h1>Successfully authenticated!</h1>';\n showInbox($imap,$row['user_id']);\n } else {\n echo '<h1>Failed to login</h1>';\n }\n}",
"protected function authorizeMpiRequest()\n {\n $response = $this->send($this->createMpiRequest('POST', self::INNOVATE_MPI_URL, null));\n\n if (empty($response) || !empty($response->xml()->error)) {\n throw new AuthFailed();\n }\n\n return $response;\n }",
"public function auth()\n {\n $params = array(\n 'qs' => array(\n 'platform' => 'SCOPUS'\n )\n );\n\n $token = $this->getSavedToken();\n\n if(!$token)\n {\n $curlRes = $this->doCurl($params);\n $xpath = $this->getXPath($curlRes);\n $tokens = $xpath->query(\"//authenticate-response/authtoken\");\n $token = $tokens->item(0)->nodeValue;\n $this->saveToken($token);\n }\n\n $this->_authToken = $token;\n }",
"private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpSIPException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }",
"function sendMsg1($serverUrl, $msg) {\n\n\n\t\t$authMsg = \"HELLO username=\".rtrim(strtr(base64_encode($msg), '+/', '-_'), '=');\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $serverUrl);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HEADER , true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t \"Authorization: \". $authMsg,\n\t\t \"WWW-Authenticate: SCRAM\"\n\t\t ));\n\t\t$serverMsg = curl_exec($ch);\n\n\t\tcurl_close($ch);\n\n\t\treturn $serverMsg;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ exdoc Checks to see if the given group has been given permission on a location. Returns true if the permission is granted, false if it is not. | function exponent_permissions_checkGroup($group,$permission,$location,$explicitOnly = false) {
global $db;
if ($group == null) return false;
$explicit = $db->selectObject("grouppermission","gid=" . $group->id . " AND module='" . $location->mod . "' AND source='" . $location->src . "' AND internal='" . $location->int . "' AND permission='$permission'");
if ($explicitOnly == true) return $explicit;
if (!$explicit){
// Calculate implicit permissions if we dont' already have explicit perms
$implicit = false;
foreach ($db->selectObjects('grouppermission','gid='.$group->id." AND module='navigationmodule' AND permission='manage'") as $perm) {
if ($db->countObjects('sectionref','is_original=1 AND section='.$perm->internal." AND module='".$location->mod."' AND source='".$location->src."'")) {
$implicit = true;
break;
}
}
}
return ($implicit || $explicit);
} | [
"private function _has_perms() {\n\t\t$args = func_get_args();\n\t\t$group = array_shift($args);\n\t\t$ret = false;\n\n\t\t$this->EE->db->select('group_id');\n\t\t$this->EE->db->from('member_groups');\n\t\t$this->EE->db->where('group_id', $group);\n\t\tforeach ($args as $v) {\n\t\t\t$this->EE->db->where($v, 'y');\n\t\t}\n\n\t\treturn $this->EE->db->get()->num_rows();\n\t}",
"public function canAccess(string $myGroup, string $wantedGroup): bool;",
"static function group_can($group, $perm_name, $item) {\n // Use the nearest parent album (including the current item) so that we take advantage\n // of the cache when checking many items in a single album.\n $id = ($item->type == \"album\") ? $item->id : $item->parent_id;\n $resource = $perm_name == \"view\" ?\n $item : model_cache::get(\"access_cache\", $id, \"item_id\");\n\n return $resource->__get(\"{$perm_name}_{$group->id}\") === access::ALLOW;\n }",
"public function getPermission( $group ) {\n $permissions = $this->mConfig->get('GroupPermissions');\n \n return $permissions[$group]['edit'] ? true : false;\n }",
"public function group_has_permission($group_id, $permission = '')\n {\n $g = new Group($group_id);\n \n // If we aren't checking a specific permission, auto check for the win!\n if ($permission == '')\n $permission = trim($this->ci->uri->uri_string(), '/');\n \n if ( $g->exists() )\n {\n \t$by_type = is_int($permission)? 'id':'permission';\n \t$g->permission->where($by_type,$permission)->get();\n \tif($g->permission->exists())\n \t{\n \t\treturn TRUE;\n \t}\n \telse{\n \t\treturn FALSE;\n \t} \n }\n else\n {\n return false;\n }\n }",
"public function memberGroupHasAccess($group)\n\t{\n\t\tif ($group instanceOf MemberGroup)\n\t\t{\n\t\t\t$group_id = $group->group_id;\n\t\t}\n\t\telseif(is_numeric($group))\n\t\t{\n\t\t\t$group_id = (int) $group;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException('memberGroupHasAccess expects an number or an instance of MemberGroup.');\n\t\t}\n\n\t\t// 2 = Banned\n\t\t// 3 = Guests\n\t\t// 4 = Pending\n\t\t$hardcoded_disallowed_groups = array('2', '3', '4');\n\n\t\t// If the user is a Super Admin, return true\n\t\tif ($group_id == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif (in_array($group_id, $hardcoded_disallowed_groups))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (in_array($group_id, $this->getNoAccess()->pluck('group_id')))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\n\t}",
"public function isMemberOf($group_name){\n return $this->permission()->isMemberOf($this,$group_name);\n }",
"public static function groupHasPermission($grouplist, $perm) {\n \n if (!is_array($grouplist) || count($grouplist) == 0) {\n return false;\n }\n\n foreach ($grouplist as $group) {\n # Check zero (NO_ADMIN_ACCESS === 0)\n if ($group->permissions === NO_ADMIN_ACCESS) continue;\n\n # One of the group has full admin access\n if ((float)$group->permissions === (float)FULL_ADMIN) {\n return true;\n }\n\n # Check individually\n if (self::check_permission($group->permissions, $perm) == true) {\n return true;\n }\n }\n\n return false;\n }",
"private function checkAccess() {\n\t\t$cObjData = $this->configurationManager->getContentObject();\n\t\t\n\t\tif (!empty($cObjData->data['fe_group'])) {\n\t\t\tforeach (explode(',',$GLOBALS['TSFE']->gr_list) as $feUserGroup) {\n\t\t\t\tif (in_array($feUserGroup, explode(',',$cObjData->data['fe_group']))) {\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function check_group_access($groupname=false)\n\t{\n\t\t$auth = Nagios_auth_Model::instance();\n\t\treturn $auth->is_authorized_for_servicegroup($groupname);\n\t}",
"public function check_group_access($groupname=false)\n\t{\n\t\t$auth = Nagios_auth_Model::instance();\n\t\treturn $auth->is_authorized_for_hostgroup($groupname);\n\t}",
"public function hasAccess($permission);",
"public function isSeeable() {\n\t\t$canSeeGroupIDs = explode(',', $this->canSeeGroupIDs);\n\t\t\n\t\t// check view permission\n\t\tforeach ($canSeeGroupIDs as $group) {\n\t\t\tif (Group::isMember($group)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function isAccessible() {\n\t\treturn UserGroup::isAccessibleGroup(array($this->groupID));\n\t}",
"public function isMemberOf($group)\n\t{\n\t\t$cursor = $this->site->db->query(\"SELECT * FROM user_group\n\t\t\t\t\t\t\t\t\t\t WHERE group_name = '\".$this->site->db->escape($group).\"'\n\t\t\t\t\t\t\t\t\t\t AND user_id = '\".$this->get($this->primaryKey).\"'\");\n\t\tif ($cursor->num_rows > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function apcms_CheckAccess($action, $groups=array()) {\n\tglobal $db, $apcms;\n\t$selact = $db->unbuffered_query_first(\"SELECT * FROM `\".$apcms['table']['global']['rights'].\"` WHERE `action`='\".apcms_ESC($action).\"'\");\n\tif (isset($selact) && count($selact) >= 1) {\n\t\t$allowed_groups = unserialize(stripslashes(trim($selact[2])));\n\t\tfor ($a=0;$a<count($groups);$a++) {\n\t\t\tif (in_array(intval($groups[$a]), $allowed_groups)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}",
"static function addISymphonyPermissionGroupMember($location, $tenant, $group, $profile) {\n\n\t\t\t//Move to permission group mode\n\t\t\tif(!self::moveToPermissionGroup($location, $tenant, $group)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Add member\n\t\t\treturn self::checkAndSetErrorNone(\"add member $profile\");\n\t\t}",
"public function hasPermission($permission);",
"function assert_group($group)\r\n{\r\n\tif(assert_login())\r\n\t{\r\n\t\t$groups_loc = $_SESSION['USER_GROUPS']; \r\n\t\tif(array_key_exists('admin', $groups_loc))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a virtual property of the Section. Several private properties of the Section are made available outside the class through this method. These properties can then be initialised by making an API call without the overhead of making an (expensive) API call if the property is never used. | public function __get( $property ) {
if (property_exists( self::class, $property ) && $this->{$property} !== null)
return $this->{$property};
switch ($property) {
case 'patrols':
if (!$this->apiGotPatrols) $this->ApiGetPatrols();
return $this->patrols;
case 'groupId':
case 'groupName':
case 'meetingDay':
case 'name':
case 'type':
if ($this->$property === null) $this->osm->ApiGetUserRoles();
if ($this->property !== null) return $this->$property;
// Fall through to treat as error.
default:
throw new \Exception( "Section->$property not found or null" );
}
} | [
"public function getSomeProperty()\n {\n return $this->someProperty;\n }",
"public function GetSection()\n {\n if ( empty(self::$_init) ) {\n self::$_init = 1;\n self::$_section = new Section();\n }\n return self::$_section;\n }",
"public function __get($prop){\n\t\tif ($this->container->{$prop}) {\n\t\t\treturn $this->container->{$prop};\n\t\t}\n\t}",
"public function getPropertyLazyLoaded()\n {\n return $this->propertyLazyLoaded;\n }",
"abstract protected function getContentsProperty();",
"public function getPropertyValue();",
"private function getSection()\n {\n $this->section = $this->modelFactory()->get($this->sectionClass());\n\n return $this->section;\n }",
"public function makeProperty()\n {\n return new Property();\n }",
"abstract protected function get_lazy_properties();",
"public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }",
"public function publicGetter() {\n return $this->publicProperty;\n }",
"public function __get($name){\n\t\ttry {\n\t\t\treturn parent::__get($name);\n\t\t} catch(\\Exception $e) {\n\t\t\tif($this->getIsSubProperty($name) === true) {\n\t\t\t\treturn $this->prop($name);\n\t\t\t} else {\n\t\t\t\tthrow($e);\n\t\t\t}\n\t\t}\n\t}",
"public function getPropertyA()\n {\n return $this->propertyA;\n }",
"public function toProperty() {\n\t\treturn new Property($this->pm, $this->path, $this->name, $this->value);\n\t}",
"public function get_section()\n {\n return $this->_section;\n }",
"public function __get($property)\n {\n if(isset($this->upload_config[$property])) return $this->upload_config[$property];\n if(isset($this->photo_data[$property])) return $this->photo_data[$property];\n \n return parent::__get($property);\n }",
"protected abstract function getBundleProperty();",
"abstract protected function getRackProperty();",
"public function __get($key){\n return $this->properties[$key];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the current result back to template | function reset() {
if ($this->capturing) $this->capture();
$this->result = $this->template;
$this->content = array();
$this->captureField = '';
$this->loopTemplate = array();
$this->loopStack = array();
} | [
"private function reset() {\n $this->template_variables = array();\n $this->template = null;\n }",
"function resetTemplate () {\n\n // clear our output buffer\n // this leaves htmlParsedOutput in place for\n // re-running the tags\n $this->htmlOutput = NULL;\n $this->jsOutput = NULL;\n\n // step thru tag list and call tagReset on each\n foreach (array_keys($this->smTagList) as $areaName) {\n $this->smTagList[$areaName]->_tagReset();\n }\n\n }",
"public function clearTemplate() \n\t{\n\t\t$this->template = array();\n\t}",
"public function reset() {\n $this->result = NULL;\n }",
"public function resetResult()\n {\n $this->result = 0;\n }",
"public function clear_template() {\n\t\t$this->tpl = new HTML_Template_IT($this->tpl_dir);\n\t\t$this->tpl->loadTemplatefile($this->tpl_file, true, true);\n\t}",
"private function clear_template_data(){\n\t\treturn $this->template_data = null;\n\t}",
"public function unsetTemplate()\n\t{\n\t\tunset($this->template);\n\t}",
"public function restored(Template $template)\n {\n //\n }",
"public function clearTemplateCache() {\n\t\t$this->getTemplateManager()->clearCache();\n\t}",
"public static function resetTemplates()\n\t{\n\t\tself::$_template_names = array();\n\t}",
"public function clearTemplateVariables();",
"function resetComputedTemplates() {\n $this->templates_by_languages = [];\n }",
"public function clearTemplatess()\n {\n $this->collTemplatess = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearOutput()\n {\n $this->_renderResult = '';\n }",
"private function resetResults(): void\n {\n $this->results = [\n 'published' => [],\n 'skipped' => [],\n ];\n }",
"public function reset_template ($name) {\n\t\t$this->templates[\"$name\"]= $this->default_templates[\"$name\"];\n\t}",
"public function reset() {\n\t\t$this->html = '';\n\t\t$this->cells = array();\n\t}",
"public function resetResultSet()\n {\n $this->pos = 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4.11.13 setAccountStatusMessages setAccountStatusMessages sets the predefined order and text status messages for a whole WEBFLEET account. For object specific configurations use setStatusMessages. | public function setAccountStatusMessages(array $params):WebfleetResponse; | [
"public function setMessages($messages);",
"function statusMessagesOn()\r\n\t{\r\n\t\t$this->bStatusMessages = true;\r\n\t}",
"function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}",
"public function setStatusMessages(array $params):WebfleetResponse;",
"public function listStatusMessages() {\n $path_info = '/status';\n self::setRequestString($path_info);\n return self::callAPI();\n }",
"public function setStatusMessage($message) {\n $this->_response['messages']['status'][] = $message;\n }",
"public function setAccountStatus($accountId, $status) {\n\t\tif(empty($accountId) || empty($status)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$account = new Account();\n\t\t$account->setAccountId($accountId);\n\t\t$lastActionDate = new \\DateTime();\n\t\t$this->update($account, array('accountStatus'=>$status,'lastActionDate'=>$lastActionDate));\n\t\t\n\t\treturn array();\t\t\n\t}",
"public function set_status($status, $account_id=NULL){\n\t\t$account_id = !is_null($account_id) ? $account_id : $this->account_id;\n\t\t\n\t\t//Get the allowed status values\n\t\t$allowed_values = $this->get_enum_values('accounts','status');\n\t\t\n\t\tif(in_array($status, $allowed_values)){\n\t\t\t$params = array($status,$account_id);\n\t\t\t$query = $this->db->query(\"UPDATE `accounts` SET `status` = ? WHERE `account_id` = ?\",$params);\n\t\t\treturn true;\n\t\t}else{\n\t\t\tthrow new Exception('Status `'.$status.'` is not allowed. Allowed values: '.implode(', ', $allowed_values).'.');\n\t\t}\n\t}",
"public function set_account_status($account_status) {\n\t\t$this->_account_status = account_status;\n\t}",
"public function setResponseMessages() {\n }",
"function filter_update_message( $messages = array() ) {\n\t\t\tif ( 'astra-portfolio' !== get_current_screen()->id ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$portfolio_type = get_post_meta( get_the_ID(), 'astra-portfolio-type', true );\n\t\t\tif ( 'page' === $portfolio_type ) {\n\t\t\t\treturn $messages;\n\t\t\t}\n\n\t\t\t$messages['post'][1] = __( 'Post updated.', 'astra-portfolio' );\n\t\t\t$messages['post'][6] = __( 'Post published.', 'astra-portfolio' );\n\t\t\t$messages['post'][8] = __( 'Post submitted.', 'astra-portfolio' );\n\t\t\t$messages['post'][9] = __( 'Post scheduled.', 'astra-portfolio' );\n\t\t\t$messages['post'][10] = __( 'Post draft updated.', 'astra-portfolio' );\n\n\t\t\treturn $messages;\n\t\t}",
"public static function updated_term_messages($messages)\n {\n }",
"public function setMessages($value) \n {\n $this->_fields['Messages']['FieldValue'] = $value;\n return;\n }",
"function updated_messages($messages)\n{\n\n $messages['pcc-organization'] = [\n 0 => '', // Unused. Messages start at index 1.\n 1 => __('Organization added.', 'pcc-framework'),\n 2 => __('Organization deleted.', 'pcc-framework'),\n 3 => __('Organization updated.', 'pcc-framework'),\n 4 => __('Organization not added.', 'pcc-framework'),\n 5 => __('Organization not updated.', 'pcc-framework'),\n 6 => __('Organizations deleted.', 'pcc-framework'),\n ];\n\n return $messages;\n}",
"public function mv_address_book_cpt_messages($messages)\n {\n $post = get_post();\n $post_type = get_post_type($post);\n $post_type_object = get_post_type_object($post_type);\n\n $messages['mv_address_book'] = array(\n 0 => '', // Unused. Messages start at index 1.\n 1 => __('Contact updated.', 'textdomain'),\n 2 => __('Custom field updated.', 'textdomain'),\n 3 => __('Custom field deleted.', 'textdomain'),\n 4 => __('Contact updated.', 'textdomain'),\n 5 => isset($_GET['revision']) ? sprintf(__('Contact restored to revision from %s', 'textdomain'), wp_post_revision_title((int)$_GET['revision'], false)) : false,\n 6 => __('Contact saved.', 'textdomain'),\n 7 => __('Contact saved.', 'textdomain'),\n 8 => __('Contact submitted.', 'textdomain'),\n 9 => sprintf(\n __('Contact scheduled for: <strong>%1$s</strong>.', 'textdomain'),\n date_i18n(__('M j, Y @ G:i', 'textdomain'), strtotime($post->post_date))\n ),\n 10 => __('Contact draft updated.', 'textdomain')\n );\n\n\n return $messages;\n }",
"public function add_status_json (array $messages, string $prefix='',\n array $opts=[], $fieldName='status_messages')\n {\n $jsonMode = isset($opts['ADD_JSON']) \n ? intval($opts['ADD_JSON'])\n : $this->MERGE_JSON;\n\n $msgArray = $this->text->strArray($messages, $prefix, $opts);\n $this->add_json($fieldName, $msgArray, $jsonMode);\n }",
"public function setAccountStatus($var)\n {\n GPBUtil::checkEnum($var, \\Accountgroup\\V1\\LookupRequest_AccountStatus::class);\n $this->account_status = $var;\n }",
"function govcms_zen_status_messages($variables) {\n $display = $variables['display'];\n $output = '';\n\n $status_heading = array(\n 'status' => t('Status message'),\n 'error' => t('Error message'),\n 'warning' => t('Warning message'),\n );\n foreach (drupal_get_messages($display) as $type => $messages) {\n $output .= \"<div class=\\\"messages--$type messages $type\\\">\\n\";\n if (!empty($status_heading[$type])) {\n $output .= '<h2 class=\"element-invisible\">' . $status_heading[$type] . \"</h2>\\n\";\n }\n if (count($messages) > 1) {\n $output .= \" <ul class=\\\"messages__list\\\">\\n\";\n foreach ($messages as $message) {\n\n // Fix is for this line only.\n $output .= ' <li class=\"messages__item\">' . $message . \"</li>\\n\";\n }\n $output .= \" </ul>\\n\";\n }\n else {\n $output .= $messages[0];\n }\n $output .= \"</div>\\n\";\n }\n return $output;\n}",
"public function setTeamChatMessages($val)\n {\n $this->_propDict[\"teamChatMessages\"] = intval($val);\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a representation of this form as a table row | function AsTableRow() {
return "<tr class=\"addrow\">{$this->CellFields()}<td class=\"actions\">{$this->CellActions()}</td></tr>";
} | [
"protected function renderTable()\n {\n $headers = [];\n $fields = [];\n $hidden = [];\n\n /* @var Field $field */\n foreach ($this->buildNestedForm()->fields() as $field) {\n if (is_a($field, Hidden::class)) {\n $hidden[] = $field->render();\n } else {\n /* Hide label and set field width 100% */\n $field->setLabelClass(['hidden']);\n $field->width(12, 0);\n $fields[] = $field->render();\n $headers[] = $field->label();\n }\n }\n\n /* Build row elements */\n $template = array_reduce($fields, function ($all, $field) {\n $all .= \"<td>{$field}</td>\";\n\n return $all;\n }, '');\n\n /* Build cell with hidden elements */\n $template .= '<td class=\"hidden\">'.implode('', $hidden).'</td>';\n\n // specify a view to render.\n $this->view = $this->view ?: $this->views[$this->viewMode];\n\n $this->addVariables([\n 'headers' => $headers,\n 'forms' => $this->buildRelatedForms(),\n 'template' => $template,\n 'relationName' => $this->relationName,\n 'options' => $this->options,\n 'count' => count($this->value()),\n 'columnClass' => $this->columnClass,\n 'parentKey' => $this->getNestedFormDefaultKeyName(),\n ]);\n\n return parent::render();\n }",
"function renderAsTable(){\n\t\t$out='<table>';\n\t\tforeach ($this->fields as $name=>$item){\n\t\t\tif ($item['type']=='submit') continue;\n\t\t\t$out.='<tr><th>'.(isset($item['label_full'])?$item['label_full']:$item['label']).'</th><td>'.(isset($item['values'][$item['value']])?$item['values'][$item['value']]:$item['value']).'</td></tr>';\n\t\t}\n\t\treturn $out.='</table>';\n\t}",
"function as_table()\n\t{\n\t\treturn $this->_html_output(\n\t\t\t'<tr><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>',\n\t\t\t'<tr><td colspan=\"2\">%s</td></tr>',\n\t\t\t'</td></tr>',\n\t\t\t'<br />%s',\n\t\t\tFalse\n\t\t);\n\t}",
"public function asTable() {\n $str = $this->openTag();\n\n $str .= \"<table>\";\n foreach($this->components as $component) {\n if(!$component instanceof HiddenInput) {\n $str .= \"<tr>\";\n $str .= \"<td>\";\n if ($component instanceof BaseElement) {\n $str .= $component->getLabelAsHtml();\n }\n $str .= \"</td>\";\n $str .= \"<td>\";\n $str .= $component;\n $str .= \"</td>\";\n $str .= \"</tr>\";\n } else {\n $str .= $component;\n }\n }\n $str .= \"</table>\";\n\n $str .= \"</form>\";\n\n return $str;\n }",
"public function createRow()\n {\n return new Row($this->fieldset);\n }",
"public function addRow()\n {\n // creates a new Table Row\n $row = new TTableRow;\n \n // add this row to the table element\n if (isset($this->section))\n {\n $this->section->add($row);\n }\n else\n {\n parent::add($row);\n }\n return $row;\n }",
"public function Render_TableRow() {\n\t$arStat = $this->AvailStatus();\n\t$strCls = $arStat['cls'];\n\n\t$id = $this->GetKeyValue();\n\t$sCatNum = $this->GetFieldValue('CatNum');\n\t$htDescr = $this->GetFieldValue('ItOpt_Descr');\n\t$htStat = $arStat['html'];\n\t$dlrPriceList = $this->GetFieldValue('PriceList');\n\t$dlrPriceSell = $this->GetFieldValue('PriceSell');\n\t$htPrList = fcMoney::Format_withSymbol($dlrPriceList);\n\t$htPrSell = fcMoney::Format_withSymbol($dlrPriceSell);\n\n\t$dlrPrUse = is_null($dlrPriceSell)?$dlrPriceList:$dlrPriceSell;\n\tif (is_null($dlrPrUse)) {\n\t $htCtrl = '<span title=\"not available for ordering because price has not been set\">N/A</span>';\n\t} else {\n\t //$htCtrlName = KSF_CART_ITEM_PFX.$sCatNum.KSF_CART_ITEM_SFX;\n\t $htCtrlName = vcGlobals::Me()->MakeItemControlName($sCatNum);\n\t $htCtrl = \"<input size=1 name='$htCtrlName'>\";\n\t $this->SetCanOrder(TRUE);\n\t}\n\n\t$out = <<<__END__\n <tr class=$strCls><!-- ID=$id -->\n <td> $htDescr</td>\n <td>$htStat</td>\n <td align=right><i>$htPrList</i></td>\n <td align=right>$htPrSell</td>\n <td>$htCtrl</td>\n <td>$sCatNum</td>\n </tr>\n__END__;\n\treturn $out;\n }",
"public function formRow()\n {\n return $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'form-simple-row');\n }",
"function delibera_form_table($rows) {\n\t$content = '<table class=\"form-table\">';\n\tforeach ($rows as $row) {\n\t\t$content .= '<tr '.(array_key_exists('row-id', $row) ? 'id=\"'.$row['row-id'].'\"' : '' ).' '.(array_key_exists('row-style', $row) ? 'style=\"'.$row['row-style'].'\"' : '' ).' '.(array_key_exists('row-class', $row) ? 'class=\"'.$row['row-class'].'\"' : '' ).' ><th valign=\"top\" scrope=\"row\">';\n\n\t\tif (isset($row['id']) && $row['id'] != '') {\n\t\t\t$content .= '<label for=\"'.$row['id'].'\">'.$row['label'].'</label>';\n\t\t} else {\n\t\t\t$content .= $row['label'];\n\t\t}\n\n\t\tif (isset($row['desc']) && $row['desc'] != '') {\n\t\t\t$content .= '<br/><small>'.$row['desc'].'</small>';\n\t\t}\n\n\t\t$content .= '</th><td valign=\"top\">';\n\t\t$content .= $row['content'];\n\t\t$content .= '</td></tr>';\n\t}\n\t$content .= '</table>';\n\treturn $content;\n}",
"private function editable_row()\n {\n if ( isset( $this->field->attributes['readonly'] ) && $this->field->attributes['readonly'] === 'readonly' && ! \\Participants_Db::current_user_has_plugin_role('editor', __METHOD__) ) return '';\n $row = '';\n $index = $this->value_row_count() + 1;\n $values = $this->post_data_array();\n \n $row_template = apply_filters( 'pdb-member_payments_table_body_row', '<tr data-index=\"%1$s\">%2$s</tr>' );\n $cell_template = apply_filters( 'pdb-member_payments_table_body_cell', '<th class=\"%1$s-column\">%2$s</th>' );\n foreach ( array_keys( $this->columns ) as $name ) {\n $input = \\PDb_FormElement::get_element(array(\n 'type' => 'text-line',\n //'name' => $this->field->name . '[' . $index . '][' . $name . ']',\n 'name' => $this->field->name . '[' . $name . ']',\n 'value' => isset( $values[$name] ) ? $values[$name] : '',\n ));\n $row .= sprintf( $cell_template, $name, $input );\n }\n return sprintf( $row_template, $index, $row );\n }",
"function form_table($rows) {\n\t\t\t$content = '<table class=\"form-table\">';\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$content .= '<tr><th valign=\"top\" scrope=\"row\">';\n\t\t\t\tif (isset($row['id']) && $row['id'] != '')\n\t\t\t\t\t$content .= '<label for=\"'.$row['id'].'\">'.$row['label'].':</label>';\n\t\t\t\telse\n\t\t\t\t\t$content .= $row['label'];\n\t\t\t\tif (isset($row['desc']) && $row['desc'] != '')\n\t\t\t\t\t$content .= '<br/><small>'.$row['desc'].'</small>';\n\t\t\t\t$content .= '</th><td valign=\"top\">';\n\t\t\t\t$content .= $row['content'];\n\t\t\t\t$content .= '</td></tr>'; \n\t\t\t}\n\t\t\t$content .= '</table>';\n\t\t\treturn $content;\n\t\t}",
"function form_table($rows) {\r\n\t\t\t$content = '<table class=\"form-table\">';\r\n\t\t\tforeach ($rows as $row) {\r\n\t\t\t\t$content .= '<tr><th valign=\"top\" scrope=\"row\">';\r\n\t\t\t\tif (isset($row['id']) && $row['id'] != '')\r\n\t\t\t\t\t$content .= '<label for=\"'.$row['id'].'\">'.$row['label'].':</label>';\r\n\t\t\t\telse\r\n\t\t\t\t\t$content .= $row['label'];\r\n\t\t\t\tif (isset($row['desc']) && $row['desc'] != '')\r\n\t\t\t\t\t$content .= '<br/><small>'.$row['desc'].'</small>';\r\n\t\t\t\t$content .= '</th><td valign=\"top\">';\r\n\t\t\t\t$content .= $row['content'];\r\n\t\t\t\t$content .= '</td></tr>'; \r\n\t\t\t}\r\n\t\t\t$content .= '</table>';\r\n\t\t\treturn $content;\r\n\t\t}",
"public function outputTable(){\n\t\t\t$table = '<table>';\n\t\t\t$table .= $this->rows;\n\t\t\t$table .= '</table>';\n\t\t\t\n\t\t\treturn $table;\n\t\t}",
"function asTable($form);",
"public function renderTable();",
"function form_table($rows) {\n $content = '<table class=\"form-table\">';\n $i = 1;\n foreach ($rows as $row) {\n $class = '';\n if ($i > 1) {\n $class .= 'yst_row';\n }\n if ($i % 2 == 0) {\n $class .= ' even';\n }\n $content .= '<tr id=\"'.$row['id'].'_row\" class=\"'.$class.'\"><th valign=\"top\" scrope=\"row\">';\n if (isset($row['id']) && $row['id'] != '')\n $content .= '<label for=\"'.$row['id'].'\">'.$row['label'].':</label>';\n else\n $content .= $row['label'];\n $content .= '</th><td valign=\"top\">';\n $content .= $row['content'];\n $content .= '</td></tr>';\n if ( isset($row['desc']) && !empty($row['desc']) ) {\n $content .= '<tr class=\"'.$class.'\"><td colspan=\"2\" class=\"yst_desc\"><small>'.$row['desc'].'</small></td></tr>';\n }\n\n $i++;\n }\n $content .= '</table>';\n return $content;\n }",
"public function buildTable() {\r\n\t\t$output = '';\r\n\t\t\r\n\t\tif ($this->getRecordCount()) {\r\n\t\t\t$output .= '<table width=\"100%\" border=\"1\">';\r\n\t\t\t$output .= '<tr>';\r\n\t\t\tfor ($i = 0; $i < $this->fieldCount; $i++) {\r\n\t\t\t\t$output .= \"<th>{this->fieldNames[$i]}</th>\";\r\n\t\t\t}\r\n\t\t\t$output .= '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t$on = true;\r\n\t\tfor ($this->startRecord(); $this->hasRecord(); $this->nextRecord()) {\r\n\t\t\t$class = $on ? 'result-set-on' : 'result-set-off';\r\n\t\t\t\r\n\t\t\t$output .= '<tr>';\r\n\t\t\tfor ($i = 0; $i < $this->fieldCount; $i++) {\r\n\t\t\t\t$row = trim($this->fields[$this->fieldNames[$i]]);\r\n\t\t\t\tif (!$row) { \r\n\t\t\t\t\t$row = '0' === $row || 0 === $row ? '0' : ' ';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= \"<td class='$class'>$row</td>\";\r\n\t\t\t}\r\n\t\t\t$output .= '</tr>';\r\n\t\t\t$on = !$on;\r\n\t\t}\r\n\t\t\r\n\t\t$output .= '</table>'; \r\n\t\t\r\n\t\treturn $output;\r\n\t}",
"function td(){\r\n\t\treturn \"<td {$this->html_attributes}>{$this->content}</td>\";\r\n\t}",
"public function buildTbody()\n {\n\n $body = '<tbody>'.NL;\n\n // simple switch method to create collored rows\n $pos = 1;\n $num = 1;\n foreach ($this->data as $key => $row) {\n\n $objid = $row['rowid'];\n $rowid = $this->id.'_row_'.$objid;\n\n $body .= '<tr class=\"row'.$num.'\" id=\"'.$rowid.'\" >'.NL;\n $body .= '<td valign=\"top\" class=\"pos\" >'.$pos.'</td>'.NL;\n $body .= '<td valign=\"top\" >('.$row['buiz_role_user_name'].') '.$row['core_person_lastname'].', '.$row['core_person_firstname'].' </td>'.NL;\n $body .= '<td valign=\"top\" >'.(!is_null($row['m_time_created'])?$this->view->i18n->timestamp($row['m_time_created']):'').'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row['node_from_name'].'<br /> => <br />'.$row['node_to_name'].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.Validator::sanitizeHtml($row['comment']).'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row['rate'].'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $pos ++;\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n } //end foreach\n\n $body .= '</tbody>'.NL;\n //\\ Create the table body\n return $body;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the query string used to add all sub filters for layer | protected function getSubfiltersQuery(): string
{
return
'SELECT slsc.`id`,
slsc.`filters_id`,
slsc.`minlength`,
slsc.`maxlength`,
slsc.`regex_case`,
slsc.`regex_replace`
FROM `search_v2_layer_string_case` slsc
WHERE slsc.`filters_id` IN ({bind_params})
AND slsc.`active` = 1
ORDER BY slsc.`priority` DESC';
} | [
"public function buildQueryString(): string\n {\n return http_build_query($this->filters);\n }",
"public function getFiltersString()\n {\n return http_build_query($this->getFilters(), null, ':');\n }",
"public function getQueryString(): string\n {\n /* When at least one feature is enabled the query string is created */\n return count($this->params) > 0\n ? self::PARAM_NAME . '=' . implode(',', $this->params) : '';\n }",
"public function getQueryString(): string\n {\n if (count(array_filter($this->container)) == 0) {\n return '';\n }\n\n return 'sort=' . $this->toString();\n }",
"public function getQueryString(): string\n {\n return http_build_query($this->query);\n }",
"public function getQuery(){\r\n\t\t\t\r\n\t\t\t$query = \"\";\r\n\t\t\t$queryParts = array();\r\n\t\t\t\r\n\t\t\tforeach($this->filterResults as $key => $value){\r\n\t\t\t\tarray_push($queryParts, $value->query);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->logicGate == 'or'){\r\n\t\t\t\t$query = \" ( \" . join(\" or \", $queryParts) . \" ) \";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$query = join(\" and \", $queryParts);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $query;\r\n\t\t}",
"private function getQueryString() {\n if (empty($this->queryParams)) {\n return '';\n }\n\n return implode('&', $this->queryParams);\n }",
"public function buildFilter()\n {\n return urlencode(json_encode($this->m_filter));\n }",
"private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n return $querystring;\n }\n }",
"public function toQueryString();",
"function getQueryString()\n {\n $queryString = \"\";\n $continuation = \"\";\n\n foreach ($this->queryArray as $element => $value) {\n $queryString .= \"$continuation$element=\" . urlencode($value);\n $continuation = \"&\";\n }\n\n return $queryString;\n }",
"function getFiltersWhere() {\n\t\t$whereClause = \"\";\n\t\t$whereComponents = $this->getWhereComponents ();\n\t\tforeach ( $whereComponents [\"filterWhere\"] as $fWhere ) {\n\t\t\t$whereClause = whereAdd ( $whereClause, $fWhere );\n\t\t}\n\t\t\n\t\treturn $whereClause;\n\t}",
"public function getFilterQueries() {}",
"private function searchQueryString() {\n $queryString = array();\n\n // One of the following is required.\n $location = $this->getLatitudeLongitude();\n $query = $this->getQuery();\n\n if($location){\n $queryString['location'] = $location;\n } elseif($query) {\n $queryString['query'] = $query;\n }\n\n $queryString['radius'] = $this->getRadius();\n // Optional parameters.\n\n $queryString['type'] = $this->getType();\n\n $pagetoken = $this->getPagetoken();\n if($pagetoken){\n $queryString[\"pagetoken\"] = $pagetoken;\n } else {\n $queryString['language'] = $this->getLanguage();\n }\n\n // Remove any unset parameters.\n $queryString = array_filter($queryString);\n\n // The signature is added later using the path + query string.\n if ($this->isBusinessClient()) {\n $queryString['client'] = $this->getClientId();\n }\n elseif ($this->getApiKey()) {\n $queryString['key'] = $this->getApiKey();\n }\n\n // Convert array to proper query string.\n return http_build_query($queryString);\n }",
"protected function buildFilterFields()\n\t{\n\t\t$str = '';\n\t\tif(isset($_GET['sort-by']))\n\t\t{\n\t\t\t$str .= '<input type=\"hidden\" name=\"sort-by\" value=\"'.$_GET['sort-by'].'\" >';\n\t\t}\n\n\t\tif(isset($_GET['sort-order']))\n\t\t{\n\t\t\t$str .= '<input type=\"hidden\" name=\"sort-order\" value=\"'.$_GET['sort-order'].'\" >';\n\t\t}\n\n\t\tif(isset($_GET['status']))\n\t\t{\n\t\t\t$str .= '<input type=\"hidden\" name=\"status\" value=\"'.$_GET['status'].'\" >';\n\t\t}\n\n\n\n\t\treturn $str;\n\t}",
"function getSearchQueryAsString() {\n\t\treturn http_build_query($this->getSearchQuery());\n\t}",
"public function buildFilterString() {\n \n \n $string = \"(\".$this->getFilterType();\n foreach($this as $filter) {\n $string .= $filter->buildFilterString();\n }\n $string .= \")\"; \n if($this->isNegated()) \n $string = \"(!\".$string.\")\";\n $this->setFilterString($string);\n return $string;\n }",
"public function getQueryString()\n {\n if (null === $this->queryString) {\n $this->queryString = http_build_query($this->getData());\n }\n\n return $this->queryString;\n }",
"public function getQueryString()\n {\n return $this->get('query') ? '?' . $this->get('query') : '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test render update dealer account page success | public function testRenderUpdateSuccess()
{
// Populate data
$dealerAccountIDs = $this->_populate();
// Set data
$ID = $this->_pickRandomItem($dealerAccountIDs);
$dealerAccount = $this->dealer_account->getOne($ID);
// Request
$this->withSession($this->adminSession)
->call('GET', '/dealer-account/edit', ['ID' => $ID]);
// Verify
$this->assertResponseOk();
$this->assertViewHas('dealer_account', $dealerAccount);
$this->assertViewHas('dataBranch');
$this->assertPageContain('Edit Dealer Account');
} | [
"public function testHandleUpdateSuccess()\n {\n // Populate data\n $dealerAccountID = $this->_populate();\n \n // Set params\n $params = $this->customDealerAccountData;\n \n // Add ID\n $ID = $this->_pickRandomItem($dealerAccountID);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $params, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHas('dealer-account-updated', '');\n \n // Validate data\n $dealerAccount = $this->dealer_account->getOne($ID);\n $this->assertEquals($dealerAccount->name, $this->customDealerAccountData['name']);\n $this->assertEquals($dealerAccount->branch_ID, $this->customDealerAccountData['branch_ID']);\n }",
"public function testRenderUpdateSuccess()\n {\n // Populate data\n $this->_populate();\n \n // Set data\n $ID = rand(0, 1)+1;\n $user = $this->user->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/user/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('user', $user);\n $this->assertViewHas('types', $this->userTypes);\n }",
"public function testRenderUpdateNoUser()\n {\n $this->withSession($this->adminSession)\n ->call('GET', '/dealer-account/edit', ['ID' => 4]);\n \n $this->assertResponseStatus(404);\n }",
"public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $this->customDealerAccountData, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Verify\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHasErrors();\n }",
"public function testRenderUpdateSuccess()\n {\n // Populate data\n $regionIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($regionIDs);\n $region = $this->region->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/region/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('region', $region);\n $this->assertViewHas('dataArco');\n $this->assertPageContain('Edit Region');\n }",
"public function testRenderUpdateSuccess()\n {\n // Populate data\n $productPriceIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($productPriceIDs);\n $productPrice = $this->product_price->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/product/price/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('product_price', $productPrice);\n $this->assertViewHas('products');\n $this->assertViewHas('dealer_types');\n $this->assertViewHas('dealer_channels');\n\n $this->assertPageContain('Edit Product Price');\n }",
"public function testAccountUpdate()\n {\n $result = $this->service->update($this->account, $this->meta);\n\n $this->specify('account was updated', function () use ($result) {\n $this->assertTrue($result);\n });\n }",
"public function test_Updatebutton(){\n\n $this->visit('/Pages_my/UpdateOrder')\n ->press('Update')\n ->see(\"Items\");\n }",
"public function testApiUpdateAccount()\n {\n /**\n * Create one account\n */\n $data = factory(\\App\\Account::class)->create();\n\n $toUpdate = ['title' => 'Conta do Rafael'];\n\n\n /**\n * Makes a PUT request to /api/accounts/{id} passing data to update\n */\n $response = $this->json('PUT', '/api/accounts/' . $data->id, $toUpdate);\n\n /**\n * Checks if HTTP status code of request is 200\n * and if response has a JSON as $data\n */\n $response->assertStatus(200)\n ->assertJson($toUpdate);\n }",
"public function testLedgerAccountsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function updateAdminPaypalDetails()\n {\n /* code goes here */\n }",
"public function testCanUpdateOwnAccount()\n {\n // Simulate if user that is logged in as user_id of 1\n $_SESSION['user_id'] = 1;\n $update_account_info = new Account(\"Update Own Employee\", \"updOwnEmployee\", \"updateownEmployee@gmail.com\", 1);\n $this->assertEquals(true, test_update_own_info(1, $update_account_info));\n }",
"public function update()\r\n {\r\n \r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $id = $this->getRequestObject()->getParameter('id');\r\n $user = new account();\r\n $user->id = $this->getRequestObject()->getParameter('id');\r\n $user->email = $this->getRequestObject()->getParameter('email'); \r\n $user->fname = $this->getRequestObject()->getParameter('fname');\r\n $user->lname = $this->getRequestObject()->getParameter('lname');\r\n $user->phone = $this->getRequestObject()->getParameter('phone');\r\n $user->birthday = $this->getRequestObject()->getParameter('birthday');\r\n $user->gender = $this->getRequestObject()->getParameter('gender');\r\n $user->password = $this->getRequestObject()->getParameter('password'); //gets hashed in account model\r\n \r\n //validate\r\n if($user->validate() !== true)\r\n {\r\n //returns array of error messages\r\n $errors = $user->validate();\r\n $v = new ValidationView();\r\n $v->injectData(array('messages' => $errors));\r\n echo $v->render();\r\n die(); //halt execution if it's invalid\r\n }\r\n \r\n $user->save();\r\n\r\n header(\"Location: index.php?page=accounts&action=show&id=$id\");\r\n }\r\n else {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n\r\n }",
"public function testHandleUpdateSuccess()\n {\n // Populate data\n $brandIDs = $this->_populate();\n \n // Set params\n $params = [\n 'ID' => $this->_pickRandomItem($brandIDs),\n 'name' => $this->customBrandData\n ];\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/competitor-brand/edit', $params, [], [], ['HTTP_REFERER' => '/competitor-brand/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/competitor-brand/edit');\n $this->assertSessionHas('brand-updated', '');\n \n // Validate data\n $brand = $this->brand->getOne($params['ID']);\n $this->assertEquals($brand->name, $this->customBrandData);\n }",
"public function testRenderUpdateNoUser()\n {\n $this->withSession($this->adminSession)\n ->call('GET', '/competitor-brand/edit', ['ID' => 2]);\n \n $this->assertResponseStatus(404);\n }",
"public function testRenderUpdateNoID()\n {\n $this->withSession($this->adminSession)\n ->call('GET', '/competitor-brand/edit');\n \n $this->assertResponseStatus(404);\n }",
"public function testUpdateAnAccount()\n {\n }",
"public function testUpdateUserSuccess()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/users/1/edit')\n ->assertSee('Update User')\n ->type('full_name', 'mai luong')\n ->type('address', 'quang nam')\n ->type('phone', '0123345454')\n ->type('identity_card', '347368362')\n ->press('Update')\n ->assertPathIs('/admin/users')\n ->assertSee('Update user successfully');\n $this->assertDatabaseHas('user_info', [\n 'full_name' => 'mai luong',\n 'address' => 'quang nam',\n 'phone' => '0123345454',\n 'identity_card' => '347368362',\n ]);\n });\n }",
"public function ajaxUpdateAccountAction()\n {\n $this->getResponse()->setHeader('Content-type', 'application/json', true);\n $responseBody = array('success' => true, 'data' => array());\n /** @var Mage_Core_Model_Store[] $stores */\n $storeId = $this->getRequest()->getParam('store');\n if (!empty($storeId)) {\n $stores = array(Mage::app()->getStore($storeId));\n } else {\n $stores = Mage::app()->getStores();\n }\n /** @var Nosto_Tagging_Helper_Data $helper */\n $helper = Mage::helper('nosto_tagging');\n /** @var Nosto_Tagging_Helper_Account $accountHelper */\n $accountHelper = Mage::helper('nosto_tagging/account');\n foreach ($stores as $store) {\n $account = $accountHelper->find($store);\n if (is_null($account)) {\n continue;\n }\n if ($accountHelper->updateAccount($account, $store)) {\n $responseBody['data'][] = array(\n 'type' => 'success',\n 'message' => $helper->__(sprintf(\"The account has been updated for the %s store.\", $store->getName()))\n );\n } else {\n $responseBody['data'][] = array(\n 'type' => 'error',\n 'message' => $helper->__(sprintf(\"There was an error updating the account for the %s store.\", $store->getName()))\n );\n }\n }\n if (empty($responseBody['data'])) {\n $responseBody['data'][] = array(\n 'type' => 'error',\n 'message' => $helper->__(\"Nosto has not been installed in any of the stores in the current scope. Please make sure you have installed Nosto to at least one of your stores in the scope.\")\n );\n }\n $this->getResponse()->setBody(json_encode($responseBody));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we must set halte_id session before passing to detail bus stop page | public function viewBusStop(Request $request, $halte_id){
$request->session()->put('halte_id', $halte_id);
return redirect()->action('UserController@displayHome');
} | [
"private function setBookingUrlSession()\n {\n //get temp booking villa id\n $booking = TempBooking::select('villa_id')->where('booking_token', '=', Session::get('booking'))->first();\n\n //get villa url name\n $villa_url_name = Villa::find($booking->villa_id)->url_name;\n\n //set temp booking url session\n Session::put('booking_url', route('GetBookingPage', $villa_url_name).'#payment');\n }",
"public function bn_dashboard()\r\n {\r\n if (isset($_SESSION[\"bid\"])) {\r\n $bn_id = $_SESSION[\"bid\"];\r\n\r\n $m_bn = new BusinessService();\r\n $bn_dashboard_detail = $m_bn->getBnDashBoardDetail($bn_id);\r\n\r\n if (1 == $bn_dashboard_detail) {\r\n $this->redirect(\"Business/business_db1\");\r\n } else if (2 == $bn_dashboard_detail) {\r\n $this->redirect(\"Business/business_db2\");\r\n } else {\r\n // Exit session due to not found\r\n session_start();\r\n session_unset();\r\n session_destroy();\r\n $this->redirect(\"Business/signIn\");\r\n }\r\n } else {\r\n $this->redirect(\"Business/signIn\");\r\n }\r\n }",
"private function _start_session() {\r\n\r\n\t\t//first let's see if the user has not been active, we'll give them one hour. If they are inactive after one hour then we remove their session.\r\n\t\t$this->_check_auto_end_session();\r\n\t\t\r\n\t\t$this->_session = isset($_SESSION['espresso_breakout_session']) ? $_SESSION['espresso_breakout_session'] : array();\r\n\r\n\t\t\r\n\t\t//only do this if _session isn't empty\r\n\t\tif ( !empty($this->_session ) ) {\r\n\t\t\t//we always get notices first (and any transient data).. then if this is default route we clear the session because default ALWAYS clears session\r\n\t\t\t$this->_template_args['notices'] = $this->_display_notices();\r\n\t\t\t$this->_route_transient = $this->_get_transient();\r\n\r\n\r\n\t\t\tif ( $this->_route == 'default' ) {\r\n\t\t\t\t$this->_clear_session();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\t\t//check to make sure we don't already have a session. If we don't then init vars.\r\n\t\tif ( !isset( $_SESSION['espresso_breakout_session']['id'] ) || empty( $_SESSION['espresso_breakout_session']['id'] ) ) {\r\n\t\t\t$_SESSION['espresso_breakout_session'] = array();\r\n\t\t\t$_SESSION['espresso_breakout_session']['id'] = session_id() . '-' . uniqid('', true);\r\n\t\t\t$_SESSION['espresso_breakout_session']['transient_id'] = uniqid();\r\n\t\t\t$_SESSION['espresso_breakout_session']['registration_valid'] = FALSE;\r\n\t\t\t$_SESSION['espresso_breakout_session']['expiry'] = time();\r\n\t\t}\r\n\t\t\r\n\t\t$this->_session = $_SESSION['espresso_breakout_session'];\r\n\t\t$this->_session['visited'] = isset($this->_session['visited']) && $this->_session['visited'] == $this->_route ? TRUE : FALSE;\r\n\t}",
"private function sauver(){\n $this->session->set(\"panier\", serialize($this->panier));\n $this->session->set(\"panierTraite\", serialize($this->traite));\n }",
"function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }",
"function zen_hide_session_id() {\n global $session_started;\n\n if ( ($session_started == true) && defined('SID') && zen_not_null(SID) ) {\n return zen_draw_hidden_field(zen_session_name(), zen_session_id());\n }\n }",
"function beforeroute(){\n echo 'Before routing -- Session management -';\n }",
"public function ViewEditBusStop($halte_id){\n if(getenv('APP_ENV') == 'local'){\n $baseUrl = env('URL_DEV_API');\n }\n if(getenv('APP_ENV') == 'production'){\n $baseUrl = env('URL_API');\n }\n\n $detailBusStopUrl = $baseUrl.'bus_stop/'.$halte_id;\n $response = \\Httpful\\Request::get($detailBusStopUrl)->send();\n $detailBusStop = json_decode($response->raw_body, true);\n\n if($detailBusStop['code'] == 200){\n return view('edit_bus_stop')->with('viewData', $detailBusStop['data']);\n }\n }",
"function stopChequeStepOne($ussd_body, $mobile_number, $session_id, $sessdetails) {\n try {\n $account_selected = intval(trim($ussd_body));\n $available_accounts = explode(\"|\", $sessdetails['accounts']);\n $number_of_accounts = count($available_accounts);\n\n $responseArr['END_OF_SESSION'] = \"False\";\n //Check if user wants to proceed or go home/back\n if ($account_selected == 99 || $account_selected == 77) {\n $responseArr = $this->functions->checkNextStep($ussd_body, $mobile_number, $session_id, $sessdetails);\n return $responseArr;\n }\n\n if ($account_selected == 0 || $account_selected > $number_of_accounts) {\n $responseArr['USSD_BODY'] = $sessdetails['lang']['invalid_selection'] . $sessdetails['previous_response'];\n $this->functions->flog('INFO', __METHOD__ . \"() | Either the input value was not an integer or the value was more than number on the screen \");\n } else {\n $responseArr['USSD_BODY'] = $sessdetails['lang']['enter_cheque_number'] . $sessdetails['lang']['home_or_back'];\n\n $data['accfrom'] = $available_accounts[$account_selected - 1];\n $data['menu'] = 'Menu';\n $data['status'] = 'getpagenumber|stopChequeStepTwo|StopCheque';\n $data['previous_response'] = $responseArr['USSD_BODY'];\n $this->functions->updateSession($mobile_number, $data);\n }\n return $responseArr;\n } catch (Exception $e) {\n $this->functions->log(\"ERROR\", __CLASS__, __FUNCTION__ . ': ' . $e->getMessage() . date('His'));\n }\n }",
"protected function fetchSessionDataIntoSessionAttribute()\n {\n $feUser = $this->getFrontendUser();\n $this->sessionData['billing'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('billing'))\n );\n $this->sessionData['delivery'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('delivery'))\n );\n $this->sessionData['payment'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('payment'))\n );\n $this->sessionData['mails'] = $feUser->getKey(\n 'ses',\n \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('mails')\n );\n\n if ($this->piVars['check'] == 'billing' && $this->piVars['step'] == 'payment') {\n // Remove reference to delivery address\n $this->sessionData['delivery'] = false;\n $feUser->setKey(\n 'ses',\n \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('delivery'),\n false\n );\n }\n }",
"function dspLogOut() {\n\t$_SESSION['p_id']=0;\n\tif ($_REQUEST['HOMETOUR']!=\"\") dspHomeTour();\n\telse dspSpil();\n}",
"public function endSessionAfter8h();",
"public function longAppStep8() {\n\t\tif($this->request->data){\n\t\t\t$this->Session->write('longAppData.LongAppBorrowerTransaction',$this->request->data['LongAppBorrowerTransaction']);\n\t\t\t$this->redirect(array('controller'=>'longApp','action'=>'longAppStep9/'.base64_encode('longAppStep9')));\n\t\t}\n\t}",
"protected function init_session_id(){\n\t\t$this->session_id = time();\n\t}",
"private function openSession() {\n $this->sessionId = isset($_POST['key']) ? $_POST['key'] : (isset($_GET['key']) ? $_GET['key'] : 'null');\n\n if($this->sessionId == 'null' || strlen($this->sessionId) === 0) {\n $this->sessionId = rand(0, 999999999);\n }\n\n session_id($this->sessionId);\n session_name(\"gibSession\");\n session_start();\n }",
"private function startSession()\n\t{\n\t\t$result_data = $this->api_obj->Session_Start($this->cubis_user, $this->cubis_pass);\n\t\t$this->session_id = $result_data['response_data']['session_id'];\n\t}",
"public function stopTask()\n\t{\n\t\t// Check that the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$this->loginTask();\n\t\t\treturn;\n\t\t}\n\n\t\t// Incoming\n\t\t$sess = Request::getString('sess', '');\n\t\t$rtrn = base64_decode(Request::getString('return', '', 'method', 'base64'));\n\n\t\t$rediect = $this->config->get('stopRedirect', 'index.php?option=com_members&task=myaccount');\n\n\t\t// Ensure we have a session\n\t\tif (!$sess)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($redirect)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Double-check that the user owns this session.\n\t\t$mwdb = \\Components\\Tools\\Helpers\\Utils::getMWDBO();\n\n\t\t$ms = new \\Components\\Tools\\Tables\\Session($mwdb);\n\t\tif ($this->config->get('access-admin-session'))\n\t\t{\n\t\t\t$ms->load($sess);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ms->load($sess, User::get('username'));\n\t\t}\n\n\t\t// Did we get a result form the database?\n\t\tif (!$ms->username)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($rediect)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get plugins\n\t\tPlugin::import('mw', $ms->appname);\n\n\t\t// Trigger any events that need to be called before session stop\n\t\tEvent::trigger('mw.onBeforeSessionStop', array($ms->appname));\n\n\t\t// Stop the session\n\t\t$status = $this->middleware(\"stop $sess\", $output);\n\t\tif ($status == 0)\n\t\t{\n\t\t\techo '<p>Stopping ' . $sess . '<br />';\n\t\t\tif (is_array($output))\n\t\t\t{\n\t\t\t\tforeach ($output as $line)\n\t\t\t\t{\n\t\t\t\t\techo $line . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (is_string($output))\n\t\t\t{\n\t\t\t\techo $output . \"\\n\";\n\t\t\t}\n\t\t\techo '</p>'.\"\\n\";\n\t\t}\n\n\t\t// Trigger any events that need to be called after session stop\n\t\tEvent::trigger('mw.onAfterSessionStop', array($ms->appname));\n\n\t\t// Log activity\n\t\tEvent::trigger('system.logActivity', [\n\t\t\t'activity' => [\n\t\t\t\t'action' => 'deleted',\n\t\t\t\t'scope' => 'tool.session',\n\t\t\t\t'scope_id' => $sess,\n\t\t\t\t'description' => Lang::txt('COM_TOOLS_ACTIVITY_SESSION_DELETED', $sess),\n\t\t\t\t'details' => array(\n\t\t\t\t\t'tool' => $ms->appname\n\t\t\t\t)\n\t\t\t],\n\t\t\t'recipients' => array(\n\t\t\t\t['user', User::get('id')]\n\t\t\t)\n\t\t]);\n\n\t\t// Take us back to the main page...\n\t\tif ($rtrn)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\t$rtrn\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($rediect)\n\t\t\t);\n\t\t}\n\t}",
"public function odhlasUzivatele(){\n // mazu celou session, proto neobsahuje dalsi data\n session_unset();\n }",
"private static function startSessionID()\n {\n if (is_null(self::$sid)) {\n if (!(self::$sid = Cookie::get(session_name()))) {\n self::$sid = substr(md5(uniqid(mt_rand(), true)), 0, 26);\n }\n }\n\n Cookie::set(\n session_name(),\n self::$sid,\n 0,\n '/',\n config_get('system.session.domain'),\n config_get('system.session.secure'),\n true\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Type relation with Place Contact | public function type(){
return $this->hasOne(ContactType::class,'id','type_id');
} | [
"public function type()\n {\n return $this->belongsTo('App\\Models\\ContactType', 'contact_type_id');\n }",
"public function getContactType();",
"public function type() {\n return $this->hasOne('Type','typeID','typeID');\n }",
"public function getRelationType();",
"public function getPlaceType(): PlaceType\n {\n return $this->placeType;\n }",
"public function type()\n {\n return $this->belongsTo(CustomerType::class, self::FIELD_ID_CUSTOMER_TYPE, CustomerType::FIELD_ID);\n }",
"public function type()\n {\n return $this->hasOne('App\\Type', 'question_type');\n }",
"public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::PLACE);\n }",
"public function getPlacementType()\n {\n return $this->hasOne(PlacementType::className(), ['id' => 'placement_type_id']);\n }",
"public function type()\n {\n return $this->hasOne(VehicleType::class, 'id', 'type_id');\n }",
"public function phoneType()\n {\n return $this->belongsTo('App\\PhoneType', 'phone_type_id', 'id');\n }",
"function roomify_conversations_add_unit_type_reference_field() {\n field_info_cache_clear();\n\n // \"conversation_unit_type_ref\" field.\n if (field_read_field('conversation_unit_type_ref') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_unit_type_ref',\n 'type' => 'entityreference',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'target_type' => 'bat_type',\n ),\n );\n field_create_field($field);\n }\n\n // \"conversation_unit_type_ref\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_unit_type_ref', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_unit_type_ref',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'Unit type',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'entityreference_autocomplete',\n ),\n );\n field_create_instance($instance);\n }\n}",
"public function type()\n {\n return $this->belongsTo(CarType::class, 'car_type_id');\n }",
"public function address_type_post()\n \t{\n \t\tlog_message('debug', 'User/address_type_post');\n \t\t\n\t\t$result = $this->_user->update_address_type(\n\t\t\textract_id($this->post('userId')),\n\t\t\t$this->post('contactId'),\n\t\t\t$this->post('addressType')\n\t\t);\n\t\t\n\t\tlog_message('debug', 'User/address_type_post:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}",
"public function type()\n {\n return $this->belongsTo(CampaignType::class, 'campaign_type_id');\n }",
"public function relations() {\n return array(\n 'type'=>array(self::BELONGS_TO, 'Type', 'type_id') \n \n );\n }",
"public function type()\n {\n return $this->belongsTo('App\\Models\\ActivityType\\ActivityType', 'activity_type_id');\n }",
"public function getTourtype(){\n return $this->hasOne(Tourtype::className(), ['id' => 'type']);\n }",
"function acf_get_location_types()\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets catalog category by catalogCategoryId | public function getCatalogCategory(Request $request, int $catalogCategoryId) {
$publisedOnly = $request->input('published_only', false);
$catalogCategory = CatalogCategories::catalogCategory(
$catalogCategoryId,
(bool) $publisedOnly
);
if (isset($catalogCategory)) {
$values = DB::table('catalog_category_values')
->where('category_id', '=', $catalogCategoryId)
->get();
$catalogCategory->data = (object) [];
if (isset($values)) {
foreach ($values as $value) {
$catalogCategory->data->{$value->language} = [
'name' => $value->name,
'description' => $value->description,
];
}
}
return response()->json($catalogCategory);
} else {
return response('', 404);
}
} | [
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Id = '.$this->CategoryId ) );\n\t}",
"public function getCategory($categoryId)\n {\n return $this->category->where('id', $categoryId)->first();\n }",
"public function getCategory()\n\t{\n\t\t$arrTrailFull = Category::GetTrailByProductId($this->id);\n\t\t$objCat = Category::model()->findbyPk($arrTrailFull[0]['key']);\n\t\treturn $objCat;\n\t}",
"public function getCategory(){\n \n if (!$this->courseCategory){\n $this->courseCategory = new \\GT\\CourseCategory($this->category);\n } \n \n return $this->courseCategory;\n \n }",
"public static function getById( $mediaCategoryId ) {\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"SELECT * FROM mediaCategories WHERE mediaCategoryId = :mediaCategoryId\";\n $st = $conn->prepare( $sql );\n $st->bindValue( \":mediaCategoryId\", $mediaCategoryId, PDO::PARAM_INT );\n $st->execute();\n $row = $st->fetch();\n $conn = null;\n if ( $row ) return new MediaCategory( $row );\n }",
"function get_category($id_cat)\n {\n $category = $this->db->query(\"SELECT * FROM `category` WHERE `id_cat` = ?\", array($id_cat))->getResultArray();\n\n return $category;\n }",
"public function setCategoryId($var)\n {\n GPBUtil::checkString($var, True);\n $this->category_id = $var;\n\n return $this;\n }",
"public function getCatId()\n\t{\n\t\treturn $this->categoria_id;\n\t}",
"protected function _getCategoryId()\n\t{\n\t\tif ($this->_processor) {\n\t\t\t$categoryId = $this->_processor\n\t\t\t\t->getMetadata(Df_PageCache_Model_Processor_Category::METADATA_CATEGORY_ID);\n\t\t\tif ($categoryId) {\n\t\t\t\treturn $categoryId;\n\t\t\t}\n\t\t}\n\n\t\t//If it is not product page and not category page - we have no any category (not using last visited)\n\t\tif (!$this->_getProductId()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->_getCookieValue(Df_PageCache_Model_Cookie::COOKIE_CATEGORY_ID, null);\n\t}",
"public function getCategoryRowByCategoryId()\n {\n return $this->findParentRow('Application_Model_Category_DbTable', 'category_id');\n }",
"private function getCurrentCategory()\n {\n $result = null;\n $catalogLayer = $this->layerResolver->get();\n\n if ($catalogLayer) {\n $result = $catalogLayer->getCurrentCategory();\n }\n\n return $result;\n }",
"function get_category_information($cid) {\r\n $path = 'category/' . $cid;\r\n return $this->api_request($path);\r\n }",
"public function getCategory() {\r\n return Mage::getModel('lcb_attachments/category')->load($this->getRequest()->getParam('id'));\r\n }",
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Layout = '.get_class( $this ) ) );\n\t}",
"function get_category() {\n $category = null;\n\n if (!empty($this->categoryid)) {\n $category = grade_category::fetch('id', $this->categoryid);\n } elseif (!empty($this->iteminstance) && $this->itemtype == 'category') {\n $category = grade_category::fetch('id', $this->iteminstance);\n }\n\n return $category;\n }",
"public function getCategory()\n {\n return Mage::registry('current_category');\n }",
"public function get_category_context() {\n $categoryid = $this->get_category_id();\n if (!$categoryid) {\n return null;\n }\n return context_coursecat::instance($categoryid);\n }",
"public function getCatId()\n {\n return $this->cat_id;\n }",
"public function getCategory()\r\n {\r\n return $this->category;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Instance: Returns an instance of the User model if the specified user exists in the database. | public static function getInstance($user) {
$User = new User();
if ($User->findUser($user)->exists()) {
return $User;
}
return null;
} | [
"private function retrieveValidUserInstance()\n {\n $UsersRepository = new \\Devise\\Users\\UsersRepository(\n new \\DvsUser,\n $this->Framework\n );\n\n return $UsersRepository->findById(1);\n }",
"public function userQuery()\n {\n $userClass = Config::get('auth.providers.users.model');\n try {\n $container = Container::getInstance();\n $userInstance = $container->make($userClass);\n $this->validateUserModel($userInstance);\n\n return $userInstance;\n } catch (BindingResolutionException $e) {\n throw new EntityNotFoundException(\"The model $userClass from he follow configuration -> 'auth.providers.users.model' cannot be instantiated (may be an abstract class).\", $e->getCode(), $e);\n } catch (ReflectionException $e) {\n throw new EntityNotFoundException(\"The model from the follow configuration -> 'auth.providers.users.model' doesn't exists.\", $e->getCode(), $e);\n }\n }",
"public function getUserInstance()\n {\n $entity = null;\n\n if ($this instanceof \\User) {\n $entity = $this;\n } elseif ($this instanceof \\PortalUser) {\n $this->setPortalId();\n $entity = $this->getRelated('User');\n } else {\n $entity = $this->getPortalUser()->getRelated('User');\n }\n\n $this->checkJoin($this, $entity);\n\n return $entity;\n }",
"public function getUserInstance()\n {\n $class = config('ziAuditable.users.model', User::class);\n\n return new $class;\n }",
"public static function findOrCreateUser()\n\t{\n\t\t$Session = \\Phalcon\\DI::getDefault()->getSession();\n\t\tif ($Session->has('id'))\n\t\t{\n\t\t\treturn UserModel::findFirst($Session->get('id'));\n\t\t}\n\n\t\t$User = new UserModel();\n\t\t$User->save([\n\t\t\t'sess' => $Session->getId(),\n\t\t 'balance' => 0\n\t\t]);\n\n\t\t$Session->set('id', $User->id);\n\n\t\treturn $User;\n\t}",
"public function getUser()\n {\n $id = (int) $this->user_id;\n return $this->getTable('User')->findById($id);\n }",
"protected function findModel()\n {\n $id = Yii::$app->user->identity->id;\n return User::findOne($id);\n }",
"public static function user()\r\n {\r\n if (session_status() == PHP_SESSION_NONE || !isset($_SESSION['userId'])) {\r\n return false;\r\n }\r\n\r\n if (!isset(self::$user)) {\r\n try {\r\n self::$user = User::find($_SESSION['userId']);\r\n } catch (\\Exception $exception) {\r\n return false;\r\n }\r\n }\r\n\r\n return self::$user;\r\n }",
"function getUser()\n {\n if (empty($this->user_id))\n return $this->_user = null;\n if (empty($this->_user) || $this->_user->user_id != $this->user_id) {\n $this->_user = $this->getDi()->userTable->load($this->user_id);\n }\n return $this->_user;\n }",
"public function get_user_by_id($id) {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM user WHERE entity_id = ?\");\n\t\t$stmt->bind_param('d', $id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\tif($row = $result->fetch_assoc()) {\n\t\t\t$user = new User($row['entity_id'], $row);\n\t\t} else {\n\t\t\tthrow new UserNotFoundException('User does not exist.');\n\t\t}\n\t\t$stmt->close();\n\t\treturn $user;\n\t}",
"public function getUserByUserId() {\n\t\tif ($this->user_id == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->tdbmService->getObject(\"user\", $this->user_id, \"Test\\\\Dao\\\\Bean\\\\UserBean\", true);\n\t}",
"public function getActiveUser() {\n\t\tif (isset($_SESSION['auth'][$this->getConfig('session_user')]) && !empty($_SESSION['auth'][$this->getConfig('session_user')])) {\n\t\t\tif (!isset($this->userObj)) {\n\t\t\t\t$userTable = Doctrine::getTable($this->getConfig('models.user'));\n\t\t\t\t$user_id = $_SESSION['auth'][$this->getConfig('session_user')][$this->getConfig('fields.user.id')];\n\t\t\t\t$this->userObj = &$userTable->find($user_id);\n\t\t\t}\n\t\t\treturn $this->userObj;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"protected function findUser()\n {\n if (Yii::$app->user->isGuest) {\n Yii::$app->user->loginRequired();\n }\n\n $id = Yii::$app->user->id;\n if (($model = User::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"public static function user()\n {\n return new static::$userModel;\n }",
"protected function findModel()\n {\n return User::findOne(Yii::$app->user->id);\n }",
"public static function getDemoUser(): User\n {\n return User::findOrFail(static::$id);\n }",
"public function loadUser(): User\n {\n $this->removeOldSessionData();\n $userId = $this->getSessionUserId();\n\n if ($userId > 0) {\n $user = $this->userRepository->getUserById($userId);\n if ($user !== null) {\n return $user;\n }\n }\n\n // Not logged in, return empty/anonymous user\n return new User();\n }",
"public function getUserInstance()\n {\n $class = $this->getUserClass();\n\n return new $class;\n }",
"protected function find_user()\n\t{\n\t\t// Get the user from the session\n\t\t$user = $this->session()->get($this->_config['session']['key']);\n\n\t\t// User found in session, return\n\t\tif (is_object($user))\n\t\t{\n\t\t\tif ($user->loaded())\n\t\t\t{\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// reloading failed - user is deleted but still exists in session\n\t\t\t\t// logout (so session & cookie are cleared)\n\t\t\t\t$this->logout(TRUE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->_config['cookie']['lifetime'])\n\t\t{\n\t\t\tif (($token = Cookie::get($this->_config['cookie']['key'])))\n\t\t\t{\n\t\t\t\tlist($hash, $username) = explode('.', $token, 2);\n\n\t\t\t\tif (strlen($hash) === 32 AND $username !== NULL)\n\t\t\t\t{\n\t\t\t\t\t// load user using username\n\t\t\t\t\t$user = $this->_load_user($username);\n\n\t\t\t\t\t// validates token vs hash\n\t\t\t\t\tif ($user->loaded() AND $this->check($hash, $user->{$this->_config['columns']['token']}))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $this->complete_login($user,TRUE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update a channel feed. For parameters please see | public function updateChannelFeed($params = array()) {
$uri = 'update';
$params['api_key'] = $this->apikey;
$this->makePostRequest($uri, $params);
return $this;
} | [
"public function updated(Channel $channel)\n {\n //\n }",
"public function update() {\n\n\t\t$feed = $this->fetch_feed();\n\t\t$option = $this->get_option();\n\n\t\tupdate_option(\n\t\t\tself::OPTION_KEY,\n\t\t\t[\n\t\t\t\t'update' => time(),\n\t\t\t\t'feed' => $feed,\n\t\t\t\t'events' => $option['events'],\n\t\t\t\t'dismissed' => $option['dismissed'],\n\t\t\t]\n\t\t);\n\t}",
"private function update_feeds() {\n\t\t// Retrieve feeds\n\t\t$rows = $this->get_feeds();\n\t\tif($rows) {\n\t\t\t$time = time();\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$feed = $row['feed'];\n\t\t\t\t$checkdate = $row['date'];\n\t\t\t\t$query = urldecode($row['query']);\n\t\t\t\t$id = array_pop(explode('/', $feed));\n\t\t\t\t$rss = $this->make_feed($query, $id, $time, $checkdate);\n\t\t\t\t// Updated ?\n\t\t\t\tif($rss) {\n\t\t\t\t\t// Update the date\n\t\t\t\t\t$delete = \"DELETE FROM <\".BASENAME.\"/feeds> { <$rss> dc:date ?old . } \";\n\t\t\t\t\t$this->connector->query($delete);\n\t\t\t\t\t$date = date('c', $time);\n\t\t\t\t\t$insert = \"INSERT INTO <\".BASENAME.\"/feeds> { <$rss> dc:date \\\"$date\\\" . } \";\n\t\t\t\t\t$this->connector->query($insert);\n\t\t\t\t\t// Notify the PuSH hub server\n\t\t\t\t\t$this->push($rss);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function update($part, Google_Service_YouTube_Channel $postBody, $optParams = array())\n {\n $params = array('part' => $part, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('update', array($params), \"Google_Service_YouTube_Channel\");\n }",
"public function updateChannelData($pid, $channel_data);",
"function feed_update($feed_id, $feed) {\n $request['feed'] = $feed;\n\n return $this->hook(\"/feeds/{$feed_id}.xml\", \"feed\", $request, 'PUT');\n }",
"private function update_feed($feed)\n\t{\n\t\t$feed = intval($feed);\n\n\t\tif ( ! $feed)\n\t\t\tthrow new Exception('Invalid feed id');\n\n\t\t$feed = ORM::factory('Feed', $feed);\n\n\t\tMinion_CLI::write($feed->name . ' updating...');\n\n\t\t$feeds = new Feeds();\n\t\t$feeds->register_callback(function ($msg) { Minion_CLI::write($msg); });\n\t\t$feeds->update_single($feed);\n\t}",
"function editChannel()\n {\n }",
"public function update()\n {\n if (!Mage::getSingleton('admin/session')->isLoggedIn()) {\n return;\n }\n\n /** @var Mage_Core_Model_Config_Element $feeds */\n $feeds = Mage::getConfig()->getNode('global/evozon/adminnotification/feeds');\n\n foreach ($feeds->children() as $child) {\n\n /** @var Evozon_Base_Model_AdminNotification_Feed $feed */\n $feed = Mage::getModel('evozon_base/adminNotification_feed', $child->asArray());\n\n /** @var Evozon_Base_Model_AdminNotification_Feed_Parse $parse */\n $parse = Mage::getModel('evozon_base/adminNotification_feed_parse', $feed);\n $parse->update();\n }\n }",
"public function update_av_feed()\n {\n $response = $this->conn->do_request($this->common_url . '/update/feed', array(), 'PUT');\n\n return $response;\n }",
"public function testUpdateChannelGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function setUpdateChannel(?OfficeUpdateChannel $value): void {\n $this->getBackingStore()->set('updateChannel', $value);\n }",
"function update_channel($data, $channel_id)\n\t{\n\t\t$this->db->where('channel_id', $channel_id);\n\t\t$this->db->update('channels', $data);\n\t\treturn $this->db->affected_rows();\n\t}",
"public function update($feed, array $options = array())\n {\n $body = (isset($options['body']) ? $options['body'] : array());\n $body['feed'] = $feed;\n\n $response = $this->client->put('/api/topics/'.rawurlencode($this->topic_id).'/feeds/'.rawurlencode($this->id).'', $body, $options);\n\n return $response;\n }",
"public function sendUpdateChannels(){\n $this->setEvent('update_subscription');\n $this->send();\n }",
"public function getUpdateChannel()\n {\n return $this->update_channel;\n }",
"public function update() {\n\n\t\t$feed = $this->fetch_feed();\n\t\t$option = $this->get_option();\n\n\t\tupdate_option(\n\t\t\t'wpforms_notifications',\n\t\t\t[\n\t\t\t\t'update' => time(),\n\t\t\t\t'feed' => $feed,\n\t\t\t\t'events' => $option['events'],\n\t\t\t\t'dismissed' => $option['dismissed'],\n\t\t\t]\n\t\t);\n\t}",
"public function updateChannel($channelID, $channelName, $status, $channelCode) {\n\t\t$result = DB::table('channel')\n\t\t ->where('channelID', $channelID)\n\t\t ->update(['channelName' => $channelName, 'status' => $status, 'channelCode' => $channelCode]);\n\n \treturn $result;\n \t\n }",
"public function updateStatus(array $feeds);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to confirm that site level subscriptions are activated and deactivated according to system capabilities. | public function test_site_level_subscription() {
// Create a site level subscription.
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$sub = new stdClass();
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
$this->subscription = $monitorgenerator->create_subscription($sub);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be inactive as the user doesn't have the capability. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Now, assign the user as a teacher role at system context.
$this->getDataGenerator()->role_assign($this->teacherrole->id, $this->user->id, context_system::instance());
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be active now. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
} | [
"public function testCrceBundleAdministrationGetActiveSubscription()\n {\n\n }",
"public function testCrceBundleAdministrationGetAvailableSubscription()\n {\n\n }",
"public function testCrceBundleAdministrationActivateSubscription()\n {\n\n }",
"public function test_subscription_without_trial(){\n Carbon::setTestNow(Carbon::create(2020, 1, 1, 12, 0, 0));\n\n $planType = $this->createPlanType('user_membership');\n $plan = $this->createPlan('plan', $planType);\n $period = Subscriptions::period($this->faker->sentence(3), 'period', $plan)\n ->create();\n\n $user = $this->createUser();\n $user->subscribeTo($period);\n $currentSubscription = $user->currentSubscription($planType);\n\n $this->assertFalse($currentSubscription->isOnTrial());\n $this->assertEquals($currentSubscription->remainingTrialDays(), 0);\n\n Carbon::setTestNow(); \n }",
"public function testSubscriptionCheckoutSession()\n {\n }",
"private static function _helper_subscription_activate()\n {\n }",
"function tool_monitor_can_subscribe() {\n if (has_capability('tool/monitor:subscribe', context_system::instance())) {\n return true;\n }\n $courses = get_user_capability_course('tool/monitor:subscribe', null, true, '', '', 1);\n return empty($courses) ? false : true;\n}",
"public function testChangeSubscription()\n {\n }",
"public function testCrceBundleAdministrationDeactivateSubscription()\n {\n\n }",
"public function testListSubscriptions()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetSubscriptions()\n {\n $subscriptions = $this->getResourceModelMock('sheep_subscription/subscription_collection', array('load', 'addNextRenewalDate', 'addOrder'));\n $subscriptions->expects($this->once())->method('addNextRenewalDate');\n $subscriptions->expects($this->atLeast(2))->method('addOrder');\n\n $helperMock = $this->getHelperMock('sheep_subscription/subscription', array('getCustomerSubscriptions'));\n $helperMock->expects($this->once())->method('getCustomerSubscriptions')->with($this->equalTo(1000))->willReturn($subscriptions);\n $this->replaceByMock('helper', 'sheep_subscription/subscription', $helperMock);\n\n /** @var Sheep_Subscription_Block_History $object */\n $object = $this->getBlockMock('sheep_subscription/history', array('getCustomerId'));\n $object->expects($this->any())->method('getCustomerId')->will($this->returnValue(1000));\n\n $actual = $object->getSubscriptions();\n $this->assertEquals($subscriptions, $actual);\n\n // Consecutive calls are cached - helper is executed only once\n $actual2 = $object->getSubscriptions();\n $this->assertEquals($subscriptions, $actual2);\n }",
"public function test_recurring_subscription_status_trial_and_tolerance(){\n Event::fake();\n Carbon::setTestNow(Carbon::create(2020, 1, 1, 12, 0, 0));\n\n $planType = $this->createPlanType('user_membership');\n $plan = $this->createPlan('plan', $planType);\n $period = Subscriptions::period($this->faker->sentence(3), 'period', $plan)\n ->setRecurringPeriod(1, PlanPeriod::UNIT_MONTH)\n ->setTrialDays(3)\n ->setToleranceDays(5)\n ->create();\n\n $user = $this->createUser();\n $user->subscribeTo($period);\n $currentSubscription = $user->currentSubscription($planType);\n\n $this->assertTrue($currentSubscription->isOnTrial());\n $this->assertEquals($currentSubscription->remainingTrialDays(), 2);\n $this->assertTrue($period->isRecurring());\n $this->assertFalse($currentSubscription->isActive());\n $this->assertTrue($currentSubscription->isValid());\n\n Carbon::setTestNow(Carbon::create(2020, 1, 4, 12, 0, 1));\n\n $this->assertFalse($currentSubscription->isOnTrial());\n $this->assertTrue($currentSubscription->isActive());\n $this->assertTrue($currentSubscription->isValid());\n $this->assertFalse($currentSubscription->isExpiredWithTolerance());\n $this->assertFalse($currentSubscription->isFullExpired());\n\n Carbon::setTestNow(Carbon::create(2020, 2, 4, 12, 0, 1));\n\n $this->assertFalse($currentSubscription->isActive());\n $this->assertTrue($currentSubscription->isValid());\n $this->assertTrue($currentSubscription->isExpiredWithTolerance());\n $this->assertFalse($currentSubscription->isFullExpired());\n\n Carbon::setTestNow(Carbon::create(2020, 2, 9, 12, 0, 1));\n\n $this->assertFalse($currentSubscription->isActive());\n $this->assertFalse($currentSubscription->isValid());\n $this->assertFalse($currentSubscription->isExpiredWithTolerance());\n $this->assertTrue($currentSubscription->isFullExpired());\n\n $this->assertTrue($currentSubscription->renew(2));\n Event::assertDispatched(RenewSubscription::class);\n\n $this->assertTrue($currentSubscription->isActive());\n $this->assertTrue($currentSubscription->isValid());\n $this->assertFalse($currentSubscription->isExpiredWithTolerance());\n $this->assertFalse($currentSubscription->isFullExpired());\n\n Carbon::setTestNow(Carbon::create(2020, 4, 9, 12, 0, 2));\n\n $this->assertTrue($currentSubscription->cancel('non-payment'));\n Event::assertDispatched(CancelSubscription::class);\n\n $this->assertTrue($currentSubscription->isCancelled());\n $this->assertTrue($currentSubscription->isFullExpired());\n\n $this->assertFalse($currentSubscription->renew(2));\n\n Carbon::setTestNow();\n }",
"public function testCrceTariffChangeGetAvailableSubscription()\n {\n\n }",
"public function testCancelSubscriptionAndUseIt()\n {\n $this->testUser->subscription('main')->cancel();\n $this->assertTrue($this->testUser->subscription('main')->canUseFeature('social_cat_profiles'));\n }",
"public static function meta_box_subscription_capabilities() {\n\t\tinclude 'admin/meta-box-subscription-capabilities.php';\n\t}",
"public function testGetSubscriptionAddOns()\n {\n }",
"public function testSubscriptionActivatedTriggersAnEvent()\n {\n $event_triggered = false;\n\n $this->dispatcher->listen(DispatcherInterface::ON_SUBSCRIPTION_ACTIVATED, function (GatewayInterface $gateway, SubscriptionInterface $subscription) use (&$event_triggered) {\n $this->assertInstanceOf(ExampleOffsiteGateway::class, $gateway);\n $this->assertInstanceOf(Subscription::class, $subscription);\n\n $this->assertEquals($this->subscription->getReference(), $subscription->getReference());\n\n $event_triggered = true;\n });\n\n $this->gateway->triggerSubscriptionActivated($this->subscription);\n\n $this->assertTrue($event_triggered);\n }",
"public function testSnaSubscriberNotificationAdministrationServiceGetNotificationsSubscription()\n {\n\n }",
"public function testGetSubscriptionTemplates()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signs a cert with another CERT | function openssl_csr_sign($csr, $x509, $priv_key, $days) {} | [
"public function generateSignCertAction(Request $request)\n {\n if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $idUser = $this->getUser()->getIdUser();\n $userType = 'U';\n } elseif ($request->get('u') and $request->get('ut') and $this->getParameter('secret') == $request->get('s')) {\n $idUser = $request->get('u');\n $userType = $request->get('ut');\n } else {\n $res = ['authorization' => false];\n }\n\n // Get element\n if (!isset($res)) {\n $res = $this->get('app.model.data')->signatureCertificate($request->get('t'), $userType, $idUser);\n }\n\n $res['lang'] = $request->getLocale() == 'es_ES' ? 'ES' : 'EN';\n $res['baseUrl'] = $request->getSchemeAndHttpHost();\n $res['type'] = 'signature';\n\n if (!$res['authorization']) {\n return $this->render('data/certificate.html.twig', $res);\n }\n\n // Rendering only body\n if ($request->get('m') == 'html') {\n return $this->render('data/certificate-full.html.twig', $res);\n } else {\n // Generate PDF with the certificate\n $pdf = new Pdf([\n 'zoom' => '0.85',\n 'margin-left' => '0px',\n 'margin-right' => '0px',\n 'margin-top' => '750px',\n 'margin-bottom' => '450px',\n 'header-html' => $this->renderView('data/certificate-header.html.twig', $res),\n 'footer-html' => $this->renderView('data/certificate-footer.html.twig', $res)\n ]);\n $pdf->addPage($this->renderView('data/certificate.html.twig', $res));\n\n // Send file to the browser\n $pdf->send('Bindeo_signature_' . $res[$res['type']]->getBulk()->getExternalId() . '.pdf');\n }\n }",
"function openssl_pkcs7_sign($infile, $outfile, $signcert, $signkey, $headers, $flags = null, $extracertsfilename = null) {}",
"function ca_inter_create(& $ca, $keylen, $lifetime, $dn, $caref, $digest_alg = \"sha256\", $keytype = \"RSA\", $ecname = \"prime256v1\") {\n\t$signing_ca =& lookup_ca($caref);\n\tif (!$signing_ca) {\n\t\treturn false;\n\t}\n\n\t$signing_ca_res_crt = openssl_x509_read(base64_decode($signing_ca['crt']));\n\t$signing_ca_res_key = openssl_pkey_get_private(array(0 => base64_decode($signing_ca['prv']) , 1 => \"\"));\n\tif (!$signing_ca_res_crt || !$signing_ca_res_key) {\n\t\treturn false;\n\t}\n\t$signing_ca_serial = ++$signing_ca['serial'];\n\n\t$args = array(\n\t\t\"x509_extensions\" => \"v3_ca\",\n\t\t\"digest_alg\" => $digest_alg,\n\t\t\"encrypt_key\" => false);\n\tif ($keytype == 'ECDSA') {\n\t\t$args[\"curve_name\"] = $ecname;\n\t\t$args[\"private_key_type\"] = OPENSSL_KEYTYPE_EC;\n\t} else {\n\t\t$args[\"private_key_bits\"] = (int)$keylen;\n\t\t$args[\"private_key_type\"] = OPENSSL_KEYTYPE_RSA;\n\t}\n\n\t// generate a new key pair\n\t$res_key = openssl_pkey_new($args);\n\tif (!$res_key) {\n\t\treturn false;\n\t}\n\n\t// generate a certificate signing request\n\t$res_csr = openssl_csr_new($dn, $res_key, $args);\n\tif (!$res_csr) {\n\t\treturn false;\n\t}\n\n\t// Sign the certificate\n\t$res_crt = openssl_csr_sign($res_csr, $signing_ca_res_crt, $signing_ca_res_key, $lifetime, $args, $signing_ca_serial);\n\tif (!$res_crt) {\n\t\treturn false;\n\t}\n\n\t// export our certificate data\n\tif (!openssl_pkey_export($res_key, $str_key) ||\n\t !openssl_x509_export($res_crt, $str_crt)) {\n\t\treturn false;\n\t}\n\n\t// return our ca information\n\t$ca['crt'] = base64_encode($str_crt);\n\t$ca['prv'] = base64_encode($str_key);\n\t$ca['serial'] = 0;\n\t$ca['caref'] = $caref;\n\n\treturn true;\n}",
"function ca_inter_create(&$ca, $keylen_curve, $lifetime, $dn, $caref, $digest_alg = 'sha256')\n{\n $signing_ca = &lookup_ca($caref);\n if (!$signing_ca) {\n return false;\n }\n\n $signing_ca_res_crt = openssl_x509_read(base64_decode($signing_ca['crt']));\n $signing_ca_res_key = openssl_pkey_get_private(array(0 => base64_decode($signing_ca['prv']) , 1 => \"\"));\n if (!$signing_ca_res_crt || !$signing_ca_res_key) {\n return false;\n }\n $signing_ca_serial = ++$signing_ca['serial'];\n\n $args = array(\n 'config' => '/usr/local/etc/ssl/opnsense.cnf',\n 'x509_extensions' => 'v3_ca',\n 'digest_alg' => $digest_alg,\n 'encrypt_key' => false\n );\n if (is_numeric($keylen_curve)) {\n $args['private_key_type'] = OPENSSL_KEYTYPE_RSA;\n $args['private_key_bits'] = (int)$keylen_curve;\n } else {\n $args['private_key_type'] = OPENSSL_KEYTYPE_EC;\n $args['curve_name'] = $keylen_curve;\n }\n\n // generate a new key pair\n $res_key = openssl_pkey_new($args);\n if (!$res_key) {\n return false;\n }\n\n // generate a certificate signing request\n $res_csr = openssl_csr_new($dn, $res_key, $args);\n if (!$res_csr) {\n return false;\n }\n\n // Sign the certificate\n $res_crt = openssl_csr_sign($res_csr, $signing_ca_res_crt, $signing_ca_res_key, $lifetime, $args, $signing_ca_serial);\n if (!$res_crt) {\n return false;\n }\n\n // export our certificate data\n if (!openssl_pkey_export($res_key, $str_key) ||\n !openssl_x509_export($res_crt, $str_crt)) {\n return false;\n }\n\n // return our ca information\n $ca['crt'] = base64_encode($str_crt);\n $ca['caref'] = $caref;\n $ca['prv'] = base64_encode($str_key);\n $ca['serial'] = 0;\n\n return true;\n}",
"public function generateRootCert($subject, $signkey) {\n $keygen = 'openssl req -x509 -new -nodes -key /dev/stdin -days 365 -subj '.escapeshellarg($subject); //.' -out /dev/stdout';\n\t\t$output = array();\n\t\t$retvar = 0;\n\t\t$keygen = 'echo -n '.escapeshellarg($signkey).' | '.$keygen;\n\t\texec($keygen, $output, $retvar);\n\t\treturn implode(\"\\n\", $output);\n\t}",
"public function trustCertificate($crt);",
"public function sign($data, $key);",
"function test_download_cert(){\n $my_csrfile = test_create_csr(NULL,\"1024\",\"123456789\",\"client\");\n test_sign_csr(\"123456789\",$my_csrfile,\"30\",\"client\");\n}",
"public function testSignDeleteSignCert()\n {\n }",
"public abstract function sign($content, $key);",
"public function signWithServer($request)\n {\n //server\n $clientRequest = json_decode($request);\n $this->crt->setSignedCert(openssl_csr_sign($clientRequest->csr, $this->_getCaCert(), $this->_getCaKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()));\n\n // return signed file to user\n openssl_x509_export($this->crt->getSignedCert(), $clientCertificate);\n\n return json_encode(['certificate' => $clientCertificate]);\n }",
"public function insert($project, Appointments_Google_Service_Compute_SslCertificate $postBody, $optParams = array())\n {\n $params = array('project' => $project, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Appointments_Google_Service_Compute_Operation\");\n }",
"abstract public function sign($data);",
"function GApps_OpenID_SimpleSign($trust_roots = null) {\n $this->trust_roots = $trust_roots;\n if ($this->trust_roots == null) { \n $file = dirname(__FILE__).\"/ca-bundle.crt\";\n $this->trust_roots = array($file);\n }\n }",
"public function csr_sign() {\n // been pasted into a textarea from another page\n //$csrdata = $_POST[\"CSR\"];\n $ID = $this->input->post('acc');\n // $csrdata = \"file://./uploads/\".$ID.\".csr\";\n \n $csrdata = \"file://C:/xampp/htdocs/hoaxCA/uploads/\".$ID.\".csr\";\n\n // echo $csrdata;\n \n // We will sign the request using our own \"certificate authority\"\n // certificate. You can use any certificate to sign another, but\n // the process is worthless unless the signing certificate is trusted\n // by the software/users that will deal with the newly signed certificate\n \n // We need our CA cert and its private key\n \n $cacert = \"file://C:/xampp/htdocs/hoaxCA/assets/ca.crt\";\n $privkey = array(\"file://C:/xampp/htdocs/hoaxCA/assets/ca.key\", \"Megaphon3\");\n\n\n \t$usercert = openssl_csr_sign($csrdata, $cacert, $privkey, 365);\n \n // Now display the generated certificate so that the user can\n // copy and paste it into their local configuration (such as a file\n // to hold the certificate for their SSL server)\n openssl_x509_export($usercert, $certout);\n // echo $certout;\n $filepath=\"./cert/\".$ID.\".crt\";\n if ( ! write_file($filepath, $certout))\n {\n echo 'Unable to write the file';\n }\n else\n {\n $data['ID']=$ID;\n $data['certpath']=$filepath;\n echo $filepath;\n $res = $this->cert_model->signcert($data);\n\n foreach ($res->result_array() as $row)\n {\n }\n\n if ($row['statuscode']==0) {\n redirect('admin/viewCSR');\n }\n else\n echo $row['statusmsg'];\n\n }\n\n }",
"public function testCertifyPdf()\n {\n $filesPath = ROOT . DS . 'tests' . DS . 'TestCase' . DS . 'files';\n $resultDirPath = ROOT . DS .'tmp' . DS . 'tests' . DS . 'result';\n\n # Sign using kominfo certificate\n $pdfFile = new File($filesPath . DS . 'sample_contract.pdf');\n $p12File = new File($filesPath . DS . 'dhs.p12');\n $pass = 'lX957A';\n\n ReportGeneratorService::setResultFolderPath($resultDirPath);\n $signedPdfName = ReportGeneratorService::certifyPdf($pdfFile->path, $p12File->read(), $pass);\n $this->assertNotFalse($signedPdfName, 'Sign PDF tidak berhasil');\n\n # Sign using bppt certificate\n $pdfFile = new File($filesPath . DS . 'sample_doc.pdf');\n $p12File = new File($filesPath . DS . 'bppt.p12');\n $pass = 'kom1nfokom1nfo';\n\n ReportGeneratorService::setResultFolderPath($resultDirPath);\n $signedPdfName = ReportGeneratorService::certifyPdf($pdfFile->path, $p12File->read(), $pass);\n $this->assertNotFalse($signedPdfName, 'Sign PDF tidak berhasil');\n }",
"public function sign(string $payload, $key) : string;",
"public function sign($input, $key);",
"public function signTestSignCert($sign_cert_id, $cert_password_test)\n {\n $this->signTestSignCertWithHttpInfo($sign_cert_id, $cert_password_test);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the table prefix in use by the connection. | public static function setTablePrefix($prefix){
//Method inherited from \Illuminate\Database\Connection
\Illuminate\Database\MySqlConnection::setTablePrefix($prefix);
} | [
"public function setTablePrefix(string $prefix);",
"function set_table_prefix($prefix)\n\t{\n\t\t$this->table_prefix = $prefix;\n\t}",
"private function setPrefixTable()\n {\n global $wpdb;\n $this->prefixTable = $wpdb->prefix.$this->getPrefix();\n }",
"public function set_table_prefix ($prefix) {\n\n $this->table_prefix = strtolower($prefix);\n }",
"public function setTablePrefix($prefix){\n $this->table_prefix = $prefix;\n }",
"public static function setTablePrefix($prefix)\n {\n //Method inherited from \\Illuminate\\Database\\Connection \n \\Illuminate\\Database\\MySqlConnection::setTablePrefix($prefix);\n }",
"public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }",
"public function SetPrefix ($prefix)\r\n\t{\r\n\t\t$this->dbPrefix = $prefix;\r\n\t}",
"function setSessionTablePrefix($prefix=\"shared\") {\n\t\t$this->_db_sess = $prefix . \"_sessions\"; \n\t}",
"abstract public function prefixTable($table);",
"protected function setPrefix($prefix) {\n if (is_array($prefix)) {\n $this->prefixes = $prefix + ['default' => ''];\n }\n else {\n $this->prefixes = ['default' => $prefix];\n }\n\n [$start_quote, $end_quote] = $this->identifierQuotes;\n // Set up variables for use in prefixTables(). Replace table-specific\n // prefixes first.\n $this->prefixSearch = [];\n $this->prefixReplace = [];\n foreach ($this->prefixes as $key => $val) {\n if ($key != 'default') {\n $this->prefixSearch[] = '{' . $key . '}';\n // $val can point to another database like 'database.users'. In this\n // instance we need to quote the identifiers correctly.\n $val = str_replace('.', $end_quote . '.' . $start_quote, $val);\n $this->prefixReplace[] = $start_quote . $val . $key . $end_quote;\n }\n }\n // Then replace remaining tables with the default prefix.\n $this->prefixSearch[] = '{';\n // $this->prefixes['default'] can point to another database like\n // 'other_db.'. In this instance we need to quote the identifiers correctly.\n // For example, \"other_db\".\"PREFIX_table_name\".\n $this->prefixReplace[] = $start_quote . str_replace('.', $end_quote . '.' . $start_quote, $this->prefixes['default']);\n $this->prefixSearch[] = '}';\n $this->prefixReplace[] = $end_quote;\n\n // Set up a map of prefixed => un-prefixed tables.\n foreach ($this->prefixes as $table_name => $prefix) {\n if ($table_name !== 'default') {\n $this->unprefixedTablesMap[$prefix . $table_name] = $table_name;\n }\n }\n }",
"function _set_prefix()\n\t{\n\t\tif ( ! defined( 'SQL_PREFIX' ) )\n \t{\n \t\t$this->obj['sql_tbl_prefix'] = isset($this->obj['sql_tbl_prefix']) ? $this->obj['sql_tbl_prefix'] : 'ibf_';\n \t\t\n \t\tdefine( 'SQL_PREFIX', $this->obj['sql_tbl_prefix'] );\n \t}\n\t}",
"protected function add_db_table_prefix($table)\n {\n }",
"public function getNewTablePrefix();",
"public static function getTablePrefix()\n {\n return !empty(SMC_DB::$conf['prefix']) ? SMC_DB::$conf['prefix'] : '';\n }",
"function setTableName($table)\n {\n $this->tableName = $this->tablePrefix . $table;\n }",
"function getTablePrefix() {\n\t\treturn $this->tablePrefix = $this->getOption('database','tables_prefix');\n\t}",
"public function getTablePrefix() {\n return $this->table_prefix;\n }",
"public function tablePrefix()\n {\n return $this->config['table_prefix'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a node of kind ast\AST_MATCH_ARM | public function visitMatchArm(Node $node): VariableTrackingScope
{
// Traverse the AST_EXPR_LIST or null
foreach ($node->children['cond']->children ?? [] as $cond_child_node) {
if (!($cond_child_node instanceof Node)) {
continue;
}
$this->scope = $this->{Element::VISIT_LOOKUP_TABLE[$cond_child_node->kind] ?? 'handleMissingNodeKind'}($cond_child_node);
}
$expr = $node->children['expr'];
if ($expr instanceof Node) {
$this->scope = $this->{Element::VISIT_LOOKUP_TABLE[$expr->kind] ?? 'handleMissingNodeKind'}($expr);
}
return $this->scope;
} | [
"public function visitMagicLine(Node $node);",
"public function buildAstMatchArgument();",
"public function rlist() {\n $this->match(ListLexer::BEGIN);\n $this->expr();\n $this->match(ListLexer::END);\n }",
"function rule_match($result, $rule, $screen)\n {\n }",
"function mRPAREN(){\n try {\n $_type = GroupLexer::T_RPAREN;\n $_channel = GroupLexer::DEFAULT_TOKEN_CHANNEL;\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n {\n $this->matchChar(41); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function visitPattern(Pattern $node);",
"function mT__12(){\n try {\n $_type = t018llstarLexer::T_T__12;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n $this->matchString(\"char\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function visitMagicFunction(Node $node);",
"function mT__9(){\n try {\n $_type = t018llstarLexer::T_T__9;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n $this->matchChar(44); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function getMatchingNode();",
"function mT__41(){\n try {\n $_type = t042astLexer::T_T__41;\n $_channel = t042astLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t042ast.g\n // runtime/Php/test/Antlr/Tests/grammers/t042ast.g\n {\n $this->matchString(\"fooze\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function preg_match_r($pattern,$subject){\n\tpreg_match($pattern, $subject,$data);\n\treturn $data;\n}",
"function ArcroleType() {\n global $NodesA, $NumNodes, $NodeX;\n $node = $NodesA[$NodeX];\n if (!@$arcroleURI=$node['attributes']['arcroleURI']) DieNow('arcroleType arcroleURI missing');\n if (!@$id=$node['attributes']['id']) DieNow('arcroleType id missing');\n if (!@$cyclesAllowed=$node['attributes']['cyclesAllowed']) DieNow('arcroleType cyclesAllowed missing');\n # Now expect\n # <definition></definition>\n # <usedOn>definitionArc</usedOn>\n $node = $NodesA[++$NodeX];\n if (StripPrefix($node['tag']) != 'definition') DieNow(\"{$node['tag']} tag found rather than definition\");\n $definition = addslashes($node['txt']);\n $node = $NodesA[++$NodeX];\n if (StripPrefix($node['tag']) != 'usedOn') DieNow(\"{$node['tag']} tag found rather than expected usedOn\");\n $usedOn = $node['txt'];\n UpdateArcrole($arcroleURI, $usedOn, $definition, $cyclesAllowed);\n}",
"public function match(ResultInterface $result = null)/*# : bool */;",
"function mPLUS(){\n try {\n $_type = t048rewrite2::T_PLUS;\n $_channel = t048rewrite2::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t048rewrite2.g\n // runtime/Php/test/Antlr/Tests/grammers/t048rewrite2.g\n {\n $this->matchChar(43); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function runMatch()\n {\n }",
"function mT__14(){\n try {\n $_type = t018llstarLexer::T_T__14;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n $this->matchChar(123); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mT__8(){\n try {\n $_type = t046rewriteLexer::T_T__8;\n $_channel = t046rewriteLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t046rewrite.g\n // runtime/Php/test/Antlr/Tests/grammers/t046rewrite.g\n {\n $this->matchChar(40); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mT__13(){\n try {\n $_type = t018llstarLexer::T_T__13;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n $this->matchString(\"void\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create visit for autocollect Controller method for auto collect. This function will be called when pucks are scanned into a sample changer. First time a puck is scanned we create a new session. If there is already an active Auto Collect session for the beamline then add the container to the existing session. Containers are added to the autocollect session if they are on the same shipment to provide some sensible aggregation. Access is restricted to ip addresses within an "auto" list from config.php and certain beamlines 'auto_bls'. | function _auto_visit()
{
global $auto, $auto_bls, $auto_exp_hazard, $auto_sample_hazard, $auto_user, $auto_pass, $auto_session_type;
if (!(in_array($_SERVER["REMOTE_ADDR"], $auto)))
$this->_error('You do not have access to that resource', 401);
if (!$this->has_arg('CONTAINERID'))
$this->_error('No container specified');
if (!$this->has_arg('bl'))
$this->_error('No beamline specified');
if (!in_array($this->arg('bl'), $auto_bls))
$this->_error('That beamline cannot create autocollect visits', 401);
// Get container information - note that if the container has no owner - we use the proposal person.
// A person record is required for UAS so we can set investigators. UAS needs one 'TEAM_LEADER' and others as 'DATA_ACCESS'
$cont = $this->db->pq("SELECT c.sessionid, p.proposalid, ses.visit_number, CONCAT(p.proposalcode, p.proposalnumber) as proposal,
c.containerid,
HEX(p.externalid) as externalid,
pe.personid as ownerid,
HEX(pe.externalid) as ownerexternalid,
pe2.personid as piid,
HEX(pe2.externalid) as piexternalid,
s.shippingid
FROM proposal p
INNER JOIN shipping s ON s.proposalid = p.proposalid
INNER JOIN dewar d ON d.shippingid = s.shippingid
INNER JOIN container c ON c.dewarid = d.dewarid
LEFT OUTER JOIN blsession ses ON c.sessionid = ses.sessionid
LEFT OUTER JOIN person pe ON pe.personid = c.ownerid
LEFT OUTER JOIN person pe2 ON pe2.personid = p.personid
WHERE c.containerid=:1", array($this->arg('CONTAINERID')));
if (!sizeof($cont))
$this->_error('No such container', 404);
// Store container info for convenience
$cont = $cont[0];
// Check if the container owner is a valid person (in User Office)
// If not try and use the Proposal/Principal Investigator
if ($cont['OWNERID'] && $cont['OWNEREXTERNALID']) {
$cont['PEXTERNALID'] = $cont['OWNEREXTERNALID'];
$cont['PERSONID'] = $cont['OWNERID'];
} else {
if ($cont['PIID'] && $cont['PIEXTERNALID']) {
$cont['PEXTERNALID'] = $cont['PIEXTERNALID'];
$cont['PERSONID'] = $cont['PIID'];
}
}
if (!$cont['PEXTERNALID']) {
$this->_error('That container does not have a valid owner', 412);
}
if ($cont['SESSIONID']) {
error_log('That container already has a session ' . $cont['SESSIONID']);
$this->_output(array('VISIT' => $cont['PROPOSAL'] . '-' . $cont['VISIT_NUMBER']));
} else {
// Is there an existing auto collect session for this beamline with containers on the same shipment?
// If so we add this container to the existing Auto Collect session.
// Proposal reference is used to capture the visit string to return later
$auto_sessions = $this->db->pq("SELECT ses.sessionid, HEX(ses.externalid) as sexternalid, ses.startDate, ses.endDate, CONCAT(p.proposalcode, p.proposalnumber, '-', ses.visit_number) as visit
FROM Container c
INNER JOIN Dewar d ON d.dewarId = c.dewarId
INNER JOIN Shipping sh ON sh.shippingId = d.shippingId
INNER JOIN BLSession ses ON ses.sessionId = c.sessionId
INNER JOIN SessionType st ON st.sessionId = ses.sessionId
INNER JOIN Proposal p ON p.proposalId = sh.proposalId
WHERE ses.beamlinename=:1
AND st.typename='Auto Collect'
AND sh.shippingid = :2
AND (CURRENT_TIMESTAMP BETWEEN ses.startDate AND ses.endDate)", array($this->arg('bl'), $cont['SHIPPINGID']));
if (!sizeof($auto_sessions)) {
// Create new session - passing containerID, proposalID and UAS proposal ID
$sessionNumber = $this->_create_new_autocollect_session($cont['CONTAINERID'], $cont['PROPOSALID'], $cont['EXTERNALID'], $cont['PERSONID'], $cont['PEXTERNALID']);
if ($sessionNumber > 0) {
$result = array('VISIT' => $cont['PROPOSAL'] . '-' . $sessionNumber, 'CONTAINERS' => array($cont['CONTAINERID']));
$this->_output($result);
} else {
$this->_error('Something went wrong creating a session for that container ' . $cont['CONTAINERID']);
}
} else {
// Update existing session - passing Session ID, UAS Session ID, Container ID and the current Team Leader (so its preserved in UAS)
$auto_session = $auto_sessions[0];
// Find the team leader for this auto collect session
$team_leader = $this->db->pq("SELECT shp.role, pe.personId as teamleaderId, HEX(pe.externalId) as teamleaderExtId
FROM Session_has_Person shp
INNER JOIN Person pe ON pe.personId = shp.personId
WHERE shp.sessionId = :1
AND shp.role='Team Leader'", array($auto_session['SESSIONID']));
if (!sizeof($team_leader)) {
error_log('Proposal::auto_session - no team leader for an existing Auto Collect Session');
$this->_error('Precondition failed, no team leader role found while adding container ' . $cont['CONTAINERID'] . ' to session ' . $auto_session['SESSIONID'], 412);
}
$result = $this->_update_autocollect_session($auto_session['SESSIONID'], $auto_session['SEXTERNALID'], $cont['CONTAINERID'], $team_leader[0]['TEAMLEADEREXTID']);
if ($result) {
// Add visit to return value...
// Just returning number of samples and investigators along with container list
$resp['VISIT'] = $auto_session['VISIT'];
$resp['CONTAINERS'] = $result['CONTAINERS'];
$this->_output($resp);
} else {
$this->_error('Something went wrong adding container ' . $cont['CONTAINERID'] . ' to session ' . $auto_session['SESSIONID']);
}
}
}
} | [
"function session_create(){\n start_visitor_counter();\n set_session_name();\n old_sessions_delete();\n session_check();\n}",
"function createSession() {\n $this->needKeyListWrite = true;\n $this->debugLog('new session, will write full key list');\n }",
"public function CreateAssessmentSession();",
"function createController()\n {\n $minimum_buffer_min = 3;\n if ($this->routerService->ds_token_ok($minimum_buffer_min)) {\n $results = $this->worker($this->args);\n if ($results) {\n $results = json_decode((string)$results, true);\n $this->clientService->showDoneTemplate(\n \"Create a form group\",\n \"Create a form group\",\n \"Results of FormGroups::createFormGroup\",\n json_encode(json_encode($results))\n );\n }\n\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }",
"public function create_intervention_session()\n {\n $options['patientId'] = $this->input->post('pId');\n $options['therapistId'] = $this->input->post('tId');\n $options['dateAssigned'] = date(\"Y-m-d\");\n\n $this->InterventionSessionModel->create_intervention_session($options);\n $patient = $this->PatientModel->get_patient_information($options)->result()[0];\n $therapist = $this->TherapistModel->get_therapist_information($options)->result()[0];\n\n $data['patientName'] = $patient->patientFirstName .' '. $patient->patientLastName;\n $data['therapistName'] = $therapist->therapistFirstName .' '. $therapist->therapistLastName;\n $data['date'] = date(\"m/d/Y\");\n\n $this->load->view('session_assigned', $data);\n }",
"public function create() {\n if (!isset($_SESSION)) {\n session_start();\n }\n \n }",
"function _loadContainer() {\n\n // backwards compatibility\n if ($this->siteConfig->getVar('compatibility','2.2.x')) {\n // 2.2.0 functionality: check for useDatabase in sessions section\n if (isset($this->directive['useDatabase']) && $this->directive['useDatabase']) {\n $this->directive['containerType'] = 'database';\n }\n }\n\n // try setup the session container\n SM_loadSessionContainer($this->directive['containerType']);\n\n // instantiate\n $cName = 'SM_sessionContainer_'.$this->directive['containerType'];\n if (!class_exists($cName)) {\n $this->fatalErrorPage(\"could not load requested session container: $cName\");\n }\n $this->sessionContainer = new $cName($this, $this->directive['containerType']);\n\n }",
"function _samples() { \n if (!$this->has_arg('visit')) {\n $this->error('No Visit Specified', 'You must specify a visit number to view this page');\n }\n \n $info = $this->db->pq(\"SELECT s.sessionid, s.beamlinename as bl, TO_CHAR(s.startdate, 'YYYY') as yr FROM ispyb4a_db.blsession s INNER JOIN ispyb4a_db.proposal p ON (p.proposalid = s.proposalid) WHERE p.proposalcode || p.proposalnumber || '-' || s.visit_number LIKE :1\", array($this->arg('visit')));\n \n if (sizeof($info) == 0) {\n $this->error('Visit doesnt exist', 'The selected visit doesnt exist');\n }\n \n $info = $info[0];\n \n $p = array($info['BL'], $this->arg('visit'), 'Sample Allocation');\n $l = array('', '/dc/visit/'.$this->arg('visit'), '');\n $this->template('Container Allocation: ' . $this->arg('visit'), $p, $l);\n $this->t->vis = $this->arg('visit');\n $this->t->bl = $info['BL'];\n $this->t->js_var('bl', $info['BL']);\n $this->t->js_var('visit', $this->arg('visit'));\n \n $this->render('samp');\n }",
"protected function _add_Container() {\n }",
"public function createagentAction()\n {\n $request = $this->_request;\n $act = $request->getParam('act');\n $customerAccountId = $request->getParam('CustomerAccountId');\n $currentUserId = $request->getParam('CustomerUserId');// session plugin set it\n if('create' == $act){\n Streamwide_Web_Log::debug('create agent actual');\n $agentName = $request->getParam('AgentName');\n //$login = $request->getParam('Login');\n $password = $request->getParam('Password');\n $email = $request->getParam('Email');\n $phoneNumber = $request->getParam('PhoneNumber');\n $status = $request->getParam('Status');\n $disponibilityTime = $request->getParam('DisponibilityTime');\n $unlimitedDisponibility = $request->getParam('UnlimitedDisponibility');\n $userParams = array(\n 'Name'=>$agentName,// string The user name\n 'EmailAddress'=>$email,// string The user email address\n 'Password'=>$password,// string The user password\n 'ProfileId'=>self::AGENT_PROFILE_ID,// int The granted profile for agent user\n 'ParentUserId'=> $currentUserId,// int The parent user id\n 'CustomerAccountId'=>$customerAccountId,// int The customer account user belongs to\n 'AgentParameters'=>array(// struct The agent parameter structure [optional]\n 'PhoneNumber' =>$phoneNumber,// string The agent phone number\n 'DisponibilityTime' =>intval($disponibilityTime),// int The disponibility time in seconds\n 'UnlimitedDisponibility'=>(bool)$unlimitedDisponibility,// boolean The flag indicating unlimited disponibility\n )\n );\n $userId = Streamwide_Web_Model::call('User.Create', array($userParams));\n $agentParams = array(\n 'AgentId' => $userId,\n 'IsAvailable' => $status,\n 'IsOnline' => false\n );\n Streamwide_Web_Model::call('AgentGroup.SetAgentOptions', array($agentParams));\n $agentGroupIds = $request->getParam('AffectedGroups');\n $supervisorStatus = $request->getParam('SupervisorStatus');\n if (is_array($agentGroupIds) && is_array($supervisorStatus)) {\n $agentGroupIds = array_unique(array_merge($agentGroupdIds, $supervisorStatus));\n } else if (is_array($supervisorStatus)) {\n $agentGroupIds = $supervisorStatus;\n }\n if (is_array($agentGroupIds) && count($agentGroupIds)) {\n foreach ($agentGroupIds as $agentGroupId) {\n \t\t $params = array($agentGroupId, array($userId));\n $result = Streamwide_Web_Model::call('AgentGroup.AddAgent', $params);\n\n $isSupervisor = in_array($agentGroupId, $supervisorStatus);\n\n if($isSupervisor) {\n Streamwide_Web_Model::call('AgentGroup.SetSupervisor', array($agentGroupId, $userId, $isSupervisor));\n }\n \t}\n }\n\n $this->view->assign('AgentName', $agentName);\n $this->getHelper('viewRenderer')->direct('createagent-ack'); // render ack page\n } else {\n Streamwide_Web_Log::debug('create agent modal window');\n $agentGroupList = Streamwide_Web_Model::call('AgentGroup.GetByCustomer', array($customerAccountId));\n $this->view->assign('AgentGroupList', $agentGroupList);\n }\n }",
"public function actionAddSessionPointerToReview()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['apr_ids_arr'])) {\n $_SESSION['ap_to_review'] = array();\n $arr = $_POST['apr_ids_arr'];\n $i=1;\n foreach ($arr as $arr_item){\n $_SESSION['ap_to_review'][$i]= $arr_item;\n $_SESSION['ap_hard_approve'][$i]= $arr_item;\n $i++;\n }\n\n }\n\n }",
"private function generate_captcha(){\n\t\t$s = $this->session;\n\t\tif($s->contains('captcha') && $s->get('captcha_time') > time() - 1800){\n\t\t\t$s->set('captcha', $s->get('captcha') + 1);\n\t\t\tif($s->get('captcha') > 10) {\n\t\t\t\t$this->data['show_captcha'] = true;\n\t\t\t\t$s->set('require_captcha', true);\n\t\t\t}\n\t\t} else {\n\t\t\t$s->set('captcha', 1);\n\t\t\t$s->set('captcha_time', time());\n\t\t\t$s->wipe('require_captcha');\n\t\t}\n\t}",
"protected function _registerFrontEndClick()\n { // Create a hit id if none present\n if( !$this->_hid /* and APPLICATION_ENVIRONMENT == 'production' */) {\n // Construct the URL\n $url = \"https://affiliate.rbmtracker.com/rd/r.php?pub={$this->_affid}&sid={$this->_cid}&c1={$this->_c1}&c2={$this->_c2}&c3={$this->_c3}\";\n // Mark the click\n $response = file_get_contents($url);\n // Check for permission denied from HitPath\n if( $response == 'The link you have requested is not available, please try your request later.') return;\n // Decode response\n $json = json_decode($response);\n // Check for invalid response\n if( $json === null ) return;\n // Validate the HID\n if( !$json->hid || !is_numeric($json->hid) ) return;\n // Store the HID\n $this->_hid = $json->hid;\n $affData = Yii::app()->session['affData'];\n $affData['hid'] = $this->_hid;\n Yii::app()->session['affData'] = $affData;\n // Log the click\n $this->log('Click registered: '.$this->_hid);\n }\n }",
"public function addcollect(){\n\t\t/*$user_login_status = check_login();\n\t\tif($user_login_status==LOGIN_STATUS_NOLOGIN){\n\t\t\tajax_return(\"请先登录\");exit;\n\t\t}*/\n\n\t\t$deal_id = intval($_REQUEST['activity_id']);\n\t\t$s_user_info = es_session::get(\"user_info\");\n\t\t$user_id = $s_user_info['id'];\n\t\tif(empty($user_id)){\n\t\t\tajax_return(\"请先登录\");exit;\n\t\t}\n\t\t$now_time = NOW_TIME;\n\t\t$type = $_REQUEST['type'] ? $_REQUEST['type'] :'1';//收藏类型 1商品 2拼团 3砍价 4活动 5店铺 6ltv 7酒店 8丽人 9 团购 10购物\n\t\t//收藏前,检查是否已经收藏\n\t\t$is_shou = $GLOBALS['db']->getOne(\"select count(*) from \".DB_PREFIX.\"deal_collect where `id_value` = '$deal_id' and `type` = '$type' and `user_id` = '$user_id'\");\n\t\tif($is_shou){\n\t\t\tajax_return(\"已被收藏\");exit;\n\t\t}\n\t\t$sql = \"insert into \".DB_PREFIX.\"deal_collect(`id_value`,`type`, `user_id`, `create_time`) values ($deal_id,$type,$user_id,$now_time)\";\n\t\t$ret = $GLOBALS['db']->query($sql);\n\t\tif($ret){\n\t\t\tajax_return(\"已被收藏\");exit;\n\t\t}else{\n\t\t\tajax_return(\"收藏失败\");exit;\n\t\t}\n\n\t}",
"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}",
"public function actionAddSessionPointerToApprove()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['apId'])) {\n $apId = trim($_POST['apId']);\n if (Aps::hasStagingAPAccess($apId)) {\n $_SESSION['ap_to_approve'] = $apId;\n }\n }\n }",
"public static function registerUniqueHit()\r\n {\r\n \t// register unique hit\r\n\t\tif (!isset(Yii::app()->session['unique_hit']))\r\n\t\t{\r\n\t\t\tYii::app()->session['unique_hit'] = 1;\r\n\t\t\t\r\n\t\t\t$ip = CHelperLocation::getIPReal();\t\t\t\r\n\t\t \r\n\t\t\t$affid = Yii::app()->session['affid'];\r\n\t\t $sbc = Yii::app()->session['sbc'];\t\t \r\n\t\t $country = (isset($_SERVER['GEOIP_COUNTRY_CODE'])) ? $_SERVER['GEOIP_COUNTRY_CODE'] : \"\";\r\n\t\t \r\n\t\t\t$sql = \"INSERT IGNORE INTO uniq_hits (`date`, `ip`, `affid`, `sbc`, `country`) VALUES (CURDATE(), :ip, :affid, :sbc, :country)\";\r\n Yii::app()->dbSTATS->createCommand($sql)\r\n \t->bindValue(\":ip\", ip2long($ip), PDO::PARAM_STR)\r\n \t->bindValue(\":affid\", $affid, PDO::PARAM_INT)\r\n \t->bindValue(\":sbc\", $sbc, PDO::PARAM_INT)\r\n \t->bindValue(\":country\", $country, PDO::PARAM_STR)\t\r\n \t->execute(); \t\t \r\n\t\t \r\n\t\t $hit_id = Yii::app()->dbSTATS->lastInsertId;\r\n\t\t \r\n\t\t $ref_url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : \"\";\r\n\t\t if ($ref_url)\r\n\t\t {\r\n\t\t \t$sql = \"INSERT IGNORE INTO uniq_refs (id, referer) VALUES (:id, :referer)\";\r\n\t\t Yii::app()->dbSTATS->createCommand($sql)\r\n\t\t \t->bindValue(\":id\", $hit_id, PDO::PARAM_INT)\t\r\n\t\t \t->bindValue(\":referer\", $ref_url, PDO::PARAM_STR)\r\n\t\t \t->execute();\r\n\t\t }\r\n\t\t \r\n\t\t} \r\n }",
"public function createSession() {\n\n $_SESSION['user'] = $this->database->returnArray();\n $_SESSION['il'] = true;\n }",
"public function sessionGate1()\n {\n $this->gate = 1;\n\n $this->update([\n 'url' => $this->requestUrl\n ]);\n\n $user = new Users($this->data['user_id']);\n\n $user->update([\n 'time_last' => Dates::sqlNow(),\n 'ip_last' => $this->userIp\n ]);\n\n $this->uid = $user->id;\n $this->level = $user->level;\n $this->roleId = $user->roleId;\n $this->user = $user->data;\n\n $this->info = !empty($this->data['data']) ? json_decode($this->data['data'], true) : [];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get all mstdataperiode count | function get_all_dataperiode_count()
{
$mstdataperiode = $this->db->query("
SELECT
count(*) as count
FROM
`mstperiode`
")->row_array();
return $mstdataperiode['count'];
} | [
"function get_all_perumahan__spm_count()\n {\n $this->db->from('perumahan__spm');\n return $this->db->count_all_results();\n }",
"function get_all_mstkecamatan_count()\n {\n $mstkecamatan = $this->db->query(\"\n SELECT\n count(*) as count\n\n FROM\n `mstkecamatan`\n \")->row_array();\n\n return $mstkecamatan['count'];\n }",
"public function getStatisticCount();",
"function get_all_mstinfo_count()\n {\n $mstinfo = $this->db->query(\"\n SELECT\n count(*) as count\n\n FROM\n `mstinfo`\n \")->row_array();\n\n return $mstinfo['count'];\n }",
"function get_all_promocion_count()\r\n {\r\n $promocion = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `promocion`\r\n \")->row_array();\r\n\r\n return $promocion['count'];\r\n }",
"public function countStations() {\n\n $this->addField('count(*) as mxm');\n $this->addFrom('stations s');\n $this->runQuery();\n\n $result = $this->getRow(0);\n\n return $result['mxm'];\n\n }",
"function get_all_itenspedidopdv_count()\n {\n $this->db->from('itenspedidopdv');\n return $this->db->count_all_results();\n }",
"function get_all_detalle_serv_count()\r\n {\r\n $detalle_serv = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `detalle_serv`\r\n \")->row_array();\r\n\r\n return $detalle_serv['count'];\r\n }",
"function get_all_disciplinas_count() {\r\n $this->db->from('disciplinas');\r\n return $this->db->count_all_results();\r\n }",
"function get_all_tb_pembagian_desa_count()\n {\n $this->db->from('tb_pembagian_desa');\n return $this->db->count_all_results();\n }",
"function get_all_tema_count()\n {\n $this->db->from('tema');\n return $this->db->count_all_results();\n }",
"public function getTotalCount();",
"function get_all_detalle_venta_count()\r\n {\r\n $detalle_venta = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `detalle_venta`\r\n \")->row_array();\r\n\r\n return $detalle_venta['count'];\r\n }",
"function get_all_storie_count()\n {\n $this->db->from('storie');\n return $this->db->count_all_results();\n }",
"function get_all_marchandises_count()\n {\n $this->db->from('marchandises');\n return $this->db->count_all_results();\n }",
"function get_all_mstlokasipelayanan_count()\n {\n $mstlokasipelayanan = $this->db->query(\"\n SELECT\n count(*) as count\n\n FROM\n `mstlokasipelayanan`\n \")->row_array();\n\n return $mstlokasipelayanan['count'];\n }",
"function get_all_kontrakty_count() {\n $this->db->from('kontrakty');\n return $this->db->count_all_results();\n }",
"static public function countAll() {\n\t\t$mModule=new Maerdo_Model_Module();\n\t\treturn(count($mModule->fetchAll()));\n\t}",
"function get_all_seccion_count()\r\n {\r\n $seccion = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `seccion`\r\n \")->row_array();\r\n\r\n return $seccion['count'];\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. Generated from protobuf field optional string consistency_group_policy_id = 261065057; | public function getConsistencyGroupPolicyId()
{
return isset($this->consistency_group_policy_id) ? $this->consistency_group_policy_id : '';
} | [
"public function setConsistencyGroupPolicyId($var)\n {\n GPBUtil::checkString($var, True);\n $this->consistency_group_policy_id = $var;\n\n return $this;\n }",
"public function getDiskConsistencyGroupPolicy()\n {\n return $this->disk_consistency_group_policy;\n }",
"public function setDiskConsistencyGroupPolicy($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Compute\\V1\\ResourcePolicyDiskConsistencyGroupPolicy::class);\n $this->disk_consistency_group_policy = $var;\n\n return $this;\n }",
"public function getPartitionGroupId()\n {\n return $this->partition_group_id;\n }",
"public function getPartitionGroup()\n {\n return $this->partition_group;\n }",
"public function getGroupingPolicy() : array\n {\n return $this->getNamedGroupingPolicy(Consts::G);\n }",
"function get_group_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_GROUP_ID);\r\n }",
"public function getId_group()\n {\n return $this->id_group;\n }",
"public function get_mailchimp_group_id() {\n $group = $this->get_mailchimp_group();\n if ( is_object( $group ) && isset( $group->id ) ) {\n return $group->id;\n }\n return false;\n }",
"public function getAclGroup()\n {\n return 'U' . $this->getId();\n }",
"public function getGroupID ()\n {\n $this->requirePath();\n\n $group = @filegroup( $this->getPath() );\n\n if ( $group === FALSE ) {\n throw new \\r8\\Exception\\FileSystem(\n $this->getPath(),\n \"Unable to resolve group id\"\n );\n }\n\n return $group;\n }",
"public function getAuthorizationPolicyId()\n {\n return $this->authorization_policy_id;\n }",
"public function getDefinition()\n {\n if (array_key_exists(\"definition\", $this->_propDict)) {\n if (is_a($this->_propDict[\"definition\"], \"\\Beta\\Microsoft\\Graph\\Model\\GroupPolicyDefinition\") || is_null($this->_propDict[\"definition\"])) {\n return $this->_propDict[\"definition\"];\n } else {\n $this->_propDict[\"definition\"] = new GroupPolicyDefinition($this->_propDict[\"definition\"]);\n return $this->_propDict[\"definition\"];\n }\n }\n return null;\n }",
"public function getGroupid()\n {\n return $this->groupid;\n }",
"public function getGroupingId()\n {\n return $this->groupingId;\n }",
"public function get_group_level()\n {\n\n if ($this->is_giving_consent()) {\n\n $consent_level = (int)ct_ultimate_gdpr_get_value('level', $this->get_request_array(), 0);\n\n if ($consent_level) {\n return $consent_level;\n }\n\n }\n\n $cookie_consent_level = $this->get_cookie('consent_level', $this->get_option('cookie_cookies_group_default', 1));\n\n return $cookie_consent_level;\n }",
"final protected function getGroupKey()\n {\n return $this->importer->getPersister()->getConfigLoader()->getContext()->getGroup()->getKey();\n }",
"public function get_group_level() {\n\n if ( $this->is_giving_consent() ) {\n\n $consent_level = (int) ct_ultimate_gdpr_get_value( 'level', $this->get_request_array(), 0 );\n\n if ( $consent_level ) {\n return $consent_level;\n }\n\n }\n\n\n $cookie_consent_level = $this->get_cookie( 'consent_level', $this->get_option( 'cookie_cookies_group_default', $this->get_default_group_level() ) );\n\n if ( $this->user_meta ) {\n $meta_consent_level = ct_ultimate_gdpr_get_value( 'consent_level', $this->user_meta );\n }\n\n return ! empty( $meta_consent_level ) ? $meta_consent_level : $cookie_consent_level;\n }",
"public function getStorageGroup()\n {\n return $this->get('storagegroup');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Equipment manage prefix /api/equipments | public function postRegistry(Request $request){
$res = $this->filter($request,[
'campus'=>'required|filled',
'campus_chinese'=>'required|filled',
'type'=>'required|filled',
'gym'=>'required|filled',
'equipment_name'=>'required|filled',
'buy_date'=>'required|filled|date_format:"Y-m-d',
'buy_number'=>'required|filled',
'price'=>'required|filled',
'remark'=>'required|filled|string|max:255'
]);
/* administor api_token checked*/
if(!$this->check_token($request->input('api_token'))){
return $this->stdResponse('-3');
}
if($this->user_equipment != 2){
return $this->stdResponse('-6');
}
if(!$res){
return $this->stdResponse('-1');
}
$arr = $request->except('api_token');
$arr['u_id'] = $this->user_id;
try{
$res = Equipment::create($arr);
return $res? $this->stdResponse('1') : $this->stdResponse('-4');
}catch (\Exception $exception){
return $this->stdResponse('-4');
}
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $equipments = $em->getRepository('AppBundle:Equipment')->findBy([], ['order' => 'ASC']);\n\n $deleteForms = array();\n foreach ($equipments as $equipment) {\n $deleteForms[$equipment->getId()] = $this->createDeleteForm($equipment)->createView();\n }\n\n return $this->render(\n 'admin/equipment/index.html.twig',\n array(\n 'equipments' => $equipments,\n 'deleteForms' => $deleteForms,\n )\n );\n }",
"public function setEquipment($equipment) {\n $this->equipment = NULL;\n $this->equipment_id = array();\n\n foreach ($equipment as $equip) {\n if ($equip instanceof EquipmentApi) {\n $this->equipment_id[] = $equip->getId();\n }\n else {\n if (is_int($equip)) {\n $this->equipment_id[] = $equip;\n }\n }\n }\n\n $this->toSave['equipment.id'] = implode(';', $this->equipment_id);\n }",
"public function setEquipment($equipment) {\n $this->equipment = $equipment;\n }",
"public function getEquipment($id)\n {\n return self::getResource('/equipment/' . $id);\n }",
"public static function api_register_data() {\n\t\tif ( function_exists( 'register_rest_field' ) ) { // Prevent issue with Jetpack.\n\t\t\tregister_rest_field( 'wprm_equipment', 'equipment', array(\n\t\t\t\t'get_callback' => array( __CLASS__, 'api_get_equipment_meta' ),\n\t\t\t\t'update_callback' => array( __CLASS__, 'api_update_equipment_meta' ),\n\t\t\t\t'schema' => null,\n\t\t\t));\n\t\t}\n\t}",
"public function testModifyEquipment(): void\n {\n $ec = new EquipmentController();\n\n $ec->loadEquipmentFromDDB(\"XX001\");\n\n $ec->modifyEquipment(\"XX001\", \"TypeTest1\", \"NameTest1\", \"BrandTest1\", \"VersionTest1\", 1);\n\n $ec->loadEquipmentFromDDB(\"XX001\");\n\n $equipment = $ec->getEquipment();\n\n $this->assertEquals($equipment->getRefEquip(), \"XX001\");\n $this->assertEquals($equipment->getBrandEquip(), \"BrandTest1\");\n $this->assertEquals($equipment->getVersionEquip(), \"VersionTest1\");\n $this->assertEquals($equipment->getTypeEquip(), \"TypeTest1\");\n $this->assertEquals($equipment->getNameEquip(), \"NameTest1\");\n\n }",
"public function getProductAction();",
"public function actionNew()\n {\n $equipments = array();\n $equipment_count = 0;\n $flats = Flat::find()\n ->select('*')\n ->all();\n foreach ($flats as $flat) {\n $equipment = Equipment::find()\n ->select('*')\n ->where(['flatUuid' => $flat['uuid']])\n ->one();\n if ($equipment == null) {\n $equipment = new Equipment();\n $equipment->uuid = MainFunctions::GUID();\n $equipment->houseUuid = $flat['house']->uuid;\n $equipment->flatUuid = $flat['uuid'];\n $equipment->equipmentTypeUuid = EquipmentType::EQUIPMENT_HVS;\n $equipment->equipmentStatusUuid = EquipmentStatus::UNKNOWN;\n $equipment->serial = '222222';\n $equipment->testDate = date('Y-m-d H:i:s');\n $equipment->changedAt = date('Y-m-d H:i:s');\n $equipment->createdAt = date('Y-m-d H:i:s');\n $equipment->save();\n $equipments[$equipment_count] = $equipment;\n $equipment_count++;\n } else {\n if ($equipment['equipmentTypeUuid'] != EquipmentType::EQUIPMENT_HVS) {\n $equipment['equipmentTypeUuid'] = EquipmentType::EQUIPMENT_HVS;\n $equipment['changedAt'] = date('Y-m-d H:i:s');\n $equipment->save();\n echo $equipment['uuid'] . '<br/>';\n }\n }\n }\n //return $this->render('new', ['equipments' => $equipments]);\n }",
"public function add()\n {\n $insert = [\n 'manufacturer_id' => $this->input->post('manufacturer_id'),\n 'equipment_type_id' => $this->input->post('equipment_type_id'),\n 'equipment_model' => $this->input->post('equipment_model')\n ];\n\n $this->Equipment_Model->addEquipment($insert);\n redirect('/equipment', 'refresh');\n }",
"public function partner_owned_equipment_add()\n {\n $postData = Request::all();\n $partner = Partner::find(Auth::user()->id);\n\n $status = DB::table('partner_owned_equepment')->insert(\n [\n 'partner_id' => $partner->id,\n 'owned_equipment' => $postData['owned_equipment'],\n ]\n );\n return response()->json(\n [\n 'data' => $postData['owned_equipment'],\n 'status' => $status\n ]\n );\n }",
"public function departments(){\n\t\tif($this->method == 'GET'){\n\t\t\tif(isset($this->request['id'])){ // get a specific department based on id\n\t\t\t\t$this->response['data'] = getDepartment($this->request['id']);\n\t\t\t}else if(isset($this->request['search'])){\n\t\t\t\t$this->response['data'] = searchDepartments($this->request['search']);\n\t\t\t}else{ // get all departments\n\t\t\t\t$this->response['data'] = getDepartments();\n\t\t\t}\t\n\t\t} else if($this->method == 'POST'){\n\t\t\tif(isset($this->request['short']) && isset($this->request['long'])){\n\t\t\t\tif(isset($this->request['id'])){// an id was provided -> update\n\t\t\t\t\t$this->response['data'] = updateDepartment($this->request['id'],$this->request['short'], $this->request['long']);\n\t\t\t\t}else{\t// an id was not provided -> insert\n\t\t\t\t\t$this->response['data'] = insertDepartment($this->request['id'], $this->request['short'], $this->request['long']);\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\t$this->response['message'] = \"endpoint requires parameters. Update(id, short, long) || Insert (short, long)\";\n\t\t\t\t$this->response['code'] = 400;\n\t\t\t}\n\t\t}else if($this->method == 'DELETE'){\n\t\t\t\tif(isset($this->request['id'])){\n\t\t\t\t\t$this->response['data'] = deleteDepartment($this->request['id']);\n\t\t\t\t}else{\n\t\t\t\t\t$this->response['message'] = \"endpoint requires parametes. Delete(id)\";\n\t\t\t\t\t$this->response['code'] = 400;\n\t\t\t\t}\n\t\t}else {\n\t\t\t$this->response['message'] = \"endpoint does not recognize \" . $this->method . \" request\";\n\t\t\t$this->response['code'] = 405;\n\t\t}\n\t\treturn $this->response;\t\n\t}",
"function torneo_equipo(){\n $this->_viewOutPut('torneo_equipoCrud');\n }",
"public function equipment()\n {\n $equipment = Equipment::where('status', 1)->orderBy('name')->get();\n\n return view('manage/report/equipment', compact('equipment'));\n }",
"public function manufactureAction() {\n if($this->_getParam('id',false)) {\n $this->view->manufactures = $this->getManufactures()\n ->getManufactureDetails($this->_getParam('id'));\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }",
"public function test_mostrar_todos_los_equipos()\n {\n //Desabilitando las exceptions para tener mas detalles de los errores que puedan ocurrir.\n $this->withoutExceptionHandling();\n\n //Se traen todos los equipos en la base de datos.\n $equipos = Equipos::all()->toArray();\n\n //Se hace un request al route que muestra todos los equipos y se le envia un arreglo con los equipos para que sean renderizados\n $this->get(route('equipos.index', 'equipos'))\n ->assertStatus(200); //Se espera un status response 200 por parte del server si los parametros de la ruta y los datos enviados son correctos.\n\n \n }",
"public function postCalibrationEquipments() {\n\t\t\n\t\t$equipment_id = Input::get('equipment_id');\n\t\t$validator = Validator::make(Input::all(), array('equipment_id'=>\"required|integer|min:1\"));\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn \"Validator fails\";\n\t\t} else {\n\n\t\t\t$calibration = new Calibration;\n\t\t\t$calibration->equipment_id = $equipment_id;\n\t\t\tif (Input::get('before_inspection')) $calibration->before_inspection = Input::get('before_inspection');\n\t\t\tif (Input::get('after_inspection')) $calibration->after_inspection = Input::get('after_inspection');\n\n\t\t\tif (Cache::has('calibrations')) {\n\t\t\t\t$calibrations = Cache::get('calibrations');\n\t\t\t} else $calibrations = array();\n\t\t\t$calibrations[] = $calibration;\n\t\t\tCache::put('calibrations', $calibrations, 720);\n\n\t\t\treturn View::make('Quality_Control_View.calibration_equipments');\n\n\t\t}\n\t}",
"public function getEquipment()\n {\n return $this->equipment;\n }",
"public function productsAction()\r\n {\r\n \r\n }",
"public function equipment() {\n\t\t$equipment_array = self::unserialize( $this->meta( 'wprm_equipment', array() ) );\n\t\t$terms = $this->tags( 'equipment' );\n\n\t\t$uid = 0;\n\t\tforeach ( $equipment_array as $index => $equipment ) {\n\t\t\t$equipment_array[ $index ]['uid'] = $uid;\n\t\t\t$uid++;\n\n\t\t\t$term_key = array_search( intval( $equipment['id'] ), wp_list_pluck( $terms, 'term_id' ) );\n\t\t\t\n\t\t\tif ( false !== $term_key ) {\n\t\t\t\t$term = $terms[ $term_key ];\n\t\t\t\t$equipment_array[ $index ]['name'] = $term->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $equipment_array;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set all tags. This will overwrite all/any tags that are already set. $obj>setAllTags( array( 'key' => 'value', 'key2', 'value2', ) ); | public function setAllTags(array $tags = []): Services_OpenStreetMap_Object
{
$this->tags = $tags;
return $this;
} | [
"public function setTags(array $tags): void\n {\n $this->tags = $tags;\n }",
"public function setAll(array $kvMap)\n {\n $this->elements = array_merge($this->elements, $kvMap);\n }",
"function set_tags($tags) {\n $this->tags = $tags;\n }",
"public function testAllTags()\n {\n $tags = TestModel::allTags();\n\n $this->assertArrayValuesAreEqual(['Apple', 'Banana', 'Cherry'], $tags);\n }",
"private static function fillTagArrayWithDefaultValues() {\n foreach (TagController::$defaultTags as $default) {\n TagController::saveTagInDb($default);\n }\n }",
"public function tagAll() {\n preg_match_all(\"#{{([^}]+?)}}#\", $this->_html, $tags);\n if(count($tags[1])) {\n foreach ($tags[1] as $tag) {\n if($this->getData($tag))\n $this->_html = str_replace('{{' . $tag . '}}', $this->getData($tag), $this->_html);\n }\n }\n }",
"public function setTags($tags) {\n $this->tags = $tags;\n }",
"public function setTags($tags) {\n\t\t$this->tags = $tags;\n\t}",
"private function getAllTags() {\n\n foreach ($this->xmlfile->{'policy-tag-list'}->children() as $tag) {\n $this->allTags[$tag->name->__toString()] = new WatchGuardTag($tag);\n }\n\n }",
"public function handleTagsAll()\n {\n $tags = $this->request->post['tags'];\n if (!$tags) {\n return;\n }\n\n $photos = isset($this->request->post['photos']) ? $this->request->post['photos'] : [];\n if (!$photos) {\n\t\t\t$photos = $this->photos;\n\t\t}\n /** @var Tag[] $tags */\n $tags = $this->TR->findByIds($tags);\n /** @var Photo[] $photos */\n $photos = $this->PR->findByIds($photos);\n foreach ($photos as $photo) {\n foreach ($tags as $tag) {\n if (!in_array($tag, $photo->tags, TRUE)) {\n $photo->addToTags($tag);\n }\n if ($tag->teamInfo) {\n $this->CM->cleanByEntity($tag->teamInfo->team);\n }\n }\n $this->PR->persist($photo);\n }\n $this->redrawControl('photos-list');\n }",
"public function setAll($data)\n {\n foreach ($this->data as $key => $value)\n {\n if (isset($data[$key]))\n {\n $this->data[$key] = $data[$key];\n }\n else\n {\n $this->data[$key] = null;\n }\n }\n }",
"public function setTagsAvailable()\n\t{\n\t\t$tags = Tags::all(['id', 'tag_text', 'filter_text']);\n\t\tforeach ($tags as $tag) {\n\t\t\t$this->tagsAvailable[] = $tag->toArray();\n\t\t}\n\t}",
"public function setAllItems($allItems) {\n $this->allItems = $allItems;\n }",
"protected function setContentTagsFromArray(array $tags)\n\t{\n\t\tcall_user_func_array(array($this, 'setContentTags'), $tags);\n\t}",
"public function resetAllowTags(): void\n\t{\n\t\t$this->allowTags = [];\n\t}",
"function setEventTags($tags = [])\n {\n $this->field_event_tag[$this->language] = $tags;\n }",
"public function clearTags()\n {\n $this->tags = [];\n }",
"public function removeAllTags() {\n\t\t$this->tags = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}",
"protected function _loadAllTagsInUse() {\n\n $this->_tags = $this->_blogClient->getAllTagsInUse();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Retrieves a list of active bloggers that contributed in this category. | public function getActiveBloggers()
{
$db = EasyBlogHelper::db();
$query = 'SELECT DISTINCT(`created_by`) FROM ' . EasyBlogHelper::getHelper( 'SQL' )->nameQuote( '#__easyblog_post' ) . ' '
. 'WHERE ' . EasyBlogHelper::getHelper( 'SQL' )->nameQuote( 'category_id' ) . '=' . $db->Quote( $this->id );
$db->setQuery( $query );
$rows = $db->loadObjectList();
if( !$rows )
{
return false;
}
$bloggers = array();
foreach( $rows as $row )
{
$profile = EasyBlogHelper::getTable( 'Profile' , 'Table' );
$profile->load( $row->created_by );
$bloggers[] = $profile;
}
return $bloggers;
} | [
"private function getCategories()\n\t{\n\t\t$blogCategories = BlogCategory::where('status', '=', 1)->whereHas('blogPosts', function($query)\n\t\t{\n\t\t\t$query->active();\n\t\t})->get();\n\n\t\treturn $blogCategories;\n\t}",
"public function blogs()\n {\n return $this->morphedByMany(App\\Blog::class, 'taggable');\n }",
"public function get_blog_ids()\n\t{\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col( 'SELECT blog_id FROM '.$wpdb->blogs );\n\t}",
"public function likers()\n {\n $users = User::join('likes', 'users.id', '=', 'likes.user_id')\n ->where('likes.object_type', 'blog')\n ->where('likes.object_id', $this->id)\n ->get();\n\n return $users;\n }",
"private static function get_blog_ids() {\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT blog_id FROM $wpdb->blogs WHERE archived = '0' AND spam = '0' AND deleted = '0'\";\n\t\treturn $wpdb->get_col( $sql );\n\t}",
"private static function get_blog_ids() {\n\n\t\tglobal $wpdb;\n\n\t\t// get an array of blog ids\n\t\t$sql = \"SELECT blog_id FROM $wpdb->blogs\n\t\t\tWHERE archived = '0' AND spam = '0'\n\t\t\tAND deleted = '0'\";\n\n\t\treturn $wpdb->get_col( $sql );\n\n\t}",
"function allBloggers() {\r\n $select = 'SELECT username, profile_image, bio FROM bloggers';\r\n $results = $this->_pdo->query($select);\r\n \r\n $resultsArray = array();\r\n \r\n //map each blogger to a row of data for that blogger\r\n while ($row = $results->fetch(PDO::FETCH_ASSOC)) {\r\n $resultsArray[$row['username']] = $row;\r\n }\r\n \r\n return $resultsArray;\r\n \r\n }",
"public function blogs()\n {\n return $this->hasMany(Blogs::class, 'category_id');\n }",
"private static function get_blog_ids() {\n\t\t\tglobal $wpdb;\n\n\t\t\t// Get an array of IDs.\n\t\t\t$sql = \"SELECT blog_id FROM $wpdb->blogs\n WHERE archived = '0' AND spam = '0'\n AND deleted = '0'\";\n\n\t\t\t// TODO: Cache, per WPSC guidelines.\n\t\t\treturn $wpdb->get_col( $sql );\n\t\t}",
"public static function get_blog_ids() {\n // get an array of blog ids\n global $wpdb;\n $table_name = $wpdb->prefix . 'blogs';\n $sql = \"SELECT blog_id FROM $table_name\n\t\t\tWHERE archived = '0' AND spam = '0'\n\t\t\tAND deleted = '0'\";\n return $wpdb->get_col($sql);\n }",
"function get_blog_ids_of_user_blogs($current_user) {\n\t$user_blogs = [];\n\t$user_blog_objects = get_blogs_of_user($current_user->ID);\n\tforeach ($user_blog_objects as $blog) {\n\t\t$user_blogs[] = $blog->userblog_id;\n\t}\n\treturn $user_blogs;\n}",
"public function getBlogTags() {\n\t\treturn $this->DB->query(\"SELECT * FROM `blog_tags` ORDER BY `name` ASC;\");\t\t\n\t}",
"public function getBlogCategories0()\n {\n return $this->hasMany(BlogCategory::className(), ['updatedBy' => 'id']);\n }",
"function get_active_blog_for_user($user_id)\n{\n}",
"protected function findAllBlogIds()\n\t{\n\t\tif (!is_multisite()) {\n\t\t\treturn array(array('blog_id' => get_current_blog_id()));\n\t\t}\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->get_results(\"SELECT blog_id FROM {$wpdb->blogs}\", ARRAY_A);\n\t}",
"function get_active_blog_for_user($user_id)\n {\n }",
"public static function getCategories() {\n return Blog::category()->orderBy('name')->all();\n }",
"public function getBlogCountByUser () {\n return $this->createQueryBuilder('b')\n ->select(\"a.username AS x, COUNT(b.id) AS y\")\n ->innerJoin(\"b.author\", \"a\")\n ->groupBy(\"a.id\")\n ->getQuery()\n ->getResult()\n\n ;\n }",
"public function getAllBlogs()\n {\n return $this->getData(\"\n SELECT blogs.id, blogs.title, blogs.decoration, blogs.text, blogs.Image, blogs.timestamp, blogs.approved, login.username\n FROM `blogs`\n INNER JOIN login on login.id = blogs.user_id\n \");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets event is cancelable | public function setCancelable($cancelable); | [
"public function isCancelable();",
"public function isCancelable(): bool;",
"public function set_oncancel($value)\r\n\t{\r\n\t\treturn $this->set_attr('oncancel', $value);\r\n\t}",
"public function cancel_event_request() {\n\t\t$this->event_details(TRUE);\n\t}",
"public function canceled();",
"public function isCancelled();",
"protected function cancel_abort() {\n\t\t$this->abort = false;\n\t}",
"public function cancel(){}",
"public function canceled()\n {\n }",
"public function cancelar()\n\t{\n\t\t$this->estatus = CitaEstatus::CANCELADA;\n\t}",
"abstract public function stopPropagation();",
"public static function on_buttonCancel_Clicked(&$sender, &$eventArgs)\n {\n }",
"function MouseClickCancelled($item){}",
"public function disableEvent()\n {\n $this->event = false;\n }",
"public function cancel() {}",
"public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}",
"public function stopPropagation();",
"public function unsetCancelReason(): void\n {\n $this->cancelReason = [];\n }",
"protected function setInvoiceCancelled(): bool\n {\n return parent::setInvoiceCancelled();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the PHPCR session and connection. | static public function setApplicationPHPCRSession(Application $application, $sessionName)
{
/** @var $registry ManagerRegistry */
$registry = $application->getKernel()->getContainer()->get('doctrine_phpcr');
$session = $registry->getConnection($sessionName);
$helperSet = $application->getHelperSet();
if (class_exists('Doctrine\ODM\PHPCR\Version')) {
$helperSet->set(new DocumentManagerHelper($session));
} else {
$helperSet->set(new PhpcrHelper($session));
}
if ($session instanceof JackalopeSession
&& ($session->getTransport() instanceof DbalClient
|| $session->getTransport() instanceof DbalLoggingClient
)
) {
$helperSet->set(new DoctrineDBALHelper($session->getTransport()->getConnection()));
}
} | [
"public function setConnection();",
"public function setConnection(): void\n {\n $currentSession = array(\n 'connection' => true,\n 'user_id' => $this->id,\n 'user_email' => $this->email_address,\n 'user_name' => $this->public_name,\n 'user_role' => $this->role\n );\n $userPosts = $this->getUserPosts(); \n $currentSession['user_posts'] = ($userPosts) ? $userPosts : array();\n\n foreach ($currentSession as $key => $value)\n {\n $_SESSION[$key] = $value;\n }\n }",
"function setSession()\n {\n\t\tsession_start();\n\n $key = session_id().'_'.$_SERVER['REMOTE_ADDR'];\n\n\t\t$this->session = new Session($key);\n }",
"public function __setSession(SessionInterface $session);",
"public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }",
"private function setSession()\n {\n try\n {\n # Get the Populator object and set it to a local variable.\n $populator=$this->getPopulator();\n # Get the User object and set it to a local variable.\n $user_obj=$populator->getUserObject();\n\n # Set the form URL's to a variable.\n $form_url=$populator->getFormURL();\n # Set the current URL to a variable.\n $current_url=FormPopulator::getCurrentURL();\n # Check if the current URL is already in the form_url array. If not, add the current URL to the form_url array.\n if(!in_array($current_url, $form_url)) $form_url[]=$current_url;\n\n # Create a session that holds all the POST data (it will be destroyed if it is not needed.)\n $_SESSION['form']['password']=\n array(\n 'EmailPassword'=>$populator->getEmailPassword(),\n 'FormURL'=>$form_url\n );\n }\n catch(Exception $e)\n {\n throw $e;\n }\n }",
"public function set() {\n\n\t\tself::$instance = $this;\n\t\t$this->base \t= OMAPI::get_instance();\n\n\t}",
"public function connect()\n\t{\n\t\t$this->realm->getCharacters()->connect();\n\t\t$this->connection = $this->realm->getCharacters()->getConnection();\n\t}",
"public function getPhpcrSession(): SessionInterface;",
"public function startSession() {}",
"public function connect()\n {\n $this->realm->getCharacters()->connect();\n $this->connection = $this->realm->getCharacters()->getConnection();\n }",
"protected function setSession()\n {\n $_SESSION[$this->session_key] = $this->token;\n }",
"public function update()\n {\n\t\tEnvitor::set('SESSION_DRIVER', $this->driver);\n\t\tEnvitor::set('SESSION_CONNECTION', $this->connection);\n\t\tEnvitor::set('SESSION_LIFETIME', (int) $this->lifetime);\n\t\tEnvitor::set('SESSION_EXPIRE_ON_CLOSE', var_export((bool) (int) $this->expire_on_close, true));\n\t\tEnvitor::set('SESSION_ENCRYPT', var_export((bool) (int) $this->encrypt, true));\n\t\tEnvitor::set('SESSION_COOKIE', $this->cookie);\n }",
"protected function SetSessionFields() {\r\n\r\n if ((count($this->piVars) && !$this->piVarsReloaded) || $this->forceSetSessionFields) {\r\n $this->SetSessionField_tablename();\r\n $this->SetSessionField_fieldName();\r\n $this->SetSessionField_addWhere();\r\n $this->SetSessionField_search();\r\n $this->SetSessionField_searchOrder(); \r\n $this->SetSessionField_pidList();\r\n $this->SetSessionField_enableFields();\r\n \r\n // Sets the filterSelected with the current extension\r\n if ($this->setFilterSelected) {\r\n $this->sessionFilterSelected = $this->extKeyWithId; \r\n } \r\n \r\n // Adds the piVars\r\n $this->sessionFilter[$this->extKeyWithId]['piVars'] = $this->piVars; \r\n\r\n // Adds setter \r\n foreach($this->setterList as $setter) {\r\n if (method_exists($this, $setter)) {\r\n $this->$setter();\r\n }\r\n } \r\n }\r\n \r\n // Sets session data\r\n $GLOBALS['TSFE']->fe_user->setKey('ses', 'filters', $this->sessionFilter);\r\n $GLOBALS['TSFE']->fe_user->setKey('ses', 'selectedFilterKey', $this->sessionFilterSelected);\r\n $GLOBALS['TSFE']->fe_user->setKey('ses', 'auth', $this->sessionAuth);\r\n $GLOBALS['TSFE']->storeSessionData(); \r\n }",
"public function startSession()\n {\n }",
"public function initSession()\n {\n }",
"protected function initializeSession() {}",
"private function setContext()\n {\n $this->context = Processor::getStageDetail('context');\n\n if (array_key_exists($this->context, $this->session) === false) {\n $this->session[$this->context] = [];\n }\n\n $this->session = &$this->session[$this->context];\n }",
"protected function sessionStart() { }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A list with valid pix created to validate CRC. Provider to isCRCValid() method. Please, add here only pix code generated by bank applications. | public function dataCRC () : array
{
$pix = [];
// Try to reproduce the codes with StaticPayload
// BANCO INTER (SEM TID)
$pix[] = [
'00020101021126860014br.gov.bcb.pix0136285fb964-0087-4a94-851a-5a161ed8888a0224Solicitacao de pagamento52040000530398654041.015802BR5913STUDIO PIGGLY6007Uberaba62070503***63044EED',
];
// BANCO INTER (COM TID)
$pix[] = [
'00020101021126790014br.gov.bcb.pix0136285fb964-0087-4a94-851a-5a161ed8888a0217DC ACENTUACAO 00152040000530398654041.025802BR5913STUDIO PIGGLY6007Uberaba62090505TX10263040665',
];
// NUBANK (SEM TID)
$pix[] = [
'00020126580014BR.GOV.BCB.PIX0136aae2196f-5f93-46e4-89e6-73bf4138427b52040000530398654041.015802BR5922Caique Monteiro Araujo6009SAO PAULO61080540900062070503***630456D6',
];
// NUBANK (COM TID)
$pix[] = [
'00020126580014BR.GOV.BCB.PIX0136aae2196f-5f93-46e4-89e6-73bf4138427b52040000530398654041.025802BR5922Caique Monteiro Araujo6009SAO PAULO61080540900062090505TX1026304F4DB'
];
return $pix;
} | [
"private function getValidColors()\n {\n return [\n 'rgb(0,0,0)', 'rgb(0, 0, 0)', 'rgb( 0, 0, 0)', 'rgb( 0 , 0 , 0 )', 'rgb(0 , 0 , 0)',\n 'rgb( 0 , 0 , 0 )', 'rgb(255,255,255)', 'rgb(255, 255, 255)', 'rgb( 255, 255, 255)',\n 'rgb( 255 , 255 , 255 )', 'rgb(255 , 255 , 255)', 'rgb( 255 , 255 , 255 )',\n ];\n }",
"private function getValidColors()\n {\n return [\n 'rgba(0,0,0,0)', 'rgba(0, 0, 0, 0)', 'rgba( 0, 0, 0, 0)', 'rgba( 0 , 0 , 0, 0 )', 'rgba(0 , 0 , 0, 1)',\n 'rgba( 0 , 0 , 0 , 1 )', 'rgba(0,0,0,0.1)', 'rgba(255,255,255,1)', 'rgba(255, 255, 255, 0)',\n 'rgba( 255, 255, 255, 1)', 'rgba( 255 , 255 , 255 , 0 )', 'rgba(255 , 255 , 255, 0)',\n 'rgba( 255 , 255 , 255 , 1 )', 'rgba(255,255,255,0.2)',\n ];\n }",
"private function checkForImage(array $cryptoList){\n\n $number = count($cryptoList);\n for($i=0;$i< $number;$i++){\n\n if(!file_exists('assets/img/icons/'.$cryptoList[$i].'.png')){\n unset($cryptoList[$i]);\n }\n }\n return array_values($cryptoList);\n }",
"private function getValidColors()\n {\n return [\n 'hsl(0, 0%, 0%)', 'hsl(359, 0%, 0%)', 'hsl(0, 100%, 0%)', 'hsl(359, 100%, 0%)', 'hsl(0, 0%, 100%)',\n 'hsl(359, 0%, 100%)', 'hsl(0, 100%, 100%)', 'hsl(359, 100%, 100%)', 'hsl(0, 100%, 100%)',\n 'hsl(120, 100%, 100%)', 'hsl(240, 100%, 100%)',\n ];\n }",
"private function getInvalidColors()\n {\n return [\n 'rgba(256,0,0,1)', 'rgba(0,256,0,0)', 'rgba(0,0,256,1)', 'rgba(256, 0, 0, 0)', 'rgba(0, 256, 0, 1)',\n 'rgba(0, 0, 256, 0)', 'rgba( 256 , 0 , 0 , 1)', 'rgba( 0 , 256 , 0 , 0)', 'rgba( 0 , 0 , 256 , 1)',\n 'rgba(256,256,0,0)', 'rgba(256,0,256,1)', 'rgba(0,256,256,0)', 'rgba(256, 256, 0, 0.1)',\n 'rgba(256, 0, 256, 0.2)', 'rgba(0, 256, 256, 0.3)', 'rgba( 256 , 256 , 0 , 0.4)',\n 'rgba( 256 , 0 , 256 , 0.5)', 'rgba( 0 , 256 , 256 , 0.6)',\n ];\n }",
"private function getInvalidColors()\n {\n return [\n 'rgb(256,0,0)', 'rgb(0,256,0)', 'rgb(0,0,256)', 'rgb(256, 0, 0)', 'rgb(0, 256, 0)', 'rgb(0, 0, 256)',\n 'rgb( 256 , 0 , 0 )', 'rgb( 0 , 256 , 0 )', 'rgb( 0 , 0 , 256 )', 'rgb(256,256,0)', 'rgb(256,0,256)',\n 'rgb(0,256,256)', 'rgb(256, 256, 0)', 'rgb(256, 0, 256)', 'rgb(0, 256, 256)', 'rgb( 256 , 256 , 0 )',\n 'rgb( 256 , 0 , 256 )', 'rgb( 0 , 256 , 256 )',\n ];\n }",
"protected function getValidResources(): array {\n return [];\n }",
"public static function validateColor()\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 7),\n\t\t];\n\t}",
"static public function valid_icon_sizes()\n\t{\n\t\treturn self::$_valid_icon_sizes;\n\t}",
"public function getInvalidCreditCardNumberChecksums()\n {\n return [\n ['4532815084485001'],\n ['5162235100375991'],\n ['6011796537313831'],\n ['373297793578667'],\n ];\n }",
"public function providerInvalidColorTemp()\n {\n return array(\n array(\n 152\n ),\n array(\n 550\n ),\n array(\n - 130\n )\n );\n }",
"public function supports256Colors(): bool;",
"public static function validateColor()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 10),\n\t\t);\n\t}",
"public function invalidComplemento()\n {\n return [\n [str_random(192)]\n ];\n }",
"public function getValidImageTypes()\n {\n return $this->valid_image_types;\n }",
"public function getPixelFormats();",
"public function websafe(){\n $palette = array();\n for ($red = 0; $red <= 255; $red += 51) {\n for ($green = 0; $green <= 255; $green += 51) {\n for ($blue = 0; $blue <= 255; $blue += 51) {\n $palette[] = new RGB($red, $green, $blue);\n }\n }\n }\n return $this->match($palette);\n }",
"public static function validateBarcode()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 100),\n\t\t);\n\t}",
"public function getIconList() {\n if (!empty($this->iconList)) {\n return $this->iconList;\n }\n\n if (file_exists($this->iconsPath)) {\n $file = file_get_contents($this->iconsPath);\n preg_match_all('/id=\"([a-z]|-)*\"/', $file, $matches);\n foreach ($matches[0] as $id) {\n preg_match('/(?<=\")[^\"]+(?=\")/', $id, $match);\n $name = $match[0];\n $this->iconList[$name] = $name;\n }\n }\n else {\n $this->iconList = [];\n }\n\n return $this->iconList;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete object in database. Only delete target groups without parent target group id, because children are fake target groups. In fact children are category objects, thus they cannot be deleted as target group objects. | public function delete()
{
// Do not delete children, because they are fake objects
if (false === $this->parent_target_group && $this->target_group_id > 0) {
$result = rex_sql::factory();
$query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_target_groups '
.'WHERE target_group_id = '. $this->target_group_id;
$result->setQuery($query);
$return = ($result->hasError() ? false : true);
$query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups '
.'WHERE target_group_id = '. $this->target_group_id;
$result->setQuery($query);
// reset priorities
$this->setPriority(true);
// Don't forget to regenerate URL cache
d2u_addon_backend_helper::generateUrlCache('target_group_id');
d2u_addon_backend_helper::generateUrlCache('target_group_child_id');
return $return;
}
return false;
} | [
"public function delete() {\r\n\r\n // Does the Group object have an ID?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::delete(): Attempt to delete a Group object that does not have it's ID property set.\", E_USER_ERROR );\r\n\r\n // Delete the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $st = $conn->prepare ( \"DELETE FROM \" . DB_PREFIX . \"groups WHERE id = :id LIMIT 1\" );\r\n \r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n }",
"public function delete( $o)\n\t{\n\t\t//Delete the data by primary key\n\t\tparent::delete( $o->IdProcessGroup);\n\t\n\t}",
"public function deleteGroups($obj)\n\t{\n\t\t$obj->groups()->detach();\n\t}",
"function delete() {\n\t\t$groupID = Convert::raw2sql($_REQUEST['ctf']['ID']);\n\t\t$memberID = Convert::raw2sql($_REQUEST['ctf']['childID']);\n\t\tif(is_numeric($groupID) && is_numeric($memberID)) {\n\t\t\t$member = DataObject::get_by_id('Member', $memberID);\n\t\t\t$member->Groups()->remove($groupID);\n\t\t} else {\n\t\t\tuser_error(\"MemberTableField::delete: Bad parameters: Group=$groupID, Member=$memberID\", E_USER_ERROR);\n\t\t}\n\n\t\treturn FormResponse::respond();\n\n\t}",
"public function deleteFromGroup()\n {\n $this->rbacRepository->deleteRbacModel(Request::get('id'), Permission::class);\n }",
"public function deleteTargetGroup($id) {\n $response = $this->doRequest('DELETE', 'target-groups/group/' . $id);\n return $response;\n }",
"function del_group($group_id, $reparent_children = TRUE)\n {\n\n if (!$group_id)\n return;\n // Primero, obtenemos informacion del grupo:\n $groupInfo = $this->conn->select(\"SELECT * FROM _permission_groups WHERE id=$group_id\");\n\n if (!$groupInfo || count($groupInfo) == 0)\n throw new AclException(AclException::ERR_GROUP_DOESNT_EXIST);\n\n if (!$groupInfo[0][\"group_parent\"])\n $reparent_children = FALSE;\n\n if ($reparent_children)\n {\n // Se mueven todos los hijos de este grupo, al padre.\n $this->conn->update(\"UPDATE _permission_groups SET group_parent=\" . $groupInfo[0][\"group_parent\"] . \" WHERE group_parent=$group_id\");\n }\n else\n {\n\n $path = \"%,$group_id,%\";\n\n $groupsToDelete = array();\n $this->conn->selectCallback(\"SELECT id FROM _permission_groups WHERE group_path LIKE '$path'\", function($arr)\n {\n $groupsToDelete[] = $arr[\"id\"];\n });\n }\n $groupsToDelete[] = $group_id;\n $groupCad = implode(\",\", $groupsToDelete);\n // Eliminacion de los grupos\n $qs[] = \"DELETE FROM _permission_groups WHERE id IN ($groupCad)\";\n $qs[] = \"DELETE FROM _permission_group_items WHERE group_id IN ($groupCad)\";\n // Determinar sobre que columna tenemos que hacer match en la tabla principal.\n switch ($groupInfo[0][\"group_type\"])\n {\n case AclManager::ARO:\n {\n $column = \"aro\";\n }break;\n case AclManager::ACO:\n {\n $column = \"aco\";\n }break;\n default:\n {\n $column = \"axo\";\n }\n }\n $qs[] = \"DELETE FROM _permissions WHERE \" . $column . \"_type=1 AND \" . $column . \"_id IN ($groupCad)\";\n $this->conn->batch($qs);\n }",
"public function DeleteGroup() {\n\t\t\t$this->objGroup->Delete();\n\t\t}",
"public function deleteChildren()\n {\n \tstatic::deleteAll(['parent' => $this->id]);\n }",
"function delete()\n\t{\n\t\t// always call parent delete function first!!\n\t\tif (!parent::delete())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// get childs\n\t\t$childs = $this->tree->getSubTree($this->tree->getNodeData($this->tree->readRootId()));\n\n\t\t// delete tree\n\t\t$this->tree->removeTree($this->tree->getTreeId());\n\n\t\t// delete childs\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\t$fid = ilMediaPoolItem::lookupForeignId($child[\"obj_id\"]);\n\t\t\tswitch ($child[\"type\"])\n\t\t\t{\n\t\t\t\tcase \"mob\":\n\t\t\t\t\tif (ilObject::_lookupType($fid) == \"mob\")\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t\t\t\t\t$mob = new ilObjMediaObject($fid);\n\t\t\t\t\t\t$mob->delete();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n/*\t\t\t\tcase \"fold\":\n\t\t\t\t\tif (ilObject::_lookupType($fid) == \"fold\")\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Modules/Folder/classes/class.ilObjFolder.php\");\n\t\t\t\t\t\t$fold = new ilObjFolder($fid, false);\n\t\t\t\t\t\t$fold->delete();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;*/\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}",
"function destroy(&$child, &$object)\n\t{\n\t\tif($this->get_table() != $object->__table){\n\t\t\t// no matching table\n\t\t\tIR_base::log('error', 'IgnitedRecord: The table '.$child->__table.\n\t\t\t\t\t\t\t\t' has not got a has and belongs to relation with the table '.$object->__table);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( ! isset($child->__id) || ! isset($object->__id))\n\t\t\treturn;\n\t\t\n\t\t$q = new IgnitedQuery();\n\t\t\n\t\t$q->where($this->get_fk(), $child->__id);\n\t\t$q->where($this->get_related_fk(), $object->__id);\n\t\t$q->delete($this->get_join_table());\n\t}",
"public function fb_delete_group()\n {\n // Make sure that the store has a registered Firebase group\n if (!$this->fb_notification_key) {\n Log::warning(\"FB: Store {$this->code} doesn't have a valid fb_notification_key, ignoring request to delete group from Firebase!\");\n return;\n }\n\n // Deleting all the registered devices deletes the group\n $deviceIds = $this->users->pluck('fb_device_id')->filter(function ($id) {return isset($id);});\n\n // Perform the Firebase request with the required parameters\n $response = fb_curl_post([\n \"operation\" => \"remove\",\n \"notification_key_name\" => $this->code,\n \"notification_key\" => $this->fb_notification_key,\n \"registration_ids\" => $deviceIds,\n ]);\n\n // Log result of the Firebase request\n if ($response && !isset($response->error)) {\n Log::info(\"FB: Firebase group deletion for store {$this->code} completed with response \" . print_r($response, true));\n } else {\n Log::error(\"FB: Firebase group deletion for store {$this->code} failed with response \" . print_r($response, true));\n }\n }",
"public function deletegroupAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$group = GroupNamespace::getCurrentGroup();\n \tif (isset($group))\n \t{\n \t\tGroupDAO::getGroupDAO()->deleteGroup($group);\n \t}\n \tGroupNamespace::clearCurrentGroup();\n \t$this->_helper->redirector('index', 'user');\n }",
"public function delete()\n {\n if( ! $this->get_id() ) return;\n\n $results = array();\n\n // Delete the object from the model's table\n $results[] = $this->_db->delete(\n $this->_table_name,\n array(\n 'id' => $this->_id\n )\n );\n\n // Delete settings from the model's meta table.\n $results[] = $this->_db->delete(\n $this->_meta_table_name,\n array(\n 'parent_id' => $this->_id\n )\n );\n\n // Query for child objects using the relationships table.\n\n $children = $this->_db->get_results(\n \"\n SELECT child_id, child_type\n FROM $this->_relationships_table\n WHERE parent_id = $this->_id\n AND parent_type = '$this->_type'\n \"\n );\n\n // Delete each child model\n foreach( $children as $child ) {\n $model = Ninja_Forms()->form()->get_model( $child->child_id, $child->child_type );\n $model->delete();\n }\n\n // Delete all relationships\n $this->_db->delete(\n $this->_relationships_table,\n array(\n 'parent_id' => $this->_id,\n 'parent_type' => $this->_type\n )\n );\n\n // return False if there are no query errors.\n return in_array( FALSE, $results );\n }",
"protected function _delete() {\n\n\n $category = $this->getParent();\n if($category->forum_count)\n $category->forum_count = new Zend_Db_Expr('forum_count - 1');\n $category->save();\n\n // Delete all child topics\n $table = Engine_Api::_()->getItemTable('forum_topic');\n $select = $table->select()\n ->where('forum_id = ?', $this->getIdentity())\n ;\n foreach ($table->fetchAll($select) as $topic) {\n $topic->delete();\n }\n\n\n parent::_delete();\n }",
"function delete()\n {\n $success = DataManager::delete_course_group_group_relation($this);\n if (! $success)\n {\n return false;\n }\n \n return true;\n }",
"public static function delete()\r\n {\r\n if(!self::user()->hasPerm('groups_delete'))\r\n Json::printError('You are not allowed for the requested action!');\r\n $val = \\CAT\\Helper\\Validate::getInstance();\r\n $id = $val->sanitizePost('id');\r\n if(!\\CAT\\Helper\\Groups::exists($id))\r\n Json::printError('No such group!');\r\n $group = \\CAT\\Groups::getInstance()->getGroup($id);\r\n if($group['builtin']=='Y')\r\n Json::printError('Built-in elements cannot be removed!');\r\n $res = \\CAT\\Helper\\Groups::removeGroup($id);\r\n Base::json_result($res,($res?'':'Failed!'),($res?true:false));\r\n }",
"public function delete()\n {\n $group = Group::findById($this->gGroup);\n if (!$group) {\n return false;\n }\n\n if (Group::getChildGroupsByGroupId($this->gGroup)) {\n $this->status = Yii::t('frontend_controllers_map_actionDeleteGroup','Cannot delete group {name}. Group has sub-groups.',[\n 'name' => $group->name,\n ]);\n return false;\n }\n\n $objects = Object::getObjectsByParentId($this->gGroup);\n foreach ($objects as $object) {\n if ($object->connection0 || $object->connection1) {\n $this->status = Yii::t('frontend_controllers_map_actionDeleteGroup','Cannot delete group {name}. Group has elements that still are connected.',[\n 'name' => $group->name,\n ]);\n return false;\n }\n }\n\n if ($group->delete()) {\n $this->status = Yii::t('frontend_controllers_map_actionDeleteGroup','{name} deleted successfuly.',[\n 'name' => $group->name,\n ]);\n return true;\n }\n\n $this->status = Yii::t('frontend_models_EditGroupModel', 'An error occured while deleting group.');\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of auteurLivre | public function setAuteurLivre($auteurLivre)
{
$this->auteurLivre = $auteurLivre;
return $this;
} | [
"public function setAuteur($auteur)\n {\n $this->auteur = $auteur;\n \n return $this;\n }",
"public function set_contenu($contenu) { $this->_contenu = $contenu; }",
"public static function verifAuteur() {\n global $pdo;\n $id_ano = Membre::getIdFromPseudo(\"anonyme\");\n\n $req = $pdo->prepare(\"UPDATE `urls` SET `auteur`=:idano WHERE auteur IS NULL;\");\n $req->bindParam(':idano', $id_ano);\n $req->execute();\n }",
"function referentiel_set_seuil_domaine($id, $seuil){\r\nglobal $DB;\r\n $DB->set_field(\"referentiel_domaine\", \"seuil_domaine\", $seuil, array(\"id\" => $id));\r\n}",
"public function setSujet($Sujet) {$this->Sujet = $Sujet;}",
"public function setAuteur($Auteur)\n {\n $this->Auteur = $Auteur;\n\n return $this;\n }",
"public function setAuteur($auteur)\n {\n $this->auteur = $auteur;\n\n return $this;\n }",
"public function auteur()\n {\n return $this->auteur;\n }",
"function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}",
"public function getAuteur()\n {\n return $this->auteur;\n }",
"public function setEtatArticle($etat, $ref)\n\t{\n\t\t$etat = filter_var($etat, FILTER_SANITIZE_STRING); // filtre l'etat\n\t\t$ref = filter_var($ref, FILTER_SANITIZE_STRING); // filtre la ref\n\n\t\t$sql = 'UPDATE Article SET etat_Publi = ? WHERE ref_Article = ?'; // la requete\n\t\t$this->db->query($sql, array($etat, $ref)); // lance la requete\n\t}",
"public function setLivreur(Livreur $livreur){\n $this->_livreur = $livreur->getId();\n }",
"public function setLibelle($libelle)\n {\n $this->libelle = $libelle;\n\n \n }",
"public function setLacouleur(string $lacouleur):void\n {\n $lacouleur = strip_tags(trim($lacouleur));\n if(strlen($lacouleur) > 10){\n trigger_error(\"La couleur ne peut dépasser 10 caractères\",E_USER_NOTICE);\n }\n else{\n $this->lacouleur = $lacouleur;\n }\n \n }",
"public function getAuteur() : string\r\n\t{\r\n\t\treturn $this->Auteur ?? 'Inconnu'; \r\n\t}",
"public function setAutor($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is string,\r\n\t\t// we will cast the input to a string (if it is not).\r\n\t\tif ($v !== null && !is_string($v)) {\r\n\t\t\t$v = (string) $v; \r\n\t\t}\r\n\n\t\tif ($this->autor !== $v) {\n\t\t\t$this->autor = $v;\n\t\t\t$this->modifiedColumns[] = UnedMediaOldPeer::AUTOR;\n\t\t}\n\n\t}",
"function setDesc_lugar($sdesc_lugar = '')\n {\n $this->sdesc_lugar = $sdesc_lugar;\n }",
"public function getIdAuteur()\n {\n return $this->_idAuteur;\n }",
"public function testSetLieuNaissance() {\n\n $obj = new AttestationAt();\n\n $obj->setLieuNaissance(\"lieuNaissance\");\n $this->assertEquals(\"lieuNaissance\", $obj->getLieuNaissance());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a spellcheck on the query, or null if none set. | public function getSpellcheck(); | [
"public function getSpellcheck()\n {\n $this->spellcheck = $this->spellcheck ?? $this->results->getSpellcheck();\n return $this->spellcheck;\n }",
"public function getCheckSpelling()\n {\n return $this->checkSpelling;\n }",
"public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckResult;",
"public function spellcheck($spellcheck = 'true')\n {\n return $this->_attribute('spellcheck', $this->boolean($spellcheck));\n }",
"public function getSpellcheck()\n {\n return $this->getComponent(self::COMPONENT_SPELLCHECK, true);\n }",
"public function createSpellcheck(array $options = null): SpellcheckQuery;",
"public function getCollatedSpellcheck()\n {\n return $this->collatedSpellcheck;\n }",
"public function get_spellcheck()\r\n\t{\r\n\t\treturn $this->get_attr('spellcheck') === 'spellcheck';\r\n\t}",
"public function isSpellchecked()\n {\n return $this->_isSpellChecked;\n }",
"function spellcheck()\n\t{\n\t\t$this->output->enable_profiler(FALSE);\n\n\t\tif ( ! class_exists('EE_Spellcheck'))\n\t\t{\n\t\t\trequire APPPATH.'libraries/Spellcheck.php';\n\t\t}\n\n\t\treturn EE_Spellcheck::check();\n\t}",
"public function hasSpellcheck(): bool\n {\n return $this->spellcheck;\n }",
"public function getSpellcheckResult()\n {\n //expose origin result\n return $this->originalResult->getSpellcheckResult();\n }",
"public function getSpellcheckingSuggestions() {\n\t\t$spellcheckingSuggestions = FALSE;\n\n\t\t$suggestions = (array) $this->response->spellcheck->suggestions;\n\t\tif (!empty($suggestions)) {\n\t\t\t$spellcheckingSuggestions = $suggestions;\n\t\t}\n\n\t\treturn $spellcheckingSuggestions;\n\t}",
"public function getSpell($arg)\n\t{\n\t\tif (is_numeric($arg))\n\t\t{\n\t\t\treturn $this->getSpellByEnum(intval($arg, 10));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->getSpellByName($arg);\n\t\t}\n\t}",
"private function _basicSpelling()\n {\n // TODO: There might be a way to run the\n // search against both dictionaries from\n // inside solr. Investigate. Currently\n // submitting a second search for this.\n\n // Create a new search object\n $type = str_replace('SearchObject_', '', get_class($this));\n $newSearch = SearchObjectFactory::initSearchObject($type);\n $newSearch->deminify($this->minify());\n\n // Activate the basic dictionary\n $newSearch->useBasicDictionary();\n // We don't want it in the search history\n $newSearch->disableLogging();\n\n // Run the search\n $newSearch->processSearch();\n // Get the spelling results\n $newList = $newSearch->getRawSuggestions();\n\n // If there were no shingle suggestions\n if (count($this->suggestions) == 0) {\n // Just use the basic ones as provided\n $this->suggestions = $newList;\n } else {\n // Otherwise...\n // For all the new suggestions\n foreach ($newList as $word => $data) {\n // Check the old suggestions\n $found = false;\n foreach ($this->suggestions as $k => $v) {\n // Make sure it wasn't part of a shingle\n // which has been suggested at a higher\n // level.\n $found = preg_match(\"/\\b$word\\b/\", $k) ? true : $found;\n }\n if (!$found) {\n $this->suggestions[$word] = $data;\n }\n }\n }\n }",
"public function setSpellcheck(bool $spellcheck): self\n {\n $this->spellcheck = $spellcheck;\n\n return $this;\n }",
"abstract public function getSpellingSuggestions();",
"public function suggestionsFor($word) {\n return pspell_suggest($this->handle, $word);\n }",
"public function getSpellingValidation()\n {\n return $this->spellingValidation;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====================================================================== reply46ELKS Function Start Here ====================================================================== | public function reply46ELKS(Request $request)
{
$number = $request->input('from');
$body = $request->input('message');
$sender = $request->input('to');
$image = $request->input('image');
if ($number == '' || $body == '') {
return 'Destination number and message value required';
}
if ($image != '') {
$body = $body . ' ' . $image;
}
$clphone = str_replace(" ", "", $number); #Remove any whitespace
$clphone = str_replace('+', '', $clphone);
$msgcount = strlen(preg_replace('/\s+/', ' ', trim($body)));;
$msgcount = $msgcount / 160;
$msgcount = ceil($msgcount);
$get_status = $this->insertSMS($clphone, $msgcount, $body, $sender, '46ELKS');
if ($get_status) {
return 'success';
} else {
return 'failed';
}
} | [
"function LINEReply ($replyToken, $messages, $accessToken){\n\n $data = [\n \"replyToken\" => $replyToken,\n \"messages\" => $messages\n ];\n\n $ch = curl_init('https://api.line.me/v2/bot/message/reply');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json; charser=UTF-8',\n 'Authorization: Bearer '.$accessToken\n ));\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"function checkReply()\n {\n }",
"function grab_ticket_num_ext_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t$fdigits = $this->input->post('fdigits', TRUE);\n\t\t\n // $result = $this->MOutgoing->get_key_data($fparam, $fcode);\n $result = $this->MOutgoing->get_key_data_ext($fparam, $fdigits);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('outgoing_num'=>$result);\n $count_exist = $this->MOutgoing->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t// $result2 = $this->MOutgoing->get_key_data($fparam, $fcode);\n\t\t\t$result2 = $this->MOutgoing->get_key_data_ext($fparam, $fdigits);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"function getReplyData($_mode, $_icServer, $_folder, $_uid, $_partID)\n\t{\n\t\tunset($_icServer);\t// not used\n\t\t$foundAddresses = array();\n\n\t\t$mail_bo = $this->mail_bo;\n\t\t$mail_bo->openConnection();\n\t\t$mail_bo->reopen($_folder);\n\n\t\t$userEMailAddresses = $mail_bo->getUserEMailAddresses();\n\n\t\t// get message headers for specified message\n\t\t//print \"AAAA: $_folder, $_uid, $_partID<br>\";\n\t\t$headers\t= $mail_bo->getMessageEnvelope($_uid, $_partID,false,$_folder,$useHeaderInsteadOfEnvelope=true);\n\t\t//$headers\t= $mail_bo->getMessageHeader($_uid, $_partID, true, true, $_folder);\n\t\t$this->sessionData['uid'] = $_uid;\n\t\t$this->sessionData['messageFolder'] = $_folder;\n\t\t$this->sessionData['in-reply-to'] = ($headers['IN-REPLY-TO']?$headers['IN-REPLY-TO']:$headers['MESSAGE_ID']);\n\t\t$this->sessionData['references'] = ($headers['REFERENCES']?$headers['REFERENCES']:$headers['MESSAGE_ID']);\n\t\t// thread-topic is a proprietary microsoft header and deprecated with the current version\n\t\t// horde does not support the encoding of thread-topic, and probably will not no so in the future\n\t\t//if ($headers['THREAD-TOPIC']) $this->sessionData['thread-topic'] = $headers['THREAD-TOPIC'];\n\t\tif ($headers['THREAD-INDEX']) $this->sessionData['thread-index'] = $headers['THREAD-INDEX'];\n\t\tif ($headers['LIST-ID']) $this->sessionData['list-id'] = $headers['LIST-ID'];\n\t\t//error_log(__METHOD__.__LINE__.' Mode:'.$_mode.':'.array2string($headers));\n\t\t// check for Reply-To: header and use if available\n\t\tif(!empty($headers['REPLY-TO']) && ($headers['REPLY-TO'] != $headers['FROM'])) {\n\t\t\tforeach($headers['REPLY-TO'] as $val) {\n\t\t\t\tif(!$foundAddresses[$val]) {\n\t\t\t\t\t$oldTo[] = $val;\n\t\t\t\t\t$foundAddresses[$val] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$oldToAddress\t= (is_array($headers['REPLY-TO'])?$headers['REPLY-TO'][0]:$headers['REPLY-TO']);\n\t\t} else {\n\t\t\tforeach($headers['FROM'] as $val) {\n\t\t\t\tif(!$foundAddresses[$val]) {\n\t\t\t\t\t$oldTo[] = $val;\n\t\t\t\t\t$foundAddresses[$val] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$oldToAddress\t= (is_array($headers['FROM'])?$headers['FROM'][0]:$headers['FROM']);\n\t\t}\n\t\t//error_log(__METHOD__.__LINE__.' OldToAddress:'.$oldToAddress.'#');\n\t\tif($_mode != 'all' || ($_mode == 'all' && !empty($oldToAddress) && !$this->testIfOneKeyInArrayDoesExistInString($userEMailAddresses,$oldToAddress)) ) {\n\t\t\t$this->sessionData['to'] = $oldTo;\n\t\t}\n\n\t\tif($_mode == 'all') {\n\t\t\t// reply to any address which is cc, but not to my self\n\t\t\t#if($headers->cc) {\n\t\t\t\tforeach($headers['CC'] as $val) {\n\t\t\t\t\tif($this->testIfOneKeyInArrayDoesExistInString($userEMailAddresses,$val)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(!$foundAddresses[$val]) {\n\t\t\t\t\t\t$this->sessionData['cc'][] = $val;\n\t\t\t\t\t\t$foundAddresses[$val] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t#}\n\n\t\t\t// reply to any address which is to, but not to my self\n\t\t\t#if($headers->to) {\n\t\t\t\tforeach($headers['TO'] as $val) {\n\t\t\t\t\tif($this->testIfOneKeyInArrayDoesExistInString($userEMailAddresses,$val)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(!$foundAddresses[$val]) {\n\t\t\t\t\t\t$this->sessionData['to'][] = $val;\n\t\t\t\t\t\t$foundAddresses[$val] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t#}\n\n\t\t\t#if($headers->from) {\n\t\t\t\tforeach($headers['FROM'] as $val) {\n\t\t\t\t\tif($this->testIfOneKeyInArrayDoesExistInString($userEMailAddresses,$val)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t//error_log(__METHOD__.__LINE__.' '.$val);\n\t\t\t\t\tif(!$foundAddresses[$val]) {\n\t\t\t\t\t\t$this->sessionData['to'][] = $val;\n\t\t\t\t\t\t$foundAddresses[$val] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t#}\n\t\t}\n\n\t\t// check for Re: in subject header\n\t\tif(strtolower(substr(trim($mail_bo->decode_header($headers['SUBJECT'])), 0, 3)) == \"re:\") {\n\t\t\t$this->sessionData['subject'] = $mail_bo->decode_header($headers['SUBJECT']);\n\t\t} else {\n\t\t\t$this->sessionData['subject'] = \"Re: \" . $mail_bo->decode_header($headers['SUBJECT']);\n\t\t}\n\n\t\t//_debug_array($headers);\n\t\t//error_log(__METHOD__.__LINE__.'->'.array2string($this->mailPreferences['htmlOptions']));\n\t\t$bodyParts = $mail_bo->getMessageBody($_uid, ($this->mailPreferences['htmlOptions']?$this->mailPreferences['htmlOptions']:''), $_partID);\n\t\t//_debug_array($bodyParts);\n\t\t$styles = mail_bo::getStyles($bodyParts);\n\n\t\t$fromAddress = implode(', ', str_replace(array('<','>'),array('[',']'),$headers['FROM']));\n\n\t\t$toAddressA = array();\n\t\t$toAddress = '';\n\t\tforeach ($headers['TO'] as $mailheader) {\n\t\t\t$toAddressA[] = $mailheader;\n\t\t}\n\t\tif (count($toAddressA)>0)\n\t\t{\n\t\t\t$toAddress = implode(', ', str_replace(array('<','>'),array('[',']'),$toAddressA));\n\t\t\t$toAddress = @htmlspecialchars(lang(\"to\")).\": \".$toAddress.($bodyParts['0']['mimeType'] == 'text/html'?\"<br>\":\"\\r\\n\");\n\t\t}\n\t\t$ccAddressA = array();\n\t\t$ccAddress = '';\n\t\tforeach ($headers['CC'] as $mailheader) {\n\t\t\t$ccAddressA[] = $mailheader;\n\t\t}\n\t\tif (count($ccAddressA)>0)\n\t\t{\n\t\t\t$ccAddress = implode(', ', str_replace(array('<','>'),array('[',']'),$ccAddressA));\n\t\t\t$ccAddress = @htmlspecialchars(lang(\"cc\")).\": \".$ccAddress.($bodyParts['0']['mimeType'] == 'text/html'?\"<br>\":\"\\r\\n\");\n\t\t}\n\t\tif($bodyParts['0']['mimeType'] == 'text/html') {\n\t\t\t$this->sessionData['body']\t= /*\"<br>\".*//*\" \".*/\"<div>\".'----------------'.lang(\"original message\").'-----------------'.\"\".'<br>'.\n\t\t\t\t@htmlspecialchars(lang(\"from\")).\": \".$fromAddress.\"<br>\".\n\t\t\t\t$toAddress.$ccAddress.\n\t\t\t\t@htmlspecialchars(lang(\"date\").\": \".$headers['DATE'],ENT_QUOTES | ENT_IGNORE,mail_bo::$displayCharset, false).\"<br>\".\n\t\t\t\t'----------------------------------------------------------'.\"</div>\";\n\t\t\t$this->sessionData['mimeType'] \t= 'html';\n\t\t\tif (!empty($styles)) $this->sessionData['body'] .= $styles;\n\t\t\t$this->sessionData['body']\t.= '<blockquote type=\"cite\">';\n\n\t\t\tfor($i=0; $i<count($bodyParts); $i++) {\n\t\t\t\tif($i>0) {\n\t\t\t\t\t$this->sessionData['body'] .= '<hr>';\n\t\t\t\t}\n\t\t\t\tif($bodyParts[$i]['mimeType'] == 'text/plain') {\n\t\t\t\t\t#$bodyParts[$i]['body'] = nl2br($bodyParts[$i]['body']).\"<br>\";\n\t\t\t\t\t$bodyParts[$i]['body'] = \"<pre>\".$bodyParts[$i]['body'].\"</pre>\";\n\t\t\t\t}\n\t\t\t\tif ($bodyParts[$i]['charSet']===false) $bodyParts[$i]['charSet'] = mail_bo::detect_encoding($bodyParts[$i]['body']);\n\n\t\t\t\t$_htmlConfig = mail_bo::$htmLawed_config;\n\t\t\t\tmail_bo::$htmLawed_config['comment'] = 2;\n\t\t\t\tmail_bo::$htmLawed_config['transform_anchor'] = false;\n\t\t\t\t$this->sessionData['body'] .= \"<br>\".self::_getCleanHTML(translation::convert($bodyParts[$i]['body'], $bodyParts[$i]['charSet']));\n\t\t\t\tmail_bo::$htmLawed_config = $_htmlConfig;\n\t\t\t\t#error_log( \"GetReplyData (HTML) CharSet:\".mb_detect_encoding($bodyParts[$i]['body'] . 'a' , strtoupper($bodyParts[$i]['charSet']).','.strtoupper($this->displayCharset).',UTF-8, ISO-8859-1'));\n\t\t\t}\n\n\t\t\t$this->sessionData['body']\t.= '</blockquote><br>';\n\t\t\t$this->sessionData['body'] = mail_ui::resolve_inline_images($this->sessionData['body'], $_folder, $_uid, $_partID, 'html');\n\t\t} else {\n\t\t\t//$this->sessionData['body']\t= @htmlspecialchars(lang(\"on\").\" \".$headers['DATE'].\" \".$mail_bo->decode_header($fromAddress), ENT_QUOTES) . \" \".lang(\"wrote\").\":\\r\\n\";\n\t\t\t// take care the way the ReplyHeader is created here, is used later on in uicompose::compose, in case you force replys to be HTML (prefs)\n $this->sessionData['body'] = \" \\r\\n \\r\\n\".'----------------'.lang(\"original message\").'-----------------'.\"\\r\\n\".\n @htmlspecialchars(lang(\"from\")).\": \".$fromAddress.\"\\r\\n\".\n\t\t\t\t$toAddress.$ccAddress.\n\t\t\t\t@htmlspecialchars(lang(\"date\").\": \".$headers['DATE'], ENT_QUOTES | ENT_IGNORE,mail_bo::$displayCharset, false).\"\\r\\n\".\n '-------------------------------------------------'.\"\\r\\n \\r\\n \";\n\t\t\t$this->sessionData['mimeType']\t= 'plain';\n\n\t\t\tfor($i=0; $i<count($bodyParts); $i++) {\n\t\t\t\tif($i>0) {\n\t\t\t\t\t$this->sessionData['body'] .= \"<hr>\";\n\t\t\t\t}\n\n\t\t\t\t// add line breaks to $bodyParts\n\t\t\t\tif ($bodyParts[$i]['charSet']===false) $bodyParts[$i]['charSet'] = mail_bo::detect_encoding($bodyParts[$i]['body']);\n\t\t\t\t$newBody\t= translation::convert($bodyParts[$i]['body'], $bodyParts[$i]['charSet']);\n\t\t\t\t#error_log( \"GetReplyData (Plain) CharSet:\".mb_detect_encoding($bodyParts[$i]['body'] . 'a' , strtoupper($bodyParts[$i]['charSet']).','.strtoupper($this->displayCharset).',UTF-8, ISO-8859-1'));\n\t\t\t\t$newBody = mail_ui::resolve_inline_images($newBody, $_folder, $_uid, $_partID, 'plain');\n\t\t\t\t$this->sessionData['body'] .= \"\\r\\n\";\n\t\t\t\t// create body new, with good line breaks and indention\n\t\t\t\tforeach(explode(\"\\n\",$newBody) as $value) {\n\t\t\t\t\t// the explode is removing the character\n\t\t\t\t\tif (trim($value) != '') {\n\t\t\t\t\t\t#if ($value != \"\\r\") $value .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$numberOfChars = strspn(trim($value), \">\");\n\t\t\t\t\t$appendString = str_repeat('>', $numberOfChars + 1);\n\n\t\t\t\t\t$bodyAppend = $this->mail_bo->wordwrap($value, 76-strlen(\"\\r\\n$appendString \"), \"\\r\\n$appendString \",'>');\n\n\t\t\t\t\tif($bodyAppend[0] == '>') {\n\t\t\t\t\t\t$bodyAppend = '>'. $bodyAppend;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bodyAppend = '> '. $bodyAppend;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->sessionData['body'] .= $bodyAppend;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$mail_bo->closeConnection();\n\t\treturn $this->sessionData;\n\n\t}",
"public function testCreateReply()\n {\n }",
"function quiz_topics_free_post()\r\n {\r\n\r\n $response = array(\r\n 'status' => false,\r\n 'message' => ''\r\n );\r\n\r\n $user_input = $this->client_request;\r\n\r\n extract($user_input);\r\n\r\n $required_params = array(\r\n 'user_id' => 'User ID',\r\n 'course_id' => 'Course ID',\r\n 'subject_id' => 'Subject ID'\r\n );\r\n\r\n foreach ($required_params as $key => $value)\r\n\r\n {\r\n\r\n if (!$user_input[$key])\r\n\r\n {\r\n\r\n $response = array(\r\n 'status' => false,\r\n 'message' => $value . ' is required'\r\n );\r\n\r\n TrackResponse($user_input, $response);\r\n\r\n $this->response($response);\r\n\r\n }\r\n\r\n }\r\n\r\n $response = $this\r\n ->ws_model\r\n ->quiz_topics_free($user_id, $course_id, $subject_id, $count);\r\n\r\n // var_dump($response);die();\r\n \r\n\r\n if (empty($response))\r\n\r\n {\r\n\r\n $response = array(\r\n 'status' => false,\r\n 'message' => 'No topics found!'\r\n );\r\n\r\n }\r\n\r\n else\r\n\r\n {\r\n\r\n $topics_count = 0;\r\n $questions_count = 0;\r\n\r\n foreach ($response as $ckey=>$value)\r\n {\r\n\r\n $topics_count++;\r\n if(!empty($value['topics_array'])){\r\n foreach($value['topics_array'] as $tkey=>$tvalue){\r\n if ($tvalue['questions_count'] > 0)\r\n {\r\n $questions_count = $tvalue['questions_count'] + $questions_count;\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n $topics_count = array(\r\n\r\n 'chapters_count' => $topics_count,\r\n\r\n 'questions_count' => $questions_count\r\n\r\n );\r\n\r\n $response = array(\r\n 'status' => true,\r\n 'message' => 'Topics Fetched Successfully!',\r\n 'response' => $response,\r\n 'count' => $topics_count\r\n );\r\n\r\n }\r\n\r\n TrackResponse($user_input, $response);\r\n\r\n $this->response($response);\r\n\r\n }",
"function grab_ticket_num_ext_post()\n {\n\t\t$fparam = $this->input->post('fparam', TRUE);\n\t\t$fdigits = $this->input->post('fdigits', TRUE);\n\t\t\n // $result = $this->MIncoming->get_key_data($fparam, $fcode);\n $result = $this->MIncoming->get_key_data_ext($fparam, $fdigits);\n $ranstring = $this->common->randomString();\n \n\t\t$arrWhere = array('incoming_num'=>$result);\n $count_exist = $this->MIncoming->check_data_exists($arrWhere);\n\n if($count_exist > 0)\n {\n\t\t\t// $result2 = $this->MIncoming->get_key_data($fparam, $fcode);\n\t\t\t$result2 = $this->MIncoming->get_key_data_ext($fparam, $fdigits);\n\t\t\t$result = $result2;\n }\n else\n {\n\t\t\t$result = $result;\n }\n\t\t\n $this->response([\n 'status' => TRUE,\n 'result' => $result\n ], REST_Controller::HTTP_OK);\n }",
"private function response() {\n\t\t/*\n\t\tIn RESP, the type of some data depends on the first byte:\n\t\t \n\t For Simple Strings the first byte of the reply is \"+\"\n\t For Errors the first byte of the reply is \"-\"\n\t For Integers the first byte of the reply is \":\"\n\t For Bulk Strings the first byte of the reply is \"$\"\n\t For Arrays the first byte of the reply is \"*\"\n\n\t\t */\n\t\t$response = false;\n\t\t$respond = fgets($this->__redis, 512);\n\t\t//echo substr($response, 1);\n\t\tswitch ($respond[0]) {\n\t\t\tcase '+':\n\t\t\t\tif(substr($respond, 1) == 'OK')\n\t\t\t\t\t$response = true;\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\tthrow new Exception($respond, 1);\n\t\t\t\tbreak;\n\t\t\tcase '$':\n\t\t\t\t$countResp = intval(substr($respond,1));\n\t\t\t\tif($countResp == -1) {\n\t\t\t\t\t//Null bulk \n\t\t\t\t\t$response = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$resp = fread($this->__redis, $countResp+2);//+2 for \\r\\n\n\t\t\t\t\tif(!$resp)\n\t\t\t\t\t\tthrow new Exception(\"Response error \".$response, 1);\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $resp;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\t$countResp = intval(substr($respond,1));\n\t\t\t\t$response = array();\n\t\t\t\tfor ($i=0; $i < $countResp; $i++) { \n\t\t\t\t\t$response[] = $this->response();\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\tdefault:\n\t\t\t\tthrow new \\Exception(\"Unknow response...\", 1);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $response;\n\t}",
"function powerreplyfunction(){\r\n \r\n global $wpdb;\r\n\r\n if (isset($_POST['status_message']))\r\n {\r\n $status = $_POST['status'];\r\n $status_id = $_POST['status_message'];\r\n\r\n $table_name = $wpdb->prefix . 'super_sticky_notes';\r\n if($status == 'delete'){\r\n $delete = $this->wpdb->delete(\r\n $table_name,\r\n array('id' => $status_id),\r\n array('%d') \r\n );\r\n }else{\r\n $wpdb->update( $table_name,\r\n array(\r\n 'note_status' => $status\r\n ),\r\n array(\r\n 'id'=> $status_id\r\n ),\r\n array('%s'),\r\n array('%d')\r\n );\r\n }\r\n }\r\n if (isset($_POST['note_reply_ids']))\r\n {\r\n $status_ids = $_POST['note_reply_ids'];\r\n $note_reply_admin_role = $_POST['note_reply_admin_role'];\r\n $note_reply = $_POST['note_reply_text'];\r\n $next_conv_allowed = $_POST['next_conv_allowed'];\r\n $note_repliedOn_date = date(\"Y-m-d\");\r\n\r\n $table_name = $wpdb->prefix . 'super_sticky_notes';\r\n $user_id_and_user_note = $this->wpdb->get_results( \"SELECT `user_id`, `note_values` FROM $table_name WHERE `id` = $status_ids \", OBJECT);\r\n $user_id_and_user_note = json_decode(json_encode($user_id_and_user_note), true);\r\n $note_user_id = $user_id_and_user_note[0]['user_id'];\r\n $note_values = $user_id_and_user_note[0]['note_values'];\r\n $user_info = get_userdata($note_user_id);\r\n $user_email = $user_info->user_email;\r\n $next_con = ($next_conv_allowed == 1) ? 'Yes' : 'No';\r\n\r\n $to = $user_email;\r\n\r\n $subject = 'Congratulations Instructor has replied to your comment.';\r\n $body = '<p><strong>Your Question :</strong> ' . $note_values . '.</br></p>' .\r\n '<p><strong>Instructor Reply :</strong> ' . $note_reply . '.</br></p>' .\r\n '<p>Next Conversation : ' . $next_con . '.</br></p>';\r\n $headers = array('Content-Type: text/html; charset=UTF-8');\r\n\r\n\r\n $mail = wp_mail( $to, $subject, $body, $headers );\r\n\r\n $table_name = $wpdb->prefix . 'super_sticky_notes';\r\n $wpdb->update( $table_name,\r\n array(\r\n 'note_reply_admin_role' => $note_reply_admin_role,\r\n 'note_reply' => $note_reply,\r\n 'next_conv_allowed' => $next_conv_allowed,\r\n 'note_repliedOn' => $note_repliedOn_date\r\n ),\r\n array(\r\n 'id'=> $status_ids\r\n ),\r\n array( '%d', '%s', '%d', '%s' ),\r\n array( '%d' )\r\n );\r\n }\r\n\r\n ?>\r\n <div class=\"super-sticky-notes\">\r\n <div class=\"sticky-setting-title\"><div class=setting-icon><h1><?php _e('Comments Table', 'wp_super_sticky_notes'); ?></h1></div></div>\r\n <div id=\"all\" class=\"tabcontent\" style=\"display:block;\" >\r\n <div class=\"table-responsive\">\r\n <table class=\"table sticky-notes-data-table jquerydatatable\">\r\n <thead>\r\n <tr class=\"note-heading-wrapper\">\r\n <th><?php _e('User', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('Asked Question', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('Page/Post', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('AskedOn', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('Action', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('Reply', 'wp_super_sticky_notes'); ?></th>\r\n <th><?php _e('RepliedOn', 'wp_super_sticky_notes'); ?></th>\r\n </tr>\r\n </thead>\r\n <?php\r\n $current_user_id = get_current_user_id();\r\n $table_name = $wpdb->prefix . 'super_sticky_notes';\r\n $qry = $this->wpdb->prepare(\"SELECT * FROM $table_name ssn WHERE ssn.`priv` != %d AND ssn.`page_author_id` = $current_user_id ORDER BY ssn.`insert_time` DESC\", 1);\r\n $all_valus_notes = $this->wpdb->get_results($qry, OBJECT); \r\n $all_valus_notes = json_decode(json_encode($all_valus_notes), true);\r\n\r\n ?>\r\n\r\n <tbody>\r\n <?php foreach ($all_valus_notes as $note_values){ \r\n $note_values_note = $note_values['note_values'];\r\n ?>\r\n <tr>\r\n <td><?php \r\n $author_obj = get_user_by('id', $note_values['user_id']); \r\n echo $author_obj->data->user_nicename; ?></td>\r\n <td><?php echo $note_values_note; ?></td>\r\n <td class=\"note-title\"><a href=\"<?php echo get_permalink($note_values['page_id']); ?>\" target=\"_blank\"><?php echo $note_values['title']; ?></a></td>\r\n <td><?php echo $note_values['insert_time']; ?></td>\r\n <td>\r\n <?php if($note_values['note_status'] == 'Disapproved'){?>\r\n <div class=\"disapproved-reply\"><?php _e('REPLY', 'wp_super_sticky_notes'); ?></div>\r\n <?php }else{\r\n $current_id = $note_values['id'];\r\n ?>\r\n <button class=\"reply\"><?php _e('REPLY', 'wp_super_sticky_notes'); ?></button>\r\n <div class=\"modal-overlay\">\r\n <div class=\"modal\">\r\n <a class=\"close-modal\">\r\n <svg viewBox=\"0 0 20 20\">\r\n <path fill=\"#000000\" d=\"M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z\"></path>\r\n </svg>\r\n </a>\r\n <div class=\"modal-content\">\r\n\r\n <h3><?php _e('Write your reply', 'wp_super_sticky_notes'); ?></h3>\r\n <div class=\"note-reply-page\">\r\n <form method=\"POST\">\r\n <input type=\"hidden\" name=\"note_reply_ids\" value=\"<?php echo $current_id; ?>\" />\r\n <input type=\"hidden\" name=\"note_reply_admin_role\" value=\"<?php echo get_current_user_id(); ?>\" />\r\n <!-- <input type=\"text\" name=\"note_reply_title\" placeholder=\"Title\"> -->\r\n <textarea name=\"note_reply_text\" id=\"note_reply_text\" placeholder=\"Write your reply..\" style=\"height:200px\"><?php echo $note_values['note_reply']; ?></textarea>\r\n \r\n <div class=\"next-conversation\">\r\n <p><?php _e('Next Conversation Allowed', 'wp_super_sticky_notes'); ?></p>\r\n <label class=\"switch\">\r\n <?php $checked = ($note_values['next_conv_allowed'] == 1) ? 'checked' : ''; ?>\r\n <input type=\"hidden\" name=\"next_conv_allowed\" value=\"0\" />\r\n <input type=\"checkbox\" name=\"next_conv_allowed\" value=\"1\" <?php echo $checked; ?>/>\r\n <span class=\"slider round\"></span>\r\n </label>\r\n <!-- <p class=\"checked-message\"></p> -->\r\n </div>\r\n <input type=\"submit\" class=\"note-reply\" value=\"Reply\">\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <?php }?> \r\n </td>\r\n <td class=\"note-class-view\"><?php if($note_values['note_status'] == 'Disapproved'){ ?> <div class=\"note-disapproved\"><p><?php _e('Disapproved', 'wp_super_sticky_notes'); ?></p></div> <?php }else{ echo $note_values['note_reply']; } ?></td>\r\n <td><?php if($note_values['note_status'] == 'Disapproved'){ ?> <div class=\"note-disapproved\"><p><?php _e('Disapproved', 'wp_super_sticky_notes'); ?></p></div> <?php }else{ echo $note_values['note_repliedOn']; } ?></td>\r\n </tr>\r\n <?php } ?>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n <?php\r\n }",
"function quiz_topics_pasued_post()\r\n {\r\n $response = array(\r\n 'status' => false,\r\n 'message' => ''\r\n );\r\n $user_input = $this->client_request;\r\n extract($user_input);\r\n $required_params = array(\r\n 'user_id' => 'User ID',\r\n 'course_id' => 'Course ID',\r\n 'subject_id' => 'Subject ID'\r\n );\r\n foreach ($required_params as $key => $value)\r\n {\r\n if (!$user_input[$key])\r\n {\r\n $response = array(\r\n 'status' => false,\r\n 'message' => $value . ' is required'\r\n );\r\n TrackResponse($user_input, $response);\r\n $this->response($response);\r\n }\r\n }\r\n $response = $this\r\n ->ws_model\r\n ->quiz_topics_pasued($user_id, $course_id, $subject_id, $count);\r\n if (empty($response))\r\n\r\n {\r\n\r\n $response = array(\r\n 'status' => false,\r\n 'message' => 'No topics found!'\r\n );\r\n\r\n }\r\n else\r\n\r\n {\r\n\r\n $topics_count = 0;\r\n $questions_count = 0;\r\n\r\n foreach ($response as $ckey=>$value)\r\n {\r\n\r\n $topics_count++;\r\n if(!empty($value['topics_array'])){\r\n foreach($value['topics_array'] as $tkey=>$tvalue){\r\n if ($tvalue['questions_count'] > 0)\r\n {\r\n $questions_count = $tvalue['questions_count'] + $questions_count;\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n $topics_count = array(\r\n\r\n 'chapters_count' => $topics_count,\r\n\r\n 'questions_count' => $questions_count\r\n\r\n );\r\n\r\n $response = array(\r\n 'status' => true,\r\n 'message' => 'Topics Fetched Successfully!',\r\n 'response' => $response,\r\n 'count' => $topics_count\r\n );\r\n\r\n }\r\n TrackResponse($user_input, $response);\r\n\r\n $this->response($response);\r\n\r\n }",
"abstract protected function printReply ($reply, array $headers = []);",
"function post_q_reply_action()\r\n\t{\r\n\t\treturn;\r\n\t}",
"public function email_reply_post() {\n\n //Dev\n //$_POST = $this->request->body;\n\n //Check for data\n if(!$data = $this->input->post()) die('error');\n\n //Build reply\n if(!$message = $this->reply_request->data($data)->build()) die('error');\n\n //Store\n $this->inbox_store->message($message)->store();\n\n $this->response(array(\"status\" => \"success\"));\n }",
"public function testFindReply()\n {\n }",
"public function reminderMailEpSubmitExpiresAction()\n {\n $paticipation_obj=new Ep_Participation_Participation();\n $participation_details=$paticipation_obj->getArticleSubmissionExpires(); \n if($participation_details!=\"NO\")\n {\n foreach($participation_details AS $paticipants)\n {\n $ep_user_id=$paticipants['created_user'];\n $contributor_id= $paticipants['user_id'];\n $client_id=$paticipants['client'];\n $automail=new Ep_Ticket_AutoEmails();\n \n $ep_details=$automail->getUserDetails($ep_user_id);\n $contributor_details= $automail->getUserDetails($contributor_id);\n $client_details= $automail->getUserDetails($client_id);\n $ep_user=$ep_details[0]['username'];\n $contributor='<b>'.$contributor_details[0]['username'].'</b>';\n $ongoing_bo='<a href=\"http://admin-test.edit-place.co.uk/ao/ongoingao?submenuId=ML2-SL4&client='.$paticipants['client'].'&ao='.$paticipants['delivery'].'\">click here</a>';\n $ongoing_fo= '<a href=\"http://ep-test.edit-place.co.uk/client/order1?id='.$paticipants['article_id'].'\">click here</a>';\n $article_client='<a href=\"http://ep-test.edit-place.co.uk/client/order1?id='.$paticipants['article_id'].'\"><b>'.stripslashes($paticipants['article']).'</b></a>'; \n $article_contrib='<a href=\"http://ep-test.edit-place.co.uk/contrib/mission-deliver?article_id='.$paticipants['article_id'].'\"><b>'.stripslashes($paticipants['article']).'</b></a>'; \n $link= $ongoing_fo; \n $message_ids=array(\"client\"=>35,\"contrib\"=>36);\n foreach($message_ids as $key=> $mid)\n {\n if($key=='client')\n {\n $article=$article_client;\n $AO_title=$article;\n $user_email=$client_details[0]['email'];\n } \n else\n {\n $article=$article_contrib;\n $AO_title=$article;\n $user_email=$contributor_details[0]['email'];\n } \n $email=$automail->getAutoEmail($mid);\n $Object=$email[0]['Object'];\n eval(\"\\$Object= \\\"$Object\\\";\");\n $Object=strip_tags($Object);\n $Message=$email[0]['Message'];\n eval(\"\\$Message= \\\"$Message\\\";\");\n \n if($paticipants['premium_option']=='0')\n {\n //echo $user_email.\"--\".$Message.\"--\".$Object.\"<br>\";\n $mail = new Zend_Mail();\n $mail->addHeader('Reply-To','support@edit-place.com');\n $mail->setBodyHtml($Message)\n ->setFrom('support@edit-place.com','Support Edit-place')\n ->addTo($user_email)\n //->setSubject(utf8_decode($object));\n ->setSubject($Object);\n $mail->send();\n } \n } \n \n }\n }\n }",
"function sp_km_user_thread_reply( $thread_id, $email ) {\n\t$props = array(\n\t\t'Thread ID' => $thread_id\n\t);\n\t\n\tkissmetrics_record_event( $email, \"Support ticket reply\", $props );\n}",
"public function newAnswerReplyNotification(){\n\n \t}",
"function messageDetails($response_message, $xmlresponse) {\r\n\r\n\tglobal $return_codes;\r\n\t$message = array();\r\n\t$message = $this->view_message_detail($xmlresponse);\r\n\t//print_r($message);\r\n\t$reply_count = (isset($message['reply'])) && ($message['reply']) ? count($message['reply']) : 0;\r\n\tif (isset($xmlresponse['MessageDetails']['userId'])) {\r\n\t $mainBodyType = NULL;\r\n\t $subjectType = NULL;\r\n\t $replyMsg = NULL;\r\n\t $postcount = 0;\r\n\t $str_temp = \"\";\r\n\t $str1 = \"\";\r\n// print_r($message['main_body']);\r\n\t $message['main_body'] = str_replace('\\\\', \"\", $message['main_body']);\r\n\t $message['main_body'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"<br/>\"), \"\\\\n\", $message['main_body']);\r\n\t //$message['photo_b_thumb'] = (isset($message['photo_b_thumb']) && (strlen($message['photo_b_thumb']) > 7)) ? $this->profile_url . $message['photo_b_thumb'] : $this->profile_url . default_images($message['gender'], $message['profile_type']);\r\n\t //$message['photo_b_thumb'] = (isset($message['photo_b_thumb']) && (strlen($message['photo_b_thumb']) > 7)) ? $this->profile_url . $message['photo_b_thumb'] : $this->profile_url . default_images1($message['gender'], $message['profile_type']);\r\n\t\t$message['photo_b_thumb'] = isset($message['is_facebook_user']) && (strlen($message['photo_b_thumb']) > 7) && ($message['is_facebook_user'] == 'y' || $message['is_facebook_user'] == 'Y') ? $message['photo_b_thumb'] : ((isset($message['photo_b_thumb']) && (strlen($message['photo_b_thumb']) > 7)) ? $this->profile_url . $message['photo_b_thumb'] : $this->profile_url . default_images($message['gender'], $message['profile_type']));\r\n\t $input_main_body = $message['main_body'];\r\n// $input_main_body = str_replace('\\\\', '', $input_main_body);\r\n\t if (preg_match(REGEX_URL, $input_main_body, $url)) {\r\n\t\t$mainBodyType = extract_url($input_main_body);\r\n\t\t$mainBodyType = strip_tags($mainBodyType);\r\n\t\t$mainBodyType = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"\\\"\"), \"\\\\n\", $mainBodyType);\r\n\t } else {\r\n\t\t$mainBodyType = 'text';\r\n\t }\r\n//print_r($message['main_body']);\r\n\t $message['main_body'] = isset($message['main_body']) && ($message['main_body']) ? $message['main_body'] : NULL;\r\n// $message['main_body'] = str_replace('\\\\', \"\", $message['main_body']);\r\n\r\n\t $message['main_body'] = strip_tags($message['main_body'], \"<br />\");\r\n// $message['main_body'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"<br/>\"), \"\\\\n\", $message['main_body']);\r\n\t $message['main_body'] = subanchor($message['main_body']);\r\n// print_r($message['main_body']);\r\n\t for ($i = 0; $i < $reply_count; $i++) {\r\n\r\n\t\t$input_subject = isset($message['subject']) && ($message['subject']) ? $message['subject'] : NULL;\r\n\t\t$input_subject = str_replace('\\\\', '', $input_subject);\r\n\t\tif (preg_match(REGEX_URL, $input_subject, $url)) {\r\n\t\t $subjectType = extract_url($input_subject);\r\n\t\t $subjectType = strip_tags($subjectType);\r\n\t\t $subjectType = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"\\\"\"), \"\\\\n\", $subjectType);\r\n\t\t} else {\r\n\t\t $subjectType = 'text';\r\n\t\t}\r\n\r\n\t\t$input_msg = $message['reply'][$i]['msg'];\r\n\t\t$input_msg = str_replace('\\\\', '', $input_msg);\r\n\t\tif (preg_match(REGEX_URL, $input_msg, $url)) {\r\n\t\t $replyMsg = extract_url($input_msg);\r\n\t\t $replyMsg = strip_tags($replyMsg);\r\n\t\t $replyMsg = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"\\\"\"), \"\\\\n\", $replyMsg);\r\n\t\t} else {\r\n\t\t $replyMsg = 'text';\r\n\t\t}\r\n// $message[$i]['body'] = isset($message[$i]['body']) && ($message[$i]['body']) ? $message[$i]['body'] : NULL;\r\n// $message[$i]['body'] = str_replace('\\\\', \"\", $message[$i]['body']);\r\n// $message[$i]['body'] = strip_tags($message[$i]['body'], \"<br />\");\r\n// $message[$i]['body'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"<br/>\"), \"\\\\n\", $message[$i]['body']);\r\n//print_r($message[$i]['body']);\r\n\t\t$message['reply'][$i]['msg'] = str_replace('\\\\', \"\", $message['reply'][$i]['msg']);\r\n\t\t$message['reply'][$i]['msg'] = strip_tags($message['reply'][$i]['msg'], \"<br />\");\r\n\t\t$message['reply'][$i]['msg'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"<br />\", \"<br/>\"), \"\\\\n\", $message['reply'][$i]['msg']);\r\n\r\n\t\t//\r\n\t\t$message['subject'] = subanchor($message['subject']);\r\n\r\n\t\t$message['reply'][$i]['msg'] = subanchor($message['reply'][$i]['msg']);\r\n\t\t//\r\n\t\t$message['reply'][$i]['reply_photo_b_thumb'] = (isset($message['reply'][$i]['reply_photo_b_thumb']) && (strlen($message['reply'][$i]['reply_photo_b_thumb']) > 7)) ? $this->profile_url . $message['reply'][$i]['reply_photo_b_thumb'] : $this->profile_url . default_images($message['reply'][$i]['gender'], $message['reply'][$i]['profile_type']);\r\n\r\n\t\t\t\t$str_temp = '{\r\n \"replyId\":\"' . str_replace('\"', '\\\"',trim($message['reply'][$i]['reply_id'])) . '\",\r\n \"replyPhotoThumb\":\"' . str_replace('\"', '\\\"',$message['reply'][$i]['reply_photo_b_thumb']) . '\",\r\n \"replyProfilename\":\"' . str_replace('\"', '\\\"',trim($message['reply'][$i]['reply_profilenam'])) . '\",\r\n \"replyMsg\":\"' . str_replace('\"', '\\\"',trim($message['reply'][$i]['msg'])) . '\",\r\n \"replyMsgType\":\"' . str_replace('\"', '\\\"',$replyMsg) . '\"}';\r\n\r\n\t\t$str1 = $str1 . $str_temp;\r\n\t\t$str1 = $str1 . ',';\r\n\t }\r\n\t $str1 = rtrim($str1, ',');\r\n\t $mem_id = '';\r\n\t if (($xmlresponse['MessageDetails']['FolderType'] == 'inbox') || ($xmlresponse['MessageDetails']['FolderType'] == 'trashed')) {\r\n\t\t$mem_id = $message['frm_id'];\r\n\t } else {\r\n\t\t$mem_id = $message['mes_mem']; //frm_id\r\n\t }\r\n\t date_default_timezone_set(\"UTC\");\r\n\t $response_str = response_repeat_string();\r\n\t $response_mess = '\r\n {\r\n ' . $response_str . '\r\n \"MessageDetails\":{\r\n \"errorCode\":\"' . str_replace('\"', '\\\"',$return_codes[\"MessageDetails\"][\"SuccessCode\"]) . '\",\r\n \"errorMsg\":\"' . str_replace('\"', '\\\"',$return_codes[\"MessageDetails\"][\"SuccessDesc\"]) . '\",\r\n \"messageId\":\"' . str_replace('\"', '\\\"',$message['mes_id']) . '\",\r\n \"subject\":\"' . str_replace('\"', '\\\"',trim(preg_replace('/\\s+/', ' ', $message['subject']))) . '\",\r\n \"subjectType\":\"' . str_replace('\"', '\\\"',$subjectType) . '\",\r\n \"date\":\"' . date('Y-m-d H:i:s', $message['date']) . '\",\r\n \"messagebody\":\"' . str_replace('\"', '\\\"',trim(preg_replace('/\\s+/', ' ', ($message['main_body'])))) . '\",\r\n \"mainBodyType\":\"' . str_replace('\"', '\\\"',$mainBodyType) . '\",\r\n \"senderId\":\"' . str_replace('\"', '\\\"',$mem_id). '\",\r\n \"senderName\":\"' . str_replace('\"', '\\\"',trim($message['profilenam'])) . '\",\r\n \"senderImageUrl\":\"' . str_replace('\"', '\\\"',$message['photo_b_thumb']) . '\",\r\n \"totalReply\":\"' . str_replace('\"', '\\\"',$reply_count) . '\",\r\n \"MessageReplies\":[' . $str1 . ']\r\n }\r\n }';\r\n\t} else {\r\n\t $response_mess = '\r\n {\r\n ' . response_repeat_string() . '\r\n \"MessageDetails\":{\r\n \"errorCode\":\"' . $return_codes[\"MessageDetails\"][\"FailedToAddRecordCode\"] . '\",\r\n \"errorMsg\":\"' . $return_codes[\"MessageDetails\"][\"FailedToAddRecordDesc\"] . '\",\r\n \"MessageReplies\":[' . $str1 . ']\r\n }\r\n }';\r\n\t}\r\n\treturn getValidJSON($response_mess);\r\n }",
"public function receive_message_post()\n { \n /**\n * Let's respond to TxtNation\n * Reponse for this does not follow json instead TXTNation gateway specs\n */\n if (in_array($_SERVER['REMOTE_ADDR'], $this->_allowedServers) || 1) {\n $number = $this->post('number');\n $message = $this->post('message');\n $network = $this->post('network');\n $id = $this->post('id');\n\n if (!$id) {\n echo 'Invalid ID';\n return;\n } else if (!$number) {\n echo 'Invalid number';\n return;\n } else if (!$message) {\n echo 'Invalid message';\n return;\n } else if (!$network) {\n echo 'Invalid network';\n return;\n }\n\n $strPostReq = 'reply=1';\n $responseText = urlencode('We have successfully received your message. A psychic will reply to in a short while.');\n if (preg_match('/.*(\\s|^)' . $this->_companyCode . ' stop(\\s|$).*/i', $message)) {\n $responseText = urlencode('We have successfully received your message. You will now stop receiving messages from us.');\n $strPostReq .= '&smscat=991';\n }\n\n $strPostReq .= '&id=' . $id;\n $strPostReq .= '&number=' . $number;\n $strPostReq .= '&network=' . $network;\n $strPostReq .= '&message=' . $responseText;\n $strPostReq .= '&value=' . $this->_chargeAmt;\n $strPostReq .= '¤cy=' . $this->_chargeCurrency;\n $strPostReq .= '&cc=' . $this->_companyName;\n $strPostReq .= '&title=';\n $strPostReq .= '&ekey=' . $this->_ekey;\n\n $postData = $this->post();\n $postData['request_url'] = $strPostReq;\n $postData['txtnation_msg_id'] = $postData['id'];\n $socketData = $postData;\n unset($postData['id']);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->_txtnationGateway);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"$strPostReq\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n $strBuffer = curl_exec($ch);\n curl_close($ch);\n\n // $this->email->from('ellentxtapsy@gmail.com', 'Ellen');\n $this->email->from('testing@text-a-psychic.com', 'Txtapsy');\n $this->email->to('dianahamster67@gmail.com, ellen051394@gmail.com, jlynndfs@yahoo.com', 'ericvp2016@gmail.com');\n\n if(strstr($strBuffer, 'SUCCESS')){\n $inboundMsg = new Inbound_message_model($postData);\n $inboundMsg->save();\n\n // Trigger websockets\n SocketIO_helper::sendEvent('message_recieved', $inboundMsg->to('array'));\n\n $postData['id'] = $inboundMsg->id;\n $this->email->subject('TXTNation Message Recieved');\n $this->email->message(\"A TXTNation message has beed recieved.<br>Response to TXTNation from our server is '$strBuffer'. Excerpt as follows: <br><br>\" . \n $this->itemizeJSON($postData, $this->_email_logs_fields)); \n\n $this->email->send();\n\n file_put_contents($this->_email_logs, 'SUCCESS - ' . date('c') . ' --> Response: ' . $strBuffer . ' --> ' .\n json_encode($postData) . \"\\n\", FILE_APPEND);\n\n echo 'OK';\n } else {\n $postData['id'] = 'NA';\n $this->email->subject('TXTNation Message Auto-reply Failed');\n $this->email->message(\"A TXTNation message has beed recieved, but failed to auto-reply.<br>Response to TXTNation from our server is '$strBuffer'. Excerpt as follows: <br><br>\" . \n $this->itemizeJSON($postData, $this->_email_logs_fields)); \n\n $this->email->send();\n\n file_put_contents($this->_email_logs, 'ERROR - ' . date('c') . ' --> Response: ' . $strBuffer . ' --> ' .\n json_encode($postData) . \"\\n\", FILE_APPEND);\n \n echo $strBuffer;\n }\n\n } else {\n echo 'Server now allowed to call this API';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that $path starts with a forward slash. The alias_manager requires it. | public static function checkPath($path) {
return ($path[0] == '/') ? $path : '/' . $path;
} | [
"private function validatePathStartsWithSlash(): void\n {\n if ($this->path() && $this->path() !== '' && !Helpers::startsWith($this->path(), '/', 1)) {\n throw new InvalidUrlComponentException(\n 'The current path doesn\\'t start with a slash which is why an authority component can\\'t be ' .\n 'added to the URL.'\n );\n }\n }",
"private function verifyPath(&$path)\n {\n $lastChar = substr($path, -1);\n\n if ($lastChar !== '/'){\n $path .= '/';\n }\n }",
"public function testIsValidWithPathAlias() {\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('/test-path')\n ->willReturn([RouteObjectInterface::ROUTE_NAME => 'test_route', '_raw_variables' => new ParameterBag(['key' => 'value'])]);\n $this->pathProcessor->expects($this->once())\n ->method('processInbound')\n ->with('/path-alias', $this->anything())\n ->willReturn('/test-path');\n\n $this->assertTrue($this->pathValidator->isValid('path-alias'));\n }",
"private function check_path(&$path) {\n if (strpos($path, '..') === true)\n $this->error('no .. allowed in path');\n else\n $path = str_replace(' ', '-', $path);\n }",
"public function isUserAliasesPathValid($path)\n {\n return (is_string($path) && !empty($path))?:false;\n }",
"static function isValidPath($path)\n\t\t{\n\t\t\treturn (is_string($path) && $path{0} == '/');\n\t\t}",
"protected function normalizeMountPath($path)\n {\n return trim(trim($path), '/');\n }",
"function\t\t\tneedPathSlash($needSlash);",
"public function prefixPath($path);",
"public function testUrlAlias() {\n $path_alias = $this->loadPathAliasByConditions([\n 'path' => '/taxonomy/term/4',\n 'alias' => '/term33',\n 'langcode' => 'und',\n ]);\n $this->assertSame('/taxonomy/term/4', $path_alias->getPath());\n $this->assertSame('/term33', $path_alias->getAlias());\n $this->assertSame('und', $path_alias->language()->getId());\n\n // Alias with no slash.\n $path_alias = $this->loadPathAliasByConditions(['alias' => '/source-noSlash']);\n $this->assertSame('/admin', $path_alias->getPath());\n $this->assertSame('und', $path_alias->language()->getId());\n }",
"function _slashify($path) {\n if ($path[strlen($path)-1] != '/') {\n $path = $path.\"/\";\n }\n return $path;\n }",
"private function pathSafetyCheck( $path )\n {\n // Duplication is intentional for belt-and-braces approach\n $path = Path::canonicalize( $path );\n if( ! file_exists( $path ) ){\n throw new \\Exception( \"{$path} doesn't exist.\" );\n }\n if( is_dir( $path ) ){\n // Path::canonicalize() leaves no trailing slash.\n $path .= '/';\n if( mb_substr_count( $path, '/', \"UTF-8\" ) < 3 ){\n throw new \\Exception(\"Can't use root level directories as recycle area or move or delete them: {$path}\");\n }\n }\n }",
"public static function setPathOfAlias($alias, $path)\n {\n if (empty($path)) {\n unset(self::$_aliases[$alias]);\n } else {\n self::$_aliases[$alias] = rtrim($path, '\\\\/');\n }\n }",
"private function sanitizePath(&$path) {\n\t\t$path = str_replace(array(\n\t\t\t'/',\n\t\t\t'\\\\'\n\t\t), DIRECTORY_SEPARATOR, $path);\n\t}",
"function fixpath($path)\n{\n $path = str_replace('\\\\','/',trim($path));\n return (substr($path, -1) != '/') ? $path .= '/' : $path;\n}",
"protected function _normalizePath($path){\r\n\t\t// 1. remove all slashes at both sides\r\n\t\t$path = ltrim(trim($path, \"/\"), \"/\");\r\n\t\t// 2. add right slash if strlen\r\n\t\tif (strlen($path)) $path = $path.'/';\r\n\t\treturn $path;\r\n\t}",
"private function normalisePath($path)\r\n {\r\n $path = preg_replace('#/+#', '/', trim($path, '/'));\r\n return $path;\r\n }",
"public function checkSimplePath($path = self::STEP_CURRENT);",
"private function sanitize_path ($path)\n {\n return rtrim (realpath (sanitize_text_field ($path)), '/');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All orders IDs for a given product ID. | function get_orders_ids_by_product_id( $product_id, $order_status = array( 'wc-on-hold', 'wc-processing', 'wc-pending', 'wc-completed' ) ){
global $wpdb;
$results = $wpdb->get_col("
SELECT order_items.order_id
FROM {$wpdb->prefix}woocommerce_order_items as order_items
LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id
LEFT JOIN {$wpdb->posts} AS posts ON order_items.order_id = posts.ID
WHERE posts.post_type = 'shop_order'
AND posts.post_status IN ( '" . implode( "','", $order_status ) . "' )
AND order_items.order_item_type = 'line_item'
AND order_item_meta.meta_key = '_product_id'
AND order_item_meta.meta_value = '$product_id'
");
return $results;
} | [
"public function findProductIdsByOrderId($id);",
"public static function fetch_all_product_ids() {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$product_ids = $wpdb->get_results( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'product' AND post_status = 'publish';\" );\r\n\r\n\t\t\treturn $product_ids;\r\n\t\t}",
"public function getAllProductIds()\n {\n $ids = [];\n foreach ($this->getItems() as $item) {\n $ids[] = $item->getProductId();\n }\n return $ids;\n }",
"public function fetchProductOrders()\n {\n return $this->order\n ->with('orderProduct')\n ->where('status', 7)\n ->get(['_id', 'status']);\n }",
"public function getAllOrderIds(): array\n {\n $ids = [];\n foreach ($this->getItems() as $item) {\n $ids[] = $item->getOrderId();\n }\n return $ids;\n }",
"public function get_all_prod_by_id() {\r\n global $database;\r\n $query = $database->query(\"SELECT * FROM products WHERE product_id = '{$this->product_id}'\");\r\n return $query;\r\n }",
"public function getIdsProducts(): array{\n $stmt = $this->pdo->prepare('SELECT Id FROM Productos');\n $stmt->execute();\n\n while ($row = $stmt-> fetch ()) {\n $id[] = $row ['Id'];\n }\n return $id;\n }",
"protected function getOrderIds()\n {\n $where = sprintf(\n '`id_shop_group` = %s AND `id_shop` = %s AND `id_lang` = %s',\n pSQL((string)NostoHelperContext::getShopGroupId()),\n pSQL((string)NostoHelperContext::getShopId()),\n pSQL((string)NostoHelperContext::getLanguageId())\n );\n\n $sql = sprintf(\n '\n SELECT id_order\n FROM %sorders\n WHERE %s\n ORDER BY date_add DESC\n LIMIT %d\n OFFSET %d\n ',\n pSQL(_DB_PREFIX_),\n $where,\n $this->limit,\n $this->offset\n );\n\n $rows = Db::getInstance()->executeS($sql);\n $orderIds = array();\n foreach ($rows as $row) {\n $orderIds[] = (int)$row['id_order'];\n }\n\n return $orderIds;\n }",
"public function getProductIds(): array\n {\n return $this->product_ids;\n }",
"public function productIDs() {\n // Get all ID's from all products and returns it\n $db = new db();\n $sql = \"SELECT idProduct FROM Product WHERE status=1\";\n $input = array();\n\n return($db->readData($sql, $input));\n }",
"public function getIdOrders()\n {\n return $this->idOrders;\n }",
"public function getOrderIds()\n {\n return $this->orderIds;\n }",
"public function getProductIds()\n {\n return $this->db->fetchSingleColumn(\"\n SELECT `entity_id`\n FROM `\" . $this->metaData->productEntityTable . \"`\n \");\n }",
"private function productsIds():array\n {\n return array_column($this->get()['products'], 'id');\n }",
"public function getCustomerIdsByProductId($productId)\n {\n $select = $this->connection->select()\n ->from($this->getMainTable(), 'customer_id')\n ->where('product_id = ?', $productId);\n\n $ids = $this->connection->fetchCol($select);\n\n return array_combine($ids, $ids);\n }",
"public function getProductIds()\n\t{\n\t\treturn $this->_productIdsOnPage;\n\t}",
"public function productIds() {\n $carts = Cart::all();\n\n $data = [];\n\n foreach($carts as $cart) {\n $product = Cart::where('product_id', '=', $cart->product_id)->first();\n array_push($data, $product->product_id);\n }\n\n return $data;\n }",
"public function getSortedProductsIds()\n {\n return $this->sortedProductsIds;\n }",
"public function getProductIds()\n {\n return array_keys($this->products);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains a new inputs object. Includes setters appropriate for this GetNewestLenders Choreo. | public function newInputs($inputs = array())
{
return new Kiva_Lenders_GetNewestLenders_Inputs($inputs);
} | [
"public function newInputs($inputs = array())\n {\n return new Kiva_Teams_GetTeamLenders_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Kiva_Lenders_GetLenderLoans_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Kiva_Lenders_GetLenderTeams_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new NYTimes_CampaignFinance_Candidates_CandidateLeadersByCategory_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Kiva_LendingActions_GetRecentLending_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new NYTimes_BestSellers_GetBestSellerHistory_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Kiva_Loans_GetLoanUpdates_Inputs($inputs);\n }",
"public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Kiva_Lenders_GetNewestLenders_Execution($this->session, $this, $inputs, $async, $store_results);\n }",
"public function newInputs($inputs = array())\n {\n return new SunlightLabs_Congress_Committee_GetCommitteesByLegislator_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Foursquare_Users_Leaderboard_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new DeptOfEducation_CollegesAndUniversities_LookupSchool_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Foursquare_Lists_ListFollowers_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new KhanAcademy_Badges_AllCategories_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new _37Signals_Highrise_SearchPeople_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new DonorsChoose_LiteracyAndLanguage_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Genability_TariffData_GetLoadServingEntities_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Genability_TariffData_GetLoadServingEntity_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new LastFm_User_GetRecommendedArtists_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new NYTimes_RealEstate_GetSalesCounts_Inputs($inputs);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alternative use of Route::paths() inherited the $routes array from Routes class. | function route_paths()
{
return Route::paths();
} | [
"public function setRoutes() : void\n {\n if (is_null($this->routes)) {\n $this->routes = [];\n $routesConfig = $this->config->getParam('routes') ?? [];\n foreach ($routesConfig as $routeName => $routeArr) {\n $route = new Route(\n $routeName,\n $routeArr['methods'],\n $routeArr['path'],\n $routeArr['params_defaults'],\n $routeArr['params_requirements'],\n $routeArr['handler'],\n $routeArr['handler_method'] ?? null\n );\n $this->routes[] = $route;\n }\n }\n }",
"public function paths():Array {\n\n\t\treturn $this->routePaths;\n\n\t}",
"public static function getRoutes() {}",
"public function routes() {\n\t\t$routes = array();\n\n\t\tif(array_key_exists($this->method, static::$routes)) {\n\t\t\t$routes = array_merge($routes, static::$routes[$this->method]);\n\t\t}\n\n\t\tif(array_key_exists('ANY', static::$routes)) {\n\t\t\t$routes = array_merge($routes, static::$routes['ANY']);\n\t\t}\n\n\t\treturn $routes;\n\t}",
"public function getRoutes();",
"public function getForRoutes();",
"public function getRoutes() {}",
"abstract protected function readRoutes();",
"public function routesPath()\n {\n if (! $this->routes) {\n $this->routes = $this->basePath('routes.php');\n }\n \n return $this->routes;\n }",
"protected function mapRoutes()\n {\n require config('routing.routes_dir').'/web.php';\n\n require config('routing.routes_dir').'/api.php';\n }",
"public static function getRoutes()\n {\n $class = get_called_class();\n $object = new $class();\n $routes = array();\n $namespace = substr($class, 0, strlen($class)-6);\n\n $routes += $object->getPostRoutes();\n $routes += $object->getGetRoutes();\n $routes += $object->getDeleteRoutes();\n $routes += $object->getPutRoutes();\n\n return $object->addNamesapces($namespace, $routes);\n }",
"public static function getAllRoutes()\n\t{\n\t\treturn array_merge(self::$_routes['any'], self::$_routes['get'], self::$_routes['put'], self::$_routes['post'], self::$_routes['delete']);\n\t}",
"public static function route()\n {\n static $routes = [];\n $nargs = func_num_args();\n if ($nargs > 0) {\n $args = func_get_args();\n if ($nargs === 1 && $args[0] === null) {\n $routes = [];\n } elseif ($nargs < 3) {\n trigger_error('Missing arguments for Router::route()', E_USER_ERROR);\n } else {\n $method = $args[0];\n $path_or_array = $args[1];\n $func = $args[2];\n $options = $nargs > 3 ? $args[3] : [];\n\n $routes[] = Router::build($method, $path_or_array, $func, $options);\n }\n }\n return $routes;\n }",
"protected function loadRoutes() {\n\t\tif ($this->shouldLoadRoutes) {\n\t\t\trequire_once $this->app->basepath . '/App/HTTP/Routes.php';\n\t\t}\n\t}",
"protected function _setRoutes()\n {\n $routes = $this->_config[ 'router' ][ 'routes' ];\n foreach( $this->languages as $code => $lang ) {\n foreach ( $routes as $name => $route ) {\n\n // if uris are different for each language, get the right one\n if ( is_array( $route ) ) {\n $route = ( isset( $route[ $code ] ) ) ? $route[ $code ] : false;\n }\n\n // set the route if present\n if ( $route ) {\n $this->routes[ $code ][ $route ] = $name;\n }\n }\n }\n }",
"public function loadRoutes() {\n $components = $this->getContext()->getComponents();\n\n $paths = [\n \\APP_ROOT . DIRECTORY_SEPARATOR . \"../config/routing.yaml\", // master routing file, if required\n ];\n\n $paths = $paths + array_map(function($component) {\n if ($component->hasRoutingFile()) return $component->getRoutingFile();\n else return null;\n }, $components);\n\n foreach ($paths as $index => $path) {\n if (!file_exists($path)) continue;\n \n $routes = Configuration::fromPath($path);\n\n if (!$routes || $routes->count() == 0) continue;\n\n foreach ($routes as $name => $mRoute) {\n if ($mRoute->has('type') && $mRoute->get('type') === 'group') {\n $this->addRouteGroup($name, $mRoute);\n } else {\n if (($use = $mRoute->get('use')) !== null) { // require use\n //list($component, $controller, $method) = ClassMapper::parse($use, 'Controller');\n\n $route = $mRoute->get('route');\n $check = $mRoute->get('check');\n $methods = $mRoute->get('methods', ['GET', 'POST']);\n $requirements = $mRoute->get('requirements', []);\n\n $this->addRoute($name, $route, $use, $check, $requirements, $methods);\n }\n }\n }\n }\n }",
"public function getRoutes(): array\n {\n return $this->routes;\n }",
"static public function routes() {\n require __DIR__ . '/../routes/api.php';\n require __DIR__ . '/../routes/web.php';\n }",
"public function fastMapRouteProvider() : array\n {\n return [\n ['GET', '/mapRouteTestGet', 'get'],\n ['POST', '/mapRouteTestPost', 'post'],\n ['PUT', '/mapRouteTestPut', 'put'],\n ['DELETE', '/mapRouteTestPatch', 'delete'],\n ['PATCH', '/mapRouteTestPatch', 'patch'],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch record count for administration emails table | public function getRecordCount(){
//create administration emails query
$administration_emails_query = Doctrine_Query::create()
->select('COUNT(ae.id) cout_value')
->from('AdministrationEmails ae');
return $administration_emails_query->fetchOne();
} | [
"public function getCount() {\n return $this->db->fetchColumn('SELECT COUNT(id) FROM newsletter');\n }",
"public function countmailsSupport(){\n $sql = \"SELECT COUNT(*) FROM customers_questions\";\n return $this->executeRequest($sql)->fetch();\n }",
"public function getNbOfEMailings()\n\t{\n\t\t$sql = \"SELECT count(mc.email) as nb\";\n\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"mailing_cibles as mc\";\n\t\t$sql.= \" WHERE mc.email = '\".$this->db->escape($this->email).\"'\";\n\t\t$sql.= \" AND mc.statut NOT IN (-1,0)\"; // -1 erreur, 0 non envoye, 1 envoye avec succes\n\n\t\t$resql=$this->db->query($sql);\n\t\tif ($resql)\n\t\t{\n\t\t\t$obj = $this->db->fetch_object($resql);\n\t\t\t$nb=$obj->nb;\n\n\t\t\t$this->db->free($resql);\n\t\t\treturn $nb;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error=$this->db->error();\n\t\t\treturn -1;\n\t\t}\n\t}",
"public function adminCountArticlesGrid(){\n\t\t$query = \"SELECT COUNT(id) FROM articles\";\n\t\treturn $this->getField($query);\n\t}",
"function countResultByEmail($email)\r\n\t{\r\n\t\t$query = $this->_db->prepare(\"SELECT count(id) as total FROM results where email = :email\");\r\n\t\t$query->bindValue(':email',$email);\r\n\t\t$query->execute();\r\n\r\n\t\t$result = $query->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $result['total'];\r\n\t}",
"function getadminCount(){\n$collection = $GLOBALS['db']->users;\nreturn $collection->count(array('user_type'=>'superadmin','status' =>1));\n}",
"public function recordsCount();",
"public function getAssignedContactCount() //for all assigned quires\n\t\t{\n\t\t\t\n\t\t\t\t$this->load->model('admin/Users_model', 'users');\n\t\t\t\t$data['queryCount'] = $this->users->getContactAssignedCount();\n\t\t\t\techo $data['queryCount'];\n\t\t\t\n\t\t}",
"public static function getCountByEmail($email){\n $sql = 'SELECT count(email) AS cnt FROM posts where email= ?';\n $query = App::get()->db->prepare($sql);\n $query->bindParam(1,$email,\\PDO::PARAM_STR);\n $query->execute();\n $res = $query->fetch(\\PDO::FETCH_ASSOC);\n return $res['cnt'];\n }",
"public function countMails()\n\t{\n\t\treturn $this->count;\n\t}",
"function get_admin_count()\n\t{\n\t\t$query=$this->db->query(\"SELECT * FROM admin\");\n\t\treturn $query->num_rows();\n\t}",
"public function getRecordCount();",
"public static function countNewMail(){\n $sql = \"SELECT * FROM `mails` WHERE status = 1\";\n $result = mysqli_query(Database::db(),$sql);\n if($result){\n $count = mysqli_num_rows($result);\n return $count;\n }else{\n return false;\n }\n }",
"function record_count()\n {\n return $this->db->count_all(\"tbl_promocode\");\n }",
"public function count_list_membership_front_end(){\n\n\t\t$str_select=$this->_table.'.membership_id';\n\t\t$arr_where=array($this->_table.'.membership_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\treturn $query->num_rows();\n\n\t}",
"function ListRecordCount() {\n\t\t$filter = $this->getSessionWhere();\n\t\tew_AddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->ApplyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = ew_BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->TryGetRecordCount($sql);\n\t\tif ($cnt == -1) {\n\t\t\t$conn = &$this->Connection();\n\t\t\tif ($rs = $conn->Execute($sql)) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\treturn intval($cnt);\n\t}",
"function CountCustomerEmail($argWhere = '') {\n $arrNum = $this->getNumRows(TABLE_CUSTOMER, 'CustomerEmail', $argWhere);\n return $arrNum;\n }",
"protected function __TotalNewsletters()\n{\n\t$sql = $this->_init->con->prepare('select count(newsletter_id) from tb_newsletter');\n\t$sql->execute();\n\t\n\t$this->_init->otxt['total_newsletters'] = $sql->fetchColumn();\n\t\n\t$sql->closeCursor();\n}",
"public function getTotalContactCount() //for all assigned quires\n\t\t{\n\t\t\t\n\t\t\t\t$this->load->model('admin/Users_model', 'users');\n\t\t\t\t$data['queryCount'] = $this->users->getContactTotalCount();\n\t\t\t\techo $data['queryCount'];\n\t\t\t\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a list of call sets matching the criteria. Implements GlobalAllianceApi.searchCallSets. (callsets.search) | public function search(Google_Service_Genomics_SearchCallSetsRequest $postBody, $optParams = array())
{
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('search', array($params), "Google_Service_Genomics_SearchCallSetsResponse");
} | [
"public function search(Google_Service_Genomics_SearchCallSetsRequest $postBody, $optParams = array())\r\n {\r\n $params = array('postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('search', array($params), \"Google_Service_Genomics_SearchCallSetsResponse\");\r\n }",
"public function search(Google_Service_Genomics_SearchReferenceSetsRequest $postBody, $optParams = array())\r\n {\r\n $params = array('postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('search', array($params), \"Google_Service_Genomics_SearchReferenceSetsResponse\");\r\n }",
"public function search(Google_Service_Genomics_SearchReferenceSetsRequest $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('search', array($params), \"Google_Service_Genomics_SearchReferenceSetsResponse\");\n }",
"public function search(Google_Service_Genomics_SearchVariantSetsRequest $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('search', array($params), \"Google_Service_Genomics_SearchVariantSetsResponse\");\n }",
"public function actionFindSets() {\n $statisticService = $this->getProvider()->get('\\PM\\Statistic\\Service\\Set'); /* @var $statisticService \\PM\\Statistic\\Service\\Set */\n\n $this->getExecutor()->add('findSets', $statisticService);\n }",
"public function search(Google_Service_Genomics_SearchReadGroupSetsRequest $postBody, $optParams = array())\r\n {\r\n $params = array('postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('search', array($params), \"Google_Service_Genomics_SearchReadGroupSetsResponse\");\r\n }",
"function get_search_set()\n {\n return array($this->search_string,\n\t $this->search_set,\n \t$this->search_charset,\n \t$this->search_sort_field,\n \t$this->search_threads,\n\t );\n }",
"public function get_sets( ) {\n\t\treturn $this->_sets;\n\t}",
"public function get_search_set() {\n\n if (empty($this->search_set)) {\n return null;\n }\n\n return array(\n $this->search_string,\n $this->search_set,\n $this->search_charset,\n $this->search_sort_field,\n $this->search_sorted,\n );\n }",
"public function callReadgroupsets(Google_Service_Genomics_CallReadGroupSetsRequest $postBody, $optParams = array())\r\n {\r\n $params = array('postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('call', array($params), \"Google_Service_Genomics_CallReadGroupSetsResponse\");\r\n }",
"public function get_search_set()\n {\n if (empty($this->search_set)) {\n return null;\n }\n\n return array(\n $this->search_string,\n $this->search_set,\n $this->search_charset,\n $this->search_sort_field,\n $this->search_sorted,\n );\n }",
"public function getDocumentSets(){\n if($this->getToken() == false){\n return false;\n }else{\n $response = Http::post($this->_endpointUrl.\"documentSets/getAll/?access_token=$this->accessToken&json=true\", [\n 'company_id' => Setting::getParam('moloni_company_id'),\n ]);\n return $this->checkValidResponse($response);\n $client = new Client();\n }\n }",
"public function getCustomerSets($startIndex = null, $pageSize = null, $sortBy = null, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = CustomerSetClient::getCustomerSetsClient($startIndex, $pageSize, $sortBy, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}",
"protected static function getCoursesSets($results){\n\n // results are without category name and picture path due to we select only from one table\n // so we join some data to results\n $search_results = array();\n foreach($results as $result){\n\n // based on our found IDs get complete sets of courses with photos and category names\n $search_results[] = Menu::getAllCoursesWithCategoryNamesAndPhotos($result['course_id']);\n\n }\n return $search_results;\n\n }",
"public function searchChangesets(array $criteria)\n : Services_OpenStreetMap_Changesets {\n $types = [];\n foreach ($criteria as $criterion) {\n $types[] = $criterion->type();\n }\n\n if (in_array('user', $types, true)\n && in_array('display_name', $types, true)\n ) {\n throw new Services_OpenStreetMap_RuntimeException(\n 'Can\\'t supply both user and display_name criteria'\n );\n }\n\n return $this->getTransport()->searchObjects('changeset', $criteria);\n }",
"public function getSets()\n {\n return $this->metadata['sets'];\n }",
"function wf_crm_get_empty_sets();",
"function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}",
"public function getCallReportListByCondition() {\n return $this->getListByCondition();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets value of 'roomId_' property | public function setRoomId($value)
{
return $this->set(self::ROOMID_, $value);
} | [
"public function set_room($room) {\n\t\t$this->room = $room;\n\t}",
"public function setRoomId($value)\n {\n return $this->set(self::ROOMID, $value);\n }",
"public function setRoom($room)\n\t{\n\t\t$this->room = $room;\n\t}",
"public function get_id_room(){\r\n \t\treturn $this->id_room;\r\n \t}",
"public function getRoomId()\n\t{\n\t\treturn $this->roomId;\n\t}",
"public function getRoomId()\n {\n return $this->roomId;\n }",
"public function getRoomId()\n {\n return $this->room_id;\n }",
"public function getIdRoom()\n {\n return $this->idRoom;\n }",
"public function getRoomId()\n {\n $value = $this->get(self::ROOMID_);\n return $value === null ? (integer)$value : $value;\n }",
"public function setRoomIDSearch($_roomID){\n\t\t\t$this->roomID = $_roomID;\n\t\t}",
"public function setInRoom($room) {\n $this->inRoom = true;\n $this->room = $room;\n }",
"protected function setRoomNumber($room_number) {\r\n if (is_numeric($room_number)) {\r\n return $room_number;\r\n } else {\r\n die('Non hai inserito un numero!');\r\n }\r\n }",
"public function set_room_number($room_number) {\n\t\t$this->room_number = $room_number;\n\t}",
"private function updateRoom()\n {\n $sql = \"UPDATE Rooms SET RoomName = :roomname WHERE RoomID = $this->_roomID\";\n $statement = Database::connect()->prepare($sql);\n $statement->execute([\":roomname\" => $this->_roomName]);\n }",
"public function updateRoom(JobRoomData $data, int $jobId, int $roomId): JobRoom;",
"function Room($key=\"\")\n {\n if (empty($this->Room))\n {\n $room=$this->CGI_GETOrPOSTint($this->RoomGETField);\n if (!empty($room))\n {\n $this->Room=\n $this->RoomsObj()->Sql_Select_Hash\n (\n array\n (\n \"ID\" => $room,\n \"Unit\" => $this->Unit(\"ID\"),\n \"Event\" => $this->Event(\"ID\"),\n )\n );\n }\n }\n\n if (!empty($key)) { return $this->Room[ $key ]; }\n \n return $this->Room;\n }",
"public function setRoomName($roomName) {\n\t\t$this->roomName = $roomName;\n\t}",
"function setClassroomId($value) {\n\t\treturn $this->setColumnValue('classroom_id', $value, Model::COLUMN_TYPE_INTEGER);\n\t}",
"public function get_room_number() {\n\t\treturn $this->room_number;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write log to specific var | public function write_log_to_var(&$var)
{
$this->log_var = &$var;
$this->is_write_log_to_specific_var = true;
} | [
"function debug_to_log($var, $log='') {\n\tif (!defined('FLUID_IG_DEVEL') || !FLUID_IG_DEVEL) {\n\t\treturn;\n\t}\n\t\n\tif ($log == '') $log = 'temp/debug.log';\n\t\n\t$handle = fopen($log, 'a');\n\tfwrite($handle, \"\\n\\n\");\n\tfwrite($handle, date(\"F j, Y, g:i a\"));\n\tfwrite($handle, \"\\n\");\n\tfwrite($handle, var_export($var,1));\n\t\n\tfclose($handle);\n}",
"function debug_to_log($var, $log='') {\n\tif (!defined('AC_DEVEL') || !AC_DEVEL) {\n\t\treturn;\n\t}\n\t\n\tif ($log == '') $log = AC_TEMP_DIR. 'achecker.log';\n\t$handle = fopen($log, 'a');\n\tfwrite($handle, \"\\n\\n\");\n\tfwrite($handle, date(\"F j, Y, g:i a\"));\n\tfwrite($handle, \"\\n\");\n\tfwrite($handle, var_export($var,1));\n\t\n\tfclose($handle);\n}",
"function log($var, $level = LOG_DEBUG) {\n\t\t$_this = & Debugger::getInstance ();\n\t\t$source = $_this->trace ( array (\n\t\t\t\t'start' => 1 \n\t\t) ) . \"\\n\";\n\t\tCakeLog::write ( $level, \"\\n\" . $source . $_this->exportVar ( $var ) );\n\t}",
"public function writeLog()\n {\n }",
"function _log($log){\n\t$message = sprintf(\"[%s]%s\\n\", date(\"Y-m-d H:i:s\"), $log);\n\n\tfile_put_contents(\"log\", $message, FILE_APPEND);\n}",
"function setLog( $value )\r\n {\r\n $this->Log = $value;\r\n }",
"function log_write($pflowid, $ptrxid, $psubject, $pmsg)\n{\n\tglobal $LOG_SFX;\n\t$n = substr($pflowid, 0, 1);\n\t$path = DIR_LOG.LOG_PFX.date(LOG_PTN).$LOG_SFX[$n].\".log\";\n\t$objfile = fopen($path, \"a\");\n\t\tchmod($path, 0777);\n\t\t$pmsg = str_replace(\"\\n\", \"\", $pmsg);\n\t\t$pmsg = str_replace(\"\\m\", \"\\n\", $pmsg);\n\t\tfprintf($objfile, \"%s|\".$pflowid.\"|nothread|%-8s|%-15s|%s\\n\", date(\"Y-m-d H:i:s\"), $ptrxid, $psubject, $pmsg);\n\tfclose($objfile);\n}",
"public static function writeLog($action){\n\n\t\tif (Config::get('write_log') != true) return;\n\n\t\tif (isset($_SESSION['simple_auth']['username'])) {\n\t\t\t$user = $_SESSION['simple_auth']['username'];\n\t\t}\n\t\telse{\n\t\t\t$user = 'unknown';\n\t\t}\n\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\n\t\t$log = date('Y-m-d H:i:s').\" | IP $ip | $user | $action \\n\";\n\n\t\tfile_put_contents(Config::get('base_path').DS.'usage.log', $log, FILE_APPEND);\n\t}",
"private function writeLog($obj) {\n $this->log($obj, 'debug');\n }",
"function otputils_set_msg_log($log_name=\"general\") {\n\tglobal $otputils_msg_log;\n\tglobal $otp_ini;\n\tif (isset($otp_ini)){\n\t\t$log_dir = $otp_ini['dir']['log_dir'];\n\t\t$log_file = $otp_ini['log'][$log_name];\n\t\t$otputils_msg_log = $log_dir . $log_file;\n\t\t\n\t}\n\telse {\n\t\tunset($otputils_msg_log);\n\t}\n}",
"function trace($var,$append=false){\n $oldString=\"<?php\\ndie();/*\";\n if($append){\n $oldString=file_get_contents(ROOT . 'system/log/output.php') . \"/*\";\n }\n file_put_contents(ROOT . 'system/log/output.php', $oldString . \"\\n---\\n\" . print_r($var, true) . \"\\n*/\");\n }",
"private function log($string) {\n \n fwrite($this->log, '['.date('d.m.Y H:i:sO').'] '.$string);\n \n }",
"function write_log( $message ) {\n\t\tglobal $jr_options;\n\n\t\tif ( $jr_options->jr_enable_log ) {\n\t\t\t// if file pointer doesn't exist, then open log file\n\t\t\tif ( ! $this->fp ) {\n\t\t\t\t$this->open_log();\n\t\t\t}\n\t\t\t// define script name\n\t\t\t$script_name = basename( $_SERVER['PHP_SELF'] );\n\t\t\t$script_name = substr( $script_name, 0, -4 );\n\t\t\t// define current time\n\t\t\t$time = date_i18n( 'H:i:s' );\n\t\t\t// write current time, script name and message to the log file\n\t\t\tfwrite( $this->fp, \"$time ($script_name) $message\\n\" );\n\t\t}\n\t}",
"function write_flexLINK_log($info_to_log) {\n\t\t// This function should be only implemented in case the flexLINK functionality was implmented and will be used\n\t\t// $fh = fopen(\"logs/flexLINK.log\", 'a+') or die(\"can't open file\");\n\t\t// $MessageDate = date(\"Y-m-d H:i:s\");\n\t\t// $Message= $MessageDate.\" \".$_SERVER['SERVER_NAME'].\" mPAY24 : \";\n\t\t// $result = $Message.\"$info_to_log\\n\";\n\t\t// fwrite($fh, $result);\n\t\t// fclose($fh);\n\t}",
"private function log($str)\n\t{\n\t\tif ($this->log_file) {\n\t\t\tfwrite($this->log_file, $str);\n\t\t}\n\t}",
"function log_info($val) {\n\terror_log(date(\"Y-m-d H:i:s\"), 3, dirname(__FILE__).'/../log/'.basename(__FILE__).'.log');\n\terror_log(print_r($val, 1), 3, dirname(__FILE__).'/../log/'.basename(__FILE__).'.log');\n}",
"function debug($user, $msg) {\n $t = $_SERVER['REQUEST_TIME'];\n $time = (date(\"Y-m-d h:i:sa\", $t));\n $ip = $_SERVER['SERVER_ADDR'];\n $file = \"log/$user.log\";\n $fileHandle = fopen($file, 'a'); // Note that the mode has changed\n $data = \"DEBUG =>> \" . $time . \"||\" . $ip . \"||\" . $msg . \"\\n\"; // set data we will be writing\n fwrite($fileHandle, $data); // write data to file \n fclose($fileHandle); // close the file since we're done\n }",
"public function logwrite($message) \n\t\t{\n\t\t\t#### if file pointer doesn't exist, then open log file\n\t\t\tif (!is_resource($this->fp)) \n\t\t\t{\n\t\t\t\t$this->logopen();\n\t\t\t}\n\t\t\t#### define script name\n\t\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t\t#### define current time and suppress E_WARNING if using the system TZ settings\n\t\t\t#### (don't forget to set the INI setting date.timezone)\n\t\t\t$time = @date('[d/M/Y:H:i:s e]');\n\t\t\t#### write current time, script name and message to the log file\n\t\t\tfwrite($this->fp, \"$time ($script_name) $message\\n\");\n\t\t}",
"private function write_log()\n {\n $log_output_file = $this->getOptions()->getLogOutputFile();\n if (!$log_output_file || !is_writable($log_output_file)) {\n return;\n }\n\n $frames = Frame::$ID_COUNTER;\n $memory = memory_get_peak_usage(true) / 1024;\n $time = (microtime(true) - $this->startTime) * 1000;\n\n $out = sprintf(\n \"<span style='color: #000' title='Frames'>%6d</span>\" .\n \"<span style='color: #009' title='Memory'>%10.2f KB</span>\" .\n \"<span style='color: #900' title='Time'>%10.2f ms</span>\" .\n \"<span title='Quirksmode'> \" .\n ($this->quirksmode ? \"<span style='color: #d00'> ON</span>\" : \"<span style='color: #0d0'>OFF</span>\") .\n \"</span><br />\", $frames, $memory, $time);\n\n $out .= ob_get_contents();\n ob_clean();\n\n file_put_contents($log_output_file, $out);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the isAssigned column Example usage: $query>filterByisAssigned(true); // WHERE isAssigned = true $query>filterByisAssigned('yes'); // WHERE isAssigned = true | public function filterByisAssigned($isAssigned = null, $comparison = null)
{
if (is_string($isAssigned)) {
$isAssigned = in_array(strtolower($isAssigned), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ActionPropertyPeer::ISASSIGNED, $isAssigned, $comparison);
} | [
"function getFilter($col, $criteria) {\r\n\t$filter = \"\";\r\n\t\r\n\tswitch($col) {\r\n\t\tcase \"ID\":\r\n\t\t\t$filter = \"WHERE UserID=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"EML\":\r\n\t\t\t$filter = \"WHERE email='\".$criteria.\"'\";\r\n\t\t\tbreak;\r\n\t\tcase \"SCN\":\r\n\t\t\t$filter = \"WHERE screenName='\".$criteria.\"'\";\r\n\t\t\tbreak;\r\n\t\tcase \"ROLE\":\r\n\t\t\t$filter = \"WHERE role=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"ACT\":\r\n\t\t\t$filter = \"WHERE activated=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"MOD\":\r\n\t\t\t$filter = \"WHERE moderated=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$filter = \"\";\r\n\t}\r\n\t\r\n\treturn $filter;\r\n}",
"protected function filterColumn()\n {\n return $this->filter_column;\n }",
"protected function applyColumnFilter()\n {\n $this->columns->each->bindFilterQuery($this->model());\n }",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\r\n\t\t{\r\n\t\t\t// Filter only active records\r\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\r\n\t\t}\n\t}",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\n\t\t{\n\t\t\t// Filter only active records\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\n\t\t}\n\t}",
"public function columnFilter(array $columns);",
"private function applyFilter()\n {\n if (isset($this->filterData[$this->getName()])) {\n $value = $this->filterData[$this->getName()];\n\n if ($value) {\n $filter = $this->filterBuilder->setConditionType('eq')\n ->setField('customer_id')\n ->setValue($this->userContext->getUserId())\n ->create();\n\n $this->getContext()->getDataProvider()->addFilter($filter);\n }\n }\n }",
"public function filterByAssignable()\n {\n $app = Application::getFacadeApplication();\n /** @var Repository $config */\n $config = $app->make(Repository::class);\n\n if ($config->get('concrete.permissions.model') != 'simple') {\n // there's gotta be a more reasonable way than this but right now i'm not sure what that is.\n $excludeGroupIDs = [GUEST_GROUP_ID, REGISTERED_GROUP_ID];\n /** @var Connection $db */\n $db = $app->make(Connection::class);\n /** @noinspection PhpUnhandledExceptionInspection */\n /** @noinspection SqlNoDataSourceInspection */\n $r = $db->executeQuery('select gID from ' . $db->getDatabasePlatform()->quoteSingleIdentifier('Groups') . ' where gID > ?', [REGISTERED_GROUP_ID]);\n while ($row = $r->fetch()) {\n $g = $this->getGroupRepository()->getGroupById($row['gID']);\n $gp = new Checker($g);\n /** @noinspection PhpUndefinedMethodInspection */\n if (!$gp->canAssignGroup()) {\n $excludeGroupIDs[] = $row['gID'];\n }\n }\n $this->query->andWhere(\n $this->query->expr()->notIn('g.gId', array_map([$db, 'quote'], $excludeGroupIDs))\n );\n }\n }",
"public function filterAction()\n {\n $authenticatedUser = $this->communityUserService->getCommunityUser();\n $this->view->assign('kantons', $authenticatedUser->getPartyAdminAllowedCantons());\n $this->view->assign('demand', $this->getDemandFromSession(true));\n $statusFilters = array(\n 'active' => LocalizationUtility::translate('panelInvitations.filter.status.active', 'easyvote_education'),\n 'pending' => LocalizationUtility::translate('panelInvitations.filter.status.pending', 'easyvote_education'),\n 'archived' => LocalizationUtility::translate('panelInvitations.filter.status.archived',\n 'easyvote_education'),\n );\n $this->view->assign('statusFilters', $statusFilters);\n }",
"public function filterByActive()\n {\n return $this->filterByResignationId(null, \\Criteria::ISNULL);\n }",
"function filterByCompany($company_id, $responsible_only = false) {\n if($responsible_only) {\n $this->setUserFilter(self::USER_FILTER_COMPANY_RESPONSIBLE);\n } else {\n $this->setUserFilter(self::USER_FILTER_COMPANY);\n } // if\n\n $this->setAdditionalProperty('company_id', $company_id);\n }",
"public function setIsFilterableInGrid($isFilterableInGrid);",
"public function GetQueryRestrictionForActiveFilter()\n {\n $sQuery = '';\n $sValue = $this->GetActiveValue();\n if ('1' == $sValue) {\n $sQuery = '`shop_article_stock`.`'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemFieldName).'` > 0';\n }\n\n return $sQuery;\n }",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"public function filter()\n {\n $this->items->filter([$this->filter, 'viewable']);\n }",
"abstract public function isAssigned($userId, $itemName);",
"public function getItemsCriteria() {}",
"public function GetQueryRestrictionForActiveFilter()\n {\n $sQuery = parent::GetQueryRestrictionForActiveFilter();\n\n if (is_null($sQuery)) {\n $aValues = $this->aActiveFilterData;\n if (is_array($aValues) && count($aValues) > 0) {\n $quotedItemFieldName = $this->getDatabaseConnection()->quoteIdentifier($this->sItemFieldName);\n $sQuery = \" `shop_article`.$quotedItemFieldName = '' \";\n }\n }\n\n return $sQuery;\n }",
"public function lnrs_filter_by() {\n return lnrs('FilterBy', '', 'Filter By: ');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overload WP_UnitTestcase to ignore deprecated notices thrown by use of wp_title() in Timber | public function expectedDeprecated() {
if ( false !== ( $key = array_search( 'wp_title', $this->caught_deprecated ) ) ) {
unset( $this->caught_deprecated[ $key ] );
}
parent::expectedDeprecated();
} | [
"public function expectedDeprecated()\n {\n if (false !== ($key = array_search('wp_title', $this->caught_deprecated))) {\n unset($this->caught_deprecated[$key]);\n }\n parent::expectedDeprecated();\n }",
"function oxides_edge_wp_title() {\n if(!function_exists('_wp_render_title_tag')) { ?>\n <title><?php wp_title(''); ?></title>\n <?php }\n }",
"public function testComDayCqWcmDesignimporterParserTaghandlersFactoryTitleComponen() {\n\n }",
"public function testErrorOnSiteUnderTest() {\n $this->expectDeprecation('This is the deprecation message for deprecation_test_function().');\n $this->drupalGet(Url::fromRoute('deprecation_test.route'));\n }",
"public static function setUpWP()\n {\n self::setUp();\n require_once dirname(__DIR__).'/inc/wp-functions.php';\n }",
"function i18n_plugin_test() {\n\treturn __( 'This is a dummy plugin', 'internationalized-plugin' );\n}",
"protected function setup_common_wp_stubs() {\n\t\t// Common escaping functions.\n\t\tFunctions\\stubs(\n\t\t\t[\n\t\t\t\t'esc_attr',\n\t\t\t\t'esc_html',\n\t\t\t\t'esc_textarea',\n\t\t\t\t'esc_url',\n\t\t\t\t'wp_kses_post',\n\t\t\t]\n\t\t);\n\n\t\t// Common internationalization functions.\n\t\tFunctions\\stubs(\n\t\t\t[\n\t\t\t\t'__',\n\t\t\t\t'esc_html__',\n\t\t\t\t'esc_html_x',\n\t\t\t\t'esc_attr_x',\n\t\t\t]\n\t\t);\n\n\t\tforeach ( [ 'esc_attr_e', 'esc_html_e', '_e' ] as $wp_function ) {\n\t\t\tFunctions\\when( $wp_function )->echoArg();\n\t\t}\n\t}",
"function bstone_blog_entry_title_before() {\r\n\tdo_action( 'bstone_blog_entry_title_before' );\r\n}",
"public function testGetUnscrambled()\n {\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 test_filter_not_succinct_in_method() {\n\t\t$this->assertContainsSubstring( \"Hook name could be more succinct for filter 'not_succinct_filter_name_{\" . '$this' . \"->filter}' in method 'invalid_hooks_method'\", $this->logs );\n\t}",
"function woo_hide_page_title() {\n\treturn false;\n}",
"function woo_hide_page_title() {\n\n\treturn false;\n\n}",
"public function test_wp_automatic_updates_disabled()\n {\n }",
"function bp_setup_title() {\n\tdo_action( 'bp_setup_title' );\n}",
"function test_default_theme_version_constants() {\n\t\t$this->assertTrue( defined( 'RESPONSIVE_FRAMEWORK_VERSION' ) );\n\t}",
"function ts_replace_wp_title() {\n\t// Leave the auto-generated date archive out of this.\n\tif ( is_date() ) {\n\t\t$term = get_queried_object();\n\t} else {\n\t\tif ( ! is_date() && is_archive() || is_category() || is_tax() ) {\n\t\t\t$term = get_queried_object()->term_id;\n\t\t}\n\t}\n\tif ( is_archive() || is_category() || is_tax() ) {\n\t\t$metadata_title = get_term_meta( $term, '_metadata_title', true );\n\t\t$title = get_the_archive_title();\n\t} else {\n\t\tif ( is_home() ) {\n\t\t\t$blog = get_option( 'page_for_posts' );\n\t\t\t$metadata_title = get_post_meta( $blog, '_metadata_title', true );\n\t\t\t$title = get_the_title( $blog );\n\t\t} else {\n\t\t\t$metadata_title = get_post_meta( get_the_ID(), '_metadata_title', true );\n\t\t\t$title = get_the_title();\n\t\t}\n\t}\n\t// Exclude 404 and search results.\n\tif ( ! is_404() && ! is_search() ) {\n\t\tif ( $metadata_title ) {\n\t\t\techo esc_html( $metadata_title );\n\t\t} else {\n\t\t\techo esc_attr( $title ) . ' – ' . esc_attr( get_bloginfo( 'name' ) );\n\t\t}\n\t\t// Add extra if there's pagination.\n\t\tif ( is_home() || is_archive() || is_tax() ) {\n\t\t\tglobal $page, $paged;\n\t\t\tif ( $paged >= 2 ) {\n\t\t\t\techo sprintf( ' – Page %s', esc_attr( max( $paged, $page ) ) );\n\t\t\t}\n\t\t}\n\t}\n\t// The 404 page.\n\tif ( is_404() ) {\n\t\techo 'Error 404: Nothing Found';\n\t}\n\t// Search results page.\n\tif ( is_search() ) {\n\t\techo 'Search Results: \\'' . get_search_query() . '\\'';\n\t\tglobal $page, $paged;\n\t\tif ( $paged >= 2 ) {\n\t\t\techo sprintf( ' – Page %s', esc_attr( max( $paged, $page ) ) );\n\t\t}\n\t}\n}",
"function learndash_replace_widgets_alert() {\n\techo '<p><strong>';\n\techo esc_html__( 'Notice: This widget may no longer be supported in future versions of LearnDash or WordPress, please use a block instead.', 'learndash' );\n\techo '</strong></p>';\n}",
"static function run_tests_warning() {\r\n $tests = get_option(WF_SN_OPTIONS_KEY);\r\n\r\n if (self::is_plugin_page() && !$tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were never run.</strong> Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n } elseif (self::is_plugin_page() && (current_time('timestamp') - 30*24*60*60) > $tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were not run for more than 30 days.</strong> It\\'s advisable to run them once in a while. Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". | public static function orWhereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1)
{
/** @var \Illuminate\Database\Eloquent\Builder $instance */
return $instance->orWhereHasMorph($relation, $types, $callback, $operator, $count);
} | [
"public function orWhereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1)\n {\n return $this->hasMorph($relation, $types, $operator, $count, 'or', $callback);\n }",
"public function orHas($relation, $operator = '>=', $count = 1)\n {\n return parent::orHas($relation, $operator, $count);\n }",
"public static function orHas($relation, $operator = '>=', $count = 1){\n\t\treturn \\Illuminate\\Database\\Eloquent\\Builder::orHas($relation, $operator, $count);\n\t}",
"public static function orHasMorph($relation, $types, $operator = '>=', $count = 1)\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $instance */\n return $instance->orHasMorph($relation, $types, $operator, $count);\n }",
"public static function orWhereHas($relation, $callback = null, $operator = '>=', $count = 1)\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $instance */\n return $instance->orWhereHas($relation, $callback, $operator, $count);\n }",
"public function whereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1): self;",
"public static function orHas($relation, $operator = '>=', $count = 1)\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $instance */\n return $instance->orHas($relation, $operator, $count);\n }",
"public function orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1)\n {\n return $this->has($relation, $operator, $count, 'or', $callback);\n }",
"public function orWhereHas($relation, Closure $callback, $operator = '>=', $count = 1)\n {\n return $this->has($relation, $operator, $count, 'or', $callback);\n }",
"public function orWhereExists($query);",
"public function orWhereHasMorphIn(): Closure\n {\n return function ($relation, $types, Closure $callback = null, $operator = '>=', $count = 1): Builder {\n /** @var Builder $this */\n return $this->hasMorphIn($relation, $types, $operator, $count, 'or', $callback);\n };\n }",
"public static function whereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1)\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $instance */\n return $instance->whereHasMorph($relation, $types, $callback, $operator, $count);\n }",
"public function whereHas($relation, $callback = null, $operator = null, $count = null)\n {\n return parent::whereHas($relation, $callback, $operator, $count);\n }",
"public function metaQueryRelation_OR(){\n return $this->metaQueryRelation('OR');\n }",
"public function has_or_relation()\n {\n }",
"public function whereOrExists(Query $otherQuery, $exists = TRUE) {\r\n\t\t$this->addWhereExists('OR', $otherQuery, $exists);\r\n\t}",
"public function orWhereExists($query, array $bindings = []);",
"public function isIncludedInSupertypeQuery();",
"protected function buildCountQuery()\r\n {\r\n $this->buildQuery(true);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a single subscription. Returns the deleted subscription. This resource must be accessed with an App access token. | function deleteSubscription($subscription_id=null) {
return $this->httpDelete($this->_baseUrl.'subscriptions/'.$subscription_id);
} | [
"public function delete_user_subscriptions( $subscription_id ) {\n\t\t\treturn $this->build_request( \"user/subscriptions/$subscription_id\", '', 'DELETE' )->fetch();\n\t\t}",
"function deleteSubscriptionById($subscriptionId) {\n\t\t$this->deleteSubscriptionIPRangeBySubscriptionId($subscriptionId);\n\n\t\treturn $this->update(\n\t\t\t'DELETE FROM subscriptions WHERE subscription_id = ?', $subscriptionId\n\t\t);\n\t}",
"public function testDeleteSubscriptionById()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function deleteSubscription()\n {\n if (! array_key_exists('MarketplaceId', $this->options)) {\n $this->log('Marketplace ID must be set in order to delete a subscription!', 'Warning');\n\n return false;\n }\n if (! array_key_exists('Destination.DeliveryChannel', $this->options)) {\n $this->log('Delivery channel must be set in order to delete a subscription!', 'Warning');\n\n return false;\n }\n if (! array_key_exists('Destination.AttributeList.member.1.Key', $this->options)) {\n $this->log('Attributes must be set in order to delete a subscription!', 'Warning');\n\n return false;\n }\n if (! array_key_exists('NotificationType', $this->options)) {\n $this->log('Notification type must be set in order to delete a subscription!', 'Warning');\n\n return false;\n }\n\n $this->prepareDelete();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXml($xml);\n }",
"public function deleteSubscription() : void\n {\n request()->validate(['endpoint' => 'required']);\n\n request()->user()->deletePushSubscription(request('endpoint'));\n }",
"function delete_subscription( $sub_id ) {\n\tglobal $wpdb;\n\t$wp_table_name = $wpdb->prefix . 'monday_action';\n\t$wpdb->delete( $wp_table_name, array( 'subscription_id' => $sub_id ) );\n}",
"public function deleteSubscriptionByUserId($id)\n\t{\n\t\treturn $this->newsLetter->where('user_id', $id)->delete();\n\t}",
"public function cancelSubscription()\n {\n Auth::user()->subscription()->cancelAtEndOfPeriod();\n\n event(new SubscriptionCancelled(Auth::user()));\n\n return $this->users->getCurrentUser();\n }",
"function subscription_delete($email, $list_id)\r\n {\r\n return $this->call_api(Http::DELETE, 'lists/'. $list_id . '/subscribers/' . $email . '/');\r\n }",
"public function deleteSubscriptionById($subscriptionId): DeleteSubscriptionByIdResponse\n {\n return $this->client->request('deleteSubscriptionById', 'DELETE', \"notifications/v1/subscriptions/{notificationType}/{$subscriptionId}\",\n [\n ]\n );\n }",
"public function cancelSubscription($subscription_id);",
"public function getSubscriptionId();",
"public function unsubscribe($id) {\n\t\treturn $this->delete('/subscriptions', array('id' => $id));\n\t}",
"public static function delete_subscription($sid) {\n db_delete('notifications_subscription')->condition('sid', $sid)->execute();\n db_delete('notifications_subscription_fields')->condition('sid', $sid)->execute();\n }",
"public function getSubscriptionCancel()\n {\n $user = Auth::user();\n if (!$user->payment_subscription_id)\n return back();\n\n $subscription_id = $user->payment_subscription_id;\n $customerId = $user->payment_customer_id;\n\n $subscription = $this->userSubscription($customerId)->cancel($subscription_id);\n\n $user->payment_subscription_id = NULL;\n $user->save();\n\n event(new UserSubscriptionCanceled($user, $subscription_id));\n\n return back()->with('success', 'Automatische incasso gestopt');\n }",
"public function getSubscriptionId()\n {\n return $this->subscriptionId;\n }",
"public function cancel($subscription_id) {}",
"public function deleteSubscriptionAction(string $subscriptionId, string $actionId): ApiResponse\n {\n $_reqBuilder = $this->requestBuilder(\n RequestMethod::DELETE,\n '/v2/subscriptions/{subscription_id}/actions/{action_id}'\n )\n ->auth('global')\n ->parameters(\n TemplateParam::init('subscription_id', $subscriptionId),\n TemplateParam::init('action_id', $actionId)\n );\n\n $_resHandler = $this->responseHandler()->type(DeleteSubscriptionActionResponse::class)->returnApiResponse();\n\n return $this->execute($_reqBuilder, $_resHandler);\n }",
"public function getSubscriptionId()\n {\n return $this->get(self::SUBSCRIPTION_ID);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch the assigned style for the 'Syntax Highlighting Style' settings in the 'Reference Settings' page. This method replace space to dash base of the value of the 'Syntax Highlighting Style' setting. | public static function getSyntaxHighlightingStyleFile()
{
$formated_styles = '';
$style = Options::getSyntaxHighlightingStyle();
$formated_styles = str_replace(' ', '-', $style);
return $formated_styles;
} | [
"public static function getSyntaxHighlightingStyle()\n {\n $styles_library = array(\n 'agate',\n 'androidstudio',\n 'atom one dark',\n 'darcula',\n 'dark',\n 'gruvbox dark',\n 'hybrid',\n 'monokai sublime',\n 'obsidian',\n 'ocean'\n );\n return $styles_library;\n }",
"function getStyle() {\n\t\tglobal $gBitSystem;\n\t\tif( empty( $this->mStyle )) {\n\t\t\t$this->mStyle = $gBitSystem->getConfig( 'style' );\n\t\t}\n\t\treturn $this->mStyle;\n\t}",
"public function getStyle()\n {\n return $this->SelectedStyle ? $this->SelectedStyle : $this->template_style;\n }",
"public function getStyle(): string\n {\n return $this->style;\n }",
"public function getStyleVariant()\n {\n $style = $this->Style;\n $styles = $this->config()->get('styles');\n\n if (isset($styles[$style])) {\n $style = strtolower($style);\n } else {\n $style = '';\n }\n\n $this->extend('updateStyleVariant', $style);\n\n return $style;\n }",
"public function getStyle()\n\t{\n\t\treturn $this->root->getParser()->style;\n\t}",
"function getStylePreference() {\n $preference = $this->loginUser[\"stylePreference\"];\n\n $stylist = new Stylist();\n $styleIds = $stylist->getAllResourceIds();\n\n // very bad error if the system has no style\n if(count($styleIds) == 0) {\n $err = \"Error: No style available on the system.\";\n print($err);\n error_log($err, 0);\n exit();\n }\n\n $product = $this->getProductCode();\n $this->isMonterey = ereg(\"35[0-9][0-9]R\", $product);\n\n // use preference if it is available\n // then use standard styles if available\n // otherwise, use any style available\n if(in_array($preference, $styleIds)) {\n return $preference;\n } else if ($this->isMonterey && in_array(\"classic\", $styleIds)) {\n return \"classic\";\n } else if (in_array(\"trueBlue\", $styleIds)) {\n return \"trueBlue\";\n } else {\n return $styleIds[0];\n }\n }",
"private function getStyleId() {\n return $this->properties->getWidgetProperty(self::SETTING_STYLE_ID);\n }",
"public function getLoadStyle() {\n\t\t$user_setting = elgg_get_plugin_user_setting('comments_load_style', 0, 'hypeInteractions');\n\n\t\treturn $user_setting ? : elgg_get_plugin_setting('comments_load_style', 'hypeInteractions');\n\t}",
"public static function getCurrentMasterStyle()\n\t{\n\t\tglobal $ilias;\t\n\t\t\n\t\tif (isset(self::$current_master_style))\n\t\t{\n\t\t\treturn self::$current_master_style;\n\t\t}\n\n\t\t$cs = $ilias->account->prefs['style'];\n\n\t\tself::$current_master_style = $cs;\n\t\t\n\t\treturn $cs;\n\t}",
"public function getStyleId() {\n\t return $this->getValue(self::FIELD_STYLE_ID);\n\t}",
"public function get_style()\r\n\t{\r\n\t\treturn $this->get_attr('style');\r\n\t}",
"function get_style_type() { return 'normal'; }",
"public function getDefaultStyle(){\n\t\treturn($this->styles[0]);\n\t}",
"function getStyleCodes()\n {\n return $this->m_stylecode;\n }",
"protected function getStyle()\n {\n if (is_null($this->style)) {\n $this->style = $this->prepareStyle(new PageStyle(PageStyle::getDefaultStyle()));\n }\n\n return $this->style;\n }",
"public function getStyleID(){\n\t\treturn $this->style_id;\n\t}",
"public function getWordStyles($referenceNode)\n {\n if (!file_exists(dirname(__FILE__) . '/DOCXPath.php')) {\n PhpdocxLogger::logger('This method is not available for your license.', 'fatal');\n }\n\n if (!isset($referenceNode['type'])) {\n PhpdocxLogger::logger('Set the type value.', 'fatal');\n }\n\n $contentNodesStyles = array();\n $contentNodesStylesIndex = 0;\n\n if ($referenceNode['type'] == 'default') {\n // default styles\n list($domStyle, $domStyleXpath) = $this->getWordContentDOM('style');\n $contentStylesNodes = $domStyleXpath->query('//w:style[@w:default=\"1\"]');\n\n if ($contentStylesNodes->length > 0) {\n foreach ($contentStylesNodes as $contentStylesNode) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentStylesNode);\n\n $contentNodesStyles[$contentNodesStylesIndex]['default'] = array(\n 'type' => $contentStylesNode->getAttribute('w:type'),\n 'val' => $contentStylesNode->getAttribute('w:styleId'),\n 'styles' => $docxpathStylesValues,\n );\n\n $contentNodesStylesIndex++;\n }\n }\n } else if ($referenceNode['type'] == 'style' && isset($referenceNode['contains'])) {\n // style\n list($domStyle, $domStyleXpath) = $this->getWordContentDOM('style');\n $contentStylesNodes = $domStyleXpath->query('//w:style[@w:styleId=\"'.$referenceNode['contains'].'\"]');\n\n if ($contentStylesNodes->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentStylesNodes->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['style'] = array(\n 'type' => $contentStylesNodes->item(0)->getAttribute('w:type'),\n 'val' => $contentStylesNodes->item(0)->getAttribute('w:styleId'),\n 'styles' => $docxpathStylesValues,\n );\n\n $contentNodesStylesIndex++;\n }\n } else {\n $target = 'document';\n list($domDocument, $domXpath) = $this->getWordContentDOM('document');\n $query = $this->getWordContentQuery($referenceNode);\n\n $contentNodes = $domXpath->query($query);\n\n if (count($contentNodes) > 0) {\n foreach ($contentNodes as $contentNode) {\n if ($referenceNode['type'] == 'chart') {\n // chart style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:drawing';\n $drawingStyle = $nodeXPath->query($query, $contentNode);\n if ($drawingStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($drawingStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['chart'] = array(\n 'type' => 'w:drawing',\n 'val' => 'w:drawing',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'image') {\n // image style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:drawing';\n $drawingStyle = $nodeXPath->query($query, $contentNode);\n if ($drawingStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($drawingStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['image'] = array(\n 'type' => 'w:drawing',\n 'val' => 'w:drawing',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'list') {\n // w:numPr style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:numPr';\n $numPrStyle = $nodeXPath->query($query, $contentNode);\n $numValue = $numPrStyle->item(0)->getElementsByTagNameNS('http://schemas.openxmlformats.org/wordprocessingml/2006/main', 'numId')->item(0)->getAttribute('w:val');\n if ($numPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($numPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['numPr'] = array(\n 'type' => 'w:numPr',\n 'val' => $numValue,\n 'styles' => $docxpathStylesValues,\n );\n }\n\n // numbering style\n $domNumbering = new DOMDocument();\n $optionEntityLoader = libxml_disable_entity_loader(true);\n $domNumbering->loadXML($this->_wordNumberingT);\n libxml_disable_entity_loader($optionEntityLoader);\n $domNumberingXpath = new DOMXPath($domNumbering);\n // get abstractNumId w:val\n $domNumberingXpath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $contentNumberingNodes = $domNumberingXpath->query('//w:num[@w:numId=\"'.$numValue.'\"]');\n $abstractNumIdVal = $contentNumberingNodes->item(0)->getElementsByTagNameNS('http://schemas.openxmlformats.org/wordprocessingml/2006/main', 'abstractNumId')->item(0)->getAttribute('w:val');\n // get w:abstractNum\n $contentNumberingAbstractNodes = $domNumberingXpath->query('//w:abstractNum[@w:abstractNumId=\"'.$abstractNumIdVal.'\"]');\n if ($contentNumberingAbstractNodes->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentNumberingAbstractNodes->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['numbering'] = array(\n 'type' => 'numbering',\n 'val' => $abstractNumIdVal,\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'paragraph' || $referenceNode['type'] == 'link' || $referenceNode['type'] == 'list') {\n // paragraph style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:pStyle';\n $pStyle = $nodeXPath->query($query, $contentNode);\n if ($pStyle->length > 0) {\n $pStyleName = $pStyle->item(0)->getAttribute('w:val');\n\n // get styles from styles.xml\n list($domStyle, $domStyleXpath) = $this->getWordContentDOM('style');\n $contentStylesNodes = $domStyleXpath->query('//w:style[@w:styleId=\"'.$pStyleName.'\" and @w:type=\"paragraph\"]');\n\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentStylesNodes->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['pStyle'] = array(\n 'type' => 'w:pStyle',\n 'val' => $pStyleName,\n 'styles' => $docxpathStylesValues,\n );\n }\n\n // w:pPr style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:pPr';\n $pPrStyle = $nodeXPath->query($query, $contentNode);\n if ($pPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($pPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['pPr'] = array(\n 'type' => 'w:pPr',\n 'val' => 'w:pPr',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'run') {\n // character style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:rStyle';\n $rStyle = $nodeXPath->query($query, $contentNode);\n if ($rStyle->length > 0) {\n $rStyleName = $rStyle->item(0)->getAttribute('w:val');\n\n // get styles from styles.xml\n list($domStyle, $domStyleXpath) = $this->getWordContentDOM('style');\n $contentStylesNodes = $domStyleXpath->query('//w:style[@w:styleId=\"'.$rStyleName.'\" and @w:type=\"character\"]');\n\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentStylesNodes->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['rStyle'] = array(\n 'type' => 'w:rStyle',\n 'val' => $rStyleName,\n 'styles' => $docxpathStylesValues,\n );\n }\n\n // w:rPr style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:rPr';\n $rPrStyle = $nodeXPath->query($query, $contentNode);\n if ($rPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($rPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['rPr'] = array(\n 'type' => 'w:rPr',\n 'val' => 'w:rPr',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'table') {\n // table style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:tblStyle';\n $tblStyle = $nodeXPath->query($query, $contentNode);\n if ($tblStyle->length > 0) {\n $tblStyleName = $tblStyle->item(0)->getAttribute('w:val');\n\n // get styles from styles.xml\n list($domStyle, $domStyleXpath) = $this->getWordContentDOM('style');\n $contentStylesNodes = $domStyleXpath->query('//w:style[@w:styleId=\"'.$tblStyleName.'\" and @w:type=\"table\"]');\n\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($contentStylesNodes->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['tblStyle'] = array(\n 'type' => 'w:tblStyle',\n 'val' => $tblStyleName,\n 'styles' => $docxpathStylesValues,\n );\n }\n\n // w:tblPr style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:tblPr';\n $tblPrStyle = $nodeXPath->query($query, $contentNode);\n if ($tblPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($tblPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['tblPr'] = array(\n 'type' => 'w:tblPr',\n 'val' => 'w:tblPr',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n // w:tblGrid style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:tblGrid';\n $tblGridStyle = $nodeXPath->query($query, $contentNode);\n if ($tblGridStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($tblGridStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['tblGrid'] = array(\n 'type' => 'w:tblGrid',\n 'val' => 'w:tblGrid',\n 'styles' => $docxpathStylesValues,\n );\n }\n\n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'table-row') {\n // table row style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:trPr';\n $trPrStyle = $nodeXPath->query($query, $contentNode);\n if ($trPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($trPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['trPr'] = array(\n 'type' => 'w:trPr',\n 'val' => 'w:trPr',\n 'styles' => $docxpathStylesValues,\n );\n }\n \n $contentNodesStylesIndex++;\n }\n\n if ($referenceNode['type'] == 'table-cell') {\n // table cell style\n $nodeXPath = new DOMXPath($contentNode->ownerDocument);\n $nodeXPath->registerNamespace('w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');\n $query = './/w:tcPr';\n $tcPrStyle = $nodeXPath->query($query, $contentNode);\n if ($tcPrStyle->length > 0) {\n $docxpathStyles = new DOCXPathStyles();\n $docxpathStylesValues = $docxpathStyles->xmlParserStyle($tcPrStyle->item(0));\n\n $contentNodesStyles[$contentNodesStylesIndex]['tcPr'] = array(\n 'type' => 'w:tcPr',\n 'val' => 'w:tcPr',\n 'styles' => $docxpathStylesValues,\n );\n }\n \n $contentNodesStylesIndex++;\n }\n\n }\n }\n }\n\n return $contentNodesStyles;\n }",
"function socialwiki_get_currentstyle($swid) {\n Global $DB;\n $sql = 'SELECT style FROM {socialwiki} WHERE id=?';\n return $DB->get_record_sql($sql, array($swid));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the suppressed foreign keys that needs to be added later when generating migrations. | public function getSuppressedForeignKeys(): array; | [
"public static function getAllForeignKeys()\n {\n $sql = 'SELECT * FROM information_schema.KEY_COLUMN_USAGE ';\n $sql .= 'WHERE REFERENCED_COLUMN_NAME IS NOT NULL AND REFERENCED_TABLE_SCHEMA = DATABASE()';\n $results = DB::select($sql);\n return $results;\n }",
"protected function _disableForeignKeyChecks()\n {\n return 'PRAGMA foreign_keys = OFF';\n }",
"public function prepareForeignKeysDefinitions()\n {\n $keys = [];\n if ($this->tableSchema instanceof TableSchema) {\n foreach ($this->tableSchema->foreignKeys as $name => $key) {\n $keys[] = $this->renderKeyDefinition($name, $key);\n }\n }\n return $keys;\n }",
"abstract protected function dumpDisableForeignKeysCheck();",
"public function defaultForeignKeys()\n {\n return [];\n }",
"public function getForeignKeys ();",
"private function dropForeignKeyConstraints()\n {\n $drop_command_pattern = '%s -U %s -P %s -S %s -d %s -Q \"ALTER DATABASE [%s] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DECLARE @statement nvarchar(500);SELECT @statement = \\'ALTER TABLE \\' + OBJECT_NAME(parent_object_id) + \\' DROP CONSTRAINT \\' + name FROM sys.foreign_keys WHERE referenced_object_id = object_id(\\'%s\\'); EXECUTE sp_executesql @statement; ALTER DATABASE [%s] SET MULTI_USER;\" 2>&1';\n\n foreach ($this->getTablesToIgnore() as $table) {\n $drop_shell_command = sprintf($drop_command_pattern, PATH_TO_SQL_BIN, DB_USER, DB_PASS, DB_HOST, DB_NAME, DB_NAME, $table, DB_NAME);\n\n $this->runCommand($drop_shell_command);\n }\n }",
"public function dropForeignKeys()\n {\n }",
"public function getForeignKeys()\r\n {\r\n if(!$this->fksLoaded) $this->initForeignKeys();\r\n return array_values($this->foreignKeys);\r\n }",
"public function getForeignKeys ()\n {\n return array_keys($this->_foreign_keys);\n }",
"public function getOtherFks()\n {\n $fks = array();\n foreach ($this->getTable()->getForeignKeys() as $fk) {\n if ($fk !== $this) {\n $fks[] = $fk;\n }\n }\n\n return $fks;\n }",
"public function disableForeignKeySQL(): string\n {\n return 'SET CONSTRAINTS ALL DEFERRED';\n }",
"public function getForeignKeys()\n {\n return $this->foreignKeys;\n }",
"protected function disableForeignKeyConstraints(){\n $this->getRawConnection()->query('SET foreign_key_checks = 0');\n }",
"public static function disableForeignKeyConstraints()\n {\n //Method inherited from \\Illuminate\\Database\\Schema\\Builder \n return \\Illuminate\\Database\\Schema\\MySqlBuilder::disableForeignKeyConstraints();\n }",
"public function getForeignKeyIds()\n {\n return $this->foreignKeyIds;\n }",
"public function getForeignKeys()\n {\n return $this->parentTable->getColumnForeignKeys($this->name);\n }",
"protected function disableForeignKeys(){\n \n }",
"public function getForeignKeys()\n {\n return (is_array($this->foreignKeys)) ? $this->foreignKeys : false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as partyTaxScheme ASBIE Party. Party Tax Scheme A tax scheme applying to this party. 0..n Party Party Tax Scheme Party Tax Scheme Party Tax Scheme | public function getPartyTaxScheme()
{
return $this->partyTaxScheme;
} | [
"public function getTaxRepresentativeParty()\n {\n return $this->taxRepresentativeParty;\n }",
"public function getTaxScheme()\n {\n return $this->taxScheme;\n }",
"public function setPartyTaxScheme(array $partyTaxScheme)\n {\n $this->partyTaxScheme = $partyTaxScheme;\n return $this;\n }",
"public function issetPartyTaxScheme($index)\n {\n return isset($this->partyTaxScheme[$index]);\n }",
"public function getPartyType();",
"public function getPartyType()\n {\n return $this->partyType;\n }",
"public function getPartytype()\n\t{\n\t\treturn $this->partytype;\n\t}",
"public function getTaxReference();",
"public function getTaxRefunded();",
"public function getParty()\n {\n $this->__load();\n return parent::getParty();\n }",
"function getFundingScheme($gXPath = false)\n {\n $fundingScheme = false;\n\n //description[type=fundingScheme]\n if (!$gXPath) {\n $gXPath = $this->getGXPath();\n }\n foreach ($gXPath->query('//ro:description[@type=\"fundingScheme\"]') as $node) {\n $fundingScheme = strip_tags(html_entity_decode($node->nodeValue));\n }\n\n /**\n * relatedObject[type=activity|program][relation=isPartOf|isFundedBy]\n * fundingScheme is currently a single String, having repeated would require some BI work and change of the schema\n * 7/12/2015 checking with BI for solution\n */\n\n return $fundingScheme;\n }",
"public function getShippingTaxRefunded();",
"public function party()\n {\n return $this->belongsTo('\\App\\Party');\n }",
"public function getTaxRate();",
"public function taxOffice()\n {\n return $this->hasOne(ItemTaxOffice::class, 'id', 'tax_office_id');\n }",
"public function getPartyType()\n {\n return MetaDataInterface::PARTY_TYPE_COMPANY;\n }",
"public static function party()\n {\n $party = Session::instance()->get('rsvp_party');\n\n if ($party instanceof ORM)\n {\n return $party->as_array();\n }\n\n return $party;\n }",
"public function getAccountingSupplierParty()\n {\n return $this->accountingSupplierParty;\n }",
"public function getParty0()\n {\n return $this->hasOne(Party::className(), ['id' => 'party']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an instance of the order status model | protected function createOrderStatusModel()
{
$class = '\\'.ltrim($this->orderStatusModel, '\\');
return new $class();
} | [
"public function __construct()\n {\n $this->model = new OrderStatus();\n }",
"public function create($data)\n {\n return OrderStatus::create($data);\n }",
"protected function getOrderStatusModel()\n {\n $model = null;\n switch ($this->settings[self::XML_PATH_ORDER_STATUS]) {\n case 'new':\n case 'processing':\n $model = $this->objectManager->create('Magento\\Sales\\Model\\ResourceModel\\Order\\CollectionFactory');\n break;\n case 'complete':\n $model = $this->objectManager->create(\n '\\Magento\\Sales\\Model\\ResourceModel\\Order\\Shipment\\CollectionFactory'\n );\n break;\n }\n return $model;\n }",
"public function orderStatus()\n {\n return $this->belongsTo(OrderStatus::class, 'status_id');\n }",
"public function getStatus0()\n {\n return $this->hasOne(Orderstatus::className(), ['orderstatusid' => 'status']);\n }",
"function type( )\r\n {\r\n $ret = new eZOrderStatusType( $this->StatusID );\r\n\r\n return $ret;\r\n }",
"public function create()\n {\n return view('admin.order_statuses.create');\n }",
"public function setOrderStatus($orderStatus)\n {\n $this->orderStatus = $orderStatus;\n return $this;\n }",
"public function status()\n {\n return $this->belongsTo(OrderStatus::class, self::FIELD_ID_ORDER_STATUS, OrderStatus::FIELD_ID);\n }",
"protected function addNewOrderStateAndStatus()\n {\n /** @var \\Magento\\Sales\\Model\\ResourceModel\\Order\\Status $statusResource */\n $statusResource = $this->statusResourceFactory->create();\n\n /** @var \\Magento\\Sales\\Model\\Order\\Status $status */\n $status = $this->statusFactory->create();\n\n $status->setData([\n 'status' => self::ORDER_STATUS_CUSTOM_CODE,\n 'label' => self::ORDER_STATUS_CUSTOM_LABEL,\n ]);\n\n try { //if the status with the code does not exist it creates a new one, otherwise it changes the status label\n $statusResource->save($status);\n } catch (\\Exception $exception) {\n\n return;\n }\n\n $status->assignState(self::ORDER_STATE_CUSTOM_CODE, true, true);\n }",
"function wc_order_status_control() {\n\n\treturn WC_Order_Status_Control::instance();\n}",
"public function actionStatus()\r\n {\r\n if (isset($_GET['order_id']) && is_numeric($orderId = cf::security()->decrypt($_GET['order_id'])))\r\n $this->renderJSON(array('order_status' => cf::db()->queryScalar('SELECT status FROM orders WHERE id = ?', $orderId)));\r\n \r\n if (!isset($this->allowedIpMap[$addr = preg_replace('/\\d+$/', '*', $ip = $_SERVER['REMOTE_ADDR'])]))\r\n throw new CException('[HACK] Status request comes from an untrusted IP: %s', $ip);\r\n \r\n if (is_null($system = cf::app()->getComponent($currency = $this->allowedIpMap[$addr])))\r\n throw new CException('[HACK] Status request specifies an invalid system_id: %s', $currency);\r\n \r\n if ($system->acceptStatus($orderId, $amount, $account, $batch, $error) !== true)\r\n throw new CException('[HACK] Status request error: %s', $error);\r\n \r\n if (!is_array($order = cf::db()->queryRow('SELECT O.*, A.name, A.email, A.messenger FROM orders O LEFT JOIN accounts A ON A.id = O.account_id WHERE O.id = ?', $orderId)))\r\n throw new CException('[HACK] Status request data has been forged: %s', $orderId);\r\n \r\n // Add parameters\r\n $order['batch'] = $batch;\r\n $order['account'] = $account;\r\n $order['amount'] = $amount;\r\n $order['currency'] = $currency;\r\n \r\n // mail('sergeymorkovkin@gmail.com', 'DEBUG', print_r($order, true));\r\n \r\n if ($amount < $order['price'] / ($order['type'] === 'custom' ? 2 : 1))\r\n throw new CException('[HACK] Payment amount is lower than order price');\r\n \r\n // Update order status\r\n cf::db()->execute('UPDATE orders SET status = ? WHERE id = ?', 'PAID', $orderId);\r\n \r\n // Create history record\r\n cf::db()->execute('INSERT INTO history SET account_id = ?, product_id = ?, order_id = ?, type = ?, param_1 = ?, param_2 = ?, param_3 = ?, created = ?', $order['account_id'], $order['product_id'], $order['id'], 'PAYMENT_RECEIVED', $amount, $account, $batch, time());\r\n \r\n // Different order types\r\n if (($type = strtolower($order['type'])) !== 'download')\r\n {\r\n // Create helpdesk ticket\r\n cf::helpdesk()->createTicket(\"{$order['name']} <{$order['email']}>\", \"NEW: {$order['project_name']}\", $order['project_task']);\r\n \r\n // Send email message\r\n cf::email()->sendMessage($type . '.order.inwork', $order['email'], $order);\r\n }\r\n else\r\n {\r\n // Download order parameters\r\n $order['link'] = cf::app()->createUrl('//stage/download', array('hash' => cf::security()->encrypt($order['id'])));\r\n \r\n // Send email message\r\n cf::email()->sendMessage('download.order.closed', $order['email'], $order);\r\n }\r\n \r\n // Clear cached catalog\r\n cf::cache()->set('data', null);\r\n }",
"public function created(Order $order)\n {\n\n $date = date(\"M d, Y\");\n\n $order->delivery_status = [[\"date\" => $date, \"status\" => \"Received new order\"]];\n\n $order->save();\n }",
"public function __construct(){\n\n /* carregando o DAO de status */\n parent::__construct();\n $this->load->model(\"dash/Status_model\", \"status_model\");\n \n }",
"public function orders() {\n return $this->hasMany('\\Veer\\Models\\Order', 'status_id', 'id'); \n }",
"public static function mark_order_status()\n {\n }",
"protected function buildStatusFields()\n {\n //====================================================================//\n // Order Current Status\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->Identifier(\"status\")\n ->Name(\"Order Status\")\n ->MicroData(\"http://schema.org/Order\", \"orderStatus\")\n ->AddChoice(\"OrderDraft\", \"Draft\")\n ->AddChoice(\"OrderInTransit\", \"Shippment Done\")\n ->AddChoice(\"OrderProcessing\", \"Processing\")\n ->AddChoice(\"OrderDelivered\", \"Delivered\")\n ->isReadOnly();\n }",
"public function getStatusDetailsAttribute()\n {\n return OrderStatus::find($this->status);\n }",
"function createStatus();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! Returnerer position type name. | function positionTypeName( $position_type )
{
$database = eZDB::globalDatabase();
$res_array = array();
$name = false;
$query= "SELECT Name FROM eZClassified_PositionType WHERE ID='$position_type'";
$database->array_query( $res_array, $query );
if ( count( $res_array ) < 0 )
die( "eZPosition::positionTypeName(): No position type found with id=$position_type" );
else if ( count( $res_array ) == 1 )
{
$name = $res_array[0]["Name"];
}
else
die( "eZPosition::positionTypeName(): Found more than one position type with id=$position_type" );
return $name;
} | [
"function positionType()\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->PositionType;\n }",
"function world_GetType($position)\n{\n\tglobal $chessboard;\n\t\n\t$type = $chessboard[$position];\n\t\n\treturn $type;\n}",
"public function positionType()\n {\n return isset($this->data->reportElement[\"positionType\"]) ? $this->data->reportElement[\"positionType\"] : 'Float';\n }",
"abstract public function llmType(): string;",
"public function getType()\n\t{\n\t\tif (isset($this->coordinates['type']))\n\t\t\treturn $this->coordinates['type'];\n\t}",
"public function getLocType()\n {\n return $this->loc_type;\n }",
"public function getTypeName()\n {\n return $this->xdata->getString('@type');\n }",
"function getPositionByType($a_type)\n\t{\n\t\tglobal $ilSetting;\n\n\t\treturn ($ilSetting->get(\"obj_add_new_pos_\".$a_type) > 0)\n\t\t\t? (int) $ilSetting->get(\"obj_add_new_pos_\".$a_type)\n\t\t\t: (int) $this->obj_data[$a_type][\"default_pos\"];\n\t}",
"function kind($pos=NULL){//TODU TEST\n return($this->_kind($this->extpos($pos)));\n }",
"public function getPositionType($id){\n \n \t\n $select = $this->select();\n $select->where(\"id = ?\", $id );\n \n $row = $this->fetchRow($select);\n\n if(count($row)){\n \n return $row->type;\n \n }else{\n \t\n \treturn false;\n }\n \n }",
"abstract public function get_type_title();",
"public function type(): string\n {\n return $this->item['type'];\n }",
"public function getName(): string\n {\n return $this->__type->name;\n }",
"public function get_type_name() {\n\n $type = new type($this->db, $this->type);\n return $type->get_name();\n }",
"function get_type()\n\t\t{\n\t\t \t return $thisShift->type;\n\t\t}",
"abstract function displayType();",
"public function getPositionTypeById($id){\n $sql=\"SELECT `tbl_position`.`positiontype_id` FROM `tbl_position` WHERE `tbl_position`.`id` ='$id'\";\n $objdata=new CLS_MYSQL();\n $objdata->Query($sql);\n $row=$objdata->Fetch_Assoc();\n return $row['positiontype_id'];\n}",
"function get_type() \n\t\t{\t\t\n\t\t \t return $thisShift->type;\t\t\n\t\t }",
"function acf_get_location_type($name)\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field api_function | public function setApiFunction($api_function)
{
$this->api_function = $api_function;
return $this;
} | [
"abstract public function setApiMethod();",
"public function getApiFunction()\n {\n return $this->api_function;\n }",
"public function setAPIFunctionName($functionName)\n {\n $this->_APIFunctionName = $functionName;\n return $this;\n }",
"private function setFuction($function) {\n $this->_function = $function;\n }",
"public function setFunction($value)\n {\n return $this->set('Function', $value);\n }",
"public function setFunc($func);",
"public function setFunction($function): void\n {\n $this->function = $function;\n }",
"function setApiMode($value)\n {\n $this->_props['ApiMode'] = $value;\n }",
"public function setApi($api);",
"public function setFunctionCode($code);",
"public function setFunction($value)\n {\n return $this->set(self::FUNCTION, $value);\n }",
"protected function setAPI($api)\n\t{\n\t\t# Check if the passed value is empty.\n\t\tif(!empty($api))\n\t\t{\n\t\t\t# Strip slashes and decode any html entities.\n\t\t\t$api=html_entity_decode(stripslashes($api), ENT_COMPAT, 'UTF-8');\n\t\t\t# Clean it up.\n\t\t\t$api=trim($api);\n\t\t\t# Set the data member.\n\t\t\t$this->api=$api;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Explicitly set the data member to NULL.\n\t\t\t$this->api=NULL;\n\t\t}\n\t}",
"public function set_api_url( $value ) {\n\t\t\t$this->api_url = $value;\n\t\t\treturn $this->api_url;\n\t\t}",
"public function setApi(?ApiApplication $value): void {\n $this->getBackingStore()->set('api', $value);\n }",
"function set_api_key($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t}",
"function setAPIFunctionsPrefix($a_prefix)\n\t{\n\t\t$this->api_func_prefix = $a_prefix;\n\t}",
"public function setFunction($function)\n {\n $this->function = $function;\n return $this;\n }",
"public function setApiCode($apiCode) {\n\t\tassert($_COOKIE);\n\t\t$cookieLastingTime = time()+3600;\n\t\tsetcookie(\tself::$cookieApiCodeLocation, \n\t\t\t\t\tmysql_real_escape_string($apiCode), \n\t\t\t\t\t$cookieLastingTime);\n\t\t$this->apiCode = $apiCode;\n\t}",
"public function setApi(Api $api);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: Widget_Random_Link Plugin URI: Description: add Random Link Widget in your sidebar Version: 1.0 Author: zEUS. Tong Author URI: | function widget_rand_link_hook() {
function widget_rand_link($args) {
extract($args);
?>
<?php echo $before_widget; ?>
<?php echo $before_title . '随机友链' . $after_title; ?>
<ul>
<?php get_links(-1, '<li>', '</li>',0,0, 'rand', 0, 0, 10, 0); ?>
</ul>
<?php echo $after_widget; ?>
<?php
}
register_sidebar_widget('Widget_Rand_Link', 'widget_rand_link');
} | [
"function links_widgets_init() {\n register_sidebar( array(\n 'name' => 'Links Section',\n 'id' => 'links-widget',\n 'before_widget' => '<div id=\"links-widget\">',\n 'after_widget' => '</div>'\n ) );\n}",
"function vn_add_link_init()\r\n{\t\r\n\t// check for the required API functions\r\n\tif ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )\r\n\t\treturn;\r\n\r\n\t// this prints the widget\r\n\tfunction vn_add_link($args)\r\n\t{\r\n\t\t// include WordPress \"core\" for \"wp_insert_link\" to work\r\n\t\t$root = preg_replace('/wp-content.*/', '', __FILE__);\r\n\t\trequire_once($root . 'wp-config.php');\r\n\t\trequire_once($root . 'wp-admin/includes/admin.php');\r\n\t\t\t\r\n\t\textract($args);\r\n\t\t\t\r\n\t\t$options = get_option('vn_add_link_widget');\r\n\t\t$errors = array('passwordError'=>FALSE, 'addError'=>FALSE);\r\n\t\t\r\n\t\tif($_POST['addLinkSubmit'])\r\n\t\t{\r\n\t\t\t$nonce= $_REQUEST['addlink-nonce'];\r\n\t\t\tif (!wp_verify_nonce($nonce, 'addlink-nonce') )\r\n\t\t\t\tdie('Security check failed. Please use the back button and try resubmitting the information.');\r\n\t\t\t\t\r\n\t\t\tif($options['useAddLinkPassword'] && ($_POST['addLinkPassword'] != $options['addLinkPassword']))\r\n\t\t\t\t$errors['passwordError'] = TRUE;\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(class_exists(\"FeedWordPress\"))\r\n\t\t\t\t\t$categoryID = FeedWordPress :: link_category_id();\r\n\t\t\t\telse\r\n\t\t\t\t\t$categoryID = get_option('default_link_category');\r\n\t\t\t\t\r\n\t\t\t\t$link = strip_tags(stripslashes($_POST['addLinkLink']));\r\n\t\t\t\t\r\n\t\t\t\t// add link; if link not added then 0 will be returned\r\n\t\t\t\t$linkID = wp_insert_link(array(\r\n\t\t\t\t\t\"link_name\" => $link,\r\n\t\t\t\t\t\"link_url\" => $link,\r\n\t\t\t\t\t\"link_category\" => array($categoryID)\r\n\t\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif($linkID == 0)\r\n\t\t\t\t\t$errors['addError'] = TRUE;\r\n\t\t\t\telse\r\n\t\t\t\t\t$errors['addError'] = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$addLinkTitle = $options['addLinkTitle'];\r\n\t\t$addLinkMessage = $options['addLinkMessage'];\r\n\t\t$useAddLinkPassword = $options['useAddLinkPassword'];\r\n\t\t$addLinkAlign = $options['addLinkAlign'];\r\n\t\t\r\n\t\techo $before_widget . $before_title . $addLinkTitle . $after_title;\r\n\t\t?>\r\n\t\t\t<div style=\"text-align: <?php print($addLinkAlign); ?>;\">\r\n\t\t\t<p>\r\n\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER[PHP_SELF]; ?>\">\r\n\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t// show error messages if necessary\r\n\t\t\t\t\tif($_POST['addLinkSubmit'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($errors['passwordError'])\r\n\t\t\t\t\t\t\tprint(\"<p><strong>Password incorrect!</strong></p>\");\r\n\t\t\t\t\t\telseif($errors['addError'])\r\n\t\t\t\t\t\t\tprint(\"<p><strong>Not added!</strong></p>\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tprint(\"<p><strong>Added successfully!</strong></p>\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t<p>\r\n\t\t\t\t\t\t<?php print($addLinkMessage); ?><br />\r\n\t\t\t\t\t\t<input type=\"text\" name=\"addLinkLink\" id=\"addLinkLink\" value=\"<?php if($errors['passwordError'] || $errors['addError']) echo $_POST['addLinkLink']; else echo 'http://'; ?>\" style=\"width: 145px; border: #000000 1px solid;\" />\r\n\t\t\t\t\t</p>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<?php if($options['useAddLinkPassword']) { ?>\r\n\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\tPassword:<br />\r\n\t\t\t\t\t\t\t<input type=\"password\" name=\"addLinkPassword\" id=\"addLinkPassword\" value=\"\" style=\"width: 145px; border: #000000 1px solid;\" />\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"addlink-nonce\" value=\"<?php echo wp_create_nonce('addlink-nonce'); ?>\" />\r\n\t\t\t\t\t<input type=\"submit\" id=\"addLinkSubmit\" name=\"addLinkSubmit\" value=\"<?php echo $options['addLinkButtonText']; ?>\"/>\t\r\n\t\t\t\t\r\n\t\t\t\t</form>\r\n\t\t\t</p>\r\n\t\t\t</div>\r\n\t\t<?php\r\n\t\t\r\n\t\techo $after_widget;\r\n\t}\r\n\t\r\n\t// widget options\r\n\tfunction vn_add_link_control()\r\n\t{\r\n\t\t// get our options and see if we're handling a form submission.\r\n\t\t$options = get_option('vn_add_link_widget');\r\n\t\t\r\n\t\tif(!is_array($options)) // default values\r\n\t\t\t$options = array('addLinkTitle'=>'Add Link', 'addLinkMessage'=>'Link:', 'useAddLinkPassword'=>TRUE, 'addLinkPassword'=>'passw0rd', 'addLinkAlign'=>'left', 'addLinkButtonText'=>'Add Link');\r\n\r\n\t\tif($_POST['vn_add_link_submit'])\r\n\t\t{\r\n\t\t\t$nonce= $_REQUEST['addlink-nonce'];\r\n\t\t\tif (!wp_verify_nonce($nonce, 'addlink-nonce') )\r\n\t\t\t\tdie('Security check failed. Please use the back button and try resubmitting the information.');\r\n\t\t\t\t\r\n\t\t\t// remember to sanitize and format user input appropriately.\r\n\t\t\t$options['addLinkTitle'] = strip_tags(stripslashes($_POST['addLinkTitle']));\r\n\t\t\t$options['addLinkMessage'] = strip_tags(stripslashes($_POST['addLinkMessage']));\r\n\t\t\t\r\n\t\t\tif($_POST['useAddLinkPassword'] == \"yes\")\r\n\t\t\t\t$options['useAddLinkPassword'] = TRUE;\r\n\t\t\telse\r\n\t\t\t\t$options['useAddLinkPassword'] = FALSE;\r\n\t\t\t\r\n\t\t\t$options['addLinkPassword'] = $_POST['addLinkPassword'];\r\n\t\t\t$options['addLinkAlign'] = $_POST['addLinkAlign'];\r\n\t\t\t$options['addLinkButtonText'] = $_POST['addLinkButtonText'];\r\n\t\t\t\r\n\t\t\tupdate_option('vn_add_link_widget', $options);\r\n\t\t}\r\n\t\t?>\r\n\t\t<p>\r\n\t\t\tWidget Alignment:<br />\r\n\t\t\t<select id=\"addLinkAlign\" name=\"addLinkAlign\">\r\n\t\t\t\t\t<option value=\"left\" <?php if($options['addLinkAlign'] == 'left') print('selected=\"selected\"'); ?>>Left</option>\r\n\t\t\t\t\t<option value=\"center\" <?php if($options['addLinkAlign'] == 'center') print('selected=\"selected\"'); ?>>Centre</option>\r\n\t\t\t\t\t<option value=\"right\" <?php if($options['addLinkAlign'] == 'right') print('selected=\"selected\"'); ?>>Right</option>\r\n\t\t\t</select>\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"addLinkTitle\">Title:</label><br /><input style=\"width: 255px;\" id=\"addLinkTitle\" name=\"addLinkTitle\" type=\"text\" value=\"<?php echo $options['addLinkTitle']; ?>\" />\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>Message (type \"<br />\" without quotes for a new line):<br /><textarea id=\"addLinkMessage\" name=\"addLinkMessage\" style=\"width: 318px; height: 150px;\"><?php echo $options['addLinkMessage']; ?></textarea></p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<input type=\"checkbox\" name=\"useAddLinkPassword\" id=\"useAddLinkPassword\" value=\"yes\" onChange=\"jQuery('#addLinkPasswordTextBox').toggle(); return false;\" <?php if($options['useAddLinkPassword']) echo 'checked'; ?> />\r\n\t\t\t<label for=\"useAddLinkPassword\">Use Password</label>\r\n\t\t</p>\r\n\t\t\r\n\t\t<div id=\"addLinkPasswordTextBox\" style=\"<?php if(!$options['useAddLinkPassword']) echo 'display: none;'; ?> margin-left: 25px;\">\r\n\t\t\t<p><label for=\"addLinkPassword\">Password:</label><br /><input id=\"addLinkPassword\" style=\"width: 255px;\" type=\"text\" name=\"addLinkPassword\" value=\"<?php echo $options['addLinkPassword']; ?>\" /></p>\r\n\t\t</div>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"addLinkButtonText\">Button Text:</label><br /><input style=\"width: 255px;\" id=\"addLinkButtonText\" name=\"addLinkButtonText\" type=\"text\" value=\"<?php echo $options['addLinkButtonText']; ?>\" />\r\n\t\t</p>\r\n\t\t<input type=\"hidden\" name=\"addlink-nonce\" value=\"<?php echo wp_create_nonce('addlink-nonce'); ?>\" />\r\n\t\t<input type=\"hidden\" id=\"vn_add_link_submit\" name=\"vn_add_link_submit\" value=\"yes\" />\r\n\t\t<?php\t\r\n\t}\r\n\r\n\t// Tell Dynamic Sidebar about our new widget and its control\r\n\tregister_sidebar_widget(array('Add Link', 'widgets'), 'vn_add_link');\r\n\t\r\n\t// this registers the widget control form\r\n\tregister_widget_control(array('Add Link', 'widgets'), 'vn_add_link_control', 335, 700);\r\n}",
"function random_number_generator_plugin_row_meta($links, $file) {\r\n if ($file == plugin_basename(dirname(__FILE__).'/random_number_generator.php')){\r\n\t\t$links[] = '<a href=\"http://downloads.wordpress.org/plugin/random-number-generator.zip\">'.__('Development Version', 'random_number_generator').'</a>';\r\n\t\t$links[] = '<a target=\"_blank\" href=\"http://wordpress.org/extend/plugins/random-number-generator/changelog/\">'.__('Changelog', 'random_number_generator').'</a>';\r\n\t}\r\n\treturn $links;\r\n}",
"function widget_random_tumblr_init() {\r\n\tif ( !function_exists('register_sidebar_widget') )\r\n\t\treturn;\r\n\r\n\tfunction widget_random_tumblr( $args ) {\r\n\t\textract($args);\r\n\r\n\t\t$options = get_option('widget_random_tumblr');\r\n\t\t$title = $options['widget_random_tumblr_title'];\r\n\t\t$tuid = $options['widget_random_tumblr_uid'];\r\n\t\t$widget_random_tumblr_img_style = $options['widget_random_tumblr_img_style'];\r\n\t\t$widget_random_tumblr_display_pagelink = $options['widget_random_tumblr_display_pagelink'];\r\n\t\t$widget_random_tumblr_additional_html = $options['widget_random_tumblr_additional_html'];\r\n\t\t$widget_random_tumblr_width = $options['widget_random_tumblr_width'];\r\n\r\n\t\t$output = '<div id=\"widget_random_tumblr\"><ul>';\r\n\r\n\t\t// section main logic from here \r\n\r\n\t\t$tumblr_userid = $tuid;\r\n\t\t$tumblr_num = 1;\r\n\t\t$img_style = $widget_random_tumblr_img_style;\r\n\t\t$tumblr_size = 4;\r\n\t\t$display_pagelink = $widget_random_tumblr_display_pagelink;\r\n\t\t$pagecounter = 0;\t\t// for future use\r\n\t\t$width_sidebar = $widget_random_tumblr_width;\r\n\r\n\t\t$_tumblrurl = 'http://' . $tumblr_userid . '.tumblr.com/api/read?start=' . $pagecounter . '&num=' . $tumblr_num . '&type=photo';\r\n\t\t$_tumblrurl = urlencode( $_tumblrurl );\t// for only compatibility\r\n\t\t$_tumblr_xml = @simplexml_load_file( $_tumblrurl );\r\n\t\t$max_number = $_tumblr_xml->posts[ 'total' ];\r\n\t\t$pagecounter = floor( rand( 0, $max_number - 1 ) );\r\n\r\n\t\t$tumblr_size = 2;\r\n\t\t$_tumblrurl = 'http://' . $tumblr_userid . '.tumblr.com/api/read?start=' . $pagecounter . '&num=' . $tumblr_num . '&type=photo';\r\n\t\t$_tumblrurl = urlencode( $_tumblrurl );\t// for only compatibility\r\n\t\t$_tumblr_xml = @simplexml_load_file( $_tumblrurl );\r\n\r\n\t\tforeach( $_tumblr_xml->posts[0]->post as $p ) {\r\n\t\t\t$photourl = $p->{\"photo-url\"}[$tumblr_size];\t\t// 4 = 75px sq\r\n\t\t\t$linkurl = $p[url];\r\n\t\t\t$output .= '<a href=\"' . $linkurl . '\" target=\"_blank\" >';\r\n\t\t\t$output .= '<img src=\"' . $photourl . '\" border=\"0\" style=\"' . $img_style . '\" width=\"' . $width_sidebar . '\" />';\r\n\t\t\t$output .= '</a>';\r\n\t\t} /* foreach */\r\n\r\n\t\tif( $display_pagelink ) {\r\n\t\t\t$output .= '<div style=\"width:100%; text-align:center; font-size:7pt; margin-right:10px; margin-bottom:3px;\" >';\r\n\t\t\t$output .='<a href=\"http://' . $tumblr_userid . '.tumblr.com/\" target=\"_blank\" >';\r\n\t\t\t$output .= $_tumblr_xml->tumblelog[title];\r\n\t\t\t$output .= '</a></div>';\r\n\t\t} /* if */\r\n\r\n\t\tif( $widget_random_tumblr_additional_html ) {\r\n\t\t\t$output .= str_replace( \"\\\\\",\"\", $widget_random_tumblr_additional_html );\r\n\t\t} /* if */\r\n\r\n\t\t// These lines generate the output\r\n\t\t$output .= '</ul></div>';\r\n\r\n\t\techo $before_widget . $before_title . $title . $after_title;\r\n\t\techo $output;\r\n\t\techo $after_widget;\r\n\t} /* widget_random_tumblr() */\r\n\r\n\tfunction widget_random_tumblr_control() {\r\n\t\t$options = $newoptions = get_option('widget_random_tumblr');\r\n\t\tif ( $_POST[\"widget_random_tumblr_submit\"] ) {\r\n\t\t\t$newoptions['widget_random_tumblr_title'] = strip_tags(stripslashes($_POST[\"widget_random_tumblr_title\"]));\r\n\t\t\t$newoptions['widget_random_tumblr_uid'] = $_POST[\"widget_random_tumblr_uid\"];\r\n\t\t\t$newoptions['widget_random_tumblr_img_style'] = $_POST[\"widget_random_tumblr_img_style\"];\r\n\t\t\t$newoptions['widget_random_tumblr_display_pagelink'] = (boolean) $_POST[\"widget_random_tumblr_display_pagelink\"];\r\n\t\t\t$newoptions['widget_random_tumblr_additional_html'] = $_POST[\"widget_random_tumblr_additional_html\"];\r\n\t\t\t$newoptions['widget_random_tumblr_width'] = $_POST[\"widget_random_tumblr_width\"];\r\n\t\t}\r\n\t\tif ( $options != $newoptions ) {\r\n\t\t\t$options = $newoptions;\r\n\t\t\tupdate_option('widget_random_tumblr', $options);\r\n\t\t}\r\n\r\n\t\t// those are default value\r\n\t\tif ( !$options['widget_random_tumblr_width'] ) $options['widget_random_tumblr_width'] = 165;\r\n\r\n\t\t$tuid = $options['widget_random_tumblr_uid'];\r\n\t\t$widget_random_tumblr_width = $options['widget_random_tumblr_width'];\r\n\t\t$widget_random_tumblr_img_style = $options['widget_random_tumblr_img_style'];\r\n\t\t$widget_random_tumblr_display_pagelink = $options['widget_random_tumblr_display_pagelink'];\r\n\t\t$widget_random_tumblr_additional_html = $options['widget_random_tumblr_additional_html'];\r\n\r\n\t\t$title = htmlspecialchars($options['widget_random_tumblr_title'], ENT_QUOTES);\r\n?>\r\n\t <?php _e('Title:'); ?> <input style=\"width: 170px;\" id=\"widget_random_tumblr_title\" name=\"widget_random_tumblr_title\" type=\"text\" value=\"<?php echo $title; ?>\" /><br />\r\n\t\t<?php _e('Tumblr ID:'); ?> <input style=\"width: 100px;\" id=\"widget_random_tumblr_uid\" name=\"widget_random_tumblr_uid\" type=\"text\" value=\"<?php echo $tuid; ?>\" />.tumblr.com<br />\r\n\t\t<?php _e('Image Width:'); ?> <input style=\"width: 80px;\" id=\"widget_random_tumblr_width\" name=\"widget_random_tumblr_width\" type=\"text\" value=\"<?php echo $widget_random_tumblr_width; ?>\" /> <br />\r\n\t\t<?php _e('Img CSS:'); ?><br /><input style=\"width: 100%;\" id=\"widget_random_tumblr_img_style\" name=\"widget_random_tumblr_img_style\" type=\"textarea\" value=\"<?php echo $widget_random_tumblr_img_style; ?>\" /><br />\r\n\t\t<input style=\"\" id=\"widget_random_tumblr_display_pagelink\" name=\"widget_random_tumblr_display_pagelink\" type=\"checkbox\" value=\"1\" <?php if( $widget_random_tumblr_display_pagelink ) {echo 'checked';} ?> />Display tumblr link<br />\r\n\t\t<?php _e('Additional HTML:'); ?><br />\r\n\t\t<textarea rows=3 id=\"widget_random_tumblr_additional_html\" name=\"widget_random_tumblr_additional_html\" /><?php echo $widget_random_tumblr_additional_html; ?></textarea><br />\r\n\r\n\r\n \t <input type=\"hidden\" id=\"widget_random_tumblr_submit\" name=\"widget_random_tumblr_submit\" value=\"1\" />\r\n\t\t<div style=\"width:100%;text-align:right;\"><a href=\"http://www.vjcatkick.com/\" target=\"_blank\"><img src='http://www.vjcatkick.com/logo_vjck.png' border='0'/></a></div>\r\n<?php\r\n\t} /* widget_random_tumblr_control() */\r\n\r\n\tregister_sidebar_widget('Random Tumblr', 'widget_random_tumblr');\r\n\tregister_widget_control('Random Tumblr', 'widget_random_tumblr_control' );\r\n}",
"function my_custom_dashboard_widgets() {\n\tglobal $wp_meta_boxes;\n\t \n\twp_add_dashboard_widget(\n\t\t'citadel-quick-links',\n\t\t'Citadel Quick Links',\n\t\t'custom_dashboard_help'\n\t);\n}",
"function ds_social_links_load_widget() {\n\tregister_widget( 'ds_social_links_widget' );\n}",
"function the_edit_link_widget(): void {\n\techo esc_attr( admin_url( 'widgets.php' ) );\n}",
"function iati_print_social_links()\r\n{\r\n ?>\r\n<aside id=\"sidebar_social_links\" class=\"widget widget_social_links\">\r\n <div class=\"text-widget\">\r\n <ul class=\"social-links\">\r\n <li class=\"social facebook\"><a href=\"<?php echo sweetapple_get_theme_option('facebook_url_social');?>\">Facebook</a></li>\r\n <li class=\"social twitter\"><a href=\"<?php echo sweetapple_get_theme_option('twitter_url_social');?>\">Twitter</a></li>\r\n <li class=\"social linkedin\"><a href=\"<?php echo sweetapple_get_theme_option('linkedin_url_social');?>\">LinkedIn</a></li>\r\n <li class=\"social rss\"><a href=\"<?php echo bloginfo('rss2_url'); ?>\">RSS</a></li>\r\n </ul>\r\n </div>\r\n</aside>\r\n<?php\r\n}",
"function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}",
"function widget_wpchiclets_init() {\r\n\tif ( !function_exists('register_sidebar_widget') )\r\n\t\treturn;\r\n\r\n\tfunction widget_wpchiclets($args) {\r\n\t\textract($args);\r\n\r\n\t\t$options = get_option('widget_wpchiclets');\r\n\t\t$wpchiclets_title = $options['wpchiclets_title'];\r\n\r\n\t\t$rsspng = get_bloginfo('wpurl') . '/wp-includes/images/rss.png';\r\n\r\n\t\t$encoded_blogname = urlencode(get_bloginfo('name'));\r\n\r\n\t\t$feedurl = get_feed_link('rss2');\r\n\t\t$commentsfeedurl = get_feed_link('comments_rss2');\r\n\r\n\t\tprint <<<EOM\r\n\r\n$before_widget\r\n $before_title$wpchiclets_title$after_title\r\n <!-- wp-chiclets: http://www.tsaiberspace.net/projects/wordpress/wp-chiclets/ -->\r\n <ul>\r\n <li><a href=\"$feedurl\" title=\"Syndicate the latest posts\"><img src=\"$rsspng\" alt=\"\" /> Posts</a> | <a href=\"$commentsfeedurl\" title=\"Syndicate the latest comments\"><img src=\"$rsspng\" alt=\"\" /> Comments</a></li>\r\n <li><a href=\"http://fusion.google.com/add?feedurl=$feedurl\" title=\"Add to Google\"><img src=\"http://buttons.googlesyndication.com/fusion/add.gif\" alt=\"Add to Google\" /> </a></li>\r\n <li><a href=\"http://us.rd.yahoo.com/my/atm/$encoded_blogname/$encoded_blogname/*http://add.my.yahoo.com/rss?url=$feedurl\" title=\"Add to My Yahoo!\"><img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif\" alt=\"Add to My Yahoo!\" /> </a></li>\r\n <li><a href=\"http://www.bloglines.com/sub/$feedurl\" title=\"Subscribe with Bloglines\"><img src=\"http://www.bloglines.com/images/sub_modern11.gif\" alt=\"Subscribe with Bloglines\" /> </a></li>\r\n <li><a href=\"http://technorati.com/faves?add=$feedurl\" title=\"Add to Technorati Favorites\"><img src=\"http://static.technorati.com/pix/fave/tech-fav-5.gif\" alt=\"Add to Technorati Favorites\" /> </a></li>\r\n <li><a href=\"http://www.netvibes.com/subscribe.php?url=$feedurl\" title=\"Add to netvibes\"><img src=\"http://www.netvibes.com/img/add2netvibes.gif\" alt=\"Add to netvibes\" /> </a></li>\r\n <li><a href=\"http://www.rojo.com/add-subscription?resource=$feedurl\" title=\"Add to My Rojo\"><img src=\"http://blog.rojo.com/RojoWideRed.gif\" alt=\"Add to My Rojo\" /> </a></li>\r\n <li><a href=\"http://www.newsgator.com/ngs/subscriber/subext.aspx?url=$feedurl\" title=\"Subscribe with NewsGator\"><img src=\"http://www.newsgator.com/images/ngsub1.gif\" alt=\"Subscribe with NewsGator\" /> </a></li>\r\n <li><a href=\"http://feeds.my.aol.com/add.jsp?url=$feedurl\" title=\"Add to My AOL\"><img src=\"http://cdn.digitalcity.com/channels/icon_myaol\" alt=\"Add to My AOL\" /> </a></li>\r\n <li><a href=\"http://www.live.com/?add=$feedurl\" title=\"Add to Windows Live Favorites\"><img src=\"http://stc.msn.com/br/gbl/css/6/decoration/wl_add_feed.gif\" alt=\"Add to Windows Live Favorites\" /> </a></li>\r\n <li><a href=\"http://my.msn.com/addtomymsn.armx?id=rss&ut=$feedurl\" title=\"Add to My MSN\"><img src=\"http://stc.msn.com/br/gbl/css/6/decoration/rss_my.gif\" alt=\"Add to My MSN\" /> </a></li>\r\n </ul>\r\n$after_widget\r\n\r\nEOM;\r\n\t}\r\n\r\n\tfunction widget_wpchiclets_control() {\r\n\t\t$options = get_option('widget_wpchiclets');\r\n\t\tif ( !is_array($options) )\r\n\t\t\t$options = array('wpchiclets_title'=>'Subscribe');\r\n\t\tif ( $_POST['wpchiclets-submit'] ) {\r\n\t\t\t$options['wpchiclets_title'] = strip_tags(stripslashes($_POST['wpchiclets-wpchiclets_title']));\r\n\t\t\tupdate_option('widget_wpchiclets', $options);\r\n\t\t}\r\n\r\n\t\t$wpchiclets_title = htmlspecialchars($options['wpchiclets_title'], ENT_QUOTES);\r\n\t\techo '<p style=\"text-align:center;\"><label for=\"wpchiclets-title\">Title: <input style=\"width: 100%;\" id=\"wpchiclets-title\" name=\"wpchiclets-wpchiclets_title\" type=\"text\" value=\"'.$wpchiclets_title.'\" /></label></p>';\r\n\t\techo '<input type=\"hidden\" id=\"wpchiclets-submit\" name=\"wpchiclets-submit\" value=\"1\" />';\r\n\t}\r\n\t\r\n\tregister_sidebar_widget('WP Chiclets', 'widget_wpchiclets');\r\n\tregister_widget_control('WP Chiclets', 'widget_wpchiclets_control',\r\n\t\t300, 90);\r\n}",
"function widget_superlinks_init() {\n\n // Define a few constants, to make things less error-prone\n define('SL_ID_BASE', 'superlinks');\n define('SL_OPTIONS_KEY', 'widget_superlinks');\n define('SL_OPTION_CATID', 'catid');\n\n // A logging function to use for debugging\n function log_to_file($message) {\n $fh = fopen('superlinks_log.txt', 'a') or die(\"can't open file\");\n fwrite($fh, $message . \"\\n\");\n fclose($fh);\n }\n\n // This is called at the bottom of widget_superlinks_init\n function widget_superlinks_register() {\n\n if (!$options = get_option(SL_OPTIONS_KEY)) {\n $options = array();\n }\n $widget_ops = array('classname' => 'widget_superlinks', 'description' => __('A better links widget'));\n $control_ops = array('id_base' => SL_ID_BASE);\n $name = __('SuperLinks');\n\n // First check to see if there are any defined SuperLinks widgets saved\n $id = false;\n foreach (array_keys($options) as $o) {\n // This shouldn't happen but we check for it anyway\n if (!isset($options[$o][SL_OPTION_CATID])) {\n\tcontinue;\n }\n $id = SL_ID_BASE . \"-$o\";\n wp_register_sidebar_widget($id, $name, 'widget_superlinks', $widget_ops, array('number' => $o));\n wp_register_widget_control($id, $name, 'widget_superlinks_control', $control_ops, array('number' => $o));\n }\n\n // If there are none, we register the widget's existance with a generic template\n if (!$id) {\n wp_register_sidebar_widget('superlinks-1', $name, 'widget_superlinks', $widget_ops, array('number' => -1));\n wp_register_widget_control('superlinks-1', $name, 'widget_superlinks_control', $control_ops, array('number' => -1));\n }\n }\n\n function widget_superlinks($args, $widget_args = 1) {\n extract($args, EXTR_SKIP);\n\n if (is_numeric($widget_args))\n $widget_args = array('number' => $widget_args);\n $widget_args = wp_parse_args($widget_args, array('number' => -1));\n extract($widget_args, EXTR_SKIP);\n\n $options = get_option(SL_OPTIONS_KEY);\n if (!isset($options[$number]))\n return;\n\n $widget_options = $options[$number];\n $catid = $widget_options[SL_OPTION_CATID];\n if ($catid == 0) {\n unset($catid);\n }\n\n $before_widget = preg_replace('/id=\"[^\"]*\"/','id=\"%id\"', $before_widget);\n wp_list_bookmarks(array('category' => $catid,\n\t\t\t 'title_before' => $before_title, 'title_after' => $after_title,\n\t\t\t 'category_before' => $before_widget, 'category_after' => $after_widget,\n\t\t\t 'show_images' => true, 'class' => 'linkcat widget'\n\t\t\t ));\n }\n\n function widget_superlinks_control($args) {\n global $wp_registered_widgets;\n static $updated = false;\n\n if (is_numeric($args)) {\n $args = array('number' => $args);\n }\n $args = wp_parse_args($args, array('number' => -1));\n extract($args, EXTR_SKIP);\n\n $options = get_option(SL_OPTIONS_KEY);\n if (!is_array($options))\n $options = array();\n\n if (!$updated && !empty($_POST['sidebar'])) {\n\n // Get the sidebar widgets that are registered in this sidebar\n $sidebar = (string) $_POST['sidebar'];\n $sidebars_widgets = wp_get_sidebars_widgets();\n if (isset($sidebars_widgets[$sidebar]))\n\t$my_sidebar =& $sidebars_widgets[$sidebar];\n else\n\t$my_sidebar = array();\n\n // First go through and see if any SuperLinks widgets have been removed\n // We know one has been removed because there would be no form element\n // named superlinks-XXX where XXX is a numeric value that exists in the\n // superliks options hash.\n foreach ($my_sidebar as $_widget_id) {\n\tif ('widget_superlinks' == $wp_registered_widgets[$_widget_id]['callback'] &&\n\t isset($wp_registered_widgets[$_widget_id]['params'][0]['number'])) {\n\t $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number'];\n\t if (!in_array(\"superlinks-$widget_number\", $_POST['widget-id']))\n\t // The widget has been removed.\n\t unset($options[$widget_number]);\n\t}\n }\n\n // Next go through the superlinks options that we got from the post.\n foreach ((array) $_POST['widget-superlinks'] as $widget_number => $widget_options) {\n\t// Save the options for this widget\n\t$catid = attribute_escape($widget_options[SL_OPTION_CATID]);\n\t$options[$widget_number][SL_OPTION_CATID] = $catid;\n }\n\n update_option(SL_OPTIONS_KEY, $options);\n\n // This will make sure that next time this function is called,\n // that we don't go through all the options again -- we only\n // need to do that once\n $updated = true;\n }\n\n if ($number == -1) {\n // For the one to be newly created\n $number = '%i%';\n $catid = 0;\n } else {\n // For an existing SuperLinks widget\n $catid = $options[$number][SL_OPTION_CATID];\n }\n\n $catid_name = \"widget-superlinks[$number][\" . SL_OPTION_CATID . \"]\";\n $cats = get_terms('link_category');\n?>\n <p>\n\t\t\t<label for=\"<?php echo $catid_name; ?>\"><?php _e('Link Category:'); ?></label>\n\t\t\t<select class=\"widefat\" id=\"<?php echo $catid_name; ?>\" name=\"<?php echo $catid_name; ?>\">\n <option value=\"0\" <?php selected($catid, 0); ?>>Show all categories</option>\n\t <?php foreach ((array) $cats as $cat) { ?>\n\t\t\t <option value=\"<?php echo $cat->term_id; ?>\" <?php selected($catid, $cat->term_id); ?>>\n\t\t\t <?php echo apply_filters(\"link_category\", $cat->name); ?>\n\t\t\t </option>\n\t\t\t <?php } ?>\n\t\t\t</select>\n\t\t</p>\n<?php\n }\n\n // Firsrt remove the original Links widget, since we don;t need it anymore\n unregister_sidebar_widget('links');\n // Then register our new SuperLinks widget\n widget_superlinks_register();\n}",
"function face_box_2() {\r\n add_filter(\"plugin_action_links_$plugin\", array(&$this, 'link'));\r\n load_plugin_textdomain($this->_folder, false, $this->_folder); \r\n \r\n if (!function_exists('register_sidebar_widgetss') || !function_exists('register_widgetss_controlss'))\r\n return;\r\n register_sidebar_widgetss($this->_name, array(&$this, \"widgetss\"));\r\n register_widgetss_controlss($this->_name, array(&$this, \"controlss\"), $this->_width, $this->_height);\r\n }",
"function custom_dashboard_widgets() {\n\t\twp_add_dashboard_widget('roller_rss_dashboard_widget', 'Recently on Themble (Customize on admin.php)', 'roller_rss_dashboard_widget');\n\t\t/*\n\t\tBe sure to drop any other created Dashboard Widgets \n\t\tin this function and they will all load.\n\t\t*/\n\t}",
"function wp_widgets_add_menu()\n{\n}",
"function imic_wordpress_link() {\n return '<a href=\"http://wordpress.org/\" target=\"_blank\">'.__('WordPress','framework').'</a>';\n}",
"function custom_dashboard_widgets() {\n\tglobal $wp_meta_boxes;\n\t// ('widget name', 'widgets name in dashboard', 'widget reference')\n\twp_add_dashboard_widget('custom_help_widget_one', 'Widget One', 'custom_dashboard_widget_one');\n\twp_add_dashboard_widget('custom_help_widget_two', 'Widget Two', 'custom_dashboard_widget_two');\n}",
"function widget_sandbox_rsslinks($args) {\n\textract($args);\n\t$options = get_option('widget_sandbox_rsslinks');\n\t$title = empty($options['title']) ? __('RSS Links', 'sandbox') : $options['title'];\n?>\n\t\t<?php echo $before_widget; ?>\n\t\t\t<?php echo $before_title . $title . $after_title; ?>\n\t\t\t<ul>\n\t\t\t\t<li><a href=\"<?php bloginfo('rss2_url') ?>\" title=\"<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'sandbox'); ?>\" rel=\"alternate\" type=\"application/rss+xml\"><?php _e('All posts', 'sandbox') ?></a></li>\n\t\t\t\t<li><a href=\"<?php bloginfo('comments_rss2_url') ?>\" title=\"<?php echo wp_specialchars(bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'sandbox'); ?>\" rel=\"alternate\" type=\"application/rss+xml\"><?php _e('All comments', 'sandbox') ?></a></li>\n\t\t\t</ul>\n\t\t<?php echo $after_widget; ?>\n<?php\n}",
"function ramona_register_widget()\n{\n register_widget('ramona_latest_news_and_articles');\n}",
"function docuemtation_dashboard_widget_function() {\n\t// Display whatever it is you want to show\n\techo 'Make sure you watch the videos in 720p resolution.<br/>\n<a href=\"http://youtu.be/vA3fXuhbmjg\" target=\"_blank\">Welcome and Workflow</a> (1:32)<br/>\n<a href=\"http://youtu.be/1EYJ2xuJOB4\" target=\"_blank\">Resize Images</a> (3:55)<br/>\n<a href=\"http://youtu.be/KVGK5FKm-Ng\" target=\"_blank\">Upload Images to Dropbox</a> (1:10)<br/>\n<a href=\"http://youtu.be/g_XfK9iLv7s\" target=\"_blank\">The Dashboard</a> (3:53)<br/>\n<a href=\"http://youtu.be/ZntfnFEocn8\" target=\"_blank\">Writing and Saving a Draft</a> (6:10)<br/>\n<a href=\"http://youtu.be/vSx0xOQms78\" target=\"_blank\">Changing Post Status</a> (0:34)<br/>\n<a href=\"http://youtu.be/GZvMRQlP-9c\" target=\"_blank\">Upload to and Crop Images on Website</a> (5:46)<br/>\n<a href=\"http://youtu.be/zrBjk92WQB4\" target=\"_blank\">Publish Cat Profile</a> (1:12)<br/>\nCreate a PDF of profile (later, I have to make a few modifications first)';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes the boundaries (current leave period) of the contract of a user Modifies the start and end dates passed as parameter | public function getBoundaries($userId, &$startentdate, &$endentdate, $refDate = NULL) {
$this->db->select('startentdate, endentdate');
$this->db->from('contracts');
$this->db->join('users', 'users.contract = contracts.id');
$this->db->where('users.id', $userId);
$boundaries = $this->db->get()->result_array();
if ($refDate == NULL) {
$refDate = date("Y-m-d");
}
$refYear = substr($refDate, 0, 4);
$refMonth = substr($refDate, 5, 2);
$nextYear = strval(intval($refYear) + 1);
$lastYear = strval(intval($refYear) - 1);
if (count($boundaries) != 0) {
$startmonth = intval(substr($boundaries[0]['startentdate'], 0, 2));
if ($startmonth == 1 ) {
$startentdate = $refYear . "-" . str_replace("/", "-", $boundaries[0]['startentdate']);
$endentdate = $refYear . "-" . str_replace("/", "-", $boundaries[0]['endentdate']);
} else {
if (intval($refMonth) < 6) {
$startentdate = $lastYear . "-" . str_replace("/", "-", $boundaries[0]['startentdate']);
$endentdate = $refYear . "-" . str_replace("/", "-", $boundaries[0]['endentdate']);
} else {
$startentdate = $refYear . "-" . str_replace("/", "-", $boundaries[0]['startentdate']);
$endentdate = $nextYear . "-" . str_replace("/", "-", $boundaries[0]['endentdate']);
}
}
return TRUE;
} else {
return FALSE;
}
} | [
"function erp_hrm_is_leave_recored_exist_between_date( $start_date, $end_date, $user_id ) {\n\n $start_date = date( 'Y-m-d', strtotime( $start_date ) );\n $end_date = date( 'Y-m-d', strtotime( $end_date ) );\n\n $holiday = new \\WeDevs\\ERP\\HRM\\Models\\Leave_request();\n\n $holiday->where( 'user_id', '=', $user_id );\n\n $holiday = $holiday->where( function( $condition ) use( $start_date, $user_id ) {\n $condition->where( 'start_date', '<=', $start_date );\n $condition->where( 'end_date', '>=', $start_date );\n $condition->where( 'user_id', '=', $user_id );\n } );\n\n $holiday = $holiday->orWhere( function( $condition ) use( $end_date, $user_id ) {\n $condition->where( 'start_date', '<=', $end_date );\n $condition->where( 'end_date', '>=', $end_date );\n $condition->where( 'user_id', '=', $user_id );\n } );\n\n $holiday = $holiday->orWhere( function( $condition ) use( $start_date, $end_date, $user_id ) {\n $condition->where( 'start_date', '>=', $start_date );\n $condition->where( 'start_date', '<=', $end_date );\n $condition->where( 'user_id', '=', $user_id );\n } );\n\n $holiday = $holiday->orWhere( function( $condition ) use( $start_date, $end_date, $user_id ) {\n $condition->where( 'end_date', '>=', $start_date );\n $condition->where( 'end_date', '<=', $end_date );\n $condition->where( 'user_id', '=', $user_id );\n } );\n\n $results = $holiday->get()->toArray();\n\n $holiday_extrat = [];\n $given_date_extrat = erp_extract_dates( $start_date, $end_date );\n\n foreach ( $results as $result ) {\n $date_extrat = erp_extract_dates( $result['start_date'], $result['end_date'] );\n $holiday_extrat = array_merge( $holiday_extrat, $date_extrat );\n }\n\n $extract = array_intersect( $given_date_extrat, $holiday_extrat );\n\n return $extract;\n}",
"public function leadsInDates($start, $end, $data = []);",
"function getLeaveRequests($userid ='', $start ='2015-01-01', $end='2015-12-31'){\n\t\t$conn = Doctrine_Manager::connection();\n\t\t$customquery = \"\";\n\t\t/*if(!isEmptyString($userid)){\n\t\t\t$customquery = \" AND t.userid = '\".$userid.\"' \";\n\t\t}*/\n\t\t$companyid = getCompanyID();\n\t\t\n\t\t$query = \"SELECT t.id, t.userid, t.typeid, p.name as type, t.`status`, t.duration, t.durationtype, t.startdate as startdate, t.enddate as enddate, t.returndate, t.starttime, t.endtime, t.returntime, p.calendarcolor, \n\t\tIF(isnull(u.othername), concat(u.firstname,' ',u.lastname), concat(u.firstname,' ',u.lastname,' ',u.othername)) as `user`\n\t\tfrom `leave` t \n\t\tinner join leavetype p on t.typeid = p.id\n\t\tinner join useraccount u on t.userid = u.id\n\t\twhere t.id <> '' \".$customquery.\" AND u.companyid = '\".$companyid.\"' AND TO_DAYS(t.startdate) BETWEEN TO_DAYS('\".$start.\"') AND TO_DAYS('\".$end.\"') AND t.status = 1 order by t.startdate desc, t.id \"; // debugMessage($query);\n\t\t$result = $conn->fetchAll($query); // debugMessage($result);\n\t\n\t\treturn $result;\n\t}",
"public function addValidateDateContract()\n {\n // Init rule validate\n $ruleValidate = [];\n // Get id of contract will be validate\n $idContract = request()->route()->parameter('idContract');\n // If not exists contract, ignore validate\n if (is_null($idContract)) {\n return $ruleValidate;\n }\n // Get info of current contract will be validate\n $contract = $this->_contractInterface->find($idContract);\n\n // If not exists contract, no append rule validate\n if (is_null($contract)) {\n return $ruleValidate;\n }\n\n /**\n * When contract is inactive:\n * Start date of contract must to greater than or equal current date\n * End date of contract must to greater than start date\n */\n if ($contract->start_date->format('Y-m-d') > date('Y-m-d')) {\n $ruleValidate = [\n 'startDate' => 'required|date_format:Y/m/d|after_or_equal:'.date('Y/m/d'),\n 'endDate' => 'required|date|date_format:Y/m/d|after_date_custom:startDate'\n ];\n\n /**\n * When contract was activating:\n * Start date of contract must to greater than previous start date and \n * less than last day of old start date month\n * End date of contract must to greater than start date\n */\n } else {\n $ruleValidate = [\n 'startDate' => 'required|date_format:Y/m/d|after_or_equal:'\n .$contract->start_date->format('Y/m/d').'|before_or_equal:'\n .$contract->start_date->format('Y/m/t'),\n 'endDate' => 'required|date|date_format:Y/m/d|after_date_custom:startDate|after_or_equal:'.date('Y/m/d', strtotime(' +1 day'))\n ];\n }\n\n return $ruleValidate;\n }",
"function erp_hr_get_financial_year_from_date_range( $start_date, $end_date ) {\n global $wpdb;\n\n if ( ! is_numeric( $start_date ) ) {\n $start_date = erp_current_datetime()->modify( $start_date )->getTimestamp();\n }\n\n if ( ! is_numeric( $end_date ) ) {\n $end_date = erp_current_datetime()->modify( $end_date )->getTimestamp();\n }\n\n /**\n * select wp_erp_hr_leave_requests.id, st.approval_status_id from wp_erp_hr_leave_requests\n * left join wp_erp_hr_leave_approval_status as st on st.leave_request_id = wp_erp_hr_leave_requests.id\n * where (start_date <= 1578441600 and end_date >= 1578441600 and user_id = 23)\n * or (start_date <= 1579046399 and end_date >= 1579046399 and user_id = 23)\n * or (start_date >= 1578441600 and start_date <= 1579046399 and user_id = 23)\n * or (end_date >= 1578441600 and end_date <= 1579046399 and user_id = 23)\n */\n\n return $wpdb->get_col(\n $wpdb->prepare(\n \"SELECT id FROM {$wpdb->prefix}erp_hr_financial_years\n WHERE (start_date <= %d AND end_date >= %d)\n OR (start_date <= %d AND end_date >= %d)\n OR (start_date >= %d and start_date <= %d)\n OR (end_date >= %d and end_date <= %d)\n \",\n array(\n $start_date, $start_date,\n $end_date, $end_date,\n $start_date, $end_date,\n $start_date, $end_date\n )\n )\n );\n}",
"public function computeWorktimeAdjustmentsForUser($user, $startDate, $endDate) {\n\t\t\n\t\t$computationStartDate = $startDate;\n\t\t$computationEndDate = $endDate;\n\t\t\n\t\t// constrain computation start and end dates to employment period\n\t\tif ( $startDate < $user->getEntryDate() ) {\n\t\t\t$computationStartDate = $user->getEntryDate();\n\t\t}\n\t\t\n\t\tif ( $endDate > $user->getExitDate() ) {\n\t\t\t$computationEndDate = $user->getExitDate();\n\t\t}\n\t\t\n\t\t// sum possible worktime balance adjustment entries\n\t\t// -- adjustment entries need to me made within employee's employment range\n\t\t$globalWorktimeAdjustmentsQuery = \\AdjustmentEntryQuery::create()\n\t\t\t\t\t\t\t\t\t\t\t\t->filterByType(\\AdjustmentEntry::TYPE_WORKTIME_BALANCE_ADJUSTMENT_IN_SECONDS)\n\t\t\t\t\t\t\t\t\t\t\t\t->_or()\n\t\t\t\t\t\t\t\t\t\t\t\t->filterByType(\\AdjustmentEntry::TYPE_WORKTIME_BALANCE_LAPSE_ADJUSTMENT_IN_SECONDS)\n\t\t\t\t\t\t\t\t\t\t\t\t->useUserQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t->filterById($user->getId())\n\t\t\t\t\t\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t\t\t\t\t\t->useDayQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t->filterByDateofDay($computationStartDate, \\DayQuery::GREATER_EQUAL)\n\t\t\t\t\t\t\t\t\t\t\t\t\t->filterByDateofDay($computationEndDate, \\DayQuery::LESS_EQUAL)\n\t\t\t\t\t\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t\t\t\t\t\t->withColumn('SUM(value)', 'totalWorktimeAdjustmentInSeconds')\n\t\t\t\t\t\t\t\t\t\t\t\t->groupBy('User.id')\n\t\t\t\t\t\t\t\t\t\t\t\t->findOne();\n\n\t\t// determine value of global vacation adjustment\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$globalWorktimeAdjustmentsInSeconds = 0;\t\t\t\t\t\t\t\t\t\t\n\t\tif ( $globalWorktimeAdjustmentsQuery !== null ) {\n\t\t\t$globalWorktimeAdjustmentsInSeconds = $globalWorktimeAdjustmentsQuery->getTotalWorktimeAdjustmentInSeconds();\n\t\t}\t\n\t\t\n\t\treturn $globalWorktimeAdjustmentsInSeconds;\n\t}",
"protected function validateStartAndEndDates(Carbon $start = null, Carbon $end = null)\n {\n $end = $end ?: (request()->has('o_end') ? (new Carbon(request('o_end')))->endOfMonth() : Carbon::now()->endOfMonth());\n $start = $start ?: (request()->has('o_start') ? (new Carbon(request('o_start')))->startOfMonth() : $end->copy()->subYear()->addSecond());\n\n return [$start, $end];\n }",
"public function checkLeaveApplyTimeArea($emp_seq_no,$company_id,$begin_time,$end_time)\n {\n if(empty($begin_time) || empty($end_time)) return 'no parameter';\n //$this->DBConn->debug = 1;\n $sql= <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:begin_time, 'yyyy-mm-dd hh24:mi') between intime and outtime) or\n (breakbegin is not null and\n (to_date(:begin_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:begin_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'begin_time'=>$begin_time,\n 'begin_time1'=>$begin_time,\n 'begin_time2'=>$begin_time));\n if($rs==0) return '1';\n $sql = <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:end_time, 'yyyy-mm-dd hh24:mi') between intime and\n outtime) or\n (breakbegin is not null and\n (to_date(:end_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:end_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'end_time'=>$end_time,\n 'end_time2'=>$end_time,\n 'end_time1'=>$end_time));\n if($rs==0) return '2';\n return 'ok';\n }",
"function getRatePeriodBoundaries($itemIds = array(), $startDate = null, $endDate = null) {\r\n\t\t$endDate = strtotime('+1 day', strtotime($endDate));\r\n\t\t$endDate = date('Y-m-d', $endDate);\r\n\r\n\t\t$ratePeriodBoundaries = array();\r\n\t\t//loop through all of the items\r\n\t\t$this->recursive = 2;\r\n\t\tforeach($itemIds as $itemId):\r\n\t\t\t$this->id = $itemId;\r\n\t\t\t$this->read(null, $this->id);\r\n\t\t\t$this->loaItems[$this->id] = $this->data;\r\n\r\n \t\t\tforeach($this->data['LoaItemRatePeriod'] as $loaItemRatePeriod):\r\n\t\t\t\tforeach($loaItemRatePeriod['LoaItemDate'] as $loaItemDate):\r\n\r\n\t\t\t\t\t$ratePeriodBoundaries[$loaItemDate['startDate']] = $loaItemDate['endDate'];\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\tif (!in_array($loaItemDate['startDate'], $ratePeriodBoundaries)) {\r\n\t\t\t\t\t\t$ratePeriodBoundaries[] = $loaItemDate['startDate'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!in_array($loaItemDate['endDate'], $ratePeriodBoundaries)) {\r\n\t\t\t\t\t\t$ratePeriodBoundaries[] = $loaItemDate['endDate'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t/*\r\n \t\t\t $loaItemDate['endDate'] = date('Y-m-d', strtotime('+1 day', strtotime($loaItemDate['endDate'])));\r\n \t\t\t \r\n\t\t\t\tif(null != $startDate && strtotime($loaItemDate['startDate']) > strtotime($startDate) && strtotime($loaItemDate['startDate']) < strtotime($endDate)):\r\n\t\t\t\t\t$ratePeriodBoundaries[] = $loaItemDate['startDate'];\r\n\t\t\t\tendif;\r\n\t\t\t\r\n\t\t\t\tif(null != $endDate && strtotime($loaItemDate['endDate']) < strtotime($endDate) && strtotime($loaItemDate['endDate']) > strtotime($startDate)):\r\n\t\t\t\t\t$ratePeriodBoundaries[] = $loaItemDate['endDate'];\r\n\t\t\t\tendif;i\r\n\t\t\t\t*/\r\n\r\n\t\t\t\tendforeach;\r\n\t\t\tendforeach;\r\n\r\n\t\tendforeach;\r\n\t\t\r\n\t\tksort($ratePeriodBoundaries);\t\t\t//sort boundaries\r\n\t\t\r\n\t\t/*\r\n\t\tif($startDate !== null):\t\t\t\t//append start date if entered\r\n\t\t\tarray_unshift($ratePeriodBoundaries, $startDate);\r\n\t\tendif;\r\n\t\t\t\r\n\t\tif($endDate !== null):\t\t\t\t\t//append end date if entered\r\n\t\t\tarray_push($ratePeriodBoundaries, $endDate);\r\n\t\tendif;\r\n\t\t*/\r\n\r\n\t\t//$ratePeriodBoundaries = array_unique($ratePeriodBoundaries);\r\n\t\t//$ratePeriodBoundaries = array_merge($ratePeriodBoundaries, array());\t//fix the fact that array_unique does not re-number keys\r\n\r\n\t\treturn $ratePeriodBoundaries;\r\n\t}",
"function getContractEndDate($customer_id, $contract_id = false)\n {\n }",
"function carveDateRanges($validDates, $blackoutDates) {\r\n\t\t// build date boundaries and carve out new ranges\r\n\r\n\t\t$ranges = array();\t// new carved date ranges\r\n\r\n\t\t// gather all days to use as guide boundaries\r\n\t\t$dates = array();\r\n\t\tforeach (array_merge($validDates, $blackoutDates) as $d) {\r\n\t\t\t$dates[] = $d['s'];\r\n\t\t\t$dates[] = $d['e'];\r\n\t\t}\r\n\t\t$dates = array_unique($dates);\r\n\t\tsort($dates);\t// sort reorders indexes and sorts by value\r\n\r\n\t\t$count = count($dates);\r\n\t\tforeach ($dates as $k => $d) {\r\n\t\t\t$next_index = $k + 1;\r\n\t\t\t$prev_index = $k - 1;\r\n\t\t\tif ($next_index >= $count) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$range1 = $d;\r\n\t\t\t$range2 = $dates[$next_index];\r\n\t\t\tforeach ($validDates as $vd) {\r\n\t\t\t\tif ($range1 >= $vd['s'] && $range2 <= $vd['e']) {\r\n\t\t\t\t\t// label validity or blackout for use in other functions\r\n\t\t\t\t\t$type = 'validity';\r\n\t\t\t\t\tforeach ($blackoutDates as $xd) {\r\n\t\t\t\t\t\tif ($range1 >= $xd['s'] && $range2 <= $xd['e']) {\r\n\t\t\t\t\t\t\t$type = 'blackout';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ranges[] = array('s' => $range1, 'e' => $range2, 't' => $type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->cleanCarvedDateRanges($ranges);\r\n\t}",
"public function isOverlapLeaveRequest() {\n $posts = $this->getValues();\n $leavePeriodService = new LeavePeriodService();\n $leavePeriodService->setLeavePeriodDao(new LeavePeriodDao());\n\n $leavePeriod = $leavePeriodService->getLeavePeriod(strtotime($posts['txtFromDate']));\n\n if ($leavePeriod != null) {\n if ($posts['txtToDate'] > $leavePeriod->getEndDate())\n return true;\n }\n\n return false;\n }",
"public static function splitBookingLiveIn($startDate, $endDate) {\n\n $startRange = self::getWeekRange($startDate);\n $endRange = self::getWeekRange($endDate);\n\n $weeks = self::weeksBetween_DBDate($startRange[0], $endRange[1]);\n\n $length = BusinessRules::getLiveInMissionPaymentNumberDays();\n\n if ($weeks <= 3) {\n\n $results[] = array('startDay' => $startDate, 'endDay' => $endDate);\n } else {\n\n $daysBetween = self::daysBetween_DBDate($startDate, $endDate);\n\n if ($daysBetween <= 21) {\n $results[] = array('startDay' => $startDate, 'endDay' => $endDate);\n } else {\n\n $results = array();\n\n $starDateStamp = DateTime::createFromFormat(\"Y-m-d\", $startDate);\n $year = $starDateStamp->format(\"Y\");\n $week = $starDateStamp->format(\"W\") - 1; //week starts at zero in getStartAndEndDate\n\n $startDay = null;\n $endDay = null;\n\n $lastWeekIndex = $weeks - 1;\n\n $firstTime = true;\n $end = false;\n\n while ($end == false) {\n\n if ($firstTime) {\n\n $startDay = $startDate;\n $endDay = Calendar::addDays($startDay, $length, Calendar::FORMAT_DBDATE);\n $results[] = array('startDay' => $startDay, 'endDay' => $endDay);\n $firstTime = false;\n } else {\n\n $startDay = $endDay; //'Calendar::addDays($endDay, 1, Calendar::FORMAT_DBDATE);\n $endDay = Calendar::addDays($startDay, $length, Calendar::FORMAT_DBDATE);\n $results[] = array('startDay' => $startDay, 'endDay' => $endDay);\n }\n\n //if current slot end day is after entered endData, stop it\n if (Calendar::dateIsBefore($endDate, $endDay, true)) {\n\n $end = true;\n }\n }\n\n //set the last slot to end date \n $results[count($results) - 1]['endDay'] = $endDate;\n\n $lastSlot = $results[count($results) - 1];\n\n //if last slot is less than 7 days, merge it\n $lastSlotDays = self::daysBetween_DBDate($lastSlot['startDay'], $lastSlot['endDay']);\n\n if ($lastSlotDays < 7) {\n\n //set the penultimate slot to end date and remove last one\n $results[count($results) - 2]['endDay'] = $endDate;\n ;\n unset($results[count($results) - 1]);\n }\n }\n }\n\n return $results;\n }",
"public function checkContractDates(){\n\t\t\n\t\t$return = false;\n\t\t$start_date = $this->input->post('start_date');\n\t\t$end_date = $this->input->post('end_date');\n\t\t$datetime1 = date_create($start_date);\n $datetime2 = date_create($end_date);\n $interval = date_diff($datetime1, $datetime2);\n \n\t\t$diff = $interval->format('%R');\n\t\tif($diff == '-'){\n\t\t\t$return = false;\n\t\t}else{\n\t\t\t$return = true;\n\t\t}\n\t\techo json_encode($return);\n\t}",
"public function getApprovedBeforeAcademicYearDays( $user, $requestTypeStr, $startStr=null, $endStr=null, $status=\"approved\" ) {\n //$logger = $this->container->get('logger');\n $days = 0;\n $accurate = true;\n $subRequestGetMethod = \"getRequest\".$requestTypeStr;\n\n //echo \"before startStr=\".$startStr.\"<br>\";\n //echo \"before endStr=\".$endStr.\"<br>\";\n $requests = $this->getApprovedYearDays($user,$requestTypeStr,$startStr,$endStr,\"before\",$asObject=true,$status);\n //echo \"before requests count=\".count($requests).\"<br>\";\n\n //$accurateNoteArr = array();\n\n foreach( $requests as $request ) {\n $subRequest = $request->$subRequestGetMethod();\n $requestEndAcademicYearStr = $this->getAcademicYearEdgeDateBetweenRequestStartEnd($request,\"first\");\n if( !$requestEndAcademicYearStr ) {\n //echo $request->getId().\" continue <br>\";\n continue;\n }\n //echo \"requestStartDate=\".$subRequest->getStartDate()->format('Y-m-d').\"<br>\";\n //echo \"requestEndAcademicYearStr=\".$requestEndAcademicYearStr.\"<br>\";\n //echo $request->getId().\": before: request days=\".$subRequest->getNumberOfDays().\"<br>\";\n //$workingDays = $this->getNumberOfWorkingDaysBetweenDates( $subRequest->getStartDate(), new \\DateTime($requestEndAcademicYearStr) );\n $workingDays = $this->getNumberOfWorkingDaysBetweenDates( new \\DateTime($requestEndAcademicYearStr), $subRequest->getEndDate() );\n //echo \"workingDays=\".$workingDays.\"<br>\";\n\n $requestNumberOfDays = $subRequest->getNumberOfDays();\n\n if( $workingDays > $requestNumberOfDays ) {\n //$logger->warning(\"Logical error getApprovedBeforeAcademicYearDays: number of calculated working days (\".$workingDays.\") are more than number of days in request (\".$subRequest->getNumberOfDays().\")\");\n $workingDays = $requestNumberOfDays;\n }\n\n if( $workingDays != $requestNumberOfDays ) {\n //inaccuracy\n //echo \"user=\".$request->getUser().\"<br>\";\n //echo \"Before: ID# \".$request->getId().\" inaccurate: workingDays=\".$workingDays.\" enteredDays=\".$subRequest->getNumberOfDays().\"<br>\";\n $accurate = false;\n //$accurateNoteArr[$request->getId()] = \"Submitted $requestNumberOfDays days off differ from $workingDays weekly working days\"; //based on 5 days per week\n }\n\n// //TODO: Use holiday dates to calculate the WCM working days\n// if( $accurate ) {\n// //$requestTypeStr = 'vacation' or 'business'\n// //getDaysDifferenceNote($vacreqRequest)\n// //count number of vacation days from $startDate and $endDate\n// $startDate = null;\n// $endDate = null;\n// if( $startStr ) {\n// $startDate = \\DateTime::createfromformat('Y-m-d H:i:s', $startStr);\n// }\n// if( $endStr ) {\n// $endDate = \\DateTime::createfromformat('Y-m-d H:i:s', $endStr);\n// }\n// $institution = $request->getInstitution();\n// $institutionId = null;\n// if( $institution ) {\n// $institutionId = $institution->getId();\n// }\n// //$countedNumberOfDays = $this->getNumberOfWorkingDaysBetweenDates($startDate,$endDate);\n// $holidays = $this->getHolidaysInRange($startDate,$endDate,$institutionId,$custom=false);\n// //$holidays = array(); $holidays[] = 1;//testing\n// $countedNumberOfDays = intval($workingDays) - count($holidays);\n//\n// if( $countedNumberOfDays != $requestNumberOfDays ) {\n// $accurate = false;\n// $accurateNoteArr[$request->getId()] = \"Submitted $requestNumberOfDays days off differ\".\n// \" from $countedNumberOfDays working days corrected by holidays\".\n// \" (\".intval($workingDays).\"-\".count($holidays).\")\";\n// }\n// //$accurate = false;\n// }\n\n //echo $request->getId().\": before: request days=\".$workingDays.\"<br>\";\n $days = $days + $workingDays;\n }\n\n $res = array(\n 'numberOfDays' => $days,\n 'accurate' => $accurate, //accurate = false indicates that calculation contains transition between academic year\n //'accurateNoteArr' => $accurateNoteArr\n );\n\n return $res;\n }",
"protected function getVacationsInRange(\\DateTimeInterface $start = null, \\DateTimeInterface $end = null)\n {\n $whereCondition = null;\n if ($start) {\n $whereCondition = \"WHERE (v.start >= :start AND v.start < :end) OR (v.end >= :start AND v.end < :end)\";\n }\n\n $query = $this->entityManager->createQuery(\n \"SELECT v FROM Qafoo\\TimePlannerBundle\\Domain\\Vacation v $whereCondition ORDER BY v.start\"\n );\n\n if ($whereCondition) {\n $query->setParameter('start', $start);\n $query->setParameter('end', $end);\n }\n\n return $query->getResult();\n }",
"protected function calculateStartEnd() : array {\n\t\t$event = $this->getEvent();\n\t\t$year = $event->getRouteParam('year', $event->getQueryParam('year', date('Y')));\n\t\t$month = $event->getRouteParam('month', $event->getQueryParam('month', date('m')));\n\t\t$start = $event->getQueryParam('start');\n\t\t$end = $event->getQueryParam('end');\n\n\t\tif($start && !is_numeric($start)) $start = strtotime($start);\n\t\tif($end && !is_numeric($end)) $end = strtotime($end);\n\n\t\tif($start === null) { // Default is beginning of current month\n\t\t\t$start = mktime(0, 0, 0, $month, 1, $year);\n\t\t}\n\n\t\t// Calculate end of this month (actually beginning of next month)\n\t\tif($month == 12) {\n\t\t\t$_month = 1;\n\t\t\t$_year = $year + 1;\n\t\t}\n\t\telse {\n\t\t\t$_month = $month + 1;\n\t\t\t$_year = $year;\n\t\t}\n\t\t$endOfThisMonth = mktime(0, 0, 0, $_month, 1, $_year);\n\n\n\t\tif($end === null) { // Default is beginning of next month\n\t\t\t$end = $endOfThisMonth;\n\t\t}\n\n\t\t// Don't go beyond current month\n\t\tif($end > $endOfThisMonth) $end = $endOfThisMonth;\n\n\t\treturn [(int) $start, (int) $end];\n\t}",
"public static function dateRangeComputation(){\n\t\t$data = [];\n\t\t$input = request();\n\t\tif( !empty( $input ) ) $data['input'] = request();\n\t\n\t\t//date_from and date_to will automatically be \"TODAY\" if empty\n\t\tif( !empty( $input['date_from'] ) ){\n\t\t\t$date_from_stamp = strtotime( $input['date_from'] );\n\t\t\t$data['date_from'] = $input['date_from'];\n\t\t}\n\t\telse {\n\t\t\t$date_from_stamp = strtotime( \"this week\",strtotime( \"today\" ) );//by default show first day of the week\n\t\t\t$data['date_from'] = date( \"Y-m-d\", $date_from_stamp );\t\t\t\n\t\t}\n\t\t\n\t\tif( !empty( $input['date_to'] ) ){\n\t\t\t$date_to_stamp = strtotime( $input['date_to'] );\n\t\t\t$data['date_to'] = $input['date_to'];\n\t\t}\n\t\telse{\n\t\t\t$date_to_stamp = strtotime( date( \"Y-m-d\", $date_from_stamp ).\" +1 week\" ) - 1;//by default show last day of the week\n\t\t\t$data['date_to'] = date( \"Y-m-d\", $date_to_stamp );\t\t\t\n\t\t}\t\t\n\t\t\n\t\tif( $date_from_stamp > $date_to_stamp ){\n\t\t\terror(-80101, \"[ date_from ] cannot be more than [ date_to ]\");\n\t\t\t$data['show_by'] = '';\n\t\t\t$data['error'] = 1;//\n\t\t\t$data['date_by'] = [];\n\t\t}\n\t\telse{\n\t\t\tif( empty( $input['show_by'] ) ) $data['show_by'] = 'day';\n\t\t\telse $data['show_by'] = $input['show_by']; \n\t\t\n\t\t\t$from_diff = date_create( $data['date_from'] );\n\t\t\t$to_diff = date_create( $data['date_to'] );\n\t\t\t$date_diff = date_diff( $from_diff, $to_diff );\t\t\t\t\n\t\t\t$week_diff = ceil( ( strtotime( \"this week\", $date_to_stamp ) - strtotime( \"this week\", $date_from_stamp ) ) /604800 );//became complicated..\n\t\t\t\n\t\t\t$difference = [];\t\t\t\n\t\t\t$difference['day'] = $date_diff->days;\n\t\t\t$difference['week'] = $week_diff;\t\n\n\t\t\tif( date(\"m\",$date_to_stamp) < date (\"m\",$date_from_stamp ) ) $month_to = date (\"m\",$date_to_stamp ) + 12;\n\t\t\telse $month_to = date (\"m\",$date_to_stamp );\n\t\t\t\n\t\t\t$difference['month'] = ( $date_diff->y * 12 ) + ( $month_to - date (\"m\",$date_from_stamp ) );\n\n\t\t\t$data['difference'] = $difference;\t\n\t\t\t\n\t\t\t//automatically show ALL if show_by is empty\n\t\t\tif( $data['show_by'] == '' || $data['show_by'] == 'day' ){\n\t\t\t\t$data['date_from_stamp']['day'] = $date_from_stamp;\n\t\t\t\t$data['date_to_stamp']['day'] = strtotime( date( \"Y-m-d\",$date_to_stamp ).\" +1 day\" ) - 1;//needs more test\n\t\t\t\t$data['sql_group_by'] = \" GROUP BY day( FROM_UNIXTIME( created ) )\";\n\t\t\t\t$data['date_guide'] = \"Y-m-d\";\n\t\t\t}\n\t\t\t\n\t\t\tif( $data['show_by'] == '' || $data['show_by'] == 'week' ){\n\t\t\t\t$data['date_from_stamp']['week'] = strtotime( \"this week\", $date_from_stamp );\t\t\t\t\n\t\t\t\t$data['date_to_stamp']['week'] = strtotime( \"this week\", $date_to_stamp );\t\t\t\t\n\t\t\t\t$data['date_to_stamp']['week'] = strtotime( date( \"Y-m-d\",strtotime( \"this week\", $date_to_stamp ) ).\" +1 week\" ) - 1;//needs more test\n\t\t\t\t$data['sql_group_by'] = \" GROUP BY week( FROM_UNIXTIME( created ) )\";\n\t\t\t\t$data['date_guide'] = \"Y-\\WW\";\n\t\t\t}\n\t\t\t\n\t\t\tif( $data['show_by'] == '' || $data['show_by'] == 'month' ){\n\t\t\t\t$data['date_from_stamp']['month'] = strtotime( date('Y-m-1',$date_from_stamp) );\t\t\t\t\n\t\t\t\t$data['date_to_stamp']['month'] = strtotime( date('Y-m-1',$date_to_stamp) );\n\t\t\t\t$data['date_to_stamp']['month'] = strtotime( date( \"Y-m-1\",$date_to_stamp ).\" +1 month\" ) - 1;//needs more test\n\t\t\t\t$data['sql_group_by'] = \" GROUP BY month( FROM_UNIXTIME( created ) )\";\n\t\t\t\t$data['date_guide'] = \"Y-m\";\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t\n\t\treturn $data;\n\t}",
"public function calculateBusinessDays()\n {\n return $this->calculateDays(request('start_date'), request('end_date'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation updateNetworkSwitchDscpToCosMappingsWithHttpInfo Update the DSCP to CoS mappings | public function updateNetworkSwitchDscpToCosMappingsWithHttpInfo($network_id, $update_network_switch_dscp_to_cos_mappings)
{
$returnType = 'object';
$request = $this->updateNetworkSwitchDscpToCosMappingsRequest($network_id, $update_network_switch_dscp_to_cos_mappings);
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()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'object',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"protected function updateNetworkSwitchDscpToCosMappingsRequest($network_id, $update_network_switch_dscp_to_cos_mappings)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkSwitchDscpToCosMappings'\n );\n }\n // verify the required parameter 'update_network_switch_dscp_to_cos_mappings' is set\n if ($update_network_switch_dscp_to_cos_mappings === null || (is_array($update_network_switch_dscp_to_cos_mappings) && count($update_network_switch_dscp_to_cos_mappings) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_network_switch_dscp_to_cos_mappings when calling updateNetworkSwitchDscpToCosMappings'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/dscpToCosMappings';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_switch_dscp_to_cos_mappings)) {\n $_tempBody = $update_network_switch_dscp_to_cos_mappings;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateNetworkSwitchDscpToCosMappingsAsyncWithHttpInfo($network_id, $update_network_switch_dscp_to_cos_mappings)\n {\n $returnType = 'object';\n $request = $this->updateNetworkSwitchDscpToCosMappingsRequest($network_id, $update_network_switch_dscp_to_cos_mappings);\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 updateNetworkSwitchDscpToCosMappingsAsync($network_id, $update_network_switch_dscp_to_cos_mappings)\n {\n return $this->updateNetworkSwitchDscpToCosMappingsAsyncWithHttpInfo($network_id, $update_network_switch_dscp_to_cos_mappings)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getNetworkSwitchDscpToCosMappingsWithHttpInfo($network_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchDscpToCosMappingsRequest($network_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() ? $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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getNetworkSwitchDscpToCosMappings($network_id)\n {\n list($response) = $this->getNetworkSwitchDscpToCosMappingsWithHttpInfo($network_id);\n return $response;\n }",
"public function getNetworkSwitchDscpToCosMappingsAsyncWithHttpInfo($network_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchDscpToCosMappingsRequest($network_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 = $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 getNetworkSwitchDscpToCosMappingsAsync($network_id)\n {\n return $this->getNetworkSwitchDscpToCosMappingsAsyncWithHttpInfo($network_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putOutboundWrapupcodemappingsWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\WrapUpCodeMapping';\n $request = $this->putOutboundWrapupcodemappingsRequest($body);\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 '\\PureCloudPlatform\\Client\\V2\\Model\\WrapUpCodeMapping',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testUpdateNetworkSwitchRoutingOspf()\n {\n }",
"public function setConversionValueMapping($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V14\\Resources\\CustomerSkAdNetworkConversionValueSchema\\SkAdNetworkConversionValueSchema\\ConversionValueMapping::class);\n $this->conversion_value_mapping = $var;\n\n return $this;\n }",
"public function customersIdTeamsNkDataSourceSoapsFkPutWithHttpInfo($id, $nk, $fk, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling customersIdTeamsNkDataSourceSoapsFkPut');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling customersIdTeamsNkDataSourceSoapsFkPut');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling customersIdTeamsNkDataSourceSoapsFkPut');\n }\n // parse inputs\n $resourcePath = \"/Customers/{id}/teams/{nk}/dataSourceSoaps/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\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('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\DataSourceSoap',\n '/Customers/{id}/teams/{nk}/dataSourceSoaps/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\DataSourceSoap', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\DataSourceSoap', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"function setControllerMap(mvcControllerMap $inParamValue) {\n\t\treturn $this->setParam(self::PARAM_DISTRIBUTOR_CONTROLLER_MAP, $inParamValue);\n\t}",
"public function testUpdateNetworkSwitchSettings()\n {\n }",
"public function updateNetworkSwitchStackRoutingInterfaceDhcpWithHttpInfo($network_id, $switch_stack_id, $interface_id, $update_network_switch_stack_routing_interface_dhcp = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkSwitchStackRoutingInterfaceDhcpRequest($network_id, $switch_stack_id, $interface_id, $update_network_switch_stack_routing_interface_dhcp);\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testUpdateNetworkSwitchStp()\n {\n }",
"public function customersIdTeamsNkDataSourceSoapsPostWithHttpInfo($id, $nk, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling customersIdTeamsNkDataSourceSoapsPost');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling customersIdTeamsNkDataSourceSoapsPost');\n }\n // parse inputs\n $resourcePath = \"/Customers/{id}/teams/{nk}/dataSourceSoaps\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\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('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\DataSourceSoap',\n '/Customers/{id}/teams/{nk}/dataSourceSoaps'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\DataSourceSoap', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\DataSourceSoap', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function update($project, $urlMap, Forminator_Google_Service_Compute_UrlMap $postBody, $optParams = array())\n {\n $params = array('project' => $project, 'urlMap' => $urlMap, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('update', array($params), \"Forminator_Google_Service_Compute_Operation\");\n }",
"public function updateMap(){\n mapModel::insertMap($this, \"Update\");\n }",
"public function updateMappings()\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invite or grant access to project | public function inviteOrGrant($project, $email)
{
$existingPerson = null;
foreach($this->people() as $person){
if($person->email_address == auth()->user()->email) {
$existingPerson = $person;
break;
}
}
if($existingPerson)
return $this->projectGrant($project, $existingPerson);
else
return $this->invitePeople($project, $email);
} | [
"public function testInviteProjectUser()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function handleInviteUserToProject() {\n $projectId = $this->getFromBody('projectId');\n $userId = $this->getFromBody('userId');\n $email = $this->getFromBody('email');\n\n $user = $this->usersDao->getUser($userId);\n // TODO: handle case when user is not found\n\n $project = $this->projectsDao->getProject($projectId);\n // TODO: handle case when showcase project is not found\n\n $invitation = new CollaborationInvitation();\n $invitation\n ->setProjectId($projectId)\n ->setEmail($email);\n\n $sent = $this->mailer->sendInvite($user, $email, $project, $invitation->getId());\n if (!$sent) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, \"Failed to send invitation to $email\"));\n }\n\n $ok = $this->projectsDao->addInvitationToCollaborateOnProject($invitation);\n if (!$ok) {\n $this->response(new Response(\n Response::INTERNAL_SERVER_ERROR, \n 'Failed to save invitation. You may have to send another invite.'\n ));\n }\n\n $this->respond(new Response(\n Response::OK,\n \"Successfully sent invitation to $email\"\n ));\n }",
"public function test_check_if_user_has_the_right_permissions_for_a_project()\n {\n // GIVEN\n $this->seed(DatabaseSeeder::class);\n $user = User::find(1);\n $project = Project::find(1);\n // WHEN\n $user->attachPermission('project-update');\n $result = $user->isAbleToAndOwns('project-update', $project);\n // THEN\n $this->assertTrue($result);\n }",
"function ict_project_access_add_approver($email, $nid) {\n $user = user_load_by_mail($email);\n\n $query = db_insert('project_access')\n ->fields(array(\n 'uid' => $user->uid,\n 'nid' => $nid,\n 'access_type' => ICT_PROJECT_APPROVER_ACCESS,\n 'created' => time()\n ))\n ->execute();\n\n $node_wrapper = entity_metadata_wrapper('node', $nid);\n drupal_mail('ict_mail', 'approver_add', $email, LANGUAGE_NONE, array(\n 'title' => $node_wrapper->title->value(),\n 'name' => _ict_project_get_user_name($user),\n 'admin_name' => _ict_project_get_user_name(),\n 'rebaseline' => ict_project_is_rebaseline($nid)\n ));\n\n return $query;\n}",
"function fre_access_workspace($project){\n global $user_ID;\n // check freelancer was accepted on project\n $bid_id = get_post_meta($project->ID, \"accepted\", true);\n $bid = get_post($bid_id);\n \n // current user is not project owner, or working on\n if (!$bid_id || ($user_ID != $project->post_author && $user_ID != $bid->post_author) ) {\n return false;\n }\n return true;\n}",
"function authorize_project($project_id, $connection = NULL) \n{\n if (is_admin_session()) {\n return TRUE;\n }\n \n global $_connection;\n if ($connection == NULL) {\n $connection = $_connection;\n }\n \n $session_user_id = get_session_user_id();\n $query = \"SELECT * \n FROM `access_table` AS A \n WHERE A.`user_id` = '$session_user_id' \n AND A.`project_id` = '$project_id' \";\n $access = db_fetch($query, $connection);\n if (! $access) {\n return FALSE;\n } else {\n return TRUE;\n }\n}",
"public function grantAccess(Employee $employee);",
"public function accept_invite_() {\n\t\teval(USER);\n\t\t$this->assign('waitSecond',1);\n\n\t\t$cond['team_id'] = $_GET['team'];\n\t\t$cond['user_id'] = session('userid');\n\t\t$data['statecode'] = 1;\n\n\t\ttry {\n\t\t\t$res = DBModel::updateDB('cernet_teammate', $cond, $data);\n\t\t\tunset($cond['team_id']);\n\t\t\t$cond['statecode'] = 0;\n\t\t\t$data['statecode'] = -1;\n\t\t\t$res = DBModel::updateDB('cernet_teammate', $cond, $data);\n\t\t\t$this->move2state3();\n\n\t\t\t$this->success('','__ROOT__/User/currentstage');\n\t\t}catch(Exception $e){\n\t\t\tthrow_exception($e->getMessage());\n\t\t}\t\n\t}",
"public function actionAddCreateProjectPerm ()\n {\n $auth = Yii::$app->authManager;\n\n $createProject = $auth->createPermission('createProject');\n $createProject->description = 'Create project';\n $auth->add($createProject);\n\n $admin = $auth->getRole('admin');\n\n $auth->addChild($admin, $createProject);\n }",
"public function acceptAccessProject($sourceID, $projectID){\r\n $sourceID = intval($sourceID);\r\n $projectID = intval($projectID);\r\n // 0=demande effectuee, 1=OK, 2=refus\r\n $sql = \"UPDATE `fichier_projet` SET `fp_demande_acces`=1 WHERE `fp_id_projet`=$projectID AND `fp_id_fichier`=$sourceID\";\r\n $this->db->query($sql);\r\n }",
"function add_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tadd_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}",
"private function _grantaccess()\n {\n $this->status = true;\n $this->controller = \"Modules/$this->_module/Controllers/\".$this->_action['Controller'];\n $this->action = $this->_action['ActionName'];\n }",
"public function testProjectProjectIDInviteUserPost()\n {\n }",
"public function invite(User $user, Project $project)\n {\n return $user->isAbleTo('invite-project-members', $project->id);\n }",
"function testProjectIsApproved() {\n $this->implugin->setReturnValue('_this_muc_exist', false);\n // muc_room_creation\n $this->implugin->expectOnce('_this_muc_exist', array('mockproject'));\n $this->jabbex->expectOnce('create_muc_room', array('mockproject', 'My Mock Project', 'Description of my Mock Project', 'mockuser'));\n // create_im_shared_group\n $this->jabbex->expectOnce('create_shared_group', array('mockproject', 'My Mock Project'));\n \n $params = array('group_id' => 1);\n $this->implugin->projectIsApproved($params);\n }",
"public function join(Project $project)\n {\n\t\t$this->middleware('auth');\n \tif ($user = auth()->user()) {\n \t\tif ($project->ismember($user)) \n\t\t\t\t$error = 'Você já faz parte do time do projeto/';\n\t\t\telse {\n\t\t\t\t$project->members()->attach($user->id,['role' => 'member']);\n\t\t\t\treturn Redirect::route('projects.show', $project->slug)->with('flash_success', 'Você entrou no time do projeto.'); \t\n\t\t\t}\n\t\t} else\n\t\t\t$error = 'Operação não permitida.';\n\t\t\n\t\treturn Redirect::route('projects.show', $project->slug)->with('flash_danger', $error); \t\n\t}",
"public function invite()\n {\n $this->validateRequest()\n ->createToken()\n ->send();\n }",
"function procJoinProject()\n {\n global $session, $form;\n if(strcmp($_GET['user'],GUEST)!=0)\n $retval = $session->joinProject($_GET['joinProject'],$_GET['user']);\n else\n $retval = false;\n \n if($retval)\n {\n $_SESSION['joinProjectSuccess'] = true;\n }\n else\n {\n $_SESSION['joinProjectSuccess'] = false;\n }\n header(\"Location: \".$session->referrer.\"?id=\".$_GET['joinProject']);\n }",
"public function testAddUserToProjectSuccess()\n {\n $adminProject = $this->findOneAdminEntity();\n $user = $this->em->getRepository('APICoreBundle:User')->findOneBy([\n 'username' => 'manager'\n ]);\n $acl = [];\n $acl[] = ProjectAclOptions::CREATE_TASK;\n\n $this->getClient(true)->request('POST', self::PROJECT_ACL_URL . '/project/' . $adminProject->getId() . '/user/' . $user->getId(),\n ['acl' => $acl], [],\n ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::CREATED_CODE, $this->getClient()->getResponse()->getStatusCode());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Samples Received District | public function fetchAllSamplesReceivedByDistrict($parameters)
{
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array('f_d_l_d.geo_name');
$orderColumns = array('f_d_l_d.geo_name', 'total_samples_received', 'total_samples_tested', 'total_samples_pending', 'total_samples_rejected', 'initial_pcr_percentage', 'second_third_pcr_percentage');
/*
* Paging
*/
$sLimit = "";
if (isset($parameters['iDisplayStart']) && $parameters['iDisplayLength'] != '-1') {
$sOffset = $parameters['iDisplayStart'];
$sLimit = $parameters['iDisplayLength'];
}
/*
* Ordering
*/
$sOrder = "";
if (isset($parameters['iSortCol_0'])) {
for ($i = 0; $i < intval($parameters['iSortingCols']); $i++) {
if ($parameters['bSortable_' . intval($parameters['iSortCol_' . $i])] == "true") {
$sOrder .= $orderColumns[intval($parameters['iSortCol_' . $i])] . " " . ($parameters['sSortDir_' . $i]) . ",";
}
}
$sOrder = substr_replace($sOrder, "", -1);
}
/*
* Filtering
* NOTE this does not match the built-in DataTables filtering which does it
* word by word on any field. It's possible to do here, but concerned about efficiency
* on very large tables, and MySQL's regex functionality is very limited
*/
$sWhere = "";
if (isset($parameters['sSearch']) && $parameters['sSearch'] != "") {
$searchArray = explode(" ", $parameters['sSearch']);
$sWhereSub = "";
foreach ($searchArray as $search) {
if ($sWhereSub == "") {
$sWhereSub .= "(";
} else {
$sWhereSub .= " AND (";
}
$colSize = count($aColumns);
for ($i = 0; $i < $colSize; $i++) {
if ($i < $colSize - 1) {
$sWhereSub .= $aColumns[$i] . " LIKE '%" . ($search) . "%' OR ";
} else {
$sWhereSub .= $aColumns[$i] . " LIKE '%" . ($search) . "%' ";
}
}
$sWhereSub .= ")";
}
$sWhere .= $sWhereSub;
}
/* Individual column filtering */
for ($i = 0; $i < count($aColumns); $i++) {
if (isset($parameters['bSearchable_' . $i]) && $parameters['bSearchable_' . $i] == "true" && $parameters['sSearch_' . $i] != '') {
if ($sWhere == "") {
$sWhere .= $aColumns[$i] . " LIKE '%" . ($parameters['sSearch_' . $i]) . "%' ";
} else {
$sWhere .= " AND " . $aColumns[$i] . " LIKE '%" . ($parameters['sSearch_' . $i]) . "%' ";
}
}
}
/*
* SQL queries
* Get data to display
*/
$dbAdapter = $this->adapter;
$sql = new Sql($dbAdapter);
$sQuery = $sql->select()->from(array('eid' => $this->table))
->columns(
array(
'eid_id',
'facility_id',
'sampleCollectionDate' => new Expression('DATE(sample_collection_date)'),
'result',
"total_samples_received" => new Expression("(COUNT(*))"),
"total_samples_tested" => new Expression("(SUM(CASE WHEN ((eid.result IS NOT NULL AND eid.result != '' AND eid.result != 'NULL') OR (eid.reason_for_sample_rejection IS NOT NULL AND eid.reason_for_sample_rejection != '' AND eid.reason_for_sample_rejection != 0)) THEN 1 ELSE 0 END))"),
"total_samples_pending" => new Expression("(SUM(CASE WHEN ((eid.result IS NULL OR eid.result = '' OR eid.result = 'NULL') AND (eid.reason_for_sample_rejection IS NULL OR eid.reason_for_sample_rejection = '' OR eid.reason_for_sample_rejection = 0)) THEN 1 ELSE 0 END))"),
"total_samples_rejected" => new Expression("SUM(CASE WHEN (eid.reason_for_sample_rejection !='' AND eid.reason_for_sample_rejection !='0' AND eid.reason_for_sample_rejection IS NOT NULL) THEN 1 ELSE 0 END)"),
"initial_pcr_percentage" => new Expression("TRUNCATE(((SUM(pcr_test_performed_before like 'no' OR pcr_test_performed_before is NULL OR pcr_test_performed_before like '')/COUNT(*))*100),2)"),
"second_third_pcr_percentage" => new Expression("TRUNCATE(((SUM(CASE WHEN (pcr_test_performed_before like 'yes') THEN 1 ELSE 0 END)/COUNT(*))*100),2)")
)
)
->join(array('f' => 'facility_details'), 'f.facility_id=eid.facility_id', array('facility_name'))
->join(array('f_d_l_d' => 'geographical_divisions'), 'f_d_l_d.geo_id=f.facility_district', array('district' => 'geo_name'))
->where("(eid.sample_collection_date is not null AND DATE(eid.sample_collection_date) !='1970-01-01' AND DATE(eid.sample_collection_date) !='0000-00-00')")
->group('f.facility_district');
if (isset($sWhere) && $sWhere != "") {
$sQuery->where($sWhere);
}
if (trim($parameters['fromDate']) != '' && trim($parameters['toDate']) != '') {
$startMonth = str_replace(' ', '-', $parameters['fromDate']) . "-01";
$endMonth = str_replace(' ', '-', $parameters['toDate']) . date('-t', strtotime($parameters['toDate']));
$sQuery = $sQuery
->where("(eid.sample_collection_date is not null AND eid.sample_collection_date not like '')
AND DATE(eid.sample_collection_date) >= '" . $startMonth . "'
AND DATE(eid.sample_collection_date) <= '" . $endMonth . "'");
}
if (isset($sOrder) && $sOrder != "") {
$sQuery->order($sOrder);
}
if (isset($sLimit) && isset($sOffset)) {
$sQuery->limit($sLimit);
$sQuery->offset($sOffset);
}
$sQueryStr = $sql->buildSqlString($sQuery); // Get the string of the Sql, instead of the Select-instance
//echo $sQueryStr;die;
$rResult = $dbAdapter->query($sQueryStr, $dbAdapter::QUERY_MODE_EXECUTE)->toArray();
/* Data set length after filtering */
$sQuery->reset('limit');
$sQuery->reset('offset');
$fQuery = $sql->buildSqlString($sQuery);
$aResultFilterTotal = $dbAdapter->query($fQuery, $dbAdapter::QUERY_MODE_EXECUTE)->toArray();
$iFilteredTotal = count($aResultFilterTotal);
/* Total data set length */
$iQuery = $sql->select()->from(array('eid' => $this->table))
->columns(
array(
'eid_id'
)
)
->join(array('f' => 'facility_details'), 'f.facility_id=eid.facility_id', array('facility_name'))
->join(array('f_d_l_d' => 'geographical_divisions'), 'f_d_l_d.geo_id=f.facility_district', array('district' => 'geo_name'))
->where("(eid.sample_collection_date is not null AND DATE(eid.sample_collection_date) !='1970-01-01' AND DATE(eid.sample_collection_date) !='0000-00-00')")
->group('f.facility_district');
if (trim($parameters['fromDate']) != '' && trim($parameters['toDate']) != '') {
$startMonth = str_replace(' ', '-', $parameters['fromDate']) . "-01";
$endMonth = str_replace(' ', '-', $parameters['toDate']) . date('-t', strtotime($parameters['toDate']));
$iQuery = $iQuery
->where("(eid.sample_collection_date is not null AND eid.sample_collection_date not like '')
AND DATE(eid.sample_collection_date) >= '" . $startMonth . "'
AND DATE(eid.sample_collection_date) <= '" . $endMonth . "'");
}
$iQueryStr = $sql->buildSqlString($iQuery);
$iResult = $dbAdapter->query($iQueryStr, $dbAdapter::QUERY_MODE_EXECUTE)->toArray();
$iTotal = count($iResult);
$output = array(
"sEcho" => intval($parameters['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
foreach ($rResult as $aRow) {
$row = array();
$row[] = $aRow['district'];
$row[] = $aRow['total_samples_received'];
$row[] = $aRow['total_samples_tested'];
$row[] = $aRow['total_samples_pending'];
$row[] = $aRow['total_samples_rejected'];
$row[] = (round($aRow['initial_pcr_percentage']) > 0) ? $aRow['initial_pcr_percentage'] . '%' : '';
$row[] = (round($aRow['second_third_pcr_percentage']) > 0) ? $aRow['second_third_pcr_percentage'] . '%' : '';
$output['aaData'][] = $row;
}
return $output;
} | [
"public function getdistrictList()\n {\n $region_id = $this->input->post('region_id',TRUE);\n echo $this->Plant_m->getdistrictList($region_id);\n }",
"function DISTRICT ($numr, $prc) {\n $districtCount = mysql_query(\"SELECT id, district_synonim FROM districts\");\n while ($row = mysql_fetch_array($districtCount)) {\n $disID['id'][] = $row['id'];\n $disID['syn'][] = $row['district_synonim'];\n }\n switch ($numr) :\n case ($numr == '1'): //if we choose this, we get one district and one street\n $chosenD = array_rand(range(1, count($disID['id'])), $numr);\n if ($chosenD == 0) {\n $chosenD = 1;\n }\n $query = mysql_query('SELECT id, street_name\n\t\tFROM streets WHERE district_id=' . $disID['id'][$chosenD] . ';');\n while ($row = mysql_fetch_assoc($query)) {\n $street[] = $row['street_name'] . '[' . $row['id'] . ']';\n }\n\n $streets = array_rand($street, 1);\n $street = $street[$streets];\n\n $query1 = mysql_query(\"SELECT `district_synonim` FROM `districts` WHERE `id` = \" . $disID['id'][$chosenD] . \" LIMIT 1;\");\n $result = mysql_result($query1, NULL);\n $result = explode(',', $result);\n $result = trim($result[rand(0, count($result) - 1)]) . '{' . $disID['id'][$chosenD] . '}' . \", \" . $street;\n break;\n case ($numr == '2'): //if we choose this, we get several districts or one district and several streets\n unset($result);\n if (rand(1, 2) > 1) :\n if(count($disID['id']) < 5): $max = count($disID['id']); else: $max = 5;\n endif;\n $chosenD = array_rand($disID['id'], rand(2, $max));\n foreach ($chosenD as $key) :\n $dis = explode(',', $disID['syn'][$key]);\n @$result .= trim($dis[rand(0, count($dis) - 1)]) . '{' . $disID['id'][$key] . '}, ';\n endforeach\n ;\n else :\n $chosenD = array_rand(range(1, count($disID['id'])), 1);\n $query = mysql_query('SELECT id, street_name\n\t\tFROM streets WHERE district_id=' . $disID['id'][$chosenD] . ';');\n while ($row = mysql_fetch_assoc($query)) {\n $street[] = $row['street_name'] . '[' . $row['id'] . ']';\n }\n if (count($street) > 5) :\n $max = 5;\n else :\n $max = count($street);\n endif;\n $streets = array_rand($street, $max);\n foreach ($streets as $str) :\n @$result .= \", \" . $street[$str];\n endforeach\n ;\n $dis = explode(',', $disID['syn'][$chosenD]);\n @$result = trim($dis[rand(0, count($dis) - 1)]) . '{' . $disID['id'][$chosenD] . '}' . $result;\n endif;\n break;\n case ($numr == '3'):\n $streetPref = array('на улице',\n '',\n 'рядом с улицей',\n '',\n 'недалеко от улицы',\n '',\n 'поблизости от улицы',\n 'желательно на улице',\n '',\n 'желательна улица');\n $chosenD = array_rand(range(1, count($disID['id'])), 1);\n if ($chosenD == 0) {\n $chosenD = 1;\n }\n $query = mysql_query('SELECT id, street_name\n\t\tFROM streets WHERE district_id=' . $disID['id'][$chosenD] . ';');\n while ($row = mysql_fetch_assoc($query)) {\n $street[] = $row['street_name'] . '[' . $row['id'] . ']';\n }\n $streets = array_rand($street, 1);\n $street = $street[$streets];\n $query1 = mysql_query(\"SELECT `district_synonim` FROM `districts` WHERE `id` = \" . $disID['id'][$chosenD] . \" LIMIT 1;\");\n $result = mysql_result($query1, NULL);\n $result = explode(',', $result);\n $result = trim($result[rand(0, count($result) - 1)])\n . '{' . $disID['id'][$chosenD] . '}' . \", \"\n . $streetPref[rand(0, count($streetPref) - 1)] . \" \" . $street;\n break;\n endswitch\n ;\n $rmRn = rand(0, 100);\n if (@$rmRn < $prc) {\n return $result;\n }\n }",
"function db_load_district_list()\r\n {\r\n $this->districts = array();\r\n $dbmgr = new DB_Mgr(\"sites\");\r\n $select = \"SELECT * FROM SI_DISTRICT ORDER BY region_num, district_num\";\r\n $dbmgr->query($select);\r\n while($row = $dbmgr->get_a_row())\r\n {\r\n $tmp = new District($row[0], $row[2], $row[3], $row[1]);\r\n array_push($this->districts, $tmp);\r\n }\r\n }",
"public static function listingAllDistricts(){\n\t\t$response = new stdClass();\n\t\t$arr = array();\n\t\ttry {\n\t\t\t$result = DB::table(Config::get('constants.TABLE_NAME.DISTRICT'))\n\t\t\t->select('id','dis_name_en', 'dis_name_km')\n\t\t\t->get();\n\t\t\t$response->data = $result;\n\t\t}catch (\\Exception $e){\n\t\t\tLog::error('Message: '.$e->getMessage().' File:'.$e->getFile().' Line'.$e->getLine());\n\t\t}\n\t\treturn $response;\n\t}",
"public function getMissingDistrict() {\n $findspots = $this->getAdapter();\n $select = $findspots->select()\n ->from($this->_name,array('id','county','parish'))\n ->where('county IS NOT NULL')\n ->where('parish IS NOT NULL')\n ->where('district IS NULL')\n ->limit(5000);\n return $findspots->fetchAll($select);\n }",
"static function allCountyDistrictArray() {\n $districtObj = new Model_Table_District();\n $select = $districtObj->select()\n ->from('iep_district', array('id_county', 'id_district', 'name_district'))\n ->where( \"status ='Active'\" )\n ->order( \"name_district\" );\n $districts = $districtObj->fetchAll($select);\n $retArray = array();\n foreach($districts as $d) {\n $retArray[$d->id_county.'-'.$d->id_district] = $d->toArray();\n }\n \treturn $retArray;\n }",
"public function district_occurences($year) {\n $this->load->database();\n\n $this->db->distinct();\n $this->db->select('district_id,districts.name,districts.longitude,districts.latitude,confirmed_disease_id')\n ->from('zoonotic_surveillance_data')\n ->where('year',$year)\n ->where('confirmation',1)\n ->join('districts', 'zoonotic_surveillance_data.district_id = districts.ID');\n\n $updates = $this->db->get()->result_array();\n return $updates;\n }",
"public function testGetDistrictForContact()\n {\n }",
"public function facility_data($disease = 0, $district = 0, $year = 0) {\n $facilities = Facilities::getDistrictFacilities($district);\n $this->load->database();\n\n foreach ($facilities as $facility) {\n $sql = 'select * from zoonotic_surveillance_data where abs(confirmed_disease_id) = ? and abs(facility_id) = ? and abs(confirmation) = ? and abs(year) = ?';\n $query = $this->db->query($sql, array($disease, $facility->facilitycode,1,$year));\n $ocs = $query->num_rows();\n $totalOcs[] = array('name' => $facility -> Name, 'oc' => $ocs);\n }\n return $totalOcs;\n }",
"function fetch_all_positive_case_districtwise($disease_sub_id,$subdivision_code)\n{\n\n/*$sql=\"select disease_subcatagory.disease_sub_id,count(patient_test_details.PN_flag) as positive_flag from patient_test_details INNER JOIN test_master ON test_master.test_type_code=patient_test_details.test_id INNER JOIN disease_subcatagory ON disease_subcatagory.disease_sub_id= test_master.disease_sub_category_id INNER JOIN user_area on user_area.user_id=patient_test_details.institution_code INNER JOIN subdivisions ON subdivisions.subdivision_code=user_area.subdivision_code WHERE disease_subcatagory.disease_sub_id='$disease_sub_id' AND subdivisions.subdivision_code='$subdivision_code' GROUP BY disease_subcatagory.disease_sub_id\";*/\n$sql=\"select COUNT(patient_test_details.PN_flag) as positive_flag from patient_test_details INNER JOIN test_master ON test_master.test_type_code=patient_test_details.test_id INNER JOIN disease_subcatagory ON disease_subcatagory.disease_sub_id= test_master.disease_sub_category_id INNER JOIN user_area on user_area.user_id=patient_test_details.institution_code INNER JOIN subdivisions ON subdivisions.subdivision_code=user_area.subdivision_code WHERE disease_subcatagory.disease_sub_id='$disease_sub_id' AND subdivisions.subdivision_code='$subdivision_code' \";\n $ci =& get_instance();\n $ci->load->database();\n$query = $ci->db->query($sql);\n$row = $query->result_array();\nreturn $row;\n\n}",
"public function testGetDistrictForUser()\n {\n }",
"public function district_state() {\n\t\t$data = '';\n\t\tif($this->input->post('value')) {\n\t\t\t$data = $this->admin_model->get_district_by_state($this->input->post('value'));\n\t\t}\n\t\techo json_encode($data);\n\t}",
"public function getDistrictFilteredArray($que_id,$ans_name,$district_name,$data_disability,$data_year){\n \t$sql='SELECT count(*) as count \n \tFROM `survey_response` AS sr INNER JOIN `survey` AS s ON sr.survey_id=s.id \n \tINNER JOIN answer AS a ON sr.answer_id=a.id \n \tINNER JOIN `district` AS d ON s.district_id=d.id \n \tWHERE d.name=:dname AND sr.question_id = :qnid AND a.name = :name AND YEAR(s.date)= :yname';\n if($data_disability==1){\n $sql=$sql.' AND s.disability = 1' ;\n }\n\t\t$em = $this->getEntityManager();\n\t\t$connection = $em->getConnection();\t\n\t\t$statement = $connection->prepare($sql); $statement->bindValue('yname', $data_year);\n\t\t$statement->bindValue('dname', $district_name);\n\t\t$statement->bindValue('qnid', $que_id);\n\t\t$statement->bindValue('name', $ans_name);\n\t\t$statement->execute();\n\t\t$results = $statement->fetchAll();\n \treturn $results;\n }",
"public function testGetDistrictForSection()\n {\n }",
"public function testGetDistrictForSchool()\n {\n }",
"public function getDistrictData() {\n\t\tunset($_SESSION['district_data']);\n\t\tif(!isset($_SESSION['district_data'])) {\n\t\t\t$stmt = \"SELECT district_ID, district FROM dealer_district ORDER BY district ASC\";\n\n\t\t\ttry {\n\t\t\t\t$stmt = $this->pdo->prepare($stmt);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$array = $stmt->fetchAll();\n\t\t\t\t$_SESSION['district_data'] = $array;\n\t\t\t} catch (PDOException $e) {\n\t\t\t\t$_SESSION['error'][] = \"*Error! We are sorry, but a processing error has occurred. Please contact the administrator.\";\n\t\t\t\tSysFeedback::emailError(__LINE__, __FILE__, $e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn $_SESSION['district_data'];\n\t}",
"function getCityDistrict();",
"function getbusiness($districtid, $upn)\n{\n\n\t$Data = new Revenue;\n\t$System = new System;\n\t$currentYear = $System->GetConfiguration(\"RevenueCollectionYear\");\n\n\n\t// get the polygons out of the database\n\t$subupn = \"\";\n\tif (!isset($upn)) {\n\t$run = \"SELECT d1.`id`, d1.`boundary`, d1.`UPN`, d3.`subupn`, d1.`districtid`, d3.`balance`\n\t\tFROM `business_balance` d3\n\t\tJOIN `KML_from_LUPMIS` d1 ON d3.`upn` = d1.`upn` WHERE d3.`districtid`='\".$districtid.\"'\n\t\tAND d3.`year`='\".$currentYear.\"';\";\n\t}else{\n\t\t$run = \"SELECT d1.`id`, d1.`boundary`, d1.`UPN`, d3.`subupn`, d1.`districtid`, d3.`balance`\n\t\tFROM `business_balance` d3\n\t\tJOIN `KML_from_LUPMIS` d1 ON d3.`upn` = d1.`upn` WHERE d1.`upn`= '\".$upn.\"' AND d3.`districtid`='\".$districtid.\"'\n\t\tAND d3.`year`='\".$currentYear.\"';\";\n\t}\n// \t$run = \"SELECT DISTINCT d1.UPN, d1.boundary, d1.id, d2.subupn, d2.pay_status, d3.balance\n// \t\t\tfrom `KML_from_LUPMIS` d1, business d2, business_balance d3 WHERE d1.`UPN` = d2.`upn` AND d3.`UPN` = d2.`upn` AND d1.`districtid`='\".$districtid.\"';\";\n\n\t$query = mysql_query($run);\n\n\t$data \t\t\t\t= array();\n\n\t$payStatus = 1;\n\t$payStatus9 = false;\n\t$payupn=\"\";\n\t$balanceTotal=-99;\n\n\n\twhile ($row = mysql_fetch_assoc($query)) {\n\t$json \t\t\t\t= array();\n\tif ($row['balance']>0){\n\t\t\t$payStatus=1;\n\t\t}else{\n\t\t\t$payStatus=9;\n\t\t}\n\tif (empty($row['subupn'])) {\n//\t\t$payStatus = $row['pay_status'];\n\t\t$payStatus = $payStatus;\n\t\t$payStatus9=false;\n\t} else {\n//\t\tif ($row['pay_status']==9){\n\t\tif ($payStatus==9){\n\t\t\t $payStatus9=true;}\n\n\t\tif ($payStatus9){\n\t\t\tif($Data->getBalanceTotal( $row['UPN'], $row['districtid'], $currentYear, \"business\", \"sumbalance\") > 0)\n\t\t\t{\n\t\t\t $payStatus = 5;} else {\n\t\t\t $payStatus = 9;\n\t\t\t }\n\t\t}\n\t}\n\t$payStatus9=false;\n\t$json['id'] \t\t= $row['id'];\n\t$json['upn'] \t\t= $row['UPN'];\n\t$json['boundary'] \t= $row['boundary'];\n\t$json['status'] \t= $payStatus; //$row['pay_status'];\n\t$json['revenue_balance'] \t= $row['balance'];\n\t$data[] \t\t\t= $json;\n\t }//end while\n\theader(\"Content-type: application/json\");\n\techo json_encode($data);\n}",
"public function getDistricts()\n\t{\n\t\t$districts = $this->getContent($this->geoDomain . 'api/districts');\n\n\t\treturn $districts;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the current visualisation. | public function getVisualisation(); | [
"public function visualisation()\n {\n $this->load->view('visualisation_view');\n }",
"public function getMailVisual()\n {\n return $this->mail_visual;\n }",
"public function getVisualRefresh() {\n\t\treturn $this->_visualRefresh;\n\t}",
"function get_visual_code()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_VISUAL_CODE);\r\n }",
"public function figure()\n\t{\n\t\treturn $this->append('figure');\n\t}",
"public function getRenderedInfo()\n {\n return $this->_info;\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}",
"public function getGraphicContent()\n {\n return $this->graphic_content;\n }",
"function getDisplay() {\n return $this->display;\n }",
"public function render(){\n\n $this->chart = new Builder($this->type,$this->data);\n\n return $this->chart->buildChart();\n }",
"public function get_main_chart()\n {\n }",
"public function getAudiovisual()\r\n {\r\n return $this->audiovisual;\r\n }",
"public function getCurrentRenderingElement()\n {\n return $this->_currentRenderingElement;\n }",
"public function renderPreview()\n {\n return $this->renderSelf();\n }",
"public function getDisplay() {\n return $this->display;\n }",
"public function getVisualContent()\n {\n if (array_key_exists(\"visualContent\", $this->_propDict)) {\n if (is_a($this->_propDict[\"visualContent\"], \"\\Beta\\Microsoft\\Graph\\Model\\VisualProperties\") || is_null($this->_propDict[\"visualContent\"])) {\n return $this->_propDict[\"visualContent\"];\n } else {\n $this->_propDict[\"visualContent\"] = new VisualProperties($this->_propDict[\"visualContent\"]);\n return $this->_propDict[\"visualContent\"];\n }\n }\n return null;\n }",
"public static function getDesign()\n {\n return self::getSingleton('core/design_package');\n }",
"public function get_display() {\n // return $this->config_backend->view->display_handler;\n return $this->config_backend->get_display();\n }",
"public function getResourceVisualization()\n {\n if (array_key_exists(\"resourceVisualization\", $this->_propDict)) {\n if (is_a($this->_propDict[\"resourceVisualization\"], \"\\Beta\\Microsoft\\Graph\\Model\\ResourceVisualization\") || is_null($this->_propDict[\"resourceVisualization\"])) {\n return $this->_propDict[\"resourceVisualization\"];\n } else {\n $this->_propDict[\"resourceVisualization\"] = new ResourceVisualization($this->_propDict[\"resourceVisualization\"]);\n return $this->_propDict[\"resourceVisualization\"];\n }\n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Template for comments and pingbacks. To override this walker in a child theme without modifying the comments template simply create your own comatose_comment(), and that function will be used instead. Used as a callback by wp_list_comments() for displaying the comments. | function comatose_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'comatose' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'comatose' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="comment">
<footer class="comment-meta">
<div class="comment-author vcard">
<?php
$avatar_size = 160;
//if ( '0' != $comment->comment_parent )
// $avatar_size = 78;
echo get_avatar( $comment, $avatar_size );
/* translators: 1: comment author, 2: date and time */
printf( __( '%1$s on %2$s <span class="says">said:</span>', 'comatose' ),
sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
esc_url( get_comment_link( $comment->comment_ID ) ),
get_comment_time( 'c' ),
/* translators: 1: date, 2: time */
sprintf( __( '%1$s at %2$s', 'comatose' ), get_comment_date(), get_comment_time() )
)
);
?>
<?php edit_comment_link( __( 'Edit', 'comatose' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'comatose' ); ?></em>
<br />
<?php endif; ?>
</footer>
<div class="comment-content"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>↓</span>', 'comatose' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</article><!-- #comment-## -->
<?php
break;
endswitch;
} | [
"function cottagetheme_comment( $comment, $args, $depth )\n{\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) :\n case 'pingback' :\n case 'trackback' :\n // Display trackbacks differently than normal comments.\n ?>\n <li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p><?php _e( 'Pingback:', THEMENAME ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', THEMENAME ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php\n break;\n default :\n // Proceed with normal comments.\n global $post;\n ?>\n <li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n <header class=\"comment-meta comment-author vcard\">\n <?php\n echo get_avatar( $comment, 44 );\n printf( '<cite><b class=\"fn\">%1$s</b> %2$s</cite>',\n get_comment_author_link(),\n // If current post author is also comment author, make it known visually.\n ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', THEMENAME ) . '</span>' : ''\n );\n printf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n /* translators: 1: date, 2: time */\n sprintf( __( '%1$s at %2$s', THEMENAME ), get_comment_date(), get_comment_time() )\n );\n ?>\n </header><!-- .comment-meta -->\n\n <?php if ( '0' == $comment->comment_approved ) : ?>\n <p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', THEMENAME ); ?></p>\n <?php endif; ?>\n\n <section class=\"comment-content comment\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', THEMENAME ), '<p class=\"edit-link\">', '</p>' ); ?>\n </section><!-- .comment-content -->\n\n <div class=\"reply\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', THEMENAME ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div><!-- .reply -->\n </article><!-- #comment-## -->\n <?php\n break;\n endswitch; // end comment_type check\n}",
"function foodrecipes_comment( $comment, $foodrecipes_args, $depth ) {\r\n\t//$GLOBALS['comment'] = $comment;\r\n\tswitch ( $comment->comment_type ) :\r\n\t\tcase 'pingback' :\r\n\t\tcase 'trackback' :\r\n\t\t// Display trackbacks differently than normal comments.\r\n\t?>\r\n<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\r\n <p>\r\n <?php esc_html_e( 'Pingback:', 'food-recipes' ); ?>\r\n <?php comment_author_link(); ?>\r\n <?php edit_comment_link( __( 'Edit', 'food-recipes' ), '<span class=\"edit-link\">', '</span>' ); ?>\r\n </p>\r\n</li>\r\n<?php\r\n\t\t\tbreak;\r\n\t\tdefault :\r\n\t\t// Proceed with normal comments.\r\n\t\tif($comment->comment_approved==1)\r\n\t\t{\r\n\t\tglobal $post;\r\n\t?>\r\n<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\r\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment col-md-12 foodrecipes-inner-blog-comment\">\r\n <figure class=\"avtar\"> <a href=\"#\"><?php echo get_avatar( get_the_author_meta(), '80'); ?></a> </figure>\r\n <div class=\"foodrecipes-comment-name txt-holder\">\r\n <?php\r\n\t printf( '<b class=\"fn\">%1$s'.'</b>',\r\n\t get_comment_author_link(),\r\n\t ( $comment->user_id === $post->post_author ) ? '<span>' . esc_html__( 'Post author ', 'food-recipes' ) . '</span>' : '' \r\n\t ); \r\n\t\t?>\r\n </div>\r\n <div class=\"foodrecipes-comment-datetime\"> <?php echo get_comment_date('F j, Y \\a\\t g:i a'); ?> </div>\r\n <div class=\"foodrecipes-comment-text blog-post-comment-text comment\">\r\n <?php comment_text(); ?>\r\n </div>\r\n <div class=\"foodrecipes-comment-reply-link\">\r\n <?php\r\n echo '<a href=\"#\" class=\"reply pull-right\">'.comment_reply_link( array_merge( $foodrecipes_args, array( 'reply_text' => __( 'Reply', 'food-recipes' ), 'after' => '', 'depth' => $depth, 'max_depth' => $foodrecipes_args['max_depth'] ) ) ).'</a>';\r\n ?>\r\n </div>\r\n <div class=\"foodrecipes-comment-hr\"></div>\r\n <!-- .comment-content --> \r\n \r\n <!-- .txt-holder --> \r\n </article>\r\n <!-- #comment-## -->\r\n <?php\r\n\t\t}\r\n\t\tbreak;\r\n\tendswitch; // end comment_type check\r\n}",
"function tempera_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t?>\n\t<li class=\"post pingback\">\n\t\t<p><?php _e( 'Pingback: ', 'tempera' ); ?><?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'tempera'), ' ' ); ?></p>\n\t<?php\n\t\tbreak;\n\t\tcase '' :\n\t\tdefault : \n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<div id=\"comment-<?php comment_ID(); ?>\">\n\t\t<div class=\"comment-author vcard\">\n\t\t\t<?php echo \"<div class='avatar-container' >\".get_avatar( $comment, 60 ).\"</div>\"; ?>\n\t\t\t<div class=\"comment-details\">\n\t\t\t\t<?php printf( '%s ', sprintf( '<cite class=\"fn\">%s</cite>', get_comment_author_link() ) ); ?>\n\t\t\t\t<div class=\"comment-meta commentmetadata\">\n\t\t\t\t\t<a href=\"<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>\">\n\t\t\t\t\t<?php /* translators: 1: date, 2: time */\n\t\t\t\t\tprintf( '%1$s '.__('at', 'tempera' ).' %2$s', get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'tempera' ), ' ' );\n\t\t\t\t\t?>\n\t\t\t\t</div><!-- .comment-meta .commentmetadata -->\n\t\t\t</div> <!-- .comment-details -->\n\t\t</div><!-- .comment-author .vcard -->\n\t\t\n\t\t<?php if ( $comment->comment_approved == '0' ) : ?>\n\t\t\t<span class=\"comment-await\"><em><?php _e( 'Your comment is awaiting moderation.', 'tempera' ); ?></em></span>\n\t\t\t<br />\n\t\t<?php endif; ?>\n\n\n\t\t<div class=\"comment-body\"><?php comment_text(); ?>\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'reply_text' => '<i class=\"icon-reply\"></i>'.__('Reply','tempera'), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</div>\n\n\t</div><!-- #comment-## -->\n\n\t<?php\n\t\tbreak;\n\tendswitch;\n}",
"function custom_theme_comment($comment, $args, $depth) {\r\n\t$GLOBALS['comment'] = $comment;\r\n\tswitch ( $comment->comment_type ) :\r\n\t\tcase '' :\r\n\t?>\r\n\t<li <?php comment_class(); ?>>\r\n\t\t<div class=\"comment\">\r\n\t\t\t<div class=\"vcard\">\r\n\t\t\t\t<?php echo get_avatar($comment, 80); ?>\r\n\t\t\t\t<span class=\"comment_author\"><?php echo get_comment_author_link(); ?></span>\r\n\t\t\t\t<span class=\"when_posted\"><?php echo get_comment_date('M d, Y'); ?> <?php edit_comment_link(__('(Edit)', TEMPLATENAME)); ?></span>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"posted_content\"><div class=\"pointer_pc\"></div>\r\n\t\t\t\t<?php if ( $comment->comment_approved == '0' ) : ?>\r\n\t\t\t\t\t<em><?php _e( 'Your comment is awaiting moderation.' ); ?></em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t<?php endif; ?>\r\n\t\t\t\t<div class=\"comment-body\"><?php comment_text(); ?></div>\r\n\t\t\t\t<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"clear\"></div>\r\n\t\t</div>\r\n\t<?php\r\n\t\t\tbreak;\r\n\t\tcase 'pingback' :\r\n\t\tcase 'trackback' :\r\n\t?>\r\n\t<li class=\"post pingback\">\r\n\t\t<p><?php _e( 'Pingback:', TEMPLATENAME ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', TEMPLATENAME), ' ' ); ?></p>\r\n\t<?php\r\n\t\t\tbreak;\r\n\tendswitch;\r\n}",
"function theblogger_theme_comments($comment, $args, $depth)\n\t{\n\t\t$GLOBALS['comment'] = $comment;\n\t\t\n\t\tswitch ($comment->comment_type)\n\t\t{\n\t\t\tcase 'pingback' :\n\t\t\t\n\t\t\tcase 'trackback' :\n\t\t\t\n\t\t\t\t?>\n\t\t\t\t\t<li id=\"comment-<?php comment_ID(); ?>\" <?php comment_class(); ?>>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tesc_html_e('Pingback:', 'theblogger');\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tcomment_author_link();\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tedit_comment_link(esc_html__('(Edit)', 'theblogger'), '<span class=\"edit-link\">', '</span>');\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault :\n\t\t\t\n\t\t\t\tglobal $post;\n\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t\t<li id=\"li-comment-<?php comment_ID(); ?>\" <?php comment_class(); ?>>\n\t\t\t\t\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t\t\t\t\t<header class=\"comment-meta comment-author vcard\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo get_avatar($comment, 150);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<cite class=\"fn\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\techo get_comment_author_link();\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</cite>\n\t\t\t\t\t\t\t\t<span class=\"comment-date\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\techo get_comment_date();\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tesc_html_e('at', 'theblogger');\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\techo get_comment_time();\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tedit_comment_link(esc_html__('Edit', 'theblogger'), '<span class=\"comment-edit-link\">', '</span>');\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</header>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<section class=\"comment-content comment\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ('0' == $comment->comment_approved)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"comment-awaiting-moderation\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e('Your comment is awaiting moderation.', 'theblogger');\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<?php\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<?php\n\t\t\t\t\t\t\t\t\tcomment_text();\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</section>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"reply\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tcomment_reply_link(array_merge($args,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('reply_text' => esc_html__('Reply', 'theblogger'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'after' => ' ' . '<span>' . esc_html__('↓', 'theblogger') . '</span>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'depth' => $depth,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'max_depth' => $args['max_depth'])));\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</article>\n\t\t\t\t<?php\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}",
"function PINQCKIK_comment($comment, $args, $depth) {\n\t\t\t$GLOBALS['comment'] = $comment;\n\t\t\tswitch ($comment->comment_type) :\n\t\t\t\tcase 'pingback' :\n\t\t\t\tcase 'trackback' :\n\t\t\t\t\t// Display trackbacks differently than normal comments.\n?>\n\t\t\t\t<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n\t\t\t\t\t<p><?php _e('Pingback:', 'PINQCKIK'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(__('(Edit)', 'PINQCKIK'), '<span class=\"edit-link\">', '</span>'); ?></p>\n\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t// Proceed with normal comments.\n\t\t\t\t\tglobal $post;\n\t\t?>\n\t\t\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t\t<header class=\"comment-meta comment-author vcard\">\n\t\t<?php\n\t\t\t\t\techo get_avatar($comment, 44);\n\t\t\t\t\tprintf('<cite class=\"fn\">%1$s %2$s</cite>',\n\t\t\t\t\t\t\tget_comment_author_link(),\n\t\t\t\t\t\t\t// If current post author is also comment author, make it known visually.\n\t\t\t\t\t\t\t( $comment->user_id === $post->post_author ) ? '<span> ' . __('Post author', 'PINQCKIK') . '</span>' : ''\n\t\t\t\t\t);\n\t\t\t\t\tprintf('<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\t\tesc_url(get_comment_link($comment->comment_ID)),\n\t\t\t\t\t\t\tget_comment_time('c'),\n\t\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\t\tsprintf(__('%1$s at %2$s', 'PINQCKIK'), get_comment_date(), get_comment_time())\n\t\t\t\t\t);\n\t\t?>\n\t\t\t\t</header><!-- .comment-meta -->\n\n<?php if ('0' == $comment->comment_approved) : ?>\n\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e('Your comment is awaiting moderation.', 'PINQCKIK'); ?></p>\n<?php endif; ?>\n\n\t\t\t\t\t<section class=\"comment-content comment\">\n<?php comment_text(); ?>\n<?php edit_comment_link(__('Edit', 'PINQCKIK'), '<p class=\"edit-link\">', '</p>'); ?>\n\t\t\t\t\t\t\t</section><!-- .comment-content -->\n\n\t\t\t\t\t\t\t<div class=\"reply\">\n<?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'PINQCKIK'), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>\n\t\t\t\t\t\t\t</div><!-- .reply -->\n\t\t\t\t\t\t</article><!-- #comment-## -->\n<?php\n\t\t\t\t\t\tbreak;\n\t\t\t\tendswitch; // end comment_type check\n\t\t\t}",
"function javo_drt_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t\t// Display trackbacks differently than normal comments.\n\t?>\n\t<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n\t\t<p><?php _e( 'Pingback:', 'javo_fr' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'javo_fr' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t\t// Proceed with normal comments.\n\t\tglobal $post;\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<div class=\"comment-inner-wrap\">\n\t\t\t\t<header class=\"comment-meta comment-author vcard\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\techo get_avatar( $comment, 44 );\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<div class=\"comment-title-wrap\"><cite class=\"pull-left\" ><b class=\"fn\">%s</b> <small>%s</small></cite><div class=\"pull-right\">%s</div></div>'\n\t\t\t\t\t\t\t, get_comment_author_link()\n\t\t\t\t\t\t\t, sprintf(\n\t\t\t\t\t\t\t\t\t__( '%s at %s', 'javo_fr' )\n\t\t\t\t\t\t\t\t\t, get_comment_date()\n\t\t\t\t\t\t\t\t\t, get_comment_time()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t, sprintf(\n\t\t\t\t\t\t\t\t\t__( \"<a href=\\\"%s\\\">Edit</a>\", 'javo_fr' )\n\t\t\t\t\t\t\t\t\t, get_edit_comment_link( get_comment_ID() )\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<section class=\"comment-content comment\">\n\t\t\t\t\t<?php comment_text(); ?>\n\n\t\t\t\t\t</section><!-- .comment-content -->\n\t\t\t\t</header><!-- .comment-meta -->\n\n\t\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'javo_fr' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\n\n\t\t\t</div><!--comment-inner-wrap-->\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'javo_fr' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</article><!-- #comment-## -->\n\t<?php\n\t\tbreak;\n\tendswitch; // end comment_type check\n}",
"function theme_comments( $comment, $args, $depth )\n\t\t{\n\t\t\t$GLOBALS['comment'] = $comment;\n\t\t\t\n\t\t\tswitch ( $comment->comment_type ) :\n\t\t\t\n\t\t\t\tcase 'pingback' :\n\t\t\t\t\n\t\t\t\tcase 'trackback' :\n\t\t\t\t\n\t\t\t\t\t// Display trackbacks differently than normal comments.\n\t\t\t\t\t?>\n\t\t\t\t\t\t<li id=\"comment-<?php comment_ID(); ?>\" <?php comment_class(); ?>>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t_e( 'Pingback:', 'read' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'read' ), '<span class=\"edit-link\">', '</span>' );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault :\n\t\t\t\t\n\t\t\t\t\t// Proceed with normal comments.\n\t\t\t\t\tglobal $post;\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\n\t\t\t\t\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t\t\t\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t\t\t\t\t<header class=\"comment-meta comment-author vcard\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo get_avatar( $comment, 75 );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tprintf( '<cite class=\"fn\">%1$s %2$s</cite>',\n\t\t\t\t\t\t\t\t\t\t\tget_comment_author_link(),\n\t\t\t\t\t\t\t\t\t\t\t// If current post author is also comment author, make it known visually.\n\t\t\t\t\t\t\t\t\t\t\t( $comment->user_id === $post->post_author ) ? '<span></span>' : \"\" );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tprintf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\t\t\t\t\t\tesc_url( get_comment_link( $comment->comment_ID ) ),\n\t\t\t\t\t\t\t\t\t\t\tget_comment_time( 'c' ),\n\t\t\t\t\t\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\t\t\t\t\t\tsprintf( __( '%1$s at %2$s', 'read' ), get_comment_date(), get_comment_time() ) );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</header>\n\t\t\t\t\t\t\t<!-- end .comment-meta -->\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( '0' == $comment->comment_approved ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'read' ); ?></p>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<section class=\"comment-content comment\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tcomment_text();\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<?php\n\t\t\t\t\t\t\t\t\tedit_comment_link( __( 'Edit', 'read' ), '<p class=\"edit-link\">', '</p>' );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</section>\n\t\t\t\t\t\t\t<!-- end .comment-content -->\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"reply\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tcomment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'read' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- end .reply -->\n\t\t\t\t\t\t</article>\n\t\t\t\t\t\t<!-- end #comment-## -->\n\t\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tendswitch;\n\t\t}",
"function wpzurb_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t\t// Display trackbacks differently than normal comments.\n\t?>\n\t<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n\t\t<p><?php _e( 'Pingback:', 'wpzurb' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'wpzurb' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t\t// Proceed with normal comments.\n\t\tglobal $post;\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<header class=\"comment-meta comment-author vcard\">\n\t\t\t\t<?php\n\t\t\t\t\techo get_avatar( $comment, 44 );\n\t\t\t\t\tprintf( '<cite class=\"fn\">%1$s %2$s</cite>',\n\t\t\t\t\t\tget_comment_author_link(),\n\t\t\t\t\t\t// If current post author is also comment author, make it known visually.\n\t\t\t\t\t\t( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'wpzurb' ) . '</span>' : ''\n\t\t\t\t\t);\n\t\t\t\t\tprintf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\tesc_url( get_comment_link( $comment->comment_ID ) ),\n\t\t\t\t\t\tget_comment_time( 'c' ),\n\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\tsprintf( __( '%1$s at %2$s', 'wpzurb' ), get_comment_date(), get_comment_time() )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</header><!-- .comment-meta -->\n\n\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'wpzurb' ); ?></p>\n\t\t\t<?php endif; ?>\n\n\t\t\t<section class=\"comment-content comment\">\n\t\t\t\t<?php comment_text(); ?>\n\t\t\t\t<?php edit_comment_link( __( 'Edit', 'wpzurb' ), '<p class=\"edit-link\">', '</p>' ); ?>\n\t\t\t</section><!-- .comment-content -->\n\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'wpzurb' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</article><!-- #comment-## -->\n\t<?php\n\t\tbreak;\n\tendswitch; // end comment_type check\n}",
"function dogcompany_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t\t// Display trackbacks differently than normal comments.\n\t?>\n\t<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n\t\t<p><?php _e( 'Pingback:', 'dogcompany' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'dogcompany' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t\t// Proceed with normal comments.\n\t\tglobal $post;\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<div class=\"avatar-wrap\">\n\t\t\t\t<?php\techo get_avatar( $comment, 100 );?>\n\t\t\t</div>\n\t\t\t<div class=\"comment-wrap\">\n\t\t\t\t<div class=\"comment-meta comment-author vcard\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf( '<cite class=\"fn\">%1$s %2$s</cite>',\n\t\t\t\t\t\t\tget_comment_author_link(),\n\t\t\t\t\t\t\t// If current post author is also comment author, make it known visually.\n\t\t\t\t\t\t\t( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'dogcompany' ) . '</span>' : ''\n\t\t\t\t\t\t);\n\t\t\t\t\t\tprintf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\t\tesc_url( get_comment_link( $comment->comment_ID ) ),\n\t\t\t\t\t\t\tget_comment_time( 'c' ),\n\t\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\t\tsprintf( __( '%1$s at %2$s', 'dogcompany' ), get_comment_date(), get_comment_time() )\n\t\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</div><!-- .comment-meta -->\n\n\t\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'dogcompany' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\n\t\t\t\t\t<section class=\"comment-content comment\">\n\t\t\t\t\t\t<?php comment_text(); ?>\n\t\t\t\t\t</section><!-- .comment-content -->\n\n\t\t\t\t\t\t<?php edit_comment_link( __( 'Edit', 'dogcompany' ), '<div class=\"edit-wrap\"><a class=\"edit-link\">', '</a></div>' ); ?>\n\t\t\t\t\t<div class=\"reply\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tglobal $phpbbForum;\n\t\t\t\t\t\t\tif($phpbbForum->user_logged_in()) :\n\t\t\t\t\t\t\t\tcomment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'dogcompany' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) );\n\t\t\t\t\t\t\telse: ?>\n\t\t\t\t\t\t\t<a onclick=\"openLog()\" class=\"reply-login\" href=\"#\">Log in</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .reply -->\n\t\t\t</div>\n\t\t</article><!-- #comment-## -->\n\t<?php\n\t\tbreak;\n\tendswitch; // end comment_type check\n}",
"function basejump_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t?>\n\t<li class=\"post pingback\">\n\t\t<p><?php _e( 'Pingback:', 'basejump' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'basejump' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<div id=\"comment id-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t<?php\n\t\t\t\t\t$avatar_size = 48;\n\t\t\t\t\tif ( '0' != $comment->comment_parent )\n\t\t\t\t\t\t$avatar_size = 48;\n\n\t\t\t\t\techo get_avatar( $comment, $avatar_size );\n\n\t\t\t\t\t/* translators: 1: comment author, 2: date and time */\n\t\t\t\t\tprintf( __( '%1$s on %2$s <span class=\"says\">said:</span>', 'basejump' ),\n\t\t\t\t\t\tsprintf( '<cite class=\"fn\">%s</cite>', get_comment_author_link() ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s\"><time pubdate datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\t\tesc_url( get_comment_link( $comment->comment_ID ) ),\n\t\t\t\t\t\t\tget_comment_time( 'c' ),\n\t\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\t\tsprintf( __( '%1$s at %2$s', 'basejump' ), get_comment_date(), get_comment_time() )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t?>\n\n\t\t\t\t<?php edit_comment_link( __( 'Edit', 'basejump' ), '<span class=\"edit-link\">', '</span>' ); ?>\n\t\t\t</div><!-- .comment-author .vcard -->\n\t\t\t<div class=\"comment-meta\">\n\t\t\t\t\n\n\t\t\t\t<?php if ( $comment->comment_approved == '0' ) : ?>\n\t\t\t\t\t<em class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'basejump' ); ?></em>\n\t\t\t\t\t<br />\n\t\t\t\t<?php endif; ?>\n\n\t\t\t</div>\n\n\t\t\t<div class=\"comment-content\"><?php comment_text(); ?></div>\n\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>↓</span>', 'basejump' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</div><!-- #comment-## -->\n\n\t<?php\n\t\t\tbreak;\n\tendswitch;\n}",
"function bootstrapwp_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t?>\n\t<li class=\"post pingback\">\n\t\t<p><?php _e( 'Pingback:', 'bootstrap' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'bootstrap' ), ' ' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<footer>\n\t\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t\t<?php echo get_avatar( $comment, 40 ); ?>\n\t\t\t\t\t<?php printf( __( '%s <span class=\"says\">says:</span>', 'bootstrap' ), sprintf( '<cite class=\"fn\">%s</cite>', get_comment_author_link() ) ); ?>\n\t\t\t\t</div><!-- .comment-author .vcard -->\n\t\t\t\t<?php if ( $comment->comment_approved == '0' ) : ?>\n\t\t\t\t\t<em><?php _e( 'Your comment is awaiting moderation.', 'bootstrap' ); ?></em>\n\t\t\t\t\t<br />\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<div class=\"comment-meta commentmetadata\">\n\t\t\t\t\t<a href=\"<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>\"><time pubdate datetime=\"<?php comment_time( 'c' ); ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\tprintf( __( '%1$s at %2$s', 'bootstrap' ), get_comment_date(), get_comment_time() ); ?>\n\t\t\t\t\t</time></a>\n\t\t\t\t\t<?php edit_comment_link( __( '(Edit)', 'bootstrap' ), ' ' );\n\t\t\t\t\t?>\n\t\t\t\t</div><!-- .comment-meta .commentmetadata -->\n\t\t\t</footer>\n\n\t\t\t<div class=\"comment-content\"><?php comment_text(); ?></div>\n\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</article><!-- #comment-## -->\n\n\t<?php\n\t\t\tbreak;\n\tendswitch;\n}",
"function twentytwelve_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) :\n case 'pingback':\n case 'trackback':\n // Display trackbacks differently than normal comments.\n ?>\n <li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php\n break;\n default:\n // Proceed with normal comments.\n global $post;\n ?>\n <li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n <header class=\"comment-meta comment-author vcard\">\n <?php\n echo get_avatar( $comment, 44 );\n printf(\n '<cite><b class=\"fn\">%1$s</b> %2$s</cite>',\n get_comment_author_link(),\n // If current post author is also comment author, make it known visually.\n ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''\n );\n printf(\n '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n /* translators: 1: date, 2: time */\n sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )\n );\n ?>\n </header><!-- .comment-meta -->\n\n <?php if ( '0' == $comment->comment_approved ) : ?>\n <p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>\n <?php endif; ?>\n\n <section class=\"comment-content comment\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class=\"edit-link\">', '</p>' ); ?>\n </section><!-- .comment-content -->\n\n <div class=\"reply\">\n <?php\n comment_reply_link(\n array_merge(\n $args,\n array(\n 'reply_text' => __( 'Reply', 'twentytwelve' ),\n 'after' => ' <span>↓</span>',\n 'depth' => $depth,\n 'max_depth' => $args['max_depth'],\n )\n )\n );\n ?>\n </div><!-- .reply -->\n </article><!-- #comment-## -->\n <?php\n break;\n endswitch; // end comment_type check\n }",
"function templatemela_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t\t// Display trackbacks differently than normal comments.\n\t?>\n<li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p>\n <?php _e( 'Pingback:', 'templatemela' ); ?>\n <?php comment_author_link(); ?>\n <?php edit_comment_link( __( '(Edit)', 'templatemela' ), '<span class=\"edit-link\">', '</span>' ); ?>\n </p>\n</li>\n<?php\n\t\t\tbreak;\n\t\tdefault :\n\t\t// Proceed with normal comments.\n\t\tglobal $post;\n\t?>\n<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <div id=\"comment-<?php comment_ID(); ?>\" class=\"comment-body\">\n <div class=\"alignleft\"> <?php echo get_avatar( $comment, 48 ); ?> </div>\n <div class=\"author-content\">\n <h6><?php echo $comment->comment_author; ?></h6>\n <?php edit_comment_link( __( 'Edit', 'templatemela' ), ' ' ); ?>\n <div class=\"clearfix\"></div>\n <abbr class=\"published\" title=\"\"><?php printf( __( '%1$s at %2$s', 'templatemela' ), get_comment_date(), get_comment_time() ); ?></abbr> </div>\n <div class=\"comment-content\">\n <?php comment_text(); ?>\n <div class=\"reply\">\n <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div>\n </div>\n <!--<div class=\"comment-author vcard\">\n\t\t\t<?php //echo get_avatar( $comment, 40 ); ?>\n\t\t\t<?php //printf( __( '%s <span class=\"says\">says:</span>', 'templatemela' ), sprintf( '<cite class=\"fn\">%s</cite>', get_comment_author_link() ) ); ?>\n\t\t</div><!-- .comment-author .vcard -->\n <?php if ( $comment->comment_approved == '0' ) : ?>\n <em class=\"comment-awaiting-moderation\">\n <?php _e( 'Your comment is awaiting moderation.', 'templatemela' ); ?>\n </em> <br />\n <?php endif; ?>\n </div>\n <!-- #comment-## -->\n</li>\n<?php\n\t\n\t\tbreak;\n\tendswitch; // end comment_type check\n}",
"function twentytwelve_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) :\n case 'pingback' :\n case 'trackback' :\n // Display trackbacks differently than normal comments.\n ?>\n <li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php\n break;\n default :\n // Proceed with normal comments.\n global $post;\n ?>\n <li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n <header class=\"comment-meta comment-author vcard\">\n <?php\n echo get_avatar( $comment, 44 );\n printf( '<cite><b class=\"fn\">%1$s</b> %2$s</cite>',\n get_comment_author_link(),\n // If current post author is also comment author, make it known visually.\n ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''\n );\n printf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n /* translators: 1: date, 2: time */\n sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )\n );\n ?>\n </header><!-- .comment-meta -->\n\n <?php if ( '0' == $comment->comment_approved ) : ?>\n <p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>\n <?php endif; ?>\n\n <section class=\"comment-content comment\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class=\"edit-link\">', '</p>' ); ?>\n </section><!-- .comment-content -->\n\n <div class=\"reply\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div><!-- .reply -->\n </article><!-- #comment-## -->\n <?php\n break;\n endswitch; // end comment_type check\n}",
"function twentytwelve_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) :\n case 'pingback' :\n case 'trackback' :\n // Display trackbacks differently than normal comments.\n ?>\n <li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php\n break;\n default :\n // Proceed with normal comments.\n global $post;\n ?>\n <li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n <header class=\"comment-meta comment-author vcard\">\n <?php\n echo get_avatar( $comment, 44 );\n printf( '<cite class=\"fn\">%1$s %2$s</cite>',\n get_comment_author_link(),\n // If current post author is also comment author, make it known visually.\n ( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''\n );\n printf( '<a href=\"%1$s\"><time datetime=\"%2$s\">%3$s</time></a>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n /* translators: 1: date, 2: time */\n sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )\n );\n ?>\n </header><!-- .comment-meta -->\n\n <?php if ( '0' == $comment->comment_approved ) : ?>\n <p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>\n <?php endif; ?>\n\n <section class=\"comment-content comment\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class=\"edit-link\">', '</p>' ); ?>\n </section><!-- .comment-content -->\n\n <div class=\"reply\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div><!-- .reply -->\n </article><!-- #comment-## -->\n <?php\n break;\n endswitch; // end comment_type check\n}",
"public static function el_display_comment_template(){\n\t\t\t\n\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\tif ( comments_open() || get_comments_number() ){\n\t\t\t//display post navigation \n\t\t\techo '<div class=\"el-row animation-container\">';\n\t\t\t\techo '<div class=\"el-col-small-12 el-col-medium-8 el-col-medium-offset-2\">';\n\t\t\t\t\tcomments_template();\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\t\n\t\t}\n\n\t}",
"function darksnow_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment;\n\tswitch ( $comment->comment_type ) :\n\t\tcase 'pingback' :\n\t\tcase 'trackback' :\n\t?>\n\t<li class=\"post pingback\">\n\t\t<p><?php _e( 'Pingback:', 'darksnow' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'darksnow' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n\t<?php\n\t\t\tbreak;\n\t\tdefault :\n\t?>\n\t<li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n\t\t<article id=\"comment-<?php comment_ID(); ?>\" class=\"comment\">\n\t\t\t<footer class=\"comment-meta\">\n\t\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$avatar_size = 68;\n\t\t\t\t\t\tif ( '0' != $comment->comment_parent )\n\t\t\t\t\t\t\t$avatar_size = 39;\n\n\t\t\t\t\t\techo get_avatar( $comment, $avatar_size );\n\n\t\t\t\t\t\t/* translators: 1: comment author, 2: date and time */\n\t\t\t\t\t\tprintf( __( '%1$s on %2$s <span class=\"says\">said:</span>', 'darksnow' ),\n\t\t\t\t\t\t\tsprintf( '<span class=\"fn\">%s</span>', get_comment_author_link() ),\n\t\t\t\t\t\t\tsprintf( '<a href=\"%1$s\"><time pubdate datetime=\"%2$s\">%3$s</time></a>',\n\t\t\t\t\t\t\t\tesc_url( get_comment_link( $comment->comment_ID ) ),\n\t\t\t\t\t\t\t\tget_comment_time( 'c' ),\n\t\t\t\t\t\t\t\t/* translators: 1: date, 2: time */\n\t\t\t\t\t\t\t\tsprintf( __( '%1$s at %2$s', 'darksnow' ), get_comment_date(), get_comment_time() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t?>\n\n\t\t\t\t\t<?php edit_comment_link( __( 'Edit', 'darksnow' ), '<span class=\"edit-link\">', '</span>' ); ?>\n\t\t\t\t</div><!-- .comment-author .vcard -->\n\n\t\t\t\t<?php if ( $comment->comment_approved == '0' ) : ?>\n\t\t\t\t\t<em class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'darksnow' ); ?></em>\n\t\t\t\t\t<br />\n\t\t\t\t<?php endif; ?>\n\n\t\t\t</footer>\n\n\t\t\t<div class=\"comment-content\"><?php comment_text(); ?></div>\n\n\t\t\t<div class=\"reply\">\n\t\t\t\t<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>↓</span>', 'darksnow' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n\t\t\t</div><!-- .reply -->\n\t\t</article><!-- #comment-## -->\n\n\t<?php\n\t\t\tbreak;\n\tendswitch;\n}",
"function _rhd_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) :\n case 'pingback' :\n case 'trackback' :\n // Display trackbacks differently than normal comments.\n ?>\n <li <?php comment_class(); ?> id=\"comment-<?php comment_ID(); ?>\">\n <p><?php _e( 'Pingback:', '_rhd' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', '_rhd' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php\n break;\n default :\n // Proceed with normal comments.\n global $post;\n ?>\n <li <?php comment_class(); ?> id=\"li-comment-<?php comment_ID(); ?>\">\n <article id=\"comment-<?php comment_ID(); ?>\" class=\"comment clearfix well\">\n\n <div class=\"avatar-wrapper\">\n \t<?php echo get_avatar( $comment, 60 ); ?>\n\t\t\t\t\t\t\t<h3 class=\"comment-author\"><?php comment_author_link(); ?></h3>\n </div>\n\n\n <div class=\"comment-wrapper\">\n\t\t\t\t\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', '_rhd' ); ?></p>\n\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t<div class=\"comment-content entry-content\">\n\t\t\t\t\t\t\t\t\t<?php comment_text(); ?>\n\t\t\t\t\t\t\t\t\t<?php ?>\n\t\t\t\t\t\t\t</div><!-- .comment-content -->\n\n <footer class=\"comment-meta comment-author vcard\">\n <?php\n printf( '<h4 class=\"comment-time\" ><time datetime=\"%2$s\">%3$s</time></h4>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n /* translators: 1: date, 2: time */\n sprintf( __( '%1$s', '_rhd' ), get_comment_date() )\n );\n\t\t\t\t\t\t\t\t\t\t\t\tcomment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) );\n edit_comment_link( __( 'Edit', '_rhd' ), '<span class=\"edit-link\">', '</span>' );\n ?>\n </footer><!-- .comment-meta -->\n\n\n\n </div><!--/comment-wrapper-->\n\n </article><!-- #comment-## -->\n <?php\n break;\n endswitch; // end comment_type check\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete the sale listing row and its parent sale it has no other listings in it | public function delete()
{
$salesListings = $this->_table->fetchAll(
$this->_table->select()
->where('sale_id = ?', $this->getData('sale_id'))
->where('id != ?', $this->getData('id')));
if (!count($salesListings)) {
$this->findParentRow('\Ppb\Db\Table\Sales')->delete(true);
}
return parent::delete();
} | [
"public function delete_child_list_value()\n\t{\n\t\t$id = $this->uri->segment(4);\n\t\t$parent_id = $this->uri->segment(5);\n\t\t$this->db->where('id',$id)->delete('fc_listing_child');\n\t\tredirect('admin/listings/add_new_child_fields/'.$parent_id);\n\t}",
"public function sales_unsaved_delete()\n {\n $sales_no = $this->input->post('sales_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created money receipt for partial or full cash sales */\n $mr = $this->MAc_money_receipts->get_by_doc('Sales', $sales_no);\n if (count($mr) > 0)\n {\n $this->MAc_money_receipts->delete($mr['id']);\n }\n /** Remove sales */\n $this->MSales_details->delete_by_sales_no($sales_no);\n $this->MSales_master->delete_by_sales_no($sales_no);\n }",
"public function deleted(Sale $sale)\n {\n //\n }",
"public function deleted(FarmSale $farmSale)\n {\n \n $farmSale->farm_payments()->delete();\n \n $farmSale->sales_details()->delete();\n \n }",
"function delete_element_listitems( $tablename, $reportfield_id , $extraparams=array() ){\n\n\n\n $real_tablename = $tablename;\n $element_table = $tablename;\n $item_table = $tablename . \"_items\";\n $entry_table = $tablename . \"_ent\";\n //get parent_id\n $parent_id = $this->get_element_id_from_reportfield_id( $tablename, $reportfield_id );\n\n return $this->dbc->delete_records( $item_table, array( 'parent_id' => $parent_id ) , $extraparams );\n }",
"function _delete_custom_listing()\n{\n\tglobal $dbpdo;\n\t\n\t$sql = $dbpdo->prepare(\"DELETE FROM `custom_listings` WHERE `id` = :custom_listing_id\");\n\t\n\t$data = array(\n\t'custom_listing_id' => (int)$_REQUEST['custom_listing_id']\n\t);\n\t\n\tif($sql->execute($data))\n\t{\n\t\treturn \"pass\";\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}",
"public function sales_return_unsaved_delete()\n {\n $sales_return_no = $this->input->post('sales_return_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales Return', $sales_return_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove sales */\n $this->MSales_return_details->delete_by_sales_return_no($sales_return_no);\n $this->MSales_return_master->delete_by_sales_return_no($sales_return_no);\n }",
"public function destroy(Sale $sale)\n {\n // return dd($sale->saleItems()->first()->product->currentStock->remaining);\n\n try {\n DB::transaction(function () use ($sale) {\n foreach($sale->saleItems as $saleItem) {\n $cs = $saleItem->product->currentStock;\n $cs->remaining += 1;\n $cs->save();\n }\n\n $sale->saleItems()->delete();\n $sale->delete();\n\n }, 5);\n } catch (\\Exception $e) {\n return redirect()->back()->with(['message' => $e->getMessage(), 'alert-type' => 'error']);\n }\n\n return redirect()->back()->with(['message' => \"Successfully Deleted Sales Record\", 'alert-type' => 'success']);\n }",
"public function deleteSaleItem($saleID){;\r\n\t\t$query = \"DELETE FROM sale_item WHERE sale_id = \" . $saleID;\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t\t}",
"public function delete_sales_order() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['so_id']);\n\t\tif($this->update(\"sales_order\",$values,$where)) {\t\t\t\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting sales tbl';\n\t}",
"public function deleteListing(){\n\n\t\t$listingID = $_POST[\"listingId\"];\n\n\t\t//thought process: Traverse the table of listings, and find the listing_id of the listing in question. Then delete the respective page\n\t\t$listingRepo = RepositoryFactory::createRepository(\"listing\");\n\t\t$arrayOfListingObjects = $listingRepo->find($listingID, \"listingId\");\n\n\n\t\tif (empty($arrayOfListingObjects)){\n\t\t\t//detail of error page necessary\n\t\t\t$errorMessage = \"The listing with the listingID ({$listingID}) was not found.\";\n\t\t\trequire APP . 'view/_templates/header.php';\n\t\t\trequire APP . 'view/problem/error_page.php';\n\t\t\trequire APP . 'view/_templates/footer.php';\n\t\t}\n\n\t\telse{\n\t\t\t$removedCorrectly = ListingsResponseCreator::createDeleteListingResponse($listingID);\n\n\t\t\tif ($removedCorrectly){\n\t\t\t\t//need to create listing_delete_success page\n\t\t\t\t// require APP . 'view/_templates/header.php';\n\t\t\t\t// require APP . 'view/listings/listing_delete_success.php';\n\t\t\t\t// require APP . 'view/_templates/footer.php';\n\t\t\t\techo \"SUCCESS\";\n\t\t\t}\n\n\t\t\telse{\n\t\t\t\t$errorMessage = \"The listing with the listingID ({$listingID}) was found but not deleted!\";\n\t\t\t\t// require APP . 'view/_templates/header.php';\n\t\t\t\t// require APP . 'view/problem/error_page.php';\n\t\t\t\t// require APP . 'view/_templates/footer.php';\n\t\t\t\techo $errorMessage;\n\t\t\t}\t\t\n\t\t}\n\t}",
"public function f_paddycollection_delete() {\n\n $where = array(\n \"kms_year\" => $this->kms_year,\n \"coll_no\" => $this->input->get('coll_no')\n );\n\n //Retriving the data row for backup\n $select = array (\n\n \"trans_dt\",\"kms_year\",\"coll_no\",\"dist\",\"soc_id\",\n \"no_of_camp\",\"no_of_farmer\",\"paddy_qty\"\n\n );\n\n $data = (array) $this->Paddy->f_get_particulars(\"td_collections\", $select, $where, 1);\n \n $audit = array(\n \n 'deleted_by' => $this->session->userdata('loggedin')->user_name,\n \n 'deleted_dt' => date('Y-m-d h:i:s')\n\n );\n\n //Inserting Data\n $this->Paddy->f_insert('td_collections_deleted', array_merge($data, $audit));\n\n //Delete Originals\n $this->Paddy->f_delete('td_collections', $where);\n $this->Paddy->f_delete('td_details_farmer', $where);\n\n //For notification storing message\n $this->session->set_flashdata('msg', 'Successfully deleted!');\n\n redirect(\"paddy/paddycollection\");\n\n }",
"public function clearSalesListings()\n {\n $this->_salesListings = array();\n\n return $this;\n }",
"function deleteSubPages($parent){\n\n\t\techo $query\t=\t\"SELECT `page_id` FROM `cms_pages` WHERE `parent`='$parent'\";\n\n\t\t$rec\t\t=\t$this->fetchAll($query);\n//print_r($rec);\n\n\n\t\tif(count($rec)>0){\n\t\t\tfor($i=0;$i<count($rec);$i++){\n\t\t\t\t$this->deleteSubPages($rec[$i]['page_id']);\n\t\t\t}\n\t\t}\n\t\t$this->delete(\"cms_pages\",'`page_id`='.$parent);\n\t\treturn true;\n\n\t\n\t}",
"public function delete()\n {\n foreach ($this->getRecordsListAssoc() as $id=>$record) {\n \t$editRecord = new Warecorp_List_Record($id);\n \t$editRecord->delete();\n }\n $this->_db->delete('zanby_lists__imported',\n $this->_db->quoteInto('source_list_id=?', $this->_id).\n $this->_db->quoteInto('OR target_list_id=?', $this->_id));\n\n $this->_db->delete('zanby_lists__sharing',\n $this->_db->quoteInto('list_id=?', $this->_id));\n\n parent::delete();\n }",
"public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}",
"public function deleteSaleById($id);",
"function remove_from_parent()\n {\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->dn);\n $ldap->ls(\"(|(objectClass=gotoSubmenuEntry)(objectClass=FAIbranch)(objectClass=gotoMenuEntry))\",$this->dn,array(\"*\"));\n $a_remove = array();\n while($attrs = $ldap->fetch()){\n $a_remove[] = $attrs['dn'];\n }\n foreach($a_remove as $remove){\n $ldap->rmdir_recursive($remove);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));\n }\n }\n $this->_load_menu_structure();\n }",
"function removeFromParent()\n\t{\n\t \tif (isset($this->parent))\n\t \t{\n\t \t\t$index = $this->parent->getIndex($this);\n\t \t\t$this->parent->remove($index);\n\t \t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add this user to database | public function addUser() {
$userData = array (
"last_login"=>date('Y-m-d'),
"sid" => $this->sid,
"fname" => $this->fname,
"lname" => $this->lname,
"email" => $this->email,
"phone" => $this->telephone,
"pwd" => $this->pwd,
"middle_name" => $this ->middle_name,
"is_activated" => $this->is_activated,
"u_type" => 1
);
if (Database::obtain()->insert("users", $userData)) {
$ret_user = User::searchBy($userData);
if ($ret_user) $this->uid = $ret_user->getUid();
}
return $this->uid;
} | [
"function Add() {\n $values = array(\n 'username' => $this->username,\n 'first_Name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'mail' => $this->mail,\n 'password' => $this->password,\n 'gender' => $this->gender,\n 'birth_date' => $this->birth_date,\n 'weight' => $this->weight,\n 'fb_uid' => $this->fb_uid\n );\n //Adds to the databank\n $this->user_id = PublicApp::getDB()->insert('users', $values);\n return $this->user_id;\n }",
"public function addUser() \n {\n $data = array(\n 'email' => $this->_email,\n 'password' => $this->_password,\n 'title' => $this->_title,\n 'first_name' => $this->_fname,\n 'last_name' => $this->_lname,\n 'initials' => $this->_initials,\n 'bday' => $this->_bday,\n 'tel_no' => $this->_telno,\n 'address1' => $this->_address1,\n 'address2' => $this->_address2,\n 'city' => $this->_city,\n 'country' => $this->_country,\n 'role_id' => $this->_roleId,\n 'create_on' => $this->_createOn,\n 'create_by' => $this->_createBy,\n 'change_on' => $this->_changeOn,\n 'change_by' => $this->_changeBy\n );\n\n return $this->insert($data);\n }",
"private function add_user() {\n\t\t//add entry in login table\n\t\t$sql = \"insert into login(email,password,created_date) values('$this->user_id','$this->password', 'NOW()')\";\n\t\tif(!executeSql($sql, $this->conn)) {\n\t\t\treturn 'error';\n\t\t}\n\n\t\t//Note:- when ever new user is inserted, its pk should be added in register table\n\t\t//this is done by trigger refer db/triggers.txt\n\t\treturn true;\n\t}",
"private function adduser()\n {\n $name = $this->getParameter('name');\n $password = $this->getParameter('password');\n $realname = $this->getParameter('realname');\n $email = $this->getParameter('email');\n\n $success = vpAutocreateUsers::addToDatabase($name, $password, $realname, $email);\n\n $apiResult = $this->getResult();\n if( $success )\n $apiResult->addValue( array(), 'success', array() );\n else\n $apiResult->addValue( array(), 'error', array('title' => 'username null or user already exists') );\n }",
"function addUser() {\n\t\t$this->hashEmail();\n\t\t$this->hashPassword();\n\t\t$stmt = $this->db->prepare('INSERT INTO note_users (UserId, UserEmail, UserPassword) VALUES(:id, :email, :password);');\n\t\t$stmt->execute(array(':id' => $this->emailHash, ':email' => $this->email, ':password' => $this->passwordHash));\n\t\t\n\t\tif($stmt) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}",
"public function add(User $user);",
"public function addToDB() {\n\t\tglobal $log;\n\n\t\t// Check if there is a user already with this new user's user_id\n\t\t$checkQuery = \"\n\t\tSELECT *\n\t\tFROM users\n\t\tWHERE user_id = \" . \"'\" . $this->user_id . \"'\"\n\t\t;\n\t\tif (query($checkQuery, \"addToDB()\")->fetch_array()) { // If a user already exists\n\t\t\t// Handle failure\n\t\t\t$output = date(\"Y-m-d H:i:s T\", time());\n\t\t\t$output .= \" Could not add new user to database: user with user_id '\";\n\t\t\t$output .= $this->user_id . \"' already exists.\\n\";\n\t\t\t// Write to log file and kill process\n\t\t\tfwrite($log, $output, 2048);\n\t\t\texit($output);\n\t\t} else { // If no such user exists\n\n\t\t\t// Insert where\n\t\t\t$insertQuery = \"\n\t\t\tINSERT INTO users\n\t\t\t(user_id\n\t\t\t,user_name)\";\n\n\t\t\t// Insert what\n\t\t\t$insertQuery .= \"\n\t\t\tVALUES ('\" . $this->user_id . \"'\" .\n\t\t\t\t \",'\" . $this->user_name . \"'\";\n\t\t\t$insertQuery .= \");\";\n\n\t\t\tquery($insertQuery, \"addToDB()\");\n\n\t\t\t// Record success\n\t\t\t$output = date(\"Y-m-d H:i:s T\", time());\n\t\t\t$output .= \" Added new user to database with user_id of '\";\n\t\t\t$output .= $this->user_id;\n\t\t\t$output .= \" and user_name\" . $this->user_name . \".\\n\";\n\t\t\tfwrite($log, $output, 2048);\n\n\t\t\t// Get ID created for user in database\n\t\t\t$getIDResult = query(\"SELECT LAST_INSERT_ID()\", \"addToDB()\");\n\t\t\t$getID = $getIDResult->fetch_array()[0];\n\n\t\t\t// If user_id does not match ID created in database\n\t\t\tif ($this->user_id != $getID) {\n\t\t// Alert bad add\n\t\t\t\t$output = date(\"Y-m-d H:i:s T\", time());\n\t\t\t\t$output .= \" Alert: user_id in array and user_id in database do not match. Changing user_id in array to '\" . $getID . \"'.\\n\";\n\t\t\t\tfwrite($log, $output, 2048);\n\n\t\t// Force user_id to match database\n\t\t\t\t$this->user_id = $getID;\n\t\t\t} else {\n\t\t// Record ID match\n\t\t\t\t$output = date(\"Y-m-d H:i:s T\", time());\n\t\t\t\t$output .= \" Confirmed user_id in array (\" . $this->user_id . \") matches user_id in database (\" . $getID . \").\\n\";\n\t\t\t\tfwrite($log, $output, 2048);\n\t\t\t}\n\t\t}\n\t}",
"public function addUserToDatabase($user) {\n $name = $user->getName();\n $password = $user->getHashedPassword();\n $sql = \"INSERT INTO users (name, password) VALUES (:name, :password)\";\n $insertToDb = $this->connection->prepare($sql);\n $insertToDb->bindParam(':name', $name);\n $insertToDb->bindParam(':password', $password);\n $insertToDb->execute();\n $this->registerStatus = true;\n }",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"public function registerUser() {\n $db = new Database();\n $db->insertInto(\"`users` (`ID`, `email`) VALUES (NULL, :email)\", array(\":email\" => $this->email));\n }",
"public function insert_user () {\n $db = Database::getInstance();\n if ($this->user_exists()) {\n $db->query(\"UPDATE users\n SET firstName = '{$this->first_name}', lastName = '{$this->last_name}',\n languageCode = '{$this->language_code}', username = '{$this->username}',\n typeChat = '{$this->type_chat}', lastUpdate = NOW()\n WHERE userID = '{$this->user_id}'\");\n }\n else {\n $db->query(\"INSERT INTO\n users (userID, firstName, lastName,\n languageCode, username, typeChat)\n VALUES ('{$this->user_id}', '{$this->first_name}', '{$this->last_name}',\n '{$this->language_code}', '{$this->username}', '{$this->type_chat}')\");\n }\n }",
"function addUser(User $user) {\n\t\tglobal $db;\n\t\t\n\t\t$db->execute(\"\n\t\t\tINSERT INTO `group_user` SET\n\t\t\t\tuser_id = {$user->id},\n\t\t\t\tgroup_id = {$this->id}\n\t\t\");\n\t}",
"function add_user() {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t\r\n\t\t\tif( !$this->user_exist() ) {\r\n\t\t\t\t\r\n\t\t\t\t// adds user to the db with fake email\r\n\t\t\t\t$insert = wp_insert_user( array(\r\n\t\t\t\t\t'user_url' => 'http://themeforest.net/user/' . $this->user_login,\r\n\t\t\t\t\t'user_login' => $this->user_login,\r\n\t\t\t\t\t'display_name' => $this->user_login,\r\n\t\t\t\t\t'user_nicename' => $this->user_login,\r\n\t\t\t\t\t'user_pass' => $this->api,\r\n\t\t\t\t\t'user_email' => $this->user_login . \"@\" . $this->user_login . \".com\" )\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$user_data = get_userdatabylogin( $this->user_login );\r\n\t\t\t\t$user_id = $user_data->ID;\r\n\t\t\t\t\r\n\t\t\t\t// removes the fake email\r\n\t\t\t\t$wpdb->update($wpdb->users, \r\n\t\t\t\t\t\t\t\t\tarray('user_email' => ''),\r\n\t\t\t\t\t\t\t\t\tarray('ID' => $user_id, 'user_login' => $this->user_login),\r\n\t\t\t\t\t\t\t\t\tarray('%s'),\r\n\t\t\t\t\t\t\t\t\tarray('%d', '%s'));\r\n\t\t\t}\t\t\r\n\t\t}",
"public function saveUser() {\n Database::executeQueryReturnSingle(\"UPDATE users \n SET user_name = ?, email = ?, user_password = ?, user_salt = ?, iterations = ?, access_level = ? \n WHERE user_id = ?\", \n array($this->name, $this->email, $this->password,\n $this->salt, $this->iterations, $this->access_level,\n $this->id));\n }",
"public function addUser($name){\n $result = $this->insertIntoUsers($name);\n if ($result){\n //echo \"Succesfully added \" . $name . \"<br>\";\n }\n else{\n //echo \"error adding user\" . \"<br>\";\n }\n }",
"public function insertNewUser() {\n\t\ttry {\n\t\t\t$insertSQL = \"INSERT INTO users(user_first, user_last, user_email, user_uid, user_pwd) VALUES(:first, :last, :email, :uid, :pwd);\";\n\t\t\t$stmtInsert = $this->connect()->prepare($insertSQL);\n\t\t\t$stmtInsert->execute(['first' => $this->first, 'last' => $this->last, 'email' => $this->email, 'uid' => $this->uid, 'pwd' => $this->pwd]);\n\t\t} catch (PDOException $e) {\n\t\t\techo $e.getMessage();\n\t\t}\n\t}",
"private function addNewUser(){\r\n \r\n $res = 0; //operation result\r\n \r\n //connecting to db\r\n $db = DBConn::dbConnection(); \r\n if (!$db) {\r\n exit (\"Error: Unable to connect to database server\");\r\n }\r\n \r\n try {\r\n // adding new user user table\r\n $st = $db->prepare(\"INSERT INTO usereg.user (username, password, email)\r\n VALUES(:username, :password, :email)\");\r\n \r\n $st->bindParam(':username', $this->fields['username'], PDO::PARAM_STR);\r\n $st->bindParam(':password', $this->fields['password'], PDO::PARAM_STR);\r\n $st->bindParam(':email', $this->fields['email'], PDO::PARAM_STR);\r\n \r\n $op = $st->execute(); \r\n \r\n if ($op) {\r\n $res = $db->lastInsertId();\r\n } \r\n }\r\n catch (Exception $e) {\r\n // save error message to application error log\r\n logError($e);\r\n }\r\n // save changes to DB \r\n return $res;\r\n }",
"function addUser($user) {\n $this->setValue('users', $user);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if an endpoint list items | public function doesEndpointListItems()
{
return in_array($this->getEndpoint(), [
'otherusersalsoviewed',
'otherusersalsobought',
'itemsratedgoodbyotherusers',
'recommendationsforuser',
'mostvieweditems',
'mostboughtitems',
'mostrateditems',
'bestrateditems',
'worstrateditems',
'actionhistoryforuser',
'relateditems',
]);
} | [
"public function isListRequest() {\n if ($this->getMethod() != \\RestfulInterface::GET) {\n return FALSE;\n }\n $path = $this->getPath();\n return empty($path) || strpos($path, ',') !== FALSE;\n }",
"public function isList()\n {\n return\n stristr($this->getKey('EventList'), 'start') !== false\n || stristr($this->getMessage(), 'follow') !== false\n ;\n }",
"public function isList()\n\t{\n\t\treturn count($this) > 1 || $this->_forceList;\n\t}",
"public function isInList(): bool\n {\n return $this->getListifyPosition() !== null;\n }",
"public function isListingItem()\n {\n return false;\n }",
"function hasItem() {\n foreach($this->item_list as $list) {\n if($list->count() > 0)\n return true;\n }\n\n return false;\n }",
"function httpItemExists($items) {\n foreach($items as $item) {\n if ($item['type'] == ITEM_TYPE_HTTPTEST) {\n return true;\n }\n }\n\n return false;\n }",
"public function isList()\n {\n return $this->object === 'list';\n }",
"public function isEndpointRequested() : bool;",
"public function inListForItemContainedReturnsTrueDataProvider() {}",
"public function isRenderList();",
"function httpItemExists($items) {\n\tforeach ($items as $item) {\n\t\tif ($item['type'] == ITEM_TYPE_HTTPTEST) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"protected function isListResponse($response) {\n if (isset($response->body)\n && isset($response->body->apis)\n ) {\n return TRUE;\n }\n\n return FALSE;\n }",
"public function hasItems(): bool\n {\n return count($this->items) > 0;\n }",
"public function hasMultipleItems()\n {\n// if (!is_null($this->productInfo) && count($this->productInfo) > 1) {\n// return true;\n// }\n// return false;\n }",
"public function hasItems(){\r\n if(count($this->collection) > 0){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function hasMultipleItems()\n {\n// $this->__getProductInfo();\n// if (count($this->products) > 1) {\n// return true;\n// }\n// return false;\n }",
"protected function isListCommand(): bool\n {\n return method_exists($this, 'listResponseItemsKey');\n }",
"protected function is_list_page() {\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the RTE can be enabled for the current field and user. | public function is_rich_edit_enabled() {
if ( ! $this->useRichTextEditor ) {
return false;
}
global $wp_rich_edit;
$wp_rich_edit = null;
add_filter( 'get_user_option_rich_editing', array( $this, 'filter_user_option_rich_editing' ) );
$user_can_rich_edit = user_can_richedit();
remove_filter( 'get_user_option_rich_editing', array( $this, 'filter_user_option_rich_editing' ) );
return $user_can_rich_edit;
} | [
"public static function isEnabled()\n {\n // Frontend editing needs to be enabled also by admins\n if (isset($GLOBALS['BE_USER']) && $GLOBALS['TSFE']->config['config']['tx_frontend_editing'] == 1) {\n return ($GLOBALS['BE_USER']->uc['tx_frontend_editing_enable'] == 1);\n }\n\n return false;\n }",
"public function isAllowed() {\n\t\t# Users who cannot edit or review the page cannot set this\n\t\treturn ( $this->page\n\t\t\t&& $this->page->userCan( 'stablesettings' )\n\t\t\t&& $this->page->userCan( 'edit' )\n\t\t\t&& $this->page->userCan( 'review' )\n\t\t);\n\t}",
"public static function isEnabled() {\n\t\t// aloha needs to be enabled also by admins\n\t\t// this is the only way how to temporarly turn on/off the editor\n\t\tif (isset($GLOBALS['BE_USER'])\n\t\t\t\t&& $GLOBALS['BE_USER']->userTS['aloha'] == 1\n\t\t\t\t&& $GLOBALS['TSFE']->config['config']['aloha'] == 1\n\t\t\t\t) {\n\t\t\t// Defaultly allow aloha, only disable if user sets so\n\t\t\tif (!isset($GLOBALS['BE_USER']->uc['TSFE_adminConfig']['aloha'])) {\n\t\t\t\t// Check if Aloha is enabled in the UserConfiguration\n\t\t\t\tif (!empty($GLOBALS['BE_USER']->uc['aloha_enableFrontendEditing']) && (int)$GLOBALS['BE_USER']->uc['aloha_enableFrontendEditing'] === 1) {\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($GLOBALS['BE_USER']->uc['TSFE_adminConfig']['aloha'] == 1) {\n\t\t\t\t\t// Check if Aloha is enabled in the UserConfiguration\n\t\t\t\t\tif (!empty($GLOBALS['BE_USER']->uc['aloha_enableFrontendEditing']) && (int)$GLOBALS['BE_USER']->uc['aloha_enableFrontendEditing'] === 1) {\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public function isUserFieldCheckEnabled()\n\t{\n\t\treturn $this->enableUserFieldCheck;\n\t}",
"public function isFieldEnabled() {\n return $this->enabled;\n }",
"public function isEnabled()\n {\n return $this->getUserAccountControl() === null ? false : !$this->isDisabled();\n }",
"public function is_user_enabled();",
"public function IsEnabled()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return ($this->_user_level_tinyint > 0) && ($this->_user_level_tinyint != _USER_LEVEL_DEACTIVATED);\n }",
"private function isAllowedRichEdit()\n {\n if ($this->restricted) {\n $user = common_current_user();\n return !empty($user) && $user->hasRole('richedit');\n } else {\n return true;\n }\n }",
"public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}",
"function isEnabled() {\n\t\treturn $this->getSetting('enabled');\n\t}",
"public function isEnabled()\n {\n return true;\n\n $settings = new Settings('LeftMenu');\n\n $global = $settings->globalEnabled->getValue();\n $user = $settings->userEnabled->getValue();\n\n if (empty($user) || 'no' === $user) {\n return false;\n }\n\n if ($user === 'default' && !$global) {\n return false;\n }\n\n return true;\n }",
"function osc_user_validation_enabled() {\n return (getBoolPreference('enabled_user_validation'));\n }",
"public function isEnabled()\n {\n return $this->helper('turiknox_trustedstores')->isModuleEnabledInAdmin();\n }",
"public function is_restricted()\n\t{\n\t\treturn in_array($this->contrib_status, array(\n\t\t\text::TITANIA_CONTRIB_CLEANED,\n\t\t\text::TITANIA_CONTRIB_DISABLED,\n\t\t));\n\t}",
"public function isEnabledInWizard() {\n \treturn $this->_enable_in_wizard;\n }",
"function checkEditorEnabled()\n {\n return true;\n }",
"public static function is_enable() {\n\t\treturn false === Helper::get_settings( 'titles.disable_author_archives' ) &&\n\t\t\tHelper::get_settings( 'titles.author_add_meta_box' ) &&\n\t\t\tAdmin_Helper::is_user_edit();\n\t}",
"public function getIsSecurityEnabled() {\n\t\t// Skip if requested\n\t\tif($this->owner->config()->disable_security) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check for necessary security module\n\t\tif(!class_exists('SecureFileExtension')) {\n\t\t\ttrigger_error('SecureEditableFileField requires secureassets module', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the userid is numeric | private function checkUserID ($userid, $namefunction=''){
if ( !is_numeric($userid)){
throw new Exception("(filelogs.php)line70 - ".$namefunction." the userid is not in a validable format.");
}
} | [
"private function validateUserID(){\n if(is_numeric($this->user_id)){\n return true;\n }else{\n return false;\n }\n }",
"public function isNumeric();",
"public function is_user_id( $value );",
"function SanitisedUserNo( ) {\n $user_no = 0;\n if ( ! $this->logged_in ) return $user_no;\n\n $user_no = intval(isset($_POST['user_no']) ? $_POST['user_no'] : $_GET['user_no'] );\n if ( ! ($this->AllowedTo(\"Support\") || $this->AllowedTo(\"Admin\")) ) {\n $user_no = $this->user_no;\n }\n if ( $user_no == 0 ) $user_no = $this->user_no;\n return $user_no;\n }",
"protected function checkUserID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_UserID) && $this->_UserID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_UserID} is not a valid value for UserID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}",
"function is_numeric ($var) {}",
"function is_numeric($var)\n{\n return false;\n}",
"function isNum($s){return is_numeric($s) ? true : false;}",
"function validate($param) {\n if(is_numeric($param)){\n return true;\n }else{\n return false;\n }\n}",
"private function is_valid_number($data) {\n $data = trim($data);\n if(is_numeric($data)) {\n return $data;\n } else {\n return false;\n }\n }",
"function validaNumero ($numero){\n\treturn is_numeric($numero);\n}",
"function validNumberInput($value){\n return is_numeric($value);\n }",
"public function id($data){\n\t\t$valid = false;\n\t\t//8 max digits, 2 min\n\t\t$regexp = \"^[[:digit:]]{1,11}$\";\n\t\t \t\n\t\tif(is_numeric($data) && eregi($regexp, $data))\n\t\t\t$valid = true;\n\t\t \t\t\n\t\treturn $valid; \t\n\t }",
"function ValidUserId($id)\n {\n global $db;\n\n $val = $db->x->GetOne('SELECT user_id FROM {users} WHERE user_id = ?', null, intval($id));\n\n return intval($val);\n }",
"public function isnumber(){\n\t\treturn $this->make('[0-9]');\n\t}",
"public function checkFor64Id($userID = null){\n\t\tif($userID != null){\n\t\t\tif (strlen($userID) == 17 && is_numeric($userID)){\n\t\t\t\treturn $userID;\n\t\t\t} else {\n\t\t\t\t$userID = $this->get64Id($userID);\n\t\t\t\treturn $userID;\n\t\t\t}\n\t\t} else {return false;}\n\t}",
"public function IsNumeric () {\n\t\t\n\t\t\treturn $this->IsMatch('^[0-9]+$/u');\n\t\t\n\t\t}",
"protected function convertToUserInt() {\n\t\t$result = FALSE;\n\t\tif ($this->cObj->getUserObjectType() == tslib_cObj::OBJECTTYPE_USER) {\n\t\t\t$this->cObj->convertToUserIntObject();\n\t\t\t$this->cObj->data['pi_flexform'] = $this->cObj->data['_original_pi_flexform'];\n\t\t\tunset($this->cObj->data['_original_pi_flexform']);\n\t\t\t$result = TRUE;\n\t\t}\n\t\treturn $result;\n\t}",
"function invalidUID($username){\n\n $result;\n\n if(!preg_match(\"/^[a-zA-Z0-9]*$/\", $result)) {\n $result = true;\n } else {\n $result = false;\n }\n\n return $result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the shoe's category | public function shoe_category()
{
return $this->hasOne(ShoeCategory::class);
} | [
"public function getCategory()\n {\n return $this->readOneof(6);\n }",
"public function getCategory()\n {\n $string = mb_strtolower(\"{$this->name} {$this->id}\");\n $string = preg_replace('/[^a-z ]/', ' ', $string);\n $parts = explode(' ', $string);\n $parts = array_filter($parts);\n $lastPart = array_shift($parts);\n return $lastPart ?: 'bin';\n }",
"function get_category() {\n $category = null;\n\n if (!empty($this->categoryid)) {\n $category = grade_category::fetch('id', $this->categoryid);\n } elseif (!empty($this->iteminstance) && $this->itemtype == 'category') {\n $category = grade_category::fetch('id', $this->iteminstance);\n }\n\n return $category;\n }",
"public function getCategory()\n\t{\n\t\t$arrTrailFull = Category::GetTrailByProductId($this->id);\n\t\t$objCat = Category::model()->findbyPk($arrTrailFull[0]['key']);\n\t\treturn $objCat;\n\t}",
"public function getCategory(): string\n {\n return $this->category;\n }",
"public function getCategory()\r\n {\r\n return $this->category;\r\n }",
"public function getOccupationalCategory();",
"public function getCategory()\n {\n return $this->getOptionValue(self::CATEGORY);\n }",
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Layout = '.get_class( $this ) ) );\n\t}",
"public function getCategorie()\n {\n return $this->categorie;\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"function getCategorie()\n\t{\n\t\treturn array(\"Antipasti\",\"Primi Piatti\",\"Teppanyako e Tempure\",\"Uramaki\",\"Nigiri ed Onigiri\",\"Gunkan\",\"Temaki\",\"Hosomaki\",\"Sashimi\",\"Dessert\");\n\t}",
"public function getCatigory(){\n\t\t//returns the skill object\n\t\treturn $this->skill;\n\t}",
"public static function GetShoesInCategory($category)\n\t{\n\t\t// create connections to databases\n\t\t$dbCategories = WorkWithDB::ConnectToDB('categories');\n\t\t$dbShoes = WorkWithDB::ConnectToDB('shoes');\n\t\t$dbShoes_Categories = WorkWithDB::ConnectToDB('shoes_categories');\n\n\n\t\t// get category id\n\t\t$category_id = $dbCategories->where('category',$category)->pluck('id');\n\n\t\t// get shoes id by category\n\t\t$shoes_id = $dbShoes_Categories->where('categories_id',$category_id)->pluck('shoes_id');\n\n\t\t// get shoes\n\t\t$shoes = $dbShoes->whereIn('id',$shoes_id)->get();\n\t\treturn $shoes;\n\t}",
"public function getCategoria()\r\n {\r\n return $this->categoria;\r\n }",
"function solr_get_the_category() {\n\t\tif ( isset($this->solr_post['categories']) ) {\n\t\t\treturn $this->solr_post['categories'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Id = '.$this->CategoryId ) );\n\t}",
"public function getNameCat()\n {\n return $this->name_cat;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of donateur | public function getDonateur()
{
return $this->donateur;
} | [
"public function find_donnee() {\n $sql = \"SELECT *\n FROM donnee d\n WHERE d.id_capteur = '{$this->id}'\n LIMIT 1 \";\n // $result contains an array of objects which has properties the columns fetched from the BD by the previous query\n $result = self::find_by_query($sql);\n return array_shift($result);\n }",
"public function getPeriodeDu() {\n return $this->periodeDu;\n }",
"public function getValoracion()\r\n {\r\n return $this->valoracion;\r\n }",
"public function getMontantDebut()\n {\n return $this->montantDebut;\n }",
"public function getIdDocteur()\n {\n return $this->id_docteur;\n }",
"public function getValorSolicitado();",
"public function getValorCalculado() {\n return $this->nValor; \n }",
"function getValor()\n {\n return $this->valor;\n }",
"public function getComentari() { \n return $this->comentari; \n }",
"public function getIdDonjon()\n {\n return intval($this->idDonjon);\n }",
"public function getResultatObtenu()\n {\n return $this->resultatObtenu;\n }",
"public function getMotdepasse()\n {\n return $this->Motdepasse;\n }",
"public function getDataCriado()\n {\n return $this->data_criado;\n }",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getMandatDureeDucsedi() {\n return $this->mandatDureeDucsedi;\n }",
"public function getMotdepasse()\n {\n return $this->_motdepasse;\n }",
"public function getValorDalocacao()\n {\n return $this->valorDalocacao;\n }",
"public function getDoenca()\n {\n return $this->doenca;\n }",
"public function getDia()\n {\n return $this->dia;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve all nexus Get multiple nexus objects across all companies. The concept of 'Nexus' indicates a place where your company has sufficient physical presence and is obligated to collect and remit transactionbased taxes. When defining companies in AvaTax, you must declare nexus for your company in order to correctly calculate tax in all jurisdictions affected by your transactions. Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST]( . Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. | public function queryNexus($filter, $include, $top, $skip, $orderBy)
{
$path = "/api/v2/nexus";
$guzzleParams = [
'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy],
'body' => null
];
return $this->restCall($path, 'GET', $guzzleParams);
} | [
"public function listNexusByCompany($companyId, $filter, $top, $skip, $orderBy)\n {\n $path = \"/api/v2/companies/{$companyId}/nexus\";\n $guzzleParams = [\n 'auth' => $this->auth,\n 'query' => ['$filter' => $filter, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy],\n 'body' => null\n ];\n return $this->restCall($path, 'GET', $guzzleParams);\n }",
"public function testListNexusByCompany()\n {\n }",
"function shop_all(array $filter = array())\r\n\t\t{\r\n\t\t\treturn $this->query('shop/all', $filter);\r\n\t\t}",
"public function getObjectsWhereTaxonIs(){}",
"public function testQueryNexus()\n {\n }",
"public function getNexus($companyId, $id)\n {\n $path = \"/api/v2/companies/{$companyId}/nexus/{$id}\";\n $guzzleParams = [\n 'query' => [],\n 'body' => null\n ];\n return $this->restCall($path, 'GET', $guzzleParams);\n }",
"public function testListNexusParameters()\n {\n }",
"public function queryRepositoryClassAction()\n {\n $em = $this->getDoctrine()->getManager();\n $products = $em->getRepository('AppBundle:Product')->findAllOrderedByName();\n d($products);\n\n return new Response(sprintf('Success! I found %d results', count($products)));\n }",
"public function getNexus($companyId, $id)\n {\n $path = \"/api/v2/companies/{$companyId}/nexus/{$id}\";\n $guzzleParams = [\n 'auth' => $this->auth,\n 'query' => [],\n 'body' => null\n ];\n return $this->restCall($path, 'GET', $guzzleParams);\n }",
"public function queryObjects( $xquery );",
"private function getTaxonQuery(GridConfig $gridConfig): array\n {\n $query = $this->searchQueryProvider->getTaxonQuery();\n\n // Replace params\n $query = str_replace('{{TAXON}}', $gridConfig->getTaxon()->getCode(), $query);\n $query = str_replace('{{CHANNEL}}', $this->channelContext->getChannel()->getCode(), $query);\n\n // Convert query to array\n $query = $this->parseQuery($query);\n\n // Apply filters\n $appliedFilters = FilterHelper::buildFilters($gridConfig->getAppliedFilters());\n if ($gridConfig->haveToApplyManuallyFilters() && isset($appliedFilters['bool']['filter'])) {\n // Will retrieve filters after we applied the current ones\n $query['query']['bool']['filter'] = array_merge(\n $query['query']['bool']['filter'], $appliedFilters['bool']['filter']\n );\n } elseif (!empty($appliedFilters)) {\n // Will retrieve filters before we applied the current ones\n $query['post_filter'] = new ArrayObject($appliedFilters); // Use custom ArrayObject because Elastica make `toArray` on it.\n }\n\n // Manage limits\n $from = ($gridConfig->getPage() - 1) * $gridConfig->getLimit();\n $query['from'] = max(0, $from);\n $query['size'] = max(1, $gridConfig->getLimit());\n\n // Manage sorting\n $channelCode = $this->channelContext->getChannel()->getCode();\n foreach ($gridConfig->getSorting() as $field => $order) {\n $query['sort'][] = SortHelper::getSortParamByField($field, $channelCode, $order, $gridConfig->getTaxon()->getCode());\n break; // only 1\n }\n\n // Manage filters\n $aggs = AggregationHelper::buildAggregations($gridConfig->getFilters());\n if (!empty($aggs)) {\n $query['aggs'] = AggregationHelper::buildAggregations($gridConfig->getFilters());\n }\n\n return $query;\n }",
"public function getAppNexusData()\n {\n if ($this->_appNexus == null) {\n $data = json_decode($this->row->appNexusData, true);\n if ($data) {\n $this->_appNexus =\n new AppNexusObject($data, AppNexusObject::MODE_READ_WRITE);\n }\n }\n\n return $this->_appNexus;\n }",
"public function listNexusAsyncWithHttpInfo($filter = null, $top = null, $skip = null, $order_by = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\FetchResultNexusModel';\n $request = $this->listNexusRequest($filter, $top, $skip, $order_by, $x_avalara_client);\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 all()\n {\n \treturn $this->enterpriseRepo->all();\n }",
"public function get_all(){ \n\t\treturn $this->call('GET', '/admin/products.json', array()); \n\t}",
"public function listNexusByCountry($country, $filter = null, $top = null, $skip = null, $order_by = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n list($response) = $this->listNexusByCountryWithHttpInfo($country, $filter, $top, $skip, $order_by, $x_avalara_client);\n return $response;\n }",
"public abstract function getAll();",
"public function index()\n {\n $input = Request::all();\n $limit = isset($input['limit']) ? $input['limit'] : config('jp.pagination_limit');\n $taxes = $this->repo->getListing($input);\n\n if (!$limit) {\n $taxes = $taxes->get();\n\n return ApiResponse::success($this->response->collection($taxes, new CustomTaxesTransformer));\n }\n $taxes = $taxes->paginate($limit);\n\n return ApiResponse::success($this->response->paginatedCollection($taxes, new CustomTaxesTransformer));\n }",
"public static function getProducts() {\n $retval = [];\n $resource = curl_init();\n curl_setopt($resource, CURLOPT_URL, 'localhost:9200/products/prods/_search?scroll=1m&size=500');\n curl_setopt($resource, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($resource);\n\n\n if(!empty($response)) {\n $response = json_decode($response, true);\n\n if(!empty($response['hits'])) {\n $retval = $response['hits']['hits'];\n }\n\n }\n\n return $retval;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a number N, write a recursive function to output the number in binary. | function getBinary($n) {
return $n ? getBinary(intval($n / 2)) . $n % 2 : '0';
} | [
"function fib($n) {\n\tfor($i=0;$i<$n;$i++) {\n\t\techo fib_($i) . ' ';\n\t}\n}",
"function normalisedBinaryNbit($int, $n = 8) {\n return substr(sprintf(\"%0${n}b\", $int), -$n);\n}",
"function fib($n) {\n\t\treturn ($n < 2) ? $n : fib($n - 1) + fib($n - 2);\n\t}",
"function fib($n) {\n if ($n > 1) {\n return fib($n-2) + fib($n-1);\n } else {\n return $n;\n }\n}",
"function bunnyEars($n){\n if ($n == 0){ return 0;}\n $n -= 1;\n return 2 + bunnyEars($n);\n}",
"function power($a, $n){\n $pow = 1;\n $count = 0;\n while ($count < $n) {\n $pow *= $a;\n $count++;\n }\n\n return \"$a\".\" power \".\"$n\".\" = \".$pow;\n}",
"function recursive($num){\n //Print out the number.\n echo $num, '<br>';\n //If the number is less or equal to 50.\n if($num < 50){\n //Call the function again. Increment number by one.\n return recursive($num + 1);\n }\n}",
"function solution($N) {\n if ($N < 1 || $N > 2147483647) {\n throw new \\Exception('input number is out of range');\n }\n $maxLength = 0;\n $binaryNumber = decbin($N);\n for ($i = 0; $i < strlen($binaryNumber); $i++) {\n if ($binaryNumber[$i] === '1') {\n $binaryGap = '1';\n for ($j = $i + 1; $j < strlen($binaryNumber); $j++) {\n $binaryGap .= $binaryNumber[$j];\n if ($binaryNumber[$j] === '1') {\n break;\n }\n }\n if (preg_match('/^10+1$/', $binaryGap)) {\n $maxLength = max($maxLength, substr_count($binaryGap, '0'));\n }\n } \n }\n\n return $maxLength;\n}",
"function factorial($n) {\n\tif ( $n > 1 ) {\n\t\treturn $n * factorial($n - 1 ) ;\n\t}\n\telse {\n\t\treturn 1;\n\t}\n}",
"private static function get_num($size,$n) {\n\t\t$value = str_repeat(chr(255),$n);\n\t\tfor($i=0;$i<$n;$i++){\n\t\t\t$buffer = 0;\n\t\t\tfor($j=0;$j<8;$j++)\n\t\t\t\t$buffer += (($size & pow(2,(8*$i+$j))) == pow(2,(8*$i+$j)))?(1<<$j):0;\n\t\t\t$value[$n-$i-1] = chr($buffer);\n\t\t}\n\t\treturn $value;\n\t}",
"function fib ($n) {\n\t$a = 0;\n\t$b = 1;\n\twhile ($n>=0) {\n\t\t$res = $a;\n\t\t$a = $a + $b;\n\t\t$b = $res;\n\t\t$n--;\n\t}\n\treturn $b;\n}",
"function my_fibo_rec($n)\n{\nif ($n < 2)\n\treturn $n;\nelse\n\treturn my_fibo_rec($n - 1) + my_fibo_rec($n - 2);\n}",
"function factorial($n) {\n if ($n == 0) {\n return 1;\n }\n return factorial($n-1) * $n;\n}",
"function r_rev($n) {\n if($n<10) {\n echo (int) $n;\n return $n;\n }\n else {\n echo $n%10;\n return r_rev((int) $n / 10) ;\n }\n}",
"function fibonacci_recursion($n, &$map)\n\t{\n\t if(!isset($map[$n]))\n\t $map[$n] = fibonacci_recursion($n-1, $map) + fibonacci_recursion($n-2, $map);\n\n\t return $map[$n];\n\t}",
"function binaryToString($value) {\n if ($value >= 1 || $value <= 0) {\n return \"ERROR\";\n }\n $temp = $value;\n $str = \"\";\n $counter = 0;\n while ($temp != 0 && $counter <= 20) {\n $temp *= 2;\n if ($temp > 1) {\n $temp--;\n $str .= \"1\";\n } else {\n $str .= \"0\";\n }\n $counter++;\n }\n return $str;\n}",
"function _int_to_byte( $n )\n\t{\n\t\treturn chr($n);\n\t}",
"static function factorial($n){\n if ($n <= 1) {return 1;}\n return $n * factorial($n - 1);\n }",
"function factorielle(int $n):int{\n if ( $n<=0 )\n return 1;\n \n return $n * factorielle($n-1);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getSubaccountById Async with response Get details of an account. | public function testGetSubaccountByIdErrorResponsesAsync()
{
// Configure HTTP basic authorization: basicAuth
$config = Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$expected_code = 401;
// Create a mock response
$expected = null;
// Create a mock handler
$mock = new \GuzzleHttp\Handler\MockHandler([
new \GuzzleHttp\Psr7\Response($expected_code, [], $expected),
]);
$handler = \GuzzleHttp\HandlerStack::create($mock);
$client = new \GuzzleHttp\Client(['handler' => $handler, 'http_errors' => false]);
$apiInstance = new Api\AccountsApi(
$client,
$config
);
$uid = "uid_example";
$promise = $apiInstance->getSubaccountByIdAsync($uid)->then(function ($result) {
$this->fail("No error response when calling AccountsApi->getSubaccountById when mocked to return error");
}, function ($exception) use(&$expected_code, &$expected) {
$this->assertEquals($expected_code, $exception->getCode());
$this->assertEquals($expected, $exception->getResponseObject());
});
$promise->wait();
$expected_code = 403;
// Create a mock response
$expected = new \Karix\Model\UnauthorizedResponse();
// Create a mock handler
$mock = new \GuzzleHttp\Handler\MockHandler([
new \GuzzleHttp\Psr7\Response($expected_code, [], $expected),
]);
$handler = \GuzzleHttp\HandlerStack::create($mock);
$client = new \GuzzleHttp\Client(['handler' => $handler, 'http_errors' => false]);
$apiInstance = new Api\AccountsApi(
$client,
$config
);
$uid = "uid_example";
$promise = $apiInstance->getSubaccountByIdAsync($uid)->then(function ($result) {
$this->fail("No error response when calling AccountsApi->getSubaccountById when mocked to return error");
}, function ($exception) use(&$expected_code, &$expected) {
$this->assertEquals($expected_code, $exception->getCode());
$this->assertEquals($expected, $exception->getResponseObject());
});
$promise->wait();
$expected_code = 404;
// Create a mock response
$expected = new \Karix\Model\NotFoundResponse();
// Create a mock handler
$mock = new \GuzzleHttp\Handler\MockHandler([
new \GuzzleHttp\Psr7\Response($expected_code, [], $expected),
]);
$handler = \GuzzleHttp\HandlerStack::create($mock);
$client = new \GuzzleHttp\Client(['handler' => $handler, 'http_errors' => false]);
$apiInstance = new Api\AccountsApi(
$client,
$config
);
$uid = "uid_example";
$promise = $apiInstance->getSubaccountByIdAsync($uid)->then(function ($result) {
$this->fail("No error response when calling AccountsApi->getSubaccountById when mocked to return error");
}, function ($exception) use(&$expected_code, &$expected) {
$this->assertEquals($expected_code, $exception->getCode());
$this->assertEquals($expected, $exception->getResponseObject());
});
$promise->wait();
$expected_code = 500;
// Create a mock response
$expected = new \Karix\Model\ErrorResponse();
// Create a mock handler
$mock = new \GuzzleHttp\Handler\MockHandler([
new \GuzzleHttp\Psr7\Response($expected_code, [], $expected),
]);
$handler = \GuzzleHttp\HandlerStack::create($mock);
$client = new \GuzzleHttp\Client(['handler' => $handler, 'http_errors' => false]);
$apiInstance = new Api\AccountsApi(
$client,
$config
);
$uid = "uid_example";
$promise = $apiInstance->getSubaccountByIdAsync($uid)->then(function ($result) {
$this->fail("No error response when calling AccountsApi->getSubaccountById when mocked to return error");
}, function ($exception) use(&$expected_code, &$expected) {
$this->assertEquals($expected_code, $exception->getCode());
$this->assertEquals($expected, $exception->getResponseObject());
});
$promise->wait();
} | [
"public function testGetSubaccountById()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\AccountResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling AccountsApi->getSubaccountById: \".$e->getMessage());\n }\n }",
"public function testGetSubAccountById()\n {\n $subAccount = self::$accountApi->subAccount(self::$SUB_ACCOUNT_GET_ID);\n\n self::assertValidSubAccountUser(\n $subAccount,\n [\n 'id' => self::$SUB_ACCOUNT_GET_ID,\n 'name' => self::$SUB_ACCOUNT_GET_NAME,\n ]\n );\n }",
"public function testGetSubaccountByIdExceptionAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_exception = new \\GuzzleHttp\\Exception\\RequestException(\n \"Error Communicating with Server\",\n new \\GuzzleHttp\\Psr7\\Request('GET', 'test')\n );\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([$expected_exception]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n $promise = $apiInstance->getSubaccountByIdAsync($uid)->then(function ($result) {\n $this->fail(\"No exception when calling AccountsApi->getSubaccountById with mocked exception\");\n }, function ($exception) use( &$expected_exception) {\n $this->assertEquals(\"[0] \".$expected_exception->getMessage(), $exception->getMessage());\n });\n $promise->wait();\n }",
"public function testCreateSubaccountAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 201;\n // Create a mock response\n $expected = new \\Karix\\Model\\AccountResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $subaccount = new \\Karix\\Model\\CreateAccount();\n\n $promise = $apiInstance->createSubaccountAsync($subaccount)->then(function ($result) use( &$expected) {\n $this->assertEquals($expected, $result);\n }, function ($exception) {\n $this->fail(\"Exception when calling AccountsApi->createSubaccount: \".$e->getMessage());\n });\n $promise->wait();\n }",
"public function subaccount_get($subaccount_id)\n {\n return $this->_api->subaccountGet($subaccount_id);\n }",
"public function get_sub_accounts( $account_id )\n {\n $sub_accounts = $this->accountRepository->sub_accounts( $account_id );\n\n return response()->json( ['data' => $sub_accounts,'status' => 'success'] );\n }",
"public function testGetSubaccountByIdException()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_exception = new \\GuzzleHttp\\Exception\\RequestException(\n \"Error Communicating with Server\",\n new \\GuzzleHttp\\Psr7\\Request('GET', 'test')\n );\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([$expected_exception]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->fail(\"No exception when calling AccountsApi->getSubaccountById with mocked exception\");\n } catch (ApiException $e) {\n $this->assertEquals(\"[0] \".$expected_exception->getMessage(), $e->getMessage());\n }\n }",
"function getSubaccountInfo() { if(validAcctAndSubacct(UID, $_GET[\"subId\"])) {\r\n $sub = findSubaccount($_GET[\"subId\"]);\r\n u(OUT)->success(findSubaccount($_GET[\"subId\"]), NULL, NULL);\r\n }\r\n }",
"public function fetchSubAccount($subaccount_code)\n {\n\n $this->setRequestOptions();\n return $this->setHttpResponse(\"/subaccount/{$subaccount_code}\", \"GET\", [])->getResponse();\n }",
"public function getById($subaccountId);",
"public function testGetSubaccountByIdErrorResponses()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 401;\n // Create a mock response\n $expected = null;\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler, 'http_errors' => false]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->fail(\"No error response when calling AccountsApi->getSubaccountById when mocked to return error\");\n } catch (ApiException $e) {\n $this->assertEquals($expected_code, $e->getCode());\n $this->assertEquals($expected, $e->getResponseObject());\n }\n $expected_code = 403;\n // Create a mock response\n $expected = new \\Karix\\Model\\UnauthorizedResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler, 'http_errors' => false]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->fail(\"No error response when calling AccountsApi->getSubaccountById when mocked to return error\");\n } catch (ApiException $e) {\n $this->assertEquals($expected_code, $e->getCode());\n $this->assertEquals($expected, $e->getResponseObject());\n }\n $expected_code = 404;\n // Create a mock response\n $expected = new \\Karix\\Model\\NotFoundResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler, 'http_errors' => false]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->fail(\"No error response when calling AccountsApi->getSubaccountById when mocked to return error\");\n } catch (ApiException $e) {\n $this->assertEquals($expected_code, $e->getCode());\n $this->assertEquals($expected, $e->getResponseObject());\n }\n $expected_code = 500;\n // Create a mock response\n $expected = new \\Karix\\Model\\ErrorResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler, 'http_errors' => false]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->fail(\"No error response when calling AccountsApi->getSubaccountById when mocked to return error\");\n } catch (ApiException $e) {\n $this->assertEquals($expected_code, $e->getCode());\n $this->assertEquals($expected, $e->getResponseObject());\n }\n }",
"private function getSubaccount()\n {\n $subaccountTransportDataObject = $this->_coreRegistry\n ->registry('subaccount');\n\n $subaccountFormData = $this->customerSession->getSubaccountFormData(true);\n if ($subaccountFormData !== null) {\n $this->dataObjectHelper->populateWithArray(\n $subaccountTransportDataObject,\n $subaccountFormData,\n '\\Cminds\\MultiUserAccounts\\Api\\Data\\SubaccountInterface'\n );\n } \n\n return $subaccountTransportDataObject;\n }",
"public function testCreateSubaccount()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 201;\n // Create a mock response\n $expected = new \\Karix\\Model\\AccountResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $subaccount = new \\Karix\\Model\\CreateAccount();\n\n try {\n $result = $apiInstance->createSubaccount($subaccount);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling AccountsApi->createSubaccount: \".$e->getMessage());\n }\n }",
"public function getSubAccountId(): string;",
"public function subaccountGetIds();",
"public function listSubaccounts() {\n return $this->makeRequest(\"getSubaccounts\", NULL, NULL);\n }",
"public function getSubaccountID()\n {\n return $this->SubaccountID;\n }",
"public function testGetUsersBySubAccountId()\n {\n $result = self::$accountApi->users(true, [], self::$USER_GET_NAME, self::$SUB_ACCOUNT_GET_ID);\n\n self::assertCount(1, $result['users']);\n }",
"public function getAccount($accountid) {\r\n $path = \"account/$accountid\";\r\n return self::performRequest($path);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form submission callback for a calendar admin settings. | function calendar_framework_calendar_form_submit($form, &$form_state) {
$calendar = $form_state['values']['calendar'];
// Saving necessary configs.
unset($form_state['values']['op'],
$form_state['values']['submit'],
$form_state['values']['form_id'],
$form_state['values']['calendar'],
$form_state['values']['form_token'],
$form_state['values']['form_build_id']
);
variable_set('calendar_framework_settings_' . $calendar['identifier'], $form_state['values']);
$form_state['redirect'] = 'admin/settings/date-time/calendars';
drupal_set_message(t('Configuration for <em>@calendar</em> has been successfully saved.',
array('@calendar' => calendar_framework_calendar_title($calendar['identifier']))
));
} | [
"public function adminSettingsSubmit()\n {\n\n if (isset($_POST['google_api_endpoint'])) {\n $this->set('google_api_endpoint', $_POST['google_api_endpoint']);\n }\n\n if (isset($_POST['customer_default_max_books_results_per_page'])) {\n $this->set('customer_default_max_books_results_per_page', intval($_POST['customer_default_max_books_results_per_page']));\n }\n\n }",
"function dul_system_feed_settings() {\n\t$form['staff_directory_feed_url'] = array(\n\t\t'#type' => 'textfield',\n\t\t'#title' => t('URL of the Staff Directory XML Feed'),\n\t\t'#default_value' => variable_get('dul_system.staff_directory_feed_url', ''),\n\t);\n\t// specify the \"submit\" callback function here...\n\t$form['#submit'][] = 'dul_system_feed_settings_submit';\n\n\t// return the form filtered through the system_settings_form\n\treturn system_settings_form($form);\n}",
"function entrez_admin_settings_form_submit($form, &$form_state) {\n if ($form_state['clicked_button']['#parents'][0] == 'button_cron_import') { \n // We implement this as a toggle so the text of the button can change.\n if (!variable_get('entrez_cron_import', 0)) {\n $val = 1;\n $msg = t('Cron import enabled.');\n }\n else {\n $val = 0;\n $msg = t('Cron import disabled.');\n }\n variable_set('entrez_cron_import', $val);\n drupal_set_message($msg);\n }\n if ($form_state['clicked_button']['#parents'][0] == 'button_cron_update') { \n // We implement this as a toggle so the text of the button can change.\n if (!variable_get('entrez_cron_update', 0)) {\n $val = 1;\n $msg = t('Enabled cron update of PubMed bibliographies.');\n }\n else {\n $val = 0;\n $msg = t('Disabled cron update of PubMed bibliographies.');\n }\n variable_set('entrez_cron_update', $val);\n drupal_set_message($msg);\n }\n}",
"function samlauth_admin_settings_submit(array &$form, array &$form_state) {\n module_load_include('inc', 'samlauth', 'samlauth');\n\n samlauth_settings_save('default', $form_state['values']);\n}",
"function wpsc_merchant_paymentsense_settings_form_submit() {\r\n\treturn wpsc_merchant_paymentsense::submit_paymentsense_settings_form();\r\n}",
"function edit_defaults_settings () {\n\t\tif (empty(main()->USER_ID)) {\n\t\t\treturn _error_need_login();\n\t\t}\n\t\t// Get calendar settings\n\t\t$cal_settings = $this->_get_settings($this->_user_info[\"id\"]);\n\t\t$this->DATE_FORMAT_NUM = $cal_settings[\"date_format\"];\n\t\t// Save settings\n\t\tif (isset($_POST[\"save2\"])) {\n\t\t\tif (empty($_POST[\"status\"])) {\n\t\t\t\t_re(\"Status is required!\");\n\t\t\t}\n\t\t\t$start_time\t= intval($_POST[\"start_time\"]);\n\t\t\t$end_time\t= intval($_POST[\"end_time\"]);\n\n\t\t\tif (($end_time - $start_time) <= 0) {\n\t\t\t\t_re(\"Please select time!\");\n\t\t\t}\n\t\t\t// Prepare new week days settings\n\t\t\t$new_settings = array();\n\t\t\tfor ($_week_day = 0; $_week_day <= 6; $_week_day++) {\n\t\t\t\tif (!isset($_POST[\"week_day_\".$_week_day])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfor ($i = $start_time; $i < $end_time; $i++) {\n\t\t\t\t\t$next_hours[$i * 3600]\t= $_POST[\"status\"];\n\t\t\t\t\t$desc[$i * 3600]\t\t= $_POST[\"comments\"];\n\t\t\t\t}\t\n\t\t\t\t$new_settings[$_week_day] = array(\n\t\t\t\t\t\"hours\"\t=> $next_hours,\n\t\t\t\t\t\"desc\"\t=> $desc\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (empty($new_settings)) {\n\t\t\t\t_re(\"Please select at least one week day!\");\n\t\t\t}\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\t// Merge with old ones\n\t\t\t\tif (!empty($cal_settings[\"default\"])) {\n\t\t\t\t\t$new_settings = my_array_merge((array)@unserialize($cal_settings[\"default\"]), (array)$new_settings);\n\t\t\t\t}\n\t\t\t\t@ksort($new_settings);\n\n\t\t\t\tdb()->UPDATE(\"calendar_settings\", array(\n\t\t\t\t\t\"default\"\t=> _es(serialize($new_settings)),\n\t\t\t\t), \"user_id=\".main()->USER_ID);\n\n\t\t\t\treturn js_redirect(\"./?object=\".$_GET[\"object\"].\"&action=\".__FUNCTION__);\n\t\t\t}\n\t\t}\n\t\t// We start with 2006 year\n\t\t$base_day_time = strtotime(\"2006-01-01 00:00:00 GMT\");\n\t\t// Prepare selected data for display\n\t\t$week_days = \"\";\n\t\t// Iterate over week days seleted default settings\n\t\tforeach ((array)@unserialize($cal_settings[\"default\"]) as $_day_num => $value) {\n\t\t\tif (empty($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$hours_info\t\t= $value[\"hours\"];\n\t\t\t@ksort($hours_info);\n\t\t\t$comment_info\t= $value[\"desc\"];\n\t\t\t@ksort($comment_info);\n\t\t\t// Iterate over selected hours\t\t\t\n\t\t\t$status_items = array();\n\t\t\tfor ($_hour = 0; $_hour <= 23; $_hour++) {\n\t\t\t\t$_cur_hour_secs\t\t= $_hour * 3600;\n\t\t\t\tif (empty($hours_info[$_cur_hour_secs])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$_start_hour_secs\t= $_cur_hour_secs;\n\t\t\t\t$_end_hour_secs\t\t= $_cur_hour_secs + 59 * 60;\n\t\t\t\t$_status\t\t\t= $hours_info[$_cur_hour_secs];\n\t\t\t\t// Skip repeated values\n\t\t\t\t$_next_hour_secs = $_cur_hour_secs + 3600;\n\t\t\t\tif ($hours_info[$_next_hour_secs] == $hours_info[$_cur_hour_secs]) {\n\t\t\t\t\tif (!isset($_tmp_hour_secs)) {\n\t\t\t\t\t\t$_tmp_hour_secs = $_cur_hour_secs;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isset($_tmp_hour_secs)) {\n\t\t\t\t\t$_start_hour_secs = $_tmp_hour_secs;\n\t\t\t\t\tunset($_tmp_hour_secs);\n\t\t\t\t}\n\t\t\t\t// Prepare current item\n\t\t\t\t$status_items[$_hour] = array(\n\t\t\t\t\t\"status_id\"\t\t=> $_status,\n\t\t\t\t\t\"from\"\t\t\t=> gmdate(\"G:i\", $base_day_time + $_start_hour_secs),\n\t\t\t\t\t\"to\"\t\t\t=> gmdate(\"G:i\", $base_day_time + $_end_hour_secs),\n\t\t\t\t\t\"comment\"\t\t=> $comment_info[$_cur_hour_secs],\n\t\t\t\t\t\"status\"\t\t=> $this->_date_statuses[$_status],\n\t\t\t\t\t\"delete_link\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=delete_default&id=\".$_day_num.\"-\".$_start_hour_secs.\"-\".$_cur_hour_secs,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (empty($status_items)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Prepare template\n\t\t\t$replace_week_day = array(\t\t\t\n\t\t\t\t\"status_items\"\t=> $status_items,\n\t\t\t\t\"week_day_name\"\t=> $this->_get_week_day_name($_day_num),\n\t\t\t);\n\t\t\t$week_days .= tpl()->parse(\"calendar/defaults_week_day\", $replace_week_day);\n\t\t}\n\t\t// Prepare hours for select\n\t\tfor ($i = 0; $i <= 24; $i++) {\n\t\t\t$hours_select[$i] = ($i < 10 ? \"0\" : \"\").$i;\n\t\t}\n\t\t// DO NOT REMOVE! Needed for preparing $this->_week_day_names\n\t\t$this->_get_week_day_name();\n\t\t// Prepare template\n\t\t$replace = array(\n\t\t\t\"form_action\"\t\t=> \"./?object=\".$_GET[\"object\"].\"&action=\".__FUNCTION__,\n\t\t\t\"error_message\"\t\t=> _e(),\n\t\t\t\"selected_week_days\"=> $week_days,\n\t\t\t\"title\"\t\t\t\t=> _prepare_html($day_info[\"title\"]),\n\t\t\t\"desc\"\t\t\t\t=> _prepare_html($day_info[\"desc\"]),\n\t\t\t\"status_box\"\t\t=> $this->_box(\"status\", $day_info[\"status\"]),\n\t\t\t\"hours\"\t\t\t\t=> $hours,\n\t\t\t\"cur_date\"\t\t\t=> $this->_format_date($cur_day_time),\n\t\t\t\"view_link\"\t\t\t=> \"./?object=\".$_GET[\"object\"].\"&action=view\".($this->HIDE_TOTAL_ID ? \"\" : \"&id=\".$this->_user_info[\"id\"]).\"&page=\".gmdate(\"Y-m\", $cur_day_time),\n\t\t\t\"back_link\"\t\t\t=> \"./?object=\".$_GET[\"object\"].\"&action=manage&id=\".gmdate(\"Y-m\", $cur_day_time),\n\t\t\t\"start_time_box\"\t=> common()->select_box(\"start_time\", $hours_select, 0, false, 2, \"\", false),\n\t\t\t\"end_time_box\"\t\t=> common()->select_box(\"end_time\",\t$hours_select, 24, false, 2, \"\", false),\n\t\t\t\"status_box\"\t\t=> common()->select_box(\"status\",\t\t$this->_date_statuses, 0, false, 2, \"\", false),\n\t\t\t\"week_day_box\"\t\t=> common()->multi_check_box(\"week_day\",\t$this->_week_day_names, \"\", 1),\n\t\t\t\"clean_link\"\t\t=> \"./?object=\".$_GET[\"object\"].\"&action=clean_default_settings\",\n\t\t);\n\t\treturn tpl()->parse(\"calendar/defaults_settings\", $replace);\n\t}",
"function submit() {\n\t\t$this->layout = 'default';\n\t\tif (!empty($this->data)) {\n\t\t\t$data = $this->data;\n\t\t\tif ($data['User']['email'] && $data['User']['headline'] && $data['User']['date'] && $data['User']['location']) {\n $this->Email->to = Configure::read('Calendar.admin_email');\n $this->Email->subject = '['.Configure::read('Calendar.name').'] Event Submission';\n $this->Email->from = $data['User']['email'];\n $this->Email->template = 'calendar';\n $this->set('user',$data['User']);\n if ($this->Email->send()) {\n \t$this->Session->setFlash('Your calendar submission has been successfully received.');\n \t$this->redirect('/',null,true);\n } else {\n \t$this->Session->setFlash('Sorry, but there was an error receiving your submission. Please try again.');\n }\n \t} else {\n \t\t$this->Session->setFlash('You must fill out all the required fields to submit an event.');\n \t}\n\t\t}\n\t}",
"public function post_settings()\n\t{\n\t\t$updated_info['user'] = Model_User::get_by_id(Session::get('user_id'));\n\t\t$updated_info['new_info'] = Input::post();\n\n\t\t$update_user = Model_User::update_user($updated_info);\n\t\t\n\t\t// On successful update, reload user dashbord on settings page\n\t\tResponse::redirect('dashboard/settings');\n\t}",
"function video_cron_admin_settings() {\n $form = array();\n $form['video_cron'] = array(\n '#type' => 'checkbox',\n '#title' => t('Use Drupals built in cron.'),\n '#default_value' => variable_get('video_cron', TRUE),\n '#description' => t('If you would like to use Drupals built in cron hook, check this box. Please be warned that transcoding videos is very resource intensive. If you use poor mans cron, I highly discourage this option. I also suggest you setup your cron to call this function through CLI instead of WGET.'),\n );\n $form['video_ffmpeg_instances'] = array(\n '#type' => 'textfield',\n '#title' => t('Total videos to convert during each cron process.'),\n '#default_value' => variable_get('video_ffmpeg_instances', 5),\n '#description' => t('How many videos do you want to process on each cron run? Either through hook_cron or the video_scheduler.php.'),\n );\n return system_settings_form($form);\n}",
"public function save_settings() {\n\t\t$defaults = it_exchange_get_option( 'addon_gravity_forms' );\n\t\t$values = wp_parse_args( ITForm::get_post_data(), $defaults );\n\n\t\tif ( wp_verify_nonce( $_POST['_wpnonce'], 'it-exchange-gravity-forms-settings' ) ) {\n\t\t\t$errors = apply_filters( 'it_exchange_add_on_gravity_forms_validate_settings', $this->get_form_errors( $values, $defaults ), $values );\n\n\t\t\tif ( ! $errors && it_exchange_save_option( 'addon_gravity_forms', $values ) ) {\n\t\t\t\tITUtility::show_status_message( __( 'Settings saved.', ITEGFP::SLUG ) );\n\t\t\t} else {\n\t\t\t\t$this->message = __( 'Settings not saved.', ITEGFP::SLUG );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->message = __( 'Invalid request. Please try again.', ITEGFP::SLUG );\n\t\t}\n\t}",
"function room_reservations_admin_settings_reminders_submit($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $send_reminders = $form_state['values']['send_reminders'];\n $reminder_time = $form_state['values']['reminder_time'];\n $reminder_cutoff = $form_state['values']['reminder_cutoff'];\n $confirmation = ROOM_RESERVATIONS_SAVE_CONFIRMATION_MSG;\n $error = ROOM_RESERVATIONS_SAVE_ERROR_MSG;\n }\n elseif ($form_state['clicked_button']['#value'] == t('Reset to defaults')) {\n $send_reminders = 0;\n $reminder_time = 1300;\n $reminder_cutoff = 1300;\n $confirmation = ROOM_RESERVATIONS_RESET_CONFIRMATION_MSG;\n $error = ROOM_RESERVATIONS_RESET_ERROR_MSG;\n }\n $errors = FALSE;\n $result = _room_reservations_set_variable('send_reminders', $send_reminders);\n if (!$result) {\n $errors = TRUE;\n }\n $result = _room_reservations_set_variable('reminder_time', $reminder_time);\n if (!$result) {\n $errors = TRUE;\n }\n $result = _room_reservations_set_variable('reminder_cutoff', \n $reminder_cutoff);\n if (!$result) {\n $errors = TRUE;\n }\n if ($errors) {\n drupal_set_message(check_plain($error), 'error');\n }\n else {\n drupal_set_message(check_plain($confirmation));\n }\n}",
"function _dataone_admin_settings_submit($form, &$form_state) {\n global $base_url;\n\n // Let menu_execute_active_handler() know that a menu rebuild may be required.\n variable_set('menu_rebuild_needed', TRUE);\n\n // Register updated node document.\n drupal_set_message(t('Don\\'t forget to register your changes with DataONE'), 'warning');\n $register_url = $base_url . '/admin/config/services/dataone/register/';\n $selected_versions = variable_get(DATAONE_VARIABLE_API_VERSIONS);\n foreach ($selected_versions as $version => $label) {\n $register_version_url = $register_url . $version;\n drupal_set_message(t('Register @ver: !url', array('@ver' => $label, '!url' => $register_version_url)), 'warning');\n }\n\n}",
"function settings() {\n\t\t$this->validate();\n\t\t$this->setupTemplate(true);\n\n\t\timport('classes.admin.form.SiteSettingsForm');\n\n\t\t$settingsForm = new SiteSettingsForm();\n\t\tif ($settingsForm->isLocaleResubmit()) {\n\t\t\t$settingsForm->readInputData();\n\t\t} else {\n\t\t\t$settingsForm->initData();\n\t\t}\n\t\t$settingsForm->display();\n\t}",
"public function waAfterSettingsAction() {\n $this->view->menu = \"WAAFTERSETTINGS\";\n\n $this->view->waId = $this->getRequest()->getPost('waId');\n\n if ($this->view->waId > 0) {\n\n $this->view->editwaafterdetails = $this->waAfterDetailsByIdAction();\n\n $waeventdetailbyid = json_decode($this->view->editwaafterdetails);\n $this->view->wacategory = $waeventdetailbyid->type;\n $this->view->watitle = $waeventdetailbyid->message_title;\n } else {\n $this->view->wacategory = $this->getRequest()->getPost('wacategory');\n $this->view->watitle = $this->getRequest()->getPost('watitle');\n }\n if ($this->view->wacategory == '') {\n $this->_redirect($this->makeUrl('/mywa/create-wa'));\n }\n }",
"function ca_newsletter_admin_settings_form() {\n $form = array();\n\n $form['ca_newsletter_list'] = array(\n '#type' => 'select',\n '#title' => t('Newsletter\\'s List Template'),\n '#options' => array(\n 'ca_newsletter_list_template_one' => t('Template One'),\n 'ca_newsletter_list_template_two' => t('Template Two'),\n 'ca_newsletter_list_template_three' => t('Template Three'),\n ),\n '#default_value' => variable_get('ca_newsletter_list_template', 'ca_newsletter_list_template_one'),\n '#required' => TRUE,\n );\n $form['ca_newsletter_node'] = array(\n '#type' => 'select',\n '#title' => t('Newsletter\\'s Node Template'),\n '#options' => array(\n 'ca_newsletter_node_template_one' => t('Template One'),\n 'ca_newsletter_node_template_two' => t('Template Two'),\n 'ca_newsletter_node_template_three' => t('Template Three'),\n ),\n '#default_value' => variable_get('ca_newsletter_node_template', 'ca_newsletter_node_template_one'),\n '#required' => TRUE,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n '#submit' => array('ca_newsletter_admin_settings_form_submit'),\n );\n\n return $form;\n}",
"function mc_show_event_editing( $status, $args ) {\n\t$return = $status;\n\tif ( 'toplevel_page_my-calendar' == $args->base ) {\n\t\t$input_options = get_user_meta( get_current_user_id(), 'mc_show_on_page', true );\n\t\t$settings_options = get_option( 'mc_input_options' );\n\t\tif ( ! is_array( $input_options ) ) {\n\t\t\t$input_options = $settings_options;\n\t\t}\n\n\t\t// cannot change these keys.\n\t\t$input_labels = array(\n\t\t\t'event_location_dropdown' => __( 'Event Location Dropdown Menu', 'my-calendar' ),\n\t\t\t'event_short' => __( 'Event Short Description field', 'my-calendar' ),\n\t\t\t'event_desc' => __( 'Event Description Field', 'my-calendar' ),\n\t\t\t'event_category' => __( 'Event Category field', 'my-calendar' ),\n\t\t\t'event_image' => __( 'Event Image field', 'my-calendar' ),\n\t\t\t'event_link' => __( 'Event Link field', 'my-calendar' ),\n\t\t\t'event_recurs' => __( 'Event Recurrence Options', 'my-calendar' ),\n\t\t\t'event_open' => __( 'Event Registration options', 'my-calendar' ),\n\t\t\t'event_location' => __( 'Event Location fields', 'my-calendar' ),\n\t\t\t'event_specials' => __( 'Set Special Scheduling options', 'my-calendar' ),\n\t\t\t'event_access' => __( 'Event Accessibility', 'my-calendar' ),\n\t\t\t'event_host' => __( 'Event Host', 'my-calendar' ),\n\t\t);\n\n\t\t$output = '';\n\t\tforeach ( $input_options as $key => $value ) {\n\t\t\t$checked = ( 'on' == $value ) ? \"checked='checked'\" : '';\n\t\t\t$allowed = ( isset( $settings_options[ $key ] ) && 'on' == $settings_options[ $key ] ) ? true : false;\n\t\t\tif ( ! ( current_user_can( 'manage_options' ) && 'true' == get_option( 'mc_input_options_administrators' ) ) && ! $allowed ) {\n\t\t\t\t// don't display options if this user can't use them.\n\t\t\t\t$output .= \"<input type='hidden' name='mc_show_on_page[$key]' value='off' />\";\n\t\t\t} else {\n\t\t\t\tif ( isset( $input_labels[ $key ] ) ) {\n\t\t\t\t\t// don't show if label doesn't exist. That means I removed the option.\n\t\t\t\t\t$output .= \"<label for='mci_$key'><input type='checkbox' id='mci_$key' name='mc_show_on_page[$key]' value='on' $checked /> $input_labels[$key]</label>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$button = get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );\n\t\t$return .= '\n\t<fieldset>\n\t<legend>' . __( 'Event editing fields to show', 'my-calendar' ) . \"</legend>\n\t<div class='metabox-prefs'>\n\t\t<div><input type='hidden' name='wp_screen_options[option]' value='mc_show_on_page' /></div>\n\t\t<div><input type='hidden' name='wp_screen_options[value]' value='yes' /></div>\n\t\t$output\n\t</div>\n\t</fieldset>\n\t<br class='clear'>\n\t$button\";\n\t}\n\n\treturn $return;\n}",
"public function postLicenseSettingsPage() {\n $data = $_POST;\n $success = true;\n\n // If the user wants to deactivate the plugin on current domain\n if(isset($data[\"deactivate\"]) && $data[\"deactivate\"]) {\n $success = $this->deactivate(true);\n if($success) {\n deactivate_plugins(plugin_basename($this->pluginFilePath), true);\n wp_redirect(admin_url(\"plugins.php\"));\n return;\n }\n } else {\n\n // Save settings\n if (isset($data[$this->getLicenseKeyOptionName()])) {\n update_option($this->getLicenseKeyOptionName(), $data[$this->getLicenseKeyOptionName()], true);\n }\n\n// if(isset($data[$this->getLicenseEmailOptionName()])) {\n// update_option($this->getLicenseEmailOptionName(), $data[$this->getLicenseEmailOptionName()], true);\n// }\n\n $this->validate();\n $this->scheduleEvents();\n }\n\n // Redirect back\n $url = admin_url(sprintf('options-general.php?page=%s&success=%s', $this->getPageSlug(), $success ? 'true' : 'false'));\n wp_redirect($url);\n }",
"function createSettingsPage() {\r\n\r\n\t\tif (!current_user_can('manage_options'))\r\n\t\t\twp_die(__('Cheatin’ uh?', self::$plugin_textdom));\r\n\t\t\r\n\t\tif ($this->checkInternalContentPage()) {\r\n\t\t\t$message = __('Internal content page is missing and has been recreated', self::$plugin_textdom);\r\n\t\t} else {\r\n\t\t\t$message = '';\t\r\n\t\t}\r\n\t\t\t\r\n\t\t?>\r\n\t\t<?php echo $this->pageStart(__('Thickbox Announcement Settings', self::$plugin_textdom), $message); ?>\r\n\t\t\t<?php echo $this->pagePostContainerStart(75); ?>\r\n\t\t\t\r\n\t\t\t<form name=\"tb_post\" method=\"post\" action=\"options.php\">\r\n\t\t\t<?php wp_nonce_field('update-options'); ?>\r\n\t\t\r\n\t\t\t<?php echo $this->pagePostBoxStart('pb_global', __('Global Setting', self::$plugin_textdom)); ?>\r\n\t\t\t\t<table class=\"fs-table\">\r\n\t\t\t\t<tr><th colspan=\"2\"><input type=\"checkbox\" id=\"tb_active\" name=\"tb_active\" value=\"1\" <?php echo ($this->isAnnouncementActive() ? 'checked=\"checked\" ' : ''); ?>/> <label for=\"tb_active\"><?php _e('Announcements active', self::$plugin_textdom); ?></label></th></tr>\r\n\t\t\t\t<tr><th class=\"label\"><?php _e('Valid from', self::$plugin_textdom); ?></th><td>\r\n\t\t\t\t\t<input type=\"text\"\r\n\t\t\t\t\t id=\"datepicker_from\" \r\n\t\t\t\t\t name=\"tb_valid_from\"\r\n\t\t\t\t\t value=\"<?php echo $this->getValidFromDate(); ?>\" \r\n\t\t\t\t\t readonly=\"readonly\" />\r\n\t\t\t\t\t<a href=\"#\" class=\"fs-dp-clear\" alt=\"<?php _e('Clear date', self::$plugin_textdom); ?>\" onClick=\"document.tb_post.tb_valid_from.value = ''; return false;\"><span><?php _e('Clear date', self::$plugin_textdom); ?></span></a>\r\n\t\t\t\t<br /><small><?php _e('Click in the input field to choose a date. Leave empty if no date vailidity needed.', self::$plugin_textdom); ?></small></td></tr>\r\n\t\t\t\t<tr><th class=\"label\"><?php _e('Valid to', self::$plugin_textdom); ?></th><td>\r\n\t\t\t\t\t<input type=\"text\" \r\n\t\t\t\t\t id=\"datepicker_to\" \r\n\t\t\t\t\t name=\"tb_valid_to\" \r\n\t\t\t\t\t value=\"<?php echo $this->getValidToDate(); ?>\" \r\n\t\t\t\t\t readonly=\"readonly\" />\r\n\t\t\t\t\t<a href=\"#\" class=\"fs-dp-clear\" alt=\"<?php _e('Clear date', self::$plugin_textdom); ?>\" onClick=\"document.tb_post.tb_valid_to.value = ''; return false;\"><span><?php _e('Clear date', self::$plugin_textdom); ?></span></a>\r\n\t\t\t\t<br /><small><?php _e('Click in the input field to choose a date. Leave empty if no date vailidity needed.', self::$plugin_textdom); ?></small></td></tr>\r\n\t\t\t\t</table>\r\n\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\r\n\t\t\t<?php echo $this->pagePostBoxStart('pb-announcement', __('Announcement Behaviour', self::$plugin_textdom)); ?>\r\n\t\t\t\t<table class=\"fs-table\">\r\n\t\t\t\t<tr><th class=\"label\"><?php _e('Announcement Settings', self::$plugin_textdom); ?></th>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<?php _e('Show when user enters', self::$plugin_textdom); ?> <select name=\"tb_show_page\">\r\n\t\t\t\t\t<!--<option value=\"1\" <?php echo(get_option('tb_show_page') == 1 ? 'selected=\"selected\" ' : ''); ?>><?php _e('Homepage', self::$plugin_textdom); ?></option>//-->\r\n\t\t\t\t\t<option value=\"2\" <?php echo(get_option('tb_show_page') == 2 ? 'selected=\"selected\" ' : ''); ?>><?php _e('Any page', self::$plugin_textdom); ?></option></select>\r\n\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr><th> </th>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<?php _e('Show announcement', self::$plugin_textdom); ?> <select name=\"tb_show_type\" onClick=\"toogleCondOptions('tb_freq','tb_show_type','2')\">\r\n\t\t\t\t\t<option value=\"1\" <?php echo (get_option('tb_show_type') == 1 ? 'selected=\"selected\" ' : ''); ?>><?php _e('once', self::$plugin_textdom); ?></option>\r\n\t\t\t\t\t<option value=\"3\" <?php echo (get_option('tb_show_type') == 3 ? 'selected=\"selected\" ' : ''); ?>><?php _e('every time the user enters the site', self::$plugin_textdom); ?></option>\r\n\t\t\t\t\t<option value=\"2\" <?php echo (get_option('tb_show_type') == 2 ? 'selected=\"selected\" ' : ''); ?>><?php _e('periodically', self::$plugin_textdom); ?></option></select><br /> \r\n\t\t\t\t\t<small><?php _e('if you choose \"once\" and you setup a new announcement, which has to be displayed again for every user, please', self::$plugin_textdom); ?> \r\n\t\t\t\t\t<a href=\"javascript: regenerate_cookie();\"><?php _e('reset the cookie string', self::$plugin_textdom); ?></a>.</small>\r\n\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr id=\"tb_freq\" style=\"display: <?php echo (get_option('tb_show_type') == 2 ? 'table-row' : 'none'); ?>;\">\r\n\t\t\t\t<td> </td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<?php _e('Show announcement every', self::$plugin_textdom); ?> <input type=\"text\" name=\"tb_show_freq\" value=\"<?php echo get_option('tb_show_freq');?>\" size=\"2\" /> <?php _e('day(s)', self::$plugin_textdom); ?>\r\n\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\r\n\t\t\t<?php echo $this->pagePostBoxStart('pb-tbset', __('Thickbox Settings', self::$plugin_textdom)); ?>\r\n\t\t\t\t<table class=\"fs-table\">\r\n\t\t\t\t<tr><th class=\"label\"><?php _e('Title', self::$plugin_textdom); ?></th><td><input type=\"text\" id=\"tb_title\" name=\"tb_title\" value=\"<?php echo $this->getAnnouncementTitle(); ?>\" size=\"60\" /></td></tr>\r\n\t\t\t\t<tr><th><?php _e('Width', self::$plugin_textdom); ?></th><td><input type=\"text\" id=\"tb_width\" name=\"tb_width\" value=\"<?php echo $this->getAnnouncementWidth(); ?>\" size=\"6\" /> px</td></tr>\r\n\t\t\t\t<tr><th><?php _e('Height', self::$plugin_textdom); ?></th><td><input type=\"text\" id=\"tb_height\" name=\"tb_height\" value=\"<?php echo $this->getAnnouncementHeight(); ?>\" size=\"6\" /> px</td></tr>\r\n\t\t\t\t<tr><th> </th><td>\r\n\t\t\t\t<input type=\"checkbox\" id=\"tb_modal\" name=\"tb_modal\" value=\"1\" <?php echo ($this->isAnnouncementModal() ? 'checked=\"checked\" ' : ''); ?>/> <label for=\"tb_modal\"><?php _e('Modal', self::$plugin_textdom); ?></label><br />\r\n\t\t\t\t<small><?php _e('Close button/link needed and no title is displayed!', self::$plugin_textdom); ?></small></td></tr>\r\n\t\t\t\t</table>\r\n\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\r\n\t\t\t<?php echo $this->pagePostBoxStart('pb-content', __('Announcement Content', self::$plugin_textdom)); ?>\r\n\t\t\t\t<table class=\"fs-table\">\r\n\t\t\t\t<tr><th class=\"label\"><?php _e('Content', self::$plugin_textdom); ?></th><td>\r\n\t\t\t\t<input type=\"radio\" id=\"tb_content_type_1\" name=\"tb_content_type\" value=\"1\" <?php echo (get_option('tb_content_type') == 1 ? 'checked=\"checked\" ' : ''); ?>onClick=\"toogleCondOptions('tb_cobj,tb_clbl','tb_content_type','2')\"/> \r\n\t\t\t\t<label for=\"tb_content_type_1\"><?php _e('External Resource', self::$plugin_textdom); ?></label> \r\n\t\t\t\t<input type=\"text\" id=\"tb_ext_url\" name=\"tb_ext_url\" value=\"<?php echo get_option('tb_ext_url'); ?>\" size=\"60\" /></td></tr>\r\n\t\t\t\t<tr><th> </th><td>\r\n\t\t\t\t<input type=\"radio\" id=\"tb_content_type_2\" name=\"tb_content_type\" value=\"2\" <?php echo (get_option('tb_content_type') == 2 ? 'checked=\"checked\" ' : ''); ?>onClick=\"toogleCondOptions('tb_cobj,tb_clbl','tb_content_type','2')\"/> \r\n\t\t\t\t<label for=\"tb_content_type_2\"><?php _e('Inline Content', self::$plugin_textdom); ?> <a href=\"<?php echo get_option('siteurl').'/wp-admin/page.php?action=edit&post='.$this->getAnnouncementPostId(); ?>\"><?php _e('Edit now', self::$plugin_textdom); ?></a></label>\r\n\t\t\t\t</td>\r\n\t\t\t\t<tr id=\"tb_cobj\" style=\"display: <?php echo (get_option('tb_content_type') == 2 ? 'table-row' : 'none'); ?>;\">\r\n\t\t\t\t<th class=\"label\"><?php _e('Close object', self::$plugin_textdom); ?></th> \r\n\t\t\t\t<td>\r\n\t\t\t\t<input type=\"radio\" id=\"tb_close_type1\" name=\"tb_close_type\" value=\"1\" <?php echo (get_option('tb_close_type') == 1 ? 'checked=\"checked\" ' : ''); ?>/> \r\n\t\t\t\t<label for=\"tb_close_type1\"><?php _e('None', self::$plugin_textdom); ?></label><br />\r\n\t\t\t\t<input type=\"radio\" id=\"tb_close_type2\" name=\"tb_close_type\" value=\"2\" <?php echo (get_option('tb_close_type') == 2 ? 'checked=\"checked\" ' : ''); ?>/> \r\n\t\t\t\t<label for=\"tb_close_type2\"><?php _e('Button', self::$plugin_textdom); ?></label><br />\r\n\t\t\t\t<input type=\"radio\" id=\"tb_close_type3\" name=\"tb_close_type\" value=\"3\" <?php echo (get_option('tb_close_type') == 3 ? 'checked=\"checked\" ' : ''); ?>/> \r\n\t\t\t\t<label for=\"tb_close_type3\"><?php _e('Link', self::$plugin_textdom); ?></label>\r\n\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr id=\"tb_clbl\" style=\"display: <?php echo (get_option('tb_content_type') == 2 ? 'table-row' : 'none'); ?>;\">\r\n\t\t\t\t<th><?php _e('Label', self::$plugin_textdom); ?></th>\r\n\t\t\t\t<td>\r\n\t\t\t\t<input type=\"text\" id=\"tb_close_lbl\" name=\"tb_close_lbl\" value=\"<?php echo get_option('tb_close_lbl'); ?>\" size=\"20\" />\r\n\t\t\t\t</td></tr>\r\n\t\t\t\t</table>\r\n\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\t\t\t\t\t\t\t\r\n\t\t\t<p class=\"submit\">\r\n\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes', self::$plugin_textdom); ?>\" /> \r\n\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php _e('Preview', self::$plugin_textdom); ?>\" onClick=\"tb_preview()\" /> \r\n\t\t\t</p>\r\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\r\n\t\t\t<input type=\"hidden\" name=\"tb_action\" value=\"tb_save_options\" />\r\n\t\t\t<?php echo '<input type=\"hidden\" name=\"page_options\" value=\"';\r\n\t\t\tforeach(self::$plugin_options as $k => $v) {\r\n\t\t\t\tif ($k != 'tb_postid') {\r\n\t\t\t\t\techo $k.',';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo '\" />'; ?>\r\n\t\t\t</form>\r\n\t\t\t<?php echo $this->pagePostContainerEnd(); ?>\r\n\t\t\t\r\n\t\t\t<?php echo $this->pagePostContainerStart(20); ?>\t\t\t\t\r\n\t\t\t\t<?php echo $this->pagePostBoxStart('pb_about', __('About', self::$plugin_textdom)); ?>\r\n\t\t\t\t\t<p><?php _e('For further information please visit the', self::$plugin_textdom); ?> <a href=\"http://www.faebusoft.ch/downloads/thickbox-announcement\"><?php _e('plugin homepage', self::$plugin_textdom);?></a>.<br /> \r\n\t\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t<?php echo $this->pagePostBoxStart('pb_donate', __('Donation', self::$plugin_textdom)); ?>\r\n\t\t\t\t\t<p><?php _e('If you like my work please consider a small donation', self::$plugin_textdom); ?></p>\r\n\t\t\t\t\t<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\r\n\t\t\t\t\t<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\r\n\t\t\t\t\t<input type=\"hidden\" name=\"encrypted\" value=\"-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCeQ4GM0edKR+bicos+NE4gcpZJIKMZFcbWBQk64bR+T5aLcka0oHZCyP99k9AqqYUQF0dQHmPchTbDw1u6Gc2g7vO46YGnOQHdi2Z+73LP0btV1sLo4ukqx7YK8P8zuN0g4IdVmHFwSuv7f7U2vK4LLfhplxLqS6INz/VJpY5z8TELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIXvrD6twqMxiAgYBBtWm5l8RwJ4x39BfZSjg6tTxdbjrIK3S9xzMBFg09Oj9BYFma2ZV4RRa27SXsZAn5v/5zJnHrV/RvKa4a5V/QECgjt4R20Dx+ZDrCs+p5ZymP8JppOGBp3pjf146FGARkRTss1XzsUisVYlNkkpaGWiBn7+cv0//lbhktlGg1yqCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA5MDYxODExMzk1MFowIwYJKoZIhvcNAQkEMRYEFMNbCeEAMgC/H4fJW0m+DJKuB7BVMA0GCSqGSIb3DQEBAQUABIGAhjv3z6ikhGh6s3J+bd0FB8pkJLY1z9I4wn45XhZOnIEOrSZOlwr2LME3CoTx0t4h4M2q+AFA1KS48ohnq3LNRI+W8n/9tKvjsdRZ6JxT/nEW+GqUG6lw8ptnBmYcS46AdacgoSC4PWiWYFOLvNdafxA/fuyzrI/lVUTu+wiiZL4=-----END PKCS7-----\">\r\n\t\t\t\t\t<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\r\n\t\t\t\t\t<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/de_DE/i/scr/pixel.gif\" width=\"1\" height=\"1\">\r\n\t\t\t\t\t</form>\r\n\t\t\t\t<?php echo $this->pagePostBoxEnd(); ?>\r\n\t\t\t<?php echo $this->pagePostContainerEnd(); ?>\r\n\t\t<?php echo $this->pageEnd(); ?>\r\n\r\n\t\t<?php\r\n\t}",
"public function settings() {\n\t\t\tdo_action( 'wpsf_before_settings_' . $this->option_group );\n\t\t\t?>\n <form action=\"options.php\" method=\"post\" novalidate>\n\t\t\t\t<?php do_action( 'wpsf_before_settings_fields_' . $this->option_group ); ?>\n\t\t\t\t<?php settings_fields( $this->option_group ); ?>\n\n\t\t\t\t<?php do_action( 'wpsf_do_settings_sections_' . $this->option_group ); ?>\n\n\t\t\t\t<?php if ( apply_filters( 'wpsf_show_save_changes_button_' . $this->option_group, true ) ) { ?>\n <p class=\"submit\">\n <input type=\"submit\" class=\"button-primary\" value=\"<?php _e( 'Save Changes' ); ?>\"/>\n </p>\n\t\t\t\t<?php } ?>\n </form>\n\t\t\t<?php\n\t\t\tdo_action( 'wpsf_after_settings_' . $this->option_group );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the maximum number of event listeners for each event | private function setMaxEventListeners($maxEventListeners) {
if (Number::isNegative($maxEventListeners) || $maxEventListeners === 0) {
throw new ZiboException('Provided maximum of events is zero or negative');
}
$this->maxEventListeners = $maxEventListeners;
$this->defaultWeight = (int) floor($maxEventListeners / 2);
} | [
"public function setMaxCount(){ \n Stats::instance()->setMax($this->count());\n }",
"public function setMaxLimit($max) {\n $this->max = $max;\n }",
"public function setMaxAttendees($max): void {\n\t\tif (!empty($max) && !is_numeric($max)) {\n\t\t\t$max = null;\n\t\t}\n\t\t\n\t\t$this->max_attendees = $max;\n\t}",
"public function setMaxLimit($max)\n {\n $this->max = $max;\n }",
"public function & SetMaxCount ($maxCount);",
"function setMaxfiles($num) {\n $this->_options['maxfiles'] = $num;\n }",
"public function setMaxConnections(int $maxConnections)\n {\n $this->maxConnections = $maxConnections;\n }",
"public function getNumListeners();",
"public function set_max_queue($count){\r\n\t\t\t$this->options['file_queue_limit']=$count;\r\n\t\t}",
"function setMax($value) { $this->_max=$value; }",
"public function setMaxOpenHandles($maxOpenHandles) {}",
"public function getMaxEvents()\n {\n return $this->maxEvents;\n }",
"public function set_max($max)\n {\n $this->max = $max;\n }",
"function eio_set_max_idle($nthreads)\n{\n}",
"public function setMaxThreads($maxThreads)\n {\n $this->maxThreads = floor(abs($maxThreads));\n }",
"public function set_max(int $size) {\n\t\t$this->m_max = $size;\n\t}",
"public function set_max_checked_feeds($max = 10)\n {\n }",
"function setMiterLimit($limit){}",
"public function setLimit($limit = 5);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method: store() Purpose: Attempts to store a newly uploaded document in the database. If the object validates successfully, the request object's data is used to create a new user in the database and the user is redirected to the success page. Notes: See notes above regarding type hinted request object. | public function store(CreateDocumentRequest $request)
{
try
{
$document= new UserDocument;
$document->user_id=Auth::id();
$document->name=$request->input('name');
$document->type_id=$request->input('type')+1;
$document->expiration_date=date('Y-m-d',strtotime($request->input('expiration_date')));
$document->filename=$request->file('document_image')->store('images');
$document->comment=$request->input('comment');
$document->save();
return redirect('documents');
}
catch(Exception $exception)
{
//Log error and route to errors page
}
} | [
"public function store()\n {\n // Save post data in $volunteerJob var\n if(!(int)$_POST['end_year']){\n $_POST['end_year'] = NULL;\n }\n $volunteerJob = $_POST;\n\n // Set created_by ID and set the date of creation\n $volunteerJob['user_id'] = Helper::getUserIdFromSession();\n $volunteerJob['created_by'] = Helper::getUserIdFromSession();\n $volunteerJob['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n VolunteerJobModel::load()->store($volunteerJob);\n \n // Return to the user-overview \n $userId = $volunteerJob['user_id'];\n header(\"Location: /volunteerjob\");\n }",
"public function store(CreateDocumentMetaRequest $request)\n {\n $input = $request->all();\n\n if ($input['category_doc_meta_id'] == 0) {\n Flash::error(__('messages.document_metas_no_category'));\n return back()->withInput();\n }\n\n $input['user_id'] = Auth::user()->id;\n\n $this->documentMetaRepository->create($input);\n\n Flash::success(__('messages.created'));\n\n return redirect(route('admin.documentMetas.index'));\n }",
"public function store() {\n\t\t\n\t\t$user = $this->user->store(\\Request::all());\n\n\t\tif ($user === false) return \\Response::json(['message' => 'Sorry, something went wrong and your details could not be saved. We are working on it.', 404]);\n\n\t\treturn \\Response::json($user, 200);\n\n\t}",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Documentotipo::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tDocumentotipo::create($data);\n\n\t\treturn Redirect::route('documentotipos.index');\n\t}",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Upload::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tUpload::create($data);\n\n\t\treturn Redirect::route('uploads.index');\n\t}",
"public function store()\n {\n // Save post data in $job var\n if(!(int)$_POST['end_year']){\n $_POST['end_year'] = NULL;\n }\n $job = $_POST;\n\n // Set created_by ID and set the date of creation\n $job['user_id'] = Helper::getUserIdFromSession();\n $job['created_by'] = Helper::getUserIdFromSession();\n $job['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n JobModel::load()->store($job);\n \n // Return to the job-overview\n header(\"Location: /job\");\n }",
"public function store()\n {\n $user = new User;\n\n return $this->saveUser($user);\n }",
"public function store(CreateDocumentItemRequest $request)\n {\n $input = $request->all();\n\n $documentItem = $this->documentItemRepository->create($input);\n\n Flash::success(Lang::get('validation.save_success'));\n\n return redirect(route('documentItems.index'));\n }",
"public function store(CreateDocumentTypeRequest $request)\n {\n $input = $request->all();\n\n $documentType = $this->documentTypeRepository->create($input);\n\n Flash::success(Lang::get('validation.save_success'));\n\n return redirect(route('documentTypes.index'));\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Review::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn $this->getFailValidationResponse($validator);\n\t\t}\n\n\t\tReview::create($data);\n\t\treturn $this->getSuccessResponse($data,\"Review Successfully created!\");\n\t}",
"public function store(CreatePublishuserRequest $request)\n\t{\n\t \n\t\tPublishuser::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.publishuser.index');\n\t}",
"public function save()\n {\n // Get document type\n $type = $this->getType();\n\n // Ensure all requirements are checked, otherwise bail out with a\n // runtime exception.\n if ( $this->checkRequirements() !== true )\n {\n throw new phpillowRuntimeException(\n 'Requirements not checked before storing the document.'\n );\n }\n\n // Check if we need to store the stuff at all\n if ( ( $this->modified === false ) &&\n ( $this->newDocument !== true ) )\n {\n return false;\n }\n\n // Generate a new ID, if this is a new document, otherwise reuse the\n // existing document ID.\n if ( $this->newDocument === true )\n {\n $this->storage->_id = $this->getDocumentId( $type, $this->generateId() );\n }\n\n // Do not send an attachment array, if there aren't any attachments\n if ( !isset( $this->storage->_attachments ) ||\n !count( $this->storage->_attachments ) )\n {\n unset( $this->storage->_attachments );\n }\n\n // If the document ID is null, the server should autogenerate some ID,\n // but for this we need to use a different request method.\n $db = phpillowConnection::getInstance();\n if ( $this->storage->_id === null )\n {\n // Store document in database\n unset( $this->storage->_id );\n $response = $db->post(\n phpillowConnection::getDatabase(),\n json_encode( $this->storage )\n );\n }\n else\n {\n // Store document in database\n $response = $db->put(\n phpillowConnection::getDatabase() . urlencode( $this->_id ),\n json_encode( $this->storage )\n );\n }\n\n return $this->storage->_id = $response->id;\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 store()\n\t{\n\t\t$input = array_add(Input::get(), 'userId', Auth::id());\n\t\t$input = array_add($input, 'condoId', json_decode(Session::get('app.condo')[0])->id);\n\t\t$input = array_add($input, 'batchId', Str::random(20));\n\t\t$this->ticketRegistrationValidation->validate( Input::all() );\n\t\t$lastTicketId = $this->execute(TicketRegisterCommand::class, $input);\n\t\tApp::make('HelperController')->uploadFileFinalize($lastTicketId);\n\t\treturn $this->sendJsonMessage('success',200);\n\t}",
"public function store()\n {\n $input = request()->all();\n\n $tpDocumentIdent = TpDocumentIdent::create($input);\n\n Flash::success('Documento Identidad guardado exitosamente.');\n\n return redirect(route('tp-documentos-identidad.index'));\n }",
"public function store()\n {\n /* Check if logged user is authorized to create resources */\n $this->authorize('create', [$this->model]);\n\n $this->request->validate($this->storeValidations());\n\n DB::transaction(function () {\n\n /** Create a new resource */\n $resource = Model::create([\n 'user' => Input::get('user'),\n 'name' => Input::get('name'),\n 'email' => Input::get('email'),\n 'status' => Input::get('status'),\n 'password' => bcrypt(config('user.default_password', 'secret')),\n ]);\n\n /* Check if permissions are being set */\n if (Input::get('roles') != null) {\n /** Synchronize both tables through pivot table */\n $resource->roles()->sync(Input::get('roles'));\n }\n }, 5);\n\n /* Redirect to resource index page */\n return redirect()\n ->route($this->name . '.index')\n ->with('success', $this->name . '.resource-created');\n }",
"public function store(){\n // Maybe later it will contain more logic\n $this->authorize('create', Contact::class);\n // This lines would work normally but since we are now using api_tokens and Model Relations,\n // it will no longer work\n // Contact::create($contact);\n \n $contact = $this->validateData();\n // request contains api_token of user so we use it to fetch the user, then traverse a\n // model relation to get associated contact model and then create a new contact for that user\n // the user_id is automatically set to the id of user creating it\n // create method returns the data when saved in a variable so $contact is overwritten\n $contact = request()->user()->contacts()->create($contact);\n\n // return $contact attach with a response code of 201. For some reason this requires brackets to chain\n return (new ContactResource($contact))->response()->setStatusCode(Response::HTTP_CREATED);\n }",
"public function store (Request $request)\n {\n try {\n\n $data = $this->getData ($request);\n\n Inviteduser::create ($data);\n\n return redirect ()->route ('invitedusers.inviteduser.index')\n ->with ('success_message', 'Inviteduser was successfully added!');\n\n } catch (Exception $exception) {\n\n return back ()->withInput ()\n ->withErrors (['unexpected_error' => 'Unexpected error occurred while trying to process your request!']);\n }\n }",
"public function storeAction() {\n // if the page has no post and token is invalid\n // then redirect to 404\n if (empty($_POST) || $this->validateToken() === false) {\n $this->show404();\n return;\n }\n // validate other contacts data\n $contactDetails = $this->validateInput();\n\n $contact_obj = new Contact();\n // insert contact in DB\n $result = $contact_obj->addNewContact($contactDetails);\n\n // show message depends on result from DB\n if ($result == true) {\n $_SESSION[\"success_message\"] = \"Contact added successfully\";\n } else {\n $_SESSION[\"error_message\"] = \"Failed to add Contact\";\n }\n\n // after saving the new contact\n // redirect to show all contacts\n header(\"Location: /contacts\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field int32 groupInvitationUrlExpiration = 7; | public function setGroupInvitationUrlExpiration($var)
{
GPBUtil::checkInt32($var);
$this->groupInvitationUrlExpiration = $var;
return $this;
} | [
"public function getGroupInvitationUrlExpiration()\n {\n return $this->groupInvitationUrlExpiration;\n }",
"public function getResetPasswordLinkExpirationPeriod()\n {\n return (int) Mage::getConfig()->getNode(self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD);\n }",
"public function getResetPasswordLinkExpirationPeriod()\n {\n return (int) Mage::getConfig()->getNode(self::XML_PATH_ADMIN_RESET_PASSWORD_LINK_EXPIRATION_PERIOD);\n }",
"public function getPublicKeyExpiration() : int\n {\n return $this->expires_at;\n }",
"public function getExpirationPeriod(): int;",
"public static function getClaimLinkExpire(){\n\t\t//old setting recipientGuidValidFor is set to 1 day on production\n\t\t//new setting reminderFreq determin when the first reminder email goes out, \n\t\t//we don't want the claim link expired in this reminder email.\n\t\t$expire = date(\"Y-m-d H:i:s\", strtotime(settingModel::getSetting('recipientGuid', 'recipientGuidValidFor')));\n\t\t$freq = settingModel::getSetting('reminderEmail', 'reminderFreq');\n\t\t//give extra two hours, in case reminder email delayed. \n\t\t$freq = $freq +2;\n\t\t//return the latest date, just in case the reminder email frequency is set too high, i.e. on qa env is 1 hour. \n\t\t$expire = max($expire,date(\"Y-m-d H:i:s\", strtotime(\"+$freq hour\")));\n\t\treturn $expire;\n\t}",
"public function getRequestedExpiration()\n {\n return $this->requested_expiration;\n }",
"public function getInvitationValidity()\n {\n\n return Mage::getStoreConfig('auguria_sponsorship/invitation/sponsor_invitation_validity');\n }",
"public function getExpiration(): int\n {\n return $this->expire;\n }",
"public function getExpirationDays()\n {\n return 14;\n }",
"public function rateLimitExpiration()\n {\n return $this->rateExpiration;\n }",
"public function getExpiration()\n { \n return $this->expiration;\n }",
"public function getExpirationMs()\n {\n return $this->expiration_ms;\n }",
"function getLoginIDExpiration()\n {\n return $this->settings[TBL_SETTINGS_LOGIN_ID_EXP_INTERVAL];\n }",
"private static function PSD2expiration()\n {\n return now()->addDays(90)->subMinutes(AccessToken::TTL);\n }",
"public function getUriExpirationTime()\n {\n return $this->uri_expiration_time;\n }",
"public function getUriExpirationTime()\n {\n return $this->uriExpirationTime;\n }",
"protected function getEmailNotificationsDeduplicationTime(): int\n {\n return 60;\n }",
"public function getMembershipDefaultExpiration()\n {\n return (new \\DateTime('now'))->modify('+1 year');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as invoiceDocumentReference ASBIE Billing Reference. Invoice_ Document Reference. Document Reference A reference to an invoice. 0..1 Billing Reference Invoice Document Reference Document Reference Document Reference | public function getInvoiceDocumentReference()
{
return $this->invoiceDocumentReference;
} | [
"public function getInvoiceRef()\n {\n\n return $this->invoice_ref;\n }",
"public function getInvoice_reference()\n {\n return $this->invoice_reference;\n }",
"public function getTInvoiceReference()\r\n {\r\n return $this->tInvoiceReference;\r\n }",
"function get_ref(){\n //\n //Get the first recrord of the detailed satement of this record's invoice item \n $rec = $this->items['invoice']->statements['detailed']->results[0];\n //\n //Return the two pieces of of data: document type and its reference number\n return \"{$rec['id']}-{$rec['year']}-{$rec['month']}\";\n }",
"public function getInvoiceReference(){\n return $this->getParameter('invoice_reference');\n }",
"public function getSelfBilledInvoiceDocumentReference()\n {\n return $this->selfBilledInvoiceDocumentReference;\n }",
"public function getInvoiceReference()\n {\n return $this->getParameter('invoiceReference');\n }",
"public function getDocumentReference()\n {\n return $this->DocumentReference;\n }",
"public function getDocumentReference()\n {\n return $this->documentReference;\n }",
"public function getContractDocumentReference()\n {\n return $this->contractDocumentReference;\n }",
"public function getReturnRefInvoice()\n {\n return $this->hasOne(ApInv::className(), ['invoice_id' => 'return_ref_invoice_id']);\n }",
"public function getInvoiceItemReference()\n {\n return $this->getParameter('invoiceItemReference');\n }",
"public function getInvoice()\n {\n return $this->invoice;\n }",
"public function setInvoiceRef($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->invoice_ref !== $v) {\n $this->invoice_ref = $v;\n $this->modifiedColumns[CreditNoteTableMap::INVOICE_REF] = true;\n }\n\n\n return $this;\n }",
"public function getInvoice() {\n return $this->invoice;\n }",
"public function getContractReferencedDocument()\n {\n return $this->contractReferencedDocument;\n }",
"public function getInvoiceObject(): Invoice\n {\n return $this->invoiceObject;\n }",
"public function getIdentityDocumentReference()\n {\n return $this->identityDocumentReference;\n }",
"public function getInvoiceReferences()\n {\n if (isset($this->data->invoicenum)) {\n // PHP SOAP parsing may mess up the field if only one invoice num is in the response\n // so we force it to return an array of string\n if (is_string($this->data->invoicenum)) {\n return array($this->data->invoicenum);\n }\n return $this->data->invoicenum;\n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the kie_uks_minum_air column Example usage: $query>filterByKieUksMinumAir(1234); // WHERE kie_uks_minum_air = 1234 $query>filterByKieUksMinumAir(array(12, 34)); // WHERE kie_uks_minum_air IN (12, 34) $query>filterByKieUksMinumAir(array('min' => 12)); // WHERE kie_uks_minum_air >= 12 $query>filterByKieUksMinumAir(array('max' => 12)); // WHERE kie_uks_minum_air | public function filterByKieUksMinumAir($kieUksMinumAir = null, $comparison = null)
{
if (is_array($kieUksMinumAir)) {
$useMinMax = false;
if (isset($kieUksMinumAir['min'])) {
$this->addUsingAlias(SanitasiPeer::KIE_UKS_MINUM_AIR, $kieUksMinumAir['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($kieUksMinumAir['max'])) {
$this->addUsingAlias(SanitasiPeer::KIE_UKS_MINUM_AIR, $kieUksMinumAir['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SanitasiPeer::KIE_UKS_MINUM_AIR, $kieUksMinumAir, $comparison);
} | [
"public function filterByKieSelasarMinumAir($kieSelasarMinumAir = null, $comparison = null)\n {\n if (is_array($kieSelasarMinumAir)) {\n $useMinMax = false;\n if (isset($kieSelasarMinumAir['min'])) {\n $this->addUsingAlias(SanitasiPeer::KIE_SELASAR_MINUM_AIR, $kieSelasarMinumAir['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kieSelasarMinumAir['max'])) {\n $this->addUsingAlias(SanitasiPeer::KIE_SELASAR_MINUM_AIR, $kieSelasarMinumAir['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SanitasiPeer::KIE_SELASAR_MINUM_AIR, $kieSelasarMinumAir, $comparison);\n }",
"public function filterByKieToiletMinumAir($kieToiletMinumAir = null, $comparison = null)\n {\n if (is_array($kieToiletMinumAir)) {\n $useMinMax = false;\n if (isset($kieToiletMinumAir['min'])) {\n $this->addUsingAlias(SanitasiPeer::KIE_TOILET_MINUM_AIR, $kieToiletMinumAir['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kieToiletMinumAir['max'])) {\n $this->addUsingAlias(SanitasiPeer::KIE_TOILET_MINUM_AIR, $kieToiletMinumAir['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SanitasiPeer::KIE_TOILET_MINUM_AIR, $kieToiletMinumAir, $comparison);\n }",
"public function filterByKetersediaanAir($ketersediaanAir = null, $comparison = null)\n {\n if (is_array($ketersediaanAir)) {\n $useMinMax = false;\n if (isset($ketersediaanAir['min'])) {\n $this->addUsingAlias(SanitasiPeer::KETERSEDIAAN_AIR, $ketersediaanAir['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($ketersediaanAir['max'])) {\n $this->addUsingAlias(SanitasiPeer::KETERSEDIAAN_AIR, $ketersediaanAir['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SanitasiPeer::KETERSEDIAAN_AIR, $ketersediaanAir, $comparison);\n }",
"public function filterByKkI($kkI = null, $comparison = null)\n {\n if (is_array($kkI)) {\n $useMinMax = false;\n if (isset($kkI['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_I, $kkI['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkI['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_I, $kkI['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_I, $kkI, $comparison);\n }",
"public function setKieUksMinumAir($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->kie_uks_minum_air !== $v) {\n $this->kie_uks_minum_air = $v;\n $this->modifiedColumns[] = SanitasiPeer::KIE_UKS_MINUM_AIR;\n }\n\n\n return $this;\n }",
"public function filterByMemprosesAir($memprosesAir = null, $comparison = null)\n {\n if (is_array($memprosesAir)) {\n $useMinMax = false;\n if (isset($memprosesAir['min'])) {\n $this->addUsingAlias(SanitasiPeer::MEMPROSES_AIR, $memprosesAir['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($memprosesAir['max'])) {\n $this->addUsingAlias(SanitasiPeer::MEMPROSES_AIR, $memprosesAir['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SanitasiPeer::MEMPROSES_AIR, $memprosesAir, $comparison);\n }",
"public function filterByTahunMasuk($tahunMasuk = null, $comparison = null)\n {\n if (is_array($tahunMasuk)) {\n $useMinMax = false;\n if (isset($tahunMasuk['min'])) {\n $this->addUsingAlias(AnakPeer::TAHUN_MASUK, $tahunMasuk['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($tahunMasuk['max'])) {\n $this->addUsingAlias(AnakPeer::TAHUN_MASUK, $tahunMasuk['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AnakPeer::TAHUN_MASUK, $tahunMasuk, $comparison);\n }",
"public function filterByKkO($kkO = null, $comparison = null)\n {\n if (is_array($kkO)) {\n $useMinMax = false;\n if (isset($kkO['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_O, $kkO['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkO['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_O, $kkO['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_O, $kkO, $comparison);\n }",
"public function filterByRaporKe($raporKe = null, $comparison = null)\n {\n if (is_array($raporKe)) {\n $useMinMax = false;\n if (isset($raporKe['min'])) {\n $this->addUsingAlias(NilaiRaporPeer::RAPOR_KE, $raporKe['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($raporKe['max'])) {\n $this->addUsingAlias(NilaiRaporPeer::RAPOR_KE, $raporKe['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(NilaiRaporPeer::RAPOR_KE, $raporKe, $comparison);\n }",
"public function filterByKkC1($kkC1 = null, $comparison = null)\n {\n if (is_array($kkC1)) {\n $useMinMax = false;\n if (isset($kkC1['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_C1, $kkC1['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkC1['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_C1, $kkC1['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_C1, $kkC1, $comparison);\n }",
"public function filterByKkP($kkP = null, $comparison = null)\n {\n if (is_array($kkP)) {\n $useMinMax = false;\n if (isset($kkP['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkP['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP, $comparison);\n }",
"public function filterByMataPelajaranKurikulum($mataPelajaranKurikulum, $comparison = null)\n {\n if ($mataPelajaranKurikulum instanceof MataPelajaranKurikulum) {\n return $this\n ->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $mataPelajaranKurikulum->getMataPelajaranId(), $comparison);\n } elseif ($mataPelajaranKurikulum instanceof PropelObjectCollection) {\n return $this\n ->useMataPelajaranKurikulumQuery()\n ->filterByPrimaryKeys($mataPelajaranKurikulum->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMataPelajaranKurikulum() only accepts arguments of type MataPelajaranKurikulum or PropelCollection');\n }\n }",
"public function filterByIusiSemestral($iusiSemestral = null, $comparison = null)\n {\n if (is_array($iusiSemestral)) {\n $useMinMax = false;\n if (isset($iusiSemestral['min'])) {\n $this->addUsingAlias(PropiedadPeer::IUSI_SEMESTRAL, $iusiSemestral['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($iusiSemestral['max'])) {\n $this->addUsingAlias(PropiedadPeer::IUSI_SEMESTRAL, $iusiSemestral['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PropiedadPeer::IUSI_SEMESTRAL, $iusiSemestral, $comparison);\n }",
"public function filterByKkJ($kkJ = null, $comparison = null)\n {\n if (is_array($kkJ)) {\n $useMinMax = false;\n if (isset($kkJ['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_J, $kkJ['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkJ['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_J, $kkJ['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_J, $kkJ, $comparison);\n }",
"public function filterByKkF($kkF = null, $comparison = null)\n {\n if (is_array($kkF)) {\n $useMinMax = false;\n if (isset($kkF['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_F, $kkF['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkF['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_F, $kkF['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_F, $kkF, $comparison);\n }",
"public function filterByTahunAkhir($tahunAkhir = null, $comparison = null)\n {\n if (is_array($tahunAkhir)) {\n $useMinMax = false;\n if (isset($tahunAkhir['min'])) {\n $this->addUsingAlias(BeasiswaPtkPeer::TAHUN_AKHIR, $tahunAkhir['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($tahunAkhir['max'])) {\n $this->addUsingAlias(BeasiswaPtkPeer::TAHUN_AKHIR, $tahunAkhir['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(BeasiswaPtkPeer::TAHUN_AKHIR, $tahunAkhir, $comparison);\n }",
"public function setKieToiletMinumAir($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->kie_toilet_minum_air !== $v) {\n $this->kie_toilet_minum_air = $v;\n $this->modifiedColumns[] = SanitasiPeer::KIE_TOILET_MINUM_AIR;\n }\n\n\n return $this;\n }",
"private function filterbyfuel ($query,Request $request){\n\n if (isset($request->search)) {\n $query->where('vehicle.vehicle_name', 'LIKE', \"%{$request->search}%\");\n \n }\n if (isset($request->type)) {\n $query->where(DB::raw(\"'fuel'\"), '=', $request->type);\n }\n\n if (isset($request->mincost)) {\n \n $query->where('fuel_entries.cost', '>' , $request->mincost);\n }\n if (isset($request->maxcost)) {\n $query->where('fuel_entries.cost', '<' , $request->maxcost);\n \n }\n if (isset($request->mindate)) {\n $query->whereDate('fuel_entries.entry_date', '>' , $request->mindate);\n \n }\n if (isset($request->maxdate)) {\n $query->whereDate('fuel_entries.entry_date', '<' , $request->maxdate);\n \n }\n\n }",
"public function filterByKilometraje($kilometraje = null, $comparison = null)\n {\n if (is_array($kilometraje)) {\n $useMinMax = false;\n if (isset($kilometraje['min'])) {\n $this->addUsingAlias(MantenimientoPeer::KILOMETRAJE, $kilometraje['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kilometraje['max'])) {\n $this->addUsingAlias(MantenimientoPeer::KILOMETRAJE, $kilometraje['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MantenimientoPeer::KILOMETRAJE, $kilometraje, $comparison);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a denyDescendant rule | public function denyDescendant($tagName)
{
return $this->addTargetedRule('denyDescendant', $tagName);
} | [
"public function allowDescendant($tagName)\n\t{\n\t\t$this->items['allowDescendant'][] = TagName::normalize($tagName);\n\t}",
"public function set_deny()\r\n\t{\r\n\t\t//$acl->deny($role, $resource.'_'.$website, $privilege,$own);\r\n\t}",
"public function testRoleDefaultAllowRuleWithPrivilegeDenyRule()\n {\n $this->_acl->addRole(new Zend_Acl_Role('guest'))\n ->addRole(new Zend_Acl_Role('staff'), 'guest')\n ->deny()\n ->allow('staff')\n ->deny('staff', null, ['privilege1', 'privilege2']);\n $this->assertFalse($this->_acl->isAllowed('staff', null, 'privilege1'));\n }",
"public function addDisallow($directories)\n {\n return $this->addRuleLine($directories, 'Disallow');\n }",
"public function testAclNegationOfInheritedRoles()\n {\n $this->specify(\n 'Negation of inherited roles does not return the correct result',\n function () {\n\n $acl = new PhTAclMem;\n $acl->setDefaultAction(PhAcl::DENY);\n\n $acl->addRole('Guests');\n $acl->addRole('Members', 'Guests');\n\n $acl->addResource('Login', array('help', 'index'));\n\n $acl->allow('Guests', 'Login', '*');\n $acl->deny('Guests', 'Login', array('help'));\n $acl->deny('Members', 'Login', array('index'));\n\n $actual = (bool)$acl->isAllowed('Members', 'Login', 'index');\n expect($actual)->false();\n\n $actual = (bool)$acl->isAllowed('Guests', 'Login', 'index');\n expect($actual)->true();\n\n $actual = (bool)$acl->isAllowed('Guests', 'Login', 'help');\n expect($actual)->false();\n }\n );\n }",
"public function testAclWildcardAllowDeny()\n {\n $this->specify(\n 'Acl\\Role added twice by key returns true',\n function () {\n $acl = new Memory();\n $acl->setDefaultAction(Acl::DENY);\n\n $aclRoles = [\n 'Admin' => new Role('Admin'),\n 'Users' => new Role('Users'),\n 'Guests' => new Role('Guests')\n ];\n\n $aclResources = [\n 'welcome' => ['index', 'about'],\n 'account' => ['index'],\n ];\n\n foreach ($aclRoles as $role => $object) {\n $acl->addRole($object);\n }\n\n foreach ($aclResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n $acl->allow(\"*\", \"welcome\", \"index\");\n\n foreach ($aclRoles as $role => $object) {\n expect($acl->isAllowed($role, 'welcome', 'index'))->true();\n }\n\n $acl->deny(\"*\", \"welcome\", \"index\");\n foreach ($aclRoles as $role => $object) {\n expect($acl->isAllowed($role, 'welcome', 'index'))->false();\n }\n }\n );\n }",
"abstract public function deny();",
"public function allow() {\n // create a new ruleset with full access\n $this->_allow(\n $this->getResource(), \n $this->getRole(), \n $this->getPrivileges(), \n $this->getAssertion()\n );\n }",
"public function denyAccessToAllGroups() : Property\n {\n foreach( $this->acl_entries as $entry )\n {\n if( $entry->getType() != c\\T::GROUP )\n {\n $temp[] = $entry;\n }\n }\n $this->acl_entries = $temp;\n return $this;\n }",
"public function denyLink()\n {\n }",
"public function testMakeRuleWithBlacklist(): void\n {\n $rule = UserRole::makeRuleWithBlacklist([UserRole::MODERATOR()]);\n\n $this->assertFalse($rule->passes(null, UserRole::MODERATOR()->value()));\n $this->assertTrue($rule->passes(null, UserRole::ADMIN()->value()));\n $this->assertTrue($rule->passes(null, UserRole::SUPER_ADMIN()->value()));\n $this->assertTrue($rule->passes(null, UserRole::USER()->value()));\n $this->assertFalse($rule->passes(null, 'moderato'));\n $this->assertFalse($rule->passes(null, 5));\n }",
"public function testRemoveDefaultDeny()\n {\n $this->assertFalse($this->_acl->isAllowed());\n $this->_acl->removeDeny();\n $this->assertFalse($this->_acl->isAllowed());\n }",
"public function testRolePrivilegeDeny()\n {\n $roleGuest = new Zend_Acl_Role('guest');\n $this->_acl->addRole($roleGuest)\n ->allow($roleGuest)\n ->deny($roleGuest, null, 'somePrivilege');\n $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));\n }",
"public function testRemoveDefaultDenyNonExistent()\n {\n $this->_acl->allow()\n ->removeDeny();\n $this->assertTrue($this->_acl->isAllowed());\n }",
"protected function _canExcludeChildrenFromFilter()\n {\n return true;\n }",
"public function ignoresRules();",
"public function testDisallowSub() {\n list($d, $a) = $this->disallowAllow(array_merge(self::$blockTags, ['sub', 'sup', 'img']));\n $this->check($d, $a, 'sub', ['<sub>', '</sub>']);\n }",
"public function addAllow($directories)\n {\n $this->addRuleLine($directories, 'Allow');\n }",
"public function testIsDeniedWithoutRolesAndResource(): void {\r\n $this -> assertTrue($this -> acl -> isDenied('administrator', 'blog.edit'));\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get instance of current HttpRequest. Be carefull, do not modify this instance if it not what you really want. You can call HttpRequest::getCurrent() with feel of safety in your head. | public static function getInstance()
{
if(self::$current !== null)
return self::$current;
if (function_exists('apache_request_headers'))
$request_headers = array_change_key_case(apache_request_headers(), CASE_LOWER);
else
{
$request_headers = array();
foreach($_SERVER as $k => $v)
{
if(strncmp($k, 'HTTP_', 5) == 0)
{
$k = strtolower(strtr(substr($k, 5), '_', '-'));
$request_headers[$k] = $v;
}
}
}
self::$current = new HttpRequest(
URI::getCurrent(),
$_POST,
$_FILES,
$_COOKIE,
$request_headers,
isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null,
isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null,
isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null
);
return self::$current;
} | [
"private function request() {\n if (!$this->request) {\n $this->request = new HttpRequest();\n }\n\n return $this->request;\n }",
"public static final function getRequest() {\n\t\treturn RequestHandler::getActiveRequest();\n\t}",
"public static function getRequest(){\n\t\n\t\tif (!self::$request)\n\t\t\tself::$request = new Request();\n\t\t\t\n\t\treturn self::$request;\n\t}",
"public function getRequest()\n {\n return $this->currentRequest;\n }",
"public static function request()\n {\n if (!static::$instance) {\n static::$instance = new static();\n }\n return static::$instance;\n }",
"public function getCurrentRequest()\n {\n return $this->currentRequest;\n }",
"public static function getMainHttpRequest(): ?HttpRequest {\n\t\treturn static::$mainRequest instanceof HttpRequest ? static::$mainRequest : null;\n\t}",
"public static function getCurrent() {\n\t\t// Setup default context\n\t\t// @codeCoverageIgnoreStart\n\t\tif (!self::$current) {\n\t\t\t$request = new MOXMAN_Http_Request();\n\t\t\t$response = new MOXMAN_Http_Response();\n\t\t\t$session = new MOXMAN_Http_Session();\n\t\t\tself::$current = new MOXMAN_Http_Context($request, $response, $session);\n\t\t}\n\t\t// @codeCoverageIgnoreEnd\n\n\t\treturn self::$current;\n\t}",
"public static function getRequest()\n {\n if (self::$request === null) {\n // @codeCoverageIgnoreStart\n self::$request = Request::buildFromGlobals();\n\n }\n // @codeCoverageIgnoreEnd\n\n return self::$request;\n }",
"protected function getRequest()\n {\n return $this->request;\n }",
"protected function getDefaultHttpRequest()\n {\n return HttpRequest::createFromGlobals();\n }",
"public function singleton() {\n\t\t// check it the HTTPRequest is already initialized\n\t\tif(self::$INSTANCE == null) { // if not, initialize it\n\t\t\tself::$INSTANCE = new TechDivision_Controller_Mock_Request();\n\t\t}\n\t\t// return the actual HTTPRequest instance\n\t\treturn self::$INSTANCE;\n }",
"public function getRequest(): Request;",
"public function getCurrentRequest()\n {\n return $this->psrRequest;\n }",
"public static function instance()\n\t{\n\t\tif ( ! is_null(self::$initial) )\n\t\t{\n\t\t\treturn self::$initial;\n\t\t}\n\n\t\t$uri = Arr::get($_SERVER, 'PATH_INFO', '');\n\t\t$uri = ltrim($uri, '/');\n\t\t\n\t\t$get_params = Arr::get($_SERVER, 'QUERY_STRING', '');\n\t\t\n\t\t$url_tokens = explode('/', $uri);\n\n\t\t$controller\t= !empty($url_tokens['0']) ? $url_tokens[0] : '';\n\t\t$action \t= array_key_exists('1', $url_tokens) ? $url_tokens[1] : '';\n\t\t$params \t= array_key_exists('2', $url_tokens) ? array_slice($url_tokens, 2) : array();\n\n\t\t$method \t= isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n\t\t$requested_with = isset($_SERVER['HTTP_X_REQUESTED_WITH']) ? $_SERVER['HTTP_X_REQUESTED_WITH'] : null;\n\n\t\t$data \t\t= $method == 'GET' ? $get_params : file_get_contents('php://input');\n\t\t$pdata = [];\n\n\t\tif ( ! empty($data) )\n\t\t{\n\t\t\tparse_str($data, $pdata);\n\t\t}\n\n\t\t$request \t= new Request($uri, $controller, $action, $params, $method, $requested_with, $pdata);\n\n\t\treturn $request;\n\t}",
"public function getHttpContext()\n {\n return $this->httpContext;\n }",
"public function getRequest() {\n\t\treturn $this->application->getRequest()->get($this->getNamespace());\n\t}",
"public function getRequest()\n {\n return $this->getComponent('httpRequest');\n }",
"public static function request()\n {\n return self::$request;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a cleaned course number, free of special sections or designators | public function getCleanCourseNum($courseInfo) {
$matches = [];
if (preg_match('/^(.*?)-?(?:[A-Z]\d{0,2})$/', $courseInfo['courseNum'], $matches) === 1) {
return $matches[1];
} else {
return $courseInfo['courseNum'];
}
} | [
"function getCleanCourseNum($courseInfo) {\n\t$matches = array();\n\tif(preg_match('/^(.*?)-?(?:[A-Z]\\d{0,2})$/', $courseInfo['courseNum'], $matches) === 1) {\n\t\treturn $matches[1];\n\t} else {\n\t\treturn $courseInfo['courseNum'];\n\t}\n}",
"function unh_d1_client_getcourseNumber($course = NULL) {\n $ret = '';\n \n if (!empty($course) && array_key_exists('courseNumber', $course)) {\n $ret = $course['courseNumber'];\n }\n \n return $ret;\n}",
"public static function get_course_section_number(){\n \t$course_id = get_the_ID();\n \t$number_sections = 0;\n \t$course_curriculum = bp_course_get_curriculum($course_id);\n if(isset($course_curriculum) && is_array($course_curriculum)){\n \tforeach($course_curriculum as $key => $curriculum){\n \tif(!is_numeric($curriculum)){\n \t ++$number_sections;\n \t}\n \t}\n }\n \treturn '<li>'._x(\"Number of Sections\",\"Course Detail Sidebar Number of Sections\",\"vibe-customtypes\").'<i class=\"course_detail_span\">'.$number_sections.'</i></li>'; \n }",
"function reader_get_numsections($course) {\n global $DB;\n if (is_numeric($course)) {\n $course = $DB->get_record('course', array('id' => $course));\n }\n if ($course && isset($course->id)) {\n if (isset($course->numsections)) {\n return $course->numsections; // Moodle >= 2.3\n }\n if (isset($course->format)) {\n return $DB->get_field('course_format_options', 'value', array('courseid' => $course->id, 'format' => $course->format, 'name' => 'numsections'));\n }\n }\n return 0; // shouldn't happen !!\n}",
"function get_course_id()\n {\n return (int)$this->sloodle_instance->course;\n }",
"function get_course_infos_clean( $courseid ){\n\n $DB=$GLOBALS['GLBMDL_DB'];\n return cleanresponse_course_infos( get_course_infos($courseid, $DB) );\n\n }",
"function valid_coursexx($c)\n{\n\tglobal $cognates, $areas, $senior;\n\tif (strlen(trim($c)) < 6)\t// must be at least 6 chars\n\t\treturn false;\n\n\tpreg_match(\"/^([a-zA-Z]+)([0-9]+)$/\", trim($c), $match);\n\n\t$dept = strtoupper($match[1]);\n\t$number = $match[2];\n\t$name = $dept.$number;\n\n\t// check to see if it is in array\n\tif (isset($areas[$name]))\n\t\treturn true;\n\telse if (isset($senior[$name]))\n\t\treturn true;\n\telse if (isset($cognates[$name]))\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"public function get_courseidnumber() {\n return s($this->course->idnumber);\n }",
"function getCourseName($courses,$number)\n{\n\n $name = \"\";\n if (! isset($courses->list[$number])) {\n if ($number == '')\n $name = 'NOT ASSIGNED';\n else\n print \" course number not found: $number<br>\\n\";\n }\n else\n $name = $courses->list[$number]->name;\n \n return $name;\n}",
"function eng_classes($courses, $st_courses)\n{\n //english classes\n $readonly = array('readonly', 'readonly', 'readonly','readonly');\n $eng = hide_section('GenEdReq', 'English, Humanities, and Social Sciences');\n $required = eng_required();\n foreach($courses as $course)\n {\n if( in_array($course->number, $required))\n {\n $eng .= html_gen($course, $st_courses, $readonly).PHP_EOL;\n }\n }\n return $eng;\n\n\n\n}",
"function unh_d1_client_getcourseObjectId($course = NULL) {\n $ret = '';\n \n if (!empty($course) && array_key_exists('objectId', $course)) {\n $ret = $course['objectId'];\n }\n \n return $ret;\n}",
"private static function coursemodule_helper($course)\n {\n $newcm = new stdClass();\n $newcm->course = $course->id;\n $newcm->module = 17; // 17 == resource\n $newcm->visible = 1;\n $newcm->visibleold = 1;\n $newcm->visibleoncoursepage = 1;\n $newcm->groupmode = 0;\n $newcm->groupingid = 0;\n $newcm->showdescription = 0;\n return $newcm;\n }",
"public function getCourseId() {\n \t$val = $this->cacheGetObj('course_id');\n \tif (is_null($val))\n \t\treturn $this->cacheSetObj('course_id', $this->getOffering()->getCourseId());\n \telse\n \t\treturn $val;\n\t}",
"public function getCourseInfo()\n\t{\n\t\t$gid = Request::getString('gid');\n\t\t$offering = Request::getString('offering');\n\t\t$section = Request::getString('section');\n\t\t$section = ($section ?: null);\n\n\t\t$this->course = new Course($gid);\n\t\t$this->course->offering($offering);\n\t\t$this->course->offering()->section($section);\n\t}",
"function get_course_main_info($nid) {\n $course = array('nid' => $nid);\n $node = node_load($nid);\n \n if ($node && $node->type == 'course') {\n if (isset($node->field_c_subject['und'])) {\n $subject = taxonomy_term_load($node->field_c_subject['und'][0]['tid']);\n $course['subject'] = $subject->name;\n } else {\n $course['subject'] = '';\n }\n \n $imageInfo = get_obj_field_img_info($node, 'field_c_cover_image');\n $course['coverImageUrl'] = $imageInfo['url'];\n $course['coverImageAlt'] = $imageInfo['alt'];\n $course['coverImageTitle'] = $imageInfo['title'];\n $course['title'] = $node->title;\n $course['description'] = get_obj_field_value($node, 'field_c_description');\n $course['startDate'] = format_obj_field_date_value($node, 'field_c_start_date', 'j M Y');\n $course['startDateDM'] = format_obj_field_date_value($node, 'field_c_start_date', 'j F');\n $course['duration'] = get_obj_field_value($node, 'field_c_duration');\n \n $course['durationIdList'] = [];\n if (isset($node->field_c_duration_list['und']) && $node->field_c_duration_list['und']) {\n foreach ($node->field_c_duration_list['und'] as $item) {\n $course['durationIdList'][] = $item['value'];\n }\n }\n }\n \n return $course;\n}",
"function concordat_student_report()\n{\n\n//\tThis is a 2-step performance\n//\t1st we select all assessment units (of a given division or department) and their related degree programmes for a given academic year\n//\t$table = get_assessment_units($dept_id, $ay_id);\n\t$table = get_assessment_units();\n\n//\t2nd we amend the data in the table with the nr.of students and if the degree programme is joint owned\n\t$table = amend_data($table);\n\n\t$table =cleanup($table,2);\n\t\n\treturn $table;\n}",
"private function build_attribute_no_courses(): object {\n $attributename = $this->get_attribute_by_name('Number of Courses');\n $datasourcedomain = $this->get_data_source('Course Details');\n\n $attribute = (object)[\n 'objectTypeAttributeId' => $attributename->id,\n \"objectAttributeValues\" => [\n (object)[\n \"value\" => $datasourcedomain->data->numberofcourses,\n ],\n ],\n ];\n\n return $attribute;\n }",
"function concordat_student_report()\n{\n\n//\tThis is a 2-step performance\n//\t1st we select all assessment units (of a given division or department) and their related degree programmes for a given academic year\n//\t$table = get_assessment_units($dept_id, $ay_id);\n\t$table = get_assessment_units();\n\n//\t2nd we amend the data in the table with the nr.of students and if the degree programme is joint owned\n\t$table = amend_data($table);\n\n\t$table =cleanup($table,1);\n\t\n\treturn $table;\n}",
"static public function get_numsections($course) {\n global $DB;\n if (is_numeric($course)) {\n $course = $DB->get_record('course', array('id' => $course));\n }\n if (isset($course->numsections)) {\n // Moodle <= 2.3\n return $course->numsections;\n }\n if (isset($course->format)) {\n // Moodle >= 2.4\n $params = array('courseid' => $course->id, 'format' => $course->format, 'name' => 'numsections');\n return $DB->get_field('course_format_options', 'value', $params);\n }\n return 0; // shouldn't happen !!\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts: `dialog ... gauge ...` | function wha_dialog_gauge_open(&$pipes, $stdin, $text, $height, $width,
$percent = null, $common_options = array())
{
$gauge_options = array('--gauge', $text, $height, $width);
if($percent !== null) {
$gauge_options[] = $percent;
}
$args = array_merge($common_options, $gauge_options);
$process = wha_dialog_open($args, $pipes, $stdin);
return $process;
} | [
"function CLCFG_dialogGaugeProcPos($backtitle, $title, $message, $infofilecmd, $fullsize, $force=false)\n{\n\techo(\"\n\t\n\techo | dialog --backtitle \\\"$backtitle\\\" --title \\\"$title\\\" --gauge \\\"$message\\\" 6 70 0\n\tsleep 2\n\t\n\tinfofile=`$infofilecmd`\n\n\t(\n\twhile [ -e \\$infofile ]\n\tdo\n\tsleep 2\n\tpos=`cat \\$infofile | grep pos | tr -d [:blank:] | cut -d':' -f2 2>/dev/null`\n\tfsize=$fullsize\n\tPCT=`echo \\$pos | awk -vOFMT=\\\"%.100g\\\" -vsize=\\$fsize '{print(($0 / size) * 100)}'`\necho \\\"XXX\\\"\necho \\$PCT | cut -d'.' -f1\necho \\\"$message\\\"\necho \\\"XXX\\\"\");\n\tMSR_statusBarCommand(\"\\$PCT\", \"$message\");\necho(\"\n\tdone\n\t) | dialog --backtitle \\\"$backtitle\\\" --title \\\"$title\\\" --gauge \\\"$message\\\" 6 70 0\n\");\n}",
"protected function build_dialog(){\r\n\t\t$dialog = new GtkDialog('Scanning in progress...', null, Gtk::DIALOG_MODAL);\r\n\t\t$top_area = $dialog->vbox;\r\n\t\t$top_area->pack_start(new GtkLabel('Please hold on while processing directory...'));\r\n\t\t$this->progress = new GtkProgressBar();\r\n\t\t$this->progress->set_orientation(Gtk::PROGRESS_LEFT_TO_RIGHT);\r\n\t\t$top_area->pack_start($this->progress, 0, 0);\r\n\t\t$cancel = new gtkbutton('cancel');\r\n\t\t$top_area->pack_start($cancel, false, false);\r\n\t\t$cancel->connect_simple('clicked',array($this,'cancel'));\r\n\t\t$dialog->set_has_separator(false);\r\n\t\t$this->dialog = $dialog;\r\n\t}",
"public function spinnerCommand(): void\n {\n $total = 5000;\n\n while ($total--) {\n Show::spinner('Data handling ');\n usleep(100);\n }\n\n Show::spinner('Done', true);\n }",
"function graphGauge($id,$width,$height,$font,$n,$r,$lowestBest,$title){\n $border=0;\n $res=$this->create($id,$width,$height,$border);\n $res.=$this->getCanvas($id);\n $res.=$this->setFont($id,$font);\n $res.=$this->initiateGauge($id,$r,$n,$lowestBest,$title,$font);\n $res.=$this->endScript();\n return $res;\n \n }",
"function InitDialog(){}",
"public function makeProgress()\n {\n $this->bar->advance();\n }",
"function PlotGauges($data){\n\tfunction plotThermo($thermoName, $thermoWidth, $thermoHeight, $thermoMin, $thermoMax, $thermoValue){\n\t\t$myThermoSize = \"<canvas id='\".$thermoName.\"' width='\".$thermoWidth.\"' height='\".$thermoHeight.\"'>[No canvas support]</canvas>\";\n\t\t$myThermo = \"var thermometer = new RGraph.Thermometer('\".$thermoName.\"', \".$thermoMin.\",\".$thermoMax.\",\".$thermoValue.\")\n\t\t\t\t\t.Set('scale.visible', 'true')\n\t\t\t\t\t.Set('value.label.decimals', 2)\n\t\t\t\t\t.Draw();\";\n\t\t$dataOut = array($myThermoSize, $myThermo);\n\t\treturn $dataOut;\n\t}\n\t// function to plot humidity meter\n\tfunction plotHum($humName, $humWidth, $humHeight, $humMin, $humMax, $humValue, $gaugeName){\n\t\t$myHumSize = \"<canvas id=\".$humName.\" width=\".$humWidth.\" height=\".$humHeight.\">[No canvas support]</canvas>\";\n\t\t$myHum = \"var gauge = new RGraph.Gauge('\".$humName.\"', \".$humMin.\", \".$humMax.\", \".$humValue.\")\n\t\t\t\t\t\t\t.Set('title.bottom', '\".$gaugeName.\"')\n\t\t\t\t\t\t\t.Set('value.label.decimals', 2)\n\t\t\t\t\t\t\t.Set('colors.ranges', []) // comment [80,90,'green'],[90,100,'red']\n\t\t\t\t\t\t\t.Draw();\";\n\t\t$dataOut = array($myHumSize, $myHum);\n\t\treturn $dataOut;\n\t}\n\t// **************************************************************************\n\t// Settings\n\t// 2. Thermo plot Input Variables \n\t$thermoWidth = 80; // rarely change\n\t$thermoHeight = 400; // rarely change\n\t$thermoMin = 0; // no need to change\n\t$thermoMax = 100; // no need to change\n\t// 3. Gauge Humidity Plot varables\n\t$humWidth = 250;\n\t$humHeight = 250;\n\t$humMin = 0;\n\t$humMax = 100;\n\t$gaugeName = \"Humidity\";\n\t// **************************************************************************\n\t// Implementation Start\n\techo \"<html>\n\t<head>\n\t\t<link rel='stylesheet' href='demos.css' type='text/css' media='screen' />\n\t\t<script src='../includes/rgrlib/RGraph.common.core.js' ></script>\n\t\t<script src='../includes/rgrlib/RGraph.common.dynamic.js' ></script>\n\t\t<script src='../includes/rgrlib/RGraph.common.tooltips.js' ></script>\n\t\t<script src='../includes/rgrlib/RGraph.thermometer.js' ></script>\n\t\t<script src='../includes/rgrlib/RGraph.gauge.js' ></script>\n\t</head>\n\t<body><div align='center'>\";\n\n\t// using function\n\t// 1 air temp 1 \n\t$thermoName = $data[6]['procedure']; // always need to change \n\t$thermoValue = $data[6]['value'];//$thermoValue = 50; // always need to change\n\t$getThermo = plotThermo($thermoName, $thermoWidth, $thermoHeight, $thermoMin, $thermoMax, $thermoValue);\n\t// 2 air hum 1\n\t$humName=$data[0]['procedure'];\n\t$humValue = $data[0]['value'];//$humValue = 69.1230;\n\t$getHum = plotHum($humName, $humWidth, $humHeight, $humMin, $humMax, $humValue, $gaugeName);\n\t// 3 Soil temp 1\n\t$thermoNameS1 = $data[4]['procedure']; // always need to change \n\t$thermoValueS1 = $data[4]['value'];//$thermoValue = 50; // always need to change\n\t$getThermoS1 = plotThermo($thermoNameS1, $thermoWidth, $thermoHeight, $thermoMin, $thermoMax, $thermoValueS1);\n\t// 4 Soil Moist 1\n\t// No Calibration\n\t$smsName = $data[2]['procedure'];\n\t$smValue = $data[2]['value'];\n\t$gaugeNameM = \"Soil Moisture\";\n\t$smMin = 0;\n\t$smMax = 1024;\n\t$SoilM1 = plotHum($smsName, $humWidth, $humHeight, $smMin, $smMax, $smValue, $gaugeNameM);\n\t// 5 Air temp 2\n\t$thermoName1 = $data[7]['procedure']; // always need to change \n\t$thermoValue1 = $data[7]['value'];//$thermoValue = 50; // always need to change\n\t$getThermo1 = plotThermo($thermoName1, $thermoWidth, $thermoHeight, $thermoMin, $thermoMax, $thermoValue1);\n\t// 6 air hum 2\n\t$humName2=$data[1]['procedure'];\n\t$hum2Val = $data[0]['value']+0.5;\n\t$humValue2 = $hum2Val;//$humValue = 69.1230;\n\t$getHum2 = plotHum($humName2, $humWidth, $humHeight, $humMin, $humMax, $humValue2, $gaugeName);\n\t// 7 soil temp 2 // damaged replaced \n\t$thermoNameS2 = $data[5]['procedure']; // always need to change \n\t$thermoValueS2 = $data[4]['value']+0.4;//$thermoValue = 50; // always need to change\n\t$getThermoS2 = plotThermo($thermoNameS2, $thermoWidth, $thermoHeight, $thermoMin, $thermoMax, $thermoValueS2);\n\t// 8 soil moist 2\n\t$smsName = $data[3]['procedure'];\n\t$smValue = $data[3]['value'];\n\t$gaugeNameM = \"Soil Moisture\";\n\t$smMin = 0;\n\t$smMax = 1024;\n\t$SoilM2 = plotHum($smsName, $humWidth, $humHeight, $smMin, $smMax, $smValue, $gaugeNameM);\n\t// print first output of function\n\t//======================================\n\t// temp 1\n\techo \"<table ><tr><td colspan=2 align='center'>Sensor ID: \".$data[6]['procedure'].\" </td></tr>\n\t<tr><td>1.<br/>\n\tObserved Property: \".$data[6]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[6]['time']))).\"<br/>\t\n\tValue: \".$data[6]['value'].\"<br/>\n\tUnit: degree Celsius\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getThermo[0]);\n\t// hum 1\n\techo \"</td></tr>\n\t<tr><td colspan=2 align='center'>Sensor ID: \".$data[0]['procedure'].\" </td></tr>\n\t<tr><td>2.<br/>\n\tObserved Property: \".$data[0]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[0]['time']))).\"<br/>\t\n\tValue: \".$data[0]['value'].\"<br/>\n\tUnit: percent\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getHum[0]);\n\t// soil temp 1\n\techo \"</td></tr><tr><td colspan=2 align='center'>Sensor ID: \".$data[4]['procedure'].\" </td></tr>\n\t<tr><td>3.<br/>\n\tObserved Property: \".$data[4]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[4]['time']))).\"<br/>\t\n\tValue: \".$data[4]['value'].\"<br/>\n\tUnit: degree Celsius\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getThermoS1[0]);\n\t// soil Moist 1\n\techo \"</td></tr><!--\n\t<tr><td colspan=2 align='center'>Sensor ID: \".$data[2]['procedure'].\" </td></tr>\n\t<tr><td>4.<br/>\n\tObserved Property: \".$data[2]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[2]['time']))).\"<br/>\t\n\tValue: \".$data[2]['value'].\"<br/>\n\tUnit: percent\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($SoilM1[0]);\n\t// temp 2\n\techo \"</td></tr>-->\n\t<tr><td colspan=2 align='center'>Sensor ID: \".$data[7]['procedure'].\" </td></tr>\n\t<tr><td>5.<br/>\n\tObserved Property: \".$data[7]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[7]['time']))).\"<br/>\t\n\tValue: \".$data[7]['value'].\"<br/>\n\tUnit: degree Celsius\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getThermo1[0]);\n\t// hum 2\n\techo \"</td></tr><tr><td colspan=2 align='center'>Sensor ID: \".$data[1]['procedure'].\" </td></tr>\n\t<tr><td>6.<br/>\n\tObserved Property: \".$data[1]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[1]['time']))).\"<br/>\t\n\tValue: \".$hum2Val.\"<br/>\n\tUnit: percent\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getHum2[0]);\n\t// soil temp 2\n\techo \"</td></tr><tr><td colspan=2 align='center'>Sensor ID: \".$data[5]['procedure'].\" </td></tr>\n\t<tr><td>7.<br/>\n\tObserved Property: \".$data[5]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[5]['time']))).\"<br/>\t\n\tValue: \".$thermoValueS2.\"<br/>\n\tUnit: degree Celsius\n\t</td>\n\t<td align='center'>\";\n\tprint_r ($getThermoS2[0]);\n\t// soil moist 2\n\techo \"</td></tr><!--\n\t<tr><td colspan=2 align='center'>Sensor ID: \".$data[3]['procedure'].\" </td></tr>\n\t<tr><td>8.<br/>\n\tObserved Property: \".$data[3]['observedProperty'].\"<br/>\n\tLast Update: \".date(\"Y-m-d H:i:s\",(strtotime($data[3]['time']))).\"<br/>\t\n\tValue: \".$data[3]['value'].\"<br/>\n\tUnit: percent\n\t</td>\n\t<td>\";\n\tprint_r ($SoilM2[0]);\n\techo \"</td></tr>-->\n\t</table>\";\n\t\n\techo \"<br/>\n\t\t <script>\";\n\techo \"window.onload = function (){\";\n\t// print second output of function\n\tprint_r ($getThermo[1]);\n\tprint_r ($getHum[1]);\n\tprint_r ($getThermoS1[1]);\n\t//print_r ($SoilM1[1]);\n\n\tprint_r ($getThermo1[1]);\n\tprint_r ($getHum2[1]);\n\tprint_r ($getThermoS2[1]);\n\t//print_r ($SoilM2[1]);\n\t\n\t// end of html file\n\techo \"}\";\n\techo \"</script>\";\n\techo \"</div></body>\n\t</html>\";\n\t// **************************************************************************\n}",
"public function start()\n {\n $this->startTime = time();\n $this->step = 0;\n $this->percent = 0;\n $this->lastMessagesLength = 0;\n $this->barCharOriginal = '';\n\n if (null === $this->format) {\n $this->format = $this->determineBestFormat();\n }\n\n if (!$this->max) {\n $this->barCharOriginal = $this->barChar;\n $this->barChar = $this->emptyBarChar;\n }\n\n $this->display();\n }",
"public function advanceProgressBar();",
"function display()\r\n {\r\n static $lnEnd;\r\n static $cellAmount;\r\n static $determinate;\r\n\r\n if(!isset($lnEnd)) {\r\n $ui =& $this->_UI;\r\n $lnEnd = $ui->_getLineEnd();\r\n $cellAmount = ($this->getMaximum() - $this->getMinimum()) / $ui->getCellCount();\r\n }\r\n\r\n if (function_exists('ob_get_clean')) {\r\n $bar = ob_get_clean(); // use for PHP 4.3+\r\n } else {\r\n $bar = ob_get_contents(); // use for PHP 4.2+\r\n ob_end_clean();\r\n }\r\n $bar .= $lnEnd;\r\n\r\n $progressId = $this->getIdent().'_';\r\n\r\n if ($this->isIndeterminate()) {\r\n if (isset($determinate)) {\r\n $determinate++;\r\n $progress = $determinate;\r\n } else {\r\n $progress = $determinate = 1;\r\n }\r\n } else {\r\n $progress = ($this->getValue() - $this->getMinimum()) / $cellAmount;\r\n $determinate = 0;\r\n }\r\n $bar .= '<script type=\"text/javascript\">self.setprogress(\"'.$progressId.'\",'.((int) $progress).',\"'.$this->getString().'\",'.$determinate.'); </script>';\r\n\r\n echo $bar;\r\n ob_start();\r\n }",
"public function updateGauge(array $data)\n {\n }",
"public function Dialog($date, $onSelect = null, $settings = null, $pos = null)\n {\n $this->CallJqUiMethod(\"dialog\", $date, $onSelect, $settings, $pos);\n }",
"private function showProgress()\n {\n $this->output->progressStart(3);\n for ($i = 0; $i < 3; $i++) {\n sleep(1);\n $this->output->progressAdvance();\n }\n $this->output->progressFinish();\n }",
"static function createProgressBar($msg=\" \") {\n\n echo \"<div class='doaction_cadre'>\".\n \"<div class='doaction_progress' id='doaction_progress'></div>\".\n \"</div><br>\";\n\n echo \"<script type='text/javascript'>\";\n echo \"var glpi_progressbar=new Ext.ProgressBar({\n text:\\\"$msg\\\",\n id:'progress_bar',\n applyTo:'doaction_progress'\n });\";\n echo \"</script>\\n\";\n }",
"public static function gauge($stat, $value) {\n static::queueStats(array($stat => \"$value|g\"));\n }",
"public function probeGauge(){\n\t// Connect to server and select databse.\n\t\t$con = new PDO('mysql:host='.$this->dbhost.';dbname='.$this->dbname.';charset=utf8', ''.$this->dbuser.'', ''.$this->dbpass.'', array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));\n\t\t\n\t\tif (!$con){\n\t\t\tdie('Could not connect: ' . mysql_error());\n\t\t\t}\n\t\t\t\n\t$probe_query = $con->prepare(\"SELECT * FROM probe WHERE doctorID = ?\");\n\t$probe_query->bindValue(1, $this->med_id, PDO::PARAM_INT);\n\t$probe_query->execute();\n\n\twhile($probe_row = $probe_query->fetch(PDO::FETCH_ASSOC)){\n\n\t$probe_response = $con->prepare(\"SELECT * FROM proberesponse WHERE probeID = ? ORDER BY responseTime DESC LIMIT 1\");\n\t$probe_response->bindValue(1, $probe_row['probeID'], PDO::PARAM_INT);\n\t$probe_response->execute();\n\n\t$row_response = $probe_response->fetch(PDO::FETCH_ASSOC);\n\n\tif($row_response['response'] == 1){\n\t$this->vb_response = $this->vb_response + 1;\n\t}elseif($row_response['response'] == 2){\n\t$this->b_response = $this->b_response + 1;\n\t}elseif($row_response['response'] == 3){\n\t$this->n_response = $this->n_response + 1;\n\t}elseif($row_response['response'] == 4){\n\t$this->g_response = $this->g_response + 1;\n\t}elseif($row_response['response'] == 5){\n\t$this->vg_response = $this->vg_response + 1;\n\t}else{\n\t$this->t_response = $this->t_response - 1;\n\t}\n\t$this->t_response = $this->t_response + 1;\n\t}\n\t\n\t//END PROBE GAUGE\n\t}",
"function presentUpdate()\n {\n // Make sure the info has been grabbed.\n // This will just return if the info has already been grabbed.\n $this->getPackageInfo();\n\n // Create the main dialog widget.\n $this->createMainDialog();\n\n $renderer = &$this->getHtmlRendererWithLabel($this->mainwidget);\n\n // Get Html code to display\n $html = $this->toHtml($renderer);\n\n // Run the dialog and return whether or not the user clicked \"Yes\".\n if ($this->mainwidget->validate()) {\n $safe = $this->mainwidget->exportValues();\n\n if (isset($safe['mainBtnYes'])) {\n return true;\n } elseif (isset($safe['mainBtnNo'])) {\n return false;\n } else {\n $this->prefDialog();\n }\n }\n echo $html;\n exit();\n }",
"private function drawProgress()\r\n {\r\n if ($this->total_questions !== FALSE) {\r\n $this->output->writeln([SELF::LINE_BREAK . \"[Prompt \" . $this->question_count . \"/\" . $this->total_questions . \"]\"]);\r\n }\r\n }",
"public function storeGauge(string $name, $value);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show loading view for paypal. | public function loadingPopup()
{
return view('common::billing/loading-popup');
} | [
"public function paypalpending()\n\t{\n\t\t$view = $this->getView('Pbbooking','html');\n\t\t$view->setLayout('paypalpending');\n\t\t$view->display();\n\t}",
"public function display_paypal_button() {\n\t\t?>\n\t\t<div id=\"woo_pp_ec_button_checkout\"></div>\n\t\t<?php\n\t}",
"function payfort_preload_checkout() {\n ?>\n <script src=\"https://beautiful.start.payfort.com/checkout.js\"></script>\n <script>\n StartCheckout.config({\n key: \"<?php echo $this->test_mode == 'yes'? $this->test_open_key : $this->live_open_key ?>\",\n form_label: 'OK',\n complete: function(params) {\n submitFormWithToken(params); // params.token.id, params.email\n }\n });\n </script>\n <?php\n }",
"public function paypageAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }",
"public function question_bank_loading() {\n return html_writer::div($this->pix_icon('i/loading', get_string('loading')), 'questionbankloading');\n }",
"public function renderPaymentView()\n {\n $formType = $this->formFactory->create('paypal_express_checkout_view');\n\n return $this->environment->display('PaypalExpressCheckoutBundle:PaypalExpressCheckout:view.html.twig', array(\n 'paypal_express_checkout_form' => $formType->createView(),\n ));\n }",
"public function getLoadingUrl()\n\t{\n\t\treturn Mage::getUrl(self::URL_PATH_LOADING, array('_secure' => true));\n\t}",
"function load_paypal()\n\t{\n\t\t// Load PayPal config\n $this->config->load('paypal');\n\n $paypal = $this->Paypal_config->get_one_by('id');\n\n //prepare paypal config\n $config = array(\n\n \t// Sandbox / testing mode option.\n 'Sandbox' => $paypal->sandbox,\n\n // PayPal API username of the API caller\n 'APIUsername' => $paypal->api_username,\n\n // PayPal API password of the API caller\n 'APIPassword' => $paypal->api_password,\n\n // PayPal API signature of the API caller\n 'APISignature' => $paypal->api_signature,\n\n // PayPal API subject (email address of 3rd party user that has granted API permission for your app) \n 'APISubject' => '',\n\n // API version you'd like to use for your call. You can set a default version in the class and leave this blank if you want.\n 'APIVersion' => $paypal->api_version\n );\n\n if ($config['Sandbox']) {\n // if paypal is testing,open error reporting\n \n //error_reporting(E_ALL);\n ini_set('display_errors', '1');\n }\n\n //load paypal library\n $this->load->library('paypal/Paypal_pro', $config);\n\t}",
"public function renderPaymentView()\n {\n $order = $this->controller->getData('order');\n $model = $this->extension->getExtModel();\n $company = !empty($order->customer->company) ? $order->customer->company : null;\n \n $cancelUrl = Yii::app()->createAbsoluteUrl('price_plans/index');\n $returnUrl = Yii::app()->createAbsoluteUrl('price_plans/index');\n $notifyUrl = Yii::app()->createAbsoluteUrl('payment_gateway_ext_paypal/ipn');\n \n $assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias($this->extension->getPathAlias()) . '/assets/customer', false, -1, MW_DEBUG);\n Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/payment-form.js');\n \n $customVars = sha1(StringHelper::uniqid());\n $view = $this->extension->getPathAlias() . '.customer.views.payment-form';\n \n $this->controller->renderPartial($view, compact('model', 'order', 'company', 'cancelUrl', 'returnUrl', 'notifyUrl', 'customVars'));\n }",
"public function getPaypalVisible();",
"function showPaymentReceivedPage()\n {\n $xtpl = new XTemplate('payment_received.xtpl', TEMPLATES);\n\n $xtpl->parse('main');\n $xtpl->out('main');\n }",
"public function oePayPalDisplayCartInPayPal()\n {\n }",
"public function showForm(Request $request)\n {\n return view('payments.paypal');\n }",
"function showPaypal(){\n if(isset($_SESSION['total_quantity']) && $_SESSION['total_quantity'] >= 1){\n\n $paypal = <<<DELIMETER\n \n <input type=\"image\" name=\"upload\"\n src=\"https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif\"\n alt=\"PayPal - The safer, easier way to pay online\">\n \n DELIMETER;\n\n return $paypal;\n\n }\n }",
"public function edd_slg_login_link_paypal() {\n\t\t\n\t\tglobal $edd_options;\n\t\t\n\t\t$show_link = edd_slg_can_show_social_link( 'paypal' );\n\t\t\n\t\t//check paypal is enable or not\n\t\tif( !empty($edd_options['edd_slg_enable_paypal']) && $show_link ) {\n\t\t\t\n\t\t\t$paypalimglinkurl = isset( $edd_options['edd_slg_paypal_link_icon_url'] ) && !empty( $edd_options['edd_slg_paypal_link_icon_url'] ) \n\t\t\t\t\t\t? $edd_options['edd_slg_paypal_link_icon_url'] : EDD_SLG_IMG_URL . '/paypal-link.png';\n\t\t\t\t\t\t\n\t\t\t//load paypal button\n\t\t\tedd_slg_get_template( 'social-link-buttons/paypal_link.php', array( 'paypalimglinkurl' => $paypalimglinkurl) );\n\t\t\t\n\t\t\tif( EDD_SLG_PAYPAL_APP_ID != '' && EDD_SLG_PAYPAL_APP_SECRET != '' ) {\n\t\t\t$paypal_authurl = $this->socialpaypal->edd_slg_get_paypal_auth_url();\n\t\t\t\t\n\t\t\t\techo '<input type=\"hidden\" class=\"edd-slg-social-paypal-redirect-url\" id=\"edd_slg_social_paypal_redirect_url\" name=\"edd_slg_social_paypal_redirect_url\" value=\"'.$paypal_authurl.'\"/>';\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function paypal_form()\n {\n $html=\"\";\n\n // again some quantities\n $contents=$this->cart->contents();\n $product_count=$this->get_actual_cart_total();\n\n if ($product_count>0 or\n 1==$this->config->item('always_show_pay_button'))\n {\n if (0==$product_count)\n {\n $html.=\"<span id='pp_button_deactivated'>\".$this->config->item('paypal_button_text').\"</span>\";\n }\n else\n {\n // open form and initialise various paypal values - inc vendor from config\n $html.=\"<form action='/order/initialise/paypal' method='post'>\";\n $html.=\"<input id='pp_button' class='checkout' type='submit' value='\".$this->config->item('paypal_button_text').\"' title='pay with credit card or paypal account using paypal - the payment portal most trusted by ebay users'/>\";\n $html.=\"</form>\";\n }\n }\n return $html;\n }",
"public static function pxp_paypal_settings()\n\t{\n\t\tinclude_once( 'class-pxp-admin-paypal.php' );\n\t\tPXP_Admin_Paypal::output();\n\t}",
"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 page() {\n $this->loadAssets();\n\n $Currencies = new LaterPayModelCurrency();\n\n $this->assign('global_default_price', ViewHelper::formatNumber((float)LATERPAY_GLOBAL_PRICE_DEFAULT, 2));\n $this->assign('Currencies', $Currencies);\n\n $this->render('pluginBackendGetStartedTab');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all articles assigned to this supplier | public function getArticles()
{
return $this->articles;
} | [
"public function getAll()\n {\n return $this->articles;\n }",
"public function getAllArticleItems()\n {\n return $this->articles;\n }",
"public function getArticles()\n {\n return $this->articles;\n }",
"public function getArticleObjects()\n {\n $this->loadArticles();\n\n return $this->articles;\n }",
"public function getArticles()\n {\n return Db::queryAll('\n SELECT `article_id`, `title`, `url`, `description`\n FROM `article`\n ORDER BY `article_id` DESC\n ');\n }",
"public function getArticles()\n {\n return $this->findBy([], [ 'title' => 'ASC' ]);\n }",
"public function articles ()\n {\n return new ArticlesProvider($this->client);\n }",
"public function allSuppliers()\n {\n return $this->supplier->all();\n }",
"public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }",
"public function getArticles(){\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\treturn $placeRepository->getArticlesOfPlace($this);\n\t}",
"public function getArticlesList();",
"public function listArticles() {\n\t\t\t$query = \"SELECT * FROM articles\";\n\t\t\t$resultat = $this->db->getAll($query);\n\t\t\treturn $resultat;\n\t\t}",
"public function getArticles()\n {\n if (is_null($this->_aArtIds)) {\n $oDb = oxDb::getDb();\n $sQ = \"select oxobjectid from oxobject2delivery where oxdeliveryid=\" . $oDb->quote($this->getId()) . \" and oxtype = 'oxarticles'\";\n $aArtIds = $oDb->getCol($sQ);\n $this->_aArtIds = $aArtIds;\n }\n\n return $this->_aArtIds;\n }",
"static function get_articles()\n {\n global $db;\n\n // grab the articles and push them into an array\n $result = array();\n $query = mysqli_query($db, \"SELECT * FROM `articles`\");\n while ($cur = mysqli_fetch_assoc($query)) {\n $result[] = $cur;\n }\n\n return (count($result) === 0) ? null : $result;\n }",
"function GetMyArticles(){\n\t\t\t$this->_connect->query(\"Select * FROM `articles`\");\n\t\t\t\n\t\t\treturn $this->_connect->fetchAll();\n\t\t}",
"public function getArticles()\n {\n return $this->hasMany(Article::className(), ['cat_id' => 'id']);\n }",
"function GetMyArticles(){\n\t\t\t$result = $this->_connect->query(\"Select * FROM `articles`\");\n\n\t\t\treturn $result->fetchAll();\n\t\t}",
"public function getRelatedArticles()\n {\n return $this->hasMany(Article::className(), ['id' => 'related_article_id'])->viaTable('article_to_related_article', ['article_id' => 'id']);\n }",
"public function getSupplierItems() : \\Aimeos\\Map\n\t{\n\t\treturn map( $this->get( '.supplier', [] ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks $image as deleted, saves it to the DB (if it has a UID) and deletes the corresponding image file. | public function delete(tx_realty_Model_Image $image) {
if ($image->isDead()) {
return;
}
$fileName = $image->getFileName();
parent::delete($image);
if ($fileName !== '') {
$fullPath = PATH_site . tx_realty_Model_Image::UPLOAD_FOLDER .
$fileName;
if (file_exists($fullPath)) {
unlink($fullPath);
}
}
} | [
"public function deleteImage()\n {\n Storage::deleted($this->main_image);\n Storage::deleted($this->index_image);\n Storage::deleted($this->image);\n }",
"public function deleteImage()\n\t{\n\t\t$file = $this->getImagePath() . $this->getImageFilename();\n\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file);\n\t\t\t$this->image_filename = '';\n\t\t}\n\t}",
"function delete_image($image){\n\tif(file_exists($image)){\n\t\t$new_name = generateName(getNumber($image), '.deleted');\n\t\trename($image, $new_name);\n\t}\n}",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage(){\n\t\t$this->load->helper(array('response', 'input', 'security'));\n\t\t$filename = sanitize_filename($this->input->post('filename'));\n\t\t$imageId = sanitizeInteger($this->input->post('id'));\n\n\t\t// first delete the record in database\n\t\tif($this->images->deleteImageById($imageId)){\n\t\t\t// if it goes ok, delete the file\n\n\t\t\t$deleteFile = realpath(\"./uploads/\".$filename);\n\t\t\tif(unlink($deleteFile)){\n\t\t\t\t// if all good, return success answer\n\t\t\t\techo returnResponse('success', 'OK', 'jsonizeResponse');\n\t\t\t}else{\n\t\t\t\techo returnResponse('error', 'ERROR', 'jsonizeResponse');\n\t\t\t}\n\t\t}else{\n\t\t\techo returnResponse('error', 'ERROR', 'jsonizeResponse');\n\t\t}\n\n\t}",
"public function forceDeleted(Image $image)\n {\n //\n }",
"private function deleteImageFile()\n {\n if ($this->image && File::exists(public_path($this->image))) {\n File::delete(public_path($this->image));\n }\n }",
"public function deleteImage($image)\n {\n Storage::delete($image);\n }",
"public function deleteImage()\n\t{\n\t\tif ($this->getImager()->delete($this->owner{$this->idColumn}))\n\t\t{\n\t\t\t$this->owner->{$this->idColumn} = null;\n\t\t\t$this->owner->save(false);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function testDeleteImageFileImage()\n {\n $uploaderHelper = $this->getContainer()->get('vich_uploader.templating.helper.uploader_helper');\n\n /** @var Image $image */\n $objects = $this->loadFixturesAndAuthenticate(['@AppBundle/DataFixtures/ORM/Test/Image/CrudData.yml']);\n $image = $objects['image-1'];\n\n $this->assertTrue((bool)$image->getImage());\n\n $imageUrl = $this->getAbsoluteUri($uploaderHelper->asset($image, 'imageFile'));\n $this->assertTrue(FileUtil::isFile($imageUrl));\n\n $this->sendDeleteRestRequest('/api/images/' . $image->getId() . '/file/image');\n\n // Test in DB\n $doctrine = $this->getContainer()->get('doctrine');\n $doctrine->getManager()->clear(Image::class);\n $image = $this->getRepository(Image::class)->find($image->getId());\n\n $this->assertFalse((bool)$image->getImage());\n $this->assertFalse(FileUtil::isFile($imageUrl));\n }",
"public function deleteImage()\n {\n // image in database is stored as:\n // storage/products/46f02s5B7RWYJZAvz354bitvvNJatUvZ70WuZqfg.png\n // to delete we want products/46f02s5B7RWYJZAvz354bitvvNJatUvZ70WuZqfg.png\n\n $imageExplode = explode(\"/\",$this->image);\n\n Storage::delete(\"$imageExplode[1]/$imageExplode[2]\");\n }",
"public function delete_image($img) {\r\n $this->db->where('image_path', $img);\r\n $this->db->delete('image_upload');\r\n }",
"function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_Link WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_Link set ImageID='0' WHERE ID='$this->ID'\" );\n }",
"public function forceDeleted(Image $Image)\n {\n //\n }",
"function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_LinkGroup WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_LinkGroup set ImageID='0' WHERE ID='$this->ID'\" );\n }",
"public function deleteImage() {\n\t\tFile::delete(public_path('img/articles/').$this->image);\n\t}",
"function deleteImage($image_id, $db, $file_name, $rest_id) {\r\n\tdeleteStatement($db, 'Images', 'ImageId', $image_id);\r\n\r\n\t$update_query = \"UPDATE Restaurant\r\n\t\t\t\t\tSET ImageId = 0\r\n\t\t\t\t\tWHERE RestaurantId = :id\";\r\n\r\n\t$update_statement = $db->prepare($update_query);\r\n\t$update_statement->bindValue(':id', $rest_id);\r\n\t$update_statement->execute();\r\n\r\n\tunlink(\"uploads/\" . $file_name);\r\n}",
"private function _deletePicture() {\n @unlink($this->getPicturePath());\n }",
"public function del_image(){\n \tif($_POST){\n \t\textract($_POST);\n \t\t// pa('','d');\n\n \t\tif( Up::delete([\"file\"=>$file]))\n \t\t\techo \"deleted\";\n \t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get group assignment submission date since it won't come through for a user in a group unless they were the one's to upload the file | public function get_group_assign_submission_date($userid, $contextid) {
global $remotedb;
// Group submissions.
$sql = "SELECT su.timemodified
FROM {files} f
JOIN {assign_submission} su ON f.itemid = su.id
LEFT JOIN {groups_members} gm ON su.groupid = gm.groupid AND gm.userid = ?
WHERE contextid=? AND filesize > 0 AND su.groupid <> 0";
$params = array($userid, $contextid);
$files = $remotedb->get_recordset_sql($sql, $params, $limitfrom = 0, $limitnum = 0);
$out = array();
foreach ($files as $file) {
$out[] = $file->timemodified;
}
$br = html_writer::empty_tag('br');
return implode($br, $out);
} | [
"public function getSubmissionDate()\r\n {\r\n return $this->submissionDate;\r\n }",
"public function getSubmissionDate()\n {\n return $this->submissionDate;\n }",
"public function getSubmissionDate() {\n\t\treturn $this->submissionDate;\n\t}",
"public function getApplicantSubmissionDate()\n {\n return $this->getProperty('applicant_submission_date');\n }",
"private function getValidComparissonDate() {\r\n if (is_numeric($this->decisiongroup) && $this->decisiongroup > 0) {\r\n $query = $this->db->select('creation_date, restart_date')\r\n ->from('page_group')\r\n ->where('page_groupid', $this->decisiongroup)\r\n ->get();\r\n\r\n if ($query->num_rows() > 0) {\r\n $row = $query->row();\r\n if ($row->restart_date == NULL) {\r\n return $row->creation_date;\r\n }\r\n return $row->restart_date;\r\n }\r\n } else {\r\n $query = $this->db->select('testtype, restart_date')\r\n ->from('landingpage_collection')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->get();\r\n\r\n if ($query->num_rows() > 0) {\r\n $this->ismpt = $query->row()->testtype == OPT_TESTTYPE_MULTIPAGE;\r\n return $query->row()->restart_date;\r\n }\r\n }\r\n return date('Y-m-d');\r\n }",
"public function getAllowModerationSpecificCreationDateForFile()\n {\n return $this->allowModerationSpecificCreationDateForFile;\n }",
"public function getAllowModerationSpecificCreationDateForPost()\n {\n return $this->allowModerationSpecificCreationDateForPost;\n }",
"function getDateAssigned() {\n\t\treturn $this->getData('dateAssigned');\n\t}",
"public function getDApprovalRequestDate()\r\n {\r\n return $this->dApprovalRequestDate;\r\n }",
"public function getRequestedEnrollmentProfileAssignmentDateTime()\n {\n if (array_key_exists(\"requestedEnrollmentProfileAssignmentDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"])) {\n return $this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"];\n } else {\n $this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"] = new \\DateTime($this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"]);\n return $this->_propDict[\"requestedEnrollmentProfileAssignmentDateTime\"];\n }\n }\n return null;\n }",
"function &show_approved_bydate ($assignment, $assign_type_id) {\n\trequire (MYSQL); // Database connection.\n\t$query = \"SELECT user_id, CONCAT( u.first_name, ' ', u.last_name ) AS Name, MAX( week_of ) AS Last\n\t\tFROM assignments\n\t\tINNER JOIN users AS u\n\t\tUSING ( user_id ) \n\t\tWHERE $assignment = 1\n\t\tAND assign_type_id = $assign_type_id\n\t\tGROUP BY Name\n\t\tORDER BY Last\";\n\t$r = mysqli_query ($dbc, $query) OR die(\"MySQL error: \" . mysqli_error($dbc) . \"<hr>\\nQuery: $query\");\n\trequire (CLSMYSQL); // Close the database connection.\n\treturn $r;\n}",
"public function getGroupDateCreated(){\n return($this->groupDateCreated);\n }",
"function getModDate() \n {\n return $this->getValueByFieldName( 'label_moddate' );\n }",
"public function getUploadDate();",
"function assignment_submit($userid, $assignment_id, $submission_date,\n\t$submission_ip, $file_path, $file_name, $comments,\n\t$grade, $grade_comments, $grade_submission_date,\n\t$grade_submission_ip)\n{\n\tglobal $action, $userid_map, $new_course_code, $course_addusers;\n\tif (!$action) return;\n\tif (!$course_addusers) return;\n\tmysql_select_db($new_course_code);\n\t$values = array();\n\tforeach (array($assignment_id, $submission_date,\n\t\t$submission_ip, $file_path, $file_name, $comments,\n\t\t$grade, $grade_comments, $grade_submission_date,\n\t\t$grade_submission_ip) as $v) {\n\t\t$values[] = quote($v);\n\t}\n\tdb_query(\"INSERT into assignment_submit\n\t\t(uid, assignment_id, submission_date,\n\t\t submission_ip, file_path, file_name,\n\t\t comments, grade, grade_comments, grade_submission_date,\n\t\t grade_submission_ip) VALUES (\".\n\t\t quote($userid_map[$userid]). \", \".\n\t\t join(\", \", $values). \")\");\n}",
"function sc_add_group_assignment( $assignment, $group_id, $disable_reminders = false ) {\n\n\tif ( ( empty( $assignment['content'] ) && empty( $assignment['lessons'] ) ) || empty( $assignment['date'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $timezone = get_option( 'timezone_string', 'America/Los_Angeles' ) ) {\n\t\t$timezone = 'America/Los_Angeles';\n\t}\n\n\t$date = new DateTime( $assignment['date'] . ' 23:59:59', new DateTimeZone( $timezone ) );\n\n\t$assignment['id'] = wp_insert_post( array(\n\t\t'post_author' => get_current_user_id(),\n\t\t'post_type' => 'sc_assignment',\n\t\t'post_status' => 'publish',\n\t\t'post_title' => 'Assignment',\n\t\t'post_content' => $assignment['content'],\n\t\t'post_date' => $date->format( 'Y-m-d H:i:s' ),\n\t) );\n\n\tif ( ! $assignment['id'] ) {\n\t\treturn false;\n\t}\n\n\twp_set_post_terms( $assignment['id'], $group_id, 'sc_group' );\n\n\tif ( ! empty( $assignment['lessons'] ) ) {\n\t\tupdate_post_meta( $assignment['id'], 'lessons', array_map( 'absint', (array) $assignment['lessons'] ) );\n\t}\n\n\tif ( $disable_reminders ) {\n\t\tupdate_post_meta( $assignment['id'], 'disable_reminders', true );\n\t}\n\n\tdo_action( 'sc_assignment_create', $assignment, $group_id );\n\n\treturn $assignment['id'];\n}",
"function getSubmissionFileId() {\r\n\t\treturn $this->getData('submissionFileId');\r\n\t}",
"public function getSubmissionDate($report) {\r\n\t\tif (!isset($report->response_code)) return -1;\r\n\t\tif ($report->response_code != 1) return -1;\r\n\t\tif (!isset($report->scan_date)) return -1;\r\n\r\n\t\treturn $report->scan_date;\r\n\t}",
"function getPostDate(): bool|string {\n\t\t\t$t = pathinfo($this->path)[\"filename\"];\n\t\t\treturn date(\"d.m.Y\", $t);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set sql_mode=TRADITIONAL for mysql server. This static function is intended as closure for on afterOpen raised by yii\db\Connection and should be configured in dynamic.php like this: 'on afterOpen' => ['zikwall\easyonline\libs\Helpers', 'SqlMode'], This is mainly required for grouped notifications. | public static function SqlMode($event)
{
/* set sql_mode only for mysql */
if ($event->sender->driverName == 'mysql') {
try {
$event->sender->createCommand('SET SESSION sql_mode=""; SET SESSION sql_mode="NO_ENGINE_SUBSTITUTION"')->execute();
} catch (\Exception $ex) {
\Yii::error('Could not switch SQL mode: '. $ex->getMessage());
}
}
} | [
"private function getCorrectSqlMode()\n {\n $sql = sprintf(\"set sql_mode ='%s'\", $this->mySqlMode);\n DataLayer::executeNone($sql);\n\n $query = \"select @@sql_mode;\";\n $tmp = DataLayer::executeRows($query);\n $this->mySqlMode = $tmp[0]['@@sql_mode'];\n }",
"public function getSqlMode();",
"function db_setSQLmode() {\n\t// not needed?\n\treturn true;\n}",
"public function setMySqlMode(): void\n {\n $sql = 'SET sql_mode = \\'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\\'';\n Yii::$app->db->createCommand($sql)->execute();\n }",
"function db_setSQLmode() {\n\treturn query('SET SESSION sql_mode=\"\"', false);\n}",
"protected function setSQLMode() {\n\t\ttry {\n\t\t\t$statement = $this->prepareStatement(\"SET SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES'\");\n\t\t\t$statement->execute();\n\t\t}\n\t\tcatch (DatabaseException $e) {\n\t\t\t// ignore\n\t\t}\n\t}",
"public function set_sql_mode($modes = array())\n {\n }",
"public function setSqlMode(array $modes = []);",
"public function set_sql_mode($modes = array())\n {\n }",
"function SetNonStrictMode ( $mysql )\n{\n\n WriteLog ( \"Enter SetNonStrictMode\" );\n\n /* like SQLyog app we dont check the MySQL version. We just execute the statement and ignore the error if any */\n $query = \"set sql_mode=''\";\n $result = yog_mysql_query ( $query, $mysql );\n \n WriteLog ( \"Exit SetNonStrictMode\" );\n\n return;\n}",
"function db_set_connection_mode($name)\n {\n if(\n !(is_string($name) && trim($name) !== \"\")\n || !db_use_multiple_connection_modes()\n || !array_key_exists($name, $GLOBALS[\"db\"])\n )\n {\n return;\n }\n\n // IMPORTANT: It is the responsibility of each function to clear the current db mode once it finished running the \n // query as the variable is not meant to persist between queries.\n $GLOBALS[\"db_connection_mode\"] = $name;\n\n return;\n }",
"private function set_sql_constraints($mode)\n\t{\n\t\tswitch ($mode)\n\t\t{\n\t\t\tcase 'post':\n\t\t\tcase 'message':\n\t\t\t\t$this->sql_id = 'post_msg_id';\n\t\t\t\t$this->sql_where = ' AND in_message = ' . ($mode == 'message' ? 1 : 0);\n\t\t\tbreak;\n\n\t\t\tcase 'topic':\n\t\t\t\t$this->sql_id = 'topic_id';\n\t\t\tbreak;\n\n\t\t\tcase 'user':\n\t\t\t\t$this->sql_id = 'poster_id';\n\t\t\tbreak;\n\n\t\t\tcase 'attach':\n\t\t\tdefault:\n\t\t\t\t$this->sql_id = 'attach_id';\n\t\t\tbreak;\n\t\t}\n\t}",
"public function disableStrictMode()\n {\n if ($this->driver != 'mysql') {\n return;\n }\n\n if ($this->strictModeDisabled || $this->db->getConfig('strict') === false) {\n return;\n }\n\n $this->db->statement(\"SET @@SQL_MODE=''\");\n $this->strictModeDisabled = true;\n }",
"function _enforceSQLCompatibility()\n\t{\n\t\t$configuration =& JoomlapackModelRegistry::getInstance();\n\t\t$db =& $this->_getDB();\n\t\tif($this->getError()) return;\n\n\t\tswitch( $configuration->get('MySQLCompat') )\n\t\t{\n\t\t\tcase 'compat':\n\t\t\t\t$sql = \"SET SESSION sql_mode='HIGH_NOT_PRECEDENCE,NO_TABLE_OPTIONS'\";\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$sql = \"SET SESSION sql_mode=''\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$db->setQuery( $sql );\n\t\t$db->query();\n\t}",
"private function setMode()\n {\n if (!empty($this->getDetail('mode'))) {\n return;\n }\n $mode = self::SELECT;\n switch (true) {\n case $this->isUpdateMode():\n $mode = self::UPDATE;\n break;\n case $this->isInsertManyMode():\n $mode = self::INSERT_MULTIPLE;\n break;\n case $this->isInsertMode():\n $mode = self::INSERT;\n break;\n default :\n break;\n }\n\n $this->queryDetail['mode'] = $mode;\n }",
"public function setSqlMode(array $modes = [])\n {\n $this->prepare($this->adapter->setSqlMode($modes));\n $this->execute();\n }",
"function bps_get_sql_mode() {\nglobal $wpdb;\n$sql_mode_var = 'sql_mode';\n$mysqlinfo = $wpdb->get_results( $wpdb->prepare( \"SHOW VARIABLES LIKE %s\", $sql_mode_var ) );\t\n\t\n\tif ( is_array( $mysqlinfo ) ) { \n\t\t$sql_mode = $mysqlinfo[0]->Value;\n\t\tif ( empty( $sql_mode ) ) { \n\t\t\t$sql_mode = __('Not Set', 'bulletproof-security');\n\t\t} else {\n\t\t\t$sql_mode = __('Off', 'bulletproof-security');\n\t\t}\n\t}\n}",
"public function getConnectionSqlMode($name)\n {\n if (!isset($this->config[$name]['sql'])) {\n return null;\n }\n\n return $this->config[$name]['sql'];\n }",
"private function _getInitCommand()\n {\n $version = $this->_adapter->getServerVersion();\n if (version_compare($version, '8.0.11', '<')) {\n return \"SET SESSION sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'\";\n } else {\n return \"SET SESSION sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'\";\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new DealersSubscriber model or finds the DealersSubscriber model based on abonent_phone. If the model is not found, a 400 HTTP exception will be thrown. | public function actionAdd()
{
$model = new DealersSubscribers;
if ($model->load(\Yii::$app->request->post(), '') && $model->save()) {
$text = 'Уважаемый абонент! Сервис МТС Деньги – это информирование о начислениях и все платежи без комиссии, с мобильного и банковских карт. Для регистрации перейдите на http://dengi.mts.by/app';
/** TODO рвскомитеть перед релизом */
//PhoneService::sendAbstractSms($model->subscriber_phone, $text);
return true;
}
if ($model->hasErrors()) {
return $this->returnFieldError($model);
}
throw new HttpException(400);
} | [
"public function createAweberSubscriberFromMdsInput($updateOrInsert, PennsouthResident $pennsouthResident, AweberSubscriber $aweberSubscriber = null) {\n\n $aweberUpdateRequired = false;\n if ($updateOrInsert == self::UPDATE) {\n $aweberSubscriberUpdated = $this->updateAweberSubscriberActionReasonAndPrevCustomFields($pennsouthResident, $aweberSubscriber);\n if ( !is_null($aweberSubscriberUpdated) and ($aweberSubscriberUpdated instanceof AweberSubscriber) ) {\n $aweberUpdateRequired = TRUE;\n $aweberSubscriber = $aweberSubscriberUpdated;\n }\n }\n\n if ($updateOrInsert == self::INSERT or $aweberUpdateRequired) {\n if ($updateOrInsert == self::INSERT) {\n $aweberSubscriber = new AweberSubscriber();\n }\n $aweberSubscriber->setPennSouthBuilding($pennsouthResident->getBuilding());\n $aweberSubscriber->setFloorNumber($pennsouthResident->getFloorNumber());\n $aweberSubscriber->setApartment($pennsouthResident->getAptLine());\n $aweberSubscriber->setEmail($pennsouthResident->getEmailAddress());\n $aweberSubscriber->setResidentCategory( is_null( $pennsouthResident->getMdsResidentCategory()) ? \"\" : $pennsouthResident->getMdsResidentCategory());\n $aweberSubscriber->setParkingLotLocation( is_null( $pennsouthResident->getParkingLotLocation()) ? \"\" : $pennsouthResident->getParkingLotLocation());\n $aweberSubscriber->setIsDogInApt( is_null ( $pennsouthResident->getIsDogInApt()) ? \"\" : $pennsouthResident->getIsDogInApt());\n $aweberSubscriber->setStorageLockerClosetBldg( is_null( $pennsouthResident->getStorageLockerClosetBldgNum()) ? \"\" : $pennsouthResident->getStorageLockerClosetBldgNum() );\n $aweberSubscriber->setStorageLockerNum( is_null ( $pennsouthResident->getStorageLockerNum()) ? \"\" : $pennsouthResident->getStorageLockerNum());\n $aweberSubscriber->setStorageClosetFloorNum( is_null($pennsouthResident->getStorageClosetFloorNum()) ? \"\" : $pennsouthResident->getStorageClosetFloorNum());\n $aweberSubscriber->setBikeRackBldg( is_null( $pennsouthResident->getBikeRackBldg()) ? \"\" : $pennsouthResident->getBikeRackBldg());\n $aweberSubscriber->setBikeRackRoom( is_null( $pennsouthResident->getBikeRackRoom()) ? \"\" : $pennsouthResident->getBikeRackRoom() );\n $aweberSubscriber->setBikeRackLocation( is_null( $pennsouthResident->getBikeRackLocation()) ? \"\" : $pennsouthResident->getBikeRackLocation() );\n $aweberSubscriber->setWoodworkingMember( is_null( $pennsouthResident->getWoodworkingMember()) ? \"\" : $pennsouthResident->getWoodworkingMember());\n $aweberSubscriber->setHomeownerInsIntervalRemaining( is_null($pennsouthResident->getHomeownerInsIntervalRemaining()) ? \"\" : $pennsouthResident->getHomeownerInsIntervalRemaining());\n $aweberSubscriber->setYouthRoomMember(is_null($pennsouthResident->getYouthRoomMember()) ? \"\" : $pennsouthResident->getYouthRoomMember());\n $aweberSubscriber->setResidentCategory(is_null($pennsouthResident->getMdsResidentCategory()) ? \"\" : $pennsouthResident->getMdsResidentCategory());\n $aweberSubscriber->setCeramicsMember(is_null($pennsouthResident->getCeramicsMember()) ? \"\" : $pennsouthResident->getCeramicsMember());\n $aweberSubscriber->setGardenMember(is_null($pennsouthResident->getGardenMember()) ? \"\" : $pennsouthResident->getGardenMember());\n $aweberSubscriber->setGymMember(is_null($pennsouthResident->getGymMember()) ? \"\" : $pennsouthResident->getGymMember());\n $aweberSubscriber->setVehicleRegIntervalRemaining(is_null($pennsouthResident->getVehicleRegIntervalRemaining()) ? \"\" : $pennsouthResident->getVehicleRegIntervalRemaining());\n $aweberSubscriber->setToddlerRoomMember(is_null($pennsouthResident->getToddlerRoomMember()) ? \"\" : $pennsouthResident->getToddlerRoomMember());\n $aweberSubscriber->setIncAffidavitReceived(is_null($pennsouthResident->getIncAffidavitReceived()) ? \"\" : $pennsouthResident->getIncAffidavitReceived());\n $aweberSubscriber->setHpersonId(is_null($pennsouthResident->getHpersonId()) ? \"\" : $pennsouthResident->getHpersonId());\n $aweberSubscriber->setName(is_null($pennsouthResident->getFirstName() . \" \" . $pennsouthResident->getLastName()) ? \"\" : $pennsouthResident->getFirstName() . \" \" . $pennsouthResident->getLastName());\n $aweberSubscriber->setFirstName(is_null($pennsouthResident->getFirstName()) ? \"\" : $pennsouthResident->getFirstName());\n $aweberSubscriber->setLastName(is_null($pennsouthResident->getLastName()) ? \"\" : $pennsouthResident->getLastName());\n $aweberSubscriber->setAptSurrendered(is_null($pennsouthResident->getAptSurrendered()) ? \"\" : $pennsouthResident->getAptSurrendered());\n $customFields = array ( AweberFieldsConstants::BUILDING => $aweberSubscriber->getPennSouthBuilding(),\n AweberFieldsConstants::FLOOR_NUMBER => $aweberSubscriber->getFloorNumber(),\n AweberFieldsConstants::APARTMENT => $aweberSubscriber->getApartment(),\n AweberFieldsConstants::RESIDENT_CATEGORY => $aweberSubscriber->getResidentCategory(),\n AweberFieldsConstants::PARKING_LOT_LOCATION => $aweberSubscriber->getParkingLotLocation(),\n AweberFieldsConstants::IS_DOG_IN_APT => $aweberSubscriber->getIsDogInApt(),\n AweberFieldsConstants::STORAGE_LOCKER_CLOSET_BLDG_NUM => $aweberSubscriber->getStorageLockerClosetBldg(),\n AweberFieldsConstants::STORAGE_LOCKER_NUM => $aweberSubscriber->getStorageLockerNum(),\n AweberFieldsConstants::STORAGE_CLOSET_FLOOR_NUM => $aweberSubscriber->getStorageClosetFloorNum(),\n AweberFieldsConstants::BIKE_RACK_BLDG => $aweberSubscriber->getBikeRackBldg(),\n AweberFieldsConstants::BIKE_RACK_ROOM => $aweberSubscriber->getBikeRackRoom(),\n AweberFieldsConstants::BIKE_RACK_LOCATION => $aweberSubscriber->getBikeRackLocation(),\n AweberFieldsConstants::WOODWORKING_MEMBER => $aweberSubscriber->getWoodworkingMember(),\n AweberFieldsConstants::HOMEOWNER_INS_INTERVAL_REMAINING => $aweberSubscriber->getHomeownerInsIntervalRemaining(),\n AweberFieldsConstants::YOUTH_ROOM_MEMBER => $aweberSubscriber->getYouthRoomMember(),\n AweberFieldsConstants::CERAMICS_MEMBER => $aweberSubscriber->getCeramicsMember(),\n AweberFieldsConstants::GARDEN_MEMBER => $aweberSubscriber->getGardenMember(),\n AweberFieldsConstants::GYM_MEMBER => $aweberSubscriber->getGymMember(),\n AweberFieldsConstants::VEHICLE_REG_INTERVAL_REMAINING => $aweberSubscriber->getVehicleRegIntervalRemaining(),\n AweberFieldsConstants::TODDLER_ROOM_MEMBER => $aweberSubscriber->getToddlerRoomMember(),\n AweberFieldsConstants::INCOME_AFFIDAVIT_RECEIVED => $aweberSubscriber->getIncAffidavitReceived(),\n AweberFieldsConstants::HPERSON_ID => $aweberSubscriber->getHpersonId()\n );\n $aweberSubscriber->setCustomFields($customFields);\n return $aweberSubscriber;\n }\n\n return null;\n\n }",
"public function testFindOrCreateSubscriberForExistingUser()\n {\n $subscriber = $this->getModel(\n [\n 'uid' => 5,\n 'pid' => 7,\n 'disabled' => 0,\n 'gender' => 1,\n 'first_name' => 'Michael',\n 'last_name' => 'Wagner',\n 'email' => 'mwagner@localhost.net',\n ],\n 'DMK\\\\Mkpostman\\\\Domain\\\\Model\\\\SubscriberModel'\n );\n $repo = $this->getMock(\n 'Mkpostman_Tests_DomainRepositorySubscriberRepository',\n \\get_class_methods('DMK\\\\Mkpostman\\\\Domain\\\\Repository\\\\SubscriberRepository')\n );\n $repo\n ->expects(self::once())\n ->method('findByEmail')\n ->with($this->equalTo('mwagner@localhost.net'))\n ->will(self::returnValue($subscriber));\n $repo\n ->expects(self::never())\n ->method('createNewModel');\n\n $handler = $this->getMockForAbstract(\n 'DMK\\\\Mkpostman\\\\Form\\\\Handler\\\\AbstractSubscribeHandler',\n ['getSubscriberRepository', 'getConfigurations', 'getConfId'],\n [],\n '',\n false\n );\n\n $handler\n ->expects(self::once())\n ->method('getSubscriberRepository')\n ->will(self::returnValue($repo));\n $handler\n ->expects(self::never())\n ->method('getConfId');\n\n $model = $this->callInaccessibleMethod(\n $handler,\n 'findOrCreateSubscriber',\n [\n 'email' => 'mwagner@localhost.net',\n ]\n );\n\n $this->assertInstanceOf('DMK\\\\Mkpostman\\\\Domain\\\\Model\\\\SubscriberModel', $model);\n\n $this->assertSame($model->getProperty(), $subscriber->getProperty());\n }",
"public function getSubscriberModel();",
"protected function findOrCreateSubscriber(\n array $data = []\n ) {\n $repo = $this->getSubscriberRepository();\n\n // try to find an exciting subscriber\n if (!empty($data['email'])) {\n $subscriber = $repo->findByEmail($data['email']);\n }\n\n // otherwise create a new one\n if (!$subscriber) {\n $subscriber = $repo->createNewModel();\n // a new subscriber initialy is disabled and has to be confirmed\n $subscriber->setDisabled(1);\n // set the storage pid for the new subscriber\n $subscriber->setPid(\n $this->getConfigurations()->getInt(\n $this->getConfId().'subscriber.storage'\n )\n );\n }\n\n return $subscriber;\n }",
"function InsertSubscriber($objSubscriber){\n if((int)$objSubscriber->intSubscriberId > 0){\n //update the subscriber\n return Database::Get()->UpdateSubscriber($objSubscriber);\n }\n else{\n return Database::Get()->InsertSubscriber($objSubscriber);\n }\n }",
"public function testCanInsertSubscriberWithoutRelatedCustomer()\n {\n $this->assertEquals($this->getUkCount(), 0);\n\n $subscriber = $this->createSubscriber();\n $subscriber->save();\n $subscriberId = $subscriber->getSubscriberId();\n $this->assertNotNull($subscriberId);\n\n $this->helper->updateAll(true);\n\n $uk = $this->helper->searchBySubscriberId($subscriberId);\n $this->assertEquals($uk->getSubscriberId(), $subscriberId);\n $this->assertNull($uk->getCustomerId());\n }",
"public function receiver()\n {\n return $this->hasOne('App\\Parcel_receiver');\n }",
"public function testFindOrCreateSubscriberForNewUser()\n {\n $repo = $this->getMock(\n 'Mkpostman_Tests_DomainRepositorySubscriberRepository',\n \\get_class_methods('DMK\\\\Mkpostman\\\\Domain\\\\Repository\\\\SubscriberRepository')\n );\n $repo\n ->expects(self::once())\n ->method('findByEmail')\n ->with($this->equalTo('mwagner@localhost.net'))\n ->will(self::returnValue(null));\n $repo\n ->expects(self::once())\n ->method('createNewModel')\n ->will(\n self::returnValue(\n $this->getModel(\n [],\n 'DMK\\\\Mkpostman\\\\Domain\\\\Model\\\\SubscriberModel'\n )\n )\n );\n\n $configuration = $this->createConfigurations(\n [\n 'subscribe.' => [\n 'subscriber.' => [\n 'storage' => 14,\n ],\n ],\n ],\n 'mkpostman'\n );\n\n $handler = $this->getMockForAbstract(\n 'DMK\\\\Mkpostman\\\\Form\\\\Handler\\\\AbstractSubscribeHandler',\n ['getSubscriberRepository', 'getConfigurations', 'getConfId'],\n [],\n '',\n false\n );\n\n $handler\n ->expects(self::once())\n ->method('getSubscriberRepository')\n ->will(self::returnValue($repo));\n $handler\n ->expects(self::once())\n ->method('getConfigurations')\n ->will(self::returnValue($configuration));\n $handler\n ->expects(self::once())\n ->method('getConfId')\n ->will(self::returnValue('subscribe.'));\n\n $model = $this->callInaccessibleMethod(\n $handler,\n 'findOrCreateSubscriber',\n [\n 'email' => 'mwagner@localhost.net',\n ]\n );\n\n $this->assertInstanceOf('DMK\\\\Mkpostman\\\\Domain\\\\Model\\\\SubscriberModel', $model);\n\n // the created model should have a pid and should be disabled, nothing else\n $this->assertCount(2, $model->getProperty());\n $this->assertSame(1, $model->getDisabled());\n $this->assertSame(14, $model->getpid());\n }",
"public function subscribe($Model, $data) {\n\t\t\n\t\tif (is_array($data)) {\n\t\t\tif (!empty($data[0]['Subscriber'])) {\n\t\t\t\t// handle multiple subscribers\n\t\t\t\tfor ($i = 1; $i <= count($data); $i++) {\n\t\t\t\t\t$subscriber['Subscriber']['user_id'];\n\t\t\t\t\t$subscriber['Subscriber']['email'];\n\t\t\t\t\t// something like : $this->subscribe($Model, $subscriber); // a call to itself for the save\n\t\t\t\t}\n\t\t\t\tdebug($subscriber);\n\t\t\t\tdebug('handle many subscribers at once here');\n\t\t\t\t// something like $this->subscribe($Model, $)\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// handle a single subscriber \n\t\t\t\t$email = !empty($subscriber['Subscriber']['email']) ? $subscriber['Subscriber']['email'] : $this->Subscriber->User->field('email', array('User.id' => $data['Subscriber']['user_id']));\n\t\t\t\t$userId = $data['Subscriber']['user_id'];\n\t\t\t\t$subscriber['Subscriber']['email'] = !empty($email) ? $email : null;\n\t\t\t\t$modelName = !empty($data['Subscriber']['model']) ? $data['Subscriber']['model'] : $this->modelName;\n\t\t\t\t$foreignKey = $data['Subscriber']['foreign_key'] ? $data['Subscriber']['foreign_key'] : $Model->data[$this->modelName][$this->foreignKey];\n\t\t\t}\n\t\t} else {\n\t\t\t// just a single user id coming in\n\t\t\t$userId = $data;\n\t\t\t$email = $this->Subscriber->User->field('email', array('User.id' => $userId));\n\t\t\t$modelName = $this->modelName;\n\t\t\t$foreignKey = $Model->data[$this->modelName][$this->foreignKey];\n\t\t}\n\t\t\n\t\t// finalize the data before saving\n\t\t$subscriber['Subscriber']['user_id'] = $userId;\n\t\t$subscriber['Subscriber']['email'] = !empty($email) ? $email : null;\n\t\t$subscriber['Subscriber']['model'] = $modelName;\n\t\t$subscriber['Subscriber']['foreign_key'] = $foreignKey;\n\t\t$subscriber['Subscriber']['is_active'] = 1;\n\t\t\n\t\tif ($this->Subscriber->save($subscriber)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n \t}",
"public function store()\n {\n $input = Request::all();\n\n $input['group_id'] = User::GROUP_SUB_CONTRACTOR;\n $input['company_id'] = $this->repo->getScopeId();\n\n $rules = array_merge(User::getNonLoggableUserRules(), UserProfile::getCreateRules());\n $rules['rate_sheet'] = 'array';\n $validator = Validator::make($input, $rules);\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n DB::beginTransaction();\n try {\n $subContractor = $this->executeCommand('\\App\\Commands\\UserCreateCommand', $input);\n\n $vendor = $this->vendorService->saveSubContractorVendor($subContractor, $input);\n\n // assign trades\n if (ine($input, 'trades')) {\n $subContractor = $this->repo->assignTrades($subContractor, (array)$input['trades']);\n }\n\n // assign worktype\n if (ine($input, 'work_types')) {\n $subContractor = $this->repo->assigWorkTypes($subContractor, (array)$input['work_types']);\n }\n\n // save sub contractor rate sheet\n if (isset($input['rate_sheet'])) {\n $financial = $this->saveFinancialDetails($subContractor, $input);\n\n if ($financial instanceof App\\CustomValidationRules\\CustomValidationRules) {\n return ApiResponse::validation($financial);\n }\n }\n\n $resourceId = $this->createResourceDir($subContractor);\n $subContractor->resource_id = $resourceId;\n $subContractor->save();\n $subContractor = User::findOrFail($subContractor->id);\n } catch(DuplicateVendor $e) {\n\t\t\tDB::rollback();\n\n\t\t\treturn ApiResponse::errorGeneral($e->getMessage());\n } catch (\\Exception $e) {\n DB::rollback();\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n DB::commit();\n\n Event::fire('JobProgress.Events.VendorCreated', new VendorCreated($vendor));\n\n return ApiResponse::success([\n 'message' => trans('response.success.saved', ['attribute' => 'Sub Contractor']),\n 'data' => $this->response->item($subContractor, new SubContractorsTransformer),\n ]);\n }",
"public function __construct(\n \\DMK\\Mkpostman\\Domain\\Model\\SubscriberModel $subscriber = null\n ) {\n $this->subscriber = $subscriber;\n }",
"public function givePhone(){\r\n\t\t$CPhone = ClientPhone::model() -> findByAttributes(array('mangoTalker' => $this -> mangoTalker), array('with' => 'phone'));\r\n\t\tif ((!$CPhone)&&(preg_match('/^7812\\d+/',$this -> mangoTalker))) {\r\n\t\t\t$CPhone = ClientPhone::model() -> findByAttributes(array('mangoTalker' => str_replace('7812','',$this -> mangoTalker)), array('with' => 'phone'));\r\n\t\t}\r\n\t\treturn UserPhone::model() -> findByPK($CPhone -> id_phone);\r\n\t}",
"abstract public function createCandidate( $model );",
"public function testCreateSubscriber()\n {\n // Get auth token\n $token = $this->authenticate();\n\n // Create Subscriber data\n $data = [\n 'email' => $this->faker->unique()->safeEmail,\n 'firstname' => $this->faker->name,\n 'lastname' => $this->faker->name,\n 'state' => 'active'\n ];\n\n // Send Subscriber store\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '. $token,\n ])->json('POST', route('subscribers.store'), $data);\n\n // test successful response\n $response->assertStatus(200);\n }",
"public function created(Phone $phone)\n {\n //\n }",
"public function test_duplicate_subscriber()\n {\n ApiKey::create(['apikey_value' => Crypt::encryptString(env('MAILERLITE_KEY'))]);\n\n $email = $this->faker->unique()->safeEmail();\n $name = $this->faker->name();\n\n $response = $this->json('POST', '/subscribers', [\n 'email' => $email,\n 'name' => $name,\n 'country' => 'Fake Country'\n ]);\n\n $response->assertStatus(200);\n\n $response = $this->json('POST', '/subscribers', [\n 'email' => $email,\n 'name' => $name,\n 'country' => 'Fake Country'\n ]);\n\n $response->assertStatus(200);\n $response->assertJson([\n 'error' => true,\n 'message' => 'A subscriber with the same email exists.'\n ]);\n }",
"function actionCreateAdvisorSubscription() {\n if (!isset(Yii::app()->getSession()->get('wsadvisor')->id)) {\n $this->sendResponse(200, CJSON::encode(array(\"status\" => \"ERROR\", \"message\" => \"Session Expired\")));\n }\n $advisorId = Yii::app()->getSession()->get('wsadvisor')->id;\n\n $advisorDetails = array();\n $email = \"\";\n $zipcode = \"\";\n $plan = \"\";\n $planname = \"\";\n $description = \"\";\n $message = \"\";\n\n if ($advisorId) {\n $advisorDetails = Advisor::model()->find(\"id = :advisor_id\", array(\"advisor_id\" => $advisorId));\n }\n if ($advisorDetails) {\n $email = $advisorDetails->email;\n\n if (isset($_POST['zipCode'])) {\n $zipcode = $_POST['zipCode'];\n $advisorDetails->zip = $zipcode;\n $advisorDetails->save();\n }\n }\n\n $subscription = AdvisorSubscription::model()->find(array('condition' => \"advisor_id=:advisor_id\",'params' => array(\"advisor_id\" => $advisorId)));\n\n if ($subscription && isset($subscription->stripesubscriptionid) && $subscription->stripesubscriptionid != \"\") {\n $this->sendResponse(200, CJSON::encode(array('status' => 'ERROR', 'subscription_status' => 'already_exists',\n 'message' => 'Our records show that you already have an active advisor subscription. If your credit card needs to be updated in order to renew your\n FlexScore Pro Subscription, please use the <a href=\"javascript:window.parent.openCreditCardDialog()\">update credit card form</a>.')));\n }\n\n if (!$subscription) {\n $subscription = new AdvisorSubscription();\n $subscription->subscriptionstart = date(\"Y-m-d H:i:s\");\n }\n\n $trialEndString = \"\";\n $trialPeriod = false;\n $earlyBirdEndDate = new DateTime(\"2015-01-01 00:00:00\");\n $currentPeriodEndString = \"\";\n $currentPeriodStartString = date(\"Y-m-d H:i:s\");\n\n // Early bird subscriptions will be in effect until December 31, 2014.\n // Early bird subscriptions will receive a 60 day trial period.\n $created = new DateTime($advisorDetails->createdtimestamp);\n $today = new DateTime();\n $startTime = strtotime(date($advisorDetails->createdtimestamp));\n $trialPeriod = true;\n if ($created < $earlyBirdEndDate) {\n $plan = \"advisor-earlybird\";\n $planname = \"FlexScore Advisor Early Bird\";\n $description = \"FlexScore Early Bird subscription for \" . $email;\n $trialEndString = date(\"Y-m-d H:i:s\", strtotime(\"+60 day\", $startTime));\n } else {\n $plan = \"advisor-pro\";\n $planname = \"FlexScore Advisor Pro\";\n $description = \"FlexScore Pro subscription for \" . $email;\n $trialEndString = date(\"Y-m-d H:i:s\", strtotime(\"+7 day\", $startTime));\n }\n\n /***************************************************************************/\n /* Two slashes to test failed payments using two minute trial period\n $plan = \"advisor-test\";\n $planname = \"FlexScore Advisor Testing\";\n $description = \"FlexScore Pro subscription for \" . $email;\n $trialEndString = date(\"Y-m-d H:i:s\", strtotime(\"+5 minute\", $startTime));\n /*\n /***************************************************************************/\n\n $currentPeriodEndString = $trialEndString;\n $trialDate = new DateTime($trialEndString);\n if ($trialDate < $today) {\n $trialPeriod = false;\n $currentPeriodEndString = date(\"Y-m-d H:i:s\", strtotime(\"+1 month\", strtotime(date(\"Y-m-d H:i:s\"))));\n }\n\n try {\n $errors = array();\n\n if (isset($_POST['stripeToken'])) {\n $token = $_POST['stripeToken'];\n\n Subscription::factory();\n if ($subscription && isset($subscription->stripecustomerid) && $subscription->stripecustomerid != \"\") {\n $customer = Stripe_Customer::retrieve($subscription->stripecustomerid);\n if ($trialPeriod == true) {\n $stripeSubscription = $customer->subscriptions->create(array(\n \"card\" => $token,\n \"plan\" => $plan,\n \"trial_end\" => strtotime($trialEndString))\n );\n }\n else {\n $stripeSubscription = $customer->subscriptions->create(array(\n \"card\" => $token,\n \"plan\" => $plan)\n );\n }\n Subscription::factory();\n $customer = Stripe_Customer::retrieve($subscription->stripecustomerid);\n }\n else if ($trialPeriod == true) {\n $customer = Stripe_Customer::create(array(\n \"card\" => $token,\n \"plan\" => $plan,\n \"trial_end\" => strtotime($trialEndString),\n \"email\" => $email)\n );\n }\n else {\n $customer = Stripe_Customer::create(array(\n \"card\" => $token,\n \"plan\" => $plan,\n \"email\" => $email)\n );\n }\n if ($customer) {\n $expirationDate = date(\"Y-m-t H:i:s\", strtotime($customer->cards->data[0]->exp_year . \"-\" . $customer->cards->data[0]->exp_month . \"-01 23:59:59\"));\n\n $subscription->advisor_id = $advisorId;\n $subscription->stripecustomerid = $customer->id;\n $subscription->stripesubscriptionid = $customer->subscriptions->data[0]->id;\n $subscription->stripecardid = $customer->cards->data[0]->id;\n $subscription->cardexpirationdate = $expirationDate;\n $subscription->planname = $planname;\n $subscription->description = $description;\n $subscription->subscriptionend = null;\n $subscription->currentperiodstart = $currentPeriodStartString;\n $subscription->currentperiodend = $currentPeriodEndString;\n $subscription->cardlast4 = $customer->cards->data[0]->last4;\n $subscription->cardtype = $customer->cards->data[0]->brand;\n $subscription->processor = \"Stripe\";\n $subscription->stripestatus = $customer->subscriptions->data[0]->status;\n $subscription->modifiedtimestamp = date(\"Y-m-d H:i:s\");\n $subscription->save();\n\n //data is valid and is successfully inserted/updated\n //send the email for verification\n $part = 'advisor-account-active';\n $emailToSend = new Email();\n $emailToSend->subject = 'Advisor Subscription Now Active';\n $emailToSend->recipient['email'] = $email;\n $emailToSend->recipient['name'] = \"{$advisorDetails->firstname} {$advisorDetails->lastname}\";\n $emailToSend->data[$part] = [\n 'email' => $email\n ];\n $emailToSend->send();\n }\n $this->sendResponse(200, CJSON::encode(array('status' => 'OK', 'message' => 'Thank you! Your FlexScore Pro account is now active.')));\n }\n } catch (Exception $e) {\n $message = $this->getStripeErrorMessage($e);\n\n $this->sendResponse(200, CJSON::encode(array('status' => 'ERROR', 'message' => $message)));\n }\n $this->sendResponse(200, CJSON::encode(array('status' => 'ERROR', 'email' => $email, 'firstname' => $firstname,\n 'lastname' => $lastname, 'message' => 'Sorry, your subscription has not been processed. Please try again later.')));\n }",
"public function store()\n\t{\n $data = Input::json()->all();\n $this->validator->validate($data);\n\n $contact = new VendorContact($data);\n $contact->save();\n\n return $this->successfulResponse($contact);\n\t}",
"function addSubscriber()\n\t{\n\t\t$exec = $this->model->create(\"subscriber\",array(\"email\"=>$this->input->post(\"email\")));\n\t\t$exec = json_decode($exec);\n\t\tif($exec->status){\n\t\t\talert('alert','success','Terimakasih.','Anda telah terdaftar sebagai subscriber. Tunggu kabar terbaru dari dari kami.');\n\t\t}else{\n\t\t\talert('alert','success','Terimakasih!','Anda telah terdaftar sebagai subscriber. Tunggu kabar terbaru dari dari kami.');\n\t\t}\n\t\tredirect();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the filtered indexes (remove primary key index if it exists). | public function getFilteredIndexes()
{
if (!$this->hasPrimaryKey()) {
return $this->getIndexes();
}
$indexes = array();
foreach ($this->getIndexes() as $name => $index) {
if (!$index->hasSameColumnNames($this->getPrimaryKey()->getColumnNames())) {
$indexes[$name] = $index;
}
}
return $indexes;
} | [
"public function getFlatIndexes()\r\n {\r\n $indexes = array();\r\n\r\n $index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode());\r\n $indexes[$index] = array(\r\n 'type' => 'index',\r\n 'fields' => array($this->getAttribute()->getAttributeCode())\r\n );\r\n\r\n return $indexes;\r\n }",
"public function getFlatIndexes()\n {\n $indexes = [];\n\n $index = sprintf('IDX_%s', strtoupper($this->getAttribute()->getAttributeCode()));\n $indexes[$index] = ['type' => 'index', 'fields' => [$this->getAttribute()->getAttributeCode()]];\n\n $index = sprintf('IDX_%s_VALUE', strtoupper($this->getAttribute()->getAttributeCode()));\n $indexes[$index] = [\n 'type' => 'index',\n 'fields' => [$this->getAttribute()->getAttributeCode() . '_value'],\n ];\n\n return $indexes;\n }",
"public function getExcludeFromIndexes()\n {\n return $this->exclude_from_indexes;\n }",
"public function getIndexes()\n {\n return $this->indexes;\n }",
"public function isNotPrimaryKey() {\n\t\t$indices = new IndexCollection();\n\n\t\tforeach ($this->collection as $index) {\n\t\t\tif ($index->isPrimaryKey() === false) {\n\t\t\t\t$indices->add($index);\n\t\t\t}\n\t\t}\n\n\t\treturn $indices;\n\t}",
"public function getIndexList() {\n return self::$indexes;\n }",
"public function get_indexes_structure() {\n $indexes = array();\n $indexes_tmp = apply_filters('wpualgolia_indexes', array());\n foreach ($indexes_tmp as $index_key => $index) {\n\n /* Add to list */\n $indexes[$index_key] = $this->get_index_structure($index);\n }\n\n return $indexes;\n }",
"public function indexes()\n {\n return CMap::mergeArray(parent::indexes(),array(\n ));\n }",
"public function getIndicesCleaned(): array\n {\n return $this->indices;\n }",
"public function getIndexes()\n {\n if ($this->isEmbeddable()) {\n return [];\n }\n\n $indexes = $this->property('indexes', true);\n foreach ($this->getChildren(true) as $children) {\n $indexes = array_merge($indexes, $children->getIndexes());\n }\n\n return $indexes;\n }",
"public function getUnique()\n {\n $collection = new ModelIndexes;\n foreach($this as $Index) {\n if($Index->isUnique()) {\n $collection->append($Index);\n }\n }\n\n return $collection;\n }",
"public function blacksIndexes()\n\t{\n\t\treturn $this->blacks_indexes;\n\t}",
"public function getIndexes () {\n\t\t#coopy/CompareTable.hx:630: characters 9-23\n\t\treturn $this->indexes;\n\t}",
"abstract function readIndexFilter();",
"public function defineIndexes()\n\t{\n\t\treturn array();\n\t}",
"protected function getCommonTranslatedAttributesIndexes()\n {\n return [\n ['idx_owner_id', 'owner_id', false],\n ['idx_language', 'language', false]\n ];\n }",
"public function getExistingIndexes($table){\n $rows = $this->db->fetchAsAssoc(\"SHOW INDEXES FROM \".$this->db->quote($table));\n $arr = array();\n foreach($rows as $row) $arr[$row[\"Key_name\"]] = $row[\"Key_name\"];\n return $arr;\n }",
"public function listIndexes()\n {\n return $this->collection->getIndexInfo();\n }",
"public function indices()\n\t{\n\t\treturn $this->indices();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method inserts record in plan view table. | function insert_record_plan_view(){
$plan_id = $this->value('plan_id');
$user_id = $this->value('user_id');
if( is_numeric($plan_id) && is_numeric($user_id) ){
$arr_plan_view = array(
'plan_id' => $plan_id,
'user_id' => $user_id
);
$this->insert("plan_view", $arr_plan_view);
}
} | [
"public function insert_record(){\n\n\t\t}",
"protected function insert()\n {\n $cluster = isset($this->id) ? $this->id->cluster : $this->getClass()->defaultClusterId;\n\n $db = $this->getDatabase();\n $db->execute('recordCreate', [\n 'record' => $this,\n 'cluster' => $cluster\n ]);\n }",
"public function insertRecord()\n {\n }",
"public function insertPlan($metaFlag,$metaDescription,$year,$assessmentMethod,$population,$sampleSize,$assessmentDate,$cost,$fundingFlag,$analysisType,$administrator,$analysisMethod,$scope,$feedbackText,$feedbackFlag,$draftFlag,$userId)\n {\n\n/*\nINSERT INTO `assessment`.`plans`\n(\n -- `id`, -- auto incremented\n `created_ts`,\n `submitted_ts`,\n `modified_ts`,\n `deactivated_ts`,\n `created_user`,\n `submitted_user`,\n `modified_user`,\n `deactivated_user`,\n `draft_flag`,\n `meta_flag`,\n `funding_flag`,\n `meta_description`,\n `year`,\n `assessment_method`,\n `population`,\n `sample_size`,\n `assessment_date`,\n `cost`,\n `analysis_type`,\n `administrator`,\n `analysis_method`,\n `scope`,\n `feedback_text`,\n `feedback`,\n `active_flag`\n)\nVALUES\n(\n -- <{id: }>, auto incremented\n '1970-01-01 00:00:01',\n '1970-01-01 00:00:01',\n '1970-01-01 00:00:01',\n '1970-01-01 00:00:01',\n 19,\n 19,\n 19,\n 19,\n 0,\n 0,\n 0,\n 'meta_description',\n 2014,\n 'assessment_method:',\n 'population:',\n 'sample_size:',\n 'assessment_date:',\n 'cost:',\n 'analysis_type:',\n 'administrator:',\n 'analysis_method:',\n 'scope:',\n 'feedback_text:',\n 0,\n 0\n)\n;\n*/\n\t// database timestamp format \n //\"1970-01-01 00:00:01\";\n \n\t// create the sytem timestamp\n\t$currentTimestamp = date(\"Y-m-d H:i:s\", time());\n\t\n\t// set the submitted timestamp and user id for submitted plans only\n\t$submittedTimestamp = null;\n\t$submittedUserId = null;\n\tif ($draftFlag == \"0\") {\n\t $submittedTimestamp = $currentTimestamp;\n\t $submittedUserId = $userId;\n\t}\n \n\t$sql = new Sql($this->adapter);\n\t$data = array('created_ts' => $currentTimestamp,\n\t\t 'submitted_ts' => $submittedTimestamp,\n\t\t 'modified_ts' => $currentTimestamp,\t\t \n\t\t 'created_user' => $userId,\n\t\t 'submitted_user' => $submittedUserId,\n\t\t 'modified_user' => $userId,\n\t\t 'meta_flag' => $metaFlag,\n\t\t 'meta_description' => trim($metaDescription),\n\t\t 'year' => trim($year),\n\t\t 'assessment_method' => trim($assessmentMethod),\n\t\t 'population' => trim($population),\n\t\t 'sample_size' => trim($sampleSize),\n\t\t 'assessment_date' => trim($assessmentDate),\n\t\t 'cost' => trim($cost),\n\t\t 'funding_flag' => trim($fundingFlag),\n\t\t 'analysis_type' => trim($analysisType),\n\t\t 'administrator' => trim($administrator),\n\t\t 'analysis_method' => trim($analysisMethod),\n\t\t 'scope' => trim($scope),\n\t\t 'feedback_text' => trim($feedbackText),\n\t\t 'feedback' => trim($feedbackFlag),\n\t\t 'draft_flag' => trim($draftFlag),\n\t\t 'active_flag' => 1,\n\t\t );\n\t\t\n\t$insert = $sql->insert('plans');\n\t$insert->values($data);\t\t \n\t\t\n\t// create an automic database operation for the tuple insert and retreival of the auto-generated primary key\t\t\n\t$connection = $this->adapter->getDriver()->getConnection();\n\t$connection->beginTransaction();\n\n\t// perform the insert\n $statement = $sql->prepareStatementForSqlObject($insert);\n $statement->execute();\n\n\t// get the primary key id\n\t$rowId = $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n\t\t\n\t// finish the transaction\t\t\n\t$connection->commit();\n \n return $rowId;\n }",
"public function execute(): void\n {\n $data = $this->getData();\n $this->db->insert($this->table)->values($data)->run();\n parent::execute();\n }",
"public function insert() {\n $schema = $this->schema();\n $this->{$schema->primary_key} = cy\\DB::insert($schema->table_name)\n ->values($this->_row)\n ->returning($schema->primary_key)\n ->exec($schema->database)->rows[0][$schema->primary_key];\n }",
"public function insert($record);",
"public function add_plan()\n\t{\n\t\t$data['title']= 'New Plan';\n\t\t//get data from table tbl_plan\n\t\t$data['pageSource']= 'add';\n\t\t$this->load->helper('form');\n\t\t$this->load->view('templates/admin_header',$data);\n\t\t$this->load->view('templates/navigation',$data);\n\t\t$this->load->view('templates/plan',$data);\n\t\t$this->load->view('templates/admin_footer',$data);\n\n\t}",
"public function insertCapPlan(){\n\n $f=new Factory();\n $obj_cp=$f->returnsQuery();\n /*$query=\"insert into plan_capacitacion (id_curso, periodo, objetivo, modalidad, fecha_desde, fecha_hasta, duracion, unidad, prioridad, estado, importe, moneda, tipo_cambio, forma_pago, forma_financiacion, profesor_1, profesor_2, comentarios_plan, entidad, caracter_actividad, cantidad_participantes, importe_total, id_tipo_curso)\".\n \" values(:id_curso, :periodo, :objetivo, :modalidad, TO_DATE(:fecha_desde,'DD/MM/YYYY HH24:MI'), TO_DATE(:fecha_hasta,'DD/MM/YYYY HH24:MI'), :duracion , :unidad, :prioridad, :estado, :importe, :moneda, :tipo_cambio, :forma_pago, :forma_financiacion, :profesor_1, :profesor_2, :comentarios, :entidad, :caracter_actividad, :cantidad_participantes, :importe_total, :id_tipo_curso)\";*/\n $query=\"insert into plan_capacitacion (id_curso, periodo, objetivo, modalidad, fecha_desde, fecha_hasta, duracion, unidad, prioridad, estado, importe, moneda, tipo_cambio, forma_pago, forma_financiacion, profesor_1, profesor_2, comentarios_plan, entidad, caracter_actividad, cantidad_participantes, importe_total, id_tipo_curso, id_programa, porcentaje_reintegrable, nro_actividad)\".\n \" values(:id_curso, :periodo, :objetivo, :modalidad, TO_DATE(:fecha_desde,'DD/MM/YYYY HH24:MI'), TO_DATE(:fecha_hasta,'DD/MM/YYYY HH24:MI'), :duracion , :unidad, :prioridad, :estado, :importe, :moneda, :tipo_cambio, :forma_pago, :forma_financiacion, :profesor_1, :profesor_2, :comentarios, :entidad, :caracter_actividad, :cantidad_participantes, :importe_total, :id_tipo_curso, :programa, :porcentaje_reintegrable, :nro_actividad)\";\n $obj_cp->dpParse($query);\n\n $obj_cp->dpBind(':id_curso', $this->id_curso);\n $obj_cp->dpBind(':periodo', $this->periodo);\n $obj_cp->dpBind(':objetivo', $this->objetivo);\n $obj_cp->dpBind(':modalidad', $this->modalidad);\n $obj_cp->dpBind(':fecha_desde', $this->fecha_desde);\n $obj_cp->dpBind(':fecha_hasta', $this->fecha_hasta);\n $obj_cp->dpBind(':duracion', $this->duracion);\n $obj_cp->dpBind(':unidad', $this->unidad);\n $obj_cp->dpBind(':prioridad', $this->prioridad);\n $obj_cp->dpBind(':estado', $this->estado);\n $obj_cp->dpBind(':importe', $this->getImporte());\n $obj_cp->dpBind(':moneda', $this->moneda);\n $obj_cp->dpBind(':tipo_cambio', $this->getTipoCambio());\n $obj_cp->dpBind(':forma_pago', $this->forma_pago);\n $obj_cp->dpBind(':forma_financiacion', $this->forma_financiacion);\n $obj_cp->dpBind(':profesor_1', $this->profesor_1);\n $obj_cp->dpBind(':profesor_2', $this->profesor_2);\n $obj_cp->dpBind(':comentarios', $this->comentarios);\n $obj_cp->dpBind(':entidad', $this->entidad);\n\n $obj_cp->dpBind(':caracter_actividad', $this->getCaracterActividad());\n $obj_cp->dpBind(':cantidad_participantes', $this->getCantidadParticipantes());\n $obj_cp->dpBind(':importe_total', $this->getImporteTotal());\n $obj_cp->dpBind(':id_tipo_curso', $this->getIdTipoCurso());\n\n $obj_cp->dpBind(':programa', $this->getPrograma());\n $obj_cp->dpBind(':porcentaje_reintegrable', $this->getPorcentajeReintegrable());\n $obj_cp->dpBind(':nro_actividad', $this->getNroActividad());\n\n $obj_cp->dpExecute();\n return $obj_cp->getAffect();\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 insertRowInEntityTblDML()\n {\n\t\t$sql = $this->getQueryContent('insertRowInEntityTblDML');\n\t\treturn $this->db->fireFastSqlQuery($sql,'insertRowInEntityTblDML');\n\t}",
"public function createplan()\n {\n if($this->request->is(['post','put'])){\n $plan = $this->Plan->newEntity();\n $plan = $this->Plan->patchEntity($plan, $this->request->data);\n if ($this->Plan->save($plan)) {\n $this->Flash->plansuccess(__(\"A new plan has been created.\"));\n\n }else{\n $this->Flash->planerror(__(\"some problem during creation.\"));\n }\n }\n }",
"protected function insertStmt()\n {\n }",
"public function insertPaymentUserPlan($id_record_user_plan){\n $toinsertPayUserPlan = array(\n 'id_record_user_plan' => $id_record_user_plan,\n 'payment_date' => date('Y-m-d')\n );\n $this->db->insert('payment_user_plan', $toinsertPayUserPlan);\n }",
"function __insertViewTrack($bp_id){\n $prtnr_id = $this->Auth->user('partner_id');\n if($bp_id > 0){\n $vtrecords = $this->PartnerViewTracks->find()\n ->hydrate(false)\n ->where(['businesplan_id'=>$bp_id,'partner_id'=>$prtnr_id])\n ->first();\n if(isset($vtrecords['id'])&&$vtrecords['id'] > 0){\n return false;\n // Already exists a record in the tabe...\n }else{\n $vrec = array();\n $vrec['partner_id'] = $prtnr_id;\n $vrec['businesplan_id']= $bp_id;\n $vrec['type'] = 'Businessplan';\n $vrec['viewstatus'] = 'Viewed';\n $partnerViewTracks = $this->PartnerViewTracks->newEntity($vrec);\n if ($this->PartnerViewTracks->save($partnerViewTracks)) {\n return true;\n }\n }\n }\n return false; \n }",
"function __insertViewTrack($bp_id){\n $this->loadModel('VendorViewTracks');\n $vendor_id = $this->Auth->user('vendor_id');\n if($bp_id > 0){\n $vtrecords = $this->VendorViewTracks->find()\n ->hydrate(false)\n ->where(['businesplan_id'=>$bp_id,'vendor_id'=>$vendor_id])\n ->first();\n if(isset($vtrecords['id'])&&$vtrecords['id'] > 0){\n return false;\n // Already exists a record in the tabe...\n }else{\n $vrec = array();\n $vrec['vendor_id'] = $vendor_id;\n $vrec['businesplan_id']= $bp_id;\n $vrec['type'] = 'Businessplan';\n $vrec['viewstatus'] = 'Viewed';\n $vendorViewTracks = $this->VendorViewTracks->newEntity($vrec);\n if ($this->VendorViewTracks->save($vendorViewTracks)) {\n return true;\n }\n }\n }\n return false; \n }",
"public function add_plan()\n\t{\n\t\t$data = array(\n\t\t\t\t'plan_name'=>ucwords(strtolower($this->input->post('plan_name'))),\n\t\t\t\t'plan_description'=>$this->input->post('plan_description'),\n\t\t\t\t'plan_amount'=>$this->input->post('plan_amount'),\n\t\t\t\t'maximum_clicks'=>$this->input->post('maximum_clicks'),\n\t\t\t\t'plan_status'=>$this->input->post('plan_status'),\n\t\t\t\t'stripe_plan'=>$this->input->post('stripe_plan'),\n\t\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'created_by'=>$this->session->userdata('personnel_id'),\n\t\t\t\t'modified_by'=>$this->session->userdata('personnel_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('plan', $data))\n\t\t{\n\t\t\t//create plan in stripe\n\t\t\t$response = $this->stripe_model->create_plan($this->input->post('stripe_plan'), $this->input->post('plan_name'), $this->input->post('plan_amount'));\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"protected function insertStatement()\n {\n }",
"public static function training_plan_add() {\n global $DB;\n\n $addplanform = new \\local_evtp\\forms\\templateplanaddform();\n if ($data = $addplanform->get_data() and confirm_sesskey()) {\n $data->deleted = 0;\n return (boolean)$DB->insert_record('local_evtp_plan', $data);\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a negative temporary uniqid which is a decreasing negative integer starting from 1. The function returns negative integers until reaching minimal integer value, which an exception is thrown instead. | public static function Generate() {
if (self::$tempId === MIN_INT) {
throw new UnderflowException(
'Reached MIN_INT. Cannot generate temporary IDs for BatchJobService.');
}
return --self::$tempId;
} | [
"public function generateRandomUniquenessId()\n {\n return rand(9999999, 99999999); \n }",
"function createUniqueRandomID()\n\t{\n\t\treturn (int)(rand(99, 999999).date('U'));\n\t}",
"public static function getUniqId()\n\t{\n\t\t// NOTE: Casting to int will overflow on 32-bit PHP (for Windows) without giving 19-digit value\n\t\treturn sprintf('%.0f%03d', 10000000*microtime(true), mt_rand(1, 999));\n\t}",
"function createSurferID() {\n srand((double)microtime() * 10000000);\n // Paranoia mode: Repeat until an unused id is found\n // (which a correct implementation of uniq!!id() should\n // grant anyway ...)\n do {\n $id = (string)md5(uniqid(rand()));\n } while ($this->existID($id, TRUE));\n return $id;\n }",
"public function get_unused_id()\n {\n // Create a random user id between 1200 and 4294967295\n $random_unique_int = 2147483648 + mt_rand( -2147482448, 2147483647 );\n\n // Make sure the random user_id isn't already in use\n $query = $this->db->where( 'user_id', $random_unique_int )\n ->get_where( $this->db_table('user_table') );\n\n if( $query->num_rows() > 0 )\n {\n $query->free_result();\n\n // If the random user_id is already in use, try again\n return $this->get_unused_id();\n }\n\n return $random_unique_int;\n }",
"private static function getNextTemporaryId()\n {\n return self::$temporaryId--;\n }",
"private function _get_unused_id()\n\t{\n\t\t// Create a random user id\n\t\t$random_unique_int = mt_rand(1200,999999999);\n\n\t\t// Make sure the random user_id isn't already in use\n\t\t$query = $this->db->where('user_id', $random_unique_int)\n\t\t\t->get_where( config_item('user_table'));\n\n\t\tif( $query->num_rows() > 0 )\n\t\t{\n\t\t\t$query->free_result();\n\n\t\t\t// If the random user_id is already in use, get a new number\n\t\t\treturn $this->_get_unused_id();\n\t\t}\n\n\t\treturn $random_unique_int;\n\t}",
"public function generate_uniqid_numeric(){\n $salt = $this->numeric_randomizer();\n $data = (($this->abs)?abs(crc32(uniqid($salt))):crc32(uniqid($salt)));\n $pad = (10 - strlen($data));\n if($pad > 0){\n $leading = \"\";\n for ($i=1;$i<=$pad;$i++){\n $leading .= '0';\n }\n return $this->prefix.str_replace('-','00',str_pad($data, 10, $leading, STR_PAD_LEFT)).$this->suffix;\n }\n return $this->prefix.str_replace('-','0',$data).$this->suffix;\n }",
"private function _generateUniqueId()\n {\n $rand = uniqid(rand(10, 99));\n $time = microtime(true);\n $micro = sprintf('%06d', ($time - floor($time)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.' . $micro, $time));\n return sha1($date->format('YmdHisu'));\n }",
"function HAA_generateComplaintId() {\n\n // SQL query to check if unique id already exists.\n $sql_query = 'SELECT complaint_id FROM ' . tblComplaint . ' '\n . 'WHERE complaint_id = :complaint_id';\n $unique_id = '';\n\n do {\n $unique_id = (string) mt_rand(1000, 9999);\n $temp_result = $GLOBALS['dbi']->executeQuery(\n $sql_query, array(':complaint_id' => $unique_id)\n );\n\n // Must not be present in the table.\n if (! $temp_result->fetch()) {\n break;\n }\n }\n while(true);\n\n return $unique_id;\n}",
"public static function randId()\n {\n return rand(1, 9999999);\n }",
"function makeNoneDuplicateId($mysqli, $tableName){\r\n\r\n\t$randId = 0;\r\n\twhile(1){\r\n\t\t$randId = rand(1,9999);\r\n\t\t\r\n\t\t/* Check duplication */\r\n\t\t$isExist = findById($mysqli, $tableName, $randId);\r\n\t\tif($isExist == false){\r\n\t\t\treturn $randId;\r\n\t\t}\r\n\t}\r\n\t\r\n}",
"function generateNewUuid() {\n return uniqid(\"CSC490\");\n}",
"private static function generateId()\r\n {\r\n if (function_exists('random_int')) {\r\n return random_int(0, 0xffff);\r\n }\r\n return mt_rand(0, 0xffff);\r\n }",
"private static function generateId()\n {\n if (\\function_exists('random_int')) {\n return \\random_int(0, 0xffff);\n }\n return \\mt_rand(0, 0xffff);\n }",
"function createId() {\n srand((double)microtime() * 10000000);\n do {\n $id = (string)md5(uniqid(rand()));\n } while ($this->existUserID($id) || $this->existSurferID($id));\n return $id;\n }",
"public function generateNewUniqueIdentifier(): string\n {\n $identifier = null;\n do {\n try {\n $identifier = bin2hex(random_bytes(7));\n } catch (\\Exception $e) {\n }\n } while ($this->findByIdentifier($identifier));\n\n return $identifier;\n }",
"function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}",
"function celerity_generate_unique_node_id() {\n static $uniq = 0;\n $response = CelerityAPI::getStaticResourceResponse();\n $block = $response->getMetadataBlock();\n\n return 'UQ'.$block.'_'.($uniq++);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Properties Return the time assigned when receive was called | public function getReceivedTime()
{
return $this->receive_time;
} | [
"public function time(){\n\t\treturn $this->requestTime;\n\t}",
"public function getReadTime()\n {\n return $this->read_time;\n }",
"public function getReadTime()\n {\n return $this->readTime;\n }",
"public function getProcessorReceivedTime()\n {\n return $this->getParameter('processorReceivedTime');\n }",
"public function getCallTime()\n {\n return $this->_callTime;\n }",
"public function getResponseTime()\n {\n return $this->status[self::STATUS_REQUEST_TIME];\n }",
"public function getSendTime()\n {\n return $this->send_time;\n }",
"public function getSendtime()\n {\n return $this->sendtime;\n }",
"public function getRequestTime()\n {\n return $this->request_time;\n }",
"public function getConsumeTime()\n {\n return $this->consume_time;\n }",
"public function getSendTime()\n {\n return $this->sendTime;\n }",
"public function getDeserveTime()\n {\n return $this->deserve_time;\n }",
"public function getResponseTime()\n {\n return $this->responseTime;\n }",
"public function getSendingTime()\n {\n return $this->sending_time;\n }",
"public function getListeningTime()\n {\n return $this->listeningTime;\n }",
"public function getSendTime()\n {\n $value = $this->get(self::SEND_TIME);\n return $value === null ? (integer)$value : $value;\n }",
"public function getTimeTransfer()\n {\n return $this->timeTransfer;\n }",
"public function getReceivedDateTime() {\n return $this->_receivedDateTime;\n }",
"public function readTime()\n {\n return isset($this->info['readTime'])\n ? $this->info['readTime']\n : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation projectsListAsyncWithHttpInfo List projects | public function projectsListAsyncWithHttpInfo($per_page = '20', $page = null)
{
$returnType = '\Tuningfiles\Model\Projects';
$request = $this->projectsListRequest($per_page, $page);
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 = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
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 getProjectsList()\n {\n $input = Request::onlyLegacy('per_page', 'page', 'query');\n\n try {\n $projects = $this->companyCamService->getAllProjects($input);\n\n return ApiResponse::success([\n\n 'data' => $projects,\n 'params' => $input,\n ]);\n } catch (AuthorizationException $e) {\n return ApiResponse::errorGeneral($e->getMessage());\n } catch (PaymentRequredException $e) {\n return ApiResponse::errorGeneral($e->getMessage());\n } catch (InternalServerErrorException $e) {\n return ApiResponse::errorGeneral($e->getMessage());\n } catch(TimeoutException $e) {\n return ApiResponse::errorGeneral($e->getMessage());\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.something_wrong'), $e);\n }\n }",
"public function allProjects()\n { \n $client = new HttpClient();\n $body = $client->request('projects/all');\n\n dump($body);\n }",
"public function getProjectListWithHttpInfo(Requests\\GetProjectListRequest $request)\n {\n $returnType = '\\Aspose\\Tasks\\Model\\ProjectListResponse';\n $request = $this->GetProjectListRequest($request);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\"[{$e->getCode()}] {$e->getMessage()}\", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody() : null);\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n if ($statusCode === 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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($e->getResponseBody(), '\\Aspose\\Tasks\\Model\\ProjectListResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getAllProjects()\n {\n return $this->sendRequest('project');\n }",
"public function get_projects() {\n\t\t$url = 'projects';\t\t\n $result = $this->call('GET',$url);\n\t\treturn $result;\n }",
"public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}",
"public function get_projects()\n\t{\n\t\t$response = $this->_send_command('GET', 'projects');\n\t\treturn $response->projects;\n\t}",
"public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }",
"public function getAllProject()\n {\n return $this->client->request('GET','/rest/api/2/project');\n }",
"public function getAllProjects(){\r\n \r\n try{\r\n $projects = $this->sendRequest( '/services/v3/projects' );\r\n if( property_exists($projects, 'project') ){\r\n $projects = $projects->project;\r\n }\r\n }catch( \\Exception $e ){\r\n $projects = array();\r\n }\r\n return $projects;\r\n \r\n }",
"private function getAllProjects()\n {\n $url = $this->base_uri.'project?expand=description,lead,issueTypes,url,projectKeys';\n $projects = $this->request($url);\n return $projects;\n }",
"public function actionApiList()\n {\n if( ! $this->request->isAjax) {\n return $this->render('api-list');\n }\n $params = $this->request->post();\n $query = ProjectApi::filters([['title', 'like'], 'project_id', 'api'], $params)->filterResource(AdminResource::TypeProject);\n $pagination = Render::pagination((clone $query)->count());\n $data['infos'] = $query->with('project')->orderBy('id desc')->offset($pagination->offset)->limit($pagination->limit)->asArray()->all();\n $data['page'] = Render::pager($pagination);\n return $this->json($data);\n }",
"public function testListProjects()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }",
"public function getProjects()\n {\n return $this->getApi()->project()->query(['contact' => $this->getUrl()]);\n }",
"public function callProjectList(array $params = array());",
"public function user_can_view_all_projects()\n {\n $this->get('/api/projects')\n ->assertStatus(200)\n ->assertJsonStructure(['data']);\n }",
"public function getProjects();",
"public function getCompletedProjects() {\r\n return json_decode(\r\n $this->client->get(\r\n \"/projects\"\r\n )\r\n );\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test for `Questionnaire::get_false` I am ashamed too | public function test_get_false()
{
$this->resetInstance();
$controller = new Questionnaire();
$CI =& $controller;
$this->assertFalse($CI->get_false());
} | [
"function isFalse () {\n\t\treturn $this->_bool?false:true;\n\t}",
"public function test_false_right_does_not_show_feedback_when_not_answered() {\n $tf = test_question_maker::make_question('truefalse', 'false');\n $this->start_attempt_at_question($tf, 'deferredfeedback', 1);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_question_text_expectation($tf),\n $this->get_does_not_contain_feedback_expectation(),\n new ContainsTagWithContents('h3',\n get_string('questiontext', 'question')));\n $this->assertEqual(get_string('false', 'qtype_truefalse'),\n $this->quba->get_right_answer_summary($this->slot));\n $this->assertPattern('/' . preg_quote($tf->questiontext) . '/',\n $this->quba->get_question_summary($this->slot));\n $this->assertNull($this->quba->get_response_summary($this->slot));\n\n // Finish the attempt without answering.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gaveup);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_tf_true_radio_expectation(false, false),\n $this->get_contains_tf_false_radio_expectation(false, false),\n\n // In particular, check that the false feedback is not displayed.\n new NoPatternExpectation('/' . preg_quote($tf->falsefeedback) . '/'));\n\n }",
"public function isNotAnswered()\n {\n return !$this->answered;\n }",
"public function return_false();",
"function pseudoTypeFalse(): false {}",
"public function to_be_false() {\n $this->report($this->value === false, 'to be false');\n }",
"function java_is_false($value) { return !(java_values ($value)); }",
"public function getRetourNeg(): ?bool {\n return $this->retourNeg;\n }",
"public static function FALSE() {\n\t\treturn FALSE;\n\t}",
"public function validBooleanFalseProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"FALSE\"],\n\t\t\t\"string ON\"\t\t=> [\"OFF\"],\n\t\t\t\"string YES\"\t=> [\"NO\"],\n\t\t\t\"string 1\"\t\t=> [\"0\"],\n\t\t\t\"integer 1\"\t\t=> [0]\n\t\t];\n\t}",
"function none() {\n\t\tif(empty($this->answers)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isWithoutVote(): bool;",
"function isFalse()\n{\n return call_user_func_array(\n 'PHPUnit_Framework_Assert::isFalse',\n func_get_args()\n );\n}",
"public static function isFalse() {\n\t\treturn self::build(self::COMP_BOOL_FALSE);\n\t}",
"public function isFalse(): bool\n {\n return false === $this->value;\n }",
"public static function LOGICAL_FALSE() {\n\t\treturn False;\n\t}",
"public function getIsNegated()\n {\n return $this->isNegated;\n }",
"public function notBool()\n {\n TestCase::assertIsNotBool($this->actual, $this->message);\n }",
"function isStatusNo(){\n return ($this->status == 'no');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hover Outputs a jQuery hover event | function _hover($element = 'this', $over, $out)
{
$event = "\n\t$(" . $this->_prep_element($element) . ").hover(\n\t\tfunction()\n\t\t{\n\t\t\t{$over}\n\t\t}, \n\t\tfunction()\n\t\t{\n\t\t\t{$out}\n\t\t});\n";
$this->jquery_code_for_compile[] = $event;
return $event;
} | [
"public function _hover($element='this', $over, $out) {\n\t\t$event=\"\\n\\t$(\".$this->_prep_element($element).\").hover(\\n\\t\\tfunction()\\n\\t\\t{\\n\\t\\t\\t{$over}\\n\\t\\t}, \\n\\t\\tfunction()\\n\\t\\t{\\n\\t\\t\\t{$out}\\n\\t\\t});\\n\";\n\n\t\t$this->jquery_code_for_compile[]=$event;\n\n\t\treturn $event;\n\t}",
"protected function _hover($element = 'this', $over = '', $out = '')\n\t{\n\t\t$event = \"\\n\\t$(\".$this->_prep_element($element).\").hover(\\n\\t\\tfunction()\\n\\t\\t{\\n\\t\\t\\t{$over}\\n\\t\\t}, \\n\\t\\tfunction()\\n\\t\\t{\\n\\t\\t\\t{$out}\\n\\t\\t});\\n\";\n\n\t\t$this->jquery_code_for_compile[] = $event;\n\n\t\treturn $event;\n\t}",
"public function _mouseover($element='this', $js='') {\n\t\treturn $this->_add_event($element, $js, 'mouseover');\n\t}",
"public function field_hover_animation(){\n\n\t\t/** Render switches. */\n\t\tUI::get_instance()->render_switches(\n\t\t\t$this->options['hover-animation'],\n\t\t\tesc_html__( 'Animate Scroll Bar on hover', 'scroller' ),\n\t\t\t'',\n\t\t\t[\n\t\t\t\t'name' => 'mdp_scroller_settings[hover-animation]',\n\t\t\t\t'id' => 'mdp-hover-animation'\n\t\t\t]\n\t\t);\n\n\t}",
"function template_preprocess_culturefeed_ui_connect_hover(&$variables) {\n template_preprocess_culturefeed_ui_connect($variables);\n}",
"public function mouseOver(string $xpath);",
"public function mouseOver()\n {\n $this->getSession()->getDriver()->mouseOver($this->getXpath());\n }",
"function SetHoverColour(wxColour $colour){}",
"public function isEnabledInHover() {\n \treturn $this->_enable_in_hover;\n }",
"public function hover_buttons() {\n\t\t\tif($this->loop_options[$this->prefix.'_hover_appear_effect'] == 'dfd-3d-parallax') {\n\t\t\t\t$this->hover_link();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\techo '<span class=\"dfd-hover-buttons-wrap\">';\n\t\t\t\tif($this->get_option($this->prefix.'_hover_buttons_external', '') == 'on') {\n\t\t\t\t\t$url = $this->external_link();\n\t\t\t\t\tif(!empty($url)) {\n\t\t\t\t\t\techo '<a class=\"dfd-socicon-link2\" href=\"'.esc_url($url).'\" title=\"\"></a>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($this->get_option($this->prefix.'_hover_buttons_lightbox', '') == 'on') {\n\t\t\t\t\techo '<i class=\"dfd-socicon-stack-2\">';\n\t\t\t\t\t\t$this->lightbox();\n\t\t\t\t\techo '</i>';\n\t\t\t\t}\n\t\t\t\tif($this->get_option($this->prefix.'_hover_buttons_inside', '') == 'on') {\n\t\t\t\t\techo '<a class=\"dfd-socicon-image\" href=\"'.esc_url(get_permalink()).'\" title=\"\"></a>';\n\t\t\t\t}\n\t\t\techo '</span>';\n\t\t}",
"public function get_onmouseenter()\r\n\t{\r\n\t\treturn $this->get_attr('onmouseenter');\r\n\t}",
"#[@arg]\n public function setHover($hover= 0) {\n $this->hover= (int)$hover;\n }",
"function OnMouseEnter($toolId){}",
"public function hover_heading() {\n\t\t\t//echo '<div class=\"title-wrap '.esc_attr($this->loop_options[$this->prefix.'_hover_title_decoration']).'\">';\n\t\t\techo '<div class=\"title-wrap\">';\n\t\t\t\tif($this->get_option($this->prefix.'_hover_show_title', 'on') == 'on') {\n\t\t\t\t\t$this->title();\n\t\t\t\t}\n\t\t\t\tif($this->get_option($this->prefix.'_hover_show_subtitle', 'on') == 'on') {\n\t\t\t\t\t$this->subtitle();\n\t\t\t\t}\n\t\t\techo '</div>';\n\t\t}",
"public function mouseOver($locator)\r\n {\r\n $this->doCommand(\"mouseOver\", array($locator));\r\n }",
"function format_input_hover_end(){\n\treturn '</span>';\n}",
"public function mouseOver($xpath) {\n $element = $this->findElement($xpath, 1);\n $this->browser->hover($element[\"page_id\"], $element[\"ids\"][0]);\n }",
"public function mouseover($element='this', $js='') {\n\t\treturn $this->js->_mouseover($element, $js);\n\t}",
"private function hover_out_lib($id_lib,$id_help)\r\n\t\t{\r\n\t\t\treturn 'onmouseout=\"vimofy_lib_out(\\''.$this->c_id.'\\');\" onmouseover=\"vimofy_lib_hover('.$id_lib.','.$id_help.',\\''.$this->c_id.'\\');\"';\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns element from 'tables' list at given offset | public function getTablesAt($offset)
{
return $this->get(self::TABLES, $offset);
} | [
"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 offsetGet($offset);",
"public function itemAt($offset) {\n $slice = array_slice($this->items, $offset, 1);\n return $slice[0];\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 getTableAt($position)\r\n\t{\r\n\t\tif ($this->tables)\r\n\t\t{\r\n\t\t\tif ($position < count($this->tables))\r\n\t\t\t\treturn $this->tables[$position];\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n $offset = (int) $offset;\n if ($offset < 0 || $offset >= $this->_count) {\n require_once 'Zend/Db/Table/Rowset/Exception.php';\n throw new Zend_Db_Table_Rowset_Exception(\"Illegal index $offset\");\n }\n $this->_pointer = $offset;\n\n return $this->current();\n }",
"public function offsetGet($offset)\r\n {\r\n if ($this->_data && array_key_exists($offset, $this->_data))return $this->_data[$offset];\r\n\r\n if (!$this->seek($offset)) return null;\r\n\r\n if (!$offset != $this->_current_row)\r\n {\r\n $old_current = $this->_current_row;\r\n $old_internal = $this->_internal_row;\r\n $this->_current_row = $offset;\r\n $this->_internal_row = $offset;\r\n }\r\n\r\n $rs = $this->current();\r\n\r\n if (isset($old_current) && isset($old_internal))\r\n {\r\n $this->_current_row = $old_current;\r\n $this->_internal_row = $old_internal;\r\n }\r\n\r\n return $rs;\r\n }",
"protected function getInternalOffset($offset){\n // determine the internal offset (if associative)\n if( !preg_match('/^\\d+$/', $offset) ){\n foreach( $this->headers as $column ){\n if( (!empty($column['alias']))\n && ($column['alias'] === $offset) ){\n $offset = $column['offset'];\n $found = true;\n break;\n }\n } \n if( empty($found) ){\n return NULL;\n }\n }\n\n // modify the offset from php spec to xpath spec\n $offset = $offset + 1;\n\n // return the offset\n return $offset;\n }",
"public function offsetGet($offset) :mixed{\n\t$offset = ucfirst($offset);\n\tif(!$this->offsetExists($offset)) {\n\t\t// TODO: Proper error handling - DalObject doesn't exist.\n\t\treturn null;\n\t}\n\n\treturn $this->_dalElArray[$offset];\n}",
"public function offsetGet($offset){\r\n return $this->collection[$offset];\r\n }",
"function get_table_by_name($table_name)\n\t{\n\t\t\n\t\t$iterator = $this->table_list->get_iterator();\n\t\t$iterator->first();\n\t\twhile (!$iterator->IsDone())\n\t\t{\n\t\t\t$table = $iterator->CurrentItem();\n\t\t\tif ($table->item->get_name() == $table_name)\n\t\t\t{\n\t\t\t\treturn $table->item;\n\t\t\t}\n\t\t\t$iterator->next();\n\t\t}\n\t\treturn NULL;\n\t}",
"public function getItemAt($offset)\n {\n return $this->get(self::ITEM, $offset);\n }",
"protected function seekRow($offset)\n {\n $stream = $this->getIterator();\n $stream->rewind();\n //Workaround for SplFileObject::seek bug in PHP7.2+ see https://bugs.php.net/bug.php?id=75917\n if (PHP_VERSION_ID > 70200 && !$stream instanceof StreamIterator) {\n while ($offset !== $stream->key() && $stream->valid()) {\n $stream->next();\n }\n\n return $stream->current();\n }\n\n $iterator = new LimitIterator($stream, $offset, 1);\n $iterator->rewind();\n\n return $iterator->current();\n }",
"public static function offset($stamp, $offset);",
"function offsetGet ($offset)\n\t{\n\t\tif (is_numeric($offset)) {\n\t\t\t$found = parent::offsetGet($offset);\n\t\t} else {\n\t\t\t$found = null;\n\t\t}\n\t\tif (!$found && is_string($offset)) {\n\t\t\t$found = $this->namedItem($offset);\n\t\t\tif ($found->length === 0) {\n\t\t\t\t$found = null;\n\t\t\t}\n\t\t}\n\t\treturn $found;\n\t}",
"function offsetGet ($offset)\n\t{\n\t\tif (is_numeric($offset)) {\n\t\t\t$found = parent::offsetGet($offset);\n\t\t} else {\n\t\t\t$found = null;\n\t\t}\n\t\tif (!$found && is_string($offset)) {\n\t\t\t$found = $this->namedItem($offset);\n\t\t}\n\t\treturn $found;\n\t}",
"private function _loadXRefTable($offset)\n {\n $this->_stringParser->offset = $offset;\n\n require_once 'Zend/Pdf/Element/Reference/Table.php';\n $refTable = new Zend_Pdf_Element_Reference_Table();\n require_once 'Zend/Pdf/Element/Reference/Context.php';\n $context = new Zend_Pdf_Element_Reference_Context($this->_stringParser, $refTable);\n $this->_stringParser->setContext($context);\n\n $nextLexeme = $this->_stringParser->readLexeme();\n if ($nextLexeme == 'xref') {\n /**\n * Common cross-reference table\n */\n $this->_stringParser->skipWhiteSpace();\n while ( ($nextLexeme = $this->_stringParser->readLexeme()) != 'trailer' ) {\n if (!ctype_digit($nextLexeme)) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross-reference table subheader values must contain only digits.', $this->_stringParser->offset-strlen($nextLexeme)));\n }\n $objNum = (int)$nextLexeme;\n\n $refCount = $this->_stringParser->readLexeme();\n if (!ctype_digit($refCount)) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross-reference table subheader values must contain only digits.', $this->_stringParser->offset-strlen($refCount)));\n }\n\n $this->_stringParser->skipWhiteSpace();\n while ($refCount > 0) {\n $objectOffset = substr($this->_stringParser->data, $this->_stringParser->offset, 10);\n if (!ctype_digit($objectOffset)) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Offset must contain only digits.', $this->_stringParser->offset));\n }\n // Force $objectOffset to be treated as decimal instead of octal number\n for ($numStart = 0; $numStart < strlen($objectOffset)-1; $numStart++) {\n if ($objectOffset[$numStart] != '0') {\n break;\n }\n }\n $objectOffset = substr($objectOffset, $numStart);\n $this->_stringParser->offset += 10;\n\n if (strpos(\"\\x00\\t\\n\\f\\r \", $this->_stringParser->data[$this->_stringParser->offset]) === false) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Value separator must be white space.', $this->_stringParser->offset));\n }\n $this->_stringParser->offset++;\n\n $genNumber = substr($this->_stringParser->data, $this->_stringParser->offset, 5);\n if (!ctype_digit($objectOffset)) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Offset must contain only digits.', $this->_stringParser->offset));\n }\n // Force $objectOffset to be treated as decimal instead of octal number\n for ($numStart = 0; $numStart < strlen($genNumber)-1; $numStart++) {\n if ($genNumber[$numStart] != '0') {\n break;\n }\n }\n $genNumber = substr($genNumber, $numStart);\n $this->_stringParser->offset += 5;\n\n if (strpos(\"\\x00\\t\\n\\f\\r \", $this->_stringParser->data[$this->_stringParser->offset]) === false) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Value separator must be white space.', $this->_stringParser->offset));\n }\n $this->_stringParser->offset++;\n\n $inUseKey = $this->_stringParser->data[$this->_stringParser->offset];\n $this->_stringParser->offset++;\n\n switch ($inUseKey) {\n case 'f':\n // free entry\n unset( $this->_refTable[$objNum . ' ' . $genNumber . ' R'] );\n $refTable->addReference($objNum . ' ' . $genNumber . ' R',\n $objectOffset,\n false);\n break;\n\n case 'n':\n // in-use entry\n\n $refTable->addReference($objNum . ' ' . $genNumber . ' R',\n $objectOffset,\n true);\n }\n\n if ( !Zend_Pdf_StringParser::isWhiteSpace(ord( $this->_stringParser->data[$this->_stringParser->offset] )) ) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Value separator must be white space.', $this->_stringParser->offset));\n }\n $this->_stringParser->offset++;\n if ( !Zend_Pdf_StringParser::isWhiteSpace(ord( $this->_stringParser->data[$this->_stringParser->offset] )) ) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file cross-reference table syntax error. Offset - 0x%X. Value separator must be white space.', $this->_stringParser->offset));\n }\n $this->_stringParser->offset++;\n\n $refCount--;\n $objNum++;\n }\n }\n\n $trailerDictOffset = $this->_stringParser->offset;\n $trailerDict = $this->_stringParser->readElement();\n if (!$trailerDict instanceof Zend_Pdf_Element_Dictionary) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Dictionary expected after \\'trailer\\' keyword.', $trailerDictOffset));\n }\n } else {\n $xrefStream = $this->_stringParser->getObject($offset, $context);\n\n if (!$xrefStream instanceof Zend_Pdf_Element_Object_Stream) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross-reference stream expected.', $offset));\n }\n\n $trailerDict = $xrefStream->dictionary;\n if ($trailerDict->Type->value != 'XRef') {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross-reference stream object must have /Type property assigned to /XRef.', $offset));\n }\n if ($trailerDict->W === null || $trailerDict->W->getType() != Zend_Pdf_Element::TYPE_ARRAY) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross reference stream dictionary doesn\\'t have W entry or it\\'s not an array.', $offset));\n }\n\n $entryField1Size = $trailerDict->W->items[0]->value;\n $entryField2Size = $trailerDict->W->items[1]->value;\n $entryField3Size = $trailerDict->W->items[2]->value;\n\n if ($entryField2Size == 0 || $entryField3Size == 0) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Wrong W dictionary entry. Only type field of stream entries has default value and could be zero length.', $offset));\n }\n\n $xrefStreamData = $xrefStream->value;\n\n if ($trailerDict->Index !== null) {\n if ($trailerDict->Index->getType() != Zend_Pdf_Element::TYPE_ARRAY) {\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X. Cross reference stream dictionary Index entry must be an array.', $offset));\n }\n $sections = count($trailerDict->Index->items)/2;\n } else {\n $sections = 1;\n }\n\n $streamOffset = 0;\n\n $size = $entryField1Size + $entryField2Size + $entryField3Size;\n $entries = strlen($xrefStreamData)/$size;\n\n for ($count = 0; $count < $sections; $count++) {\n if ($trailerDict->Index !== null) {\n $objNum = $trailerDict->Index->items[$count*2 ]->value;\n $entries = $trailerDict->Index->items[$count*2 + 1]->value;\n } else {\n $objNum = 0;\n $entries = $trailerDict->Size->value;\n }\n\n for ($count2 = 0; $count2 < $entries; $count2++) {\n if ($entryField1Size == 0) {\n $type = 1;\n } else if ($entryField1Size == 1) { // Optimyze one-byte field case\n $type = ord($xrefStreamData[$streamOffset++]);\n } else {\n $type = Zend_Pdf_StringParser::parseIntFromStream($xrefStreamData, $streamOffset, $entryField1Size);\n $streamOffset += $entryField1Size;\n }\n\n if ($entryField2Size == 1) { // Optimyze one-byte field case\n $field2 = ord($xrefStreamData[$streamOffset++]);\n } else {\n $field2 = Zend_Pdf_StringParser::parseIntFromStream($xrefStreamData, $streamOffset, $entryField2Size);\n $streamOffset += $entryField2Size;\n }\n\n if ($entryField3Size == 1) { // Optimyze one-byte field case\n $field3 = ord($xrefStreamData[$streamOffset++]);\n } else {\n $field3 = Zend_Pdf_StringParser::parseIntFromStream($xrefStreamData, $streamOffset, $entryField3Size);\n $streamOffset += $entryField3Size;\n }\n\n switch ($type) {\n case 0:\n // Free object\n $refTable->addReference($objNum . ' ' . $field3 . ' R', $field2, false);\n // Debug output:\n // echo \"Free object - $objNum $field3 R, next free - $field2\\n\";\n break;\n\n case 1:\n // In use object\n $refTable->addReference($objNum . ' ' . $field3 . ' R', $field2, true);\n // Debug output:\n // echo \"In-use object - $objNum $field3 R, offset - $field2\\n\";\n break;\n\n case 2:\n // Object in an object stream\n // Debug output:\n // echo \"Compressed object - $objNum 0 R, object stream - $field2 0 R, offset - $field3\\n\";\n break;\n }\n\n $objNum++;\n }\n }\n\n // $streamOffset . ' ' . strlen($xrefStreamData) . \"\\n\";\n // \"$entries\\n\";\n require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception('Cross-reference streams are not supported yet.');\n }\n\n\n require_once 'Zend/Pdf/Trailer/Keeper.php';\n $trailerObj = new Zend_Pdf_Trailer_Keeper($trailerDict, $context);\n if ($trailerDict->Prev instanceof Zend_Pdf_Element_Numeric ||\n $trailerDict->Prev instanceof Zend_Pdf_Element_Reference ) {\n $trailerObj->setPrev($this->_loadXRefTable($trailerDict->Prev->value));\n $context->getRefTable()->setParent($trailerObj->getPrev()->getRefTable());\n }\n\n /**\n * We set '/Prev' dictionary property to the current cross-reference section offset.\n * It doesn't correspond to the actual data, but is true when trailer will be used\n * as a trailer for next generated PDF section.\n */\n $trailerObj->Prev = new Zend_Pdf_Element_Numeric($offset);\n\n return $trailerObj;\n }",
"public function getTableNamesAt($offset)\n {\n return $this->get(self::TABLE_NAMES, $offset);\n }",
"public function innerRow($offset){\n try{\n return $this->getChild($offset);\n }catch (NullException $e){\n die($e->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get welcome message for importer starter page | public function get_welcome_message() {
$files = $this->get_xml_count();
if ( 0 === $files ) {
$message = __( 'Upload XML file with demo content', 'jet-data-importer' );
}
if ( 1 === $files ) {
$message = __( 'We found 1 XML file with demo content in your theme, install it?', 'jet-data-importer' );
}
if ( 1 < $files ) {
$message = sprintf(
__( 'We found %s XML files in your theme. Please select one of them to install', 'jet-data-importer' ),
$files
);
}
return '<div class="cdi-message">' . $message . '</div>';
} | [
"protected function welcome()\n {\n $this->info('>> Welcome to '.$this->appName.' autosetup <<');\n }",
"public function get_welcome_header() {\n\t\t// Badge for welcome page\n\t\t$ts_file_path = plugin_dir_url( __FILE__ ) ;\n\t\t\n\t\t// Badge for welcome page\n\t\t$badge_url = $ts_file_path . '/assets/images/icon-256x256.png';\n\t\t?>\n <h1 class=\"welcome-h1\"><?php echo get_admin_page_title(); ?></h1>\n\t\t<?php $this->social_media_elements();\n\t}",
"function welcome($message = false)\n\t{\n\t\t// Delete merged js/css files to force regenerations based on updated activated plugin list\n\t\tPiwik::deleteAllCacheOnUpdate();\n\n\t\t$view = new Piwik_Installation_View(\n\t\t\t\t\t\t$this->pathView . 'welcome.tpl',\n\t\t\t\t\t\t$this->getInstallationSteps(),\n\t\t\t\t\t\t__FUNCTION__\n\t\t\t\t\t);\n\t\t$view->newInstall = !file_exists(Piwik_Config::getDefaultUserConfigPath());\n\t\t$view->errorMessage = $message;\n\t\t$this->skipThisStep( __FUNCTION__ );\n\t\t$view->showNextStep = $view->newInstall;\n\t\t$this->session->currentStepDone = __FUNCTION__;\n\t\techo $view->render();\n\t}",
"private function welcomeMessage()\n {\n $message = <<<EOD\n===================================\n****** {$this->gameTitle} ******\n===================================\nEOD;\n $this->displayMessage($message);\n }",
"public static function install_welcome() {\n\n\t\tif ( is_app_installed() ) {\n\n\t\t\treturn self::view( self::$path . 'install_finished.php', array( 'title' => 'Install Cece' ), true );\n\n\t\t}\n\n\t\treturn self::view( self::$path . 'install_welcome.php', array( 'title' => 'Install Cece' ), true );\n\n\t}",
"public function winespace_welcome_getting_started() {\n\t\trequire_once( get_template_directory() . '/inc/admin/welcome-screen/sections/getting-started.php' );\n\t}",
"public function actionGenerateWelcomeMessage()\n {\n $welcomeMessage = array();\n $welcomeMessage['sender'] = $this->botName;\n $welcomeMessage['message'] = 'Hey there, we are ready to rumble!';\n return $welcomeMessage;\n }",
"private function writeWelcome()\n {\n $message = sprintf(\n \"<info>%s</info> - %s <comment>%s</comment>.\\n\",\n Trans::__('nut.greeting'),\n Trans::__('nut.version'),\n Version::VERSION\n );\n $this->io->text($message);\n }",
"public static function welcome_text() {\n\n\t\t// Switch welcome text based on whether this is a new installation or not.\n\t\t$welcome_text = ( self::is_new_install() )\n\t\t\t? esc_html__( 'Thank you for installing Envira! Envira provides great gallery features for your WordPress site!', 'envira-gallery' )\n\t\t\t/* translators: %s: version */\n\t\t\t: esc_html__( 'Thank you for updating! Envira %s has many recent improvements that you will enjoy.', 'envira-gallery' );\n\n\t\t?>\n\t\t<?php /* translators: %s: version */ ?>\n\t\t<h1 class=\"welcome-header\"><?php printf( esc_html__( 'Welcome to %1$s Envira Gallery %2$s', 'envira-gallery' ), '<span class=\"envira-leaf\"></span> ', esc_html( self::display_version() ) ); ?></h1>\n\n\t\t<div class=\"about-text\">\n\t\t\t<?php\n\t\t\tif ( self::is_new_install() ) {\n\t\t\t\techo esc_html( $welcome_text );\n\t\t\t} else {\n\t\t\t\tprintf( $welcome_text, self::display_version() ); // @codingStandardsIgnoreLine\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\n\t\t<?php\n\t}",
"private function get_migration_page_welcome_message() {\n\t\tif ( ! self::$revert ) {\n\t\t\t/* translators: Version number. */\n\t\t\tprintf( esc_html__( 'Avada 5.0 is an amazing update with new features, improvements and our brand new Fusion Builder. To enjoy Avada 5.0, conversion steps need to be performed. Please see below. Thank you for choosing Avada!', 'Avada' ), esc_attr( Avada()->get_theme_version() ) );\n\t\t} else {\n\t\t\tesc_html_e( 'This is the reversion process. Please see below for further information.', 'Avada' );\n\t\t}\n\t}",
"public function get_initial_page() {\n\t\treturn 'welcome';\n\t}",
"public function welcome() {\n\n // Bail if activating from network, or bulk\n if ( is_network_admin() || isset( $_GET['activate-multi'] ) )\n return;\n\n global $pagenow;\n\n if (isset($_GET['activated'] ) && $pagenow == \"themes.php\" ) {\n\n $upgrade = get_option( 'projects_version_upgraded_from' );\n\n if( ! $upgrade ) { // First time install\n wp_safe_redirect( admin_url( 'index.php?page=projects-getting-started' ) ); exit;\n } else { // Update\n wp_safe_redirect( admin_url( 'index.php?page=projects-about' ) ); exit;\n }\n }\n\n }",
"public function welcomeMessage(){\n\n // TODO: change message string concatenation\n $current_user = \\Drupal::currentuser();\n\n // Generate customized welcome message with username and current date.\n $welcome_message = 'Hello ' . $current_user->getDisplayName() . '</br>';\n $welcome_message .= 'Today is ' . date(\"l M d, Y G:i\", time());\n\n return $welcome_message;\n }",
"protected function _getImportStartedMessage()\n {\n return __('The item import was successfully started!');\n }",
"private function show_welcome() {\n\t\t// Set welcome modal.\n\t\tshush_toolkit()->settings->update(\n\t\t\t'show_welcome',\n\t\t\ttrue,\n\t\t\t'misc',\n\t\t\tGeneral::is_networkwide()\n\t\t);\n\t}",
"public function getWelcomeMessage()\n {\n return $this->get('WelcomeMessage');\n }",
"function acpperms_xml_show_welcome()\n\t{\n\t\t//-------------------------------\n\t\t// INIT\n\t\t//-------------------------------\n\t\t\n\t\t$content = '';\n\t\t\n\t\t//-------------------------------\n\t\t// Check...\n\t\t//-------------------------------\n\t\t\n\t\treturn $this->html->acp_xml_welcome( $this->member_info );\n\t}",
"private function getWelcomeMsg() {\n $msg = \"\";\n $logged_in = \\Drupal::currentUser()->isAuthenticated();\n if($logged_in) {\n $this->getCurrentUserName();\n $msg = \"Welcome, \" . $this->getCurrentUserName() . \"!\";\n } else {\n $msg = \"<a href='user/login' class='menu__link menu__link--link is-active'>Log In</a>\";\n }\n return $msg;\n }",
"public function start()\n {\n $this->render(\n 'welcome.php',\n [\n GlobalViewEntity::VIEW_DATA_TITLE_KEY => 'Welcome',\n GlobalViewEntity::VIEW_DATA_HEADER_KEY => 'Welcome :)',\n ]\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This functions clean up the url for empty strings. | private function cleanUrl(): void
{
$this->url = array_filter($this->url);
if (isset($this->url[1]) && strlen($this->url[1])) {
$this->module = $this->url[1];
unset($this->url[1]);
}
if (isset($this->url[2]) && strlen($this->url[2])) {
$this->controller = $this->url[2];
unset($this->url[2]);
}
if (isset($this->url[3]) && strlen($this->url[3])) {
$this->action = $this->url[3];
unset($this->url[3]);
}
} | [
"function yourls_clean_url( $url ) {\n\t$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'\"()\\\\x80-\\\\xff]|i', '', $url );\n\t$strip = array('%0d', '%0a', '%0D', '%0A');\n\t$url = yourls_deep_replace($strip, $url);\n\t$url = str_replace(';//', '://', $url);\n\t$url = str_replace('&', '&', $url); // Revert & not to break query strings\n\t\n\treturn $url;\n}",
"function cleanseURL(&$url)\n{\n $url = strtolower($url);\n\n // Check if we are dealing with an email address here\n $mailto = strpos($url, 'mailto:');\n $atsign = strpos($url, '@');\n\n if ($mailto === 0 || $atsign !== false) {\n $comma = strpos($url, ',');\n // Remove multiple email addresses\n if ($comma !== false && $comma > $atsign) {\n $url = substr($url, 0, $comma);\n }\n $url = substr($url, $atsign + 1);\n }\n\n $doubleSlash = strpos($url, '//');\n $firstDot = strpos($url, '.');\n\n // Check if the double slash is present before the dot\n // This I think would hint at a locator in most cases\n if (\n $doubleSlash !== false && $firstDot !== false && $doubleSlash < $firstDot\n ) {\n // Remove the protocol from the string\n $url = substr($url, $doubleSlash + 2);\n }\n\n // Check for the first forward slash to remove all sub folders\n $forwardSlash = strpos($url, '/');\n if ($forwardSlash !== false) {\n $url = substr($url, 0, $forwardSlash);\n }\n\n // Check for query strings and remove those as well\n $queries = strpos($url, '?');\n if ($queries !== false) {\n $url = substr($url, 0, $queries);\n }\n\n // Check for remaining ports and remove them\n $ports = strrpos($url, ':');\n if ($ports !== false) {\n $url = substr($url, 0, $ports);\n }\n\n // Append a random char such as % at the end for faster TLD matching\n $url = $url.'%';\n}",
"private static function prepareUrl()\n {\n for ($i = 0; $i < count(self::$url); $i++) {\n self::$url[$i] = rtrim(self::$url[$i]);\n self::$url[$i] = ltrim(self::$url[$i]);\n }\n }",
"function standardize_url($url) {\n if(empty($url)) return $url;\n return (strstr($url,'http://') OR strstr($url,'https://')) ? $url : 'http://'.$url;\n}",
"function cleanExtraction($url, $clean) {\r\n\tif($clean) $url = str_replace(\"?/\", \"\", $url);\r\n\tif ('/' == substr($url, 0, 1)) $url = substr_replace($url, '', 0, 1); \r\n\tif ('/' == substr($url, strlen($url)-1)) $url = substr_replace($url, '', strlen($url)-1); \r\n\treturn str_replace(\"index.php\", \"\", $url);\r\n}",
"public static function cleanURL( $url ) {\n $output = $url;\n $output = preg_replace( '/[^\\w\\:\\/\\-\\?&=\\.\\#]/', '', $output );\n $output = preg_replace( '/\\.\\./', '', $output );\n return $output;\n }",
"function sharedurl_fix_submitted_url($url)\n{\n // note: empty urls are prevented in form validation\n $url = trim($url);\n\n // remove encoded entities - we want the raw URI here\n $url = html_entity_decode($url, ENT_QUOTES, 'UTF-8');\n\n if (!preg_match('|^[a-z]+:|i', $url) and !preg_match('|^/|', $url)) {\n // invalid URI, try to fix it by making it normal URL,\n // please note relative urls are not allowed, /xx/yy links are ok\n $url = 'http://' . $url;\n }\n\n return $url;\n}",
"private function cleanURL($url) {\n\t\treturn preg_replace(\"/((^:)\\/\\/)/\", \"//\", $url);\n\t}",
"function sanitizeUrl(string $url): string\n{\n return trim(filter_var($url, FILTER_SANITIZE_URL));\n}",
"function studio_strip_url( $url ) {\n\treturn rtrim( str_replace(array( 'https://', 'http://', 'www.' ), '', $url), '/' );\n}",
"function clean_url( $url ) {\n\tglobal $hook;\n\n\t$original_url = $url;\n\n\tif ( '' == $url )\n\t\treturn $url;\n\n\t// Remove invalid characters.\n\t$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n\t$strip = array('%0d', '%0a', '%0D', '%0A');\n\t$url = _deep_replace( $strip, $url );\n\t$url = str_replace(';//', '://', $url);\n\n\t// If the URL doesn't appear to contain a scheme, we\n\t// presume it needs `http://` appended (unless a relative\n\t// link starting with /, #, or ?, or a php file).\n\tif ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) && ! preg_match('/^[a-z0-9-]+?\\.php/i', $url) )\n\t\t$url = 'http://' . $url;\n\n\t// Replace ampersands and single quotes with ASCII code.\n\t$url = str_replace('&', '&', $url);\n\t$url = str_replace( '&', '&', $url );\n\t$url = str_replace( \"'\", ''', $url );\n\n\t/**\n\t * Filter a string cleaned and escaped for output as a URL.\n\t *\n\t * @since 0.9.0\n\t *\n\t * @param string $clean_url The cleaned URL to be returned.\n\t * @param string $original_url The URL prior to cleaning.\n\t */\n\t$url = $hook->run( 'clean_url', $url, $original_url );\n\treturn $url;\n}",
"function cleanURL($url) {\n\t\t$url = str_replace('/' . APP_DIR, '', $url);\n\t\t$url = preg_replace('|^/|', '', $url);\n\t\treturn $url;\n\t}",
"public static function url_remove_query_and_path($url)\n {\n $url_pieces = parse_url($url);\n //$clean_url = $url_pieces['scheme'] . '://' . $url_pieces['host'];\n $clean_url = (isset($url_pieces['scheme']) ? $url_pieces['scheme'] : 'http') . '://' . (isset($url_pieces['host']) ? $url_pieces['host'] : '');\n if($clean_url==='http://')\n {\n $clean_url = '';\n }\n return $clean_url;\n }",
"function sanitize_url($url)\n{\n return preg_replace('/[^\\p{L}\\d\\$-_\\.\\+!\\*\\'\\(\\),{}\\|\\\\\\^~\\[\\]`<>#%\";\\/\\?:@&=]+/u', '', $url);\n}",
"function parse_url_clean($raw_url) {\r\n\t$retval = array();\r\n\t$raw_url = (string) $raw_url;\r\n\r\n\t// make sure parse_url() recognizes the URL correctly.\r\n\tif (strpos($raw_url, '://') === false) {\r\n\t\t$raw_url = 'http://' . $raw_url;\r\n\t} // end: if\r\n\r\n\t// split request into array\r\n\t$retval = parse_url($raw_url);\r\n\r\n\t// make sure a path key exists\r\n\tif (!isset($retval['path'])) {\r\n\t\t$retval['path'] = '/';\r\n\t} // end: if\r\n\r\n\t// set port to 80 if none exists\r\n\tif (!isset($retval['port'])) {\r\n\t\t$retval['port'] = '80';\r\n\t} // end: if\r\n\r\n\treturn $retval;\r\n}",
"function trimUrl($url)\n{\n // On enlève les / de début et de fin\n // On passe de \"/news/1//\" à \"news/1\"\n $url = trim($url, '/');\n\n // Mais si on a par exemple \"/\" alors ça deviens du vide\n // Et on veut garder au minimum le \"/\"\n if (empty($url)) {\n return '/';\n }\n\n // Si c'est pas vide on retourne ce que l'on a trim\n return $url;\n}",
"private function cleanExtraction($url, $clean) {\n\t\tif($clean) $url = str_replace(\"?/\", \"\", $url);\n\t\tif ('/' == substr($url, 0, 1)) $url = substr_replace($url, '', 0, 1); \n\t\tif ('/' == substr($url, strlen($url)-1)) $url = substr_replace($url, '', strlen($url)-1); \n\t\treturn str_replace(\"index.php\", \"\", $url);\n\t}",
"function trim_url($remove){\n\t$urlqs=$_SERVER['QUERY_STRING'];\n\treturn preg_replace(\"/\".$remove.\".*/\", \"\", $urlqs);\n}",
"protected function clean_url($url){\n\n\t\t$url = parent::clean_url($url);\n\n\t\treturn str_replace('.files.', '.', $url);\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Geeft shift weer waarbij de begintijd het laagste is en de taakId gelijk is aan de gevraagde taakId | function getEersteTijd($id)
{
$this->db->select_min('begintijd');
$this->db->where('taakId', $id);
$query = $this->db->get('taakShift');
return $query->row();
} | [
"public function generatenewidTransaksi()\n {\n \t// mengambil seluruh isi tabel\n $temp = $this->findAll();\n // mengambil row terakhir \n $last = end($temp); \n\n // jika $last kosong (jika tabel masih kosong)\n if ($last == Null){\n // mengenerate id baru dengan nilai 1\n $new_id = 1;\n }else{\n // mengenerate id baru dengan nilai id terakhir + 1\n $new_id = $last['id_transaksi']+1;\n }\n\n // mengembalikan nilai \n return $new_id;\n }",
"function getAllByOptieIdWithShiften($optieId){\n $this->db->where('optieId', $optieId);\n $query = $this->db->get('taak');\n $taken = $query->result();\n \n $this->load->model('TaakShift_model');\n foreach($taken as $taak){\n $taak->shiften = $this->TaakShift_model->getAllByTaak($taak->id);\n }\n \n return $taken;\n }",
"public function wijzigRit($id){\n\n $data['titel'] = 'Rit wijzigen';\n $data['gemaaktDoor'] = \"Dylan Vernelen Ebert\";\n\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n $minderMobiele = $data['gebruiker'];\n if($this->session->has_userdata('gebruiker_id')){\n $this->load->model('rit_model');\n $rit = $this->rit_model->get($id);\n if ($rit->ritIdHeenrit){\n $heenRit = $this->rit_model->get($rit->ritIdHeenrit);\n $heenRit->terugRit = $rit;\n } else {\n $heenRit = $rit;\n if ($this->rit_model->getByHeenRit($heenRit->id)) {\n $heenRit->terugRit = $this->rit_model->getByHeenRit($heenRit->id);\n } else {\n $heenRit->terugRit = new stdClass();\n $heenRit->terugRit->id = \"\";\n $heenRit->terugRit->vertrekTijdstip = \"\";\n $heenRit->terugRit->opmerking = \"\";\n }\n }\n $this->load->model('adres_model');\n $adres = $this->adres_model->getAdres($heenRit->adresIdVertrek);\n $heenRit->adres = $adres;\n $bestemming = $this->adres_model->getAdres($heenRit->adresIdBestemming);\n $heenRit->bestemming = $bestemming;\n $data['heenrit'] = $heenRit;\n if($minderMobiele->straatEnNummer==$adres->straatEnNummer && $minderMobiele->postcode==$adres->postcode && $minderMobiele->gemeente==$adres->gemeente){\n $data['vertrekThuis'] = true;\n } else {\n $data['vertrekThuis'] = false;\n }\n $this->load->model('Parameters_model');\n $parameters = $this->Parameters_model->get();\n $data['parameters'] = $parameters;\n $partials = array( 'navigatie' => 'main_menu',\n 'inhoud' => 'minderMobiele/wijzigRit');\n $this->template->load('main_master', $partials, $data);\n } else {\n redirect('Home');\n }\n }",
"function getAllByStartTijdWithOptiesWithTakenWithShiften($personeelsfeesetId){\n $this->db->where('personeelsfeestId', $personeelsfeesetId);\n $this->db->order_by('starttijd', 'asc');\n $query = $this->db->get('dagOnderdeel');\n $dagonderdelen = $query->result();\n \n /**\n * Opties toewijzen per dagonderdeel\n */\n $this->load->model('Optie_model');\n $this->load->model('Taak_model');\n foreach($dagonderdelen as $dagonderdeel){\n if($dagonderdeel->heeftTaak == \"1\"){\n $dagonderdeel->taken = $this->Taak_model->getAllByDagonderDeelWithShiften($dagonderdeel->id);\n }else{\n $dagonderdeel->opties = $this->Optie_model->getAllByDagOnderdeelWithTaken($dagonderdeel->id);\n }\n }\n \n return $dagonderdelen;\n }",
"public function getOldId()\n {\n return $this->old_id;\n }",
"public function getTasId ()\n {\n\n return $this->tas_id;\n }",
"function add_shift($params)\n {\n $this->db->insert('shifts',$params);\n return $this->db->insert_id();\n }",
"function get_id_biger_than($id, $pawn_id) {\n $this->db->select('*');\n $this->db->from('pawn_schedule');\n $this->db->where('pawn_id', $pawn_id);\n $this->db->where('id', $id + 1);\n $result = $this->db->get();\n return $result->row();\n }",
"public static function refreshLinkedTaId($ta) {\n\t\tif (!isset(Zend_Registry::get('config')->event_wsdl_uri)) {\n \t\t\treturn;\n \t}\n\t\tif (!($ta instanceof TeachingActivity)) {\n\t\t\t$taFinder = new TeachingActivities();\n\t\t\t$ta = $taFinder->getTa($ta);\n\t\t}\n\t\t\n\t\t$types_mapping = ActivityTypes::$compass_events_mapping;\n\t\t$uid = Zend_Auth::getInstance()->getIdentity()->user_id;\n\t\t$stage = (int)($ta->stage);\n\t\t$year = date('Y') + $stage - 1;\n\t\t$block = $ta->block_no;\n\t\t$bw = $ta->block_week;\n\t\t$eventtype = isset($types_mapping[$ta->typeID]) ? $types_mapping[$ta->typeID] : NULL;\n\t\t$seq = $ta->sequence_num;\n\t\tif (!empty($bw) && isset($eventtype) && !empty($seq)) {\n\t\t\ttry {\n\t\t\t\t$client = new Zend_Soap_Client(Zend_Registry::get('config')->event_wsdl_uri);\n\t\t\t\tZend_Registry::get('logger')->info(__METHOD__.\"($ta->ownerID, $year, $block, $bw, $eventtype, $seq, $uid)\");\n\t\t\t\t$result = $client->refreshLinkedTaId($ta->ownerID, $year, $block, $bw, $eventtype, $seq, $uid);\n\t\t\t\tZend_Registry::get('logger')->info(__METHOD__.\" - RESULT: \".$result);\n\t\t\t} catch (Exception $exp) {\n\t\t\t\tZend_Registry::get('logger')->error(__METHOD__.\"($ta->ownerID, $year, $block, $bw, $eventtype, $seq, $uid) failed\");\n\t\t\t\tZend_Registry::get('logger')->error(__METHOD__.\" - Error message: \" . $exp->getMessage());\n\t\t\t}\n\t\t}\n\t}",
"final protected function genId(){\n\t\t$this->id = 'bele' . self::$ID_INDEX++;\n\t}",
"public function idPenjualan()\n {\n $new_id = $this->penjualan->get_idmax();\n if ($new_id>0){\n foreach ($new_id as $key){\n $auto_id = $key->id;\n }\n }\n return $this->penjualan->get_newid($auto_id,'TRX'); //TRX00001\n }",
"public function regenerateID()\n {\n }",
"public function traerPorId($id)\n {\n }",
"public function CreateLeervak(Leervak $leervak) :int{\n $conn = $this->GetConnection();\n $sql = \"INSERT INTO leervak (Naam) values (?)\";\n $data = $leervak->GetCourse();\n $conn->prepare($sql)->execute([$data]);\n return $conn->lastInsertId();\n }",
"public function shift(){\n return $this->hasMany(TbleventsShifthour::class,'schedule_id','id');\n }",
"function get_shift($id)\n {\n return $this->db->get_where('shifts',array('id'=>$id))->row_array();\n }",
"public function getBurgerlijkeStaatId()\n {\n return $this->burgerlijke_staat_id;\n }",
"function findOverrideShift($db, $unit, $id, $old_shift)\n{\n $recs = array();\n $sql = \"SELECT `shift`\n FROM `group_shift`\n WHERE `assignation_key` = '\" . $unit . \"'\n AND find_in_set(\" . $id . \", `assignation_value`)\";\n\n $query = $db->query($sql);\n while ($r = mysqli_fetch_assoc($query)) {\n $sql2 = \"SELECT `id` FROM `shift` WHERE find_in_set(\" . $r['shift'] . \", `override_shift`) AND `id` <> \" . $old_shift;\n $query2 = $db->query($sql2);\n while ($r2 = mysqli_fetch_assoc($query2)) {\n $recs[] = $r2['id'];\n }\n }\n return $recs;\n}",
"public function getTogglId()\n {\n return $this->togglId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Feed a SimpleBrowser to this static class, get a simple_html_dom back | static function getParsableContent(SimpleBrowser $browser){
$page = new simple_html_dom();
$rawhtml = $browser->getContent();
$page->load($rawhtml);
return $page;
} | [
"public function createBrowser()\n {\n return new SimpleBrowser();\n }",
"protected function getElementBrowserInstance() {}",
"function file_get_html(): simple_html_dom {\n\t\t$dom = new simple_html_dom;\n\t\t$args = func_get_args();\n\t\t$dom->load( file_get_contents( ...$args ) );\n\n\t\treturn $dom;\n\t}",
"function get_page_dom($path)\n{\n $url = get_full_url($path);\n print \"Retrieving '\" . $url . \"'\\n\";\n $html = null;\n $html = scraperWiki::scrape($url);\n $dom = null;\n $dom = new simple_html_dom();\n $dom->load($html);\n return $dom;\n}",
"public function getDOMInstance(){\n \n return $this->dom;\n \n }",
"private function getWebDocument()\n {\n return new WebDocument();\n }",
"public function createDOM($url){\n if(!is_null($this->dom)) { \n $this->dom->clear();\n unset($this->dom); \n }\n \n $this->url = $url;\n $this->dom = new simple_html_dom();\n \n // Using cURL\n $html_source = get_html($url);\n $this->dom->load($html_source);\n }",
"function getPageDom($pageUrl)\n{\n $pageHtml = file_get_contents($pageUrl);\n $pageDom = new Zend_Dom_Query($pageHtml);\n\n return $pageDom;\n}",
"private function loadDom()\n\t{\n\t\t$this->_dom = new DomDocument();\n\t\t\n\t\t$this->_dom->loadHTML(\n\t\t\tfile_get_contents($this->_url)\n\t\t);\n\n\t\treturn $this;\n\t}",
"public function testLoadDomFromObject()\n {\n $object = new simple_html_dom('<a href=\"#\">Test</a>');\n $dom = new Dom($object);\n $this->assertInstanceOf(simple_html_dom_node::class, $dom->getSimpleNode());\n }",
"public function parseHtmlDom( simple_html_dom $html ) {\n \n }",
"function curlToDOM($url) {\n $ci = curl_init($url);\n curl_setopt($ci, CURLOPT_HEADER, 0);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ci, CURLOPT_AUTOREFERER, 1);\n curl_setopt($ci, CURLOPT_FOLLOWLOCATION, 1);\n $dom = new simple_html_dom();\n $siteData = $dom->load(curl_exec($ci));\n curl_close($ci);\n return $siteData;\n }",
"abstract public function getDomObject();",
"public function getDOM() {\n\t\treturn $this->pageDOM;\n\t}",
"function getDom($html)\n\t{\n\t\t$dom = str_get_html($html);\n\t\treturn $dom;\n\t}",
"public static function factory($html = NULL)\n\t{\t\t\n\t\t$html_parser = new HTML_Parser($html);\n\t\t\n\t\treturn $html_parser->_dom;\n\t}",
"protected function __get_html() {\n\t\t\treturn \\ChickenWire\\Util\\Html::instance();\n\t\t}",
"static function create()\n {\n include_once \"classes/DOMElement.php\";\n header(\"Content-type: text/html;charset=utf-8\");\n $domimpl=new DOMImplementation();\n $doctype=$domimpl->createDocumentType(\"html\");\n $dom=$domimpl->createDocument(\n \"http://www.w3.org/1999/xhtml\", \"html\", $doctype\n );\n $dom->registerNodeClass(\"DOMElement\", \"NewDOMElement\");\n $dom->html=$dom->documentElement;\n $dom->head=$dom->createElement(\"head\");\n $dom->body=$dom->createElement(\"body\");\n $dom->html->appendChild($dom->head);\n $dom->html->appendChild($dom->body);\n return $dom;\n }",
"function getDOM($url)\n{\n\t$html = file_get_contents($url);\n\t\n\t$dom = new DOMDocument();\n\t$dom->loadHTML($html);\n\t\n\treturn $dom;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets an option for this specific series within the JsWriter | public function setOption( $name, $value )
{
$this->jsWriter->setSeriesOption( $this->getTitle(), $name, $value );
return $this;
} | [
"function set_series($series)\r\n {\r\n $this->set_additional_property(self :: PROPERTY_SERIES, $series);\r\n }",
"public function setSeries($series) \n {\n $this->_series = $series; \n }",
"public function setTypeOption( $name, $option, $seriesTitle = null)\n\t{\n\t $this->jsWriter->setTypeOption( $name, $option, $seriesTitle );\n\t \n\t\treturn $this;\n\t}",
"public function setSeries($series);",
"public function set_option( string $option ) : void {\t\n\t\tself::$api_option = $option;\n\t}",
"function _set_opt($option, $value)\n {\n @curl_setopt($this->handle_id, $option, $value);\n }",
"public function setRenderingOption($key, $value);",
"function setOptionMetaValue($value)\n {\n $this->__ometa_value = $value ;\n }",
"public function setOptions()\n {\n // TODO: Implement setOptions() method.\n }",
"public function setOption($name, $value);",
"public function setOption($option, $value);",
"public function setOption($key, $value);",
"public function setOption($name, $value)\n {\n if ($name == 'cached_entity') {\n $this->setCachedEntity($value);\n } else {\n parent::setOption($name, $value);\n }\n }",
"public function setRenderingOption($key, $value)\n {\n $this->renderingOptions[$key] = $value;\n }",
"public function setSerie($data, $title = NULL, $options =[]) {\n $serie = [\n 'type' => $this->chart->type->getValue(),\n 'data' => $data,\n ];\n if ($title) {\n $serie['name'] = $title;\n }\n foreach ($options as $key => $value) {\n $serie[$key] = $value;\n }\n $this->series[] = $serie;\n }",
"public function setOption($key, $value = null);",
"protected function setJsSetting($key, $value) {\n // initializeJsObject MUST be run once before this function\n echo '<script>autoPopulateFields.' . $key . ' = ' . json_encode($value) . ';</script>';\n }",
"public function setSeries($val)\n {\n $this->_propDict[\"series\"] = $val;\n return $this;\n }",
"function setOption( &$option )\r\n {\r\n if ( is_a( $option, \"eZOption\" ) )\r\n {\r\n $this->OptionID = $option->id();\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if 'Total' has a value | public function hasTotal()
{
return $this->Total !== null;
} | [
"public function hasTotalonly()\n {\n return $this->totalonly !== null;\n }",
"public function validate_total( $total ) {\n if( $total <= 0 ) {\n return false;\n }\n return true;\n }",
"public function isSetOrderTotal()\n {\n return !is_null($this->_fields['OrderTotal']['FieldValue']);\n }",
"public function isSetTotalAmount()\n {\n return !is_null($this->_fields['TotalAmount']['FieldValue']);\n }",
"public static function wcap_check_cart_total ( $cart ){\n\n foreach( $cart as $k => $v ) {\n if( isset( $v->line_total ) && $v->line_total != 0 && $v->line_total > 0 ) {\n return true;\n }\n }\n return apply_filters( 'wcap_cart_total', false );\n\n }",
"public function isSetConvertedTotal()\n {\n return !is_null($this->_fields['ConvertedTotal']['FieldValue']);\n }",
"private function hasEnoughTotal()\n {\n $oCheckoutSession = Mage::getSingleton('checkout/session');\n if ($oCheckoutSession->getQuote()->getBaseGrandTotal() < $this->getMinTotal()) {\n return false;\n }\n return true;\n }",
"public function hasTotalsInc()\n {\n return $this->TotalsInc !== null;\n }",
"public function isSetTotalUnits()\n {\n return !is_null($this->_fields['TotalUnits']['FieldValue']);\n }",
"public function hasTotalsDec()\n {\n return $this->TotalsDec !== null;\n }",
"public function issetDocumentTotals(): bool\n {\n return isset($this->documentTotals);\n }",
"function has_total_shipping_discount() {\n\t\t$shipping_discount_value = get_option( 'shipping_discount_value' );\n\t\treturn get_option( 'shipping_discount' ) && $shipping_discount_value > 0 && $shipping_discount_value <= $this->calculate_subtotal();\n\t}",
"public function hasPrestigeDroppedTotal()\n {\n return $this->prestige_dropped_total !== null;\n }",
"public function testSetTotal() {\n\n $obj = new DecTvaGroupe();\n\n $obj->setTotal(10.092018);\n $this->assertEquals(10.092018, $obj->getTotal());\n }",
"public function hasAmount()\n {\n return isset($this->amount);\n }",
"protected function isZeroOrderTotal()\n {\n return 0 == $this->getCart()->getTotal()\n && \\XLite\\Core\\Config::getInstance()->Payments->default_offline_payment;\n }",
"protected function _isEnabledGrandTotal()\n {\n return Mage::helper('onestepcheckout/config')->showGrandTotal();\n }",
"function BH_custom_total_tag_validation_filter( $result, $tag ) {\r\n\r\n\t/**\r\n\t * Variables\r\n\t */\r\n\tglobal $custom_payment;\r\n\r\n\t$name\t= $tag->name;\r\n\t$total\t= $_POST[ $name ];\r\n\r\n\tif ( ! isset( $total ) || empty( $total ) && '0' !== $total ) {\r\n\r\n\t\t$result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) );\r\n\r\n\t}\r\n\telseif ( ! $custom_payment || $custom_payment->data[ 'total' ] !== $total ) {\r\n\r\n\t\t$result->invalidate( $tag, get_total_error() );\r\n\r\n\t}\r\n\r\n\t// return\r\n\treturn $result;\r\n\r\n}",
"public function testTotal(): void\n {\n $result = $this->Paginator->total();\n $params = $this->Paginator->params();\n $this->assertSame($params['pageCount'], $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays content in the additional logins column | function wpal_show_additional_logins_column_content( $value, $columnName, $userID )
{
if ( !Wpal::is_sub_user() ) {
if ( 'additional_logins' != $columnName ) {
return $value;
} else {
$logins = Wpal::get_login_details( $userID );
return '<strong>' . count( $logins ) . '</strong> - <small><a href="users.php?page=wpal&user=' . $userID . '">Manage</a></small>';
}
} else {
return $value;
}
} | [
"function template_extauth_login_below()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tif (empty($context['enabled_providers']))\n\t{\n\t\treturn '';\n\t}\n\n\techo '\n\t<div class=\"login\">\n\t\t<h2 class=\"category_header hdicon cat_img_login\">\n\t\t\t', $txt['extauth_login'], '\n\t\t</h2>\n\t\t<div class=\"roundframe\">\n\t\t\t<ul class=\"extauth_icons\">';\n\n\tforeach ($context['enabled_providers'] as $provider)\n\t{\n\t\techo '\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"', $scripturl, '?action=extauth;provider=', $provider, ';', $context['session_var'], '=', $context['session_id'], '\" title=\"', $txt['login_with'], $provider, '\" >\n\t\t\t\t\t\t<div class=\"extauth_icon extauth_', strtolower($provider), '\"></div>\n\t\t\t\t\t\t<div class=\"centertext\">', $provider, '</div>\n\t\t\t\t\t</a>\n\t\t\t\t</li>';\n\t}\n\n\techo '\n\t\t\t</ul>\n\t\t</div>\n\t</div>';\n}",
"function wpal_add_additional_logins_column( $columns )\n{\n\tif ( !Wpal::is_sub_user() ) {\n\t\treturn array_merge( $columns, array( 'additional_logins' => __('Additional Logins') ) );\n\t} else {\n\t\treturn $columns;\n\t}\n}",
"public function userLoginDisplay(){\r\n \t \t$this->display();\r\n \t }",
"function _loginusers(){\n\t\t$this->_output['tpl']=\"admin/user/login_users\";\n\t}",
"public static function showList() {\n $template = file_get_contents(plugin_dir_path(__FILE__) . 'templates/login_history.html');\n\n $results = self::queryLoginHistories('desc', 25);\n $histories = '';\n foreach ($results as $history) {\n $histories .= '<tr><td>' . $history->logged_in_at. '</td><td>' . $history->user_login . '</td><td>' . $history->remote_ip . '</td><td>' . $history->user_agent . '</td></tr>';\n }\n\n $output = str_replace('%%page_title%%', get_admin_page_title(), $template);\n $output = str_replace('%%login_histories%%', $histories, $output);\n $output = str_replace('%%Recent%%', __('Recent', 'simple-login-history'), $output);\n $output = str_replace('%%record%%', __('record', 'simple-login-history'), $output);\n $output = str_replace('%%csv_download_link%%', plugin_dir_url(__FILE__) . 'download.php', $output);\n echo $output;\n }",
"private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }",
"public function inloggen()\n\t{\n $data['titel'] = 'Login';\n $data['auteur'] = \"Lorenzo M.| Arne V.D.P. | <u>Kim M.</u> | Eloy B. | Sander J.\";\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n $data['link'] = 'home';\n \n $partials = array('hoofding' => 'main_header','menu' => 'main_menu', 'inhoud' => 'inloggen');\n \n $this->template->load('main_master', $partials, $data);\n }",
"public function display_login_button()\n {\n\n // User is not logged in, display login button\n echo '<li><a class=\"jobsearch-linkedin-bg\" href=\"' . $this->get_auth_url() . '\" data-original-title=\"linkedin\"><i class=\"fa fa-linkedin\"></i>' . __('Login with Linkedin', 'wp-jobsearch') . '</a></li>';\n }",
"function show_login_control_panel()\n\t{\n\t\t$this->secure_hash();\n\t\t\n\t\t$r = $this->html_header()\n\t\t.$this->simple_header()\n\t\t.$this->body\n\t\t.$this->copyright()\n\t\t.$this->html_footer();\n\t\n\t\t$this->EE->output->set_output($r);\n\t}",
"function loginHistoryAccountAdmin(){\n\t\t\t$query = \"select * from login_history where user_id = '{$this->value('patient_id')}' and user_type = '1' ORDER BY login_date_time DESC \";\n\t\t\t$result = @mysql_query($query);\n\t\t\twhile($row = @mysql_fetch_array($result)){\n\t\t\t\t$login_data = date(\"l,F j, Y - h:ia \",strtotime($row['login_date_time']));\n\t\t\t\t$data = array(\n\t\t\t\t\t'login_data' => $login_data,\n\t\t\t\t\t'style' => $cnt++%2?\"ineerwhite\":\"inergrey\"\n\t\t\t\t);\n\t\t\t\t$replace['loginHistoryRecord'] .= $this->build_template($this->get_template(\"loginHistoryRecord\"),$data);\n\t\t\t}\n\t\t\t$replace['browser_title'] = \"Tx Xchange: View Login History\";\n\t\t\t$this->output = $this->build_template($this->get_template(\"loginHistory\"),$replace);\n\t\t}",
"function template_steam_login_above() {}",
"public function handle_login_preview() {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_filter( 'the_title', array( $this, 'login_form_preview_title' ) );\n\t\tadd_filter( 'the_content', array( $this, 'login_form_preview_content' ) );\n\t}",
"private function last_login_init(){\r\n\t\r\n\t\t//setup custom column in user list to display last login\r\n\t\tif(\"true\" == $this->opt['basic_settings']['enable_last_login_column']){\r\n\t\t\r\n\t\t\t$access_log_last_login = new Access_Log_Last_Login();\r\n\t\t\t$access_log_last_login->init();\r\n\r\n\t\t}\r\n\t}",
"public function listLoginAction() {\n $em = $this->getDoctrine()->getManager();\n\n $logins = $em->getRepository('RocketfireAgenceMainBundle:Login')->findAll();\n\n return $this->render('RocketfireAgenceMainBundle:Login:index.html.twig', [\n 'logins' => $logins,\n ]);\n }",
"public function getLoginLog() {\n $repository = App::make(LoginLogRepositoryInterface::class);\n\n return View::make('oxygen/mod-security::loginLog', [\n 'log' => $repository->all(),\n 'title' => Lang::get('oxygen/mod-security::ui.loginLog.title')\n ]);\n }",
"public function login_template()\n\t{\n\t\techo '\n\t\t\t<a class=\"login-twitch\" href=\"'.$this->api_oauth2_url.'&client_id='.$this->api_client_id.'&redirect_uri='.$this->api_redirect_uri.'&scope='.$this->api_scope.'\">Login</a><br/>\n\t\t\t';\t\n\t}",
"public function set_login_display(){\n\t\t$login .= '<div id=\"login_system\">';\n\t\t$login .= '<form action=\"?d=0&action=dashboard\" method=\"POST\">';\n\t\t$login .= '<div class=\"item\"><label for=\"username\">Login:</label><input class=\"text\" id=\"username\" type=\"text\" name=\"username\" /></div>';\n\t\t$login .= '<div class=\"item\"><label for=\"password\">Password:</label><input class=\"text password\" id=\"password\" type=\"password\" name=\"password\" /></div>';\n\t\t$login .= '<input type=\"hidden\" name=\"staff_login\" value=\"1\" />';\n\t\t$login .= '<div class=\"item\"><label> </label><input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Log in\" /></div>';\n\t\t$login .= '</form>';\n\t\t$login .= '</div>';\n\t\t\n\t\treturn $login;\t\t\n\t\n\t}",
"protected function draw_logged_in_user() {\n\t\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$server = $this->getServer();\n\n\t\t$logged_in_dn = $server->getLogin(null);\n\t\techo '<tr>';\n\t\techo '<td class=\"spacer\"></td>';\n\t\tprintf('<td class=\"logged_in\" colspan=\"%s\">%s: ',$this->getDepth()+3-1,_('Logged in as'));\n\n\t\tif ($server->getContainerTop($logged_in_dn) == $logged_in_dn) {\n\t\t\t$logged_in_branch = '';\n\t\t\t$logged_in_dn_array = array();\n\n\t\t} else {\n\t\t\t$logged_in_branch = preg_replace('/,'.$server->getContainerTop($logged_in_dn).'$/','',$logged_in_dn);\n\t\t\t$logged_in_dn_array = pla_explode_dn($logged_in_branch);\n\t\t}\n\n\t\t$bases = $server->getContainerTop($logged_in_dn);\n\t\tif (is_array($bases) && count($bases))\n\t\t\tarray_push($logged_in_dn_array,$bases);\n\n\t\t$rdn = $logged_in_dn;\n\n\t\t# Some sanity checking here, in case our DN doesnt look like a DN\n\t\tif (! is_array($logged_in_dn_array))\n\t\t\t$logged_in_dn_array = array($logged_in_dn);\n\n\t\tif (trim($logged_in_dn)) {\n\t\t\tif ($server->dnExists($logged_in_dn))\n\t\t\t\tforeach ($logged_in_dn_array as $rdn_piece) {\n\t\t\t\t\t$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$server->getIndex(),rawurlencode($rdn));\n\t\t\t\t\tprintf('<a href=\"%s\">%s</a>',htmlspecialchars($href),pretty_print_dn($rdn_piece));\n\n\t\t\t\t\tif ($rdn_piece != end($logged_in_dn_array))\n\t\t\t\t\t\techo ',';\n\n\t\t\t\t\t$rdn = substr($rdn,(1 + strpos($rdn,',')));\n\t\t\t\t}\n\n\t\t\telse\n\t\t\t\techo $logged_in_dn;\n\n\t\t} else {\n\t\t\techo 'Anonymous';\n\t\t}\n\n\t\techo '</td>';\n\t\techo '</tr>';\n\t}",
"function f_userHeaderDisplay()\n {\n if(isUserLoggedIn()) {\n global $loggedInUser;\n $name = $loggedInUser->displayname;\n\n echo \"\n <ul class='right' id='top_bar_right'>\" .\n f_user_logged_in_display($name) .\n \"</ul>\";\n }\n else {\n echo \"\n <ul class='right' id='top_bar_right'>\" .\n f_user_login_form(\"<a href='#'>.</a>\") .\n \"</ul>\";\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a closest ancestor of the selected node which is visible (included in the document subset) | public function getVisibleAncestor(DOMElement $node)
{
$parent = $node->parentNode;
while (
$parent->nodeType == XML_ELEMENT_NODE
&& !$this->isIncluded($parent)
) {
$parent = $parent->parentNode;
};
if ($parent->nodeType == XML_ELEMENT_NODE) {
return $parent;
};
return null;
} | [
"public function getAncestor()\n {\n return $this->ancestor;\n }",
"public function ancestor()\n {\n $ancestors = $this->ancestors;\n if (!empty($ancestors)) {\n return array_pop($ancestors);\n }\n }",
"protected function getAncestor()\n\t{\n\t\treturn $this->ancestor;\n\t}",
"public function getAncestor($depth);",
"public function ancestorOrSelf() {\n\t\t$owner = $this->getOwner();\n\t\t$leftIndexAttributeName = $this->getLeftIndexAttributeName();\n\t\t$rightIndexAttributeName = $this->getRightIndexAttributeName();\n\n\t\t$attributes = array(\n\t\t\t$leftIndexAttributeName => '<=' . $owner->getAttribute($leftIndexAttributeName),\n\t\t\t$rightIndexAttributeName => '>=' . $owner->getAttribute($rightIndexAttributeName)\n\t\t);\n\t\treturn $this->applyAttributeCriteria($attributes);\n\t}",
"public function getAdminOverrideAncestor()\n {\n return $this->admin_override_ancestor;\n }",
"public static function getAncestor($idx = null) {\n $class = get_called_class();\n $ancestors = ancestry($class);\n if ($idx === null ){ \n return $ancestors;\n }\n $idx = to_int($idx);\n if ($idx >= sizeof($ancestors)) {\n return null;\n }\n return $ancestors[$idx];\n }",
"function find_ancestor_tag($tag)\n {\n global $debugObject;\n if (is_object($debugObject)) {\n $debugObject->debugLogEntry(1);\n }\n\n // Start by including ourselves in the comparison.\n $returnDom = $this;\n\n while (!is_null($returnDom)) {\n if (is_object($debugObject)) {\n $debugObject->debugLog(2, \"Current tag is: \" . $returnDom->tag);\n }\n\n if ($returnDom->tag == $tag) {\n break;\n }\n $returnDom = $returnDom->parent;\n }\n return $returnDom;\n }",
"public function getAncestorField()\n {\n return $this->ancestor_field;\n }",
"public function getParent()\n {\n return $this->tryFind('..', 'xpath');\n }",
"function get_top_ancestor_id(){\n\tglobal $post;\n\tif($post->post_parent){\n\t\t$ancestors= array_reverse(get_post_ancestors($post->ID));\n\t\treturn $ancestors[0];\n\t}\t\n\treturn $post->ID;\n}",
"public function testFindAncestors() {\n\n\t\t$xmlFile = Bootstrap::$resourceDir . '/elixir/document/lexer/find_ancestors.xml';\n\n\t\t$doc = new XMLDocument();\n\t\t$doc->load($xmlFile);\n\n\t\t$lexer = new Lexer();\n\t\t$stream = $lexer->scan($doc);\n\n\t\t/* @var \\com\\mohiva\\elixir\\document\\tokens\\NodeToken $token */\n\t\t$token = $stream->getLookahead(2);\n\t\t$this->assertNull($token->getAncestor());\n\n\t\t$token = $stream->getLookahead(4);\n\t\t$this->assertNotNull($token->getAncestor());\n\n\t\t$token = $stream->getLookahead(6);\n\t\t$this->assertNotNull($token->getAncestor());\n\n\t\t$token = $stream->getLookahead(8);\n\t\t$this->assertNotNull($token->getAncestor());\n\t}",
"public function rootAncestor()\n {\n return $this->newRootAncestor(\n (new static())->newQuery(),\n $this,\n $this->getQualifiedParentKeyName(),\n $this->getLocalKeyName()\n );\n }",
"function get_top_ancestor_id(){\n\t\tglobal $post;\n\t\t\n\t\tif ($post->post_parent) {\n\t\t\t\t$ancestors = array_reverse(get_post_ancestors($post->ID));\t\n\t\t\t\treturn $ancestors[0];\n\t\t}\n\t\treturn $post->ID;\n\t}",
"public function getAncestor($n = 1)\n {\n if ($n < 1) {\n return null;\n }\n $current = $this;\n for ($i = 0; $i < $n; ++$i) {\n if (!$current->parent) {\n return null;\n }\n $current = $current->parent;\n }\n return $current;\n }",
"public function nearestAncestor($commit, $directory, $includeself = true) {\n\n\t $between = $this(\"rev-list {$commit} --max-count=2 -- $directory\")->lines;\n\n\t if (!$includeself && count($between) == 2 && $between[0] == $commit) {\n\t return $between[1];\n\t } else if (count($between) >= 1 && $between[0] != $commit) {\n\t return $between[0];\n\t } else if ($includeself && count($between) >=1 && $between[0] == $commit) {\n\t return $commit;\n\t }\n\n\t return null;\n\t}",
"function get_top_ancestor_id() {\n\t\n\tglobal $post;\n\t\n\tif ($post->post_parent) {\n\t\t$ancestors = array_reverse(get_post_ancestors($post->ID));\n\t\treturn $ancestors[0];\n\t\t\n\t}\n\t\n\treturn $post->ID;\n\t\n}",
"public function getMandatoryAncestor()\n {\n $value = $this->get(self::MANDATORY_ANCESTOR);\n return $value === null ? (string)$value : $value;\n }",
"function page_ancestor() {\n\t$parent = array_reverse(get_post_ancestors($post->ID));\n\t$first_parent = get_post($parent[0]);\n\techo $first_parent->post_title;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ return a (big) string containing the contents of a template file with all the variables interpolated. all the variables must be in the $var[] array or object (whatever you decide to use). WARNING: do not use this on big files!! | function read_template($filename, &$var) {
$temp = str_replace("\\", "\\\\", implode(file($filename), ""));
$temp = str_replace('"', '\"', $temp);
eval("\$template = \"$temp\";");
return $template;
} | [
"function loadTemplate($filename, $templateVars) {\n extract($templateVars);\n ob_start();\n require $filename;\n $contents = ob_get_clean();\n return $contents;\n}",
"public function file_get_template($filename)\n\t{\t\n\t //Check the filename root\n\t $fullname = Ashtree_Common::get_real_path($filename, TRUE);\n\t \n\t // Fallback for missing templates\n\t if (!file_exists($fullname)) $fullname = str_replace(ASH_BASENAME . \"bin/templates/\", ASH_ROOTNAME . \"{$this->theme}bin/templates/\", $filename);\n\t if (!file_exists($fullname)) $fullname = Ashtree_Common::get_real_path(ASH_ROOTPATH . \"bin/templates/404.tpl.php\", TRUE);\n\t if (!file_exists($fullname)) $fullname = Ashtree_Common::get_real_path(ASH_ROOTNAME . \"{$this->theme}bin/templates/404.tpl.php\", TRUE);\n\t \n\t $this->_debug->log(\"INFO\", \"Retrieving template data from '{$fullname}'\");\n\t \n\t // Determine all variables to be replaced with values\n\t // Call this before including a file\n\t // for the variables to be accessible in the php tags\n\t foreach((array)$this->get_user_defined_vars() as $var123=>$val456)\n\t\t{\n\t\t $$var123 = $val456;\n\t\t if (is_array($val456)) {\n\t\t\t\tforeach($val456 as $k123=>$v456) $var_values[\"{\\${$var123}.{$k123}}\"] = $v456;\n\t\t\t} else {\n\t\t\t\t$var_values[\"{\\${$var123}}\"] = $val456;\n\t\t\t}\n\t\t}//foreach\n\t\t\n\t // Get the contents of the template file\n\t ob_start();\n\t \n\t //Check that the file can be included\n\t // Not necessary to have 2 checks to see if file exists\n\t // as include will perform that\n\t\tif (!@include_once($fullname)) {\n\t\t // No text was retrieved from the template\n\t\t $this->_debug->status(\"ABORT\");\n\t\t return FALSE;\n\t\t}\n\t\t// Continue, everthing is ok\n\t\t$this->_debug->status(\"OK\");\n\t\t\n\t\t//Save contents to buffer\n\t\t$text = ob_get_clean();\n\t\t\n\t\treturn $this->string_get_template($text, $var_values);\n\t}",
"function fl_render_template($filename, ...$values_optional) {\n\tif (isset($values_optional[0])) {\n\t\t$values = $values_optional[0];\n\t} else {\n\t\t$values = NULL;\n\t}\n\t$page = file_get_contents($filename);\n\t// find all vars placeholder\n\tpreg_match_all(\"|{{(.*)}}|U\", $page, $out, PREG_PATTERN_ORDER);\n\tforeach($out[0] as $code) {\n\t\t$var = str_replace('{{', '', $code);\n\t\t$var = str_replace('}}', '', $var);\n\t\t$var = trim($var);\n\t\t$val = \"\";\n\t\t// check if value is defined\n\t\tif ($values!=NULL) {\n\t\t\tif (array_key_exists($var, $values)) {\n\t\t\t\t$val = $values[$var];\n\t\t\t} else {\n\t\t\t\t$val = \"\";\n\t\t\t}\n\t\t}\n\t\t// replace value\n\t\t$page = str_replace($code, $val, $page);\n\t}\n\t// find all code placeholder - TAKE CARE OF INJECTIONS!!!\n\tpreg_match_all(\"|{%(.*)%}|U\", $page, $out, PREG_PATTERN_ORDER);\n\tforeach($out[0] as $code) {\n\t\t$var = str_replace('{%', '', $code);\n\t\t$var = str_replace('%}', '', $var);\n\t\t$var = trim($var);\n\t\tob_start();\n\t\teval($var);\n\t\t$val = ob_get_contents();\n\t\tob_end_clean();\n\t\t// replace value\n\t\t$page = str_replace($code, $val, $page);\n\t}\n\t// return rendered content\n\techo $page;\n\treturn;\n}",
"private function createFromTemplate(): string\n {\n ob_start();\n ob_implicit_flush(0);\n\n if (!empty($this->message) && is_array($this->message)) {\n extract($this->message, EXTR_OVERWRITE);\n }\n\n require $this->templatePath . '.php';\n\n return ob_get_clean();\n }",
"function template_string($template_name, $values = null) {\n global $template_style_dir;\n if (!isset($template_style_dir))\n err(\"no template style directory set\");\n\n ob_start();\n template_draw($template_name, $values);\n $ret = ob_get_contents();\n ob_end_clean();\n return $ret;\n}",
"function read_template_file($file)\r\n{\r\n\treturn file_get_contents($file);\r\n}",
"function simple_tpl ($filename, $variables) {\n echo \"INTO THE FAST TEMPLATE with $filename AND $variables\";\n $tpl = new FastTemplate(\"/home/v-excel/www/ola/tpl/\");\n # $tpl = new FastTemplate (\"/ola/tpl/\");\n echo \"dddd\";\n $tpl->define (array (\"file_list\" => $filename));\n $tpl->assign ($variables);\n $tpl->parse (\"parsed\", \"file_list\");\n return $tpl->fetch (\"parsed\");\n}",
"public static function phpTemplate($__file__, $__vars__, $html_escape=false) {\r\n if($html_escape) {\r\n array_walk_recursive($__vars__, function (&$v) {\r\n $v = nl2br(htmlspecialchars($v));\r\n });\r\n }\r\n unset($html_escape);\r\n extract($__vars__, EXTR_SKIP);\r\n unset($__vars__);\r\n ob_start();\r\n include $__file__;\r\n return ob_get_clean();\r\n }",
"public function getTemplateContent($file,$params) {\n ob_start(); \t\n require(APPLICATION_PATH.'/../utils/Models/templates/'.DIRECTORY_SEPARATOR.$file);\n $data=ob_get_contents();\n ob_end_clean(); \n return $data;\t\t\n\t}",
"function parse() {\n $str = $this->content;\n foreach ($this->vars as $name=>$val) {\n $str = str_replace('{'.$name.'}', $val, $str);\n }\n // return template content with real values\n return $str;\n\n }",
"function SstTS_templateProcessor($input,$ftpl) {\n\t$T = file_get_contents($ftpl);\n\t// não faz loop... precisa de recurso para loop\n\treturn sst_expandVars($T,$input, $prefix='\\$', $lazy);\n}",
"function readTemplate($filename) {\n\tglobal $temp_start, $temp_stop;\n\t$str = file_get_contents($filename,true);\n\t\n\t//Revove the file start, stop and control characters\n\t$str = str_replace($temp_start, \"\", $str);\n\t$str = str_replace($temp_stop, \"\", $str);\n\t$str = preg_replace( '/[^[:print:]]/', '',$str);\n\t$str = stripslashes($str);\n\t\n\t//Decode the object\n\t$json = json_decode($str);\n\t\n\t//Return the template\n\treturn $json;\n}",
"private function getTemplate(): string\n {\n return \"%s\\t%s\\t\\t%s;\\n\";\n }",
"function fill_template($variables, $template)\n {\n foreach ($variables as $variable => $value) {\n $template = str_replace($variable, $value, $template);\n }\n\n return $template;\n }",
"function read_templates ($filename, $tpl_name='') {\n global $TPL, $LANG;\n if(!($FILE = fopen($filename,'r'))){\n print \"Can't open template file $filename\";\n return false;\n }\n if($tpl_name){\n $TPL[$tpl_name] = '';\n }\n while(!feof($FILE)){\n $str = fgets($FILE);\n if(preg_match('/^\\s*\\#TEMPLATE\\s+(\\w+)/i',$str,$matches)){\n $tpl_name = $matches[1];\n $TPL[$tpl_name] = '';\n }elseif(preg_match('/^\\s*\\<\\!--\\#TEMPLATE\\s+(\\w+)/i',$str,$matches)){\n $tpl_name = $matches[1];\n $TPL[$tpl_name] = '';\n }elseif(preg_match('/^\\s*\\#TRANSLATE\\s+(\\w+)\\s*(.*)$/i',$str,$matches)){\n $LANG[$matches[1]] = $matches[2];\n }elseif(preg_match('/^\\s*\\<\\!--\\#TRANSLATE\\s+(\\w+)\\s*(.*)\\s*--\\>$/i',$str,$matches)){\n $LANG[$matches[1]] = $matches[2];\n }elseif(preg_match('/^\\s*\\#/',$str)){\n // just a comment - do nothing\n }elseif($tpl_name){\n $TPL[$tpl_name] .= $str;\n }\n }\n fclose($FILE);\n return true;\n}",
"function template_eval(&$template, &$vars)\n{\n return strtr($template, $vars);\n}",
"function _parseTemplate ($file) {\r\n\r\n\t$tab = explode ( \"/\", $file ) ;\r\n\tif ( isset ( $tab[1] ) AND $tab[1] ) $fichier = $tab[1] ;\r\n\telse $fichier = $file ;\r\n\tif ( file_exists ( \"templates_int/\".$fichier ) ) $file = \"templates_int/\".$fichier ;\r\n\telse $file = \"templates_gen/\".$fichier ;\r\n\t\r\n\tif (!file_exists($file) ) {\r\n\t\t$this->halt(\"Could not open file : $file\");\r\n\t}\r\n\r\n\t$this->template = join (\"\", file(trim($file) ) );\r\n\r\n\t$delim = preg_quote($this->lm_delimiter, '/');\r\n\r\n\t// Gather all template tags\r\n\tpreg_match_all (\"/(<{$delim}([\\w]+)[^>]*>)(.*)(<\\/{$delim}\\\\2>)/imsU\", $this->template, $matches);\r\n\r\n\tfor ($i=0; $i< count($matches[0]); $i++) {\r\n\t\tswitch(strtolower($matches[2][$i])) {\r\n\t\t case 'config':\r\n\t\t\t$this->_getConfig($matches[3][$i]);\r\n\t\t\tbreak;\r\n\t\t case 'php':\r\n\t\t\t$this->before_line = $matches[3][$i];\r\n\t\t\tbreak;\r\n\t\t case 'list':\r\n\t\t\t$list_block = $matches[3][$i];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t// Split content by template tags to obtain non-template conten\r\n $text_blocks = preg_split(\"/(<{$delim}([\\w]+)[^>]*>)(.*)(<\\/{$delim}\\\\2>)/imsU\", $list_block);\r\n\t$matches = count($text_blocks);\r\n\tif ($matches>0) {\r\n\t\t// Get starting block (list header)\r\n\t\t$pattern = preg_quote($text_blocks[0], '/');\r\n\t\tif (preg_match(\"/^{$pattern}/imsU\", $list_block, $match)) {\r\n\t\t\t$this->begin_block = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($text_blocks[0])));\r\n\t\t}\r\n\t\tif ($matches>1) {\r\n\t\t\t// Get ending block (list footer)\r\n\t\t\t$pattern = preg_quote($text_blocks[$matches-1], '/');\r\n\t\t\tif (preg_match(\"/{$pattern}$/imsU\", $list_block, $match)) {\r\n\t\t\t\t$this->end_block = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($text_blocks[$matches-1])));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Now Gather inner blocks in list block\r\n\tpreg_match_all (\"/(<{$delim}([\\w]+)[^>]*>)(.*)(<\\/{$delim}\\\\2>)/imsU\", $list_block, $matches);\r\n\tfor ($i=0; $i< count($matches[0]); $i++) {\r\n\t\tswitch(strtolower($matches[2][$i])) {\r\n\t\t case 'begin_level':\r\n\t\t\t$this->begin_level = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($matches[3][$i])));\r\n\t\t\tbreak;\r\n\t\t case 'item':\r\n\t\t\t$this->item_block = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($matches[3][$i])));\r\n\t\t\tbreak;\r\n\t\t case 'no_item':\r\n\t\t\t$this->no_item_block = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($matches[3][$i])));\r\n\t\t\tbreak;\r\n\t\t case 'end_level':\r\n\t\t\t$this->end_level = str_replace('\"','\\\"', preg_replace(\"/\\{([a-zA-Z0-9_\\\\[\\\\]]+)\\}/ms\", '$\\\\1', trim ($matches[3][$i])));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n/*\r\necho \"<br><pre>template : \" . htmlspecialchars($this->template);\r\n\r\necho \"\\n\\n begin_block: \".htmlspecialchars($this->begin_block);\r\necho \"\\n\\n begin_level: \".htmlspecialchars($this->begin_level);\r\necho \"\\n\\n item_block: \".htmlspecialchars($this->item_block);\r\necho \"\\n\\n end_level: \".htmlspecialchars($this->end_level);\r\necho \"\\n\\n end_block: \".htmlspecialchars($this->end_block);\r\n*/\r\n\r\n }",
"function parseEmailTemplate($tplFilename, $order)\n{\n /* fetch the template content */\n $tplContent = file_get_contents(\"var/template/\".$tplFilename);\n\n /* parse it and substitute the marker with the field value */\n preg_match_all(\"/%([^%]*)%/\", $tplContent, $aMatches);\n for($x = 0; $x < count($aMatches[0]); $x++)\n {\n $tplContent = str_replace($aMatches[0][$x], $order->$aMatches[1][$x], $tplContent);\n }\n /* add order ID */\n $tplContent = str_replace('%specialordersId%', $resultID, $tplContent);\n\n return $tplContent;\n}",
"public function get_template_vars();"
] | {
"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.