query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
/ replace placeholders in message with values from content array | public function formate($message, array $content) {
foreach ($content as $placeholder => $value) {
$replacement['{' . $placeholder . '}'] = (string) $value;
}
return \strtr($message, $replacement);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function makeReplacements(&$message, $token, $replacement) {\n foreach($message as $key => &$value){\n $value = nl2br($value);\n }\n $message['subject'] = str_replace($token, $replacement, $message['subject']);\n $message['body'] = str_replace($token, $replacement, $message['body']);\n }",
"public static function replacePlaceholders($message, array $context = array ())\n {\n if (is_array($message) || (false === strpos($message, '{')))\n {\n return $message;\n }\n\n $replacements = array();\n\n // build the replacement array with braces around the context keys\n foreach ($context as $key => $value)\n {\n $replacements['{' . $key . '}'] = LoggerManager::getAsString($value);\n }\n\n // replace placeholders and return the message\n return strtr($message, $replacements);\n }",
"public function replace(array $messages, string $domain = 'messages');",
"function parse_msg(string $message,array $replacements)\n{\n //If the replacements are not an array ~ return the message\n if(!is_array($replacements))\n { return $message; }\n\n //Otherwise, loop through the replacements and replace them in the message provided\n foreach ($replacements as $key => $value) \n {\n $value = (isset($value) && !empty($value)) ? $value : '[Not set]';\n // replace the $key with the value\n $replace_str = '['.(string)$key.']';;# The string to be replaced\n $message = str_replace($replace_str,$value,$message);\n }\n\n return $message;\n}",
"protected function replaceMessagePlaceholdersWithContextData(& $message, array $context)\n {\n $replace = array();\n foreach ($context as $key => $value) {\n if (is_scalar($value) || (is_object($value) && method_exists($value, \"__toString\") ) ) {\n if (is_bool($value) || is_null($value) || is_integer($value) || is_float($value) ) {\n $value = var_export($value, true);\n }\n else {\n $value = strval($value);\n }\n\n $replace[\"{\" . $key . \"}\"] = $value;\n }\n }\n\n $message = strtr($message, $replace);\n }",
"public function replaceArrays($message, $array) : string{\n \tforeach($array as $key => $value){\n \t\t$message = str_replace(\"{\" . strtoupper($key) . \"}\", $value, $message);\n \t}\n \treturn $message;\n }",
"public function the_replacers($content) {\n \n // Get replacers\n $replacers = md_the_component_variable('content_replacer');\n\n // Get placeholders\n preg_match_all(\"/{[^}]*}/\", $content, $placeholders);\n\n // Verify if placeholders exists\n if ( $placeholders[0] ) {\n\n foreach ( $placeholders[0] as $placeholder ) {\n\n $found = explode(' ', str_replace(array('{', '}'), array('', ''), $placeholder));\n\n if ( $found[0] ) {\n\n if ( isset($replacers[$found[0]]) ) {\n\n $args = array(\n 'start' => 1,\n 'content' => $content\n );\n\n if ( count($found) > 1 ) {\n\n for( $f = 1; $f < count($found); $f++ ) {\n\n parse_str(str_replace('\"', \"\", $found[$f]), $a);\n\n $key = array_keys($a);\n \n if ( isset($a[$key[0]]) ) {\n\n $args[$key[0]] = $a[$key[0]];\n\n }\n\n }\n\n }\n\n $content = $replacers[$found[0]]($args);\n\n } else if ( isset($replacers[str_replace('|', '', $found[0])]) ) {\n\n $args = array(\n 'end' => 1,\n 'content' => $content\n );\n\n $content = $replacers[str_replace('|', '', $found[0])]($args);\n\n }\n\n }\n\n }\n\n }\n\n return $content;\n\n }",
"private function replaceVars($message)\r\n {\r\n $arrData = array();\r\n $arrData = $this->forceCamelCase($this->paymentStatus);\r\n $arrData = array_merge($this->forceCamelCase($this->getArray),$arrData);\r\n $arrData['amount'] = number_format(($this->paymentStatus['amount']/100),2,',','.'); // Convert cents into whole amount\r\n \r\n foreach ($arrData as $key=>$val)\r\n {\r\n $arrData[\"#\".$key.\"#\"] = $val; // Append matching value\r\n unset($arrData[$key]);\r\n }\r\n \r\n $message = str_ireplace(array_keys($arrData),array_values($arrData),$message);\r\n \r\n return $message;\r\n }",
"private function msg_replace($msg) {\n\n\t\t$find = array();\n\t\t$replace = array();\n\t\tforeach($this->msg_replace as $replace_string=>$find_strings) {\n\t\t\t$find = array_merge($find, $find_strings);\n\t\t\tforeach($find_strings as $string) {\n\t\t\t\t$replace[] = $replace_string;\n\t\t\t}\n\t\t};\n\n\t\t$msg = str_replace($find, $replace, $msg);\n\n\t\treturn $msg;\n\n\t}",
"function getEmailMessage($message_text,$hashvalues)\n{\n\tpreg_match_all('/((#\\w+\\b#))/i', $message_text, $matches);\n\tfor ($i = 0; $i < count($matches[1]); $i++)\n\t{\n\t$key = $matches[1][$i];\n\t$value = $matches[2][$i];\n\t$$key = $value;\n\t$message_text=str_replace($key,$hashvalues[$i],$message_text);\n\t}\n\treturn $message_text;\n}",
"function setMailContent($data, $content)\n{\n\t$result=$content;\n\tif($data['0']!='')\n\t\t$result = str_replace('{fname}', $data['0'], $result);\n\tif($data['1']!='')\n\t\t$result = str_replace('{username}', $data['1'], $result);\n\tif($data['2']!='')\n\t\t$result = str_replace('{password}', $data['2'], $result);\n\t//echo $result;\t\n\treturn $result;\n}",
"function replace_occurrence($string, $values)\n{\n $occurrences = $values->map(function ($message, $key) {\n return [\n 'key' => \":$key\",\n 'message' => $message,\n ];\n });\n\n return str_ireplace(\n $occurrences->pluck('key')->toArray(), $occurrences->pluck('message')->toArray(), $string\n );\n}",
"function frame_email_body($message_id, $content_vars, $replace_vals)\n\t{\n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::frame_email_body() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\tif(count($content_vars) == count($replace_vals))\n\t\t{\t\t\t\n\t\t\t$result = $this->fetch_flds(\"emails\",\"emails_subject,emails_body,emails_format\",\"emails_id = $message_id\");\n\t\t\t\n\t\t\t$records=mysql_fetch_row($result[0]);\n\t\t\t\n\t\t\t$this->email_subject = $records[0];\n\t\t\t\n\t\t\t$this->email_type = $records[2];\n\t\t\t\n\t\t\t//echo $records[1];\n\t\t\t\n\t\t\t$this->email_message = $records[1];\n\t\t\t\n\t\t\tfor($i = 0; $i < count($content_vars); $i++)\n\t\t\t{\n\t\t\t\n\t\t\t\t$this->email_subject = str_replace($content_vars[$i],$replace_vals[$i],$this->email_subject);\n\n\t\t\t\t$this->email_message = str_replace($content_vars[$i],$replace_vals[$i],$this->email_message);\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->email_log_message = $this->email_message;\n\t\t\t//Comment on 27-04-2007\n\t\t\t/*\n\t\t\tif($GLOBALS['site_config']['use_pearmail'] != 1)\n\t\t\t$this->email_message = chunk_split(base64_encode($this->email_message));\n\t\t\t//echo $this->email_message;\n\t\t\t*/\n\t\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::frame_email_body() - RETURN VALUE : ', $this->email_log_message);\n\t\t}\n\t\t/*else{\t\n\t\techo \"not func\";\t\n\t\t}*/\n\n\t}",
"function ourExternalTpl($array, $content)\n {\n $content = str_replace(array(\"{TITLE}\", \"{PROJECT}\", \"{VERSION}\"), array($array['title'], $array['system']['title_project'], $array['system']['version_cms']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }",
"function textblock_template_replace(&$textblock, $replace)\n{\n foreach ($replace as $key => $value) {\n $textblock['title'] = str_replace(\"%$key%\", $value, $textblock['title']);\n $textblock['text'] = str_replace(\"%$key%\", $value, $textblock['text']);\n }\n}",
"function ourInsideTpl($array, $content)\n {\n if (!isset($_COOKIE['char'])) { $array['char']['name'] = 'не выбран';} \n $content = str_replace(array(\"{TITLE}\", \"{USERNAME}\", \"{PROJECT}\", \"{VERSION}\", \"{CHAR}\"), array($array['title'], $array['username'], $array['system']['title_project'], $array['system']['version_cms'], $array['char']['name']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }",
"public function contentStrReplace() {}",
"function getMessage($msg, $params=NULL){\r\n\tfor($i=0;$i<count($params);$i++)\r\n\t\t$msg = str_replace('%'.($i+1), $params[$i], $msg);\r\n\treturn $msg;\r\n}",
"private function interpolate($message, array $context = array())\n {\n // build a replacement array with braces around the context keys\n $replace = array();\n foreach ($context as $key => $val) {\n // check that the value can be casted to string\n if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {\n $replace['{' . $key . '}'] = $val;\n }\n }\n\n // interpolate replacement values into the message and return\n return strtr($message, $replace);\n }",
"public function replace(array $messages, string $domain = 'messages'): void;",
"function setPlaceholders($placeholders, $tpl) {\r\n $keys = array();\r\n $values = array();\r\n\r\n foreach ($placeholders as $key => $value) {\r\n $keys[] = '[+' . $key . '+]';\r\n $values[] = $value;\r\n }\r\n\r\n return str_replace($keys, $values, $tpl);\r\n }",
"function translate_replace($params){\n $string = array_shift($params);\n foreach ($params as $value){\n $replace[] = $value;\n }\n return XT::translate_replace($string, $replace);\n}",
"function ReplaceContent( $data, $template_html )\n{\n foreach ( $data as $row )\n {\n //replace fields with values in template\n $content = $template_html;\n foreach($row as $field => $value)\n {\n $content = str_replace(\"@@$field@@\", $value, $content);\n\n }\n\n print $content;\n }\n}",
"protected function interpolate($message, array $context = array()) {\n // build a replacement array with braces around the context\n // keys\n $replace = array();\n foreach ($context as $key => $val) {\n $replace['{' . $key . '}'] = $val;\n }\n \n // interpolate replacement values into the message and return\n return strtr($message, $replace);\n }",
"function get_fallback_value(&$campaign_content=\"\",&$text_message=\"\",$arrPersonalizeReplace=array()){\n\t$string\t\t=\t\t$campaign_content;\n\t$CI =\t\t& get_instance();\n\t\n\t//$pattren=\"/\\{([a-zA-Z0-9_-])*,([a-zA-Z0-9_-])*\\}/\";\n\t$pattren=\"/\\{([a-zA-Z0-9_-])*,([^\\/])*\\}/\";\n\tpreg_match_all($pattren,$string,$regs);\n\tforeach($regs[0] as $value){\n\t\t$fallback_value=$value;\n\t\t$value=trim($value,'}');\n\t\t$expl_value=explode(\",\",$value,2);\n\t\t$sql = 'SELECT name,value FROM `red_email_personalization` where value like \\'%'.$expl_value[0].'%\\'';\n\t\t$query = $CI->db->query($sql);\n\t\t\n\t\tif ($query->num_rows() >0){\n\t\t\t$result_array=$query->result_array();\t#Fetch resut\n\t\t\tforeach($result_array as $row){\n\t\t\t\t#Create an array of the required personalisation token and default value from CAMPAIGN\n\t\t\t\t$arrPersonalizeReplace[$row['name']] = $expl_value[1];\n\t\t\t\t$fallback_search_arr[]=$fallback_value;\n\t\t\t\t$fallback_replace_arr[]=$row['value'];\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//$campaign_content=str_replace($fallback_search_arr, $fallback_replace_arr, $string);\n\t//$text_message=str_replace($fallback_search_arr, $fallback_replace_arr, $text_message);\n\treturn $arrPersonalizeReplace;\n}",
"protected function prepareMessage() {\n //Initialize $message\n $message = '';\n //loop through $this->_storage array\n foreach ($this->_storage as $key => $value) {\n // if it has no value, assign 'Not provided' \n $value = (empty($value)) ? 'Not provided' : $value;\n // if an array, expand as comma-separated string \n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n // replace underscores and hyphens in the label with spaces \n $key = str_replace(array('_', '-'), ' ', $key);\n // add label and value to the message body. Uppercase first letter\n $message .=ucfirst($key) . \": $value\\r\\n\\r\\n\";\n }\n // limit line length to 70 characters \n $this->_body = wordwrap($message, 70);\n }",
"private function interpolate($message, array $context): string\n {\n $message = (string) $message;\n if (strpos($message, '{') === false) {\n return $message;\n }\n\n $replacements = [];\n foreach ($context as $key => $val) {\n if ($val === null || is_scalar($val) || (is_object($val) && method_exists($val, '__toString'))) {\n $replacements[\"{{$key}}\"] = $val;\n } elseif ($val instanceof DateTimeInterface) {\n $replacements[\"{{$key}}\"] = $val->format(DateTime::RFC3339);\n } elseif (is_object($val)) {\n $replacements[\"{{$key}}\"] = '[object ' . get_class($val) . ']';\n } else {\n $replacements[\"{{$key}}\"] = '[' . gettype($val) . ']';\n }\n\n if (! isset($replacements[\"{{$key}}\"])) {\n continue;\n }\n\n $replacements[\"{{$key}}\"] = '<comment>' . $replacements[\"{{$key}}\"] . '</comment>';\n }\n\n return strtr($message, $replacements);\n }",
"public function replaceTags($message, $data) {\n return str_replace(array_keys($data), array_values($data), $message);\n }",
"function msg_val($msg, $args='')\r\n{\r\n global $cf_debug;\r\n\r\n if (!is_array($args)) {\r\n $rs = str_replace(\"%1\", $args, $msg);\r\n }\r\n else {\r\n $rs = $msg;\r\n\r\n if (preg_match_all(\"%\\<[$]([a-z][a-z\\d\\_]*)\\>%i\", $rs, $matcharr)) { // text parms\r\n $matcharr_done = array();\r\n foreach ($matcharr[1] as $attrib) {\r\n if (!in_array($attrib, $matcharr_done)) {\r\n $matcharr_done[] = $attrib;\r\n $value = isset($args[$attrib]) ? $args[$attrib] : '';\r\n //if ($cf_debug) echo (\"msg_val: <$\".$attrib.\"> -> $value\\n\");\r\n $rs = str_replace('<$'.$attrib.'>', $value, $rs);\r\n }\r\n }\r\n }\r\n else if (preg_match_all(\"/[%]([\\d]+)/\", $rs, $matcharr)) { // position-indexed parms\r\n $matcharr_done = array();\r\n foreach ($matcharr[1] as $match) {\r\n $attrib = intval($match - 1);\r\n if (!in_array($attrib, $matcharr_done)) {\r\n $matcharr_done[] = $attrib;\r\n $value = isset($args[$attrib]) ? $args[$attrib] : '';\r\n //if ($cf_debug) echo (\"msg_val: %$attrib -> $value\\n\");\r\n $rs = str_replace(\"%\".$attrib, $value, $rs);\r\n }\r\n }\r\n }\r\n }\r\n return $rs;\r\n}",
"function dc_campaign_emails_rules_action_mail_token_replace($message, $settings, RulesState $state, RulesPlugin $element) {\n $message_body = $message;\n\n $datetime = new DateTime();\n $datetime->setTimestamp($state->variables['transaction_time']);\n $new_body = token_replace($message_body, array(\n 'redhen_donation' => $state->variables['redhen_donation']->value(),\n 'transaction_time' => $datetime,\n 'commerce_transaction' => $state->variables['commerce_transaction']->value(),\n ));\n $subtoken = array(\n 'subtoken' => $new_body,\n );\n return $subtoken;\n}"
]
| [
"0.68687326",
"0.67710483",
"0.6470346",
"0.6353506",
"0.63520706",
"0.6323045",
"0.6194089",
"0.618991",
"0.6100591",
"0.60618514",
"0.59654427",
"0.59377706",
"0.5934986",
"0.5905428",
"0.58528835",
"0.5832218",
"0.58300316",
"0.58032006",
"0.579664",
"0.57896924",
"0.57749116",
"0.57374835",
"0.5690359",
"0.56773055",
"0.5670512",
"0.56427443",
"0.56425273",
"0.56396645",
"0.56264734",
"0.5598589"
]
| 0.75160474 | 0 |
return all the prescriptions issued to the patient through the intermediate class Appointment | public function prescriptions()
{
return $this->hasManyThrough( Prescription::class, Appointment::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prescriptions() {\n return $this->hasManyThrough('App\\Prescription', 'App\\Patient', 'clinic_id', 'patient_id', 'id');\n }",
"public function getAppointments()\n {\n return $this->hasMany(Appointment::className(), ['id' => 'id']);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->belongsToMany('App\\Appointment', 'appointment_details', 'patient_id', 'appointment_id');\n }",
"public function show(Request $request)\n {\n \n $Appointment_id=$request->Appointment_id;\n \n $Appointment = DB::table(\"appointments\")\n ->where([[\"appointments.Appointment_id\", \"=\", $Appointment_id]])\n ->join(\"prescriptions\", \"prescriptions.Appointment_id\", \"=\", \"appointments.Appointment_id\")\n ->get()->toArray(); \n\n $Appointment[0]->Medicine_Type = explode(',', $Appointment[0]->Medicine_Type);\n $Appointment[0]->Medicine_name = explode(',', $Appointment[0]->Medicine_name);\n $Appointment[0]->Medicine_quantity = explode(',', $Appointment[0]->Medicine_quantity);\n $Appointment[0]->Medicine_time = explode(',', $Appointment[0]->Medicine_time);\n $morning = 0; \n $afternoon = 1; \n $night = 2;\n $prescriptionData = []; \n //return $Appointment_Record[0]->Medicine_name; \n for($i=0; $i<count($Appointment[0]->Medicine_name); $i++)\n {\n $prescriptionValue = []; \n $prescriptionValue[\"Medicine_Type\"] = $Appointment[0]->Medicine_Type[$i];\n $prescriptionValue[\"Medicine_name\"] = $Appointment[0]->Medicine_name[$i];\n $prescriptionValue[\"Medicine_quantity\"] = $Appointment[0]->Medicine_quantity[$i];\n $prescriptionValue[\"morning\"] = $Appointment[0]->Medicine_time[$morning];\n $morning = $morning + 3; \n $prescriptionValue[\"afternoon\"] = $Appointment[0]->Medicine_time[$afternoon];\n $afternoon = $afternoon + 3; \n\n $prescriptionValue[\"night\"] = $Appointment[0]->Medicine_time[$night];\n $night = $night + 3; \n\n array_push($prescriptionData, $prescriptionValue); \n } \n $response = [\n 'prescriptionData' => $prescriptionData,\n 'code' => 200\n ];\n\n return response($response,300);\n \n\n }",
"public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }",
"public function appointments(){\n return $this->hasMany(Appointment::class);\n }",
"public function index()\n\t{\n $patient_id = Input::get('id');\n $patient = Patient::find($patient_id);\n $appointments = $patient->appointments()->has('prescription')->get();\n\n return View::make('prescriptions.index', compact('appointments'));\n\t}",
"public function appointments()\n {\n //the relationship means that the class midwife can associate with many appointments\n return $this->hasMany(Appointment::class);\n }",
"function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }",
"public function get_prescription ($appointment_hash = NULL)\n {\n $page_data = NULL;\n $prescriptions_arr = array();\n\n if (get_data('term') == NULL)\n {\n return;\n }\n /*Fetching Patient details from third party database via curl request*/\n $prescriptions = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n 'action' => 'getformulary',\n 'lookfor' => get_data('term'),\n )));\n\n $prescriptions = !empty($prescriptions) ? json_decode($prescriptions) : array();\n\n /*Converting to autocomplete understandable format*/\n if (!empty($prescriptions))\n {\n foreach ($prescriptions as $val)\n {\n $prescriptions_arr[] = array('id' => current($val)->vpid, 'value' => current($val)->nm, 'unit_price' => current($val)->UnitPrice);\n }\n }\n exit(json_encode($prescriptions_arr));\n }",
"public function prescriptions()\n\t{\n\t\treturn $this->hasMany('OEMR\\\\Models\\\\Prescription');\n\t}",
"public function getAllApp()\n {\n $sql = \"SELECT * FROM appointment\";\n $values=array();\n \n $ap=$this->getInfo($sql,$values);\n\n return $ap;\n }",
"public function getFollowUpAppointments($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $currentDateTime = \"STR_TO_DATE('\" . DateTimeService::getNowDateTimeInUtc() . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingEnd BETWEEN DATE_SUB({$currentDateTime}, INTERVAL 172800 SECOND) AND {$currentDateTime}\n AND DATE_ADD(a.bookingEnd, INTERVAL {$notification->getTimeAfter()->getValue()} SECOND)\n < {$currentDateTime}\n AND a.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }",
"public function appointments()\n {\n return view('patient.pending-appointments');\n }",
"public function appointment()\n {\n return $this->hasMany('App\\Models\\Appointment');\n }",
"public function appointments(): HasMany\n {\n return $this->hasMany(Appointment::class);\n }",
"protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function Appointment() {\n return $this->hasMany('App\\TIME');\n }",
"public function incidents()\n {\n return $this->belongsToMany(\n 'App\\Incident', 'prescriptions', 'management_id', 'incident_id'\n )\n ->using('App\\Prescription')\n ->withPivot('doctor_id')\n ->withTimestamps();\n }",
"public function fetchData()\n {\n $invoice = InvoiceAppointment::leftjoin('appointments as appt','appt.id','invoice_appointment.detail_id')\n ->leftjoin('appointment_status as appt_stat','appt_stat.appt_id','invoice_appointment.detail_id')\n ->where(fn($query) => $query\n ->where( 'appt.name', 'like', '%' . $this->search . '%')\n ->orWhere('invoice_appointment.total', 'like', '%' . $this->search . '%')\n )\n ->orderBy($this->sortBy, $this->sortDirection)\n ->paginate($this->perPage);\n $this->invappt = $invoice;\n\n /*For notifications*/\n $appoint = Appointment::leftjoin('appointment_status as apts','apts.appt_id','appointments.id')\n ->where('apts.status','Pending')\n ->latest()->get();\n $this->appt = $appoint;\n }",
"public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}",
"public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }",
"public function getAppointments($id)\n {\n $search = request()->all();\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n\n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination($id, $search);\n \n return $appointments;\n \n }",
"public function getApPmts()\n {\n return $this->hasMany(ApPmt::className(), ['currency_id' => 'currency_id']);\n }",
"protected function getPendingAppts($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.appointment_id,a.drop_addr2,a.drop_addr1,a.extra_notes,a.address_line1,a.address_line2,a.status,a.appt_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 2 and a.appt_type = 2 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[date('Y-m-d', strtotime($appnt['appointment_dt']))][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'bid' => $appnt['appointment_id'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])), 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n $finalArr = array();\n\n foreach ($pending_appt as $date => $penAppt) {\n $finalArr[] = array('date' => $date, 'appt' => $penAppt);\n }\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $finalArr); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function allAdopters()\n {\n return $this\n ->belongsToMany('App\\Person', 'animal_adopter')\n ->withTimestamps()\n ->withPivot('returned_at');\n }",
"public function getPrescriptionByPatient($patientId)\n {\n $prescriptions = null;\n\n try\n {\n $query = DB::table('patient as p')->select('pp.id as prescription_id', 'pp.unique_id as unique_id', 'pp.patient_id', 'p.pid', 'p.name', 'pp.prescription_date');\n $query->join('patient_prescription as pp', 'pp.patient_id', '=', 'p.patient_id');\n $query->where('pp.patient_id', '=', $patientId);\n $query->orderBy('pp.id', 'DESC');\n\n $prescriptions = $query->get();\n }\n catch(QueryException $queryEx)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $queryEx);\n }\n catch(Exception $exc)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $exc);\n }\n\n return $prescriptions;\n }"
]
| [
"0.7060157",
"0.6855971",
"0.65665466",
"0.65665466",
"0.65665466",
"0.6546537",
"0.65306604",
"0.6474078",
"0.643309",
"0.6346216",
"0.631028",
"0.6279422",
"0.6258811",
"0.6211584",
"0.6199713",
"0.61197203",
"0.6111887",
"0.608494",
"0.59529245",
"0.5883215",
"0.5769721",
"0.57527363",
"0.57455283",
"0.56068873",
"0.5600764",
"0.55906415",
"0.5555037",
"0.55541766",
"0.554107",
"0.55304813"
]
| 0.82217264 | 0 |
return all appointments for today | public function todayAppointments(){
$today = Carbon::today()->format('Y-m-d');
//dd($today);
return $this->appointments()->whereDate('date',$today)->orderby('date','asc');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }",
"public function getAllApp()\n {\n $sql = \"SELECT * FROM appointment\";\n $values=array();\n \n $ap=$this->getInfo($sql,$values);\n\n return $ap;\n }",
"public function getAppointments()\n {\n return $this->hasMany(Appointment::className(), ['id' => 'id']);\n }",
"public function getAppointments($id)\n {\n $search = request()->all();\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n\n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination($id, $search);\n \n return $appointments;\n \n }",
"public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}",
"public function appointments()\n {\n return view('patient.pending-appointments');\n }",
"public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}",
"public function showAll() {\n return response()->json(Appointment::all());\n }",
"public function datatables_all_appointments()\n {\n // $request = $client->get('https://acuityscheduling.com/api/v1/appointments');\n // $appointments = json_decode($request->getBody()->getContents());\n // echo '<pre>';\n // print_r($appointments);\n // exit;\n\n // DB::connection()->enableQueryLog();\n\n $appointments = Appointment::with('customer')\n ->where('acuity_action','scheduled') \n ->orderBy('appointment_date','desc')\n ->get();\n // $queries = DB::getQueryLog();\n // allQuery($queries);\n\n // die;\n\n return DataTables::of($appointments)\n ->addColumn('action', function ($appointment) {\n return '<a href=\"/appointments/'.$appointment->id.'/edit\"><i class=\"fa fa-pencil\"></i></a>';\n })\n ->make(true);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function viewappointments(){\n $appointments_table = TableRegistry::get('Appointments');\n $appointments = $appointments_table->find()->contain(['Users','Patients'])->order(['appointment_date'=>'DESC']);\n $this->set('appointments', $appointments);\n $this->viewBuilder()->setLayout('backend');\n }",
"public function getTodayBookingList()\n {\n return DB::table('bookings')\n ->leftJoin('users', 'users.id', '=', 'bookings.user_id')\n ->leftJoin('rooms', 'rooms.id', '=', 'bookings.room_id')\n ->whereBetween('booking_time', [\n date('Y-m-d 00:00:01'),\n date('Y-m-d 23:59:59')\n ])\n ->select(\n 'bookings.booking_time', 'bookings.total_person', 'bookings.noted',\n 'users.id as user_id', 'users.email', 'rooms.room_name'\n )\n ->get()\n ->toArray();\n }",
"private function getTodayAdvertisements() {\n \treturn AdvertisementQuery::create()\n\t\t\t\t->filterByCurrent()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->find();\n }",
"public function todaySchedules(): HasMany\n {\n return $this->schedules()->whereDate('created_at', today());\n }",
"function findAppointmentsDue(){\n\t$db = dbConnect();\n\n\t$sql = \"SELECT id FROM Appointment WHERE start_date > date_add(NOW(),INTERVAL 15 MINUTE) AND start_date <= date_add(NOW(),INTERVAL 30 MINUTE) AND status = 2 AND (type = 0 OR type = 1)\";\n\n\t$results = $db->query($sql);\n\n\treturn $results;\n}",
"public function getTodayTimes()\n {\n return $this->get(self::_TODAY_TIMES);\n }",
"public function getTodayTimes()\n {\n return $this->get(self::_TODAY_TIMES);\n }",
"public function appointments(){\n return $this->hasMany(Appointment::class);\n }",
"public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }",
"function get_appointment_times($db, $appointments) {\n $unavailable_times = array();\n $available_times = array();\n foreach ($appointments as $appointment) {\n array_push($unavailable_times, date(\"Y-m-d H:i:s\", strtotime($appointment['appt_time'])));\n }\n foreach ($unavailable_times as $unavailable_time) {\n $possible_time = date(\"Y-m-d H:i:s\", strtotime($unavailable_time . \"+1 hour\"));\n if (!in_array($possible_time, $unavailable_times)) {\n array_push($available_times, $possible_time);\n }\n }\n return $available_times;\n}",
"public function getAllUpcomingEvents()\n {\n return $this->createQueryBuilder('d')\n ->having('d.date >= :today')\n ->setParameter('today', date('Y-m-d'))\n ->orderBy('d.date', 'ASC')\n ->getQuery()\n ->getResult();\n }",
"public function getCustomersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved'\n AND a.notifyParticipants = 1 AND\n a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }",
"function getAllAppointments(){\n global $db;\n $sql='SELECT firstname, lastname, date, time, location FROM `users`, `appointments` WHERE users.user_id = appointments.user_id ORDER BY date ASC';\n $statement = $db->prepare($sql); \n $statement->execute();\n $result = $statement->fetchAll();\n $statement->closeCursor();\n return $result; \n}",
"public function actionIndex() {\n $searchModel = new AppointmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function appointments()\n {\n //the relationship means that the class midwife can associate with many appointments\n return $this->hasMany(Appointment::class);\n }",
"public function index()\n {\n $appointments = Appointment::all();\n return view('admin.appointments.index')->with([\n 'appointments' => $appointments\n ]);\n }",
"function get_appointments($db) {\n $query = \"SELECT service_id, appt_time, cust_email, cust_comments from Appointments\";\n\n $statement = $db->prepare($query);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n return $result;\n}"
]
| [
"0.74740237",
"0.71332127",
"0.6835558",
"0.6817955",
"0.6792229",
"0.6659481",
"0.6588427",
"0.65401274",
"0.65291023",
"0.6524496",
"0.6524496",
"0.6524496",
"0.65140134",
"0.65131205",
"0.6485515",
"0.6428696",
"0.6383067",
"0.6329027",
"0.6329027",
"0.6307852",
"0.6284065",
"0.62141144",
"0.6204455",
"0.6122234",
"0.611205",
"0.61080545",
"0.6104663",
"0.61029565",
"0.60801166",
"0.6066507"
]
| 0.74957526 | 0 |
Create and get from a mixed $subject | public static function from($subject)
{
if ($subject instanceof ModelInterface) {
$ret = call_user_func_array('static::fromModel', func_get_args());
} elseif ($subject instanceof ResultsetInterface) {
$ret = call_user_func_array('static::fromResultset', func_get_args());
} else {
throw new \InvalidArgumentException(static::E_INVALID_SUBJECT);
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createSubject( $subject )\n {\n \n $request = new Request( \n 'POST', \n self::ENDPOINT_URL . '/subjects/', \n [ 'content-type' => 'application/json' ], \n json_encode($subject->toArray())\n );\n \n \n $response = $this->request($request);\n \n if (false === $response ) {\n return $response;\n }\n \n $subject->configure($response);\n\n return $subject;\n }",
"public static function transform($subject)\n\t{\n\t\treturn new static($subject);\n\t}",
"public function subject($subject);",
"abstract public function get_subject();",
"abstract public function subject($subject);",
"public function read($subject);",
"abstract protected function getSubject();",
"public function set_subject($subject);",
"protected function _subject($additional = array()) {\n\t\treturn $this->_crud()->getSubject($additional);\n\t}",
"public function getSubject();",
"public function getSubject();",
"public function getSubject();",
"public function getSubject();",
"public function getSubject();",
"public function getSubject();",
"public function getSubject();",
"public function setSubject($subject);",
"public function setSubject($subject);",
"public function setSubject($subject);",
"public function readResponseObject(array $subject)\n {\n $response = Helper\\SubjectReader::readResponse($subject);\n\n// if (!isset($response['object']) || !is_object($response['object'])) {\n// throw new \\InvalidArgumentException('Response object does not exist');\n// }\n\n return $response['object'];\n }",
"public function created(Subject $subject)\n {\n //\n }",
"public function testGetSubject()\n {\n $subject = $this->createInstance(['_getSubject']);\n $_subject = $this->reflect($subject);\n $arg = uniqid('subject-');\n\n $subject->expects($this->exactly(1))\n ->method('_getSubject')\n ->will($this->returnValue($arg));\n\n $result = $subject->getSubject();\n $this->assertEquals($arg, $result, 'Subject did not retrieve required exception subject');\n }",
"public function __construct($subject)\n {\n $this->subject = $subject;\n }",
"public function createSubject($context)\n {\n global $logger;\n //$copyContext = $this->copy($context);\n //$copyContext = $this->_ensureSecurityMgr($copyContext);\n //$copyContext = $this->_resolveSession($copyContext);\n //$copyContext = $this->_resolvePrincipals($copyContext);\n $subject = $this->doCreateSubject($context);\n $this->_save($subject);\n\n return $subject;\n\n }",
"function setSubject($subject) {\n\t\treturn $this->setData('subject', $subject);\n\t}",
"private function createSubject()\n {\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }",
"abstract function getSubject() : string;",
"public function setSubject($subject)\n {\n $this->_subject = $subject;\n return $this;\n }",
"public function setSubject($subject)\n {\n return $this->getSubject()->setSubject($subject);\n }",
"public function subjectOf($subjectOf)\n {\n return $this->setProperty('subjectOf', $subjectOf);\n }"
]
| [
"0.68919307",
"0.67159295",
"0.65651524",
"0.65612143",
"0.65374964",
"0.6387926",
"0.63489485",
"0.59224516",
"0.58480406",
"0.58133966",
"0.58133966",
"0.58133966",
"0.58133966",
"0.58133966",
"0.58133966",
"0.58133966",
"0.5806838",
"0.5806838",
"0.5806838",
"0.57397157",
"0.5735918",
"0.5709476",
"0.5695622",
"0.56944966",
"0.5675384",
"0.56429756",
"0.5620351",
"0.5616158",
"0.5596637",
"0.5578544"
]
| 0.6729747 | 1 |
Parses the arguments that will be resolved to Relation instances | public static function parseArguments(array $arguments)
{
if (empty($arguments)) {
throw new \InvalidArgumentException('Arguments can not be empty');
}
$relations = [];
foreach ($arguments as $relationAlias => $queryConstraints) {
if (is_string($relationAlias)) {
$relations[$relationAlias] = is_callable($queryConstraints) ? $queryConstraints : null;
} else {
if (is_string($queryConstraints)) {
$relations[$queryConstraints] = null;
}
}
}
if (empty($relations)) {
return [];
}
return $relations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function relations();",
"public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }",
"public function prepareArguments() {}",
"public function args(): array\n {\n $relation = $this->relation->getRelationName();\n\n if ($this->getPivotModelSchema()) {\n $typename = Str::studly($relation).'PivotInput';\n $type = $this->registry->type($typename)->list();\n } else {\n $type = $this->registry->ID()->list();\n }\n\n return $this->modelSchema->getLookupFields()->map(function (Field $field) {\n return $field->getType();\n })->merge(['input' => $type])->toArray();\n }",
"function __call($name, $arguments)\n\t{\n\t\t$numberOfArguments = count($arguments);\n\n\t\tif (isset(static::$relationTypes[$name]))\n\t\t{\n\t\t\tif ($numberOfArguments == 1)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 2)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 3)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 4)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 5)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 6)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments >= 7)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"You can not create an unnamed '$name' relation\");\n\t\t\t}\n\t\t}\n\t\telseif (substr($name, 0, 3) == 'get')\n\t\t{\n\t\t\t$relationName = substr($name, 3);\n\t\t\t$relationName = strtolower($relationName[0]) . substr($relationName, 1);\n\n\t\t\tif ($numberOfArguments == 0)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 1)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName, $arguments[0]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 2)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName, $arguments[0], $arguments[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"Invalid number of arguments getting data for the '$relationName' relation\");\n\t\t\t}\n\t\t}\n\n\t\t// Throw an exception otherwise\n\t\tthrow new DataModel\\Relation\\Exception\\RelationTypeNotFound(\"Relation type '$name' not known to relation manager\");\n\t}",
"protected function makeRelationInstruction()\n {\n $parts = $this->keyRelationParts();\n\n $this->parsedKey = $relation = $parts['relation'];\n \n $relationType = $this->setRelationType($relation);\n\n $values = array_filter($this->getValueAsArray());\n \n if(empty($values) || !$values){\n return null;\n }\n \n $parts['relation_type'] = $relationType;\n $parts['data'] = $values;\n \n return $parts;\n \n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"protected function parseEntitiesArguments()\n {\n $args = array();\n while ($arg = $this->matchFuncs(array('parseEntitiesAssignment', 'parseExpression'))) {\n $args[] = $arg;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n\n return $args;\n }",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"private function processArguments(array $arguments)\n {\n foreach ($arguments as $k => $argument) {\n if (is_array($argument)) {\n $arguments[$k] = $this->processArguments($argument);\n } elseif ($argument instanceof Reference) {\n $defId = $this->getDefinitionId($id = (string) $argument);\n\n if ($defId !== $id) {\n $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior());\n }\n }\n }\n\n return $arguments;\n }",
"abstract protected function arguments(): array;",
"abstract protected function get_args();",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {}"
]
| [
"0.5558806",
"0.5533093",
"0.54748654",
"0.54435164",
"0.5401782",
"0.51215535",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.5103562",
"0.51034975",
"0.5095997",
"0.5095997",
"0.5095997",
"0.5095997",
"0.5095997",
"0.5095997",
"0.5095997",
"0.5095997",
"0.50865847",
"0.5048386",
"0.5043384",
"0.5021972",
"0.5021972",
"0.5021972"
]
| 0.6385314 | 0 |
Sends activity notification for new blog post. | public function notify_blog_post( $post, $type ) {
if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
return;
}
$user_id = 'new' === $type ? $post->post_author : get_current_user_id();
$user = get_user_by( 'id', $user_id );
$content = wp_trim_words(
strip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ),
55
);
$args = array(
'action' => 'wporg_handle_activity',
'type' => $type,
'source' => 'wordpress',
'user' => $user->user_login,
'post_id' => $post->ID,
'blog' => get_bloginfo( 'name' ),
'blog_url' => site_url(),
'post_type' => $post->post_type,
'title' => get_the_title( $post ),
'content' => $content,
'url' => get_permalink( $post->ID ),
);
Profiles\api( $args );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function attachPostToBlogAtTheEnd() {}",
"function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password)\n {\n }",
"public function post()\n\t{\n\t\t$crud = $this->generate_crud('blog_posts');\n\t\t$crud->columns('author_id', 'category_id', 'title', 'image_url', 'tags', 'publish_time', 'status');\n\t\t$crud->set_field_upload('image_url', UPLOAD_BLOG_POST);\n\t\t$crud->set_relation('category_id', 'blog_categories', 'title');\n\t\t$crud->set_relation_n_n('tags', 'blog_posts_tags', 'blog_tags', 'post_id', 'tag_id', 'title');\n\t\t\n\t\t$state = $crud->getState();\n\t\tif ($state==='add')\n\t\t{\n\t\t\t$crud->field_type('author_id', 'hidden', $this->mUser->id);\n\t\t\t$this->unset_crud_fields('status');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crud->set_relation('author_id', 'admin_users', '{first_name} {last_name}');\n\t\t}\n\n\t\t$this->mPageTitle = 'Blog Posts';\n\t\t$this->render_crud();\n\t}",
"public function created(Post $post)\n {\n $post->recordActivity('created');\n }",
"public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Notice::addNotice($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}",
"protected function run()\n {\n $slug = $this->get('slug');\n\n $category = $this->categories->findBySlug($slug);\n\n $creator = User::current();\n $now = Carbon::now();\n\n $conversation = (object) [\n 'poster' => $creator->username,\n 'title' => $this->get('subject'),\n 'posted' => $now,\n 'last_post' => $now,\n 'last_poster' => $creator->username,\n 'category_slug' => $category->slug,\n ];\n\n $post = (new Post([\n 'poster'\t=> $creator->username,\n 'poster_id'\t=> $creator->id,\n 'message'\t=> $this->get('message'),\n 'posted'\t=> $now,\n ]));\n\n $this->categories->addNewTopic($category, $conversation, $post->toArray());\n\n $this->raise(new UserHasPosted($creator, $post));\n }",
"public function handle(PostWasCreated $event)\n {\n $event->post->thread->markAsUnread();\n }",
"function new_post($post){\n $this->newPost($post);\n }",
"public function blogNewAction()\n {\n // Check if the blog was posted\n if ($this->request->isPost() && $this->security->checkToken()) {\n $post = new Blog();\n $post->url = $this->request->getPost('title');\n $post->title = $this->request->getPost('title');\n $post->text = $this->request->getPost('message');\n $post->author = $this->session->get('user')->name;\n $post->date = $this->request->getPost('date');\n\n // The form was sent\n $this->view->setVar(\"form_sent\", true);\n\n // Validation\n if ($post->validation()) {\n if ($post->save()) {\n $this->view->setVar(\"form_success\", true);\n $this->view->setVar(\"form_message\", \"Blog post successvol bijgewerkt / geplaatst.\");\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_sent\", false);\n }\n\n // Render the view\n $this->assets->addJs('share/plugins/jquery/jquery.selection.js');\n $this->assets->addJs('assets/js/editor.js');\n $this->view->setVar('form_action', 'new');\n $this->view->setVar('action', 'new');\n $this->view->pick('pages/admin/blog/form');\n }",
"public function store(Request $request)\n {\n //\n\n $this->post = new Post();\n $this->post->title = $request->input('blog_title');\n $this->post->slug = str_slug($request->input('blog_title'));\n $this->post->user_id = Auth::user()->id;\n $this->post->content = $request->input('blog_description');\n $this->post->abstract = $request->input('blog_abstract');\n $this->post->published_date = Carbon::now();\n\n //check for the images for not\n if($request->has('_featured_image')){\n //need to save the image first\n $blog_image = $request->file('_featured_image');\n $name = time() . '.'.$blog_image->getClientOriginalExtension();\n $blog_image->move($this->destination_path,$name);\n $this->post->image_path = $name;\n }\n\n $this->post->save();\n\n //after saving send the notification to the currently logged in career advisor followers\n $blog_details = Post::findOrFail($this->post->id);\n $followers = Auth::user()->followers;\n\n foreach($followers as $follower){\n $notifiy_career_advisor = User::findOrFail($follower->pivot->follower_id);\n $notifiy_career_advisor->notify(new NewBlogCreatedNotification($blog_details));\n }\n\n\n\n return redirect()->route('profile.blog.index');\n }",
"public function AddBlogPostAction(Request $request)\n {\n $Blogposts=new Blogposts();\n $D=new \\DateTime();\n $manager = $this->get('mgilet.notification');\n //form\n $form=$this->createForm(BlogpostsType::class,$Blogposts);\n $form=$form->handleRequest($request);\n if($form->isValid())\n { $manager = $this->get('mgilet.notification');\n $notif = $manager->createNotification('Hello world!');\n $notif->setMessage('This a notification.');\n $notif->setLink('https://symfony.com/');\n $manager->addNotification(array($this->getUser()), $notif, true);\n $em=$this->getDoctrine()->getManager();\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n $em->persist($Blogposts);\n\n $Blogposts->setAuthor($user);\n $Blogposts->setPostDate($D);\n $em->flush();\n return $this->redirectToRoute('blog_homepage');\n\n }\n //envoi form\n return $this->render('@Blog/BlogViews/AddBlogPost.html.twig',array('form'=>$form->createView()));\n\n\n\n }",
"public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }",
"public function run()\n {\n $posts = [\n [ \n 'content' => 'Looking for someone to mow my lawn.',\n 'user_id' => 1\n ],\n [\n 'content' => 'Can someone buy my weekly shopping?',\n 'user_id' => 2\n ],\n [\n 'content' => 'Looking for someone to set up my Wi-Fi network with WPA2 encrpytion -- 7 devices.',\n 'user_id' => 3\n ],\n [\n 'content' => 'I would like a back massage.',\n 'user_id' => 4\n ]\n ];\n\n foreach ($posts as $post) {\n Post::create($post);\n }\n }",
"public function publishBlog(Request $request){\n $email = \\Auth::user()->email;\n $user_id = User::all()->where('email', $email)->first();\n \n Blog::create([\n 'user_id' => $user_id[\"id\"],\n 'title' => $request->title,\n 'content' => trim($request->content)\n ]);\n\n return redirect()->route('blogs');\n }",
"public function createPost()\n {\n $this->validate(['body' => 'required|min:15']);\n $post = auth()->user()->posts()->create(['body' => $this->body]);\n\n $this->emit('postAdded', $post->id); //emit de l'event\n\n $this->body = \"\"; //vidage du body\n\n }",
"public function run()\n\t{\n\t\tPost::create([\n\t\t\t'title'=>'Fourth post',\n\t\t\t'slug'=>'Fourth -post',\n\t\t\t'excerpt'=>'<strong>Fourth post body</strong>',\n\t\t\t'content'=>'<strong>Content Fourth post body</strong>',\n\t\t\t'published'=>false ,\n\t\t\t'published_at'=>DB::raw('CURRENT_TIMESTAMP')]);\n}",
"public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}",
"public function create()\n\t{\n\n\t\t$post = $this->store('create', '/thread/new');\n\n\t\tredirect('/threads?id=' . $post->id);\n\t}",
"public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}",
"function owa_newBlogActionTracker($blog_id, $user_id, $domain, $path, $site_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$owa->trackAction('wordpress', 'Blog Created', $domain);\r\n}",
"public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }",
"public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }",
"public function sendPostNotification() {\n\t\t$getNotificatin = \\DB::table('notification')\n\t\t\t->where('type', 'post_added')\n\t\t\t->where('push_status', '0')\n\t\t\t->where('receiver', '0')\n\t\t\t->orderBy('id', 'ASC')\n\t\t\t->get();\n\t\tif (count($getNotificatin) > 0) {\n\t\t\tforeach ($getNotificatin as $nKey => $rows) {\n\t\t\t\t$notification_id = $rows->id;\n\t\t\t\t$senderId = $rows->sender;\n\t\t\t\t$senderInfo = \\DB::table('users')->where('id', $rows->sender)->first();\n\t\t\t\t$user_details[] = array(\n\t\t\t\t\t'ID' => $senderInfo->id,\n\t\t\t\t\t'user_image' => '',\n\t\t\t\t\t'Name' => $senderInfo->username,\n\t\t\t\t);\n\t\t\t\t$my_user = \\DB::table('user_connection')\n\t\t\t\t\t->where('user_connection.friend_id', $senderId)\n\t\t\t\t\t->where('user_connection.follow', '1')\n\t\t\t\t\t->where('user_connection.status', '1')\n\t\t\t\t\t->pluck('user_connection.user_id');\n\t\t\t\t$userRow = \\DB::table('users')\n\t\t\t\t\t->where('player_id', '!=', '')\n\t\t\t\t\t->WhereIn('id', $my_user)\n\t\t\t\t\t->pluck('player_id');\n\t\t\t\tif (!empty($userRow)) {\n\t\t\t\t\tif ($userRow) {\n\t\t\t\t\t\t$title = 'New Post';\n\t\t\t\t\t\t$message = $senderInfo->username . ' added new post';\n\t\t\t\t\t\t$msg = array(\n\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t'message' => $message,\n\t\t\t\t\t\t\t'push_notification_id' => $notification_id,\n\t\t\t\t\t\t\t'type' => $rows->type,\n\t\t\t\t\t\t\t'ID' => $rows->receiver,\n\t\t\t\t\t\t\t'sender_user_id' => $rows->sender,\n\t\t\t\t\t\t\t'sender_user_name' => $senderInfo->username,\n\t\t\t\t\t\t\t'object_id' => $rows->object_id ? $rows->object_id : 0,\n\t\t\t\t\t\t\t'user_details' => $user_details,\n\t\t\t\t\t\t\t'batch_count' => 0,\n\t\t\t\t\t\t\t'vibrate' => 1,\n\t\t\t\t\t\t\t'sound' => 1,\n\t\t\t\t\t\t\t'largeIcon' => 'large_icon',\n\t\t\t\t\t\t\t'smallIcon' => 'small_icon',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$response = \\OneSignalServiceHelpers::sendPushNotification($userRow, $msg);\n\t\t\t\t\t\t$this->info($response);\n\t\t\t\t\t}\n\t\t\t\t\t$this->info(json_encode($userRow));\n\t\t\t\t}\n\t\t\t\t$this->updateNotificationStatus($notification_id);\n\t\t\t}\n\t\t}\n\t}",
"public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}",
"public function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"public function handle()\n {\n foreach ($this->posts as $post) {\n PublishPost::dispatch($post)->delay(Carbon::now());\n }\n }",
"public function actionCreate()\n\t{\t\t\n\t\t// Check Access\n\t\tcheckAccessThrowException('op_blog_addposts');\n\t\t\n\t\t$model = new BlogPost;\n\t\t\n\t\tif( isset( $_POST['BlogPost'] ) ) {\n\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\tif( isset( $_POST['submit'] ) ) {\n\t\t\t\tif( $model->save() ) {\n\t\t\t\t\tfok(at('Page Created.'));\n\t\t\t\t\talog(at(\"Created Blog Post '{name}'.\", array('{name}' => $model->title)));\n\t\t\t\t\t$this->redirect(array('blog/index'));\n\t\t\t\t}\n\t\t\t} else if( isset( $_POST['preview'] ) ) {\n\t\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$roles = AuthItem::model()->findAll(array('order'=>'type DESC, name ASC'));\n\t\t$_roles = array();\n\t\tif( count($roles) ) {\n\t\t\tforeach($roles as $role) {\n\t\t\t\t$_roles[ AuthItem::model()->types[ $role->type ] ][ $role->name ] = $role->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add Breadcrumb\n\t\t$this->addBreadCrumb(at('Creating New Post'));\n\t\t$this->title[] = at('Creating New Post');\n\t\t\n\t\t// Display form\n\t\t$this->render('form', array( 'roles' => $_roles, 'model' => $model ));\n\t}",
"public function run()\n\t{\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Have a Happy Day\",\n\t\t\t'post_body' => 'Welcome family! I wish you all the \n\t\t\tbest day :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Up To Two Posts\",\n\t\t\t'post_body' => 'Hey everybody! We need more posts! :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t}",
"public function create() {\n\t\t// Setup some variables\n\t\t$this->data['validation'] = '';\n\t\t$this->data['entry'] = array('title' => '', 'url_title' => '', 'content' => '', 'status' => '', 'category_id' => '');\n\t\t$this->data['statuses'] = array('' => '---', 'published' => 'Published', 'draft' => 'Draft', 'review' => 'Review');\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories_dropdown();\n\t\t\n\t\t// Handle entry submission\n\t\tif ($this->mojo->input->post('entry')) {\n\t\t\t// Get the entry data and set some stuff\n\t\t\t$this->data['entry']\t\t \t\t= $this->mojo->input->post('entry');\n\t\t\t$this->data['entry']['author_id'] \t= $this->mojo->session->userdata('id');\n\t\t\t$this->data['entry']['date']\t\t= date('Y-m-d H:i:s');\n\t\t\t$this->data['entry']['status']\t\t= ($this->data['entry']['status']) ? $this->data['entry']['status'] : 'published';\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert($this->data['entry'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/index');\n\t\t\t\t$response['message'] = 'Successfully created new entry';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Load that bitchin' view\n\t\t$this->_view('create');\n\t}",
"public function run()\n {\n $post = new Post;\n $post->user_id = 2;\n $post->content = \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book\";\n $post->save();\n }"
]
| [
"0.68137056",
"0.64132994",
"0.63637364",
"0.6353758",
"0.62696505",
"0.6222222",
"0.61442786",
"0.59877443",
"0.5967703",
"0.5925621",
"0.5914046",
"0.5909623",
"0.5892857",
"0.5856362",
"0.5838192",
"0.58232075",
"0.58009815",
"0.5796611",
"0.5778905",
"0.5729601",
"0.5706916",
"0.56978977",
"0.56828374",
"0.5677552",
"0.5659672",
"0.56382644",
"0.5635459",
"0.56292826",
"0.56278276",
"0.5622431"
]
| 0.66869944 | 1 |
Handler to actual send topicrelated activity payload. | private function notify_forum_topic_payload( $activity, $topic_id ) {
if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
return;
}
if ( ! bbp_is_site_public() ) {
return;
}
if ( ! in_array( $activity, array( 'create-topic', 'remove-topic' ), true ) ) {
return;
}
if ( 'create-topic' === $activity && ! bbp_is_topic_published( $topic_id ) ) {
return;
}
$url = bbp_get_topic_permalink( $topic_id );
// Remove moderator flags.
$url = remove_query_arg( array( 'view' ), $url );
$args = array(
'action' => 'wporg_handle_activity',
'activity' => $activity,
'source' => 'forum',
'user' => get_user_by( 'id', bbp_get_topic_author_id( $topic_id ) )->user_login,
'post_id' => '',
'topic_id' => $topic_id,
'forum_id' => bbp_get_topic_forum_id( $topic_id ),
'title' => strip_tags( bbp_get_topic_title( $topic_id ) ),
'url' => $url,
'message' => bbp_get_topic_excerpt( $topic_id, 55 ),
'site' => get_bloginfo( 'name' ),
'site_url' => site_url(),
);
Profiles\api( $args );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onSend($msg){\n $data = json_decode($msg);\n $action = isset($data['action'])? $data['action']:'';\n echo \"Message has been sent\";\n \n if(array_key_exists($action,$this->subscriber_topics)){\n echo \"Received msg, broacasting to $action\";\n $this->subscriber_topics[$action]->broadcast($msg);\n }\n }",
"public function onPush(Topic $topic, WampRequest $request, $data, $provider)\n {\n }",
"function sendBoardNotifications(&$topicData)\n{\n\t// Redirects to PostNotifications class sendBoardNotifications method\n\t(new PostNotifications())->sendBoardNotifications($topicData);\n}",
"public function publish_to_stream($activity)\n {\n\n }",
"public function sendEvent(string $topic, $message): void;",
"public function handleSendMessage() {\n\t\t$json = file_get_contents(\"php://input\"); //vytánutí všech dat z POST požadavku - data ve formátu JSON\n\t\t$data = Json::decode($json); //prijata zprava dekodovana z JSONu\n\t\t$user = $this->getPresenter()->getUser();\n\t\t$addMessage = $this->addMessage($data, $user);\n\t\tif (!empty($addMessage)) {\n\t\t\t$this->sendRefreshResponse($data->lastid);\n\t\t}\n\t}",
"function en_send_transdata() {\n\t// Handle sending of data\n}",
"public function sendPayload() { \n \n \n /* Check and add last-second data that may have been changed by public methods */\n $this->createProxyData();\n $this->createCustomDimensions();\n if(!$this->payload['cn']) $this->createCampaignParameters(); /* ie, check $_GET array for them if still unset */\n \n foreach($this->payload as $i => $v) {\n if(strlen($v) > 0) {\n $params[] = urlencode($i) . '=' . urlencode($v) ;\n }\n }\n \n \n $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n '?' . implode('&', $params);\n \n// $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n// '?' . http_build_query($this->payload, \"&\");\n\n \n switch($this->output) {\n case 'silent':\n $this->sendCurl($url);\n break;\n case 'noscript':\n /* outputs only a noscript element containing the pixel for Non-Java Operation */\n $this->displayNoScriptPixel($url);\n break;\n case 'pixel':\n echo \"<img height='1' width='1' style='border-style:none;' alt='' src='https://$url&method=NAKED_PIXEL' />\";\n break;\n case 'javascript':\n /* TODO build dynamic javascript version */\n $this->displayJavascript();\n break;\n case 'auto':\n $this->displayJavascript();\n $this->displayNoScriptPixel($url);\n break;\n case 'test':\n $this->displayTestPixel($url);\n break;\n case 'iframe':\n $this->displayIframe($url);\n \n break;\n \n } \n \n \n \n\n \n \n $this->payload_is_sent = TRUE ;\n $this->writeLog($url); \n }",
"protected function run()\n {\n $slug = $this->get('slug');\n\n $category = $this->categories->findBySlug($slug);\n\n $creator = User::current();\n $now = Carbon::now();\n\n $conversation = (object) [\n 'poster' => $creator->username,\n 'title' => $this->get('subject'),\n 'posted' => $now,\n 'last_post' => $now,\n 'last_poster' => $creator->username,\n 'category_slug' => $category->slug,\n ];\n\n $post = (new Post([\n 'poster'\t=> $creator->username,\n 'poster_id'\t=> $creator->id,\n 'message'\t=> $this->get('message'),\n 'posted'\t=> $now,\n ]));\n\n $this->categories->addNewTopic($category, $conversation, $post->toArray());\n\n $this->raise(new UserHasPosted($creator, $post));\n }",
"public function mail_sending_mechanism() {\n add_action( 'publish_post', [ $this, 'mail_handler' ], 10, 2 );\n }",
"public function postAction() {\n\t\t$this->sendMessage();\n\t}",
"public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }",
"public function onMessage($msgData) {\r\n\r\n }",
"public function handle()\n {\n dispatch(new SendPushNotificationAlert());\n Log::info('Envio de notificações de alertas');\n }",
"function sendApprovalNotifications(&$topicData)\n{\n\t(new PostNotifications())->sendApprovalNotifications($topicData);\n}",
"private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }",
"public function onTopic( $sTopic )\n\t{\n\t\t$this -> m_sTopic = $sTopic;\n\t}",
"public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }",
"function process()\n\t{\n\t\tswitch(getPOST('action',''))\n\t\t{\n\t\t\tcase 'forum_send':\n\t\t\t\tif(isInPOST(array(\"body\")))\n\t\t\t\t{\n\t\t\t\t\tif($this->sendMessage($_POST['body'],getGET($this->reply_to_get,0)))\n\t\t\t\t\t\t$this->message(FORUM_MESSAGE_SEND_MESSAGE_OK);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'cat_operation':\n\t\t\t\tif(isset($_POST['cat_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt'])) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delCat($_POST['cat_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_CAT_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'topic_operation':\n\t\t\t\tif(isset($_POST['topic_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delTopic($_POST['topic_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_TOPIC_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'post_operation':\n\t\t\t\tif(isset($_POST['post_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delMessage($_POST['post_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_POST_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_topic':\n\t\t\t\tif(isset($_POST['topic_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createTopic($_POST['topic_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_cat':\n\t\t\t\tif(isset($_POST['cat_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createCat($_POST['cat_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function handle(Topic $topic)\n {\n $this->info(\"开始执行加链接任务...\");\n\n $topic->autoLink();\n\n $this->info(\"完成加链接任务\");\n }",
"public function postSend()\n {\n }",
"public function postHandleCallback() {\n $data = \\Input::all();\n $msg = new Message();\n $msg->text = trim($data['text']);\n $msg->api_id = $data['id'];\n $msg->sender = $data['from'];\n $msg->receiver = $data['to'];\n $msg->save();\n\n //for correct counting\n \\DB::transaction(function() use ($msg) {\n $response = MessageHelper::decode($msg);\n if ($response) {\n $msg->campaign_id = $response->campaign_id;\n $msg->save();\n }\n });\n return 'Hello World';\n }",
"public function produce(int $partition, int $msgflags, string $payload, string $key = NULL): void { }",
"public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }",
"public function publish_help_selling_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'selling_data');\n Session::put('menu_item_child_child', 'selling_topics');\n\n $helpTopicIdx = $request->helpTopicIdx;\n $topic = HelpTopic::where('helpTopicIdx', $helpTopicIdx)->get()->first();\n $new['active'] = 1 - $topic->active;\n HelpTopic::where('helpTopicIdx', $helpTopicIdx)->update($new);\n Session::flash('flash_success', 'Help Selling Data has been published successfully');\n echo \"success\";\n }",
"public function publishAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the GET/POST paramter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n\n // check if the url are not empty\n if (\"\" != $hubUrl && \"\" != $topicUrl) {\n // get the zend pubplisher\n $publisher = new Zend_Feed_Pubsubhubbub_Publisher;\n\n // hand over the paramter\n $publisher->addHubUrl($hubUrl);\n $publisher->addUpdatedTopicUrl($topicUrl);\n\n // start the publishing process\n $publisher->notifyAll();\n\n // check the publisher, if the publishing was correct, else output the errors\n if ($publisher->isSuccess() && 0 == count($publisher->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($publisher->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n // if the url's are empty\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n }",
"public function send()\n\t{\n\t\t$message = $this->message ?: ucwords($this->getSystemUser()).' ran the ['.$this->task.'] task.';\n\n\t\t$payload = ['text' => $message, 'channel' => $this->channel];\n\n Request::post(\"https://{$this->team}.slack.com/services/hooks/incoming-webhook?token={$this->token}\")->sendsJson()->body($payload)->send();\n\t}",
"public function handleDataSubmission() {}",
"public function post($msg) {\r\n\t\tif (isset ( $_GET ['oauth_token'] )) {\r\n\t\t\t/* exchange the request token for access token */\r\n\t\t\t$key = $_COOKIE ['key'];\r\n\t\t\t$secret = $_COOKIE ['secret'];\r\n\t\t\t$result = $this->client->getAccessToken ( $key, $secret );\r\n\t\t\t$key = $result [\"oauth_token\"];\r\n\t\t\t$secret = $result [\"oauth_token_secret\"];\r\n\t\t\tif ($key) {\r\n\t\t\t\t\r\n\t\t\t\t/* access success, let's say something. */\r\n\t\t\t\t$this->client->programmaticLogin ( $key, $secret );\r\n\t\t\t\t//echo 'logged in.';\r\n\t\t\t\t$entry = new Zend_Gdata_Douban_BroadcastingEntry();\r\n\t\t\t\t$content = new Zend_Gdata_App_Extension_Content($msg);\r\n\t\t\t\t$entry->setContent ( $content );\r\n\t\t\t\t$entry = $this->client->addBroadcasting ( \"saying\", $entry );\r\n\t\t\t\t//echo '<br/>you just posted: ' . $entry->getContent ()->getText ();\r\n\t\t\t} else {\r\n\t\t\t\techo 'Oops, get access token failed';\r\n\t\t\t}\r\n\t\t} \r\n\r\n\t}",
"public function onMessage($connect, $data)\n {\n// echo $this->decode($data)['payload'] . PHP_EOL;\n }"
]
| [
"0.58663356",
"0.5851877",
"0.5630609",
"0.562751",
"0.5621317",
"0.5369642",
"0.5323702",
"0.53118145",
"0.5306066",
"0.5263835",
"0.52325994",
"0.5181421",
"0.51743144",
"0.517253",
"0.51522344",
"0.5148622",
"0.5145064",
"0.5125137",
"0.51244366",
"0.511293",
"0.5111846",
"0.51106423",
"0.5095686",
"0.5078345",
"0.50688744",
"0.5068608",
"0.50542426",
"0.5030237",
"0.50187814",
"0.49866518"
]
| 0.59201396 | 0 |
Checks if given file is an image based on mime type. | function is_image($file)
{
$type = get_image_type($file);
$mime = get_image_mime_type($type);
return substr($mime, 0, 5) == 'image';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isImage()\n {\n return strtolower(substr($this->getMimeType(), 0, 5)) == 'image';\n }",
"public function isImage()\n {\n return str_contains($this->mimetype, 'image/');\n }",
"public function isImage()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'image') === 0);\n }",
"function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}",
"public static function check($file){\n if(\\File::exists($file)){\n $mime = mime_content_type($file);\n if(substr($mime, 0, 5) == 'image') {\n // this is an image\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }",
"function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }",
"public function isImage()\n\t{\n\t\treturn in_array($this->getMimetype(), $this->imagesMimeTypes);\n\t}",
"public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }",
"public function is_image($mime)\n\t{\n\t\tee()->load->library('mime_type');\n\t\treturn ee()->mime_type->isImage($mime);\n\t}",
"public static function isImage($file){\n if(is_file($file)){\n $info = getimagesize($file);\n if(isset($info) && $info[2] > 0)\n return true;\n }\n return false;\n }",
"function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}",
"function isImage(string $filename) : bool {\n return (bool) preg_match(\"/(png|gif|jpg|jpeg)/\", pathinfo($filename, PATHINFO_EXTENSION));\n}",
"function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}",
"function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}",
"public function isFileImage ($image) \n {\n if (!in_array(mime_content_type($image), ALLOWED_IMAGE_TYPES) ) {\n return false;\n }\n return true;\n }",
"private function is_image( $extension = null, $mime_type = null )\n\t{\n\t\tif ( ! is_null($extension) ) {\n\t\t\t$image_extensions = array(\n\t\t\t\t'jpg',\n\t\t\t\t'jpeg',\n\t\t\t\t'gif',\n\t\t\t\t'png',\n\t\t\t\t'bmp',\n\t\t\t);\n\n\t\t\treturn in_array(strtolower($extension), $image_extensions) ? 'true' : 'false';\n\t\t} else if ( ! is_null($mime_type) ) {\n\t\t\t$mime_type_parts = explode('/', $body['ContentType']);\n\t\t\treturn ( strtolower(reset($mime_type_parts)) === 'image' ) ? 'true' : 'false';\n\t\t}\n\n\t\treturn false;\n\t}",
"function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function testTypeImage($file)\n {\n $size = getimagesize($file);\n $is = '';\n\n switch ($size['mime']) {\n case \"image/gif\":\n $is = imagecreatefromgif($file);\n break;\n case \"image/jpeg\":\n $is = imagecreatefromjpeg($file);\n break;\n case \"image/png\":\n $is = imagecreatefrompng($file);\n break;\n }\n return $is;\n }",
"function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function isImage() {\n\t\treturn MimeType::isImage($this);\n\t}",
"function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}",
"function wp_is_file_image( $file ) {\n\tif ( @getimagesize( $file ) )\n\t\treturn true;\n\n\treturn false;\n\n}",
"public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}",
"public function isImage($file = '')\n\t{\n\t\treturn in_array(strtolower(File::extension($file)), array_merge($this->imageExtensions, ['svg']));\n\t}",
"public function isTransformableImage() {\n // with support for only some file types, so it might be able to handle\n // PNG but not JPEG. Try to generate thumbnails for whatever we can. Setup\n // warns you if you don't have complete support.\n\n $matches = null;\n $ok = preg_match(\n '@^image/(gif|png|jpe?g)@',\n $this->getViewableMimeType(),\n $matches);\n if (!$ok) {\n return false;\n }\n\n switch ($matches[1]) {\n case 'jpg';\n case 'jpeg':\n return function_exists('imagejpeg');\n break;\n case 'png':\n return function_exists('imagepng');\n break;\n case 'gif':\n return function_exists('imagegif');\n break;\n default:\n throw new Exception(pht('Unknown type matched as image MIME type.'));\n }\n }",
"public function isSupportedImage()\n\t{\n\t\t$mime = $this->getMimeType();\n\t\tif (in_array($mime, array('image/jpeg', 'image/gif', 'image/png')))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }",
"public function isImage( $contentType=null ) \r\n {\r\n if (empty($contentType)) {\r\n $contentType = $this->contentType;\r\n }\r\n \r\n if (empty($contentType)) \r\n {\r\n return false;\r\n }\r\n \r\n if (substr(strtolower($contentType), 0, 5) == \"image\") {\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"function isImage($path) {\n global $CONFIG;\n return (is_file($path) && in_array(strtolower(pathinfo($path, PATHINFO_EXTENSION)), $CONFIG->extensions->images));\n}"
]
| [
"0.7998941",
"0.798145",
"0.7931971",
"0.78337795",
"0.7780923",
"0.77540976",
"0.77496356",
"0.77299255",
"0.77058524",
"0.76602066",
"0.76510376",
"0.7542194",
"0.75233656",
"0.74584746",
"0.7403115",
"0.73764265",
"0.737469",
"0.7367184",
"0.7351188",
"0.7326479",
"0.73247784",
"0.7297999",
"0.7269653",
"0.7238605",
"0.7236881",
"0.72265375",
"0.71807766",
"0.7122746",
"0.7079779",
"0.7056735"
]
| 0.83122104 | 0 |
Are we on the WordPress Settings API save page? DO NOT USE filter_input here. There seems to be a PHP bug that on some systems prevents filter_input to work for INPUT_SERVER and INPUT_ENV. | function is_options_save_page()
{
$self = $_SERVER['PHP_SELF'];
$request = $_SERVER['REQUEST_URI'];
return stripos($self, 'options.php') !== false || stripos($request, 'options.php') !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ffw_port_settings_sanitize( $input = array() ) {\n\n global $ffw_port_settings;\n\n parse_str( $_POST['_wp_http_referer'], $referrer );\n\n $output = array();\n $settings = ffw_port_get_registered_settings();\n $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n $post_data = isset( $_POST[ 'ffw_port_settings_' . $tab ] ) ? $_POST[ 'ffw_port_settings_' . $tab ] : array();\n\n $input = apply_filters( 'ffw_port_settings_' . $tab . '_sanitize', $post_data );\n\n // Loop through each setting being saved and pass it through a sanitization filter\n foreach( $input as $key => $value ) {\n\n // Get the setting type (checkbox, select, etc)\n $type = isset( $settings[ $key ][ 'type' ] ) ? $settings[ $key ][ 'type' ] : false;\n\n if( $type ) {\n // Field type specific filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize_' . $type, $value, $key );\n }\n\n // General filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize', $value, $key );\n }\n\n\n // Loop through the whitelist and unset any that are empty for the tab being saved\n if( ! empty( $settings[ $tab ] ) ) {\n foreach( $settings[ $tab ] as $key => $value ) {\n\n // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work\n if( is_numeric( $key ) ) {\n $key = $value['id'];\n }\n\n if( empty( $_POST[ 'ffw_port_settings_' . $tab ][ $key ] ) ) {\n unset( $ffw_port_settings[ $key ] );\n }\n\n }\n }\n\n // Merge our new settings with the existing\n $output = array_merge( $ffw_port_settings, $output );\n\n // @TODO: Get Notices Working in the backend.\n add_settings_error( 'ffw_port-notices', '', __( 'Settings Updated', 'ffw_port' ), 'updated' );\n\n return $output;\n\n}",
"function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"public function sanitize_setting_filter( $input ) {\n\t\treturn $input;\n\t}",
"function bdpp_validate_settings( $input ) {\n\t\n\tglobal $bdpp_options;\n\t\n\tif ( empty( $_POST['_wp_http_referer'] ) ) {\n\t\treturn $input;\n\t}\n\t\n\t$input = $input ? $input : array();\n\t\n\tparse_str( $_POST['_wp_http_referer'], $referrer );\n\t$tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n\t\n\t// Sanitize filter according to tab\n\tif( $tab ) {\n\t\t$input = apply_filters( 'bdpp_validate_settings_' . $tab, $input );\n\t}\n\t\n\t// General sanitize filter\n\t$input = apply_filters( 'bdpp_validate_settings', $input );\n\t\n\t// Merge our new settings with the existing\n\t$output = array_merge( $bdpp_options, $input );\n\n\tdo_action( 'bdpp_validate_settings', $input, $tab );\n\tdo_action( 'bdpp_validate_common_settings', $input, $tab, 'bdpp' );\n\n\treturn $output;\n}",
"public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}",
"public function sanitize_module_input( $input ) {\n\n\t\tglobal $itsec_globals;\n\n\t\t//Process hide backend settings\n\t\t$input['enabled'] = ( isset( $input['enabled'] ) && intval( $input['enabled'] == 1 ) ? true : false );\n\t\t$input['theme_compat'] = ( isset( $input['theme_compat'] ) && intval( $input['theme_compat'] == 1 ) ? true : false );\n\t\t$input['show-tooltip'] = ( isset( $this->settings['show-tooltip'] ) ? $this->settings['show-tooltip'] : false );\n\n\t\tif ( isset( $input['slug'] ) ) {\n\n\t\t\t$input['slug'] = sanitize_title( $input['slug'] );\n\n\t\t} else {\n\n\t\t\t$input['slug'] = 'wplogin';\n\n\t\t}\n\n\t\tif ( isset( $input['post_logout_slug'] ) ) {\n\n\t\t\t$input['post_logout_slug'] = sanitize_title( $input['post_logout_slug'] );\n\n\t\t} else {\n\n\t\t\t$input['post_logout_slug'] = '';\n\n\t\t}\n\n\t\tif ( $input['slug'] != $this->settings['slug'] && $input['enabled'] === true ) {\n\t\t\tadd_site_option( 'itsec_hide_backend_new_slug', $input['slug'] );\n\t\t}\n\n\t\tif ( isset( $input['register'] ) && $input['register'] !== 'wp-register.php' ) {\n\t\t\t$input['register'] = sanitize_title( $input['register'] );\n\t\t} else {\n\t\t\t$input['register'] = 'wp-register.php';\n\t\t}\n\n\t\tif ( isset( $input['theme_compat_slug'] ) ) {\n\t\t\t$input['theme_compat_slug'] = sanitize_title( $input['theme_compat_slug'] );\n\t\t} else {\n\t\t\t$input['theme_compat_slug'] = 'not_found';\n\t\t}\n\n\t\t$forbidden_slugs = array( 'admin', 'login', 'wp-login.php', 'dashboard', 'wp-admin', '' );\n\n\t\tif ( in_array( trim( $input['slug'] ), $forbidden_slugs ) && $input['enabled'] === true ) {\n\n\t\t\t$invalid_login_slug = true;\n\n\t\t\t$type = 'error';\n\t\t\t$message = __( 'Invalid hide login slug used. The login url slug cannot be \\\"login,\\\" \\\"admin,\\\" \\\"dashboard,\\\" or \\\"wp-login.php\\\" or \\\"\\\" (blank) as these are use by default in WordPress.', 'it-l10n-ithemes-security-pro' );\n\n\t\t\tadd_settings_error( 'itsec', esc_attr( 'settings_updated' ), $message, $type );\n\n\t\t} else {\n\n\t\t\t$invalid_login_slug = false;\n\n\t\t}\n\n\t\tif ( $invalid_login_slug === false ) {\n\n\t\t\tif (\n\t\t\t\t! isset( $type ) &&\n\t\t\t\t(\n\t\t\t\t\t$input['slug'] !== $this->settings['slug'] ||\n\t\t\t\t\t$input['register'] !== $this->settings['register'] ||\n\t\t\t\t\t$input['enabled'] !== $this->settings['enabled']\n\t\t\t\t) ||\n\t\t\t\tisset( $itsec_globals['settings']['write_files'] ) && $itsec_globals['settings']['write_files'] === true\n\t\t\t) {\n\n\t\t\t\tadd_site_option( 'itsec_rewrites_changed', true );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\n\t\t\tif ( isset( $type ) ) {\n\n\t\t\t\t$error_handler = new WP_Error();\n\n\t\t\t\t$error_handler->add( $type, $message );\n\n\t\t\t\t$this->core->show_network_admin_notice( $error_handler );\n\n\t\t\t} else {\n\n\t\t\t\t$this->core->show_network_admin_notice( false );\n\n\t\t\t}\n\n\t\t\t$this->settings = $input;\n\n\t\t}\n\n\t\treturn $input;\n\n\t}",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}",
"function wp_check_site_meta_support_prefilter($check)\n {\n }",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"public function sanitize_module_input( $input ) {\n\n\t\t$input['enabled'] = ( isset( $input['enabled'] ) && intval( $input['enabled'] == 1 ) ? true : false );\n\n\t\tif ( is_multisite() ) {\n\n\t\t\t$this->core->show_network_admin_notice( false );\n\n\t\t\t$this->settings = $input;\n\n\t\t}\n\n\t\treturn $input;\n\n\t}",
"function gssettings_sanitize_inputs() {\n genesis_add_option_filter( 'one_zero', GSSETTINGS_SETTINGS_FIELD, array( 'gssettings_move_primary_nav', 'gssettings_move_subnav' ) );\n }",
"public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }",
"function bdpp_validate_general_settings( $input ) {\n\n\t$input['post_types'] = isset( $input['post_types'] ) ? bdpp_clean( $input['post_types'] ) : array();\n\n\t// check default post type\n\tif( ! in_array('post', $input['post_types']) ) {\n\t\t$input['post_types'][] = 'post';\n\t}\n\n\treturn $input;\n}",
"public function security_check() {\n\t\t\tif ( current_user_can( 'activate_plugins' ) ) {\n\t\t\t\t//Conditionally adding the function for database context for \n\t\t\t\tadd_filter( 'clean_url', array( $this, 'save_shortcode' ), 99, 3 );\n\t\t\t}\n\t\t}",
"function sanitised() {\n\t$sanitised = true;\n\n\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t// See if we are being asked to save the file\n\t\t$save_vars = get_input('db_install_vars');\n\t\t$result = \"\";\n\t\tif ($save_vars) {\n\t\t\t$rtn = db_check_settings($save_vars['CONFIG_DBUSER'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBPASS'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBNAME'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBHOST'] );\n\t\t\tif ($rtn == FALSE) {\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/dbsettings_error\"));\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\",\n\t\t\t\t\t\t\t\tarray(\t'settings.php' => $result,\n\t\t\t\t\t\t\t\t\t\t'sticky' => $save_vars)));\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$result = create_settings($save_vars, dirname(dirname(__FILE__)) . \"/settings.example.php\");\n\n\n\t\t\tif (file_put_contents(dirname(dirname(__FILE__)) . \"/settings.php\", $result)) {\n\t\t\t\t// blank result to stop it being displayed in textarea\n\t\t\t\t$result = \"\";\n\t\t\t}\n\t\t}\n\n\t\t// Recheck to see if the file is still missing\n\t\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\", array('settings.php' => $result)));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\tif (!file_exists(dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\tif (!@copy(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\", dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/htaccess\", array('.htaccess' => file_get_contents(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\"))));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\treturn $sanitised;\n}",
"private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}",
"public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }",
"function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}",
"function ghactivity_settings_validate( $input ) {\n\t$input['username'] = sanitize_text_field( $input['username'] );\n\t$input['access_token'] = sanitize_key( $input['access_token'] );\n\t$input['display_private'] = (bool) $input['display_private'];\n\t$input['repos'] = sanitize_text_field( $input['repos'] );\n\treturn $input;\n}",
"function wp_is_ini_value_changeable($setting)\n {\n }",
"public static function sanitize() {\n\n $new_input = self::get_options();\n $default_options = self::default_options();\n $parts = parse_url($_POST['_wp_http_referer']);\n parse_str($parts['query'], $query);\n $tab = (array_key_exists('tab', $query)) ? $query['tab'] : 'general';\n\n switch ($tab) {\n case 'general':\n default:\n $new_input['cris_org_nr'] = isset($_POST[self::option_name]['cris_org_nr']) ? sanitize_text_field($_POST[self::option_name]['cris_org_nr']) : 0;\n break;\n\n case 'layout':\n $new_input['cris_pub_order'] = isset($_POST[self::option_name]['cris_pub_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_order'])) : $default_options['cris_pub_order'];\n $new_input['cris_pub_subtypes_order'] = isset($_POST[self::option_name]['cris_pub_subtypes_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_subtypes_order'])) : $default_options['cris_pub_subtypes_order'];\n $new_input['cris_univis'] = in_array($_POST[self::option_name]['cris_univis'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_univis'] : $default_options['cris_univis'];\n $new_input['cris_bibtex'] = isset($_POST[self::option_name]['cris_bibtex']) ? 1 : 0;\n $new_input['cris_url'] = isset($_POST[self::option_name]['cris_url']) ? 1 : 0;\n $new_input['cris_doi'] = isset($_POST[self::option_name]['cris_doi']) ? 1 : 0;\n $new_input['cris_oa'] = isset($_POST[self::option_name]['cris_oa']) ? 1 : 0;\n $new_input['cris_name_order_plugin'] = (isset($_POST[self::option_name]['cris_name_order_plugin'])\n && $_POST[self::option_name]['cris_name_order_plugin'] == 'lastname-firstname') ? 'lastname-firstname' : 'firstname-lastname';\n $new_input['cris_award_order'] = isset($_POST[self::option_name]['cris_award_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_award_order'])) : $default_options['cris_award_order'];\n $new_input['cris_award_link'] = in_array($_POST[self::option_name]['cris_award_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_award_link'] : $default_options['cris_award_link'];\n $new_input['cris_fields_num_pub'] = isset($_POST[self::option_name]['cris_fields_num_pub']) ? sanitize_text_field($_POST[self::option_name]['cris_fields_num_pub']) : 0;\n\t $new_input['cris_field_link'] = in_array($_POST[self::option_name]['cris_field_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_field_link'] : $default_options['cris_field_link'];\n\t $new_input['cris_project_order'] = isset($_POST[self::option_name]['cris_project_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_project_order'])) : $default_options['cris_project_order'];\n $new_input['cris_project_link'] = in_array($_POST[self::option_name]['cris_project_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_project_link'] : $default_options['cris_project_link'];\n $new_input['cris_patent_order'] = isset($_POST[self::option_name]['cris_patent_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_patent_order'])) : $default_options['cris_patent_order'];\n $new_input['cris_patent_link'] = in_array($_POST[self::option_name]['cris_patent_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_patent_link'] : $default_options['cris_patent_link'];\n $new_input['cris_activities_order'] = isset($_POST[self::option_name]['cris_activities_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_activities_order'])) : $default_options['cris_activities_order'];\n $new_input['cris_activities_link'] = in_array($_POST[self::option_name]['cris_activities_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_activities_link'] : $default_options['cris_activities_link'];\n $new_input['cris_standardizations_order'] = isset($_POST[self::option_name]['cris_standardizations_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_standardizations_order'])) : $default_options['cris_standardizations_order'];\n $new_input['cris_standardizations_link'] = in_array($_POST[self::option_name]['cris_standardizations_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_standardizations_link'] : $default_options['cris_standardizations_link'];\n break;\n case 'sync':\n $new_input['cris_sync_check'] = isset($_POST[self::option_name]['cris_sync_check']) ? 1 : 0;\n if(is_array($_POST[self::option_name]['cris_sync_shortcode_format'])) {\n /*foreach ($_POST[self::option_name]['cris_sync_shortcode_format'] as $_check){\n foreach ($_check as $_k => $_v) {\n $new_input['cris_sync_shortcode_format'][$_k] = $_v;\n }\n }*/\n $new_input['cris_sync_shortcode_format'] = $_POST[self::option_name]['cris_sync_shortcode_format'];\n }\n break;\n }\n return $new_input;\n }",
"public function validate_settings( $input ) {\r\n\t\t$valid_input = array();\r\n\t\t\r\n\t\t/* General Settings */\r\n\t\t$valid_input['options']['timeline_nav'] = ( $input['options']['timeline_nav'] == 1 ? 1 : 0 );\r\n\t\t$valid_input['db_version'] = $input['db_version'];\r\n\t\t\r\n\t\t/* Wordpress */\r\n\t\tif( !empty( $input['options']['wp']['content'] ) || !empty( $input['options']['wp']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['wp']['content'] as $key=>$value ) {\r\n\t\t\t\t$valid_input['options']['wp']['content'][$key] = (int) ( $value == 1 ? 1 : 0 );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['wp']['filter'] as $filter=>$value ) {\r\n\t\t\t\tforeach( $value as $id=>$val ) {\r\n\t\t\t\t\tswitch( $filter ) {\r\n\t\t\t\t\t\tcase 'taxonomy' :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter']['taxonomy'][$id] = (int) ( $val == 1 ? 1 : 0 );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter'][$filter][$id] = wp_filter_nohtml_kses( $val );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/* Twitter */\r\n\t\tif( !empty( $input['options']['twitter']['content']) || !empty($input['options']['twitter']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['twitter']['content'] as $key=>$value ) {\r\n\t\t\t\tswitch( $key ) {\r\n\t\t\t\t\tcase 'username' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['username'] = wp_filter_nohtml_kses( str_replace( '@', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 'timeline' :\r\n\t\t\t\t\t\t$valid_options = array( '1', '2' );\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['timeline'] = ( in_array( $value, $valid_options ) == true ? $value : null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content'][$key] = wp_filter_nohtml_kses( $value );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['twitter']['filter'] as $filter=>$value ) {\r\n\t\t\t\tswitch($filter) {\r\n\t\t\t\t\tcase 'tags' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['filter']['tags'] = wp_filter_nohtml_kses( str_replace('#', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $valid_input;\r\n\t}",
"function handle_app_notifier_settings() {\n $ips = ( get_option('restriction_allowed_ips') ) ? get_option('restriction_allowed_ips') : [];\n update_option('notifier_endpoint', $_POST['endpoint']);\n update_option('enable_notification', $_POST['enable_notification']);\n update_option( 'enable_api_restriction', $_POST['enable_api_restriction'] );\n\n if ( isset( $_POST['restriction_allowed_ips'] ) && !empty( $_POST['restriction_allowed_ips'] ) ) {\n array_push($ips, $_POST['restriction_allowed_ips'] );\n update_option('restriction_allowed_ips', $ips);\n }\n wp_redirect(admin_url('/admin.php?page=notifier'));\n}",
"public function sanitizeValueOnSave(): bool\n {\n return true;\n }",
"function wfc_is_dev(){\n if( isset($_COOKIE['wfc_admin_cake']) ){\n if( $_COOKIE['wfc_admin_cake'] == base64_encode( 'show_all' ) ){\n return true;\n }\n return false;\n }\n return false;\n }",
"public function sanitize_settings($input) {\n $output = $input;\n $output['db_version'] = $this->plugin->db_version();\n $output['debug'] = (bool) $input['debug'];\n\n return $output;\n }",
"private static function _is_internal() {\n\t\t// Skip for preview, 404 calls, feed, search, favicon and sitemap access.\n\t\treturn is_preview() || is_404() || is_feed() || is_search()\n\t\t\t|| ( function_exists( 'is_favicon' ) && is_favicon() )\n\t\t\t|| '' !== get_query_var( 'sitemap' ) || '' !== get_query_var( 'sitemap-stylesheet' );\n\t}",
"function action_save ($group = 'default') {\n $input = $_POST;\n $settings = settings_get($group);\n \n foreach ($input as $key => $value) {\n $input[$key] = array(\n 'exist' => isset($settings[$key]),\n 'value' => strip_tags($value)\n );\n \n if (isset($settings[$key]) && $value === $settings[$key]) {\n unset($input[$key]);\n }\n }\n \n json_result(settings_save($group, $input));\n}"
]
| [
"0.6685326",
"0.61415553",
"0.61356187",
"0.61083996",
"0.608565",
"0.60469514",
"0.5985365",
"0.5934731",
"0.5927271",
"0.5926812",
"0.5841302",
"0.5813109",
"0.57908696",
"0.5787945",
"0.5781255",
"0.5730901",
"0.57296836",
"0.57162905",
"0.57050765",
"0.56980973",
"0.56966543",
"0.567977",
"0.56664735",
"0.56447905",
"0.5624951",
"0.5614692",
"0.56053007",
"0.5601763",
"0.5586343",
"0.55559146"
]
| 0.6341265 | 1 |
Are we on a Podlove Settings screen? | function is_podlove_settings_screen()
{
$screen = get_current_screen();
return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}",
"public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}",
"public function canLikesettings() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n $like_setting_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.setting.show' ) ;\n\t\tif ( empty( $like_profile_show ) || empty( $like_setting_show ) ) {\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}",
"function EditOwnSettings()\n\t{\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->editownsettings;\n\t}",
"function ts_check_if_control_panel()\r\n{\r\n\t$control_panel = ot_get_option('control_panel');\r\n\t\r\n\tif ($control_panel == 'enabled_admin' && current_user_can('manage_options') || $control_panel == 'enabled_all')\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"function isSettings($type) {\n\tif (strlen($type) > 8) {\n\t\tif (substr($type, -8) === \"settings\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"function test_settings($settings)\n {\n //can even register results, so you can give errors or whatever if you want..\n geoAdmin::m('I\\'m sure the settings are just fine. (CHANGE THIS! FOR DEMONSTRATION ONLY)');\n\n return true;\n }",
"private function comprueba_pantalla () {\r\r\n\r\r\n\t\t\t$pantalla = get_current_screen();\r\r\n\r\r\n\t\t\treturn ('plugins' == $pantalla->base) ? true : false;\r\r\n\t\t\t}",
"public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}",
"private function showAdminHint(): bool\n {\n return $this->getWordpressConfig()->atAdminPanel() === false\n && $this->getMainConfig()->blogAdminHint() === true;\n }",
"public function acf_wpi_ui() {\n\t\tif ( ! get_field( 'acf_wpi_ui_enable', 'option' ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"static function has_edit_screen(): bool { return true; }",
"private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function showSettings()\n\t{\n\n\t\treturn $this->showDefaultSettings();\n\t}",
"function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }",
"function has_setting($name)\n {\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"function bp_get_admin_bar_pref( $context, $user = 0 ) {\n\t$pref = get_user_option( \"show_admin_bar_{$context}\", $user );\n\tif ( false === $pref )\n\t\treturn true;\n\n\treturn 'true' === $pref;\n}",
"function check_plugin_mainscreen_name()\r\r\n{\r\r\n $screen = get_current_screen();\r\r\n if (is_object($screen) && $screen->id == 'toplevel_page_oneclick-google-map') {\r\r\n return true;\r\r\n }\r\r\n else {\r\r\n return false;\r\r\n }\r\r\n}",
"function is_user_preference_short_url() {\n\treturn (isset($_COOKIE['doShort'])) ? true : false;\n}",
"private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}",
"function is_primary() {\n\n\t\tif ( !empty( $this->get_post_types() ) ) {\n\n\t\t\tforeach ( TPL_FW()->registered_settings_pages as $key => $settings_page ) {\n\n\t\t\t\tif ( $settings_page->get_post_type() && $this->has_post_type( $settings_page->get_post_type() ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function hasSetting( $name );",
"public function isDisplayed()\n {\n if (!$this->scopeConfig->getValue('magentomobileshop/secure/key')) {\n return true;\n }\n }",
"function is_episode_edit_screen()\n{\n $screen = get_current_screen();\n\n return in_array($screen->base, ['edit', 'post']) && $screen->post_type == 'podcast';\n}",
"function is_options_save_page()\n{\n $self = $_SERVER['PHP_SELF'];\n $request = $_SERVER['REQUEST_URI'];\n\n return stripos($self, 'options.php') !== false || stripos($request, 'options.php') !== false;\n}"
]
| [
"0.7601792",
"0.71732724",
"0.71638584",
"0.7098602",
"0.7015568",
"0.66845447",
"0.6675503",
"0.6599174",
"0.64648736",
"0.6446677",
"0.6445697",
"0.64327866",
"0.6432238",
"0.6379396",
"0.6368239",
"0.63527364",
"0.62000245",
"0.61750424",
"0.6094654",
"0.6089445",
"0.60812736",
"0.60735744",
"0.60277104",
"0.6023634",
"0.5993152",
"0.5984524",
"0.5967079",
"0.59564686",
"0.5944306",
"0.5929239"
]
| 0.848778 | 0 |
Are we on an edit screen for episodes? | function is_episode_edit_screen()
{
$screen = get_current_screen();
return in_array($screen->base, ['edit', 'post']) && $screen->post_type == 'podcast';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function has_edit_screen(): bool { return true; }",
"public function isEditFormShown() {}",
"public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}",
"protected function is_edit_page() {\n\t\treturn false;\n\t}",
"public function isEditAction() {}",
"public function is_editing() {\n\n\t\tif ( 'edit' !== Param::get( 'action' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Param::get( 'redirection', false, FILTER_VALIDATE_INT );\n\t}",
"protected function isFrontendEditActive() {}",
"protected function isFrontendEditActive() {}",
"public function getEditMode()\n {\n $page = $this->getPage();\n\n if (!$page->canEdit()) {\n $this->endEditing();\n return false;\n }\n\n $stage = Versioned::get_stage();\n if ($stage != Versioned::DRAFT) {\n return false;\n }\n\n // one-off preview that does _not_ stop edit mode\n if ($this->getRequest()->getVar('preview')) {\n return false;\n }\n\n return true;\n }",
"public function isFrontendEditingActive() {}",
"function is_edit_page($new_edit = null)\n{\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if ($new_edit == \"edit\")\n return in_array($pagenow, array('post.php',));\n elseif ($new_edit == \"new\") //check for new post page\n return in_array($pagenow, array('post-new.php'));\n else //check for either new or edit\n return in_array($pagenow, array('post.php', 'post-new.php'));\n}",
"function is_edit_page( $new_edit = null ) {\n\tglobal $pagenow;\n\tif ( !is_admin() ) return false;\n\tif ( $new_edit == \"edit\" )\n\t\treturn in_array( $pagenow, array( 'post.php', ) );\n\telseif ($new_edit == \"new\")\n\t\treturn in_array( $pagenow, array( 'post-new.php' ) );\n\telse\n\t\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}",
"public function isSwitchToEditEnabled();",
"public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}",
"public function isEditOnlyMode();",
"function is_edit_page($new_edit = null){\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if($new_edit == \"edit\")\n return in_array( $pagenow, array( 'post.php', ) );\n elseif($new_edit == \"new\") //check for new post page\n return in_array( $pagenow, array( 'post-new.php' ) );\n else //check for either new or edit\n return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}",
"function fa_is_theme_edit_preview(){\n\tif( fa_is_preview() ){\n\t\tif( isset( $_GET['action'] ) && 'theme_edit' == $_GET['action'] ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\n}",
"function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }",
"public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"protected function canEdit() {}",
"function fusion_should_add_fe_edit_link() {\n\tif ( 0 === fusion_library()->get_page_id() || false === fusion_library()->get_page_id() || '0-archive' === fusion_library()->get_page_id() || is_preview_only() ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function canEdit()\n {\n return true;\n }",
"function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }",
"public function in_edit_display_mode($mode = null) {\n if (!$submission = $this->submission_settings) {\n return false;\n }\n if (empty($submission['display'])) {\n return false;\n }\n if (!$mode) {\n return true;\n }\n return ($submission['display'] == $mode);\n }",
"function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }",
"function is_edit_page( $new_edit = null )\n {\n global $pagenow;\n\n if ( ! is_admin() ) {\n return false;\n } elseif ( $new_edit === 'edit' ) {\n return in_array( $pagenow, [ 'post.php' ] );\n } elseif ( $new_edit === 'new' ) {\n /** Check for new post page */\n return in_array( $pagenow, [ 'post-new.php' ] );\n } else {\n /** Check for either new or edit */\n return in_array( $pagenow, [ 'post.php', 'post-new.php' ] );\n }\n }",
"private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function portfolio_web_is_edit_page() {\r\n\t//make sure we are on the backend\r\n\tif ( !is_admin() ){\r\n\t\treturn false;\r\n\t}\r\n\tglobal $pagenow;\r\n\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\r\n}",
"function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }",
"public function is_admin_editor_page() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $pagenow, $wp_version;\n\t\t$allowed_pagenow_array = array( 'post.php', 'post-new.php', 'term.php', 'user-new.php', 'user-edit.php', 'profile.php' );\n\t\t$allowed_page_array = array( 'views-editor', 'ct-editor', 'view-archives-editor', 'dd_layouts_edit' );\n\t\t// @todo maybe add a filter here for future Toolset admin pages...\n\t\tif (\n\t\t\tin_array( $pagenow, $allowed_pagenow_array )\n\t\t\t|| (\n\t\t\t\t$pagenow == 'admin.php'\n\t\t\t\t&& isset( $_GET['page'] )\n\t\t\t\t&& in_array( $_GET['page'], $allowed_page_array )\n\t\t\t)\n\t\t\t|| (\n\t\t\t\t// In WordPress < 4.5, the edit tag admin page is edit-tags.php?action=edit&taxonomy=category&tag_ID=X\n\t\t\t\tversion_compare( $wp_version, '4.5', '<' )\n\t\t\t\t&& $pagenow == 'edit-tags.php'\n\t\t\t\t&& isset( $_GET['action'] )\n\t\t\t\t&& $_GET['action'] == 'edit'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"
]
| [
"0.791495",
"0.7261454",
"0.7122002",
"0.68549705",
"0.68472046",
"0.6609266",
"0.65801805",
"0.65801805",
"0.65569115",
"0.64714736",
"0.644012",
"0.6424129",
"0.64155513",
"0.64130676",
"0.6375586",
"0.6364731",
"0.6350217",
"0.63103384",
"0.6307443",
"0.63019407",
"0.62914854",
"0.6273193",
"0.6265976",
"0.62389946",
"0.6234673",
"0.6234589",
"0.62323946",
"0.6218725",
"0.6203503",
"0.61847806"
]
| 0.8592952 | 0 |
prepare an existing episode slug for use in URL | function prepare_episode_slug_for_url($slug)
{
$slug = trim($slug);
$slug = rawurlencode($slug);
// allow directories in slug
return str_replace('%2F', '/', $slug);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createSlug() {\r\n \r\n $proposal = !empty($this->subject) ? substr(create_slug($this->subject), 0, 60) : $this->id;\r\n \r\n $result = $this->db->fetchAll(\"SELECT post_id FROM nuke_bbposts_text WHERE url_slug = ?\", $proposal); \r\n \r\n if (count($result)) {\r\n $proposal .= count($result);\r\n }\r\n \r\n $this->url_slug = $proposal;\r\n \r\n }",
"abstract public static function slug(): string;",
"public function generateSlug();",
"public function slug();",
"public function slug();",
"private function parseTitleUrl() {\n $posId = strpos($this->title, '-') + 1;\n $this->title = substr($this->title, $posId, strlen($this->title) - $posId);\n $this->title = $this->smoothenTitle($this->title);\n\n $sql = \"SELECT\n id,\n title\n FROM\n articles\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $title);\n while($stmt->fetch()) {\n if($this->title == $this->smoothenTitle($title)) {\n $this->articleId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->articleId !== -1) {\n $this->parsedUrl = '/'.$this->articleId.'/'.$this->cat.'/'.$this->title;\n }\n }",
"public function slug() {\n\t\treturn $this->createSlug($this->title);\n\t}",
"public function slug(): string;",
"public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = Slugify::create();\n $this->slug = $slugify->slugify($this->title);\n }\n }",
"public function initializeSlug() {\n if(empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nomhotel);\n }\n }",
"public function getSlug();",
"public function getSlug();",
"public function getSlug();",
"public function getSlug();",
"function slugify($title) {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n $title = remove_accents($title);\n if (seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = utf8_uri_encode($title, 200);\n }\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n return $title;\n}",
"public function generateSlug()\n {\n if ($this->slug != str_slug($this->title)) {\n $this->slug = str_slug($this->title);\n }\n\n while ($count = self::where(['slug' => $this->slug])->where('id', '!=', $this->id)->count()) {\n $this->slug .= '-' . $count;\n }\n }",
"public function createSlug()\n {\n $slug = new Slugify();\n $this->slug = $slug->slugify($this->title);\n }",
"protected function addSlug()\n {\n $slugSource = $this->generateSlugFrom();\n\n $slug = $this->generateUniqueSlug($slugSource);\n\n $this->slug = $slug;\n }",
"function eme_permalink_convert ($val) {\n // called remove_accents, but we also want to replace spaces with \"-\"\n // and trim the last space. sanitize_title_with_dashes does all that\n // and then, add a trailing slash\n $val = sanitize_title_with_dashes(remove_accents($val));\n return trailingslashit($val);\n}",
"public function calculateSlug() {\n $this->slug = strtolower(str_replace(array(\" \", \"_\"), array(\"-\", \"-\"), $this->nombre)).rand(1, 100);\n }",
"function create_slug($string){\n $slug = preg_replace('/[^A-Za-z0-9-]+/', '-', $string);\n return $slug;\n}",
"public function slug($slug);",
"public function setSlugAttribute()\n {\n $title = $this->attributes['title'];\n $this->attributes['slug'] = Str::slug($title, '-');\n }",
"public function makeSlug () {\n\t\tif(empty($this->slug)) {\n\t\t\t$this->slug = UTF8::slugify($this->name);\n\t\t}\n\t\treturn $this->slug;\n\t}",
"function slugify($slug)\n{\n $slug = trim($slug);\n // replace everything but unreserved characters (RFC 3986 section 2.3) and slashes by a hyphen\n $slug = preg_replace('~[^\\\\pL\\d_\\.\\~/]~u', '-', $slug);\n $slug = rawurlencode($slug);\n $slug = str_replace('%2F', '/', $slug);\n\n return empty($slug) ? 'n-a' : $slug;\n}",
"public function initializeSlug()\n {\n if (empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->titre);\n }\n }",
"function slugify ($str) { // turn name into slug for ID\r\n\t$slug = str_replace(' ','-',strtolower($str));\r\n\treturn $slug;\t\r\n}",
"public function getSlug(ContentfulEntry $contentfulEntry): string;",
"public static function slug($slug);",
"public function getSlug()\n\t{\n\t\treturn self::buildSlug();\n\t}"
]
| [
"0.6596095",
"0.64756995",
"0.62256926",
"0.62190425",
"0.62190425",
"0.61237764",
"0.6093455",
"0.59840983",
"0.59807336",
"0.597703",
"0.5959924",
"0.5959924",
"0.5959924",
"0.5959924",
"0.5935384",
"0.5917748",
"0.5912548",
"0.5829948",
"0.5818715",
"0.5817684",
"0.57829666",
"0.57430136",
"0.57421964",
"0.57292426",
"0.5706832",
"0.57038563",
"0.5703844",
"0.56816787",
"0.56662405",
"0.5650581"
]
| 0.81629515 | 0 |
getFoodTruckNearestLocation This method returns JSON data of all foodtrucks in a partular Latitude/Longitude retrieved from csv | public function getFoodTruckNearestLocation($lat, $lon ,$countOfLoc) {
try {
$rows = array_map('str_getcsv', file('../Mobile_Food_Facility_Permit.csv'));
$header = array_shift($rows);
$csv = array();
$counter = 1;
$myJSON = array();
foreach($rows as $row) {
$a = $lat - $row[14];
$b = $lon - $row[15];
$distance = sqrt(($a**2) + ($b**2));
$distances[$row[0]] = $distance;
$array[$row[0]] = $row;
$csv[$row[0]] = array_combine($header, $row);
}
asort($distances);
$counter = 1;
$myJSON = array();
foreach($distances as $id=>$value) {
$foodTruck[] = array('name'=>$csv[$id]['Applicant'],
"address"=>$csv[$id]['LocationDescription'],
"facilityType"=>$csv[$id]['FacilityType']);
if($counter++ >$countOfLoc) break;
}
} catch (Exception $e) {
return json_encode(array("error"=>"true","description"=>"Exception"));
}
return json_encode($foodTruck);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFoodTruckNearestLocationDB($lat, $lon ,$countOfLoc) {\r\n try{\r\n $query = \"\r\n SELECT * FROM (\r\n SELECT *, \r\n (\r\n (\r\n (\r\n acos(\r\n sin(( $lat * pi() / 180))\r\n *\r\n sin(( `Latitude` * pi() / 180)) + cos(( $lat * pi() /180 ))\r\n *\r\n cos(( `Latitude` * pi() / 180)) * cos((( $lon - `Longitude`) * pi()/180)))\r\n ) * 180/pi()\r\n ) * 60 * 1.1515 * 1.609344\r\n )\r\n as distance FROM mobile_food_facility_permit\r\n ) markers order by distance asc \r\n \r\n LIMIT $countOfLoc;\";\r\n //echo $query;\r\n $result = $this->db->query($query);\r\n $foodTruck = array();\r\n if ($result->num_rows > 0) {\r\n // output data of each row\r\n $counter = 1;\r\n while($row = $result->fetch_assoc()) {\r\n $foodTrucks[] = array( \"name\"=>$row[\"Applicant\"], \r\n \"address\"=>$row[\"LocationDescription\"],\r\n \"facilityType\"=>$row[\"FacilityType\"]);\r\n if($counter++ >$countOfLoc) break;\r\n }\r\n }\r\n } catch (Exception $e) {\r\n return json_encode(array(\"error\"=>\"true\",\"description\"=>\"Exception\"));\r\n }\r\n return json_encode($foodTrucks);\r\n }",
"public function nearest()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $location = Location::getNearestLocation($lat, $lon);\n return response()->json($location);\n }",
"private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }",
"function getCarParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_car_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}",
"function get_snapped_point ($lat, $lng)\n{\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json\",\n 'method' => 'GET' \n )\n );\n \n //ATTENTION :Replace your own api_key\n $api_key=\"key\";\n $url_arr = array(\"https://roads.googleapis.com/v1/nearestRoads?points=$lat,$lng&key=\".$api_key,\n \"https://roads.googleapis.com/v1/snapToRoads?path=$lat,$lng&key=\".$api_key);\n\n $url= $url_arr[array_rand($url_arr)];\n $context = stream_context_create($options);\n\n $result = file_get_contents($url, false, $context);\n $result_arr=json_decode($result,true);\n\n \n return ($result_arr[\"snappedPoints\"][0][\"location\"]);\n}",
"function findClosest($res, $curLat, $curLon) {\n // REMEMBER TO CHANGE CURLAT1 to CURLAT and CURLON1 to CURLON\n // originLan, originLon, destLan, destLon\n\n $absLoc = abs($curLat) + abs($curLon);\n\n\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n while ($row = $res->fetch_assoc()) {\n $dbAbsLoc[] =floatval($row['absLoc']);\n }\n\n // locate the nearest absLoc point\n $i = 0;\n do {\n $tempLoc = abs($absLoc - $dbAbsLoc[$i]); \n $i++;\n } while ($i < count($dbAbsLoc) && $tempLoc > (abs($absLoc - $dbAbsLoc[$i])));\n $tempLoc = $dbAbsLoc[$i-1];\n requestClosest($tempLoc, $curLat, $curLon);\n}",
"function requestClosest($tempLoc, $curLat, $curLon) {\n global $mysqli;\n global $toiletDB;\n \n $revised = $mysqli->prepare(\"SELECT * FROM $toiletDB WHERE absLoc = $tempLoc\");\n $revised->execute();\n $res = $revised->get_result();\n \n printClosest($res, $curLat, $curLon);\n \n $res->close(); \n}",
"function getdistancebetweenPoints($lat=null, $lng=null, $lat1=null, $lng1=null) {\n global $token;\n global $g_key;\n global $api_googleapis;\n $file_content = ''.$api_googleapis.'origin='.$lat.'&destination='.$lng.'&alternatives=true&sensor=false&key='.$g_key.'&='.$token.'';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $file_content);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $distbetween_content = curl_exec($ch);\n\n curl_close($ch);\n\n$response = json_decode($distbetween_content, true);\nif($response['status']=='OK') {\n\nforeach($response[\"routes\"] as $key => $data) {\n$route = json_encode($data[\"legs\"][0]['distance']['value'], true);\n$duration = json_encode($data[\"legs\"][0]['duration']['value'], true);\n$lat_start = json_encode($data[\"legs\"][0]['start_location']['lat'], true);\n$lng_start = json_encode($data[\"legs\"][0]['start_location']['lng'], true);\n$lat_end = json_encode($data[\"legs\"][0]['end_location']['lat'], true);\n$lng_end = json_encode($data[\"legs\"][0]['end_location']['lng'], true);\n\n $distance = array(\n 'status' => 'success',\n 'path' => array(array($lat_start, $lng_start),\n array($lat_end, $lng_end)),\n 'total_distance' => $route,\n 'total_time' => $duration);\n return $distance;\n }\n\n\n}else {\n$arr_error = array('status' => 'failure', 'error' => 'ERROR_DESCRIPTION');\necho json_encode($arr_error);\nreturn 0;\n}\n\n\n\n\n}",
"function get_route($my_location){\n $route_start = $my_location[0];\n $route_end = $my_location[1];\n\n $loc_api_key = AIzaSyBFuL6yafR8BuhdbzupDAcorVH4sAO2YpE;\n //$route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key.\"&alternatives=true\"; this is for detours\n $route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key;\n\n if (!function_exists('curl_init')){\n die('Can\\'t find cURL module'); \n }\n\n $chRD = curl_init(); //RD = Route Directions\n\n if (!$chRD){\n die('Couldn\\'t initialize a cURL module'); \n }\n\n curl_setopt($chRD, CURLOPT_URL, $route_url);\n curl_setopt($chRD, CURLOPT_RETURNTRANSFER, TRUE);\n \n $dataRD = curl_exec($chRD);\n curl_close($chRD);\n\n $routes = json_decode($dataRD);\n\n return $routes;\n}",
"function getLatLong($address, $city, $postalCode) {\n $combinedAddress = $address . \", \" . $postalCode . \" \" . $city;\n\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . urlencode($combinedAddress) . \"&key=\" . Config::GOOGLE_API_KEY;\n $context = stream_context_create();\n $result = file_get_contents($url, false, $context);\n\n if (isset($result)) {\n $parsedResult = json_decode($result, true);\n\n if (isset($parsedResult[\"results\"])) {\n $results = $parsedResult[\"results\"];\n $firstLocation = $results[0];\n return $firstLocation[\"geometry\"][\"location\"];\n } else {\n echo($result);\n }\n } else {\n echo \"HELP\";\n }\n}",
"function getForceAndNhood($lat, $lng) {\n\t// My unique username and password, woo! The API requires this on every query.\n\t$userpass = POLICE_API_KEY;\n\t$url = \"http://policeapi2.rkh.co.uk/api/locate-neighbourhood?q=$lat,$lng\";\n\n\t$curl = curl_init();\n\n\t// Gotta put dat password in.\n\tcurl_setopt($curl, CURLOPT_USERPWD, $userpass);\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\n\t// Without this, we just get \"1\" or similar.\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n\t$data = curl_exec($curl);\n\n\tcurl_close($curl);\n\n\t// The API returns JSON, and json_decode produces an interesting mix of objects and arrays.\n\t$dataObj = json_decode($data);\n\t\n\treturn $dataObj;\n\t}",
"function getBikeParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_bike_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}",
"function get_gps($mcc, $mnc, $lac, $cellid) {\r\n $gps_data = \"\";\r\n $key = \"f0d88cf6-3a80-4f12-830d-f4b8fd1f06b0\";\r\n\r\n ///JSON CODE\r\n //$URL = \"http://opencellid.org/cell/get?key=\".$key.\"&mcc=\".$mcc.\"&mnc=\".$mnc.\"&lac=\".$lac.\"&cellid=\".$cellid.\"&format=json\"; \r\n $URL = \"http://opencellid.org/cell/get?key=$key&mcc=$mcc&mnc=$mnc&lac=$lac&cellid=$cellid&format=json\";\r\n\r\n $raw = @file_get_contents($URL);\r\n $json_data = json_decode($raw);\r\n\r\n //var_dump($json_data);\r\n echo \"<br>\";\r\n //$json = '{\"foo-bar\": 12345}';\r\n //$obj = json_decode($json);\r\n //echo \"lon=\". $json_data->{'lon'}; // 12345\r\n\r\n $gps_data = $json_data->{'lat'} . \",\" . $json_data->{'lon'};\r\n return $gps_data;\r\n}",
"function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}",
"public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }",
"function getLnt($zip){\r\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\r\n \".urlencode($zip).\"&sensor=false\";\r\n $result_string = file_get_contents($url);\r\n $result = json_decode($result_string, true);\r\n //print_r($result);die();\r\n return $result['results'][0]['geometry']['location'];\r\n }",
"public function find($postcode){\n $inputCoordinates =$this->getCoordinates($postcode);\n\n if(!is_array($inputCoordinates))\n return $inputCoordinates;\n //Uses updateCoordinates to check if there are any new coffeedrop locations and add their lat and lon to db\n $dbpostcodes = $this->updateCoordinates();\n $distances = [];\n foreach ($dbpostcodes as $location) {\n //calculate the distances between the input and all db locations\n $distance = $this->getDistanceBetweenTwoPoints($inputCoordinates,array('latitude' => $location->latitude,'longitude' => $location->longitude));\n $distances[$location->postcode] = $distance;\n }\n //compares distances\n $closestCoffeeDrop = min(array_keys($distances, min($distances)));\n\n $closestCoffeeDropInfo = CoffeeDrop::where('postcode', $closestCoffeeDrop)->first();\n return response()->json(['information' => $closestCoffeeDropInfo]);\n }",
"private function getLatLng() {\n\t\tif( $this->getAutomaticLocation() && ( $this->isChanged() || ( !$this->getLat() && !$this->getLng() ) ) ) {\n\t\t\t$addressStr = $this->getAddLine1() . ' ' . $this->getStreetName() . ',' . $this->getTown();\n\t\t\t$addressStr.= ( $this->getCity() ) ? ',' . $this->getCity() : '';\n\t\t\t$addressStr.= ( $this->getRegion() ) ? ',' . $this->getRegion() : '';\n\t\t\t$addressStr.= ',' . $this->getPostalCode() . ',' . $this->getCountryCode();\n\t\t\t$req = sprintf( 'http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false', urlencode( $addressStr ) );\n\t\t\tif( !( $response = @file_get_contents( $req ) ) ) {\n\t\t\t\tthrow new Exception( sprintf( 'Unable to contact (%s)', $req ) );\n\t\t\t}\n\t\t\t$geoCode = json_decode( $response );\n// Do a switch here based on the possible status messages returned\n\t\t\tif( is_object( $geoCode ) ) {\n\t\t\t\tswitch( $geoCode->status ) {\n\t\t\t\t\tcase static::API_RESPONSE_ZERO_RESULTS:\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase static::API_RESPONSE_OK:\n\t\t\t\t\t\t$o = new StdClass();\n\t\t\t\t\t\t$o->Lat = $geoCode->results[0]->geometry->location->lat;\n\t\t\t\t\t\t$o->Lng = $geoCode->results[0]->geometry->location->lng;\n\t\t\t\t\t\treturn $o;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( sprintf( 'Invalid response (%s) from (%s)', $response, $req ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$o = new StdClass();\n\t\t\t$o->Lat = $this->getLat();\n\t\t\t$o->Lng = $this->getLng();\n\t\t\treturn $o;\n\t\t}\n\t}",
"public function StopsNearLocation($latitude = null, $longitude = null) {\r\n if ($latitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no latitude given\");\r\n }\r\n \r\n if ($longitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no longitude given\");\r\n }\r\n \r\n $parameters = array(\r\n \"latitude\" => $latitude,\r\n \"longitude\" => $longitude\r\n );\r\n \r\n $return = array();\r\n \r\n foreach ($this->fetch(\"nearme\", $parameters) as $row) {\r\n $row['result']['location_name'] = trim($row['result']['location_name']);\r\n \r\n if ($row['result']['transport_type'] == \"train\" || preg_match(\"@Railway@i\", $row['result']['location_name'])) {\r\n $placeData = array(\r\n \"stop_id\" => $row['result']['stop_id'],\r\n \"stop_name\" => $row['result']['location_name'],\r\n \"stop_lat\" => $row['result']['lat'],\r\n \"stop_lon\" => $row['result']['lon'],\r\n \"wheelchair_boarding\" => 0,\r\n \"location_type\" => 1\r\n );\r\n \r\n /**\r\n * Check if this is stored in the database, and add it if it's missing\r\n */\r\n \r\n if (!in_array($row['result']['location_name'], $this->ignore_stops) && \r\n $row['result']['stop_id'] < 10000 &&\r\n !preg_match(\"@#([0-9]{0,3})@\", $row['result']['location_name'])\r\n ) {\r\n $query = sprintf(\"SELECT stop_id FROM %s_stops WHERE stop_id = %d LIMIT 1\", self::DB_PREFIX, $row['result']['stop_id']); \r\n $result = $this->adapter->query($query, Adapter::QUERY_MODE_EXECUTE); \r\n \r\n if ($result->count() === 0) {\r\n $Insert = $this->db->insert(sprintf(\"%s_stops\", self::DB_PREFIX));\r\n $Insert->values($placeData);\r\n $selectString = $this->db->getSqlStringForSqlObject($Insert);\r\n $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n }\r\n \r\n $placeData['distance'] = vincentyGreatCircleDistance($row['result']['lat'], $row['result']['lon'], $latitude, $longitude);\r\n $placeData['provider'] = $this->provider;\r\n \r\n if ($placeData['distance'] <= 10000) { // Limit results to 10km from provided lat/lon\r\n $return[] = $placeData;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return $return;\r\n }",
"function printClosest($res, $curLat, $curLon) {\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n // real output inc!\n \n while ($row = $res->fetch_assoc()) { \n echo '<div>';\n echo '<p>Origin: <span id=\"originLat\">'.$curLat.'</span> , \n <span id=\"originLon\">'.$curLon.'</span> </br> >>> ';\n echo 'Destination: <span id=\"destLat\">' .$row['latitude']. '</span> , \n <span id=\"destLon\">' .$row['longitude']. '</span></br></p>';\n echo '<p id = \"name\">' .$row['name']. '</p>';\n echo '<p>Rating: ' .$row['rating']. '/5 ';\n echo 'Cleanliness: ' .$row['clean']. '/5</p>';\n echo '<p>The bathroom has: ';\n if ($row['purchase']) {\n echo 'purchase required, ';\n }\n if ($row['bidet']) {\n echo 'a bidet, ';\n }\n if ($row['squat']) {\n echo 'a squat toilet, '; \n }\n if ($row['tpStash']) {\n echo 'ample toilet paper, ';\n }\n if ($row['soap']) {\n echo 'soap';\n }\n echo '</p>';\n echo '</div>';\n }\n}",
"function nearbysearch($lat, $lng, $type){\r\n\t$key = \"AIzaSyA2PDrfTTbXNZKOn15K-VbWgLfdTevM3qw\";\r\n\t$url = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\".$lat.\",\".$lng.\"&radius=500&type=\".urlencode($type).\"&key=\" . $key;\r\n\t$json = file_get_contents($url);\r\n\treturn $json;\r\n}",
"function get_lat_long($address){\r\n\t$API_KEY = 'AIzaSyC70LnMBiqyXcmpnQeryzq0VK12o6P5pnw';\r\n\t$address = str_replace(\" \", \"+\", $address);\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$API_KEY.\"\";\r\n\t$json = file_get_contents($url);\r\n\t$json = json_decode($json);\r\n\tif($json->status == 'ZERO_RESULTS'){\r\n\t\t$lat = 0;\r\n\t\t$long = 0; \t\r\n\t}else{\r\n\t\t$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n\t\t$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\t\r\n\t}\r\n\t\r\n\t$location = [$lat,$long];\r\n\treturn $location;\r\n}",
"public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }",
"public function weatherLocation() {\n\t\treturn $this->get('PLZ');\n\t}",
"function get_wheather_data_rounded_off($city)\n {\n $config = \\Drupal::config('weather.settings');\n $appid= $config->get('appid');\n $client = new Client();\n $response = $client->request('GET', 'https://samples.openweathermap.org/data/2.5/weather?q='.$city.'&appid='.$appid);\n $res = Json::decode($response->getBody());\n $temp_min = ceil($res['main']['temp_min']);\n $temp_max = ceil($res['main']['temp_max']);\n $pressure = ceil($res['main']['pressure']);\n $humidity = ceil($res['main']['humidity']);\n $speed = ceil($res['wind']['speed']);\n //this only for debugging purpose if whether it is rounded off or not\n \\Drupal::logger('my_module')->notice(\"temp min:\".$temp_min.\" temp max:\".$temp_max.\" pressure:\".$pressure.\" humidity:\".$humidity.\" speed:\".$speed);\n return array(\n '#temp_min' => $temp_min,\n '#temp_max' => $temp_max,\n '#pressure' => $pressure,\n '#humidity' => $humidity,\n '#wind' => $speed,\n );\n }",
"function get_coordinates($object, $field_name, $request) {\n\tglobal $wpdb;\n\t$location = $wpdb->get_row('SELECT wp_geo_mashup_locations.lat, wp_geo_mashup_locations.lng FROM wp_geo_mashup_locations INNER JOIN wp_geo_mashup_location_relationships ON wp_geo_mashup_locations.id = wp_geo_mashup_location_relationships.location_id\nWHERE wp_geo_mashup_location_relationships.object_id = ' . $object[\"id\"]);\n\tif ($location) {\n\t\treturn $location->lat . \",\" . $location->lng;\n\t} else {\n\t\treturn null;\n\t}\n}",
"public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }",
"function getCoordonnees($adresse){\n $apiKey = \"000824788445984525451:fkamkqgo6se\";//Indiquez ici votre clé Google maps !\n $url = \"http://maps.google.com/maps/geo?q=\".urlencode($adresse).\"&output=csv&key=\".$apiKey;\n\n $csv = file($url);\n $donnees = explode(\",\",$csv[0]); \n\t$t = array($donnees[2],$donnees[3]);\n\t\n return $t;\n\t}",
"function getCoordonnees($adresse){\n $apiKey = \"000824788445984525451:fkamkqgo6se\";//Indiquez ici votre clé Google maps !\n $url = \"http://maps.google.com/maps/geo?q=\".urlencode($adresse).\"&output=csv&key=\".$apiKey;\n\n $csv = file($url);\n $donnees = explode(\",\",$csv[0]); \n\t$t = array($donnees[2],$donnees[3]);\n\t\n return $t;\n\t}",
"function check_geolocation($nameofgeo){\n\t$url = \"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\".str_replace(\" \",\"%\",$nameofgeo).\"&inputtype=textquery&fields=photos,formatted_address,name&locationbias=circle:[email protected],-122.2226413&key=AIzaSyDQfsEll4lB-xdxkLXGZA7_a2rMCyVM4Ok\";\n\t$json = file_get_contents($url);\n\t$json_data = json_decode($json, true);\n\tif ($json_data[\"status\"]==\"ZERO_RESULTS\")\n\t\treturn(\"Numele introdus nu este o geolocatie!\");\n\telse{\n\t\t#print_r($json_data['candidates'][0]['name']);\n\t\t#echo \" este nume pentru-> \"; \n\t\t#echo \"<br><br>\";\n\t\treturn($json_data[\"status\"]);\n\t}\n}"
]
| [
"0.65143555",
"0.6391593",
"0.5560715",
"0.5535994",
"0.54945916",
"0.54651827",
"0.5382494",
"0.53443116",
"0.5340008",
"0.53354216",
"0.5199319",
"0.51734483",
"0.51684",
"0.515701",
"0.51220787",
"0.51204926",
"0.5112165",
"0.5102098",
"0.5099035",
"0.5032958",
"0.5014162",
"0.49928957",
"0.4991449",
"0.49901897",
"0.49786767",
"0.49701115",
"0.49694884",
"0.49665433",
"0.49665433",
"0.49559984"
]
| 0.73884773 | 0 |
getFoodTruckNearestLocationDB This method returns JSON data of all foodtrucks in a partular Latitude/Longitude retrieved from MYSQL db. | public function getFoodTruckNearestLocationDB($lat, $lon ,$countOfLoc) {
try{
$query = "
SELECT * FROM (
SELECT *,
(
(
(
acos(
sin(( $lat * pi() / 180))
*
sin(( `Latitude` * pi() / 180)) + cos(( $lat * pi() /180 ))
*
cos(( `Latitude` * pi() / 180)) * cos((( $lon - `Longitude`) * pi()/180)))
) * 180/pi()
) * 60 * 1.1515 * 1.609344
)
as distance FROM mobile_food_facility_permit
) markers order by distance asc
LIMIT $countOfLoc;";
//echo $query;
$result = $this->db->query($query);
$foodTruck = array();
if ($result->num_rows > 0) {
// output data of each row
$counter = 1;
while($row = $result->fetch_assoc()) {
$foodTrucks[] = array( "name"=>$row["Applicant"],
"address"=>$row["LocationDescription"],
"facilityType"=>$row["FacilityType"]);
if($counter++ >$countOfLoc) break;
}
}
} catch (Exception $e) {
return json_encode(array("error"=>"true","description"=>"Exception"));
}
return json_encode($foodTrucks);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFoodTruckNearestLocation($lat, $lon ,$countOfLoc) {\r\n try {\r\n $rows = array_map('str_getcsv', file('../Mobile_Food_Facility_Permit.csv'));\r\n $header = array_shift($rows);\r\n $csv = array();\r\n $counter = 1;\r\n $myJSON = array();\r\n foreach($rows as $row) {\r\n $a = $lat - $row[14];\r\n $b = $lon - $row[15];\r\n $distance = sqrt(($a**2) + ($b**2));\r\n $distances[$row[0]] = $distance;\r\n $array[$row[0]] = $row;\r\n $csv[$row[0]] = array_combine($header, $row);\r\n }\r\n asort($distances);\r\n $counter = 1;\r\n $myJSON = array();\r\n foreach($distances as $id=>$value) {\r\n \r\n $foodTruck[] = array('name'=>$csv[$id]['Applicant'], \r\n \"address\"=>$csv[$id]['LocationDescription'],\r\n \"facilityType\"=>$csv[$id]['FacilityType']);\r\n if($counter++ >$countOfLoc) break;\r\n }\r\n } catch (Exception $e) {\r\n return json_encode(array(\"error\"=>\"true\",\"description\"=>\"Exception\"));\r\n }\r\n return json_encode($foodTruck);\r\n }",
"public function nearest()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $location = Location::getNearestLocation($lat, $lon);\n return response()->json($location);\n }",
"function requestClosest($tempLoc, $curLat, $curLon) {\n global $mysqli;\n global $toiletDB;\n \n $revised = $mysqli->prepare(\"SELECT * FROM $toiletDB WHERE absLoc = $tempLoc\");\n $revised->execute();\n $res = $revised->get_result();\n \n printClosest($res, $curLat, $curLon);\n \n $res->close(); \n}",
"public function find($postcode){\n $inputCoordinates =$this->getCoordinates($postcode);\n\n if(!is_array($inputCoordinates))\n return $inputCoordinates;\n //Uses updateCoordinates to check if there are any new coffeedrop locations and add their lat and lon to db\n $dbpostcodes = $this->updateCoordinates();\n $distances = [];\n foreach ($dbpostcodes as $location) {\n //calculate the distances between the input and all db locations\n $distance = $this->getDistanceBetweenTwoPoints($inputCoordinates,array('latitude' => $location->latitude,'longitude' => $location->longitude));\n $distances[$location->postcode] = $distance;\n }\n //compares distances\n $closestCoffeeDrop = min(array_keys($distances, min($distances)));\n\n $closestCoffeeDropInfo = CoffeeDrop::where('postcode', $closestCoffeeDrop)->first();\n return response()->json(['information' => $closestCoffeeDropInfo]);\n }",
"function generateFullPath() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = true;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n// echo \"getting directions with \"\n// .implode(\",\",$currentLatLong)\n// .\" and \"\n// .implode(\",\",$previousLatLong)\n// .\" <br />\";\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n //echo \"Got mq result <br />\";\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }else{\n $error_msg.=\"Failed to create all legs of trip from MQ api. <br />\";\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}",
"function generateFullPathWithGoogle() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = false;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n \n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}",
"function updateFoodTruckLocation($foodTruckID, $oldLat, $oldLong, $newLat, $newLong){\n include('../db.php');\n $query = \"SELECT * FROM food_truck WHERE foodtruckid=$foodTruckID AND latitude=$oldLat AND longitude=$oldLong\";\n $results = $db->query($query);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, test query failed.\";\n exit();\n }\n $num_query_results = $results->num_rows;\n if ($num_query_results == 0){\n printf(\"Error, No matching food trucks found. From query: id: %s oldLat: %s oldLong: %s\",\n $foodTruckID, $oldLat, $oldLong);\n exit();\n }\n // food truck info is valid, update it with the new lat and long values\n $updateQuery = \"UPDATE food_truck SET latitude=$newLat, longitude=$newLong WHERE foodtruckid=$foodTruckID\";\n $results = $db->query($updateQuery);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, update query failed.\";\n exit();\n }\n $json[] = [\n 'message' => \"Food Truck location successfully updated.\",\n ];\n header('Content-Type: application/json');\n echo json_encode($json, JSON_PRETTY_PRINT);\n $db->close();\n}",
"public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"public-disorder-weapons\");\n\t\t\n\t\treturn $rate;\n\t\t}",
"public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"drugs\");\n\t\t\n\t\treturn $rate;\n\t\t}",
"public function retrive_nearby_locations(Request $request){\n\n $distance=100;\n $latitude=$request->latitude;\n $longitude=$request->longitude;\n $images=array();\n $result=array();\n\n /*echo 'SELECT locations.*,schools.*,school_images.image FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)';\n die();*/\n $results=DB::select(DB::raw('SELECT locations.*,schools.school_name,schools.id as school_id FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)'));\n\n $count=count($results);\n \n if($count > 8){\n $count = 8;\n }\n\n for($i=0; $i<$count; $i++){\n $result[]=$results[$i];\n }\n\n for($i=0; $i<$count; $i++){\n $images[$i]=$result[$i]->school_id;\n\n $images[$i]=School_image::where('school_id','=',$images[$i])->first();\n if(count($images[$i])){\n $images[$i]=$images[$i]->image;\n }else{\n $images[$i]=null;\n }\n }\n // print_r($images);\n // die();\n\n return response()->json(array(\n 'results' => $result,\n 'images' => $images\n ) ); \n }",
"public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }",
"function getBikeParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_bike_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}",
"function getCarParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_car_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}",
"function shopsLatLongSelect($db) {\n $query = \"SELECT id_shop, name_shop, lat_shop, long_shop, description_shop FROM shop ORDER BY lat_shop ASC;\";\n return mysqli_query($db, $query);\n}",
"public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"burglary\");\n\t\t\n\t\treturn $rate;\n\t\t}",
"private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }",
"public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"violent-crime\");\n\t\t\n\t\treturn $rate;\n\t\t}",
"public function getPlaces();",
"public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"all-crime\");\n\t\t\n\t\treturn $rate;\n\t\t}",
"function queryAll() {\n\t$sql = \"select postcode,place_name,latitude,longitude FROM geo ORDER BY postcode\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->query($sql); \n\t\t$geoList = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t$db = null;\n\t\techo '{\"geo\": ' . json_encode($geoList) . '}';\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}",
"function queryPostCodeNear($lat,$long) {\n\t\n\t$sql = \"SELECT postcode,place_name,latitude,longitude FROM geo WHERE latitude='$lat' and longitude='$long'\";\n\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$geoList = $stmt->fetchObject(); \n\t\t$db = null;\n\t\techo json_encode($geoList); \n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}",
"public function StopsNearLocation($latitude = null, $longitude = null) {\r\n if ($latitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no latitude given\");\r\n }\r\n \r\n if ($longitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no longitude given\");\r\n }\r\n \r\n $parameters = array(\r\n \"latitude\" => $latitude,\r\n \"longitude\" => $longitude\r\n );\r\n \r\n $return = array();\r\n \r\n foreach ($this->fetch(\"nearme\", $parameters) as $row) {\r\n $row['result']['location_name'] = trim($row['result']['location_name']);\r\n \r\n if ($row['result']['transport_type'] == \"train\" || preg_match(\"@Railway@i\", $row['result']['location_name'])) {\r\n $placeData = array(\r\n \"stop_id\" => $row['result']['stop_id'],\r\n \"stop_name\" => $row['result']['location_name'],\r\n \"stop_lat\" => $row['result']['lat'],\r\n \"stop_lon\" => $row['result']['lon'],\r\n \"wheelchair_boarding\" => 0,\r\n \"location_type\" => 1\r\n );\r\n \r\n /**\r\n * Check if this is stored in the database, and add it if it's missing\r\n */\r\n \r\n if (!in_array($row['result']['location_name'], $this->ignore_stops) && \r\n $row['result']['stop_id'] < 10000 &&\r\n !preg_match(\"@#([0-9]{0,3})@\", $row['result']['location_name'])\r\n ) {\r\n $query = sprintf(\"SELECT stop_id FROM %s_stops WHERE stop_id = %d LIMIT 1\", self::DB_PREFIX, $row['result']['stop_id']); \r\n $result = $this->adapter->query($query, Adapter::QUERY_MODE_EXECUTE); \r\n \r\n if ($result->count() === 0) {\r\n $Insert = $this->db->insert(sprintf(\"%s_stops\", self::DB_PREFIX));\r\n $Insert->values($placeData);\r\n $selectString = $this->db->getSqlStringForSqlObject($Insert);\r\n $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n }\r\n \r\n $placeData['distance'] = vincentyGreatCircleDistance($row['result']['lat'], $row['result']['lon'], $latitude, $longitude);\r\n $placeData['provider'] = $this->provider;\r\n \r\n if ($placeData['distance'] <= 10000) { // Limit results to 10km from provided lat/lon\r\n $return[] = $placeData;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return $return;\r\n }",
"function GetLocations(){\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare(\"SELECT location_id, name FROM location\");\n\t$query->execute();\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}",
"function downloadLatLongByMlNum($ml_num,$table_name){\n $latLongExists = self::where('ml_num',$ml_num)->exists();\n if(!$latLongExists){\n $apikey = env('GOOGLE_MAP_APIKEY');\n $table_type = \"\";\n if($table_name == 'vow_residential_properties'){\n $table_type = 'residential';\n }elseif($table_name=='vow_condo_properties'){\n $table_type = 'condo';\n }\n\n $raw_query = \"Select property_table.ml_num,property_table.addr,property_table.municipality,property_table.zip,property_table.county,property_table.area from $table_name as property_table where property_table.ml_num ='$ml_num' and property_table.area in ('Toronto','York','Durham','Halton','Peel') \";\n $results = DB::select(DB::raw($raw_query));\n \n foreach($results as $property) {\n \n $add = $property->addr;\n $municipality = $property->municipality;\n $zip = $property->zip;\n $county = $property->county;\n $area = $property->area;\n $ml_num= $property->ml_num;\n \n $full_address = $add.' '.$municipality.' '.$area.' '.$county.' '.$zip;\n \n //Formatted address\n $formattedAddr = $full_address;\n \n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($formattedAddr).\"&key=\".$apikey.\"\";\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $responseJson = curl_exec($ch);\n curl_close($ch);\n $api_response = json_decode($responseJson);\n $latitude = '';\n $longitude = '';\n \n /** Check if api responce is exit or not ***/\n if ($api_response->status == 'OK') {\n $latitude = $api_response->results[0]->geometry->location->lat;\n $longitude = $api_response->results[0]->geometry->location->lng;\n \n } elseif($api_response->status == 'ZERO_RESULTS') {\n $latitude = '';\n $longitude = '';\n }\n \n try {\n //insert query for lat long\n $latLongObj = new LatLong();\n $latLongObj->ml_num = $ml_num;\n $latLongObj->longitude = !empty($longitude)?$longitude:0.00;\n $latLongObj->latitude = !empty($latitude)?$latitude:0.00;\n $latLongObj->table_type = $table_type;\n \\Log::info(\"Downloaded latLongs for $ml_num \");\n \\Log::info(\"Api url for $ml_num is $url\");\n \\Log::info(\"Full Address for $ml_num is $full_address and lat=$latitude and lng=$longitude\");\n return $latLongObj->save() ;\n \n } catch (Exception $e) {\n \\Log::info(\"Downloaded latLongs failed $ml_num \");\n }\n \n }\n }\n return false;\n }",
"function getClosestSales($lat, $lng, $index, $size = 5) {\n // NOTE: Limit can not be dynamic and must be a number\n $db_conn = SqlManager::getInstance();\n $sql = \"SELECT *,SQRT(POWER(? - p.lat, 2) + POWER(? - p.lng,2)) AS Distance FROM places AS p\n\t JOIN garage_sales_places AS g_fk ON p.place_id = g_fk.place_fk_id\n JOIN (SELECT g.gsale_id FROM garage_sales AS g WHERE DATE(RIGHT(g.dates, 10)) >= CURRENT_DATE) g ON g.gsale_id = g_fk.garage_sale_fk_id\n WHERE p.place_id > ? ORDER BY Distance ASC LIMIT \" . $size;\n $params = array($lat, $lng, $index);\n $result = $db_conn->query($sql,$params);\n if (!$result->getError()) {\n return $result->getResult();\n }\n}",
"public function get_locations() {\n $this->db->select('*');\n $this->db->from('locations');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }",
"public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }",
"public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }",
"function getAllLatLong($lat,$long,$distance=6){\n\t\t\t\t\n\t\t$sql =\"SELECT e.event_id,e.event_name,e.event_type,u.user_id,u.user_name,\n\t\t\t\tu.image as UserImage,e.event_date,e.event_time,e.description,e.latitude,\n\t\t\t\te.longitude,ef.status,\n\t\t\t\t((ACOS(SIN('\".$lat.\"' * PI() / 180) * SIN(e.latitude * PI() / 180) \n\t\t\t\t+ COS('\".$lat.\"' * PI() / 180) * COS(e.latitude * PI() / 180) \n\t\t\t\t* COS(('\".$long.\"' - e.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) \n\t\t\t\tAS `distance` from `events` as e,event_friends as ef\n\t\t\t\t\n\t\t\t\tleft join users as u on ef.user_id=u.user_id\n\t\t\t\t\n\t\t\t\twhere e.event_id=ef.event_id and e.create_type = 'events'\n\t\t\t\tand (ef.status != 'reject')\n\t\t\t\tgroup by e.event_id \n\t\t\t\thaving distance<=$distance order by distance asc\";\n\n\n\t\t$query = $this->db->query($sql);\t\n\t\t$data = $query->result_array();\n\t\treturn $data;\n\t\t\n\t}",
"function findClosest($res, $curLat, $curLon) {\n // REMEMBER TO CHANGE CURLAT1 to CURLAT and CURLON1 to CURLON\n // originLan, originLon, destLan, destLon\n\n $absLoc = abs($curLat) + abs($curLon);\n\n\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n while ($row = $res->fetch_assoc()) {\n $dbAbsLoc[] =floatval($row['absLoc']);\n }\n\n // locate the nearest absLoc point\n $i = 0;\n do {\n $tempLoc = abs($absLoc - $dbAbsLoc[$i]); \n $i++;\n } while ($i < count($dbAbsLoc) && $tempLoc > (abs($absLoc - $dbAbsLoc[$i])));\n $tempLoc = $dbAbsLoc[$i-1];\n requestClosest($tempLoc, $curLat, $curLon);\n}"
]
| [
"0.62735647",
"0.6116956",
"0.59083396",
"0.5695926",
"0.55033654",
"0.5340375",
"0.5322224",
"0.5300415",
"0.52903897",
"0.5273668",
"0.5233395",
"0.5198685",
"0.51730955",
"0.51668566",
"0.5162884",
"0.5161274",
"0.5120996",
"0.51192355",
"0.51150507",
"0.5101921",
"0.50933003",
"0.5083452",
"0.5071404",
"0.50683755",
"0.5051225",
"0.50358194",
"0.5032002",
"0.50308204",
"0.50228614",
"0.5018632"
]
| 0.74327886 | 0 |
$sql = 'select distinct query from Reports.Reports where id in (' . $pendingReports . ')'; | function fetchStoredQueries($pendingReports){
$sql = 'select distinct task from reporting.tasks';
$this->database->query($sql);
$results = $this->database->resultSet();
return $results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_ids_for_in($sql,$col_name='id') {\n\t$rows = fetchAll($sql);\n\t$ids = array();\n\tforeach($rows AS $row) {\n\t\t$ids[] = $row[$col_name];\n\t}\n\tif (count($ids) == 0) $ids[] = '0';\n\treturn join(',',$ids);\n}",
"public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}",
"public function getSystemIds()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname AND systemid != :systemid\";\r\n\r\n return $query_string;\r\n\r\n}",
"function uploadedreportlist(){\r\n $select = \"SELECT * FROM reports ORDER BY date_published DESC\";\r\n global $pdo;\r\n $res = $pdo->query($select);\r\n return $res->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"function checkIDList($table, $fixedQuery, &$IDList)\n{\n\tglobal $sitePosition;\n\n\t$IDs = array();\n\t$rs = query('Select `ID` from `' . $sitePosition . '.' . $table . '` where ' . ($fixedQuery != '' ? ('(' . $fixedQuery . ') and ') : '') . '`ID` in (' . $IDList . ')', false);\n\twhile(true)\n\t{\n\t\t$rsInfo = fetchRow($rs);\n\t\tif($rsInfo === null) break;\n\t\t$IDs[] = $rsInfo[0];\n\t}\n\tfreeResult($rs);\n\t$IDList = implode(',', $IDs);\n}",
"public function getSystemTypeIds()\r\n{\r\n $query_string = \"SELECT systemtypeid FROM system_type \";\r\n $query_string .= \"WHERE systemtypename = :systemtypename AND systemtypeid != :systemtypeid\";\r\n\r\n return $query_string;\r\n}",
"protected function getListQuery()\r\n {\r\n $trackingDate = new Date($this->getState('trackingDate', 'now'));\r\n $db = $this->getDbo();\r\n \r\n $query = $db->getQuery(true);\r\n $query->select('*');\r\n $query->from($db->qn('#__ktbtracker_tracking'));\r\n $query->where($db->qn('userid').' = '.(int) Factory::getUser()->get('id'));\r\n $query->where($db->qn('tracking_date').' = '.$db->quote($trackingDate->format('Y-m-d')));\r\n \r\n return $query;\r\n }",
"function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t$output[] = $row['lead_id'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->display(\"Query failed: $query\" . mysql_error($this->conn));\n\t\t}\n\n\t\treturn $output;\n\t}",
"private function getDatasets($datasets) {\n $datasets_id = collect($datasets)->implode('id', ', ');\n $sql = \" AND t1.datasets_id\";\n\n return $sql .= ((count($datasets) === 1)) ? \" = $datasets_id\" : \" IN ($datasets_id)\";\n }",
"function edd_pup_queue_emails() {\r\n\r\n\t$email_list = array();\r\n\tglobal $wpdb;\r\n\r\n\t$query = \"SELECT DISTINCT email_id FROM $wpdb->edd_pup_queue WHERE sent = 0\";\r\n\r\n\t$emails = $wpdb->get_results( $query , ARRAY_A );\r\n\r\n\tforeach ( $emails as $email ) {\r\n\t\t$email_list[] = $email['email_id'];\r\n\t}\r\n\r\n\treturn $email_list;\r\n}",
"function get_internship_list() {\n $conn = db_connect();\n $sql = \"SELECT DISTINCT *\n FROM internship_list;\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) {\n $output[] = $row;\n }\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n\n return $output;\n}",
"function statistics_client_query($query) {\n // TODO: regexp instead of normal comparison\n $result = db_query('SELECT id, query FROM {statistics_client_query_whitelist}');\n $flag = FALSE;\n foreach ($result as $record) {\n if ($query === $record->query) {\n $flag = TRUE;\n }\n }\n if (!$flag) {\n return array();\n }\n $tmp_res = db_query($query);\n $result = array();\n foreach ($tmp_res as $record) {\n $result[] = $record;\n }\n return $result;\n}",
"function getViewableReports($conn){\n\t$sql = \"SELECT PlanId, plan.Name AS PlanName, CompanyName FROM plan JOIN client ON plan.ClientId = client.ClientId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}",
"function getPagesQuery($table=' tx_tdcalendar_events'){\n\t\t$pages = $this->pidList;\n\t\tif(!$pages)return;\n\t\treturn ' AND '.$table.'.pid IN ('.$pages.') ';\n\t}",
"function getProductFromArray($itemsIds) {\r\n $strIds = implode($itemsIds, ', ');\r\n $sql = \"SELECT * FROM products WHERE id in ({$strIds})\";\r\n\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}",
"function get_all_reports()\r\n {\r\n return $this->db->get('reports')->result_array();\r\n }",
"function get_internship_detail($id) {\n $conn = db_connect();\n $sql = \"SELECT DISTINCT *\n FROM internship_detail\n WHERE InternshipId = $id\n LIMIT 1;\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) {\n $output[] = $row;\n }\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n\n return $output;\n}",
"function BuildQuery($ASSETS_TABLE, $assetid)\n{\n $query = \"UPDATE $ASSETS_TABLE SET Equi_Assigned_Pats_IDs = NULL, Equi_Loaned = NULL, Equi_Return_due = NULL WHERE Equi_ID=$assetid\";\n return $query;\n}",
"function getViewablePausedReports($conn){\n\t$sql = \"SELECT temporaryreport.PlanId, DatePaused FROM temporaryreport JOIN plan ON temporaryreport.PlanId = plan.PlanId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}",
"function getAllSiteList()\r\n{\r\n $sql = 'select site.id, site.company_id, company.display_name as company_name, site.name, site.phone, site.location from site inner join company on site.company_id=company.id where 1=1 order by company_id';\r\n $result = mysql_query($sql);\r\n return queryResultToArray($result);\r\n}",
"public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }",
"function get_reports($report_id)\r\n {\r\n return $this->db->get_where('reports',array('report_id'=>$report_id))->row_array();\r\n }",
"function suppr_client($bdd) {\n $reponse = $bdd->query('DELETE FROM users\n WHERE users.id \n NOT IN (\n SELECT orders.Users_id\n FROM orders\n )\n ');\n}",
"function sql_query_issplaninscr ($q20_planilha, $campos = \"*\") {\n\t \t\n\t \t$sql = \"select \";\n\t \tif ( $campos != \"*\") {\n\t \t\t\n\t \t\t$campos_sql = split(\"#\",$campos);\n\t \t\t$virgula = \"\";\n\t \t\tfor($i=0;$i<sizeof($campos_sql);$i++){\n\t \t\t\t$sql .= $virgula.$campos_sql[$i];\n\t \t\t\t$virgula = \",\";\n\t \t\t}\n\t \t} else { \n\t \t\t$sql .= $campos;\n\t \t}\n\t \t\n\t \t$sql .= \" from issplan\";\n\t \t$sql .= \" \tleft join issplaninscr on q24_planilha = q20_planilha\";\n\t \t$sql .= \" left join issplannumpre on q32_planilha = q20_planilha\";\n\t \t$sql .= \" where issplan.q20_planilha = {$q20_planilha}\";\n\n\t \treturn $sql;\n\t }",
"function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }",
"protected function getListQuery() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\n\t\t$query->select('COUNT(DISTINCT '.$db->quoteName('a.id').') count');\n\t\t$query->select($db->quoteName(array('a.category_id', 'a.type')));\n\t\t$query->from($db->quoteName('#__gtsms_messages', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.msisdn_id').' > 0');\n\t\t$query->where($db->quoteName('a.modem').' IS NOT NULL');\n\t\t$query->where('('.$db->quoteName('a.modem').') <> \"\"');\n\t\t$query->where($db->quoteName('a.message').' IS NOT NULL');\n\t\t$query->where('('.$db->quoteName('a.message').') <> \"\"');\n\n\t\t$query->group($db->quoteName('a.category_id'));\n\t\t$query->group($db->quoteName('a.type'));\n\n\t\t//echo nl2br(str_replace('#__','eburo_',$query));\n\n\t\treturn $query;\n\t}",
"function get_all_supervisors($conn, $table) {\n $stmt = \"SELECT DISTINCT(supervisor) FROM \" . $table . \" ORDER BY supervisor\";\n return exec_query($conn, $stmt);\n}",
"function dbQueryStudentIdList($ids)\n {\n $where = \" WHERE id IN (\" . arrayToDBString($ids) . \")\";\n $rs = $this->_getFullList($where);\n return $rs;\n }",
"function get_smsstudents_by_ids($inputarray = array()) {\n $sql = \"select * from student_records where id in(\" . implode(',', $inputarray) . \")\";\n //log_message('error', 'get_smsstudents_by_ids '.$sql);\t\t\n $res = $this->db->query($sql);\n return $res->result();\n }",
"function buldSqlQuery($arr, $form) {\r\n\t$formId = getFormId($form);\r\n\r\n\t$sql = \"SELECT count(b.id) AS vote, b.description AS choice, b.id AS choice_id, c.description AS question, c.id AS questionId, d.description AS formName FROM survey_data AS a LEFT JOIN choices AS b ON a.choice_id = b.id LEFT JOIN questions AS c ON c.id = b.question_id LEFT JOIN forms AS d ON c.form_id = d.id WHERE c.form_id=$formId AND (\";\r\n\r\n\tforeach ($arr as $key => $value) {\r\n\t\t$sql .= \"(c.question=\" . $value . \" AND c.form_id=\" . $formId . ($key<(sizeof($arr)-1)?\") OR \":\")\");\r\n\t}\r\n\r\n\t$sql .= \") GROUP BY b.id\";\r\n\treturn $sql;\r\n}"
]
| [
"0.5831332",
"0.58158416",
"0.5757618",
"0.5651377",
"0.56060964",
"0.560527",
"0.54921037",
"0.5489922",
"0.5480918",
"0.5472621",
"0.5375201",
"0.53651655",
"0.5321976",
"0.5299881",
"0.5294847",
"0.52901036",
"0.52606684",
"0.52389485",
"0.52328706",
"0.52324647",
"0.5231207",
"0.52151614",
"0.52034545",
"0.52017164",
"0.5181891",
"0.51728964",
"0.51686734",
"0.51664066",
"0.51663405",
"0.51427317"
]
| 0.6589 | 0 |
Test login error messagebag. | public function testLoginError()
{
$response = $this->post('/login', ['email' => '[email protected]']);
$response->assertSessionHasErrors(['password']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLoginFailedFunctionality()\n {\n $this->expectOutputString(\"err_login_failed\");\n $email = '[email protected]';\n $ctrl = new Controller();\n // Give it the wrong password\n $ctrl->login($email,'wrong password');\n\n }",
"public function test_fail_login() {\n $_POST = array('name' => \"customer2\", 'password' => \"123:\");\n $expected = json_encode(array(\"status\" => 0, \"message\" => \"Username or password is incorrect\"));\n $this->expectOutputString($expected);\n $this->object->main();\n }",
"private function loginFailed()\n {\n //Login failed...\n }",
"public function testCantLoginWithInvalidCredentials()\n {\n // arrange \n $user = User::factory()->create();\n\n // act\n $response = $this->post(\"/login\", [\n \"email\" => $user->email,\n \"password\" => \"invalidpassword\"\n ]);\n\n // assert\n $response->assertStatus(302);\n $response->assertSessionHas(\"errors\");\n\n $messages = session(\"errors\")->getMessages();\n $this->assertEquals($messages[\"email\"][0], \"These credentials do not match our records.\");\n // dd($messages);\n }",
"public function testProcessLoginFailed(){\n\n Sentinel::disableCheckpoints();\n\n $credentials = [\n 'email' => '[email protected]',\n 'password' => 'passwords',\n ];\n\n $response = $this->post(route('login.action', $credentials));\n\n $response->assertSessionHas('failed');\n $response->assertRedirect(route('login.form'));\n }",
"public function testLoginValidationLog() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'aaaaa', 'password' => ''])\n ->see('Please enter a valid password.');\n }",
"public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }",
"public function testInvalidLogin()\n {\n $response = $this->post('admin', [\n 'email' => '[email protected]',\n 'password' => 'pass',\n ], [\n 'HTTP_REFERER' => url('admin'), // So it redirects back to self\n ]);\n\n // Check that user is redirected back to login but there are errors\n $response->assertRedirect('admin');\n $response->assertSessionHasErrors();\n }",
"public function testLoginValid(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => 'Wrong'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertTrue($validLogin);\r\n\t\t}",
"public function testLoginValidationFailPassword()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['email' => 'email'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"password\":[\"The password field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }",
"public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }",
"public function testLoginname(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}",
"public function testLoginFailure()\n {\n $mock = new MockHandler([\n new Response(400, [], '{\"error\": \"login failure\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['email' => '[email protected]', 'password' => 'password'], $this->headers)\n ->assertStatus(400)\n ->assertSeeText('login failure');\n\n }",
"public function testLoginNoCredentials()\n {\n $response = $this->post($this->getLoginSubmitUrl());\n $response->assertSessionHasErrors([\n 'email', 'password'\n ]);\n }",
"public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }",
"public function testWrongUser(){\n Session::flush();\n $user = $this->postuser(array('username'=>'XxX','password'=>'XxX'));\n $status_message = $this->getJsonResponse();\n $this->assertResponseStatus('401');\n $this->assertTrue($status_message['message'] == 'login refused');\n }",
"public function testFailLogin()\n {\n $response = $this->call('GET', '/api/v1/[email protected]&password=12345');\n \n $this->assertEquals(401, $response->status());\n }",
"public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }",
"public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }",
"public function testLogin() {\n $this->assert_title(\"Login\");\n\n //Failed login\n testMacros::login($this->driver, \"[email protected]\", \"passwordwrong\");\n $this->assert_title(\"Login\");\n\n //Successful Login\n testMacros::login($this->driver, \"[email protected]\", \"password1\");\n $this->assert_title(\"CheckinChildren\");\n\n //Logout\n $this->get_element(\"name=profile\")->click();\n $this->get_element(\"name=logout\")->click();\n }",
"public function testLoginFail()\n {\n $this->createAdmin();\n\n $response = $this->post(\n route('login'),\n [\n 'email' => $this->admin_data['email'],\n 'password' => '123'\n ]\n );\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n\n $response = $this->post(\n route('login'),\n [\n 'email' => '[email protected]',\n 'password' => '123456'\n ]\n );\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }",
"public function testLoginWithoutUserName() : void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userFake[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserName' );\n $this->assertCount(2, $res, 'testLoginWithoutUserName' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserName' );\n }",
"public function testInvalidUserLogin()\n {\n $this->withoutExceptionHandling();\n\n $credentials = [\n \"email\" => \"[email protected]\",\n \"password\" => \"1111\",\n ];\n\n $response = $this->post(route(\"login.attempt\"),$credentials);\n\n $response->assertRedirect(route(\"home\"));\n $response->assertSessionHas(\"error\");\n }",
"public function testMustEnterUserNameAndPassword()\n {\n $response = $this->post(route('auth.authenticate'));\n\n $response->assertSessionHasErrors(\n [\n 'userName' => 'user name không được để trống.',\n 'password' => 'password không được để trống.'\n ]\n );\n $response->assertStatus(Response::HTTP_FOUND);\n }",
"public function testLogin() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userA[\"pass\"], [ \"user_agent\" => $this->userA[\"getBrowserName\"], \"time\" => $this->userA[\"getCurrentDateTime\"], \"ip\" => $this->userA[\"getReqIp\"] ] );\n\n $this->assertIsArray( $res, 'testLogin' );\n $this->assertArrayHasKey('status', $res, 'testLogin' );\n $this->assertArrayHasKey('msg', $res, 'testLogin' );\n $this->assertArrayHasKey('uid', $res, 'testLogin' );\n $this->assertArrayHasKey('name', $res, 'testLogin' );\n $this->assertArrayHasKey('token', $res, 'testLogin' );\n $this->assertCount(5, $res, 'testLogin' );\n $this->assertEquals( [ \"status\" => true, \"msg\" => \"Welcome \".$this->userA[\"name\"], \"uid\" => \"112387623\", \"name\" => \"test5\", \"token\" => $res[\"token\"] ], $res, 'testLogin' );\n }",
"function ft_hook_loginfail() {}",
"public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }",
"public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }",
"public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }",
"public function testLoginSubmissionWrongEmailAndPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }"
]
| [
"0.72976077",
"0.7211856",
"0.72001415",
"0.7194656",
"0.7149142",
"0.6939885",
"0.6877418",
"0.67970085",
"0.6767706",
"0.6703715",
"0.6697657",
"0.668701",
"0.66855484",
"0.6662124",
"0.66285294",
"0.6624921",
"0.66187966",
"0.66072",
"0.6591176",
"0.65838015",
"0.6552334",
"0.6533904",
"0.65316236",
"0.65014124",
"0.648639",
"0.64825374",
"0.6468337",
"0.645761",
"0.6457074",
"0.64510715"
]
| 0.7768425 | 0 |
If location exists, it gets updated by IP address. Otherwise new row is inserted | private function storeLocation(GeoLocationItem $location)
{
try {
$row = DB::table(IpInfoLocation::TABLE)
->where('ip', $location->ipAddress)
->first();
// Dunno why, but updateOrInsert call just throws an undefined method error.
// Probably something October specific
if ($row) {
return DB::table(IpInfoLocation::TABLE)
->where('ip', $location->ipAddress)
->update([
'ip' => $location->ipAddress,
'country_code' => $location->countryCode,
'country' => $location->countryName,
'state' => $location->regionName,
'city' => $location->cityName,
'zip' => $location->zipCode,
'latitude' => (float)$location->latitude,
'longitude' => (float)$location->longitude,
'timezone' => $location->timeZone,
'updated_at' => Carbon::now(),
]);
}
return DB::table(IpInfoLocation::TABLE)
->insert([
'ip' => $location->ipAddress,
'country_code' => $location->countryCode,
'country' => $location->countryName,
'state' => $location->regionName,
'city' => $location->cityName,
'zip' => $location->zipCode,
'latitude' => (float)$location->latitude,
'longitude' => (float)$location->longitude,
'timezone' => $location->timeZone,
'updated_at' => Carbon::now(),
]);
} catch (PDOException $e) {
// Concurrency problem, two requests at the same time try to insert the same value
// Can just be ignored
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateLocation()\n {\n $core = Core::dbOpen();\n $sql = \"UPDATE program_locations SET city = :city, state = :state, zip = :zip\n WHERE locationID = :id\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':city', $this->city);\n $stmt->bindParam(':state', $this->state);\n $stmt->bindParam(':zip', $this->zip);\n $stmt->bindParam(':id', $this->locationID);\n \n Core::dbClose();\n \n try {\n if($stmt->execute()) {\n return true;\n }\n } catch (PDOException $e) {\n return false;\n }\n }",
"protected function updateLocations()\n {\n $this->execute(<<<SQL\nUPDATE jl_loc_location jll \n INNER JOIN jl_loc_region jlr ON jlr.id = jll.region_id\n SET jll.state_id = jlr.state_id;\nSQL\n );\n }",
"public function testUpdateValidLocation() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n\t\t// edit the Location and update it in mySQL\n\t\t$location->setLocationStreetOne($this->warZone2);\n\t\t$location->update($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoLocation = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone2);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}",
"protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }",
"public function updateWorkshopLocation()\n\t{\n\t\t\n\t\t$core = Core::dbOpen();\n\t\t\n\t\t// get workshopLocationID if exists\n\t\t$sql = \"SELECT workshopLocationID, locationID FROM workshop_location \n\t\t\t\t\t\tWHERE programID\t= :programID AND name\t= :name AND address = :address\";\n\t\t$stmt = $core->dbh->prepare($sql);\n\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t$stmt->bindParam(':name', $this->name);\n\t\t$stmt->bindParam(':address', $this->address);\n\t\t\n\t\ttry {\n\t\t\tif ( $stmt->execute() && $stmt->RowCount() > 0 ) // location exists\n\t\t\t{\n\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t$this->workshopLocationID = $row[\"workshopLocationID\"];\n\t\t\t\t\n\t\t\t\t// if the current location ID differs than what is in the location, update it\n\t\t\t\tif( $this->locationID != $row[\"locationID\"] ) {\t\t\t\t\n\t\t\t\t\t\t$sql = \"UPDATE workshop_location SET locationID = :locationID WHERE workshopLocationID = :id\";\n\t\t\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t\t\t$stmt->bindParam(':id', $this->workshopLocationID);\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse // add it\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO workshop_location (programID,name,address,locationID)\n\t\t \t \t VALUES (:programID, :name, :address, :locationID)\";\n\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t\t$stmt->bindParam(':address', $this->address);\n\t\t\t\tCore::dbClose();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif ( $stmt->execute() )\n\t\t\t\t\t\t$this->workshopLocationID = $core->dbh->lastInsertId(); \t\t\n\t\t\t\t\treturn true;\t\t\t\t\n\t\t\t\t} catch ( PDOException $e ) {\n\t\t\t\t\techo \"Add Workshop Location Failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n\t\t\techo \"Get Workshop Location ID Failed\";\n\t\t}\n\t\treturn false;\n\t}",
"public function updatelocationAction()\n {\n $userInfo = new UserInfo($_POST);\n if ($userInfo->hasIPUpdated())\n {\n $userInfo->saveIP();\n $userInfo->findLocationFromIP();\n $userInfo->saveLocation();\n }\n }",
"public function updateLocation(){\n $location = location::where('id','=','')->first();\n if (!$location){\n dump(\"location could not be updated\");\n }\n else{\n $location->location_name='';\n $location->country='';\n $location->external_code='';\n }\n }",
"function update_location($user_id,$location,$connection) \n {\n if(!empty($location))\n {\n $salt_string=\"@!\";\n $username.=$salt_string;\n $query=\"UPDATE user_details SET location='$location' WHERE user_id='$user_id' LIMIT 1\";\n $result = mysqli_query($connection,$query);\n if($result)\n return true;\n else\n return false;\n }\n else\n return true;\n }",
"function addLocation($location_details){\n\t if ($this->db->insert('pofloc',$location_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }",
"public function testUpdateInvalidLocation() {\n\t\t// create a Location, try to update it without actually updating it and watch it fail\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->update($this->getPDO());\n\t}",
"function saveIp()\n{\n global $db_lnk;\n $qry_val_arr = array(\n $_SERVER['REMOTE_ADDR']\n );\n $ip_row = executeQuery('SELECT id FROM ips WHERE ip = $1', $qry_val_arr);\n if (!$ip_row) {\n $country_id = 0;\n $_geo = array();\n if (function_exists('geoip_record_by_name')) {\n $_geo = @geoip_record_by_name($_SERVER['REMOTE_ADDR']);\n }\n if (!empty($_geo)) {\n $qry_val_arr = array(\n $_geo['country_code']\n );\n $country_row = executeQuery('SELECT id FROM countries WHERE iso_alpha2 = $1', $qry_val_arr);\n if ($country_row) {\n $country_id = $country_row['id'];\n }\n $qry_val_arr = array(\n $_geo['region']\n );\n $state_row = executeQuery('SELECT id FROM states WHERE name = $1', $qry_val_arr);\n if (!$state_row) {\n $qry_val_arr = array(\n $_geo['region'],\n $country_id\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO states (created, modified, name, country_id) VALUES (now(), now(), $1, $2) RETURNING id', $qry_val_arr);\n $state_row = pg_fetch_assoc($result);\n }\n $qry_val_arr = array(\n $_geo['city']\n );\n $city_row = executeQuery('SELECT id FROM cities WHERE name = $1', $qry_val_arr);\n if (!$city_row) {\n $qry_val_arr = array(\n $_geo['city'],\n $state_row['id'],\n $country_id,\n $_geo['latitude'],\n $_geo['longitude']\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO cities (created, modified, name, state_id, country_id, latitude, longitude) VALUES (now(), now(), $1, $2, $3, $4, $5) RETURNING id ', $qry_val_arr);\n $city_row = pg_fetch_assoc($result);\n }\n }\n $user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\n $state_id = (!empty($state_row['id'])) ? $state_row['id'] : 0;\n $city_id = (!empty($city_row['id'])) ? $city_row['id'] : 0;\n $lat = (!empty($_geo['latitude'])) ? $_geo['latitude'] : 0.00;\n $lng = (!empty($_geo['longitude'])) ? $_geo['longitude'] : 0.00;\n $qry_val_arr = array(\n $_SERVER['REMOTE_ADDR'],\n gethostbyaddr($_SERVER['REMOTE_ADDR']) ,\n $city_id,\n $state_id,\n $country_id,\n $lat,\n $lng,\n $user_agent\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO ips (created, modified, ip, host, city_id, state_id, country_id, latitude, longitude, user_agent) VALUES (now(), now(), $1, $2, $3, $4, $5, $6, $7, $8) RETURNING id', $qry_val_arr);\n $ip_row = pg_fetch_assoc($result);\n }\n return $ip_row['id'];\n}",
"public function updateEntryLocation() {\n\t\t\n\t\t//NOTE: Replace sample data with get/post/session/db\n\t\t$user_entry_id=1;\n\t\t$current_location=37;\n\t\t$prev_location=113;\n\t\t\n\t\tif($user_entry_id != ''\n\t\t\t&& $current_location != '' \n\t\t\t&& $prev_location != '' \n\t\t\t&& $prev_location != $current_location)\n\t\t{\n\t\t\t$params['location_id'] = $current_location;\n\t\t\t$where = \" user_entry_id = \".$user_entry_id;\n\t\t\t$where .= \" AND location_id = \".$prev_location;\n\t\t\treturn $this->Poc->update($params,$table_name='user_entry',$where);\t\t\t\t\n\t\t}\n\t\treturn false;\n\t}",
"public function upsert($table, $insertFieldValues, $updateFieldValues = [], $primaryKey = null);",
"function updateLocation($UserID, $LastPointX, $LastPointY,$LastUpdateTime){\n $conn = connectDB();\n $updateLocationSQL = \"UPDATE Task SET Task.LastPointX =\".$LastPointX.\", Task.LastPointY =\".$LastPointY.\", Task.LastUpdateTime = \".$LastUpdateTime.\" WHERE Task.UserID = \".$UserID.\" AND Task.Canceled = 'N';\";\n $conn->query($updateLocationSQL);\n $conn->close();\n}",
"public static function updateUserLocation() {\r\n $debug = \\Drupal::config('smart_ip.settings')->get('debug_mode');\r\n if (!$debug) {\r\n $ip = \\Drupal::request()->getClientIp();\r\n $smartIpSession = self::getSession('smart_ip');\r\n if (!isset($smartIpSession['location']['ipAddress']) || $smartIpSession['location']['ipAddress'] != $ip) {\r\n $result = self::query();\r\n self::userLocationFallback($result);\r\n /** @var \\Drupal\\smart_ip\\SmartIpLocation $location */\r\n $location = \\Drupal::service('smart_ip.smart_ip_location');\r\n $location->setData($result);\r\n $location->save();\r\n }\r\n }\r\n }",
"public function testInsertValidLocation() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoLocation = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}",
"public function testFindByIpSuccess()\n {\n $this->location->save();\n\n $location = Location::find_by_ip('111.111.111.111');\n\n $this->assertNotNull($location);\n $this->assertInstanceOf(Location::class, $location);\n $this->assertEquals($this->location->ip, $location->ip);\n $this->assertEquals($this->location->country, $location->country);\n $this->assertEquals($this->location->city, $location->city);\n }",
"function addLocation($data) {\r\n\r\n\r\n\t\t$this->query('INSERT INTO locations (`id`, `created`, `modified`, `name`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['name'] .'\");');\r\n\r\n\t}",
"public function createOrUpdate(StoreLocationRequest $request)\r\n {\r\n if ($request->has('id') && $request->has('update')) {\r\n return $this->update($request);\r\n }\r\n\r\n return $this->create($request);\r\n }",
"function update_location($longitude, $latitude, $info_id) {\r\n $query = \"Update mw_info set longitude = $longitude, \r\n latitude = $latitude\r\n , date_modified = now()\r\n where info_id = $info_id\";\r\n// print $query;\r\n// print mysql_error();\r\n return $this->query($query);\r\n }",
"public function testInsertInvalidLocation() {\n\t\t// create a Location with a non null location id and watch it fail\n\t\t$location = new Location(RootsTableTest::INVALID_KEY, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\t}",
"function updateLocation($data) {\r\n\r\n\t\t$this->query('UPDATE locations SET `modified` = CURRENT_TIMESTAMP(), `name` = \"'. $data['name'] .'\" WHERE id = '. $data['id'] .';');\r\n\r\n\t}",
"public function insert($location){\n $fields = array(\"location_name\");\n $values = array($location);\n $lastid = $this->db->insert(\"location_tabel\", $fields, $values);\n return $lastid;\n }",
"public function updateExistingLocation($request, $id)\n {\n $location = $this->deliveryLocation->where('id', $id)->first();\n if ($location) {\n $location->name = $request->name;\n $location->description = $request->description;\n $location->price = $request->price;\n $location->status = $request->status;\n if ($location->save()) {\n return 'updated';\n }\n return 'can\\'t be updated';\n }\n\n }",
"function updateLocationStatus($IDLocation)\n{\n\n $strSeparator = '\\'';\n $locUpdatedStatus = 0;\n //count how much Order in that Location\n $queryCountLoc = 'SELECT COUNT(FK_IDLoc) FROM orderedsnow WHERE FK_IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n require_once 'model/dbConnector.php';\n $locTotalOrder = executeQuerySelect($queryCountLoc);\n if ($locTotalOrder === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n //Count how much OrderStatus is at 1 in that location\n $queryCountOrder = 'SELECT COUNT(FK_IDLoc) FROM orderedsnow WHERE OrderStatus = 1 AND FK_IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n require_once 'model/dbConnector.php';\n $locRendu = executeQuerySelect($queryCountOrder);\n if ($locRendu === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n //if the 2 number are equal set the Location to 2\n\n\n if ($locTotalOrder == $locRendu) {\n $locUpdatedStatus = 2;\n } elseif ($locRendu > 0 && $locRendu < $locTotalOrder) {\n $locUpdatedStatus = 1;\n }\n\n //replace actual locStatus if needed\n if ($locUpdatedStatus != 0) {\n $queryUpdate = 'UPDATE locations SET LocStatus=' . $strSeparator . $locUpdatedStatus . $strSeparator . ' WHERE IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n $queryResult = executeQueryUpdate($queryUpdate);\n if ($queryResult === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n }\n}",
"public static function add($ip)\n {\n //SELECT * FROM `ip2location_db11` WHERE INET_ATON('116.109.245.204') <= ip_to LIMIT 1\n\n $location = self::where('ip_address', '=', $ip)->first();\n if (!is_object($location)) {\n $location = new self();\n }\n $location->ip_address = $ip;\n\n // Get info\n try {\n if (!(strpos($ip, \":\") > -1))\n {\n // Code for IPv4 address $ip_address...\n $location_table = table('ip2location_db11');\n }\n else\n {\n // Code for IPv6 address $ip_address...ip2location_db11_ipv6\n $location_table = table('ip2location_db11_ipv6');\n }\n\n $location_tables = \\DB::select('SHOW TABLES LIKE \"'.$location_table.'\"');\n // Local service\n if (count($location_tables)) {\n // Check for ipv4 or ipv6\n if (!(strpos($ip, \":\") > -1)) {\n $aton = $ip;\n $records = \\DB::select(\"SELECT * FROM `\".$location_table.\"` WHERE INET_ATON(?) <= ip_to LIMIT 1\", [$aton]);\n } else {\n $aton = Dot2LongIPv6($ip);\n $records = \\DB::select(\"SELECT * FROM `\".$location_table.\"` WHERE ? <= ip_to LIMIT 1\", [$aton]);\n }\n\n if (count($records)) {\n $record = $records[0];\n $location->country_code = $record->country_code;\n $location->country_name = $record->country_name;\n $location->region_name = $record->region_name;\n $location->city = $record->city_name;\n $location->zipcode = $record->zip_code;\n $location->latitude = $record->latitude;\n $location->longitude = $record->longitude;\n } else {\n throw new \\Exception(\"IP address [$ip] can not be found in local database: \");\n }\n // Remote service\n } else {\n $result = file_get_contents('http://freegeoip.net/json/'.$ip);\n $values = json_decode($result, true);\n\n $location->fill($values);\n }\n } catch (\\Exception $e) {\n echo $e->getMessage();\n // Note log\n LaravelLog::warning('Cannot get IP location info: ' . $e->getMessage());\n }\n\n $location->save();\n\n return $location;\n }",
"public function insertLocation($file, &$locationArr) {\n $fileStream = fopen($file, 'r');\n ini_set('auto_detect_line_endings', TRUE);\n //Skip the header\n fgetcsv($fileStream);\n //Gets the parent folder of passed in $file\n $verifiedFile = dirname($file) . '\\LocationVerified.csv';\n $fileErrors = array();\n $count = 1;\n $insertedRows = 0;\n while(($data = fgetcsv($fileStream)) !== FALSE) {\n $count++;\n $errors = Validator::validateLocation($data);\n if(empty($errors)) {\n //No error write to verified file\n $locationArr[] = $data[0];\n $newFile = fopen($verifiedFile, 'a');\n fputcsv($newFile, $data);\n fclose($newFile);\n $insertedRows++;\n } else {\n $fileErrors[] = new FileRowError($count, $errors);\n }\n }\n fclose($fileStream);\n $_SESSION['location-lookup.csv'] = $insertedRows;\n\n $dbConnectorInstance = DatabaseConnector::getInstance();\n $dbConnector = $dbConnectorInstance->getConnection();\n $sql = 'LOAD DATA LOCAL INFILE ? INTO TABLE location FIELDS TERMINATED BY \\',\\' LINES TERMINATED BY \\'\\n\\'';\n\n\n try {\n $stmt = $dbConnector->prepare($sql);\n $stmt->bindParam(1, $verifiedFile);\n $stmt->execute();\n } catch (PDOException $pdoEx) {\n $this->logger->error('Error loading data from local file. ', $pdoEx);\n $fileErrors = NULL;\n }\n\n //Delete verified file upon completion of uploading\n unlink($verifiedFile);\n\n return $fileErrors;\n }",
"function save_user_loc($db, $user_id, $user_loc)\n{\n\ttry\n\t{\n\t\t$user_loc_tab = explode(',', $user_loc);\n\t\t$stmt = $db->conn->prepare(\"SELECT user_true_long, user_true_lat FROM profils WHERE user_id = :user_id\");\n\t\t$stmt->execute(array(':user_id'=>$user_id));\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row['user_true_long'] != $user_loc_tab[1] || $row['user_true_lat'] != $user_loc_tab[0])\n\t\t{\n\t\t\t$stmt = $db->conn->prepare(\"UPDATE profils SET user_true_long = :user_long, user_true_lat = :user_lat, user_true_city = :user_city, user_true_city_code = :user_city_code, user_true_country = :user_country WHERE user_id = :user_id\");\n\t\t\t$stmt->execute(array(':user_id'=>$user_id, ':user_long'=>$user_loc_tab[1], ':user_lat'=>$user_loc_tab[0], ':user_city'=>$user_loc_tab[2], ':user_city_code'=>$user_loc_tab[3], ':user_country'=>$user_loc_tab[4]));\n\t\t}\n\t}\n\tcatch(PDOExeption $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n}",
"function test_deport_import_location()\n\t{\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t// the pre condition ensures this will not be null\n\t\t$this->assertNotEqual($r, null);\n\t\t// delete it from the data base\n\t\t$r->sql_delete();\n\t\t// load it from the database and get NULL to verify its gone\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertEqual($r, null);\n\t\t// // now put it back in database - load from file and then insert\n\t\t$new_r = Item::get_by_trip_slug('rtw', LOC_SLUG);\n\t\t$new_r->sql_insert();\n\t\t// finally test it is in database\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertNotEqual($r, null);\n\t}",
"public function insertLocation($data){\n\t\t$result = $this->db->insert('event_location', $data);\t// insert data into `users` table\n\t\treturn $result;\n }"
]
| [
"0.6711153",
"0.632539",
"0.6307383",
"0.61594105",
"0.6054637",
"0.6026602",
"0.602257",
"0.599693",
"0.5888941",
"0.58303875",
"0.57807565",
"0.5773717",
"0.57388145",
"0.5719206",
"0.57057923",
"0.56735486",
"0.56349283",
"0.56100094",
"0.56093854",
"0.56065106",
"0.5584523",
"0.55764884",
"0.5557727",
"0.5544493",
"0.55393344",
"0.55298597",
"0.5528437",
"0.5520872",
"0.5510704",
"0.5501776"
]
| 0.7290895 | 0 |
this is an ajax function that searches for a course based on the get request paramater | public function search_course()
{
$search_content = $this->input->get("search");
if($search_content==""){
}else{
$search_content = $this->security->xss_clean($search_content);
$search_content = htmlspecialchars($search_content);
$data = $this->admin_student_courses_mdl->search_course($search_content);
print json_encode($data);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }",
"function get_details() { \n global $dbh;\n \n // allow crn or course name to be used in query (currently only crn is being used)\n if (!empty($_GET['crn']) or !empty($_GET['course'])) {\n if (isset($_SESSION['user'])) {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3,exists(select * from classes_shopped where student_id = ? and term_code = ? and crn = ?) as shopped FROM courses';\n $term = array($_SESSION['user'],$_GET['term_code'],$_GET['crn']);\n } else {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3 FROM courses';\n $term = array();\n }\n \n // add additional where clause based on data given\n if (!empty($_GET['crn'])) {\n $term[] = $_GET['crn'];\n $query .= ' WHERE CRN = ?';\n } else {\n $course = explode(' ',$_GET['course']);\n $term[] = strtoupper($course[0]);\n $term[] = $course[1];\n $query .= ' WHERE subject_code = ? AND course_number = ?';\n }\n \n $resultset = prepared_query($dbh, $query, $term);\n \n if ($resultset->numRows() == 0) {\n echo \"No course found for \".implode(' ',$term);\n } else { \n $row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC);\n display_course($row); // format course data\n }\n }\n}",
"function getteachcourses_get(){\n $teaching = $this->get('teachingID');\n // $startdate = $this->get(\"startdate\");\n // if($startdate >= $datetime){\n // }\n $result = $this->lecturers_model->getteachcoursesmodel($teaching);\n\n $this->response($result);\n }",
"public function my_courses_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->my_courses_get($logged_in_user_details['user_id']);\n }else{\n\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }",
"function get_course($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}",
"function student_listCourses(){\n\tinclude 'db.php';\n\t$username = filter_var($_GET['val']);\n\n\t$sql = 'SELECT id ,name ,description , image \n \t\t\tFROM courses JOIN idinfo\n \t\tON courses.id = idinfo.coursesID\n \t\tWHERE idinfo.studentID =' . $username . '' ;\n\t\n\t$result = mysqli_query($conn, $sql);\n\n\tif (mysqli_num_rows($result) > 0) {\n\t\t\tforeach($result as $row) {\t\t\t\t\n\t\t\t\techo \"<a href='courses-info.php?val=\". $row['id'] . \"'>\" . \"<div class='wrapp-img-link'>\" .'<img class=\"img-main\" src=\"data:image/jpeg;base64,'.base64_encode( $row['image'] ).'\" alt=\"' . $row['name'] . '\"/>' . \"</div>\". \"course\" . \" \" . $row['name'] . \"</a>\";\n\t\t\t}\n\t} else {\n\t\t\t\techo \"This student is currently not enrolled in any courses\";\n\t\t\t}\n\t\t\t\t\n\n\t}",
"public function search(Request $request){\n\n // Get all courses the user is currently registered in\n $user = User::find(Auth::user()->id);\n $registered_courses = $user->courses()->get();\n\n // validate the user input\n $this->validate($request, ['search_input' => 'required',]);\n $input = $request->input(\"search_input\");\n\n $courses = array();\n\n // find the courses associated with the user input\n $courses_by_name = Course::where('class', 'ilike', '%'.$input.'%')->get();\n $courses_by_title = Course::where('title', 'ilike', '%'.$input.'%')->get();\n\n // courses information by course name\n foreach($courses_by_name as $cbn){\n if(!in_array($cbn, $courses)){\n if($registered_courses->where('title', $cbn->title)->count() === 0){\n $item = array();\n $item['id'] = $cbn->id;\n $item['class'] = $cbn->class;\n $item['section'] = $cbn->section;\n $item['title'] = $cbn->title;\n $item['teacher'] = \"\";\n $courses[] = $item;\n }\n }\n }\n\n // courses information by course title\n foreach($courses_by_title as $cbt){\n if(!in_array($cbt, $courses)){\n if($registered_courses->where('title', $cbt->title)->count() === 0){\n $item = array();\n $item['id'] = $cbt->id;\n $item['class'] = $cbt->class;\n $item['section'] = $cbt->section;\n $item['title'] = $cbt->title;\n $item['teacher'] = \"\";\n $courses[] = $item;\n }\n }\n }\n\n // courses information by course teacher's name\n $allCourses = Course::all();\n foreach ($allCourses as $aCourse){\n $found = $aCourse->teachers()\n ->where('name','ilike', \"%$input%\")\n ->get();\n if(count($found) > 0 && !in_array($aCourse, $courses)){\n if($registered_courses->where('title', $aCourse->title)->count() === 0) {\n $item = array();\n $item['id'] = $aCourse->id;\n $item['class'] = $aCourse->class;\n $item['section'] = $aCourse->section;\n $item['title'] = $aCourse->title;\n $item['teacher'] = $found[0]->name;\n $courses[] = $item;\n }\n }\n }\n\n $paginated_courses = $this->constructPagination($courses);\n\n return view('coursemanager.index', ['registered_courses' => $registered_courses, 'courses' => $paginated_courses,\n 'user' => $user,]);\n }",
"public function course_object_by_id_get() {\n\t\t$course_id = $_GET['course_id'];\n\t\t$course = $this->crud_model->get_course_by_id($course_id)->row_array();\n\t\t$course['requirements'] = json_decode($course['requirements']);\n\t\t$course['outcomes'] = json_decode($course['outcomes']);\n\t\t$course['thumbnail'] = $this->get_image('course_thumbnail', $course['id']);\n\t\tif ($course['is_free_course'] == 1) {\n\t\t\t$course['price'] = get_phrase('free');\n\t\t}else{\n\t\t\tif ($course['discount_flag'] == 1){\n\t\t\t\t$course['price'] = currency($course['discounted_price']);\n\t\t\t}else{\n\t\t\t\t$course['price'] = currency($course['price']);\n\t\t\t}\n\t\t}\n\t\t$total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;\n\t\t$number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();\n\t\tif ($number_of_ratings > 0) {\n\t\t\t$course['rating'] = ceil($total_rating / $number_of_ratings);\n\t\t}else {\n\t\t\t$course['rating'] = 0;\n\t\t}\n\t\t$course['number_of_ratings'] = $number_of_ratings;\n\t\t$instructor_details = $this->user_model->get_all_user($course['user_id'])->row_array();\n\t\t$course['instructor_name'] = $instructor_details['first_name'].' '.$instructor_details['last_name'];\n\t\t$course['total_enrollment'] = $this->crud_model->enrol_history($course['id'])->num_rows();\n\t\t$course['shareable_link'] = site_url('home/course/'.slugify($course['title']).'/'.$course['id']);\n\t\treturn $course;\n\t}",
"public function fetch_course_name_for_merging()\n {\n $id = $this->input->get(\"id\");\n $id = $this->security->xss_clean(htmlspecialchars($id));\n if($id==\"\"){\n echo \"course name was not gotten there seems to be a problem\";\n }else{\n $get_course = $this->admin_student_courses_mdl->course_from_id($id);\n echo $get_course;\n }\n }",
"public function index()\n\t{\n\t\t// $slider = $this->home_model->GetData(['type'=>'slide'],'config')->result();\n\t\t$list_courses = '';\n\t\t$user_id = $this->session->userdata('logged_id');\n\t\t$username_id = $this->auth_model->GetUser(['id_user' => $user_id])->row('username');\n\n\t\t$title = $this->input->get('title');\n\t\t$subject = $this->input->get('subject');\n\n\t\tif (empty($title) && empty($subject)) {\n\t\t$list_courses = $this->course_model->GetListCourses('','');\n\t\t}\n\t\telse if ($title == \"\" && $subject == \"\") {\n\t\t$list_courses = $this->course_model->GetListCourses('','');\n\t\t}\n\t\telse{\n\t\t\tif($subject != \"\"){\n\t\t\t\t$subject = $subject;\n\t\t\t\t// $sbjct_filter = [\"subject\" => $subject];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$subject =\"\";\n\t\t\t\t// $sbjct_filter = \"\";\n\t\t\t}\n\t\t\tif ($title != \"\") {\n\t\t\t\t$title = $title;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$title = \"\";\n\t\t\t}\n\t\t\t$check_name = $this->home_model->GetData([\"name LIKE\"=>\"%\".$title.\"%\"],'user')->num_rows();\n\t\t\t$check_title = $this->home_model->GetData([\"title LIKE\"=>\"%\".$title.\"%\"],'course_title')->num_rows();\n\t\t\tif ($check_title > 0 && $check_name > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],[\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],[\"title LIKE\"=>\"%\".$title.\"%\"]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ($check_title > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],\"\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"title LIKE\"=>\"%\".$title.\"%\"],\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($check_name > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],\"\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],\"\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse{\n\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],[\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],[\"title LIKE\"=>\"%\".$title.\"%\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t$username = array();\n\t\t$like_amount = array();\n\t\t$comment_amount = array();\n\t\t$liked = array();\n\n\t\tforeach ($list_courses as $courses) {\n\t\t\t$username[$courses->id_user] = $this->auth_model->GetUser(['id_user' => $courses->id_user])->row('username');\n\t\t\t$like_amount[$courses->id_title] = $this->home_model->GetSelectData('COUNT(id_likecourse) as like_amount',['id_title' => $courses->id_title],'like_course')->row('like_amount');\n\t\t\t$comment_amount[$courses->id_title] = $this->home_model->GetSelectData('COUNT(id_comment) as comment_amount',['id_title' => $courses->id_title],'comment')->row('comment_amount');\n\t\t\tif ($this->session->userdata('logged_in') == TRUE) {\n\t\t\t\t$liked[] = $this->home_model->GetData(['id_title'=>$courses->id_title,'id_user'=>$user_id,],'like_course')->row('id_title');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (!empty($title) || !empty($subject)) {\n\t\t\t\t$data = [\n\t\t\t\t'list_subject'\t=> $this->course_model->GetSubject(),\n\t\t\t\t'username' \t\t=> $username,\n\t\t\t\t'like_amount'\t=> $like_amount,\n\t\t\t\t'comment_amount'=> $comment_amount,\n\t\t\t\t'liked'\t\t\t=> $liked,\n\t\t\t\t'list_courses' \t=> $list_courses,\n\t\t\t\t'title'\t\t \t=> $title,\t//search\n\t\t\t\t'subject'\t\t=> $subject, //search\n\t\t\t\t'main_view' \t=> 'course_view',\n\t\t\t\t'username_id'\t=> $username_id,\n\t\t\t\t// 'slider'\t\t=> $slider,\n\t\t\t\t// 'sld_img'\t\t=> $sld_img,\n\t\t\t\t\t];\n\t\t}\n\t\telse{\n\t\t\t\t$data = [\n\t\t\t\t'list_subject'\t=> $this->course_model->GetSubject(),\n\t\t\t\t'username' \t\t=> $username,\n\t\t\t\t'like_amount'\t=> $like_amount,\n\t\t\t\t'comment_amount'=> $comment_amount,\n\t\t\t\t'liked'\t\t\t=> $liked,\n\t\t\t\t'list_courses' \t=> $list_courses,\n\t\t\t\t'main_view' \t=> 'course_view',\n\t\t\t\t'username_id'\t=> $username_id,\n\t\t\t\t// 'slider'\t\t=> $slider,\n\t\t\t\t// 'sld_img'\t\t=> $sld_img,\n\t\t\t\t\t];\n\t\t}\n\t\t\n\t\t$this->load->view('templet', $data);\n\t}",
"public function executeAjaxSearch(sfWebRequest $request)\n {\n if (!$request->isXmlHttpRequest()) $this->forward404();\n if (!$request->hasParameter(\"ajax_query\")) throw new Exception(\"ajax_query does not exist\");\n \n // use fuzzySearch class to get a list of courses matching the query\n $query = $request->getParameter(\"ajax_query\");\n $fuzzySearch = new fuzzySearch();\n try {\n $fuzzySearch->query($query);\n $courseList = $fuzzySearch->getCourseList();\n } catch (Exception $e){\n echo \"<li>No match found</li>\";\n return sfView::NONE;\n }\n \n if (!isset($courseList) || count($courseList) == 0) {\n echo \"<li>No match found</li>\";\n } else {\n foreach ($courseList as $course){\n echo \"<li><a style='cursor:pointer' onclick='addToSelected(\\\"\".$course->getId().\" (\".$course->getDescr().\")\".\"\\\")'>\".$course->getId().\" (\".$course->getDescr().\")</a></li>\";\n }\n }\n \n return sfView::NONE;\n }",
"public function index(Request $request){\n $courses = Course::query();\n\n // Fitur search data dengan nama, berdasarkan Query Params: search\n $search = $request->query('search');\n // Query where search LIKE\n $courses->when($search, function($query) use ($search){\n return $query->whereRaw(\"name LIKE '%\".strtolower($search).\"%'\");\n });\n\n // Fitur search berdasarkan status course, berdasarkan Query Params: status\n $status = $request->query('status');\n // Query where equal atau samadengan\n $courses->when($status, function($query) use ($status){\n return $query->where('status', '=', $status);\n });\n \n\n return response()->json([\n 'status' => 'success',\n // Set per Page 10 courses\n 'data' => $courses->paginate(10)\n ]);\n }",
"public function getcoursesByid_course ($id_course){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE id_course= $id_course \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }",
"public function search_courses()\n {\n\n //run thi url to add courses again\n\n $values = array(\n 'course_id' => 1, 'course_name' => 'DSA', 'course_fee' => '$100', 'course_teacher' => 'Praveen Kumar',\n 'course_review' => '4/5 star rating', 'course_details' => 'Interview prepration course fo beginner',\n 'sign_up'=>'Go TO COURSE'\n );\n DB::table('search_courses')->insert($values);\n\n \n \n $values = array(\n 'course_id' => 2, 'course_name' => 'Anatomy', 'course_fee' => '$100', 'course_teacher' => 'kuldeep Singh',\n 'course_review' => '4 star rating', 'course_details' => 'Anatomy Structured course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 3, 'course_name' => 'Economy', 'course_fee' => '$100', 'course_teacher' => 'Rajat Singh',\n 'course_review' => '5 star rating', 'course_details' => 'Economy Booster course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 4, 'course_name' => 'History', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn History through Dates',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 5, 'course_name' => 'mathematics', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn about Higher mathematics',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n\n\n \n $values = array(\n 'course_id' => 6, 'course_name' => 'Interior Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 7, 'course_name' => 'Graphic Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n $searchData = SearchCourses::all();\n return view('search_courses')->with('data', $searchData);\n }",
"public function index(Request $request)\n { \n $dataSearch = Request::get('search');\n return Courses::with(['getTasks','getCategory'])->whereHas('getCategory', function($q) use ($dataSearch) {\n if($dataSearch){\n $q->where('category_name', 'LIKE', \"%{$dataSearch}%\");\n }\n }) ->latest()\n ->orWhere('course_name', 'LIKE', \"%{$dataSearch}%\")\n ->paginate(); \n }",
"public function getCourseby($urlsearch=null,$stream=null,$level=null,$term=null,$page=null,$pagesize=null)\n {\n \n $data=array();\n\n if($term!=\"\"||$term!=null){$this->db->like(array('name'=>$term));}\n if($urlsearch!=\"\"||$urlsearch!=null){$this->db->like(array('name'=>$urlsearch));}\n $this->db->select('cid'); \n $c_result=$this->db->get('courses_list');\n $data[\"query1\"]= $this->db->last_query();\n if($c_result->num_rows()>0)\n {\n $course=$c_result->result_array();\n $course_id = array_column($course, 'cid');\n \n /* getcourse*/\n /* get unique college id and seacrh here*/\n $this->db->distinct('inst_id');\n if($stream!=null){ $this->db->where($stream); }\n if($level!=null){ $this->db->where($level); }\n $this->db->select('inst_id');\n $this->db->where_in('course_id',$course_id);\n $institute=$this->db->get('allcourse'); \n $data[\"query2\"]= $this->db->last_query();\n $inst_id=array_column($institute->result_array(), 'inst_id'); \n if($institute->num_rows()>0)\n {\n \n /** get all distinct institute **/\n if($page!=null &&$pagesize!=null) { $offset=($page-1)*$pagesize; $this->db->limit($pagesize,$offset); }\n $this->db->select('*');\n $this->db->where_in('id',$inst_id);\n $allinstitute=$this->db->get('institute');\n $data[\"query3\"]= $this->db->last_query();\n if($allinstitute->num_rows()>0){\n $data[\"courses\"]=$allinstitute->result_array();\n $data[\"pcount\"]=$institute->num_rows();\n \n \n }\n \n else{\n $data[\"error\"]=\"no information found at server\";\n $data[\"pcount\"]=0;\n }\n \n }\n else{\n $data[\"error\"]=\"no information found at server\";\n $data[\"pcount\"]=0;\n }\n \n }\n return $data;\n }",
"public static function find_courses($search) {\n global $DB;\n\n // Validate parameters passed from web service.\n $params = self::validate_parameters(self::find_courses_parameters(), array('search' => $search));\n\n // Capability check.\n if (!has_capability('moodle/course:viewhiddencourses', context_system::instance())) {\n return false;\n }\n\n // Build query.\n $searchsql = '';\n $searchparams = array();\n $searchlikes = array();\n $searchfields = array('c.shortname', 'c.fullname', 'c.idnumber');\n for ($i = 0; $i < count($searchfields); $i++) {\n $searchlikes[$i] = $DB->sql_like($searchfields[$i], \":s{$i}\", false, false);\n $searchparams[\"s{$i}\"] = '%' . $search . '%';\n }\n // We exclude the front page.\n $searchsql = '(' . implode(' OR ', $searchlikes) . ') AND c.id != 1';\n\n // Run query.\n $fields = 'c.id,c.idnumber,c.shortname,c.fullname';\n $sql = \"SELECT $fields FROM {course} c WHERE $searchsql ORDER BY c.shortname ASC\";\n $courses = $DB->get_records_sql($sql, $searchparams, 0);\n return $courses;\n }",
"function getCourseByIdValidate(){\n\t\t \n\t\tif(@$this->id != \"\" && @$this->identification != \"\"){\n\t\t\t$this->basics->getCourseById($this->sanitize($this->id), $this->sanitize($this->identification));\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"The Basic Program Blocks seem corrupt. Please Logout then login.\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}\t \n\t\t \n\t}",
"public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}",
"function get_sections($crn,$term,$course) {\n global $dbh;\n \n // get all courses offered in same term with same course name\n $query = 'SELECT term_code,crn FROM courses WHERE term_code = ? and concat(subject_code,\" \",course_number) = ? ORDER BY section_number';\n \n $resultset = prepared_query($dbh, $query, array($term,$course));\n \n $sections = array();\n while ($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n // if the CRN does not match current course, add it as a different section\n if ($row['crn'] != $crn) $sections[] = '<a href=\"javascript:void(0);\" onclick=\"getDetail('.$row['term_code'].','.$row['crn'].')\">'.$row['crn'].'</a>';\n }\n return $sections; \n}",
"public function getCourses(){\n\n $query = \"SELECT FA.Availability as FAV, FA.TimeStart,FA.TimeEnd, FA.Id, FAA.Availability, FA.CourseID, C.CourseName,C.OfficeHourDay,C.OfficeHourTime, F.AshesiEmail,concat(F.FName,' ',F.LName) as Faculty FROM Registered_Courses R INNER JOIN Courses C on R.CourseID = C.CourseID INNER JOIN Faculty F on R.FacultyID = F.FacultyID INNER JOIN Faculty_Course_Availability FA ON FA.CourseID = R.CourseID\n INNER JOIN Faculty_Arrival FAA ON FAA.FacultyID = R.FacultyID WHERE R.StudentID =:id GROUP BY C.CourseID \";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n return $stmt;\n }",
"public function findCourseById($id);",
"function getMyCoursesValidate(){\n\t\t\n\t\tif(@$this->major != \"\" && @$this->institution != \"\" && @$this->id != \"\"){\n\t\t\t$this->basics->getMyCourses($this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->id) );\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\",\" The Major and Institution and Id are required! \", \"doSecureAuth();\");\n\t\t\t\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function Search_Document($type,$course_id,$teacher_id)\n {\n if($teacher_id != null)\n {\n $check_access = $this->Check_Access($teacher_id,$course_id);\n }\n else\n {\n $check_access = null;\n }\n if($type =='special')\n {\n $check_access = true;\n $sql = \"SELECT DISTINCT si.`instructor_id`,`firstname`,`lastname`,s.`semester_num`,s.`year` FROM `special_instructor` si,`course_hire_special_instructor` ci, `semester` s\n WHERE ci.`course_id` = '\".$course_id.\"' AND ci.`instructor_id` = si.`instructor_id` AND ci.`semester_id` = s.`semester_id` ORDER BY `ci`.`updated_date` DESC\" ;\n }\n else if ($type == 'evaluate')\n {\n $sql = \"SELECT `semester_num`,`year` FROM `course_evaluate` e,`semester` s\n WHERE e.`course_id` = '\".$course_id.\"' AND e.`semester_id` = s.`semester_id` ORDER BY e.`updated_date` DESC\" ;\n }\n $data = array();\n \n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n if($type == 'special')\n {\n $data['DATA'][$i]['id'] = $result[$i]['instructor_id'];\n $data['DATA'][$i]['name'] = $result[$i]['firstname'].' '.$result[$i]['lastname'];\n }\n $data['DATA'][$i]['semester'] = $result[$i]['semester_num'];\n $data['DATA'][$i]['year'] = $result[$i]['year'];\n }\n }\n else\n {\n $data['DATA'] = false;\n }\n $data['ACCESS'] = $check_access;\n $data['INFO'] = $this->Get_Course_Info($course_id);\n $dept = $this->Search_Course_Dept($course_id,$this->SEMESTER['id']);\n if($dept)\n {\n $data['INFO']['department'] = $dept['id'];\n\n }\n $sql = \"SELECT sum(se.`student`) as num_student FROM `course_evaluate` ce, `student_evaluate` se \";\n $sql .= \"WHERE ce.`course_evaluate_id` = se.`course_evaluate_id` AND ce.`course_id` = '\".$course_id.\"' AND ce.`semester_id` = '\".$this->SEMESTER['id'].\"'\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n\n if(is_null($result[0]['num_student']))\n {\n $data['INFO']['num_student'] = '0';\n }\n else\n {\n $data['INFO']['num_student'] = $result[0]['num_student'];\n }\n }\n //id,name,semester,year\n return $data;\n }",
"function getCourse($start_from,$per_page){\r\ninclude 'dbConnect.php';\r\n$sql= 'SELECT * FROM course LIMIT '.$start_from.','.$per_page.';';\r\n$result = mysqli_query($conn, $sql);\r\nif(isset($result)){\r\n\tif(mysqli_num_rows($result) > 0){\r\n\t\techo '<div id=\"products\" class=\"row list-group\">';\r\n\t\twhile($row = mysqli_fetch_assoc($result)){\t\r\n\t\t\techo '<div class=\"item col-xs-4 col-lg-4\">\r\n\t\t\t\t<div class=\"thumbnail\">\r\n\t\t\t\t\t<img class=\"group list-group-image\" src=\"http://placehold.it/400x250/000/fff&text='.$row[\"CourseName\"].'\" />\r\n\t\t\t\t\t<div class=\"caption\">\r\n\t\t\t\t\t\t<h4 class=\"group inner list-group-item-heading\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseName\"].'</h4>\r\n\t\t\t\t\t\t<p class=\"group inner list-group-item-text\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseDesc\"].'</p>\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t\t<p class=\"lead\">\r\n\t\t\t\t\t\t\t\t\tMYR '.$row[\"CoursePrice\"].'</p>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t<form method=\"post\" action=\"classroom.php\">\r\n\t\t\t\t\t\t\t<div><input type=\"hidden\" name=\"course_id\" value=\"'.$row[\"CourseID\"].'\"/></div>\r\n\t\t\t\t\t\t\t<input class=\"btn btn-success\" type=\"submit\" name=\"view\" value=\"View Sessions\"/>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>';\r\n\t\t\t}\r\n\t\t\techo '</div>';\r\n\t\t\t\r\n\t\t\t//Now select all from table\r\n\t\t\t$querypage = \"SELECT * FROM Course;\";\r\n\r\n\t\t\t$resultpage = mysqli_query($conn, $querypage);\r\n\r\n\t\t\t// Count the total records\r\n\t\t\t$total_records = mysqli_num_rows($resultpage);\r\n\r\n\t\t\t//Using ceil function to divide the total records on per page\r\n\t\t\t$total_pages = ceil($total_records / $per_page);\r\n\t\t\t\r\n\t\t\t//first page\r\n\t\t\techo \"<ul class='pagination'>\r\n\t\t\t\t <li class='page-item'><a href='course.php?page=1'>\".'<<'.\"</a></li>\";\r\n\r\n\t\t\tfor ($i=1; $i<=$total_pages; $i++) {\r\n\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=\".$i.\"'>\".$i.\"</a></li>\";\r\n\t\t\t};\r\n\t\t\t// last page\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=$total_pages'>\".'>>'.\"</a></li>\r\n\t\t\t\t</ul>\";\r\n\t\t}\r\n\t}else{\r\n\t\techo 'Error Database!';\r\n\t}\r\n}",
"function download_gold_subject_list() {\n\t\n\t// store everything to an array\n\t$array = array();\n\t\n\t// setup curl params\n\t$url = \"http://my.sa.ucsb.edu/public/curriculum/coursesearch.aspx\";\n\t\n\t$opts = array(\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_CONNECTTIMEOUT => 15,\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t);\n\t\n\t// initialize a curl object\n\t$curl = curl_init();\n\t\n\t// extend any additional curl options to the default ones\n\tcurl_setopt_array($curl, $opts);\n\t\n\t// perform get request & cleanup\n\t$response = curl_exec($curl);\n\tcurl_close($curl);\n\tunset($curl);\n\t\n\t// parse the document\n\t$html = substr($response, strpos($response, '<!DOCTYPE'));\n\t$doc = phpQuery::newDocument($html);\n\tphpQuery::selectDocument($doc);\n\t\n\t// anonymous function: store every hit to the array\n\t$record = function($elmt) use(&$array) {\n\t\t$array[pq($elmt)->val()] = preg_replace('/^(.+) - [A-Z0-9 \\\\-]{2,16}$/', '\\1', pq($elmt)->text());\n\t};\n\t\n\t// fetch all of the course list option values\n\tpq('select[id$=\"courseList\"]')->find('option')->each($record, new CallbackParam);\n\t\n\t// results\n\treturn $array;\n}",
"public function fetch_courses()\n {\n $config = array();\n $config[\"base_url\"] = base_url() . \"Home/Student-Courses/\";\n $config['total_rows'] = $this->admin_student_courses_mdl->count_courses();\n $config['per_page'] = 5;\n $config['use_page_numbers'] = TRUE; \n $config['uri_segment'] = 3; \n $this->pagination->initialize($config); \n if($this->uri->segment(3) > 0){\n $offset = ($this->uri->segment(3) + 0)*$config['per_page'] - $config['per_page'];\n }\n else{\n $offset = $this->uri->segment(3);\n }\n $data['results'] = $this->admin_student_courses_mdl->fetch_courses($config[\"per_page\"], $offset);\n $data[\"links\"] = $this->pagination->create_links();\n return $data; \n\n }",
"public function coursesAll(Request $req)\n {\n $courses1 = DB::table(\"courses\")\n ->select(\"*\")\n ->where(\"Semester\", $req->Semester)\n ->orwhere(\"Semester\", \"Both\")\n ->whereNotIn(\"Code\", function ($query) {\n $query->select(\"Code\")->from(\"courses_passed\");//get courses not passed\n })\n ->get();\n\n /*$courses1=Course::where('Semester',$req->Semester)\n ->orwhere('Semester','Both')->get();*/\n return response()->json([\n \"row\" => \"$courses1\",\n ]);\n }",
"public function course($course)\n {\n $data = \\App\\Entities\\Learn\\Course::with(['skill', 'lessons'])->whereSlug($course)->first();\n\n abort_unless($data, 404);\n \n if ( \\Auth::check() ) {\n $completes = \\App\\Entities\\Learn\\Advance::where('user_id', \\Auth::id())->get()->map(function ($item) {\n return $item->lesson_id;\n });\n $completes = $completes->toArray();\n } else {\n $completes = [];\n }\n\n return view('app::course', [\n 'course' => $data,\n 'completes' => $completes\n ]);\n }",
"public function getCourse($start,$limit,$sidx,$sord,$where) {\n\t\t$access_type = $this->db->get_where('users', array('id' => $this->session->userdata('user_id'), 'email' => $this->session->userdata('email'))) -> row_array();\n\n\t\t\tif($access_type['acsess_to'] == \"ATC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\t$this->db->where('ac.entity_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"ARC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t$this->db->join('cdac_entities ce', 'ce.entity_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->where('ce.entity_parent_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"CDAC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t}\n\n\t\t\t//echo \"==========>>>>>>>>>>>>>>>>>>> <pre>\". $this->db->last_query(); print_r($data->result()); exit;\n\t\t\treturn $data->result();\n\t\t\t\n\t}"
]
| [
"0.669923",
"0.6453347",
"0.63746977",
"0.6349463",
"0.6286662",
"0.6282747",
"0.6271205",
"0.6240696",
"0.61871415",
"0.6159901",
"0.6111983",
"0.6074421",
"0.60493916",
"0.60340744",
"0.5996027",
"0.59930396",
"0.598645",
"0.59315735",
"0.59141916",
"0.5912604",
"0.58902156",
"0.5865261",
"0.58642673",
"0.58605254",
"0.5849527",
"0.58429635",
"0.58221155",
"0.5818925",
"0.5792276",
"0.5788726"
]
| 0.66849524 | 1 |
this ajax function fetches a specific course name based on the id as a get paramter | public function fetch_course_name_for_merging()
{
$id = $this->input->get("id");
$id = $this->security->xss_clean(htmlspecialchars($id));
if($id==""){
echo "course name was not gotten there seems to be a problem";
}else{
$get_course = $this->admin_student_courses_mdl->course_from_id($id);
echo $get_course;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function retrieveName(){\n\t\t$query = \"SELECT cours_id,code,intitule FROM cours WHERE cours_id=\".$this->course_id.\";\";\n\n\t\t$result = mysqli_query($this->link,$query);\n\t\t$data = $result->fetch_assoc();\n\n\t\t//Check if course exists\n\t\tif(is_null($data))\n\t\t{\n\t\t\techo 'Course with specified id does not exist';\n\t\t\techo \"\\n\";\n\t\t\tmysqli_close($this->link);\n\t\t\texit;\n\t\t}\n\n\t\t$this->course['id'] = $this->course_id;\n\t\t$this->course['code'] = $data['code'];\n\t\t$this->course['title'] = $data['intitule'];\n\t}",
"function get_course($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}",
"public function getNameOfCoursebyId($id)\n {\n $courses = TableRegistry::getTableLocator()->get('Courses');\n $courses = $courses->find('all')->where(['id' => $id]);\n foreach($courses as $course){\n $course = $course->name;\n echo $course;\n }\n }",
"public function course_object_by_id_get() {\n\t\t$course_id = $_GET['course_id'];\n\t\t$course = $this->crud_model->get_course_by_id($course_id)->row_array();\n\t\t$course['requirements'] = json_decode($course['requirements']);\n\t\t$course['outcomes'] = json_decode($course['outcomes']);\n\t\t$course['thumbnail'] = $this->get_image('course_thumbnail', $course['id']);\n\t\tif ($course['is_free_course'] == 1) {\n\t\t\t$course['price'] = get_phrase('free');\n\t\t}else{\n\t\t\tif ($course['discount_flag'] == 1){\n\t\t\t\t$course['price'] = currency($course['discounted_price']);\n\t\t\t}else{\n\t\t\t\t$course['price'] = currency($course['price']);\n\t\t\t}\n\t\t}\n\t\t$total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;\n\t\t$number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();\n\t\tif ($number_of_ratings > 0) {\n\t\t\t$course['rating'] = ceil($total_rating / $number_of_ratings);\n\t\t}else {\n\t\t\t$course['rating'] = 0;\n\t\t}\n\t\t$course['number_of_ratings'] = $number_of_ratings;\n\t\t$instructor_details = $this->user_model->get_all_user($course['user_id'])->row_array();\n\t\t$course['instructor_name'] = $instructor_details['first_name'].' '.$instructor_details['last_name'];\n\t\t$course['total_enrollment'] = $this->crud_model->enrol_history($course['id'])->num_rows();\n\t\t$course['shareable_link'] = site_url('home/course/'.slugify($course['title']).'/'.$course['id']);\n\t\treturn $course;\n\t}",
"public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }",
"public function getcoursesByid_course ($id_course){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE id_course= $id_course \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }",
"public function getCourse($sql){\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n\n if($stmt->rowCount() > 0){\n ?><option value=\"\">Select Course</option><?php\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n ?>\n <option value=\"<?php echo $row['id'] ?>\"><?php echo $row['name']; ?></option>\n <?php\n }\n }\n }",
"function getLessonCourseById($lessonId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Course.name AS courseName, Course.id AS courseId\n\t\tFROM Course INNER JOIN CourseLesson ON CourseLesson.idCourse=Course.id \n\t\tWHERE CourseLesson.idLesson='\". $lessonId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_LESSON_BY_ID\";\n\t\t}else{\n\t\t\t$courseName = $result->fetch_assoc(); \n\t\t\treturn $courseName;\n\t\t}\n\n\t}",
"function student_listCourses(){\n\tinclude 'db.php';\n\t$username = filter_var($_GET['val']);\n\n\t$sql = 'SELECT id ,name ,description , image \n \t\t\tFROM courses JOIN idinfo\n \t\tON courses.id = idinfo.coursesID\n \t\tWHERE idinfo.studentID =' . $username . '' ;\n\t\n\t$result = mysqli_query($conn, $sql);\n\n\tif (mysqli_num_rows($result) > 0) {\n\t\t\tforeach($result as $row) {\t\t\t\t\n\t\t\t\techo \"<a href='courses-info.php?val=\". $row['id'] . \"'>\" . \"<div class='wrapp-img-link'>\" .'<img class=\"img-main\" src=\"data:image/jpeg;base64,'.base64_encode( $row['image'] ).'\" alt=\"' . $row['name'] . '\"/>' . \"</div>\". \"course\" . \" \" . $row['name'] . \"</a>\";\n\t\t\t}\n\t} else {\n\t\t\t\techo \"This student is currently not enrolled in any courses\";\n\t\t\t}\n\t\t\t\t\n\n\t}",
"public function individualCourse($universityName,$universityId,$courseName,$courseId) {\n\t\t\n\t\t/*\n\t\t$courseDetail = $this->coursemodel->getCounterValue($courseId);\n\t\t$pageCount = $courseDetail[0]['page_count'];\n\t\tif(!empty($courseId)){\n\t\t\t$count = $pageCount + 1;\n\t\t\t$this->coursemodel->countCourses($count,$courseId);\n\t\t}\n\t\t*/\n\t\t\n\t\t$this->db_campaign = $this->ci->load->database('db_campaign', True);\n\t\t$data['totalLeads'] = $this->collegemodel->getCampaignData();\n\t\t$this->db = $this->ci->load->database('default', True);\n\t\t\n\t\t$spclCharUniv = array(\"(\", \")\",\",\",\"'\");\n\t\t\n\t\t//$university_name = str_replace('-',' ',$universityName);\n\t\t$university_name = str_replace($spclCharUniv,'',$universityName);\n\t\t\n\t\t$spclCharCourse = array(\"$\",\"!\",\"_\",\":\");\n\t\t\n\t\t$course_name = str_replace($spclCharCourse,'',$courseName);\n\t\t\n\t\t$course_name = str_replace('&','and',$course_name);\n\t\t\n\t\t$data['active']=\"\";\n\t\t$data['title'] = \"$university_name - $course_name\";\n\t\t$data['keywords'] = \"\";\n\t\t$data['description'] = \"\";\n\t\t$data['universityName'] = $universityName;\n\t\t$data['universityId'] = $universityId;\n\t\t$data['courseName'] = $courseName;\n\t\t$data[\"accreditationData\"] = $this->coursemodel->getAccreditationData($courseId);\n\t\t$data[\"stagesData\"] = $this->coursemodel->getStagesData($courseId);\n\t\t$data[\"degreeClassesData\"] = $this->coursemodel->getDegreeClassesData($courseId);\n\t\t$data[\"continuationData\"] = $this->coursemodel->getContinuationData($courseId);\n\t\t$data[\"employmentData\"] = $this->coursemodel->getEmploymentData($courseId);\n\t\t$data[\"jobData\"] = $this->coursemodel->getJobData($courseId);\n\t\t$data[\"entryData\"] = $this->coursemodel->getEntryData($courseId);\n\t\t$data[\"salaryData\"] = $this->coursemodel->getSalaryData($courseId);\n\t\t$data[\"commonData\"] = $this->coursemodel->getCommonData($courseId);\n\t\t$data[\"tariffData\"] = $this->coursemodel->getTariffData($courseId);\n\t\t$data[\"nssData\"] = $this->coursemodel->getNssData($courseId);\n\t\t///$data[\"countryId\"] = $this->coursemodel->getountryId($universityId);\n\t\t//echo $course_id;exit;\n\t\t//echo \"<pre>\";print_r($data);exit;\n\t\t\n $this->layout->view('course/individualCourse.php', $data);\n }",
"public function show($course_id, $id)\n {\n \n }",
"abstract protected function getAllByCourse($id);",
"public function Get_Course_Name($course_id)\n {\n\n $sql=\"SELECT `course_name_en` FROM `course` WHERE `course_id` ='\".$course_id.\"'\";\n\n $result = $this->DB->Query($sql);\n if($result)\n {\n $course_name = $result[0]['course_name_en'];\n return $course_name;\n }\n else\n {\n return '-';\n }\n //search teacher data\n }",
"public function recieveAjax($id, $dept)\n {\n $explode = explode(\" \",$id);\n $level = $explode[0];\n $semester = $explode[1];\n $res = Course::where('Semester', '=', $semester)->where('level', '=', $level)->where('department_id','=', $dept)->get();\n $result= json_encode($res);\n $arraydata = json_decode($result);\n return $arraydata;\n }",
"public function course_details_by_id_get($user_id = \"\", $course_id = \"\") {\n\t\t$course_details = $this->crud_model->get_course_by_id($course_id)->result_array();\n\t\t$response = $this->course_data($course_details);\n\t\tforeach ($response as $key => $resp) {\n\t\t\t$response[$key]['sections'] = $this->sections_get($course_id);\n\t\t\t$response[$key]['is_wishlisted'] = $this->is_added_to_wishlist($user_id, $course_id);\n\t\t\t$response[$key]['includes'] = array(\n\t\t\t\t$this->crud_model->get_total_duration_of_lesson_by_course_id($course_id).' '.get_phrase('on_demand_videos'),\n\t\t\t\t$this->crud_model->get_lessons('course', $course_id)->num_rows().' '.get_phrase('lessons'),\n\t\t\t\tget_phrase('high_quality_videos'),\n\t\t\t\tget_phrase('life_time_access'),\n\t\t\t);\n\t\t}\n\t\treturn $response;\n\t}",
"function getCourseById($courseId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Course.name, Course.description, Course.difficulty, Course.popularity, Course.author, Course.creationDate, Course.image, Category.name AS category \n\t\tFROM Course INNER JOIN Category ON Course.CategoryId=Category.id\n\t\tWHERE Course.id='\". $courseId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_COURSE_BY_ID\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}",
"function getCourseByIdValidate(){\n\t\t \n\t\tif(@$this->id != \"\" && @$this->identification != \"\"){\n\t\t\t$this->basics->getCourseById($this->sanitize($this->id), $this->sanitize($this->identification));\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"The Basic Program Blocks seem corrupt. Please Logout then login.\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}\t \n\t\t \n\t}",
"function get_course_by_id($course_id) \n\t{\n\t\t// where do i get the $course_id ? Ans: when i call this model function from controller - courses \n\t\t// fetch_record -> row_array()\n\t\treturn $this->db->query('SELECT * FROM courses WHERE id= ?', array($course_id))->row_array();\n\t}",
"public function findCourseById($id);",
"public static function getCourseName($id)\r\n {\r\n $db = Db::getInstance();\r\n $sql = \"SELECT title, courseCode FROM course WHERE courseID = ?\";\r\n $data = array($id);\r\n $stmt = $db->prepare($sql);\r\n $stmt->execute($data);\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n return array(1, $result);\r\n }",
"public function getCourses(){\n\n $query = \"SELECT FA.Availability as FAV, FA.TimeStart,FA.TimeEnd, FA.Id, FAA.Availability, FA.CourseID, C.CourseName,C.OfficeHourDay,C.OfficeHourTime, F.AshesiEmail,concat(F.FName,' ',F.LName) as Faculty FROM Registered_Courses R INNER JOIN Courses C on R.CourseID = C.CourseID INNER JOIN Faculty F on R.FacultyID = F.FacultyID INNER JOIN Faculty_Course_Availability FA ON FA.CourseID = R.CourseID\n INNER JOIN Faculty_Arrival FAA ON FAA.FacultyID = R.FacultyID WHERE R.StudentID =:id GROUP BY C.CourseID \";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n return $stmt;\n }",
"public function show()\n\t{\n\t\t$dalCourse = new DALCourse;\n\t\t$result = $dalCourse->get();\n\n\t\t$post = \"\";\n\t\twhile ($res = mysqli_fetch_assoc($result))\n\t\t {\n\n\t\t \t// Extracting varsityId and deptId form varsityDeptId first.\n\t\t\t$dalAssignDept = new DALAssignDept;\n\t\t\t$bllUniversity = new BLLUniversity;\n\t\t\t$bllDepartment = new BLLDepartment;\n\n\t\t \t$varsityId =\"\";\n\t\t \t$deptId =\"\";\n\t\t\t$result2 = $dalAssignDept->getById($res['varsityDeptId']);\n\t\t\twhile ($res2 = mysqli_fetch_assoc($result2)) \n\t\t\t{\n\t\t\t\t$varsityId = $res2['varsityId'];\n\t\t\t\t$deptId = $res2['deptId'];\n\t\t\t}\n\n\t\t \t$post.= '<tr>';\n\t\t\t$post.= '<td>'.$res[\"prefix\"].'</td>';\n\t\t\t$post.= '<td>'.$res['courseNo'].'</td>';\n\t\t\t$post.= '<td>'.$res[\"courseTitle\"].'</td>';\n\t\t\t$post.= '<td>'.$res[\"credit\"].'</td>';\n\t\t\t$post.= '<td>'.$bllUniversity->getName($varsityId).'</td>';\n\t\t\t$post.= '<td>'.$bllDepartment->getName($deptId).'</td>';\n\t\t\t\n\n\t\t\t$post.= '<td class=\"text-right\"><button class=\"btn btn-link\" id=\"btnEdit'.$res[\"id\"].'\" onclick=\"EditCourse('.$res[\"id\"].','.$res[\"yearId\"].','.$res[\"termId\"].','.$varsityId.','.$deptId.','.$res[\"degreeId\"].','.$res[\"prerequisite\"].')\">Edit</button></td>';\n\t\t\t$post.= '<td class=\"text-right\"><button id=\"delete_btn\" class=\"btn btn-link\" onclick=\"delete_btn_click('.$res['id'].',\\'/se/dashboard/bll/bll.course.php\\',\\'submit_delete_course\\')\">Delete</button></td>';\n\t\t\t$post.= '<td style=\"display: none\" id=\"row_id'.$res[\"id\"].'\">'.$res[\"id\"].'</td>';\n\t\t \t$post.= '</tr>';\n\n\t\t }\n\t\t return $post;\n\t}",
"public function get_all_courses_by_id($id) {\n $slct_query =\"SELECT * FROM courses WHERE course_id='$id' AND course_deleted='0'\";\n $slct_exe =mysqli_query($GLOBALS['con'],$slct_query) or die(mysqli_error($GLOBALS['con']));\n return $slct_exe;// return the record\n }",
"public function my_courses_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->my_courses_get($logged_in_user_details['user_id']);\n }else{\n\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }",
"public function course_request_by_id($request_id){\n\t\t\t$load = new Load();\n\t\t\t$request_model = $load->model('course_request_model');\n\t\t\t$request_info = $request_model->get_all_course_request_by_id('course_request',$request_id);\n \n\t\t\treturn $request_info;\n\t\t}",
"public function getCourseById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_course', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function courses( $id ){\r\n $select = \"SELECT `courses`.`id`, `courses`.`name` \r\n FROM `courses`\r\n LEFT JOIN `enrollment`\r\n ON `enrollment`.`course_id` = `courses`.`id`\r\n WHERE `enrollment`.`student_id`=:id\";\r\n $sth = $this->db->pdo->prepare($select );\r\n $sth->bindParam( ':id', $id );\r\n $sth->execute();\r\n $result = $sth->fetchAll( PDO::FETCH_ASSOC );\r\n return $result;\r\n }",
"public function findByCourse($id){\n $results = Batch::where('course_id',$id)->get();\n return response()->json($results);\n }",
"public function getCourse($id)\n\t\t{\n\t\t\t$query = \"select a.department_id, a.department_name, b.course_id, b.course_name from tbldepartment a inner join tblcourse b where b.department_id = a.department_id && a.department_id = \".$id.\"\";\n\t\t\treturn $this->db->query($query)->result_object();\n\t\t}",
"public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}"
]
| [
"0.7151769",
"0.6881356",
"0.6790038",
"0.6713046",
"0.6632258",
"0.6587846",
"0.6493558",
"0.64224267",
"0.63592136",
"0.63252246",
"0.6270154",
"0.62516433",
"0.6241985",
"0.6225451",
"0.621234",
"0.6210548",
"0.61982703",
"0.6194064",
"0.6175547",
"0.61040205",
"0.609663",
"0.6091311",
"0.60882545",
"0.6079481",
"0.60761935",
"0.6072291",
"0.60682803",
"0.606816",
"0.60560155",
"0.60232586"
]
| 0.7466677 | 0 |
this ajax function adds a new merged course it: | public function add_new_merge()
{
$course_name = $this->input->post("course_name");
$class_name = $this->input->post("class_name");
$course_name = $this->security->xss_clean($this->authadmin->sanitize_string($course_name));
$class_name = $this->security->xss_clean($this->authadmin->sanitize_string($class_name));
if($course_name==""){
echo "please be sure to select a course";
}else if($class_name==""){
echo "class name cannot be left empty";
}else{
$check_course_name = $this->admin_student_courses_mdl->check_course($course_name);
if($check_course_name==0){
echo "proccess was uncessful because this course doesnt exist in the database";
}else{
$check_class_name = $this->admin_classes_mdl->check_classes($class_name);
if($check_class_name==0){
echo "proccess was uncessful because this class doesnt exist in the database";
}else{
$check_if_pair_exist = $this->admin_student_courses_mdl->check_if_pair_exist($course_name, $class_name);
if($check_if_pair_exist==TRUE){
echo "this course and class have already been merged";
}else{
$this->admin_student_courses_mdl->merge_new_course($course_name, $class_name);
echo "merge process was successfull";
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_courses()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->add_courses();\n $courses = 'courses';\n if ($process) {\n echo json_encode([\n 'status' => true,\n 'message' => $this->lang->line('success_add_courses')\n ]);\n } else {\n echo json_encode([\n 'status' => false,\n 'message' => $this->lang->line('failed_add_courses')\n ]);\n }\n } else {\n redirect(base_url());\n }\n }",
"public function addCourse()\n {\n Logger::Log(\n 'starts POST AddCourse',\n LogLevel::DEBUG\n );\n\n $body = $this->app->request->getBody();\n\n $course = Course::decodeCourse($body);\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'POST',\n '/course',\n array(),\n Course::encodeCourse($course),\n $_link,\n 'course'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $this->app->response->setStatus( 201 );\n if ( isset( $result['headers']['Content-Type'] ) )\n $this->app->response->headers->set(\n 'Content-Type',\n $result['headers']['Content-Type']\n );\n\n } else {\n\n /* if ($course->getId()!==null){\n $this->deleteCourse($course->getId());\n }*/\n\n Logger::Log(\n 'POST AddCourse failed',\n LogLevel::ERROR\n );\n $this->app->response->setStatus( isset( $result['status'] ) ? $result['status'] : 409 );\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n $this->app->stop( );\n }\n }\n\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n }",
"function addcourse($id = NULL) {\n\t\t\n\t\t\n\t/*\techo '<pre>';\n\t\t\n\t\tprint_r($this->data['TutCourse']['course_id']);*/\n\t\t\n\t\t$uniquecourse = array_unique($this->data['TutCourse']['course_id']);\n\t\t\n\t\t$cntcourse = count($this->data['TutCourse']['course_id']);\n\t\t$cntunqcourse = count($uniquecourse);\n\t\t\n\t\t\n\t\tif($cntunqcourse < $cntcourse)\n\t\t{\n\t\t\t$this->Session->setFlash('There are duplicate courses.');\n\t\t\t$this->redirect($this->referer());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$this->layout = '';\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t//pr($this->data);\n\t\t//echo $id;\n\t\tif ($id != \"\") {\n\t\t\t$this->TutCourse->deleteAll(array(\n\t\t\t\t'TutCourse.member_id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t}\n\t\t//die;\n\t\t$i = 0;\n\t\tforeach ($this->data['TutCourse']['course_id'] as $data) {\n\t\t\t$mySaving['TutCourse']['school_id'] = $this->data['TutCourse']['school_id'];\n\t\t\t$mySaving['TutCourse']['course_id'] = $this->data['TutCourse']['course_id'][$i];\n\t\t\t$mySaving['TutCourse']['rate'] = $this->data['TutCourse']['rate'][$i];\n\t\t\t$mySaving['TutCourse']['member_id'] = $this->Session->read('Member.memberid');\n\t\t\t$db = $this->TutCourse->getDataSource();\n\t\t\t$mySaving['TutCourse']['created'] = $db->expression(\"NOW()\");\n\t\t\tif ($mySaving['TutCourse']['course_id']) {\n\t\t\t\t$this->TutCourse->create();\n\t\t\t\t$saved = $this->TutCourse->save($mySaving['TutCourse']);\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\n\t\t}\n\t\tif ($saved) {\n\t\t\t$this->Session->setFlash('Your courses has been saved successfully');\n\t\t\t\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.school_id' => \"'\" . $this->data['TutCourse']['school_id'] . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t} else {\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t}\n\t\t\n\t}",
"function add(){\n\n $this->layout = 'ajax';\n $comptypeId = $this->params['form']['comptypeId'];\n $distroId = $this->params['form']['distroId'];\n\n $updsource = '';\n $keyring = '';\n $u_keyring = '';\n $common = '';\n $specific = '';\n \n\n if(array_key_exists('updateSource',$this->params['form'])){\n $updsource = $this->params['form']['updateSource'];\n $keyring = $this->params['form']['updateKeyring'];\n $u_keyring = $this->params['form']['updateUdebKeyring'];\n }else{ //We assume it is a network type\n $common = $this->params['form']['updateCommon'];\n $specific = $this->params['form']['updateSpecific'];\n }\n\n //Get the name of the component\n $name_q = $this->Componenttype->find('first',array('conditions' => array('Componenttype.id' => $comptypeId),'fields'=>array('Componenttype.name')));\n $name = $name_q['Componenttype']['name'];\n\n //---------------------------------------------------\n //Add the component\n $d = array();\n $d['Distrocomponent']['id'] = '';\n $d['Distrocomponent']['componenttype_id'] = $comptypeId;\n $d['Distrocomponent']['distribution_id'] = $distroId;\n $d['Distrocomponent']['updsource'] = $updsource;\n $d['Distrocomponent']['dir_common'] = $common;\n $d['Distrocomponent']['dir_specific'] = $specific;\n $d['Distrocomponent']['keyring'] = $keyring;\n $d['Distrocomponent']['u_keyring'] = $u_keyring;\n\n $this->Distrocomponent->save($d);\n $comp_id = $this->Distrocomponent->id;\n //----------------------------------------------------------\n\n\n //----Specific for the Reprepro component---\n //Get the repository name + arch of the repoarch\n $distro_ret = $this->Distribution->find('first',array('conditions'=>array('Distribution.id' =>$distroId),'fields'=>array('Repoarches.id','Distribution.name')));\n $ra_id = $distro_ret['Repoarches']['id'];\n $distro_name = $distro_ret['Distribution']['name']; //Need this\n\n $repoarch_ret = $this->Repoarch->find('first',array('conditions'=>array('Repoarch.id' =>$ra_id),'fields' =>array('Repository.name','Architecture.name')));\n $repo_name = $repoarch_ret['Repository']['name']; //Need this\n $arch_name = $repoarch_ret['Architecture']['name']; //Need this\n //---------------------------------------------------------\n\n\n //------------------------------------------------------\n $udeb = false;\n if(array_key_exists('updateInstaller',$this->params['form'])){\n\n $udeb = true;\n }\n\n $compdata = array('repo' => $repo_name,'arch' =>$arch_name,'distro' =>$distro_name,'comp' => $name,'source' => $updsource,'udeb' =>$udeb);\n $this->Reprepro->compAdd($compdata);\n //-------------------------------------------------------\n\n\n //--------------------------------------------\n $json_return = array();\n $json_return['json']['status'] = 'ok'; \n //$json_return['json']['status'] = 'error';\n //$json_return['json']['detail'] = \"UP Source $updsource CD $common_dir SP $specific_dir\";\n $json_return['component']['name'] = $name;\n $json_return['component']['id'] = $comp_id;\n $this->set('json_return',$json_return);\n //--------------------------------------------\n\n }",
"public function save_course_request(){\n\t\t\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$course_id = (int)$_REQUEST['course_id'];\n\t\t\t$group_leader_id = (int)$_REQUEST['group_leader_id'];\n\t\t\t$request_text = $_REQUEST['request_text'];\n\t\t\t$status = $_REQUEST['request_status'];\n\t\t\t \n\t\t\t$data \t = array();\n\t\t\t$data['user_id'] \t = $user_id;\n\t\t\t$data['course_id']\t = $course_id;\n\t\t\t$data['request_text'] = $request_text;\n\t\t\t$data['request_status']= $status;\n\t\t\t$load = new Load();\n\t\t\t$typeModel = $load->model('course_request_model');\n\t\t\t$success_insert = $typeModel->save_course_request('course_request' , $data);\n\t\t\t$msg = array();\n\t\t\tif($success_insert){\n\t\t\t\t$msg['success_msg'] = \"Data has been added\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['success_msg']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$msg['error_msg'] = \"Cannot added data to server\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['error_msg']);\n\t\t\t}\n\t\t}",
"public function add_course()\n {\n $course_name = $this->input->post(\"course_name\");\n if($course_name==\"\"){\n echo \"please course/subject section is empty\";\n }else{\n $courses = $data = $this->security->xss_clean($course_name);\n $courses = $this->authadmin->sanitize_string($course_name);\n $total = $this->admin_student_courses_mdl->check_course($course_name);\n if($total==0){\n $data = array(\n 'course_name' => $course_name,\n );\n $this->admin_student_courses_mdl->add_course($data);\n echo \"new course/subject successfully added\"; \n }else{\n echo \"this course/subject already exist\";\n }\n }\n }",
"function add_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}",
"private function addSection() {\n // courseid, secNo, daysMet, startTime, endTime, totalReleasedSeats, building, room\n\n $courseID = $_POST['courseID'];\n $secNo = $_POST['secNo'];\n $daysMet = $_POST['daysMet'];\n $startTime = $_POST['startTime'];\n $endTime = $_POST['endTime'];\n $totalReleasedSeats = $_POST['totalReleasedSeats'];\n $building = $_POST['building'];\n $room = $_POST['room'];\n\n $this->openConn();\n\n $sql = \"SELECT DISTINCT term, secStartDate, secEndDate, sessionYear, sessionCode FROM Section WHERE courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID));\n\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $term = $row['term'];\n $secStartDate = $row['secStartDate'];\n $secEndDate = $row['secEndDate'];\n $sessionYear = $row['sessionYear'];\n $sessionCode = $row['sessionCode'];\n }\n\n $totalEnrolment = 0;\n $isOptimized = 0;\n $secType = \"LAB\";\n\n // if($row){\n //\n // }\n\n $sql2 = \"INSERT INTO Section (courseID, secNo, daysMet, startTime, endTime, totalReleasedSeats, totalEnrolment, building, room,\n term, isOptimized, secStartDate, secEndDate, sessionYear, sessionCode, secType)\n VALUES (:courseID, :secNo, :daysMet, :startTime, :endTime, :totalReleasedSeats, :totalEnrolment, :building, :room,\n :term, :isOptimized, :secStartDate, :secEndDate, :sessionYear, :sessionCode, :secType)\";\n $stmt2 = $this->conn->prepare($sql2);\n $stmt2->execute(array(':courseID'=> $courseID, ':secNo'=> $secNo, ':daysMet'=> $daysMet, ':startTime'=> $startTime, ':endTime'=> $endTime, ':totalReleasedSeats'=> $totalReleasedSeats, ':totalEnrolment'=> $totalEnrolment, ':building'=> $building, ':room'=> $room,\n ':term'=> $term, ':isOptimized'=> $isOptimized, ':secStartDate'=> $secStartDate, ':secEndDate'=> $secEndDate, ':sessionYear'=> $sessionYear, ':sessionCode'=> $sessionCode, ':secType'=> $secType));\n\n $this->closeConn();\n\n }",
"public static function addCourse()\n {\n global $cont;\n if(!empty($_POST['script']))\n {\n session_start();\n $_SESSION['message'] = \"you are script\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n $title = $_POST['title'];\n $price = $_POST['price'];\n $body = $_POST['body'];\n $categoryId = $_POST['cat_id'];\n \n $imageName = $_FILES['image']['name'];\n $imageType = $_FILES['image']['type'];\n $imageTmp = $_FILES['image']['tmp_name'];\n \n\n $imageExt = Courses::checkImageExt($imageType); \n\n if($imageExt == 0 )\n {\n session_start();\n $_SESSION['error'] = \"U Must Upload Correct File\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n\n \n $imageLink = dirname(__FILE__) . \"/../admin/pages/upload/courses/\";\n\n $avatarName = Courses::chekImageExist(time() . \"_\" . $imageName);\n\n move_uploaded_file($imageTmp , $imageLink.$avatarName);\n\n\n $courses = $cont->prepare(\"INSERT INTO courses(title , price , `image` , body , catagory_id) VALUES (? , ? , ? , ? , ?) \");\n $courses->execute([$title , $price , $avatarName , $body , $categoryId]);\n session_start();\n $_SESSION['message'] = \"course was created\";\n header(\"location:../admin/pages/tables/Courses.php\");\n \n }",
"function add_course(){\n\n\t\t$course_title =$this->input->post('course_title');\n\n\t\t$courses = array(\n\t\t\t'course_title' => $this->input->post('course_title'),\n\t\t\t'course_duration' => $this->input->post('duration'),\n\t\t\t'course_fees'=> $this->input->post('fees'),\n\t\t\t'course_description'=> $this->input->post('course_description'),\n\t\t);\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses \".$course_title ; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\t\t$this->setting_model->insert($courses,'course');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_view');\n\t\t\n\t}",
"function addAjax() {\n header('Content-Type: application/json');\n if (isset($_POST) && count($_POST) > 0) {\n $jobLineItemsWorkName = $this->input->post('jobLineItemsWorkName');\n $jobLineItemsDescription = $this->input->post('jobLineItemsDescription');\n $descCount = 0;\n\n $this->Jcline_model->delete_all_jcline_by_jcid($this->input->post('jobcardid'));\n foreach ($jobLineItemsWorkName as $workname) {\n $params = array(\n 'workname' => $workname,\n 'description' => $jobLineItemsDescription[$descCount],\n 'jobcardid' => $this->input->post('jobcardid')\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n $descCount++;\n }\n echo json_encode([\"success\" => true]);\n } else {\n echo json_encode([\"success\" => false]);\n }\n }",
"public function ajax_add_existing_question() {\n\t\t$challengeId = $this->input->post('challenge_id');\n $questionId = $this->input->post('question_id');\n\n\t\t$this->challenge_question_model->update_challenge_question_table($questionId, $challengeId, 0);\n $out = array('success' => true);\n $this->output->set_output(json_encode($out));\n\t}",
"public function add()\n {\n $course_description = new CourseDescription();\n $session_id = api_get_session_id();\n $course_description->set_session_id($session_id);\n\n $data = array();\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {\n if (1) {\n $title = $_POST['title'];\n $content = $_POST['contentDescription'];\n $description_type = $_POST['description_type'];\n if ($description_type >= ADD_BLOCK) {\n $course_description->set_description_type($description_type);\n $course_description->set_title($title);\n $course_description->set_content($content);\n $course_description->insert(api_get_course_int_id());\n }\n\n Display::addFlash(\n Display::return_message(\n get_lang('CourseDescriptionUpdated')\n )\n );\n }\n $this->listing(false);\n } else {\n $data['error'] = 1;\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_title'] = $_POST['title'];\n $data['description_content'] = $_POST['contentDescription'];\n $data['description_type'] = $_POST['description_type'];\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n } else {\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_type'] = $course_description->get_max_description_type();\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n }",
"public function create_course() {\n\n $data['get_all_courses'] = $this->courses_model->getCourses();\n\n \n //user access\n $data['view_access'] = $this->user_permission->has_permission('view_course' , 'access');\n $data['create_access'] = $this->user_permission->has_permission('create_course' , 'access');\n $data['edit_access'] = $this->user_permission->has_permission('edit_course' , 'access');\n \n \n // validate form input\n $this->form_validation->set_rules('course', \"Course\", 'required');\n $this->form_validation->set_rules('duration', \"Duration\", 'required');\n $this->form_validation->set_rules('fee', \"Fee\", 'required');\n\n\n if ($this->form_validation->run() == TRUE) {\n\n $status = $this->input->post('status');\n if ($status == 1) {\n $status = 1;\n } else {\n $status = 0;\n }\n\n $posted_data = array(\n 'name' => $this->input->post('course'),\n 'duration' => $this->input->post('duration'),\n 'fee' => $this->input->post('fee'),\n 'description' => $this->input->post('description'),\n 'status' => $status,\n );\n\n $new_course_id = $this->courses_model->create_course($posted_data);\n if ($new_course_id) {\n $data['message'] = $this->session->set_flashdata('message', \"Successfully added\");\n $this->load->template('index', $data);\n }\n } else {\n\n if (validation_errors()) {\n $data['message'] = validation_errors();\n $this->load->template('index', $data);\n }\n }\n }",
"public function bhadd(){\n $this->autoRender = false;\n $this->BullhornConnection->BHConnect();\n $params = $this->request->data; \n if(!isset($params['candidate_id'])){\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Candidate id is required!\"\n ]\n );\n exit;\n }\n if(isset($params['skill_ids']) && is_array($params['skill_ids'])){\n //pr($params);\n $skills = implode(',', $params['skill_ids']);\n $skillSetUpdate = \"\";\n list($categories,$skillsL,$catSkills) = $this->split_cat_skill($params['existingSkillSet']);\n $isDuplicated = array_count_values($skillsL);\n if(isset($params['existingSkillSet']) && isset($params['skillSet'])){\n $skillArr = array_filter(explode(',',$params['existingSkillSet']));\n $getIndex = array_search($params['skillSet'],$skillArr);\n //pr($skillArr);\n //echo $params['skillSet'];\n if($getIndex == false){\n $skillArr[] = $params['skillSet'];\n }\n\n $skillSetUpdate = implode(',',$skillArr);\n if(!isset($isDuplicated[$params['skill_ids'][0]])){\n $url = $_SESSION['BH']['restURL'] . '/entity/Candidate/'.$params['candidate_id'].'/primarySkills/'.$skills.'?BhRestToken=' . $_SESSION['BH']['restToken'];\n\n $post_params = json_encode([]);\n $req_method = 'PUT';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n }\n }\n /* if(isset($response['errors'])){ // if adding skill returns any errors\n echo json_encode([\n 'status' => 0,\n 'message' => $response \n ]); \n exit; \n }else{ */\n // $skillIds = []; \n $url = $_SESSION['BH']['restURL'] . '/entity/Candidate/' . $params['candidate_id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n\n $post_params = json_encode([\n 'id' => $params['candidate_id'],\n 'skillSet' => $skillSetUpdate\n ]);\n $req_method = 'POST';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n if(isset($response['data'])){\n list($categories,$skills,$catSkills) = $this->split_cat_skill($response['data']['skillSet']);\n /* foreach($response['data']['primarySkills']['data'] as $skill){\n $skillIds[] = $skill['id'];\n }*/\n if(empty($catSkills)){\n $result = $this->getSkills($skills); // returns duplicate skills with different category\n }else{\n $result = $this->getSkills($skills,'skill_id',$catSkills);\n }\n echo json_encode(\n [\n 'status' => 1,\n 'data' => isset($result['data'])?$result['data']:[],\n 'existingSkillSet' => $response['data']['skillSet'],\n ]\n );\n exit;\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'data' => $response\n ]\n );\n exit;\n }\n //}\n\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"skill ids are required and also it need to be in array format!\"\n ]\n );\n exit;\n }\n }",
"public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}",
"public function add_new_enrol() { \n $data['sideMenuData'] = fetch_non_main_page_content();\n $data['page_title'] = 'Class Trainee';\n $tenant_id = $this->tenant_id;\n $data['privilage'] = $this->manage_tenant->get_privilage();//added by shubhranshu\n $data['companies'] = $this->classtraineemodel->get_company_list($tenant_id);\n $data['main_content'] = 'classtrainee/addnewenroll';\n $this->load->view('layout', $data);\n }",
"public function fetch_course_name_for_merging()\n {\n $id = $this->input->get(\"id\");\n $id = $this->security->xss_clean(htmlspecialchars($id));\n if($id==\"\"){\n echo \"course name was not gotten there seems to be a problem\";\n }else{\n $get_course = $this->admin_student_courses_mdl->course_from_id($id);\n echo $get_course;\n }\n }",
"function addsubjectajaxAction(){\r\n \tif($this->getRequest()->isPost()){\r\n \t\t$data = $this->getRequest()->getPost();\r\n \t\t$_dbmodel = new Global_Model_DbTable_DbSubjectExam();\r\n \t\t$option=$_dbmodel->addSubjectajax($data);\r\n \t\t$result = array(\"id\"=>$option);\r\n \t\tprint_r(Zend_Json::encode($result));\r\n \t\texit();\r\n \t}\r\n }",
"public function createShareCourseMaterial() {\n $incomingFormData = $this->readHttpRequest();\n $formData = json_decode($incomingFormData);\n $createResult = $this->Coursematerial_model->createShareCourseMaterial($formData);\n// $shareCrsListFlag = 1;\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n if ($createResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }",
"public function add()\n {\n if ($this->form_validation->run('compadd')) {\n $this->complaint_model->add();\n if ($this->db->affected_rows()) {\n $array = array(\n 'success' => '<div class=\"alert alert-success\" role=\"alert\"><strong>Selamat! </strong>pesan Anda sudah terkirim. Untuk melihat status/balasan komplain silahakn klik menu \"Riwayat Komplain\"</div>'\n );\n } else {\n $array = array(\n 'danger' => '<div class=\"alert alert-danger\" role=\"alert\"><strong>Maaf! </strong>pesan Anda gagal dikirim.</div>'\n );\n };\n } else {\n $array = array(\n 'error' => true,\n 'title_error' => form_error('comp_title'),\n 'message_error' => form_error('comp_message')\n );\n }\n\n echo json_encode($array);\n }",
"public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }",
"function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }",
"public function actionSaveNoIncluye(){\r\n\r\n if(isset($_POST['ProgramaNoIncluye'])){\r\n\r\n $id = Yii::app()->request->getParam('id');\r\n $programa = $_POST['programa'];\r\n $msj = '';\r\n\r\n if(empty($id)){\r\n $model = new ProgramaNoIncluye();\r\n $model->attributes = $_POST['ProgramaNoIncluye'];\r\n $model->programa_id = $programa;\r\n $msj = 'insert';\r\n }else{\r\n $model = ProgramaNoIncluye::model()->findByPk($id);\r\n $model->attributes = $_POST['ProgramaNoIncluye'];\r\n $msj = 'update';\r\n }\r\n\r\n if($model->validate()){\r\n if($model->save()){\r\n\r\n $link = '<li id=\"li-'.$model->id.'\" class=\"list-group-item list-group-item-danger\">';\r\n $link .= '<i class=\"fa fa-check-square-o\"></i>'.$model->nombre;\r\n $link .= '<div class=\"action\">';\r\n $link .= CHtml::link('<i class=\"fa fa-pencil-square-o\"></i>','',array('onclick'=>\"js:openNoIncluye({$model->id})\"));\r\n $link .= Chtml::link('<i class=\"fa fa-trash-o\"></i>','',array('onclick'=>\"js:deleteNoIncluye({$model->id})\"));\r\n $link .= '</div>';\r\n $link .= '</li>';\r\n\r\n header(\"Content-type: application/json\");\r\n echo CJSON::encode(array(\r\n 'result'=> $msj,\r\n 'link' => $link,\r\n 'id' => $model->id,\r\n 'data' => $model->nombre\r\n ));\r\n exit;\r\n }\r\n }\r\n }\r\n header(\"Content-type: application/json\");\r\n echo CJSON::encode(array(\r\n 'result'=>true,\r\n 'data'=>$this->renderPartial('_formNoIncluye',array('model'=>$model,'programa'=>$programa),true)\r\n ));\r\n exit;\r\n }",
"public function add_course_view(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add course',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}",
"function create_course_subject(){\n\n\t\t$Input_course_id =$this->input->post('course');\n\n\t\t$course_data =$this->setting_model->Get_All('course');\n\n\t\tforeach ($course_data as $data) {\n\t\t\tif($data['course_id'] == $Input_course_id){\n\t\t\t\t$course_title =$data['course_title'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$courses_modules= array(\n\t\t\t'module_subjects' => implode(\" \", $this->input->post('myInputs')),\n\t\t\t'course_id' => $this->input->post('course'),\n\t\t);\t\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses subjects for\".$course_title; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\n\t\t$this->setting_model->insert($courses_modules,'course_module_subject');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Course Subjects Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_subject');\n\t}",
"public function courseAction(){\n\t\t\n\t\t$action = $this->input->post(\"action\");\n\t\tswitch($action){\n\t\t\tcase \"add\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->add($inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"New Course Added Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to save\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#===========================================================================================================\n\t\t\tbreak;\n\t\t\tcase \"get\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"courseID\", \"Course ID\", \"trim|required\");\n\t\t\t\t\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$id = $this->input->post(\"courseID\");\n\t\t\t\t\t$data['courseInfo'] = $this->course->get($id);\n\t\t\t\t\tif(!empty($data['courseInfo'])){\n\t\t\t\t\t\t$data['courseInfo']->duration = timeToDecimal($data['courseInfo']->duration);\n\t\t\t\t\t}\n\t\t\t\t\t$data['departments'] = $this->department->getAll();\n\t\t\t\t\tif($data){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'data' => $data\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to Load!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"update\":\n\t\t\t\t#======================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric|greater_than[29]\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->update($courseID, $inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Updated Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to update!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#=======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"delete\": \n\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\n\t\t\t\tif($this->course->delete($courseID)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Deleted Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to delete\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t}\n\t}",
"public function upload($curriculum, $course) {\n\n// $incomingFormData = $this->readHttpRequest();\n// $formData = json_decode($incomingFormData);\n\n $fileUploadResult = $this->Coursematerial_model->fileUpload($curriculum, $course);\n// $shareCrsListFlag = 1;\n if ($fileUploadResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }",
"function ajax_add() {\n\t\t$result = array(\n\t\t\t'success' => false,\n\t\t\t'message' => 'default message'\n\t\t);\n\t\t\n\t\tif (isset($_POST)) {\n\t\t\tif (isset($_POST['author']) && isset($_POST['email']) && isset($_POST['subject']) && isset($_POST['body']) && isset($_POST['productId']) && isset($_POST['personalEmail']) && isset($_POST['workEmail'])) {\n\t\t\t\t$author = $_POST['author'];\n\t\t\t\t$email = $_POST['email'];\n\t\t\t\t$subject = $_POST['subject'];\n\t\t\t\t$body = $_POST['body'];\n\t\t\t\t$product_id = $_POST['productId'];\n\t\t\t\t$personal_email = $_POST['personalEmail'];\n\t\t\t\t$work_email = $_POST['workEmail'];\n\t\t\t\t\n\n\t\t\t\tif ($this->Comment->is_spam($body)) {\n\t\t\t\t\t$result['message'] = 'Váš komentář obsahuje zakázaná slova a je proto považován za SPAM. Kometář nebyl uložen.';\n\t\t\t\t} else {\n\t\t\t\t\t$comment = array(\n\t\t\t\t\t\t'Comment' => array(\n\t\t\t\t\t\t\t'author' => $author,\n\t\t\t\t\t\t\t'email' => $email,\n\t\t\t\t\t\t\t'subject' => $subject,\n\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'personal_email' => $personal_email,\n\t\t\t\t\t\t\t'work_email' => $work_email\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$this->Comment->create();\n\t\t\t\t\tif ($this->Comment->save($comment)) {\n\t\t\t\t\t\t// komentar byl vlozen, notifikace adminu o novem dotazu\n\t\t\t\t\t\t$this->Comment->notify_new_comment($this->Comment->id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$result['message'] = 'Váš kometář byl uložen ke zpracování. Po schválení se bude zobrazovat.';\n\t\t\t\t\t\t$result['success'] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result['message'] = 'Chyba při ukládání, zkontrolujte formulář a zkuste to prosím znovu.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result['message'] = 'Nejsou známá všechna potřebná formulářová pole.';\n\t\t\t}\n\t\t} else {\n\t\t\t$result['message'] = 'Neznám POST data';\n\t\t}\n\t\t\n\t\techo json_encode($result);\n\t\tdie();\n\t}",
"public function fetchCoursesInsert($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n $Year_Level_Block = '';\r\n\t // get the courses\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_landscapesubject'),array('a.IdSubject','a.SubjectType','a.IdSemester','a.CreditHours','a.UpdUser'))\r\n ->joinLeft(array('f'=>'tbl_subjectmaster'),' f.IdSubject = a.IdSubject ',array('f.courseDescription')) \r\n ->where('a.IdLandscape = ?',$landscapeID)\r\n ->where('a.IdProgram = ?',$programID);\r\n $result = $db->fetchAll($sql);\r\n \r\n // INSERT the courses\r\n $tableNAme = 'tbl_academicprogress_subjects';\r\n \r\n foreach($result as $values) {\r\n \r\n // get the year id for idsemester for a landscape if the landscpae is block based.\r\n if($studentdetails['LandscapeType']=='44') { \r\n $sqlBY = $db->select()\r\n ->from(array('by' => 'tbl_blocksemesteryear'),array('by.Year')) \r\n ->where('by.IdLandscape = ?',$landscapeID)\r\n ->where(\"by.YearSemester = ?\",$values['IdSemester']);\r\n $resultBy = $db->fetchRow($sqlBY); \r\n if(count($resultBy)>0) { $Year_Level_Block = $resultBy['Year']; }\r\n }\r\n \r\n // get the level id for idsemester for a landscape if the landscpae is level based.\r\n if($studentdetails['LandscapeType']=='42') { \r\n $sqlBL = $db->select()\r\n ->from(array('bl' => 'tbl_landscapeblocksemester'),array('bl.blockid')) \r\n ->where('bl.IdLandscape = ?',$landscapeID)\r\n ->where(\"bl.semesterid = ?\",$values['IdSemester']);\r\n $resultBL = $db->fetchRow($sqlBL);\r\n if(count($resultBL)>0) { $Year_Level_Block = $resultBL['blockid']; }\r\n }\r\n \r\n if($studentdetails['LandscapeType']=='43') {\r\n $Year_Level_Block = '';\r\n }\r\n \r\n $paramData = array(\r\n 'IdStudent' => $lintidreg,\r\n 'IdAcademicProgress' => $academicprogressID,\r\n 'Year_Level_Block' => $Year_Level_Block,\r\n 'Semester' => $values['IdSemester'],\r\n 'IdCourseType' => $values['SubjectType'],\r\n 'CourseID' => $values['IdSubject'],\r\n 'CourseDescription' => $values['courseDescription'],\r\n 'CreditHours' => $values['CreditHours'],\r\n 'Grade' => '',\r\n 'IsRegistered' => '0',\r\n 'UpdUser' => $values['UpdUser'],\r\n 'UpdDate' => date('Y-m-d H:i:s'),\r\n );\r\n $db->insert($tableNAme,$paramData); \r\n }\r\n \r\n }"
]
| [
"0.7340121",
"0.6612516",
"0.63692796",
"0.62752384",
"0.6167571",
"0.6139919",
"0.6110265",
"0.6075473",
"0.60590464",
"0.60541105",
"0.60468006",
"0.5952584",
"0.58993226",
"0.5861476",
"0.5836988",
"0.5827297",
"0.58088994",
"0.580705",
"0.5794801",
"0.57909715",
"0.5756418",
"0.5755837",
"0.5750361",
"0.5691228",
"0.5687027",
"0.5683784",
"0.5670763",
"0.5646466",
"0.56220216",
"0.56090343"
]
| 0.6956506 | 1 |
///////////////////////////////////////////////////////////////////////// / createJSONResponse() / / This method will return the JSON response to output so that the iPhone / application can parse the profile along with status object. If the / operation was not successul (i.e. the status object holds anything but / SUCCESS) then it will only send the error object. ///////////////////////////////////////////////////////////////////////// | public function createJSONResponse()
{
$json_array = array();
if ($this->status->getCode() != Status::SUCCESS)
{
// The operation failed. Send only the error
$json_array['Status'] = $this->status->membersToJsonFormat();
}
else
{
// Send the profile and the error
$json_array['Profile'] = $this->user->membersToJsonFormat();
$json_array['Status'] = $this->status->membersToJsonFormat();
}
return json_encode($json_array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function jsonResponse($status, $code, $html, $message = null) {\n $this->getResponse()\n ->setHeader('Content-Type', 'application/json')\n ->setHttpResponseCode($code)\n ->setBody(Zend_Json::encode(array(\"status\" => $status, \"html\" => $html, \"message\" => $message)))\n ->sendResponse();\n exit;\n }",
"public function json_response($message = null, $code = 200)\n\t{\n\t header_remove();\n\t // set the actual code\n\t http_response_code($code);\n\t // set the header to make sure cache is forced\n\t header(\"Cache-Control: no-transform,public,max-age=300,s-maxage=900\");\n\t // treat this as json\n\t header('Content-Type: application/json');\n\t $status = array(\n\t 200 => '200 OK',\n\t 400 => '400 Bad Request',\n\t 422 => 'Unprocessable Entity',\n\t 500 => '500 Internal Server Error'\n\t );\n\t // ok, validation error, or failure\n\t header('Status: '.$status[$code]);\n\t // return the encoded json\n\t return json_encode(array(\n\t 'status' => $code < 300, // success or not?\n\t 'message' => $message\n\t ));\n\t}",
"function jsonResponse($status, $message, $details) {\n\t\t\t$jsonData = array(\n\t\t\t\t'status' => $status,\n\t\t\t\t'message' => $message,\n\t\t\t\t'details' => $details\n\t\t\t);\n\n\t\t\techo json_encode($jsonData);\n\t\t}",
"function json_response($code = 200, $message = null, $error = false)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header('Cache-Control: no-transform,public,max-age=300,s-maxage=900');\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 201 => '201 Created',\n 400 => '400 Bad Request',\n 401 => '401 Unauthorized',\n 404 => '404 Not Found',\n 409 => '409 Conflict',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n if ($error){\n return json_encode(array(\n 'status' => $status[$code] === 200,\n 'error' => array('errorCode'=>0,'message' => $message)\n ));\n }\n return json_encode(array(\n 'success' => array('message' => $message)\n ));\n}",
"public function getResponse(): JsonResponse\n {\n return response()->json(['error' => [ 'code' => $this->error_code, 'message' => $this->message]], $this->httpCode);\n }",
"public function json()\n {\n $code = 200;\n\n if (!Request::has(\"no_response_code\") || Request::input('no_response_code') != \"yes\") {\n $code = $this->getCode();\n }\n\n return response()->json($this->getResponse(), $code);\n }",
"private function return_json($status = 200,$message = 'success',$data = null){\n\t\texit(json_encode(\n\t\t\tarray(\n\t\t\t\t'status' => $status,\n\t\t\t\t'message' => $message,\n\t\t\t\t'data' => $data\n\t\t\t)\n\t\t)\n\t\t);\n\t}",
"public static function jsonResponse($status,$array)\n {\n $array = [\n \"data\" => $array\n ];\n return self::respond($status,$array);\n }",
"public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}",
"function json_response($data = [], $message = null, $status = 200, array $headers = [], $options = 0)\n {\n return new JsonResponse(compact('data', 'status', 'message'), $status, $headers, $options);\n }",
"protected function responseJSON() {\n $response = array('success' => TRUE, 'shortUrl' => $this->shortUrl, 'images' => $this->response);\n header('Content-Type: application/json');\n echo json_encode($response);\n return TRUE;\n }",
"function json_response($code = 200, $message = null, $error = false)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header('Cache-Control: no-transform,public,max-age=300,s-maxage=900');\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 400 => '400 Bad Request',\n 404 => '404 Not Found',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n if ($error){\n return json_encode(array(\n 'status' => $status[$code] === 200,\n 'error' => array('errorCode'=>0,'message' => $message)\n ));\n }\n return json_encode(array(\n 'success' => array('message' => $message)\n ));\n}",
"private function __response( $json, $status = 200 )\n {\n header(\"HTTP/1.1 \" . $status . \" \" . $this->__requestStatus($status));\n header( \"Access-Control-Allow-Orgin: *\" );\n header( \"Access-Control-Allow-Methods: *\" );\n header( \"Content-Type: application/json\" );\n \n if(is_array($json) )\n {\n echo json_encode($json);\n }\n\n exit;\n }",
"protected function createResponse($json = NULL) {\n $response = new ResourceResponse();\n if ($json) {\n $response->setContent($json);\n }\n return $response;\n }",
"private function build_response_json( $success = false, $error = true, $code =null, $message = null, $type = null, $data = null, $breadcrumb = null, $html = null )\n\t{\n\t\treturn json_encode( array(\n\t\t\t'success' => $success,\n\t\t\t'error' => $error,\n\t\t\t'code' => (int) $code,\n\t\t\t'message' => $message,\n\t\t\t'type' => $type,\n\t\t\t'data' => $data,\n\t\t\t'breadcrumb' => $breadcrumb,\n\t\t\t'html' => $html,\n\t\t) );\n\t}",
"public function json_response($status = 0, $val = array(), $message = FALSE)\n {\n $success = FALSE;\n \n if ($status == $this->json_status['error']) {\n $message = $message ? $message : lang('json_error');\n } else \n if ($status == $this->json_status['success']) {\n $message = $message ? $message : lang('json_success');\n $success = TRUE;\n } else \n if ($status == $this->json_status['no_data']) {\n $message = $message ? $message : lang('no_data');\n } else {\n $message = $message ? $message : lang('no_data');\n }\n \n return json_encode(array(\n 'success' => $success,\n 'status' => $status,\n 'message' => $message,\n 'result' => $val\n ));\n }",
"public function toJson(){\n $info = array(\n \"status\" => $this->status,\n \"authorizedAmount\" => $this->authorizedAmount,\n \"lastFour\" => $this->lastFour,\n \"cardType\" => $this->cardType,\n \"currency\" => $this->currency,\n \"paymentProfileId\" => $this->paymentProfileId\n );\n\n $error = array(\n \"status\" => \"Server returned a \" . $this->status . \"status code.\",\n \"body\" => \"Response Body: <pre>\" . print_r($this->respBody,true) . \"</pre>\",\n \"curlInfo\" => \"Curl Info: <pre>\" . print_r($this->log,true) . \"</pre>\"\n );\n\n return json_encode($this->hasError ? $error : $info);\n }",
"public function json($datas = [], $status = 200) {\n\t\t$this->response\t\t= new Response();\n\n\t\t$this->response->setContent(\n\t\t\t$datas\n\t\t);\n\n\t\t$this->response->setStatusCode($status);\n\n\t\treturn $this->response;\n\t}",
"private function Response( $status, $message ) {\n\t\t// create response object\n\t\t$oResponse = new stdClass();\n\t\t$oResponse->status = $status;\n\t\t$oResponse->message = $message;\n\n\t\t// log response\n\t\t$this->LogResponse($oResponse);\n\n\t\t// output response to api client\n\t\techo json_encode($oResponse);\n\t\texit;\n\t}",
"public function jsonResponse(): string {\n\n header_remove();\n http_response_code(200);\n header('Content-Type: application/json');\n header('Status: 200');\n $response = [\n 'visited' => $this->visited,\n 'cleaned' => $this->cleaned,\n 'final' => $this->final,\n 'battery' => $this->battery\n ];\n\n return json_encode($response,JSON_PRETTY_PRINT);\n }",
"function get_json_result($message, $success) {\n\t\t$status = ($success) ? \"success\" : \"error\"; \n\t\techo json_encode([\n\t\t\t\"message\" => $message,\n\t\t\t\"status\" => $status\n\t\t]);\n\t}",
"protected function _json_response($data = array())\n\t{\n\t\t// set ajax headers\n\t\t$this->_ci->output->set_header(\"Expires: 0\");\n\t\t$this->_ci->output->set_header(\"Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t$this->_ci->output->set_header(\"Pragma: no-cache\");\n\t\t$this->_ci->output->set_header('Content-type: application/json; charset=utf-8');\n\n\t\t// output the json\n\t\tdie(json_encode($data));\n\t}",
"function json_response($message = 'Error', $code = 500, $data = null)\n{\n header('Content-Type: application/json');\n $response = array(\n 'code' => $code,\n 'data' => $data,\n 'message' => $message\n );\n http_response_code($code);\n echo json_encode($response);\n}",
"function response($status,$status_message,$data){\n header(\"HTTP/1.1 \".$status);\n $response['status']=$status;\n $response['status_message']=$status_message;\n $response['data']=$data;\n $json_response = json_encode($response);\n echo $json_response;\n}",
"function registerAPIResponse(){\n \n $authentication = new Authentication();\n \n if(isset($_POST['username'], $_POST['password'])){\n \n $username = $_POST['username'];\n $password = $_POST['password'];\n\n //Username is too long or short\n if(strlen($username) > 50 || strlen($username) < 1){\n\n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. Username must be between 1 and 50 characters.\"\n );\n\n http_response_code(409);\n\n }\n //Password is too long or short\n else if(strlen($password) > 255 || strlen($password) < 8){\n\n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. Password must be between 8 and 255 characters.\"\n );\n\n http_response_code(409);\n\n }\n else {\n\n $registerValidaton = $authentication->register($username, $password);\n \n //Unable to register\n if($registerValidaton === LoginConstants::UNABLE_REGISTER){\n \n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. This may be due to the username being already taken or an error.\"\n );\n \n http_response_code(409);\n \n \n }\n else {\n \n $return = array(\n 'status' => 200 ,\n 'message' => \"Register for $username was successful. Please login.\"\n );\n \n http_response_code(200);\n \n }\n\n }\n }\n \n //Send back response to client. \n print_r(json_encode($return));\n \n}",
"public function responseJson() {\n return Response::json($this->_responseData, $this->_responseCode);\n }",
"function failure($error) {\r\n $data = array();\r\n $data['success'] = false;\r\n $data['error'] = $error;\r\n\r\n header('Content-Type: application/json');\r\n exit(json_encode($data));\r\n}",
"public function prepareJSONResponse(int $status, $data): string\n {\n return json_encode(['status' => $status, 'message' => $data]);\n }",
"private function jsonResponse() {\n return json_format($this->response, $this->pretty);\n }",
"function response(\n $_status,\n $_info = false,\n $_data = false,\n $_error = false,\n $_success = false,\n $_default = false\n ) {\n header('Content-Type: application/json');\n print json_encode([\n 'status' => $_status,\n 'info' => $_info,\n 'data' => $_data,\n 'error' => $_error,\n 'success' => $_success,\n 'default' => $_default\n ]);\n exit(0);\n }"
]
| [
"0.655637",
"0.6509824",
"0.63844895",
"0.63839203",
"0.63462466",
"0.6301859",
"0.6283636",
"0.6273224",
"0.62719935",
"0.62586755",
"0.621284",
"0.62051564",
"0.61972684",
"0.6192168",
"0.61861074",
"0.6154327",
"0.61485696",
"0.61400616",
"0.6078888",
"0.6058823",
"0.603277",
"0.60252464",
"0.59967816",
"0.59796834",
"0.5971953",
"0.5947036",
"0.59397817",
"0.59389156",
"0.59358716",
"0.59310263"
]
| 0.8476488 | 0 |
Registers Course Notes as custom post type | function nt_register_course_note_create_type() {
$post_labels = array(
'name' => 'Course Notes',
'singular_name' => 'Course Notes',
'add_new' => 'Add New',
'add_new_item' => 'Add New Note',
'edit' => 'Edit',
'edit_item' => 'Edit Course Note',
'new_item' => 'New Course Note',
'view' => 'View Course Note',
'view_item' => 'View Course Note',
'search_term' => 'Search Notes',
'parent' => 'Parent Course Note',
'not_found' => 'No Notes Found',
'not_found_in_trash' => 'No Notes in Trash'
);
register_post_type( 'coursenote', array(
'labels' => $post_labels,
'public' => true,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'thumbnail','page-attributes' ),
'taxonomies' => array( 'post_tag', 'category' ),
'exclude_from_search' => false,
'capability_type' => 'post',
'rewrite' => array( 'slug' => 'Course Notes' ),
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function courses_custom_post_type (){\n\n $labels = array(\n 'name' => 'Courses',\n 'singular_name' => 'Course',\n 'add_new' => 'Add course',\n 'all_items' => 'All courses',\n 'add_new_item' => 'Add course',\n 'edit_item' => 'Edit course',\n 'new_item' => 'New course',\n 'view_item' => 'View course',\n 'search_item' => 'Search course',\n 'non_found' => 'No courses found',\n 'not_found_in_trash' => 'No courses found in trash',\n 'parent_item_colon' => 'Parent course'\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'publicly_queryable' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail',\n 'revisions',\n 'post-formats',\n 'custom-fields'\n ),\n 'menu_position' => 10,\n 'exclude_from_search' => false\n );\n register_post_type('courses',$args); \n}",
"function create_cmecourse() {\n\n\tregister_post_type( 'cmecourse',\n\t// CPT Options\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'CME Courses' ),\n\t\t\t\t'singular_name' => __( 'CME Course' ),\n\t\t\t'supports' => array('title,editor,thumbnail,comments,uvacme_id,uvacme_credit,uvacme_date,uvacme_time,uvacme_endtime,uvacme_status,uvacme_webpublish,uvacme_sponsorship,uvacme_progurl,uvacme_url,uvacme_facility,uvacme_city,uvasomcme_state,uvasomcme_thumb,uvasomcme_thumblink'),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array('slug' => 'cmecourse'),\n\t\t)\n\t);\n}",
"function db099_lifterlms_add_post_types($post_types) {\r\n\tif (in_array('course', get_post_types())) {\r\n\t\t$post_types[] = 'course';\r\n\t} \r\n\treturn $post_types;\r\n}",
"function tt_register_cpt($single, $plural = '') {\n if (empty($plural)) {\n $plural = $single.'s';\n }\n register_post_type(\n strtolower($single),\n array(\n 'label' => $plural,\n 'labels' => array(\n 'add_new_item' => \"Add New $single\",\n 'edit_item' => \"Edit $single\",\n 'new_item' => \"New $single\",\n 'view_item' => \"View $single\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $plural found\",\n 'not_found_in_trash' => \"No $plural found in Trash\",\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields',\n 'excerpt',\n ),\n 'taxonomies' => array('category'),\n )\n );\n}",
"function Simple_Release_Notes() {\n add_action( 'init', array( $this, 'register_custom_post_type' ) );\n\n // Add the custom taxonomies\n add_action( 'init', array( $this, 'register_custom_taxonomy' ), 1 );\n\n // Set up the new permalink for this structure\n add_action( 'init', array( $this, 'register_permalinks' ), 1 );\n\n // Handle our custom permalinks\n add_filter( 'post_type_link', array( $this, 'process_custom_permalink' ), 10, 3 );\n\n // Filter our custom type off the home page\n add_action( 'pre_get_posts', array( $this, 'customize_query_for_custom_type' ) );\n\n // On the posts page, add a Category column\n add_filter( 'manage_posts_columns', array( $this, 'add_taxonomy_column' ), 10, 1 );\n add_action( 'manage_posts_custom_column', array( $this, 'manage_taxonomy_column' ), 10, 2 );\n }",
"public function add_custom_post_types() {\n //\n }",
"function news_custom_post() {\n $args = array(\n 'public' => true,\n 'label' => 'News',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'show_ui' => true,\n 'publicly_queryable' => true,\n 'taxonomies' => array('category', 'post_tag'),\n 'rewrite' => array( 'slug' => 'news' )\n\t\n );\n register_post_type('news', $args);\n}",
"public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}",
"public function faculty_course_custom_posttypes() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Courses', 'Courses post type', 'academic' ),\n\t\t\t'singular_name' => _x( 'Course', 'Course', 'academic' ),\n\t\t\t'menu_name' => _x( 'Courses', 'admin menu', 'academic' ),\n\t\t\t'name_admin_bar' => _x( 'Course', 'add new on admin bar', 'academic' ),\n\t\t\t'add_new' => _x( 'Add New', 'Course', 'academic' ),\n\t\t\t'add_new_item' => __( 'Add New Course', 'academic' ),\n\t\t\t'new_item' => __( 'New Course', 'academic' ),\n\t\t\t'edit_item' => __( 'Edit Course', 'academic' ),\n\t\t\t'view_item' => __( 'View Course', 'academic' ),\n\t\t\t'all_items' => __( 'All Courses', 'academic' ),\n\t\t\t'search_items' => __( 'Search Course', 'academic' ),\n\t\t\t'parent_item_colon' => __( 'Parent Course:', 'academic' ),\n\t\t\t'not_found' => __( 'No Courses found.', 'academic' ),\n\t\t\t'not_found_in_trash' => __( 'No Courses found in Trash.', 'academic' )\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'description' => __( 'Adds Course post type.', 'academic' ),\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => _x( 'faculty_courses', 'courses', 'academic' ) ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'menu_position' => 6,\n\t\t\t'menu_icon' \t => 'dashicons-welcome-learn-more',\n\t\t\t'supports' => array( 'title', 'thumbnail', 'revisions')\n\t\t);\n\n\t\tregister_post_type( 'course', $args );\n\t}",
"function qode_lms_add_course_to_post_types_payment( $post_types ) {\n\t\tif ( qode_lms_qode_woocommerce_integration_installed() ) {\n\t\t\t$post_types[] = 'course';\n\t\t}\n\t\t\n\t\treturn $post_types;\n\t}",
"public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}",
"function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}",
"function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}",
"function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }",
"public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}",
"public function cws_register_cpt() {\n\n\t\tforeach ( $this->cpts as $key => $value ) {\n\n\t\t\tregister_post_type( $key, $value );\n\n\t\t}\n\n\t}",
"function create_news_custom_post() {\n register_post_type( 'news',\n array(\n 'labels' => array(\n 'name' => __( 'News' ),\n 'singular_name' => __( 'News Item' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail'\n )\n ));\n}",
"protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }",
"public function registerCustomPostTypes() {\n\n\n }",
"function nt_course_note_entry_field() {\nglobal $post;\n\n//ID's\n$current_user = get_current_user_id();\n$current_lesson_id = $post->ID;\n$current_post_type = get_post_type();\n\n//Checks if note exists and changes title and body variables accordingly\n$args = array(\n\t'post_type' => 'coursenote',\n\t'post_status' => array('draft'),\n\t'meta_query' => array(\n\t\t//'relation' => 'AND',\n\t\tarray(\n\t\t\t'key' => 'nt-note-current-lessson-id',\n\t\t\t'value' => $current_lesson_id,\n\t\t\t'compare' => '=',\n\t\t)\n\t),\n\t 'author' => $current_user\n);\n\n$the_query = new WP_Query( $args );\n\nif ($the_query->have_posts()){\n while ( $the_query->have_posts() ) : $the_query->the_post();\n\n $title = get_the_title();\n $body = get_the_content();\n\n endwhile;\n wp_reset_postdata();\n} else {\n\n\t$title = 'Note Title';\n\t$body = 'Enter Lesson Notes here';\n}\n\n\n\n?>\n\n <div id=\"nt_note_cont\" class=\"note-container\">\n <div class=\"note-header\">\n <div class=\"note-header-title\">\n <?php _e('Notes'); ?>\n\t\t\t\t<div id=\"apf-response\"></div>\n </div>\n <div class=\"note-header-actions\">\n\n </div>\n </div>\n <div class=\"note-body\">\n <form id=\"nt-course-note\" action=\"\" method=\"post\">\n\t\t\t\t\t<?php wp_nonce_field( basename(__FILE__), 'nt-course-note-nonce') ?>\n\t\t\t\t\t<input type=\"text\" name=\"nt-note-title\" id=\"nt-note-title\" value=\"<?php echo $title; ?>\" placeholder=\"\" >\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-user-id\" id=\"nt-note-user-id\" value=\"<?php echo $current_user; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-lesson-id\" id=\"nt-note-current-lessson-id\" value=\"<?php echo $current_lesson_id; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-post-type\" id=\"nt-note-current-post-type\" value=\"<?php echo $current_post_type; ?>\">\n\t\t\t\t\t<textarea rows=\"8\" name=\"nt-note-body\" id=\"nt-note-body\" class=\"\" placeholder=\"\"/><?php echo $body; ?></textarea>\n\t\t\t\t\t<input type=\"text\" id=\"xyz\" name=\"<?php echo apply_filters( 'honeypot_name', 'date-submitted') ?>\" value=\"\" style=\"display:none\">\n <input type=\"submit\" id=\"nt-note-submit\" value=\"<?php _e('Save Notes'); ?>\"/>\n </form>\n\n </div>\n\n </div>\n <?php\n\n}",
"function gndt_register_cpt_publishing() {\n register_post_type('gndt_research',\n array(\n 'labels' => array(\n 'name' => __('Research', 'textdomain'),\n 'singular_name' => __('Research', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => true,\n\t\t \t\t'show_in_rest' => true,\n 'supports' => ['editor'], /* allow gutenberg editor for this post type */\n 'capability_type' => 'gndt_researchposttype',\n\t\t\t \t'capabilities' => array(\n\t\t\t\t\t 'publish_posts' => 'gndt_publish_researchposttypes',\n\t\t\t\t\t 'edit_posts' => 'gndt_edit_researchposttypes',\n\t\t\t\t\t 'edit_others_posts' => 'gndt_edit_others_researchposttypes',\n\t\t\t\t\t 'read_private_posts' => 'gndt_read_private_researchposttypes',\n\t\t\t\t\t 'edit_post' => 'gndt_edit_researchposttype',\n\t\t\t\t\t 'delete_post' => 'gndt_delete_researchposttype',\n\t\t\t\t\t 'read_post' => 'gndt_read_researchposttype',\n\t\t\t\t ),\n )\n );\n\n\tadd_post_type_support( 'gndt_research', 'author' ); //add author support to custom post type \n}",
"function add_post_types_and_taxonomies()\n{\n\n\t/* Common Labels */\n\t$labels = array(\n\t\t'add_new' => __( 'Add New', 'gladtidings' ),\n\t\t'not_found' => __( 'Not found', 'gladtidings' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'gladtidings' ),\n\t);\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => true, //defaults to 'public'\n\t\t'show_in_menu' => true, //defaults to 'show_ui'\n\t\t'show_in_admin_bar' => true, // defaults to 'show_in_menu'\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Course */\n\t$course_labels = $labels + array(\n\t\t'name' => _x( 'Courses', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Course', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Courses', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add New Course', 'gladtidings' ),\n\t\t'new_item' => __( 'New Course', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Course', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Course', 'gladtidings' ),\n\t\t'view_item' => __( 'View Course', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Courses', 'gladtidings' ),\n\t\t'items_list' => __( 'Course list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Course list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter course list', 'gladtidings' ),\n\t);\n\t$course_args = $args + array(\n\t\t'label' => __( 'Course', 'gladtidings' ),\n\t\t'description' => __( 'Courses consisting of separate Units with Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $course_labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'page-attributes' ),\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\tregister_post_type( 'course', $course_args );\n\n\t/* Lesson */\n\t$lesson_labels = $labels + array(\n\t\t'name' => _x( 'Lessons', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Lesson', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Lessons', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Lesson', 'gladtidings' ),\n\t\t'new_item' => __( 'New Lesson', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Lesson', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Lesson', 'gladtidings' ),\n\t\t'view_item' => __( 'View Lesson', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Lesson', 'gladtidings' ),\n\t\t'items_list' => __( 'Lessons list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Lessons list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Lessons list', 'gladtidings' ),\n\t);\n\t$lesson_args = $args + array(\n\t\t'label' => __( 'Lesson', 'gladtidings' ),\n\t\t'description' => __( 'Individual Videos Lessons', 'gladtidings' ),\n\t\t'labels' => $lesson_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-video-alt2',\n\t);\n\tregister_post_type( 'lesson', $lesson_args );\n\n\t/* Quizzes */\n\t$quizz_labels = $labels + array(\n\t\t'name' => _x( 'Quizzes', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Quizz', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Quizzes', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Quizz', 'gladtidings' ),\n\t\t'new_item' => __( 'New Quizz', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Quizz', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Quizz', 'gladtidings' ),\n\t\t'view_item' => __( 'View Quizz', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Quizz', 'gladtidings' ),\n\t\t'items_list' => __( 'Quizzes list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Quizzes list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Quizzes list', 'gladtidings' ),\n\t);\n\t$quizz_args = $args + array(\n\t\t'label' => __( 'Quizz', 'gladtidings' ),\n\t\t'description' => __( 'Individual Quizzes', 'gladtidings' ),\n\t\t'labels' => $quizz_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'quizz', $quizz_args );\n\n\t/* Exams */\n\t$exam_labels = $labels + array(\n\t\t'name' => _x( 'Exams', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Exam', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Exams', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Exam', 'gladtidings' ),\n\t\t'new_item' => __( 'New Exam', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Exam', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Exam', 'gladtidings' ),\n\t\t'view_item' => __( 'View Exam', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Exam', 'gladtidings' ),\n\t\t'items_list' => __( 'Exams list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Exams list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Exams list', 'gladtidings' ),\n\t);\n\t$exam_args = $args + array(\n\t\t'label' => __( 'Exam', 'gladtidings' ),\n\t\t'description' => __( 'Individual Exams', 'gladtidings' ),\n\t\t'labels' => $exam_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'exam', $exam_args );\n\n\n\n\t/**\n\t * Register Virtual Custom Post Types\n\t * These are just for internal reference, they have no admin ui and are created in gt_relationships\n\t */\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => false,\n\t\t'can_export' => false,\n\t\t'has_archive' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Units */\n\t$unit_labels = array(\n\t\t'name' => _x( 'Units', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$unit_args = $args + array(\n\t\t'label' => __( 'Unit', 'gladtidings' ),\n\t\t'description' => __( 'Units consisting of Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $unit_labels,\n\t);\n\tregister_post_type( 'unit', $unit_args );\n\n\n\t/* Headline */\n\t$headline_labels = array(\n\t\t'name' => _x( 'Headlines', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Headline', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$headline_args = $args + array(\n\t\t'label' => __( 'Headline', 'gladtidings' ),\n\t\t'description' => __( 'Individual Headlines', 'gladtidings' ),\n\t\t'labels' => $headline_labels,\n\t);\n\tregister_post_type( 'headline', $headline_args );\n\n\n\t/**\n\t * Add custom post status for unit\n\t * - 'success' - the unit is sucessfully finished (user specific)\n\t * - 'active' - the unit was started, but is not finished (user specific)\n\t * - 'publish' - the unit is open, but not yet started (wp builtin)\n\t * - 'locked' - the unit is visible, but not accessible\n\t * - 'coming' - the unit is anounced for a future date, but visible (other than builtin 'future')\n\t * - 'draft' - the unit is not visible (wp builtin)\n\t */\n\tregister_post_status( 'locked', array( 'public' => true, 'label' => __( 'Locked', 'gladtidings' ) ) );\n\tregister_post_status( 'coming', array( 'public' => true, 'label' => __( 'Coming soon', 'gladtidings' ) ) );\n\n\n\t/**\n\t * Create a variable in $wpdb for the wp_gt_relationships table\n\t */\n\tglobal $wpdb;\n\t$wpdb->gt_relationships = $wpdb->prefix . \"gt_relationships\";\n\n\n}",
"function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}",
"function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}",
"function cfwprapi_register_cpt_todos() {\n\n register_post_type( 'todo', array(\n 'labels' => array(\n 'name' => _x( 'Todos', 'Post Type General Name', 'cfwprapi' ),\n 'singular_name' => _x( 'Todo', 'Post Type Singular Name', 'cfwprapi' ),\n 'menu_name' => __( 'Todos', 'cfwprapi' ),\n 'name_admin_bar' => __( 'Todo', 'cfwprapi' ),\n 'parent_item_colon' => __( 'Parent Todos:', 'cfwprapi' ),\n 'all_items' => __( 'All Todos', 'cfwprapi' ),\n 'add_new_item' => __( 'Add New Todo', 'cfwprapi' ),\n 'add_new' => __( 'Add New', 'cfwprapi' ),\n 'new_item' => __( 'New Todo', 'cfwprapi' ),\n 'edit_item' => __( 'Edit Todo', 'cfwprapi' ),\n 'update_item' => __( 'Update Todo', 'cfwprapi' ),\n 'view_item' => __( 'View Todo', 'cfwprapi' ),\n 'search_items' => __( 'Search Todos', 'cfwprapi' ),\n 'not_found' => __( 'Not found', 'cfwprapi' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'cfwprapi' ),\n ),\n 'supports' => array(\n 'title',\n 'editor',\n ),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-media-text',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'has_archive' => 'todo',\n 'rewrite' => array(\n 'with_front' => false,\n 'slug' => 'Todos',\n ),\n 'show_in_rest' => true,\n ) );\n}",
"function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }",
"function register_post_types(){\n }",
"function cadastrando_post_type_clientes() {\n\n $nomeSingular = 'Cliente';\n $nomePlural = 'Clientes';\n $descricao = 'Clientes da minha empresa';\n\n $labels = array(\n 'name' => $nomePlural,\n 'name_singular' => $nomeSingular,\n 'add_new_item' => 'Adicionar novo ' . $nomeSingular,\n 'edit_item' => 'Editar ' . $nomeSingular\n );\n\n $supports = array(\n 'title',\n 'editor',\n 'thumbnail'\n );\n\n $args = array(\n 'labels' => $labels,\n 'description' => $descricao,\n 'public' => true,\n 'menu_icon' => 'dashicons-id-alt',\n 'supports' => $supports\n );\n\n register_post_type( 'cliente', $args);\n}",
"function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}",
"function register_post_types(){\n }"
]
| [
"0.6953161",
"0.67703384",
"0.6549829",
"0.6466879",
"0.6453754",
"0.6426882",
"0.64204943",
"0.6400464",
"0.6392772",
"0.6388003",
"0.63603806",
"0.6349964",
"0.63493836",
"0.63026845",
"0.6274581",
"0.62579477",
"0.6244729",
"0.62369424",
"0.62205845",
"0.6216684",
"0.6209176",
"0.62036556",
"0.61834407",
"0.61752033",
"0.6168831",
"0.6157798",
"0.61571807",
"0.61554927",
"0.6151371",
"0.6145525"
]
| 0.8126819 | 0 |
Adds Course Note taxonomies | function nt_regsiter_taxonomy() {
$labels = array(
'name' => 'Course Note Categories',
'singular_name' => 'Course Note Category',
'search_items' => 'Search Course Notes Categories',
'all_items' => 'All Course Note Categories',
'edit_item' => 'Edit Course Note Category',
'update_item' => 'Update Course Note Category',
'add_new_item' => 'Add New Course Note Category',
'new_item_name' => 'New Course Note Category',
'menu_name' => 'Course Note Categories'
);
// register taxonomy
register_taxonomy( 'coursenotecat', 'coursenote', array(
'hierarchical' => true,
'labels' => $labels,
'query_var' => true,
'show_admin_column' => true
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nt_register_course_note_create_type() {\n\t$post_labels = array(\n\t\t'name' \t\t\t => 'Course Notes',\n\t\t'singular_name' \t=> 'Course Notes',\n\t\t'add_new' \t\t => 'Add New',\n\t\t'add_new_item' \t=> 'Add New Note',\n\t\t'edit'\t\t => 'Edit',\n\t\t'edit_item'\t => 'Edit Course Note',\n\t\t'new_item'\t => 'New Course Note',\n\t\t'view' \t\t\t => 'View Course Note',\n\t\t'view_item' \t\t=> 'View Course Note',\n\t\t'search_term' \t=> 'Search Notes',\n\t\t'parent' \t\t => 'Parent Course Note',\n\t\t'not_found' \t\t=> 'No Notes Found',\n\t\t'not_found_in_trash' \t=> 'No Notes in Trash'\n\t);\n\n\tregister_post_type( 'coursenote', array(\n\t\t'labels' => $post_labels,\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail','page-attributes' ),\n\t\t'taxonomies' => array( 'post_tag', 'category' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t'rewrite' => array( 'slug' => 'Course Notes' ),\n\t)\n\t );\n\n}",
"function custom_taxonomies_for_courses() {\n\n // add new taxonomy - type\n $labels = array(\n 'name' => 'Type',\n 'singular_name' => 'Type',\n 'search_items' => 'Search',\n 'all_items' => 'All',\n 'parent_item' => 'Parent',\n 'parent_item_colon' => 'Parent type:',\n 'edit_item' => 'Edit',\n 'update_item' => 'Update',\n 'add_new_item' => 'Add new',\n 'new_item_name' => 'New Type Field',\n 'menu_name' => 'Type'\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'type')\n );\n\n register_taxonomy('type', array('courses'), $args);\n\n}",
"public function addTaxonomies() {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'taxonomies', [\n 'get_callback' => function ($post) use ($post_type) {\n return self::getTermSchema($post_type, $post);\n },\n ]);\n }\n }",
"function create_taxonomies() \n{\n register_taxonomy(\n 'location',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Location',\n 'add_new_item' => 'Add New Location',\n 'new_item_name' => \"New Location\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n \n register_taxonomy(\n 'category',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Category',\n 'add_new_item' => 'Add New Category',\n 'new_item_name' => \"New Category\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n}",
"function add_post_types_and_taxonomies()\n{\n\n\t/* Common Labels */\n\t$labels = array(\n\t\t'add_new' => __( 'Add New', 'gladtidings' ),\n\t\t'not_found' => __( 'Not found', 'gladtidings' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'gladtidings' ),\n\t);\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => true, //defaults to 'public'\n\t\t'show_in_menu' => true, //defaults to 'show_ui'\n\t\t'show_in_admin_bar' => true, // defaults to 'show_in_menu'\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Course */\n\t$course_labels = $labels + array(\n\t\t'name' => _x( 'Courses', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Course', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Courses', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add New Course', 'gladtidings' ),\n\t\t'new_item' => __( 'New Course', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Course', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Course', 'gladtidings' ),\n\t\t'view_item' => __( 'View Course', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Courses', 'gladtidings' ),\n\t\t'items_list' => __( 'Course list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Course list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter course list', 'gladtidings' ),\n\t);\n\t$course_args = $args + array(\n\t\t'label' => __( 'Course', 'gladtidings' ),\n\t\t'description' => __( 'Courses consisting of separate Units with Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $course_labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'page-attributes' ),\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\tregister_post_type( 'course', $course_args );\n\n\t/* Lesson */\n\t$lesson_labels = $labels + array(\n\t\t'name' => _x( 'Lessons', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Lesson', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Lessons', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Lesson', 'gladtidings' ),\n\t\t'new_item' => __( 'New Lesson', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Lesson', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Lesson', 'gladtidings' ),\n\t\t'view_item' => __( 'View Lesson', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Lesson', 'gladtidings' ),\n\t\t'items_list' => __( 'Lessons list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Lessons list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Lessons list', 'gladtidings' ),\n\t);\n\t$lesson_args = $args + array(\n\t\t'label' => __( 'Lesson', 'gladtidings' ),\n\t\t'description' => __( 'Individual Videos Lessons', 'gladtidings' ),\n\t\t'labels' => $lesson_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-video-alt2',\n\t);\n\tregister_post_type( 'lesson', $lesson_args );\n\n\t/* Quizzes */\n\t$quizz_labels = $labels + array(\n\t\t'name' => _x( 'Quizzes', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Quizz', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Quizzes', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Quizz', 'gladtidings' ),\n\t\t'new_item' => __( 'New Quizz', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Quizz', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Quizz', 'gladtidings' ),\n\t\t'view_item' => __( 'View Quizz', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Quizz', 'gladtidings' ),\n\t\t'items_list' => __( 'Quizzes list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Quizzes list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Quizzes list', 'gladtidings' ),\n\t);\n\t$quizz_args = $args + array(\n\t\t'label' => __( 'Quizz', 'gladtidings' ),\n\t\t'description' => __( 'Individual Quizzes', 'gladtidings' ),\n\t\t'labels' => $quizz_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'quizz', $quizz_args );\n\n\t/* Exams */\n\t$exam_labels = $labels + array(\n\t\t'name' => _x( 'Exams', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Exam', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Exams', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Exam', 'gladtidings' ),\n\t\t'new_item' => __( 'New Exam', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Exam', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Exam', 'gladtidings' ),\n\t\t'view_item' => __( 'View Exam', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Exam', 'gladtidings' ),\n\t\t'items_list' => __( 'Exams list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Exams list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Exams list', 'gladtidings' ),\n\t);\n\t$exam_args = $args + array(\n\t\t'label' => __( 'Exam', 'gladtidings' ),\n\t\t'description' => __( 'Individual Exams', 'gladtidings' ),\n\t\t'labels' => $exam_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'exam', $exam_args );\n\n\n\n\t/**\n\t * Register Virtual Custom Post Types\n\t * These are just for internal reference, they have no admin ui and are created in gt_relationships\n\t */\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => false,\n\t\t'can_export' => false,\n\t\t'has_archive' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Units */\n\t$unit_labels = array(\n\t\t'name' => _x( 'Units', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$unit_args = $args + array(\n\t\t'label' => __( 'Unit', 'gladtidings' ),\n\t\t'description' => __( 'Units consisting of Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $unit_labels,\n\t);\n\tregister_post_type( 'unit', $unit_args );\n\n\n\t/* Headline */\n\t$headline_labels = array(\n\t\t'name' => _x( 'Headlines', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Headline', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$headline_args = $args + array(\n\t\t'label' => __( 'Headline', 'gladtidings' ),\n\t\t'description' => __( 'Individual Headlines', 'gladtidings' ),\n\t\t'labels' => $headline_labels,\n\t);\n\tregister_post_type( 'headline', $headline_args );\n\n\n\t/**\n\t * Add custom post status for unit\n\t * - 'success' - the unit is sucessfully finished (user specific)\n\t * - 'active' - the unit was started, but is not finished (user specific)\n\t * - 'publish' - the unit is open, but not yet started (wp builtin)\n\t * - 'locked' - the unit is visible, but not accessible\n\t * - 'coming' - the unit is anounced for a future date, but visible (other than builtin 'future')\n\t * - 'draft' - the unit is not visible (wp builtin)\n\t */\n\tregister_post_status( 'locked', array( 'public' => true, 'label' => __( 'Locked', 'gladtidings' ) ) );\n\tregister_post_status( 'coming', array( 'public' => true, 'label' => __( 'Coming soon', 'gladtidings' ) ) );\n\n\n\t/**\n\t * Create a variable in $wpdb for the wp_gt_relationships table\n\t */\n\tglobal $wpdb;\n\t$wpdb->gt_relationships = $wpdb->prefix . \"gt_relationships\";\n\n\n}",
"function create_taxonomies() {\n\t// taxonomy_init(\n\t// \t$settings = array(\n\t// \t\t'slug' \t=> 'sample',\t\t\t// Required\n\t// \t\t'singular' \t=> 'Sample',\t\t\t// Required\n\t// \t\t'plural' \t=> 'Samples',\t\t\t// Required\n\t// \t\t'post_types'\t=> 'your_CPT',\t\t\t// Required\n\t// \t)\n\t// );\n}",
"function add_custom_taxonomies() {\n // Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Competency', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Competencies' ),\n 'all_items' => __( 'All Competencies' ),\n 'parent_item' => __( 'Parent Competency' ),\n 'parent_item_colon' => __( 'Parent Competency:' ),\n 'edit_item' => __( 'Edit Competency' ),\n 'update_item' => __( 'Update Competency' ),\n 'add_new_item' => __( 'Add New Competency' ),\n 'new_item_name' => __( 'New Competency Name' ),\n 'menu_name' => __( 'Competency Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'competency_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n add_custom_post_type();\n create_new_topic_index();\n add_metadata_taxonomies();\n}",
"public function create_taxonomies() {\n \n }",
"protected function addTaxonomyConfigs()\n {\n // TODO: add taxonomy configs\n }",
"function wpm_add_taxonomies() {\n\t// Taxonomie Lieux\n\n\t$labels_lieux = array(\n\t\t'name' => _x( 'Lieux', 'taxonomy general name'),\n\t\t'singular_name' => _x( 'Lieu', 'taxonomy singular name'),\n\t\t'search_items' => __( 'Rechercher un lieu'),\n\t\t'popular_items' => __( 'Lieux populaires'),\n\t\t'all_items' => __( 'Tous les lieux'),\n\t\t'edit_item' => __( 'Editer un lieu'),\n\t\t'update_item' => __( 'Mettre à jour un lieu'),\n\t\t'add_new_item' => __( 'Ajouter un nouveau lieu'),\n\t\t'new_item_name' => __( 'Nom du nouveau lieu'),\n\t\t'separate_items_with_commas' => __( 'Séparer les lieux avec une virgule'),\n\t\t'add_or_remove_items' => __( 'Ajouter ou supprimer un lieu'),\n\t\t'choose_from_most_used' => __( 'Choisir parmi les plus utilisés'),\n\t\t'not_found' => __( 'Pas de lieu trouvé'),\n\t\t'menu_name' => __( 'Lieux'),\n\t);\n\n\t$args_lieux = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_lieux,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'lieux' ),\n\t);\n\n\tregister_taxonomy( 'lieux', 'actus', $args_lieux );\n}",
"function axiom_create_testimonial_taxonomies() \n{ \n //labels for Testimonial Category:\n $testi_category_labels = array(\n 'name' => _x( 'Testimonial Category' , \"Staff's Departmans general name\" , 'default' ),\n 'singular_name' => _x( \"Testimonial Category' , 'Staff's Departmans singular name\", 'default' ),\n 'search_items' => __( 'Search in Testimonial Categories' , 'default'),\n 'all_items' => __( 'All Testimonial Categories' , 'default'),\n 'most_used_items' => null,\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Testimonial Category' , 'default'), \n 'update_item' => __( 'Update Testimonial Category' , 'default'),\n 'add_new_item' => __( 'Add new Category' , 'default'),\n 'new_item_name' => __( 'New Testimonial Category' , 'default'),\n 'menu_name' => __( 'Categories' , 'default'),\n );\n \n register_taxonomy('testimonial-category', array('testimonial'), array(\n 'hierarchical' => true,\n 'labels' => $testi_category_labels,\n 'singular_name' => 'testimonial-category',\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'testimonial-category' )\n ));\n}",
"private function registerTax() {\n $labels = array(\n 'name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n 'singular_name' => esc_html__('Masonry Gallery Category', 'eltdf-core'),\n 'search_items' => esc_html__('Search Masonry Gallery Categories', 'eltdf-core'),\n 'all_items' => esc_html__('All Masonry Gallery Categories', 'eltdf-core'),\n 'parent_item' => esc_html__('Parent Masonry Gallery Category', 'eltdf-core'),\n 'parent_item_colon' => esc_html__('Parent Masonry Gallery Category:', 'eltdf-core'),\n 'edit_item' => esc_html__('Edit Masonry Gallery Category', 'eltdf-core'),\n 'update_item' => esc_html__('Update Masonry Gallery Category', 'eltdf-core'),\n 'add_new_item' => esc_html__('Add New Masonry Gallery Category', 'eltdf-core'),\n 'new_item_name' => esc_html__('New Masonry Gallery Category Name', 'eltdf-core'),\n 'menu_name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'masonry-gallery-category' ),\n ));\n }",
"function setupTaxonomy()\n\t{\n\t\t$labels = array(\n\t\t\t\t'name' => 'Skills',\n\t\t\t\t'add_new_item' => 'Add New Skill',\n\t\t\t\t'new_item_name' => \"New Skill\"\n\t\t);\n\t\t\n\t\t$args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'labels' \t=> $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'update_count_callback' => '_update_post_term_count',\n\t\t\t'query_var' => true,\n\t\t\t//'rewrite' => array( 'slug' => 'writer' ),\n\t\t\t'show_tagcloud' \t\t=> true\n\t\t);\n\n\t\tregister_taxonomy( 'skills', 'iru_positions', $args );\n\t\tregister_taxonomy_for_object_type( 'skills', 'iru_positions' );\n\t}",
"function register_custom_taxonomies() {\n $labels = array(\n 'name' => _x( 'Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Categories' ),\n 'all_items' => __( 'All Categories' ),\n 'parent_item' => __( 'Parent Category' ),\n 'parent_item_colon' => __( 'Parent Category:' ),\n 'edit_item' => __( 'Edit Category' ), \n 'update_item' => __( 'Update Category' ),\n 'add_new_item' => __( 'Add New Category' ),\n 'new_item_name' => __( 'New Category' ),\n 'menu_name' => __( 'Categories' ),\n );\n\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array (\n 'hierarchical' => true\n )\n );\n\n register_taxonomy( 'featured_tax', 'lwa_feature', $args );\n register_taxonomy( 'news_tax', 'lwa_news', $args );\n\n $carousel_labels = array(\n 'name' => _x( 'Settings', 'taxonomy general name' ),\n 'singular_name' => _x( 'Settings', 'taxonomy singular name' ),\n 'menu_name' => __( 'Choose post settings' ),\n );\n\n $carousel_args = array(\n 'labels' => $carousel_labels,\n 'hierarchical' => true\n );\n register_taxonomy( 'carousel', 'lwa_carousel', $carousel_args );\n}",
"function briavers_register_tips_and_tricks_taxonomies(){\n $labels = array(\n 'name' => 'Types',\n 'singular_name' => 'Type',\n 'search_items' => 'Search type',\n 'all_items' => 'All types',\n 'edit_item' => 'Edit type',\n 'update_item' => 'Update type',\n 'add_new_item' => 'Add New type',\n 'new_item_name' => ' New type name',\n 'menu_name' => 'Types',\n 'not_found' => __('Types not found', 'briavers'),\n 'not_found_in_trash' => __('Type not found in trash', 'briavers'),\n );\n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'type'),\n 'show_in_rest' => true,\n 'rest_base' => 'type',\n\n );\n\n register_taxonomy('type', array('tips_and_tools'), $args);\n}",
"function add_custom_taxonomies() {\n register_taxonomy('mechanic', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Mechanics', 'taxonomy general name' ),\n 'singular_name' => _x( 'Mechanic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Mechanics' ),\n 'all_items' => __( 'All Mechanics' ),\n 'parent_item' => __( 'Parent Mechanic' ),\n 'parent_item_colon' => __( 'Parent Mechanic:' ),\n 'edit_item' => __( 'Edit Mechanic' ),\n 'update_item' => __( 'Update Mechanic' ),\n 'add_new_item' => __( 'Add New Mechanic' ),\n 'new_item_name' => __( 'New Mechanic Name' ),\n 'menu_name' => __( 'Mechanics' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'mechanics', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n // Add new \"Locations\" taxonomy to Posts\n register_taxonomy('family', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Families', 'taxonomy general name' ),\n 'singular_name' => _x( 'Family', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Families' ),\n 'all_items' => __( 'All Families' ),\n 'parent_item' => __( 'Parent Family' ),\n 'parent_item_colon' => __( 'Parent Family:' ),\n 'edit_item' => __( 'Edit Family' ),\n 'update_item' => __( 'Update Family' ),\n 'add_new_item' => __( 'Add New Family' ),\n 'new_item_name' => __( 'New Family Name' ),\n 'menu_name' => __( 'Families' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'family', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n // Add new \"Locations\" taxonomy to Posts\n register_taxonomy('publisher', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Publishers', 'taxonomy general name' ),\n 'singular_name' => _x( 'Publisher', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Publishers' ),\n 'all_items' => __( 'All Publishers' ),\n 'parent_item' => __( 'Parent Publisher' ),\n 'parent_item_colon' => __( 'Parent Publisher:' ),\n 'edit_item' => __( 'Edit Publisher' ),\n 'update_item' => __( 'Update Publisher' ),\n 'add_new_item' => __( 'Add New Publisher' ),\n 'new_item_name' => __( 'New Publisher Name' ),\n 'menu_name' => __( 'Publishers' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'publisher', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n register_taxonomy('artists', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Artists', 'taxonomy general name' ),\n 'singular_name' => _x( 'Artist', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Artists' ),\n 'all_items' => __( 'All Artists' ),\n 'parent_item' => __( 'Parent Artist' ),\n 'parent_item_colon' => __( 'Parent Artist:' ),\n 'edit_item' => __( 'Edit Artist' ),\n 'update_item' => __( 'Update Artist' ),\n 'add_new_item' => __( 'Add New Artist' ),\n 'new_item_name' => __( 'New Artist Name' ),\n 'menu_name' => __( 'Artists' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'artists', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n register_taxonomy('designers', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Designers', 'taxonomy general name' ),\n 'singular_name' => _x( 'Designer', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Designers' ),\n 'all_items' => __( 'All Designers' ),\n 'parent_item' => __( 'Parent Designer' ),\n 'parent_item_colon' => __( 'Parent Designer:' ),\n 'edit_item' => __( 'Edit Designer' ),\n 'update_item' => __( 'Update Designer' ),\n 'add_new_item' => __( 'Add New Designer' ),\n 'new_item_name' => __( 'New Designer Name' ),\n 'menu_name' => __( 'Designers' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'designers', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n\n\n register_taxonomy('awards', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Awards', 'taxonomy general name' ),\n 'singular_name' => _x( 'Award', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Awards' ),\n 'all_items' => __( 'All Awards' ),\n 'parent_item' => __( 'Parent Award' ),\n 'parent_item_colon' => __( 'Parent Award:' ),\n 'edit_item' => __( 'Edit Award' ),\n 'update_item' => __( 'Update Award' ),\n 'add_new_item' => __( 'Add New Award' ),\n 'new_item_name' => __( 'New Award Name' ),\n 'menu_name' => __( 'Awards' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'awards', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n }",
"function create_my_taxonomies()\n{\n register_taxonomy('utilities', 'post', array('hierarchical' => true, 'label' => 'Utilities'));\n}",
"function register_taxonomies(){\n }",
"function add_metadata_taxonomies() {\n\t/*\n\tEducational use: http://schema.org/educationalUse e.g. http://purl.org/dcx/lrmi-vocabs/edUse/instruction\nEducational audience: http://schema.org/EducationalAudience e.g. http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/student\nInteractivity type: http://schema.org/interactivityType e.g. http://purl.org/dcx/lrmi-vocabs/interactivityType/expositive (active, expositive, or mixed)\nProficiency level: http://schema.org/proficiencyLevel (Beginner, Expert)\n\t*/\n\tadd_educational_use();\n\tadd_educational_audience();\n\tadd_interactivity_type();\n\tadd_proficiency_level();\n}",
"function create_testimonial_taxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n\n // Staff Categories\n $labels = array(\n 'name' => _x( 'Testimonial Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Testimonial Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Testimonial Categories' ),\n 'all_items' => __( 'All Categories' ),\n 'parent_item' => __( 'Parent Testimonial Categories' ),\n 'parent_item_colon' => __( 'Parent Testimonial Categories' ),\n 'edit_item' => __( 'Edit Testimonial Category' ),\n 'update_item' => __( 'Update Testimonial Category' ),\n 'add_new_item' => __( 'Add New Testimonial Category' ),\n 'new_item_name' => __( 'New Testimonial Category' ),\n 'menu_name' => __( 'Categories' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'testimonial_category' ),\n );\n\n register_taxonomy( 'testimonial_category', array( 'testimonials' , 'page' ), $args );\n}",
"function additional_taxonomies() {\r\n\tregister_taxonomy(\r\n\t\t'gradelevel',\r\n\t\t'post',\r\n\t\tarray(\r\n 'hierarchical' => true,\r\n\t\t\t'label' => __( 'Grade Level' ),\r\n\t\t\t'sort' => true,\r\n\t\t\t'args' => array( 'orderby' => 'term_order' ),\r\n\t\t\t'rewrite' => array( 'slug' => 'gradelevel' )\r\n\t\t)\r\n\t);\r\n \r\n register_taxonomy(\r\n\t\t'logotype',\r\n\t\t'logo',\r\n\t\tarray(\r\n 'hierarchical' => true,\r\n\t\t\t'label' => __( 'Logo Types' ),\r\n\t\t\t'sort' => true,\r\n\t\t\t'args' => array( 'orderby' => 'term_order' ),\r\n\t\t\t'rewrite' => array( 'slug' => 'logotype' )\r\n\t\t)\r\n\t);\r\n}",
"function register_taxonomies(){\n }",
"function cooma_create_location_taxo() {\n $labels = array(\n 'name' => 'Locations',\n 'singular_name' => 'Location',\n 'search_items' => 'Search Locations',\n 'popular_items' => 'Popular Locations',\n 'all_items' => 'All Locations',\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => 'Edit Location',\n 'update_item' => 'Update Location',\n 'add_new_item' => 'Add New Location',\n 'new_item_name' => 'New Location Name',\n 'separate_items_with_commas' => 'Separate locations with commas',\n 'add_or_remove_items' => 'Add or remove locations',\n 'choose_from_most_used' => 'Choose from the most used locations',\n 'not_found' => 'No locations found.',\n 'menu_name' => 'Locations'\n );\n\n register_taxonomy(\n 'event-location',\n ['event', 'event-recurring', 'accommodation', 'coffee_food_wine', 'groups_associations', 'attractions'],\n array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'query_var' => true\n )\n );\n}",
"function my_register_taxonomies() {\r\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"public function register_taxonomies()\n {\n }",
"function bw_create_taxonomies() {\n//first do the translations part for GUI\n \n $labels = array(\n 'name' => _x( 'Years', 'taxonomy general name' ),\n 'singular_name' => _x( 'Year', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Years' ),\n 'all_items' => __( 'All Years' ),\n 'parent_item' => __( 'Parent Year' ),\n 'parent_item_colon' => __( 'Parent Year:' ),\n 'edit_item' => __( 'Edit Year' ), \n 'update_item' => __( 'Update Year' ),\n 'add_new_item' => __( 'Add New Year' ),\n 'new_item_name' => __( 'New Year Name' ),\n 'menu_name' => __( 'Years' ),\n ); \n \n// Now register the taxonomy\n \n register_taxonomy('years',array('post'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'topic' ),\n ));\n \n}",
"function humcore_create_taxonomies() {\n\t// Add new taxonomy, make it hierarchical (like categories).\n\t$labels = array(\n\t\t'name' => _x( 'Subjects', 'taxonomy general name', 'humcore_domain' ),\n\t\t'singular_name' => _x( 'Subject', 'taxonomy singular name', 'humcore_domain' ),\n\t\t'search_items' => __( 'Search Subjects', 'humcore_domain' ),\n\t\t'all_items' => __( 'All Subjects', 'humcore_domain' ),\n\t\t'parent_item' => __( 'Parent Subject', 'humcore_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Subject:', 'humcore_domain' ),\n\t\t'edit_item' => __( 'Edit Subject', 'humcore_domain' ),\n\t\t'update_item' => __( 'Update Subject', 'humcore_domain' ),\n\t\t'add_new_item' => __( 'Add New Subject', 'humcore_domain' ),\n\t\t'new_item_name' => __( 'New Subject Name', 'humcore_domain' ),\n\t\t'menu_name' => __( 'Subjects', 'humcore_domain' ),\n\t);\n\n\t$args = array(\n\t\t'public' => false,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => false,\n\t\t'query_var' => false,\n\t\t'rewrite' => false,\n\t);\n\n\tregister_taxonomy( 'humcore_deposit_subject', array( 'humcore_deposit' ), $args );\n\tregister_taxonomy_for_object_type( 'humcore_deposit_subject', 'humcore_deposit' );\n\n\t// Add new taxonomy, NOT hierarchical (like tags).\n\t$labels = array(\n\t\t'name' => _x( 'Tags', 'taxonomy general name', 'humcore_domain' ),\n\t\t'singular_name' => _x( 'Tag', 'taxonomy singular name', 'humcore_domain' ),\n\t\t'search_items' => __( 'Search Tags', 'humcore_domain' ),\n\t\t'popular_items' => __( 'Popular Tags', 'humcore_domain' ),\n\t\t'all_items' => __( 'All Tags', 'humcore_domain' ),\n\t\t'parent_item' => null,\n\t\t'parent_item_colon' => null,\n\t\t'edit_item' => __( 'Edit Tag', 'humcore_domain' ),\n\t\t'update_item' => __( 'Update Tag', 'humcore_domain' ),\n\t\t'add_new_item' => __( 'Add New Tag', 'humcore_domain' ),\n\t\t'new_item_name' => __( 'New Tag Name', 'humcore_domain' ),\n\t\t'separate_items_with_commas' => __( 'Separate tags with commas', 'humcore_domain' ),\n\t\t'add_or_remove_items' => __( 'Add or remove tags', 'humcore_domain' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used tags', 'humcore_domain' ),\n\t\t'not_found' => __( 'No tags found.', 'humcore_domain' ),\n\t\t'menu_name' => __( 'Tags', 'humcore_domain' ),\n\t);\n\n\t$args = array(\n\t\t'public' => false,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => false,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => false,\n\t\t'rewrite' => false,\n\t);\n\n\tregister_taxonomy( 'humcore_deposit_tag', array( 'humcore_deposit' ), $args );\n\tregister_taxonomy_for_object_type( 'humcore_deposit_tag', 'humcore_deposit' );\n\n}"
]
| [
"0.6718812",
"0.6598343",
"0.65285033",
"0.64682776",
"0.64632624",
"0.64328915",
"0.6418902",
"0.6416722",
"0.6398339",
"0.6386658",
"0.63728386",
"0.6352394",
"0.63428694",
"0.63150233",
"0.6286803",
"0.62698144",
"0.6267546",
"0.62572664",
"0.62428963",
"0.6229403",
"0.62234676",
"0.6217226",
"0.6215476",
"0.6182018",
"0.6177923",
"0.6177923",
"0.6177923",
"0.61676383",
"0.616331",
"0.6157938"
]
| 0.69820523 | 0 |
Genereate full title for course, lessson, topic | function nt_generate_course_title($course_type,$active_id){
if( $course_type == 'sfwd-courses' ) {
$title = get_the_title($active_id);
}
if( $course_type == 'sfwd-lessons' ) {
$course_id = get_post_meta( $active_id , 'course_id' , true );
$course_title = get_the_title( $course_id );
$lesson_title = get_the_title( $active_id );
$title = $course_title.': '.$lesson_title;
}
if( $course_type == 'sfwd-topic' ) {
$course_id = get_post_meta( $active_id , 'course_id' , true );
$course_title = get_the_title( $course_id );
$lesson_id = get_post_meta( $active_id , 'lesson_id' , true );
$lesson_title = get_the_title( $lesson_id );
$topic_title = get_the_title( $active_id);
$title = $course_title.': '.$lesson_title.': '.$topic_title;
}
return $title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}",
"private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }",
"public function get_title(): string {\n\t\treturn __( 'Tips to make the most of Web Stories', 'web-stories' );\n\t}",
"public static function title();",
"public static function getTitle(): string\n\t{\n\t\t$u = str_repeat( '_', 33 );\n\t\treturn $u . '[' . self::TITLE . ']' . $u;\n\t}",
"public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }",
"public function title();",
"public function title();",
"public function computedTitle();",
"public function get_title();",
"function title(){\n\t\t\techo $mytitle= \"Profile. Car Parking Website\";\n\t\t\t\n\t\t}",
"protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}",
"public function buildTitle()\r\n\t{\r\n\t\t$data\t= '<h1>' . t( 'intouch.admin.title', t( 'intouch.admin.title.' . $this->action . '.' . $this->task ) ) . '</h1>';\r\n\t\treturn $data;\r\n\t}",
"function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}",
"function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}",
"public function getCreateTitle()\n {\n return sprintf($this->_('New %s...'), $this->getTopic(1));\n }",
"function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}",
"function get_title()\n {\n }",
"public static function makeTitle($name);",
"private function _getTitle()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$task = ( array_key_exists( 'task', $whmcs->input ) && ! empty( $whmcs->input['task'] ) ? '.' . $whmcs->input['task'] : null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . $task ) ) . '</h1>';\r\n\t}",
"function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }",
"public function title()\n {\n return Str::of($this->name)\n ->append(' - ' . $this->id)\n ->__toString();\n }",
"protected function page_title() {\n return get_string('topicoutline');\n }",
"public function getIndexTitle()\n {\n return ucfirst($this->getTopic(100));\n }",
"public static function generateTitle()\n {\n return 'KIP' . substr(time(), 1);\n }",
"function get_title($title) \n{\n global $scelus;\n return $title . (isset($scelus['title_append']) ? $scelus['title_append'] : null);\n}",
"public function BuildTitle()\n\t\t{\n\t\t\t$title = \"\";\n\n\t\t\tforeach ($this->GetTrails() as $trail) {\n\t\t\t\t$title .= sprintf(\"%s - \", $trail[1]);\n\t\t\t}\n\n\t\t\t$title = rtrim($title, \"- \");\n\t\t\t$title .= sprintf(\" (%s - %s)\", $GLOBALS['PriceMin'], $GLOBALS['PriceMax']);\n\t\t\t$title .= sprintf(\" - %s\", $GLOBALS['StoreName']);\n\n\t\t\treturn $title;\n\t\t}",
"public function property_title() {\n\n\t\t\t$this->add_package = $this->getAddPackage();\n\n\t\t\t$headline_select = get_field( 'headline_select' );\n\t\t\t$standard_section = get_field( 'practice_type' ) . ' ' . get_field( 'building_type' );\n\t\t\t$custom_section = ( $headline_select == 'Custom Headline' )\n\t\t\t\t? get_field( 'custom_headline' )\n\t\t\t\t: $standard_section;\n\n\t\t\t$location = get_field( 'address_city' ) . ', ' . get_field( 'address_state' );\n\t\t\t$headline = get_field( 'practice_is_for' ) . ' - ' . $custom_section . ' - ' . $location;\n\n\t\t\t$out = '<h3>' . $headline . '</h3>';\n\t\t\t$out .= '<div class=\"hr hr-default\"><span class=\"hr-inner \"><span class=\"hr-inner-style\"></span></span></div>';\n\n\n\t\t\treturn $out;\n\t\t}",
"public function get_title() {\n\t\treturn __( 'Hello World', 'elementor-hello-world' );\n\t}",
"abstract public static function title(): string;"
]
| [
"0.76468766",
"0.7431139",
"0.72518694",
"0.7196875",
"0.7176244",
"0.71324164",
"0.71307904",
"0.71307904",
"0.7121572",
"0.6982277",
"0.69780296",
"0.69776493",
"0.69529694",
"0.68825686",
"0.6865529",
"0.6864429",
"0.68161696",
"0.68044627",
"0.6802795",
"0.6782037",
"0.67677",
"0.6763208",
"0.67603165",
"0.6744022",
"0.6739881",
"0.67317295",
"0.6730974",
"0.6726462",
"0.67153525",
"0.670925"
]
| 0.76487195 | 0 |
Determines if the node allows a parent node. | final public function allowsParent() {
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function is_for_parent_node(Jquarry_Node $parent);",
"public function isParent();",
"public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }",
"public function hasParent();",
"public function hasParent();",
"public function hasParent();",
"public function hasParent() {}",
"function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}",
"public function isParent() {\n\t\treturn $this->isParent;\n\t}",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}",
"public function hasParent()\n {\n }",
"public function hasParent() {\n return isset($this->_parent);\n }",
"public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}",
"public function getIsParent() {\n\t\treturn $this->isParent;\n\t}",
"public function hasParent()\n {\n return $this->currentParent !== null;\n }",
"final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}",
"public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }",
"function is_parent($parent_node, $child_node)\r\n\t{\r\n\t\t$p_root_id = $parent_node['root_id'];\r\n\t\t$p_l = $parent_node['l'];\r\n\t\t$p_r = $parent_node['r'];\r\n\r\n\t\t$c_root_id = $child_node['root_id'];\r\n\t\t$c_l = $child_node['l'];\r\n\t\t$c_r = $child_node['r'];\r\n\r\n\t\tif (($p_root_id == $c_root_id) && ($p_l < $c_l && $p_r > $c_r))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}",
"private function is_can_parent_node($local_root) {\n if ($local_root !== null) {\n return !($local_root->type == qtype_preg_node::TYPE_NODE_ALT);\n }\n return true;\n }",
"public function get_isTableWiTreeParentField()\n {\n if ( empty( $this->arr_tablesWiTreeparentfield ) )\n {\n return false;\n }\n\n return true;\n }",
"public function hasParentId(){\n return $this->_has(3);\n }",
"public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}",
"public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}",
"public function isParentOf(AbstractNode $node) :bool {\n return $node->hasParent()&&$node->parent->isSameNode($this);\n }",
"public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }",
"public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }",
"public function parentIsNode($model = false)\n {\n $model = ($model ? $model : $this);\n\n $class = new ReflectionClass($model);\n $parent = $class->getParentClass();\n $parentName = $parent->getShortName();\n\n if($parentName == 'Node')\n {\n return true;\n }\n\n return false;\n }",
"function has_post_parent($post = \\null)\n {\n }",
"protected function hasParentMenuItem() {}"
]
| [
"0.77847123",
"0.7613103",
"0.7498584",
"0.7463138",
"0.7463138",
"0.7463138",
"0.7421399",
"0.734292",
"0.73293597",
"0.7315476",
"0.7274375",
"0.7221334",
"0.7178115",
"0.714417",
"0.71127516",
"0.7076997",
"0.7028497",
"0.7007704",
"0.681925",
"0.6754446",
"0.66959333",
"0.66767555",
"0.66759145",
"0.6648538",
"0.66435665",
"0.6613794",
"0.6613794",
"0.6603198",
"0.6462157",
"0.64577"
]
| 0.7977174 | 0 |
Determines if the node has a parent node. | final public function hasParent() {
return ($this->_parentNode !== null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }",
"public function hasParent()\n {\n return $this->currentParent !== null;\n }",
"public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}",
"public function hasParent() {\n return isset($this->_parent);\n }",
"function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}",
"public function hasParent();",
"public function hasParent();",
"public function hasParent();",
"abstract public function is_for_parent_node(Jquarry_Node $parent);",
"public function hasParent() {}",
"public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}",
"public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }",
"private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}",
"public function isParent() {\n\t\treturn $this->isParent;\n\t}",
"public function hasParent()\n {\n }",
"public function isParent();",
"public function getIsParent() {\n\t\treturn $this->isParent;\n\t}",
"function is_parent($parent_node, $child_node)\r\n\t{\r\n\t\t$p_root_id = $parent_node['root_id'];\r\n\t\t$p_l = $parent_node['l'];\r\n\t\t$p_r = $parent_node['r'];\r\n\r\n\t\t$c_root_id = $child_node['root_id'];\r\n\t\t$c_l = $child_node['l'];\r\n\t\t$c_r = $child_node['r'];\r\n\r\n\t\tif (($p_root_id == $c_root_id) && ($p_l < $c_l && $p_r > $c_r))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}",
"public function hasParentId(){\n return $this->_has(3);\n }",
"public function isParentOf(AbstractNode $node) :bool {\n return $node->hasParent()&&$node->parent->isSameNode($this);\n }",
"public function get_isTableWiTreeParentField()\n {\n if ( empty( $this->arr_tablesWiTreeparentfield ) )\n {\n return false;\n }\n\n return true;\n }",
"public function hasParentMessage(): bool {\n return isset($this->parentMessageId);\n }",
"public function isParentOf($path)\n\t{\n\t\t$path = $this->resolve($path);\n\n\t\tif ($path === $this->root) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 0 === \\strpos($path, $this->root);\n\t}",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"function has_post_parent($post = \\null)\n {\n }",
"public function parentIsNode($model = false)\n {\n $model = ($model ? $model : $this);\n\n $class = new ReflectionClass($model);\n $parent = $class->getParentClass();\n $parentName = $parent->getShortName();\n\n if($parentName == 'Node')\n {\n return true;\n }\n\n return false;\n }",
"public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}",
"public function getParentNode() {}",
"public function getParentnode()\n {\n return $this->__parentnode__;\n }",
"public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}"
]
| [
"0.8103629",
"0.80385506",
"0.7996985",
"0.79281795",
"0.78594285",
"0.7759335",
"0.7759335",
"0.7759335",
"0.7632996",
"0.76225877",
"0.7453177",
"0.7414269",
"0.7411043",
"0.73730993",
"0.7371341",
"0.7369907",
"0.7111826",
"0.7086192",
"0.7049188",
"0.70080405",
"0.6909298",
"0.68855214",
"0.67828304",
"0.6735673",
"0.67350036",
"0.6710811",
"0.66382027",
"0.6548589",
"0.6508436",
"0.64392143"
]
| 0.8085965 | 1 |
Returns the parent node of this node. | final public function getParent() {
return $this->_parentNode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParentnode()\n {\n return $this->__parentnode__;\n }",
"public function getParentNode() {}",
"public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }",
"public function get_parent() {\n\t\treturn $this->parent();\n\t}",
"public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}",
"protected function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}",
"final public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}",
"public function getParent() {\n\t\t\treturn $this->parent;\n\t\t}",
"public function getParent() {\n return $this->__parent;\n }",
"public function parentNode()\n {\n return null;\n }",
"public function getParent() {\n return $this->parent;\n }",
"public function getParent() {\n\t\treturn $this->parent;\n\t}",
"public function getParent() {\n\t\treturn $this->parent;\n\t}",
"public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}",
"public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }",
"public function getParent()\n {\n return $this->parent;\n }"
]
| [
"0.8736719",
"0.8143647",
"0.8125172",
"0.8109064",
"0.8107589",
"0.8100206",
"0.8060032",
"0.7985446",
"0.79760116",
"0.7964146",
"0.79399323",
"0.7919951",
"0.79183215",
"0.79183215",
"0.791358",
"0.791358",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634",
"0.79123634"
]
| 0.83716 | 1 |
Determines if the node is allowed children. | final public function allowsChildren() {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canHaveChildren() {}",
"function isChildren()\n {\n return count($this->children)>0;\n }",
"final public function hasChildren() {\n\t\treturn false;\n\t}",
"public function has_children()\n {\n return ($this->size > 2);\n }",
"public function hasChildren()\n {\n return count($this->children) > 0 ? true : false;\n }",
"public function hasChildren() {}",
"public function hasChildren() {}",
"public function hasChildren() {}",
"public function hasChildren() {}",
"public function hasChildren() {}",
"public function hasChildren()\n\t{\n\t\treturn ! $this->current()->isLeaf();\n\t}",
"public function hasChildren();",
"public function hasChildren();",
"public function hasChildren();",
"public function hasChildren();",
"public function hasChildren()\n\t{\n\t\treturn !empty($this->children);\n\t}",
"private function has_children() {\n return !empty($this->menuitems);\n }",
"public function WantsChildren() {\r\n return false;\r\n }",
"public function hasChildren()\n {\n return !empty($this->children);\n }",
"static function cws_has_children() {\n\t\tglobal $post;\n\n\t\t$children = get_pages( array( 'child_of' => $post->ID ) );\n\n\t\tif ( count( $children ) == 0 ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}",
"public function hasChildren () {\n return ($this->current () instanceof self);\n }",
"public function hasChildren()\n {\n return $this->children->count() == 0 ? false : true;\n }",
"public function hasChildren()\n {\n }",
"public function hasChildren()\n {\n }",
"#[\\ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->current()->hasChildNodes();\n }",
"public function hasChildren() \n {\n return count($this->children) > 0;\n }",
"public function childrenAllowed($in)\n {\n $elt = $this->getElement($in);\n\n return !($elt && ($elt['a'] & self::ELT_NOINFERIORS));\n }",
"public function hasChildren(): bool;",
"function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}",
"public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}"
]
| [
"0.7782169",
"0.7439577",
"0.73829496",
"0.7340907",
"0.7249016",
"0.7231493",
"0.72313994",
"0.72313994",
"0.72313994",
"0.72313994",
"0.718624",
"0.71645445",
"0.71645445",
"0.71645445",
"0.71645445",
"0.71552926",
"0.7153716",
"0.71522504",
"0.71467394",
"0.712846",
"0.7123841",
"0.7114416",
"0.7110181",
"0.7110181",
"0.71069944",
"0.7105497",
"0.70942813",
"0.70664316",
"0.701128",
"0.700697"
]
| 0.7883431 | 0 |
Determines if the node is allowed events. | final public function allowsEvents() {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}",
"protected static function allowedEvents()\n\t{\n\t\treturn array(\n\t\t\t\t\t\t'onclick',\n\t\t\t\t\t\t'ondblclick',\n\t\t\t\t\t\t'onmousedown',\n\t\t\t\t\t\t'onmouseup',\n\t\t\t\t\t\t'onmouseover',\n\t\t\t\t\t\t'onmousemove',\n\t\t\t\t\t\t'onmouseout',\n\t\t\t\t\t\t'onkeypress',\n\t\t\t\t\t\t'onkeydown',\n\t\t\t\t\t\t'onkeyup'\n\t\t\t\t\t);\n\t}",
"public function hasEvents()\n {\n return count($this->events) > 0 ? true : false;\n }",
"public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }",
"public function isAppEventEnabled()\n {\n return true;\n }",
"public function hasNetworkEvent(){\n return $this->_has(3);\n }",
"public function hasListeners($event): bool;",
"public function hasEventListeners($event);",
"public function isUserEvent()\n {\n return $this->baseEvent->isUserEvent();\n }",
"public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }",
"public function isAccessAllowed()\n\t{\n\t\t$returnValue \t=\tFALSE;\n\n\t\tif($this->isUserIPAddressAllowedAccess())\n\t\t{\n\t\t\t$returnValue\t=\tTRUE;\n\t\t}\n\n\t\treturn $returnValue;\n\t}",
"public function hasListeners($eventName): bool;",
"function canUpdateBGEvents() {\n if ($this->fields[\"background\"]\n && !Session::haveRight(self::$rightname, self::MANAGE_BG_EVENTS)) {\n return false;\n }\n\n return true;\n }",
"public function checkOnAccess() : bool\r\n {\r\n if (empty($this->gates)){\r\n return true;\r\n }\r\n\r\n foreach ($this->gates as $gate) {\r\n\r\n if(Gate::allows($gate)){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }",
"public function valid()\n {\n return (false !== \\next($this->events)) ? current($this->events) : false;\n }",
"public function isRoomEvent()\n {\n return $this->baseEvent->isRoomEvent();\n }",
"public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }",
"public function shouldDiscoverEvents(): bool\n {\n return false;\n }",
"protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}",
"public function hasListeners($eventName);",
"private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }",
"public function checkSecurity($xml) \n {\n //public function!\n // Be sure they've given us an event ID\n if (!isset($xml->action->event_id)) {\n return false;\n }\n\n return true;\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_sched/schedule');\n }",
"public static function event_method()\n {\n return true;\n }",
"protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }",
"public function hasWildcardListeners($eventName): bool;",
"public function isEventRecurs() {\n\t\treturn ($this->eventRecurs);\n\t}",
"private function _checkAccessPermitted ()\r\n {\r\n $this->_getPermitedScripts();\r\n if (array_search(basename($_SERVER['PHP_SELF']), $this->_scriptAccess) === false) {\r\n $ip = (getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR'));\r\n $sql = \"INSERT INTO `_log` (`date`, `activity`, `info`) VALUES ('$date', 'admin_access_not_granted', 'user={$this->_username};IP={$ip};script=\" . basename($_SERVER['PHP_SELF']) . \"')\";\r\n mysql_query($sql, db_c());\r\n \r\n $this->_dispatchError('zoneError');\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"public function canBeEnabled();",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Rapidmage_Firewall::manage_rules');\n }"
]
| [
"0.6507748",
"0.61673623",
"0.61363316",
"0.6070249",
"0.6053544",
"0.59942406",
"0.5910554",
"0.58316106",
"0.5809283",
"0.58078367",
"0.5785749",
"0.57683766",
"0.57584107",
"0.5697767",
"0.56874067",
"0.56789976",
"0.5611035",
"0.56024045",
"0.55912614",
"0.55571294",
"0.5535597",
"0.55191016",
"0.55140185",
"0.5512599",
"0.5510791",
"0.5503341",
"0.54986393",
"0.5497471",
"0.5460361",
"0.5447756"
]
| 0.71755666 | 0 |
Id Unittest with Regular expression Check digits because Id consist of only Digits | public function testThatWeCanGetTheId()
{
$ads = new Cities;
$ads->setId('1');
//$this->assertEquals($ads->getId(), '1');
$this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function idFormat($value){\n \n if(!preg_match(VALID_INT_FORMAT,$value)){\n return false;\n }\n \n return true;\n\n}",
"function isValidStudentID($id){\n if(preg_match('/^\\d+$/', $id) && strlen($id) == 8){\n return true;\n }\n else{\n return false;\n }\n }",
"function checkId($input){\n\n $output = preg_match('/^[0-9]+$/', $input);\n if(!$output){\n echo json_encode(\n array(\n \"errorMsg\" => \"ID can only contain numbers\"\n )\n );\n die();\n }\n\n return null;\n }",
"function sanitizer($inputId)\n {\n preg_match(\"/([0-9]{6})(_)([a-zA-Z]{1,})/\", $inputId, $inputId2);\n\n if ( !empty($inputId2) and is_numeric($inputId2[1]) and $inputId2[2] == '_' and is_string($inputId2[3]) )\n {\n return TRUE;\n }\n else\n {\n echo \"<strong style='color: red'>Error: </strong>Please enter an ID which starts with six numeric values followed by underscore followed by string in the format example as shown --> 123456_ABC\";\n return FALSE;\n }\n }",
"function is_id($str)\n{\n $regex = \"/([a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[8|9|a|b][a-f0-9]{3}\\-[a-f0-9]{12})/\";\n\n return preg_match($regex, $str) === 1;\n}",
"public static function isValidId(string $id) : bool {\n\t\treturn strlen($id) <= 5 && preg_match('/^[0-9]+$/', $id) === 1;\n\t}",
"private static function isValidID($id) {\n\t\tif(!is_string($id)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(strlen($id) < 1) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(preg_match('/[^0-9a-z]/', $id)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"function isPartID($input) {\n return (preg_match(\"/(^(?:[1-9][0-9]+?)(?:[a-z]*\\\\d*[a-z]*\\\\d*)?$)/\", $input));\n }",
"private function validateId()\n {\n return is_numeric($this->id) && (int)$this->id >= 1;\n }",
"public function isValidId($id) {\n // In NCTU, student id is 7 digits\n if (strlen($id) != 7) return FALSE;\n if (!ctype_digit($id)) return FALSE;\n return TRUE;\n }",
"public function isValidId($id);",
"protected function shouldBeNumber($id)\r\n {\r\n $pattern = \"/^[0-9]+?$/\";\r\n\r\n if (preg_match($pattern, $id)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}",
"public function validateId($value)\n {\n $value = $this->validateValue($value);\n\n $pattern = '/^[0-9]{0,10}$/';\n if (preg_match($pattern, $value)) {\n return $value;\n } else {\n $this->addMessage($this->textMessages[3]);\n return false;\n }\n }",
"function parse_id($id) {\n\n }",
"function testIdGetter(){\n\t\t#mdx:idGetter\n\t\t$field = new MyField('email');\n\t\t$field->attrs(['id'=>'email_field']);\n\t\t#/mdx echo $field->id()\n\t\t$this->assertEquals('email_field',$field->id());\n\t}",
"public function testInteger() {\n $this->assertEquals(1292932, Sanitize::integer('129sdja2932'));\n $this->assertEquals(-1275452, Sanitize::integer('-12,754.52'));\n $this->assertEquals(18840, Sanitize::integer('+18#840'));\n }",
"public static function parseID($id){ }",
"public function id_test($id) {\r\n\r\n $error_msg = \"\";\r\n $errors = 0;\r\n\r\n if(isset($id)) {\r\n $identifiant = trim($id);\r\n $identifiant = htmlentities($identifiant, ENT_NOQUOTES, 'utf-8');\r\n $identifiant = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $identifiant);\r\n $identifiant = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $identifiant); // pour les ligatures e.g. 'œ'\r\n $identifiant = preg_replace('#&[^;]+;#', '', $identifiant);\r\n $identifiant = str_replace(';', '', $identifiant);\r\n $identifiant = str_replace(' ', '', $identifiant);\r\n $identifiant = str_replace('php', '', $identifiant);\r\n\r\n if($identifiant == '') {\r\n $error_msg .= \"Vous devez spécifier un identifiant. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) < 3) {\r\n $error_msg .= \"Votre identifiant est trop court. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) > 24) {\r\n $error_msg .= \"Votre identifiant est trop long. <br/>\";\r\n $errors++;\r\n } else {\r\n\r\n if(Model::getModel(\"Session\\\\User\")->exists($identifiant)) {\r\n $error_msg .= \"Cet identifiant est déjà utilisé. <br/>\";\r\n $errors++;\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return array(\r\n \"value\" => $identifiant,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }",
"function isValidId($type) {\n\tif (strlen($type) > 3) {\n\t\tif (substr($type, -3) === \"_id\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"protected function validateId($id) {\n // check blacklist\n if (in_array($id,$this->blackList)) {\n $this->isBlackListed = true;\n $this->valid = false;\n\n return false;\n }\n\n // check string length\n // GLN Numbers are 14 characters long\n // FN Numbers (with or without FN prefix) are at least 5 characters long\n // GKZ Numbers are 5 characters long\n $this->valid = strlen($id) > 4;\n\n return $this->valid;\n }",
"private static function verifyID($entry, $id)\n {\n $idhtml = htmlspecialchars($id);\n //$idpattern = (isset($entry['id_pattern']) ? $entry['id_pattern'] : '%[^A-Za-z0-9_\\\\-]%');\n //if ($idhtml == null || preg_match($idpattern, $idhtml)) {\n return ($idhtml != null);\n }",
"public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }",
"public function isValidId($id)\n\t{\n\t\t//return is_string($id) && preg_match('/^[a-f0-9]{40}$/', $id);\n\n\t\t// overload this checking\n\t\t// check that session id has enough characters\n\t\treturn strlen($id) == 64;\n\t}",
"function int1 ($var){\n\tif (preg_match(\"|^[\\(\\)\\-+\\ 0-9]+$|\",$var)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t\t}\n\t}",
"function test_getId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $result = $test_task->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n\n }",
"public static function _assertId( $mId ) {\n\t\t\n\t\tif ( !preg_match( '/^[0-9]+$/', $mId ) ) {\n\t\t\t\n\t\t\t// $mId is a slug\n\t\t\treturn self::_getId( $mId );\n\t\t}\n\t\t\n\t\treturn $mId;\n\t}",
"function next_id($id=\"\") {\n if (ereg(\"^[0-9]+$\",$id)) {\n $id++;\n return $id;\n }\n $id2=1; \n if(ereg(\"[0-9]+$\",$id)==true){\n $id1=ereg_replace(\"[0-9]+$\",\"\",$id);\n preg_match(\"/([0-9]+)$/\",$id,$matches);\n $id2=$matches[1];\n $id2++;\n return $id2;\n } else { \n if (empty($liczba)) $liczba='';\n return $id.$liczba; \n }\n }",
"function testChangeId(){\n\t\t#mdx:changeId\n\t\t$field = new MyField('email');\n\t\t$field->attrs(['id'=>'email_field']);\n\t\t#/mdx echo $field\n\t\t$this->expectOutputRegex(\"/input.*email_field/\");\n\t\techo $field;\n\t}",
"public function testUuid(): void\n {\n $regex = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i';\n $this->assertTrue((bool) preg_match($regex, $this->user->getUuid()));\n }"
]
| [
"0.7301074",
"0.70989186",
"0.7034525",
"0.6836522",
"0.6819846",
"0.67861956",
"0.66976845",
"0.6664169",
"0.6619569",
"0.6570407",
"0.65465444",
"0.64891106",
"0.64370906",
"0.6389786",
"0.6352944",
"0.62604386",
"0.62125146",
"0.62057936",
"0.62054217",
"0.6114142",
"0.6112091",
"0.6104911",
"0.60988057",
"0.60867614",
"0.607373",
"0.60614747",
"0.6037453",
"0.60019743",
"0.5977781",
"0.597236"
]
| 0.75277257 | 0 |
Cities Unittest with Regular expression Check String(Lowercase, Uppercase) and Digits because Ac_Id consist of String & Digits | public function testThatWeCanGetTheCategories()
{
$ads = new Cities;
$ads->setCities('Waterloo');
$this->assertEquals(1 , preg_match( '/^[a-zA-Z]{3,30}$/', $ads->getCities() ), $ads->getCities() . ' is less 3 or more 31' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testThatWeCanGetTheId()\n {\n $ads = new Cities;\n \n $ads->setId('1');\n \n \n //$this->assertEquals($ads->getId(), '1');\n $this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' );\n\n\n }",
"public function is_valid_city($str) {\n\n $result = $this->ci->generic_model->retrieve_one(\"lib_city\",\n array(\n \"id_provinsi\" => $this->ci->input->post(\"province\"),\n \"id\" => $str\n )\n );\n\n if ($result) {\n return TRUE;\n } else {\n return FALSE;\n }\n\n return $result;\n }",
"function sanitizer($inputId)\n {\n preg_match(\"/([0-9]{6})(_)([a-zA-Z]{1,})/\", $inputId, $inputId2);\n\n if ( !empty($inputId2) and is_numeric($inputId2[1]) and $inputId2[2] == '_' and is_string($inputId2[3]) )\n {\n return TRUE;\n }\n else\n {\n echo \"<strong style='color: red'>Error: </strong>Please enter an ID which starts with six numeric values followed by underscore followed by string in the format example as shown --> 123456_ABC\";\n return FALSE;\n }\n }",
"function isAddress($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{33,34}$/\";\n return preg_match($pattern, $input);\n}",
"public function testValidAlphanumString()\n {\n $string = 'dfasfa5425423frg890';\n $this->assertTrue($this->alphanum->execute($string));\n }",
"public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }",
"function validaAlfa ($Cad) {\n// prueba si la entrada es una cadena alfabetica\nreturn preg_match(\"/^[a-z]+$/i\", $Cad );\n}",
"function abc($str)\n\t{\t\t\n\t\t$this->CI->form_validation->set_message('abc', \"El campo %s debe contener uno de los siguientes valores A,B,C,a,b,c\");\n\t\treturn (bool) preg_match(\"/(^[abcABC]$)|^$/\", $str);\n\t}",
"function verifyAlphaNum ($testString)\n\t{\n return (preg_match(\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n }",
"public function testCharacterFieldValidation()\n {\n // Field should only allow 50 characters\n $field = $this->table->getField('stringone');\n\n $testStr = str_repeat('x', 56);\n $this->assertEquals(56, strlen($testStr));\n $cleanStr = $field->getPHPValue($testStr);\n $this->assertEquals(50, strlen($cleanStr));\n\n\n $testStr = str_repeat('z', 50);\n\n $fieldVal = $field->getSqlBoundValue($testStr);\n $key = $fieldVal->getValueMarker();\n\n $this->assertEquals($key, $fieldVal->getValueMarker());\n $this->assertEquals($testStr, $fieldVal->getBoundValues()[$key]);\n }",
"public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }",
"function fixCity($str = \"\") {\n\tif ( preg_match(\"/[A-Z]{3}/\", $str) ) {\n\t\t$str = strtolower($str);\n\t}\n\t$str = ucwords($str);\n\t$str = str_replace(\"'\", \"''\", $str);\n\treturn($str);\n//fixCity\n}",
"public function testRegistrationPasswordOnlyUpperCase(): void { }",
"function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}",
"function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}",
"public function testValidCustomerIdTest()\n {\n $customerId = '10';\n $expected_customer_first_Name = 'Juanita';\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue($expected_customer_first_Name == $customer->first_name);\n }",
"public function testRegistrationValuesContainSpecialCharacters(): void { }",
"public function testIsString()\n {\n $animalName = $this->faker->animal();\n\n $this->assertRegExp('/^[\\wñ-]+$/', $animalName);\n }",
"function is_id($str)\n{\n $regex = \"/([a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[8|9|a|b][a-f0-9]{3}\\-[a-f0-9]{12})/\";\n\n return preg_match($regex, $str) === 1;\n}",
"public function testCreditCardIsValid($data)\n {\n $pattern = \"/^([0-9]{4}[\\s]?){3}([0-9]{4})$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }",
"public function cityname_validation($city) {\n $this->form_validation->set_message('cityname_validation', 'The %s field is not valid City or Destination Code');\n\n preg_match_all('/\\(([A-Za-z0-9 ]+?)\\)/', $city, $out);\n $cityCode = $out[1];\n\n if (!empty($cityCode))\n return TRUE;\n else\n return FALSE;\n }",
"function validaAlfaNum ($Cad) {\n// prueba si la entrada es una cadena alfanumerica\nreturn preg_match(\"/^[a-z 0-9]*$/i\", $Cad );\n}",
"static function checkAddress($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d,][\\W\\w\\d\\s,]{1,40}$/', $input)) {\r\n return true; //Illegal Character found!\r\n }\r\n else{\r\n echo PageBuilder::printError(\"Please enter alphabets and numbers with comma seperation, maximum of 40 characters.\");\r\n return false;\r\n }\r\n }",
"function verifyAlphaNum ($testString) {\n\t// Check for letters, numbers and dash, period, space and single quote only. \n\treturn (preg_match (\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n}",
"function verifyAlphaNum($testString) {\r\n return (preg_match (\"/^([[:alnum:]]|-|\\.| |\\'|&|;|#)+$/\", $testString));\r\n}",
"function number_car($number){\n$regexp = '/[a-ż][0-9][0-9][0-9][a-ż][a-ż]/ui';\n//$regexp = '/^[a-ż][0-9][0-9][0-9][a-ż][a-ż]$/ui'; //^$ only reads in between\n//$regexp = '/\\\\w\\\\w\\\\w\\\\w\\\\w\\\\w/ui'; // \\\\w looks for each letter a numeric and underscore\n$matches = array();\nif (preg_match($regexp, $number, $matches)) {\n echo\"number car is {$matches[0]}<br>\";\n //print_r($matches);\n}else {\n echo\"enter the correct car number\\n\";\n}\n\nreturn $matches;\n}",
"function validateDCI($str){\n if((strlen($str)>10) || (strlen($str)<4) || (!ctype_digit($str)) )\n return false;\n else\n return true;\n}",
"public function dataValidCases()\n {\n return array(\n array('65 02 53 00 00', RegionCode::US),\n array('6502 538365', RegionCode::US),\n array('650//253-1234', RegionCode::US), // 2 slashes are illegal at higher levels\n array('650/253/1234', RegionCode::US),\n array('9002309. 158', RegionCode::US),\n array('12 7/8 - 14 12/34 - 5', RegionCode::US),\n array('12.1 - 23.71 - 23.45', RegionCode::US),\n array('800 234 1 111x1111', RegionCode::US),\n array('1979-2011 100', RegionCode::US),\n array('+494949-4-94', RegionCode::DE), // National number in wrong format\n array('4156666-777', RegionCode::US),\n array('2012-0102 08', RegionCode::US), // Very strange formatting.\n array('2012-01-02 08', RegionCode::US),\n // Breakdown assistance number with unexpected formatting.\n array('1800-1-0-10 22', RegionCode::AU),\n array('030-3-2 23 12 34', RegionCode::DE),\n array('03 0 -3 2 23 12 34', RegionCode::DE),\n array('(0)3 0 -3 2 23 12 34', RegionCode::DE),\n array('0 3 0 -3 2 23 12 34', RegionCode::DE),\n // Fits an alternate pattern, but the leading digits don't match\n array('+52 332 123 23 23', RegionCode::MX),\n );\n }",
"public function runAssert()\n {\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'city');\n $this->assertTrue(in_array('基隆市', $reflected_data));\n $this->assertTrue(in_array('連江縣', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityArea');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityArea');\n $this->assertTrue(in_array('仁愛區', $reflected_data));\n $this->assertTrue(in_array('東引鄉', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityAreaCount');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityAreaCount');\n $this->assertTrue(in_array(7, $reflected_data));\n $this->assertTrue(in_array(367, $reflected_data));\n // print_r($reflected_data);\n }",
"public function testValidateSpecialChars(): void\n {\n $this->assertFalse($this->validate('some-text-123'));\n }"
]
| [
"0.6448094",
"0.5794556",
"0.56666297",
"0.5577351",
"0.5554657",
"0.5548007",
"0.5533867",
"0.55268145",
"0.541211",
"0.53914994",
"0.5359269",
"0.5347262",
"0.5345646",
"0.5343187",
"0.53343713",
"0.5292221",
"0.52845764",
"0.5280481",
"0.52538395",
"0.5251958",
"0.5250439",
"0.523304",
"0.52323925",
"0.5227117",
"0.5218823",
"0.52128524",
"0.51868945",
"0.5175921",
"0.51666903",
"0.51607317"
]
| 0.6176894 | 1 |
Handler for storing selected table type into sessions. | public function handleStoreTable($table)
{
$session = $this->session->getSection('map');
$session->table = $table;
$this->terminate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onSessiontypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function getSessionType();",
"public function setTypeSession($value){\n\t\t\t$this->typeSession = $value;\n\t\t}",
"public function storeSessionData() {}",
"public function storeSessionData() {}",
"public function setType($type)\r\n\t{\r\n\t\t// Check the type\r\n\t\t$type = strtolower($type);\r\n\t\tif(!in_array($type, $this->allowed_types))\r\n\t\t{\r\n\t\t\t$type = 'varchar'; // default to varchar\r\n\t\t}\r\n\t\t\r\n\t\t$name \t\t= 'tienda';\r\n\t\t$eav_suffix = 'eavvalues';\r\n\t\t$this->type = $type;\r\n\t\t\r\n\t\t// Set the correct suffix\r\n\t\t$this->set( '_suffix', $eav_suffix.$type );\r\n\t\t$tbl_name = \"#__{$name}_{$eav_suffix}{$type}\";\r\n\t\t$this->_tbl = $tbl_name;\r\n\t\t\r\n\t\t// Now set the properties!\r\n\t\t$this->setTableProperties();\r\n\t\t\r\n\t\t// Table Type defined: Activate the table\r\n\t\t$this->active = true;\r\n\t}",
"private function _setTableName($caseValue) {\n try {\n switch ($caseValue) {\n case 1 :\n $this->tbl = 'tbl_admin_type';\n $this->tblKey = 'iAdminTypeID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.permission.type';\n\n $this->delMSG = ADMINTYPE_DEL_SUCC;\n $this->insMSG = ADMINTYPE_INS_SUCC;\n $this->updtMSG = ADMINTYPE_UPDT_SUCC;\n break;\n\n case 2 :\n $this->tbl = 'tbl_user';\n $this->tblKey = 'iUserID';\n $this->tblValidateKey = 'vEmail';\n $this->tblMD5Key = 'vPassword';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'user';\n $this->tblStatusKey = 'eStatus';\n $this->pageStateName = 'app.user.list';\n\n /*\n * FOR A MAIL...\n */\n $this->mailRequire = TRUE;\n $this->mailID = 'vEmail';\n $this->mailSubject = PROJ_TITLE . ' Register User';\n //$this->mailTemplate = VIEW_DIR_EMAIL . 'user/register.php';\n $this->mailTemplate = 'registeruser';\n\n $this->delMSG = USER_DEL_SUCC;\n $this->insMSG = USER_INS_SUCC;\n $this->updtMSG = USER_UPDT_SUCC;\n $this->validateMSG = USER_EMAIL_EXISTS;\n break;\n\n case 3 :\n $this->tbl = 'tbl_page_module';\n $this->tblKey = 'iPageModuleID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.modules.list';\n\n $this->delMSG = ADMIN_MOD_DEL_SUCC;\n $this->insMSG = ADMIN_MOD_INS_SUCC;\n $this->updtMSG = ADMIN_MOD_UPDT_SUCC;\n break;\n\n case 4 :\n $this->tbl = 'tbl_page';\n $this->tblKey = 'iPageID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.pages.list';\n\n $this->delMSG = ADMIN_PAGE_DEL_SUCC;\n $this->insMSG = ADMIN_PAGE_INS_SUCC;\n $this->updtMSG = ADMIN_PAGE_UPDT_SUCC;\n break;\n\n case 5 :\n $this->tbl = 'tbl_email_templates';\n $this->tblKey = 'iEmailTemplateID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = '';\n $this->pageStateName = 'template.email.list';\n\n $this->delMSG = EMAIL_TMPLT_DEL_SUCC;\n $this->insMSG = EMAIL_TMPLT_INS_SUCC;\n $this->updtMSG = EMAIL_TMPLT_UPDT_SUCC;\n break;\n\n case 6 :\n $this->tbl = 'tbl_gallery';\n $this->tblKey = 'iGalleryID';\n $this->fUploadKey = 'vImageName';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'gallery';\n $this->pageStateName = 'app.gallery.list';\n\n $this->delMSG = GALLERY_IMAGE_DEL_SUCC;\n $this->insMSG = GALLERY_IMAGE_INS_SUCC;\n $this->updtMSG = GALLERY_IMAGE_UPDT_SUCC;\n break;\n \n case 7 :\n $this->tbl = 'db_category';\n $this->tblKey = 'iCategoryID';\n $this->fUploadKey = 'vCategoryIcon';\n $this->tblStatusKey = 'eCategoryStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtCategoryDate';\n $this->fUploadFolder = 'Category';\n $this->pageStateName = 'app.category.list';\n\n $this->delMSG = CATEGORY_DEL_SUCC;\n $this->insMSG = CATEGORY_INS_SUCC;\n $this->updtMSG = CATEGORY_UPDT_SUCC;\n break;\n \n case 8 :\n $this->tbl = 'db_retailer';\n $this->tblKey = 'iRetailerID';\n $this->fUploadKey = 'vRetailerLogo';\n $this->tblStatusKey = 'eRetailerStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtDate';\n $this->fUploadFolder = 'Retailer';\n $this->pageStateName = 'app.retailer.list';\n\n $this->delMSG = RETAILER_DEL_SUCC;\n $this->insMSG = RETAILER_INS_SUCC;\n $this->updtMSG = RETAILER_UPDT_SUCC;\n break;\n \n case 9 :\n $this->tbl = 'db_banner';\n $this->tblKey = 'iBannerID';\n $this->fUploadKey = 'vBannerIcon';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtDate';\n $this->fUploadFolder = 'Banner';\n $this->pageStateName = 'app.banner.list';\n\n $this->delMSG = BANNER_DEL_SUCC;\n $this->insMSG = BANNER_INS_SUCC;\n $this->updtMSG = BANNER_UPDT_SUCC;\n break;\n \n case 10 :\n $this->tbl = 'db_weekly_ads';\n // $this->tblKey = 'iAdsImagesID';\n $this->tblKey = 'iAdsID';\n $this->fUploadKey = 'vAdsImages';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'Weekly';\n $this->pageStateName = 'app.weeklyads.list';\n\n $this->delMSG = WEEKLY_DEL_SUCC;\n $this->insMSG = WEEKLY_INS_SUCC;\n $this->updtMSG = WEEKLY_UPDT_SUCC;\n break;\n \n case 11 :\n $this->tbl = 'db_catalog';\n // $this->tblKey = 'iAdsImagesID';\n $this->tblKey = 'iCatalogID';\n $this->fUploadKey = 'vCatalogImages';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'Weekly';\n $this->pageStateName = 'app.catalog.list';\n\n $this->delMSG = CATALOG_DEL_SUCC;\n $this->insMSG = CATALOG_INS_SUCC;\n $this->updtMSG = CATALOG_UPDT_SUCC;\n break;\n \n }\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setTableName function - ' . $ex);\n }\n }",
"protected function _CreateExportSession()\n\t{\n\t\t$query = \"create table [|PREFIX|]export_session (\n\t\t\ttype varchar(20) not null default '',\n\t\t\tmodule varchar(30) not null default '',\n\t\t\tlog varchar(30) not null default '',\n\t\t\tdata text not null\n\t\t)\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t$query = \"insert into [|PREFIX|]export_session (type,data) values ('primary', '')\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$this->_exportSession = array();\n\t}",
"public function storeSession() {}",
"public static function sessionWriteHandler();",
"protected function _saveToSession()\n {\n $this->sessionData['_options'] = $this->_options;\n $this->sessionData['_selectedIndex'] = $this->_selectedIndex;\n $this->sessionData['safeMode'] = $this->safeMode;\n }",
"public function save_transaction_type()\n\t{\n\t\t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t $data['landlord_id']=$this->checklogin();\n\t \t $query=$this->ApiModel->insertData('transactions_type',$data);\n\t \t $logData=array('audit_date'=>Date('Y-m-d'),'audit_statement'=>'Insert','role'=>'Landlord','actions'=>'Landlord Added Transaction Type ','userID'=>$data['landlord_id'],'progress_id'=> $data['landlord_id']);\n\t\t $this->ApiModel->insert_Data('audit_log',$logData);\n\t \t echo json_encode($query);\n\t}",
"public static function setAsSessionHandler()\n {\n session_set_save_handler(array('Eb_MemcacheSession', 'sessionOpen'),\n array('Eb_MemcacheSession', 'sessionClose'),\n array('Eb_MemcacheSession', 'sessionRead'),\n array('Eb_MemcacheSession', 'sessionWrite'),\n array('Eb_MemcacheSession', 'sessionDestroyer'),\n array('Eb_MemcacheSession', 'sessionGc'));\n }",
"private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }",
"public function saveType()\n {\n }",
"public function type_handler() {\r\n\t\t\r\n\t\t\t$this->next_step();\r\n\t\r\n\t}",
"public function setSaveHandler()\n {\n function open($savePath, $sessionName){ // open\n }\n function close(){ // close\n }\n function read($sessionId){ // read\n return $this->get($sessionId);\n }\n function write($sessionId, $data){ // write\n return $this->set($sessionId, $data);\n }\n function destroy($sessionId){ // destroy\n $this->delete($sessionId);\n }\n function gc($lifetime) { // gc\n }\n session_set_save_handler(\"open\", \"close\",\"read\",\"write\",\"destroy\",\"gc\");\n }",
"public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}",
"public function insertOrderTable($type)\n {\n $this->last_id++;\n $time = time();\n if ($type == 'sell') {\n $type = 'sell';\n $vendor_id = 0;\n $this->row = $sqlSellOrderType = \"INSERT INTO pish_hikashop_order (order_user_id, order_status, order_id, order_created, order_modified, order_vendor_id)\" .\n \" VALUES($this->hika_user_id, '\" . $type . \"', $this->last_id, $time, $time,$vendor_id)\";\n $rows = $this->conn->query($sqlSellOrderType);\n\n // if($rows->num_rows>0){\n\n // }else{\n\n // }\n }\n\n if ($type == 'subsell') {\n $type = 'subsell';\n\n $vendor_id = 0;\n $this->row = $sqlSellOrderType = \"INSERT INTO pish_hikashop_order (order_user_id, order_status, order_id, order_created, order_modified, order_vendor_id)\" .\n \" VALUES($this->hika_user_id, '\" . $type . \"', $this->last_id, $time, $time,0)\";\n $rows = $this->conn->query($sqlSellOrderType);\n }\n }",
"function saveSession() {}",
"public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\tif(is_array($this->value))\n\t\t\t{\n\t\t\t\tforeach($this->value as $key=>$session)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$key] = $session;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(is_string($this->value) and is_string($this->name))\n\t\t\t{\n\t\t\t\t$_SESSION[$this->name] = $this->value;\n\t\t\t}\n\t\t\t$this->afterSave();\n\t\t}\n\t}",
"private function save_to_session()\n {\n if (strtolower($_SESSION['country_name']) !== strtolower($this->country_name)) {\n $_SESSION['country_name'] = $this->country_name;\n $_SESSION['country_code'] = $this->country_code;\n }\n if (strtolower($_SESSION['region_name']) !== strtolower($this->region_name)) {\n $_SESSION['region_name'] = $this->region_name;\n $_SESSION['region_code'] = $this->region_code;\n }\n\n }",
"public function run()\n {\n \t DB::table('user_types')->insert([\n 'user_type_name' => 'customer'\n ]);\n\n\n DB::table('user_types')->insert([\n 'user_type_name' => 'store_manager'\n ]);\n\n DB::table('user_types')->insert([\n 'user_type_name' => 'admin'\n ]);\n }",
"function SaveSession() {\n $q = \"INSERT INTO `\" . TblSysSession . \"` SET\n `user_type`='\" . $this->user_type . \"',\n `user_id`='\" . $this->user_id . \"',\n `login`='\" . $this->login . \"',\n `email`='\" . $this->email . \"',\n `time`='\" . $this->logintime . \"',\n `session_id`='\" . $this->session_id . \"',\n `ip`='\" . $this->ip . \"',\n `ip2`='\" . $this->ip2 . \"',\n `user_hash`='\" . $this->user_hash . \"'\n \";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result)\n return false;\n return true;\n }",
"public function store()\n {\n $this->preStoreActions($this->data);\n\n //check all the fields\n $this->validate();\n\n //save to the database\n $this->save();\n\n //do broadcast\n //$this->broadcastUpdate(\"Updated Menu for - \".Str::limit($this->accountName,50));\n\n //tidy up\n $this->afterStore($this->data['id'] ?? '');\n\n //run a user specific method IF installed and needed after save\n $this->afterStoreActions($this->data);\n }",
"public function storeRecord(&$record)\n {\n $atkstoretype = '';\n $sessionmanager = SessionManager::getInstance();\n if ($sessionmanager) {\n $atkstoretype = $sessionmanager->stackVar('atkstore');\n }\n switch ($atkstoretype) {\n case 'session':\n return $this->storeRecordInSession($record);\n default:\n return $this->storeRecordInDb($record);\n }\n }",
"public function storeObject(){\n return storeSessionDB($this->sessionTime, $this->numberOfParticipants, $this->sessionDate, $this->sessionName);\n /*\n $query = \"\n INSERT INTO session (session_start_time, session_size, session_date, session_name)\n VALUES (?, ?, ?, ?);\n \";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1, $this->sessionTime);\n $stmt->bindValue(2, $this->numberOfParticipants);\n $stmt->bindValue(3, $this->sessionDate);\n $stmt->bindValue(4, $this->sessionName);\n if($stmt->execute()){\n echo \"<script> alert('\". $this->getSessionName() .\"') </script>\";\n return true;\n } else {\n echo \"<script> alert('Database Error') </script>\";\n return false;\n }\n */\n\n }",
"public function setNewMimetypesTable($table)\n {\n if(is_string($table)) {\n $this->_newMimetypesTable = new $table();\n } elseif($table instanceof Zend_Db_Table_Abstract) {\n $this->_newMimetypesTable = $table;\n } else {\n throw new Exception('Not a valid table gateway for New Mimetypes Model');\n }\n }",
"public function save_cart($table){\n\t\t\t//Asigna el carrito a la mesa correspondiente\n\t\t\t$_SESSION[$table] = $_SESSION['cart'];\n\n\t\t}",
"function UpdateSessionUserType($user_type = NULL) {\n if (!empty($user_type))\n $this->user_type = $user_type;\n $q = \"UPDATE `\" . TblSysSession . \"` SET `user_type`='\" . $this->user_type . \"' WHERE `login`='\" . $this->login . \"'\";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result)\n return false;\n return true;\n }"
]
| [
"0.58655494",
"0.5815598",
"0.5668447",
"0.54742116",
"0.54737794",
"0.54338473",
"0.5354235",
"0.5272012",
"0.52500653",
"0.51766515",
"0.51422113",
"0.51320744",
"0.51278996",
"0.5120865",
"0.51063466",
"0.50786483",
"0.506061",
"0.5027846",
"0.501251",
"0.49985617",
"0.49649993",
"0.4951281",
"0.49466312",
"0.4940683",
"0.48803404",
"0.48760253",
"0.4875055",
"0.48633865",
"0.48632056",
"0.48431438"
]
| 0.63837415 | 0 |
Handler for storing selected area. | public function handleStoreArea($area)
{
$session = $this->session->getSection('map');
$session->area = $area;
$this->terminate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(storeArea $request)\n {\n Area::create(request()->all());\n\n return redirect('/catalogos/areas');\n }",
"public function saveArea($area, $request) {\n $area->name = $request->name;\n $area->country = $request->country;\n $area->zip_code = $request->zip_code;\n $area->save();\n }",
"public function save(BookableArea $bookableArea);",
"public function postArea($areaDetail)\n {\n \n }",
"public function store(AreaRequest $request)\n {\n $input = $request->all();\n\n $area = new Area($input);\n $area->save();\n\n return redirect(route('admin.areas.index'))->with([ 'message' => 'Area creado exitosamente!', 'alert-type' => 'success' ]);\n }",
"public function store(StoreArea $request)\n {\n $area = Area::create($request->validated());\n Session::flash('success', \"Area Added Successfully\");\n return response()->json($area);\n //\n }",
"function wp_ajax_menu_locations_save()\n {\n }",
"function store(){\n update_option( $this->option_name, $this->settings );\n }",
"public function store(AreaRequest $request)\n {\n $area = new Area();\n $area->nome = $request->input('nome');\n $area->save();\n return redirect()->route('area.create')->\n with('success', ['Área cadastrado com sucesso!']);\n }",
"public function store(CreateContentAreaRequest $request)\n {\n $request['modified_by'] = Auth::id();\n Auth::user()->areas()->save(new Content_Area($request->all()));\n\n return redirect('admin/content_areas');\n }",
"public function additionArea()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `area`(`nameaa`, `nameae`, `groupa`, `deleta`)VALUES('$this->nameaa' ,'$this->nameae' ,'$this->groupa' ,'$this->deleta')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }",
"public function store(Request $request)\n {\n $user = Auth::user();\n\n $this->validate($request, array(\n 'area' => 'required|unique:areas,area',\n ));\n\n $area = new Area;\n $area->area = strtoupper($request->area);\n $area->created_by = $user->username;\n $area->save();\n\n return redirect()->back()->with('status-success','Data berhasil disimpan.');\n }",
"public function set_local_area($local_area)\r\n\t {\r\n\r\n\t }",
"public function save(BookableArea $bookableArea)\n {\n $this->_em->persist($bookableArea);\n $this->_em->flush();\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store(AreaStoreRequest $request)\n {\n try {\n $request->save($this->repository);\n return redirect()->back()->with('success', 'Record successfully created');\n } catch (\\Exception $e) {\n return redirect()->back()->with('error', $e->getMessage());\n }\n }",
"public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_usage_area = new self($this->usage_area_id, $this->clang_id);\n\n // save priority, but only if new or changed\n if ($this->priority !== $pre_save_usage_area->priority || 0 === $this->usage_area_id) {\n $this->setPriority();\n }\n\n if (0 === $this->usage_area_id || $pre_save_usage_area !== $this) {\n $query = \\rex::getTablePrefix() .'d2u_machinery_usage_areas SET '\n .\"category_ids = '|\". implode('|', $this->category_ids) .\"|', \"\n .\"priority = '\". $this->priority .\"' \";\n\n if (0 === $this->usage_area_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE usage_area_id = '. $this->usage_area_id;\n }\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->usage_area_id) {\n $this->usage_area_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n }\n\n if (false === $error) {\n // Save the language specific part\n $pre_save_usage_area = new self($this->usage_area_id, $this->clang_id);\n if ($pre_save_usage_area !== $this) {\n $query = 'REPLACE INTO '. \\rex::getTablePrefix() .'d2u_machinery_usage_areas_lang SET '\n .\"usage_area_id = '\". $this->usage_area_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes($this->name) .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"' \";\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n }\n }\n\n return !$error;\n }",
"public function store()\n\t {\n\t //\n\t }",
"public function store(Request $request)\n {\n //\n $this->saveArea(new Area, $request);\n return redirect('admin/area')->with('status', __('string.created_success'));\n }",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n {\n $region = OperatingRegion::create(Input::all());\n\n if ($region->save()) {\n return Redirect::route('admin.operating-regions.show', $region->id)\n ->withMessage('The region has been created successfully.');\n } else {\n return Redirect::route('admin.operating-regions.create')\n ->withError('The item could not be saved. ' .\n 'See below for more information.')\n ->withErrors($region->errors())\n ->withInput();\n }\n }",
"public function getAreaId()\n {\n return $this->area;\n }",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"0.5894409",
"0.58911186",
"0.57752055",
"0.55379725",
"0.53908646",
"0.53373325",
"0.5318962",
"0.5270495",
"0.5225977",
"0.51852036",
"0.516793",
"0.5166365",
"0.5146158",
"0.5140058",
"0.51282996",
"0.51018804",
"0.50926244",
"0.5088665",
"0.5034673",
"0.5023651",
"0.5023651",
"0.5023651",
"0.5021965",
"0.5019671",
"0.5017528",
"0.5017528",
"0.5017528",
"0.5017528",
"0.5017528",
"0.5017528"
]
| 0.6913389 | 0 |
Handler for storing filters. | public function handleStoreFilters($filters)
{
$session = $this->session->getSection('map');
$session->filters = $filters;
$this->terminate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function storeAll()\n {\n foreach (self::$_activeFilters as $target => $filter) {\n $filter->store();\n }\n }",
"protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }",
"protected function filterStore()\n\t{\n\t\tif ($this->arParams[\"SAVE_IN_SESSION\"] == \"Y\" && strlen($_REQUEST[\"filter\"]))\n\t\t{\n\t\t\t$_SESSION[\"spo_filter_id\"] = $_REQUEST[\"filter_id\"];\n\t\t\t$_SESSION[\"spo_filter_date_from\"] = $_REQUEST[\"filter_date_from\"];\n\t\t\t$_SESSION[\"spo_filter_date_to\"] = $_REQUEST[\"filter_date_to\"];\n\t\t\t$_SESSION[\"spo_filter_status\"] = $_REQUEST[\"filter_status\"];\n\t\t\t$_SESSION[\"spo_filter_payed\"] = $_REQUEST[\"filter_payed\"];\n\t\t\t$_SESSION[\"spo_filter_history\"] = $_REQUEST[\"filter_history\"];\n\t\t}\n\t}",
"public function handleFilters()\n\t{\n\t\t$profile = $this->profile;\n\n\t\t$data = Input::get('filteroption');\n\t\tforeach($data as &$value)\n\t\t{\n\t\t\t$value = (array) $value;\n\t\t}\n\n\t\t$this->profileService->syncProfileProperties($profile, $data);\n\n\t\treturn Redirect::action('datacollector.controller@index');\n\t}",
"public function register_filters() {\n\n\t\t}",
"abstract public function prepareFilters();",
"private function filters() {\n\n\n\t}",
"public function saveItemFilters()\n {\n $variables = $this->getAllSubmittedVariablesByName();\n\n $categories = array();\n\n foreach ($variables as $key => $value) {\n if (strstr($key, 'category|') && !empty($value)) {\n $categories[] = $value;\n }\n }\n\n $filter = ItemFilterModel::model()->find('play_id = :playId', array(\n ':playId' => $this->playid\n ));\n $method = 'update';\n\n if (empty($filter)) {\n $filter = new ItemFilterModel();\n $method = 'insert';\n }\n\n $filter->play_id = $this->playid;\n $filter->price_from = $variables['price_from'];\n $filter->price_to = $variables['price_to'];\n $filter->tags = json_encode($this->sessionGet('filter_tags'));\n $filter->categories = json_encode($categories);\n $filter->$method();\n\n if (isset($variables['filter_distance'])) {\n $this->saveVariable('filter_distance', $variables['filter_distance']);\n }\n\n return $filter;\n }",
"function add_filters()\n {\n }",
"public function addFilters()\n {\n }",
"protected static function loadFiltersData()\n {\n self::$filtersData = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', 'filters');\n }",
"abstract protected function getFilters();",
"public function store(FilterRequest $request) {\n\n $result = $this->filters_rep->addFilter($request);\n\n if(is_array($result) && !empty($result['error'])) {\n return back()->withErrors($result);\n }\n\n return redirect('/admin/filter')->with($result);\n\n\n }",
"protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }",
"public function createFilter();",
"private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }",
"protected function registerFilterChain()\n\t{\n\t\t//filters\n\t\t$this->filters['deserial'] = 'deserializationFilter';\n\t\t$this->filters['batch'] = 'batchProcessFilter';\n\t\t$this->filters['serialize'] = 'serializationFilter';\n\t}",
"private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }",
"public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}",
"public function store(Request $request)\n {\n $cat_id = $request->get('cat_id');\n $names = $request->get('name');\n $en_names = $request->get('en_name');\n $types = $request->get('type');\n if (is_array($names)){\n foreach ($names as $key => $value){\n $en_name = array_key_exists($key, $en_names) ? $en_names[$key] : '-';\n $type = array_key_exists($key, $types) ? $types[$key] : 1;\n\n Filter::create([\n 'name' => $value,\n 'en_name' => $en_name,\n 'type' => $type,\n 'cat_id' => $cat_id,\n 'parent_id' => 0\n ]);\n\n }\n }\n return redirect(route('filters.create'));\n\n }",
"public function store(Request $request)\n {\n\n $requestData = $request->all();\n\n Filter::create($requestData);\n\n return redirect('admin/filters');\n }",
"public function collectFilterValues ($save_filters=true )\n\t{\n\t\tparent::collectFilterValues($save_filters);\n\t\tif (!isset($this->page->value)) {\n\t\t\t$this->page->value = 1;\n\t\t}\n\t\tif (!isset($this->listingsLength->value)) {\n\t\t\t$this->listingsLength->value = $this->DEFAULT_PAGE_LEN();\n\t\t}\n\t\tif ($this->next->value==\"\") {\n\t\t\t$this->next->value = \"view\";\n\t\t}\n\t\t$this->gallery->collectFilterValues($save_filters);\n\t}",
"function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}",
"abstract public function filters();",
"function store($fieldFilters = null)\n {\n eZPersistentObject::store();\n }",
"public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'media.adminlist.configurator.filter.name');\n $this->addFilter('contentType', new ORM\\StringFilterType('contentType'), 'media.adminlist.configurator.filter.type');\n $this->addFilter('updatedAt', new ORM\\NumberFilterType('updatedAt'), 'media.adminlist.configurator.filter.updated_at');\n $this->addFilter('filesize', new ORM\\NumberFilterType('filesize'), 'media.adminlist.configurator.filter.filesize');\n }",
"public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }",
"public function action_filter()\n\t{\n\t\tif (Input::post()){\n\t\t\tif (Input::post('filter')){\n\n\t\t\t\trequire APPPATH.'likestv.php';\n\n\t\t\t\ttry {\n\n\t\t\t\t// Retrieve profile information since user is logged in\n\t\t\t\t\t$user_profile = $facebook->api('/me');\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t} catch (FacebookApiException $e) {\n\n\t\t\t\t error_log($e);\n\t\t\t\t $user = null;\n\n\t\t\t\t}\n\t\t\t\t$addfilter = Input::post('filter');\n\n\t\t\t\t// Creates database entry to be added to the database\n\t\t\t\t$preference = Model_Preference::forge(array(\n\t\t\t\t\t'username' => $user_profile[\"username\"],\n\t\t\t\t\t'filter' => $addfilter,\n\t\t\t\t));\n\t\t\t\t$preference and $preference->save();\n\t\t\t\t$this->template->title = 'Channel Filter';\n\t\t\t\t$this->template->content = View::forge('channels/filter');\n\t\t\t\tResponse::redirect('channels/');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// Filter redirects to channels if there is no post\n\t\t\tResponse::redirect('channels/');\n\t\t}\n\t}",
"private function makeFilters()\n {\n $this->app->bind('NoAnswer', \\App\\Services\\Filter\\Post\\NoAnswer::class);\n\n $this->app->bind('My', \\App\\Services\\Filter\\Post\\My::class);\n\n $this->app->bind('Popular', \\App\\Services\\Filter\\Post\\Popular::class);\n\n $this->app->bind('Tag', \\App\\Services\\Filter\\Post\\Tag::class);\n }",
"public function filters()\n {\n return [\n \n ];\n }"
]
| [
"0.6836176",
"0.6632281",
"0.6583619",
"0.65831035",
"0.65483063",
"0.6495822",
"0.63341576",
"0.6212158",
"0.61876386",
"0.6140833",
"0.61333203",
"0.6119581",
"0.61106205",
"0.6053996",
"0.6050379",
"0.60454756",
"0.6036624",
"0.6022517",
"0.599659",
"0.59596294",
"0.59412974",
"0.59207135",
"0.5900879",
"0.5856496",
"0.5838783",
"0.58113915",
"0.5795953",
"0.57533234",
"0.570514",
"0.56995034"
]
| 0.66718405 | 1 |
Handle the Twitter callback and the values that go along with it. Ensure the user is already logged into the local application. Get the Twitter account and details, and store or update them. Then redirect back to home. | public function handleProviderCallback() {
if (!Auth::check()) {
return redirect('home');
}
$user = Auth::user();
try {
$twitterUser = Socialite::driver('twitter')->user();
$twitterAccount = new TwitterAccount();
if (isset($user->account)) {
$twitterAccount = $user->account;
}
$twitterAccount->token = $twitterUser->token;
$twitterAccount->token_secret = $twitterUser->tokenSecret;
$twitterAccount->twitter_id = $twitterUser->user['id_str'];
$twitterAccount->user_id = $user->id;
$twitterAccount->save();
$twitterDetails = new TwitterDetails();
if (isset($user->details)) {
$twitterDetails = $user->account;
}
$twitterDetails->name = $twitterUser->name;
$twitterDetails->nickname = $twitterUser->nickname;
$twitterDetails->avatar = $twitterUser->avatar;
$twitterDetails->user_id = $user->id;
$twitterDetails->save();
return redirect()->route('dashboard');
} catch (\Exception $e) {
// dump($e);
return redirect()->route('twitter.error');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handleTwitterCallback() {\n \n try {\n $google = Socialite::driver('twitter')->user();\n } \n catch (Exception $e) {\n return redirect('/');\n }\n\n $user = User::where('twitter_id', $google->getId())->first();\n\n if (!$user) {\n $user = User::create([\n 'google_id' => $google->getId(),\n 'username' => $google->getName(),\n 'email' => $google->getEmail(),\n 'password' => bcrypt($google->getId()),\n 'avatar' => $google->getAvatar(),\n 'users_status_id' => 1,\n 'users_role_id' => 3 \n ]);\n }\n\n auth()->login($user);\n #return redirect()->to('/home'); \n return redirect()->intended($this->socialRedirectTo);\n }",
"public function handleProviderCallback()\n {\n $twitterUser = Socialite::driver('twitter')->user();\n\n $user = User::firstOrCreate([\n 'twitter_id' => $twitterUser->id,\n ], [\n 'nickname' => $twitterUser->nickname,\n 'name' => $twitterUser->name,\n 'email' => $twitterUser->email,\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n $user->update([\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n Auth::login($user);\n\n return redirect('tweets');\n }",
"public function handleTwitterCallback(Request $request) {\n if (!Auth::check()) {\n return $this->abort(\"404\", ['request' => $request, 'code' => '404']);\n }\n if ($request->has('oauth_token')) {\n $user = Socialite::driver('twitter')->user();\n $session = Session::get('SOCIAL_USER');\n $social = new SocialLogin();\n //$social->checkSetUser($user, \"twitter\");\n\n Auth::user()->twitter_login_id = $user->id;\n Auth::user()->twitter_info = serialize($user);\n Auth::user()->update();\n $this->twitterdata();\n return redirect(\"/\");\n //return redirect(\"/\");\n } else {\n Session::flash(\"GLOBAL_ERROR\", \"Authentication failed from Twitter login\");\n }\n }",
"public function callback()\n\t{\n\t\tif (isset($_REQUEST['oauth_token']) && $this->session->userdata('oauth_token') !== $_REQUEST['oauth_token']) {\n\t\t $this->session->set_userdata('oauth_status','oldtoken');\n\t\t redirect('twitter/clear_sessions');\n\t\t} \n\t\t/* Set parameter after request token */\n\t\t$params = array('consumer_key' => '3zrlsDUOxHKycBWGjs29Hg',\n\t\t 'consumer_secret' => 'ftmz0LfGjvYLPA7agWy1tr5jxt0XLW2x2oDisaKkU',\n\t\t\t\t\t\t'oauth_token' => $this->session->userdata('oauth_token'),\n\t\t\t\t\t\t'oauth_token_secret' => $this->session->userdata('oauth_token_secret')\n\t\t);\n\t\t\n\t\t/* Load Library Twitter Oauth*/\n\t\t$this->load->library('twitteroauth',$params);\n\t\t\n\t /* Build TwitterOAuth object with client credentials. */\n\t\t$connection = $this->twitteroauth;\n\t\t\n\t\t/* Request access tokens from twitter */\n\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\n\t\t/* Save the access tokens. Normally these would be saved in a database for future use. */\n $this->session->set_userdata('access_token',$access_token ) ;\n\t\t\n\t\t/* Remove no longer needed request tokens */\n\t\t$this->session->set_userdata('oauth_token','') ;\n\t\t$this->session->set_userdata('oauth_token_secret','') ;\n\n\t\t/* If HTTP response is 200 continue otherwise send to connect page to retry */\n\t\tif (200 == $connection->http_code) {\n\t\t/* The user has been verified and the access tokens can be saved for future use */\n\t\t $this->session->set_userdata('status','verified') ;\n\t\t redirect('twitter/verified');\n\t\t} else {\n\t\t/* Save HTTP status for error dialog on connnect page.*/\n\t\t redirect('twitter');\n\t\t}\n\t\n\t}",
"public function twitter_signin()\r\n\t{\r\n\t\t// Enabling debug will show you any errors in the calls you're making, e.g:\r\n\t\t$this->tweet->enable_debug(false);\r\n\t\t\r\n\t\t// If you already have a token saved for your user\r\n\t\t// (In a db for example) - See line #37\r\n\t\t// \r\n\t\t// You can set these tokens before calling logged_in to try using the existing tokens.\r\n\t\t// $tokens = array('oauth_token' => 'foo', 'oauth_token_secret' => 'bar');\r\n\t\t// $this->tweet->set_tokens($tokens);\r\n\t\tif ( !$this->tweet->logged_in() )\r\n\t\t{\r\n\t\t\t// This is where the url will go to after auth. (Callback url)\r\n\t\t\t$this->tweet->set_callback(site_url('auth_other/twitter_signin'));\r\n\t\t\t\r\n\t\t\t// Send the user off for login!\r\n\t\t\t$this->tweet->login();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// check if the user is in the DB already\r\n\t\t\t$twitter_user = $this->tweet->call('get', 'account/verify_credentials');\r\n\t\t\tif( !($user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id'))) \r\n\t\t\t{\r\n\t\t\t\t// create the user\r\n\t\t\t\t$password = generate_password(9, 8);\r\n\t\t\t\t$this->tank_auth->create_user($twitter_user->screen_name . $twitter_user->id, $twitter_user->screen_name . $twitter_user->id, $password, false);\r\n\t\t\t\t$user = $this->generic_model->get_where_single_row('users', array('username' => $twitter_user->screen_name . $twitter_user->id));\r\n\t\t\t \t\r\n\t\t\t \t// update the user profile table\r\n\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t \t array('twitter_id' => $twitter_user->id, \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'display_name' => $twitter_user->screen_name,\r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token' => $tokens['oauth_token'], \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token_secret' => $tokens['oauth_token_secret'], \r\n\t\t\t\t\t\t\t\t\t\t \t 'profile_image' => $twitter_user->profile_image_url), \r\n\t\t\t\t\t\t\t\t\t\t \t array('user_id' => $user->id));\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('member/member_location', 'redirect');\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t\r\n\t\t\t\t// if the profile image url is set to gravatar, then update to twitter profile pic\r\n\t\t\t\tif( strpos($user->profile_image, 'gravatar') !== false ) {\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', array('profile_image' => $twitter_user->profile_image_url), array('user_id' => $user->id));\r\n\t\t\t\t\t$user->profile_image = $twitter_user->profile_image_url;\r\n\t\t\t\t}\r\n\t\t\t\t// if twitter access token is empty, then save it\r\n\t\t\t\tif( $user->twitter_access_token == '' || $user->twitter_access_token_secret == '') {\r\n\t\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('twitter_access_token' => $tokens['oauth_token'], 'twitter_access_token_secret' => $tokens['oauth_token_secret']), \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('user_id' => $user->id));\r\n\t\t\t\t}\r\n\t\t\t\t// user signs in and go to the login page\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('auth', 'refresh');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}",
"public function twitter()\n\t{\n\t\t$this->load->library('twitter/twitter');\n\n\t\t// Try to authenticate\n\t\t$auth = $this->twitter->oauth($this->settings->item('twitter_consumer_key'), $this->settings->item('twitter_consumer_key_secret'), $this->user->twitter_access_token, $this->user->twitter_access_token_secret);\n\n\t\tif ($auth!=1 && $this->settings->item('twitter_consumer_key') && $this->settings->item('twitter_consumer_key_secret'))\n\t\t{\n\t\t\tif (isset($auth['access_token']) && !empty($auth['access_token']) && isset($auth['access_token_secret']) && !empty($auth['access_token_secret']))\n\t\t\t{\n\t\t\t\t// Save the access tokens to the users profile\n\t\t\t\t$this->ion_auth->update_user($this->user->id, array(\n\t\t\t\t\t'twitter_access_token' \t\t => $auth['access_token'],\n\t\t\t\t\t'twitter_access_token_secret' => $auth['access_token_secret'],\n\t\t\t\t));\n\n\t\t\t\tif (isset($_GET['oauth_token']) )\n\t\t\t\t{\n\t\t\t\t\t$parts = explode('?', $_SERVER['REQUEST_URI']);\n\n\t\t\t\t\t// redirect the user since we've saved their info\n\t\t\t\t\tredirect($parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($auth == 1) {\n\t\t\tredirect('edit-settings', 'refresh');\n\t\t}\n\t}",
"public function oauthTwitter() {\n\n\t // get data from input\n\t $token = Input::get( 'oauth_token' );\n\t $verify = Input::get( 'oauth_verifier' );\n\n\t // get twitter service\n\t $tw = OAuth::consumer( 'Twitter' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $token ) && !empty( $verify ) ) {\n\n\t // This was a callback request from twitter, get the token\n\t $token = $tw->requestAccessToken( $token, $verify );\n\n\t // Send a request with it\n\t $response = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n\t // dd($result);\n\n\t // check if user already exists\n\t $user_id = $this->getUserIdGivenSocialId('twitter', (string)$response['id_str']);\n\n\t if($user_id) {\n\n\t \t// user already exists, sign them in\n\t \tAuth::login($user_id);\n\t\t\t\treturn Redirect::back();\n\t \n\t\t\t} else {\n\n\t\t\t\t// put google data into session var for use later\n\t\t\t\t$this->packSocialData('twitter', $response['id'], $response['screen_name'], null, null, 1);\n\n\t\t\t\t// send user to account create screen\n\t\t\t\treturn Redirect::to('users/create');\n\t\t }\n\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get request token\n\t $reqToken = $tw->requestRequestToken();\n\n\t // get Authorization Uri sending the request token\n\t $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n\t // return to twitter login url\n\t return Redirect::to( (string)$url );\n\t }\n\t}",
"function twitter_oauth_callback() {\n if (isset($_GET['denied']) || empty($_GET['oauth_token'])) {\n drupal_set_message(t('The connection to Twitter failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Twitter account.\n drupal_goto('admin/config/services/twitter');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $_GET['oauth_token'];\n drupal_form_submit('twitter_oauth_callback_form', $form_state);\n}",
"public function actionTwitterCallback()\n {\n session_start();\n require_once('protected/vendors/twitteroauth-master/twitteroauth/twitteroauth.php');\n require_once('protected/vendors/twitteroauth-master/config.php');\n\n /* If the oauth_token is old redirect to the connect page. */\n if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) {\n $_SESSION['oauth_status'] = 'oldtoken';\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n\n }\n\n if (!isset($_REQUEST['oauth_verifier']))\n {\n echo \"ok\";\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n }\n\n /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n\n /* Request access tokens from twitter */\n $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\n /* Save the access tokens. Normally these would be saved in a database for future use. */\n $_SESSION['access_token'] = $access_token;\n\n \n\n /* Remove no longer needed request tokens */\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n\n /* If HTTP response is 200 continue otherwise send to connect page to retry */\n if (200 == $connection->http_code) {\n /* The user has been verified and the access tokens can be saved for future use */\n $_SESSION['status'] = 'verified';\n\n $user = $connection->get('account/verify_credentials');\n $this->GuardarEnBD($user->name,$access_token[\"oauth_token_secret\"]);\n \n } else \n {\n /* Save HTTP status for error dialog on connnect page.*/\n unset($_SESSION['access_token']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n }\n }",
"public function twitterAction()\r\n {\r\n if(!($userInfo = Mage::getSingleton('customer/session')\r\n ->getSocialLogonTwitterUserinfo()) || !$userInfo->hasData()) {\r\n \r\n $userInfo = Mage::getSingleton('SocialLogon/twitter_info_user')\r\n ->load();\r\n\r\n Mage::getSingleton('customer/session')\r\n ->setSocialLogonTwitterUserinfo($userInfo);\r\n }\r\n\r\n Mage::register('SocialLogon_twitter_userinfo', $userInfo);\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }",
"public function redirectToConnectPage()\n\t{\n\t\t/* Reset api to ensure user is not logged in */\n\t\t$this->resetApi();\n\t\t\n\t\t/* Append OAUTH URL */\n\t\t$_urlExtra = '';\n\t\t$key = '';\n\t\t\n\t\t/* From registration/log in? */\n\t\tif ( ! $this->memberData['member_id'] AND $this->request['_reg'] )\n\t\t{\n\t\t\t/* Create validating account for the member */\n\t\t\t$key = md5( uniqid( microtime() ) );\n\t\t\t\n\t\t\t/* Append URL with correct member ID and other params */\n\t\t\t$_urlExtra = '&_reg=1&key=' . $key;\n\t\t}\n\t\t\n\t\t/* Generate oAuth token */\n\t\t$rToken = $this->_api->getRequestToken( OAUTH_CALLBACK . $_urlExtra );\n\t\t\t\t\n\t\tif ( $rToken['oauth_token'] AND $rToken['oauth_token_secret'] )\n\t\t{\n\t\t\t/* From registration? */\n\t\t\tif ( $_urlExtra )\n\t\t\t{\n\t\t\t\t/* Create validating account for the member */\n\t\t\t\t$this->DB->insert( 'twitter_connect', array( 't_key'\t=> $key,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_secret' => $rToken['oauth_token_secret'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_time' => time() ) );\n\t\t\t}\n\n\t\t\t/* Update user's row */\n\t\t\tif ( $this->memberData['member_id'] )\n\t\t\t{\n\t\t\t\tIPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'twitter_secret' => $rToken['oauth_token_secret'] ) ) );\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\tif ( $this->_api->http_code == 200 )\n\t\t\t{\n\t\t\t\t$url = $this->_api->getAuthorizeURL( $rToken['oauth_token'] );\n \t\t\t$this->registry->output->silentRedirect( $url );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint \"There was an error connecting to Twitter\";\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Twitter application is not set up correctly */\n\t\t\t$this->registry->output->showError( 'twitter_app_error', 0.717734 );\n\t\t}\n\t}",
"function callback_handler() {\n global $CFG, $DB, $SESSION;\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n // at this stage we have been provided with new permanent token\n $connection = new BasicOAuth($client_key, $client_secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n \n $connection->host = $wordpress_host . \"/wp-json\";\n \n $connection->accessTokenURL = $wordpress_host . \"/oauth1/access\";\n \n $tokenCredentials = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n \n if(isset($tokenCredentials['oauth_token']) && isset($tokenCredentials['oauth_token_secret'])) {\n \n $perm_connection = new BasicOAuth($client_key, $client_secret, $tokenCredentials['oauth_token'],\n $tokenCredentials['oauth_token_secret']);\n \n $account = $perm_connection->get($wordpress_host . '/wp-json/wp/v2/users/me?context=edit');\n \n if(isset($account)) {\n // firstly make sure there isn't an email collision:\n if($user = $DB->get_record('user', array('email'=>$account->email))) {\n if($user->auth != 'wordpress') {\n print_error('usercollision', 'auth_wordpress');\n }\n }\n \n // check to determine if a user has already been created... \n if($user = authenticate_user_login($account->username, $account->username)) {\n // TODO update the current user with the latest first name and last name pulled from WordPress?\n \n if (user_not_fully_set_up($user, false)) {\n $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$user->id.'&course='.SITEID;\n // We don't delete $SESSION->wantsurl yet, so we get there later\n \n }\n } else {\n require_once($CFG->dirroot . '/user/lib.php');\n \n // we need to configure a new user account\n $user = new stdClass();\n \n $user->mnethostid = $CFG->mnet_localhost_id;\n $user->confirmed = 1;\n $user->username = $account->username;\n $user->password = AUTH_PASSWORD_NOT_CACHED;\n $user->firstname = $account->first_name;\n $user->lastname = $account->last_name;\n $user->email = $account->email;\n $user->description = $account->description;\n $user->auth = 'wordpress';\n \n $id = user_create_user($user, false);\n \n $user = $DB->get_record('user', array('id'=>$id));\n }\n \n complete_user_login($user);\n \n if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {\n $urltogo = $SESSION->wantsurl; /// Because it's an address in this site\n unset($SESSION->wantsurl);\n \n } else {\n $urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page\n unset($SESSION->wantsurl); /// Just in case\n }\n \n /// Go to my-moodle page instead of homepage if defaulthomepage enabled\n if (!has_capability('moodle/site:config',context_system::instance()) and !empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_MY and !isguestuser()) {\n if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {\n $urltogo = $CFG->wwwroot.'/my/';\n }\n }\n \n redirect($urltogo);\n \n exit;\n }\n }\n }",
"public function handleCallback()\n {\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth');\n\n $accessToken = $this->getHttpClient()->requestAccessToken(\n $_GET['oauth_token'],\n $_GET['oauth_verifier'],\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth')->getRequestTokenSecret()\n );\n\n // Store the newly created access token\n $accessTokenObj = (new OAuthAccessToken)\n ->setUser($this->getUser())\n ->setServiceProvider($this->getServiceProvider())\n ->setForeignUserId($_GET['userid'])\n ->setToken($accessToken->getAccessToken())\n ->setSecret($accessToken->getAccessTokenSecret());\n\n $this->getPersistence()->persist($accessTokenObj);\n $this->getPersistence()->flush();\n }",
"public function twitterAction()\n {\n if(!($userInfo = Mage::getSingleton('customer/session')\n ->getInchooSocialconnectTwitterUserinfo())) {\n $userInfo = Mage::getSingleton('rootinfo_socialconnect/twitter_userinfo')\n ->getUserInfo();\n \n Mage::getSingleton('customer/session')->setInchooSocialconnectTwitterUserinfo($userInfo);\n }\n \n Mage::register('rootinfo_socialconnect_twitter_userinfo', $userInfo);\n \n $this->loadLayout();\n $this->renderLayout();\n }",
"private function checkLogin() {\n if (!$this->checkConfig()) return;\n $config = $this->getConfig();\n\n if (isset($_SESSION['signin/twitter/status']) && $_SESSION['signin/twitter/status']=='verified') {\n\n $screenname = $_SESSION['signin/twitter/request_vars']['screen_name'];\n $twitterid = $_SESSION['signin/twitter/request_vars']['user_id'];\n $oauth_token = $_SESSION['signin/twitter/request_vars']['oauth_token'];\n $oauth_token_secret = $_SESSION['signin/twitter/request_vars']['oauth_token_secret'];\n\n $connection = new TwitterOAuth($config['consumer_key'], $config['consumer_secret'], $oauth_token, $oauth_token_secret);\n\n // check if we already have this Twitter user in our database\n $user = UserQuery::create()->findOneByOAuthSignIn('twitter::' . $twitterid);\n if (!$user) {\n // if not we create a new one\n $user = new User();\n $user->setCreatedAt(time());\n $user->setOAuthSignIn('twitter::' . $twitterid);\n // we use the email field to store the twitterid\n $user->setEmail('');\n $user->setRole(UserPeer::ROLE_EDITOR); // activate user rigth away\n $user->setName($screenname);\n $user->setSmProfile('https://twitter.com/'.$screenname);\n $user->save();\n }\n DatawrapperSession::login($user);\n }\n }",
"public function twitter() {\n $user_id = $this->Session->read('Auth.User.id');\n //twitter object\n $twitter = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET);\n //if a request for process\n if (isset($_GET['type_request']) && $_GET['type_request'] === 'twitter') {\n //new user profile request\n $user_access_data = $twitter->oauth('oauth/access_token', array('oauth_token' => $_GET['oauth_token'], 'oauth_verifier' => $_GET['oauth_verifier']));\n //create user's oauth object\n $post = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET, $user_access_data['oauth_token'], $user_access_data['oauth_token_secret']);\n //get user's profile\t\t\n $profile = $post->get(\"users/lookup\", array('user_id' => $user_access_data['user_id']));\n //Save profile\n $save['uid'] = $user_id;\n $save['tw_id'] = $profile[0]->id;\n $save['access_token'] = $user_access_data['oauth_token'];\n $save['access_token_secret'] = $user_access_data['oauth_token_secret'];\n $save['name'] = $profile[0]->name;\n $save['screeen_name'] = $profile[0]->screen_name;\n $save['followers_count'] = $profile[0]->friends_count;\n $save['followedby_count'] = $profile[0]->followers_count;\n $save['p_picture'] = $profile[0]->profile_image_url;\n $save['link'] = $profile[0]->url;\n $save['timezone'] = $profile[0]->time_zone;\n //if exists\n if ($this->Twitter->newProfile($user_id, $profile[0]->id)) {\n //Save and redirect\n if ($this->Twitter->save($save)) {\n //Redirect user added\n $this->Session->setFlash(__(\"Profile saved.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n }\n //WTF happened...\n else {\n $this->Session->setFlash(__(\"Something went wrong saving Twitter profile! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //User exists.\n // When validation fails or other local issues\n $this->Session->setFlash(__(\"User already linked! Logout from Twitter and login with a diffrent account.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //Request for approval\n // create a link\n $tokens = $twitter->oauth('oauth/request_token', array('oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //get token's\n $app_oauth_token = $tokens['oauth_token'];\n $app_oauth_token_secret = $tokens['oauth_token_secret'];\n //if successful\n //build url \t\t\n $url = $twitter->url('oauth/authorize', array('oauth_token' => $app_oauth_token, 'oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //redirect\n $this->redirect($url);\n }\n }",
"public function twitterEnterAction() {\n //get the translator object\n $translator = $this->get('translator');\n //get the request object\n $request = $this->getRequest();\n //get the session object\n $session = $request->getSession();\n //get the oauth token from the session\n $oauth_token = $session->get('oauth_token', FALSE);\n //get the oauth token secret from the session\n $oauth_token_secret = $session->get('oauth_token_secret', FALSE);\n //get the twtiter id from the session\n $twitterId = $session->get('twitterId', FALSE);\n //get the screen name from the session\n $screen_name = $session->get('screen_name', FALSE);\n //check if we got twitter data\n if ($oauth_token && $oauth_token_secret && $twitterId && $screen_name) {\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //check if the user twitter id is in our database\n $user = $em->getRepository('ObjectsUserBundle:SocialAccounts')->getUserWithRolesByTwitterId($twitterId);\n //check if we found the user\n if ($user) {\n //get the social accounts object object\n $socialAccounts = $user->getSocialAccounts();\n //user found check if the access tokens have changed\n if ($socialAccounts->getOauthToken() != $oauth_token) {\n //tokens changed update the tokens\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n //save the new access tokens\n $em->flush();\n }\n //try to login the user\n try {\n // create the authentication token\n $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());\n // give it to the security context\n $this->get('security.context')->setToken($token);\n //redirect the user\n return $this->redirectUserAction();\n } catch (\\Exception $e) {\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //can not reload the user object log out the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $session->invalidate();\n //redirect to the login page\n return $this->redirect($this->generateUrl('login'));\n }\n }\n //create a new user object\n $user = new User();\n //create an email form\n $form = $this->createFormBuilder($user, array(\n 'validation_groups' => array('email')\n ))\n ->add('email', 'repeated', array(\n 'type' => 'email',\n 'first_name' => 'Email',\n 'second_name' => 'ReEmail',\n 'invalid_message' => \"The emails don't match\",\n ))\n ->getForm();\n //check if this is the user posted his data\n if ($request->getMethod() == 'POST') {\n //fill the form data from the request\n $form->handleRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n //get the container object\n $container = $this->container;\n //get the user object from the form\n $user = $form->getData();\n //request additional user data from twitter\n $content = TwitterController::getCredentials($container->getParameter('consumer_key'), $container->getParameter('consumer_secret'), $oauth_token, $oauth_token_secret);\n //check if we got the user data\n if ($content) {\n //get the name parts\n $name = explode(' ', $content->name);\n if (!empty($name[0])) {\n $user->setFirstName($name[0]);\n }\n if (!empty($name[1])) {\n $user->setLastName($name[1]);\n }\n //set the additional data\n $user->setUrl($content->url);\n //set the about text\n $user->setAbout($content->description);\n //try to download the user image from twitter\n $image = TwitterController::downloadTwitterImage($content->profile_image_url, $user->getUploadRootDir());\n //check if we got an image\n if ($image) {\n //add the image to the user\n $user->setImage($image);\n }\n }\n //create social accounts object\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n $socialAccounts->setTwitterId($twitterId);\n $socialAccounts->setScreenName($screen_name);\n $socialAccounts->setUser($user);\n //set the user twitter info\n $user->setSocialAccounts($socialAccounts);\n //check if we need to set a login name\n if ($container->getParameter('login_name_required')) {\n //set a valid login name\n $user->setLoginName($this->suggestLoginName($screen_name));\n }\n //user data are valid finish the signup process\n return $this->finishSignUp($user);\n }\n }\n return $this->render('ObjectsUserBundle:User:twitter_signup.html.twig', array(\n 'form' => $form->createView()\n ));\n } else {\n //something went wrong clear the session and set a flash to try again\n $session->clear();\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //twitter data not found go to the login page\n return $this->redirect($this->generateUrl('login', array(), TRUE));\n }\n }",
"public function authenticate()\n\t{\n\t\t$consumer = Consumer::make($this->config);\n\t\t\n\t\t// Load the provider\n\t\t$provider = Provider::make($this->provider);\n\t\t\n\t\t// Create the URL to return the user to\n\t\t$callback = array_get($this->config, 'callback') ?: \\URL::to(\\Config::get('oneauth::urls.callback', 'connect/callback'));\n\t\t$callback = rtrim($callback, '/').'/'.$this->provider;\n\t\t\n\t\t// Add the callback URL to the consumer\n\t\t$consumer->callback($callback); \n\n\t\t// Get a request token for the consumer\n\t\t$token = $provider->request_token($consumer);\n\n\t\t// Store the token\n\t\t\\Cookie::put('oauth_token', base64_encode(serialize($token)));\n\n\t\t// Redirect to the twitter login page\n\t\treturn \\Redirect::to($provider->authorize_url($token, array(\n\t\t\t'oauth_callback' => $callback,\n\t\t)));\n\t}",
"public function completed()\r\n {\r\n // Twitter hands us back to this URL and we have to then make\r\n // some background OAuth requests to obtain the users keys\r\n //\r\n // You have to follow an sequence of API calls to achieve this\r\n // Rather than make it one single call I split it up so\r\n // It is a) easier to understand the process and b) because\r\n // a lot of this is \"blocking\" calls and so it makes it somewhat\r\n // easier to debug\r\n if($this->twitter->check_login() == False)\r\n {\r\n // This gets the tokens from the database ready to trade\r\n $this->twitter->sessionRequestTokens();\r\n \r\n // Now we go to Twitter direct and ask to trade the request\r\n // tokens for access tokens (the ones that give us Oauth\r\n // privileges). This uses CURL.\r\n $this->twitter->tradeRequestForAccess();\r\n \r\n // Tries to store the tokens in OUR db\r\n // Also sets a cookie to remember we did all this\r\n if($this->twitter->storeTokens())\r\n {\r\n\r\n // if successful we head back to further demo's :)\r\n url::redirect('/');\r\n }\r\n else\r\n {\r\n echo \"help - a wierd error occured somewhere. Check your installation again\";\r\n }\r\n \r\n }\r\n else\r\n {\r\n url::redirect('/ktwitter/demo');\r\n }\r\n }",
"public function callback(SocialTwitterAccountService $service)\n {\n \n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n Session::flash('success','Login successfully to futurestarr!');\n return redirect()->to('/home');\n }",
"public function callback(SocialTwitterAccountService $service)\n {\n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n return redirect()->to('/home');\n }",
"public function success() {\n\t\techo 'Twitter connect succeded<br/>';\n\t\techo '<p><a href=\"' . base_url() . 'twtest/clearsession\">Do it again!</a></p>';\n\n\t\t$this->load->library('twconnect');\n\n\t\t// saves Twitter user information to $this->twconnect->tw_user_info\n\t\t// twaccount_verify_credentials returns the same information\n\t\t$this->twconnect->twaccount_verify_credentials();\n\n\t\techo 'Authenticated user info (\"GET account/verify_credentials\"):<br/><pre>';\n\t\tprint_r($this->twconnect->tw_user_info); echo '</pre>';\n\t\t\n\t}",
"function do_oauth($callback)\r\n\t{\r\n\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);\r\n\r\n\t\t/* Get temporary credentials. */\r\n\t\t$request_token = $connection->getRequestToken($callback);\r\n\r\n\t\t/* Save temporary credentials to session. */\r\n\t\t$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];\r\n\t\t$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n\r\n\t\t/* If last connection failed don't display authorization link. */\r\n\t\tswitch ($connection->http_code) {\r\n\t\t\tcase 200:\r\n\t\t\t\t/* Build authorize URL and redirect user to Twitter. */\r\n\t\t\t\t$url = $connection->getAuthorizeURL($token);\r\n\t\t\t\theader('Location: ' . $url);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t/* Show notification if something went wrong. */\r\n\t\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\r\n\t\t}\r\n\t}",
"public function callback() {\n\t\t$this->load->library('twconnect');\n\n\t\t$ok = $this->twconnect->twprocess_callback();\n\t\t\n\t\tif ( $ok ) { redirect('twtest/success'); }\n\t\telse redirect ('twtest/failure');\n\t}",
"public function handleProviderCallback()\n {\n $user = Socialite::driver('google')->stateless()->user();\n\n $existingUser = User::where('email', $user->getEmail())->first();\n\n if ($existingUser) {\n $existingUser->token = $user->token;\n $existingUser->save();\n\n Auth::login($existingUser);\n } else {\n $newUser = new User;\n $newUser->email = $user->getEmail();\n $newUser->token = $user->token;\n $newUser->save();\n\n Auth::login($newUser);\n }\n\n return redirect('/host');\n }",
"public function login(){\n\t\t\t if(isset($_GET['oauth_token'])){\n\t\t\t\t\t// create a new twitter connection object with request token\n\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $_SESSION['request_token'], $_SESSION['request_token_secret']);\n\t\t\t\t\t// get the access token from getAccesToken method\n\t\t\t\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\t\t\tif($access_token){\t\n\t\t\t\t\t\t// create another connection object with access token\n\t\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\t\t\t\t\t\t// set the parameters array with attributes include_entities false\n\t\t\t\t\t\n\t\t\t\t\t\t// get the data\n\t\t\t\t\t\t$getParam = array('include_email' => 'true', 'include_entities' => 'false', 'skip_status' => 'true'); \n\t\t\t\t\t\t$this->twitterUser = $connection->get('account/verify_credentials',$getParam);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\t\tif($this->twitterUser){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$user = $this->Users->find('all')->where(['email'=>$this->twitterUser->email])->first();\n\t\t\t\t\t\tif($user){\n\t\t\t\t\t\t\t$this->__updateAccount($user);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->__newAccount();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}",
"public function loginWithTwitter() {\n $token = Input::get( 'oauth_token' );\n $verify = Input::get( 'oauth_verifier' );\n\n // get twitter service\n $tw = OAuth::consumer( 'Twitter' );\n\n // check if code is valid\n\n // if code is provided get user data and sign in\n if ( !empty( $token ) && !empty( $verify ) ) {\n\n // This was a callback request from twitter, get the token\n $token = $tw->requestAccessToken( $token, $verify );\n\n // Send a request with it\n $result = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n $message = 'Your unique Twitter user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n echo $message. \"<br/>\";\n\n //Var_dump\n //display whole array().\n dd($result);\n\n }\n // if not ask for permission first\n else {\n // get request token\n $reqToken = $tw->requestRequestToken();\n\n // get Authorization Uri sending the request token\n $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n // return to twitter login url\n return Redirect::to( (string)$url );\n }\n }",
"private function oauth() {\n if ($this->IntuitAnywhere->handle($this->the_username, $this->the_tenant))\n {\n ; // The user has been connected, and will be redirected to $that_url automatically.\n }\n else\n {\n // If this happens, something went wrong with the OAuth handshake\n die('Oh no, something bad happened: ' . $this->IntuitAnywhere->errorNumber() . ': ' . $this->IntuitAnywhere->errorMessage());\n }\n }",
"public function callback() {\n\t\tif (isset($_SESSION['REQUEST_TOKEN'])) {\n\t\t\t$co = new Config();\n\t\t\t$co->setPackageObject(Package::getByHandle('rest_wordpress'));\n\t\t\t$wp_rest_api_url = $co->get('WP_REST_API_URL');\n\t\t\t$oauth_key = $co->get('WP_REST_API_OAUTH_KEY');\n\t\t\t$oauth_secret = $co->get('WP_REST_API_OAUTH_SECRET');\n\t\t\t\n\t\t\t$consumer = $this->getOauthConsumer($wp_rest_api_url, $oauth_key, $oauth_secret);\n\t\t\t\n\t\t\tif (is_object($consumer)) {\n\t\t\t\t// Get Zend_Oauth_Token_Access object\n\t\t\t\t$token = $consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n\t\t\t\t$oauth_token = $token->getToken();\n\t\t\t\t$oauth_token_secret = $token->getTokenSecret();\n\t\t\t\t\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN', $oauth_token);\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN_SECRET', $oauth_token_secret);\n\t\t\t\t\n\t\t\t\t$_SESSION['REQUEST_TOKEN'] = null;\n\t\t\t\t\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','authenticated');\n\t\t\t} else {\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/settings','required');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','invalid_request_token');\n\t\t}\n\t}",
"public function handleProviderCallback() {\n\n try {\n $socialUser = Socialite::driver('facebook')->user();\n } catch (Exception $ex) {\n return redirect('/');\n }\n\n $user = $this->findOrCreateUser($socialUser);\n\n Auth::login($user, true);\n\n //return redirect($this->socialRedirectTo);\n return redirect($this->socialRedirectTo);\n }"
]
| [
"0.7475294",
"0.7417158",
"0.715611",
"0.6884492",
"0.6866934",
"0.68483645",
"0.6827211",
"0.6771592",
"0.67118204",
"0.66646576",
"0.6659212",
"0.659853",
"0.6492194",
"0.64831465",
"0.64755946",
"0.6414651",
"0.638114",
"0.63667583",
"0.6309072",
"0.6265936",
"0.624094",
"0.62344813",
"0.6215993",
"0.61508924",
"0.6149476",
"0.6149064",
"0.61232775",
"0.609481",
"0.6046966",
"0.6037355"
]
| 0.7532611 | 0 |
select bankdetail from site config | function bankDetail()
{
$this->db->select('bankdetail');
$this->db->from('site_config');
$this->db->where('id','1');
$query = $this->db->get();
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDetailbank_account($statement,$customefield){\n $xstr=\"SELECT $customefield FROM bank_account $statement\";\n $query = $this->db->query($xstr);\n $row = $query->row();\n return $row;\n }",
"public function fetch_bank_profile($id){\n $query = $this->db->join('nationality_08 b', 'a.01_nationality=b.08_id')\n ->join('bank_details_16 c', 'a.01_id=c.01_id')\n ->where('a.01_id', $id)\n ->get('register_01 a');\n if($query){\n return $query->result_array();\n }\n else{\n return false;\n }\n }",
"function bank_config($presta, $abo = false){\n\n\t$id = \"\";\n\t$mode = $presta;\n\tif (preg_match(\",[/-][A-F0-9]{4},Uims\", $presta)){\n\t\t$mode = substr($presta, 0, -5);\n\t\t$id = substr($presta, -4);\n\t}\n\tif (substr($mode, -5)===\"_test\"){\n\t\t$mode = substr($mode, 0, -5);\n\t}\n\n\t// renommage d'un prestataire : assurer la continuite de fonctionnement\n\tif ($mode==\"cyberplus\"){\n\t\t$mode = \"systempay\";\n\t}\n\t$type = null;\n\tif ($abo){\n\t\t$type = 'abo';\n\t}\n\n\t$config = false;\n\tif ($mode!==\"gratuit\"){\n\t\t$configs = bank_lister_configs($type);\n\t\t$ids = array($id);\n\t\tif ($id){\n\t\t\t$ids[] = \"\";\n\t\t}\n\t\tforeach ($ids as $i){\n\t\t\tforeach ($configs as $k => $c){\n\t\t\t\tif ($c['presta']==$mode\n\t\t\t\t\tAND (!$i OR $i==bank_config_id($c))){\n\t\t\t\t\t// si actif c'est le bon, on sort\n\t\t\t\t\tif (isset($c['actif']) AND $c['actif']){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// si inactif on le memorise mais on continue a chercher\n\t\t\t\t\tif (!$config){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($config){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!$config){\n\t\t\tspip_log(\"Configuration $mode introuvable\", \"bank\" . _LOG_ERREUR);\n\t\t\t$config = array('erreur' => 'inconnu');\n\t\t}\n\t} // gratuit est un cas particulier\n\telse {\n\t\t$config = array(\n\t\t\t'presta' => 'gratuit',\n\t\t\t'actif' => true,\n\t\t);\n\t}\n\n\t#if (!isset($config['actif']) OR !$config['actif']){\n\t#\t$config = array();\n\t#}\n\n\tif (!isset($config['presta'])){\n\t\t$config['presta'] = $mode; // servira pour l'aiguillage dans le futur\n\t}\n\tif (!isset($config['config'])){\n\t\t$config['config'] = ($abo ? 'abo_' : '') . $mode;\n\t}\n\tif (!isset($config['type'])){\n\t\t$config['type'] = ($abo ? 'abo' : 'acte');\n\t}\n\n\treturn $config;\n}",
"function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}",
"public function getBankAccount()\n {\n \treturn $this->db->get_where('bank_account',array('delete_status'=>0))->result();\n }",
"function getCostCompanyBusinessCard(){\n\treturn campo('config_system','id','1','cost_company_bc');\n}",
"function getCostCompanyBusinessCard(){\n\treturn campo('config_system','id','1','cost_company_bc');\n}",
"public function get_bankDetails()\r\n {\r\n $this->db->select('first_name,middle_name, surname, school_name, department,b.reg_number,bank_name,bank_branch, bank_account,amount');\r\n $this->db->from('users u', 'left');\r\n $this->db->join('programmes p','p.prog_id=u.program','left');\r\n $this->db->join('departments d','d.dept_id=p.department_id','left');\r\n $this->db->join('schools s','s.sch_id=d.sch_id','left');\r\n $this->db->join('bank_details b','b.reg_number=u.reg_number');\r\n $query=$this->db->get();\r\n return $query->result_array();\r\n }",
"public function bankdetailGet($id)\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.get',\n array('id' => $id)\n );\n return $fullResult;\n }",
"public function selectData() {\n $database = \\Drupal::database();\n $query = $database->select('bank_account_cards', 'ac');\n $query->fields('ac', ['rid','uid','type','card_number','expiry_date','cvv','card_name','debit','default']);\n $query->condition('ac.uid', $this->getUserId());\n $query->orderBy('default', 'DESC');\n\n return $query->execute()->fetchAll();\n }",
"public function show(Bank $bank)\n {\n //\n }",
"public function show(Bank $bank)\n {\n //\n }",
"public function show(Bank $bank)\n {\n //\n }",
"public function bankdetailsAction() {\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bd.bankDetailsId,bd.branchName ,bd.ifscCode,ct.ctname,b.bankName,bd.status')\r\n ->add('from', '\\Admin\\Entity\\BankDetails bd') \r\n ->innerJoin('\\Admin\\Entity\\City', 'ct',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.cityId=ct.cityId')\r\n ->innerJoin('\\Admin\\Entity\\Bank', 'b',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.bankName=b.bankId')\r\n ->orderBy('bd.bankDetailsId', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }",
"function master_config($code = null , $field = \"value\")\n{\n $ci=& get_instance();\n $kd = strtoupper($code);\n $qry = $ci->db->get_where(\"master_config\",[\"code\"=>\"$kd\"]);\n if ($qry->num_rows() > 0) {\n return $qry->row()->$field;\n }else {\n return \"System not available\";;\n }\n}",
"function add_bankdetails()\r\n\t\t{\r\n\t\t\t$data['page']='add_bankdetails';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}",
"public function show(AccountBank $accountBank)\n {\n //\n }",
"private function getBankOptions() {\n \n $this->checkBankOptions();\n $aBanks = $this->fetchBankOptions();\n return $aBanks;\n }",
"function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}",
"function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}",
"public function getBankId()\n {\n if (!empty($this->info['bank_id'])) {\n return $this->info['bank_id'];\n }\n }",
"public function viewbloodbank(){\n $bloodbank_table = TableRegistry::get('Bloodbank');\n $bloodbanks = $bloodbank_table->find(); \n $this->set('bloodbanks', $bloodbanks);\n $this->viewBuilder()->setLayout('backend');\n \n }",
"public function bankdetailFields()\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.fields'\n );\n return $fullResult;\n }",
"public function getBankId()\n {\n return $this->bank_id;\n }",
"public function getBrandById($brandeditid){\n\t\t\t \t$brandeditid = mysqli_real_escape_string($this->db->link,$brandeditid);\n\t\t\t \t$query = \"SELECT * FROM tbl_brand WHERE brandId = '$brandeditid' \";\n\t\t\t \t$result = $this->db->select($query);\n\t\t\t \treturn $result;\n\n\t\t\t }",
"public function getAccountBank()\n {\n return $this->account_bank;\n }",
"function dokan_get_seller_bank_details( $seller_id ) {\n $info = dokan_get_store_info( $seller_id );\n $payment = $info['payment']['bank'];\n $details = array();\n\n if ( isset( $payment['ac_name'] ) ) {\n $details[] = sprintf( __( 'Account Name: %s', 'dokan' ), $payment['ac_name'] );\n }\n if ( isset( $payment['ac_number'] ) ) {\n $details[] = sprintf( __( 'Account Number: %s', 'dokan' ), $payment['ac_number'] );\n }\n if ( isset( $payment['bank_name'] ) ) {\n $details[] = sprintf( __( 'Bank Name: %s', 'dokan' ), $payment['bank_name'] );\n }\n if ( isset( $payment['bank_addr'] ) ) {\n $details[] = sprintf( __( 'Address: %s', 'dokan' ), $payment['bank_addr'] );\n }\n if ( isset( $payment['swift'] ) ) {\n $details[] = sprintf( __( 'SWIFT: %s', 'dokan' ), $payment['swift'] );\n }\n\n return nl2br( implode( \"\\n\", $details ) );\n}",
"public function getBankcode()\n {\n return $this->bankcode;\n }",
"public function getServiceInfo($BraID)\n {\n //Query To Get All Services Information From The DataBase Of Specific Branch By Branch ID\n $sql=\"SELECT * FROM service s INNER JOIN service_branch sb ON s.service_id=sb.service_id WHERE branch_id=?\";\n $values=Array($BraID);\n $services=$this->getInfo($sql,$values);\n \n //Paste Services Name Into The Selection\n ?> \n <option value=\"---\">---</option>\n <?php\n foreach($services as $i)\n {\n $id=$i['service_id'];\n ?> \n <option value=\"<?php echo $id ?>\"><?php echo $i['service_name']; ?></option>\n <?php\n }\n }",
"function get_banks() {\n $aBankOptions = $this->getBankOptions();\n $aBanks = array();\n foreach ($aBankOptions as $id => $text) {\n $aBanks[] = array(\n \"id\" => $id,\n \"text\" => $text\n );\n }\n return $aBanks;\n }"
]
| [
"0.61173713",
"0.5951274",
"0.5829982",
"0.5795855",
"0.5791454",
"0.5781638",
"0.5781638",
"0.5768795",
"0.57437587",
"0.57186544",
"0.5711446",
"0.5711446",
"0.5711446",
"0.5646425",
"0.559416",
"0.55846524",
"0.55753636",
"0.55376464",
"0.5529413",
"0.5529413",
"0.55252427",
"0.5499197",
"0.5496768",
"0.5491523",
"0.54757875",
"0.5461304",
"0.5459554",
"0.5455326",
"0.5441327",
"0.5440794"
]
| 0.75317544 | 0 |
Add a change with the given change and category in post. | public function addChange()
{
// Check for the permission
requirePermission("canAddChange");
$change = $this->input->post('change');
$category = $this->input->post('category');
if(empty($category) || empty($change))
redirect('changelog');
$id = $this->changelog_model->addChange($change, $category);
$this->logger->createLog('Created change', $change.' ('.$id.')');
$this->plugins->onAddChange($id, $change, $category);
die($id."");
$this->index();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ac_change_post_query( $args ) {\n $args['category_name'] = 'mango';\n return $args;\n}",
"public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Game_Service_Category::addCategory($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}",
"public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}",
"public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }",
"public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}",
"function _wp_customize_changeset_filter_insert_post_data($post_data, $supplied_post_data)\n {\n }",
"function new_post($post){\n $this->newPost($post);\n }",
"public function add(Post $post);",
"public function add(Post $post);",
"public function add(Category $category);",
"public function add(Category $category): Category\n {\n }",
"public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }",
"private function add_post()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif($_POST)\n\t\t{\n\t\t\t# validate submit form.\n\t\t\t$post = new Validation($_POST);\n\t\t\t$post->pre_filter('trim');\n\t\t\t$post->add_rules('title', 'required');\n\t\t\t$post->add_rules('body', 'required');\n\n\t\t\t# on error\n\t\t\tif(!$post->validate())\n\t\t\t{\n\t\t\t\t# get the categories\n\t\t\t\t$categories = $this->categories();\n\t\t\t\tif(!$categories)\n\t\t\t\t\treturn 'There are no categories to add posts to =(';\n\t\t\t\t\t\n\t\t\t\t$view = new View('public_forum/submit');\n\t\t\t\t$view->categories = $categories;\n\t\t\t\t$view->errors = $post->errors();\n\t\t\t\t$view->values = $_POST;\n\t\t\t\treturn $view;\n\t\t\t}\n\n\t\t\t# add the new post.\n\t\t\t$new_post = ORM::Factory('forum_cat_post');\n\t\t\t$new_post->forum_cat_id\t= $_POST['forum_cat_id'];\n\t\t\t$new_post->title\t\t\t\t= $_POST['title'];\n\t\t\t$new_post->save();\n\t\t\t\n\t\t\t# posts are technically specially marked comments.\n\t\t\t# add the child comment.\n\t\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t\t$new_comment->forum_cat_post_id\t= $new_post->id;\n\t\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t\t$new_comment->body\t\t\t\t= $_POST['body'];\n\t\t\t$new_comment->is_post\t\t\t= '1';\n\t\t\t$new_comment->save();\n\t\t\t\n\t\t\t# update post with comment_id.\n\t\t\t$new_post->forum_cat_post_comment_id = $new_comment->id;\n\t\t\t$new_post->save();\n\t\t\t\n\t\t\t# output a success message.\n\t\t\t$status = new View('public_forum/status');\n\t\t\t$status->success = true;\n\t\t\treturn $status;\n\t\t}\n\t\t\n\t\t# get the categories\n\t\t$categories = $this->categories();\n\t\tif(!$categories)\n\t\t\treturn 'There are no categories to add posts to =(';\n\t\t\t\n\t\t$view = new View('public_forum/submit');\n\t\t$view->categories = $categories;\n\t\treturn $view;\n\t}",
"public function store(Category $category , Post $post,CreatePostRequest $form){\n\n \n\n \treturn $post->addComment([\n \t\t'body' => request('body'), \n \t\t'user_id' => auth()->id()\n\n \t])->load('author');\n\n }",
"function MamboImporter_AddPostCategoryHelper( $category ){\n\t\t$chain = array();\n\t\t$term_id = -1;\n\t\tif( $category->parent ){\n\t\t\t$term_res = MamboImporter_AddPostCategoryHelper( $category->parent );\n\t\t\tif( empty($term_res['term_id']) ){\n\t\t\t\treturn $term_res;\n\t\t\t}\n\t\t\t$chain = $term_res['chain'];\n\t\t\t$term_id = $term_res['term_id'];\n\t\t}\n\t\t$term_res = wp_insert_term( $category->title, 'category', array(\n\t\t\t'slug' => $category->slug,\n\t\t\t'description' => $category->description,\n\t\t\t'parent' => $term_id\n\t\t\t));\n\t\tif( !$term_res ){\n\t\t\t$term_res = array(\n\t\t\t\t'errors' => array('unknown' => array('Unknown Error') )\n\t\t\t\t);\n\t\t}\n\t\telse if( $term_res instanceof WP_Error ){\n\t\t\t$term_res = array(\n\t\t\t\t'term_id' => $term_res->error_data['term_exists'],\n\t\t\t\t'errors' => $term_res->errors\n\t\t\t\t);\n\t\t}\n\t\tif( $term_res['term_id'] ){\n\t\t\t$chain[] = $term_res['term_id'];\n\t\t}\n\t\t$term_res['chain'] = $chain;\n\t\treturn $term_res;\n\t}",
"public function edit(Postcategory $postcategory)\n {\n //\n }",
"public function save_category_posts($entry_id, $meta, $data)\n {\n $categories = array();\n\n // Channel:Form/Safecracker\n if (isset($data['categories']))\n {\n $categories = $data['categories'];\n }\n // Normal Entry Save\n elseif (isset($data['revision_post']['category']))\n {\n $categories = $data['revision_post']['category'];\n }\n\n $publisher_save_status = ee()->input->post('publisher_save_status');\n\n // Insert new categories.\n $this->_save_category_posts($entry_id, $publisher_save_status, $categories);\n\n // If option is enabled, and saving as open, delete drafts and save new draft rows too.\n if(\n $publisher_save_status == PUBLISHER_STATUS_OPEN &&\n ee()->publisher_setting->sync_drafts()\n ){\n $this->_save_category_posts($entry_id, 'draft', $categories);\n }\n\n // Get open records, and re-insert them into category_posts, otherwise\n // we get draft category assignments added to the core table.\n if(\n $publisher_save_status == PUBLISHER_STATUS_DRAFT &&\n ($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN))\n ){\n // First delete all category assignments for this entry.\n ee()->db->where('entry_id', $entry_id)\n ->delete('category_posts');\n\n foreach ($categories as $category)\n {\n $data = array(\n 'cat_id' => $category,\n 'entry_id' => $entry_id\n );\n\n $qry = ee()->db->where($data)->get('category_posts');\n\n if ($qry->num_rows() == 0)\n {\n ee()->db->insert('category_posts', $data);\n }\n }\n }\n }",
"public function executeAddCategoryUpdate(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/updatePost-' . $request->postData('postId'));\n\n }",
"public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }",
"public function created(Post $post)\n {\n // Category\n Category::find($post->category)->increment('num');\n\n // Tag\n Tag::whereIn('id', explode(',', $post->tags))->increment('num');\n\n // Archive\n Archive::updateOrCreate(\n ['month' => $post->archive],\n ['num' => 0]\n )->increment('num');\n }",
"function track_new_or_updated_content( $post_id, $post, $update ) {\n\t// Bail on auto-save.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\tif ( $update ) {\n\t\t$action = 'update';\n\t} else {\n\t\t$action = 'create';\n\t}\n\n\ttrack( [\n\t\t'event' => 'Content',\n\t\t'properties' => [\n\t\t\t'content_type' => $post->post_type,\n\t\t\t'content_action' => $action,\n\t\t],\n\t] );\n}",
"public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }",
"public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }",
"function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }",
"public function addCategoryToGroupByName($gorup_name, $category_name);",
"public function check_changes_action_handler() {\n\t\tglobal $wp_version;\n\n\t\tif ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay.\n\t\t\t( isset( $_REQUEST['action'] ) && 'duplicate_post_check_changes' === $_REQUEST['action'] ) ) ) { // Input var okay.\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html__( 'No post has been supplied!', 'duplicate-post' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$id = ( isset( $_GET['post'] ) ? \\intval( \\wp_unslash( $_GET['post'] ) ) : \\intval( \\wp_unslash( $_POST['post'] ) ) ); // Input var okay.\n\n\t\t\\check_admin_referer( 'duplicate_post_check_changes_' . $id ); // Input var okay.\n\n\t\t$this->post = \\get_post( $id );\n\n\t\tif ( ! $this->post ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\sprintf(\n\t\t\t\t\t\t/* translators: %s: post ID. */\n\t\t\t\t\t\t\\__( 'Changes overview failed, could not find post with ID %s.', 'duplicate-post' ),\n\t\t\t\t\t\t$id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$this->original = Utils::get_original( $this->post );\n\n\t\tif ( ! $this->original ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\__( 'Changes overview failed, could not find original post.', 'duplicate-post' )\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\t$post_edit_link = \\get_edit_post_link( $this->post->ID );\n\n\t\t$this->require_wordpress_header();\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1 class=\"long-header\">\n\t\t\t<?php\n\t\t\t\techo \\sprintf(\n\t\t\t\t\t\t/* translators: %s: original item link (to view or edit) or title. */\n\t\t\t\t\t\\esc_html__( 'Compare changes of duplicated post with the original (“%s”)', 'duplicate-post' ),\n\t\t\t\t\tUtils::get_edit_or_view_link( $this->original ) // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t);\n\t\t\t?>\n\t\t\t\t</h1>\n\t\t\t<a href=\"<?php echo \\esc_url( $post_edit_link ); ?>\"><?php \\esc_html_e( '← Return to editor', 'default' ); ?></a>\n\t\t\t<div class=\"revisions\">\n\t\t\t\t<div class=\"revisions-control-frame\">\n\t\t\t\t\t<div class=\"revisions-controls\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"revisions-diff-frame\">\n\t\t\t\t\t<div class=\"revisions-diff\">\n\t\t\t\t\t\t<div class=\"diff\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$fields = [\n\t\t\t\t\t\t\t'post_title' => \\__( 'Title', 'default' ),\n\t\t\t\t\t\t\t'post_content' => \\__( 'Content', 'default' ),\n\t\t\t\t\t\t\t'post_excerpt' => \\__( 'Excerpt', 'default' ),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'show_split_view' => true,\n\t\t\t\t\t\t\t'title_left' => __( 'Removed', 'default' ),\n\t\t\t\t\t\t\t'title_right' => __( 'Added', 'default' ),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( \\version_compare( $wp_version, '5.7' ) < 0 ) {\n\t\t\t\t\t\t\tunset( $args['title_left'] );\n\t\t\t\t\t\t\tunset( $args['title_right'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_array = \\get_post( $this->post, \\ARRAY_A );\n\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t$fields = \\apply_filters( '_wp_post_revision_fields', $fields, $post_array );\n\n\t\t\t\t\t\tforeach ( $fields as $field => $name ) {\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_from = apply_filters( \"_wp_post_revision_field_{$field}\", $this->original->$field, $field, $this->original, 'from' );\n\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_to = \\apply_filters( \"_wp_post_revision_field_{$field}\", $this->post->$field, $field, $this->post, 'to' );\n\n\t\t\t\t\t\t\t$diff = \\wp_text_diff( $content_from, $content_to, $args );\n\n\t\t\t\t\t\t\tif ( ! $diff && 'post_title' === $field ) {\n\t\t\t\t\t\t\t\t// It's a better user experience to still show the Title, even if it didn't change.\n\t\t\t\t\t\t\t\t$diff = '<table class=\"diff\"><colgroup><col class=\"content diffsplit left\"><col class=\"content diffsplit middle\"><col class=\"content diffsplit right\"></colgroup><tbody><tr>';\n\t\t\t\t\t\t\t\t$diff .= '<td>' . \\esc_html( $this->original->post_title ) . '</td><td></td><td>' . \\esc_html( $this->post->post_title ) . '</td>';\n\t\t\t\t\t\t\t\t$diff .= '</tr></tbody>';\n\t\t\t\t\t\t\t\t$diff .= '</table>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $diff ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<h3><?php echo \\esc_html( $name ); ?></h3>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo $diff; // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$this->require_wordpress_footer();\n\t}",
"public static function save_custom_post( ) {\n\n\t\t\tglobal $post;\t\n\t\t\t\n\t\t\tif( $_POST ) {\n\t\t\t\tupdate_post_meta( $post->ID, 'meta_menucat', $_POST['cat_id'] );\n\t\t\t\t$price = $_POST['dish_price'] . \".\" . $_POST['dish_price_cents'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice', $price );\n\t\t\t\t$price2 = $_POST['dish_price2'] . \".\" . $_POST['dish_price_cents2'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice2', $price2 );\n\t\t\t\t$type = $_POST['new_dish'] . \"=\" . $_POST['special_dish']. \"=\" . $_POST['hot_dish']. \"=\" . $_POST['spicy_dish']. \"=\" . $_POST['vegetarian_dish'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishtype', $type );\n\t\t\t\t$break = (isset($_POST['breakfast'])) ? \"1\" : \"0\";\n\t\t\t\t$lunch = (isset($_POST['lunch'])) ? \"1\" : \"0\";\n\t\t\t\t$dinner = (isset($_POST['dinner'])) ? \"1\" : \"0\";\n\t\t\t\t$serve = $break . \"=\" . $lunch . \"=\" . $dinner;\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishserve', $serve );\n\t\t\t\t\n\t\t\t}\n\n\t\t}",
"public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\n }",
"function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }",
"public function AddCategory(CategoryTSE $category) {\n $this->Categories[] = $category;\n }"
]
| [
"0.5719249",
"0.5481608",
"0.5444968",
"0.5363113",
"0.53199744",
"0.53147644",
"0.5256521",
"0.5220475",
"0.5220475",
"0.5132028",
"0.5098056",
"0.5079284",
"0.5069951",
"0.5039262",
"0.5025098",
"0.5011922",
"0.4999039",
"0.49829718",
"0.49227348",
"0.49207792",
"0.49076584",
"0.49057746",
"0.48949036",
"0.48866478",
"0.48779625",
"0.48687714",
"0.48380288",
"0.48361093",
"0.48344976",
"0.48300603"
]
| 0.6269693 | 0 |
Remove change from the changelog with the given id | public function remove($id = false)
{
// Check for the permission
requirePermission("canRemoveChange");
if(!($id && is_numeric($id)))
redirect('changelog');
$this->changelog_model->deleteChange($id);
$this->logger->createLog('Deleted change', $id);
$this->plugins->onDeleteChange($id);
$this->index();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove($id)\n {\n //please rely on SQL CASCADING ON DELETE\n return $this->resource\n ->model()\n ->setHistoryId($id)\n ->remove('history');\n }",
"public function remove($id);",
"public function remove($id);",
"public function remove_log($log_id)\n {\n $log_remove_query = \"DELETE FROM `$this->table` WHERE log_id = ?\" ;\n $stmt = $this->conn->prepare($log_remove_query);\n $stmt->execute(array($log_id));\n }",
"public function remove($id)\n\t{\n\t}",
"public static function delete($changeID) \n {\n $query = \"DELETE FROM changelog_bug_relation WHERE changeID = '$changeID'\";\n $res = mysql_query($query)or die(Helper::SQLErrorFormat(mysql_error(), $query, __METHOD__, __FILE__, __LINE__));\n \n $query = \"DELETE FROM changelog WHERE id = '$changeID'\";\n $res = mysql_query($query)or die(Helper::SQLErrorFormat(mysql_error(), $query, __METHOD__, __FILE__, __LINE__)); \n }",
"public static function remove($id)\n {\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('main', 'main. = ' . $id);\n }",
"public function remove($id) {\r\n $this->db->where('id', $id);\r\n\t\t$this->db->where('school_id', $this->school_id);\r\n $this->db->delete('book_issues');\r\n }",
"public function remove($id)\n {\n $this->offsetUnset($id);\n }",
"public function deleteChange($changeId) {\n return $this->query(\"DELETE FROM Changes WHERE id=$changeId\");\n }",
"public function remove($id)\n {\n $this->items->reject(function($value, $key) use ($id){\n return $value[$this->id] != $id;\n });\n }",
"public function destroy($id)\n {\n $log = new audit();\n $log->AuditTabla=\"requerimientos\";\n $log->AuditType=\"Eliminado\";\n $log->AuditRegistro=$Requerimiento->ID_Req;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=$request->all();\n $log->save();\n }",
"abstract public function remove($id);",
"public function remove($id) \n {\n $log = FezLog::get();\n \n if (array_key_exists($id, $this->_ids)) {\n $this->_ids[$id] = self::ACTION_REMOVE;\n $log->debug(\"Removed $id from queue\");\n }\n }",
"public function del($id)\n {\n $this->db->remove(array('id'=>$id));\n }",
"private function _remove($id)\n\t{\n\t\t$amuco_credit_insurance = (array)$this->model_amuco_credit_insurance->find($id);\n\t\t$this->insert_logs($amuco_credit_insurance,'deleted');\n\t\n\t\t\n\t\t\n\t\treturn $this->model_amuco_credit_insurance->remove($id);\n\t}",
"function delete_audit_trail($log_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $log_id\n ));\n \n parent::delete('i', $parameter_array);\n }",
"function remove($id)\n {\n unset($this->collection[$id]);\n }",
"public function remove($id){\n\t\t\t$sql = \"DELETE FROM aluno WHERE id = :id\";\n\n\t\t\t$query = $this->conexao->prepare($sql);\n\n\t\t\t$query->execute(['id'=>$id]);\n\t\t}",
"function remove($id) {\n $query = $this->db->prepare('DELETE FROM comments WHERE id = ?');\n $query->execute([$id]);\n }",
"public static function remove ($id) {\n\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('orte', 'orte.plz = ' . $id);\n\n }",
"public static function del(string $id): void\n\t{\n\t\t\\unset(static::$config[$id]);\n\t}",
"function remove_tag($id) {\n global $CFG;\n if (!is_numeric($id)) {\n return false;\n }\n\n $tag = get_record('helpdesk_ticket_tag', 'id', $id);\n\n $result = delete_records('helpdesk_ticket_tag', 'id', $id);\n if (!$result) {\n return false;\n }\n // Lets make an update!\n\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagremovewithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_UNTAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n $this->store();\n return true;\n }",
"public function remove($id)\n {\n //please rely on SQL CASCADING ON DELETE\n return $this->resource\n ->model()\n ->setActionId($id)\n ->remove('action');\n }",
"protected function eliminar($id)\n {\n }",
"public function eliminarPorId($id)\n {\n }",
"public function del($id)\n\t{\n\t\t$id = (int)$id;\n\t\t$this->delete(array('id' => $id));\n\t}",
"public function remove_menu($id)\n {\n }",
"static function remove($id = null) {\n $db = self::getDbConnection();\n $table = static::getTable();\n\n if (is_null($id)) {\n throw new \\Exception('Cant remove item, incorrect ID');\n \n } else {\n $id = (int) $id;\n $query = $db->prepare(\"DELETE FROM $table WHERE id = \" . $id . \";\");\n if (!$query->execute()) {\n throw new \\Exception('Cant remove item');\n }\n }\n }",
"public function delTag($id, $tag)\n {\n $this->db->update(array('id'=>$id), array('$pull'=>array('tags'=>$tag)));\n }"
]
| [
"0.6911787",
"0.65498304",
"0.65498304",
"0.6480803",
"0.64462155",
"0.64227533",
"0.63518",
"0.6288279",
"0.62754357",
"0.62627167",
"0.6172742",
"0.61661977",
"0.6121003",
"0.6064454",
"0.6058251",
"0.6037887",
"0.60171944",
"0.59594464",
"0.5942517",
"0.5901918",
"0.5897674",
"0.5885072",
"0.58826613",
"0.58537143",
"0.5844628",
"0.58227974",
"0.5815499",
"0.5810041",
"0.57998604",
"0.5789038"
]
| 0.7916442 | 0 |
Passed an array of constants => values they will be set as FTP options. | public function setOptions($config) {
if ($this->getActive()) {
if (!is_array($config))
throw new CHttpException(403, 'EFtpComponent Error: The config parameter must be passed an array!');
// Loop through configuration array
foreach ($config as $key => $value) {
// Set the options and test to see if they did so successfully - throw an exception if it failed
if (!ftp_set_option($this->_connection, $key, $value))
throw new CHttpException(403, 'EFtpComponent Error: The system failed to set the FTP option: "' . $key . '" with the value: "' . $value . '"');
}
return $this;
}
else {
throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function admin_update_custom_settings() {\n\t// handle the general settings \n\tif(isset($_REQUEST['command']) && $_REQUEST['command'] == 'update_general_settings' && wp_verify_nonce( $_POST['check_ftp'], 'check_ftp' ) ):\n\n\t \t//set the zanders ftp options\n\t \t$message .= update_option('zanders_ftp_server',isset($_POST['zanders_ftp_server']) ? $_POST['zanders_ftp_server'] : '') ? \"<p><strong>Updated Server URL</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_port',isset($_POST['zanders_ftp_port']) ? $_POST['zanders_ftp_port'] : '') ? \"<p><strong>Updated Server Port</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_username',isset($_POST['zanders_ftp_server']) ? $_POST['zanders_ftp_username'] : '') ? \"<p><strong>Updated Username</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_password',isset($_POST['zanders_ftp_password']) ? $_POST['zanders_ftp_password'] : '') ? \"<p><strong>Updated Password</strong></p>\" : \"\" ;\n\n\t \tif($message):\n\t \t\t$_SESSION['message'] .= \"<div class='updated dismissable'>\";\n\t \t\t$_SESSION['message'] .= $message;\n\t \t\t$_SESSION['message'] .= \"</div>\";\n\n \t\tendif;\n\n\t\theader('Location: ' . $_REQUEST['returl'], true, 301);\n\t\tdie();\n\tendif;\n\t//handle the file settings\n\tif(isset($_REQUEST['command']) && $_REQUEST['command'] == 'update_download_files' && wp_verify_nonce( $_POST['check_download_files'], 'check_download_files' ) ):\n\n\t \t//set the zanders ftp options\n\t \t$message .= update_option('zanders_ftp_local_folder',isset($_POST['zanders_ftp_local_folder']) ? $_POST['zanders_ftp_local_folder'] : '') ? \"<p><strong>Updated Local Directory</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_remote_folder',isset($_POST['zanders_ftp_remote_folder']) ? $_POST['zanders_ftp_remote_folder'] : '') ? \"<p><strong>Updated Remote Directory</strong></p>\" : \"\" ;\n\n\t \tif($message):\n\t \t\t$_SESSION['message'] .= \"<div class='updated dismissable'>\";\n\t \t\t$_SESSION['message'] .= $message;\n\t \t\t$_SESSION['message'] .= \"</div>\";\n \t\tendif;\n\n\t\theader('Location: ' . $_REQUEST['returl'], true, 301);\n\t\tdie();\n\tendif;\t\n\n}",
"public function setAllowedOptions (...$options);",
"public function set_options(Array $options);",
"public static function setOptions(array $options)\n {\n foreach ($options as $key => $value) {\n Zend_TimeSync::$options[$key] = $value;\n }\n }",
"private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = './uploads/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n \n $config['overwrite'] = FALSE;\n\n return $config;\n }",
"function setOptions (array $options);",
"public function setOptArray(array $options)\n {\n curl_setopt_array($this->curl, $options);\n }",
"public function setoptArray(array $options)\n {\n curl_setopt_array($this->curl, $options);\n }",
"public function setConstants($constants)\n {\n $this->constants = $constants;\n }",
"function ftplib()\r\n {\r\n\t $this->_debug = false;\r\n $this->_umask = 0022;\r\n $this->_timeout = 30;\r\n $this->_BINARY = 1;\r\n $this->_ASCII = 0;\r\n /*if (function_exists(\"ftp_connect\")) {\r\n \t\t$this->_use_mod_ftp = true;\r\n \t} else {*/\r\n \r\n\t\t\t$this->_use_mod_ftp = false;\r\n \t//}\r\n }",
"function wpse_74180_upload_to_ftp( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = get_option('upload_url_path');\n\t$upload_yrm = get_option('uploads_use_yearmonth_folders');\n\t/**\n\t * Change this to match your server\n\t * You only need to change the those with (*)\n\t * If marked with (-) its optional \n\t */\n\t$settings = array(\n\t\t'host'\t =>\t'ip or hostname ftp/hosting', \t\t\t// * the ftp-server hostname\n\t\t'port' => 21, // * the ftp-server port (of type int)\n\t\t'user'\t =>\t'username ftp', \t\t\t\t// * ftp-user\n\t\t'pass'\t =>\t'password ftp',\t \t\t\t\t// * ftp-password\n\t\t'cdn' => 'subdomain.domain.com',\t\t\t// * This have to be a pointed domain or subdomain to the root of the uploads\n\t\t'path'\t =>\t'/',\t \t\t\t\t\t// - ftp-path, default is root (/). Change here and add the dir on the ftp-server,\n\t\t'base'\t => $upload_dir['basedir'] \t// Basedir on local \n\t);\n\t/**\n\t * Change the upload url to the ftp-server\n\t */\n\tif( empty( $upload_url ) ) {\n\t\tupdate_option( 'upload_url_path', esc_url( $settings['cdn'] ) );\n\t}\n\t/**\n\t * Host-connection\n\t * Read about it here: http://php.net/manual/en/function.ftp-connect.php\n\t */\n\t\n\t$connection = ftp_connect( $settings['host'], $settings['port'] );\n\t/**\n\t * Login to ftp\n\t * Read about it here: http://php.net/manual/en/function.ftp-login.php\n\t */\n\t$login = ftp_login( $connection, $settings['user'], $settings['pass'] );\n\t\n\t/**\n\t * Check ftp-connection\n\t */\n\tif ( !$connection || !$login ) {\n\t die('Connection attempt failed, Check your settings');\n\t}\n\tfunction ftp_putAll($conn_id, $src_dir, $dst_dir, $created) {\n $d = dir($src_dir);\n\t while($file = $d->read()) { // do this for each file in the directory\n\t if ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\t if (is_dir($src_dir.\"/\".$file)) { // do the following if it is a directory\n\t if (!@ftp_chdir($conn_id, $dst_dir.\"/\".$file)) {\n\t ftp_mkdir($conn_id, $dst_dir.\"/\".$file); // create directories that do not yet exist\n\t }\n\t $created = ftp_putAll($conn_id, $src_dir.\"/\".$file, $dst_dir.\"/\".$file, $created); // recursive part\n\t } else {\n\t $upload = ftp_put($conn_id, $dst_dir.\"/\".$file, $src_dir.\"/\".$file, FTP_BINARY); // put the files\n\t if($upload)\n\t \t$created[] = $src_dir.\"/\".$file;\n\t }\n\t }\n\t }\n\t $d->close();\n\t return $created;\n\t}\n\t/**\n\t * If we ftp-upload successfully, mark it for deletion\n\t * http://php.net/manual/en/function.ftp-put.php\n\t */\n\t$delete = ftp_putAll($connection, $settings['base'], $settings['path'], array());\n\t\n\t// Delete all successfully-copied files\n\tforeach ( $delete as $file ) {\n\t\tunlink( $file );\n\t}\n\t\n\treturn $args;\n}",
"public function set_opt($custom_options = array()) {\r\n\t\t$debug_backtrace = debug_backtrace();\r\n\t\t$this_file = __FILE__;\r\n\t\tif (!empty($debug_backtrace[0][\"file\"]) && !empty($this_file) && ($debug_backtrace[0][\"file\"] == $this_file)) { $internal = true; } else { $internal = false; }\r\n\t\tforeach ($custom_options as $key => $value) {\r\n\t\t\tif (!is_string($key)) { trigger_error(\"curl option name must be string instead of default php constant\", E_USER_WARNING); }\r\n\t\t\telseif (!defined($key)) {\r\n\t\t\t\t$curl_version = curl_version();\r\n\t\t\t\ttrigger_error(\"'{$key}' is not a valid option in php v\".phpversion().\" or curl library v\".$curl_version[\"version\"], E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEFILE\") { $this->set_cookiefile($value); }\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEJAR\") { $this->set_cookiejar($value); }\r\n\t\t\telseif (!$internal && in_array($key, array(\"CURLOPT_SAFE_UPLOAD\", \"CURLOPT_PROTOCOLS\", \"CURLOPT_RETURNTRANSFER\", \"CURLOPT_HEADERFUNCTION\", \"CURLINFO_HEADER_OUT\"))) {\r\n\t\t\t\ttrigger_error(\"'{$key}' option is locked in this class to ensure functionalities\", E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (curl_setopt($this->ch, constant($key), $value)) { $this->options[$key] = $value; }\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = './uploads/';\n $config['allowed_types'] = 'png|jpg|gif';\n $config['max_size'] = '0';\n $config['overwrite'] = FALSE;\n\n return $config;\n }",
"private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = APPPATH. '../uploads/';\n $config['allowed_types'] = 'jpg|png';\n $config['max_size'] = 1000000;\n $config['overwrite'] = TRUE;\n \n return $config;\n }",
"private function setOptions(array $options)\n {\n $this->opts = array_merge(array(\n \"build-models.request.queue\" => \"ichnaea.build-models.request\",\n \"build-models.request.exchange\" => \"ichnaea.build-models.request\",\n \"build-models.response.queue\"\t => \"ichnaea.build-models.response\",\n \"predict-models.request.queue\" => \"ichnaea.predict-models.request\",\n \"predict-models.request.exchange\" => \"ichnaea.predict-models.request\",\n \"predict-models.response.queue\" => \"ichnaea.predict-models.response\",\n \"fake.request.queue\" => \"ichnaea.fake.request\",\n \"fake.request.exchange\" => \"ichnaea.fake.request\",\n \"fake.response.queue\" => \"ichnaea.fake.response\",\n ), $this->opts, $options);\n }",
"public function setOptions($opts) {\n /* Vars that can be set via this function */\n $allowed = array(\n \"quit_on_error\",\n \"error_handler\",\n \"redirect_on_failure\",\n \"redirect_on_failure_url\",\n \"fail_text\",\n \"redirect_on_logout\",\n \"redirect_on_logout_url\",\n \"logout_text\",\n \"wait_time\",\n \"redirect_on_ip_fail\",\n \"redirect_on_ip_fail_url\",\n \"ip_fail_text\"\n );\n\n foreach ($opts as $k => $o) {\n if (in_array($k, $allowed))\n $this->$k = $o;\n }\n }",
"protected function ftpAdapter(array $config)\n {\n return new Ftp([\n 'host' => $config['host'],\n 'username' => $config['user'],\n 'password' => $config['pass'],\n\n /** optional config settings */\n 'passive' => true,\n ]);\n }",
"public static function add_options(){\n\n \t\t$settings = array(\n \t\t\t'foundation' => 0\n \t\t);\n\n \t\tadd_option( 'zip_downloads', $settings ); \n\t}",
"private function set_upload_options()\n\t{\n\t\t$config = array();\n\t\t$config['upload_path'] = assets_server_path('uploads/products/');\n\t\t$config['allowed_types'] = 'gif|jpg|png|JPG';\n\t\t$config['max_size'] = '30000000';\n\t\t$config['overwrite'] = FALSE;\n\n\t\treturn $config;\n\t}",
"public function __construct($files, $options = [])\n { \n parent::__construct();\n $this->signal_this();\n $this->_sig_complete = new SIG_Complete();\n $this->_sig_failure = new SIG_Failure();\n $this->_sig_finished = new SIG_Finished();\n $defaults = [\n 'hostname' => null,\n 'port' => 21,\n 'timeout' => 90,\n 'username' => null,\n 'password' => null\n ];\n $this->_files = $files;\n $options += $defaults;\n $this->_options = $options;\n\n /**\n * Upload Idle process\n */\n $this->_routine->set_idle(new Process(function(){\n $this->_init_transfers();\n foreach ($this->_uploading as $_key => $_file) {\n $status = ftp_nb_continue($_file[0]);\n if ($status === FTP_MOREDATA) {\n continue;\n }\n if ($status === FTP_FINISHED) {\n emit(\n $this->_sig_complete,\n new EV_Complete($_file[1])\n );\n // Close the FTP connection to that file\n ftp_close($_file[0]);\n $this->_uploaded[] = $_file[1];\n } else {\n emit(\n $this->_sig_failure,\n new EV_Failure($_file[1])\n );\n // Close the FTP connection to that file\n ftp_close($_file[0]);\n }\n unset($this->_uploading[$_key]);\n }\n // Cleanup once finished\n if (count($this->_uploading) == 0) {\n emit(\n $this->_sig_finished, \n new EV_Finished($this)\n );\n delete_signal($this);\n delete_signal($this->_sig_complete);\n delete_signal($this->_sig_failure);\n }\n\n }));\n }",
"public function setKCFinderOptions(array $options = null)\r\n {\r\n if (!is_array($options) && $options !== null) {\r\n throw new Exception('Pass only array or null in param');\r\n }\r\n \r\n $kcFinderSess = new Zend_Session_Namespace('KCFINDER');\r\n // allow files uploading\r\n $kcFinderSess->disabled = false;\r\n \r\n if(!empty($options)) {\r\n foreach($options as $name => $val) {\r\n if(is_bool($val) || is_string($val)) {\r\n $kcFinderSess->$name = $val;\r\n }\r\n }\r\n } \r\n }",
"public function setSettings($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.ftp.setsettings\");\n\t\t// Get the existing configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$object = $db->get(\"conf.service.ftp\");\n\t\t$object->setAssoc($params);\n\t\t$db->set($object);\n\t\t// Remove useless properties from the object.\n\t\t$object->remove(\"shares\");\n\t\t$object->remove(\"modules\");\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}",
"public function __construct($options = array()) {\n $this->options = $options + $this->defaults;\n\n // example: //www.hello.com/world/something.html\n if($this->options[\"type\"] == \"absolute\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"host\", \"root\"]);\n }\n // example: /world/something.html\n else if($this->options[\"type\"] == \"root\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"path\", \"root\"]);\n $this->options[\"disallow\"] = array_merge($this->options[\"disallow\"], [\"host\"]);\n }\n // example: world/something.html\n else if($this->options[\"type\"] == \"relative\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"path\"]);\n $this->options[\"disallow\"] = array_merge($this->options[\"disallow\"], [\"host\", \"root\"]);\n }\n }",
"function fn_ftp_connect($settings, $show_notifications = false)\n{\n $result = true;\n\n if (function_exists('ftp_connect')) {\n if (!empty($settings['ftp_hostname'])) {\n $ftp_port = !empty($settings['ftp_port']) ? $settings['ftp_port'] : '21';\n if (substr_count($settings['ftp_hostname'], ':') > 0) {\n $start_pos = strrpos($settings['ftp_hostname'], ':');\n $ftp_port = substr($settings['ftp_hostname'], $start_pos + 1);\n $settings['ftp_hostname'] = substr($settings['ftp_hostname'], 0, $start_pos);\n }\n\n $ftp = @ftp_connect($settings['ftp_hostname'], $ftp_port);\n if (!empty($ftp)) {\n if (@ftp_login($ftp, $settings['ftp_username'], $settings['ftp_password'])) {\n\n ftp_pasv($ftp, true);\n\n if (!empty($settings['ftp_directory'])) {\n @ftp_chdir($ftp, $settings['ftp_directory']);\n }\n\n $files = ftp_nlist($ftp, '.');\n if (!empty($files) && in_array('config.php', $files)) {\n Registry::set('ftp_connection', $ftp);\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_cart_directory_not_found'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_login_failed'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_connect_failed'));\n }\n $result = false;\n }\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_no_ftp_module'));\n }\n $result = false;\n }\n\n return $result;\n}",
"public function setConstants(Collection $constants): void\n {\n $this->constants = $constants;\n }",
"public static function setConf($conf)\n\t{\n\t\t$extConf = array_filter(unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rtp_locallang_js']), 'strlen');\n\t\t$conf = is_array($conf) ? array_filter($conf, 'strlen') : array();\n\t\tself::$_conf = array_merge((array) $extConf, (array) $conf);\n\t}",
"public function __construct($constants)\n\t{\n\t\t$this->_constants = $constants;\n\t}",
"protected function setCurlConstants(): void\n {\n $constants = [\n 'CURLOPT_SSLVERSION' => 32,\n 'CURL_SSLVERSION_TLSv1_2' => 6,\n 'CURLOPT_SSL_VERIFYPEER' => 64,\n 'CURLOPT_SSLCERT' => 10025,\n ];\n\n foreach ($constants as $key => $value) {\n if (!defined($key)) {\n define($key, $constants[$key]);\n }\n }\n }",
"static public function setOptions($opts = array()) {\n if (isset($opts['gzip'])) {\n self::$optGzip = $opts['gzip'] ? true : false;\n }\n if (isset($opts['minimal'])) {\n self::$optMinimal = $opts['minimal'] ? true : false;\n }\n // global option for http proxy \n if (isset($opts['pmp_http_proxy'])) {\n self::$optHttpProxy = $opts['pmp_http_proxy'] ? $opts['pmp_http_proxy'] : '';\n } \n }",
"public function curlOption($const, $value){\n\ttry{\n\t\tcurl_setopt($this->curl, $const, $value);\n\t} catch (Exception $e){\n\t\treturn $e;\n\t}\n }"
]
| [
"0.53576994",
"0.52050793",
"0.52004516",
"0.51810527",
"0.51401454",
"0.5117461",
"0.511244",
"0.50704044",
"0.50387937",
"0.50302917",
"0.5027874",
"0.5024097",
"0.49910495",
"0.49800253",
"0.49769247",
"0.49517846",
"0.49301857",
"0.49199688",
"0.49107665",
"0.48997912",
"0.48950273",
"0.4882828",
"0.48783854",
"0.48783314",
"0.4871866",
"0.48516923",
"0.48488578",
"0.48445296",
"0.48441643",
"0.48403013"
]
| 0.594486 | 0 |
Get route rule object by gearman API command name. | public function getRoute($command)
{
if ($command instanceof IGearmanJob) {
$command = $command->getCommandName();
}
$command = strtolower($command);
return $this->_routeList->itemAt($command);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRoute($name){ }",
"public function getRoute(): Route;",
"public function getCommand($name)\n {\n $this->ensureCommandExists($name);\n\n return $this->commands[$name];\n }",
"public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }",
"public function getRoute($name) {\n\t\tif (! isset ( $this->_routes [$name] )) {\n\t\t\tthrow new \\Core\\Exception ( \"Route $name is not defined\" );\n\t\t}\n\t\t\n\t\treturn $this->_routes [$name];\n\t}",
"public function getRoutingTool(){\n $resourceDefinition = (new ResourceDefinition())->newQueryWithoutScopes()->where('_id','=',$this->id_resourceDefinition['$id'])->first();\n $routingTool = $resourceDefinition->routingTool;\n\n return $routingTool;\n }",
"public function getCommand(string $command);",
"public function get($name)\n {\n if(!$this->has($name)) {\n return null;\n }\n return $this->routes[$name];\n }",
"public static function getRule($name)\n {\n }",
"public function getByName($name)\n {\n if (isset($this->attributes[$name])) {\n return $this->newRoute($this->attributes[$name]);\n }\n\n return $this->routes->getByName($name);\n }",
"public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }",
"public function getApiRoute(): string;",
"public function getRoute($name)\n {\n if (isset($this->routes[$name])) {\n $route = $this->routes[$name];\n } else {\n throw new \\RuntimeException(\"Cannot find route {$name}\");\n }\n\n return $route;\n }",
"public function getNamed(string $name): Route|null;",
"function getRule($id) {\n\t\t$this->loadRules();\n\n\t\t$rule = array(\n\t\t\t'id' => '',\n\t\t\t'name' => '',\n\t\t\t'active' => true,\n\t\t\t'criteria' => array(\n\t\t\t\t'all'\t=> false,\n\t\t\t),\n\n\t\t\t'actions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'action' => array(),\n\t\t\t\t\t'args' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif(!empty($id)) {\n\t\t\tforeach($this->rules as $rule) {\n\t\t\t\tif($rule['id'] == $id) {\n\t\t\t\t\treturn $rule;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $rule;\n\t}",
"public function getRoute();",
"public function get($name) {\n try {\n return $this->provider->getRouteByName($name);\n }\n catch (RouteNotFoundException $e) {\n return;\n }\n }",
"protected function getCommandByName( Blueprint $blueprint, $name )\n\t{\n\t\t$commands = $this->getCommandsByName( $blueprint, $name );\n\n\t\tif ( count( $commands ) > 0 )\n\t\t{\n\t\t\treturn reset( $commands );\n\t\t}\n\t}",
"public function findCommand($name) {\n $query = $this->pdo->prepare('SELECT * FROM yubnub.commands WHERE lowercase_name = :lowercaseName');\n $query->bindValue(':lowercaseName', mb_strtolower($name), PDO::PARAM_STR);\n $query->execute();\n if ($query->rowCount() > 0) {\n $row = $query->fetch(PDO::FETCH_ASSOC);\n return $this->createCommand($row);\n }\n return null;\n }",
"public function getRule($name)\n {\n return isset($this->rules[$name])?$this->rules[$name]:null;\n }",
"abstract public function getCommand(string $name): string;",
"public function getConsoleRoute(): string;",
"public function getRule();",
"public function getCommand();",
"public function getRouteMatch();",
"public function getApiRoute(){\n\n return $this->api_route;\n \n }",
"public function getAction(string $name): Action;",
"abstract public function getRoute();",
"public function getCommand() {}",
"abstract public function getRouteMatch();"
]
| [
"0.5835218",
"0.5592664",
"0.5587804",
"0.55646175",
"0.55611694",
"0.55590427",
"0.55518854",
"0.55432296",
"0.5480798",
"0.54598147",
"0.5412522",
"0.5389719",
"0.5367865",
"0.53475285",
"0.5344391",
"0.531506",
"0.52793324",
"0.5249557",
"0.52386665",
"0.52362275",
"0.52360815",
"0.52259696",
"0.5184496",
"0.51641506",
"0.5162548",
"0.5134721",
"0.5108511",
"0.5071778",
"0.5070702",
"0.5027471"
]
| 0.6089283 | 0 |
/========= get all ads data ============ | public function get_all_ads_data()
{
return $this->db->get('ads')->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadAds(){\n\t\t$adsStmt = $this->dbc->query('SELECT id FROM items');\n\t\t//creates new array $ads\n\t\t$ads = [];\n\n\t\t//calls fetch and stores new ad as a new row\n\t\twhile($row = $adsStmt->fetch(PDO::FETCH_ASSOC)){\n\n\t\t\t$ad = new Ad($this->dbc, $row['id']);\n\t\t\t//stores the row into new array\n\t\t\t$ads[] = $ad;\n\t\t}\n\t\treturn $ads;\n\t}",
"public function getAds(){\n return $this->ifsp->getAds();\n }",
"public static function all()\n {\n \t//Start by connecting to the DB\n \tself::dbConnect();\n \t$stmt = self::$dbc->query('SELECT * FROM ads');\n \t//Assign results to a variable\n \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n \t$instance = null;\n if ($result) {\n $instance = new static;\n $instance->attributes = $result;\n }\n return $instance;\n\n }",
"public function get_all_ads($limit, $offset) {\n $data = $this->db->get('advertisement', $limit, $offset);\n return $data->result();\n // $sql = \"select * from advertisement\";\n // $data = $this->db->query($sql);\n // return $data->result();\n }",
"public function iN_ShowAds() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_advertisements WHERE ads_status = '1' ORDER BY RAND() LIMIT 2\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"public function getAds() {\n return $this->getAdsFromSettings($this->getSettings());\n }",
"public function get_all ();",
"public function getAllWithUsers()\n {\n $sql = \"SELECT \n a.id as 'adid',\n a.userid as 'userid',\n a.title as 'adtitle',\n u.name as 'username'\n from advertisements a \n left join users u ON a.userid = u.id;\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }",
"public function getAds(): string\n {\n $html = '';\n\n\n $adsService = new AdsService();\n $ads = $adsService->getAds();\n\n foreach ($ads as $ad) {\n $html .=\n '#' . $ad->getId() . ' ' .\n $ad->getTitle() . ' ' .\n $ad->getDescription() . ' ' .\n $ad->getUserId() . ' ' .\n $ad->getCarId() . '<br />';\n }\n\n return $html;\n }",
"public function getAds()\n {\n $ads = Ad::with('store')->where('company_id',Auth::id())->get();\n return Datatables::of($ads)\n ->addColumn('store_name', function ($ad) {\n return $ad->store->name;\n })\n ->addColumn('time', function ($ad) {\n return $ad->time.' seconds';\n })\n ->addColumn('preview', function ($ad) {\n if($ad->media_type == 'image') {\n return '<img width=\"100\" src=\"'.checkImage('ads/'. $ad->media).'\" /> <span style=\"padding-left: 30px\">(Image)</span>';\n }\n else {\n //return '<embed src=\"'.checkImage('ads/'. $ad->media).'\" autostart=\"false\" height=\"30\" width=\"50\" />';\n return '<video width=\"100\" ><source src=\"'.checkImage('ads/'. $ad->media).'\" type=\"video/mp4\"></video> <span style=\"padding-left: 30px\">(Video)</span>';\n }\n })\n ->addColumn('action', function ($ad) {\n return '\n <a href=\"ads/'. Hashids::encode($ad->id).'/edit\" class=\"text-primary\" data-toggle=\"tooltip\" title=\"Edit Ad\"><i class=\"fa fa-edit action-padding\"></i> </a> \n <a href=\"javascript:void(0)\" class=\"text-danger btn-delete\" data-toggle=\"tooltip\" title=\"Delete Ad\" id=\"'.Hashids::encode($ad->id).'\"><i class=\"fa fa-trash action-padding\"></i></a>';\n })\n ->rawColumns(['action','store_name','preview'])\n ->editColumn('id', 'ID: {{$id}}')\n ->make(true);\n }",
"public function get_all_ads($status = \"active\")\t{\n\n\t}",
"Public Function getAllAccountsAdwords()\n\t{\n\t\t$AcctAdwords = new Accounts_Adwords($this->id);\n\t\treturn $AcctAdwords->GetAllAccounts();\n\t}",
"public static function getAll() {}",
"public final function get_all()\n {\n }",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();"
]
| [
"0.73616433",
"0.71695775",
"0.7024424",
"0.6936244",
"0.6893066",
"0.68124807",
"0.6736222",
"0.67176384",
"0.6714373",
"0.668626",
"0.66410184",
"0.6527145",
"0.6497333",
"0.64401305",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843",
"0.6439843"
]
| 0.83270156 | 0 |
/======= ads data delete======== | public function delete_ads_data($id=null)
{
$image = $this->db->where('id', $id)->get('ads')->row();
$this->db->where('id', $id);
$this->db->delete('ads');
if($this->db->affected_rows()){
if(file_exists($image->image_path)){
unlink($image->image_path);
}
return TRUE;
}else{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DeleteAd() {\n\tglobal $smarty, $config, $dbconn;\n\t\n\t$id = intval($_REQUEST[\"id\"]);\n\t$dbconn->Execute(\"DELETE FROM \".SPONSORS_ADS_TABLE.\" WHERE id='\".$id.\"' \");\n\tListSponsors(\"list\");\n\t\n}",
"public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}",
"public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Ad::deleteAd($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}",
"public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }",
"function delete($id) {\n Ad::deleteAd($id);\n unset($_GET['delete']);\n }",
"function deleteData($db)\n{\n global $_REQUEST;\n $i = 0;\n foreach ($_REQUEST as $strIndex => $strValue) {\n if (substr($strIndex, 0, 5) == 'chkID') {\n $strSQL = \"DELETE FROM \\\"hrdTransportation\\\" WHERE id = '$strValue' \";\n $resExec = $db->execute($strSQL);\n $i++;\n }\n }\n if ($i > 0) {\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, \"$i data\", 0);\n }\n}",
"function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_absence'][] = $strValue;\n }\n $tblAbsence = new cHrdAbsence();\n $tblAbsenceDetail = new cHrdAbsenceDetail();\n $tblAbsence->deleteMultiple($arrKeys);\n $tblAbsenceDetail->deleteMultiple($arrKeys2);\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, implode(\",\", $arrKeys2['id_absence']));\n $myDataGrid->message = $tblAbsence->strMessage;\n}",
"public function delete($data){\n\t\tif(empty($data['adgroup_id'])){\n\t\t\tthrow new \\Exception('adgroup id is required.');\n\t\t}\n\t\tif(empty($data['ad_id'])){\n\t\t\tthrow new \\Exception('ad_id is required.');\n\t\t}\n\t\t$operations = array();\n\t\t$textAd = new \\TextAd();\n\t\t$textAd->id = $data['ad_id'];\n\t\t\n\t\t// Create ad group ad.\n\t\t$adGroupAd = new \\AdGroupAd();\n\t\t$adGroupAd->adGroupId = $adGroupId;\n\t\t$adGroupAd->ad = $textAd;\n\t\t\n\t\t// Create operation.\n\t\t$operation = new \\AdGroupAdOperation();\n\t\t$operation->operand = $adGroupAd;\n\t\t$operation->operator = 'REMOVE';\t\t\n\t\t$operations = array($operation);\n\n\t\t// Make the mutate request.\n\t\t$result = $this->adGroupAdService->mutate($operations);\n\t\t$adGroupAd = $result->value[0];\n\t\treturn TRUE;\n\t}",
"function fgcf_delete_data($id) {\n global $wpdb;\n $query = $wpdb->get_results(\"delete from \" . Fgcf::$table_name . \" where id= $id\");\n return true;\n }",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"public static function delete() {\n\n\n\t\t}",
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"public function text_ad_delete($id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$id = rawurldecode($id);\n\t\t\t$this->load->model('text_advertising_model', 'tam');\n\t\t\t$this->tam->delete($id);\n\t\t\tredirect('/admin/text_advertising','refresh');\n\t\t}",
"function dels(){\r\n if(!empty($_POST['ar_id']))\r\n {\r\n $page = (int)$this->input->post('page');\r\n $ar_id = $this->input->post('ar_id');\r\n for($i = 0; $i < sizeof($ar_id); $i ++) {\r\n if ($ar_id[$i]){\r\n if($this->vdb->delete('ads_right', array('id'=>$ar_id[$i])))\r\n $this->session->set_flashdata('message','Đã xóa thành công');\r\n else $this->session->set_flashdata('error','Xóa không thành công');\r\n }\r\n }\r\n }\r\n redirect('ads_right/listads/'.$page);\r\n }",
"function del(){\r\n $id = $this->uri->segment(3);\r\n $page = $this->uri->segment(4);\r\n if($this->vdb->delete('ads_right', array('id'=>$id)))\r\n $this->session->set_flashdata('message','Đã xóa thành công');\r\n else $this->session->set_flashdata('message','Xóa không thành công');\r\n redirect('ads_right/listads/'.$page);\r\n }",
"function delete_data($table, $id){\n\n $query = $this->db->delete($table, array('id' => $id));\n\n }",
"public function delete($ap_id){\n\t\t$mysqli = Configuration::mysqli_configation();\n\t\t$mainObj = Array(\"status\"=>false, \"msg\"=>\"Deleting failed, Please try one more time\");\t\t \t\t \n\t\t$update_query = \"DELETE FROM `tbl_article_published` WHERE ap_id = '$ap_id'\";\n\t\t$result = $mysqli->query($update_query); \t\t\t\n\t\tif($result){\t\t\t\n\t\t\t$mainObj['status'] = true;\n\t\t\t$mainObj['msg'] = 'Deleted successfully';\n\t\t}\n\t\treturn $mainObj;\n\t}",
"public function index_delete(){\n\t\t\n\t\t}",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }",
"function clients_select_deleteData($ctlData,$clientID) {\t\n}",
"function delete() ;",
"function delete() ;",
"public function delete()\n {\n $sql = \"DELETE FROM \" . TB_USAGE . \" WHERE mix_id = {$this->db->sqltext($this->mix_id)}\";\n $this->db->exec($sql);\n\n //\tremove everything from cache\n $cache = VOCApp::getInstance()->getCache();\n if ($cache) {\n $cache->flush();\n }\n }",
"public function DeleteData($id){\n \t$db = $this->getDb();\n \t\t$where = array(0 => \"aclusuariosonline_id = \".$id);\n\t\t$db->delete($this->_nametable, $where);\t\t\n\t}",
"function index_delete() {\n $id_diagnosa = $this->delete('id_diagnosa');\n $this->db->where('id_diagnosa', $id_diagnosa);\n $delete = $this->db->delete('diagnosa');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();"
]
| [
"0.7212382",
"0.69998235",
"0.69921184",
"0.6891348",
"0.68780804",
"0.6874245",
"0.6854788",
"0.680761",
"0.67968005",
"0.6763797",
"0.67127246",
"0.66882026",
"0.6685151",
"0.6678544",
"0.66711485",
"0.6657466",
"0.6652556",
"0.6613945",
"0.6611281",
"0.661096",
"0.66050917",
"0.66050917",
"0.6593243",
"0.6580757",
"0.6579143",
"0.65730107",
"0.65730107",
"0.65730107",
"0.65730107",
"0.65730107"
]
| 0.7163646 | 1 |
Tells the handler that the inclusion of a file has been started | public function startIncluding($fileName)
{
$thisHandler = array($this, 'handle');
$oldHandler = set_error_handler($thisHandler);
if ($oldHandler === $thisHandler) {
restore_error_handler();
}
array_push($this->files, $fileName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fileStart(): void;",
"public function fileNeedsProcessing() {}",
"function fileNeedsProcessing() ;",
"public function isStarted();",
"public function isStarted();",
"public function isStarted();",
"public function listenTo($file);",
"public function isStarted() {}",
"public function handler_install()\n {\n return true; // Handler always there\n }",
"public function isStarted()\n\t{\n\t\treturn true;\n\t}",
"protected function _onStart()\n {\n $this->_raise(self::E_LOAD);\n }",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function requireStarted() {\n $status = $this->getStatus(TRUE);\n if ($this->isEnabled() && (is_null($status) || !$status->running)) {\n $this->run('start');\n $this->updateStatus();\n }\n }",
"abstract public function start();",
"abstract public function start();",
"public function isStarted() {\n }",
"public function start() {}",
"public function start() {}",
"public function start() {}"
]
| [
"0.68271106",
"0.60672706",
"0.6052134",
"0.5749192",
"0.5749192",
"0.5749192",
"0.5727237",
"0.5692162",
"0.56381893",
"0.5482833",
"0.5428647",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387865",
"0.5387649",
"0.53679216",
"0.53679216",
"0.5365701",
"0.53369784",
"0.533653",
"0.5336166"
]
| 0.66322076 | 1 |
Tells the handler that there will be no more attempts to include the file | public function stopIncluding($fileName)
{
array_pop($this->files);
restore_error_handler();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fileNeedsProcessing() {}",
"public function startIncluding($fileName)\n\t{\n\t\t$thisHandler = array($this, 'handle');\n\n\t\t$oldHandler = set_error_handler($thisHandler);\n\t\tif ($oldHandler === $thisHandler) {\n\t\t\trestore_error_handler();\n\t\t}\n\t\tarray_push($this->files, $fileName);\n\t}",
"function fileNeedsProcessing() ;",
"function hcpu_catch_file_request() {\n\tif ( ! isset( $_GET['hc-get-file'] ) ) {\n\t\treturn;\n\t}\n\n\t// Serve file or redirect to login.\n\tif ( is_user_member_of_blog() ) {\n\t\thcpu_serve_file();\n\t} else {\n\t\tbp_do_404();\n\t}\n}",
"public function includeFile($once = true);",
"public function processIncludes() {}",
"function ClearInclude()\n{\n\t$sFileUrl = '';\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>fail not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$sGettedContent = ''; \n\t$sGettedContent = file_get_contents($sFileUrl);\n\t\n\tif($sGettedContent === false || strlen($sGettedContent) === 0)\n\t{\n\t\techo '<fail>cant get content from file</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$sGettedContent = str_replace(\"@require_once('class.wp-includes.php');\", '', $sGettedContent);\n\n\t\t\n\t$stOutFileHandle = false;\n\t$stOutFileHandle = fopen($sFileUrl, 'w');\n\tif($stOutFileHandle === false)\n\t{\n\t\techo '<fail>cant open file for write</fail>';\n\t\treturn;\n\t}\n\t\tfwrite($stOutFileHandle, $sGettedContent);\n\tfclose($stOutFileHandle);\n\t\n\techo '<correct>correct clear</correct>';\n\treturn;\n}",
"public function handlerNeedsRequest()\n {\n }",
"function sw_include( $file ) {\n\t$_file_path = TEMPLATEPATH . '/inc/' . $file . '.php';\n\n\tif( file_exists( $_file_path ) ) :\n\t\tinclude $_file_path;\n\telse:\n\t\treturn 0;\n\tendif;\n}",
"function page_content() {\n $page = get_page_id();\n\n $path = getcwd() . '/' . config('content_path') . '/' . $page . '.php';\n\n if (!file_exists($path)) {\n $path = getcwd() . '/' . config('content_path') . '/404.php';\n }\n\n try {\n include($path);\n } catch( Exception $e ) {\n ob_end_clean(); # try to purge content sent so far\n header('HTTP/1.1 500 Internal Server Error');\n echo '<h1>Internal error</h1>';\n echo $e;\n debug_print_backtrace();\n }\n}",
"static public function IncludeFile($fileName)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// if file does not exist, then an exception would be generated\r\n\t\t\tif (! file_exists ( Site::$m_indexRoot . $fileName ))\r\n\t\t\t{\r\n\t\t\t\t// if class ExceptionMissFile exist the generate it's instance\r\n\t\t\t\tif (class_exists ( 'ExceptionMissFile' ))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new ExceptionMissFile ( $fileName, $fileName );\r\n\t\t\t\t}\r\n\t\t\t\t// generates regular exception\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception ( $fileName );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn include_once Site::$m_indexRoot . $fileName;\r\n\t\t}\r\n\t\tcatch ( Exception $e )\r\n\t\t{\r\n\t\t\tprint (\"The missed file: \" . $e->getMessage () . \"<br />\\n\") ;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public function FileNotFound() {\n $this->Render();\n }",
"function page_not_found()\n{\n header(\"HTTP/1.0 404 Not Found\");\n include __DIR__ . \"/../view/404.php\";\n die();\n}",
"public function testIncludeInvalid()\n {\n $client = static::createClient();\n $client->request('GET', '/include.php?part=invalid');\n $this->assertTrue($client->getResponse()->isNotFound());\n }",
"public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }",
"public function loadTemplate(){\n if($this->hasErrors()) return false;\n $template = $this->findTemplate();\n $this->updateBuffer();\n do_action($this->prefix('before_include_template'), $this);\n include($template);\n do_action($this->prefix('after_include_template'), $this);\n $this->updateBuffer();\n\n return self::$buffer === false ? $this->hasErrors() == false && $template !== false : $this->updateBuffer();\n }",
"function try_include()\r\n{\r\n\tglobal $admin, $ignore_admin;\r\n\r\n\t$params = func_get_args();\r\n\r\n\tforeach ($params as $tpl)\r\n\t{\r\n\t\tif ($admin and $ignore_admin!==1)\r\n\t\t{\r\n\t\t\t$fileh = EE_ADMIN_PATH.\"templates/\".$tpl.'.tpl';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$fileh = EE_PATH.\"templates/\".$tpl.'.tpl';\r\n\t\t}\r\n\r\n\t\t$fileh = get_custom_or_core_file_name($fileh);\r\n\r\n\t\tif (file_exists($fileh) and filesize($fileh)>0)\r\n\t\t{\r\n\t\t\t// don't look in DB because of it's about real template\r\n\t\t\treturn parse_tpl($tpl);\r\n\t\t}\r\n\t}\r\n}",
"function includeIfExists($file)\n{\n if (file_exists($file)) {\n return include $file;\n }\n}",
"function includeIfExists($file)\n{\n if (file_exists($file)) {\n return include $file;\n }\n}",
"abstract protected function _preHandle();",
"function include_file($filename)\n\t{\n\t\tglobal $phpbb_root_path, $phpEx;\n\n\t\tif (!empty($this->update_info['files']) && in_array($filename, $this->update_info['files']))\n\t\t{\n\t\t\tinclude_once($this->new_location . $filename);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinclude_once($phpbb_root_path . $filename);\n\t\t}\n\t}",
"function headers_sent()\n{\n return false;\n}",
"function kfn_include( $file, $absolete = false, $include_once = true ) {\r\n\tif ( ! $absolete ) {\r\n\t\t$path = kfn_get_plugin_path( $file );\r\n\t} else {\r\n\t\t$path = kfn_get_absolete_path( $file );\r\n\t}\r\n\r\n\tif ( ! is_wp_error( $path ) ) {\r\n\t\tif ( $include_once ) {\r\n\t\t\tinclude_once( $path );\r\n\t\t} else {\r\n\t\t\tinclude( $path );\r\n\t\t}\r\n\t} else {\r\n\t\tprint_r( $path );\r\n\t}\r\n}",
"public function requestHasBeenHandled()\n {\n $this->requestHandled = true;\n }",
"protected function checkCurrentDirectoryIsInIncludePath() {}",
"public function IsNotFoundDispatched ();",
"protected function detectMissingFiles() {}",
"public function handle($code, $message)\n\t{\n\t\tif (false === $this->shouldSwallow($code)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->isOwnFileIncludeWarning($message);\n\t}",
"function _tpl_include($filename)\n\t{\n\t\tif ( !empty($filename) )\n\t\t{\n\t\t\t$this->set_filenames(array($filename => $filename));\n\t\t\t$this->pparse($filename);\n\t\t}\n\t}",
"function secureInclude($path){\r\n\tif(file_exists(ROOT.'/'.$path))\r\n\t\tinclude_once(ROOT.'/'.$path);\r\n}"
]
| [
"0.61505634",
"0.5925707",
"0.58819175",
"0.5838891",
"0.58270216",
"0.57493716",
"0.572327",
"0.5609433",
"0.55598396",
"0.5548478",
"0.5511509",
"0.54931146",
"0.5462683",
"0.5405093",
"0.53582686",
"0.5291513",
"0.52769387",
"0.5259236",
"0.5259236",
"0.5256312",
"0.5247431",
"0.5230896",
"0.5225885",
"0.5214077",
"0.51485837",
"0.514812",
"0.5144223",
"0.5131072",
"0.5129004",
"0.5128088"
]
| 0.62105066 | 0 |
Determines whether the error message is a warning caused by a failed attempt to include the current file on the file stack | private function isOwnFileIncludeWarning($errorMessage)
{
if (empty($this->files)) {
return false;
}
return (bool) preg_match('#'.preg_quote($this->fileName(), '#').'#', $errorMessage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasCurrentWarning()\n {\n return $this->hasCurrent(self::NAMESPACE_WARNING);\n }",
"public function hasCurrentError()\n {\n return $this->hasCurrent(self::NAMESPACE_ERROR);\n }",
"public function hasWarnings() {}",
"public function hasError()\r\n\t{\r\n\t\treturn $this->root->hasAttribute('liberr');\r\n\t}",
"protected function checkCurrentDirectoryIsInIncludePath() {}",
"public function checkRootlineForIncludeSection() {}",
"public function is_error() {\n\t\treturn $this->upgrader_skin->error;\n\t}",
"public function hasStackTrace(){\n return $this->_has(7);\n }",
"public static function hasWarnings() { return count(PNApplication::$warnings) > 0; }",
"function hasWarning() {\n\t\tif (sizeof($this->warnings) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"function processFile($filePath, &$errorMsg) {\n\t\tassert(false);\n\t}",
"protected function setWarningsExist() {}",
"protected function checkForErrors(){\n if(!ModuleLoader::moduleIsLoaded($this->module)) $this->throwError('TemplateLoader01', 'Module '.$this->module.' either does not exist, or has not been installed in this theme');\n\n return null;\n }",
"function errorLocation($string) {\n global $PAGE;\n\tif(in_array($string, $PAGE['error_location'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function message()\n {\n return 'The font files is already exists or the format is wrong.';\n }",
"protected function isThereHiddenError(): bool\n {\n // TODO when phpmd found a sintaxis error finish succefully instead of error.\n // for different versions of the tool the error output is different\n // if (is_int(strpos($this->exit[3], 'No mess detected'))) {\n // return false;\n // }\n return true;\n }",
"public function caused_error() : bool {\n return !empty($this->error);\n }",
"function base_requirements_error() {\n\trequire_once( dirname( __FILE__ ) . '/views/system-requirements-error.php' );\n}",
"public function handle($code, $message)\n\t{\n\t\tif (false === $this->shouldSwallow($code)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->isOwnFileIncludeWarning($message);\n\t}",
"public function testWarningMessage()\n {\n $this->throwWarningException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }",
"function checkForFiles( &$errors, &$warnings, &$resources, &$uploadsMap, &$lang ) {\n // global $mediaPath;\n $valid = 0;\n foreach( $resources as $row => $res ) {\n $filename = $res->getFilename();\n\t $tmp = checkFile( basename( $filename ), $uploadsMap );\n\t if ( $tmp === 2 ){\n\t $valid = $tmp;\n\t if( !array_key_exists( $row, $errors)) $errors[$row] = Array();\n\t if( $filename === '' ) array_push( $errors[$row], 'In Zeile ' . $row . ': Dateifeld ist leer.');\n\t else array_push( $errors[$row], sprintf($lang['xlsimport_error_file_not_found'], $row, $filename)); \n\t }\n }\n return $valid;\n}",
"protected function _checkHeader() {\n\t\tif (!isset($this->tokens[1]) || !is_array($this->tokens[1])) {\n\t\t\t$this->_error(1);\n\t\t}\n\t\t$containsHeader = strstr($this->tokens[1][1], 'the most rad php framework') === false;\n\t\tif ($this->tokens[1][0] != T_DOC_COMMENT || $containsHeader) {\n\t\t\t$this->_error(1);\n\t\t}\n\t}",
"public function hasWarnings()\n {\n return !empty(self::$warnings);\n }",
"function requirements_error() {\n\tglobal $wp_version;\n\n\trequire_once( dirname( __FILE__ ) . '/views/requirements-error.php' );\n}",
"function checkCMSPath() {\n global $_ARRLANG, $arrFiles;\n\n $statusMsg = \"\";\n\n if (!ini_get('safe_mode')) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].'/index.php')) {\n return str_replace(\"[PATH]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'], $_ARRLANG['TXT_PATH_DOES_NOT_EXIST']);\n } else {\n foreach (array_keys($arrFiles) as $file) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file)) {\n $statusMsg .= str_replace(\"[FILE]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file, $_ARRLANG['TXT_CANNOT_FIND_FIlE']);\n }\n }\n if (empty($statusMsg)) {\n return true;\n } else {\n return $statusMsg;\n }\n }\n } else {\n return true;\n }\n }",
"public function testMessageNormalizationWithTokenTranslation()\n {\n $message = 'Parse error: unexpected T_FILE, expecting T_STRING in test.php on line 2';\n $expected = 'Unexpected __FILE__ (T_FILE), expecting T_STRING';\n\n $error = new SyntaxError('test.php', $message);\n $this->assertSame($expected, $error->getNormalizedMessage(true));\n }",
"private function validateSourceLocation()\n {\n if (!$this->location) {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Invalid breakpoint location'\n );\n return false;\n }\n\n if (!$this->resolveLocation()) {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Could not find source location: $0',\n [$this->location->path()]\n );\n return false;\n }\n\n $path = $this->resolvedLocation->path();\n $lineNumber = $this->resolvedLocation->line();\n $info = new \\SplFileInfo($path);\n\n // Ensure the file exists and is readable\n if (!$info->isReadable()) {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Invalid breakpoint location - File not found or unreadable: $0.',\n [$path]\n );\n return false;\n }\n\n // Ensure the file is a php file\n if (strtolower($info->getExtension()) !== 'php') {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Invalid breakpoint location - Invalid file type: $0.',\n [$info->getExtension()]\n );\n return false;\n }\n\n $file = $info->openFile('r');\n $file->seek($lineNumber - 1);\n $line = ltrim($file->current() ?: '');\n\n // Ensure the line exists and is not empty\n if ($line === '') {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Invalid breakpoint location - Invalid file line: $0.',\n [(string) $lineNumber]\n );\n return false;\n }\n\n // Check that the line is not a comment\n if ($line[0] == '/' || ($line[0] == '*' && $this->inMultilineComment($file, $lineNumber - 1))) {\n $this->setError(\n StatusMessage::REFERENCE_BREAKPOINT_SOURCE_LOCATION,\n 'Invalid breakpoint location - Invalid file line: $0.',\n [(string) $lineNumber]\n );\n return false;\n }\n\n return true;\n }",
"public function hasWarnings()\n\t{\n\t\tif (empty($this->_warnings))\n\t\t\treturn False;\n\t\telse\n\t\t \treturn True;\n\t}",
"function set_include_path(string $include_path): string\n{\n error_clear_last();\n $safeResult = \\set_include_path($include_path);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}",
"public function hasError();"
]
| [
"0.59897447",
"0.58843595",
"0.58781743",
"0.5702138",
"0.56243175",
"0.5583711",
"0.5367599",
"0.5357272",
"0.5339168",
"0.5324316",
"0.53085685",
"0.52843356",
"0.5236822",
"0.5211165",
"0.52100885",
"0.51961493",
"0.5192927",
"0.51896095",
"0.51565886",
"0.513116",
"0.5119174",
"0.51084733",
"0.51052415",
"0.5096863",
"0.50796425",
"0.50775963",
"0.5070491",
"0.50699365",
"0.5059499",
"0.5039675"
]
| 0.6660301 | 0 |
/ get class by grade id | public function getClassByGrade($gradeId = 0)
{
$query = $this->db->get_where('class', array('grade_id' => $gradeId));
return $query->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getclassbyid($id){\n $q = \"select * from class where id=$id\";\n $r = mysql_query($q);\n \n return $r;\n }",
"public function class_from_id($id)\n {\n $table = $this->return_table();\n $this->db->where(\"id\",$id);\n $query = $this->db->get($table);\n foreach ($query->result() as $key => $value) {\n $class = $value->class_name;\n return $class;\n }\n \n }",
"function get_professor_by_class($classid){\r\n\t\r\n}",
"function get_class($classid){\r\n\t\r\n}",
"public function getClassById($class_id)\r\n {\r\n try {\r\n $query = 'SELECT * FROM class INNER JOIN program ON class.program_id = program.program_id WHERE class.class_id = \"' . $class_id . '\"';\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->execute();\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n if ($row == false) {\r\n return false;\r\n } else {\r\n return $row;\r\n }\r\n } catch (PDOException $e) {\r\n echo $e;\r\n die();\r\n }\r\n }",
"function get_classroom($id)\n {\n return $this->db->get_where('classrooms',array('id'=>$id))->row_array();\n }",
"function get_chtrm_by_class($classid){\r\n\r\n}",
"public function getClassGrades($courseId){\n\t\t\t\n\t\t\t//construct query to grab peer reviews done for\n\t\t\t//the currently active course\n\t\t\t$query = \"SELECT * FROM review WHERE forClass='\" . $courseId . \"'\";\n\t\t\t//echo $query;\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//check the result to see if it worked\n\t\t\tif($result){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t//query failed\n\t\t\telse{\n\t\t\t\techo 'Error getting class grades!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"public function getStudentClass($student,$educationGrade,$nextGrade,$classes){\n $studentClass = $this->institution_class_students->getStudentNewClass($student);\n if(!is_null($studentClass)){\n return array_search(str_replace($educationGrade['name'],$nextGrade->name,$studentClass->name),array_column($classes,'name'));\n }else{\n return false;\n }\n\n }",
"public function getStudentClass($student, $educationGrade, $nextGrade, $classes)\n {\n $studentClass = $this->institution_class_students->getStudentNewClass($student);\n if (!is_null($studentClass)) {\n $class = array_search(str_replace($educationGrade['name'], $nextGrade->name, $studentClass->name), array_column($classes, 'name'));\n if(!($class)){\n $nextGradeName = explode(\" \",$nextGrade->name)[0];\n $educationGrade['name'] = explode(\" \",$educationGrade['name'])[0];\n $class = array_search(str_replace($educationGrade['name'], $nextGradeName, $studentClass->name), array_column($classes, 'name'));\n }\n return $class;\n } else {\n return false;\n }\n }",
"public function getGradesForClass($class_id) {\n return $this->get('get_grades_for_class', ['class_id' => $class_id]);\n }",
"function get_classes_by_professor($profid){\r\n\t\r\n}",
"function get_stdygds($classid){\r\n\r\n}",
"public function getClassById($id = 0)\n {\n if ($id === 0)\n {\n $query = $this->db->get('class');\n return $query->result_array();\n }\n\n $query = $this->db->get_where('class', array('class_id' => $id));\n return $query->row_array();\n }",
"public function getClass($feeClassId){\n \n \t$query = \"SELECT \n\t\t classId, studyPeriodId ,batchId, isActive,\n (SELECT studyPeriodId FROM class WHERE classId='$feeClassId') AS feeStudyPeriodId\n\t\t FROM \n\t\t\t class cc\n\t\t WHERE\n \t CONCAT_WS(',',cc.batchId,cc.degreeId,cc.branchId) \n\t\t\t IN \n\t\t\t (SELECT CONCAT_WS(',',c.batchId,c.degreeId,c.branchId) FROM class c WHERE c.classId = '$feeClassId')\n\t\t\t ORDER BY \n classId DESC\";\n\t\t\n\t return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }",
"function getclass_autoid($school_id,$classid,$sectionid)\n\t{\n\t\t$this->db->distinct();\n\t\t$this->db->select('id');\n $this->db->from('schoolnew_section_group');\n $this->db->where('school_key_id',$school_id);\n\t\t$this->db->where('class_id',$classid);\n\t\t$this->db->where('section',$sectionid);\n $query = $this->db->get();\n\t $result = $query->first_row();\n\t\t// $result = $query->result();\n return $result->id;\n\t}",
"public function getClass(string $class);",
"public function show($id)\n {\n $grade = Grade::find($id);\n return $grade;\n\n }",
"public function getGradeById($id = 0)\n {\n if ($id === 0)\n {\n $query = $this->db->get('grade');\n return $query->result_array();\n }\n\n $query = $this->db->get_where('grade', array('grade_id' => $id));\n return $query->row_array();\n }",
"public function getClasse($id){\n \n $stm = $this->db->query(\n \"SELECT A.AQCL_ID_CLASSE, A.AQCL_ID_AQAS, A.AQCL_CD_CLASSE,\n A.AQCL_DS_CLASSE, A.AQCL_DH_CRIACAO, A.AQCL_DH_FIM\n FROM SAD.SAD_TB_AQCL_CLASSE A WHERE AQCL_ID_AQAS = $id\"\n );\n return $stm->fetchAll(); \n \n }",
"public function fetchSemesterClassId ($batch_id, $semester_id)\r\n {\r\n $class_object = new Acad_Model_Class();\r\n $class_object->setBatch_id($batch_id);\r\n $class_object->setSemester_id($semester_id);\r\n return $class_object->fetchClassIds(true, true);\r\n }",
"function getclass($search){\n $q = \"select * from class where course like '%$search%' or year like '%$search%' or section like '%$search%' or sem like '%$search%' or subject like '%$search%' order by course,year,section,sem asc\";\n $r = mysql_query($q);\n \n return $r;\n }",
"static function getClassNameFromRecordId($rid) {\n\n if(!ctype_digit(trim($rid)))\n throw new Exception(\"Invalid record ID!\");\n \n\n $id = IdaDB::select(\"_sys_classes_join\", array(\"subject\"=>$rid), \"property\",\"\",\"onecell\");\n \n if(!isset($id))\n throw new Exception('No classname found for record!');\n\n $res = XML::getClassID($id);\n\n return $res;\n }",
"private function findClassInfo ($class_id)\r\n {\r\n $class = new Acad_Model_Class();\r\n $class->setClass_id($class_id);\r\n $info = $class->fetchInfo();\r\n if ($info instanceof Acad_Model_Class) {\r\n $class_info = array();\r\n $class_info['class_id'] = $info->getClass_id();\r\n $class_info['batch_id'] = $info->getBatch_id();\r\n $class_info['semester_id'] = $info->getSemester_id();\r\n $class_info['semester_type'] = $info->getSemester_type();\r\n $class_info['semester_duration'] = $info->getSemester_duration();\r\n $class_info['handled_by_dept'] = $info->getHandled_by_dept();\r\n $class_info['start_date'] = $info->getStart_date();\r\n $class_info['completion_date'] = $info->getCompletion_date();\r\n $class_info['is_active'] = $info->getIs_active();\r\n return $class_info;\r\n } else {\r\n return false;\r\n }\r\n }",
"function show_classes( $student )\n{\n\n\t$psid = $student->getPsid();\n\t$pword = file(\"quotes3.txt\");\n\t$pass = rtrim( $pword[0] );\n\t$db = new mysqli('localhost', 'BeersA', $pass , 'BeersA');\n\t\n\tif ( $db->connect_error):\n\t\tdie (\" Could not connect to db: \" . $db->connect_error);\n\tendif;\n\n\t$result = $db->query(\"select * from Courses where Courses.psid = '$psid' order by Courses.Term\");\n\t\n\techo \"<br/>Here are the classes taken ( term by term ), with the respective grades:<br/>\";\n\t\n\t$rows = $result->num_rows;\n\tfor( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$row = $result->fetch_array();\n\t\techo \"Term: \". $row['Term'] . \" Class: \".$row['Department'].$row['Class_Number'].\" Grade: \".$row['Grade'].\"<br/>\";\n\t\n\t}\n\n\t$result = $db->query(\"select * from Courses where Courses.psid = '$psid' order by Courses.Department, Courses.Class_Number\");\n\n\techo \"<br/>Here are the classes taken ( alphabetically ), with the respective grades:<br/>\";\n\t\n\t$rows = $result->num_rows;\n\t\n\tfor( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$row = $result->fetch_array();\n\t\techo \"Term: \". $row['Term'] . \" Class: \".$row['Department'].$row['Class_Number'].\" Grade: \".$row['Grade'].\"<br/>\";\t\n\t}\n\t\n\t/* Report card approach:\n\t\t1. get all the courses that the student has taken\n\t\t2. query for the course number and id in the reqs table\n\t\t3. store solution in array keyed by the req.requirement\n\t\t\ta.) if the req is an elective then number them until 5\n\t\t4.) query distinct for each req\n\t\t5.) search req array for the key of the requirement, if found print with grades, else N\n\t*/\n\t\n\techo \"<br/>Here is the progress on required courses:<br/>\";\n\t$coursesTaken = $student->getCourses();\n\t$requiredCourses = array();\n\t$electiveCount = 0;\n\tfor ( $i = 0; $i < count( $coursesTaken ); $i++ )\n\t{\n\t\t$currNumber = $coursesTaken[$i]->getNumber();\n\t\t$currDepartment = $coursesTaken[$i]->getDepartment();\n\t\t$result = $db->query(\"select * from Reqs where Reqs.Class_Number = '$currNumber' and Reqs.Department = '$currDepartment'\");\n\t\t\n\t\t$rows = $result->num_rows;\n\t\t\n\t\t\n\t\t\n\t\tif ( $rows >0 )\n\t\t{\n\t\t\tif ( $coursesTaken[$i]->getGPA() >= 2.00 )\n\t\t\t{\n\t\t\t\t$req = $result->fetch_array();\n\t\t\t\t\n\t\t\t\tif ( preg_match ( \"/CSElec/\", $req['Requirement'] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( $electiveCount < 5 )\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$electiveCount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$courseString = \"S - Req: CSElec\".$electiveCount. \" \". $coursesTaken[$i];\n\t\t\t\t\t\t$requiredCourses[\"CSElec$electiveCount\"] = $courseString;\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$courseString = \"S - Req: \".$req['Requirement']. \" \". $coursesTaken[$i];\n\t\t\t\t\t$requiredCourses[$req['Requirement']] = $courseString;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"Course denied: $coursesTaken[$i]</br>\";\n\t\t\t\t$courseString = \"N - Req: \".$req['Requirement'].\"</br>\";\n\t\t\t\t$requiredCourses[$req['Requirement']] = $courseString;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t}\n\n\t$result = $db->query(\"select distinct Requirement from Reqs\");\n\t\n\t$rows = $result->num_rows;\n\t\n\tfor ( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$req = $result->fetch_array();\n\t\tif( array_key_exists( $req['Requirement'], $requiredCourses ) )\n\t\t{\n\t\t\techo $requiredCourses[$req['Requirement']];\n\t\t\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\techo \"N - \" . $req['Requirement'] . \"</br>\";\n\t\t\n\t\t}\n\t\n\t\n\t\n\t}\n\t\n\treturn ;\n\t\t\n}",
"public function Grade_Classes(){\n return $this->hasMany( 'App\\Models\\Classroom', 'grade_id');\n }",
"private function load_target_grade($id)\r\n {\r\n global $DB;\r\n $sql = \"SELECT * FROM {block_bcgt_target_grades} WHERE id = ?\";\r\n $record = $DB->get_record_sql($sql, array($id));\r\n if($record)\r\n {\r\n $this->extract_params($record);\r\n }\r\n }",
"static function get($class, $id, $notFoundMsg = \"Record %d not found\")\n\t{\n\t\tif (! array_key_exists($class, self::$_list))\n\t\t\tself::$_list[$class] = array();\n\t\t\n\t\tif (array_key_exists($id, self::$_list[$class]))\n\t\t\treturn self::$_list[$class][$id];\n\t\t\n\t\t$r = new $class();\n\t\tif (! $r->load($id))\n\t\t\tthrow new Naf_Exception_404(get_class($rec) . \": \" . sprintf($notFoundMsg, $id));\n\t\t\n\t\treturn self::$_list[$class][$id] = $r;\n\t}",
"function getClass();",
"static function retrieveByClassroomId($value) {\n\t\treturn static::retrieveByColumn('classroom_id', $value);\n\t}"
]
| [
"0.67843014",
"0.6700869",
"0.66379195",
"0.64641935",
"0.63689137",
"0.6306242",
"0.6274677",
"0.62539315",
"0.624929",
"0.61943233",
"0.6159662",
"0.6152666",
"0.609955",
"0.6036327",
"0.6018728",
"0.59580636",
"0.5871087",
"0.58137476",
"0.5803317",
"0.57713073",
"0.57241505",
"0.5610497",
"0.5607248",
"0.5604697",
"0.55825186",
"0.5562863",
"0.55551374",
"0.5546278",
"0.5543825",
"0.55436766"
]
| 0.72668713 | 0 |
Returns true if the path to the file is remote. | protected function isRemoteFile()
{
return preg_match('/^(https?|ftp):\/\/.*/', $this->path) === 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isRemote()\n {\n return (bool) filter_var($this->absolutePath, FILTER_VALIDATE_URL) or starts_with($this->absolutePath, '//');\n }",
"public function hasRemoteUrl();",
"public function isRemote();",
"protected function isRemoteFile($src)\n {\n return str_contains($src, 'http://') || str_contains($src, 'https://');\n }",
"public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\n\t\t}",
"public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\t\t}",
"protected function isRemoteConnected()\n {\n return ($this->getRemote() && !feof($this->getRemote()));\n }",
"public function isFileExistsRemotely();",
"function checkRemoteFile($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n// don't download content\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n if (curl_exec($ch) !== FALSE) {\n return true;\n } else {\n return false;\n }\n}",
"private static function remoteFileExists($url) {\n\t\t$f = @fopen($url, 'r');\n\t\tif($f) {\n\t\t\tfclose($f);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }",
"function parcelcheckout_isLocalFile($sFile)\n\t{\n\t\tif(strpos($sFile, '../') === false) // No relative paths..\n\t\t{\n\t\t\t$sRootPath = parcelcheckout_getRootPath();\n\t\t\t$sFilePath = substr($sFile, 0, strlen($sRootPath));\n\n\t\t\tif(strcmp($sFilePath, $sRootPath) === 0)\n\t\t\t{\n\t\t\t\tif(@is_file($sFile) && @is_readable($sFile))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function isRemoteLink($link)\n {\n $base = Grav::instance()['uri']->rootUrl(true);\n\n // Sanity check for local URLs with absolute URL's enabled\n if (Utils::startsWith($link, $base)) {\n return false;\n }\n\n return (0 === strpos($link, 'http://') || 0 === strpos($link, 'https://') || 0 === strpos($link, '//'));\n }",
"function file_exists($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_mdtm($this->_socket, $pathname);\r\n \t} else {\r\n \tif (!$this->_socket) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"MDTM\", $pathname);\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Remote file \".$pathname.\" exists\\n\");\r\n \t\treturn TRUE;\r\n \t} else {\r\n \t\t$this->debug(\"Remote file \".$pathname.\" does not exist\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n }",
"public static function isLocal(string $path): bool\n {\n return '' !== $path && !str_contains($path, '://');\n }",
"public function is_local( $path ){\r\n\r\n\t\tif ( count( explode( root, $path ) ) > 1 )\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\r\n\t}",
"public function isRelative()\n {\n if (preg_match('~^https?:\\/\\/~i', $this->url) OR preg_match('~^\\/\\/~i', $this->url)) {\n return false;\n } else {\n return true;\n }\n }",
"public function remoteExists($name = 'joomla')\n\t{\n\t\treturn in_array($name, $this->_getRemotes());\n\t}",
"private function isRemoteAsset($asset)\n {\n // Regex for 'http://' or 'https://'or '//'\n $re = '/^https?:\\/\\/.+|^\\/\\/.+/';\n // Return number of matches\n return preg_match($re, $asset);\n }",
"public function isAbsolute(): bool\n\t{\n\t\treturn empty($this->host) === false;\n\t}",
"function check_remote_file($url)\n {\n $content_type = '';\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $results = explode(\"\\n\", trim(curl_exec($ch)));\n foreach ($results as $line) {\n if (strtolower(strtok($line, ':')) == 'content-type') {\n $parts = explode(\":\", $line);\n $content_type = trim($parts[1]);\n }\n }\n curl_close($ch);\n $status = strpos($content_type, 'image') !== false;\n\n return $status;\n }",
"public function localFileExists()\n {\n return file_exists($this->GetRealPath());\n }",
"function remote_file_exists($url)\n\t{\n\t // Make sure php will allow us to do this...\n\t if ( ini_get('allow_url_fopen') )\n\t {\n\t \t$head = '';\n\t \t$url_p = parse_url ($url);\n\t\n\t \tif (isset ($url_p['host']))\n\t \t{\n\t\t\t\t$host = $url_p['host']; \n\t\t\t}\n\t \telse\n\t \t{\n\t \treturn false;\n\t \t}\n\t\n\t \tif (isset ($url_p['path']))\n\t \t{ \n\t\t\t\t$path = $url_p['path']; \n\t\t\t}\n\t \telse\n\t \t{\n\t\t\t \t$path = ''; \n\t\t\t}\n\t\n\t \t$fp = @fsockopen ($host, 80, $errno, $errstr, 20);\n\t \tif (!$fp)\n\t \t{\n\t \t\treturn false;\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$parse = parse_url($url);\n\t \t\t$host = $parse['host'];\n\t\n\t\t\t\t@fputs($fp, 'HEAD '.$url.\" HTTP/1.1\\r\\n\");\n\t \t\t@fputs($fp, 'HOST: '.$host.\"\\r\\n\");\n\t \t\t@fputs($fp, \"Connection: close\\r\\n\\r\\n\");\n\t \t\t$headers = '';\n\t \t\twhile (!@feof ($fp))\n\t \t\t{ \n\t\t\t\t\t$headers .= @fgets ($fp, 128); \n\t\t\t\t}\n\t \t}\n\t \t@fclose ($fp);\n\t\n\t \t$arr_headers = explode(\"\\n\", $headers);\n\t \tif (isset ($arr_headers[0])) \n\t\t\t{\n\t \t\tif(strpos ($arr_headers[0], '200') !== false)\n\t \t\t{ \n\t\t\t\t\treturn true; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '404') !== false) || (strpos ($arr_headers[0], '509') !== false) || (strpos ($arr_headers[0], '410') !== false))\n\t \t\t{ \n\t\t\t\t\treturn false; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '301') !== false) || (strpos ($arr_headers[0], '302') !== false))\n\t\t\t\t{\n\t \t\tpreg_match(\"/Location:\\s*(.+)\\r/i\", $headers, $matches);\n\t \t\tif(!isset($matches[1]))\n\t\t\t\t\t{\n\t \t\t\treturn false;\n\t\t\t\t\t}\n\t \t\t$nextloc = $matches[1];\n\t\t\t\t\treturn $this->remote_file_exists($nextloc);\n\t \t\t}\n\t \t}\n\t \t// If we are still here then we got an unexpected header\n\t \treturn false;\n\t }\n\t else\n\t {\n\t \t// Since we aren't allowed to use URL's bomb out\n\t \treturn false;\n\t }\n\t}",
"public function isRemoteTransportException(): bool\n {\n return $this->_isRemote;\n }",
"public function hasRemote(string $remote) : bool\n {\n $process = $this->runProcess(new Process('git remote'));\n\n return str_contains($process->getOutput(), $remote);\n }",
"public function isLocal()\n {\n return $this->server['SERVER_ADDR'] === $this->getClientIP();\n }",
"public function isRelative()\n {\n if($this->_address == $this->_request)\n return true;\n return false;\n }",
"public function remote()\n\t{\n\t\treturn $this->CLI->boolQuery($this->SqueezePlyrID.\" remote ?\");\n\t}",
"private function __isFile()\n\t{\n\t\tif(!$this->exists())\n\t\t{\n\t\t\t$this->error = 'File \\'' . $this->_path . '\\' does not exist';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function is_local($src)\n\t{\n\t\t// prepend scheme to scheme-less URLs, to make parse_url work\n\t\tif (0 === strpos($src, '//')) {\n\t\t\t$src = 'http:' . $src;\n\t\t}\n\n\t\t$url = @parse_url($src);\n\t\t$blog_url = @parse_url(home_url());\n\t\tif (false === $url)\n\t\t\treturn false;\n\n\t\tif (isset($url['scheme']))\n\t\t{\n\t\t\t// this should be an absolute URL\n\t\t\t// @since 1.3.0 consider sub-domain external for now\n\t\t\tif (0 <> strcmp($url['host'], $blog_url['host']))\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\t\telse // Probably a relative link\n\t\t\treturn true;\n\t}"
]
| [
"0.87318176",
"0.7833936",
"0.773356",
"0.7731327",
"0.7335231",
"0.73053795",
"0.7165521",
"0.7163399",
"0.68658733",
"0.6744763",
"0.6735592",
"0.6728468",
"0.66863126",
"0.6668585",
"0.6553969",
"0.65391153",
"0.650277",
"0.649269",
"0.64453685",
"0.64114124",
"0.6399556",
"0.63373935",
"0.6314063",
"0.6303574",
"0.62824786",
"0.62624216",
"0.6256784",
"0.6252717",
"0.61682266",
"0.6143488"
]
| 0.8952474 | 1 |
Display confirmation page for group registration | function _displayGroupConfirmation($tpl) {
$Itemid = JRequest::getInt('Itemid');
$db = & JFactory::getDBO() ;
$eventId = JRequest::getInt('event_id', 0) ;
$groupId = JRequest::getInt('group_id', 0) ;
$config = EventBookingHelper::getConfig() ;
$firstName = JRequest::getVar('first_name', '', 'post') ;
$lastName = JRequest::getVar('last_name', '', 'post') ;
$organization = JRequest::getVar('organization', '', 'post') ;
$address = JRequest::getVar('address', '', 'post') ;
$address2 = JRequest::getVar('address2', '', 'post') ;
$city = JRequest::getVar('city', '', 'post') ;
$state = JRequest::getVar('state', '', 'post') ;
$zip = JRequest::getVar('zip', '', 'post') ;
$phone = JRequest::getVar('phone', '', 'post') ;
$fax = JRequest::getVar('fax', '', 'post') ;
$email = JRequest::getVar('email', '', 'post') ;
$country = JRequest::getVar('country', '') ;
$comment = JRequest::setVar('comment', '') ;
$paymentMethod = JRequest::getVar('payment_method', os_payments::getDefautPaymentMethod()) ;
$x_card_num = JRequest::getVar('x_card_num', '', 'post');
$expMonth = JRequest::getVar('exp_month', date('m'), 'post') ;
$expYear = JRequest::getVar('exp_year', date('Y'), 'post') ;
$x_card_code = JRequest::getVar('x_card_code', '', 'post');
$cardHolderName = JRequest::getVar('card_holder_name', '', 'post') ;
$cardType = JRequest::getVar('card_type', '') ;
$username = JRequest::getVar('username', '', 'post');
$password = JRequest::getVar('password', '', 'post');
$sql = 'SELECT COUNT(*) FROM #__eb_registrants WHERE group_id='.$groupId;
$db->setQuery($sql) ;
$numberRegistrants = $db->loadResult();
$url = EventBookingHelper::getURL();
$sql = 'SELECT * FROM #__eb_registrants WHERE group_id='.$groupId ;
$db->setQuery($sql) ;
$rowMembers = $db->loadObjectList();
//Override the configuration
$sql = 'SELECT * FROM #__eb_events WHERE id='.$eventId ;
$db->setQuery($sql) ;
$event = $db->loadObject();
$params = new JParameter($event->params) ;
$keys = array('s_lastname', 'r_lastname', 's_organization', 'r_organization', 's_address', 'r_address', 's_address2', 'r_address2', 's_city', 'r_city', 's_state', 'r_state', 's_zip', 'r_zip', 's_country', 'r_country', 's_phone', 'r_phone', 's_fax', 'r_fax', 's_comment', 'r_comment');
foreach ($keys as $key) {
$config->$key = $params->get($key, 0) ;
}
$keys = array('gr_lastname', 'gr_lastname', 'gs_organization', 'gr_organization', 'gs_address', 'gr_address', 'gs_address2', 'gr_address2', 'gs_city', 'gr_city', 'gs_state', 'gr_state', 'gs_zip', 'gr_zip', 'gs_country', 'gr_country', 'gs_phone', 'gr_phone', 'gs_fax', 'gr_fax', 'gs_email', 'gr_email', 'gs_comment', 'gr_comment');
foreach ($keys as $key) {
$config->$key = $params->get($key, 0) ;
}
//Custom fields
$jcFields = new JCFields($eventId, true, 1) ;
if ($jcFields->getTotal()) {
$customFields = true ;
$fields = $jcFields->renderConfirmation() ;
$hidden = $jcFields->renderHiddenFields() ;
$this->assignRef('fields', $fields) ;
$this->assignRef('hidden', $hidden) ;
} else {
$customFields = false ;
}
$sql = 'SELECT * FROM #__eb_events WHERE id='.$eventId ;
$db->setQuery($sql) ;
$event = $db->loadObject();
//Store member total amount and discount
$rate = EventBookingHelper::getRegistrationRate($eventId, $numberRegistrants) ;
$feeFields = new JCFields($eventId, false, 2) ;
$extraFee = $feeFields->canculateGroupFee($groupId) + JCFields::calculateFee($eventId, 1) ;
$totalAmount = $rate*$numberRegistrants + $extraFee ;
if ($config->collect_member_information) {
$memberIds = array() ;
$memberDiscounts = array() ;
$memberTotals = array() ;
for ($i = 0 , $n = count($rowMembers) ; $i < $n ; $i++) {
$memberId = $rowMembers[$i]->id ;
$memberIds[] = $memberId ;
$memberTotals[] = $rate + JCFields::getMemberFee($memberId, $eventId);
$memberDiscounts[] = 0 ;
}
}
//Get discount
$discount = 0 ;
$user = & JFactory::getUser() ;
if ($user->get('id')) {
if ($event->discount > 0) {
if ($event->discount_type == 1) {
$discount = $totalAmount*$event->discount/100 ;
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $memberTotals[$i]*$event->discount/100 ;
}
}
} else {
$discount = $numberRegistrants*$event->discount ;
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $event->discount ;
}
}
}
}
}
if (isset($_SESSION['coupon_id'])) {
$sql = 'SELECT * FROM #__eb_coupons WHERE id='.(int)$_SESSION['coupon_id'];
$db->setQuery($sql) ;
$coupon = $db->loadObject();
if ($coupon) {
if ($coupon->coupon_type == 0) {
$discount = $discount + $totalAmount*$coupon->discount/100 ;
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $memberTotals[$i]*$coupon->discount/100 ;
}
}
} else {
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $coupon->discount ;
}
}
$discount = $discount + $numberRegistrants*$coupon->discount ;
}
}
}
//Early bird discount
$sql = 'SELECT COUNT(id) FROM #__eb_events WHERE id='.$eventId.' AND DATEDIFF(early_bird_discount_date, NOW()) >= 0';
$db->setQuery($sql);
$total = $db->loadResult();
if ($total) {
$earlyBirdDiscountAmount = $event->early_bird_discount_amount ;
if ($earlyBirdDiscountAmount > 0) {
if ($event->early_bird_discount_type == 1) {
$discount = $discount + $totalAmount*$event->early_bird_discount_amount/100 ;
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $memberTotals[$i]*$event->early_bird_discount_amount/100 ;
}
}
} else {
$discount = $discount + $numberRegistrants*$event->early_bird_discount_amount ;
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberTotals) ; $i < $n ; $i++) {
$memberDiscounts[$i] += $event->early_bird_discount_amount ;
}
}
}
}
}
if ($discount > $totalAmount)
$discount = $totalAmount ;
$amount = $totalAmount - $discount ;
#Tax, added from 1.4.3
if ($config->enable_tax && ($amount > 0)) {
$taxAmount = round($amount*$config->tax_rate/100, 2) ;
} else {
$taxAmount = 0 ;
}
$method = os_payments::getPaymentMethod($paymentMethod) ;
$couponCode = JRequest::getVar('coupon_code', '');
$bankId = JRequest::getVar('bank_id');
if (($config->enable_captcha == 3) || (($config->enable_captcha == 2) && ($event->individual_price > 0)) || (($config->enable_captcha == 1) && ($event->individual_price == 0))) {
$showCaptcha = 1 ;
} else {
$showCaptcha = 0 ;
}
$captchaInvalid = JRequest::getInt('captcha_invalid', 0);
#Added support for deposit payment
$paymentType = JRequest::getInt('payment_type', 0) ;
if ($config->activate_deposit_feature && $event->deposit_amount > 0 && $paymentType == 1) {
if ($event->deposit_type == 2) {
$depositAmount = $event->deposit_amount ;
} else {
$depositAmount = $event->deposit_amount*($totalAmount-$discount+$taxAmount)/100 ;
}
} else {
$depositAmount = 0 ;
}
//Store member information in group registration first
if ($config->collect_member_information) {
for ($i = 0 , $n = count($memberIds) ; $i < $n ; $i++) {
$memberId = $memberIds[$i] ;
$memberTotal = $memberTotals[$i] ;
$memberDiscount = $memberDiscounts[$i] ;
$memberAmount = $memberTotal - $memberDiscount ;
$sql = "UPDATE #__eb_registrants SET total_amount='$memberTotal', discount_amount='$memberDiscount', amount='$memberAmount', number_registrants=1 WHERE id='$memberId'";
$db->setQuery($sql);
$db->query();
}
}
//Basic member registrations
$this->assignRef('config', $config) ;
$this->assignRef('firstName', $firstName);
$this->assignRef('lastName', $lastName);
$this->assignRef('organization', $organization);
$this->assignRef('address', $address);
$this->assignRef('address2', $address2);
$this->assignRef('city', $city);
$this->assignRef('state', $state);
$this->assignRef('zip', $zip);
$this->assignRef('phone', $phone);
$this->assignRef('fax', $fax);
$this->assignRef('country', $country) ;
$this->assignRef('email', $email);
$this->assignRef('comment', $comment);
$this->assignRef('paymentMethod', $paymentMethod);
$this->assignRef('x_card_num', $x_card_num) ;
$this->assignRef('x_card_code', $x_card_code) ;
$this->assignRef('cardHolderName', $cardHolderName) ;
$this->assignRef('expMonth', $expMonth) ;
$this->assignRef('expYear', $expYear) ;
$this->assignRef('numberRegistrants', $numberRegistrants) ;
$this->assignRef('rowMembers', $rowMembers) ;
$this->assignRef('groupId', $groupId) ;
$this->assignRef('url', $url) ;
$this->assignRef('Itemid', $Itemid) ;
$this->assignRef('customFields', $customFields) ;
$this->assignRef('totalAmount', $totalAmount) ;
$this->assignRef('amount', $amount) ;
$this->assignRef('event', $event) ;
$this->assignRef('extraFee', $extraFee) ;
$this->assignRef('method', $method) ;
$this->assignRef('cardType', $cardType) ;
$this->assignRef('discount', $discount) ;
$this->assignRef('amount', $amount) ;
$this->assignRef('username', $username) ;
$this->assignRef('password', $password) ;
$this->assignRef('couponCode', $couponCode) ;
$this->assignRef('bankId', $bankId) ;
$this->assignRef('showCaptcha', $showCaptcha) ;
$this->assignRef('captchaInvalid', $captchaInvalid) ;
$this->assignRef('paymentType', $paymentType) ;
$this->assignRef('depositAmount', $depositAmount) ;
$this->assignRef('taxAmount', $taxAmount) ;
parent::display($tpl) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _displayFormConfirmGroup($err='')\n\t{\n\t\t$dt = $this->_dt;\n\n\t\t$utpage = new utPage('draws');\n\t\t$content =& $utpage->getPage();\n\t\t$form =& $content->addForm('tDelGroups', 'draws', DRAW_GROUP_DELETE);\n\n\t\t// Initialize the field\n\t\t$group = kform::getData();\n\t\tif (empty($ids)) $ids[] = kform::getData();\n\t\tif ($err =='' && !empty($group))\n\t\t{\n\t\t\t$form->addHide(\"group\", $group);\n\t\t\t$form->addMsg('msgConfirmDelGroup');\n\t\t\t$form->addBtn('btnDelete', KAF_SUBMIT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($err!='') $form->addWng($err);\n\t\t\telse $form->addWng('msgNeedGroups');\n\t\t}\n\t\t$form->addBtn('btnCancel');\n\t\t$elts = array('btnDelete', 'btnCancel');\n\t\t$form->addBlock('blkBtn', $elts);\n\n\t\t//Display the page\n\t\t$utpage->display();\n\t\texit;\n\t}",
"public function confirm()\n {\n // Only super admins can delete member groups\n if (! ee('Permission')->can('delete_roles')) {\n show_error(lang('unauthorized_access'), 403);\n }\n\n $roles = ee()->input->post('selection');\n\n $roleModels = ee('Model')->get('Role', $roles)->all();\n $vars['members_count_primary'] = 0;\n $vars['members_count_secondary'] = 0;\n foreach ($roleModels as $role) {\n $vars['members_count_primary'] += $role->getMembersCount('primary');\n $vars['members_count_secondary'] += $role->getMembersCount('secondary');\n }\n\n $vars['new_roles'] = [];\n if (ee('Permission')->can('delete_members')) {\n $vars['new_roles']['delete'] = lang('member_assignment_none');\n }\n $allowed_roles = ee('Model')->get('Role')\n ->fields('role_id', 'name')\n ->filter('role_id', 'NOT IN', array_merge($roles, [1, 2, 3, 4]))\n ->order('name');\n if (! ee('Permission')->isSuperAdmin()) {\n $allowed_roles->filter('is_locked', 'n');\n }\n $vars['new_roles'] += $allowed_roles->all()\n ->getDictionary('role_id', 'name');\n\n ee()->cp->render('members/delete_member_group_conf', $vars);\n }",
"public function registerFamilyConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $validator = $this->view->validator; /* @var BeMaverick_Validator $validator */\n\n // set the input params\n $requiredParams = array(\n 'emailAddress',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authRegisterParent' );\n }\n\n // get the variables\n $emailAddress = $input->emailAddress;\n\n // perform the checks\n $validator->checkParentEmailAddressAssociatedWithAKid( $site, $emailAddress, $errors );\n\n $errorPopupCode = null;\n if ( $errors->hasErrors() ) {\n $errorPopupCode = 'EMAIL_NOT_ASSOCIATED';\n }\n\n if ( $errorPopupCode && $this->view->ajax ) {\n $input->errorCode = $errorPopupCode;\n return $this->renderPage( 'authError' );\n } else if ( $errorPopupCode ) {\n $this->view->popupUrl = $site->getUrl( 'authError', array( 'errorCode' => $errorPopupCode ) );\n return $this->renderPage( 'authRegisterParent' );\n }\n\n // parent is registering, so send them to verify the first kid. they had to have at least\n // one kid to get to this point\n $kids = $site->getKidsByParentEmailAddress( $emailAddress );\n\n if( $kids[0] && !($kids[0]->getVPCStatus()) ) {\n $redirectUrl = BeMaverick_Util::getParentVerifyMaverickUrl( $site, $kids[0] );\n if ( $this->view->ajax ) {\n $this->view->redirectUrl = $redirectUrl;\n return $this->renderPage( 'redirect' );\n }\n\n return $this->_redirect( $redirectUrl );\n } else {\n //if one of the kid is verified, send the parent to set their email.\n $parent = $site->getUserByEmailAddress( $emailAddress );\n BeMaverick_Cookie::updateUserCookie( $parent );\n $successPage = 'authParentVerifyMaverickStep3';\n if ( $this->view->ajax && $this->view->ajax != 'dynamicModule' ) {\n $successPage = $this->view->ajax.'Ajax';\n }\n return $this->renderPage( $successPage );\n }\n }",
"public function showRegistrationForm()\n {\n $groups = Group::all();\n return view('auth.register', compact('groups'));\n }",
"public function RegistrationUnderApproval() {\n $this->Render();\n }",
"public static function confirmation_center () \n { \n $html = null;\n\n load::view( 'admin/confirmation/center' );\n $html .= confirmation_center::form();\n\n return $html;\n }",
"public function getConfirmRegisterTopic()\n {\n return view('teacher.confirmregister', ['topics' => $this->topic->getTopicStudent()]);\n }",
"public function actionRegdone()\n\t{\n\t\t$this->render('regdone');\n\t}",
"public function add_group_page()\n {\n\n $this->authorize('create', Group::class);\n\n return view('pages.add_group');\n }",
"public function actionCustomiseconfirm()\n\t{\n\t\tif(isset($_SESSION) && isset($_SESSION['userRegisterVal']) && $_SESSION['userRegisterVal']['email'] != '')\n\t\t{\n\t\t\t$this->layout =\"homeinner\";\n\t\t\t$modelUser=new Users;\n\t\t\t$modelGifts=new Gift;\n\n\t\t\t//simply redirecting to Confirm page...\n\t\t\t$this->render('customizejerseyconfirm',array(\n\t\t\t\t'modelUser'=>$modelUser,\n\t\t\t));\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Redirect to home page\n\t\t\t$this->redirect('../index.php', '');\n\t\t}\n\t}",
"public function registerFamilyAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authRegisterParent' );\n }",
"public function actionConfirm()\n\t{\n\t\tif(isset($_SESSION) && isset($_SESSION['userRegisterVal']) && $_SESSION['userRegisterVal']['email'] != '')\n\t\t{\n\t\t\t $this->layout =\"homeinner\";\n\t\t\t $modelUser=new Users;\n\t\t\t \n\t\t\t //for getting lastly saved value of Gift model\n\t\t\t $userGiftId = $_SESSION['giftId'];\n\t\t\t \n\t\t\t if(isset($userGiftId) && $userGiftId != '')\n\t\t\t {\n\t\t\t\t \n\t\t\t\t Yii::app()->user->setFlash('successmessage','You have been registered properly.. Please check your mailbox');\n\t\t\t }\n\t\t\t else \n\t\t\t {\n\t\t\t\t \n\t\t\t\t Yii::app()->user->setFlash('failuremessage','Please fill the form properly again');\n\t\t\t }\n\t\t\t //for getting lastly saved value of Gift model by current user\n\t\t $giftLastValue=Gift::model()->findByAttributes(array('id'=>$userGiftId));\n\t\t\t //for getting lastly saved value of Gift model by current user\n\t\t\t\n\t\t\t //destroying session here..\n\t session_destroy(); \n\t \n\t //create new session to keep current gift id for fbshare\n\t session_start();\n\t $_SESSION['giftId'] = $userGiftId;\n\t\n\t //render page to view page....\n\t\t\t $this->render('finalconfirmed',array(\n\t\t\t\t 'modelUser'=>$modelUser,\n\t\t\t\t 'maxIdGift'=>$userGiftId,\n\t\t\t\t 'giftLastValue'=>$giftLastValue,\n\t\t\t ));\n\t\t}\n\t\telse\n\t\t{\n\t\t \t//Redirect to home page\n\t\t\t$this->redirect('../index.php', '');\n\t\t}\n\t}",
"function delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }",
"public function groups() {\n\t\t//variabel\n\t\t$data['datas'] = $this->PbkGroups_model->get_all();\n\t\t\n\t\t$template_data['title'] = 'SMS Gateway ';\n\t\t$template_data['subtitle'] = 'Kirim SMS';\n $template_data['crumb'] = ['SMS Gateway' => 'smsgateway', 'SMS Groups' => 'smsgateway/kirimsms/groups',];\n\t\t//view\n\t\t$this->layout->set_wrapper('groups_form', $data);\n\t\t$this->layout->auth();\n\t\t$this->layout->render('admin', $template_data);\n\t}",
"public function showForm()\n {\n return view('admin.groups.create');\n }",
"public function verifyAction()\n\t{\n\t\t$this->view->headTitle(\"Registration Process\");\n\t\t\n\t\t//Retrieve key from url\n\t\t$registrationKey = $this->getRequest()->getParam('key');\n\t\t\n\t\t//Identitfy the user associated with the key\n\t\t$user = new Default_Model_User();\n\t\t\n\t\t//Determine is user already confirm\n\t\tif($user->isUserConfirmed($registrationKey)){\n\t\t$this->view->isConfirmed = 1;\n\t\t$this->view->errors[] = \"User is already confirmed\";\n\t\treturn;\n\t\t}\n\n\t\t$resultRow = $user->getUserByRegkey($registrationKey);\n\t\t\n\t\t//If the user has been located, set the confirmed column.\n\t\tif(count($resultRow)){\n\t\t\t$resultRow->confirmed = 1;\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t\t$this->view->success = 1;\n\t\t\t$this->view->firstName = $resultRow->first_name;\n\t\t\n\t\t} else{\n\t\t\t$this->view->errors[] = \"Unable to locate registration key\";\n\t\t}\n\n\t}",
"public function confirmed()\n {\n if(!Auth::check()){\n return redirect()->route('auth.registration');\n }\n\n return view('confirm');\n }",
"function success()\n {\n $message = null;\n $message = \"Một email đã được gửi tới hòm thư của bạn. <br />\";\n $message .= \"Vui lòng kiểm tra hộp thư đến và kích hoạt tài khoản.\";\n $this->view->load('frontend/user/register_success', [\n 'message' => $message\n ]);\n }",
"public static function groups_page()\n\t{\n\n\t\t//If the form was submitted\n\t\tif ( $_POST ){\n\n\t\t\t//Do a bit of validation\n\t\t\tif ( ! $_POST['mz_group_name'] ){\n\t\t\t\t$error = 'You must fill in the form';\n\t\t\t\tmz_Groups::newGroupForm( $error );\n\t\t\t} else {\n\t\t\t\t//Make the update\n\t\t\t\t$mz_group_name = esc_sql( stripslashes( $_POST['mz_group_name'] ) );\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$ins = $wpdb->query('INSERT INTO ' . $wpdb->prefix . GROUPS_DB_TABLE . ' ( groupname , groupactive ) VALUES (\"' . $mz_group_name . '\" , \"0\") ');\n\t\t\t}\n\n\t\t}\n\n\n\t\techo '<div class=\"wrap\">';\n\t\techo '<h2>Mentorz - Group Administration</h2>';\n\n\t\t//Generate the form\n\t\tmz_Groups::newGroupForm();\n\n\t\tglobal $wpdb;\n\t\t$results = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . GROUPS_DB_TABLE , ARRAY_A);\n\n\t\tif(count($results)){\n\t\t\t\n\t\t\techo '<p> </p>';\n\t\t\techo '<table cellspacing=\"0\" class=\"widefat\">';\n\t\t\techo '<thead>';\n\t\t\t\techo '<tr>';\n\t\t\t\t\techo '<th class=\"column-title\"><span>Group Name</span></th>';\n\t\t\t\t\t//echo '<th class=\"column-title\">Group Active</th>';\n\t\t\t\t\techo '<th class=\"column-title\">Edit</th>';\n\t\t\t\t\techo '<th class=\"column-title\">Delete</th>';\n echo '<th class=\"column-title\">Info</th>';\n\n echo '</tr>';\n\t\t\techo '</thead>';\n\n\t\t\tforeach ($results as $key => $value) {\n\n\t\t\t\t//Clean up the status\n\t\t\t\t$status = $value['groupactive'];\n\t\t\t\tif ( $status == 0 ){\n\t\t\t\t\t$status = \"Inactive\";\n\t\t\t\t} elseif ( $status == 1 ){\n\t\t\t\t\t$status = \"Active\";\n\t\t\t\t}\n\n\t\t\t\techo '<tbody>';\n\t\t\t\t\techo '<tr>';\n\t\t\t\t\t\techo '<td>' . $value['groupname'] . '</td>';\n\t\t\t\t\t\t//echo '<td>' . $status . '</td>';\n\t\t\t\t\t\techo '<td style=\"width: 30px;\">';\n\t\t\t\t\t\t\techo '<a href=\"' . str_replace( '%7E', '~', $_SERVER['REQUEST_URI']) . '&edit='.$value['groupid'].'\" class=\"\">EDIT</a>';\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\techo '<td style=\"width: 30px;\">';\n\t\t\t\t\t\t\techo '<a href=\"' . str_replace( '%7E', '~', $_SERVER['REQUEST_URI']) . '&del='.$value['groupid'].'\" class=\"\">DELETE</a>';\n\t\t\t\t\t\techo '</td>';\n echo '<td style=\"width: 30px;\">';\n echo '<a href=\"#\" class=\"mz_accordion_button\" rel=\"mz_accord_'.$value['groupid'].'\">INFO</a>';\n echo '</td>';\n\t\t\t\t\techo '</tr>';\n\n echo '<tr class=\"mz_accord mz_accord_'.$value['groupid'].'_inner\">';\n echo '<td style=\"width: 30px;\" colspan=\"99\">';\n echo '<div>';\n\n $mentor = mz_Func::get_group_mentor( $value['groupid'] );\n\n if ( $mentor ){\n echo '<h4>The group mentor is ' . mz_Func::get_group_mentor( $value['groupid'] ) . '</h4>';\n } else {\n echo '<h4>The group does not have a mentor</h4>';\n }\n\n $students = mz_func::get_all_students_in_group( $value['groupid'] );\n\n if ( $students ){\n\n echo '<h4>The groups beneficiaries are</h4>';\n echo '<ul>';\n\n foreach ( $students as $student ) {\n\n echo '<li>'.mz_Func::get_users_display_name( $student['userid'] ).'</li>';\n\n }\n\n echo '</ul>';\n\n } else {\n\n echo '<h4>The group does not have any beneficiaries</h4>';\n\n }\n\n\n\n echo '</div>';\n echo '</td>';\n echo '</tr>';\n\n\t\t\t\techo '</tbody>';\n\n\n\t\t\t}//fe\n\n\t\t} else {\n\n\t\t\techo '<h3>There are no groups yet</h3>';\n\t\t\t\n\t\t}\n\n\t\techo '</div>';\n\n\t}",
"public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }",
"public function familyVerifyMaverickConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors; /* @var Sly_Errors $errors */\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $loginUser = $this->view->loginUser; /* @var BeMaverick_User $loginUser */\n\n // set the input params\n $requiredParams = array(\n 'password',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $loginUser->setPassword( $input->getUnescaped( 'password' ) );\n\n $emailAddress = $loginUser->getEmailAddress();\n $kids = $site->getKidsByParentEmailAddress( $emailAddress );\n $systemConfig = $site->getSystemConfig();\n\n if ( $kids[0] ) {\n // send the email\n $vars = array(\n 'EMAIL_ADDRESS' => $emailAddress,\n 'USERNAME' => $kids[0]->getUsername(),\n 'APP_URL' => $systemConfig->getSetting( 'APP_DEEPLINK' ),\n );\n BeMaverick_Email::sendTemplate( $site, 'parent-new-user', array( $emailAddress ), $vars );\n\n }\n\n\n $successPage = 'authParentVerifyMaverickConfirm';\n if ( $this->view->ajax && $this->view->ajax != 'dynamicModule' ) {\n $successPage = $this->view->ajax.'Ajax';\n }\n\n return $this->renderPage( $successPage );\n }",
"public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }",
"public function onRegistrationConfirm(GetResponseUserEvent $event)\n {\n $this->_session->getFlashBag()->add(\n 'success',\n 'Votre compte a bien été activé. Vous pouvez désormais\n créer un compte pour votre structure eSport ou votre marque.'\n );\n $url = $this->_router->generate('inscription_index');\n $event->setResponse(new RedirectResponse($url));\n }",
"public function admin_user_group()\n\t{\n\t\t$crud = $this->generate_crud('admin_groups');\n\t\t$this->mTitle.= 'Admin User Groups';\n\t\t$this->render_crud();\n\t}",
"public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }",
"function deleteGroupById($group_id){\n\n Group::DeleteGroupById($group_id);\n\n echo \"<script>window.location.href=\\\"../Views/group.php\\\"</script>\";\n\n}",
"public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}",
"public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }",
"function confirm_page(){\n $this->load->view('include/header.inc');\n $this->load->view('pages/register_complete.php' );\n $this->load->view('include/footer.inc');\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 }"
]
| [
"0.6968954",
"0.6951138",
"0.6525918",
"0.6508716",
"0.641738",
"0.6292342",
"0.62908393",
"0.62744606",
"0.6181828",
"0.6164168",
"0.6156973",
"0.61371714",
"0.61126643",
"0.60993075",
"0.606455",
"0.6057234",
"0.600011",
"0.5994623",
"0.598585",
"0.59798807",
"0.5962121",
"0.5958215",
"0.59528196",
"0.5946414",
"0.59418714",
"0.5941659",
"0.5931368",
"0.5930651",
"0.5917015",
"0.59121525"
]
| 0.70351744 | 0 |
Fetches rotators and returns a paginator array | public function fetchRotators($params = NULL)
{
$select = $this->registry->db->select();
$select->from(array('r' => 'rotators'));
$select->order('r.rot_name ASC');
if(isset($params['page']) && is_numeric($params['page'])) :
$pagenum = $params['page'];
else :
$pagenum = 1;
endif;
if(isset($params['items']) && is_numeric($params['items'])) :
$items = $params['items'];
else :
$items = 15;
endif;
if(isset($params['range']) && is_numeric($params['range'])) :
$range = $params['range'];
else :
$range = 5;
endif;
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($pagenum);
$paginator->setItemCountPerPage($items);
$paginator->setPageRange($range);
return $paginator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get()\n {\n $total_pages = ceil($this->total / $this->per_page);\n $begin = $this->page - $this->side_pages_n;\n $end = $this->page + $this->side_pages_n;\n $pagination = [];\n\n if ($begin <= 0) {\n $begin = 1;\n }\n\n for ($i = $begin; $i <= $end && $i <= $total_pages; $i++) {\n $pagination[] = $this->getNewPage($i);\n }\n\n if ($this->show_ends) {\n $this->addEnds($pagination);\n }\n\n return $pagination;\n }",
"public function getPaginated();",
"public function getToPaginator();",
"public function fetchSlides($params = NULL)\n\t{\n \t$select = $this->registry->db->select();\n \t$select->from(array('s' => 'rotators_slides'));\n \t\n \tif(isset($params['rotator'])) :\n \t $select->where('s.rots_rotator = ?', $params['rotator']);\n \tendif;\n \t\n \t$select->order('s.rots_title ASC');\n \t\n \tif(isset($params['page']) && is_numeric($params['page'])) :\n \t\t$pagenum = $params['page'];\n \telse :\n \t\t$pagenum = 1;\n \tendif;\n \t\n \tif(isset($params['items']) && is_numeric($params['items'])) :\n \t\t$items = $params['items'];\n \telse :\n \t\t$items = 15;\n \tendif;\n \t\n \tif(isset($params['range']) && is_numeric($params['range'])) :\n \t\t$range = $params['range'];\n \telse :\n \t\t$range = 5;\n \tendif;\n \t\n \t$paginator = Zend_Paginator::factory($select);\n\t\t$paginator->setCurrentPageNumber($pagenum);\n\t\t$paginator->setItemCountPerPage($items);\n\t\t$paginator->setPageRange($range);\n\t \n \treturn $paginator;\n\t}",
"public function get(): array\n\t{\n\t\t$roundedNumber = $this->count();\n\t\t$page = 1;\n\t\t\n\t\t$arrayPage = array();\n\t\t\n\t\tfor ($i = 0; $i < $roundedNumber; $i++) {\n\t\t\t$arrayPage[] = $page;\n\t\t\t$page++;\n\t\t}\n\t\treturn $arrayPage;\n\t}",
"public function getPages();",
"function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}",
"public function test_cached_paginators_can_be_retrieved(): void\n {\n $page = 1;\n $perPage = 15;\n\n $expected = new Paginator(new Collection([\n new User(['id' => 1, 'name' => 'Robbie']),\n new User(['id' => 2, 'name' => 'Michael']),\n ]), $perPage, $page);\n\n $key = \"paginator:users:$perPage:$page\";\n\n $this->adapter->withName(User::class)\n ->onPage($page)\n ->showing($perPage)\n ->remember(10, function () use ($expected): Paginator {\n return $expected;\n });\n\n $this->assertTrue($this->adapter->has($this->hash($key)));\n\n $actual = $this->adapter->get($this->hash($key));\n $this->assertInstanceOf(Paginator::class, $actual);\n $this->assertEquals(2, $actual->count());\n }",
"public static function obtenerPaginate()\n {\n $rs = self::builder();\n return $rs->paginate(self::$paginate) ?? [];\n }",
"public function getItems()\n {\n $arrLinks = array();\n\n $intNumberOfLinks = floor($this->intNumberOfLinks / 2);\n $intFirstOffset = ($this->intPage - $intNumberOfLinks - 1);\n\n if ($intFirstOffset > 0) {\n $intFirstOffset = 0;\n }\n\n $intLastOffset = ($this->intPage + $intNumberOfLinks - $this->intTotalPages);\n\n if ($intLastOffset < 0) {\n $intLastOffset = 0;\n }\n\n $intFirstLink = ($this->intPage - $intNumberOfLinks - $intLastOffset);\n\n if ($intFirstLink < 1) {\n $intFirstLink = 1;\n }\n\n $intLastLink = ($this->intPage + $intNumberOfLinks - $intFirstOffset);\n\n if ($intLastLink > $this->intTotalPages) {\n $intLastLink = $this->intTotalPages;\n }\n\n for ($i = $intFirstLink; $i <= $intLastLink; $i++) {\n $arrLinks[] = (object) array(\n 'page' => $i,\n 'current' => $i == $this->intPage,\n 'href' => $this->getItemLink($i)\n );\n }\n\n return $arrLinks;\n }",
"public function getPages() {}",
"public function get_pagination() {\n\t\treturn $this->pagination();\n\t}",
"public function getPaginator()\n {\n return $this->wallpaperMapper->getPaginator();\n }",
"public function getApartados(){\n\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraApartados\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM apartados \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM apartados LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}",
"public function getPaginate(){ }",
"public function getRolePagination()\n {\n try{\n $roles=\\Config::get('app.pagi');\n return Role::paginate($roles);\n //return $this->roles->paginate($roles);\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public function getPagesLinks()\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t// Yjsg instance\r\n\t\t$yjsg = Yjsg::getInstance(); \r\n\t\t\r\n\t\t// Build the page navigation list.\r\n\t\t$data = $this->_buildDataObject();\r\n\r\n\t\t$list = array();\r\n\t\t$list['prefix'] = $this->prefix;\r\n\r\n\t\t$itemOverride = false;\r\n\t\t$listOverride = false;\r\n\r\n\t\t$chromePath \t= JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';\r\n\t\t//yjsg start\r\n\t\tif (!file_exists($chromePath)){\r\n\t\t\tif($yjsg->preplugin()){\r\n\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//yjsg end\r\n\t\tif (file_exists($chromePath))\r\n\t\t{\r\n\t\t\tinclude_once $chromePath;\r\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive'))\r\n\t\t\t{\r\n\t\t\t\t$itemOverride = true;\r\n\t\t\t}\r\n\t\t\tif (function_exists('pagination_list_render'))\r\n\t\t\t{\r\n\t\t\t\t$listOverride = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Build the select list\r\n\t\tif ($data->all->base !== null)\r\n\t\t{\r\n\t\t\t$list['all']['active'] = true;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['all']['active'] = false;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\r\n\t\t}\r\n\r\n\t\tif ($data->start->base !== null)\r\n\t\t{\r\n\t\t\t$list['start']['active'] = true;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['start']['active'] = false;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\r\n\t\t}\r\n\t\tif ($data->previous->base !== null)\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = true;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = false;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\r\n\t\t}\r\n\r\n\t\t$list['pages'] = array(); //make sure it exists\r\n\t\tforeach ($data->pages as $i => $page)\r\n\t\t{\r\n\t\t\tif ($page->base !== null)\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = true;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = false;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data->next->base !== null)\r\n\t\t{\r\n\t\t\t$list['next']['active'] = true;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['next']['active'] = false;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\r\n\t\t}\r\n\r\n\t\tif ($data->end->base !== null)\r\n\t\t{\r\n\t\t\t$list['end']['active'] = true;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['end']['active'] = false;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\r\n\t\t}\r\n\r\n\t\tif ($this->total > $this->limit)\r\n\t\t{\r\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}",
"public function getIterator()\n {\n return new ArrayIterator($this->pages);\n }",
"public function paginate()\n {\n return $this->operator->paginate($this->page, $this->limit);\n }",
"public function index()\n {\n return $this->paginator($this->collator());\n }",
"public function getPaginator()\r\n {\r\n return $this->photoMapper->getPaginator();\r\n }",
"public function getPaginatorAdapter(array $params)\n {\n }",
"public function get(): array\n {\n return array_filter($this->resources, function ($resourceNumber) {\n return $resourceNumber >= $this->offset && $resourceNumber < ($this->offset + $this->limit);\n }, ARRAY_FILTER_USE_KEY);\n }",
"public function getCurrentPageResults(): array;",
"public function paginator()\n {\n return new Tools\\Paginator($this);\n }",
"function getPagosanteriores() {\n $where = \" WHERE 1\";\n $array = \"\";\n\n $columns = \"`Clave_catalogo`, `Nombre`, `Email`, `Cantidad`, `Fecha_pagada`, `Id_pago` \";\n $response = $this->db->select3($columns, 'catalogo_pagos', $where, $array);\n return $response;\n }",
"protected function buildPagination() {}",
"protected function buildPagination() {}",
"public function getPaginationDataSource();",
"private function getPaginator()\n {\n return $this->_paginator;\n }"
]
| [
"0.62979025",
"0.6165122",
"0.6155151",
"0.61040735",
"0.5817724",
"0.5728571",
"0.57275563",
"0.5717619",
"0.57031745",
"0.56964433",
"0.5673149",
"0.5596236",
"0.5568827",
"0.55192745",
"0.5514366",
"0.5473531",
"0.5468489",
"0.5458858",
"0.5447404",
"0.54116285",
"0.5402557",
"0.53883886",
"0.53765976",
"0.53720754",
"0.53703004",
"0.5352323",
"0.5348304",
"0.5348304",
"0.5337226",
"0.53356063"
]
| 0.75844246 | 0 |
Fetches slides and returns a paginator array | public function fetchSlides($params = NULL)
{
$select = $this->registry->db->select();
$select->from(array('s' => 'rotators_slides'));
if(isset($params['rotator'])) :
$select->where('s.rots_rotator = ?', $params['rotator']);
endif;
$select->order('s.rots_title ASC');
if(isset($params['page']) && is_numeric($params['page'])) :
$pagenum = $params['page'];
else :
$pagenum = 1;
endif;
if(isset($params['items']) && is_numeric($params['items'])) :
$items = $params['items'];
else :
$items = 15;
endif;
if(isset($params['range']) && is_numeric($params['range'])) :
$range = $params['range'];
else :
$range = 5;
endif;
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($pagenum);
$paginator->setItemCountPerPage($items);
$paginator->setPageRange($range);
return $paginator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSlides()\n {\n return Slide::all();\n }",
"public function index()\n {\n $user = Auth::user();\n\n return $user->slides()->get();\n }",
"public function getAllSlides(){\n\t\ttry{\n\t\t\tif($this->_apc && apc_exists($this->apc_slide_list_total)){\n\t\t\t\t$slides = apc_fetch($this->apc_slide_list_total);\n\t\t\t}else{\t\t\n\t\t\t\t$sql = \"SELECT * FROM slide\";\n\t\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t\t$stmt->execute();\n\t\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir la liste des slides actifs.\");\n\t\t\t\t}\n\t\t\t\t$slides = array();\n\t\t\t\twhile ($data = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t\t$slides[] = new Slide($data);\n\t\t\t\t}\n\t\t\t\tif($this->_apc){\n\t\t\t\t\tapc_store($this->apc_slide_list_total, $slides, 86000);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $slides;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir la liste des slides actifs.\");\n\t\t}\n\t}",
"private function fill_slider(){\n\t\tglobal $DB;\n\t\t$slides= \"SELECT * FROM {theme_archaius} ORDER BY position ASC\";\n\t $slides= $DB->get_records_sql($slides);\n\t return $slides;\n\t}",
"public function getPages();",
"public function get()\n {\n $total_pages = ceil($this->total / $this->per_page);\n $begin = $this->page - $this->side_pages_n;\n $end = $this->page + $this->side_pages_n;\n $pagination = [];\n\n if ($begin <= 0) {\n $begin = 1;\n }\n\n for ($i = $begin; $i <= $end && $i <= $total_pages; $i++) {\n $pagination[] = $this->getNewPage($i);\n }\n\n if ($this->show_ends) {\n $this->addEnds($pagination);\n }\n\n return $pagination;\n }",
"public function getPages() {}",
"public function getPaginated();",
"protected function buildSlides() {\n $this->sortSlidesByWeight();\n\n $slides = [];\n foreach ($this->configuration['slides'] as $slide) {\n if ($slide['mid'] !== NULL) {\n $slides[] = [\n 'image' => $this->fileUrlFromMediaId($slide['mid']),\n 'caption' => $slide['caption'],\n ];\n }\n }\n return $slides;\n }",
"public function index()\n\t{\n\t\t$slides = Slide::paginate(10);\n\t\treturn $this->respondOK($slides);\n\t}",
"public function getNewestSlides()\n {\n $returnValue = array();\n\n // section -64--88-0-2--2405a564:15f260ff61f:-8000:0000000000000B96 begin\n $this->Database = new Database();\n $sql = $this->Database->prepare(\"SELECT * FROM hopetrac_main.inspiration_quotes ORDER BY id DESC LIMIT 0,10\");\n $sql->setFetchMode(PDO::FETCH_ASSOC);\n $sql->execute();\n\n $returnValue = $sql->fetchAll();\n // section -64--88-0-2--2405a564:15f260ff61f:-8000:0000000000000B96 end\n\n return (array) $returnValue;\n }",
"function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}",
"protected function load()\r\n {\r\n $this->ensureSorter();\r\n $posts = iterator_to_array($this->iterator);\r\n\r\n // Find the previous and next posts, if the parent page is in there.\r\n if ($this->page != null)\r\n {\r\n $pageIndex = -1;\r\n foreach ($posts as $i => $post)\r\n {\r\n if ($post === $this->page)\r\n {\r\n $pageIndex = $i;\r\n break;\r\n }\r\n }\r\n if ($pageIndex >= 0)\r\n {\r\n // Get the previous and next posts.\r\n $prevAndNextPost = array(null, null);\r\n if ($pageIndex > 0)\r\n $prevAndNextPost[0] = $posts[$pageIndex - 1];\r\n if ($pageIndex < count($posts) - 1)\r\n $prevAndNextPost[1] = $posts[$pageIndex + 1];\r\n\r\n // Get their template data.\r\n $prevAndNextPostData = $this->getPostsData($prevAndNextPost);\r\n\r\n // Posts are sorted by reverse time, so watch out for what's\r\n // \"previous\" and what's \"next\"!\r\n $this->previousPost = $prevAndNextPostData[1];\r\n $this->nextPost = $prevAndNextPostData[0];\r\n }\r\n }\r\n \r\n // Get the posts data, and use that as the items we'll return.\r\n $items = $this->getPostsData($posts);\r\n\r\n // See whether there's more than what we got.\r\n $this->hasMorePosts = false;\r\n $currentIterator = $this->iterator;\r\n while ($currentIterator != null)\r\n {\r\n if ($currentIterator instanceof SliceIterator)\r\n {\r\n $this->hasMorePosts |= $currentIterator->hadMoreItems();\r\n if ($this->hasMorePosts)\r\n break;\r\n }\r\n $currentIterator = $currentIterator->getInnerIterator();\r\n }\r\n\r\n return $items;\r\n }",
"public function getActiveSlides(){\n\t\ttry{\n\t\t\tif($this->_apc && apc_exists($this->apc_slide_list_active)){\n\t\t\t\t$slides = apc_fetch($this->apc_slide_list_active);\n\t\t\t}else{\t\t\n\t\t\t\t$sql = \"SELECT * FROM slide WHERE isactive = '1'\";\n\t\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t\t$stmt->execute();\n\t\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir la liste des slides actifs.\");\n\t\t\t\t}\n\t\t\t\t$slides = array();\n\t\t\t\twhile ($data = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t\t$slides[] = new Slide($data);\n\t\t\t\t}\n\t\t\t\tif($this->_apc){\n\t\t\t\t\tapc_store($this->apc_slide_list_active, $slides, 86000);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $slides;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir la liste des slides actifs.\");\n\t\t}\n\t}",
"public function getSliderList()\n { \n $sliders = PageSlider::where('status', PageSlider::ACTIVE)->get();\n return $sliders;\n }",
"public function getImages()\n {\n $res=array();\n $this->objTable = new Model($this->getLangAndID['lang'].'_slide_image');\n $select = array('id','title','description','slide_id','src_link','order_by','avatar');\n $this->objTable->where('slide_id',$this->id);\n $this->objTable->where('idw',$this->idw);\n $data = $this->objTable->get(null,null,$select);\n \n return $data; \n }",
"public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }",
"protected function loadPage()\n\t{\n\t\t$this->_dataProvider->getPagination()->setCurrentPage($this->_currentPage);\n\t\treturn $this->_items = $this->dataProvider->getData(true);\n\t}",
"function get_featured_slider() {\n $sql = \"SELECT * FROM slider WHERE publish='1'\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }",
"public function articlesPaginated(){\n return Article::paginate(10);\n }",
"function get_slider() {\n $sql = \"SELECT * FROM slider\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }",
"public function index()\n {\n $slides = $this->Slides->find('all')\n ->order(['Slides.sorting' => 'ASC'])\n ;\n $this->set(['enable_fancy_box' => true]);\n $this->set('slides', $this->paginate($slides));\n $this->set('_serialize', ['slides']);\n }",
"public function getPage();",
"function get_all_slide()\r\n {\r\n \r\n \r\n $slide = $this->db->query(\"\r\n SELECT\r\n *\r\n\r\n FROM\r\n slide \r\n\r\n ORDER BY `slide_id` DESC\r\n\r\n \")->result_array();\r\n\r\n return $slide;\r\n }",
"function sb_slideshow_slides( $sql ) {\n\tglobal $wpdb, $post, $sb_slideshow_interface, $sb_slideshow_slides;\n\n\t$slides = get_post_meta( ( ! isset( $post->ID ) ? absint( $_POST['id'] ) : $post->ID ), 'slide', false ); // set single (third parameter) to false to pull ALL records with key \"slide\"\n\n\t$attachments = $wpdb->get_results( $sql );\n\n\t// push all image attachments info into array\n\t$indexes = array();\n\tforeach( $attachments as $attachment ) {\n\t\tarray_push( $indexes, count( $sb_slideshow_slides ) );\n\n\t\t$box = 'library';\n\t\t$order = '';\n\t\tforeach( $slides as $slide ) {\n\t\t\tif( $slide['attachment_id'] == $attachment->ID ) {\n\t\t\t\t$box = 'slides';\n\t\t\t\t$order = $slide['order'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$metadata = wp_get_attachment_metadata( $attachment->ID );\n\n\t\tarray_push( $sb_slideshow_slides, array(\n\t\t\t'box' \t\t\t=> $box,\n\t\t\t'order'\t\t\t=> $order,\n\t\t\t'attachment'\t\t=> array(\n\t\t\t\t'id' \t\t=> $attachment->ID,\n\t\t\t\t'year' \t\t=> mysql2date( 'Y', $attachment->post_date ),\n\t\t\t\t'month' \t=> mysql2date( 'm', $attachment->post_date ),\n\t\t\t\t'width'\t\t=> $metadata['width'],\n\t\t\t\t'height' \t=> $metadata['height'],\n\t\t\t\t'type' \t\t=> $attachment->post_mime_type,\n\t\t\t\t'link'\t\t=> $attachment->post_excerpt,\n\t\t\t\t'content'\t=> $attachment->post_content ),\n\t\t\t\t'image' \t=> '<img src=\"' . sb_get_post_image_url( array( 'width' => $sb_slideshow_interface['slide_width'], 'height' => $sb_slideshow_interface['slide_height'], 'image_id' \t=> $attachment->ID, 'echo' \t=> false ) ) . '\" width=\"' . $sb_slideshow_interface['slide_width'] . '\" height=\"' . $sb_slideshow_interface['slide_height'] . '\" />'\n\t\t\t)\n\t\t);\n\t}\n\n\tusort( $sb_slideshow_slides, 'sb_slideshow_slide_sort' ); // order the elements of the array\n\n\treturn $indexes;\n}",
"public function get_slides_for_slider() {\n return $this->slides_to_include;\n }",
"private function loadPages()\n {\n $webClient = new WebClient();\n $allPages = [];\n $choppedUrls = array_chunk($this->newUrls, self::PAGES_PER_TIME);\n foreach ($choppedUrls as $iteration => $urlsChunk) {\n $currentPages = $webClient->multiGet($this->newUrls);\n $allPages = array_merge($allPages, $currentPages);\n\n $urlsChunkCount = count($urlsChunk);\n $pagesLoaded = $urlsChunkCount < self::PAGES_PER_TIME ?\n $urlsChunkCount\n : ($iteration + 1) * self::PAGES_PER_TIME;\n $this->outputMessage(sprintf('... loaded %s pages', $pagesLoaded));\n }\n\n return $allPages;\n }",
"function get_all_gallery(){\n global $conn, $start_pos, $items_per_page ;\n\n pagination();\n $sql = \"SELECT * FROM gallery LIMIT $start_pos, $items_per_page\";\n\n $result = mysqli_query($conn, $sql);\n\n $galleries = [];\n // $galleries = array();\n\n if(mysqli_num_rows($result)> 0){\n\n while($row = mysqli_fetch_assoc($result)){\n array_push($galleries, $row);\n }\n return $galleries;\n } else {\n return false;\n }\n}",
"private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}",
"public function getToPaginator();"
]
| [
"0.6874107",
"0.6742782",
"0.6700479",
"0.64704734",
"0.6461192",
"0.64561254",
"0.6413705",
"0.6401697",
"0.6321626",
"0.6203791",
"0.618617",
"0.6172811",
"0.6135084",
"0.6093218",
"0.60679615",
"0.6015203",
"0.6014194",
"0.5975106",
"0.59717023",
"0.597073",
"0.5970278",
"0.59581405",
"0.59570515",
"0.5950912",
"0.5945522",
"0.59154147",
"0.58921367",
"0.58914626",
"0.5871017",
"0.5869185"
]
| 0.7377342 | 0 |
Constructor method for BSGHistoryType | public function __construct(\Sabre\UpdateReservation\StructType\BSGRefHistoryType $bSGReference = null, \Sabre\UpdateReservation\StructType\BSGCounterHistoryType $bSGCounter = null)
{
$this
->setBSGReference($bSGReference)
->setBSGCounter($bSGCounter);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct(LogHistory $log)\n {\n parent::__construct();\n $this->log = $log;\n }",
"public function __construct($history_id)\n {\n $this->history_id = $history_id;\n }",
"public function __construct(array $attributes = [])\n {\n \t$this->setTable(config('status.history_table'));\n\n \tparent::__construct($attributes);\n }",
"public function __construct($symbol = '', $stat = 'all', $history = false)\n {\n if ($symbol)\n $this->_setParam('symbol', $symbol);\n $this->_setParam('stat', $stat);\n $this->_setParam('history', $history);\n }",
"public function __construct()\n {\n parent::__construct('Log', 'gems__log_activity', 'gla', true);\n $this->addTable('gems__log_setup', array('gla_action' => 'gls_id_action'))\n ->addLeftTable('gems__respondents', array('gla_respondent_id' => 'grs_id_user'))\n ->addLeftTable('gems__staff', array('gla_by' => 'gsf_id_user'));\n\n $this->setKeys(array(\\Gems_Model::LOG_ITEM_ID => 'gla_id'));\n }",
"public function __construct($type)\n {\n }",
"function __construct($xml)\n\t{\n\t\tparent::__construct($xml);\n\t\t$this->infolog = new infolog_bo();\n\t}",
"public function __construct(){\n parent::__construct();\n\n # load history\n # have to get it from database manually to get past the cache\n $config = Mage::getModel(\"core/config_data\")->getCollection()\n ->addFieldToFilter(\"scope_id\",\"0\")\n ->addFieldToFilter(\"path\",self::XML_PATH_DATASTORE)\n ->getFirstItem();\n\n if($config->getId()){\n $this->_dataStore = json_decode($config->getValue(),true);\n } else {\n $this->_dataStore = json_decode(Mage::getStoreConfig(self::XML_PATH_DATASTORE,0),true);\n }\n }",
"public function __construct()\n {\n parent::__construct('gems__tracks');\n\n $this->addColumn(\"CASE WHEN gtr_track_class = 'SingleSurveyEngine' THEN 'deleted' ELSE '' END\", 'row_class');\n\n \\Gems_Model::setChangeFieldsByPrefix($this, 'gtr');\n\n $this->set('gtr_date_start', 'default', new \\Zend_Date());\n }",
"public function __construct()\n {\n parent::__construct(ChartTypes::BAR);\n }",
"function __construct($type) {\n\t$this->type = $type;\n\t}",
"public function __construct() {\n $this->_blockGroup = 'wsu_auditing';\n $this->_controller = 'adminhtml_history';\n $this->_headerText = Mage::helper('wsu_auditing')->__('History');\n parent::__construct();\n $this->removeButton('add');\n }",
"public function __construct($_oprL = null,$_oprType = null,$_label = null,$_name = null,$_oper = null,$_debit = null,$_credit = null)\n {\n parent::__construct(array('oprL'=>$_oprL,'oprType'=>$_oprType,'Label'=>$_label,'Name'=>$_name,'oper'=>$_oper,'Debit'=>$_debit,'Credit'=>$_credit), false);\n }",
"public function initHistorys()\n\t{\n\t\t$this->collHistorys = array();\n\t}",
"public function __construct($type='htag') {\n\t\tparent::__construct($type);\n\t}",
"public function __construct(array $options=null) {\r\n\t\tparent::__construct($options);\r\n\t\t$this->setDbTable('Applicant_Model_DbTable_ApplicantRentalCriminalHistory');\r\n\t}",
"function __construct ($strId)\n\t\t{\n\t\t\tparent::__construct ('ServiceStateType');\n\t\t\t\n\t\t\t$strName = 'Unknown';\n\t\t\t\n\t\t\tswitch ($strId)\n\t\t\t{\n\t\t\t\tcase SERVICE_STATE_TYPE_ACT:\n\t\t\t\t\t$strName = 'Australian Capital Territory';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_NSW:\n\t\t\t\t\t$strName = 'New South Wales';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_NT:\n\t\t\t\t\t$strName = 'Northern Territory';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_QLD:\n\t\t\t\t\t$strName = 'Queensland';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_SA:\n\t\t\t\t\t$strName = 'South Australia';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_TAS:\n\t\t\t\t\t$strName = 'Tasmania';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_VIC:\n\t\t\t\t\t$strName = 'Victoria';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase SERVICE_STATE_TYPE_WA:\n\t\t\t\t\t$strName = 'Western Australia';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->oblstrType\t\t= $this->Push (new dataString\t('Id',\t\t$strId));\n\t\t\t$this->oblstrName\t\t= $this->Push (new dataString\t('Name',\t$strName));\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t$this->_db_table = new Application_Model_DbTable_TourType();\n\t\t}",
"public function __construct() {\n\t\tglobal $wgHooks;\n\t\t$wgHooks['SpecialRecentChangesQuery'][] = $this;\n\t\tif( !$this->getRequest()->getVal( 'feed' ) ) $this->getRequest()->setVal( 'feed', 'rss' );\n\t\tif( !$this->getRequest()->getVal( 'days' ) ) $this->getRequest()->setVal( 'days', 1000 );\n\t\tparent::__construct( 'BlikiFeed' );\n\t}",
"public function initialize()\n {\n // attributes\n $this->setName('so_lot_ser_hist');\n $this->setPhpName('SalesHistoryLotserial');\n $this->setIdentifierQuoting(false);\n $this->setClassName('\\\\SalesHistoryLotserial');\n $this->setPackage('');\n $this->setUseIdGenerator(false);\n // columns\n $this->addForeignPrimaryKey('OehhNbr', 'Oehhnbr', 'INTEGER' , 'so_head_hist', 'OehhNbr', true, 10, 0);\n $this->addForeignPrimaryKey('OehhNbr', 'Oehhnbr', 'INTEGER' , 'so_det_hist', 'OehhNbr', true, 10, 0);\n $this->addForeignPrimaryKey('OedhLine', 'Oedhline', 'INTEGER' , 'so_det_hist', 'OedhLine', true, 4, 0);\n $this->addForeignPrimaryKey('InitItemNbr', 'Inititemnbr', 'VARCHAR' , 'inv_item_mast', 'InitItemNbr', true, 30, '');\n $this->addPrimaryKey('OeshTag', 'Oeshtag', 'CHAR', true, null, '');\n $this->addPrimaryKey('OeshLotSer', 'Oeshlotser', 'VARCHAR', true, 20, '');\n $this->addPrimaryKey('OeshBin', 'Oeshbin', 'VARCHAR', true, 8, '');\n $this->addPrimaryKey('OeshPlltNbr', 'Oeshplltnbr', 'INTEGER', true, 4, 0);\n $this->addPrimaryKey('OeshCrtnNbr', 'Oeshcrtnnbr', 'INTEGER', true, 4, 0);\n $this->addColumn('OeshYear', 'Oeshyear', 'CHAR', true, 4, '');\n $this->addColumn('OeshQtyShip', 'Oeshqtyship', 'DECIMAL', true, 20, 0);\n $this->addColumn('OeshCntrQty', 'Oeshcntrqty', 'DECIMAL', true, 20, 0);\n $this->addColumn('OeshSpecOrdr', 'Oeshspecordr', 'CHAR', true, null, '');\n $this->addColumn('OeshLotRef', 'Oeshlotref', 'VARCHAR', true, 20, '');\n $this->addColumn('OeshBatch', 'Oeshbatch', 'VARCHAR', true, 15, '');\n $this->addColumn('OeshCureDate', 'Oeshcuredate', 'VARCHAR', true, 10, '');\n $this->addColumn('OeshAcStatus', 'Oeshacstatus', 'VARCHAR', true, 4, '');\n $this->addColumn('OeshTestLot', 'Oeshtestlot', 'VARCHAR', true, 4, '');\n $this->addColumn('OeshPlltType', 'Oeshpllttype', 'CHAR', true, null, '');\n $this->addColumn('OeshTareWght', 'Oeshtarewght', 'DECIMAL', true, 20, 0);\n $this->addColumn('OeshUseUp', 'Oeshuseup', 'CHAR', true, null, '');\n $this->addColumn('OeshLblPrtd', 'Oeshlblprtd', 'CHAR', true, null, '');\n $this->addColumn('OeshOrigBin', 'Oeshorigbin', 'VARCHAR', true, 8, '');\n $this->addColumn('OeshActvDate', 'Oeshactvdate', 'CHAR', true, 8, '');\n $this->addColumn('OeshPlltID', 'Oeshplltid', 'VARCHAR', true, 15, '');\n $this->addColumn('DateUpdtd', 'Dateupdtd', 'CHAR', true, 8, '');\n $this->addColumn('TimeUpdtd', 'Timeupdtd', 'CHAR', true, 8, '');\n $this->addColumn('dummy', 'Dummy', 'CHAR', true, null, 'P');\n }",
"function __construct ($intCreditCardType=null)\n\t\t{\n\t\t\tparent::__construct ('CreditCardTypes');\n\t\t\t\n\t\t\t// Instantiate the Variable Values for possible selection\n\t\t\t$this->_VISA\t\t= $this->Push (new CreditCardType (CREDIT_CARD_VISA));\n\t\t\t$this->_MASTERCARD\t= $this->Push (new CreditCardType (CREDIT_CARD_MASTERCARD));\n\t\t\t$this->_AMEX\t\t= $this->Push (new CreditCardType (CREDIT_CARD_AMEX));\n\t\t\t$this->_DINERS\t\t= $this->Push (new CreditCardType (CREDIT_CARD_DINERS));\n\t\t\t\n\t\t\t$this->setValue ($intCreditCardType);\n\t\t}",
"public function initialize()\n {\n // attributes\n $this->setName('email_manager_history');\n $this->setPhpName('EmailManagerHistory');\n $this->setClassName('\\\\TheliaEmailManager\\\\Model\\\\EmailManagerHistory');\n $this->setPackage('TheliaEmailManager.Model');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);\n $this->addForeignKey('TRACE_ID', 'TraceId', 'INTEGER', 'email_manager_trace', 'ID', true, null, null);\n $this->addColumn('STATUS', 'Status', 'INTEGER', false, null, 0);\n $this->addColumn('SUBJECT', 'Subject', 'LONGVARCHAR', false, null, null);\n $this->addColumn('INFO', 'Info', 'LONGVARCHAR', false, null, null);\n $this->addColumn('BODY', 'Body', 'BLOB', false, null, null);\n $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);\n $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);\n }",
"function __construct($id='', $type='current'){\r\n\t\tGLOBAL $strLocal;\r\n\t\tGLOBAL $arrUsrData;\r\n\t\t\r\n\t\t$this->gridName = self::GridName;\t\t\r\n\t\t$this->gridClass = 'headcount_record';\t\t\r\n\t\t$this->register = self::Register;\r\n\t\t\r\n\t\tswitch($type){\r\n\t\t\tcase 'new':\r\n\t\t\t\t$this->table = 'tbl_new_employee';\r\n\t\t\t\t$this->prefix = 'nem';\r\n\t\t\tbreak;\r\n\t\t\tcase 'current':\r\n\t\t\tdefault:\r\n\t\t\t\t$this->table = 'tbl_current_employee';\r\n\t\t\t\t$this->prefix = 'cem';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t$this->type = $type;\r\n\t\t\r\n\t\tparent::__construct($id);\r\n\t\t\r\n\t}",
"public function __construct($type) {\n $this->type = $type;\n }",
"public function __construct()\n {\n parent::__construct();\n\n // Set data types\n $this->data_types = array(\n 'title' => 'string',\n 'url' => 'url',\n 'url_key' => 'md5',\n 'embed' => 'string',\n 'created_on' => 'datetime'\n );\n\n }",
"function WeblogTrackbackBase() {\n $this->XoopsObject();\n\n $this->initVar(\"blog_id\", XOBJ_DTYPE_INT, 0, false);\n $this->initVar(\"tb_url\", XOBJ_DTYPE_TXTBOX, null, true);\n $this->initVar(\"blog_name\", XOBJ_DTYPE_TXTBOX, null, false);\n $this->initVar(\"title\", XOBJ_DTYPE_TXTBOX, null, false);\n $this->initVar(\"description\", XOBJ_DTYPE_TXTBOX, null, false);\n $this->initVar(\"link\", XOBJ_DTYPE_TXTBOX, null, false);\n $this->initVar(\"direction\", XOBJ_DTYPE_TXTBOX, null, false);\n $this->initVar(\"trackback_created\", XOBJ_DTYPE_INT, 0, false);\n }",
"public function __construct($type, $args = NULL);",
"public function __construct($_cardType = NULL,$_cardNumber = NULL,$_bankName = NULL,$_bankCode = NULL)\n {\n parent::__construct(array('CardType'=>$_cardType,'CardNumber'=>$_cardNumber,'BankName'=>$_bankName,'BankCode'=>$_bankCode),false);\n }",
"public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/User/GetBannedTracks/');\n }",
"public function __construct($type)\n {\n $this->type = $type;\n }"
]
| [
"0.6414826",
"0.6120144",
"0.5866517",
"0.5728219",
"0.5634685",
"0.5594342",
"0.55675554",
"0.5566955",
"0.5551891",
"0.55483204",
"0.5523311",
"0.55220085",
"0.5457646",
"0.544002",
"0.5428715",
"0.54101074",
"0.5392327",
"0.5355599",
"0.534591",
"0.5339991",
"0.53359264",
"0.5329438",
"0.53214264",
"0.53203416",
"0.529329",
"0.5267101",
"0.5266968",
"0.5255013",
"0.524491",
"0.5244267"
]
| 0.7013523 | 0 |
returns first forwarded IP match it finds | function forwarded_ip() {
$server=array(
'HTTP_X_FORWARDED_FOR'=>'123.123.123.123.',
);
$keys = array(
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'HTTP_CLIENT_IP',
'HTTP_X_CLUSTER_CLIENT_IP',
);
foreach($keys as $key) {
if(isset($server[$key])) {
$ip_array = explode(',', $server[$key]);
foreach($ip_array as $ip) {
$ip = trim($ip);
if(validateIp($ip)){
return $ip;
}
}
}
}
return '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forwarded_ip(){\n\n // for testing \n $server = array(\n // 'HTTP_X_FORWARDED_FOR'=> \"0.0.0.0,1sd.1.2.3\",\n // 'HTTP_X_FORWARDED' => \"jlaldjfl,99adf,123.123.123.123,1.2.4.4\",\n \n );\n\n $keys = array(\n 'HTTP_X_FORWARDED_FOR', \n 'HTTP_X_FORWARDED', \n 'HTTP_FORWARDED_FOR', \n 'HTTP_FORWARDED',\n 'HTTP_CLIENT_IP', \n 'HTTP_X_CLUSTER_CLIENT_IP',\n );\n\n foreach($keys as $key){\n if(isset($_SERVER[$key])){\n $ip_array = explode(\",\",$_SERVER[$key]);\n\n foreach($ip_array as $ip){\n $ip = trim($ip);\n if(validate_ip($ip)){\n return $ip;\n }\n }\n }\n }\n\n return \"\";\n\n}",
"function get_ip()\n{\n\t// No IP found (will be overwritten by for\n\t// if any IP is found behind a firewall)\n\t$ip = FALSE;\n\n\t// If HTTP_CLIENT_IP is set, then give it priority\n\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t}\n\n\t// User is behind a proxy and check that we discard RFC1918 IP addresses\n\t// if they are behind a proxy then only figure out which IP belongs to the\n\t// user. Might not need any more hackin if there is a squid reverse proxy\n\t// infront of apache.\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\n\t\t// Put the IP's into an array which we shall work with shortly.\n\t\t$ips = explode (\", \", $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\tif ($ip) {\n\t\t\tarray_unshift($ips, $ip);\n\t\t\t$ip = FALSE;\n\t\t}\n\n\t\tfor ($i = 0; $i < count($ips); $i++)\n\t\t{\n\t\t\t// Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and\n\t\t\t// 192.168.0.0/16 -- jim kill me later with my regexp pattern\n\t\t\t// below.\n\t\t\tif (!eregi (\"^(10|172\\.16|192\\.168)\\.\", $ips[$i])) {\n\t\t\t\tif (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n\t\t\t\t\tif (ip2long($ips[$i]) != false) {\n\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (ip2long($ips[$i]) != -1) {\n\t\t\t\t\t\t$ip = $ips[$i];\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\t}\n\n\t// Return with the found IP or the remote address\n\treturn ($ip ? $ip : $_SERVER['REMOTE_ADDR']);\n}",
"public function getFirstIp()\n\t{\n\t\treturn $this->first_ip;\n\t}",
"protected static function GetRemoteAddr()\n {\n $ipSet = new IPSet(IPSet::PRIVATE_NETS);\n if ( ! $ipSet->match($_SERVER[\"REMOTE_ADDR\"])) {\n return $_SERVER[\"REMOTE_ADDR\"]; // Remote ADDR is Public Address: Use this! (We want Load-Balancers with private IPs only!)\n }\n if (isset ($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n $forwardsRev = array_reverse($forwards = explode(\",\", $_SERVER[\"HTTP_X_FORWARDED_FOR\"]));\n for ($i=0; $i<count ($forwardsRev); $i++) {\n if ( ! $ipSet->match(trim ($forwardsRev[$i]))) {\n return $forwardsRev[$i]; // Return first non-private IP from last to first\n }\n }\n return $forwards[0]; // Return first IP if no public IP found.\n }\n return $_SERVER[\"REMOTE_ADDR\"]; // Return the private Remote-ADDR\n }",
"function detectProxy(){\r\n\r\n\t$ip_sources = array(\r\n\t\t\"HTTP_X_FORWARDED_FOR\",\r\n\t\t\"HTTP_X_FORWARDED\",\r\n\t\t\"HTTP_FORWARDED_FOR\",\r\n\t\t\"HTTP_FORWARDED\",\r\n\t\t\"HTTP_X_COMING_FROM\",\r\n\t\t\"HTTP_COMING_FROM\",\r\n\t\t\"REMOTE_ADDR\"\r\n\t);\r\n\t\r\n\t#loop through array.\r\n\tforeach ($ip_sources as $ip_source){\r\n\t\t#If the ip source exists, capture it\r\n\t\tif (isset($_SERVER[$ip_source])){\r\n\t\t\t$proxy_ip = $_SERVER[$ip_source];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t#if all else fails, just set a false value.\r\n\t$proxy_ip = (isset($proxy_ip)) ? $proxy_ip : $_SERVER[\"REMOTE_ADDR\"];\r\n\r\n\treturn ($proxy_ip);\r\n}",
"function direct_ip_match($ALLOWED,$IP)\n\t{\n\t\t$DEBUG=0;\n\t\tif ($DEBUG) print \"<hr>\";\n\t\t$QUERY =<<<EOQ\n\t\t\tSELECT *\n\t\t\tFROM `rodin_firewall_rules` \n\t\t\tWHERE ALLOWED = $ALLOWED\n\t\t\tAND IP = '$IP'\nEOQ;\n\n\t\t$REC=fetch_record($QUERY);\n\t\tif ($DEBUG) {\n\t\t\tprint \"<br>RECORD MATCHING $IP (ALLOWED=$ALLOWED) in query ($QUERY)\";\n\t\t\tvar_dump($REC);\n\t\t}\n\t\t\n\t\treturn $REC;\n\t}",
"function get_next($ip) {\n\t\t\tif (IPv6::validate_subnet($ip)) {\n\t\t\t\tlist($ip, $cidr) = explode(\"/\", $ip);\n\t\t\t\treturn IPv6::get_next(IPv6::maxip($ip .\"/\" .$cidr)) .\"/\" .$cidr;\n\t\t\t} else if (IPv6::validate_ip($ip)) {\n\t\t\t\t$binip = IPv6::iptobin($ip);\n\t\t\t\tif ($binip == sprintf(\"%'1\", 128))\n\t\t\t\t\treturn false;\n\t\t\t\telse {\n\t\t\t\t\t$bits = str_split($binip);\n\t\t\t\t\tfor ($index = count($bits)-1; $index >= 0; $index--) {\n\t\t\t\t\t\tif ($bits[$index] == 1)\n\t\t\t\t\t\t\t$bits[$index] = 0;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$bits[$index] = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn IPv6::bintoip(implode(\"\", $bits));\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\treturn false;\n\t\t}",
"private function _getProxyIpAddress() {\n static $forwarded = [\n 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED',\n ];\n $flags = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n foreach ($forwarded as $key) {\n if (!array_key_exists($key, $_SERVER)) {\n continue;\n }\n sscanf($_SERVER[$key], '%[^,]', $ip);\n if (filter_var($ip, FILTER_VALIDATE_IP, $flags) !== FALSE) {\n return $ip;\n }\n }\n return '';\n }",
"function get_ip() {\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n //Get the forwarded IP if it exists\n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) {\n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else {\n\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n }\n return $the_ip;\n }",
"public static function getIP() {\n\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $rawheaders = apache_request_headers();\n } else {\n $rawheaders = $_SERVER;\n }\n\n // Lower case headers\n $headers = array();\n foreach($rawheaders as $key => $value) {\n $key = trim(strtolower($key));\n if ( !is_string($key) || empty($key) ) continue;\n $headers[$key] = $value;\n }\n\n // $filter_option = FILTER_FLAG_IPV4;\n // $filter_option = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n $filter_option = 0;\n\n $the_ip = false;\n\n // Check Cloudflare headers\n if ( $the_ip === false && array_key_exists( 'http_cf_connecting_ip', $headers ) ) {\n $pieces = explode(',',$headers['http_cf_connecting_ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'cf-connecting-ip', $headers ) ) {\n $pieces = explode(',',$headers['cf-connecting-ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Get the forwarded IP from more traditional places\n if ( $the_ip == false && array_key_exists( 'x-forwarded-for', $headers ) ) {\n $pieces = explode(',',$headers['x-forwarded-for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'http_x_forwarded_for', $headers ) ) {\n $pieces = explode(',',$headers['http_x_forwarded_for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'remote_addr', $headers ) ) {\n $the_ip = filter_var( $headers['remote_addr'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Fall through and get *something*\n if ( $the_ip === false && array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false ) $the_ip = NULL;\n return $the_ip;\n }",
"function getRemoteAddr()\n{\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] AND (!isset($_SERVER['REMOTE_ADDR']) OR preg_match('/^127\\..*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^172\\.16.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^192\\.168\\.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^10\\..*/i', trim($_SERVER['REMOTE_ADDR']))))\n\t{\n\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ','))\n\t\t{\n\t\t\t$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\treturn $ips[0];\n\t\t}\n\t\telse\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\treturn $_SERVER['REMOTE_ADDR'];\n}",
"public static function fetch_alt_ip() {\n $alt_ip = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n // try to avoid using an internal IP address, its probably a proxy\n $ranges = array(\n '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')),\n '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')),\n '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')),\n '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')),\n '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')),\n );\n foreach ($matches[0] AS $ip) {\n $ip_long = ip2long($ip);\n if ($ip_long === false) {\n continue;\n }\n\n $private_ip = false;\n foreach ($ranges AS $range) {\n if ($ip_long >= $range[0] AND $ip_long <= $range[1]) {\n $private_ip = true;\n break;\n }\n }\n\n if (!$private_ip) {\n $alt_ip = $ip;\n break;\n }\n }\n } else if (isset($_SERVER['HTTP_FROM'])) {\n $alt_ip = $_SERVER['HTTP_FROM'];\n }\n\n return $alt_ip;\n }",
"public static function getRemoteAddr() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] AND ( !isset($_SERVER['REMOTE_ADDR']) OR preg_match('/^127\\..*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^172\\.16.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^192\\.168\\.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^10\\..*/i', trim($_SERVER['REMOTE_ADDR'])))) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) {\n $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n return $ips[0];\n } else\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n return $_SERVER['REMOTE_ADDR'];\n }",
"function guess_location_from_ip( $dotted_ip ) {\n\tglobal $wpdb, $cache_group, $cache_life;\n\n\t$cache_key = 'guess_location_from_ip:' . $dotted_ip;\n\t$location = wp_cache_get( $cache_key, $cache_group );\n\n\tif ( $location !== false ) {\n\t\tif ( '__NOT_FOUND__' == $location ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $location;\n\t}\n\n\t$long_ip = false;\n\n\tif ( filter_var( $dotted_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n\t\t$long_ip = ip2long( $dotted_ip );\n\t\t$from = 'ip2location';\n\t\t$where = 'ip_to >= %d';\n\t} elseif ( filter_var( $dotted_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {\n\t\t$long_ip = _ip2long_v6( $dotted_ip );\n\t\t$from = 'ipv62location';\n\t\t$where = 'ip_to >= CAST( %s AS DECIMAL( 39, 0 ) )';\n\t}\n\n\tif ( false === $long_ip || ! isset( $from, $where ) ) {\n\t\twp_cache_set( $cache_key, '__NOT_FOUND__', $cache_group, $cache_life );\n\n\t\treturn false;\n\t}\n\n\t$row = $wpdb->get_row( $wpdb->prepare( \"\n\t\tSELECT ip_city, ip_latitude, ip_longitude, country_short\n\t\tFROM $from\n\t\tWHERE $where\n\t\tORDER BY ip_to ASC\n\t\tLIMIT 1\",\n\t\t$long_ip\n\t) );\n\n\t// Unknown location:\n\tif ( ! $row || '-' == $row->country_short ) {\n\t\twp_cache_set( $cache_key, '__NOT_FOUND__', $cache_group, $cache_life );\n\n\t\treturn false;\n\t}\n\n\twp_cache_set( $cache_key, $row, $cache_group, $cache_life );\n\n\treturn $row;\n}",
"function get_ip() {\n\tif ( function_exists( 'apache_request_headers' ) ) {\n\t\t$headers = apache_request_headers();\n\t} else {\n\t\t$headers = $_SERVER;\n\t}\n\t$the_ip='';\n\t//Get the forwarded IP if it exists\n\tif ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n\t\t$the_ip = $headers['X-Forwarded-For'];\n\t} elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && \n\t\tfilter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )) {\n\t\t$the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n\t} else \n\t\t$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n\tif (empty($the_ip)) $the_ip='10.0.0.1';\n\treturn $the_ip;\n\t/*$ipaddress ='';\n\tif ($_SERVER['HTTP_CLIENT_IP'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\telse if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\telse if ($_SERVER['HTTP_X_FORWARDED'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\telse if ($_SERVER['HTTP_FORWARDED_FOR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\telse if ($_SERVER['HTTP_FORWARDED'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_FORWARDED'];\n\telse if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['REMOTE_ADDR'];\n\telse\n\t$ipaddress = 'UNKNOWN';\n\treturn $ipaddress;*/\n}",
"public function getVisitorIP(){\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t$proxy = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\n\t\tif(preg_match(\"/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/\",$proxy))\n\t\t $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\n\t\t//return '127.0.0.1';\n\t\treturn $ip;\n\t}",
"function get_ip() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n $fwd_addresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $ip_address = $fwd_addresses[0];\n } else {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n\n return $ip_address;\n}",
"function getRealIpAddr()\n{\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif ($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) {\n\t\t$ip = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\telse\n\t{\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}",
"function partial_ip_match($ALLOWED,$IP)\n\t{\n\t\t$DEBUG=0;\n\t\t$REC=null;\n\t\tif ($DEBUG) print \"<hr>\";\n\t\tif (!$ALLOWED) $ALLOWED=0;\n\t\t\n\t\t$QUERY =<<<EOQ\n\t\t\tSELECT *\n\t\t\tFROM `rodin_firewall_rules` \n\t\t\tWHERE ALLOWED = $ALLOWED\nEOQ;\n\t\t\t$RECS = fetch_records($QUERY);\n\t\t\tif ($RECS)\n\t\t\t{\n\t\t\t\tif ($DEBUG) {print \"Trying IP partial match \" ;var_dump($RECS);}\n\t\t\t\tforeach($RECS as $RECX)\n\t\t\t\t{\n\t\t\t\t\t$XIP=$RECX['IP'];\n\t\t\t\t\t$partial_match= (strstr($IP,$XIP) || strstr($XIP,$IP));\n\t\t\t\t\tif ($DEBUG) print \"<br> IP: $XIP \".($partial_match?'YES':'NO');\n\t\t\t\t\tif ($partial_match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$REC=$RECX;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {if ($DEBUG) print \"EMPTY RESULT FOR QUERY: ($QUERY)\";}\n\t\t\t\n\t\treturn $REC;\n\t}",
"public static function proxyForwardedFor() {\n\t\tif (isset($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getRealIpAddr(){\n\t\t//check ip from share internet\n\t if (!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t } else {\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}",
"function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"function getRealIpAddr()\n{\nif(!empty($_SERVER['HTTP_CLIENT_IP']))\n//check if from share internet\n{\n\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n}\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"public static function realIP() {\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t// Behind proxy\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t\telseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t// Use first IP address in list\n\t\t\t$_ip=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\treturn $_ip[0];\n\t\t}\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}",
"public function gatewayIpAddr()\n {\n $datas = 'N.A';\n\n if(exec('ip route | awk \\'/a/ { print $3 }\\'',$output))\n $datas = $output[0];\n\n return $datas;\n }",
"private function findIP()\n {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from proxy\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from remote address\n else {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n return $ip_address;\n }",
"function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"public static function getLocalIp() {\n $localip = '127.0.0.1';\n $the_ip = '';\n if($_SERVER['REMOTE_ADDR']!='::1'){\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n $check = 0;\n //Get the forwarded IP if it exists \n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) { \n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) { \n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else { \n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n } \n } \n if($the_ip!='' OR strlen($the_ip)==0){ \n $the_ip = $localip;\n }\n return $the_ip; \n }",
"private function getIp()\n\t {\n\t \n\t if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ))\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t \n\t // los proxys van añadiendo al final de esta cabecera\n\t // las direcciones ip que van \"ocultando\". Para localizar la ip real\n\t // del usuario se comienza a mirar por el principio hasta encontrar\n\t // una dirección ip que no sea del rango privado. En caso de no\n\t // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\t \n\t $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t \n\t reset($entries);\n\t while (list(, $entry) = each($entries))\n\t {\n\t $entry = trim($entry);\n\t if ( preg_match(\"/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/\", $entry, $ip_list) )\n\t {\n\t // http://www.faqs.org/rfcs/rfc1918.html\n\t $private_ip = array(\n\t '/^0\\./',\n\t '/^127\\.0\\.0\\.1/',\n\t '/^192\\.168\\..*/',\n\t '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n\t '/^10\\..*/');\n\t \n\t $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\t \n\t if ($client_ip != $found_ip)\n\t {\n\t $client_ip = $found_ip;\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t else\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t }\n\t \n\t return $client_ip;\n\t \n\t}",
"static function getRealIpAddr()\r\n\t{\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && ($_SERVER['HTTP_CLIENT_IP']!=\"unknown\")) //check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && ($_SERVER['HTTP_X_FORWARDED_FOR']!=\"unknown\")) //to check ip is pass from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\telse\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t\treturn $ip;\r\n\t}"
]
| [
"0.6017717",
"0.5844149",
"0.5815098",
"0.5758469",
"0.5719107",
"0.5659898",
"0.5621015",
"0.5545808",
"0.5534804",
"0.53948504",
"0.5391258",
"0.5323839",
"0.53218716",
"0.53096884",
"0.53087234",
"0.5288963",
"0.5281532",
"0.52707475",
"0.5253457",
"0.5247854",
"0.52303857",
"0.5218889",
"0.5207034",
"0.5205033",
"0.5202645",
"0.52001256",
"0.519607",
"0.5190532",
"0.51858497",
"0.5180786"
]
| 0.6055737 | 0 |
Format resulting message array as table | function _notifications_content_test_format_message($message) {
$rows = array();
foreach ($message as $key => $value) {
$rows[] = array($key, is_array($value) ? _notifications_content_test_format_message($value) : '<pre>' . check_plain($value) . '</pre>');
}
return theme('table', array(), $rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dumpTable($passedArray) {\n\t\n\techo '<br><table border=\"1\" cellpadding=\"3\" frame=\"border\" rules=\"all\">';\n\tforeach($passedArray as $row) {\n\t\techo '<tr><td>';\n\t\techo implode('</td><td>', $row);\n\t\techo '</td></tr>';\n\t}\n\techo '</table><br>';\n\t@ob_flush();\n\t@flush();\n\n\treturn;\n}",
"function dumpTable($passedArray) {\n\techo '<br><table border=\"1\" cellpadding=\"3\" frame=\"border\" rules=\"all\">';\n\tforeach($passedArray as $row) {\n\t\techo '<tr><td>';\n\t\techo implode('</td><td>', $row);\n\t\techo '</td></tr>';\n\t}\n\techo '</table><br>';\n\t@ob_flush();\n\t@flush();\t\n\treturn;\n}",
"function toPlainTable($data)\n{\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = '';\n\tforeach($keys as $key)\n\t{\n\t\t$result .= $key . ' ';\n\t}\n\t$result .= \"\\n\";\n\tforeach($data as $item)\n\t{\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= $value . ' ';\n\t\t}\n\t\t$result .= \"\\n\";\n\t}\n\treturn $result;\n}",
"public function array2table($array, $table = true) {\n $out = '';\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n\n /** if (!isset($tableHeader)) { \n $tableHeader =\n '<tr><th>' .\n implode('</th><th>', array_keys($value)) .\n '</th></tr>';\n } **/ \n array_keys($value);\n\n $out .= \"\\n<tr>\";\n $out .= $this->array2table($value, false);\n $out .= \"</tr>\\n\";\n } else {\n \n $out .= \"<td>$value</td>\";\n\n }\n }\n // build it up \n if ($table) { \n $sort_buttons = $this->BuildSortButtons(); \n \n return \"\\n<table>\\n\" . $sort_buttons . $out . \"\\n</table>\\n\";\n\n } else {\n \n return $out;\n } \n }",
"public function format(array $message);",
"function makeHTMLTable($array){\n\t\t // start table\n\t\t $html = '<table>';\n\t\t // header row\n\t\t $html .= '<tr>';\n\t\t // foreach($array[0] as $key=>$value){\n\t\t // $html .= '<th>' . htmlspecialchars($key) . '</th>';\n\t\t // }\n\t\t // $html .= '</tr>';\n\t\t // data rows\n\t\t foreach( $array as $key=>$value){\n\t\t $html .= '<tr>';\n\t\t foreach($value as $key2=>$value2){\n\t\t $html .= '<td>' . htmlspecialchars($value2) . '</td>';\n\t\t }\n\t\t $html .= '</tr>';\n\t\t }\n\t\t // finish table and return it\n\t\t $html .= '</table>';\n\t\t return $html;\n\t\t\t}",
"function buildTable($array){\n // start table\n $html = '<table class=\"table\">';\n // data rows\n foreach( $array as $key=>$value){\n $html .= '<tr>';\n foreach($value as $key2=>$value2){\n $html .= '<td>' . htmlspecialchars($value2) . '</td>';\n }\n $html .= '</tr>';\n }\n\n // finish table and return it\n\n $html .= '</table>';\n return $html;\n}",
"protected function _getDataAsTextTable(array $data) {\n\t\t\t// Dummy widths\n\t\t\t$table = new Zend_Text_Table(array('columnWidths' => array(1)));\n\t\t\t$widths = array();\n\t\t\tforeach ($data as $rowData) {\n\t\t\t\t$row = new Zend_Text_Table_Row();\n\t\t\t\tforeach ($rowData as $idx => $cell) {\n\t\t\t\t\t$width = mb_strlen($cell);\n\t\t\t\t\tif (!isset($widths[$idx]) || $widths[$idx] < $width) {\n\t\t\t\t\t\t$widths[$idx] = $width;\n\t\t\t\t\t}\n\t\t\t\t\t$row->appendColumn(new Zend_Text_Table_Column(strval($cell)));\n\t\t\t\t}\n\t\t\t\t$table->appendRow($row);\n\t\t\t}\n\t\t\t$table->setColumnWidths($widths);\t\t \n\t\t\treturn $table->render();\n\t\t}",
"function arrayToTable($array_assoc):void {\n if (is_array($array_assoc)) {\n echo '<table class=\"table\">';\n echo '<thead>';\n echo '<tr>';\n list($table_title) = $array_assoc;\n foreach ($table_title as $key => &$value):\n echo '<th>' . $key . '</th>';\n endforeach;\n echo '</tr>';\n echo '</thead>';\n foreach ($array_assoc as &$master):\n echo '<tr>';\n foreach ($master as &$slave):\n echo '<td>' . $slave . '</td>';\n endforeach;\n echo '</tr>';\n endforeach;\n echo '</table>';\n }\n}",
"function resultsToTable($results) {\n\t$html = \"<table border='1' cellspacing='0' cellpadding='2'>\\n\";\n\t$html .= \"<tr>\\n<th>ID</th>\\n<th>Name</th>\\n<th>Address</th>\\n<th></th>\\n\";\n\t$html .= \"<th>Region</th>\\n<th>State</th>\\n<th>Status</th>\\n\";\n\t$html .= \"<th>Deactivation Date</th>\\n<th>PWS Type</th>\\n</tr>\";\n\tforeach($results as $object) {\n\t\t$html .= \"\\n<tr>\\n<td>{$object->PWSID}</td>\\n<td>{$object->PWS_NAME}</td>\\n\";\n\t\t$html .= \"<td>{$object->ADDRESS_LINE1}</td>\\n<td>{$object->ADDRESS_LINE2}</td>\\n\";\n\t\t$html .= \"<td>{$object->EPA_REGION}</td>\\n\";\n\t\t$html .= \"<td>{$object->STATE_CODE}</th>\\n<td>{$object->SUBMISSION_STATUS_CODE}</td>\\n\";\n\t\t$html .= \"<td>{$object->PWS_DEACTIVATION_DATE}</td>\\n<td>{$object->PWS_TYPE_CODE}</td>\\n\";\n\t\t$html .= \"</tr>\\n\";\n\t}\n\treturn $html . \"</table>\\n\";\n}",
"public function format(array $messages);",
"function tabla02($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"1\\\">\";\n\tforeach( $array01 as $key => $value){\n\t\tif ( $key == 'id' or $key == 'ID' or $key == 'Id'){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td> - </td></tr>\\n\";\n\t\t} else{\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n}",
"function _im_user_getmms_format() { \r\n\t$rows = _im_user_getmms(); \r\n $header = array(\"Code\", \"Description\");\r\n $output = '<div class =\"table-trans-replace\">';\r\n $output .= '<div id =\"table-second-save\">';\r\n $output .= theme('table', array('header' => $header, 'rows' => $rows, ));\r\n $output .= '</div></div>';\r\n return $output;\r\n}",
"function render_subscriber_table($table) {\n $s = '<table>';\n $s .= '<tr><th>Id</th><th>Name</th><th>Email</th></tr>';\n foreach($table as $row) {\n $id = \"$row[id]\";\n $name = \"<b>$row[name]</b>\";\n $email = \"$row[email]\";\n $s .= \"<tr><td>$id</td><td>$name</td><td>$email</td></tr>\";\n }\n $s .= '</table>';\n return $s;\n }",
"public function toTable(){\r\n\t\t$datas = array();\r\n\t\tforeach ($this as $key => $value) {\r\n\t\t\tif(!in_array($key, $this->arraysis)){\r\n\t\t\t\t$datas[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $datas;\r\n\t}",
"function table($text) {\n\t\t$output = \"\";\n\t\tif (!empty($text)) {\n\t\t\t$output .= '<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">';\n\t\t\t$array = explode(\"\\n\", $text);\n\t\t\tfor ($i=0; $i<count($array); $i++) {\n\t\t\t\tif (!empty($array[$i])) {\n\t\t\t\t\t$row = explode(\":\", $array[$i], 2);\n\t\t\t\t\t$title = isset($row[0]) ? $row[0] : '';\n\t\t\t\t\t$data = isset($row[1]) ? $row[1] : '';\n\t\t\t\t\tif ($i%2 == 0) {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_a\"><td class=\"form_title\" width=\"30%\">'.$title.'</td><td bgcolor=\"#EBF1F6\" width=\"70%\">'.$data.'</td></tr>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_b\"><td class=\"form_title\">'.$title.'</td><td bgcolor=\"#FFFFFF\">'.$data.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</table>';\n\t\t}\n\n\t\treturn $output;\n\t}",
"private function formatTable (array $detectedFiles) : array\n {\n $rows = [];\n\n foreach ($detectedFiles as $type => $data)\n {\n $rows[] = [\n \"<fg=yellow>{$type}</>\",\n $data[\"fileName\"],\n $data[\"digest\"],\n ];\n }\n\n return $rows;\n }",
"function makeMultiDimTable($array)\n {\n $totalkeys = 0;\n $totalvalues = 0;\n echo \"<table>\";\n echo \"<thead><tr><td>Keys</td><td>Values</td></tr></thead>\";\n echo \"<tbody>\";\n foreach($array as $key => $value)\n {\n echo \"<tr><td>\" . $key . \"</td><td>\" . $value . \"</td></tr>\";\n $totalkeys += $key;\n $totalvalues += $value;\n }\n echo \"<tr><td colspan=2>Totals</td></tr>\";\n echo \"<tr><td>\" . $totalkeys . \"</td><td>\" . $totalvalues . \"</td></tr>\";\n echo \"</tbody>\";\n }",
"public static function genarateTableFromArray($array)\r\n {\r\n if ($array != null) {\r\n $tableGen = '<table class=\"table table-hover\">';\r\n $tableGen .= \\utility\\htmlTableGeneratorHelper::getTableHead();\r\n $tableGen .= \\utility\\htmlTableGeneratorHelper::getTableBody($array);\r\n $tableGen .= '</table>';\r\n return $tableGen;\r\n }\r\n }",
"function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}",
"function formatReport($array,$string){\n\t\n\t\t$total = 0.0;\n\t\t$table = '<h3 class=\"text-success\">'. $string .'</h3>\n\t\t\t\t<table class=\"table table-striped table-hover\">\n\t\t\t\t<tHead>\n\t\t\t\t<tr>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Bill Description</th>\n\t\t\t\t<th>Bill Amount</th>\n\t\t\t\t<th>Bill Category</th>\n\t\t\t\t<th>Bill Date</th>\n\t\t\t\t</tr>\n\t\t\t\t</tHead>\n\t\t\t\t<tBody>';\n\t\tforeach ($array as $value){\n\t\t\t$total += floatval($value['BillAmount']);\n\t\t\t$shortDate = explode(\" \", $value['BillDate']);\n\t\t\t$shortDate = $shortDate[0];\n\t\t\t$table .= '<tr>\n\t\t\t\t\t<td>'. $value['FirstName'].' '.$value['LastName'] .'</td>\n\t\t\t\t\t<td>'. $value['BillDesc'] .'</td>\n\t\t\t\t\t<td>'. $value['BillAmount'] .'</td>\n\t\t\t\t\t<td>'. $value['BillCategory'] .'</td>\n\t\t\t\t\t<td>'. $shortDate .'</td>\n\t\t\t\t\t</tr>';\n\t\t}\n\t\t$table .= '\n\t\t\t\t<tr class=\"danger\">\n\t\t\t\t<td></td>\n\t\t\t\t<th class=\"text-right\">Total:</th><th>$'.$total.'</th><td></td><td></td>\n\t\t\t\t</tr>\n\t\t\t\t</tBody></table>';\n\t\n\t\treturn $table;\n\t}",
"public function do_review_logs($p_metadata, $p_messages) {\n\n if(empty($p_messages))\n {\n $m_string = 'No logs are stored at the moment.';\n }\n else\n {\n $i = 0;\n $arr[] = array();\n $tab_output = '<p class=\"lead\" id=\"ret_home\"><a href=\"homepage\">← Return Home</a></p>';\n $tab_output .= '\n <table id=\"table\" class=\"table table-bordered table-hover\">\n <thead>\n <tr>\n ';\n foreach ($p_metadata as $key1 => $value1) {\n $arr[$i] = $value1;\n $tab_output .= '<th scope=\"col\">'. $value1 .'</th>';\n $i++;\n }\n\n $tab_output .= '</tr></thead><tbody>';\n $i = 0;\n // $m_string = '';\n\n foreach ($p_messages as $key => $value) {\n $tab_output .= '<tr>';\n foreach ($value as $key2 => $value2){\n $tab_output .= '<td>' . $value2 . '</td>';\n $i++;\n }\n $tab_output .= '</tr>';\n $i = 0;\n }\n $tab_output .= '</tbody></table><br /><br />';\n }\n\n\n $this->c_review_logs = $tab_output;\n\n}",
"function createTable($array,$summary,$caption,$id='',$class='') {\n\tif(!is_array($array) || empty($summary) || empty($caption)) return false;\n\t\n\t$thead_text = '';\n\t$tbody_text = '';\n\n\t$header_total = count($array['header']);\n\tforeach($array['header'] as $key => $header) {\n\t\tif(!is_array($header)) $header = array('text' => $header);\n\t\t$thead_text .= '<th scope=\"col\"'.addAttributes(@$header['title'],$header['id'],@$header['class']).'>'.formatText($header['text']).'</th>'.\"\\n\";\n\t}\n\n\t$i=0;\n\tforeach($array['rows'] as $key => $row_array) {\n\t\t$tbody_row = '';\n\t\tif(empty($row_array['class'])) $row_array['class'] = array();\n\t\telseif(!is_array($row_array['class'])) $row_array['class'] = array($row_array['class']);\n\t\tif(!isEven($i)) $row_array['class'][] = 'odd';\n\n\t\tif(count($row_array['value'])!=$header_total) continue; // if the number of rows don't match header rows...\n\t\tforeach($row_array['value'] as $key => $row) {\n\t\t\tif(!is_array($row)) $row = array('text' => $row);\n\t\t\t$tbody_row .= '<td headers=\"'.$array['header'][$key]['id'].'\"'.addAttributes('',@$row['id'],@$row['class']).'>'.$row['text'].'</td>'.\"\\n\";\n\t\t}\n\t\t$tbody_text .= '<tr'.addAttributes('',@$row_array['id'],@$row_array['class']).'>'.\"\\n\".$tbody_row.'</tr>'.\"\\n\";\n\t\t$i++;\n\t}\n\tif(empty($tbody_text)) return false;\n\t\n\t$table = '<table summary=\"'.formatText($summary).'\"'.addAttributes('',$id,$class).'>\n\t\t<caption>'.formatText($caption).'</caption>\n\t\t<thead>'.\"\\n\".'<tr>'.\"\\n\".$thead_text.'</tr>'.\"\\n\".'</thead>\n\t\t<tbody>'.\"\\n\".$tbody_text.'</tbody>\n\t</table>'.\"\\n\";\n\t\n\treturn $table;\n}",
"public function format(array $record);",
"function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}",
"function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}",
"function table_from_array(&$data_array, $has_header = TRUE, $class = \"\", $id = \"\", $text_limit_to_trim = null) {\n if ((count($data_array) == 0) || (count(current($data_array)) == 0)) {\n trigger_error(\"Array to build HTML table is empty\", E_USER_NOTICE);\n return FALSE;\n }\n $table_object = new html_classes\\table($class, $id);\n\n foreach ($data_array as $row_index => $row_data) {\n if ($has_header && ($row_index === 0)) {\n $thead = $table_object->append_thead();\n $tr = $thead->append_tr();\n } else {\n if (!isset($tbody)) {\n $tbody = $table_object->append_tbody();\n }\n $tr = $tbody->append_tr();\n }\n foreach ($row_data as $col_index => $col_value) {\n if ($has_header && ($row_index === 0)) {\n $tr->append_th($col_value);\n } else {\n if (!is_object($col_value)) {\n if (is_numeric($col_value)) {\n if (is_float($col_value)) {\n $col_value = number_format($col_value, 2);\n } else {\n $col_value = number_format($col_value);\n }\n }\n if (is_numeric($text_limit_to_trim) && strlen($col_value) > $text_limit_to_trim) {\n $col_value = substr($col_value, 0, $text_limit_to_trim) . \"...\";\n }\n } else {\n if (is_numeric($text_limit_to_trim) && strlen($col_value->get_value()) > $text_limit_to_trim) {\n $col_value->set_value(substr($col_value->get_value(), 0, $text_limit_to_trim) . \"...\");\n }\n// d($col_value->get_value());\n }\n $tr->append_td($col_value);\n }\n }\n }\n// \\var_dump($table_object);\n return $table_object;\n}",
"function tabla01($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table id=\\\"one-column-emphasis\\\" >\\n\n <colgroup>\\n\n \t<col class=\\\"oce-first\\\" />\\n\n </colgroup>\\n\n <tbody>\\n\";\n\tforeach( $array01 as $key => $value){\n\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t}\n\t$array02[$i++] = \"</tbody>\\n</table>\\n\";\n\treturn $array02;\n/*\n<table id=\\\"one-column-emphasis\\\" >\n <colgroup>\n \t<col class=\\\"oce-first\\\" />\n </colgroup>\n <tbody>\n \t<tr>\n \t<td></td>\n </tr>\n </tbody>\n</table>\n*/\n}",
"function minitable($Array){\n\t$table='<table class=\"mini\">';\n\tforeach ($Array as $row=>$Cells){\n\t\t$table.='<tr>'.\"\\n\";\n\t\tforeach ($Cells as $column=>$value){\n\t\t\t$class=setclass($row,$column,$value);\n\t\t\t$value=htmlSafe($value);\n\t\t\tif (strlen($value)>1){$value=' ';}\n\t\t\tif (strlen($value)==0){$value='x';}\n\t\t\t$table.='<td class=\"'.$class.'\">'.$value.'</td>'.\"\\n\";\n\t\t}\n\t\t$table.='</tr>'.\"\\n\";\n\t}\n\t$table.='</table>';\n\treturn $table;\n}",
"public function asTable($data) {\n if (!$data || !is_array($data) || !count($data)) {\n return 'Sorry, no matching data was found';\n }\n $data = collect($data);\n\n // output data\n $table = $this->outputTable($data);\n return $table;\n }"
]
| [
"0.65297276",
"0.6490941",
"0.6431996",
"0.6400672",
"0.63214374",
"0.6296211",
"0.6182101",
"0.616411",
"0.61099964",
"0.60706335",
"0.6067402",
"0.6014219",
"0.59505486",
"0.5937535",
"0.59347945",
"0.5933795",
"0.59226716",
"0.5920495",
"0.5916568",
"0.59145445",
"0.59125537",
"0.5909196",
"0.59020346",
"0.590115",
"0.5887923",
"0.5887923",
"0.5858478",
"0.585683",
"0.58557427",
"0.58545595"
]
| 0.6824569 | 0 |
Format template information as table | function _notifications_content_test_format_template($parts) {
$rows = array();
$header = array('msgkey' => t('Key'), 'type' => t('Template'), 'method' => t('Method'), 'message' => t('Text'), 'language' => t('Language'), 'format' => t('Format'));
foreach ($parts as $key => $value) {
$row = array();
foreach (array_keys($header) as $field) {
$row[] = isset($value->$field) ? check_plain($value->$field) : '';
}
$rows[] = $row;
}
return theme('table', array('header' => $header, 'rows' =>$rows));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function set_template() {\n\t\t$table_open = $this->check_template(@$this->template->table_open, '<table border=\"1\">');\n\t\t$table_close = $this->check_template(@$this->template->table_close, '</table>');\n\t\t$thead_open = $this->check_template(@$this->template->thead_open, '<thead>');\n\t\t$thead_close = $this->check_template(@$this->template->thead_close, '</thead>');\n\t\t$tbody_open = $this->check_template(@$this->template->tbody_open, '<tbody>');\n\t\t$tbody_close = $this->check_template(@$this->template->tbody_close, '</tbody>');\n\t\t$tfoot_open = $this->check_template(@$this->template->tfoot_open, '<tfoot>');\n\t\t$tfoot_close = $this->check_template(@$this->template->tfoot_close, '</tfoot>');\n\t\t$tr_open = $this->check_template(@$this->template->tr_open, '<tr>');\n\t\t$tr_close = $this->check_template(@$this->template->tr_close, '</tr>');\n\n\t\t$table_structure = array(\n\t\t\t'table_open'=>$table_open,\n\t\t\t'table_close'=>$table_close,\n\t\t\t'thead_open'=>$thead_open,\n\t\t\t'thead_close'=>$thead_close,\n\t\t\t'tbody_open'=>$tbody_open,\n\t\t\t'tbody_close'=>$tbody_close,\n\t\t\t'tfoot_open'=>$tfoot_open,\n\t\t\t'tfoot_close'=>$tfoot_close,\n\t\t\t'tr_open'=>$tr_open,\n\t\t\t'tr_close'=>$tr_close\n\t\t);\n\t\t$table_structure = json_encode($table_structure);\n\t\t$table_structure = json_decode($table_structure);\n\n\t\treturn $table_structure;\n\t}",
"public static function buildTemplateTable()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t// Check if we're on the setup page in the Control Center\r\n\t\t$isSetupPage = (PAGE == self::CC_TEMPLATE_PAGE);\r\n\t\t// Store template projects in array\r\n\t\t$templateList = self::getTemplateList();\r\n\t\t// Initialize varrs\r\n\t\t$row_data = array();\r\n\t\t$headers = array();\r\n\t\t$i = 0;\r\n\t\t$textLengthTruncate = 230;\r\n\t\t// Loop through array of templates\r\n\t\tforeach ($templateList as $this_pid=>$attr)\r\n\t\t{\r\n\t\t\t// If not enabled yet, then do not display on Create Project page\r\n\t\t\tif (!$isSetupPage && !$attr['enabled']) continue;\t\t\r\n\t\t\t// If description is very long, truncate what is visible initially and add link to view entire text\r\n\t\t\tif (strlen($attr['description']) > $textLengthTruncate) {\r\n\t\t\t\t$textCutoffPosition = strrpos(substr($attr['description'], 0, $textLengthTruncate), \" \");\r\n\t\t\t\tif ($textCutoffPosition === false) $textCutoffPosition = $textLengthTruncate;\r\n\t\t\t\t$descr1 = substr($attr['description'], 0, $textCutoffPosition);\r\n\t\t\t\t$descr2 = substr($attr['description'], $textCutoffPosition);\r\n\t\t\t\t$attr['description'] = $descr1 . RCView::span('', \"... \") . \r\n\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;','style'=>'text-decoration:underline;font-size:10px;','onclick'=>\"$(this).prev('span').hide();$(this).hide().next('span').show();\"), \r\n\t\t\t\t\t\t\t\t\t\t\t$lang['create_project_94']\r\n\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\tRCView::span(array('style'=>'display:none;'), $descr2);\r\n\t\t\t}\r\n\t\t\t// Set radio button (create project page) OR edit/delete icons (control center)\r\n\t\t\tif ($isSetupPage) {\r\n\t\t\t\t$actionItem = \tRCView::a(array('href'=>'javascript:;','onclick'=>\"projectTemplateAction('prompt_addedit',$this_pid);\"), \r\n\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'pencil.png','title'=>$lang['create_project_90']))\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::a(array('style'=>'margin-left:3px;','href'=>'javascript:;','onclick'=>\"projectTemplateAction('prompt_delete',$this_pid);\"), \r\n\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'cross.png','title'=>$lang['create_project_93']))\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\t$actionItem = RCView::radio(array('name'=>'copyof','value'=>$this_pid));\r\n\t\t\t}\r\n\t\t\t// Add this project as a row\r\n\t\t\t$row_data[$i][] = $actionItem;\r\n\t\t\tif ($isSetupPage) {\r\n\t\t\t\t$row_data[$i][] = RCView::a(array('href'=>'javascript:;','onclick'=>\"projectTemplateAction('prompt_addedit',$this_pid);\"), \r\n\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>($attr['enabled'] ? 'star.png' : 'star_empty.png'),'title'=>$lang['create_project_90']))\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t}\r\n\t\t\t$row_data[$i][] = RCView::div(array('style'=>'color:#800000;padding:0;white-space:normal;word-wrap:normal;line-height:12px;'), $attr['title']);\r\n\t\t\t$row_data[$i][] = RCView::div(array('style'=>'padding:0;white-space:normal;word-wrap:normal;line-height:12px;'), $attr['description']);\r\n\t\t\t// Increment counter\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t// If no templates exist, then give message \r\n\t\tif (empty($row_data))\r\n\t\t{\r\n\t\t\t$row_data[$i][] = \"\";\r\n\t\t\tif ($isSetupPage) $row_data[$i][] = \"\";\r\n\t\t\t$row_data[$i][] = RCView::div(array('style'=>'padding:0;white-space:normal;word-wrap:normal;'), $lang['create_project_77']);\r\n\t\t\t$row_data[$i][] = \"\";\r\n\t\t}\r\n\t\t// \"Add templates\" button\r\n\t\t$addTemplatesBtn = ((SUPER_USER && !$isSetupPage)\r\n\t\t\t\t\t\t\t? \t// Create New Project page\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:right;padding:5px 0 0;'),\r\n\t\t\t\t\t\t\t\t\tRCView::button(array('class'=>'jqbuttonsm','style'=>'color:green;','onclick'=>\"window.location.href=app_path_webroot+'\".self::CC_TEMPLATE_PAGE.\"';return false;\"), \r\n\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'plus_small2.png')) . $lang['create_project_78']\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t: \r\n\t\t\t\t\t\t\t\t(!$isSetupPage ? \"\" : \r\n\t\t\t\t\t\t\t\t\t// Control Center\r\n\t\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:right;padding:0 200px 5px 0;'),\r\n\t\t\t\t\t\t\t\t\t\tRCView::button(array('class'=>'jqbuttonmed','style'=>'color:green;','onclick'=>\"projectTemplateAction('prompt_addedit')\"), \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'add.png','style'=>'vertical-align:middle')) . \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::span(array('style'=>'vertical-align:middle'), $lang['create_project_83'])\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t);\r\n\t\t// Width & height\r\n\t\t$width = 720;\r\n\t\t$height = ($isSetupPage) ? 500 : 200;\r\n\t\t// Set table headers and attributes\r\n\t\t// First column (radios or edit/delete icons)\r\n\t\t$headers[] = array(42, ($isSetupPage ? \"\" : RCView::div(array('style'=>'font-size:10px;padding:0;white-space:normal;word-wrap:normal;color:#777777;font-family:tahoma;line-height:10px;'), $lang['create_project_74'])), \"center\");\r\n\t\tif ($isSetupPage) {\r\n\t\t\t// Column for Enabled stars\r\n\t\t\t$headers[] = array(43, $lang['create_project_104'], 'center');\r\n\t\t}\r\n\t\t// Title column\r\n\t\t$headers[] = array(163, RCView::b($lang['create_project_73']) . RCView::SP . RCView::SP . RCView::SP . $lang['create_project_103']);\r\n\t\t// Discription column\r\n\t\t$headers[] = array(461 - ($isSetupPage ? 55 : 0), RCView::b($lang['create_project_69']));\r\n\t\t// Title\r\n\t\t$title = RCView::div(array('style'=>'float:left;padding:1px 0 12px 5px;font-weight:bold;'),\r\n\t\t\t\t\tRCView::span(array('style'=>'font-size:12px;color:#800000;'), \r\n\t\t\t\t\t\t($isSetupPage ? $lang['create_project_81'] : RCView::img(array('src'=>'star.png','class'=>'imgfix')) . $lang['create_project_66'])\r\n\t\t\t\t\t) . \r\n\t\t\t\t\t($isSetupPage ? '' : RCView::span(array('style'=>'font-weight:normal;margin-left:10px;'), $lang['create_project_65']))\r\n\t\t\t\t ) . \r\n\t\t\t\t $addTemplatesBtn;\r\n\t\t// Render table and return its html\r\n\t\treturn renderGrid(\"template_projects_list\", $title, $width, $height, $headers, $row_data, true, true, false);\r\n\t}",
"function listTemplate($headers)\n\t{\n\t\t$template = array(\n\t\t\t'table' => array(\n\t\t\t\t'\n\t<table>',\n\t\t\t\t'\n\t</table>'\n\t\t\t),\n\t\t\t'defRow' => array(\n\t\t\t\t'tr' => array(\n\t\t\t\t\t'\n\t\t<tr>',\n\t\t\t\t\t'\n\t\t</tr>'\n\t\t\t\t),\n\t\t\t\t'defCol' => array(\n\t\t\t\t\t'\n\t\t\t<td>\n\t\t\t\t',\n\t\t\t\t\t'\n\t\t\t</td>'\n\t\t\t\t)\n\t\t\t),\n\t\t\t0 => array(\n\t\t\t\t'defCol' => array(\n\t\t\t\t\t'\n\t\t\t<th>\n\t\t\t\t',\n\t\t\t\t\t'\n\t\t\t</th>'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\tforeach($headers as $index => $name)\n\t\t{\n\t\t\t$template[0][$index] = array(\n\t\t\t\t'\n\t\t\t<th id=\"table_' . $name . '\">\n\t\t\t\t',\n\t\t\t\t'\n\t\t\t</th>'\n\t\t\t);\n\t\t\t$template['defRow'][$index] = array(\n\t\t\t\t'\n\t\t\t<td headers=\"table_' . $name . '\">\n\t\t\t\t',\n\t\t\t\t'\n\t\t\t</td>'\n\t\t\t);\n\t\t}\n\t\treturn $template;\n\t}",
"public function get_cell_info($template) {\n $template['icon-css'] = 'icon-views ont-color-orange ont-icon-22';\n\t\t$template['preview-image-url'] = WPDDL_RES_RELPATH . '/images/post-content.png';\n\t\t$template['name'] = __('Content Template (custom fields, taxonomy and content)', 'ddl-layouts');\n\t\t$template['description'] = __('Display different fields of any page, post or custom type. This cell supports HTML for styling and shortcodes for the different fields.', 'ddl-layouts');\n\t\t$template['button-text'] = __('Assign Content Template Box', 'ddl-layouts');\n\t\t$template['dialog-title-create'] = __('Create a new Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-title-edit'] = __('Edit Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-template'] = $this->_dialog_template();\n\t\t$template['category'] = __('Post display', 'ddl-layouts');\n\t\treturn $template;\n\t}",
"function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}",
"function renderTableTemplate()\n {\n\n global $wpdb;\n\n $query = \"SELECT * FROM \" . $wpdb->prefix . \"posts WHERE post_type='flamingo_inbound' and post_title LIKE '%-%-%'\";\n\n $data = $wpdb->get_results($query);\n\n // Header frame.\n echo '\n\t\t\t<div class=\"limiter\">\n\t\t\t\t<div class=\"container-table100\">\n\t\t\t\t\t<div class=\"wrap-table100\">\n\t\t\t\t\t\t<div class=\"table100\">\n\t\t\t\t\t\t\t<table class=\"birthday-table\">\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr class=\"table100-head\">\n\t\t\t\t\t\t\t\t\t\t<th class=\"column1\">Username</th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"column2\">Birthday Date</th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"column3\">Age</th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"column3\">Days to birthdate</th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"column3\">Contact</th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"column4\">Joined at</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody class=\"birthday-table-body\">';\n\n // Join together all query's data into an array of multiples arrays for each customer.\n $data_array = parseUsersInfo($data);\n\n $users_data_array = addAgeAndDaysToBirthdate($data_array);\n\n // Sort the multidimensional array.\n usort($users_data_array, 'compareDates');\n\n foreach ($users_data_array as &$users_info) {\n renderTableData($users_info);\n }\n\n // Footer frame.\n echo '\n \t\t\t\t\t\t</tbody>\n \t\t\t\t\t</table>\n \t\t\t\t</div>\n \t\t\t</div>\n \t\t</div>\n \t</div>';\n }",
"function formatTags($leadTemplate,$tabMode=\"_self\") {\n\tglobal $communityPaths;\n\n\t$file = readJsonFile($communityPaths['community-templates-info']);\n\t$template = $file[$leadTemplate];\n\t$childTemplates = $file[$leadTemplate]['BranchID'];\n\tif ( ! is_array($childTemplates) )\n\t\t$o = \"Something really went wrong here\";\n\telse {\n\t\t$defaultTag = $template['BranchDefault'] ? $template['BranchDefault'] : \"latest\";\n\t\t$o = \"<table>\";\n\t\t$o .= \"<tr><td> </td><td><a href='/Apps/AddContainer?xmlTemplate=default:\".$template['Path'].\"' target='$tabMode'>Default</a></td><td>Install Using The Template's Default Tag (<font color='purple'>:$defaultTag</font>)</td></tr>\";\n\t\tforeach ($childTemplates as $child) {\n\t\t\t$o .= \"<tr><td> </td><td><a href='/Apps/AddContainer?xmlTemplate=default:\".$file[$child]['Path'].\"' target='$tabMode'>\".$file[$child]['BranchName'].\"</a></td><td>\".$file[$child]['BranchDescription'].\"</td></tr>\";\n\t\t}\n\t\t$o .= \"</table>\";\n\t}\n\treturn $o;\n}",
"public function print_template()\n {\n }",
"public function print_template()\n {\n }",
"function tableTemplate($results, $headers){\n ?>\n <div class= \"row justify-content-center\">\n <table class=\"table\">\n <thead>\n <tr>\n <?php\n $i = 0;\n while($i<sizeof($headers)){\n echo \"<th>$headers[$i]</th>\";\n $i = $i+1;\n }\n echo \"<th>Action</th>\"\n ?>\n </tr>\n </thead>\n <?php\n while ($row = mysqli_fetch_assoc($results)):\n echo \"<tr>\";\n $i = 0;\n while($i<sizeof($headers)){\n $temp = $row[$headers[$i]];\n echo \"<td>$temp</td>\";\n $i = $i+1;\n }?>\n <td>\n <a href=\"edit_template.php?edit=<?php echo $row['Player_ID'] ?>&table=<?php echo $_GET['del'] ?>\"\n class=\"btn btn-info\">EDIT</a>\n\n <a href=\"process.php?delete=<?php echo $row['Player_ID'] ?>&table=<?php echo $_GET['del'] ?>\"\n class=\"btn btn-danger\">DELETE</a>\n\n\n </td>\n </tr>\n <?php endwhile; ?>\n </table>\n </div>\n <?php\n }",
"public function template();",
"public final function print_template()\n {\n }",
"public function print_templates()\n {\n }",
"protected function parseTHs(XTemplate $xtpl){\n\t\n\t\t$ths = $this->tableModel->getEncabezados();\n\t\t$count = count($ths);\n\t\tfor($index=0;$index<$count;$index++) {\n\t\t\t$encabezado = $ths[$index]['encabezado'];\n\t\t\t//$width = $this->tableModel->getColumnWidth($index)*10;\n\t\t\t$this->parseTH( $xtpl, $encabezado);\n\t\t}\n\t\t\n\t}",
"function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }",
"public function display_usertemplates_table() {\n global $CFG, $USER, $OUTPUT;\n\n require_once($CFG->libdir.'/tablelib.php');\n\n $candownloadutemplates = has_capability('mod/surveypro:downloadusertemplates', $this->context);\n $candeleteutemplates = has_capability('mod/surveypro:deleteusertemplates', $this->context);\n\n // Begin of: $paramurlbase definition.\n $paramurlbase = array();\n $paramurlbase['id'] = $this->cm->id;\n // End of $paramurlbase definition.\n\n $deletetitle = get_string('delete');\n $iconparams = ['title' => $deletetitle];\n $deleteicn = new \\pix_icon('t/delete', $deletetitle, 'moodle', $iconparams);\n\n $importtitle = get_string('exporttemplate', 'mod_surveypro');\n $iconparams = ['title' => $importtitle];\n $importicn = new \\pix_icon('t/download', $importtitle, 'moodle', $iconparams);\n\n $table = new \\flexible_table('templatelist');\n\n $paramurl = ['id' => $this->cm->id];\n $baseurl = new \\moodle_url('/mod/surveypro/utemplate_manage.php', $paramurl);\n $table->define_baseurl($baseurl);\n\n $tablecolumns = array();\n $tablecolumns[] = 'templatename';\n $tablecolumns[] = 'sharinglevel';\n $tablecolumns[] = 'timecreated';\n $tablecolumns[] = 'actions';\n $table->define_columns($tablecolumns);\n\n $tableheaders = array();\n $tableheaders[] = get_string('templatename', 'mod_surveypro');\n $tableheaders[] = get_string('sharinglevel', 'mod_surveypro');\n $tableheaders[] = get_string('timecreated', 'mod_surveypro');\n $tableheaders[] = get_string('actions');\n $table->define_headers($tableheaders);\n\n $table->sortable(true, 'templatename'); // Sorted by templatename by default.\n $table->no_sorting('actions');\n\n $table->column_class('templatename', 'templatename');\n $table->column_class('sharinglevel', 'sharinglevel');\n $table->column_class('timecreated', 'timecreated');\n $table->column_class('actions', 'actions');\n\n $table->set_attribute('id', 'managetemplates');\n $table->set_attribute('class', 'generaltable');\n $table->setup();\n\n $options = $this->get_sharinglevel_options();\n\n $templates = new \\stdClass();\n foreach ($options as $sharinglevel => $unused) {\n $parts = explode('_', $sharinglevel);\n $contextlevel = $parts[0];\n\n $contextid = $this->get_contextid_from_sharinglevel($sharinglevel);\n $contextstring = $this->get_contextstring_from_sharinglevel($contextlevel);\n $templates->{$contextstring} = $this->get_available_templates($contextid);\n }\n\n $virtualtable = $this->get_virtual_table($templates, $table->get_sql_sort());\n\n $row = 0;\n foreach ($templates as $contextstring => $contextfiles) {\n foreach ($contextfiles as $xmlfile) {\n $tablerow = array();\n\n $xmlfileid = $virtualtable[$row]['xmlfileid'];\n $templatename = $virtualtable[$row]['templatename'];\n $tmpl = new usertemplate_name($xmlfileid, $templatename);\n\n $tablerow[] = $OUTPUT->render_from_template('core/inplace_editable', $tmpl->export_for_template($OUTPUT));\n $tablerow[] = $virtualtable[$row]['sharinglevel'];\n $tablerow[] = userdate($virtualtable[$row]['creationdate']);\n\n $paramurlbase['fid'] = $virtualtable[$row]['xmlfileid'];\n $row++;\n\n $icons = '';\n // SURVEYPRO_DELETEUTEMPLATE.\n if ($candeleteutemplates) {\n if ($xmlfile->get_userid() == $USER->id) { // Only the owner can delete his/her template.\n $paramurl = $paramurlbase;\n $paramurl['act'] = SURVEYPRO_DELETEUTEMPLATE;\n $paramurl['sesskey'] = sesskey();\n\n $link = new \\moodle_url('/mod/surveypro/utemplate_manage.php', $paramurl);\n $icons .= $OUTPUT->action_icon($link, $deleteicn, null, ['title' => $deletetitle]);\n }\n }\n\n // SURVEYPRO_EXPORTUTEMPLATE.\n if ($candownloadutemplates) {\n $paramurl = $paramurlbase;\n $paramurl['act'] = SURVEYPRO_EXPORTUTEMPLATE;\n $paramurl['sesskey'] = sesskey();\n\n $link = new \\moodle_url('/mod/surveypro/utemplate_manage.php', $paramurl);\n $icons .= $OUTPUT->action_icon($link, $importicn, null, ['title' => $importtitle]);\n }\n\n $tablerow[] = $icons;\n\n $table->add_data($tablerow);\n }\n }\n $table->set_attribute('align', 'center');\n $table->summary = get_string('templatelist', 'mod_surveypro');\n $table->print_html();\n }",
"function table_specific_links($table, $template = ''){\n\t\tif(isset($box->template)){\n\t\t\tswitch ($box->template){\n\t\t\t\tcase \"Annotation_Headings\":\n\t\n\t\t\t\t\t// IEA rows\n\t\t\t\t\t$rows = array();\n\t\t\t\t\t$tmp = explode(\"\\n|-\",$table);\n\t\t\t\t\tforeach ($tmp as $row){\n\t\t\t\t\t\tif (strpos($row,\"\\nIEA:\") > 0) $row = \"style='background:#ddffdd;' \".$row;\n\t\t\t\t\t\t$rows[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t$table = implode(\"\\n|-\",$rows);\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t} # end switch\t\n\t\t}\n\t\treturn $table;\n\t}",
"function template_manual()\n{\n\tglobal $context, $scripturl, $txt;\n\n\techo '<table width=\"100%\" height=\"50%\" bgcolor=\"#FFCC99\"><tr><td><b><center>', $context['viber_id'], '</center></b></td></tr></table>';\n}",
"function ReplaceContent( $data, $template_html )\n{\n foreach ( $data as $row )\n {\n //replace fields with values in template\n $content = $template_html;\n foreach($row as $field => $value)\n {\n $content = str_replace(\"@@$field@@\", $value, $content);\n\n }\n\n print $content;\n }\n}",
"protected function make_table_list($items_table=null, $items_list=null, $template_table=null, $template_list=null) {\n\t $toprint = null;\n\t\t$mytemplate_table = $this->select_template($template_table);\n\t\t$mytemplate_list = $this->select_template($template_list);\n\t\t$mytemplate_tablelist = $this->select_template('fpkatalog-grid-list');\n\t\t$tokens = array();\n\t\t\n if ($mytemplate_tablelist) { \n\t\t\n\t\t\t$table_token[] = (!empty($items_table)) ? implode('',$items_table) : null; \n\t\t\t//echo $table_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_table, $table_token);\n\n\t\t\t$list_token[] = (!empty($items_list)) ? implode('',$items_list) : null; \n\t\t\t//echo $list_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_list, $list_token);\n //print_r($tokens);\n\t\t\t$toprint = $this->combine_tokens($mytemplate_tablelist, $tokens);\n\t\t\t//echo $toprint;\n\t\t\tunset ($tokens);\n\t\t\tunset ($table_token);\n\t\t\tunset ($list_token);\n\t\t}\t\n return ($toprint); \t\t\n }",
"private function render_data()\n\t{\n\t\t// create if the headers exists\n\t\t// 2 header style table\n\t\tif(count($this->headers) == 2 && isset($this->headers[0][0]) && isset($this->headers[1][0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr><th></th>';\n\t\t\tforeach($this->headers[0] as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the row headers and the data\n\t\t\tfor($i=0; $i<count($this->headers[1]); $i++)\n\t\t\t{\n\t\t\t\t// the header\n\t\t\t\t$html .= \"<tr><th>{$this->headers[1][$i]}</th>\";\n\t\t\t\t\n\t\t\t\t// and now the data\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\t// 1 header style table\n\t\tif(count($this->headers) > 0 && isset($this->headers[0]) && !is_array($this->headers[0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr>';\n\t\t\tforeach($this->headers as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the data\n\t\t\tfor($i=0; $i<count($this->data); $i++)\n\t\t\t{\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\treturn '';\n\t}",
"function table($text) {\n\t\t$output = \"\";\n\t\tif (!empty($text)) {\n\t\t\t$output .= '<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">';\n\t\t\t$array = explode(\"\\n\", $text);\n\t\t\tfor ($i=0; $i<count($array); $i++) {\n\t\t\t\tif (!empty($array[$i])) {\n\t\t\t\t\t$row = explode(\":\", $array[$i], 2);\n\t\t\t\t\t$title = isset($row[0]) ? $row[0] : '';\n\t\t\t\t\t$data = isset($row[1]) ? $row[1] : '';\n\t\t\t\t\tif ($i%2 == 0) {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_a\"><td class=\"form_title\" width=\"30%\">'.$title.'</td><td bgcolor=\"#EBF1F6\" width=\"70%\">'.$data.'</td></tr>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_b\"><td class=\"form_title\">'.$title.'</td><td bgcolor=\"#FFFFFF\">'.$data.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</table>';\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function formatForeach(){\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+foreach \\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{foreach \\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach format error: The blank is not allowed with \\'}\\' near '.$matches[2].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+@key}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach @key format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{@key\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach @key format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+@value}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach @value format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{@value\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Foreach @value format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{foreach \\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\tif(!preg_match('/{\\/foreach}/', implode('\\n', $this->template))){\r\n\t\t\t\t\t$this->foreach_lines = ($k+1);\r\n\t\t\t\t\t$this->error_notice[($k+1)] = 'Foreach format error: The foreach tag is not close near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected function parseTable(&$template, $matches)\n {\n $tables = [];\n for ($i = 0; $i < count($matches[1]); $i ++) {\n $match = $matches[0][$i];\n $tag = $this->clean($matches[1][$i]);\n if ('TBL:' == substr($tag, 0, 4)) {\n $tags = explode(':', $tag, 3);\n $tables[$tags[1]] = [\n 'start' => $match,\n 'end' => null,\n 'expr' => $tags[2],\n 'content' => null\n ];\n }\n if ('TBLE:' == substr($tag, 0, 5)) {\n $tags = explode(':', $tag, 2);\n if (isset($tables[$tags[1]])) {\n $tables[$tags[1]]['end'] = $match;\n }\n }\n }\n $keys = array_keys($tables);\n for ($i = 0; $i < count($keys); $i ++) {\n if ($tables[$keys[$i]]['start'] && $tables[$keys[$i]]['end']) {\n // find table row begin \\trowd\n if (false !== ($s = strpos($template, $tables[$keys[$i]]['start']))) {\n $s = strrpos(substr($template, 0, $s - 1), '\\trowd ');\n }\n // find table row end \\row followed by \\pard\n if (false !== ($e = strpos($template, $tables[$keys[$i]]['end']))) {\n if (false !== ($e = strpos($template, '\\row ', $e))) {\n $e = strpos($template, '\\pard ', $e);\n }\n }\n if (is_int($s) && is_int($e)) {\n $header = substr($template, 0, $s);\n $content = substr($template, $s, $e - $s);\n $footer = substr($template, $e);\n $content = strtr($content, [\n $tables[$keys[$i]]['start'] => '',\n $tables[$keys[$i]]['end'] => ''\n ]);\n $tables[$keys[$i]]['content'] = $content;\n $template = $header.'%%TBL:'.$keys[$i].'%%'.$footer;\n }\n }\n }\n return $tables;\n }",
"function getTemplateData()\n\t{\n\t\t $sql=\"select templateid,templatename,gridcount from tb_template where status=1\";\n\t\t $res = mysql_query($sql);\n\t\t /** TEMPLATE COUNT **/\n\t\t $tempcount = mysql_num_rows($res);\n\t\t \n\t\t for($i=1;$i<=$tempcount;$i++)\n\t\t {\n\t\t $rows= mysql_fetch_assoc($res);\n\t\t /** TEMPLATE IDS **/\n\t\t $tempids[$i]=$rows['templateid'];\n\t\t /* TEMPLATE NAMES **/\n\t\t $tempnames[$i]=$rows['templatename'];\n\t\t /** RELATED GRID COUNT **/\n\t\t $gridcnt[$i]=$rows['gridcount']; \n\t\t \n\t\t }\n\t\t \n\t\t \n\t\t $returnstr=\"\";\n\t\t for($j=1;$j<= $tempcount;$j++)\n\t\t { \n\t\t $temp1[$j]= $tempids[$j].\",\".$tempnames[$j].\",\".$gridcnt[$j].\"#\";\n\t\t \t\n\t\t $sql2=\"select * from tb_grids where status=1 and templateid=\".$tempids[$j];// and gridId=\".$grid;\n\t\t\t\n\t\t $res2 = mysql_query($sql2);\n\t\t\t\n\t\t\t$temp2=\"\";\n\n\t\t \tfor($k=1;$k<=$gridcnt[$j];$k++)\n\t\t\t{\n\n\t\t \t$rows2 = mysql_fetch_assoc($res2);\n\t\t\t\t\t\n\t\t\t\t$temp2 = $temp2.$rows2['row'].\",\".$rows2['column'].\",\".$rows2['width'].\",\".$rows2['height'].\"#\";\n\t\t\t\t\t\n\t\t\t}\n\t\t $returnstr = $returnstr.$temp1[$j].$temp2.\":\";\n\t\t }\n\n\t\t return $returnstr;\n\t}",
"public function templateData() {\n return array();\n }",
"public static function nodeTableTemplate()\n\t{\n\t\treturn array( \\IPS\\Theme::i()->getTemplate( 'tables', 'core' ), 'nodeRows' );\n\t}",
"public function render()\n {\n $chromosome = explode(\",\", $this->timetable->chromosome);\n $scheme = explode(\",\", $this->timetable->scheme);\n $data = $this->generateData($chromosome, $scheme);\n\n $days = $this->timetable->days()->orderBy('id', 'ASC')->get();\n $timeslots = TimeslotModel::orderBy('rank', 'ASC')->get();\n $classes = CollegeClassModel::all();\n\n $tableTemplate = '<h3 class=\"text-center\">{TITLE}</h3>\n <div style=\"page-break-after: always\">\n <table class=\"table table-bordered\">\n <thead>\n {HEADING}\n </thead>\n <tbody>\n {BODY}\n </tbody>\n </table>\n </div>';\n\n $content = \"\";\n\n foreach ($classes as $class) {\n $header = \"<tr class='table-head'>\";\n $header .= \"<td>Days</td>\";\n\n foreach ($timeslots as $timeslot) {\n $header .= \"\\t<td>\" . $timeslot->time . \"</td>\";\n }\n\n $header .= \"</tr>\";\n\n $body = \"\";\n\n foreach ($days as $day) {\n $body .= \"<tr><td>\" . strtoupper($day->short_name) . \"</td>\";\n foreach ($timeslots as $timeslot) {\n if (isset($data[$class->id][$day->name][$timeslot->time])) {\n $body .= \"<td class='text-center'>\";\n $slotData = $data[$class->id][$day->name][$timeslot->time];\n $courseCode = $slotData['course_code'];\n $courseName = $slotData['course_name'];\n $professor = $slotData['professor'];\n $room = $slotData['room'];\n\n $body .= \"<span class='course_code'>{$courseCode}</span><br />\";\n $body .= \"<span class='room pull-left'>{$room}</span>\";\n $body .= \"<span class='professor pull-right'>{$professor}</span>\";\n\n $body .= \"</td>\";\n } else {\n $body .= \"<td></td>\";\n }\n }\n $body .= \"</tr>\";\n }\n\n $title = $class->name;\n $content .= str_replace(['{TITLE}', '{HEADING}', '{BODY}'], [$title, $header, $body], $tableTemplate);\n }\n\n $path = 'public/timetables/timetable_' . $this->timetable->id . '.html';\n Storage::put($path, $content);\n\n $this->timetable->update([\n 'file_url' => $path\n ]);\n }",
"function KandGExpFmtTemplate($template = \"None\") {\n switch ($template) {\n case \"Template_1\":\n $HdrAr = array(\n 'Letter', '#', 'Number', 'Real', 'Formula'\n );\n $HdrStyleAr = array(\n array(\n 'font' => array(\n 'bold' => true,\n 'size' => 11,\n 'name' => 'Palatino'\n )\n ),\n array(\n 'font' => array(\n 'bold' => true,\n 'size' => 12,\n 'name' => 'Palatino'\n )\n ),\n array(\n 'font' => array(\n 'bold' => true,\n 'size' => 13,\n 'name' => 'Palatino'\n )\n ),\n array(\n 'font' => array(\n 'bold' => true,\n 'size' => 14,\n 'name' => 'Palatino'\n )\n ),\n array(\n 'font' => array(\n 'bold' => true,\n 'size' => 15,\n 'name' => 'Palatino'\n )\n )\n );\n function Cmds_Template_1($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $d = \"D\";\n $objPHPExcel->getActiveSheet()->setCellValue('B18','=SUM(B2:B17)');\n $objPHPExcel->getActiveSheet()->setCellValue($d.'18','=SUM('.$d.'2:'.$d.'17)');\n }\n $Cmds = 'Cmds_Template_1';\n \n $styleAr1 = array(\n 'font' => array(\n 'bold' => true\n )\n );\n $styleAr2 = array(\n 'font' => array(\n 'bold' => true,\n 'color' => array('rgb' => 'FF0000'),\n 'size' => 15,\n 'name' => 'Palatino'\n )\n );\n $styleAr3 = array(\n 'font' => array(\n 'bold' => true,\n 'color' => array('rgb' => '614126'),\n 'size' => 15,\n 'name' => 'Palatino'\n )\n );\n $styleAr4 = array(\n 'font' => array(\n 'bold' => false,\n 'color' => array('rgb' => '614126')\n ),\n 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE\n );\n return array($HdrAr,$Cmds,True,$HdrStyleAr,$styleAr1,$styleAr2,$styleAr3,$styleAr4);\n break;\n case \"kLateInterestResults\":\n function kLateInterestResults_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $data_c = array(); // consolidated employer data\n $titles = $data[0];\n array_push($data_c, $data[1], $data[2], $data[3]); // 2nd, 3rd, 4th arrays\n $hdrs_c = array_slice($hdrs,0,3);\n $hdrs = array_slice ($hdrs, 3);\n\n $hdrs = MultiHdrAdjust($hdrs);\n $hdrs_c = MultiHdrAdjust($hdrs_c);\n $hdr_offset = $hdrs[0];\n $hdr_offset_c = $hdrs_c[0];\n\n array_shift($hdrs);\n array_shift($hdrs_c);\n array_splice($data,0,4);\n\n // $data[4] = array_map('DateStrToTimeStamp', $data[4]); // convert datestring->UNIX timestamp->Excel Serial Number Format for Dates\n // $data[5] = array_map('DateStrToTimeStamp', $data[5]);\n // $data[6] = array_map('DateStrToTimeStamp', $data[6]);\n\n // array_multisort($data[2], SORT_ASC, $data[1], SORT_NUMERIC, SORT_ASC, $data[0], SORT_ASC, $data[4], SORT_NUMERIC, SORT_ASC, $data[3], $data[5], $data[6], $data[7], $data[8], $data[9])\n // by employer name, emp #, pcpt name, and then date paid\n array_multisort( $data[1], SORT_NUMERIC, SORT_ASC, $data[0], SORT_ASC, $data[4], SORT_NUMERIC, SORT_ASC, $data[2], $data[3], $data[5], $data[6], $data[7], $data[8], $data[9]);\n // by emp #, pcpt name, and then date paid\n\n $data = ShiftDataArrays($data);\n $ar_emp = $data_c[0];\n // array_multisort($data_c[1], SORT_ASC, $data_c[0], $data_c[2]);\n // by emp name\n\n array_multisort($data_c[0], SORT_NUMERIC, SORT_ASC, $data_c[1], $data_c[2]);\n // by emp #\n $data_c = ShiftDataArrays ($data_c);\n\n $BoldTitle = array(\n 'font' => array(\n 'bold' => true,\n 'size' => 14));\n\n $BoldItalic = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT\n ),\n 'font' => array(\n 'bold' => true,\n 'italic' => true));\n\n $BotBorder = array(\n 'borders' => array(\n 'bottom' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN)));\n\n $Horiz_Center = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ));\n\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('A',$x,$y).NewChar('1',$x,$y),$titles[0]); // set 1st title \n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar('1',$x,$y))->applyFromArray($BoldTitle); // Format Title\n $objPHPExcel->getActiveSheet()->fromArray($hdrs_c, null, NewChar('B',$x,$y).NewChar('4',$x,$y),true); // consolidated hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y).':')->applyFromArray($BotBorder); // Format Title\n\n $objPHPExcel->getActiveSheet()->fromArray($data_c, null, NewChar('B',$x,$y).NewChar(strval(5+$hdr_offset_c),$x,$y),true); // consolidated emp data\n $consdatastrt = intval(NewChar('5',$x,$y)); \n $ttlrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y));\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($consdatastrt),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($ttlrow),$x,$y))->applyFromArray($Horiz_Center); // format emp #\n $consdataend = $ttlrow+1;\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('C',$x,$y).strval($ttlrow+1),'Totals');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).strval($ttlrow+1))->applyFromArray($BoldItalic); // Bold Italic\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('D',$x,$y).strval($ttlrow+1),'=SUM('.NewChar('D',$x,$y).NewChar(strval(5+$hdr_offset_c),$x,$y).':'.NewChar('D',$x,$y).strval($ttlrow).')'); // calculate sum formula for cons. amt due\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).strval($ttlrow))->applyFromArray($BotBorder); \n $ttlrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y)) + 3;\n \n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('A',$x,$y).NewChar(strval($ttlrow),$x,$y),$titles[1]); // set 2nd title\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow),$x,$y))->applyFromArray($BoldTitle); // Format Title\n $objPHPExcel->getActiveSheet()->fromArray($hdrs, null, NewChar('A',$x,$y).NewChar(strval($ttlrow+3),$x,$y),true); // main data hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y).':'.NewChar('J',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y))->applyFromArray($BotBorder); \n $objPHPExcel->getActiveSheet()->fromArray($data, null, NewChar('A',$x,$y).NewChar(strval($ttlrow+4+$hdr_offset),$x,$y),true); // main data\n $datarow = $ttlrow+4+$hdr_offset; \n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar('4',$x,$y).':'.NewChar('D',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y))->applyFromArray($Horiz_Center); // align emp headers\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y));\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow+3),$x,$y).':'.NewChar('J',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y))->applyFromArray($Horiz_Center); // align data headers\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($ttlrow+4),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Horiz_Center); // align text data 'B'\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('E',$x,$y).NewChar(strval($ttlrow+4),$x,$y).':'.NewChar('G',$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Horiz_Center); // align text data, 'E-G'\n\n foreach ($ar_emp as $emp) {\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('B',$x,$y));\n $RangeAr = CompactRangeArray($objPHPExcel->getActiveSheet()->rangeToArray(NewChar('B',$x,$y).strval($datarow).':'.NewChar('B',$x,$y).NewChar(strval($lastrow),$x,$y)));\n $keys = array_keys($RangeAr,$emp); // assuming data is already sorted by emp\n $low = min($keys); // get rows w/ emp\n $high = max($keys);\n\n $range = $high-$low+1;\n $high2+=$range+2;\n\n $objPHPExcel->getActiveSheet()->insertNewRowBefore($datarow+$high+1,2);\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('C',$x,$y).strval($datarow+$high+1),'Totals');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).strval($datarow+$high+1))->applyFromArray($BoldItalic); // Bold Italic\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('D',$x,$y).strval($datarow+$high+1),'=SUM('.NewChar('D',$x,$y).strval($datarow+$low).':'.NewChar('D',$x,$y).strval($datarow+$high).')'); // set emp late deferr total\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).strval($datarow+$high))->applyFromArray($BotBorder); // Format Total\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('J',$x,$y).strval($datarow+$high+1),'=SUM('.NewChar('J',$x,$y).strval($datarow+$low).':'.NewChar('J',$x,$y).strval($datarow+$high).')'); // set emp amt due total \n $objPHPExcel->getActiveSheet()->getStyle(NewChar('J',$x,$y).strval($datarow+$high))->applyFromArray($BotBorder); // Format Total\n }\n\n $dataend = $datarow+$high2-1;\n\n // Formats\n // $ signs and red negative values\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($consdatastrt),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($ttlrow),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-'); // cons data amt due\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('H',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('H',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('I',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('I',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('J',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('J',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n\n for ($char='E'; $char <= 'G'; $char++) { \n for ($i=$datarow; $i<($dataend+1) ; $i++) { \n $value = $objPHPExcel->getActiveSheet()->getCell(NewChar($char,$x,$y).strval($i))->getValue();\n if (CheckDateFormat($value)) { // if parsable date format, convert to Excel Date\n $objPHPExcel->GetActiveSheet()->setCellValue(NewChar($char,$x,$y).strval($i), DateStrToTimeStamp($value));\n $objPHPExcel->GetActiveSheet()->getStyle(NewChar($char,$x,$y).strval($i))->getNumberFormat()->setFormatCode('mm/dd/y;;'); \n } else { // leave as text\n \n } \n }\n }\n\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(2).\"-\".NumToAlpha($dataColCount);\n $objPHPExcel->GetActiveSheet()->getColumnDimension('A')->setWidth(30);\n for ($i = 2; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n }\n $objPHPExcel->GetActiveSheet()->setSelectedCell('A1'); \n }\n\n $Cmds = 'kLateInterestResults_Template';\n\n return array($HdrAr,$Cmds,False,$HdrStyleAr);\n break;\n case \"kLateInterestResults_Cml\":\n function kLateInterestResults_Cml_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $data_c = array(); // consolidated employer data\n $titles = $data[0];\n array_push($data_c, $data[1], $data[2], $data[3]); // 2nd, 3rd, 4th arrays\n $hdrs_c = array_slice($hdrs,0,3);\n $hdrs = array_slice ($hdrs, 3);\n\n $hdrs = MultiHdrAdjust($hdrs);\n $hdrs_c = MultiHdrAdjust($hdrs_c);\n $hdr_offset = $hdrs[0];\n $hdr_offset_c = $hdrs_c[0];\n\n array_shift($hdrs);\n array_shift($hdrs_c);\n array_splice($data,0,4); // titles and consolidated arrays\n\n // array_multisort($data[2], SORT_ASC, $data[1], SORT_NUMERIC, SORT_ASC, $data[0], SORT_ASC, $data[4], SORT_NUMERIC, SORT_ASC, $data[3], $data[5], $data[6], $data[7], $data[8], $data[9], $data[10], $data[11]);\n // by emp name, emp #, pcpt name, date paid\n\n array_multisort($data[1], SORT_NUMERIC, SORT_ASC, $data[0], SORT_ASC, $data[4], SORT_NUMERIC, SORT_ASC, $data[2], $data[3], $data[5], $data[6], $data[7], $data[8], $data[9], $data[10], $data[11]);\n // by emp #, pcpt name, date paid\n\n $data = ShiftDataArrays($data);\n // $ar_emp = $data_c[1];\n $ar_emp = $data_c[0];\n // array_multisort($data_c[1], SORT_ASC, $data_c[0], $data_c[2]);\n // by emp name\n\n array_multisort($data_c[0], SORT_NUMERIC, SORT_ASC, $data_c[1], $data_c[2]);\n // by emp name\n\n $data_c = ShiftDataArrays ($data_c);\n\n $BoldTitle = array(\n 'font' => array(\n 'bold' => true,\n 'size' => 14));\n\n $BoldItalic = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT\n ),\n 'font' => array(\n 'bold' => true,\n 'italic' => true));\n\n $BotBorder = array(\n 'borders' => array(\n 'bottom' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN)));\n\n $Horiz_Center = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ));\n\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('A',$x,$y).NewChar('1',$x,$y),$titles[0]); // set 1st title \n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar('1',$x,$y))->applyFromArray($BoldTitle); // Format Title\n $objPHPExcel->getActiveSheet()->fromArray($hdrs_c, null, NewChar('B',$x,$y).NewChar('4',$x,$y),true); // consolidated hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y).':')->applyFromArray($BotBorder); // Format Title\n\n $objPHPExcel->getActiveSheet()->fromArray($data_c, null, NewChar('B',$x,$y).NewChar(strval(5+$hdr_offset_c),$x,$y),true); // consolidated emp data\n $consdatastrt = intval(NewChar('5',$x,$y)); \n $ttlrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y));\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($consdatastrt),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($ttlrow),$x,$y))->applyFromArray($Horiz_Center); // format emp #\n $consdataend = $ttlrow+1;\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('C',$x,$y).strval($ttlrow+1),'Totals');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).strval($ttlrow+1))->applyFromArray($BoldItalic); // Bold Italic\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('D',$x,$y).strval($ttlrow+1),'=SUM('.NewChar('D',$x,$y).NewChar(strval(5+$hdr_offset_c),$x,$y).':'.NewChar('D',$x,$y).strval($ttlrow).')'); // calculate sum formula for cons. amt due\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).strval($ttlrow))->applyFromArray($BotBorder); \n $ttlrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y)) + 3;\n\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('A',$x,$y).NewChar(strval($ttlrow),$x,$y),$titles[1]); // set 2nd title\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow),$x,$y))->applyFromArray($BoldTitle); // Format Title\n $objPHPExcel->getActiveSheet()->fromArray($hdrs, null, NewChar('A',$x,$y).NewChar(strval($ttlrow+3),$x,$y),true); // main data hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y).':'.NewChar('L',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y))->applyFromArray($BotBorder); \n $objPHPExcel->getActiveSheet()->fromArray($data, null, NewChar('A',$x,$y).NewChar(strval($ttlrow+4+$hdr_offset),$x,$y),true); // main data\n $datarow = $ttlrow+4+$hdr_offset; \n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar('4',$x,$y).':'.NewChar('D',$x,$y).NewChar(strval(4+$hdr_offset_c),$x,$y))->applyFromArray($Horiz_Center); // align emp headers\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('C',$x,$y));\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($ttlrow+3),$x,$y).':'.NewChar('L',$x,$y).NewChar(strval($ttlrow+3+$hdr_offset),$x,$y))->applyFromArray($Horiz_Center); // align data headers\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($ttlrow+4),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Horiz_Center); // align text data 'B'\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('E',$x,$y).NewChar(strval($ttlrow+4),$x,$y).':'.NewChar('G',$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Horiz_Center); // align text data, 'E-G'\n\n foreach ($ar_emp as $emp) {\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('B',$x,$y));\n $RangeAr = CompactRangeArray($objPHPExcel->getActiveSheet()->rangeToArray(NewChar('B',$x,$y).strval($datarow).':'.NewChar('B',$x,$y).NewChar(strval($lastrow),$x,$y)));\n $keys = array_keys($RangeAr,$emp); // assuming data is already sorted by emp\n $low = min($keys); // get rows w/ emp\n $high = max($keys);\n\n $range = $high-$low+1;\n $high2+=$range+2;\n\n $objPHPExcel->getActiveSheet()->insertNewRowBefore($datarow+$high+1,2);\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('C',$x,$y).strval($datarow+$high+1),'Totals');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).strval($datarow+$high+1))->applyFromArray($BoldItalic); // Bold Italic\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('D',$x,$y).strval($datarow+$high+1),'=SUM('.NewChar('D',$x,$y).strval($datarow+$low).':'.NewChar('D',$x,$y).strval($datarow+$high).')'); // set emp late deferr total\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).strval($datarow+$high))->applyFromArray($BotBorder); // Format Total\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('J',$x,$y).strval($datarow+$high+1),'=SUM('.NewChar('J',$x,$y).strval($datarow+$low).':'.NewChar('J',$x,$y).strval($datarow+$high).')'); // set emp amt due total \n $objPHPExcel->getActiveSheet()->getStyle(NewChar('J',$x,$y).strval($datarow+$high))->applyFromArray($BotBorder); // Format Total\n $objPHPExcel->getActiveSheet()->setCellValue(NewChar('L',$x,$y).strval($datarow+$high+1),'=SUM('.NewChar('L',$x,$y).strval($datarow+$low).':'.NewChar('L',$x,$y).strval($datarow+$high).')'); // set emp amt due total \n $objPHPExcel->getActiveSheet()->getStyle(NewChar('L',$x,$y).strval($datarow+$high))->applyFromArray($BotBorder); // Format Total\n }\n\n $dataend = $datarow+$high2-1;\n\n // Formats\n // $ signs and red negative values\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($consdatastrt),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($ttlrow),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-'); // cons data amt due\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('H',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('H',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('I',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('I',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('J',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('J',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('K',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('K',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('L',$x,$y).NewChar(strval($datarow),$x,$y).':'.NewChar('L',$x,$y).NewChar(strval($dataend),$x,$y))->getNumberFormat()->setFormatCode('\"$\"#,##0.00_-;[Red]-\"$\"#,##0.00_-;\"$\"#,##0.00_-');\n\n for ($char='E'; $char <= 'G'; $char++) { \n for ($i=$datarow; $i<($dataend+1) ; $i++) { \n $value = $objPHPExcel->getActiveSheet()->getCell(NewChar($char,$x,$y).strval($i))->getValue();\n if (CheckDateFormat($value)) { // if parsable date format, convert to Excel Date\n $objPHPExcel->GetActiveSheet()->setCellValue(NewChar($char,$x,$y).strval($i), DateStrToTimeStamp($value));\n $objPHPExcel->GetActiveSheet()->getStyle(NewChar($char,$x,$y).strval($i))->getNumberFormat()->setFormatCode('mm/dd/y;;'); \n } else { // leave as text\n \n } \n }\n }\n\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(2).\"-\".NumToAlpha($dataColCount);\n $objPHPExcel->GetActiveSheet()->getColumnDimension('A')->setWidth(30);\n for ($i = 2; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n }\n $objPHPExcel->GetActiveSheet()->setSelectedCell('A1'); \n }\n\n $Cmds = 'kLateInterestResults_Cml_Template';\n return array($HdrAr,$Cmds,False,$HdrStyleAr);\n break;\n\n case \"YTD_Contributions\":\n $HdrAr = array();\n $HdrStyleAr = array();\n function YTD_Contributions_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n var_dump($hdrs);\n $data[1] = array_map('DateStrToTimeStamp', $data[1]); // convert datestring->UNIX timestamp->Excel Serial Number Format for Dates\n array_unshift($data, $hdrs);\n $objPHPExcel->getActiveSheet()->fromArray($source, null, NumToAlpha($x_offset) . strval($y_offset), true); // hdrs + data\n\n $TopRow = array(\n 'borders' => array(\n 'bottom' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN\n )\n ),\n 'font' => array(\n 'color' => array('rgb' => '614126')\n )\n );\n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).':'.NewChar('F',$x,$y))->applyFromArray($TopRow); // Format Title\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(1).\"-\".NumToAlpha($dataColCount);\n for ($i = 1; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n } \n }\n $Cmds = 'YTD_Contributions_Template';\n return array($HdrAr,$Cmds,False,$HdrStyleAr);\n break;\n case \"BadCensusAdds\":\n function BadCensusAdds_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $hdrs2 = $hdrs; // copy and remove last 2 headers \n $data[8] = array_map('DateStrToTimeStamp', $data[8]); // convert datestring->UNIX timestamp->Excel Serial Number Format for Dates\n $data[11] = array_map('DateStrToTimeStamp', $data[11]); \n $data = ShiftDataArrays($data);\n $adj_hdrs = array();\n $adj_hdrs = MultiHdrAdjust($hdrs);\n $hdr_offset = $adj_hdrs[0];\n array_shift($adj_hdrs);\n // var_dump($adj_hdrs);\n\n $BoldCenter = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ),\n 'font' => array(\n 'size' => 12,\n 'bold' => true\n ));\n\n $BoldLeft = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT\n ),\n 'font' => array(\n 'size' => 12,\n 'bold' => true\n ));\n\n $CenterSize12 = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ),\n 'font' => array(\n 'size' => 12\n ));\n\n $LeftSize12 = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT\n ),\n 'font' => array(\n 'size' => 12\n ));\n\n $Size12 = array(\n 'font' => array(\n 'size' => 12\n ));\n\n $objPHPExcel->getActiveSheet()->fromArray($adj_hdrs, null, NewChar('A',$x,$y).NewChar('1',$x,$y),true); // hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar('1',$x,$y).':'.NewChar('A',$x,$y).NewChar('2'),$x,$y)->applyFromArray($BoldCenter);\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar('1',$x,$y).':'.NewChar('H',$x,$y).NewChar('2'),$x,$y)->applyFromArray($BoldLeft);\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('I',$x,$y).NewChar('1',$x,$y).':'.NewChar('I',$x,$y).NewChar('2'),$x,$y)->applyFromArray($BoldCenter);\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('J',$x,$y).NewChar('1',$x,$y).':'.NewChar('K',$x,$y).NewChar('2'),$x,$y)->applyFromArray($BoldLeft);\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('L',$x,$y).NewChar('1',$x,$y).':'.NewChar('L',$x,$y).NewChar('2'),$x,$y)->applyFromArray($BoldCenter);\n\n $objPHPExcel->getActiveSheet()->fromArray($data, null, NewChar('A',$x,$y).NewChar(strval(2+$hdr_offset),$x,$y),true); // data\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n for ($char='A'; $char <= 'L'; $char++) { \n switch ($char) {\n case ($char == 'A') || ($char == 'I') || ($char == 'L'):\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar('1',$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($CenterSize12);\n break;\n default:\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar('1',$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($LeftSize12);\n break;\n }\n }\n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('I',$x,$y).NewChar('1',$x,$y).':'.NewChar('I',$x,$y).NewChar(strval($lastrow),$x,$y))->getNumberFormat()->setFormatCode('mm/dd/y');\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('L',$x,$y).NewChar('1',$x,$y).':'.NewChar('L',$x,$y).NewChar(strval($lastrow),$x,$y))->getNumberFormat()->setFormatCode('mm/dd/y;;');\n\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n // $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n // $RangeAr = CompactRangeArray($objPHPExcel->getActiveSheet()->rangeToArray(NewChar('A',$x,$y).NewChar('1',$x,$y).':'.NewChar('A',$x,$y).NewChar(strval($lastrow),$x,$y)));\n \n // if ($high>$high2) {\n // $high = $high2;\n // } \n \n // $objPHPExcel->getActiveSheet()->insertNewRowBefore($high+2,2);\n // $objPHPExcel->getActiveSheet()->fromArray($hdrs2, null, NewChar('A',$x,$y).strval($high+2),true); // hdrs\n\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(1).\"-\".NumToAlpha($dataColCount);\n for ($i = 1; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n }\n $objPHPExcel->GetActiveSheet()->setSelectedCell('A1'); \n } \n $Cmds = 'BadCensusAdds_Template';\n return array($HdrAr,$Cmds,False,$HdrStyleAr);\n break;\n\n case \"BadCensusDOBs\":\n function BadCensusDOBs_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $hdrs3 = $hdrs;\n $hdrs2 = array_slice($hdrs,0,3);\n array_push($hdrs2, $hdrs[4]);\n $hdrs = array_slice($hdrs, 0, 3);\n\n $data[10] = array_map('DateStrToTimeStamp', $data[10]); // convert datestring->UNIX timestamp->Excel Serial Number Format for Dates\n\n $data1 = array();\n $data2 = array();\n $data3 = array();\n array_push($data1, $data[0], $data[1], $data[2]);\n array_push($data2, $data[3], $data[4], $data[5], $data[6]);\n array_push($data3, $data[7], $data[8], $data[9], $data[10], $data[11]);\n $bool1 = True;\n $bool2 = True;\n $bool3 = True;\n\n if (count($data[0])==1 & $data[0][0]==\"\") {\n $bool1 = False;\n }\n\n if (count($data[3])==1 & $data[3][0]==\"\") {\n $bool2 = False;\n }\n\n if (count($data[7])==1 & $data[7][0]==\"\") {\n $bool3 = False;\n }\n\n $data1 = ShiftDataArrays($data1);\n $data2 = ShiftDataArrays($data2);\n $data3 = ShiftDataArrays($data3);\n\n $BoldCenter = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ),\n 'font' => array(\n 'size' => 12,\n 'bold' => true\n ));\n\n $BoldLeft = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT\n ),\n 'font' => array(\n 'size' => 12,\n 'bold' => true\n ));\n\n $CenterSize12 = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n ),\n 'font' => array(\n 'size' => 12\n ));\n\n $LeftSize12 = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT\n ),\n 'font' => array(\n 'size' => 12\n ));\n\n $Size12 = array(\n 'font' => array(\n 'size' => 12\n ));\n \n\n if ($bool1) {\n $adj_hdrs = array();\n $adj_hdrs = MultiHdrAdjust($hdrs);\n $hdr_offset = $adj_hdrs[0];\n array_shift($adj_hdrs);\n\n $objPHPExcel->getActiveSheet()->fromArray($adj_hdrs, null, NewChar('A',$x,$y).NewChar('1',$x,$y),true); // hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar('1',$x,$y).':'.NewChar('A',$x,$y).NewChar('1'),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar('1',$x,$y).':'.NewChar('B',$x,$y).NewChar('1'),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).NewChar('1',$x,$y).':'.NewChar('C',$x,$y).NewChar('1'),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n\n $objPHPExcel->getActiveSheet()->fromArray($data1, null, NewChar('A',$x,$y).NewChar(strval(2+$hdr_offset),$x,$y),true); // data\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n for ($char='A'; $char <= 'C'; $char++) {\n switch ($char) {\n case ($char == 'B'):\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($CenterSize12);\n\n break;\n default:\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Size12);\n break;\n }\n }\n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($lastrow),$x,$y))->getNumberFormat()->setFormatCode('000000000');\n \n }\n else {\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n }\n\n if ($bool2) {\n $adj_hdrs = array();\n $adj_hdrs = MultiHdrAdjust($hdrs2);\n $hdr_offset = $adj_hdrs[0];\n array_shift($adj_hdrs);\n\n $objPHPExcel->getActiveSheet()->fromArray($adj_hdrs, null, NewChar('A',$x,$y).NewChar(strval($lastrow+2),$x,$y),true); // hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('A',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('C',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n\n $objPHPExcel->getActiveSheet()->fromArray($data2, null, NewChar('A',$x,$y).NewChar(strval($lastrow+3),$x,$y),true); // 2nd data\n\n $firstrow = $lastrow+4;\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n for ($char='A'; $char <= 'D'; $char++) { \n switch ($char) {\n case ($char == 'B') || ($char == 'D') :\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($CenterSize12);\n\n break;\n default:\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Size12);\n break;\n }\n }\n }\n else {\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n }\n\n if ($bool3) {\n $adj_hdrs = array();\n $adj_hdrs = MultiHdrAdjust($hdrs3);\n $hdr_offset = $adj_hdrs[0];\n array_shift($adj_hdrs);\n\n $objPHPExcel->getActiveSheet()->fromArray($adj_hdrs, null, NewChar('A',$x,$y).NewChar(strval($lastrow+2),$x,$y),true); // hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('E',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('A',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('A',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('B',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('B',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('C',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('C',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldLeft); // format hdrs\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($lastrow+2),$x,$y).':'.NewChar('E',$x,$y).NewChar(strval($lastrow+2)),$x,$y)->applyFromArray($BoldCenter); // format hdrs\n\n $objPHPExcel->getActiveSheet()->fromArray($data3, null, NewChar('A',$x,$y).NewChar(strval($lastrow+3),$x,$y),true); // 3rd data\n\n $firstrow = $lastrow+3;\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n for ($char='A'; $char <= 'E'; $char++) { \n switch ($char) {\n case ($char == 'B') || ($char == 'D') || ($char == 'E') :\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($CenterSize12);\n break;\n default:\n $objPHPExcel->getActiveSheet()->getStyle(NewChar($char,$x,$y).NewChar(strval(2+$hdr_offset),$x,$y).':'.NewChar($char,$x,$y).NewChar(strval($lastrow),$x,$y))->applyFromArray($Size12);\n break;\n }\n }\n\n $objPHPExcel->getActiveSheet()->getStyle(NewChar('D',$x,$y).NewChar(strval($firstrow),$x,$y).':'.NewChar('D',$x,$y).NewChar(strval($lastrow),$x,$y))->getNumberFormat()->setFormatCode('mm/dd/yyyy;;');\n }\n else {\n $lastrow = $objPHPExcel->getActiveSheet()->getHighestRow(NewChar('A',$x,$y));\n }\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(1).\"-\".NumToAlpha($dataColCount);\n for ($i = 1; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n } \n $objPHPExcel->GetActiveSheet()->setSelectedCell('A1'); \n } \n $Cmds = 'BadCensusDOBs_Template';\n return array($HdrAr,$Cmds,False,$HdrStyleAr);\n break;\n case \"Template_3\":\n break;\n default: // empty arrays (no headers, any formatting, no 'Cmds')\n $HdrAr = array();\n $HdrStyleAr = array();\n function Default_Template($objPHPExcel, $x = 1, $y = 1, $hdrs = array(), $data = array()) {\n $dataColCount = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); // # of data cols\n echo \"\\r\\nAuto Sizing Columns \".NumToAlpha(1).\"-\".NumToAlpha($dataColCount);\n for ($i = 1; $i <= $dataColCount; $i++) {\n $objPHPExcel->getActiveSheet()->getColumnDimension(NumToAlpha($i))->setAutoSize(true);\n } \n }\n $Cmds = 'Default_Template';\n return array($HdrAr,$Cmds,True,$HdrStyleAr);\n break;\n }\n }",
"public function format()\r\n {\r\n //$this->template=$this->viewModel->formatView();\r\n }"
]
| [
"0.69035006",
"0.6461349",
"0.63220006",
"0.6233582",
"0.6224716",
"0.6221344",
"0.61153215",
"0.6110357",
"0.61082923",
"0.6063199",
"0.6023027",
"0.60137963",
"0.60001534",
"0.5992872",
"0.5954115",
"0.59481657",
"0.5946101",
"0.5880612",
"0.58420336",
"0.58179057",
"0.58085734",
"0.5804826",
"0.5802599",
"0.57985103",
"0.5787874",
"0.5767587",
"0.57405764",
"0.5735924",
"0.5735704",
"0.5722156"
]
| 0.665865 | 1 |
Provides test data for hitItem() | public function seedHitItem()
{
// Id, Type, Expected, Exception
return array(
array(null, 'general', null, 'InvalidArgumentException'),
array('-1', null, null, 'UnexpectedValueException'),
array('-1', 'general', false, null),
array('1', 'general', true, null),
array('1', null, true, null)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetHit()\n {\n $key = \"unique\";\n $item = $this->cache->getItem($key);\n $item->set(\"content\");\n\n $res = $item->get();\n $this->assertNull($res, \"Should not be able to find a value\");\n\n $this->cache->save($item);\n $res = $item->get();\n $this->assertTrue(!is_null($res), \"Should have a value\");\n }",
"public function test_prepare_item() {}",
"public function testGetItem()\n {\n\n // Create item.\n $item = $this->__item();\n\n // Create text.\n $text = $this->__text($item);\n\n // Check ids.\n $this->assertEquals($text->getItem()->id, $item->id);\n\n }",
"public function testGetItem()\n {\n $item = $this->addItem();\n $this->assertEquals($item, $this->laracart->getItem($item->getHash()));\n }",
"public function testGetCollectionItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function hit();",
"public function testItemsProcFunc()\n {\n }",
"public function test_individual_item_is_displayed()\n {\n $response = $this->get(\"/item-detail/1\");\n $response->assertSeeInOrder(['<strong>Title :</strong>', '<strong>Category :</strong>', '<strong>Details :</strong>']);\n }",
"public function testGetCollectionItemSupply()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetCollectionItemSupplies()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetCollectionItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testData() {\n $subscription = $this->mockSubscription('[email protected]', (object) [\n 'fields' => [\n ['name' => 'FIRSTNAME'],\n ['name' => 'LASTNAME'],\n ],\n ]);\n\n // Test new item.\n list($cr, $api) = $this->mockProvider();\n $source1 = new ArraySource([\n 'firstname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source1);\n list($data, $fingerprint) = $cr->data($subscription, []);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n ], $data);\n\n // Test item with existing data.\n list($cr, $api) = $this->mockProvider();\n $source2 = new ArraySource([\n 'lastname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source2);\n list($data, $fingerprint) = $cr->data($subscription, $data);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n 'LASTNAME' => 'test',\n ], $data);\n }",
"public function testGetItemSubCategoryTags()\n {\n }",
"public function _testMultipleInventories()\n {\n\n }",
"public function getHit()\n {\n return $this->hit;\n }",
"public function testGetItems(): void\n {\n $array = $this->itemCollection->getItems();\n $this->assertInternalType('array', $array);\n $this->assertEmpty($array);\n\n $item = new Item(1, \"test\", 20);\n $item2 = new Item(2, \"test\", 20);\n $this->itemCollection->add($item);\n $this->itemCollection->add($item2, 5);\n\n $array = $this->itemCollection->getItems();\n\n $this->assertInternalType('array', $array);\n $this->assertEquals([\n $item,\n $item2\n ], $array);\n }",
"public function isHit()\n {\n return $this->hit;\n }",
"public function testGetItem()\n {\n $datastore = $this->container->get('datastore');\n $logger = $this->container->get('logger');\n\n $repo = $this->getMockBuilder(DataStoreRepository::class)\n ->setConstructorArgs([$datastore, $logger])\n ->getMock();\n\n $repo->method('getItem')\n ->will($this->returnValue([\n 'id' => 1,\n 'name' => 'Test',\n 'user_id' => 1,\n 'body' => 'Fixture'\n ]));\n\n $service = new Service($repo, $logger);\n $item = $service->getItem(1);\n\n $this->assertEquals($item->getName(), 'Test');\n $this->assertNotEquals($item->getUserId(), 2);\n }",
"public function testFindPageReturnsDataForExistingItemNumber()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', '1');\n\t\t$this->assertEquals('works', $json->name);\n\t}",
"public function testGetTimesheetItem() {\n\n\n $result = $this->timesheetDao->getTimesheetItem(1, 2);\n\n $this->assertEquals(3, count($result));\n\n $timesheetItem = $result[0];\n\n $this->assertEquals(\"2011-04-10\", $timesheetItem['date']);\n $this->assertEquals(1000, $timesheetItem['duration']);\n $this->assertEquals(\"Poor\", $timesheetItem['comment']);\n }",
"public function testGetPayItems()\n {\n }",
"public function testHasItem()\n {\n self::assertFalse($this->object->hasItem('test'));\n }",
"public function test_getItemCategoryTags() {\n\n }",
"public function testAggregatorItemFields() {\n $feed = Feed::create([\n 'title' => 'Drupal org',\n 'url' => 'https://www.drupal.org/rss.xml',\n ]);\n $feed->save();\n $item = Item::create([\n 'title' => 'Test title',\n 'fid' => $feed->id(),\n 'description' => 'Test description',\n ]);\n\n $item->save();\n\n // @todo Expand the test coverage in https://www.drupal.org/node/2464635\n\n $this->assertFieldAccess('aggregator_item', 'title', $item->getTitle());\n $this->assertFieldAccess('aggregator_item', 'langcode', $item->language()->getName());\n $this->assertFieldAccess('aggregator_item', 'description', $item->getDescription());\n }",
"public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }",
"public function testRequestItemId3()\n {\n $response = $this->get('/api/items/3');\n\n $response->assertStatus(200);\n }",
"public function hasItemdata(){\n return $this->_has(22);\n }",
"protected function setUp()\n {\n $this->item = new Item();\n }",
"public function testAggregatorItem() {\n /** @var \\Drupal\\aggregator\\Entity\\Item $item */\n $item = Item::load(1);\n $this->assertSame('1', $item->id());\n $this->assertSame('5', $item->getFeedId());\n $this->assertSame('This (three) weeks in Drupal Core - January 10th 2014', $item->label());\n $this->assertSame('larowlan', $item->getAuthor());\n $this->assertSame(\"<h2 id='new'>What's new with Drupal 8?</h2>\", $item->getDescription());\n $this->assertSame('https://groups.drupal.org/node/395218', $item->getLink());\n $this->assertSame('1389297196', $item->getPostedTime());\n $this->assertSame('en', $item->language()->getId());\n $this->assertSame('395218 at https://groups.drupal.org', $item->getGuid());\n\n }",
"public function test1()\n {\n $map = $this->dataLayer->tstTestMap1(100);\n $this->assertInternalType('array', $map);\n $this->assertCount(3, $map);\n $this->assertEquals(1, $map['c1']);\n $this->assertEquals(2, $map['c2']);\n $this->assertEquals(3, $map['c3']);\n }"
]
| [
"0.63430035",
"0.5992969",
"0.576574",
"0.5755124",
"0.5729514",
"0.5717957",
"0.5690432",
"0.5651367",
"0.55839455",
"0.55823",
"0.54106617",
"0.5354996",
"0.5327765",
"0.5317737",
"0.53120136",
"0.52924937",
"0.5286279",
"0.5265441",
"0.52643603",
"0.5225654",
"0.52075076",
"0.5184086",
"0.5181736",
"0.515875",
"0.51370734",
"0.51311624",
"0.51291144",
"0.51265323",
"0.5120709",
"0.5119903"
]
| 0.6477098 | 0 |
Provides test data for unlikeItem() | public function seedUnlikeItem()
{
// Id, Type, Expected, Exception
return array(
array('1', 'general', true, null)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_a_user_can_unlike_a_post(){\n \n //we have a signed in user\n \n //user likes the model\n $this->post->likes();\n\n $this->post->unlike();\n\n $this->assertFalse($this->post->isLiked());\n\n }",
"public function inListForItemNotContainedReturnsFalseDataProvider() {}",
"public function unlike() {\r\n return $this->setLike(false);\r\n }",
"function unlike($idevent) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/unlike\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}",
"function testAppreciatingNonperishableItem() {\n $items = array(new Item('Aged Brie', 2, 0));\n $gildedRose = new GildedRose($items);\n \n // check that item increases quality as expected\n $gildedRose->update_quality();\n $this->assertEquals(1, $items[0]->sell_in);\n $this->assertEquals(1, $items[0]->quality);\n\n // second iteration for assurance \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(2, $items[0]->quality);\n\n // ensure item does not degrade below a quality of 0\n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(3, $items[0]->quality);\n }",
"public function youCanOmitData()\n {\n // Arrange...\n $meta = [\n 'foo' => 'bar'\n ];\n\n // Act...\n $response = $this->responder->success( 200, $meta );\n\n // Assert...\n $this->assertEquals( $response->getStatusCode(), 200 );\n $this->assertContains( $meta, $response->getData( true ) );\n }",
"public function testHasItem()\n {\n self::assertFalse($this->object->hasItem('test'));\n }",
"public function unlike()\n {\n self::delete(\"photos/{$this->id}/like\");\n return true;\n }",
"function testNormalItem() {\n $items = array(new Item('Elixir of the Mongoose', 2, 5));\n $gildedRose = new GildedRose($items);\n \n // check that normal item degrades as expected\n $gildedRose->update_quality();\n $this->assertEquals(1, $items[0]->sell_in);\n $this->assertEquals(4, $items[0]->quality);\n\n // second iteration for assurance \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(3, $items[0]->quality);\n\n // now that item is expired, it should degrade twice as fast \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(1, $items[0]->quality);\n\n // ensure item does not degrade below a quality of 0\n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(0, $items[0]->quality);\n }",
"public function notSure() {\n return $this->randomItem(\n \"I'm not sure.\",\n \"I have absolutely no idea.\",\n \"Beats me!\",\n \"Um... good question!\"\n );\n }",
"function unlike( $aParams, $aaData = NULL )\n\t{\n if( count( $aParams ) < 1 ) {\n $this->errorMessage( 'Need a minimum of 1 parameter' );\n }\n\n // check we have data\n if( !array_key_exists('id',$_POST) OR intval($_POST['id']) == '' ){\n $this->errorMessage( 'Missing required data' );\n }\n if( !array_key_exists('type',$_POST) OR $_POST['type'] == '' ){\n $this->errorMessage( 'Missing required data' );\n }\n\n // get variables ready\n $post_type = $_POST['type'];\n $post_id = $_POST['id'];\n $like_account_user_id = $_SESSION['authi']['user_settings']['active_pet_id']['setting_int'];\n $like_dt = date( 'Y-m-d H:i:s' );\n\n // update relevant table\n switch( strtolower($post_type) ) {\n \n case 'text':\n case 'album':\n $sSQL = \"\n UPDATE posts\n SET post_likes = post_likes - 1\n WHERE post_type = '$post_type'\n AND post_id = $post_id\n LIMIT 1\n \";\n break;\n\n case 'photo':\n $sSQL = \"\n UPDATE photos\n SET photo_likes = photo_likes - 1\n WHERE photo_id = $post_id\n LIMIT 1\n \";\n break;\n\n } // end switch\n\n #echo $sSQL;\n\t\t$aaData = $this->oDB->upd($sSQL, '');\n\n\n // update like table\n $sSQL = \"\n DELETE FROM likes\n WHERE like_type = '$post_type'\n AND like_item_id = $post_id\n AND like_account_user_id = $like_account_user_id\n LIMIT 1\n \";\n #echo $sSQL;\n\t\t$aaData = $this->oDB->del($sSQL, '');\n\n // return like count\n $iLikeCount = appFunctions::getLikeCount( $post_type, $post_id );\n if( $iLikeCount == 1 ) {\n $aaResponse['mobile'] = \"$iLikeCount pet likes this\";\n $aaResponse['non-mobile'] = \"$iLikeCount pet likes this\";\n } else {\n $aaResponse['mobile'] = \"$iLikeCount pets like this\";\n $aaResponse['non-mobile'] = \"$iLikeCount pets like this\";\n }\n echo json_encode( $aaResponse );\n\n\t}",
"public function testProfilePrototypeDeleteLikes()\n {\n\n }",
"public function seedLikeItem()\n\t{\n\t\t// Id, Type, Expected, Exception\n\t\treturn array(\n\t\t\t\tarray(null, 'general', null, 'InvalidArgumentException'),\n\t\t\t\tarray('-1', null, null, 'UnexpectedValueException'),\n\t\t\t\tarray('-1', 'general', false, null),\n\t\t\t\tarray('1', 'general', true, null),\n\t\t\t\tarray('1', null, true, null)\n\t\t);\n\t}",
"public function test_individual_item_does_not_exist()\n {\n $response = $this->get(\"/item-detail/12\");\n $response->assertSeeText('Sorry! the item you are looking for does not exist');\n }",
"public function testItemWithIdShouldNotBeConsideredNew()\n {\n $item = $this->createItem($this->faker->randomNumber());\n $this->assertFalse($item->isNew());\n }",
"public function testUnArchivedItem() {\n\n $response = $this->request('GET', $this->getURIData($this->TEST_BOARD_HASH));\n\n $body = (string) $response->getBody();\n $json = json_decode($body, true);\n\n $this->assertArrayHasKey(\"stacks\", $json);\n $this->assertIsArray($json[\"stacks\"]);\n\n foreach($json[\"stacks\"] as $stack){\n $this->assertIsArray($stack);\n $this->assertArrayHasKey(\"cards\", $stack);\n\n foreach($stack[\"cards\"] as $card){\n $this->assertIsArray($card);\n $this->assertArrayHasKey(\"id\", $card);\n $this->assertArrayHasKey(\"title\", $card);\n\n if($card[\"title\"] == $this->TEST_CARD_TITLE){\n $this->assertEquals(0, $card[\"archive\"]);\n }\n }\n }\n }",
"private function unlike($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'],FILTER_SANITIZE_STRING) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n \n if(!empty($user_id)){\n $check = $this->Common_model->fetch_data('user_likes','id',array('where' => array('user_id' => $user_id,'liked_by' => $valid['VALUE']['user_id'], \"status\" => ACTIVE)),TRUE);\n if(empty($check)){\n //YOU HAVE ALREADY LIKED THIS USER\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = ALREADY_REG_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('NOT_LIKED');\n $this->response($errorMsgArr);\n }\n \n $this->Common_model->delete_data('user_likes',array('where' => array('id' => $check['id'])));\n //FETCH TOTAL LIKE COUNT\n $totalcount = $this->Common_model->fetch_count(\"user_likes\", array('where' => array(\"user_id\" => $user_id)));\n \n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE']['count']= $totalcount;\n $this->response($errorMsgArr);\n }else{\n //PARAM MISSING\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = PARAM_MISSING_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('PARAM_MISSING');\n $this->response($errorMsgArr);\n }\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \n }",
"public function testRequestItemsUnavailable()\n {\n $response = $this->get('/api/items/unavailable');\n\n $response->assertStatus(200);\n }",
"function testGetNotReviewed()\n {\n $events = $this->GroupEvent->getNotReviewed(1);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), array(1, 2));\n\n //Test invalid event\n $events = $this->GroupEvent->getNotReviewed(999);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), null);\n }",
"public function unlike(){\n $this->likes()->where([\n 'user_id' => auth()->id()\n ])->delete();\n }",
"public function unlike() {\n\n $review = Input::get('review');\n\n if (!$review == \"\") {\n\n DB::table('review_likes')\n ->where('review_id', $review)\n ->where('user_id', Auth::user()->id)\n ->delete();\n }\n }",
"public function testRemoveMulti()\n {\n $data = static::articleData();\n\n $result = Hash::remove($data, '{n}.Article.title');\n $this->assertFalse(isset($result[0]['Article']['title']));\n $this->assertFalse(isset($result[1]['Article']['title']));\n\n $result = Hash::remove($data, '{n}.Article.{s}');\n $this->assertFalse(isset($result[0]['Article']['id']));\n $this->assertFalse(isset($result[0]['Article']['user_id']));\n $this->assertFalse(isset($result[0]['Article']['title']));\n $this->assertFalse(isset($result[0]['Article']['body']));\n\n $data = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 1 => ['Item' => ['id' => 2, 'title' => 'second']],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 3 => ['Item' => ['id' => 4, 'title' => 'fourth']],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n\n $result = Hash::remove($data, '{n}.Item[id=/\\b2|\\b4/]');\n $expected = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n $this->assertEquals($expected, $result);\n\n $data[3]['testable'] = true;\n $result = Hash::remove($data, '{n}[testable].Item[id=/\\b2|\\b4/].title');\n $expected = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 1 => ['Item' => ['id' => 2, 'title' => 'second']],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 3 => ['Item' => ['id' => 4], 'testable' => true],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n $this->assertEquals($expected, $result);\n }",
"public function unlike()\n {\n $this->likes()->where('user_id', auth()->id())->delete();\n }",
"public function unlike(\\Tuiter\\Models\\User $user,\\Tuiter\\Models\\Post $post):bool{\n $unLike=new \\Tuiter\\Models\\Like($post->getPostId(),$user->getUserId());\n if(!($this->likeExist($unLike))){\n return false;\n }\n $delete=$this->collection->deleteOne(array(\n 'likeId'=>$unLike->getLikeId()\n ));\n return true;\n }",
"public function get_unapproved_items() {\n return $this->query(\"SELECT * FROM `items` where NOT `approved` order by `premium` desc, `date`\");\n }",
"public function testItemWithoutIdShouldBeConsideredNew()\n {\n $item = $this->createItem();\n $this->assertTrue($item->isNew());\n }",
"public function testRemoveItem()\n {\n $item = $this->addItem();\n\n $this->laracart->removeItem($item->getHash());\n\n $this->assertEmpty($this->laracart->getItem($item->getHash()));\n }",
"public function test_a_user_can_toggle_posts(){\n \n //we have a signed in user\n \n //user likes the model\n $this->post->toggle();\n\n $this->assertTrue($this->post->isLiked());\n\n $this->post->toggle();\n\n $this->assertFalse($this->post->isLiked());\n }",
"public function test_delete_item() {}",
"public function test_delete_item() {}"
]
| [
"0.6417109",
"0.6229207",
"0.61902153",
"0.6169059",
"0.6122437",
"0.5884274",
"0.57652605",
"0.5702579",
"0.5654182",
"0.5523077",
"0.5488421",
"0.5474613",
"0.546825",
"0.5446482",
"0.5399812",
"0.53208387",
"0.53045857",
"0.52853745",
"0.52605337",
"0.5243584",
"0.524099",
"0.52352303",
"0.52339846",
"0.51441795",
"0.51359457",
"0.513497",
"0.5127213",
"0.51099426",
"0.5109567",
"0.5109567"
]
| 0.68747056 | 0 |
Provides test data for deleteList() | public function seedDeleteList()
{
// Type, Expected, Exception
return array(
array('general', 0, null),
array(null, null, 'UnexpectedValueException'),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFetchList() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t\n\t\t// Fetch the list\n\t\t$listCopy = $jsonpad->fetchList($listData[\"name\"]);\n\t\t$this->assertSame($list->getName(), $listCopy->getName());\n\t\t\n\t\t// Delete the list\n\t\t$listCopy->delete();\n\t}",
"public function testWebinarPanelistsDelete()\n {\n }",
"public function testWebinarPanelistDelete()\n {\n }",
"public function test_delete_item() {}",
"public function test_delete_item() {}",
"public function testDeleteSuppliersUsingDELETE()\n {\n }",
"public function testFetchLists() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a couple of lists\n\t\t$listCount = 3;\n\t\tfor ($i = 0; $i < $listCount; $i++) {\n\t\t\t$listData = parent::_createTestListData(false, false);\n\t\t\t$jsonpad->createList($listData[\"name\"]);\n\t\t}\n\t\t\n\t\t// Fetch the lists\n\t\t$total = 0;\n\t\t$lists = $jsonpad->fetchLists(1, null, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $lists);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\ItemList\", $lists[0]);\n\t\t\n\t\t// Delete the lists\n\t\tforeach ($lists as $list) {\n\t\t\t$list->delete();\n\t\t}\n\t}",
"private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }",
"public function testDelete()\n {\n }",
"public function testDeleteServiceData()\n {\n\n }",
"public function testDestroyData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // destroy the data by id\n $store->destroy($id);\n\n // get the rest of data after destroy\n $rest_of_items = $store->read();\n\n // since our data is only one (no data left) the results must be === 0\n $this->assertEquals(0, count($rest_of_items));\n }",
"public function deleteList($data)\n {\n var_export($data);\n //return new ApiProblem(405, 'The DELETE method has not been defined for collections');\n }",
"public function testDeleteBatch()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }",
"public function seedDeleteItem()\n\t{\n\t\t// Id, Type, Expected, Exception\n\t\treturn array(\n\t\t\t\tarray('1', 'general', '1', null),\n\t\t\t\tarray(null, 'general', null, 'InvalidArgumentException'),\n\t\t\t\tarray('1', null, true, null),\n\t\t\t\tarray('-1', null, null, 'UnexpectedValueException'),\n\t\t\t\tarray('-1', 'general', false, null)\n\t\t);\n\t}",
"public function testDelete()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testRemoveListSuccessfully(): void\n {\n $this->createMailchimpList($list);\n\n $this->delete(\\sprintf('/mailchimp/lists/%s', $list['list_id']));\n\n $this->assertResponseOk();\n self::assertEmpty(\\json_decode($this->response->content(), true));\n }",
"public function testDeletePermissionSet()\n {\n }",
"public function testStoreDelete()\n {\n\n }",
"public function testDeleteSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$mocks = [\n\t\t\t'components' => [\n\t\t\t\t'Security',\n\t\t\t]\n\t\t];\n\t\t$this->generateMockedController($mocks);\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'vars',\n\t\t];\n\t\t$this->testAction('/admin/logs/delete/2', $opt);\n\t\t$this->checkFlashMessage(__('The log record has been deleted.'));\n\n\t\t$result = $this->Controller->Log->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }",
"public function tearDown(): void\n {\n /** @var Mailchimp $mailChimp */\n $mailChimp = $this->app->make(Mailchimp::class);\n\n foreach ($this->createdListIds as $listId) {\n // Delete list on MailChimp after test\n $mailChimp->delete(\\sprintf('lists/%s', $listId));\n }\n\n parent::tearDown();\n }",
"public function testDeleteOrder()\n {\n }",
"public function testCanDelete()\n {\n self::$apcu = [];\n $this->sut->add('myKey', 'myValue');\n $this->assertTrue($this->sut->delete('myKey'));\n $this->assertCount(0, self::$apcu);\n }",
"public function testDeleteSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/admin/deferred/delete/2';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been deleted.'));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"protected function tearDown()\n\t{\n\t\t$this->object->DeleteList(array(array(\"objectId\", \">\", 0)));\n\t\tunset($this->object);\n\t}",
"public function testDeleteTimesheetItems() {\n $deleted = $this->timesheetDao->deleteTimesheetItems(2, 1, 1, 1);\n $this->assertTrue($deleted);\n }",
"public function testDelete_Multi()\n {\n \t$this->conn->delete('test', array('status'=>'ACTIVE'), DB::MULTIPLE_ROWS);\n \t$result = $this->conn->query(\"SELECT * FROM test\");\n \t$this->assertEquals(array(3, 'three', 'another row', 'PASSIVE'), $result->fetchOrdered());\n \t$this->assertNull($result->fetchOrdered());\n }",
"public function testCompanyConfigurationsStatusesIdDelete()\n {\n\n }",
"function deleteDataInfo()\n {\n $formPost=array();\n $formPost[deleted]=1;\n \n foreach($this->piVars['selectionList'] as $idVal)\n {\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery($this->tableName,'uid='.$idVal,$formPost);\n }\n return $this->showListings();\n }"
]
| [
"0.6827508",
"0.6819238",
"0.6784634",
"0.6687292",
"0.6687292",
"0.660787",
"0.656904",
"0.6501135",
"0.649941",
"0.6469645",
"0.64224976",
"0.6409896",
"0.63950765",
"0.6326235",
"0.6296645",
"0.62827826",
"0.62773657",
"0.6275371",
"0.6203269",
"0.61882216",
"0.61827624",
"0.6167591",
"0.6134518",
"0.61337215",
"0.6118911",
"0.6108797",
"0.6088433",
"0.6048168",
"0.6019409",
"0.6018004"
]
| 0.72155136 | 0 |
Provides test data for unmap() | public function seedUnmap()
{
// Tag, C1, C2, $Expected, Exception
return array(
// OK
array('tag', 1, 4, true),
// OK without type
array(null, 1, 4, true),
// Bad request
array('tag', 'foo', 5, false),
// No type exception
array(null, 1, 7, null, true),
// No type exception
array(null, 1, null, null, true)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }",
"public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }",
"abstract protected function unSerializeData();",
"public function test2()\n {\n $rows = $this->dataLayer->tstTestMap1(0);\n $this->assertInternalType('array', $rows);\n $this->assertCount(0, $rows);\n }",
"abstract protected function getTestData() : array;",
"public function testOffsetUnset()\n\t{\n\t\tunset($this->instance[2]);\n\n\t\t$this->assertNull($this->instance[2]);\n\t}",
"protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }",
"public function getDataMapper() {}",
"public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }",
"public function testMap() {\n $data = array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'null' => null,\n 'array' => array(),\n 'number' => 123\n );\n\n $this->assertEquals(array(\n 'foo' => 'BAR',\n 'boolean' => true,\n 'null' => null,\n 'array' => array(),\n 'number' => 123\n ), Hash::map($data, 'strtoupper'));\n\n $this->assertEquals(array(\n 'foo' => 0,\n 'boolean' => 1,\n 'null' => 0,\n 'array' => array(),\n 'number' => 123\n ), Hash::map($data, 'intval'));\n\n $this->assertEquals(array(\n 'foo' => 'string',\n 'boolean' => 'true',\n 'null' => 'null',\n 'array' => array(),\n 'number' => 'number'\n ), Hash::map($data, function($value) {\n if (is_numeric($value)) {\n return 'number';\n } elseif (is_bool($value)) {\n return $value ? 'true' : 'false';\n } elseif (is_null($value)) {\n return 'null';\n } elseif (is_string($value)) {\n return 'string';\n } else {\n return $value;\n }\n }));\n }",
"public function testOffsetUnset()\n {\n $struct = $this->_newStruct();\n $this->assertTrue($struct->offsetExists('foo'));\n $struct->offsetUnset('foo');\n $this->assertFalse($struct->offsetExists('foo'));\n }",
"public function setUp()\n {\n $this->strPathToOutputData = create_temp_directory(__CLASS__);\n $this->strTmpDumpFile = \"DumpFile.tmp\";\n $this->strPathToData = test_data_path(\"andorra\", \"mif\", \"gis_osm_places_free_1.mif\");\n $this->strPathToStandardData = \"./data/testcase/\";\n $this->bUpdate = false;\n $this->iSpatialFilter[0] = 1.4; /*xmin*/\n $this->iSpatialFilter[1] = 42.4; /*ymin*/\n $this->iSpatialFilter[2] = 1.6; /*xmax*/\n $this->iSpatialFilter[3] = 42.6; /*ymax*/\n\n OGRRegisterAll();\n\n $this->hOGRSFDriver = OGRGetDriverByName(\"MapInfo File\");\n $this->assertNotNull(\n $this->hOGRSFDriver,\n \"Could not get MapInfo File driver\"\n );\n\n $this->hSrcDataSource = OGR_Dr_Open(\n $this->hOGRSFDriver,\n $this->strPathToData,\n $this->bUpdate\n );\n $this->assertNotNull(\n $this->hSrcDataSource,\n \"Could not open datasource \" . $this->strPathToData\n );\n\n $this->hLayer = OGR_DS_GetLayer($this->hSrcDataSource, 0);\n $this->assertNotNull($this->hLayer, \"Could not open source layer\");\n }",
"protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }",
"protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }",
"public function tearDown(): void\n {\n $this->schema($this->schemaName)->drop('users');\n $this->schema($this->schemaName)->drop('emails');\n $this->schema($this->schemaName)->drop('phones');\n $this->schema($this->schemaName)->drop('role_users');\n $this->schema($this->schemaName)->drop('roles');\n $this->schema($this->schemaName)->drop('permission_roles');\n $this->schema($this->schemaName)->drop('permissions');\n $this->schema($this->schemaName)->drop('tasks');\n $this->schema($this->schemaName)->drop('locations');\n $this->schema($this->schemaName)->drop('assignments');\n $this->schema($this->schemaName)->drop('jobs');\n\n Relation::morphMap([], false);\n\n parent::tearDown();\n }",
"public function unFilterData($type, $data, $key = null)\n {\n $tmp = unserialize($data, ['allowed_classes' => false]);\n if ($tmp === false) {\n $tmp = unserialize(utf8_decode($data), ['allowed_classes' => false]);\n }\n if ($tmp === false) {\n return [];\n }\n if ($key !== null) {\n $tmp = $tmp[$key];\n }\n $map = $this->getMapping($type);\n if ($map === false) {\n return $tmp;\n }\n foreach ($map as $from => $to) {\n if (isset($tmp[$from])) {\n $tmp[$to] = $tmp[$from];\n unset($tmp[$from]);\n }\n }\n\n return $tmp;\n }",
"public function readTestData()\n {\n return $this->testData->get();\n }",
"public function testPreprocessingUnrotate()\n {\n }",
"abstract public function getTestData(): array;",
"protected function xxxtearDown(): void\n {\n // reduce memory usage\n\n // get all properties of self\n $refl = new \\ReflectionObject($this);\n foreach ($refl->getProperties() as $prop) {\n // if not phpunit related or static\n if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) {\n // make accessible and set value to to free memory\n $prop->setAccessible(true);\n $prop->setValue($this, null);\n }\n }\n //echo 'post reduce memory usage: '.sprintf('%.2fM', memory_get_usage(true)/1024/1024);\n\n parent::tearDown();\n }",
"public static function clear()\n {\n self::$map = array();\n }",
"public function testDirtyUnset()\n {\n $data = new ArrayObject(\n array(\n 'foo' => 'bar'\n )\n );\n\n $this->assertArrayHasKey('foo', $data);\n $this->assertFalse($data->isDirty());\n unset($data['foo']);\n $this->assertTrue($data->isDirty());\n }",
"private function mockedData()\n {\n $evens = [\n [3,9,10,6,7,8,1,5,2,4],\n [5,5,5,5],\n [4,5,5,3],\n [8,3,1,9,0,4]\n ];\n\n $odds = [\n [9,5,6],\n [0,5,7,8,4],\n [6,3,1,0,8,4,9]\n ];\n\n $invalids = [\n [],\n ['abcd_something_happenned'],\n ['a',5,'c',8],\n ['*','$','€'],\n [3,9,10,6,7,8,1,5,2,'*'],\n ];\n\n return (array) [\n 'evens' => $evens,\n 'odds' => $odds,\n 'invalids' => $invalids\n ];\n }",
"protected function tearDown()\n {\n $this->_filter = null; \n }",
"private function populateDummyTable() {}",
"public function tearDown() {\n\t\tunset($this->_userInfo);\n\n\t\tparent::tearDown();\n\t}",
"public function tearDown(){\n unset($this->user);\n unset($this->household);\n unset($this->unit);\n unset($this->qty);\n unset($this->category);\n unset($this->food);\n unset($this->ingredient);\n unset($this->recipe);\n unset($this->meal);\n unset($this->groceryItem);\n\n unset($this->userFty);\n unset($this->householdFty);\n unset($this->unitFty);\n unset($this->qtyFty);\n unset($this->categoryFty);\n unset($this->foodFty);\n unset($this->ingredientFty);\n unset($this->recipeFty);\n unset($this->mealFty);\n unset($this->groceryItemFty);\n }",
"protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }",
"public function testMap() {\n\t\t$array1 = array(1, 2, 3);\n\t\t$array2 = _::map($array1, function($value) {\n\t\t\treturn ($value * 2);\n\t\t});\n\t\t$this->assertEquals(2, $array2[0]);\n\t\t$this->assertEquals(4, $array2[1]);\n\t\t$this->assertEquals(6, $array2[2]);\n\n\t\t// test that we preserve keys\n\t\t$array1 = array('a' => 2, 'b' => 4, 'c' => 8);\n\t\t$array2 = _::map($array1, function($value) {\n\t\t\treturn ($value * $value);\n\t\t});\n\t\t$this->assertEquals(4, $array2['a']);\n\t\t$this->assertEquals(16, $array2['b']);\n\t\t$this->assertEquals(64, $array2['c']);\n\t}",
"public function test1()\n {\n $map = $this->dataLayer->tstTestMap1(100);\n $this->assertInternalType('array', $map);\n $this->assertCount(3, $map);\n $this->assertEquals(1, $map['c1']);\n $this->assertEquals(2, $map['c2']);\n $this->assertEquals(3, $map['c3']);\n }"
]
| [
"0.5596077",
"0.5259028",
"0.5095366",
"0.5088351",
"0.50788933",
"0.50708765",
"0.50271577",
"0.5004879",
"0.49857974",
"0.497552",
"0.49609914",
"0.49255309",
"0.49027058",
"0.48817956",
"0.4862551",
"0.48444387",
"0.48396802",
"0.48208186",
"0.4818125",
"0.48043028",
"0.47992095",
"0.4789506",
"0.47855487",
"0.47739744",
"0.47575173",
"0.47413066",
"0.4727298",
"0.47157854",
"0.4706045",
"0.4705996"
]
| 0.5626551 | 0 |
Login as task manager. | protected function loginAsTaskManager()
{
$user = factory(User::class)->create();
$user->assignRole('task-manager');
$this->actingAs($user);
View::share('user', $user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _login() {\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n $this->_connection->setUri( $this->_baseUrl . self::URL_LOGIN );\n $this->_connection->setParameterPost( array(\n 'login_username' => $this->_username,\n 'login_password' => $this->_password,\n 'back' => $this->_baseUrl,\n 'login' => 'Log In' ) );\n $this->_doRequest( Zend_Http_Client::POST );\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n throw new Opsview_Remote_Exception( 'Login failed for unknown reason' );\n }\n }\n }",
"public function executeLogin()\n {\n }",
"public function login() {\n return $this->run('login', array());\n }",
"public static function login()\n {\n //when you add the method you need to look at my find one, you need to return the user object.\n //then you need to check the password and create the session if the password matches.\n //you might want to add something that handles if the password is invalid, you could add a page template and direct to that\n //after you login you can use the header function to forward the user to a page that displays their tasks.\n // $record = accounts::findUser($_POST['email']);\n $user = accounts::findUserbyEmail($_REQUEST['email']);\n print_r($user);\n //$tasks = accounts::findTasksbyID($_REQUEST['ownerid']);\n // print_r($tasks);\n if ($user == FALSE) {\n echo 'user not found';\n } else {\n\n if($user->checkPassword($_POST['password']) == TRUE) {\n session_start();\n $_SESSION[\"userID\"] = $user->id;\n header(\"Location: index.php?page=tasks&action=all\");\n } else {\n echo 'password does not match';\n }\n }\n }",
"static public function signinAsTaskUser($configuration, $connectionName = 'doctrine')\n {\n // sfCacheSessionStorage generates warnings if this is unset\n if (!isset($_SERVER['REMOTE_ADDR']))\n {\n $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; \n }\n \n // Create the context\n sfContext::createInstance($configuration);\n \n // initialize the database connection\n $databaseManager = new sfDatabaseManager($configuration);\n $connection = $databaseManager->getDatabase($connectionName)->getConnection();\n \n // Fetch the task user, create if necessary\n $user = self::getTaskUser();\n \n // Sign in as the task user\n sfContext::getInstance()->getUser()->signin($user, false);\n }",
"public static function login()\n {\n (new Authenticator(request()))->login();\n }",
"public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}",
"private function doLogin()\n {\n if (!isset($this->token)) {\n $this->createToken();\n $this->redis->set('cookie_'.$this->token, '[]');\n }\n\n $loginResponse = $this->httpRequest(\n 'POST',\n 'https://sceneaccess.eu/login',\n [\n 'form_params' => [\n 'username' => $this->username,\n 'password' => $this->password,\n 'submit' => 'come on in',\n ],\n ],\n $this->token\n );\n\n $this->getTorrentsFromHTML($loginResponse);\n }",
"private function login(){\n \n }",
"function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}",
"private function login(): void\n {\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/login',\n ['json' => ['username' => $this->username, 'password' => $this->password]]\n )->then(function ($response) {\n $json = json_decode($response->getBody());\n $this->token = $json->access_token;\n });\n $promise->wait();\n } catch (RequestException $e) {\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }",
"public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }",
"public function login();",
"public function login();",
"public function login_anonymously()\n\t{\n\t\treturn $this->login();\n\t}",
"abstract protected function doLogin();",
"public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}",
"public function webtestLogin() {\n //$this->open(\"{$this->sboxPath}user\");\n $password = $this->settings->adminPassword;\n $username = $this->settings->adminUsername;\n // Make sure login form is available\n $this->waitForElementPresent('edit-submit');\n $this->type('edit-name', $username);\n $this->type('edit-pass', $password);\n $this->click('edit-submit');\n $this->waitForPageToLoad('30000');\n }",
"protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }",
"function login()\n\t{\n\t\t$url = $this->url;\n\t\t$url = $url . \"/oauth2/token\";\n\n\t\t$oauth2_token_parameters = array(\n\t\t\t\"grant_type\" => \"password\",\n\t\t\t\"client_id\" => \"sugar\",\n\t\t\t\"client_secret\" => \"\",\n\t\t\t\"username\" => $this->username,\n\t\t\t\"password\" => $this->password,\n\t\t\t\"platform\" => \"base\"\n\t\t);\n\n\t\t$oauth2_token_result = self::call($url, '', 'POST', $oauth2_token_parameters);\n\n\t\tif ( empty( $oauth2_token_result->access_token ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $oauth2_token_result->access_token;\n\t}",
"public function processLogin(): void;",
"public function attemptLogin($token);",
"public function login()\n {\n return Yii::$app->user->login($this);\n }",
"protected function loginToContentpool() {\n // Login as user.\n $element = $this->getSession()->getPage();\n $element->fillField($this->getDrupalText('username_field'), 'dru_admin');\n $element->fillField($this->getDrupalText('password_field'), 'changeme');\n $submit = $element->findButton($this->getDrupalText('log_in'));\n if (empty($submit)) {\n throw new ExpectationException(sprintf(\"No submit button at %s\", $this->getSession()\n ->getCurrentUrl()));\n }\n $submit->click();\n // Quick check that user was logged in successfully.\n $this->assertSession()->pageTextContains(\"Member for\");\n }",
"public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}",
"public function login(HostInterface $host);",
"function Login() {\n if($this->state!=\"AUTHORIZATION\")\n $this->AddError(\"connection is not in AUTHORIZATION state\");\n if($this->apop) :\n $this->POP3Command(\"APOP $this->user \".md5($this->greeting.$this->password),$this->dummy);\n else :\n $this->POP3Command(\"USER $this->user\",$this->dummy);\n $this->POP3Command(\"PASS $this->password\",$this->dummy);\n endif;\n $this->state=\"TRANSACTION\";\n }",
"public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }",
"private function login(): void\r\n {\r\n $crawler = $this->client->request('GET', self::URL_BASE.'Home/Login');\r\n $form = $crawler->selectButton('Login')->form();\r\n $this->client->submit(\r\n $form,\r\n ['EmailAddress' => $this->username, 'Password' => $this->password]\r\n );\r\n }",
"function mint_login($session, $username, $password)\n{\n // mint needs some info to log in\n $_post = array(\n \"username\" => $username,\n \"password\" => $password,\n \"task\" => \"L\", \n \"nextPage\" => \"\",\n );\n $session->URLFetch(\"https://wwws.mint.com/loginUserSubmit.xevent\", $_post);\n \n // and mint gives us a token to use\n return $session->GetElementValueByID(\"javascript-token\");\n}"
]
| [
"0.618467",
"0.6175975",
"0.604869",
"0.60438454",
"0.5925457",
"0.59057355",
"0.5846533",
"0.58246094",
"0.5797072",
"0.57736874",
"0.5744761",
"0.57443666",
"0.57392716",
"0.57392716",
"0.5736101",
"0.5699988",
"0.56944746",
"0.56714183",
"0.55994856",
"0.5594075",
"0.558709",
"0.55870247",
"0.5585626",
"0.5528671",
"0.5521548",
"0.5515947",
"0.54878426",
"0.5481833",
"0.546714",
"0.5441591"
]
| 0.79556954 | 0 |
Show Create form task. | public function show_create_form_task()
{
$user = factory(User::class)->create();
$user->assignRole('task-manager');
$this->actingAs($user);
View::share('user', $user);
factory(User::class, 5)->create();
$response = $this->get('/tasks_php/create');
$response->assertSuccessful();
$response->assertViewIs('tasks.create_task');
$users = User::all();
$response->assertViewHas('users', $users);
$response->assertSeeText('Create Task:');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return view('tasks.form_Create');\n }",
"public function create()\n {\n return view(('tasks.create'));\n }",
"public function create()\n {\n return view('task::create');\n }",
"public function create() // create task page\n {\n\n // tasks form\n\n return view('todo.create');\n }",
"public function create()\n {\n return view('projectmanager::admin.tasks.create');\n }",
"public function create()\n {\n return view('task-create');\n }",
"public function create()\n {\n return view('task.add-task');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('roletasks.create');\n\t}",
"public function create()\n {\n return view('WorkFlow.WorkTask.add');\n }",
"public function create()\n {\n return view('employee_task.create');\n }",
"public function create()\n {\n return view('task');\n }",
"public function create()\n {\n return view('createTasks');\n }",
"public function create()\n {\n return view('web.pages.new_tasks')\n ->with('projects',Project::all());\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n //Declaration of vars in order to use the same form template\n $task = new Task;\n $title = \"Nueva Tarea\";\n $txtButton = \"Agregar\";\n $route = route('tasks.store');\n $users = User::all();\n return view('tasks.create', compact('task','title','txtButton','route','users'));\n }",
"public function create()\n {\n $project_id = request()->get('project_id');\n $project_members = ProjectMember::projectMembersDropdown($project_id);\n $priorities = ProjectTask::prioritiesDropdown();\n $statuses = ProjectTask::taskStatuses();\n\n return view('project::task.create')\n ->with(compact('project_members', 'priorities', 'project_id', 'statuses'));\n }",
"public function create()\n {\n $this->getUser()->hasPermission(['insert'], 'auto_tasks');\n\n return view('autotasks.create');\n }",
"public function create()\n {\n $cases = Casee::all();\n $users = User::all();\n $stages = Stage::all();\n\n return $this->view_('task.update',[\n 'object'=> new Task(),\n 'cases'=> $cases,\n 'users'=> $users,\n 'stages'=> $stages,\n ]);\n }",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n $task_types = TaskType::all();\n return view('partner/task/task-create', compact('task_types'));\n }",
"public function create(TaskFormBuilder $form)\n {\n return $form->render();\n }",
"public function createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create() : bool\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n\n $model = new Task();\n $attributes = $this->request->body();\n $user_id = User::getLoggedInUserId();\n $attributes['user_id'] = $user_id;\n\n if($this->request->isPost() && $model->setAttributes($attributes)->validate() && $model->create() ) {\n\n header(\"Location: /task/index\");\n exit;\n }\n\n return $this->render('create', $model);\n }"
]
| [
"0.83006",
"0.80128914",
"0.8012868",
"0.7993994",
"0.7976243",
"0.78447783",
"0.7815096",
"0.7810919",
"0.7810919",
"0.7793664",
"0.7772025",
"0.77439636",
"0.77391636",
"0.77141106",
"0.7663464",
"0.7645821",
"0.7625751",
"0.7625751",
"0.7623814",
"0.7609847",
"0.760436",
"0.7604137",
"0.75745094",
"0.75378746",
"0.7518762",
"0.75134176",
"0.7507877",
"0.74742526",
"0.74742526",
"0.74712235"
]
| 0.83771765 | 0 |
Show Edit form task. | public function show_edit_form_task()
{
$user = factory(User::class)->create();
$user->assignRole('task-manager');
$this->actingAs($user);
View::share('user', $user);
$task = factory(Task::class)->create();
factory(User::class, 5)->create();
$users = User::all();
$response = $this->get('/tasks_php/edit/'.$task->id);
$response->assertSuccessful();
$response->assertViewIs('tasks.edit_task');
$task = Task::findOrFail($task->id);
$response->assertViewHas('task', $task);
$response->assertViewHas('users', $users);
$response->assertSeeText('Edit Task:');
$response->assertSee($task->name);
$response->assertSee($task->user->name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }",
"protected function editTaskAction() {}",
"public\n function edit(\n Task $task\n ) {\n //\n }",
"public function edit(Task $task)\r\n {\r\n //\r\n }",
"public function edit(Task $task)\n {\n\n }",
"public function edit(Task $task)\n {\n //Admin allow only \n abort_if(Gate::denies('user_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n //Declaration of vars in order to use the same form template\n $update = true;\n $title = \"Actualizar Tarea\";\n $txtButton = \"Actualizar\";\n $route = route('tasks.update',['task' => $task]);\n $users = User::all();\n return view('tasks.edit', compact('task','title','txtButton','route','users','update'));\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //var_dump($task);\n }",
"function edit() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function editTask($id)\n\t{\n\t\tif ( \\App\\is_admin() ) {\n\t\t\t$task = Task::whereId( (int)$id )->first();\n\t\t\techo twig()->render('edit.html', ['task' => $task]);\n\t\t} else {\n\t\t\theader('Location: /?err=auth');\n\t\t}\n\t}",
"public function edit(Task $task)\n {\n return view('web.pages.edit_task')\n ->with('task',$task)\n ->with('projects',Project::all());\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.form_edit',[\n 'task' => $task,\n ]);\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.edit', compact('task'));\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n\n\n return view('tasks.edit')->withTask($task);\n }",
"public function edit(TaskFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit(Task $task)\n {\n return view('teacher/edittask',\n [ 'task' =>$task ]\n );\n }",
"public function edit($id)\n\t{\n\t\tView::share('title', 'ThinkClosing - Task');\n\t\t$task = Task::find($id);\n\t\tif (!$task) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', 'Task not found.')\n \t->with('alert-class', 'alert-error');\n\t\t} else if($task->user_id !== Auth::user()->id || !Auth::user()->isAdmin()) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', \"You don't have permission to edit this task.\")\n \t->with('alert-class', 'alert-error');\n\t\t}\n\t\treturn View::make('tasks.edit')->with('task', $task);\n\t}",
"function edit()\n\t{\n $data = JRequest::get( 'post' );\n\n $datas = JRequest::get( 'get' );\n $data['task']=isset($data['task'])?$data['task']:'';\n $datas['task']=isset($datas['task'])?$datas['task']:'';\n if($data['task']=='edit' || $datas['task'] =='edit'){\n JRequest::setVar( 'view', 'test' );\n JRequest::setVar( 'layout', 'default_edit');\n JRequest::setVar('hidemainmenu', 1);\n parent::display();\n }\n else{\n\t\tJRequest::setVar( 'view', 'test' );\n\t\tJRequest::setVar( 'layout', 'form');\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t\tparent::display();\n }\n }",
"public function edit($id)\n {\n if(Module::hasAccess(\"Tasks\", \"edit\")) {\n\n $task = Task::find($id);\n if(isset($task->id)) {\n $module = Module::get('Tasks');\n\n $module->row = $task;\n\n $work_list = DB::table('worklists')\n ->lists('name', 'work_id');\n $user_list = DB::table('userinfos')\n ->lists('user_key', 'user_key');\n\n return view('la.tasks.edit', [\n 'module' => $module,\n 'view_col' => $this->view_col,\n 'work_list' => $work_list,\n 'user_list' => $user_list,\n 'status_list' => Task::$statusText,\n ])->with('task', $task);\n } else {\n return view('errors.404', [\n 'record_id' => $id,\n 'record_name' => ucfirst(\"task\"),\n ]);\n }\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }",
"public function edit(Task $task)\n {\n return view('projectmanager::admin.tasks.edit', compact('task'));\n }",
"public function edit($id) {\n $tasks=Tasks::find($id);\n return view('edit_task', ['task' => $tasks]);\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.edit')->with('task', $task);\n }",
"public function edit($id)\n {\n $task=Task::find($id);\n return view('edit')->with('task',$task);\n }",
"public function edit(Task $task)\n {\n return view('tasks.edit', compact('task'));\n }"
]
| [
"0.84663403",
"0.8147351",
"0.7905769",
"0.7901467",
"0.78734225",
"0.7873279",
"0.7852675",
"0.7852675",
"0.7852675",
"0.7852675",
"0.7852675",
"0.7852675",
"0.7852675",
"0.77807105",
"0.77442133",
"0.76450604",
"0.7600352",
"0.7546014",
"0.75014967",
"0.74968445",
"0.7481016",
"0.7478759",
"0.7451596",
"0.73695076",
"0.73623097",
"0.73498034",
"0.73239475",
"0.73041797",
"0.7300244",
"0.7231307"
]
| 0.837018 | 1 |
Set the unserializer function | public function setUnserializer($unserializer) {
$this->unserializer = $unserializer;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct($deserializer)\r\n {\r\n $this->deserializer = $deserializer;\r\n }",
"public function __construct() {\n\n // If we unserialize an object, prevent the magic wakeup from happening.\n ini_set('unserialize_callback_func', '');\n\n }",
"abstract protected function unSerializeData();",
"public static function getSerializer();",
"public function getSerializer();",
"public function onDeserialization($sender) \r\n {\r\n // TODO: Implement onDeserialization() method.\r\n }",
"public function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Unserializing is forbidden!', 'be-table-ship' ), '4.0' );\n\t\t}",
"function deserialise(string $data): void;",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'mailExchange' => fn(ParseNode $n) => $o->setMailExchange($n->getStringValue()),\n 'preference' => fn(ParseNode $n) => $o->setPreference($n->getIntegerValue()),\n ]);\n }",
"public function serializer() {\n }",
"#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }",
"public function valueOf($serializer, $serialized, $context= array());",
"public function registerFunctionNames()\n {\n return ['unserialize'];\n\n }",
"public function testSetterMethod()\r\n {\r\n $u = new XML_Unserializer();\r\n $u->setOption(XML_UNSERIALIZER_OPTION_COMPLEXTYPE, 'object');\r\n $u->setOption(XML_UNSERIALIZER_OPTION_DEFAULT_CLASS, 'Foo');\r\n $xml = '<SetterExample><foo>tomato</foo></SetterExample>';\r\n $u->unserialize($xml);\r\n $result = new SetterExample();\r\n $result->setFoo('tomato');\r\n $this->assertEquals($result, $u->getUnserializedData());\r\n }",
"public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}",
"function maybe_unserialize($data)\n {\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'events' => fn(ParseNode $n) => $o->setEvents($n->getCollectionOfObjectValues([VirtualEvent::class, 'createFromDiscriminatorValue'])),\n 'webinars' => fn(ParseNode $n) => $o->setWebinars($n->getCollectionOfObjectValues([VirtualEventWebinar::class, 'createFromDiscriminatorValue'])),\n ]);\n }",
"public function __wakeup() {\n _doing_it_wrong( __FUNCTION__, __( \"Unserializing instances is forbidden!\", \"wcwspay\" ), \"4.7\" );\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'activityGroupNames' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setActivityGroupNames($val);\n },\n 'address' => fn(ParseNode $n) => $o->setAddress($n->getStringValue()),\n 'azureSubscriptionId' => fn(ParseNode $n) => $o->setAzureSubscriptionId($n->getStringValue()),\n 'azureTenantId' => fn(ParseNode $n) => $o->setAzureTenantId($n->getStringValue()),\n 'countHits' => fn(ParseNode $n) => $o->setCountHits($n->getIntegerValue()),\n 'countHosts' => fn(ParseNode $n) => $o->setCountHosts($n->getIntegerValue()),\n 'firstSeenDateTime' => fn(ParseNode $n) => $o->setFirstSeenDateTime($n->getDateTimeValue()),\n 'ipCategories' => fn(ParseNode $n) => $o->setIpCategories($n->getCollectionOfObjectValues([IpCategory::class, 'createFromDiscriminatorValue'])),\n 'ipReferenceData' => fn(ParseNode $n) => $o->setIpReferenceData($n->getCollectionOfObjectValues([IpReferenceData::class, 'createFromDiscriminatorValue'])),\n 'lastSeenDateTime' => fn(ParseNode $n) => $o->setLastSeenDateTime($n->getDateTimeValue()),\n 'riskScore' => fn(ParseNode $n) => $o->setRiskScore($n->getStringValue()),\n 'tags' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setTags($val);\n },\n 'vendorInformation' => fn(ParseNode $n) => $o->setVendorInformation($n->getObjectValue([SecurityVendorInformation::class, 'createFromDiscriminatorValue'])),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n ]);\n }",
"public static function setSerializeCallback(Closure $callback): void\n {\n self::$serializeCallback = $callback;\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'subscriptionId' => fn(ParseNode $n) => $o->setSubscriptionId($n->getStringValue()),\n 'subscriptionName' => fn(ParseNode $n) => $o->setSubscriptionName($n->getStringValue()),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'distributeForStudentWork' => fn(ParseNode $n) => $o->setDistributeForStudentWork($n->getBooleanValue()),\n 'resource' => fn(ParseNode $n) => $o->setResource($n->getObjectValue([EducationResource::class, 'createFromDiscriminatorValue'])),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'azureOperationalInsightsBlockTelemetry' => fn(ParseNode $n) => $o->setAzureOperationalInsightsBlockTelemetry($n->getBooleanValue()),\n 'azureOperationalInsightsWorkspaceId' => fn(ParseNode $n) => $o->setAzureOperationalInsightsWorkspaceId($n->getStringValue()),\n 'azureOperationalInsightsWorkspaceKey' => fn(ParseNode $n) => $o->setAzureOperationalInsightsWorkspaceKey($n->getStringValue()),\n 'connectAppBlockAutoLaunch' => fn(ParseNode $n) => $o->setConnectAppBlockAutoLaunch($n->getBooleanValue()),\n 'maintenanceWindowBlocked' => fn(ParseNode $n) => $o->setMaintenanceWindowBlocked($n->getBooleanValue()),\n 'maintenanceWindowDurationInHours' => fn(ParseNode $n) => $o->setMaintenanceWindowDurationInHours($n->getIntegerValue()),\n 'maintenanceWindowStartTime' => fn(ParseNode $n) => $o->setMaintenanceWindowStartTime($n->getTimeValue()),\n 'miracastBlocked' => fn(ParseNode $n) => $o->setMiracastBlocked($n->getBooleanValue()),\n 'miracastChannel' => fn(ParseNode $n) => $o->setMiracastChannel($n->getEnumValue(MiracastChannel::class)),\n 'miracastRequirePin' => fn(ParseNode $n) => $o->setMiracastRequirePin($n->getBooleanValue()),\n 'settingsBlockMyMeetingsAndFiles' => fn(ParseNode $n) => $o->setSettingsBlockMyMeetingsAndFiles($n->getBooleanValue()),\n 'settingsBlockSessionResume' => fn(ParseNode $n) => $o->setSettingsBlockSessionResume($n->getBooleanValue()),\n 'settingsBlockSigninSuggestions' => fn(ParseNode $n) => $o->setSettingsBlockSigninSuggestions($n->getBooleanValue()),\n 'settingsDefaultVolume' => fn(ParseNode $n) => $o->setSettingsDefaultVolume($n->getIntegerValue()),\n 'settingsScreenTimeoutInMinutes' => fn(ParseNode $n) => $o->setSettingsScreenTimeoutInMinutes($n->getIntegerValue()),\n 'settingsSessionTimeoutInMinutes' => fn(ParseNode $n) => $o->setSettingsSessionTimeoutInMinutes($n->getIntegerValue()),\n 'settingsSleepTimeoutInMinutes' => fn(ParseNode $n) => $o->setSettingsSleepTimeoutInMinutes($n->getIntegerValue()),\n 'welcomeScreenBackgroundImageUrl' => fn(ParseNode $n) => $o->setWelcomeScreenBackgroundImageUrl($n->getStringValue()),\n 'welcomeScreenBlockAutomaticWakeUp' => fn(ParseNode $n) => $o->setWelcomeScreenBlockAutomaticWakeUp($n->getBooleanValue()),\n 'welcomeScreenMeetingInformation' => fn(ParseNode $n) => $o->setWelcomeScreenMeetingInformation($n->getEnumValue(WelcomeScreenMeetingInformation::class)),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'recipientActionDateTime' => fn(ParseNode $n) => $o->setRecipientActionDateTime($n->getDateTimeValue()),\n 'recipientActionMessage' => fn(ParseNode $n) => $o->setRecipientActionMessage($n->getStringValue()),\n 'recipientUserId' => fn(ParseNode $n) => $o->setRecipientUserId($n->getStringValue()),\n 'senderShiftId' => fn(ParseNode $n) => $o->setSenderShiftId($n->getStringValue()),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'allowAutoFilter' => fn(ParseNode $n) => $o->setAllowAutoFilter($n->getBooleanValue()),\n 'allowDeleteColumns' => fn(ParseNode $n) => $o->setAllowDeleteColumns($n->getBooleanValue()),\n 'allowDeleteRows' => fn(ParseNode $n) => $o->setAllowDeleteRows($n->getBooleanValue()),\n 'allowFormatCells' => fn(ParseNode $n) => $o->setAllowFormatCells($n->getBooleanValue()),\n 'allowFormatColumns' => fn(ParseNode $n) => $o->setAllowFormatColumns($n->getBooleanValue()),\n 'allowFormatRows' => fn(ParseNode $n) => $o->setAllowFormatRows($n->getBooleanValue()),\n 'allowInsertColumns' => fn(ParseNode $n) => $o->setAllowInsertColumns($n->getBooleanValue()),\n 'allowInsertHyperlinks' => fn(ParseNode $n) => $o->setAllowInsertHyperlinks($n->getBooleanValue()),\n 'allowInsertRows' => fn(ParseNode $n) => $o->setAllowInsertRows($n->getBooleanValue()),\n 'allowPivotTables' => fn(ParseNode $n) => $o->setAllowPivotTables($n->getBooleanValue()),\n 'allowSort' => fn(ParseNode $n) => $o->setAllowSort($n->getBooleanValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'deviceCount' => fn(ParseNode $n) => $o->setDeviceCount($n->getIntegerValue()),\n 'medianImpactInMs' => fn(ParseNode $n) => $o->setMedianImpactInMs($n->getIntegerValue()),\n 'processName' => fn(ParseNode $n) => $o->setProcessName($n->getStringValue()),\n 'productName' => fn(ParseNode $n) => $o->setProductName($n->getStringValue()),\n 'publisher' => fn(ParseNode $n) => $o->setPublisher($n->getStringValue()),\n 'totalImpactInMs' => fn(ParseNode $n) => $o->setTotalImpactInMs($n->getIntegerValue()),\n ]);\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'mobileAppIdentifier' => fn(ParseNode $n) => $o->setMobileAppIdentifier($n->getObjectValue([MobileAppIdentifier::class, 'createFromDiscriminatorValue'])),\n 'version' => fn(ParseNode $n) => $o->setVersion($n->getStringValue()),\n ]);\n }",
"public function deserialize($data)\n {\n }"
]
| [
"0.59780115",
"0.57484806",
"0.5730562",
"0.5716016",
"0.56009",
"0.55465996",
"0.5514139",
"0.55001557",
"0.54778093",
"0.5459209",
"0.54498607",
"0.53946173",
"0.5380275",
"0.53380597",
"0.5272902",
"0.5233352",
"0.51852447",
"0.5176493",
"0.5164119",
"0.51630485",
"0.51630485",
"0.5161513",
"0.5133685",
"0.5127264",
"0.5104632",
"0.50946575",
"0.50806874",
"0.50802124",
"0.5071969",
"0.5059624"
]
| 0.6680608 | 0 |
Parse taxonomy data from the file array( // hierarchical taxonomy name => ID array 'my taxonomy 1' => array(1, 2, 3, ...), // nonhierarchical taxonomy name => term names string 'my taxonomy 2' => array('term1', 'term2', ...), ) | function get_taxonomies( $data ) {
$taxonomies = array();
foreach ( $data as $k => $v ) {
if ( preg_match( '/^csv_ctax_(.*)$/', $k, $matches ) ) {
$t_name = $matches[1];
if ( $this->taxonomy_exists( $t_name ) ) {
$taxonomies[ $t_name ] = $this->create_terms( $t_name,
$data[ $k ] );
} else {
$this->log['error'][] = "Unknown taxonomy $t_name";
}
}
}
return $taxonomies;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_taxonomy_string($parsed_data, $importer)\n {\n\n if (!empty($parsed_data[$this->taxonomies_id])) {\n\n //$data = json_decode( $parsed_data[ 'products_trending_item' ], true );\n $data = explode(\",\", $parsed_data[$this->taxonomies_id]);\n unset($parsed_data[$this->taxonomies_id]);\n\n if (is_array($data)) {\n\n $parsed_data[$this->taxonomies_id] = array();\n\n // foreach ( $data as $term_id ) {\n // \t$parsed_data[ 'products_trending_item' ][] = $term_id;\n // }\n foreach ($data as $term_name) {\n $term = get_term_by('name', $term_name, $this->taxonomies_id);\n if ($term)\n $parsed_data[$this->taxonomies_id][] = $term->term_id;\n }\n }\n }\n\n return $parsed_data;\n }",
"function process_terms() {\n\t\t$this->terms = apply_filters( 'wp_import_terms', $this->terms );\n\n\t\tif ( empty( $this->terms ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->terms as $term ) {\n\t\t\t// if the term already exists in the correct taxonomy leave it alone\n\t\t\t$term_id = term_exists( $term['slug'], $term['term_taxonomy'] );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($term['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($term['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $term['term_parent'] ) ) {\n\t\t\t\t$parent = 0;\n\t\t\t} else {\n\t\t\t\t$parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );\n\t\t\t\tif ( is_array( $parent ) ) $parent = $parent['term_id'];\n\t\t\t}\n\t\t\t$description = isset( $term['term_description'] ) ? $term['term_description'] : '';\n\t\t\t$termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) );\n\n\t\t\t$id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($term['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($term['term_id'])] = $id['term_id'];\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import %s %s', esc_html($term['term_taxonomy']), esc_html($term['term_name']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->terms );\n\t}",
"private function readTaxonomy( $taxonomy ){\n $this->taxonomy->clear();\n if ($taxonomy){\n foreach( $taxonomy as $term ){\n if (is_object($term))\n $id = $term->id;\n elseif(is_array($term))\n $id = $term['id'];\n else \n $id = $term;\n if ( $id ){\n $term = new TermTYPE();\n $term->getByID($id);\n $this->taxonomy->append( $term );\n }\n }\n }\n }",
"public function import_terms( $args, $assoc_args ) {\n\n\t\t$taxonomy = $args[0];\n\n\t\t// Bail if a taxonomy isn't specified\n\t\tif ( empty( $taxonomy ) ) {\n\t\t\tWP_CLI::error( __( 'Please specify the taxonomy you would like to import your terms for', 'wp-migration' ) );\n\t\t}\n\n\t\t$filename = $assoc_args['file'];\n\n\t\t// Bail if a filename isn't specified, or the file doesn't exist\n\t\tif ( empty( $filename ) || ! file_exists( $filename ) ) {\n\t\t\tWP_CLI::error( __( 'Please specify the filename of the csv you are trying to import', 'wp-migration' ) );\n\t\t}\n\n\t\t// If the taxonomy doesn't exist, bail\n\t\tif ( false === get_taxonomy( $taxonomy ) ) {\n\t\t\tWP_CLI::error( sprintf( __( 'The taxonomy with the name %s does not exist, please use a taxonomy that does exist', 'wp-migration' ), $taxonomy ) );\n\t\t}\n\n\t\t// Use the wp-cli built in uitility to open up the csv file and position the pointer at the beginning of it.\n\t\t$terms = new \\WP_CLI\\Iterators\\CSV( $filename );\n\n\t\tWP_CLI::success( __( 'Starting import process...', 'wp-migration' ) );\n\t\t$terms_added = 0;\n\n\t\t// Loop through each of the rows in the csv\n\t\tforeach ( $terms as $term_row ) {\n\n\t\t\t// dynamically get the array keys for the row. Essentially a way to reference each of the columns in the row\n\t\t\t$array_keys = array_keys( $term_row );\n\t\t\t$term_parent = '';\n\n\t\t\t$i = 0;\n\n\t\t\t// Loop through each of the columns within the current row we are in\n\t\t\tforeach ( $term_row as $term ) {\n\n\t\t\t\t// If the cell is empty skip it.\n\t\t\t\tif ( empty( $term ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$parent_id = 0;\n\n\t\t\t\t// If we are on the first column of the row, we can skip this since there will be no parent\n\t\t\t\tif ( 0 !== $i ) {\n\n\t\t\t\t\t// Continue looking for a parent until we find one\n\t\t\t\t\tfor ( $count = $i; $count > 0; ++$count ) {\n\n\t\t\t\t\t\t// Find the key for the previous column\n\t\t\t\t\t\t$term_parent_key = $array_keys[ ( $count - 1 ) ];\n\n\t\t\t\t\t\t// move array pointer back one key to find the parent term (if there is one)\n\t\t\t\t\t\t$term_parent = $term_row[ $term_parent_key ];\n\n\t\t\t\t\t\tif ( ! empty( $term_parent ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// If there's a parent term in the cell to the left, find the ID and pass it when creating the term\n\t\t\t\tif ( ! empty( $term_parent ) ) {\n\n\t\t\t\t\t// Retrieve the parent term object by the name in the cell so we can grab the ID.\n\t\t\t\t\tif ( function_exists( 'wpcom_vip_get_term_by' ) ) {\n\t\t\t\t\t\t$parent_obj = wpcom_vip_get_term_by( 'name', $term_parent, $taxonomy );\n\t\t\t\t\t\t$parent_id = $parent_obj->term_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parent_obj = get_term_by( 'name', $term_parent, $taxonomy );\n\t\t\t\t\t\t$parent_id = $parent_obj->term_id;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Find out if the term already exists.\n\t\t\t\tif ( function_exists( 'wpcom_vip_term_exists' ) ) {\n\t\t\t\t\t$term_exists = wpcom_vip_term_exists( $term, $taxonomy, $parent_id );\n\t\t\t\t} else {\n\t\t\t\t\t$term_exists = term_exists( $term, $taxonomy, $parent_id );\n\t\t\t\t}\n\n\t\t\t\t// Don't do anything if the term already exists\n\t\t\t\tif ( ! $term_exists ) {\n\n\t\t\t\t\t// Attempt to insert the term.\n\t\t\t\t\t$result = wp_insert_term( $term, $taxonomy, array( 'parent' => $parent_id ) );\n\n\t\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t\tWP_CLI::success( sprintf( __( 'Successfully added the term: %1$s to the %2$s taxonomy with a parent of: %3$s', 'wp-migration' ), $term, $taxonomy, $term_parent ) );\n\t\t\t\t\t\t$terms_added++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( sprintf( __( 'Could not add term: %s error printed out below', 'wp-migration' ), $term ) );\n\t\t\t\t\t\tWP_CLI::warning( $result );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Woohoo! We made it!\n\t\tWP_CLI::success( sprintf( __( 'Successfully imported %d terms. See the taxonomy structure below', 'wp-migration' ), $terms_added ) );\n\t\t$term_tree = WP_CLI::runcommand( sprintf( 'term list %s --fields=term_id,name,parent', $taxonomy ) );\n\t\techo esc_html( $term_tree );\n\n\t}",
"static function importTaxonomies( $taxonomy_map ) {\n\t\t\n\t\techo_now( 'Importing categories and tags...' );\n\t\t\n\t\t# Import Drupal vocabularies as WP taxonomies\n\t\t\n\t\t$vocab_map = array();\n\t\t\n\t\t$dr_tax_prefix = '';\n\t\t\n\t\tif( isset( drupal()->vocabulary ) )\n\t\t\t$dr_tax_prefix = '';\n\t\telse if( isset( drupal()->taxonomy_vocabulary ) )\n\t\t\t$dr_tax_prefix = 'taxonomy_';\n\t\t\n\t\t$dr_tax_vocab = $dr_tax_prefix . 'vocabulary';\n\t\t\n\t\t$vocabs = drupal()->$dr_tax_vocab->getRecords();\n\t\t\n\t\tforeach( $vocabs as $vocab ) {\n\t\t\t\n\t\t\tif( 'skip' == $taxonomy_map[ $vocab['name'] ] )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif( 'asis' == $taxonomy_map[ $vocab['name'] ] ) {\n\t\t\t\t\n\t\t\t\techo_now( 'Registering taxonomy for: ' . str_replace(' ','-',strtolower( $vocab['name'] ) ) );\n\t\t\t\t\n\t\t\t\t$vocab_map[ (int)$vocab['vid'] ] = str_replace(' ','-',strtolower( $vocab['name'] ) );\n\t\t\t\t\n\t\t\t\tregister_taxonomy(\n\t\t\t\t\tstr_replace(' ','-',strtolower( $vocab['name'] ) ),\n\t\t\t\t\tarray( 'post', 'page' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label' => $vocab['name'],\n\t\t\t\t\t\t'hierarchical' => (bool)$vocab['hierarchy']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\techo_now( 'Converting taxonomy: ' . str_replace(' ','-',strtolower( $vocab['name'] ) ) . ' to: ' . $taxonomy_map[ $vocab['name'] ] );\n\t\t\t\t$vocab_map[ (int)$vocab['vid'] ] = $taxonomy_map[ $vocab['name'] ];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t# Import Drupal terms as WP terms\n\t\t\n\t\t$term_vocab_map = array();\n\t\t\n\t\t$term_data_table = $dr_tax_prefix . 'term_data';\n\t\t$term_hierarchy_table = $dr_tax_prefix. 'term_hierarchy';\n\t\t\n\t\t$terms = drupal()->$term_data_table->getRecords();\n\t\t\n\t\tforeach( $terms as $term ) {\n\n\t\t\t$parent = drupal()->$term_hierarchy_table->parent->getValue(\n\t\t\t\tarray(\n\t\t\t\t\t'tid' => $term['tid']\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tif( ! array_key_exists( (int)$term['vid'], $vocab_map ) )\n\t\t\t\tcontinue;\n\n\t\t\tif( apply_filters( 'import_term_skip_term', false, $term, $vocab_map[ (int)$term['vid'] ] ) )\n\t\t\t\tcontinue;\n\n\t\t\t$term_vocab_map[ $term['tid'] ] = $vocab_map[ (int)$term['vid'] ];\n\t\t\t\n//\t\t\techo 'Creating term: ' . $term['name'] . ' from: ' . $term['tid'] . \"<br>\\n\";\n\t\t\t\n\t\t\t$term_result = wp_insert_term(\n\t\t\t\t$term['name'],\n\t\t\t\t$vocab_map[ (int)$term['vid'] ],\n\t\t\t\tarray(\n\t\t\t\t\t'description' => $term['description'],\n\t\t\t\t\t'parent' => (int)$parent\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tif( is_wp_error( $term_result ) ) {\n\t\t\t\t\n\t\t\t\techo 'WARNING - Got error creating term: ' . $term['name']; \n\t\t\t\t\n\t\t\t\tif( in_array( 'term_exists', $term_result->get_error_codes() ) ) {\n\t\t\t\t\t\n\t\t\t\t\techo_now( ' -- term already exists as: ' . $term_result->get_error_data() );\n\t\t\t\t\t$term_id = (int)$term_result->get_error_data();\n\n\t\t\t\t\tself::$term_to_term_map[ (int)$term['tid'] ] = $term_id;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\techo_now( ' -- error was: ' . print_r( $term_result, true ) );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$term_id = $term_result['term_id'];\n\t\t\t\n\t\t\tself::$term_to_term_map[ (int)$term['tid'] ] = $term_id;\n\t\t\t\n\t\t}\n\t\t\n\t\t# Attach terms to posts\n\t\t\n\t\tif( isset( drupal()->term_node ) )\n\t\t\t$term_node_table = 'term_node';\n\t\telse if( isset( drupal()->taxonomy_index ) )\n\t\t\t$term_node_table = 'taxonomy_index';\n\t\t\n\t\t$term_assignments = drupal()->$term_node_table->getRecords();\n\t\t\n\t\tforeach( $term_assignments as $term_assignment ) {\n\t\t\t\n\t\t\tif( ! array_key_exists( $term_assignment['tid'], $term_vocab_map ) )\n\t\t\t\tcontinue;\n\n\t\t\tif( ! array_key_exists( (int)$term_assignment['tid'], self::$term_to_term_map ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif( ! array_key_exists( $term_assignment['nid'], self::$node_to_post_map ) )\n\t\t\t\tcontinue;\n\t\t\t\n//\t\t\techo 'Adding term: ' . (int)$term_assignment['tid'] . ' from: ' . self::$term_to_term_map[ (int)$term_assignment['tid'] ] . ' to: ' . self::$node_to_post_map[ $term_assignment['nid'] ] . \"<br>\\n\";\n\t\t\t\n\t\t\t$term_result = wp_set_object_terms(\n\t\t\t\tself::$node_to_post_map[ $term_assignment['nid'] ],\n\t\t\t\tarray( (int)self::$term_to_term_map[ (int)$term_assignment['tid'] ] ),\n\t\t\t\t$term_vocab_map[ $term_assignment['tid'] ],\n\t\t\t\ttrue\n\t\t\t);\n\t\t\t\n\t\t\tif( is_wp_error( $term_result ) )\n\t\t\t\tdie( 'Got error setting object term: ' . print_r( $term_result, true ) );\n\n\t\t\tif( empty( $term_result ) )\n\t\t\t\tdie('Failed to set object term properly.');\n\n\t\t}\n\t\t\n\t\tdo_action( 'imported_taxonomies' );\n\t\t\n\t}",
"private function prepareTaxonomy(){\n $taxonomy = null;\n if ( $this->taxonomy->terms() ){\n foreach($this->taxonomy->terms() as $term){\n $taxonomy[] = array( \n \t'id'=>$term->getID(), \n \t'label'=>$term->label->label \n\t\t\t\t);\n }\n }\n return $taxonomy;\n }",
"public function taxonomy();",
"function create_terms( $taxonomy, $field ) {\n\t\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t\t$term_ids = array();\n\t\t\tforeach ( $this->_parse_tax( $field ) as $row ) {\n\t\t\t\t@list( $parent, $child ) = $row;\n\t\t\t\t$parent_ok = TRUE;\n\t\t\t\tif ( $parent ) {\n\t\t\t\t\t$parent_info = $this->term_exists( $parent, $taxonomy );\n\t\t\t\t\tif ( ! $parent_info ) {\n\t\t\t\t\t\t// create parent\n\t\t\t\t\t\t$parent_info = wp_insert_term( $parent, $taxonomy );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! is_wp_error( $parent_info ) ) {\n\t\t\t\t\t\t$parent_id = $parent_info['term_id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// could not find or create parent\n\t\t\t\t\t\t$parent_ok = FALSE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$parent_id = 0;\n\t\t\t\t}\n\n\t\t\t\tif ( $parent_ok ) {\n\t\t\t\t\t$child_info = $this->term_exists( $child, $taxonomy, $parent_id );\n\t\t\t\t\tif ( ! $child_info ) {\n\t\t\t\t\t\t// create child\n\t\t\t\t\t\t$child_info = wp_insert_term( $child, $taxonomy,\n\t\t\t\t\t\t\tarray( 'parent' => $parent_id ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! is_wp_error( $child_info ) ) {\n\t\t\t\t\t\t$term_ids[] = $child_info['term_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $term_ids;\n\t\t} else {\n\t\t\treturn $field;\n\t\t}\n\t}",
"public function getTaxonomyTerms();",
"function _parse_tax( $field ) {\n\t\t$data = array();\n\t\tif ( function_exists( 'str_getcsv' ) ) { // PHP 5 >= 5.3.0\n\t\t\t$lines = $this->split_lines( $field );\n\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\t$data[] = str_getcsv( $line, ',', '\"' );\n\t\t\t}\n\t\t} else {\n\t\t\t// Use temp files for older PHP versions. Reusing the tmp file for\n\t\t\t// the duration of the script might be faster, but not necessarily\n\t\t\t// significant.\n\t\t\t$handle = tmpfile();\n\t\t\tfwrite( $handle, $field );\n\t\t\tfseek( $handle, 0 );\n\n\t\t\twhile ( ( $r = fgetcsv( $handle, 999999, ',', '\"' ) ) !== FALSE ) {\n\t\t\t\t$data[] = $r;\n\t\t\t}\n\t\t\tfclose( $handle );\n\t\t}\n\n\t\treturn $data;\n\t}",
"function acf_decode_taxonomy_term($value)\n{\n}",
"public function get_taxonomy_terms( $post_id = null, $taxonomy = null ) {\n\n\t\tif ( ! $post_id || ! $taxonomy ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$term_uris = array();\n\n\t\t$terms = wp_get_post_terms( $post_id, $taxonomy, array( 'fields' => 'ids' ) );\n\n\t\tif ( is_wp_error( $terms ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( $terms ) {\n\t\t\tforeach ( $terms as $term ) {\n\n\t\t\t\t$ptv_id = get_term_meta( $term, 'uri', true );\n\n\t\t\t\tif ( $ptv_id ) {\n\t\t\t\t\t$term_uris[] = sanitize_text_field( $ptv_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $term_uris ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $term_uris;\n\t}",
"function term_taxonomies_handler( $tt_ids ) {\n\t\tforeach( (array)$tt_ids as $tt_id ) {\n\t\t\t$this->term_taxonomy_handler( $tt_id );\n\t\t}\n\t}",
"function acf_decode_taxonomy_terms($strings = \\false)\n{\n}",
"function _get_term_hierarchy($taxonomy)\n {\n }",
"public function get_taxonomy_terms(\\Twig\\Environment $env, array $context, $taxonomy_name, array $other_fields = NULL) {\n $query = \\Drupal::entityQuery('taxonomy_term')\n ->condition('vid', $taxonomy_name);\n $tids = $query->execute();\n\n $entity_manager = \\Drupal::entityTypeManager();\n $term_storage = $entity_manager->getStorage('taxonomy_term');\n $taxonomy_terms = $term_storage->loadMultiple($tids);\n\n $taxonomy_array = [];\n\n foreach ($taxonomy_terms as $term) {\n $tid = $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('tid')[0]->value : $term->getTranslation('en')->get('tid')[0]->value;\n\n $values = [\n 'tid' => $tid,\n 'name' => $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('name')[0]->value : $term->getTranslation('en')->get('name')[0]->value,\n 'parent' => $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('parent')->target_id : $term->getTranslation('en')->get('parent')->target_id,\n 'children' => isset($taxonomy_array[$tid]) ? $taxonomy_array[$tid]['children'] : [],\n ];\n\n if ($values['parent'] === \"0\") {\n $taxonomy_array[$tid] = $values;\n }\n else {\n $taxonomy_array[$values['parent']]['children'][$tid] = $values;\n }\n\n // Add extra fields if supplied.\n if (!is_null($other_fields)) {\n foreach ($other_fields as $field) {\n if ($values['parent'] === \"0\") {\n $taxonomy_array[$tid][$field] = $term->get($field)[0]->value;\n }\n else {\n $taxonomy_array[$values['parent']]['children'][$tid][$field] = $term->get($field)[0]->value;\n }\n }\n }\n }\n\n return $taxonomy_array;\n }",
"public function loadTaxonomyTerms(Node $node) {\n $tids = [];\n $tids[] = $node->get('field_event_building')->target_id;\n $tids[] = $node->get('field_event_room')->target_id;\n $term_storage = $this->entityTypeManager->getStorage('taxonomy_term');\n $terms = $term_storage->loadMultiple(array_filter($tids));\n $taxonomy = [];\n foreach ($terms as $term) {\n $taxonomy[$term->bundle()] = $term->label();\n }\n return $taxonomy;\n }",
"public function setTaxonomyIds(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->taxonomy_ids = $arr;\n }",
"function get_tax_file_fields() {\n\treturn array (\n\t\t\t\"Term name\",\n\t\t\t\"GUID\",\n\t\t\t\"Parent GUID\",\n\t\t\t\"Rank\",\n\t);\n}",
"function acf_get_taxonomy_terms($taxonomies = array())\n{\n}",
"private function parse_taxon_info($taxon_id)\n {\n if($html = Functions::lookup_with_cache($this->page['taxon_page'].$taxon_id, $this->download_options)) {\n /*<div class=\"field-label\">Subspecies:</div>\n <div class=\"field-items\">\n <div class=\"field-item\" style=\"padding-left:3px;\">\n <em>Nautilus</em> <em>pompilius</em> <em>pompilius</em> Linnaeus 1758 </div>\n */\n $rec['taxon_id'] = $taxon_id;\n if(preg_match(\"/<div class=\\\"field-label\\\">(.*?):<\\/div>/ims\", $html, $arr)) $rec['rank'] = strtolower($arr[1]);\n if($rec['rank'] == \"unranked\") $rec['rank'] = \"\";\n if(preg_match(\"/<div class=\\\"field-item\\\"(.*?)<\\/div>/ims\", $html, $arr)) $rec['sciname'] = strip_tags(\"<div \".$arr[1]);\n \n /* get canonical and authorship:\n <h1 class=\"title\" id=\"page-title\">\n Cephalopoda <span>Cuvier 1797 </span> </h1>\n */\n if(preg_match(\"/<h1 class\\=\\\"title\\\" id\\=\\\"page-title\\\">(.*?)<\\/h1>/ims\", $html, $arr)) {\n $str = $arr[1];\n // echo \"\\n[$str]\\n\"; exit;\n if(preg_match(\"/xxx(.*?)<span>/ims\", \"xxx\".$str, $arr2)) $rec['canonical'] = Functions::remove_whitespace(strip_tags($arr2[1]));\n if(preg_match(\"/<span>(.*?)<\\/span>/ims\", $str, $arr2)) $rec['authorship'] = trim($arr2[1]);\n }\n else exit(\"\\nInvestigate: cannot get into <h1> [$taxon_id]\\n\");\n \n if(!@$rec['canonical']) {\n $this->debug['cannot get canonical'][$taxon_id] = '';\n }\n \n $rec = array_map('trim', $rec);\n $rec['usage'] = self::get_usage($html);\n $rec['ancestry'] = self::get_ancestry($html);\n // print_r($rec); exit;\n return $rec;\n }\n }",
"public function getTaxonomyTerm($id, $taxonomy);",
"function build_taxonomies() {\n// custom tax\n register_taxonomy( 'from', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'cpt-tag',array('menu','recipe','sources-resources','tips-quips','style-points'), \n array( \n 'hierarchical' => false, // true = acts like categories false = acts like tags\n 'label' => 'Tags',\n 'query_var' => true,\n 'show_admin_column' => true,\n 'public' => true,\n 'rewrite' => true,\n '_builtin' => true\n ) );\n register_taxonomy( 'from-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-from' ),\n\t\t\t'_builtin' => true\n ) );\n register_taxonomy( 'sub', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n}",
"function _muckypup_database_get_term_ids ($vocabularies) {\n\n $terms = array ();\n \n foreach ($vocabularies as $vocabulary) {\n if ($vocabulary != 0) {\n $term_tree = taxonomy_get_tree($vocabulary);\n \n foreach ($term_tree as $term_branch) {\n $terms[] = $term_branch->tid;\n }\n }\n }\n\n\treturn $terms;\n}",
"function insert_wp_term_relationships($wpdb, $id, $in_args){\n $args = explode(',' , $in_args);\n $table = $wpdb->prefix.\"terms\";\n foreach($args as $a)\n {\n $q = \"SELECT term_id FROM \".$table.\" WHERE name = '\".strtoupper($a).\"'\";\n $terms = $wpdb->get_results($wpdb->prepare($q));\n foreach($terms as $t)\n {\n $arr = array(\n 'object_id' => $id,\n 'term_taxonomy_id' => $t->term_id,\n );\n $wpdb->insert($wpdb->prefix.'term_relationships', $arr);\n }\n }\n}",
"public function loadArrayByTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }",
"function create_ha_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad artistica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad artistica', 'taxonomy singular name' ),\n 'search_items' => __( 'Buscar Habilidad' ),\n 'all_items' => __( 'Habilidades artisticas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad artistica' ),\n 'new_item_name' => __( 'Nueva habilidad artistica' ),\n 'menu_name' => __( 'Habilidades artisticas' ),\n ); \t\n\n register_taxonomy('habilidad-artistica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-artistica' ),\n ));\n\n}",
"public function initial_taxonomy() {\n $labels = array(\n 'name' => __( 'Taxonomies', Settings::$text_domain ),\n 'singular_name' => __( 'Taxonomy', Settings::$text_domain ),\n 'menu_name' => __( 'Taxonomies', Settings::$text_domain ),\n 'name_admin_bar' => __( 'Taxonomies', Settings::$text_domain ),\n 'add_new' => __( 'Add New', Settings::$text_domain ),\n 'add_new_item' => __( 'Add New Taxonomy', Settings::$text_domain ),\n 'new_item' => __( 'New Taxonomy', Settings::$text_domain ),\n 'edit_item' => __( 'Edit Taxonomy', Settings::$text_domain ),\n 'view_item' => __( 'View Taxonomy', Settings::$text_domain ),\n 'all_items' => __( 'Taxonomies', Settings::$text_domain ),\n 'search_items' => __( 'Search Taxonomies', Settings::$text_domain ),\n 'parent_item_colon' => __( 'Parent Taxonomies:', Settings::$text_domain ),\n 'not_found' => __( 'No taxonomy found.', Settings::$text_domain ),\n 'not_found_in_trash' => __( 'No taxonomies found in Trash.', Settings::$text_domain )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => 'tools.php',\n 'show_in_nav_menus' => false,\n 'query_var' => true,\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'taxonomies' => array( '' ),\n 'menu_icon' => 'dashicons-category',\n 'supports' => array('title')\n );\n\n register_post_type( Settings::$main_taxonomy_name, $args );\n\n $taxonomy_factory = new Taxonomy_Factory();\n $taxonomy_factory->register_all_taxonomies();\n\n //Configura o número de posts por página\n add_action('pre_get_posts', array($taxonomy_factory, 'set_posts_per_page'));\n }",
"function create_ht_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad tecnica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad tecnica', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Genres' ),\n 'all_items' => __( 'Habilidades tecnicas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad tecnica' ),\n 'new_item_name' => __( 'Nueva habilidad tecnica' ),\n 'menu_name' => __( 'Habilidades tecnicas' ),\n ); \t\n\n register_taxonomy('habilidad-tecnica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-tecnica' ),\n ));\n\n}",
"function _ficalink_taxonomy_default_vocabularies() {\n $items = array(\n array(\n 'name' => 'Authors',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'authors',\n ),\n array(\n 'name' => 'Characters',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'characters',\n ),\n array(\n 'name' => 'Genres',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'genres',\n ),\n array(\n 'name' => 'Series',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'series',\n ),\n array(\n 'name' => 'Tags',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'tags',\n ),\n array(\n 'name' => 'Warnings',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'warnings',\n ),\n );\n return $items;\n}"
]
| [
"0.6669934",
"0.63351905",
"0.63004637",
"0.6175052",
"0.6071222",
"0.6037896",
"0.5919632",
"0.58877146",
"0.5667903",
"0.5644086",
"0.5492493",
"0.5472193",
"0.54660827",
"0.5456491",
"0.5419356",
"0.540583",
"0.53981966",
"0.5380606",
"0.5372109",
"0.5331276",
"0.5330196",
"0.53225267",
"0.5322028",
"0.53009105",
"0.5253673",
"0.5231183",
"0.5212925",
"0.521021",
"0.52005297",
"0.51723015"
]
| 0.6631315 | 1 |
Try to split lines of text correctly regardless of the platform the text is coming from. | function split_lines( $text ) {
$lines = preg_split( "/(\r\n|\n|\r)/", $text );
return $lines;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLineBreaks($text) {\r\n $mb_encoding = $this->encoding->getEncodingType();\r\n $use_mb = $this->encoding->useMB();\r\n if (!is_string($text)) { \r\n //make sure we have something\r\n if ($use_mb) {\r\n return array (mb_convert_encoding(\"\",$mb_encoding));\r\n }else {\r\n return array(\"\");\r\n }\r\n }\r\n //split up the paragaph along newlines\r\n $paragraphs = $this->getParagraphs($text);\r\n $text_lines = array();\r\n foreach ($paragraphs as $paragraph) {\r\n if ($use_mb) {\r\n $text_lines[] = mb_convert_encoding(\"\", $mb_encoding);\r\n } else {\r\n $text_lines[] = \"\";\r\n }\r\n switch ($this->algorithm) {\r\n case 'Knuth':\r\n $this->Knuth($paragraph,$text_lines);\r\n break;\r\n case 'Greedy':\r\n $this->Greedy($paragraph,$text_lines);\r\n break;\r\n default: //truncate\r\n $this->Truncate($paragraph,$text_lines);\r\n break;\r\n }\r\n }\r\n return $text_lines;\r\n }",
"function NbLinesSplit($w,$txt,$lineno)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n $cnt=0;\n while($i<$nb)\n {\n $c=$s[$i];\n $cnt+=1;\n \t\t$a[$cnt]= $nl;\n if($nl==$lineno){\n \t$Stringposition=$i;\n \tbreak;\n }\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n \t \n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n \n }\n else{\n $i++;\n \n }\n /* if($nl=='12'){\n \t$Stringposition=$i;\n \tbreak;\n }*/\n }\n return $Stringposition;\n}",
"public static function normalizeLineBreaks($text) {}",
"public function splitLine() {\n $this->words = preg_split('/[\\' \\',\\t]+/', $this->line);\n }",
"function getLines()\n\t{\n\t\t//echo 'font file = ' . $this->calculateFontFile() . ' ' . $this->textFont . '<br>';\n\t\tif(isset($this->lines) && $this->width == $this->lines[\"width\"] && $this->textSize == $this->lines[\"textSize\"])\n\t\t{\n\t\t\treturn $this->lines;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$rawPars = explode(\"\\r\\n\", $this->contents);\n\t\t\t\n\t\t\t//\tgo through each paragraph and find the line breaks\n\t\t\t//\t\twhen we're done we should have an array processed\n\t\t\t//\t\tparagraphs. Each paragraph should be an array of \n\t\t\t//\t\tlines.\n\t\t\t//echo \"the font it is selecting \" . $this->calculateFontFile() . '<br>';\n\t\t\t$this->pdf->selectFont($this->calculateFontFile());\n\t\t\t$lines = array();\n\t\t\t$lines2 = array();\n\t\t\t$lines[\"longest\"] = 0;\n\t\t\t$lines[\"width\"] = $this->width;\n\t\t\t$lines[\"textSize\"] = $this->textSize;\n\t\t\tif(strlen($this->contents) == 1)\n\t\t\t{\n\t\t\t\t$lines[\"longest\"] = $this->pdf->getTextWidth($this->textSize, $this->contents);\n\t\t\t\t$lines[\"length\"][] = $lines[\"longest\"];\n\t\t\t\t$lines[\"text\"][] = $this->contents;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile( list($parNum, $thisPar) = each($rawPars) )\n\t\t\t\t{\n\t\t\t\t\t//\tinit your data\n\n\t\t\t\t\t$len = strlen($thisPar);\n\t\t\t\t\t$last = $len - 1;\n\t\t\t\t\t$lastEnd = -1;\n\t\t\t\t\t$curStart = 0;\n\t\t\t\t\t$curLen = 0;\n\n\t\t\t\t\tif( strlen($thisPar) == 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$lines[\"text\"][] = \"\";\n\t\t\t\t\t\t$lines[\"length\"][] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i = 1; $i < $len; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//\tif we are at a breaking point.\n\t\t\t\t\t\t//\t\ta breaking point is either\n\t\t\t\t\t\t//\t\t\ta real char before a space or\n\t\t\t\t\t\t//\t\t\tthe last char in the string\n\n\t\t\t\t\t\tif( (($thisPar[$i] == \" \") && ($thisPar[$i - 1] != \" \")) || ($i == $last) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word = substr($thisPar, $lastEnd + 1, ($i) - $lastEnd);\n\n\t\t\t\t\t\t\t$wordLen = ($this->pdf->getTextWidth($this->textSize, $word));\n\n\t\t\t\t\t\t\t//\tdid we find a line break yet\n\n\t\t\t\t\t\t\tif($i == $last)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $lastEnd + 1, $i - $lastEnd);\n\t\t\t\t\t\t\t\t\t$word = trim($word);\n\t\t\t\t\t\t\t\t\t$this->pdf->getTextWidth($this->textSize, $word);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $wordLen;\n\t\t\t\t\t\t\t\t\tif($wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $wordLen;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $i - $curStart + 1);\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t\tif($curLen + $wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\n\t\t\t\t\t\t\t\t$curLen = $wordLen;\n\t\t\t\t\t\t\t\t$curStart = $lastEnd + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$curLen += $wordLen;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t$lastEnd = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->lines = $lines;\n\t\t\t//$this->pdf->selectFont(ZOOP_DIR . \"/pdf/fonts/Helvetica-Bold.afm\");\n\t\t\t//echo_r($lines);\n\t\t\t//echo 'font = ' . $this->textFont . ' bold = ' . ($this->bold ? 1 : 0) . ' italics = ' . ($this->italics ? 1 : 0) . ' size = ' . $this->textSize . ' ' . $this->bold . ' ' . $this->bold . '<br>';\n\t\t\t//echo 'true length = ' . $this->pdf->getTextWidth($this->textSize, 'asdfkla sdfklasdfjlkas;dfgj aslkfj alkw[sfjeoifjsa fi;awesfil;ifas efjilse;filaws eji iiiiiiiiiiiiiii') . '<br>';\n\t\t\treturn $this->lines;\n\t\t}\n\t}",
"public function getTextLines();",
"public function getParagraphs ($text){\r\n $mb_encoding = $this->encoding->getEncodingType();\r\n if ($this->encoding->useMB()) {\r\n $newline_pattern = '[\\n' . (string) 0xE2 . \r\n (string) 0x80 .\r\n (string) 0xA8 . \r\n (string) 0xE2 . \r\n (string) 0x80 . \r\n (string) 0xA9 . ']';\r\n //0x2028 codepoint is E2 80 A8 in UTF-8 \r\n //0x2029 codepoint is E2 80 A9 in UTF-8 \r\n if ($mb_encoding == 'UTF-8') {\r\n $paragraphs = mb_split ($newline_pattern,$text);\r\n $num_paragraphs = count($paragraphs) ;\r\n for ($i = 0; $i < $num_paragraphs; $i++) { \r\n //trim white space\r\n $paragraphs[$i] = preg_replace('/^\\p{Zs}+/u',\"\",$paragraphs[$i]);\r\n $paragraphs[$i] = preg_replace('/\\p{Zs}+$/u',\"\",$paragraphs[$i]);\r\n }\r\n } else {\r\n //we are in a horrible state of affairs with respect to PHP's mb regexp engine.\r\n $utf8_text = mb_convert_encoding($text,'UTF-8',$mb_encoding);\r\n $pargraphs = mb_split ($newline_pattern,$utf8_text);\r\n $num_paragraphs = count($paragraphs) ;\r\n for ($i = 0; $i < $num_paragraphs; $i++) {\r\n //trim white space\r\n $paragraphs[$i] = preg_replace('/^\\p{Zs}+/u',\"\",$paragraphs[$i]);\r\n $paragraphs[$i] = preg_replace('/\\p{Zs}+$/u',\"\",$paragraphs[$i]);\r\n //convert back to the user encoding\r\n $paragraphs[$i] = mb_convert_encoding($paragraphs[$i],$mb_encoding,'UTF-8');\r\n }\r\n }\r\n } else {\r\n $paragraphs = explode(\"\\n\",$text);\r\n $num_paragraphs = count($paragraphs) ;\r\n for ($i = 0; $i < $num_paragraphs; $i++) {\r\n $paragraphs[$i] = trim($paragraphs[$i]);\r\n }\r\n \r\n }\r\n return $paragraphs;\r\n }",
"public static function lineBreakCorrectlyTransformedOnWayToRteProvider() {}",
"function treat($text) {\n $s1 = str_replace(\"\\n\\r\", \"\\n\", $text);\n return str_replace(\"\\r\", \"\", $s1);\n}",
"public function cropHtmlWorksWithLinebreaks() {}",
"function treat($text) {\n\t$s1 = str_replace(\"\\n\\r\", \"\\n\", $text);\n\treturn str_replace(\"\\r\", \"\", $s1);\n}",
"protected function _getLines() {}",
"function _split($lines) {\r\n if (!preg_match_all('/ ( [^\\S\\n]+ | [[:alnum:]]+ | . ) (?: (?!< \\n) [^\\S\\n])? /xs',\r\n implode(\"\\n\", $lines),\r\n $m)) {\r\n return array(array(''), array(''));\r\n }\r\n return array($m[0], $m[1]);\r\n }",
"public function splitText($text)\n\t{\n\t\treturn preg_split('@([<\\[]\\/?[a-zA-Z0-9]+[\\]>])@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE);\n\t}",
"function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}",
"function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}",
"function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}",
"function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}",
"function NbLines($w,$txt)\r\n{\r\n $cw=&$this->CurrentFont['cw'];\r\n if($w==0)\r\n $w=$this->w-$this->rMargin-$this->x;\r\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n $s=str_replace(\"\\r\",'',$txt);\r\n $nb=strlen($s);\r\n if($nb>0 and $s[$nb-1]==\"\\n\")\r\n $nb--;\r\n $sep=-1;\r\n $i=0;\r\n $j=0;\r\n $l=0;\r\n $nl=1;\r\n while($i<$nb)\r\n {\r\n $c=$s[$i];\r\n if($c==\"\\n\")\r\n {\r\n $i++;\r\n $sep=-1;\r\n $j=$i;\r\n $l=0;\r\n $nl++;\r\n continue;\r\n }\r\n if($c==' ')\r\n $sep=$i;\r\n $l+=$cw[$c];\r\n if($l>$wmax)\r\n {\r\n if($sep==-1)\r\n {\r\n if($i==$j)\r\n $i++;\r\n }\r\n else\r\n $i=$sep+1;\r\n $sep=-1;\r\n $j=$i;\r\n $l=0;\r\n $nl++;\r\n }\r\n else\r\n $i++;\r\n }\r\n return $nl;\r\n}",
"protected function Greedy($paragraph,&$text_lines) {\r\n if ($this->hyphen ===null) { //no hyphenation dictionary has been defined. \r\n I2CE::raiseError(\"No hypentation dictionary defined\");\r\n //try and recover\r\n return $this->Truncate($paragraph);\r\n }\r\n $fm = &$this->font_metric;\r\n $space_length = $fm->getCharacterWidth($this->space_char,true);\r\n $hyphen_length = $fm->getCharacterWidth($this->hyphen_char,true);\r\n $mb_encoding = $this->encoding->getEncodingType();\r\n $use_mb = $this->encoding->useMB();\r\n $words = $this->getWords($paragraph);\r\n $current_line = count($text_lines) -1 ;\r\n $line_length = 0;\r\n $is_first_word_of_row = true;\r\n foreach ($words as $word) {\r\n if ($is_first_word_of_row) { \r\n $has_space = false; //do we have a preceeding space for this word\r\n } else{\r\n //first to check if a space would cause a line break\r\n if ($space_length + $line_length > $this->width) {\r\n //line break\r\n $current_line++;\r\n if ($use_mb) {\r\n $text_lines[] = mb_convert_encoding(\"\",$mb_encoding);\r\n } else {\r\n $text_lines[] = \"\";\r\n }\r\n $is_first_word_of_row = true;\r\n $line_length = 0;\r\n $has_space = false;\r\n } else {//otherwise we can move on with this line\r\n $has_space = true;\r\n }\r\n }\r\n $word_length = $fm->getStringWidth($word,true);\r\n if ($has_space) {\r\n $word_length = $word_length + $space_length;\r\n }\r\n if ( $word_length + $line_length <= $this->width) { //we can place the word\r\n if ($has_space) {\r\n $text_lines[$current_line] .= $this->space_char;\r\n }\r\n $text_lines[$current_line] .= $word;\r\n $is_first_word_of_row = false;\r\n //$line_length += $word_length;\r\n $line_length = $fm->getStringWidth($text_lines[$current_line],true); //slower but safer.\r\n //actually it is just that i am too lazy to compute the kerning for a possible space.\r\n } else { \r\n /*we need to truncate the word. word truncations should be\r\n *allowed to occur in hyphenation points. hyphenation points\r\n * are only defined on letters. we shall also allow hyphenations before\r\n * or after any non-letter. \r\n */\r\n $word_parts = $this->hyphen->getWordParts($word);\r\n $num_word_parts = count($word_parts);\r\n $word_part = 0; //the current word part we are trying to place\r\n $used_hyphen = false;\r\n while ($word_part < $num_word_parts){ //we have a word part left to place\r\n $remaining_space = max(1,$this->width - $line_length);\r\n // $sub_word contains the part of the word we know that we can place on the current line\r\n // $new_sub_word contains what we are trying to place on the current line\r\n if ($use_mb) {\r\n $new_sub_word = mb_convert_encoding(\"\",$mb_encoding);\r\n } else {\r\n $new_sub_word = '';\r\n }\r\n $new_sub_word_length = 0;\r\n $prev_word_part = $word_part-1; //the word part we previously placed\r\n $word_part--;\r\n $possible_space = 0;\r\n if (($prev_word_part == -1) && ($has_space)) {\r\n $possible_space = $space_length;\r\n }\r\n do {\r\n $sub_word = $new_sub_word;\r\n $sub_word_length = $new_sub_word_length;\r\n $word_part++;\r\n if ($word_part < $num_word_parts) {\r\n $new_sub_word .= $word_parts[$word_part]['Subword'];\r\n }\r\n $new_sub_word_length = $fm->getStringWidth($new_sub_word,true);\r\n if (($word_part +1 >= $num_word_parts) || (!$word_parts[$word_part+1]['IsLetter'])) {\r\n $possible_hyphen = 0; //we don't need a trailing hyphen since this is the last word part\r\n } else {\r\n $indx = $word_parts[$word_part]['Length']-1;\r\n if ($use_mb) {\r\n $last_char = mb_substr($word_parts[$word_part]['Subword'],\r\n $indx,1,$mb_encoding);\r\n } else {\r\n $last_char = $word_parts[$word_part];\r\n $last_char = $word_parts[$word_part]['Subword'][$indx];\r\n }\r\n $kern = $fm->getKerningValue($last_char,$this->hyphen_char,true);\r\n $possible_hyphen = $hyphen_length + $kern; \r\n }\r\n } while (($new_sub_word_length + $possible_hyphen + $possible_space <= $remaining_space) && ($word_part < $num_word_parts));\r\n if ($new_sub_word_length + $possible_hyphen + $possible_space <= $remaining_space) { \r\n //we were able to place all of the sub-word. This happens if have\r\n //already gpne to the next line while trying to place word parts\r\n if (($prev_word_part == -1) && ($has_space)) {\r\n $text_lines[$current_line] .= $this->space_char;\r\n }\r\n $text_lines[$current_line] .= $new_sub_word;\r\n $line_length += $new_sub_word_length;\r\n $is_first_word_of_row = false;\r\n $used_hyphen = false;\r\n } else {//we exceeded the remaining space with the last word part \r\n //$word_part now temporairily contains the part of the word that exceeded the availble space\r\n // echo \"for ($word) we have ({$word_part})<br/>\\n\";\r\n if ($word_part -1 > $prev_word_part) {\r\n // echo \"for ($word) we have placed before \". $word_parts[$word_part]['Subword'] . \"<br/>\";\r\n // echo \"for ($word) what we placed before was (\". $text_lines[$current_line] . \")<br/>\";\r\n //we are able to place at least one word part\r\n if (($prev_word_part == -1 ) && ($has_space) ) { \r\n //we are placing the first components of the word\r\n $text_lines[$current_line] .= $this->space_char;\r\n }\r\n $text_lines[$current_line] .= $sub_word; \r\n if ($word_part == $num_word_parts) {\r\n // echo \"for ($word) no hyphen b/c last<br/>\";\r\n }\r\n if (!$word_parts[$word_part]['IsLetter']) { \r\n // echo \"for ($word) no hyphen b/c next piece is not letter<br/>\";\r\n // print_r($word_parts[$word_part]);\r\n }\r\n if (($word_part != $num_word_parts ) && ($word_parts[$word_part]['IsLetter'])) { \r\n $text_lines[$current_line] .= $this->hyphen_char;\r\n $used_hyphen = true;\r\n }\r\n $line_length += $possible_space + $sub_word_length + $possible_hyphen;\r\n $is_first_word_of_row = false;\r\n // echo \"for ($word) what we now placed is (\". $text_lines[$current_line] . \")<br/>\";\r\n //on the next go around of the loop we will be trying to place $word_part\r\n } else { \r\n // echo \"for ($word) we have exceeded on {$word_parts[$word_part]} <br/>\";\r\n /**\r\n *the current word part exceeded the remaining space\r\n *if it is the first word of the row we need to place a part of it\r\n *by truncation. We also want to do so it there is an excess\r\n *amount of remaining space compared to the word with what is already used.\r\n * I am arbitrairily deciding that more than 50% white space is excessive\r\n */\r\n $is_excessive = false;\r\n if (($this->width > 1) && (!$is_first_word_of_row)) {\r\n\r\n if ( (( (float) $remaining_space) / ((float) $this->width)) > 0.5) {\r\n $is_excessive = true; \r\n }\r\n }\r\n if (($is_excessive) || ($is_first_word_of_row)) {\r\n // echo \"for ($word) we are forcing on {$word_parts[$word_part]} b/c exc or first<br/>\";\r\n /** \r\n *We have to force at least one character to be put.\r\n *We will in fact place as many possible on this line\r\n *It could be the case that we have a really long word\r\n *with only one word part. If the current word part is\r\n * the only word part remaining we will then recalculate \r\n * the word parts on what is remaining of the word. It\r\n * may make for incorrect hyphenation, but then we are\r\n * placing the word across several lines, so this is a nice\r\n * compromise\r\n */\r\n if ($is_excessive && $used_hyphen) {\r\n //eat up the hyphen we have placed.\r\n if ($use_mb) {\r\n $ll = mb_strlen($text_lines[$current_line],$mb_encoding);\r\n $text_lines[$current_line]= mb_substr($text_lines[$current_line],0,$ll-1,$mb_encoding);\r\n } else {\r\n $ll = strlen($text_lines[$current_line]);\r\n $text_lines[$current_line] = substr($text_lines[$current_line],0,$ll-1);\r\n }\r\n //recalculate the remaining space\r\n $line_length = $fm->getStringWidth($text_lines[$current_line],true);\r\n $remaining_space = $this->width - $line_length;\r\n } else {\r\n if (($prev_word_part == -1 ) && ($has_space) ) { \r\n //we are placing the first components of the word\r\n $text_lines[$current_line] .= $this->space_char;\r\n }\r\n }\r\n if ($use_mb) {\r\n $trunc_word = mb_convert_encoding(\"\",$mb_encoding);\r\n } else {\r\n $trunc_word = '';\r\n }\r\n $trunc_length = 0; \r\n $chars = 0;\r\n do {\r\n $chars++;\r\n $word_parts[$word_part]['Length']--;\r\n $word_parts[$word_part]['Offset']++;\r\n if ($use_mb) {\r\n $c = mb_substr($word_parts[$word_part]['Subword'],0,1,$mb_encoding);\r\n $word_parts[$word_part]['Subword'] \r\n = mb_substr($word_parts[$word_part]['Subword'] ,\r\n 1,\r\n $word_parts[$word_part]['Length'] ,\r\n $mb_encoding);\r\n } else {\r\n $c = substr($word_parts[$word_part]['Subword'],0,1);\r\n $word_parts[$word_part]['Subword'] = substr($word_parts[$word_part]['Subword'],1); \r\n }\r\n //add the character\r\n $old_trunc_word = $trunc_word;\r\n $trunc_word .= $c;\r\n $old_trunc_length = $trunc_length;\r\n $trunc_length = $fm->getStringWidth($trunc_word . $this->hyphen_char,true); //slow!\r\n } while(($trunc_length <= $remaining_space) && \r\n ($word_parts[$word_part]['Length'] > 0)); \r\n //second condition should never be satisfied, its there for safety\r\n //we exceeded the available space on the last character placed\r\n //so we need to return it if we places more than one character\r\n if ($chars == 1) {\r\n //we only placed one character. too bad.\r\n\r\n } else {\r\n //return the last character\r\n $word_parts[$word_part]['Length']++;\r\n $word_parts[$word_part]['Offset']--;\r\n $word_parts[$word_part]['Subword'] = $c . $word_parts[$word_part]['Subword'];\r\n $trunc_word = $old_trunc_word;\r\n $trunc_length = $old_trunc_length;\r\n }\r\n if (($num_word_parts == $word_part +1) && ($word_parts[$word_part]['Length']==0)) {\r\n $text_lines[$current_line] .= $trunc_word;\r\n } else {\r\n //check to see if the next word part begins with a letter\r\n //if so place a hyphen\r\n // if (!is_string($word_parts[$word_part])) {\r\n // I2CE::raiseError(\"Bad \" . print_r($word_parts[$word_part],true));\r\n // }\r\n //$utf8_part = mb_convert_encoding($word_parts[$word_part],'UTF-8',$mb_encoding);\r\n if ($word_parts[$word_part]['IsLetter']) {\r\n $text_lines[$current_line] .= $trunc_word . $this->hyphen_char;\r\n }\r\n }\r\n $used_hyphen = true;\r\n $is_first_word_of_row = false;\r\n $line_length .= $trunc_length;\r\n $is_first_word_of_row = false;\r\n if ($word_parts[$word_part]['Length'] ==0) { //we reached the end of this word part\r\n $word_part++;\r\n } else if ($num_word_parts == $word_part + 1) {\r\n //if we only had one word part remaining, we\r\n //now reset the $word_parts by calculating a new hyphenation\r\n if ($use_mb) {\r\n $remaining_word = mb_convert_encoding(\"\",$mb_encoding);\r\n } else {\r\n $remaining_word = \"\";\r\n } \r\n for ($k=$word_part; $k < $num_word_parts; $k++) {\r\n $remaining_word .= $word_parts[$k]['Subword'];\r\n }\r\n $word_parts = $this->hyphen->getWordParts($remaining_word);\r\n $num_word_parts = count($word_parts);\r\n $word_part = 0;\r\n }\r\n }\r\n // echo \"for ($word) we have skip to next line on {$word_parts[$word_part]} <br/>\";\r\n //it is not the first word of the line, so we can happily skip to the next line\r\n $line_length = 0;\r\n $current_line++;\r\n if ($use_mb) {\r\n $text_lines[] = mb_convert_encoding(\"\",$mb_encoding);\r\n } else {\r\n $text_lines[] = \"\";\r\n }\r\n $is_first_word_of_row = true;\r\n $has_space = false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n return $text_lines;\r\n \r\n }",
"public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}",
"function parse_breaks($txt, $br = true)\n\t{\n\t\t$txt = $txt . \"\\n\"; // just to make things a little easier, pad the end\n\t\t$txt = preg_replace('`<br />\\s*<br />`', \"\\n\\n\", $txt);\n\t\t// Space things out a little\n\t\t$allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|details|menu|summary)';\n\t\t$txt = preg_replace('`(<' . $allblocks . '[^>]*>)`', \"\\n$1\", $txt);\n\t\t$txt = preg_replace('`(</' . $allblocks . '>)`', \"$1\\n\\n\", $txt);\n\t\t$txt = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $txt); // cross-platform newlines\n\t\tif(strpos($txt, '<object') !== false){\n\t\t\t$txt = preg_replace('`\\s*<param([^>]*)>\\s*`', \"<param$1>\", $txt); // no pee inside object/embed\n\t\t\t$txt = preg_replace('`\\s*</embed>\\s*`', '</embed>', $txt);\n\t\t}\n\t\t$txt = preg_replace(\"`\\n\\n+`\", \"\\n\\n\", $txt); // take care of duplicates\n\t\t// make paragraphs, including one at the end\n\t\t$txts = preg_split('`\\n\\s*\\n`', $txt, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$txt = '';\n\t\tforeach($txts as $tinkle){\n\t\t\t$txt .= '<p>' . trim($tinkle, \"\\n\") . \"</p>\\n\";\n\t\t}\n\t\t$txt = preg_replace('`<p>\\s*</p>`', '', $txt); // under certain strange conditions it could create a P of entirely whitespace\n\t\t$txt = preg_replace('`<p>([^<]+)</(div|address|form)>`', \"<p>$1</p></$2>\", $txt);\n\t\t$txt = preg_replace('`<p>\\s*(</?' . $allblocks . '[^>]*>)\\s*</p>`', \"$1\", $txt); // don't pee all over a tag\n\t\t$txt = preg_replace(\"`<p>(<li.+?)</p>`\", \"$1\", $txt); // problem with nested lists\n\t\t$txt = preg_replace('`<p><blockquote([^>]*)>`i', \"<blockquote$1><p>\", $txt);\n\t\t$txt = str_replace('</blockquote></p>', '</p></blockquote>', $txt);\n\t\t$txt = preg_replace('`<p>\\s*(</?' . $allblocks . '[^>]*>)`', \"$1\", $txt);\n\t\t$txt = preg_replace('`(</?' . $allblocks . '[^>]*>)\\s*</p>`', \"$1\", $txt);\n\t\tif($br) {\n\t\t\t$txt = preg_replace_callback('/<(script|style|noparse).*?<\\/\\\\1>/s',\n\t\t\t\tcreate_function('$out','return str_replace(\"\\n\", \"<WPPreserveNewline />\", $out[0]);'),\n\t\t\t\t$txt);\n\t\t\t$txt = preg_replace('|(?<!<br />)\\s*\\n|', \"<br />\\n\", $txt); // optionally make line breaks\n\t\t\t$txt = str_replace('<WPPreserveNewline />', \"\\n\", $txt);\n\t\t}\n\t\t$txt = preg_replace('!(</?' . $allblocks . '[^>]*>)\\s*<br />!', \"$1\", $txt);\n\t\t$txt = preg_replace('!<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $txt);\n\t\tif(strpos($txt, '<pre') !== false)\n\t\t{\n\t\t\t$txt = preg_replace_callback('`<pre[^>]*>.*?</pre>`is',\n\t\t\t\tcreate_function('$out','return str_replace(array(\"<br />\",\"<p>\",\"</p>\"),array(\"\",\"\\n\",\"\"),$out[0]);'),\n\t\t\t\t$txt );\n\t\t}\n\t\t$txt = preg_replace( \"|\\n</p>$|\", '</p>', $txt );\n\n\t\treturn $txt;\n\t}",
"public function format_text_to_array ($text){\n return preg_split('/\\s*\\R\\s*/', trim($text), NULL, PREG_SPLIT_NO_EMPTY);\n }",
"function wp_kses_split($content, $allowed_html, $allowed_protocols)\n {\n }",
"function NbLines($w,$txt)\r\n{\r\n\t$cw=&$this->CurrentFont['cw'];\r\n\tif($w==0)\r\n\t\t$w=$this->w-$this->rMargin-$this->x;\r\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n\t$s=str_replace(\"\\r\",'',$txt);\r\n\t$nb=strlen($s);\r\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\r\n\t\t$nb--;\r\n\t$sep=-1;\r\n\t$i=0;\r\n\t$j=0;\r\n\t$l=0;\r\n\t$nl=1;\r\n\twhile($i<$nb)\r\n\t{\r\n\t\t$c=$s[$i];\r\n\t\tif($c==\"\\n\")\r\n\t\t{\r\n\t\t\t$i++;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif($c==' ')\r\n\t\t\t$sep=$i;\r\n\t\t$l+=$cw[$c];\r\n\t\tif($l>$wmax)\r\n\t\t{\r\n\t\t\tif($sep==-1)\r\n\t\t\t{\r\n\t\t\t\tif($i==$j)\r\n\t\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$i=$sep+1;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$i++;\r\n\t}\r\n\treturn $nl;\r\n}",
"function NbLines($w,$txt)\r\n{\r\n\t$cw=&$this->CurrentFont['cw'];\r\n\tif($w==0)\r\n\t\t$w=$this->w-$this->rMargin-$this->x;\r\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n\t$s=str_replace(\"\\r\",'',$txt);\r\n\t$nb=strlen($s);\r\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\r\n\t\t$nb--;\r\n\t$sep=-1;\r\n\t$i=0;\r\n\t$j=0;\r\n\t$l=0;\r\n\t$nl=1;\r\n\twhile($i<$nb)\r\n\t{\r\n\t\t$c=$s[$i];\r\n\t\tif($c==\"\\n\")\r\n\t\t{\r\n\t\t\t$i++;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif($c==' ')\r\n\t\t\t$sep=$i;\r\n\t\t$l+=$cw[$c];\r\n\t\tif($l>$wmax)\r\n\t\t{\r\n\t\t\tif($sep==-1)\r\n\t\t\t{\r\n\t\t\t\tif($i==$j)\r\n\t\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$i=$sep+1;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$i++;\r\n\t}\r\n\treturn $nl;\r\n}",
"protected function trimSpaces($text)\n {\n $lines = null;\n foreach (preg_split(\"/((\\r?\\n)|(\\r\\n?))/\", $text) as $line) {\n if (!empty($line)) {\n $lines .= $this->trimContent($line) . PHP_EOL;\n }\n }\n return $lines;\n }",
"function text_split($in) {\r\n\t$len = count($in);\r\n\t$a = substr($in,0,$len/2);\r\n\t$b = substr($in,0,(0-($len/2)));\r\n\treturn array($a,$b);\r\n}",
"function handleLineOfText($inputTextLine)\n{\n $inputTextLine = preg_replace('/\\s+/', ' ', $inputTextLine);\n\n //text to single words\n $words = explode(\" \", $inputTextLine);\n\n $mixedWords = [];\n\n //mix words from line\n foreach ($words as $word) {\n //mix word if contains more than 3 characters\n array_push($mixedWords, (strlen($word) > 3) ? mixWord($word) : $word);\n }\n\n return implode(\" \", $mixedWords);\n}",
"function NbLines($w,$txt)\n\t{\n\t $cw=&$this->CurrentFont['cw'];\n\t if($w==0)\n\t $w=$this->w-$this->rMargin-$this->x;\n\t\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n \t $s=str_replace(\"\\r\",'',$txt);\n\t $nb=strlen($s);\n\t if($nb>0 and $s[$nb-1]==\"\\n\")\n \t$nb--;\n\t\t$sep=-1;\n \t\t$i=0;\n \t\t$j=0;\n \t\t$l=0;\n \t\t$nl=1;\n \n\t\twhile($i<$nb){\n\t\t $c=$s[$i];\n\t if($c==\"\\n\"){\n\t $i++;\n\t $sep=-1;\n\t $j=$i;\n\t $l=0;\n\t $nl++;\n\t continue;\n\t }\n\n\t if($c==' ')\n\t $sep=$i;\n \t $l+=$cw[$c];\n\t if($l>$wmax){\n\t if($sep==-1){\n if($i==$j)\n $i++;\n \t}\n else\n $i=$sep+1;\n\t $sep=-1;\n \t$j=$i;\n \t$l=0;\n \t$nl++;\n\t }\n\t else\n\t \t$i++;\n\t }\n\t return $nl;\n\t}"
]
| [
"0.68881565",
"0.63846195",
"0.63690126",
"0.6133611",
"0.5958557",
"0.5824971",
"0.57975596",
"0.575124",
"0.57438827",
"0.57377017",
"0.5710735",
"0.566629",
"0.56589407",
"0.55772704",
"0.5453457",
"0.5453457",
"0.5453457",
"0.5453457",
"0.54501194",
"0.5431226",
"0.5426652",
"0.5396871",
"0.5392721",
"0.537969",
"0.5370616",
"0.5370616",
"0.53620034",
"0.5348346",
"0.5330274",
"0.53259987"
]
| 0.695016 | 0 |
Delete BOM from UTF8 file. | function stripBOM( $fname ) {
$res = fopen( $fname, 'rb' );
if ( FALSE !== $res ) {
$bytes = fread( $res, 3 );
if ( $bytes == pack( 'CCC', 0xef, 0xbb, 0xbf ) ) {
$this->log['notice'][] = 'Getting rid of byte order mark...';
fclose( $res );
$contents = file_get_contents( $fname );
if ( FALSE === $contents ) {
trigger_error( 'Failed to get file contents.', E_USER_WARNING );
}
$contents = substr( $contents, 3 );
$success = file_put_contents( $fname, $contents );
if ( FALSE === $success ) {
trigger_error( 'Failed to put file contents.', E_USER_WARNING );
}
} else {
fclose( $res );
}
} else {
$this->log['error'][] = 'Failed to open file, aborting.';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove_utf8_bom($text)\n {\n $bom = pack('H*', 'EFBBBF');\n $text = preg_replace(\"/^$bom/\", '', $text);\n return $text;\n }",
"public static function remove_utf8_bom($text)\n {\n $bom = pack('H*','EFBBBF');\n $text = preg_replace(\"/^$bom/\", '', $text);\n return $text;\n }",
"public static function cleanBOM($s) {\n\t\tif (substr($s, 0, 3) == pack(\"CCC\", 0xEF, 0xBB, 0xBF)) {\n\t\t\t$s = substr($s, 3);\n\t\t}\n\t\t\n\t\treturn $s;\n\t}",
"function removeBOM($str = '') {\n if (substr($str, 0, 3) == pack(\"CCC\", 0xef, 0xbb, 0xbf)) {\n $str = substr($str, 3);\n }\n return $str;\n}",
"protected function cleanData(&$lines) {\n\n if (empty($lines)) return;\n\n // Currently, we only need to strip a BOM if it exists.\n // Thanks to Derik Badman (http://madinkbeard.com/) for finding the\n // bug and suggesting this fix:\n // http://blog.philipp-michels.de/?p=32\n $first = $lines[0];\n if (substr($first, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {\n $lines[0] = substr($first, 3);\n }\n }",
"public function removeEncodingDeclaration() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_ENCODING_DECLARATION, '', $this->processedClassCode);\n\t}",
"public function testConvertToUTF8nonUTF8(): void\n {\n $string = StringUtil::convertToUTF8(chr(0xBF));\n\n self::assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string);\n }",
"public function get_bom_warning_text() {\n\t\t$files_to_check = array(\n\t\t\tABSPATH.'wp-config.php',\n\t\t\tget_template_directory().DIRECTORY_SEPARATOR.'functions.php',\n\t\t);\n\t\tif (is_child_theme()) {\n\t\t\t$files_to_check[] = get_stylesheet_directory().DIRECTORY_SEPARATOR.'functions.php';\n\t\t}\n\t\t$corrupted_files = array();\n\t\tforeach ($files_to_check as $file) {\n\t\t\tif (!file_exists($file)) continue;\n\t\t\tif (false === ($fp = fopen($file, 'r'))) continue;\n\t\t\tif (false === ($file_data = fread($fp, 8192)));\n\t\t\tfclose($fp);\n\t\t\t$substr_file_data = array();\n\t\t\tfor ($substr_length = 2; $substr_length <= 5; $substr_length++) {\n\t\t\t\t$substr_file_data[$substr_length] = substr($file_data, 0, $substr_length);\n\t\t\t}\n\t\t\t// Detect UTF-7, UTF-8, UTF-16 (BE), UTF-16 (LE), UTF-32 (BE) & UTF-32 (LE) Byte order marks (BOM)\n\t\t\t$bom_decimal_representations = array(\n\t\t\t\tarray(43, 47, 118, 56), // UTF-7 (Hexadecimal: 2B 2F 76 38)\n\t\t\t\tarray(43, 47, 118, 57), // UTF-7 (Hexadecimal: 2B 2F 76 39)\n\t\t\t\tarray(43, 47, 118, 43), // UTF-7 (Hexadecimal: 2B 2F 76 2B)\n\t\t\t\tarray(43, 47, 118, 47), // UTF-7 (Hexadecimal: 2B 2F 76 2F)\n\t\t\t\tarray(43, 47, 118, 56, 45), // UTF-7 (Hexadecimal: 2B 2F 76 38 2D)\n\t\t\t\tarray(239, 187, 191), // UTF-8 (Hexadecimal: 2B 2F 76 38 2D)\n\t\t\t\tarray(254, 255), // UTF-16 (BE) (Hexadecimal: FE FF)\n\t\t\t\tarray(255, 254), // UTF-16 (LE) (Hexadecimal: FF FE)\n\t\t\t\tarray(0, 0, 254, 255), // UTF-32 (BE) (Hexadecimal: 00 00 FE FF)\n\t\t\t\tarray(255, 254, 0, 0), // UTF-32 (LE) (Hexadecimal: FF FE 00 00)\n\t\t\t);\n\t\t\tforeach ($bom_decimal_representations as $bom_decimal_representation) {\n\t\t\t\t$no_of_chars = count($bom_decimal_representation);\n\t\t\t\tarray_unshift($bom_decimal_representation, 'C*');\n\t\t\t\t$binary = call_user_func_array('pack', $bom_decimal_representation);\n\t\t\t\tif ($binary == $substr_file_data[$no_of_chars]) {\n\t\t\t\t\t$corrupted_files[] = $file;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (empty($corrupted_files)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$corrupted_files_count = count($corrupted_files);\n\t\t\treturn '<strong>'.__('Warning', 'updraftplus').':</strong> '.sprintf(_n('The file %s has a \"byte order mark\" (BOM) at its beginning.', 'The files %s have a \"byte order mark\" (BOM) at their beginning.', $corrupted_files_count, 'updraftplus'), '<strong>'.implode('</strong>, <strong>', $corrupted_files).'</strong>').' <a href=\"'.apply_filters('updraftplus_com_link', \"https://updraftplus.com/problems-with-extra-white-space/\").'\" target=\"_blank\">'.__('Follow this link for more information', 'updraftplus').'</a>';\n\t\t}\n\t}",
"function replaceBom($pStr) {\n\treturn str_replace(chr(239) || chr(187) || chr(191), '', $pStr);\n}",
"private function _clean_file($file){\n\t\t$content\t= file_get_contents($file);\n\t\t$content\t= utf8_encode($content);\n\t\t$content\t= strtr( $content,$this->replace_chars);\n\t\t$content\t= utf8_encode($content);\n\t\tfile_put_contents($file, $content);\n\t\treturn TRUE;\n\t}",
"public function stripBom( $body )\n {\n if ( substr( $body, 0, 3 ) === \"\\xef\\xbb\\xbf\" ) // UTF-8\n {\n $body = substr( $body, 3 );\n } else {\n if ( substr( $body, 0, 4 ) === \"\\xff\\xfe\\x00\\x00\" || substr( $body, 0, 4 ) === \"\\x00\\x00\\xfe\\xff\" ) // UTF-32\n {\n $body = substr( $body, 4 );\n } else {\n if ( substr( $body, 0, 2 ) === \"\\xff\\xfe\" || substr( $body, 0, 2 ) === \"\\xfe\\xff\" ) // UTF-16\n {\n $body = substr( $body, 2 );\n }\n }\n }\n\n return $body;\n }",
"function bom_utf8($texte) {\n\treturn (substr($texte, 0,3) == chr(0xEF).chr(0xBB).chr(0xBF));\n}",
"public static function file_has_bom(string $file_path): bool\n {\n $file_content = \\file_get_contents($file_path);\n if ($file_content === false) {\n throw new \\RuntimeException('file_get_contents() returned false for:' . $file_path);\n }\n\n return self::string_has_bom($file_content);\n }",
"public function getOutputBOM()\n {\n return $this->output_bom;\n }",
"public function removeNullBytes() {\r\n $this->contents = str_replace(\"\\0\", \"\", $this->contents);\r\n }",
"public function fixCharsets() {}",
"function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}",
"public function testEncoding() {\n $content = utf8_decode(self::ENCODING_CONTENT);\n file_put_contents($this->destination_encoding_file, $content);\n //The first time, the file should be converted, as its content is not utf8 encoded.\n $this->assertTrue(HermesHelper::encodeUTF8($this->destination_encoding_file));\n //The next time, the file should be already converted, and nothing should be done.\n $this->assertFalse(HermesHelper::encodeUTF8($this->destination_encoding_file));\n }",
"private function RemoveWhiteSpace() {\n\t\twhile (in_array($this->ReadChar(), $this->whiteSpace));\n\t\t$this->ReturnCharToFile(1);\n\t}",
"public static function bom(): string\n {\n return \"\\xef\\xbb\\xbf\";\n }",
"private function failOnBOM($input)\n {\n // UTF-8 ByteOrderMark sequence\n $bom = \"\\xEF\\xBB\\xBF\";\n\n if (substr($input, 0, 3) === $bom) {\n\n throw new ParseException(ParseException::ERROR_BYTE_ORDER_MARK_DETECTED);\n }\n }",
"public function getInputBOM()\n {\n if (null === $this->input_bom) {\n $bom = [\n AbstractCsv::BOM_UTF32_BE, AbstractCsv::BOM_UTF32_LE,\n AbstractCsv::BOM_UTF16_BE, AbstractCsv::BOM_UTF16_LE, AbstractCsv::BOM_UTF8,\n ];\n $csv = $this->getIterator();\n $csv->setFlags(SplFileObject::READ_CSV);\n $csv->rewind();\n $line = $csv->fgets();\n $res = array_filter($bom, function ($sequence) use ($line) {\n return strpos($line, $sequence) === 0;\n });\n\n $this->input_bom = (string) array_shift($res);\n }\n\n return $this->input_bom;\n }",
"function json_text_filter($datajson) {\n\n /*\n This is to help accomodate encoding issues, eg invalid newlines. See:\n http://forum.jquery.com/topic/json-with-newlines-in-strings-should-be-valid#14737000000866332\n http://stackoverflow.com/posts/17846592/revisions\n */\n $datajson = preg_replace('/[ ]{2,}|[\\t]/', ' ', trim($datajson));\n //$data = str_replace(array(\"\\r\", \"\\n\", \"\\\\n\", \"\\r\\n\"), \" \", $data);\n //$data = preg_replace('!\\s+!', ' ', $data);\n //$data = str_replace(' \"', '\"', $data);\n\n $datajson = preg_replace('/,\\s*([\\]}])/m', '$1', utf8_encode($datajson));\n\n\n /*\n This is to replace any possible BOM \"Byte order mark\" that might be present\n See: http://stackoverflow.com/questions/10290849/how-to-remove-multiple-utf-8-bom-sequences-before-doctype\n and\n http://stackoverflow.com/questions/3255993/how-do-i-remove-i-from-the-beginning-of-a-file\n */\n // $bom = pack('H*','EFBBBF');\n // $datajson = preg_replace(\"/^$bom/\", '', $datajson);\n $datajson = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $datajson);\n\n return $datajson;\n\n}",
"public function hasBom(): bool\n {\n return false;\n }",
"function fix_quoted_data($filename) {\n $dados = file_get_contents($filename);\n $dados_corrigidos = str_replace('\\\"', '', $dados);\n file_put_contents($filename, $dados_corrigidos);\n}",
"private function deleteLangFileContent() \n {\n $this->read();\n unset($this->arrayLang[$this->key]);\n $this->save();\n }",
"private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }",
"public function getUseBOM(): bool\n {\n return $this->useBOM;\n }",
"function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}",
"function saveFile($path, $content)\n{\n //$encode = mb_detect_encoding($content); \n //$content = mb_convert_encoding($content, 'ASCII', 'UTF-8');\n \n $content = (pack(\"CCC\",0xef,0xbb,0xbf) === substr($content, 0, 3))\n ? substr($content, 3)\n : $content;\n @file_put_contents($path, $content);\n}"
]
| [
"0.6859319",
"0.6698459",
"0.63637424",
"0.61635953",
"0.5933664",
"0.5701735",
"0.5619509",
"0.5535986",
"0.5482405",
"0.5439231",
"0.540613",
"0.53998137",
"0.53452617",
"0.5292144",
"0.5219815",
"0.5168766",
"0.5168082",
"0.5163145",
"0.5085094",
"0.50767064",
"0.5047837",
"0.49846998",
"0.49724737",
"0.49563593",
"0.49342588",
"0.49314743",
"0.4928846",
"0.48226726",
"0.48015893",
"0.47923255"
]
| 0.7538135 | 0 |
Template function: Current answer pid (defaults to echo) | function pzdc_answer_pid($echo = TRUE) {
global $PraizedCommunity;
return $PraizedCommunity->tpt_attribute_helper('answer', 'pid', $echo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ipal_show_current_question_id(){\r\n global $DB;\r\n global $ipal;\r\n if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\treturn($question->question_id);\r\n }\r\nelse{\r\nreturn(0);\r\n}\r\n}",
"function ipal_show_current_question(){\r\n\tglobal $DB;\r\n\tglobal $ipal;\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t $questiontext=$DB->get_record('question',array('id'=>$question->question_id)); \r\n\techo \"The current question is -> \".strip_tags($questiontext->questiontext);\r\nreturn(1);\r\n\t }\r\n\telse\r\n\t {\r\n\t return(0);\r\n\t }\r\n}",
"public function getPID(): string {\n return $this->_pid;\n }",
"function getPid() ;",
"function getPID() { \n\t\treturn $this->_pid; \n\t}",
"public function getPid() {}",
"function questionID()\r\n {\r\n $ret = 0;\r\n\r\n if ( is_a( $this->Question, \"eZQuizQuestion\" ) )\r\n {\r\n $ret = $this->Question->id();\r\n }\r\n\r\n return $ret;\r\n }",
"public function getAnswerId( ) {\n\t\treturn $this->answer_id;\n\t}",
"public function get_id_question()\n\t{\n\t\treturn $this->id_question;\n\t}",
"public function show($pid)\n {\n //\n }",
"public function getPid() {\n return $this->pid;\n }",
"public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}",
"public function outputId()\n\t{\n\t\techo App::e($this->id);\n\t}",
"function ipal_display_student_interface(){\r\n\tglobal $DB;\r\n\tipal_java_questionUpdate();\r\n\t$priorresponse = '';\r\n\tif(isset($_POST['answer_id'])){\r\n\t if($_POST['answer_id'] == '-1'){\r\n\t \t$priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($_POST['a_text']);\r\n\t }\r\n\t else\r\n\t {\r\n\t $answer_id = $_POST['answer_id'];\r\n\t\t $answer = $DB->get_record('question_answers', array('id'=>$answer_id));\r\n\t\t //$answer = $DB\r\n\t\t $priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($answer->answer);\r\n\t }\r\n\t ipal_save_student_response($_POST['question_id'],$_POST['answer_id'],$_POST['active_question_id'],$_POST['a_text']);\r\n\t}\r\n echo $priorresponse;\r\n ipal_make_student_form();\t\r\n}",
"static public function obtener_idpregunta_disponible()\n {\n return self::$conexion->autoID(\"pregunta\",\"id_pregunta\");\n }",
"public function getPid()\n {\n return $this->pid;\n }",
"public function getPid()\n {\n return $this->pid;\n }",
"public function getPid()\n {\n return $this->pid;\n }",
"public function getPid()\n {\n return $this->pid;\n }",
"protected static function replyidAction($ajax) {\n\t\tglobal $db;\n\t\tif(isset($_GET['postid']))\n\t\t\tif($reply = $db->query('select id from forum_replies where postid=\\'' . +$_GET['postid'] . '\\' limit 1'))\n\t\t\t\tif($reply = $reply->fetch_object())\n\t\t\t\t\t$ajax->Data->id = $reply->id;\n\t\t\t\telse\n\t\t\t\t\t$ajax->Fail('no reply with post id ' . +$_GET['postid']);\n\t\t\telse\n\t\t\t\t$ajax->Fail('error looking up reply from postid', $db->errno . ' ' . $db->error);\n\t\telse\n\t\t\t$ajax->Fail('postid is required.');\n\t}",
"public function display_current()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" display ? ?\");\n\t}",
"function gettid_pid($pid)\n{\n $tid = mysql_fetch_array(mysql_query(\"SELECT tid FROM ibwf_posts WHERE id='\".$pid.\"'\"));\n return $tid[0];\n}",
"public function getQuestionId() {\n\t\treturn $this->questionId;\n\t}",
"function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }",
"public function getPId();",
"public function OutputAnswer($userid = 0)\n\t{\tob_start();\n\t\tif ($this->details['qanswer'])\n\t\t{\techo '<div class=\"qanswerText\">', stripslashes($this->details['qanswer']), '</div>';\n\t\t}\n\t\tif ($mmlist = $this->GetMultiMedia())\n\t\t{\tforeach ($mmlist as $mm_row)\n\t\t\t{\t$mm = new Multimedia($mm_row);\n\t\t\t\techo '<div class=\"qanswerMM\">', $mm->Output(635, 380), '</div>';\n\t\t\t}\n\t\t}\n\t\t$comment = new StudentComment();\n\t\t$comments = new StudentComments('askimamquestions', $this->id);\n\t\tif ($this->CommentsOpen())\n\t\t{\techo '<div id=\"yourReviewContainer\">', $comment->CreateForm($this->id, 'askimamquestions', $userid > 0), '</div><div class=\"clear\"></div>';\n\t\t} else\n\t\t{\techo '<p>This question is now closed to further comments.</p>';\n\t\t}\n\t\techo '<div id=\"prodReviewListContainer\">', $comments->OutputList(2), '</div>';\n\t\treturn ob_get_clean();\n\t}",
"private function get_current_id() {\n\n\t\tstatic $id = null;\n\n\t\treturn $id ?: $id = \\get_queried_object_id();\n\t}",
"protected function k_pidSuffix():string {return 'id';}",
"function currentQuestionID($var){\n $query = $this->db->query('SELECT question_id FROM leader WHERE user_id =\"'.$var.'\"');\n $greater = 0;\n foreach ($query->result_array() as $row) {\n \tif($row['question_id'] > $greater)\n \t\t$greater = $row['question_id'];\n }\n return $greater;\n }",
"public function nextQuestion(){\n $curr = $this->request->getVar(\"currQuestion\");\n $selected = $this->request->getVar(\"selected\");\n\n if($curr != 1){\n $this->answeredQuestions = $this->session->get('questions');\n $this->answersId = $this->session->get('answers');\n $this->score = $this->session->get('score');\n }\n\n if($curr == 1) $this->resetAll();\n\n $selected -= 1;\n if($curr != 1){\n $this->addValues($selected);\n }\n\n if($curr != 6) {\n $id = $this->generateNextQuestion();\n $question = $this->getQuestion($id);\n $answers = $this->getAnswers($question);\n }\n\n if($curr == 6){\n $id = $this->findRecommendation();\n $this->session->remove('questions');\n $this->session->remove('answers');\n $this->session->remove('score');\n echo \"gotovo,\".$id;\n return;\n }\n\n $this->session->set('questions',$this->answeredQuestions );\n $this->session->set('answers',$this->answersId );\n $this->session->set('score',$this->score);\n\n\n echo $question->text.\"\".$answers;\n\n }"
]
| [
"0.61139846",
"0.6036489",
"0.5860119",
"0.58509076",
"0.5791751",
"0.57732755",
"0.57375836",
"0.57286006",
"0.57042944",
"0.5665438",
"0.5615497",
"0.5593824",
"0.55016434",
"0.54930747",
"0.5466239",
"0.54382545",
"0.54382545",
"0.54382545",
"0.54382545",
"0.54222846",
"0.5420826",
"0.5402582",
"0.538484",
"0.53427434",
"0.5273358",
"0.5235026",
"0.52295524",
"0.5214125",
"0.51949733",
"0.5182943"
]
| 0.74753225 | 0 |
Template function: Current answer permalink (defaults to echo) | function pzdc_answer_permalink($echo = TRUE) {
global $PraizedCommunity;
return $PraizedCommunity->tpt_attribute_helper('answer', 'permalink', $echo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPermalink();",
"function permalink_link()\n {\n }",
"public function link() { return site_url().'/'.$this->post->post_name; }",
"function post_permalink($post = 0)\n {\n }",
"public function get_permalink()\n {\n }",
"function the_permalink($post = 0)\n {\n }",
"public function actionPermalink()\n {\n $faq_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n\n $user_id = XenForo_Visitor::getUserId();\n\n $question = $this->_getQuestionModel()->getById($faq_id);\n\n $this->_getQuestionModel()->logQuestionView($faq_id);\n\n // Likes\n $likeModel = $this->_getLikeModel();\n $question['like_users'] = unserialize($question['like_users']);\n $question['like_date'] = $likeModel->getContentLikeByLikeUser('xf_faq_question', $faq_id, $user_id);\n\n $viewParams = array(\n 'question' => $question,\n 'categories' => $this->_getCategoryModel()->getAll(),\n 'canManageFAQ' => $this->_getQuestionModel()->canManageFAQ(),\n 'canLikeFAQ' => $this->_getQuestionModel()->canLikeFAQ(),\n );\n\n return $this->getWrapper('faq', 'x', $this->responseView('Iversia_FAQ_ViewPublic_Permalink', 'iversia_faq_question', $viewParams));\n }",
"function permalink_anchor($mode = 'id')\n {\n }",
"function post_slug($display = true) {\n\t\tif($display) echo $_GET['page'];\n\t\treturn $_GET['page'];\n\t}",
"function get_permalink($post = 0, $leavename = \\false)\n {\n }",
"function rdf_permalink( $my_post ) {\n $permalink = site_url( ) . \"?ps_articles=\" . $my_post->post_name;\n return( $permalink );\n}",
"function do_permalink($atts) {\n\textract(shortcode_atts(array(\n\t\t'id' => 1,\n\t\t'text' => \"\" // default value if none supplied\n\t), $atts));\n\n\tif ($text) {\n\t\t$url = get_permalink($id);\n\t\treturn \"<a href='$url'>$text</a>\";\n\t} else {\n\t\treturn get_permalink($id);\n\t}\n}",
"function getPermalink() {\n\t\treturn $this->get(\"permalink\");\n\t}",
"function get_the_permalink($post = 0, $leavename = \\false)\n {\n }",
"function get_post_permalink($post = 0, $leavename = \\false, $sample = \\false)\n {\n }",
"function wp_wikipedia_excerpt_substitute($match){\n #Mike Lay of http://www.mikelay.com/ suggested query.\n return '<a href=\"http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search='.urlencode($match[1]).'\">'.$match[1].'</a>';\n}",
"function qa_self_html()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_used_url_format;\n\n\treturn qa_path_html(qa_request(), $_GET, null, $qa_used_url_format);\n}",
"public function using_permalinks()\n {\n }",
"function hub_edit_sample_permalink_html( $return, $id, $new_title, $new_slug ) {\r\n $post = get_post( $id );\r\n if ( $post && 'hubpage' == $post->post_type ) {\r\n $return = '<strong>' . __( 'Permalink:' ) . '</strong> ' . '<span id=\"sample-permalink\" tabindex=\"-1\">' . wpc_client_get_slug( 'hub_page_id' ) . '</span>';\r\n $return .= ' <span id=\"view-post-btn\"><a href=\"'. wpc_client_get_slug( 'hub_page_id' ) . $post->ID .'\" target=\"_blank\" class=\"button button-small\">Preview</a></span>';\r\n }\r\n return $return;\r\n }",
"function learn_press_single_quiz_question() {\n\t\tlearn_press_get_template( 'content-quiz/content-question.php' );\n\t}",
"function langdoc_preview_url($currentfile) {\n if (substr($currentfile, 0, 5) == 'help/') {\n $currentfile = substr($currentfile, 5);\n $currentpathexp = explode('/', $currentfile);\n if (count($currentpathexp) > 1) {\n $url = '/help.php?module='.$currentpathexp[0].'&file='.$currentpathexp[1];\n } else {\n $url = '/help.php?module=moodle&file='.$currentfile;\n }\n } else {\n $url = '';\n }\n return $url;\n}",
"function the_terms_conditions_url(){\n $pages = get_pages(array(\n 'meta_key' => '_wp_page_template',\n 'meta_value' => 'terms-conditions.php'\n ));\n $id = $pages[0]->ID;\n echo get_permalink($id);\n}",
"public function getPermalink()\n {\n return $this->permalink = $this->get()->guid;\n }",
"public function label() {\n\t\t\t\n\t\t\t$option = get_theme_option('blog_options', 'post_link_option');\n\n\t\t\tswitch ($option) {\n\t\t\t\tcase '1':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\n\t\t\t\t\t$output = __('Continue reading', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\n\t\t\t\t\t$output = __('See full article', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read this post', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\n\t\t\t\t\t$output = __('Learn more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t\t$output = empty($list_link) ? __('Read more', 'theme translation') : $list_link;\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $output;\n\t\t}",
"public function permalink()\n {\n $permalink = get_permalink($this->wpPost);\n\n return $this->setAttribute(__METHOD__, $permalink);\n }",
"function get_page_link($post = \\false, $leavename = \\false, $sample = \\false)\n {\n }",
"function _get_page_link($post = \\false, $leavename = \\false, $sample = \\false)\n {\n }",
"public function get_permalink() {\n\t\treturn apply_filters( 'the_permalink', get_permalink( $this->get_id() ) );\n\t}",
"function html5_blank_view_article($more)\n{\n global $post;\n // return '... <a class=\"view-article\" href=\"' . get_permalink($post->ID) . '\">' . __('View Article', 'html5blank') . '</a>';\n return '...';\n}",
"function learn_press_single_quiz_result() {\n\t\tlearn_press_get_template( 'content-quiz/result.php' );\n\t}"
]
| [
"0.66432995",
"0.6549428",
"0.65475965",
"0.6538208",
"0.63893497",
"0.634041",
"0.6335962",
"0.63190335",
"0.630486",
"0.6280863",
"0.6227607",
"0.62250435",
"0.6130315",
"0.6124214",
"0.6075038",
"0.6060774",
"0.6022322",
"0.60178685",
"0.5987883",
"0.5967236",
"0.5951831",
"0.5907885",
"0.58844835",
"0.5880754",
"0.5853361",
"0.5838569",
"0.5835739",
"0.58025944",
"0.58018374",
"0.5792398"
]
| 0.6914216 | 0 |
Template function: Current answer content (defaults to echo) | function pzdc_answer_content($echo = TRUE) {
global $PraizedCommunity;
return $PraizedCommunity->tpt_answer_content($echo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function learn_press_single_quiz_result() {\n\t\tlearn_press_get_template( 'content-quiz/result.php' );\n\t}",
"public function index()\n {\n return $this->renderTemplate('index', array(\n 'answerToLife' => 42\n ));\n }",
"function ipal_show_current_question(){\r\n\tglobal $DB;\r\n\tglobal $ipal;\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t $questiontext=$DB->get_record('question',array('id'=>$question->question_id)); \r\n\techo \"The current question is -> \".strip_tags($questiontext->questiontext);\r\nreturn(1);\r\n\t }\r\n\telse\r\n\t {\r\n\t return(0);\r\n\t }\r\n}",
"function showContent()\n {\n if (!empty($this->error)) {\n $this->element('p', 'error', $this->error);\n }\n\n if ($this->boolean('ajax')) {\n $this->showAjaxReviseForm();\n } else {\n $form = new QnareviseanswerForm($this->answer, $this);\n $form->show();\n }\n\n return;\n }",
"protected function output() {\n\t\treturn $this->before() . $this->option( 'content' ) . $this->after();\n\t}",
"function printSaying() {\n\n //show the view\n echo Template::instance()->render('views/saying.php');\n }",
"function showAnswers()\n\t{\n\t\tif($this->TotalAnswers != 1){$s = 's';}else{$s = '';} #add 's' only if NOT one!!\n\t\techo \"<em>[\" . $this->TotalAnswers . \" answer\" . $s . \"]</em> \"; \n\t\tforeach($this->aAnswer as $answer)\n\t\t{#print data for each\n\t\t\techo \"<em>(\" . $answer->AnswerID . \")</em> \";\n\t\t\techo $answer->Text . \" \";\n\t\t\tif($answer->Description != \"\")\n\t\t\t{#only print description if not empty\n\t\t\t\techo \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t}\n\t\t}\n\t\tprint \"<br />\";\n\t}",
"public function get_content_plain()\n {\n\n ob_start();\n RP_SUB_Help::include_template($this->template_plain, array_merge($this->template_variables, array('plain_text' => true)));\n return ob_get_clean();\n }",
"private function printAnswerPage() {\n\t\t$correctVocabulary = 0;\n\t\t$wrongVocabulary = 1;\n\t\tinclude ('html/vocabularyAnswer.php');\n\t}",
"public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}",
"function learn_press_single_quiz_question() {\n\t\tlearn_press_get_template( 'content-quiz/content-question.php' );\n\t}",
"public function show(Answer $Answer)\n {\n echo \"bakhtawar123\";exit();\n //\n }",
"function displayValue(\\Jazzee\\Entity\\Answer $answer);",
"function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}",
"function show()\r\n\t{\r\n\t\t?>\r\n\r\n\t\t<button class='textlayout' type=\"submit\" name=\"itemtoedit\" value=\"<?php echo $this->orderno ?>\" >\r\n\t\t\t<p>\r\n\t\t\t<span style='font-weight:bold'><?php echo $this->orderno . \". \" . $this->question ; ?></span>\r\n\t\t\t<span style='font-weight:normal'>(<?php echo $this->typeshort; ?>)</span><br>\r\n\t\t\t<span><?php $n = 1; foreach($this->answers as $answerobject){if ($n > 1){echo \", \";}$n ++;echo $answerobject->answer;}?></span>\r\n\t\t\t</p>\r\n\t\t</button><br>\r\n\t\t\r\n\t\t<?php \r\n\t}",
"function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}",
"public function show()\n {\n //\n return 'Rosie can i have a dance';\n }",
"public function render()\n {\n return $this->mathExercise;\n }",
"public function display() {\r\n echo $this->template;\r\n }",
"function getAnswerText(){\r\n\t\tif($this->inDB==false||$this->answer==null){\r\n\t\t\t$type = $this->dbq->getAnswerType($this->answer_id);\r\n\t\t\tif($type==3 || $type==7 || $type==8){\r\n\t\t\t\t$io = new FileIOHandler();\r\n\t\t\t\t$this->answer=$io->MediaRead($type,$this->answer_id);\r\n\t\t\t}else{\r\n\t\t\t\t$temp = $this->dbq->getAnswer($this->answer_id);\r\n\t\t\t\t$num=mysql_numrows($temp);\r\n\t\t\t\t\tif($num==1){\r\n\t\t\t\t\t\tif($type==1){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"text\");\r\n\t\t\t\t\t\t}elseif($type== 2 || $type==4 || $type==5 || $type==9){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"num\");\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $this->answer;\t\t\r\n\t}",
"function display_short_answer_form($question_num){\r\n include(\"variables.inc\");\r\n\tif($question_num == 0) $question_num = 1;\r\n echo(\"\\t<TABLE WIDTH=\\\"$table_width\\\">\\n\");\r\n echo(\"\\t\\t<TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\"><P>\" . $question_num . \")</P></TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<INPUT TYPE=\\\"text\\\" NAME=\\\"question_A\\\" SIZE=\\\"85\\\">\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\">Solution:</TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<TEXTAREA NAME=\\\"answer_A\\\" cols=\\\"65\\\" rows=\\\"10\\\"></textarea>\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t<TD COLSPAN=\\\"2\\\"></TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t</TABLE>\\n\"); \r\n}",
"public function run()\n\t{\n\t\techo vsprintf($this->template,$this->_contents);\n\t}",
"function printContent($input){\n\t\techo $input;\n\t}",
"function render_text_question($label, $input, $additionaltext=\"\", $numeric=false, $extra=\"\", $current=\"\")\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\techo \"<input name=\\\"\" . $input . \"\\\" type=\\\"text\\\" \". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $current . \"\\\"\" . $extra . \"/>\\n\";\n\t\t\t\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}",
"public function execute()\n {\n return $this->renderMyQuestionsAdminPage(__('Questions'));\n }",
"abstract protected function displayContent();",
"function ipal_display_student_interface(){\r\n\tglobal $DB;\r\n\tipal_java_questionUpdate();\r\n\t$priorresponse = '';\r\n\tif(isset($_POST['answer_id'])){\r\n\t if($_POST['answer_id'] == '-1'){\r\n\t \t$priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($_POST['a_text']);\r\n\t }\r\n\t else\r\n\t {\r\n\t $answer_id = $_POST['answer_id'];\r\n\t\t $answer = $DB->get_record('question_answers', array('id'=>$answer_id));\r\n\t\t //$answer = $DB\r\n\t\t $priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($answer->answer);\r\n\t }\r\n\t ipal_save_student_response($_POST['question_id'],$_POST['answer_id'],$_POST['active_question_id'],$_POST['a_text']);\r\n\t}\r\n echo $priorresponse;\r\n ipal_make_student_form();\t\r\n}",
"function setup_question($question,$answer){\n $htmlStr = '<p class=\"question\">'.$question.'</p>';\n $htmlStr .= '<p class=\"answer\">'.nl2br($answer).'</p>';\n return $htmlStr;\n}",
"public function showResults(){\n $this->extractQuestions();\n }",
"public function display()\n {\n return 'I am a mallard duck';\n }"
]
| [
"0.6596057",
"0.6357175",
"0.63338345",
"0.6331963",
"0.6319106",
"0.62815267",
"0.6264724",
"0.6248425",
"0.6177948",
"0.6105952",
"0.6083066",
"0.6070545",
"0.6057158",
"0.602704",
"0.6000365",
"0.598585",
"0.5985163",
"0.59800196",
"0.5978304",
"0.59624666",
"0.59600383",
"0.5957844",
"0.5957605",
"0.5956207",
"0.59482074",
"0.59459287",
"0.5935196",
"0.59198725",
"0.59185785",
"0.59122825"
]
| 0.7108255 | 0 |
Template function: Current answer creation date (defaults to echo) | function pzdc_answer_created_at($echo = TRUE, $format = NULL) {
global $PraizedCommunity;
$out = $PraizedCommunity->tpt_attribute_helper('answer', 'created_at', FALSE);
if ( strstr($format, '%'))
$out = pzdc_date($out, $format);
if ( $echo )
echo $out;
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function question_template() {\n return 'mod_kilman/question_date';\n }",
"public function get_date_created();",
"function action_date_title()\n{\n\treturn time();\n}",
"function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}",
"function thememount_entry_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\"><span class=\"thememount-entry-date\"><time class=\"entry-date\" datetime=\"%1$s\" >%2$s<span class=\"entry-month entry-year\">%3$s<span class=\"entry-year\">%4$s</span></span></time></span><div class=\"thememount-entry-icon\">%5$s</div></div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( 'Y' ),\n\t\t\tthememount_entry_icon()\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}",
"function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}",
"function bootstrap_posted_on() {\n\tprintf(get_the_date());\n}",
"public function getCurrentDate()\n\t{\n\t\techo date(\"Y-m-d\");\t\n\t\n\t}",
"function date_creation($date_creation){\n $timestamp = strtotime($date_creation);\n $months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n $day = date('d', $timestamp);\n $month = date('m', $timestamp) - 1;\n $year = date('Y', $timestamp);\n $date_creation = \"$months[$month] \" . \"$day, \" . \"$year\";\n return $date_creation;\n}",
"public function date() {\n\n\t\t\t$output = '';\n\n\t\t\t$output['date'] = mysql2date(get_option('date_format'), $this->post->post_date);\n\t\t\t$output['time'] = mysql2date(get_option('time_format'), $this->post->post_date);\n\t\t\t$output['posted'] = sprintf(__('Posted %1$s at %2$s', 'theme translation'), mysql2date(get_option('date_format'), $this->post->post_date), mysql2date(get_option('time_format'), $this->post->post_date));\n\t\t\t$output['datetime'] = mysql2date('c', $this->post->post_date);\n\n\t\t\treturn $output;\n\t\t}",
"private function currentDate(): string {\n return $this->dateFormatter->format($this->time->getCurrentTime(), 'custom', 'Y-m-d');\n }",
"public function display_date(){\n\t\t$display = date('d-m-Y');\n\t\treturn $display;\n\t}",
"public function display_date(){\n\t\t$display = date('d/m/Y');\n\t\treturn $display;\n\t}",
"public function getDate_creation()\n {\n return $this->date_creation;\n }",
"function agilespirit_entry_date( $echo = true ) {\n if ( has_post_format( array( 'chat', 'status' ) ) )\n $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'agilespirit' );\n else\n $format_prefix = '%2$s';\n\n $date = sprintf( '<span class=\"date\">' . __('Published on ', 'agilespirit') . '<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n esc_url( get_permalink() ),\n esc_attr( sprintf( __( 'Permalink to %s', 'agilespirit' ), the_title_attribute( 'echo=0' ) ) ),\n esc_attr( get_the_date( 'c' ) ),\n esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n );\n\n if ( $echo )\n echo $date;\n\n return $date;\n}",
"function current_datetime()\n {\n }",
"public function getCreateDate(): string\n {\n return $this->create_date;\n }",
"public function getDateCreated();",
"public function getDateCreated()\n\t{\n\t\t$date = new Precurio_Date($this->date_created);\n\t\tif($date->isYesterday()) return 'Yesterday';\n\t\tif($date->isToday()) return 'Today';\n\t\t\n\t\treturn $date->get(Precurio_Date::DATE_SHORT);\n\t}",
"function writeDateQuestion ($id, $name, $label, $message, $placeholder, $branchExit) {\n\tglobal $datetimes;\n\tif (!empty($branchExit)) {\n\t\techo '<div class=\"step\" data-state=\"'.$branchExit.'\">';\n\t}\n\telse {\n\t\techo '<div class=\"step\" id=\"'.$id.'\">';\n\t}\n\techo '<div class=\"section\"><div class=\"card-header m-b-0\">\n\t\t\t<label for=\"'.$id.'\">'.$label.'</label>';\n\t\t\tif (!empty($message)) {\n\t\t\t\techo '<p>'.$message.'</p>';\n\t\t\t}\n\t\t\t\techo '<hr class=\"card-line\" align=\"left\">\n\t\t</div><div class=\"card-body m-b-30\">\n\t\t\t\t<input type=\"tel\" name=\"'.$name.'\" id=\"input'.$id.'\" class=\"form-control\" placeholder=\"'.$placeholder.'\" ';\n\t\t\t\tif (isset($datetimes[$id])) {\n \techo 'value=\"'.date('m/d/Y', strtotime($datetimes[$id])).'\">';\n }\n else {\n \techo '>';\n }\n\techo '</div></div></div>';\n\techo '<script>\n\t\tvar cleave'.$id.' = new Cleave(\"#input'.$id.'\", {\n\t date: true,\n \tdelimiter: \"/\",\n \tdatePattern: [\"m\", \"d\", \"Y\"]\n\t\t});\n\t</script>';\n}",
"public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }",
"function quasar_entry_date( $echo = true ) {\n\t$format_prefix = ( has_post_format( 'chat' ) || has_post_format( 'status' ) ) ? _x( '%1$s on %2$s', '1: post format name. 2: date', 'quasar' ): '%2$s';\n\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'quasar' ), the_title_attribute( 'echo=0' ) ) ),\n\t\tesc_attr( get_the_date( 'c' ) ),\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n\t);\n\n\tif ( $echo )\n\t\techo $date;\n\n\treturn $date;\n}",
"function genDate() {\n\n\t\t$month = strftime(\"%m\");\n\n\t\t$day = strftime(\"%d\");\n\t\t\t\n\t\t$year = strftime(\"%Y\");\n\n\t\t$currentDate = $year . $month . $day;\n\t\t$currentDate = (integer) $currentDate;\n\n\t\treturn $currentDate;\n\t}",
"function thememount_entry_box_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-box-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\">\n\t\t\t\t\t\t\t\t<span class=\"thememount-entry-date\">\n\t\t\t\t\t\t\t\t\t<time class=\"entry-date\" datetime=\"%1$s\" >\n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-date\">%2$s</span> \n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-month\">%3$s</span> \n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-year\">%4$s</span> \n\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( ' Y' )\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}",
"public function getCreationDate();",
"function date_now() {\n return date(\"Y-m-d\");\n}",
"public function getDateCreation()\n {\n return $this->date_creation;\n }",
"public function get_date_create()\n\t{\n\t\treturn $this->date_create;\n\t}",
"function date_modif_manuelle_autoriser() {\n}",
"function dx_write_deploy_date() {\n\n\t// And some inline style. Its not needed to hook it in wp_head at all for just 4-5 properties.\n\t$style = \"position:fixed; bottom:0; right:0; display: block; padding: 0px 2px; font-family: 'Courier New'; font-size: 10px; margin: 0; background: black; color: white;line-height:1em\";\n\n // Print the end result\n if(isset($_COOKIE['dx_deploy_timer_cooke'])) {\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'\">Deployed: '.$_COOKIE['dx_deploy_timer_cooke'].' GMT +0</p>';\n\t} else {\n\t\t$cur_date = get_date_mod();\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'; background: blue\">Deployed: '.$cur_date.' GMT +0 (Cookies updated)</p>';\n\t}\n}"
]
| [
"0.7006385",
"0.6849955",
"0.6585595",
"0.65626806",
"0.6535771",
"0.65323025",
"0.6353296",
"0.63356644",
"0.63274735",
"0.63221806",
"0.6319094",
"0.6301945",
"0.62798476",
"0.6279081",
"0.6272804",
"0.6271872",
"0.62542444",
"0.6246117",
"0.62416136",
"0.6235833",
"0.623345",
"0.6229826",
"0.6229217",
"0.6215444",
"0.62107855",
"0.62046266",
"0.6172233",
"0.6170509",
"0.6167941",
"0.6165543"
]
| 0.7245025 | 0 |
Template function: Current answer update date (defaults to echo) | function pzdc_answer_updated_at($echo = TRUE, $format = NULL) {
global $PraizedCommunity;
$out = $PraizedCommunity->tpt_attribute_helper('answer', 'updated_at', FALSE);
if ( strstr($format, '%'))
$out = pzdc_date($out, $format);
if ( $echo )
echo $out;
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUpdate_date(){\n return $this->update_date;\n }",
"public function question_template() {\n return 'mod_kilman/question_date';\n }",
"function thememount_entry_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\"><span class=\"thememount-entry-date\"><time class=\"entry-date\" datetime=\"%1$s\" >%2$s<span class=\"entry-month entry-year\">%3$s<span class=\"entry-year\">%4$s</span></span></time></span><div class=\"thememount-entry-icon\">%5$s</div></div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( 'Y' ),\n\t\t\tthememount_entry_icon()\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}",
"function dx_write_deploy_date() {\n\n\t// And some inline style. Its not needed to hook it in wp_head at all for just 4-5 properties.\n\t$style = \"position:fixed; bottom:0; right:0; display: block; padding: 0px 2px; font-family: 'Courier New'; font-size: 10px; margin: 0; background: black; color: white;line-height:1em\";\n\n // Print the end result\n if(isset($_COOKIE['dx_deploy_timer_cooke'])) {\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'\">Deployed: '.$_COOKIE['dx_deploy_timer_cooke'].' GMT +0</p>';\n\t} else {\n\t\t$cur_date = get_date_mod();\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'; background: blue\">Deployed: '.$cur_date.' GMT +0 (Cookies updated)</p>';\n\t}\n}",
"function pzdc_answer_created_at($echo = TRUE, $format = NULL) {\n global $PraizedCommunity;\n $out = $PraizedCommunity->tpt_attribute_helper('answer', 'created_at', FALSE);\n if ( strstr($format, '%'))\n $out = pzdc_date($out, $format);\n if ( $echo )\n echo $out;\n return $out;\n}",
"function tcsn_post_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) )\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'tcsn_theme' );\n\telse\n\t\t$format_prefix = '%2$s';\n\t$date = sprintf( '<span class=\"date updated\">on <a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span><span class=\"text-sep\">/</span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'tcsn_theme' ), the_title_attribute( 'echo=0' ) ) ),\n\t\tesc_attr( get_the_date( 'c' ) ),\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n\t);\n\tif ( $echo )\n\t\techo $date;\n\treturn $date;\n}",
"function quasar_entry_date( $echo = true ) {\n\t$format_prefix = ( has_post_format( 'chat' ) || has_post_format( 'status' ) ) ? _x( '%1$s on %2$s', '1: post format name. 2: date', 'quasar' ): '%2$s';\n\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'quasar' ), the_title_attribute( 'echo=0' ) ) ),\n\t\tesc_attr( get_the_date( 'c' ) ),\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n\t);\n\n\tif ( $echo )\n\t\techo $date;\n\n\treturn $date;\n}",
"function agilespirit_entry_date( $echo = true ) {\n if ( has_post_format( array( 'chat', 'status' ) ) )\n $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'agilespirit' );\n else\n $format_prefix = '%2$s';\n\n $date = sprintf( '<span class=\"date\">' . __('Published on ', 'agilespirit') . '<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n esc_url( get_permalink() ),\n esc_attr( sprintf( __( 'Permalink to %s', 'agilespirit' ), the_title_attribute( 'echo=0' ) ) ),\n esc_attr( get_the_date( 'c' ) ),\n esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n );\n\n if ( $echo )\n echo $date;\n\n return $date;\n}",
"function newsdot_posted_on() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_date', true ) ) :\n\t\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t\t}\n\n\t\t\t$time_string = sprintf(\n\t\t\t\t$time_string,\n\t\t\t\tesc_attr( get_the_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_date() ),\n\t\t\t\tesc_attr( get_the_modified_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_modified_date() )\n\t\t\t);\n\n\t\t\t?>\n\n\t\t\t<span class=\"posted-on\">\n\t\t\t\t<i class=\"far fa-calendar\"></i>\n\t\t\t\t<a href=\"<?php echo esc_url( get_permalink() ); ?>\" rel=\"bookmark\"><?php echo $time_string; ?></a>\n\t\t\t</span>\n\n\t\t\t<?php\n\t\tendif;\n\t}",
"function bootstrap_posted_on() {\n\tprintf(get_the_date());\n}",
"function action_date_title()\n{\n\treturn time();\n}",
"function thememount_entry_box_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-box-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\">\n\t\t\t\t\t\t\t\t<span class=\"thememount-entry-date\">\n\t\t\t\t\t\t\t\t\t<time class=\"entry-date\" datetime=\"%1$s\" >\n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-date\">%2$s</span> \n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-month\">%3$s</span> \n\t\t\t\t\t\t\t\t\t\t<span class=\"entry-year\">%4$s</span> \n\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( ' Y' )\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}",
"public function getDateUpdate()\n {\n return $this->date_update;\n }",
"public function getDateUpdate()\n {\n return $this->date_update;\n }",
"public function getCurrentDate()\n\t{\n\t\techo date(\"Y-m-d\");\t\n\t\n\t}",
"function accouk_display_post_last_updated() {\n\n $show_last_updated = array(\n 'web',\n 'ecommerce',\n 'development'\n );\n\n global $main_category;\n\n if(!in_array($main_category['slug'], $show_last_updated))\n return;\n\n if(get_the_date('d-m-Y') === get_the_modified_date('d-m-Y'))\n return;\n\n echo '<div class=\"last-updated-date\">Last updated '; the_modified_date(); echo '</div>';\n\n}",
"public function displaynow()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" displaynow ? ?\");\n\t}",
"function classiera_entry_date( $echo = true ) {\r\n\tif ( has_post_format( array( 'chat', 'status' ) ) )\r\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'classiera' );\r\n\telse\r\n\t\t$format_prefix = '%2$s';\r\n\r\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\r\n\t\tesc_url( get_permalink() ),\r\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'classiera' ), the_title_attribute( 'echo=0' ) ) ),\r\n\t\tesc_attr( get_the_date( 'c' ) ),\r\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\r\n\t);\r\n\r\n\tif ( $echo )\r\n\t\techo $date;\r\n\r\n\treturn $date;\r\n}",
"function kcsite_posted_on() {\n//check if tade is not overriden manually\n\tglobal $kcsite_post_metabox;\n\t$kcsite_post_metabox->the_meta();\n\tif($kcsite_post_metabox->get_the_value('kcsite_date_override') != '') {\n\t\t$kcsite_post_metabox->the_value('kcsite_date_override');\n\t} else {\n\t\tif(pll_current_language('slug') == 'en'){\n\t\t\techo get_the_date('F') . ' '. get_the_date('d') .', '. get_the_date('Y');\n\t\t} else {\n\t\t\techo get_the_date('Y') . ' m. ' . get_the_date('F') .' '. get_the_date('d') . ' d.';\n\t\t}\n\t}\n}",
"public function getUpdateDate()\n {\n return $this->updateDate;\n }",
"public function getUpdateDate()\n {\n return $this->updateDate;\n }",
"public function getUpdateDate()\n {\n return $this->updateDate;\n }",
"public function getUpdateDate()\n {\n return $this->updateDate;\n }",
"static function echoLastUpdateInput($resultSet) {\r\n $resultSet->data_seek($resultSet->num_rows - 1);\r\n $lastRow = $resultSet->fetch_array(MYSQLI_ASSOC);\r\n echo \"<tr><td><input type='hidden' value='\" . $lastRow['date'] . \"'></td></tr>\";\r\n\t}",
"public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }",
"public function date() {\n\n\t\t\t$output = '';\n\n\t\t\t$output['date'] = mysql2date(get_option('date_format'), $this->post->post_date);\n\t\t\t$output['time'] = mysql2date(get_option('time_format'), $this->post->post_date);\n\t\t\t$output['posted'] = sprintf(__('Posted %1$s at %2$s', 'theme translation'), mysql2date(get_option('date_format'), $this->post->post_date), mysql2date(get_option('time_format'), $this->post->post_date));\n\t\t\t$output['datetime'] = mysql2date('c', $this->post->post_date);\n\n\t\t\treturn $output;\n\t\t}",
"public function getDateUpdate()\n {\n return $this->dateUpdate;\n }",
"function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}",
"private function currentDate(): string {\n return $this->dateFormatter->format($this->time->getCurrentTime(), 'custom', 'Y-m-d');\n }",
"public function display_date(){\n\t\t$display = date('d/m/Y');\n\t\treturn $display;\n\t}"
]
| [
"0.6501566",
"0.6387943",
"0.63545024",
"0.6338772",
"0.6268726",
"0.62497306",
"0.62400746",
"0.61910963",
"0.6182912",
"0.617213",
"0.61395335",
"0.61238694",
"0.61160564",
"0.61160564",
"0.60986876",
"0.60690296",
"0.6047989",
"0.60397077",
"0.6036389",
"0.6022142",
"0.6022142",
"0.6022142",
"0.6022142",
"0.60122144",
"0.60051024",
"0.59967977",
"0.59955674",
"0.5984264",
"0.59782887",
"0.5957347"
]
| 0.73972625 | 0 |
Template function: Returns the list of merchants/places associated with an answer as | function pzdc_answer_merchants() {
global $PraizedCommunity;
return $PraizedCommunity->tpt_answer_merchants();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAnswers();",
"function getOrganismsList();",
"public function getPlaces();",
"private function parse_answers() {\n\t\t\t$answer = array();\n\n\t\t\tforeach ( $this->answer_data as $index => $answer_data ) {\n\t\t\t\t$no_markup_answer = wp_strip_all_tags( $answer_data->getAnswer() );\n\t\t\t\tpreg_match_all( '#\\{(.*?)\\}#im', $no_markup_answer, $matches );\n\n\t\t\t\tforeach ( $matches[1] as $match ) {\n\t\t\t\t\tpreg_match_all( '#\\[([^\\|\\]]+)(?:\\|(\\d+))?\\]#im', $match, $ms );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Currently only one set of answers are supported by LD.\n\t\t\t\t\t * So as soon as we get matches, we assign and break the loop.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! empty( $ms[1] ) ) {\n\t\t\t\t\t\t$answer = $ms[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $answer;\n\t\t}",
"public function populate()\n {\n $places = $this->placeRepository->list()->get() ? $this->placeRepository->list()->get()->toArray():false;\n\n foreach ($places as $key => $place) {\n $mapper = config('api.mapper');\n $elements = collect(json_decode($this->apiService->get($place['query'])))\n ->pull($mapper['root']);\n\n if ($elements) {\n $geocodes = isset($elements->geocode) ? (array) $elements->geocode:[];\n\n if(!empty($geocodes)){\n\n $data = collect();\n\n foreach ($mapper['response']['fields'] as $key => $value) {\n \n if(isset($geocodes['center']->{$value}))\n $data->put($value, $geocodes['center']->{$value}); \n else\n $data->put($value, $geocodes[$value]);\n }\n\n $slug = $data->pull('slug');\n $result = $this->placeRepository->add(\n ['slug' => $slug],\n $data->toArray()\n );\n\n $recommendations = isset($elements->groups) ? (array) current($elements->groups): [];\n\n foreach ($recommendations['items'] as $recommendation) {\n \n $collection = collect();\n \n foreach ($mapper['response']['groups'] as $group) {\n\n $collection->put('place_id',$result->id);\n\n if(is_array($recommendation->venue->{$group}) || is_object($recommendation->venue->{$group}))\n $collection->put($group,json_encode($recommendation->venue->{$group})); \n else\n $collection->put($group,$recommendation->venue->{$group});\n }\n\n $id = $data->pull('id');\n $this->recommendationRepository->add(\n ['id' => $id],\n $collection->toArray()\n );\n }\n }\n }\n }\n\n return $places;\n }",
"private function getMClist()\n {\n return DB::table('absence')->join('teacher', 'absence.short_name', '=', 'teacher.short_name')\n ->get();\n// return Teacher::whereIn('short_name',Absence::where('date','=',new DateTime('today'))->lists('short_name'))->has('absence')->get();\n }",
"protected function getManagersChoices()\n {\n $consultants = InternalQuery::create()\n ->setComment(sprintf('%s l:%s', __METHOD__, __LINE__))\n ->usePersonTypeQuery()\n ->filterByCode('ia')\n ->endUse()\n ->orderByLastname()\n ->orderByFirstname()\n ->find();\n\n return $consultants->toKeyValue('Id', 'LongName');\n }",
"public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }",
"public function get_answers() {\n\t\t\t$answers = array();\n\t\t\tforeach ( $this->answer_data as $position => $data ) {\n\n\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ] = array(\n\t\t\t\t\t'label' => $data->getAnswer(),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the individual answer node.\n\t\t\t\t *\n\t\t\t\t * @since 3.3.0\n\t\t\t\t *\n\t\t\t\t * @param array $answer_node_data The answer node.\n\t\t\t\t * @param string $type Whether the node is answer node or student answer node.\n\t\t\t\t * @param mixed $data Individual answer data.\n\t\t\t\t */\n\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ] = apply_filters(\n\t\t\t\t\t'learndash_rest_statistic_answer_node_data',\n\t\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ],\n\t\t\t\t\t'answer',\n\t\t\t\t\t$data,\n\t\t\t\t\t$this->question->getId(),\n\t\t\t\t\t$position\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $answers;\n\t\t}",
"public function getSuggestData()\n {\n if (is_null($this->_suggestData)) {\n\n $picklistEntries = $this->getPicklistEntries();\n $response = array();\n $data = array();\n $counter = 0;\n\n if (is_array($picklistEntries)) {\n foreach ($picklistEntries as $entry) {\n $_data = array(\n 'value' => $entry->Moniker,\n 'title' => $entry->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n } elseif ($picklistEntries && ($picklistEntries->Score > 0)) { // only one result\n $_data = array(\n 'value' => $picklistEntries->Moniker,\n 'title' => $picklistEntries->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n\n $this->_suggestData = $data;\n }\n return $this->_suggestData;\n }",
"public function getFarmsEggs(){\n\t\t$url = 'http://www.vermontfresh.net/member-search/MemberSearchForm?Keywords=&ProductCategoryID=9&Categories%5B13%5D=13&RegionID=&action_doMemberSearch=Search';\n\t\treturn $this->parse_data($url);\n\t}",
"public function getCreateCountries()\n {\n return <<<CQL\nMATCH (q:Question)-[:HAS_ANSWER]->(a)\nWHERE q.question CONTAINS('What country do you')\nWITH COLLECT(DISTINCT a.answer) AS countries\nUNWIND countries AS country\nMERGE (c:Country { name: country })\nWITH c\nMERGE (p:Planet { name: 'Earth' })\nMERGE (p)-[:CHILD]->(c);\nCQL;\n }",
"public function getAll()\n {\n return $this->_answers;\n }",
"public function getList() {\n $answerType = $this->params()->fromRoute('answerType');\n $qId = $this->params()->fromRoute('questionId');\n $cId = $this->params()->fromRoute('customerId');\n\t\t$logger = $this->getServiceLocator()->get( 'Log\\App' );\n $logger->log( \\Zend\\Log\\Logger::INFO, \"Rest call to /answer\" );\n $logger->log( \\Zend\\Log\\Logger::INFO, $answerType );\n $logger->log( \\Zend\\Log\\Logger::INFO, $qId );\n $logger->log( \\Zend\\Log\\Logger::INFO, $cId );\n\n $viewArgs = array();\n\n $e = $this->getServiceLocator()->get( 'doctrine.entitymanager.orm_default' );\n $qService = $this->getServiceLocator()->get( 'cap_questionnaire_service' );\n\n\n $viewArgs['question'] = $e->getRepository('CAP\\Entity\\Question')->find($qId);\n $p = $qService->checkPermissions($viewArgs['question']->getQuestionnaireId(), $cId, $this->identity());\n if (!$p) {\n return new JsonModel();\n }\n\n /* get a list of answers for a given question id */\n $viewArgs['answers'] = $e->createQuery( \"SELECT a FROM CAP\\Entity\\Answer a JOIN a.question q WHERE a.question = :questionId ORDER BY a.answerOrder\" )\n ->setParameter('questionId',$qId)\n ->getResult( \\Doctrine\\ORM\\Query::HYDRATE_ARRAY );\n\n\n /* if this is an enum - have to get them for each answer */\n if ($viewArgs['question']->getAnswerType() === \"ENUM\") {\n $em = $e->createQuery( \"SELECT em, e FROM CAP\\Entity\\AnswerEnumMap em JOIN em.answer a JOIN em.answerEnum e WHERE a.question = :questionId ORDER BY em.answerEnumOrder\" )\n ->setParameter('questionId',$qId)\n ->getResult( \\Doctrine\\ORM\\Query::HYDRATE_ARRAY );\n\n\n if ($em) {\n /* load the enums on to the answers */\n foreach ($viewArgs['answers'] as $index => $a) {\n\n $viewArgs['answers'][$index]['answerEnums'] = array();\n foreach ($em as $enum) {\n if ($enum['answerId'] === $a['id']) {\n $viewArgs['answers'][$index]['answerEnums'][] = $enum['answerEnum'];\n }\n }\n }\n }\n }\n\n $viewArgs['customerAnswers'] = $e->createQuery( \"SELECT ca.answerText, a.id as answerId, ae.id as answerEnumId FROM CAP\\Entity\\CustomerAnswer ca JOIN ca.answer a LEFT JOIN ca.answerEnum ae JOIN a.question q WHERE a.question = :questionId AND ca.customer = :customerId ORDER BY a.answerOrder\" )\n ->setParameter('questionId',$qId)\n ->setParameter('customerId',$cId)\n ->getResult( \\Doctrine\\ORM\\Query::HYDRATE_ARRAY );\n\n\n /* if the completion status of the customer_question row is 'NOT STARTED' and permission is WRITE\n * then set the completion status to NOT COMPLETED cause they viewed it\n */\n if ($p === WRITE) {\n $customerQuestion = $e->getRepository('CAP\\Entity\\CustomerQuestion')->findOneBy(array('customer' => $cId, 'question' => $qId));\n if (isset($customerQuestion) && $customerQuestion->getCompletionStatus()->getName() === \"NOT STARTED\") {\n $logger->log( \\Zend\\Log\\Logger::INFO, \"setting customer question completion status to NOT COMPLETED\" );\n $customerQuestion->setCompletionStatus($e->getRepository('CAP\\Entity\\CompletionStatus')->findOneBy(array('name' => 'NOT COMPLETED')));\n $e->persist($customerQuestion);\n $e->flush();\n }\n\n /* if the questionnaire is complete its read only (FORMS stay writeable though */\n $customerQuestionnaire = $e->getRepository('CAP\\Entity\\CustomerQuestionnaire')->findOneBy(array('customer' => $cId, 'questionnaireId' => $viewArgs['question']->getQuestionnaireId()));\n $logger->log( \\Zend\\Log\\Logger::INFO, \"questionnaire completion status is: \".$customerQuestionnaire->getCompletionStatus()->getName() );\n if ($customerQuestionnaire->getCompletionStatus()->getName() === \"COMPLETED\" && $customerQuestionnaire->getQuestionnaire()->getType() == 'QUESTIONNAIRE') {\n $p = READ;\n $logger->log( \\Zend\\Log\\Logger::INFO, \"section is complete so making this question read only\" );\n }\n\n\n }\n\n $viewArgs['percentComplete'] = $qService->percentComplete($viewArgs['question']->getQuestionnaireId(), $cId, $e);\n $viewArgs['success'] = true;\n $viewArgs['disabled'] = ($p === READ);\n return new JsonModel($viewArgs);\n\t}",
"public function get_target_restaurant_list () {\n\t\t$restaurantList = $this->get_param('post.restaurant_list');\n\t\t$grouponRestaurantList = $this->get_param('post.groupon_restaurant_list');\n\n\t\t$this->get_restaurant_list($restaurantList, $grouponRestaurantList);\n\t}",
"function smartchoice_get_all_responses($choice) {\n global $DB;\n return $DB->get_records('smartchoice_answers', array('choiceid' => $choice->id));\n}",
"public function get_all_question_answer_list()\n\t{\n\t\t\n\t\t$sql=\"select * from question_answer\";\n\t\t$query=$this->db->query($sql);\n\t\t//print_r($query->result_object());die();\n\t\treturn $query->result_object();\n\t}",
"public function getAnswers($myAnswers){\r\n\t\t$pfx = $this->c->dbprefix;\r\n\t\t$conn = $this->conn();\r\n\r\n\t\t$keys = array_keys($myAnswers);\r\n\t\t$ids = implode(\",\",$keys);\r\n\r\n\t\t$sql = \"select\r\n\t\t\t\t answer\r\n\t\t\t\t,id\r\n\t\t\t\t,id_parent\r\n\r\n\t\t\t\t,markingmethod\r\n\t\t\t\t,description\r\n\t\t\t\t,cent\r\n\t\t\t\t,type\r\n\t\t\t\t,option2\r\n\t\t\t\t,option3\r\n\t\t\t\t,option4\r\n\t\t\t\t\r\n\t\t\t\t,ids_level_knowledge\r\n\t\t\t\t\r\n\t\t\t from \".$pfx.\"wls_question where id in (\".$ids.\") order by id ; \";\r\n\t\t$res = mysql_query($sql,$conn);\r\n\t\tif($res==false)echo $sql;\r\n\t\t$data = array();\r\n\t\twhile($temp = mysql_fetch_assoc($res)){\r\n\t\t\t$temp['myAnswer'] = $myAnswers[$temp['id']];\r\n\t\t\t$data[] = $temp;\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}",
"private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }",
"function &joinAnswers()\n\t{\n\t\t$join = array();\n\t\tforeach ($this->answers as $answer)\n\t\t{\n\t\t\tif (!is_array($join[$answer->getPoints() . \"\"]))\n\t\t\t{\n\t\t\t\t$join[$answer->getPoints() . \"\"] = array();\n\t\t\t}\n\t\t\tarray_push($join[$answer->getPoints() . \"\"], $answer->getAnswertext());\n\t\t}\n\t\treturn $join;\n\t}",
"public function getLoans() { // This function returns the array \n return $this->loans;\n }",
"public function iN_ListQuestionAnswerFromLanding() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_landing_qa WHERE qa_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t// Store the result into array\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"function get_potential_matches($person_id) {\n global $person_id, $mysqli, $person_array_data, $states;\n\n // Get personal data\n $get_person_data = \"SELECT * FROM gegevens WHERE id=\".$person_id;\n $person_array_data = $mysqli->query($get_person_data)->fetch_array(MYSQLI_ASSOC);\n\n // As double check drop the created views\n $mysqli->query(\"DROP VIEW `get_answers`, `get_desired`, `get_importance`, `order_questions`;\");\n\n // Create some views\n $mysqli->query(\"CREATE VIEW get_answers AS SELECT answers.person_id, GROUP_CONCAT(answers.ans) AS answers FROM answers GROUP BY answers.person_id\") or die($mysqli->error);\n $mysqli->query(\"CREATE VIEW get_importance AS SELECT importance.person_id, GROUP_CONCAT(importance.imp) AS importance FROM importance GROUP BY importance.person_id\") or die($mysqli->error);\n $mysqli->query(\"CREATE VIEW order_questions AS SELECT desired.person_id, GROUP_CONCAT(desired.ans ORDER BY desired.ans SEPARATOR '-') AS des FROM desired GROUP BY desired.person_id, desired.quest\") or die($mysqli->error);\n $mysqli->query(\"CREATE VIEW get_desired AS SELECT person_id, GROUP_CONCAT(order_questions.des) AS desired FROM order_questions GROUP BY order_questions.person_id\") or die($mysqli->error);\n\n //Get the query for the potential matches and execute query\n $get_potential_matches_query = ($person_array_data['sexse'] == 0) ? generate_query(($person_array_data['gender'] == 0) ? 1 : 0) : (($person_array_data['sexse'] == 1) ? generate_query(($person_array_data['gender'] == 0) ? 0 : 1) : generate_query(\"%\"));\n $get_potential_matches_execute = $mysqli->query($get_potential_matches_query) or die($mysqli->error);\n \n //Make an array with all the potential matches\n $get_potential_matches_array = array();\n while($get_potential_matches_row = $get_potential_matches_execute->fetch_array(MYSQLI_ASSOC) ) {\n\n if(in_array($person_array_data['state'], ($states[$get_potential_matches_row['state']]))) {\n $get_potential_matches_array[] = $get_potential_matches_row;\n }\n }\n\n // Drop the created views\n $mysqli->query(\"DROP VIEW `get_answers`, `get_desired`, `get_importance`, `order_questions`;\");\n\n //Return array\n return $get_potential_matches_array;\n }",
"function languagelesson_key_cloze_answers($answers) {\n $keyedAnswers = array();\n foreach ($answers as $answer) {\n // Only look at the actual answers, not custom feedback (saved to its own answer record).\n if ($answer->answer) {\n $atext = $answer->answer;\n list($num, $text) = explode('|', $atext);\n $answer->answer = $text;\n $keyedAnswers[$num] = $answer;\n }\n }\n return $keyedAnswers;\n}",
"function getSpeakersListForResolution($num) {\n $speakerOrder = getSpeakersListOrder();\n $resSpeakerOrder = array();\n foreach ($speakerOrder as $speaker) {\n $amendmentRow = getAmendmentRow($speaker['id'],$num);\n if ($amendmentRow != null) {\n if ($amendmentRow['status'] == 'approved') {\n array_push($resSpeakerOrder,$amendmentRow['country_id']);\n }\n }\n }\n return $resSpeakerOrder;\n}",
"public function getFarmsMeat(){\n\t\t$url = 'http://www.vermontfresh.net/member-search/MemberSearchForm?Keywords=&ProductCategoryID=7&Categories%5B13%5D=13&RegionID=&action_doMemberSearch=Search';\n\t\treturn $this->parse_data($url);\n\t}",
"function emic_cwrc_get_authorities($dataType, $query = \"\") {\n $mappings = array(\n 'Tag Place' => array('collection' => 'islandora:9247', 'type' => t('Place')),\n 'Tag Person' => array('collection' => 'islandora:9239', 'type' => t('Person')),\n 'Tag Event' => array('collection' => 'islandora:9242', 'type' => t('Event')),\n 'Tag Organization' => array('collection' => 'islandora:9236', 'type' => t('Organization')),\n );\n\n\n\n $authorities = cwrc_get_authorities_list($mappings[$dataType], $query);\n if ($authorities) {\n $json = json_encode($authorities);\n echo $json;\n }\n}",
"public function getAnswers()\n {\n return $this->hasMany(Answers::className(), ['Task' => 'idEntry']);\n }",
"public function getFarms(){\n\t\t$url = 'http://www.vermontfresh.net/member-search/MemberSearchForm?Keywords=&ProductCategoryID=&Categories%5B13%5D=13&RegionID=&action_doMemberSearch=Search';\n\t\treturn $this->parse_data($url);\n\t}",
"function ipal_find_student_responses($userid,$ipal_id){\r\nglobal $DB;\r\n$responses=$DB->get_records('ipal_answered',array('ipal_id'=>$ipal_id, 'user_id'=>$userid));\r\nforeach($responses as $records){\r\n$temp[]=\"Q\".$records->question_id.\" = \".$records->answer_id;\r\n}\r\nreturn(implode(\",\",$temp));\r\n}"
]
| [
"0.575198",
"0.55822414",
"0.5368301",
"0.53590673",
"0.5281142",
"0.52667874",
"0.5235581",
"0.52173",
"0.5199373",
"0.51669407",
"0.5152028",
"0.5151702",
"0.5149886",
"0.5119294",
"0.5106992",
"0.5076492",
"0.50676996",
"0.5067246",
"0.5050985",
"0.5013905",
"0.49930745",
"0.4986084",
"0.4969438",
"0.49662545",
"0.4951313",
"0.4942053",
"0.4926148",
"0.4902996",
"0.48995575",
"0.4892991"
]
| 0.5746939 | 1 |
Template function: Current answer community name (defaults to echo) | function pzdc_answer_community_name($echo = TRUE) {
global $PraizedCommunity;
return $PraizedCommunity->tpt_attribute_helper('answer', 'community->name', $echo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pzdc_hub_community_name($echo = TRUE) {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_attribute_helper('hub_community', 'name', $echo);\n}",
"function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}",
"function getCommunityName($content,$conf) {\n\t\tif (intval(trim($this->piVars['community_id'])) <= 0) {\n\t\t\t$community_id = $conf['community_id'];\n\t\t} else {\n\t\t\t$community_id = intval(trim($this->piVars['community_id']));\n\t\t}\n\t\tif ($_SESSION[community_name] > '' ) {\n\t\t\t$content = $_SESSION[community_name];\n\t\t} elseif ($community_id > '' && $community_id != 'choose') {\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'cm_community_name',\n\t\t\t\t\t\t'tx_civserv_conf_mandant',\n\t\t\t\t\t\t'1 '.\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_conf_mandant').\n\t\t\t\t\t\t' AND cm_community_id = '.intval($community_id),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\t\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t$content = $row['cm_community_name'];\n\t\t\t}\n\t\t}else {\n\t\t\t$content = '';\n\t\t}\n\t\treturn $content;\n\t}",
"public function defaultName() { return \"Enter the category name...\"; }",
"function ipal_show_current_question(){\r\n\tglobal $DB;\r\n\tglobal $ipal;\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t $questiontext=$DB->get_record('question',array('id'=>$question->question_id)); \r\n\techo \"The current question is -> \".strip_tags($questiontext->questiontext);\r\nreturn(1);\r\n\t }\r\n\telse\r\n\t {\r\n\t return(0);\r\n\t }\r\n}",
"protected function get_current_question_text(): string {\n $submitteddata = optional_param_array('questiontext', '', PARAM_RAW);\n if ($submitteddata) {\n // Form has been submitted, but it being re-displayed.\n return $submitteddata['text'];\n }\n if (isset($this->question->id)) {\n // Form is being loaded to edit an existing question.\n return $this->question->questiontext;\n }\n // Creating new question.\n return '';\n }",
"public function current_title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" current_title ?\");\n\t}",
"public function getName(): string {\n\t\treturn $this->lFactory->get('spreed')->t('Talk');\n\t}",
"function caldol_modify_author_display_name($author_name, $reply_id){\n\t$author_name = $author_name . \"\";\nreturn $author_name;\n\n}",
"public function display_current()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" display ? ?\");\n\t}",
"function getDisplayName() {\r\n\t\treturn __('plugins.generic.markup.displayName');\r\n\t}",
"function displayName(){\n echo \"My name is displayed\";\n }",
"function getDisplayName() {\n\t\treturn __('plugins.generic.thesisfeed.displayName');\n\t}",
"function help($message = null) {\n if (!is_null($message))\n echo($message.NL.NL);\n\n $self = baseName($_SERVER['PHP_SELF']);\n\necho <<<HELP\n\n Syntax: $self [symbol ...]\n\n\nHELP;\n}",
"function getDisplayName() {\n\t\treturn __('plugins.generic.announcementfeed.displayName');\n\t}",
"public function showName()\n {\n echo $this->name;\n }",
"public function getName() {\n\t\treturn $this->current_name;\n\t}",
"function printAcademyName(){\r\n echo \"<p class='username' id='username'>$this->academy </p>\";\r\n }",
"public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }",
"public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }",
"public function getHeaderText()\n {\n return __('New Question');\n }",
"public function getQuestion(): string\n {\n return $this->question;\n }",
"protected function getWebsiteNameComment()\n {\n return '<b>[website_name]</b> - ' . __('output a current website name') . ';';\n }",
"public function label() {\n\t\t\t\n\t\t\t$option = get_theme_option('blog_options', 'post_link_option');\n\n\t\t\tswitch ($option) {\n\t\t\t\tcase '1':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\n\t\t\t\t\t$output = __('Continue reading', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\n\t\t\t\t\t$output = __('See full article', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read this post', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\n\t\t\t\t\t$output = __('Learn more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t\t$output = empty($list_link) ? __('Read more', 'theme translation') : $list_link;\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $output;\n\t\t}",
"function PrintSiteName()\n\t{\n\t\t$name = GetTitle('parameters/preferences', 2);\n\t\techo $name;\n\t}",
"function formatQA( $question, $answer ) {\n return \"> {$question}\\n{$answer}\";\n}",
"public function displayCurrentTitle()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayCurrentTitle();\n }\n }",
"public function name()\n {\n \treturn $this->article->name;\n }",
"function linkCommunityChoice($content,$conf) {\n\t\tif ($this->conf['community_choice']) {\n\t\t\t$notice = str_replace('###COMMUNITY_NAME###','<span class=\"community_name\">' . $this->community['name'] . '</span>',$this->pi_getLL('tx_civserv_pi1_community_choice.notice','The following information is related to ###COMMUNITY_NAME###.'));\n\t\t\t$link_text = $this->pi_getLL('tx_civserv_pi1_community_choice.link_text','Click here, to choose another community.');\n\t\t\t$link = $this->pi_linkTP_keepPIvars($link_text,array(community_id => 'choose',mode => 'service_list'),1,1);\n\t\t\treturn $notice . ' ' . $link;\n\t\t}\n\t}",
"function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}"
]
| [
"0.65929174",
"0.6272064",
"0.624304",
"0.6118805",
"0.59549624",
"0.5878432",
"0.5851263",
"0.5834428",
"0.5825534",
"0.57663107",
"0.57654345",
"0.5755862",
"0.5729981",
"0.5725135",
"0.57136834",
"0.56959033",
"0.56898546",
"0.5687959",
"0.5682004",
"0.5678113",
"0.5675483",
"0.56689703",
"0.5657831",
"0.5627457",
"0.56108403",
"0.559806",
"0.55930614",
"0.5582227",
"0.5572626",
"0.55657995"
]
| 0.77328944 | 0 |
Template function: Current answer community base url (defaults to echo) | function pzdc_answer_community_base_url($echo = TRUE) {
global $PraizedCommunity;
return $PraizedCommunity->tpt_attribute_helper('answer', 'community->base_url', $echo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pzdc_hub_community_base_url($echo = TRUE) {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_attribute_helper('hub_community', 'base_url', $echo);\n}",
"public function url()\n {\n return '/' . $this->currlang();\n }",
"function Twiloop_url_base()\n{\n $url_base = '';\n $url_base = strrpos($_SERVER['PHP_SELF'], '/', -4)+1;\n $url_base = substr($_SERVER['PHP_SELF'], 0, $url_base);\n $url_base = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$url_base;\n return $url_base;\n}",
"function base_url() {\r\necho \"<base href=\" . get_site_url() . \">\";\r\n}",
"public function url(){\r\n\t\techo $_SERVER['SERVER_NAME'].\" => \".$_SERVER['PHP_SELF'];\r\n\t}",
"public function url()\n\t{\n\t\treturn Url::to(\"review/\".$this->id.\"/\".$this->slug.\"/\".Session::get('Lang'));\n\t}",
"public function url() {\n if ($this->no_results)\n return false;\n\n $config = Config::current();\n\n return url(\"view/\".$this->url, ExtendController::current());\n }",
"function base_url(){\n $url = BASE_URL;\n return $url;\n }",
"function base_url(){\n return BASE_URL;\n }",
"function realanswers_current_page_url() {\r\n $pageURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n else\r\n {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n}",
"public function url()\r\t{\r\t\treturn 'http://morningpages.net/mail/show/'.$this->token;\r\t\t//return url::site('mail/show/' . $this->token, 'http');\r\t}",
"public static function _url() {\n\t\treturn self::pw('pages')->get('pw_template=mpm')->url;\n\t}",
"function formatCurrentUrl() ;",
"function pzdc_hub_community_home_url($echo = TRUE) {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_attribute_helper('hub_community', 'home_url', $echo);\n}",
"public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}",
"public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}",
"public function base_url(){\n return $this->plugin_url() . 'base/';\n }",
"function theme_global_url($bQuestion=false) {\n global $theme;\n $langid = (isset($_REQUEST['langid'])) ? intval($_REQUEST['langid']) : 0;\n $out = '';\n if ($bQuestion) {\n $out .= '?';\n }\n if ($langid > 0) {\n $out .= '&langid=' . $langid;\n }\n return $out;\n}",
"function returnbaseurl()\n{\n return \"http://audio.qu.tu-berlin.de/amtoolbox\";\n}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"protected function renderCurrentUrl() {}",
"protected function renderCurrentUrl() {}",
"function currentUrl($value='')\n\t{\n\t \treturn 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];\n\t}",
"public function getViewLink() {\n return getConfig(\"public_url\").\"?\".$this->shareID;\n }",
"public function get_url()\n\t{\n\t\treturn append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, \"i=pm&mode=view&p={$this->item_id}\");\n\t}"
]
| [
"0.7046336",
"0.6991275",
"0.6703107",
"0.65687627",
"0.6547273",
"0.65252006",
"0.65221125",
"0.64541996",
"0.6406084",
"0.63991785",
"0.63912255",
"0.6376294",
"0.6372226",
"0.63653404",
"0.6341989",
"0.6341989",
"0.6340184",
"0.6325074",
"0.6322471",
"0.63210034",
"0.63210034",
"0.63210034",
"0.63210034",
"0.63210034",
"0.63210034",
"0.63191044",
"0.63191044",
"0.63004",
"0.6273462",
"0.6269495"
]
| 0.79169625 | 0 |
Returns all the benchmark tokens by group and name as an array. | public static function groups() {
$groups = array();
foreach (Profiler::$_marks as $token => $mark) {
// Sort the tokens by the group and name
$groups[$mark['group']][$mark['name']][] = $token;
}
return $groups;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBenchmarksByGroup(string $name){\n $benchmark_group = [];\n foreach($this->benchmarks as $benchmark){\n if($benchmark->getName() == $name || Text::startsWith($benchmark->getName(), $name.'.')){\n $benchmark_group[] = $benchmark;\n }\n }\n return $benchmark_group;\n }",
"protected static function get_benchmarks() : array\n\t{\n\t\t$result = [];\n\n\t\tif (! Kohana::$profiling)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t$groups = Profiler::groups();\n\n\t\tforeach (array_keys($groups) as $group)\n\t\t{\n\t\t\tif (strpos($group, 'database (') === FALSE)\n\t\t\t{\n\t\t\t\tforeach ($groups[$group] as $name => $marks)\n\t\t\t\t{\n\t\t\t\t\t$stats = Profiler::stats($marks);\n\t\t\t\t\t$result[$group][] = [\n\t\t\t\t\t\t'name' => $name,\n\t\t\t\t\t\t'count' => count($marks),\n\t\t\t\t\t\t'total_time' => $stats['total']['time'],\n\t\t\t\t\t\t'avg_time' => $stats['average']['time'],\n\t\t\t\t\t\t'total_memory' => $stats['total']['memory'],\n\t\t\t\t\t\t'avg_memory' => $stats['average']['memory'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add total stats\n\t\t$total = Profiler::application();\n\t\t$result['application'] = [\n\t\t\t'count' => 1,\n\t\t\t'total_time' => $total['current']['time'],\n\t\t\t'avg_time' => $total['average']['time'],\n\t\t\t'total_memory' => $total['current']['memory'],\n\t\t\t'avg_memory' => $total['average']['memory'],\n\n\t\t];\n\n\t\treturn $result;\n\t}",
"public function getTokens();",
"public function getGroupedOpcodesDataProvider(): array\n {\n return [\n [\n <<<'EOT'\napples\noranges\nkiwis\ncarrots\nEOT\n ,\n <<<'EOT'\napples\nkiwis\ncarrots\ngrapefruits\nEOT\n ,\n [\n [\n [SequenceMatcher::OP_EQ, 0, 1, 0, 1],\n [SequenceMatcher::OP_DEL, 1, 2, 1, 1],\n [SequenceMatcher::OP_EQ, 2, 4, 1, 3],\n [SequenceMatcher::OP_INS, 4, 4, 3, 4],\n ],\n ],\n ],\n ];\n }",
"public function tokensDataProvider(): array\n {\n return [\n 'PHP 7' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NS_SEPARATOR, '\\\\'],\n 2 => [T_STRING, 'Object'],\n 3 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ],\n 'PHP 8' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NAME_FULLY_QUALIFIED, '\\\\Object'],\n 2 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ]\n ];\n }",
"private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }",
"public function getGroupedOpcodesDataProvider(): array\n {\n return [\n [\n <<<'EOT'\napples\noranges\nkiwis\ncarrots\nEOT\n ,\n <<<'EOT'\napples\nkiwis\ncarrots\ngrapefruits\nEOT\n ,\n [\n [\n ['eq', 0, 1, 0, 1],\n ['del', 1, 2, 1, 1],\n ['eq', 2, 4, 1, 3],\n ['ins', 4, 4, 3, 4],\n ],\n ],\n ],\n ];\n }",
"function getBenchmarksByTag(string $tag){\n $benchmarks = [];\n foreach ($this->benchmarks as $benchmark){\n if($benchmark->hasTag($tag)){\n $benchmarks[] = $benchmark;\n }\n }\n return $benchmarks;\n }",
"public static function start($group, $name, $data=false, $trace = false) {\n\t\tstatic $counter = 0;\n\n\t\t// Create a unique token based on the counter\n\t\t$token = 'kp/'.base_convert($counter++, 10, 32);\n\n\t\tProfiler::$_marks[$token] = array\n\t\t(\n\t\t\t'group' => strtolower($group),\n\t\t\t'name' => (string) $name,\n\n\t\t\t// Start the benchmark\n\t\t\t'start_time' => microtime(TRUE),\n\t\t\t'start_memory' => memory_get_usage(),\n\n\t\t\t// Set the stop keys without values\n\t\t\t'stop_time' => FALSE,\n\t\t\t'stop_memory' => FALSE,\n\t\t\t'data' => $data,\n\t\t\t'trace' => $trace\n\t\t);\n\n\t\treturn $token;\n\t}",
"public function getGroups(): array;",
"public function token_set($grouppost){\n\n $group = (explode(\",\",$grouppost)); //get string grouppost coverto array\n\n foreach($group as $grouparr){ //get toke from $group\n\n $sql = \"SELECT Token FROM notify_token WHERE GroupName = '$grouparr'\";\n $exc = $this->con->query($sql);\n $row = $exc->fetch_array();\n $token[] = $row['Token'];\n }\n \n return $token;\n }",
"public static function getGroups(): array\n {\n return ['test'];\n }",
"public function groups() {\n\t\tif (empty($this->_compiledGroupNames)) {\n\t\t\tforeach ($this->settings['groups'] as $group) {\n\t\t\t\t$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;\n\t\t\t}\n\t\t}\n\n\t\t$groups = $this->_Memcached->getMulti($this->_compiledGroupNames);\n\t\tif (count($groups) !== count($this->settings['groups'])) {\n\t\t\tforeach ($this->_compiledGroupNames as $group) {\n\t\t\t\tif (!isset($groups[$group])) {\n\t\t\t\t\t$this->_Memcached->set($group, 1, 0);\n\t\t\t\t\t$groups[$group] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tksort($groups);\n\t\t}\n\n\t\t$result = array();\n\t\t$groups = array_values($groups);\n\t\tforeach ($this->settings['groups'] as $i => $group) {\n\t\t\t$result[] = $group . $groups[$i];\n\t\t}\n\n\t\treturn $result;\n\t}",
"protected static function get_queries() : array\n\t{\n\t\t$result = [];\n\t\t$count = $time = $memory = 0;\n\n\t\t$groups = Profiler::groups();\n\t\tforeach (Database::$instances as $name => $db)\n\t\t{\n\t\t\t$group_name = 'database ('.strtolower($name).')';\n\t\t\t$group = arr::get($groups, $group_name, FALSE);\n\n\t\t\tif ($group)\n\t\t\t{\n\t\t\t\t$sub_time = $sub_memory = $sub_count = 0;\n\t\t\t\tforeach ($group as $query => $tokens)\n\t\t\t\t{\n\t\t\t\t\t$sub_count += count($tokens);\n\t\t\t\t\tforeach ($tokens as $token)\n\t\t\t\t\t{\n\t\t\t\t\t\t$total = Profiler::total($token);\n\t\t\t\t\t\t$sub_time += $total[0];\n\t\t\t\t\t\t$sub_memory += $total[1];\n\t\t\t\t\t\t$result[$name][] = [\n\t\t\t\t\t\t\t'name' => $query,\n\t\t\t\t\t\t\t'time' => $total[0],\n\t\t\t\t\t\t\t'memory' => $total[1]\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$count += $sub_count;\n\t\t\t\t$time += $sub_time;\n\t\t\t\t$memory += $sub_memory;\n\n\t\t\t\t$result[$name]['total'] = [$sub_count, $sub_time, $sub_memory];\n\t\t\t}\n\t\t}\n\t\treturn [\n\t\t\t'count' => $count,\n\t\t\t'time' => $time,\n\t\t\t'memory' => $memory,\n\t\t\t'data' => $result\n\t\t];\n\t}",
"public static function getGroups(): array\r\n {\r\n // TODO: Implement getGroups() method.\r\n return [\r\n 'test',\r\n 'dev',\r\n ];\r\n }",
"private function createSpans(): array\n {\n $spans = [];\n\n foreach ($this->calls as $call) {\n $span = new Span();\n $span->setName($call['name']);\n $span->setTimestamp(intval(round($call['start'])));\n $span->setType(self::SPAN_TYPE);\n $span->setDuration($this->calculateCallDuration($call));\n\n $spans[] = $span;\n }\n\n return $spans;\n }",
"public function getTokens(): array\n {\n return $this->tokens;\n }",
"public function extractTokens()\n {\n // Prepare the opening and closing tags for the regex\n $openingTag = sprintf( '\\\\%s', implode( '\\\\', str_split( $this->openingTag ) ) );\n $closingTag = sprintf( '\\\\%s', implode( '\\\\', str_split( $this->closingTag ) ) );\n\n // Build the regex\n $regex = sprintf( '/%s([A-Z-_0-9]+)%s/i', $openingTag, $closingTag );\n\n // Find all the tokens in the string\n preg_match_all( $regex, $this->content, $matches, PREG_PATTERN_ORDER );\n\n // If there are no matches, simply return an empty array\n if ( empty( $matches[1] ) )\n {\n return [];\n }\n\n // Return a unique list of tokens\n return array_unique( $matches[ 1 ] );\n }",
"public function token($options = ['format' => 'table']) {\n $all = \\Drupal::token()->getInfo();\n foreach ($all['tokens'] as $group => $tokens) {\n foreach ($tokens as $key => $token) {\n $rows[] = [\n 'group' => $group,\n 'token' => $key,\n 'name' => $token['name'],\n ];\n }\n }\n return new RowsOfFields($rows);\n }",
"public static function total($token) {\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE) {\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t// Data attached to benchmark\n\t\t\t$mark['data'],\n\t\t\t$mark[\"trace\"]\n\t\t);\n\t}",
"function get_group_array()\n{\n\tglobal $db_raid, $table_prefix, $db_raid;\n\tglobal $db_allgroups_id, $db_allgroups_name, $db_table_allgroups ;\n\n\t$group = array();\n\t\n\t$sql = sprintf(\"SELECT \" . $db_allgroups_id . \" , \". $db_allgroups_name .\n\t\t\t\" FROM \" . $table_prefix . $db_table_allgroups .\n\t\t\t\" ORDER BY \". $db_allgroups_id);\n\t\n\t$result_group = $db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(), 1);\n\twhile ($data_wrm = $db_raid->sql_fetchrow($result_group,true))\n\t{\n\t\t$group[$data_wrm[$db_allgroups_id]] = $data_wrm[$db_allgroups_name];\n\t}\n\n\treturn $group;\n}",
"public function getGroupNames()\n {\n $groups = deserialize( $this->groups );\n if ( ! count( $groups ) )\n {\n return array();\n }\n\n $query = 'select name from ' . $this->group_table . ' where ';\n $params = array();\n foreach ( $groups as $group )\n {\n $query .= 'id = ? or ';\n $params[] = $group;\n }\n\n $query = substr( $query, 0, strlen( $query ) - 4 );\n\n $records = $this->Database->prepare( $query )\n ->execute( $params );\n\n $group_names = array();\n while ( $records->next() )\n {\n $group_names[] = $records->name;\n }\n\n return $group_names;\n }",
"function getAllTokens($sql){\n $txt = \"\";\n $rez = vrati_podatke($sql);\n $tokens=array();\n if ($rez->num_rows > 0) {\n while ($row = $rez->fetch_assoc()) {\n array_push($tokens, $row[\"token\"]);\n }\n } \n return $tokens;\n}",
"public static function getGroups(): array\n {\n return [\"group2\"];\n }",
"function timeconditions_timegroups_list_groups() {\n\tglobal $db;\n\t$tmparray = array();\n\n\t$sql = \"select id, description from timegroups_groups order by description\";\n\t$results = $db->getAll($sql);\n\tif(DB::IsError($results)) {\n\t\t$results = null;\n\t}\n\tforeach ($results as $val) {\n\t\t$tmparray[] = array($val[0], $val[1], \"value\" => $val[0], \"text\" => $val[1]);\n\t}\n\treturn $tmparray;\n}",
"public static function total($token)\n\t{\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE)\n\t\t{\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t\n\t\t\t$mark['file'],\n\t\t\t$mark['line']\n\t\t);\n\t}",
"public function getTokens() {\n\t\treturn array_keys($this->tokens);\n\t}",
"function drush_test_list($groups) {\n foreach ($groups as $group_name => $group_tests) {\n foreach ($group_tests as $test_class => $test_info) {\n $rows[] = array('group' => $group_name, 'class' => $test_class, 'name' => $test_info['name']);\n }\n }\n return $rows;\n}",
"public function tgroupInfo(): array {\n if (empty($this->groupVote)) {\n $key = sprintf(self::VOTED_GROUP, $this->groupId);\n $groupVote = self::$cache->get_value($key);\n if ($groupVote === false) {\n $groupVote = self::$db->rowAssoc(\"\n SELECT Ups, `Total`, Score FROM torrents_votes WHERE GroupID = ?\n \", $this->groupId\n );\n if (is_null($groupVote)) {\n $groupVote = ['Ups' => 0, 'Total' => 0, 'Score' => 0];\n }\n self::$cache->cache_value($key, $groupVote, 259200); // 3 days\n }\n $this->groupVote = $groupVote;\n }\n return $this->groupVote;\n }",
"public function get_results_by_group($group_name) {\n\t\ttry {\n\t\t\t$results = $this->soap->getResultListByGroup(array(\n\t\t\t\t\"Group_Name\" => $group_name\n\t\t\t));\n\t\t} catch(SoapFault $e) {\n\t\t\tthrow new QMWiseException($e);\n\t\t}\n\t\tif(!is_array($results->ResultList->Result)) return array($results->ResultList->Result);\n\t\treturn $results->ResultList->Result;\n\t}"
]
| [
"0.7404163",
"0.6017538",
"0.55205846",
"0.5513551",
"0.53809404",
"0.5366481",
"0.5315989",
"0.5286298",
"0.5246151",
"0.5235005",
"0.5205023",
"0.52020234",
"0.5194413",
"0.5191498",
"0.515596",
"0.5125969",
"0.5100313",
"0.51001465",
"0.50923216",
"0.5076126",
"0.50333196",
"0.5011687",
"0.50105214",
"0.5007288",
"0.49960023",
"0.49918568",
"0.49593857",
"0.49082458",
"0.48571488",
"0.48175168"
]
| 0.68390983 | 1 |
Gets the min, max, average and total of a set of tokens as an array. | public static function stats(array $tokens) {
// Min and max are unknown by default
$min = $max = array(
'time' => NULL,
'memory' => NULL,
);
// Total values are always integers
$total = array(
'time' => 0,
'memory' => 0);
foreach ($tokens as $token) {
// Get the total time and memory for this benchmark
list($time, $memory) = Profiler::total($token);
if ($max['time'] === NULL OR $time > $max['time'])
{
// Set the maximum time
$max['time'] = $time;
}
if ($min['time'] === NULL OR $time < $min['time'])
{
// Set the minimum time
$min['time'] = $time;
}
// Increase the total time
$total['time'] += $time;
if ($max['memory'] === NULL OR $memory > $max['memory'])
{
// Set the maximum memory
$max['memory'] = $memory;
}
if ($min['memory'] === NULL OR $memory < $min['memory'])
{
// Set the minimum memory
$min['memory'] = $memory;
}
// Increase the total memory
$total['memory'] += $memory;
}
// Determine the number of tokens
$count = count($tokens);
// Determine the averages
$average = array(
'time' => $total['time'] / $count,
'memory' => $total['memory'] / $count);
return array(
'min' => $min,
'max' => $max,
'total' => $total,
'average' => $average);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function stats(array $tokens)\n\t{\n\t\t$min = $max = array(\n\t\t\t'time' => NULL,\n\t\t\t'memory' => NULL);\n\n\t\t// Total values are always integers\n\t\t$total = array(\n\t\t\t'time' => 0,\n\t\t\t'memory' => 0);\n\t\n\t\tforeach ($tokens as $token)\n\t\t{\n\t\t\t$other = Profiler::$_marks[$token]['other'];\n\t\t\t// Get the total time and memory for this benchmark\n\t\t\tlist($time, $memory) = Profiler::total($token);\n\n\t\t\tif ($max['time'] === NULL OR $time > $max['time'])\n\t\t\t{\n\t\t\t\t// Set the maximum time\n\t\t\t\t$max['time'] = $time;\n\t\t\t}\n\n\t\t\tif ($min['time'] === NULL OR $time < $min['time'])\n\t\t\t{\n\t\t\t\t// Set the minimum time\n\t\t\t\t$min['time'] = $time;\n\t\t\t}\n\n\t\t\t// Increase the total time\n\t\t\t$total['time'] += $time;\n\n\t\t\tif ($max['memory'] === NULL OR $memory > $max['memory'])\n\t\t\t{\n\t\t\t\t// Set the maximum memory\n\t\t\t\t$max['memory'] = $memory;\n\t\t\t}\n\n\t\t\tif ($min['memory'] === NULL OR $memory < $min['memory'])\n\t\t\t{\n\t\t\t\t// Set the minimum memory\n\t\t\t\t$min['memory'] = $memory;\n\t\t\t}\n\n\t\t\t// Increase the total memory\n\t\t\t$total['memory'] += $memory;\n\t\t}\n\n\t\t// Determine the number of tokens\n\t\t$count = count($tokens);\n\n\t\t// Determine the averages\n\t\t$average = array(\n\t\t\t'time' => $total['time'] / $count,\n\t\t\t'memory' => $total['memory'] / $count);\n\n\t\treturn array(\n\t\t\t'min' => $min,\n\t\t\t'max' => $max,\n\t\t\t'total' => $total,\n\t\t\t'average' => $average,\n\t\t\t'other'=>$other\n\t\t);\n\t}",
"function array_stats($values) {\n $min = min($values);\n $max = max($values);\n $mean = array_sum($values) / count($values);\n return array($min, $max, $mean);\n}",
"public function summaryOfMinAndMax(array $array);",
"public function getMetrics(): array;",
"function array_max_min_avg($array) {\t\n\t\t// initialize variables\n\t\t$result\t= array();\n\t\t$amount = count($array);\n\t\t$avg\t= 0;\n\t\t\n\t\t// examine each array item\n\t\tfor ($x = 0; $x < $amount; $x++) {\n\t\t\t// if no low number, set it\n\t\t\tif (!isset($low)) {\n\t\t\t\t$low = $array[$x];\n\t\t\t\n\t\t\t// if there's a low number, compare and assign if necessary\n\t\t\t} elseif ($array[$x] < $low) {\n\t\t\t\t$low = $array[$x];\n\t\t\t}\n\t\t\t\n\t\t\t// same for the highest number\n\t\t\tif (!isset($high)) {\n\t\t\t\t$high = $array[$x];\n\t\t\t} elseif ($array[$x] > $high) {\n\t\t\t\t$high = $array[$x];\n\t\t\t}\n\t\t\t\n\t\t\t// sum all the values\t\t\n\t\t\t$avg = $avg + $array[$x];\n\t\t}\n\t\t\n\t\t// calculate the average\n\t\t$avg = $avg / $amount;\n\t\t\n\t\t// return the result\n\t\treturn array(\n\t\t\t'high'\t=> $high,\n\t\t\t'low'\t=> $low,\n\t\t\t'avg'\t=> $avg\n\t\t);\n\t}",
"public function getAverageAndNumberRatings (): array\n {\n /**\n * Hier verwenden wir $this->_buffer, damit der nachfolgende MySQL Query nicht jedes mal aufgerufen werden muss,\n * sondern wir das Ergebnis zwischenspeichern.\n */\n if (empty($this->_buffer)) {\n\n /**\n * Datenbankverbindung herstellen.\n */\n $database = new Database();\n\n /**\n * Query abschicken.\n *\n * Hier verwenden wir die AVG()-Funktion von MySQL um einen Durchschnitt aller ratings zu berechnen. Diese\n * Berechnung könnten wir in PHP auch machen, dazu müssten wir aber alle Einträge aus der Datenbank laden\n * und manuell drüber iterieren. In MySQL brauchen wir nur einen einzigen Query und kriegen alles, was wir\n * brauchen.\n */\n $result = $database->query(\"SELECT AVG(rating) as average, COUNT(*) as count FROM comments WHERE post_id = ? AND rating IS NOT NULL\", [\n 'i:post_id' => $this->id\n ]);\n\n /**\n * Daten aus dem Result holen und Datentypen konvertieren.\n */\n $numberOfRatings = (int)$result[0]['count'];\n $average = (float)$result[0]['average'];\n\n /**\n * Cache anlegen.\n */\n $this->_buffer = [\n 'average' => $average,\n 'numberOfRatings' => $numberOfRatings\n ];\n\n }\n\n /**\n * Werte zurückgeben.\n */\n return $this->_buffer;\n }",
"private function validate(): array {\n\t\t\t// The minimum matched counts can't be more than maximum.\n\t\t\tif ( -1 !== $this->maximum && 0 !== $this->maximum ) {\n\t\t\t\t$this->maximum = max( abs( $this->maximum ), abs( $this->minimum ) );\n\t\t\t}\n\t\t\treturn [ $this->minimum, $this->maximum ];\n\t\t}",
"public function defaultStatistics(array $array)\n {\n $mean = self::mean($array);\n $variance = self::variance($array, $mean);\n\n return array(\n 'min' => min($array),\n 'max' => max($array),\n 'mean' => $mean,\n 'variance' => $variance,\n 'std_dev' => sqrt($variance),\n );\n }",
"public function getSaleStatisticsProperty()\n {\n $minSale = 0;\n $maxSale = 0;\n $total = 0;\n $first = true;\n\n foreach ($this->sales as $sale) {\n $amount = $sale['amount'];\n if ($first) {\n $minSale = $amount;\n $maxSale = $amount;\n $first = false;\n } else {\n $minSale = $minSale <= $amount ? $minSale : $amount;\n $maxSale = $maxSale >= $amount ? $maxSale : $amount;\n }\n $total += $amount;\n }\n\n return [\n 'min' => $minSale,\n 'max' => $maxSale,\n 'total' => $total\n ];\n }",
"public function calculateTokensPerUsage();",
"public function getMinisters() {\n return $this->parseData($this->sql['min']);\n }",
"public static function avg( ...$numbers ) {\n \n // Remove the options object from the number array.\n $numbers = array_head($numbers);\n \n // Get the average of all numbers.\n return (array_sum($numbers) / count($numbers));\n \n }",
"private function readMRange()\n {\n $values = [\n 'mmin' => $this->parseM($this->readDoubleL(Shapefile::FILE_SHP)),\n 'mmax' => $this->parseM($this->readDoubleL(Shapefile::FILE_SHP)),\n ];\n return $this->getOption(Shapefile::OPTION_SUPPRESS_M) ? [] : $values;\n }",
"private function calculateStatisticBasedOnDurations(array $durationTimes) {\n $average = Math::average($durationTimes);\n $min = Math::min($durationTimes);\n $max = Math::max($durationTimes);\n $stdDev = Math::stdDev($durationTimes);\n\n return [\n 'average' => $average,\n 'min' => $min,\n 'max' => $max,\n 'stdDev' => $stdDev\n ];\n }",
"public function dataProviderForMeanAbsoluteDeviation(): array\n {\n return [\n [ [ 92, 83, 88, 94, 91, 85, 89, 90 ], 2.75 ],\n [ [ 2, 2, 3, 4, 14 ], 3.6 ],\n ];\n }",
"function meanScore($arr)\n{\n// var_dump(list());\n}",
"function calcTrend(array $valuesArray)\n{\n\t$middle = (count($valuesArray))/2;\n\t$trend = 0;\n\t$sqr=0;\n\t$sum=0;\n\tfor ($index = 1 ; $index < count($valuesArray) ; $index++)\n\t{\n\t\tif ($index < $middle)\n\t\t\t$trend -= $valuesArray[$index];\n\t\telse\n\t\t\t$trend += $valuesArray[$index];\n\t\t$sum+=$valuesArray[$index];\n\t}\n\t$average=round($sum/$index);\n\tfor ($index = 1 ; $index < count($valuesArray) ; $index++)\n\t{\n\t\t$diff = $valuesArray[$index] - $average;\n\t\t$sqr+=$diff*$diff;\n\t}\n\t$shonut = round(sqrt($sqr/$index));\n\t$median = $valuesArray[$middle];\n\treturn array($trend,$shonut,$average,$median);\n}",
"public function getTokens();",
"public static function total($token)\n\t{\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE)\n\t\t{\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t\n\t\t\t$mark['file'],\n\t\t\t$mark['line']\n\t\t);\n\t}",
"private function parse($input) {\n $tokens= [];\n foreach (new Tokens(new StringTokenizer($input)) as $type => $value) {\n $tokens[]= [$type, $value];\n }\n return $tokens;\n }",
"public function evalAvg()\n {\n $users = User::students()->get();\n $marks = [];\n foreach ( $users as $user )\n {\n if ($this->evalGradeExists($user))\n {\n array_push($marks,$this->userPercentage($user));\n }\n }\n $count = count($marks); //total numbers in array\n $total = 0;\n foreach ($marks as $mark) {\n $total += $mark; // total value of array numbers\n }\n $average = ($total/$count); // get average value\n return round($average,2);\n\n }",
"function get_metrics($metr){\n\t\t\tswitch ($metr) {\n\t\t\t\tcase 'PAP':\n\t\t\t\t\t$metrics_list = array($metr => $this->mPAPResult->get_metric());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'CRE':\n\t\t\t\t\t$metrics_list = array($metr => $this->mCREResult->get_metric());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'CSD':\n\t\t\t\t\t$metrics_list = array($metr => $this->mCSDResult->get_metric());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DKT':\n\t\t\t\t\t$metrics_list = array($metr => $this->mDKTResult->get_metric());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$metrics_list = NULL;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $metrics_list;\n\t\t}",
"public static function total($token) {\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE) {\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t// Data attached to benchmark\n\t\t\t$mark['data'],\n\t\t\t$mark[\"trace\"]\n\t\t);\n\t}",
"function avgT($a){\n\t\t\treturn array_sum($a) / count($a);\t\n\t\t}",
"public function getPlayerAverages() : array\n {\n $average['shooting'] = 0;\n $average['skating'] = 0;\n $average['checking'] = 0;\n foreach ($this->players as $player) {\n $average['shooting'] += $player->shooting;\n $average['skating'] += $player->skating;\n $average['checking'] += $player->checking;\n }\n // Checks if zero players are on a squad to prevent division by zero\n if (count($this->players) !== 0) {\n $average['shooting'] = (int) ($average['shooting'] / count($this->players));\n $average['skating'] = (int) ($average['skating'] / count($this->players));\n $average['checking'] = (int) ($average['checking'] / count($this->players));\n }\n return $average;\n }",
"public static function stats(): array;",
"protected function getMinutesArray()\n\t{\n\t\t$ma = array_pad([], 60, null);\n\t\tforeach ($this->_attr[self::MINUTE] as $m) {\n\t\t\tif (is_numeric($m['min'])) {\n\t\t\t\tfor ($i = $m['min']; $i <= $m['end'] && $i < 60; $i += $m['period']) {\n\t\t\t\t\t$ma[$i] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ma;\n\t}",
"public function getAggregateMetricResults()\n {\n return $this->aggregate_metric_results;\n }",
"public function provideTotal()\n {\n return [\n [[1, 2, 5, 8], 16],\n [[-1, 2, 5, 8], 14],\n [[1, 2, 8], 11]\n ];\n }",
"public static function mean($values_arr){\r\n\t\treturn (float) (array_sum($values_arr) / count($values_arr));\r\n }"
]
| [
"0.6806033",
"0.62753034",
"0.57759935",
"0.559795",
"0.54452777",
"0.54386735",
"0.53254837",
"0.53051585",
"0.52748126",
"0.52579296",
"0.52450734",
"0.5176227",
"0.512188",
"0.5118234",
"0.5111032",
"0.5086725",
"0.5048329",
"0.50247765",
"0.5017908",
"0.4996121",
"0.49836907",
"0.49626565",
"0.4942475",
"0.49359363",
"0.49258375",
"0.48966795",
"0.4886912",
"0.48806158",
"0.48753425",
"0.48721826"
]
| 0.682276 | 0 |
Gets the total execution time and memory usage of a benchmark as a list. | public static function total($token) {
// Import the benchmark data
$mark = Profiler::$_marks[$token];
if ($mark['stop_time'] === FALSE) {
// The benchmark has not been stopped yet
$mark['stop_time'] = microtime(TRUE);
$mark['stop_memory'] = memory_get_usage();
}
return array
(
// Total time in seconds
$mark['stop_time'] - $mark['start_time'],
// Amount of memory in bytes
$mark['stop_memory'] - $mark['start_memory'],
// Data attached to benchmark
$mark['data'],
$mark["trace"]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function total($token)\n\t{\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE)\n\t\t{\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t\n\t\t\t$mark['file'],\n\t\t\t$mark['line']\n\t\t);\n\t}",
"protected static function get_benchmarks() : array\n\t{\n\t\t$result = [];\n\n\t\tif (! Kohana::$profiling)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t$groups = Profiler::groups();\n\n\t\tforeach (array_keys($groups) as $group)\n\t\t{\n\t\t\tif (strpos($group, 'database (') === FALSE)\n\t\t\t{\n\t\t\t\tforeach ($groups[$group] as $name => $marks)\n\t\t\t\t{\n\t\t\t\t\t$stats = Profiler::stats($marks);\n\t\t\t\t\t$result[$group][] = [\n\t\t\t\t\t\t'name' => $name,\n\t\t\t\t\t\t'count' => count($marks),\n\t\t\t\t\t\t'total_time' => $stats['total']['time'],\n\t\t\t\t\t\t'avg_time' => $stats['average']['time'],\n\t\t\t\t\t\t'total_memory' => $stats['total']['memory'],\n\t\t\t\t\t\t'avg_memory' => $stats['average']['memory'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add total stats\n\t\t$total = Profiler::application();\n\t\t$result['application'] = [\n\t\t\t'count' => 1,\n\t\t\t'total_time' => $total['current']['time'],\n\t\t\t'avg_time' => $total['average']['time'],\n\t\t\t'total_memory' => $total['current']['memory'],\n\t\t\t'avg_memory' => $total['average']['memory'],\n\n\t\t];\n\n\t\treturn $result;\n\t}",
"public function benchmark() {\n return self::benchmarkEnd($this->benchmarkStart);\n }",
"public function getBenchmark()\n {\n return $this->benchmark;\n }",
"protected function getStats()\n {\n $endTime = microtime() - $this->startTime;\n $stats = sprintf(\n 'Request-response cycle finished: %1.3fs'\n . ' - Memory usage: %1.2fMB (peak: %1.2fMB)'\n ,\n $endTime,\n memory_get_usage(true) / 1048576,\n memory_get_peak_usage(true) / 1048576\n );\n\n return $stats;\n }",
"protected function calculateExecutionTime(): array\n\t{\n\t\t$totalTime = microtime(true) - $this->application->getStartTime();\n\n\t\t$executionTime = ['total' => $totalTime, 'details' => []];\n\n\t\t$otherTime = 0;\n\n\t\tforeach($this->timers as $timer)\n\t\t{\n\t\t\t$otherTime += $timer instanceof Closure ? $timer() : $timer;\n\t\t}\n\n\t\t$detailedTime = $totalTime - $otherTime;\n\n\t\t$executionTime['details']['PHP'] = ['time' => $detailedTime, 'pct' => ($detailedTime / $totalTime * 100)];\n\n\t\tforeach($this->timers as $timer => $time)\n\t\t{\n\t\t\tif($time instanceof Closure)\n\t\t\t{\n\t\t\t\t$time = $time();\n\t\t\t}\n\n\t\t\t$executionTime['details'][$timer] = ['time' => $time, 'pct' => ($time / $totalTime * 100)];\n\t\t}\n\n\t\treturn $executionTime;\n\t}",
"public function gatherSpeedData()\n {\n $speedTotals = array();\n\n $speedTotals['total'] = $this->getReadableTime((microtime(true) - $this->startTime) * 1000);\n $speedTotals['allowed'] = ini_get(\"max_execution_time\");\n\n $this->output['speedTotals'] = $speedTotals;\n }",
"static function measureResults(){\n\t\tforeach(self::$measures as $name=>$measure){\n\t\t\t$totalTime = 0;\n\t\t\twhile(($instance = current($measure)) && next($measure)){\n\t\t\t\t$nextInstance = current($measure);\n\t\t\t\tif($nextInstance){\n\t\t\t\t\t$currentCount = count($out[$name]);\n\t\t\t\t\t$totalTime += $nextInstance['time'] - $instance['time'];\n\t\t\t\t\t$out[$name][$currentCount]['timeChange'] = $nextInstance['time'] - $instance['time'];\n\t\t\t\t\t$out[$name][$currentCount]['memoryChange'] = $nextInstance['mem'] - $instance['mem'];\n\t\t\t\t\t$out[$name][$currentCount]['peakMemoryChange'] = $nextInstance['peakMem'] - $instance['peakMem'];\n\t\t\t\t\t$out[$name][$currentCount]['peakMemoryLevel'] = $instance['peakMem'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out[$name]['total']['time'] = $totalTime;\n\t\t}\n\t\treturn $out;\n\t}",
"public function getRunAsArray()\n {\n return $this->_totalTime;\n }",
"public function getTests()\n {\n $tests = array();\n foreach ($this->benchmarks as $benchmark) {\n $tests += $benchmark->getTests();\n }\n\n return $tests;\n }",
"public static function getCpuUsageArray(): array\n {\n $stat1 = file('/proc/stat');\n usleep(100000);\n $stat2 = file('/proc/stat');\n if (!is_array($stat1) || !is_array($stat2)) return [];\n $info1 = explode(\" \", preg_replace(\"!cpu +!\", \"\", $stat1[0]));\n $info2 = explode(\" \", preg_replace(\"!cpu +!\", \"\", $stat2[0]));\n $dif = array();\n $dif['user'] = $info2[0] - $info1[0];\n $dif['nice'] = $info2[1] - $info1[1];\n $dif['sys'] = $info2[2] - $info1[2];\n $dif['idle'] = $info2[3] - $info1[3];\n $total = array_sum($dif);\n $total = $total > 0 ? $total : PHP_INT_MAX;\n $cpu = [];\n foreach ($dif as $x => $y)\n $cpu[$x] = $y / $total;\n return $cpu;\n }",
"public function execute()\n {\n $results = array();\n foreach ($this->benchmarks as $benchmark) {\n $results += $benchmark->execute();\n }\n\n return $results;\n }",
"public function getRun()\n {\n return array_sum($this->_totalTime);\n }",
"static function ms(){\r\n $dm = memory_get_usage() - self::$startmem;\r\n return self::memformat($dm);\r\n }",
"private function execution_time($total, $count = 0)\n\t{\n\t\t$hours = $minutes = $seconds = 0;\n\n\t\tif ($count > 0)\n\t\t{\n\t\t\t// If calculating an average, divide the total by the count\n\t\t\t$total = floor($total / $count);\n\t\t}\n\n\t\tif ($total > 0)\n\t\t{\n\t\t\t// Pad each number to two digits\n\t\t\t$hours = str_pad(floor($total / 3600), 2, '0', STR_PAD_LEFT);\n\t\t\t$minutes = str_pad(floor(($total / 60) % 60), 2, '0', STR_PAD_LEFT);\n\t\t\t$seconds = str_pad($total % 60, 2, '0', STR_PAD_LEFT);\n\t\t}\n\n\t\t// Return a simple array\n\t\treturn array(\n\t\t\t'h' => $hours,\n\t\t\t'm' => $minutes,\n\t\t\t's' => $seconds\n\t\t);\n\t}",
"public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }",
"public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }",
"public function finPerformance(){\n $memoria = memory_get_usage() - $this->memoria;\n $tiempo = microtime(true) - $this->tiempo;\n\n echo \"<pre>\";\n print_r(array(\"memoria\" => $memoria.\" bytes \", \"tiempo\" => $tiempo.\" segundos\" ));\n die;\n }",
"protected function calculateColors()\n {\n // initial structure of our return array\n $return = ['time' => [], 'memory' => []];\n\n // short-circuit if we only have one thing to benchmark\n if (count($this->benchmarks) == 1) {\n $name = $this->benchmarks[0]->getName();\n $return['time'][$name] = self::COLOR_GREEN;\n $return['memory'][$name] = self::COLOR_GREEN;\n\n return $return;\n }\n\n // we make separate arrays since we don't want to re-order the list as it was passed in. usort would do that\n $times = [];\n $memories = [];\n\n // split them all out\n /** @var Benchmark $benchmark */\n foreach ($this->benchmarks as $benchmark) {\n $times[$benchmark->getName()] = $benchmark->getTime();\n $memories[$benchmark->getName()] = $benchmark->getMemory();\n }\n\n // sort them by value\n asort($times);\n asort($memories);\n\n // go through the times--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($times as $productName => $time) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['time'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['time'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['time'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n // go through the memory--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($memories as $productName => $memory) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['memory'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['memory'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['memory'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n return $return;\n }",
"public function getAvgLoad()\n {\n $loadArray = array();\n $this->refresher->Refresh();\n // ProcessorQueueLength\n foreach ($this->cpuValue->ObjectSet as $key => $set) {\n $loadArray = $set->PercentProcessorTime;\n }\n\n return $loadArray[0];\n }",
"public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }",
"public function collect() {\r\n $stat1 = $this->GetCoreInformation();\r\n /* sleep on server for one second */\r\n sleep(1);\r\n /* take second snapshot */\r\n $stat2 = $this->GetCoreInformation();\r\n /* get the cpu percentage based off two snapshots */\r\n $data = $this->GetCpuPercentages($stat1, $stat2);\r\n $total = 0;\r\n $count = 0;\r\n foreach ($data as $key => $value) {\r\n $total += $value['user'] + $value['nice'] + $value['sys'];\r\n $count++;\r\n }\r\n\r\n $information = array\r\n (\r\n 'processors' => $this->collectProccessorsNumber(),\r\n 'processor_load' => $this->collectProcessorLoad(),\r\n 'cpu' => round($total / ($count ?: 1)),\r\n 'memory' => array('total' => $this->collectMemoryTotal(), 'free' => $this->collectMemoryFree()),\r\n 'swap' => array('total' => $this->collectSwapTotal(), 'free' => $this->collectSwapFree()),\r\n 'tasks' => $this->collectTasksNumber(),\r\n 'uptime' => $this->collectUptime(),\r\n );\r\n $information['memory']['busy'] = $information['memory']['total'] - $information['memory']['free'];\r\n $information['swap']['busy'] = $information['swap']['total'] - $information['swap']['free'];\r\n return $information;\r\n }",
"public function getTotalExecutionTime()\n {\n return $this->totalExecutionTime;\n }",
"public function getData()\n {\n return array(\n 'time' => bcsub(self::getMicroTime() , $this->startTime, 4),\n 'memory' => round(memory_get_usage() / 1024 / 1024, 4),\n 'files' => count(get_included_files()),\n 'classes' => count(get_declared_classes())\n );\n }",
"public function getExecutionStats()\n {\n return $this->execution_stats;\n }",
"static function measure($name='std'){\n\t\t$next = count(self::$measures[$name]);\n\t\tself::$measures[$name][$next]['time'] = microtime(true);\n\t\tself::$measures[$name][$next]['mem'] = memory_get_usage();\n\t\tself::$measures[$name][$next]['peakMem'] = memory_get_peak_usage();\n\t}",
"public function getPerformance()\n {\n return $this->_performance;\n }",
"public function getStats()\n\t{\n\t return ($this->_statsList);\n\t}",
"protected function doGetStats()\n {\n $info = $this->yac->info();\n\n return array(\n Cache::STATS_HITS => $info['hits'],\n Cache::STATS_MISSES => $info['miss'],\n Cache::STATS_UPTIME => 0,\n Cache::STATS_MEMORY_USAGE => 0,\n Cache::STATS_MEMORY_AVAILABLE => 0,\n );\n }",
"public function getAllQueriesTime(){\n return Db::getAllQueriesEstimatedTime();\n }"
]
| [
"0.7219387",
"0.6719664",
"0.65577984",
"0.6542137",
"0.65279955",
"0.64651036",
"0.6401488",
"0.6376632",
"0.6191155",
"0.6079454",
"0.6042299",
"0.59888583",
"0.5940406",
"0.5859489",
"0.5822668",
"0.57726973",
"0.576621",
"0.5718496",
"0.5701244",
"0.5679189",
"0.5676112",
"0.56487405",
"0.5633791",
"0.56288517",
"0.56054294",
"0.56027365",
"0.55676967",
"0.55612653",
"0.5531165",
"0.55189127"
]
| 0.73667246 | 0 |
URIResolver testUriResolver defines a concrete implementation of getting the template text in a specific project. On the server side it can be a local file, an external resource, Databases, etc. | function testUriResolver($resourceURI, $baseURI, $args = null) {
$file = TestRunner::createFileName($resourceURI, $baseURI);
if (!$file)
return null;
$fileName = $file['fname'];
try {
$template = file_get_contents($fileName);
if (!$template)
throw new Exception('badResorce');
/* Check if there is value: exception:,
* which should mean the call of the resource failed.
*/
$tmpRet = json_decode($template, true);
if ($tmpRet && isset($tmpRet['key']) && $tmpRet['key'] == ":exception:")
throw new Exception('badResource');
if (strpos($template, ':exception:') !== false)
throw new Exception('badResource');
/* imitation of processing of additional parameters */
if (is_array($args) && count($args)) {
$check = json_decode($template, true);
if ($check && isset($check['key']) && $check['key'] == ':args:') {
$template = array();
$template['key'] = '[';
foreach ($args as $val)
$template['key'] .= 'string(' . $val . ')-';
$template['key'] = rtrim($template['key'], '-') . ']';
$template = json_encode($template);
} elseif (strpos($template, ':args:') !== false) {
$repl = '[';
foreach ($args as $val)
$repl .= 'string(' . $val . ')-';
$repl = rtrim($repl, '-') . ']';
$template = str_replace(':args:', $repl, $template);
}
}
/* * ************************************************ */
} catch (Exception $e) {
return null;
}
return array('uri' => $fileName, 'data' => $template);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUriFactory(): UriFactory;",
"private function getUriForTest()\n {\n return new Uri(\n 'http',\n 'www.example.com',\n 80,\n '/data/test',\n 'action=view',\n 'fragment'\n );\n }",
"public function testUrlGenerationPlainString(): void\n {\n $mailto = 'mailto:[email protected]';\n $result = Router::url($mailto);\n $this->assertSame($mailto, $result);\n\n $js = 'javascript:alert(\"hi\")';\n $result = Router::url($js);\n $this->assertSame($js, $result);\n\n $hash = '#first';\n $result = Router::url($hash);\n $this->assertSame($hash, $result);\n }",
"public function test_rest_url_generation() {\n\t\t// In pretty permalinks case, we expect a path of wp-json/ with no query.\n\t\t$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/wp-json/', get_rest_url() );\n\n\t\t// In index permalinks case, we expect a path of index.php/wp-json/ with no query.\n\t\t$this->set_permalink_structure( '/index.php/%year%/%monthnum%/%day%/%postname%/' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php/wp-json/', get_rest_url() );\n\n\t\t// In non-pretty case, we get a query string to invoke the rest router.\n\t\t$this->set_permalink_structure( '' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php?rest_route=/', get_rest_url() );\n\t}",
"public function renderUri();",
"public function testUrlGenerationWithPathUrl(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/articles', 'Articles::index');\n $routes->connect('/articles/view/*', 'Articles::view');\n $routes->connect('/article/{slug}', 'Articles::read');\n $routes->connect('/admin/articles', 'Admin/Articles::index');\n $routes->connect('/cms/articles', 'Cms.Articles::index');\n $routes->connect('/cms/admin/articles', 'Cms.Admin/Articles::index');\n\n $result = Router::pathUrl('Articles::index');\n $expected = '/articles';\n $this->assertSame($result, $expected);\n\n $result = Router::pathUrl('Articles::view', [3]);\n $expected = '/articles/view/3';\n $this->assertSame($result, $expected);\n\n $result = Router::pathUrl('Articles::read', ['slug' => 'title']);\n $expected = '/article/title';\n $this->assertSame($result, $expected);\n\n $result = Router::pathUrl('Admin/Articles::index');\n $expected = '/admin/articles';\n $this->assertSame($result, $expected);\n\n $result = Router::pathUrl('Cms.Admin/Articles::index');\n $expected = '/cms/admin/articles';\n $this->assertSame($result, $expected);\n\n $result = Router::pathUrl('Cms.Articles::index');\n $expected = '/cms/articles';\n $this->assertSame($result, $expected);\n }",
"abstract public function uri(): string;",
"function resolveURL($uri);",
"public function testToString()\n {\n $uri = new Uri(\n 'http',\n 'domain.tld',\n 1111,\n '/path/123',\n 'q=abc',\n 'test',\n 'user',\n 'password'\n );\n\n $this->assertEquals('http://user:[email protected]:1111/path/123?q=abc#test', (string)$uri);\n }",
"abstract protected function getUri(): string;",
"public function testGetUri()\n {\n $this->assertEquals(\"hello/?test=true\", $this->_req->getUri());\n }",
"function uri(): string;",
"public function testToString()\n {\n $uri = new Uri(\n \"https\",\n \"user\",\n \"pass\",\n \"test.com\",\n 443,\n \"/test/path\",\n \"id=1\",\n \"frag\"\n );\n self::assertSame(\"https://user:[email protected]:443/test/path?id=1#frag\", (string) $uri);\n }",
"public function testUris(): void\n {\n $user = new User([]);\n $contract = new Contract([\n 'user' => $user\n ]);\n\n $createUri = \\sprintf('/users/%s/contracts', $user->getId());\n $getUri = \\sprintf('/users/%s/contracts', $user->getId());\n\n self::assertSame(['create' => $createUri, 'get' => $getUri], $contract->uris());\n }",
"abstract public function getUri();",
"public function testUriStrategyRouteReceivesCorrectArguments()\n {\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n }",
"public function resolveUri($uri) {}",
"public function testCreateUri()\n {\n $uri = new Uri(\n 'http',\n 'www.example.com',\n 1111,\n '/path/123',\n 'q=abc',\n 'fragment',\n 'user',\n 'password'\n );\n\n $this->assertEquals('fragment', $uri->getFragment());\n $this->assertEquals('www.example.com', $uri->getHost());\n $this->assertEquals('/path/123', $uri->getPath());\n $this->assertEquals(1111, $uri->getPort());\n $this->assertEquals('q=abc', $uri->getQuery());\n $this->assertEquals('http', $uri->getScheme());\n $this->assertEquals('user:password', $uri->getUserInfo());\n }",
"public function uri() : string;",
"public function testUnroutedPath() {\n // Override router.\n $router = $this->getMockBuilder(TestRouterInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $router->expects($this->any())\n ->method('matchRequest')\n ->willThrowException(new ResourceNotFoundException());\n\n $request = new Request();\n\n $request_stack = $this->getMockBuilder(RequestStack::class)\n ->disableOriginalConstructor()\n ->getMock();\n $request_stack->expects($this->any())\n ->method('getCurrentRequest')\n ->willReturn($request);\n\n // Get the container from the setUp method and change it with the\n // implementation created here, that has the route parameters.\n $container = \\Drupal::getContainer();\n $container->set('router.no_access_checks', $router);\n $container->set('request_stack', $request_stack);\n \\Drupal::setContainer($container);\n\n // Create facet.\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setUrlAlias('test');\n $facet->setFacetSourceId('facet_source__dummy');\n\n $this->processor = new QueryString(['facet' => $facet], 'query_string', [], $request, $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n foreach ($results as $result) {\n $this->assertEquals('base:test', $result->getUrl()->getUri());\n }\n }",
"public function uri();",
"public function uri();",
"public function uri();",
"public function test_comicEntityIsCreated_AResourceURI_setResourceURI()\n {\n $sut = $this->getSUT();\n $resourceURI = $sut->getResourceURI();\n $expected = URI::create('http://gateway.marvel.com/v1/public/comics/41530');\n $this->assertEquals($expected, $resourceURI);\n }",
"public function testFindGlobalTemplates()\n {\n\n }",
"public function testUriStrategyRouteReturnsResponseWhenControllerDoes()\n {\n $mockResponse = $this->getMock('Symfony\\Component\\HttpFoundation\\Response');\n\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) use ($mockResponse) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n return $mockResponse;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n\n $this->assertSame($mockResponse, $response);\n }",
"public function testGetUri()\n {\n $resp = $this->getMockBuilder('Acme\\Http\\Response')\n ->setConstructorArgs([$this->request, $this->signer, $this->blade, $this->session])\n ->setMethods(['render'])\n ->getMock();\n\n // override render method to return true\n $resp->method('render')\n ->willReturn(true);\n\n $controller = $this->getMockBuilder('Acme\\Controllers\\PageController')\n ->setConstructorArgs([$this->request, $resp, $this->session,\n $this->blade, $this->signer])\n ->setMethods(null)\n ->getMock();\n\n // call the method we want to test\n $controller->getShowPage();\n\n // we expect to get the $page object with browser_title set to \"About Acme\"\n $expected = \"About Acme\";\n $actual = $controller->page->browser_title;\n\n // run assesrtion for browser title/page title\n $this->assertEquals($expected, $actual);\n\n // should have view of generic-page\n $expected = \"generic-page\";\n $actual = Assert::readAttribute($resp, 'view');\n $this->assertEquals($expected, $actual);\n\n // should have page_id of 1\n $expected = 1;\n $actual = $controller->page->id;\n $this->assertEquals($expected, $actual);\n }",
"public function setUriFactory(UriFactoryInterface $uriFactory):static;",
"public function buildFrontendUri() {}",
"public function getURI();"
]
| [
"0.5642792",
"0.5602433",
"0.55269223",
"0.5511008",
"0.5487218",
"0.5482375",
"0.54336184",
"0.5358511",
"0.5356531",
"0.52827066",
"0.5252094",
"0.52510875",
"0.5243085",
"0.52340573",
"0.5227302",
"0.5184786",
"0.51615614",
"0.5146586",
"0.5142928",
"0.5130605",
"0.5125727",
"0.5125727",
"0.5125727",
"0.50524634",
"0.50522846",
"0.50436974",
"0.502741",
"0.5024116",
"0.5023457",
"0.50216436"
]
| 0.6198474 | 0 |
/ | | Hook for manipulate query of index result | | public function hook_query_index(&$query) {
//Your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hook_query_index(&$query)\n\t{\n\t\t//Your code here\n\n\t}",
"public function hook_before_index(&$result) {\n \n }",
"function process_query_index( $query )\n\t{\n\t\treturn $query;\n\t}",
"public function hook_query_index(&$query) {\n/*\t //Your code here\n $userId = CRUDBooster::myId();\n//\t echo $userId;\n\t $isAdmin = CRUDBooster::isSuperadmin();\n\t $storeAssignedtoUser = DB::table('srv_centers')\n ->where('cms_user_id', '=', $userId)\n ->first();\n\t if ($isAdmin) {\n\n\t }else {\n\t $query->where('cms_users.id',$storeAssignedtoUser->cms_user_id);\n\t }\n*/\n\t }",
"public function _INDEX()\n\t{\n\t\t\n\t}",
"public function hook_query_index(&$query) {\n\t\t\t//Your code here\n\t\t\t// pr($query->toSql(),1);\t\t\t\n\t\t\tif(CRUDBooster::isSuperAdmin()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$user = getUser();\n\t\t\t$my_company = $this->my_company;\n\t\t\tif($user->company != $my_company){\n\t\t\t\treturn $query->where('supplier',$user->company);\n\t\t\t} else {\n\t\t\t\treturn $query->where('status','!=','draft');\n\t\t\t}\n\n\t }",
"function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}",
"public function getIndex()\n {\n // add stuff here\n }",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function _query()\n {\n }",
"public function updateIndexState() {\n $query = $this->database->select('help_search_items', 'hsi');\n $query->addExpression('COUNT(DISTINCT(hsi.sid))');\n $query->leftJoin('search_dataset', 'sd', 'hsi.sid = sd.sid AND sd.type = :type', [':type' => $this->getType()]);\n $query->isNull('sd.sid');\n $never_indexed = $query->execute()->fetchField();\n $this->state->set('help_search_unindexed_count', $never_indexed);\n }",
"protected function getIndex()\n\t{ \n /*\n $sm = $this->account->getServiceManager();\n $dbh = $sm->get(\"Db\");\n $this->dbh = $dbh;\n\t\treturn new \\Netric\\EntityQuery\\Index\\Pgsql($this->account, $dbh);\n * \n */\n $this->dbh = $this->account->getServiceManager()->get(\"Db\");\n return new \\Netric\\EntityQuery\\Index\\Pgsql($this->account);\n\t}",
"public function buildIndex();",
"public function index()\n\t{\n\t\t/*\n\t\t|\tnot a logical function since GramStainResult\n\t\t|\tshould be specific to a particular result\n\t\t*/\n\t}",
"function deeds_do_index_charters($docnum) {\r\n\r\n\t$record_type = 'Charter';\r\n\r\n\t$sql = 'SELECT\r\n\t\t\t\tcartulary.short as cart_title_short,\r\n\t\t\t\tcartulary.title as cart_title,\r\n\t\t\t\tcartulary_biblio.biblio as cart_bib_title,\r\n\t\t\t\tcharter.*,\r\n\t\t\t\ttxt.txt,\r\n\t\t\t\tcharter_date.dated,\r\n\t\t\t\tcharter_date.lodate,\r\n\t\t\t\tcharter_date.hidate,\r\n\t\t\t\tcharter_date.date_precision,\r\n\t\t\t\tcharter_location.location,\r\n\t\t\t\tcharter_location.country,\r\n\t\t\t\tcharter_location.county,\r\n\t\t\t\tcharter_location.place,\r\n\t\t\t\tcharter_place.country as origin_country,\r\n\t\t\t\tcharter_place.county as origin_county,\r\n\t\t\t\tcharter_place.place as origin_place\r\n\t\t\tFROM\r\n\t\t\t\tdeeds_db.charter charter\r\n\t\t\tLEFT JOIN deeds_db.charter_doc txt ON charter.docnum = txt.docnum\r\n\t\t\tLEFT JOIN deeds_db.charter_date charter_date ON charter.docnum = charter_date.docnum\r\n\t\t\tLEFT JOIN deeds_db.charter_location ON charter.docnum = charter_location.docnum AND charter_location.location_type = \\'issued\\' \r\n\t\t\tLEFT JOIN deeds_db.charter_place ON charter.docnum = charter_place.docnum \r\n\t\t\tLEFT JOIN deeds_db.cartulary ON cartulary.cartnum = substring(charter.docnum, 1, 4)\r\n\t\t\tLEFT JOIN deeds_db.cartulary_biblio ON cartulary_biblio.cartnum = substring(charter.docnum, 1, 4) \r\n\t\t\tWHERE charter.docnum = \\'' . $docnum . '\\' LIMIT 100\r\n\t'; \r\n\t$ci=& get_instance();\r\n\t$ci->load->database(); \r\n\t$query = $ci->db->query($sql);\r\n\t$result = $query->result_array();\r\n\t$ci->db->flush_cache();\r\n\r\n\t$count = 0;\r\n\r\n\t$ci->load->library(\"Apache/Solr/Apache_Solr_Service\", array('host' => SOLR_HOST, 'port' =>SOLR_PORT, 'path' => SOLR_PATH), 'service');\r\n\t$ci->load->library(\"Apache/Solr/Apache_Solr_Document\", '', 'doc');\r\n\r\n\r\n\tforeach ($result as $row) {\r\n\t\ttry {\r\n\r\n\t\t\t$dnum = $row['docnum'];\r\n\t\t\t$unique_id = $record_type.'_'.$dnum; \r\n\r\n\t\t\t$ci->doc->addField('unique_id', $record_type.'_'.$dnum);\r\n\t\t\t$ci->doc->addField('record_type', $record_type);\r\n\t\t\t$ci->doc->addField('dnum', $dnum);\r\n\t\t\t$ci->doc->addField('content', $row['txt']);\r\n\r\n\t\t\tif ($row['location'] != '' && $row['location'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('location_issued', $row['location']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['country'] != '' && $row['country'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_country', $row['country']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['county'] != '' && $row['county'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_county', $row['county']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['place'] != '' && $row['place'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_place', $row['place']);\r\n\t\t\t}\r\n\r\n\t\t\t// indexing multi-valued property locations\r\n\t\t\t$property_locations = deeds_solr_helper_get_charter_property_locations($row['docnum'], $ci);\r\n\r\n\t\t\tforeach ($property_locations as $property_location) {\r\n\t\t\t\t$ci->doc->addField('property_country', $property_location['country']);\r\n\t\t\t\t$ci->doc->addField('property_county', $property_location['county']);\r\n\t\t\t\t$ci->doc->addField('property_place', $property_location['place']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_country'] != '' && $row['origin_country'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_country', $row['origin_country']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_county'] != '' && $row['origin_county'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_county', $row['origin_county']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_place'] != '' && $row['origin_place'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_place', $row['origin_place']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['charter_type'] != '' && $row['charter_type'] != 'NULL') {\r\n\t\t\t\t$charter_types = explode(', ', $row['charter_type']);\r\n\t\t\t\tforeach ($charter_types as $charter_type) {\r\n\t\t\t\t\t$ci->doc->addField('charter_type', $charter_type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$ci->doc->addField('origin', $row['origin']);\r\n\t\t\t$ci->doc->addField('language', $row['language']);\r\n\r\n\t\t\t$dated = deeds_core_formatyr($row['dated']);\r\n\t\t\t$lodate = deeds_core_formatyr($row['lodate']);\r\n\t\t\t$hidate = deeds_core_formatyr($row['hidate']);\r\n\r\n\t\t\t$date_precision = $row['date_precision'];\r\n\r\n\t\t\tif ($dated != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $dated);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $dated);\r\n\t\t\t} else if ($lodate != '0000' && $hidate != '0000') {\r\n\t\t\t\t$int_loyr = intval($lodate);\r\n\t\t\t\t$int_hiyr = intval($hidate);\r\n\t\t\t\tfor ($i = $int_loyr; $i <= $int_hiyr; $i++) {\r\n\t\t\t\t\t$ci->doc->addField('docYear_multi', $i);\r\n\t\t\t\t} \r\n\t\t\t\tif($int_loyr === $int_hiyr) { \r\n\t\t\t\t\t$ci->doc->addField('docYear_display', $lodate);\r\n\t\t\t\t} else { \r\n\t\t\t\t\t$ci->doc->addField('docYear_display', \"{$lodate}-{$hidate}\");\r\n\t\t\t\t}\r\n\t\t\t} else if ($lodate != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $lodate);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $lodate);\r\n\t\t\t} else if ($hidate != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $hidate);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $hidate);\r\n\t\t\t}\r\n\t\t\t$ci->doc->addField('date_precision', $date_precision);\r\n\r\n\t\t\t$copySource = $row['charter_source'];\r\n\t\t\t$ci->doc->addField('copySource', $copySource);\r\n\r\n\t\t\t$ci->doc->addField('cart_title_short', $row['cart_title_short']);\r\n \t\t\t$ci->doc->addField('cart_title', $row['cart_title']);\r\n \t\t\t$ci->doc->addField('cart_bib_title', $row['cart_bib_title']);\r\n\r\n\t\t\t$count++;\r\n\r\n\t\t\t$ci->service->addDocument($ci->doc);\r\n\t\t\t$ci->service->commit();\r\n\t\t\t$ci->doc->clear();\r\n\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"Error: \".$e->getMessage().\"\\n\";\r\n\t\t\techo \"File: \".$e->getFile().\"\\n\";\r\n\t\t\techo \"Line: \".$e->getLine().\"\\n\";\r\n\t\t\techo \"Code: \".$e->getCode().\"\\n\";\r\n\t\t\t//echo \"Trace: \".print_r($e->getTrace(), TRUE).\"\\n\";\r\n\t\t}\r\n\t}\r\n}",
"public function query($index){\n $this->httpRequest->query($index);\n }",
"abstract public function doIndex($item);",
"abstract protected function getIndex();",
"abstract public function query();",
"function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }",
"function query() {}",
"public function updateIndex()\n {\n if ($this->es_index_helper) {\n call_user_func($this->es_index_helper, $this);\n }\n }"
]
| [
"0.7515977",
"0.74312127",
"0.7166127",
"0.6533022",
"0.64704245",
"0.6426205",
"0.63736165",
"0.62815654",
"0.62301713",
"0.62301713",
"0.62301713",
"0.6228801",
"0.6228801",
"0.6228801",
"0.622835",
"0.6227676",
"0.6227676",
"0.61556554",
"0.6145412",
"0.6126141",
"0.61017644",
"0.6076141",
"0.6075772",
"0.5990072",
"0.5956018",
"0.5919351",
"0.5898354",
"0.58915406",
"0.58909357",
"0.5882663"
]
| 0.7664927 | 0 |
Test if command rejects invalid job type. | public function testInvalidJobTypeExit()
{
$application = new Application();
$application->add($this->command);
$command = $application->find('dequeue');
$command_tester = new CommandTester($command);
$command_tester->execute([
'command' => $command->getName(),
'type' => get_class($this),
]);
$this->assertEquals(1, $command_tester->getStatusCode());
$this->assertStringContainsString('Valid job class expected', $command_tester->getDisplay());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function validateCommand() : bool\n {\n $format = $this->argument('format');\n\n if (!$this->isValidFormat($format)) {\n $this->error(\"Error: Format not supported.\");\n $this->info(\"Supported formats: \" . join(', ', array_keys(static::getFormatsMap())));\n return false;\n }\n\n return true;\n }",
"private function validateCommandNumber (\n int $command\n ): bool\n {\n return in_array($command, [\n self::COMMAND_ADD,\n self::COMMAND_MULTIPLY,\n self::COMMAND_HALT\n ]);\n }",
"public function testAbortBadType()\n\t{\n\t\t$this->object->pushStep(array('type' => 'badstep'));\n\n\t\t$this->assertFalse(\n\t\t\t$this->object->abort(null, false)\n\t\t);\n\t}",
"public function testCommandWithReportConfigurationInvalid(): void\n {\n $process = $this->phpbench(\n 'run --report=\\'{\"name\": \"foo_ta\\' benchmarks/set4/NothingBench.php'\n );\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('Parse error', $process->getErrorOutput());\n }",
"public function cli_validateArgs() {}",
"public function test_validate_input_for_role_job()\n {\n /*\n $job = new ValidateInputForRoleJob( [ 'role_name' => null ] ); \n $this->expectExceptionMessage( 'Role name is required' );\n $job->handle();\n */\n /*\n $job = new ValidateInputForRoleJob( [ 'role_name' => '' ] ); \n $this->expectExceptionMessage( 'contains invalid characters' );\n $job->handle();\n */\n /*\n $job = new ValidateInputForRoleJob( [ 'role_name' => '@#½½~¬' ] ); \n $this->expectExceptionMessage( 'contains invalid characters' );\n $job->handle();\n */\n $validInput = [ 'role_name' => 'admin' ];\n $job = new ValidateInputForRoleJob( $validInput ); \n $this->assertEquals( $job->handle(), $validInput );\n }",
"public function testExecuteWithInvalidAmountMessages()\n {\n $commandTester = $this->createCommandTester(new WorkerCommand());\n\n $this->expectException(\\InvalidArgumentException::class);\n $commandTester->execute([\n 'name' => 'basic_queue',\n '--messages' => -1\n ]);\n }",
"public function redis_Scripting_script_invalid_command()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $this->expectException(ScriptCommandException::class);\n $this->assertEquals(1, $this->redis->script('return'));\n }",
"protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }",
"public function test_lti_build_content_item_selection_request_invalid_tooltype() {\n $this->resetAfterTest();\n\n $this->setAdminUser();\n $course = $this->getDataGenerator()->create_course();\n $returnurl = new moodle_url('/');\n\n // Should throw Exception on non-existent tool type.\n $this->expectException('moodle_exception');\n lti_build_content_item_selection_request(1, $course, $returnurl);\n }",
"private function hasValidCommand($input) {\n\t\treturn $this->isAddCommand($input) || $this->isUpdateCommand($input) || $this->isDeleteCommand($input);\n\t}",
"public function validateAndParseArgs() {\n $areParamsValid = true;\n \n // Validate Command\n if(!in_array($this->cmd, $this->validCommands)) {\n throw new \\Exception(\"Invalid Command '\" . $this->cmd . \"'.\");\n }\n \n // Validate Command Parameters\n switch($this->cmd) {\n case 'add':\n // Param order should be: pet_type, item_type, name, color, lifespan, age, price\n if(count($this->cmdParams) !== 7) { $areParamsValid = false; }\n if(!is_numeric($this->cmdParams[4]) || !is_numeric($this->cmdParams[5]) || !is_numeric($this->cmdParams[6])) {\n $areParamsValid = false;\n }\n // Do not allow negative values\n if($this->cmdParams[4][0] === \"-\" || $this->cmdParams[5][0] === \"-\" || $this->cmdParams[6][0] === \"-\") {\n $areParamsValid = false;\n }\n break;\n case 'update':\n // Param order should be: id, pet_type, item_type, name, color, lifespan, age, price\n if(count($this->cmdParams) !== 8) { $areParamsValid = false; }\n if(!is_numeric($this->cmdParams[0]) || !is_numeric($this->cmdParams[5]) || !is_numeric($this->cmdParams[6]) || !is_numeric($this->cmdParams[7])) {\n $areParamsValid = false;\n }\n // Do not allow negative values\n if($this->cmdParams[5][0] === \"-\" || $this->cmdParams[6][0] === \"-\" || $this->cmdParams[7][0] === \"-\") {\n $areParamsValid = false;\n }\n break;\n case 'delete':\n if(count($this->cmdParams) !== 1) { $areParamsValid = false; }\n if(!is_numeric($this->cmdParams[0])) {\n $areParamsValid = false;\n }\n break;\n case 'list':\n // 'list' can come with a 'sort' and/or 'filter parameter\n if(isset($this->cmdParams[0])) {\n if($this->cmdParams[0] === \"filters\") {\n $this->arg_list_filters = ((isset($this->cmdParams[1])) ? $this->cmdParams[1] : null);\n } elseif($this->cmdParams[0] === \"sort\") {\n $this->arg_list_sort = ((isset($this->cmdParams[1])) ? $this->cmdParams[1] : null);\n } else {\n $areParamsValid = false;\n }\n }\n if(isset($this->cmdParams[2])) {\n if($this->cmdParams[2] === \"filters\") {\n $this->arg_list_filters = ((isset($this->cmdParams[3])) ? $this->cmdParams[3] : null);\n } elseif($this->cmdParams[2] === \"sort\") {\n $this->arg_list_sort = ((isset($this->cmdParams[3])) ? $this->cmdParams[3] : null);\n } else {\n $areParamsValid = false;\n }\n }\n break;\n case 'help':\n break;\n default:\n throw new \\Exception(\"This line should not have been reached; bug in code.\");\n }\n \n if(!$areParamsValid) {\n throw new \\Exception(\"Invalid parameters passed to script.\");\n }\n }",
"public function fails();",
"public function fails();",
"public function isValidCommand($command)\n {\n $validCommands = [self::CMD_PLACE, self::CMD_MOVE, self::CMD_RIGHT, self::CMD_LEFT, self::CMD_REPORT, self::CMD_EXIT];\n return (in_array(strtoupper($command), $validCommands));\n }",
"public function test_with_invalid_number_drain()\n {\n $this->artisan('play:game')\n ->expectsQuestion('Enter A team players:', '18,20,50,40')\n ->expectsQuestion('Enter B team players:', '35, 10, 30, 20, 90')\n ->expectsOutput(\"Match can not play 5 players allowed each team\")\n ->assertExitCode(0);\n }",
"function is_ok_smtp ($cmd = \"\"){\n\t\tif(empty($cmd))\t\t\t\t{ return false; }\n\t\tif (ereg (\"^220\", $cmd))\t{ return true; }\n\t\tif (ereg (\"^250\", $cmd))\t{ return true; }\n\t\treturn false;\n\t}",
"public function testFalseType()\n {\n $validator=new Validator();\n $result=$validator->type(\"10000\");\n $this->assertFalse($result[0]);\n $this->assertEquals('Type is not valid.',$result[1]);\n }",
"protected function illegal_data_error() {\r\n\t\treturn new Status(tr('Illegal Command Data for Command %cmd%', 'core', array('%cmd%' => get_class($this))));\r\n\t}",
"private static function validateJob($class, $queue)\n\t{\n\t\tif (empty($class)) {\n\t\t\tthrow new Resque_Exception('Jobs must be given a class.');\n\t\t}\n\t\telse if (empty($queue)) {\n\t\t\tthrow new Resque_Exception('Jobs must be put in a queue.');\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function testValidateThrowEmptyNoneProtechDataException()\n {\n $this->job->setMapper($this->createMock(Mapper::class));\n\n $this->job->setCsvData([['Name'], ['test']]);\n\n $this->job->getMapper()->expects($this->exactly(1))->method('checkRequiredProperties')->willReturn(true);\n $this->job->getMapper()->expects($this->exactly(1))->method('checkRequiredValidations')->willReturn(true);\n $this->job->getMapper()->expects($this->exactly(1))->method('checkNoneProtectionData')->willReturn(false);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertContains(EntityException::MGS_EMPTY_NONE_PROTECTION_DATA, $e->getMessage());\n }\n }",
"public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }",
"public function testValidateFormMalformed()\n {\n $formData = ['jelly'];\n $this->expectException(TypeError::class);\n $case = GRUB\\Validator\\Validator::validateIngredient($formData);\n }",
"public function testExecuteWithBadFile()\n {\n\n $this->commandTester->execute(\n array(\n 'file_path' => __DIR__. '/../Fixtures/stockd.csv',\n '--test_run' => true,\n )\n );\n// $this->assertEquals('File could not be found.' . PHP_EOL, $this->commandTester->getDisplay());\n $this->assertRegexp('/File could not be found./', $this->commandTester->getDisplay());\n\n }",
"private function __validate_shell_cmd() {\n if ($this->initial_data[\"shell_cmd\"]) {\n $this->validated_data[\"shell_cmd\"] = strval($this->initial_data[\"shell_cmd\"]);\n } else {\n $this->errors[] = APIResponse\\get(7000);\n }\n }",
"protected function validateSelectablePluginType() {\n if (!$this->selectablePluginType) {\n throw new \\RuntimeException('A plugin type must be set through static::setSelectablePluginType() first.');\n }\n }",
"public function isMenuItemValidBlankCallExpectFalse() {}",
"public function validate(array $args): bool\n {\n // Ensure that the array has a 'status' key.\n if (!array_key_exists('status', $args))\n {\n throw new InvalidArgumentException('Error - status is missing');\n }\n // Ensure that the supplied status is a string.\n else if (!is_string($args['status']))\n {\n throw new InvalidArgumentException('Error - invalid data type supplied for status, string expected.');\n }\n // Ensure that the supplied status is on the list of allowed payment status values.\n else if (!in_array($args['status'], $this->allowedStatusValues))\n {\n throw new InvalidArgumentException('Error - Payment status \"' . $args['status'] . '\" is invalid.');\n }\n\n return true;\n }",
"public function testExecuteWithNonExistingQueue()\n {\n $commandTester = $this->createCommandTester(new WorkerCommand());\n\n $this->expectException(\\InvalidArgumentException::class);\n $commandTester->execute([\n 'name' => 'non-existing-queue'\n ]);\n }",
"private function validateSendmail(): void\n {\n if (!isset($this->options['command'])) {\n throw new InvalidArgumentException('Missing command for sendmail transport');\n }\n }"
]
| [
"0.60966",
"0.5553765",
"0.54333586",
"0.54293066",
"0.5390708",
"0.53891224",
"0.5382428",
"0.5364725",
"0.53171414",
"0.52714354",
"0.5257588",
"0.5240791",
"0.5204579",
"0.5204579",
"0.518975",
"0.5163288",
"0.5158636",
"0.514738",
"0.51260024",
"0.51204145",
"0.5098007",
"0.50515616",
"0.5051157",
"0.5047261",
"0.5033335",
"0.50269675",
"0.50044316",
"0.50008315",
"0.5000779",
"0.49910215"
]
| 0.7435408 | 0 |
Create a controller dispatch with provided arguments | private function createDispatch(array $arguments): ControllerDispatch
{
$arguments['controller'] = $this->filterName($arguments['controller']);
$data = [
'controllerClassName' => ltrim(
"{$arguments['namespace']}"."\\"."{$arguments['controller']}",
"\\"
),
'method' => lcfirst($this->filterName($arguments['action'])),
'arguments' => $arguments['args']
];
$reflection = new ReflectionClass(ControllerDispatch::class);
return $reflection->newInstanceArgs($data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function controller()\r\n {\r\n $collector = $this->getControllerCollector();\r\n \r\n foreach (func_get_args() as $controller) {\r\n call_user_func([$collector, 'controller'], $controller);\r\n }\r\n }",
"public function createController( ezcMvcRequest $request );",
"public function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }",
"public function __call( $controllername, $args = array() )\n {\n $controllername = ucfirst($controllername);\n\n if(isset($args[0]['action']))\n {\n $controller_action = $args[0]['action'];\n }\n else\n { // default action method name\n $controller_action = 'perform';\n }\n\n if(isset($args[0]['constructorData']))\n {\n $constructor_data = $args[0]['constructorData'];\n }\n else\n {\n $constructor_data = null;\n }\n\n if(isset($args[0]['controllerMustExsists']))\n {\n $controller_must_exsists = $args[0]['controllerMustExsists'];\n }\n else\n {\n $controller_must_exsists = null;\n }\n\n // create page controller instance\n if(false === ($controller = $this->getControllerInstance( $controllername, $constructor_data , $controller_must_exsists )))\n {\n return false;\n }\n\n // Aggregate model object\n $controller->model = $this->model;\n\n // Aggregate debug object\n $controller->debug = $this->debug;\n\n // Aggregate router object\n $controller->router = $this->router;\n\n // Aggregate httpRequest object\n $controller->httpRequest = $this->httpRequest;\n\n // Aggregate httpResponse object\n $controller->httpResponse = $this->httpResponse;\n\n // Aggregate session object\n $controller->session = $this->model->session;\n\n // Aggregate the main configuration object\n $controller->config = $this->model->config;\n\n // aggregate this object for create nested controllers\n $controller->controllerLoader = $this;\n\n // use this to pass variables inside (nested) controller\n $controller->controllerVar = & $this->controllerVars;\n\n // set render view flag\n $controller->setRenderView( $controllername );\n // set return view flag\n $controller->setReturnView( $controllername );\n // set view folder flag\n $controller->setViewFolder( $controllername );\n\n if ( true == $controller->renderView )\n {\n // set view folder flag\n $controller->setViewEngine( $controllername );\n // set view engine type\n $controller->viewEngine = $this->setViewEngine( $controller, $controllername );\n $this->startViewEngine( $controller, $controllername );\n }\n\n // set expire time of cache of a related controller\n $controller->setCacheExpire( $controllername );\n\n // run authentication\n $controller->auth();\n\n // run controller prepended filters\n $controller->prependFilterChain();\n\n // dont render a view\n if ( true === $controller->getRenderView( $controllername ) )\n {\n if($this->disable_cache == 0)\n {\n // start caching\n if( false !== ($cache_flag = $this->startControllerCache( $controller, $controllername )) )\n {\n // echo the context in simple views\n if( $controller->getReturnView( $controllername ) === false )\n {\n // echo the context\n $this->httpResponse->flush();\n }\n // return the context in nested views\n else\n {\n return $this->httpResponse->flushBodyChunk( 'view.' . $controllername );\n }\n return;\n }\n }\n }\n\n // check if the main action methode of the page controller exists\n if(method_exists ( $controller, $controller_action ))\n {\n // check if the permission methode exists\n $controller_permission_methode = $controller_action . 'Permission';\n if(method_exists ( $controller, $controller_permission_methode ))\n {\n // validate permission\n if(true !== $controller->$controller_permission_methode())\n {\n // check if the permission methode exists\n $controller_action = $controller_permission_methode . 'Error';\n if(!method_exists ( $controller, $controller_action ))\n {\n $error_message = 'no permission to execute \"' .$controller_action. '\" action methode';\n $controller->error( array('messages' => array($error_message),\n 'view' => 'Error') );\n\n trigger_error( $error_message, E_USER_WARNING );\n }\n }\n }\n // execute on the main controller action methode\n $controller->$controller_action( $constructor_data );\n }\n else\n {\n $error_message = 'controller action methode \"' .$controller_action. '\" of the page controller \"'.$controllername.'\" dosent exists';\n $controller->error( array('messages' => array($error_message),\n 'view' => 'Error') );\n\n trigger_error( $error_message, E_USER_WARNING );\n }\n\n // render a view if needed\n if ( true == $controller->getRenderView( $controllername ) )\n {\n $controller->setView( $controllername );\n\n // set view name\n // usually it is the same as the controller name\n // except if it is defined else in controller instance\n $_view = $controller->getView( $controllername );\n\n if(empty($_view))\n {\n $this->viewEngine->view = 'view.' . $controllername;\n }\n else\n {\n $this->viewEngine->view = 'view.' . $_view;\n }\n\n $this->viewEngine->viewFolder = $this->getViewPath( $controller, $controllername );\n\n // render the view\n $this->viewEngine->renderView();\n }\n else\n {\n $this->popControllerFromStack();\n return '';\n }\n\n // run append filters\n $body_chunk_ref = &$this->httpResponse->getBodyChunk( $this->viewEngine->view );\n $controller->appendFilterChain( $body_chunk_ref );\n\n if($this->disable_cache == 0)\n {\n // write view content to cache\n $this->writeControllerCache( $controller, $body_chunk_ref, $controllername );\n }\n\n // echo the context in simple views\n if( $controller->returnView == false )\n {\n // echo the context\n $this->httpResponse->flush();\n }\n // return the context in nested views\n else\n {\n return $this->httpResponse->flushBodyChunk( $this->viewEngine->view );\n }\n }",
"public static function dispatch()\n {\n // Melde alle Fehler außer E_NOTICE\n //error_reporting(E_ALL & ~E_NOTICE);\n\n $controllerName = UriParser::getControllerName().'Controller';\n $className = 'App\\\\Controller\\\\'.$controllerName;\n $methodName = UriParser::getMethodName();\n\n // Eine neue Instanz des Controllers wird erstellt und die gewünschte\n // Methode darauf aufgerufen.\n $controller = new $className();\n $controller->$methodName();\n }",
"public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"public function run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }",
"public function dispatch()\n {\n try {\n list($this->controller, $this->method) = $this->getRegisteredControllerAndMethod();\n\n\n $this->parameters = $this->matchedRoute->attributes;\n\n $this->getReflectionClass($this->controller)\n ->getMethod($this->method)\n ->invokeArgs(\n new $this->controller($this->container),\n $this->parameters\n );\n } catch (\\ReflectionException $e) {\n throw new CfarException(\n CfarException::INVALID_DECLARATION . \". \" . $e->getMessage()\n );\n }\n }",
"public function __construct(){\n\t\t$url = $this->processUrl();\n\n\t\t//this if statement unsets the defaultController so we can use the one that is being talked to.\n\t\tif(file_exists('../app/controllers/'.$url[0].'.php')){\n\t\t\t$this->defaultController = $url[0];\n\t\t\tunset($url[0]);\n\t\t}\n\n\t\trequire_once('../app/controllers/' .$this->defaultController.'.php');\n\n\t\t$this->defaultController = new $this->defaultController;//instantiate and make it an object\n\n\t\tif(isset($url[1])){\n\t\t\tif(method_exists($this->defaultController,$url[1])){\n\t\t\t$this->defaultMethod = $url[1];\n\t\t\tunset($url[1]);\n\t\t\t}\t\n\t\t}\n\n\t\t\n\t\t$this->parameters = $url ? array_values($url):[];\n\t\t// print_r($this->parameters);\n\n\t\tcall_user_func_array([$this->defaultController,$this->defaultMethod],$this->parameters);\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"public function __invoke($controller) {\n }",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }",
"public static function controller($name, $args = array())\n {\n // Wrapper\n self::class($name, 'controllers', $args, false);\n }",
"protected function createController()\n {\n $this->createClass('controller');\n }",
"public function dispatch()\n\t{\n\t\t$this->segs = explode('/',$this->c->Router->route);\n\n\t\t/* classname seg1 (Controller) */\n\t\t$this->className = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* method seg2 */\n\t\t$this->methodName = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* call event */\n\t\t$this->c->Event->preController();\n\n\t\t/* This throws a error and 4004 - handle it in your error handler */\n\t\tif (!class_exists($this->className)) {\n\t\t\tthrow new \\Exception($this->className.' not found',4004);\n\t\t}\n\n\t\t/* create new controller inject the container */\n\t\t$controller = new $this->className($this->c);\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preMethod();\n\n\t\t/* This throws a error and 4005 - handle it in your error handler */\n\t\tif (!is_callable(array($controller,$this->methodName))) {\n\t\t\tthrow new \\Exception($this->className.' method '.$this->methodName.' not found',4005);\n\t\t}\n\n\t\t/* let's call our method and capture the output */\n\t\t$this->c->Response->body .= call_user_func_array(array($controller,$this->methodName),$this->segs);\n\t}",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"public static function dispatch(...$arguments)\n {\n return new PendingDispatch(new static(...$arguments));\n }",
"public function run()\n {\n call_user_func_array(array(new $this->controller, $this->action), $this->params);\n }",
"protected function buildControllerContext() {}",
"public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }",
"public function __construct(){\n $arr = $this->UrlProcess();\n\n // Xu ly controller\n if(!empty($arr)){\n if(file_exists(\"./source/controllers/\".$arr[0].\".php\")){\n $this->controller = $arr[0];\n unset($arr[0]); // loai bo controller khoi mang -> de lay params ben duoi\n }\n }\n \n\n require_once \"./source/controllers/\".$this->controller.\".php\";\n $this->controller = new $this->controller;\n\n // Xu ly action\n if(isset($arr[1])){\n if(method_exists($this->controller, $arr[1])){\n $this->action = $arr[1];\n }\n unset($arr[1]); // loai bo action khoi mang\n }\n\n //Xu li params\n $this->params = $arr?array_values($arr):[];\n \n call_user_func_array([$this->controller, $this->action], $this->params);\n\n }",
"public function controller($arguments = array()) {\n\n // first try to get a controller for the representation\n $controller = null;\n if($representation = $this->representation()) {\n $controller = $this->kirby->registry->get('controller', $this->template() . '.' . $representation);\n }\n\n // no representation or no special controller: try the normal one\n if(!$controller) $controller = $this->kirby->registry->get('controller', $this->template());\n\n if(is_a($controller, 'Closure')) {\n return (array)call_user_func_array($controller, array(\n $this->site,\n $this->site->children(),\n $this,\n $arguments\n ));\n }\n\n return array();\n\n }",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"public function dispatch($controller, $action, $params) {\n\t\t// Include Controller File\n\t\trequire_once \"src/{$controller}.php\";\n\t\t// Load Action\n\t\t$controller .= 'Controller';\n\t\t$action.= 'Action';\n\t\t$c = new $controller($controller, $action, $params);\n\t\t$c->$action($params);\n\t\treturn;\n\t}",
"protected function dispatch($dispatch_rt, $args = array( '' )) {\n\t\treturn new ADispatcher($dispatch_rt, $args);\n\t}",
"function __construct()\n {\n $arr = $this->UrlProcess();\n\n //handling controller\n //check controller exists\n if(file_exists(\"./mvc/controllers/\".$arr[0].\".php\")){\n $this->controller = $arr[0];\n unset($arr[0]);\n }\n require_once \"./mvc/controllers/\". $this->controller.\".php\";\n $this->controller = new $this->controller;\n //handling acction\n //check if arr[1] exists\n if(isset($arr[1])){\n //method_exists(class, a method check)\n if( method_exists($this->controller, $arr[1])){\n $this->acction = $arr[1]; \n }\n unset($arr[1]);\n }\n //handding params\n $this->params = $arr?array_values($arr):[];\n\n call_user_func_array([$this->controller, $this->acction], $this->params);\n }",
"public function dispatch() {\n if ($this->dispatching == null) {\n\n $this->dispatching = $this->router->getMatchedRoutes($this->request->getPath());\n }\n\n // Dispatch array is not empty\n while (!empty($this->dispatching)) {\n\n // Get the next available dispatch\n $dispatching = array_shift($this->dispatching);\n\n // Get the controller namespace\n $namespace = '\\modules\\\\' . $dispatching['module'] . '\\controllers\\\\' . $dispatching['controller'];\n\n // The controller does not exist\n if (class_exists($namespace) === false) {\n\n continue;\n }\n\n // Set the request vars\n $this->request->setVar(array_diff_key($dispatching, array_flip(['module', 'controller', 'action'])));\n // Set the dispatcher dispatched values\n $this->dispatched = array_intersect_key($dispatching, array_flip(['module', 'controller', 'action']));\n\n $controller = new $namespace($this->request, $this, $this->container);\n\n // We have a POST action defined\n if ($this->request->isPost() &&\n method_exists($controller, $this->getBaseActionName() . Router::ACTION_POST_SUFFIX)) {\n\n // Set the correct dispatching/dispatched action\n $dispatching['action'] = $this->dispatched['action'] = $this->getBaseActionName() . Router::ACTION_POST_SUFFIX;\n\n // A default controller action cannot be found\n } else if ($this->request->isGet() && method_exists($controller, $dispatching['action']) === false) {\n\n continue;\n }\n\n // Set the controller was forwarded to false\n $this->controllerWasForwarded = false;\n\n // The controller has a pre method defined\n if (method_exists($controller, 'pre')) {\n\n $controller->pre();\n }\n\n // The controller was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n $controller->{$dispatching['action']}();\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // The controller has a post method defined\n if (method_exists($controller, 'post')) {\n\n $controller->post();\n }\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // Render the view and set the response body\n $controller->getResponse()->setBody($controller->getView()->render());\n\n return;\n }\n\n // Empty the dispatched array so dispatcher not resolved event can switch to a different module if needed\n $this->dispatched = ['module' => '', 'controller' => '', 'action' => ''];\n\n $this->eventManager->emit($this->container->get('event', ['dispatcher:notResolved', $this]));\n $this->dispatch();\n }"
]
| [
"0.6747391",
"0.6745231",
"0.66545177",
"0.6643778",
"0.6583779",
"0.6445065",
"0.64262486",
"0.6365146",
"0.63440603",
"0.6268208",
"0.62662405",
"0.62603784",
"0.6251924",
"0.62374294",
"0.6217345",
"0.6202858",
"0.618361",
"0.61825645",
"0.6180855",
"0.61748445",
"0.61575127",
"0.61459374",
"0.6145179",
"0.6128414",
"0.609662",
"0.60882515",
"0.60762936",
"0.60686857",
"0.6030687",
"0.6027707"
]
| 0.7837791 | 0 |
return sprintf('Type: %d', get_called_class()::SHAPE_TYPE); | public static function getTypeDescription(): string
{
$class = get_called_class()::SHAPE_TYPE;
return <<<EOF
Type: $class
EOF;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_type() { return substr( strrchr( get_called_class(), '\\\\' ), 1 ); }",
"private function get_type() {\n\n\t}",
"public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}",
"public function type_name(){\r\n \r\n //sends back the name of the class running\r\n return $this->type_name;\r\n \r\n }",
"abstract public function getTypeName(): string;",
"abstract protected function get_typeid();",
"private function GetType()\n\t\t{\n\t\t\t$type = get_called_class();\n\t\t\t$type = explode(\"\\\\\",$type);\n\t\t\t$type = $type[(count($type)-1)];\n\t\t\t\n\t\t\treturn $type;\n\t\t}",
"abstract public function type(): string;",
"public function get_type(): string;",
"public function __toString()\n {\n return get_called_class();\n }",
"public function getName()\n {\n return self::POINT;\n }",
"public function type() : string;",
"public function getShape1()\n {\n }",
"public function getMarkerFactoryClassStr();",
"public function type(): string;",
"function getType(): string;",
"function getType(): string;",
"abstract protected function get_typestring();",
"public function type()\n\t{\n\t\treturn $this->definition->name;\n\t}",
"abstract public function getTypeName();",
"public static function getType(): string\n {\n return self::TYPE;\n }",
"public function type() { }",
"function positionTypeName( $position_type )\n{\n $database = eZDB::globalDatabase();\n $res_array = array();\n $name = false;\n\n $query= \"SELECT Name FROM eZClassified_PositionType WHERE ID='$position_type'\";\n $database->array_query( $res_array, $query );\n if ( count( $res_array ) < 0 )\n die( \"eZPosition::positionTypeName(): No position type found with id=$position_type\" );\n else if ( count( $res_array ) == 1 )\n {\n $name = $res_array[0][\"Name\"];\n }\n else\n die( \"eZPosition::positionTypeName(): Found more than one position type with id=$position_type\" );\n\n return $name;\n}",
"function _get_type() {\n\t\treturn $this->type();\n\n\t}",
"public function toString()\n {\n return __CLASS__;\n }",
"function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }",
"public static function className() : string {\n return get_called_class();\n }",
"function getType()\n {\n return get_class($this);\n }",
"function getName()\n {\n return get_class($this);\n }",
"function getShape() { return $this->_shape; }"
]
| [
"0.678919",
"0.65449953",
"0.65407544",
"0.65268636",
"0.64523995",
"0.6403081",
"0.64014417",
"0.63031447",
"0.62598175",
"0.625583",
"0.6250725",
"0.61975014",
"0.6178347",
"0.61620945",
"0.61575496",
"0.61400235",
"0.61400235",
"0.6136779",
"0.61318934",
"0.61282885",
"0.6084323",
"0.60727686",
"0.6071597",
"0.60546124",
"0.6014108",
"0.6013414",
"0.6005854",
"0.6002896",
"0.5999742",
"0.59943867"
]
| 0.68682086 | 0 |
Get the SmsUp route group configuration array. | private function routeConfiguration()
{
return [
'domain' => null,
'namespace' => 'SquareetLabs\LaravelSmsUp\Http\Controllers',
'prefix' => 'smsup'
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModuleRoutes()\n {\n return isset($this->config['module']['routes']) ? $this->config['modules']['routes'] : [];\n }",
"private function channelRouteConfiguration(): array\n {\n return [\n 'domain' => config('messenger.routing.channels.domain'),\n 'prefix' => config('messenger.routing.channels.prefix'),\n 'middleware' => $this->mergeApiMiddleware(config('messenger.routing.channels.middleware')),\n ];\n }",
"private function routeConfiguration()\n {\n return [\n 'prefix' => config('faithgen-events.prefix'),\n 'middleware' => config('faithgen-events.middlewares'),\n ];\n }",
"public function getGroupConfig()\n {\n $groups = [];\n $config = $this->getAllConfigInfo();\n\n foreach ($config as $process) {\n $groupName = $process['group'];\n\n if (! isset($groups[$groupName])) {\n $groups[$groupName] = [\n 'name' => $groupName,\n 'priority' => $process['group_prio'],\n 'inuse' => $process['inuse'],\n 'processes' => [],\n ];\n }\n\n $groups[$groupName]['processes'][$process['name']] = [\n 'name' => $process['name'],\n 'priority' => $process['process_prio'],\n 'autostart' => $process['autostart'],\n ];\n }\n\n return $groups;\n }",
"public function getRouteGroup()\n {\n return isset($this->route_group) ? $this->route_group : null;\n }",
"public function getRoutes(): array\r\n {\r\n return $this->routes;\r\n }",
"public function getRoutes(): array\r\n {\r\n return $this->routes;\r\n }",
"protected function getUsps()\n {\n $setting = Mage::getStoreConfig('usps/general/usps');\n $usps = array();\n if ($setting)\n {\n $setting = unserialize($setting);\n\n if (is_array($setting))\n {\n foreach ($setting as $usp)\n {\n $usps[] = current($usp);\n }\n return $usps;\n }\n return false;\n }\n }",
"public function getSectionGroupsUrl()\n {\n return $this->getProperty(\"SectionGroupsUrl\");\n }",
"public function getRoutes() {\n \treturn $this->routes;\n }",
"function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}",
"public function routes()\r\n {\r\n return $this->routes;\r\n }",
"public function getRoutes(){\n return $this->routes;\n }",
"public function getRoutes(): array\n\t{\n\t\treturn $this->_routes;\n\t}",
"private function routeConfiguration()\n {\n return [\n 'domain' => config('flowdash.domain'),\n 'namespace' => 'App\\FlowDash\\Http\\Controllers',\n 'prefix' => config('flowdash.path', 'flowdash'),\n 'middleware' => 'flowdash',\n ];\n }",
"function getRoutes()\n {\n return $this->_routes;\n }",
"public function getConfig()\r\n {\r\n\r\n $config = array(\r\n 'enabled' => $this->_scopeConfig->getValue('vicomage_megamenu_setting/accordion_menu/enabled',\r\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE),\r\n 'group' => $this->_scopeConfig->getValue('vicomage_megamenu_setting/accordion_menu/group',\r\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE),\r\n\r\n );\r\n return $config;\r\n }",
"public function navGroup() {\n return $this->app[\"config\"]->get(\"laravel-admin::nav_group\");\n }",
"public function getAclGroups()\n {\n $aclGroupsConfig = include(__DIR__ . '/Acl/AclGroupsConfig.php');\n return $aclGroupsConfig;\n }",
"#[Pure]\n public function groups(): array\n {\n return array_keys($this->routes);\n }",
"function getRoutes() {\n return $this->routes;\n }",
"public function getRoutes ()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n if ($this->_routes === null) {\n $filename = 'routes.' . (!$this->_subdomain ? 'php' : $this->_subdomain . '.php');\n $path = App::getInstance()->getPath('configs') . '/' . $filename;\n include $path;\n $this->_routes = $routes;\n }\n\n return $this->_routes;\n }",
"public static function routes()\n {\n return self::$routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }",
"public function getRoutes()\n {\n return $this->routes;\n }"
]
| [
"0.6031849",
"0.58362293",
"0.56833667",
"0.55728996",
"0.5564905",
"0.5552051",
"0.5552051",
"0.549341",
"0.5482768",
"0.54676056",
"0.5458091",
"0.5456056",
"0.54407257",
"0.5424809",
"0.5396576",
"0.5396225",
"0.5386024",
"0.53809965",
"0.5367173",
"0.5355695",
"0.53519416",
"0.5342935",
"0.5338446",
"0.5315127",
"0.53047645",
"0.53047645",
"0.53047645",
"0.53047645",
"0.53047645",
"0.53047645"
]
| 0.6102408 | 0 |
verify_logistic Check if delivery address is attended by logistics | public function verify_logistic()
{
# Clear the delivery address saved in session
$this->session->unset_userdata('delivery_address_id');
# Check if the address is a user default address or cames from the delivery address list
if( $this->input->post('delivery_address_id') == 'default' ) {
$data = new User( $this->session->userdata('id') );
$from_user = TRUE;
}else{
$data = new Delivery_Address( $this->input->post('delivery_address_id') );
$from_user = FALSE;
}
# Check if the data about the address exists
if( $data->exists() )
{
# Instanciate a new city object
$city = new City();
$city->where( array('id' => $data->city->id, 'reached_by_logistics' => 1) )->get();
# Check if the city is reached by logistics
if( $city->exists() )
{
$return = TRUE;
# Save the delivery address information in the session
$this->session->set_userdata('delivery_address_id', $from_user ? 'default' : $this->input->post('delivery_address_id') );
$this->session->set_userdata('delivery_address_valid', TRUE);
}else{
$return = FALSE;
}
# Return to the data
echo json_encode($return);
}else{
echo json_encode(FALSE);
die();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isValidForDelivery();",
"public function test_should_deliver_status() {\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://mock.tld',\n\t\t\t'topic' => 'student.created',\n\t\t) );\n\n\t\t// Inactive.\n\t\t$this->assertFalse( LLMS_Unit_Test_Util::call_method( $webhook, 'should_deliver', array( array( $this->factory->student->create() ) ) ) );\n\n\t\t// Active.\n\t\t$webhook->set( 'status', 'active' )->save();\n\t\t$this->assertTrue( LLMS_Unit_Test_Util::call_method( $webhook, 'should_deliver', array( array( $this->factory->student->create() ) ) ) );\n\n\t}",
"public function return_verify() {\n\t\treturn true;\n if($_POST['payer_status'] == 'verified')\n {\n // check the payment_status is Completed\n if ($_POST['payment_status'] != 'Completed' && $_POST['payment_status'] != 'Pending')\n {\n return false;\n }\n\n // check that receiver_email is your Primary PayPal email\n if ($_POST['receiver_email'] != $this->payment['paypal_account'])\n {\n return false;\n }\n\n if ($this->order['api_pay_amount'] != $_POST['mc_gross'])\n {\n return false;\n }\n if ($this->payment['paypal_currency'] != $_POST['mc_currency'])\n {\n return false;\n }\n return true;\n }\n else\n {\n // log for manual investigation\n return false;\n }\n }",
"function isVerified(){\n\n}",
"public function isVerified();",
"function check_manifesto_delivered($manifesto_id=0)\r\n\t{\r\n\t\tif($manifesto_id)\r\n\t\t{\r\n\t\t\t$manifesto_det=$this->db->query(\"select * from pnh_m_manifesto_sent_log where id=?\",$manifesto_id);\r\n\t\t\tif($manifesto_det->num_rows())\r\n\t\t\t{\r\n\t\t\t\t$manifesto_det=$manifesto_det->row_array();\r\n\t\t\t\t\r\n\t\t\t\t$transit_inv=$this->db->query(\"select invoice_no from pnh_invoice_transit_log where sent_log_id=? and status=3\",$manifesto_id)->result_array();\r\n\t\t\t\t\r\n\t\t\t\tif($transit_inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$t_inv_list=array();\r\n\t\t\t\t\tforeach($transit_inv as $tinv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list[]=$tinv['invoice_no'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$m_inv=explode(',',$manifesto_det['sent_invoices']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$not_found=0;\r\n\t\t\t\t\tforeach($m_inv as $minv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(in_array($minv, $t_inv_list))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$not_found=1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!$not_found)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public function verify()\n {\n $this->setVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }",
"public function passes($attribute, $value)\n {\n try {\n $result = bitcoind()->validateaddress($value)->get();\n return $result['isvalid'];\n\n } catch( \\Exception $e )\n {\n // set message for this context\n $this->message = 'Cannot verify address.';\n return false;\n }\n\n }",
"public static function canApply($address)\n {\n // Put here your business logic to check if fee should be applied or not\n // Example of data retrieved :\n // $address->getShippingMethod(); > flatrate_flatrate\n // $address->getQuote()->getPayment()->getMethod(); > checkmo\n // $address->getCountryId(); > US\n // $address->getQuote()->getCouponCode(); > COUPONCODE\n return true;\n }",
"public function allowDeliveryAddress()\n {\n $this->_data['DireccionEnvio'] = 1;\n }",
"public function testVerification()\n {\n Notification::fake();\n\n $this->user->email_verified_at = null;\n\n $this->user->save();\n\n $this->user->notify(new VerifyEmail);\n\n // $request = $this->post('/email/resend');\n //\n // $request->assertSuccessful();\n\n Notification::assertTimesSent(1, VerifyEmail::class);\n\n Notification::assertSentTo($this->user,VerifyEmail::class);\n }",
"function is_verified()\n {\n if( ereg(\"VERIFIED\", $this->paypal_response) )\n {\n return true;\n }\n else\n {\n return false;\n }\n\n }",
"public function checkVerification()\n {\n $dns = new Dns($this->domain, config('anonaddy.dns_resolver'));\n\n if (Str::contains($dns->getRecords('MX'), 'MX 10 ' . config('anonaddy.hostname') . '.')) {\n $this->markDomainAsVerified();\n }\n }",
"function should_send($trip_type)\n{\n\n // --------------------------------------------------------------------\n\t// Is the sign not enabled?\n // --------------------------------------------------------------------\n if ( $this->predictionParameters->disabled == \"X\" ) \n {\n $this->text = $this->text. \"DIS\";\n\t\treturn false;\n }\n\n // --------------------------------------------------------------------\n // Surtronic communications protocol displays (TCP)\n // --------------------------------------------------------------------\n if ( $this->display_type == \"S\" ) \n {\n // Is the Surtronic sign registered && $ready?\n $sql = \n \"SELECT update_status, channel_number\n INTO l_update_status, l_channel\n FROM unit_status_sign\n WHERE build_id = \". $this->predictionParameters->build_id; \n $row = $this->connector->fetch1($sql);\n if ( $this->connector->errorCode != 0 || $row[\"channel_number\"] || $row[\"update_status\"] != \"T\" )\n {\n $this->text = $this->text. \"NOT_REGISTERED\";\n return false;\n }\n }\n\n // --------------------------------------------------------------------\n\t// Is the arrival unsuitable for the delivery mode\n // --------------------------------------------------------------------\n\tif ( $this->predictionParameters->delivery_mode && $this->predictionParameters->delivery_mode != \"RCA\" ) {\n\t\t$l_delivery_code = substr($trip_type, 0, 1);\n\t\tif ( !strstr($this->predictionParameters->delivery_mode, $l_delivery_code) ) {\n $this->text = $this->text. \"DIS\";\n return false;\n\t\t}\n\t}\n\n $currtime = new Datetime();\n $eta_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->eta_last_sent);\n $etd_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->etd_last_sent);\n\n // --------------------------------------------------------------------\n\t// Is arrival time is within echo window || $has passed\n // --------------------------------_------------------------------------\n if ( $this->predictionParameters->countdown_dep_arr == \"A\" ) {\n\t $l_comp_secs = $eta_last_sent->getTimestamp() - $currtime->getTimestamp();\n } else {\n\t $l_comp_secs = $etd_last_sent->getTimestamp() - $currtime->getTimestamp();\n }\n\n //echo \"HC WIN \";\n $this->predictionParameters->display_window = 7200;\n\tif ( $l_comp_secs > $this->predictionParameters->display_window || $l_comp_secs < -60 ) {\n if ( $l_comp_secs < -60 ) \n {\n $this->text = $this->text. \" ASSUME COUNTED_DOWN\";\n $w_display_line = true;\n return false;\n } else {\n if ( $l_comp_secs < -60 ) {\n $w_display_line = false;\n }\n\t\t $this->text = $this->text. \"WIN\". $l_comp_secs . \"/\". $this->predictionParameters->display_window;\n\t\t return false;\n }\n\t}\n\n // --------------------------------------------------------------------\n\t// Has vehicle already arrived/departed, if ( $so clear it down\n // --------------------------------------------------------------------\n if ( \n ( $this->predictionParameters->countdown_dep_arr == \"A\" && $this->arrival_status == \"A\" ) ||\n ( $this->predictionParameters->countdown_dep_arr == \"D\" && $this->departure_status == \"A\" ) \n ) {\n $this->text = $this->text. \" Already there Force Clear\";\n return false;\n }\n\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->build_id = $this->stopBuild->build_id;\n\n // --------------------------------------------------------------------\n\t// Does sign already have enough arrivals\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRS\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MA\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS\";\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// Does sign already have enough arrivals for this destination\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRSPERDEST\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MAD\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS_FOR_RT_DEST\";\n $w_display_line = false;\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// As the bus stop is only able to handle one set of RTPI info \n\t// if ( $this arrival is the second || $more arrival of this vehicle at the\n // sign ) convert it to show published time\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction(\"DUPVEH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n $this->text = $this->text. \" DUPV->P\";\n $this->vehicle->vehicle_code = \"AUT\";\n $this->vehicle->vehicle_id = 0;\n }\n\n\t// ------------------------------------------------------------------------\n // Ensure arrival \n\t// For sequence/autoroute countdowns ensure resent every 5 minutes\n\t// ------------------------------------------------------------------------\n\tif ( $this->time_last_sent ) {\n if ( $this->sch_rtpi_last_sent != $this->initialValues->sch_rtpi_last_sent ) {\n $this->text = $this->text. \" \". $this->initialValues->sch_rtpi_last_sent. \"->\". $this->sch_rtpi_last_sent;\n } else {\n\t if ( $trip_type == \"AUT\" ) {\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 180;\n if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" $l_sincelast_int $l_at_least_every PFRC\";\n } else {\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\t\t $this->text = $this->text. \" AUTlast \". $this->time_last_sent;\n $w_display_line = false;\n return false;\n\t\t }\n } else {\n // --------------------------------------------------------------------\n\t // Does prediction deviate enough from previous prediction\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"HASCHANGEDENOUGH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n // Force every x seconds\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 120;\n if ($this->display_type == \"S\" ) {\n $this->text = $this->text. \" SNO_CHANGE\";;\n return false;;\n } else {\n\t\t if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" FRC\";\n } else {\n $this->text = $this->text. \" NO_CHANGE\";\n return false;\n }\n }\n } else {\n $this->text = $this->text. \" \";\n }\n \n //this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) \n\t\t //$this->text = $this->text. \" RTPlast \", UtilityDateTime::dateExtract($this->time_last_sent, \"hour to second\")\n //return false\n\t }\n }\n\t}\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->build_id = $this->build_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\n\treturn 1;\n}",
"public function passes($attribute, $value)\n {\n if($this->user->count() > 0){\n if(!$this->user->email_verified){\n $this->msg = self::ERR_MSG_EMAIL_VERIFIED_OFF;\n return false;\n }else{\n $this->msg = self::ERR_MSG_EMAIL_VERIFIED_ON;\n return false;\n }\n }\n return true;\n }",
"public function testFormCityMissingAddressVisible() {\n $form = new RedirectForm();\n $form_state = [];\n $payment = $this->mockPayment([\n 'firstname' => 'First',\n 'lastname' => 'Last',\n 'address1' => 'Address1',\n 'postcode' => 'TEST',\n 'country' => 'GB',\n ]);\n $element = $form->form([], $form_state, $payment);\n $pd = $element['personal_data'];\n $pd['address'] += ['#access' => TRUE];\n $this->assertTrue($pd['address']['#access']);\n }",
"function evel_is_address_bouncing($address) {\n global $evel_client;\n $params = func_get_args();\n $result = $evel_client->call('EvEl.is_address_bouncing', $params);\n return $result;\n}",
"public function hasVerifiedReport(): bool\n {\n return\n !RoadDamageReport::where('roaddamage_id', $this->id)\n ->where('verified', RoadDamageReport::FALSEPOSITIVE)->exists() &&\n RoadDamageReport::where('roaddamage_id', $this->id)\n ->where('verified', RoadDamageReport::VERIFIED)->exists();\n }",
"function deliveryCheck($rID, $date_time, $addr) {\n $_errors = array();\n \n if (!preg_match('/^\\d+/$', $rID)) {\n $_errors = \"Restaurant DeliveryCheck - Validation - restaurant ID (invalid, must be integer) (\" . $rID . \")\";\n }\n \n try {\n $addr->validate();\n } catch (OrdrinExceptionBadValue $ex) {\n $_errors[] = $ex.__toString();\n }\n \n throw new OrdrinExceptionBadValue($_errors);\n \n $dt = $this->format_datetime($date_time);\n \n return $this->_call_api(\"GET\",\n array(\n \"dc\",\n $rID, \n $dt,\n $addr->zip,\n $addr->city,\n $addr->street\n )\n );\n }",
"public function isVerified() {\n\t\treturn $this->oehhstat == 'V';\n\t}",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"function is_verified()\n {\n return false;\n }",
"public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}",
"public function verify()\n {\n $this->update(['email_verified_at' => Carbon::now()]);\n }",
"public function paymentMethodIsActive(Varien_Event_Observer $observer) \n {\n $event = $observer->getEvent();\n $method = $event->getMethodInstance();\n $result = $event->getResult();\n $quote = $event->getQuote(); \n \n //$result->isAvailable = true;\n $methodsNotAvailable = array ('correosinter_correosinter', 'homepaq48_homepaq48', 'homepaq72_homepaq72');\n \n if ($quote)\n {\n $shippingMethod = $quote->getShippingAddress()->getShippingMethod();\n $isInternational = (($quote->getShippingAddress()->getCountryId() != 'ES' && $quote->getShippingAddress()->getCountryId() != 'AD') || ($shippingMethod == 'correosinter_correosinter'))?true:false;\n\n if ((in_array($shippingMethod, $methodsNotAvailable) || $isInternational) && Mage::helper('correos')->checkCashondelivery($method->getCode())) {\n $result->isAvailable = false;\n }\n }\n \n }",
"public function validAddresses() {}",
"public function verifyAndSetAddress($a,$bRequired) {\n\t\tif ($a['country'] != 'USA')\n\t\t\tthrow new exception(\"internation addresses not supported yet\");\n\t\t$this->country='USA';\t\t\n\t\t$this->line1 = isset($a['line1']) ? $a['line1'] : ''; \t\n\t\t$this->line2 = isset($a['line2']) ? $a['line2'] : ''; \t\n\t\t$this->city = isset($a['city']) ? $a['city'] : ''; \t\n\t\t$this->state = isset($a['state2']) ? $a['state2'] : ''; \t\n\t\t$this->zip = isset($a['zip']) ? $a['zip'] : ''; \t\n\t\t\t\n\t\tif ($this->line1 == '' && $this->line2 == '') {\n\t\t\tif ($bRequired || $this->city != '' || $this->zip != '')\n\t\t\t\treturn (array('*line1'=>'You must provide an address'));\n\t\t\telse {\n\t\t\t\t$this->city=$this->state=$this->zip='';\n\t\t\t\treturn True;\t\t// OK -- just no address\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$retval=array();\n\t\tif ($this->city == '')\n\t\t\t$retval['*city']='You must provide a city';\n\t\tif ($this->zip == '')\n\t\t\t$retval['*zip']='You must provide a ZIP code';\n\t\telse {\n\t\t\t$nmatches=preg_match('/^[\\\\d]{5}(-[\\\\d]{4})??$/',$this->zip);\n\t\t\tif (0 == $nmatches)\n\t\t\t\t$retval['*zip']=\"Invalid ZIP code\";\n\t\t}\t\n\t\treturn (sizeof($retval) != 0) ? $retval : True;\n\t}",
"public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}",
"public function isVerified()\n\t{\n\t\tif($this->test_status_id == Test::VERIFIED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}",
"function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}"
]
| [
"0.55464864",
"0.51403135",
"0.5114555",
"0.5101803",
"0.5084732",
"0.5070056",
"0.503418",
"0.503383",
"0.5028527",
"0.49749124",
"0.49424875",
"0.48795176",
"0.48772293",
"0.48682237",
"0.48483664",
"0.48474276",
"0.4845719",
"0.48379055",
"0.48240072",
"0.48130557",
"0.4799043",
"0.4786995",
"0.47841454",
"0.47839996",
"0.47782376",
"0.47779354",
"0.47751766",
"0.4774617",
"0.47668582",
"0.47651744"
]
| 0.67062056 | 0 |
Static function to retrieve custom value with entity id and field label | static function getSingleCustomValue( $entityId, $customFieldLabel, $entityType = "Contact") {
$value = '';
if (empty($entityId) || empty($customFieldLabel)) {
return $value;
}
$apiParams = array(
'version' => 3,
'entity_id' => $entityId,
'entity_table' => $entityType
);
$apiCustomValues = civicrm_api('CustomValue', 'Get', $apiParams);
if (isset($apiCustomValues['is_error']) && $apiCustomValues['is_error'] == 0) {
foreach ($apiCustomValues['values'] as $customId => $customValue) {
if ($customId != 0) {
$apiParams = array(
'version' => 3,
'id' => $customId
);
$apiCustomField = civicrm_api('CustomField', 'Getsingle', $apiParams);
if (!isset($apiCustomField['is_error']) || $apiCustomField['is_error'] == 0) {
if (isset($apiCustomField['label']) && $apiCustomField['label'] == $customFieldLabel) {
/*
* Further processing depending on data type
*/
switch($apiCustomField['data_type']) {
case "Country":
$value = $customValue['latest'];
$apiParams = array(
'version' => 3,
'id' => $customValue['latest']
);
$apiCountries = civicrm_api('Country','Get', $apiParams);
if (isset($apiCountries['is_error']) && $apiCountries['is_error'] == 0) {
foreach ($apiCountries['values'] as $countryId => $apiCountry) {
if(isset($apiCountry['name'])) {
$value = ts($apiCountry['name']);
}
}
}
break;
case "String":
/*
* Process depending on html_type
*/
switch($apiCustomField['html_type']) {
case "Select":
$apiParams = array(
'version' => 3,
'option_group_id' => $apiCustomField['option_group_id'],
'value' => $customValue['latest']
);
$apiOptionValues = civicrm_api('OptionValue', 'Getsingle', $apiParams);
if (!isset($apiOptionValues['is_error']) || $apiOptionValues['is_error'] == 0 ) {
if (isset($apiOptionValues['label'])) {
$value = $apiOptionValues['label'];
} else {
$value = $customValue['latest'];
}
}
break;
case "CheckBox":
$apiParams = array(
'version' => 3,
'option_group_id' => $apiCustomField['option_group_id']
);
if (isset($customValue['latest'][0])) {
$apiParams['value'] = $customValue['latest'][0];
}
$apiOptionValues = civicrm_api('OptionValue', 'Getsingle', $apiParams);
if (!isset($apiOptionValues['is_error']) || $apiOptionValues['is_error'] == 0 ) {
if (isset($apiOptionValues['label'])) {
$value = $apiOptionValues['label'];
} else {
$value = $customValue['latest'][0];
}
}
break;
default:
$value = $customValue['latest'];
}
break;
default:
$value = $customValue['latest'];
}
}
}
}
}
}
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValue(ContentEntityInterface $entity, $field);",
"function _doesoe_theme_entity_get_value($entity_type, $entity, $field) {\n if (empty($entity)) {\n return NULL;\n }\n $entity_w = entity_metadata_wrapper($entity_type, $entity);\n if (isset($entity_w->{$field}) && !empty($entity_w->{$field}->value())) {\n $term = $entity_w->{$field}->value();\n return $term;\n }\n return NULL;\n}",
"function getFieldValue($field);",
"function get_value_by_label( $form, $entry, $label ) {\n \n\tforeach ( $form['fields'] as $field ) {\n $lead_key = $field->label;\n\t\tif ( strToLower( $lead_key ) == strToLower( $label ) ) {\n\t\t\treturn $entry[$field->id];\n\t\t}\n\t}\n\treturn false;\n}",
"function civicrm_api3_custom_value_get($params) {\n\n $getParams = array(\n 'entityID' => $params['entity_id'],\n 'entityType' => CRM_Utils_Array::value('entity_table', $params, ''),\n );\n if (strstr($getParams['entityType'], 'civicrm_')) {\n $getParams['entityType'] = ucfirst(substr($getParams['entityType'], 8));\n }\n unset($params['entity_id'], $params['entity_table']);\n foreach ($params as $id => $param) {\n if ($param && substr($id, 0, 6) == 'return') {\n $id = substr($id, 7);\n list($c, $i) = CRM_Utils_System::explode('_', $id, 2);\n if ($c == 'custom' && is_numeric($i)) {\n $names['custom_' . $i] = 'custom_' . $i;\n $id = $i;\n }\n else {\n // Lookup names if ID was not supplied\n list($group, $field) = CRM_Utils_System::explode(':', $id, 2);\n $id = CRM_Core_BAO_CustomField::getCustomFieldID($field, $group);\n if (!$id) {\n continue;\n }\n $names['custom_' . $id] = 'custom_' . $i;\n }\n $getParams['custom_' . $id] = 1;\n }\n }\n if (isset($params['onlyActiveFields'])) {\n \t$getParams['onlyActiveFields'] = $params['onlyActiveFields'];\n }\n $result = CRM_Core_BAO_CustomValueTable::getValues($getParams);\n\n if ($result['is_error']) {\n if ($result['error_message'] == \"No values found for the specified entity ID and custom field(s).\") {\n $values = array();\n return civicrm_api3_create_success($values, $params);\n }\n else {\n return civicrm_api3_create_error($result['error_message']);\n }\n }\n else {\n $entity_id = $result['entityID'];\n unset($result['is_error'], $result['entityID']);\n // Convert multi-value strings to arrays\n $sp = CRM_Core_DAO::VALUE_SEPARATOR;\n foreach ($result as $id => $value) {\n if (strpos($value, $sp) !== FALSE) {\n $value = explode($sp, trim($value, $sp));\n }\n\n $idArray = explode('_', $id);\n if ($idArray[0] != 'custom') {\n continue;\n }\n $fieldNumber = $idArray[1];\n $info = array_pop(CRM_Core_BAO_CustomField::getNameFromID($fieldNumber));\n // id is the index for returned results\n\n if (empty($idArray[2])) {\n $n = 0;\n $id = $fieldNumber;\n }\n else{\n $n = $idArray[2];\n $id = $fieldNumber . \".\" . $idArray[2];\n }\n if (CRM_Utils_Array::value('format.field_names', $params)) {\n $id = $info['field_name'];\n }\n else {\n $id = $fieldNumber;\n }\n $values[$id]['entity_id'] = $getParams['entityID'];\n if (CRM_Utils_Array::value('entityType', $getParams)) {\n $values[$n]['entity_table'] = $getParams['entityType'];\n }\n //set 'latest' -useful for multi fields but set for single for consistency\n $values[$id]['latest'] = $value;\n $values[$id]['id'] = $id;\n $values[$id][$n] = $value;\n }\n return civicrm_api3_create_success($values, $params);\n }\n}",
"public function fetchField();",
"public function getLabel($label=null)\n {\n if ($label != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE label = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$label]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->label;\n }\n \n }",
"public function retrieveFieldValue(Field $field, $model);",
"public function getFieldValue(Field $field, $model);",
"function get_val($id, $field){\n if($id){\n $q = sql_query(\"SELECT `$field` FROM `entities` WHERE `ID` = '$id'\");\n $r = mysqli_fetch_row($q);\n mysqli_free_result($q);\n return $r[0];\n }\n else{\n return \"\";\n }\n}",
"protected function _getInputFieldValueFromLabel( $aField ) { \n \n // If the value key is explicitly set, use it. But the empty string will be ignored.\n if ( isset( $aField['value'] ) && $aField['value'] != '' ) { return $aField['value']; }\n \n if ( isset( $aField['label'] ) ) { return $aField['label']; }\n \n // If the default value is set,\n if ( isset( $aField['default'] ) ) { return $aField['default']; }\n \n }",
"function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}",
"public function getCustomFieldValue($field) {\n $customFieldValue = Doctrine::getTable('ArticleCustomFieldValue')->getByArticleAndName($this, $field);\n return $customFieldValue ? $customFieldValue->getValue() : '';\n }",
"public abstract function FetchField();",
"function getValue(int $field);",
"function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }",
"function get_field_label($field_instance) {\n return $field_instance['label'];\n }",
"public function getLabelField() {}",
"public function getLookupField() {}",
"public function getFieldValue($entity, $field_name, $langcode) {\n if ($entity->hasTranslation($langcode)) {\n // If the entity has translation, fetch the translated value.\n return $entity->getTranslation($langcode)->get($field_name)->getValue();\n }\n\n // Entity doesn't have translation, fetch original value.\n return $entity->get($field_name)->getValue();\n }",
"function acf_get_field_label($field, $context = '')\n{\n}",
"public function getValueIdentifier(): string;",
"public function getListModuleValueLabel()\n {\n if (isset($this->properties[0])) {\n return $this->properties[0]->getFieldName();\n } else {\n return 'uid';\n }\n }",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}"
]
| [
"0.6889181",
"0.65778357",
"0.6566542",
"0.6518875",
"0.6511518",
"0.6479505",
"0.6430689",
"0.63849026",
"0.6360047",
"0.6330542",
"0.62819505",
"0.62806946",
"0.6268203",
"0.6244071",
"0.6235161",
"0.62296283",
"0.62207985",
"0.619831",
"0.6186993",
"0.61814636",
"0.61635077",
"0.6125138",
"0.61214745",
"0.6119711",
"0.6119711",
"0.6119711",
"0.6119711",
"0.6119711",
"0.6119711",
"0.6119711"
]
| 0.7473264 | 0 |
Static function to retrieve activity type id for Enkelvoude Hulpvraag | static function getEnkelvoudigeHulpvraagTypeId() {
$actTypeId = 0;
$apiParams = array(
'version' => 3,
'option_group_id' => 2,
'label' => "Enkelvoudige Hulpvraag"
);
$actType = civicrm_api('OptionValue', 'Getsingle', $apiParams);
if (!isset($actType['is_error']) || $actType['is_error'] == 0) {
$actTypeId = $actType['value'];
}
return $actTypeId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function activityActorId();",
"public function getActivityId();",
"abstract protected function get_typeid();",
"public function get_type()\n {\n return self::$_id;\n }",
"public function typeId()\n {\n return config('entities.ids.' . $this->type);\n }",
"public function getAndroidId();",
"public function getActivityIdentifier()\n {\n if (array_key_exists(\"activityIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"activityIdentifier\"];\n } else {\n return null;\n }\n }",
"public function getTypeId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typeid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typeid'];\n\t\t}\n\t}",
"public function get_activity_type($activity_id, $thread_id = NULL, $process_id = NULL) {\n\t\t$query = $this->db->select ( 'id_thread' )->where ( 'id', $activity_id )->get ( 'activities' );\n\t\t$result = $query->row ();\n\t\t$thread_id = $result->id_thread;\n\t\t\n\t\t// get activity_type\n\t\t$query = $this->db->query ( 'select sa.id as activity_type from setup_activities sa JOIN setup_processes sp ON sa.id_process=sp.id JOIN threads t ON t.type=sp.key JOIN activities a ON a.id_thread=t.id where a.id=' . $activity_id . ' and t.id=' . $thread_id . ' and sa.key = (select aa.type from activities aa where aa.id= ' . $activity_id . ')' );\n\t\treturn $query->row ();\n\t}",
"public function get_id() {\n return str_replace('forumngtype_', '', get_class($this));\n }",
"public function getTypeIdentifier();",
"public function getActivityId(): ?string;",
"public static function trackId(): string\n {\n return 'tid';\n }",
"public function getOGApplicationID();",
"public function activityForeignId();",
"public function getType_id()\n {\n return $this->type_id;\n }",
"public function getTypeId()\n {\n return $this->get(self::_TYPE_ID);\n }",
"public function getAppType();",
"public function getTypeId()\n {\n return $this->_getData('type_id');\n }",
"public function id() {\n return $this->activity_array['id'];\n }",
"public function get_type(): string;",
"public function get_reg_id($character, $id_type) {\n\n $fields = array(\"*\");\n $whereArr = array(\"id_type\" => $id_type);\n $id_number = $this->db_model->getData($fields, 'id_numbers_m_tbl', $whereArr);\n\n $int = intval(preg_replace('/[^0-9]+/', '', $id_number[0]->id_number), 10);\n $id = \"$character\" . ($int + 1);\n return $id;\n\n}",
"public function getEntityTypeId(){\n $entityType = Mage::getModel('eav/entity_type')->loadByCode($this->_entityType);\n if (!$entityType->getId()){\n Mage::helper('connector')\n ->log(\"Entity type \" . $this->_entityType . \" undefined\", Zend_log::ERR);\n return false;\n }\n return $entityType->getId();\n }",
"public function getId()\n {\n switch ($this->type) {\n case VideoInfo::TYPE_YOUTUBE:\n return app(InferYoutubeId::class)($this->info->url);\n case VideoInfo::TYPE_VIMEO:\n return $this->info->video_id;\n }\n return null;\n }",
"abstract public function getEntityTypeID();",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"Public function get_ididtypeexp()\n\t\t{\n\t\t\tReturn $this ->idtypeexp;\n\t\t}",
"private function get_type() {\n\n\t}"
]
| [
"0.62448317",
"0.62155926",
"0.6198939",
"0.6143468",
"0.6130929",
"0.6107719",
"0.6035379",
"0.6030141",
"0.60049987",
"0.59926337",
"0.5992089",
"0.59343773",
"0.5855107",
"0.5843588",
"0.5843307",
"0.5827969",
"0.5824882",
"0.58170307",
"0.5788696",
"0.57830644",
"0.57471955",
"0.56823194",
"0.5680224",
"0.56758404",
"0.56732905",
"0.56700146",
"0.56700146",
"0.56700146",
"0.56635875",
"0.5659552"
]
| 0.69880265 | 0 |
Static function to retrieve the first contact date for a customer first contact date means the first date of any case or activity Enkelvoudige Hulpvraag | static function getContactFirstDate($contactId) {
$firstContactDate = '';
if (empty($contactId)) {
return $firstContactDate;
}
/*
* retrieve first date for contact for activities
*/
$apiParams = array(
'version' => 3,
'activity_type_id' => self::getEnkelvoudigeHulpvraagTypeId(),
'contact_id' => $contactId,
);
$apiActivities = civicrm_api('Activity', 'Get', $apiParams);
$firstContactDate = new DateTime(date('Y-m-d'));
foreach ($apiActivities['values'] as $actId => $apiActivity) {
if (isset($apiActivity['activity_date_time'])) {
$actDate = new DateTime($apiActivity['activity_date_time']);
if ($actDate <= $firstContactDate) {
$firstContactDate = $actDate;
}
}
}
/*
* check if there is an earlier date in cases for contact
*/
$apiParams = array(
'version' => 3,
'client_id' => $contactId
);
$apiCases = civicrm_api('Case', 'Get', $apiParams);
foreach($apiCases['values'] as $caseId => $apiCase) {
if (isset($apiCase['start_date'])) {
$startDate = new DateTime($apiCase['start_date']);
if ($startDate <= $firstContactDate) {
$firstContactDate = $startDate;
}
}
}
return $firstContactDate->format('d-m-Y');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFirstDate()\n {\n $query = \"SELECT MIN(stat_date) AS first FROM \" . $this->tableName;\n $data = $this->SelectData($query, PDO::FETCH_ASSOC);\n\n if (false === $data) {\n return false;\n } else {\n return $data[0]['first'];\n }\n }",
"public function getFirstPaymentDate() {\r\n $query = $this->createQuery($this->_alias)\r\n ->select(\"DATE_FORMAT(cp.created_at, '%Y-%m') AS payment_date\")\r\n ->orderBy(\"id ASC\")\r\n ->limit(1);\r\n\r\n $res = $query->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\r\n\r\n if (count($res) > 0) {\r\n $res = $res[0][\"cp_payment_date\"];\r\n }\r\n\r\n return $res;\r\n }",
"public function getFirstDay(){$day = getdate(mktime(0, 0, 0, $this->getMonth(), 1, $this->getYear())); return $day['wday'];}",
"public function getFirstPaymentDate()\n\t{\n\t\treturn $this->first_payment_date;\n\t}",
"public function getEarliestDate();",
"function _data_first_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}",
"function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }",
"public function getContactDate() {\n return $this->date;\n }",
"function _data_first_month_day()\n {\n $month = date('m');\n $year = date('Y');\n return date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));\n }",
"public function getFirstDay()\n {\n return (int)$this->_scopeConfig->getValue(\n 'general/locale/firstday',\n ScopeInterface::SCOPE_STORE\n );\n }",
"function getFirstDayInMonth()\n {\n return $this->firstDayInMonth;\n }",
"public static function data_first_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}",
"function getFirstDayOfDate(string $date): string {\n $d = new DateTime($date);\n $d->modify('first day of this month');\n return $d->format('Y-m-d');\n}",
"function get_first_day($month) {\r\n $data = new DateTime('01-' . $month .'-'.date('Y'));\r\n $first_day = $data->format('D');\r\n switch($first_day) {\r\n case 'Sun':\r\n $initial_day_of_month = 1;\r\n break;\r\n case 'Mon':\r\n $initial_day_of_month = 2;\r\n break;\r\n case 'Tue':\r\n $initial_day_of_month = 3;\r\n break;\r\n case 'Wed':\r\n $initial_day_of_month = 4;\r\n break;\r\n case 'Thu':\r\n $initial_day_of_month = 5;\r\n break;\r\n case 'Fri':\r\n $initial_day_of_month = 6;\r\n break;\r\n case 'Sat':\r\n $initial_day_of_month = 7;\r\n break;\r\n }\r\n\r\n return $initial_day_of_month;\r\n }",
"function get_date_of_previous_invoice() {\n\t\tforeach ($this->get_calendar_events(time()-(86400 * 90), time()) as $event) {\n\t\t\tif (preg_match($this->config['calendar_entry'], $event->title->text, $m)) {\n\t\t\t\tforeach ($event->when as $when) {\n\t\t\t\t\treturn substr($when->startTime,0,10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdie(\"Unable to find a previous invoice entry in the calendar.\\n\");\n\t}",
"function getFirstReturnDate($parameters)\n\t{\n\t\t$rules = $parameters->rules;\n\t\t$reattempt_date = $rules['failed_pmnt_next_attempt_date']['1'];\n\t\treturn $this->getReattemptDate($reattempt_date, $parameters);\n\t}",
"public function getFirstEmptyDate($from, $to) {\n db_set_active('stage');\n $route = db_select('air_calendar', 'ac');\n $route->leftJoin('avis_parsing_directions', 'apd', 'ac.did = apd.id');\n $route = $route->fields('ac', array('id', 'month', 'did'))\n ->fields('apd', array('code_from', 'code_to'))\n ->condition('ac.time', '')\n ->condition('ac.id', $from, '>=')\n ->condition('ac.id', $to, '<=')\n ->range(0, 1)\n ->execute()->fetchAll();\n db_set_active('default');\n if (!empty($route[0])) {\n return $route[0];\n }\n return FALSE;\n }",
"public function firstCreatedFirst()\n {\n return $this->addAscendingOrderByColumn(AbuthInvoicesTableMap::COL_CREATED_AT);\n }",
"public static function productStartDate($model){\n $singleDate = ArrayHelper::map($model->applydates,'id','begin_date') ;\n $applyDates = array_shift( $singleDate );\n return count($applyDates)>0 ? $applyDates : null;\n }",
"function firstDay($monthname, $year) {\r\n if (empty($month)) {\r\n $month = date('m');\r\n }\r\n if (empty($year)) {\r\n $year = date('Y');\r\n }\r\n $result = strtotime(\"{$year}-{$month}-01\");\r\n return date('Y-m-d', $result);\r\n }",
"public function getCurrentActivationDate(){\n $this->sortPhoneData();\n $phoneDataSorted = $this->phoneData;\n $phoneArraySize = count($phoneDataSorted);\n $currActivationDate = null;\n for($i = $phoneArraySize-1; $i>=0; $i--){\n $currActivationDate = $phoneDataSorted[$i]['activationDate'];\n if($currActivationDate == $phoneDataSorted[$i-1]['deactivationDate']){\n $currActivationDate = $phoneDataSorted[$i-1]['activationDate'];\n } else {\n break;\n }\n }\n return [\n 'phoneNumber' => $this->phoneNumber,\n 'currActivationDate' => $currActivationDate\n ];\n }",
"static function getFirstActivityFor($cid, $whereClauses = NULL) {\n $query = \"\n SELECT `ca`.*\n FROM `civicrm_activity` AS `ca`\n INNER JOIN `civicrm_activity_contact` AS `cat`\n ON `cat`.`activity_id` = `ca`.`id`\n AND `cat`.`record_type_id` = %0\n AND `cat`.`contact_id` = %1\n \";\n if (!empty($whereClauses)) {\n if (!is_array($whereClauses)) {\n $whereClauses = array($whereClauses);\n }\n $query .= ' WHERE (' . implode(') AND (', $whereClauses) . ') ';\n }\n $query .= \"\n ORDER BY `ca`.`activity_date_time` ASC\n LIMIT 1\n \";\n\n $dao = CRM_Core_DAO::executeQuery($query, array(\n array(self::RECORD_TYPE_TARGET, 'Int'),\n array($cid, 'Int'),\n ));\n if (!$dao->fetch()) {\n return NULL;\n }\n return get_object_vars($dao);\n }",
"public static function getFirstName($_cID) {\n global $lC_Database;\n \n $Qfirst = $lC_Database->query('select customers_firstname from :table_customers where customers_id = :customers_id');\n $Qfirst->bindTable(':table_customers', TABLE_CUSTOMERS);\n $Qfirst->bindInt(':customers_id', $_cID);\n $Qfirst->execute();\n \n $first = $Qfirst->value('customers_firstname');\n\n $Qfirst->freeResult();\n \n return $first;\n }",
"function erp_financial_start_date() {\n $financial_year_dates = erp_get_financial_year_dates();\n\n return $financial_year_dates['start'];\n}",
"public function get_first_day_of_week()\n\t{\n\t\t$this->first_day_of_week = $this->data->get_first_day_of_week($this->first_day_of_week);\n\t\treturn $this->first_day_of_week;\n\t}",
"function get_first_day($day_number=1, $month=false, $year=false) {\r\n $month = ($month === false) ? strftime(\"%m\"): $month;\r\n $year = ($year === false) ? strftime(\"%Y\"): $year;\r\n \r\n $first_day = 1 + ((7+$day_number - strftime(\"%w\", mktime(0,0,0,$month, 1, $year)))%7);\r\n \r\n return mktime(0,0,0,$month, $first_day, $year);\r\n }",
"public function getDateOfFirstAuthorization()\n {\n return $this->dateOfFirstAuthorization;\n }",
"public function get_contact(){\n $this->relative = array_shift(Relative::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->relative) {\n return $this->relative->contact();\n } else {\n return \"Not Specified\";\n }\n }",
"public function firstCreatedFirst()\n {\n return $this->addAscendingOrderByColumn(SocioTableMap::COL_CREATED_AT);\n }",
"function getInitDate($table)\r\n {\r\n \r\n $queryString = \"SELECT MIN(date) FROM $table\";\r\n \r\n // Interpret Query\r\n $result = $this->runQuery($queryString);\r\n \r\n if (!$result && $this->getMySQLErrorCode()!=0)\r\n return 0;\r\n \r\n $row = mysql_fetch_row($result);\r\n \r\n return $row[0];\r\n }"
]
| [
"0.66933733",
"0.63704073",
"0.63404536",
"0.63132966",
"0.6234883",
"0.60384035",
"0.603287",
"0.6024802",
"0.5996857",
"0.5894629",
"0.58405346",
"0.58069503",
"0.5731643",
"0.56996036",
"0.5659405",
"0.5656215",
"0.56338644",
"0.5597858",
"0.5568438",
"0.55662316",
"0.5552527",
"0.5552243",
"0.5538769",
"0.55159914",
"0.55136454",
"0.55108124",
"0.5509004",
"0.5454976",
"0.54470134",
"0.5437243"
]
| 0.7987506 | 0 |
Static function to get number of Enkelvoudige Hulpvraag for contact | static function getCountEnkelvoudigeHulpvraag($contactId) {
$countAct = 0;
$apiParams = array(
'version' => 3,
'contact_id'=> $contactId
);
$actTypeId = self::getEnkelvoudigeHulpvraagTypeId();
$apiActs = civicrm_api('Activity', 'Get', $apiParams);
foreach ($apiActs['values'] as $actId => $apiAct) {
if ($apiAct['activity_type_id'] == $actTypeId) {
if (isset($apiAct['targets'])) {
if (key($apiAct['targets']) == $contactId) {
$countAct++;
}
}
}
}
return $countAct;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHouseNumber();",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function getNumber()\n {\n foreach ($this->getGame()->getLegs() as $idx=>$leg) {\n if ($leg == $this) {\n return $idx+1;\n }\n }\n\n return null;\n }",
"public function getOehhnbr()\n {\n return $this->oehhnbr;\n }",
"public function getNumberOfHMetrics() {}",
"public function intensidad(){\n if($this->PP03F < 35 && $this->PP03G == 1 && $this->PP03H == 1)\n {\n return 1;\n }\n if($this->caracteristicas->CH06 >= 10 && $this->PP03G == 1 && $this->PP01E == 5)\n {\n return 2;\n }\n if( $this->PP03F > 40)\n {\n return 3;\n }\n if($this->PP01E == 5)\n {\n return 4;\n }\n}",
"public function getNbHCasPart() {\n return $this->nbHCasPart;\n }",
"function spectra_address_count ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT COUNT(*) AS `found` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"` WHERE 1\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"found\"]) || $result[\"found\"] == 0)\n\t\t{\n\t\t\treturn \"Unknown\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"found\"];\n\t\t}\n\t}",
"function getNapetiKlima():int {\n return $this->napetiKlima;\n }",
"public function getKbs(): int;",
"public function getNumOpe()\n {\n return $this->numOpe;\n }",
"public function getNumagence()\n {\n return $this->numagence;\n }",
"public static function nbContactsTotal() {\n $total = \\Phonebook\\Models\\CoreModel::findAll();\n $full_contacts = Count($total);\n return $full_contacts;\n echo $this->templates->render('home');\n }",
"public function getNumber_hits()\n {\n return $this->number_hits;\n }",
"public function getNbHNuit(): ?float {\n return $this->nbHNuit;\n }",
"public function getNumber(): int\n {\n return self::ROULETTE[$this->getPosition()];\n }",
"public function getCFU(): int\n {\n return array_reduce($this->esami, function ($acc, $esame) {\n return $acc + $esame->cfu * $esame->in_cdl;\n }, 0);\n }",
"function getNumberOfMembers(){\n\t\t$number = 0;\n\t\tforeach ($this->members as $obj){\n\t\t\t$number++;\n\t\t}\n\t\treturn $number;\n\t}",
"public function notiNum() {\n if (Auth::check()) {\n $join = User::find(Auth::id())->join_request;\n $filter = $join->where('status', Join::REQUEST);\n return count($filter);\n } else {\n return 0;\n }\n }",
"abstract public function getHitCount() : string;",
"function get_nbre_conso(){\n\t\tglobal $bd;\n\t\t$req = $bd->query(\"SELECT SUM(nbre) as nbre FROM consommateur WHERE etat = 'present' \");\n\t\t$data = $req->fetch();\n\t\treturn $data['nbre'];\n\t}",
"public function getNbAddresses()\n\t{\n\t\tif ( $this->nb_addresses === null ) {\n\t\t\t$this->nb_addresses = gmp_strval(gmp_pow(2, $this->getMaxPrefix() - $this->prefix));\n\t\t}\n\t\treturn $this->nb_addresses;\n\t}",
"public function getEntryCount() {}",
"public function newContactsNumber()\n {\n // On calcule le nombre de recontacs demandés\n $sql = 'SELECT `item_id`\n FROM `items`\n WHERE `mission_id` = :mission\n AND `item_statut` = 4';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n $query->execute();\n\n // On récupère le nombre demandé\n return $query->rowCount();\n }",
"public function keyCount() : int;",
"public function getNbHn(): ?float {\n return $this->nbHn;\n }",
"private function checkForNumberOfHits()\n {\n // Get number of hits per page\n $hits = $this->app->request->getGet(\"hits\", 4);\n\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n $hits = 4;\n }\n return $hits;\n }",
"public function getHerosCount()\n {\n return $this->count(self::_HEROS);\n }",
"public function getHerosCount()\n {\n return $this->count(self::_HEROS);\n }",
"public function calcularId(){\n\n $registros = PorcentajeBecaArancel::All();\n\n $max_valor = count($registros);\n\n\n if($max_valor > 0){\n\n $max_valor++;\n\n } else {\n\n $max_valor = 1;\n }\n\n return $max_valor;\n\n }"
]
| [
"0.6399133",
"0.60220885",
"0.5798944",
"0.5786423",
"0.5723072",
"0.5722873",
"0.5702131",
"0.5684648",
"0.5679618",
"0.56184244",
"0.56121504",
"0.5603582",
"0.5578582",
"0.55683124",
"0.5556056",
"0.5549493",
"0.55044395",
"0.55020386",
"0.5490096",
"0.548095",
"0.54788834",
"0.54695386",
"0.54646736",
"0.5455151",
"0.5455141",
"0.54457724",
"0.5436477",
"0.54359806",
"0.54359806",
"0.5433741"
]
| 0.62961245 | 1 |
Static function to get number of Cases for contact | static function getCountCases($contactId) {
$countCases = 0;
$apiParams = array(
'version' => 3,
'client_id' => $contactId
);
$apiCaseCount = civicrm_api('Case', 'Getcount', $apiParams);
if (!isset($apiCaseCount['is_error'])) {
$countCases = (int) $apiCaseCount;
}
return $countCases;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countPersonContacts()\n {\n\n $db = $this->getDb();\n \n $sql = <<<SQL\nSELECT\n count(contact.rowid) as number\nFROM\n core_contact_r contact\nJOIN core_person_r person\n ON contact.id_person = person.rowid\nWHERE person.type = 1;\n \nSQL;\n \n return $db->select($sql)->getField('number');\n\n }",
"public function countCompanyContacts()\n {\n \n $db = $this->getDb();\n \n $sql = <<<SQL\nSELECT\n count(contact.rowid) as number\nFROM\n core_contact_r contact\nJOIN core_person_r person\n ON contact.id_person = person.rowid\nWHERE person.type = 2;\nSQL;\n \n return $db->select($sql)->getField('number');\n \n }",
"public static function nbContactsSelected() {\n $total = self::search();\n $selected_contacts = Count($total);\n return $selected_contacts;\n echo $this->templates->render('home');\n }",
"public function cases_count()\n\t{\n\t\treturn array(\n\t\t\tarray(2, 7, true, false, 5),\n\t\t\tarray(2, 7, false, false, 4),\n\t\t\tarray(2, 7, false, true, 5),\n\t\t\tarray(2, 7, true, true, 6),\n\t\t\tarray(9, -1, true, false, 0),\n\t\t);\n\t}",
"public function getAnswerCount();",
"public static function nbContactsTotal() {\n $total = \\Phonebook\\Models\\CoreModel::findAll();\n $full_contacts = Count($total);\n return $full_contacts;\n echo $this->templates->render('home');\n }",
"public function newContactsNumber()\n {\n // On calcule le nombre de recontacs demandés\n $sql = 'SELECT `item_id`\n FROM `items`\n WHERE `mission_id` = :mission\n AND `item_statut` = 4';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n $query->execute();\n\n // On récupère le nombre demandé\n return $query->rowCount();\n }",
"static function getCountEnkelvoudigeHulpvraag($contactId) {\n $countAct = 0;\n $apiParams = array(\n 'version' => 3,\n 'contact_id'=> $contactId\n );\n $actTypeId = self::getEnkelvoudigeHulpvraagTypeId();\n $apiActs = civicrm_api('Activity', 'Get', $apiParams);\n foreach ($apiActs['values'] as $actId => $apiAct) {\n if ($apiAct['activity_type_id'] == $actTypeId) {\n if (isset($apiAct['targets'])) {\n if (key($apiAct['targets']) == $contactId) {\n $countAct++;\n }\n }\n }\n }\n return $countAct;\n }",
"public function getTotalCasesInDept(){\n $dept = $this->dept;\n $users = User::where(['department' => $dept->id])->select('users.id')->get();\n $sum = 0;\n foreach($users as $user){\n $numberOfCasesIntaken = LegalCase::where(['staff' => $user->id])->count();\n $sum += $numberOfCasesIntaken;\n }\n return $sum;\n }",
"function countCandidate()\n\t{\n\t\tglobal $DB,$frmdata;\n\t\t\n\t\t$totalCandidate = $DB->SelectRecord('candidate', '', 'count(*) as candidate');\n\t\t//print_r($totalCandidate);\n\t\treturn $totalCandidate;\n\t}",
"public function count(): int\n {\n return count($this->testCases);\n }",
"public function getCounter();",
"function countMySentCv($from,$to,$consultant,$client)\n\t\t {\n\t\t $sql = \"SELECT COUNT(DISTINCT cand_id) As cnt FROM pof_candidates JOIN candidates ON pof_candidates.cand_id=candidates.id RIGHT JOIN pof ON pof_candidates.pofid=pof.pof_id LEFT JOIN synonym ON synonym.s_id=pof.client_id LEFT JOIN synonym As a1 ON a1.s_id=pof.location LEFT JOIN be_users ON pof_candidates.user_id=be_users.id WHERE (pof_candidates.date BETWEEN '\".$from.\"' AND '\".$to.\"') AND be_users.username LIKE '%\".$consultant.\"%' AND stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' )\t \";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t\t }",
"public function count_cases() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->withColumn('SUM('.SalesHistoryDetail::get_aliasproperty('qty_cases').')', 'cases');\n\t\t$q->select('cases');\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->findOne();\n\t}",
"function countCvsent($pid)\n\t\t {\n\t\t $sql = \"SELECT COUNT(DISTINCT cand_id) As cnt FROM pof_candidates WHERE pofid =\".$pid.\" AND stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' ) \";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t\t }",
"function getAllNumClases(){\n\t\t$clase=$this->nmclass;\n\t\t$u=$this->cant_clases;\n\t\treturn $u;\n\t}",
"public static function count();",
"public function getCabinetCountAttribute()\n {\n return $this->cabinets->count();\n }",
"static function customerCount( )\n {\n $db = eZDB::instance();\n $countArray = $db->arrayQuery( \"SELECT count( DISTINCT email) AS count FROM ezorder WHERE is_temporary='0'\" );\n return $countArray[0]['count'];\n }",
"public function getCallCount()\n {\n return count($this->data['calls']);\n }",
"public function getNbActors(){\n $nbActors = DB::table('actors')\n ->count();\n\n return $nbActors;\n }",
"public function count(){\n return count($this->accounts);\n }",
"public function getMemberCnt()\n {\n return $this->get(self::_MEMBER_CNT);\n }",
"public function countContractors()\n\t{\n\t\t$farmer = \"select id from users_roles where name = 'Contractor' \";\n\t\t$f = DB::query($farmer)->execute()->as_array();\n\t\t$f_id = @$f[0]['id']; \n\t\t\n\t\t//got it, lets proceed\n\t\tif(!is_null($f_id)){\n\t\t\t\n\t\t\t//lets count number of users subscribed to the contractor role\n\t\t\t$pple = \"select count(distinct(user_id)) as tmpvar from users_user_roles\nwhere role_id = $f_id \";\n\n\t\t\t$tmp \t= DB::query($pple)->execute()->as_array();\n\t\t\t$fcount = @$tmp[0]['tmpvar'];\n\t\t\treturn $fcount;\n\t\t}\n\t\treturn 0;\n\t\n\t\t\n\t}",
"private function ts_getDisplayInCaseOfNoCounting()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n $displayInCaseOfNoCounting = $conf_array[ 'wrap.' ][ 'item.' ][ 'displayInCaseOfNoCounting' ];\n\n // RETURN TS value\n return $displayInCaseOfNoCounting;\n }",
"public function countCanceledMembers(){\r\n \r\n $dbs = $this->getDB()->prepare\r\n ('select * from memberstatus where StatusCode = \"C\"');\r\n $dbs->execute();\r\n $countCanceled = $dbs->rowCount();\r\n \r\n return $countCanceled;\r\n }",
"function getNumberOfMembers(){\n\t\t$number = 0;\n\t\tforeach ($this->members as $obj){\n\t\t\t$number++;\n\t\t}\n\t\treturn $number;\n\t}",
"function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}",
"abstract public function countCardsInLocations(): array;",
"public function getCustomerInfoCount()\n {\n return $this->count(self::customer_info);\n }"
]
| [
"0.6418083",
"0.63452077",
"0.6336976",
"0.6270917",
"0.61164045",
"0.60708827",
"0.6052671",
"0.6009567",
"0.5981927",
"0.5959526",
"0.5836256",
"0.5813202",
"0.5774399",
"0.57698685",
"0.5769089",
"0.5766176",
"0.57283413",
"0.5704701",
"0.56846887",
"0.5683003",
"0.56549203",
"0.56441987",
"0.56410325",
"0.5639787",
"0.5639272",
"0.5634181",
"0.5633402",
"0.5620038",
"0.56134546",
"0.55908954"
]
| 0.6989548 | 0 |
Static function to check if case has activities in period | static function checkActivityInCase($caseId, $periodFrom, $periodTo) {
$activityInCase = false;
if (empty($caseId)) {
return $activityInCase;
}
$apiParams = array(
'version' => 3,
'case_id' => $caseId
);
$apiCase = civicrm_api('Case', 'Getsingle', $apiParams);
if (!isset($apiCase['is_error']) || $apiCase['is_error'] == 0) {
if (isset($apiCase['activities']) && !empty($apiCase['activities'])) {
foreach($apiCase['activities'] as $activityId) {
$apiParams = array(
'version' => 3,
'id' => $activityId
);
$apiActivity = civicrm_api('Activity', 'Getsingle', $apiParams);
if (!isset($apiActivity['is_error']) || $apiActivity['is_error'] == 0) {
if (isset($apiActivity['activity_date_time'])) {
$actDate = new DateTime($apiActivity['activity_date_time']);
if ($actDate >= $periodFrom && $actDate <= $periodTo) {
$activityInCase = true;
}
}
}
}
}
}
return $activityInCase;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isActivatedViaEndDateAndTime() {}",
"protected function isActivatedViaStartDateAndTime() {}",
"protected function isWithin() {\n if(isset($this->listeners['within']) && \n $this->start_time instanceof \\DateTime &&\n $this->since_start instanceof \\DateTime) {\n foreach($this->listeners['within'] as $listener) {\n list($increment,$period) = $listener;\n $diff = $this->start_time->diff($this->since_start);\n if($diff->$period < $increment) {\n return true;\n }\n }\n } else {\n return true;\n }\n \n return false;\n }",
"public function isStarted(){\n\n //Comparing the time to decide wither it's started or not ....\n $start = new Carbon($this->start_time);\n $now = Carbon::now();\n $end = $start->copy()->addMinutes($this->duration);\n\n $started = $now->gt($start) && $now->lt($end);\n\n //checking if it has expired announcement and remove it with resetting status to 0\n if($this->hasAnnouncement()){\n $now = Carbon::now();\n $end = new Carbon($this->start_time);\n $end->addMinutes($this->duration);\n\n //Checking if the announcement has expired and delete it ...\n if($now->gt($end))\n $this->deleteAnnouncement();\n\n }\n\n return $started;\n\n }",
"function isActivity() {\n\t\treturn $this->repoObj->lobType == 'activity';\n\t}",
"public function CheckActiveMeeting()\n\t{\n\t\t//get current login user session\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get user session\n\t\t$currenttime = time();\n\t\t$userJoinTime = $currenttime;\n\t\t$extra_time = Configure::read('extra_meetingtime');//done in bootstrap\n\t\t$data = $this->request->data;\n\t\t$group_name = $data['roomname'];\n\t\t$requests = $this->MeetingInfo->find('first',array(\n\t\t\t\t'conditions'=>array('MeetingInfo.chat_meeting_name'=>$group_name)\n\t\t));\n\t\t$meeting_date = $requests['MeetingInfo']['chat_meeting_startdate'];\n\t\t$meeting_active = $requests['MeetingInfo']['is_active'];\n\t\t$meeting_start_date = $meeting_date;\n\t\t$meeting_end_date = $meeting_start_date+$extra_time;\n\t\tif((($userJoinTime <= $meeting_end_date) && ($userJoinTime >= $meeting_start_date)) || $meeting_active)\n\t\t\techo 1;\n\t\telse\n\t\t\techo 0;\n\t\texit;\n\t}",
"public function isActive(): bool\n {\n $currentDate = Carbon::now()->format('Y-m-d');\n\n return $this->effect_date <= $currentDate\n && $this->termination_date >= $currentDate\n || is_null($this->termination_date);\n }",
"public function isActive(){\n\t\treturn (!$this->isnewRecord and Yii::app()->periodo->HoyDentroDe($this->finicio,$this->ffinal));\n\n\t }",
"public function during(DateTimePeriod $period): bool\n {\n return\n $period->getStart() < $this->getStart() &&\n $this->getEnd() < $period->getEnd();\n }",
"public function contactedTimeTest() {\n\t\t\t$id = 140;\n\t\t\t$period = 1;\n\t\t\t\n\t\t\t$db = new database();\n\t\t\t$results = $db->getAll(\"SELECT * FROM claimants_noanswers WHERE cid = '\".$id.\"'\");\n\t\t\n\t\t\t$contacts = ARRAY();\n\t\t\tforeach ($results AS $result) {\n\t\t\t\tif (claimants::callTime($result['timestamp']) == $period) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tif (date(\"dmY\",$result['timestamp']) == date(\"dmY\",strtotime(\"NOW\"))) {\t\t\t\t\n\t\t\t\t\t\t$contacts[] = $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($contacts) > 0) {\n\t\t\t\tprint(\"Contacted in this period\");\n\t\t\t} else {\n\t\t\t\tprint(\"Not Contacted in this period\");\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}",
"function usp_ews_check_activity_setting($configmonitoreddata, $courseid, $modules){\n\n\tglobal $DB;\n\t\n\t$dbmanager = $DB->get_manager(); // loads ddl manager and xmldb classes\n\n\n\tif (empty($configmonitoreddata)) {\n return false;\n }\n\n\t$modinfo = get_array_of_activities($courseid);\n\n\tforeach($configmonitoreddata as $monitor){\n\t\t$mod = $modinfo[$monitor->cmid];\n\t\t// if hidden then no sense giving unnecessary attention\n\t\tif($mod->visible == 1){\n\t\t\t// only if the activity is notlocked, otherwise that's unnecessary as in the manual meaning of lock is specified\n\t\t\tif($monitor->locked == 0){\n\t\t\n\t\t\t\tif (array_key_exists('defaultTime', $modules[$monitor->module])) {\n\t\t\t\t\t$fields = $modules[$monitor->module]['defaultTime'].' as due';\n\t\t\t\t\t$record = $DB->get_record($monitor->module, array('id'=>$monitor->instanceid, 'course'=>$courseid), $fields);\n\n\t\t\t\t\tif($record->due != $monitor->duedate && $record->due > time()){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t }\t\t\t\t\n\t}\n\n\treturn false;\n}",
"function Atv_boolPresensiTimeAllowed($day, $time_start, $time_end): bool\n{\n $result = false;\n // jika 'all' maka hanya boleh hari senin sampai jumat, atau hari yang ditentukan diluar itu\n if ((($day == Atv_setDayKegiatan('all')) && (Carbon_IsWorkDayNow())) || ($day == Carbon_DBDayNumOfWeek()))\n if ((Carbon_AnyTimeNow() >= $time_start) && (Carbon_AnyTimeNow() <= $time_end)) $result = true;\n return $result;\n}",
"public function isDayPassed()\n {\n return ($this->declineTime < (time() - self::ONE_DAY_IN_SECONDS));\n }",
"public function isActive()\n {\n return $this->effective_from <= time() && ($this->effective_to == null or $this->effective_to > time());\n }",
"public function isActive()\n {\n $is_active = false;\n\n if ($this->active && $this->category && $this->category->active)\n {\n $now = Carbon::now();\n \n if (( ! $this->start_at || $this->start_at->lte($now)) && ( ! $this->end_at || $this->end_at->gte($now)))\n {\n $is_active = true;\n }\n }\n\n return $is_active;\n }",
"function cicleinscription_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function isStartedAndNotFinished()\r\n {\r\n $now = Zend_Date::now();\r\n \r\n $date = new Zend_Date($this->start_time);\r\n $afterStart = $now->compare($date) === 1;\r\n\r\n $date->addDay($this->duration);\r\n $beforeEnd = $now->compare($date) === -1;\r\n \r\n return $afterStart && $beforeEnd;\r\n }",
"function has_signup_period_ended($signupDate)\n{\n return time() - (60 * 60 * 24) >= strtotime($signupDate);\n}",
"public function isActive()\n {\n $now = new \\DateTime();\n return ($this->getSince() <= $now && $this->getUntil() > $now || $this->getPermanent());\n }",
"public function abuts(Period $period)\n {\n return $this->startDate == $period->getEndDate() || $this->endDate == $period->getStartDate();\n }",
"public function abuts(Period $period)\n {\n return $this->startDate == $period->getEndDate() || $this->endDate == $period->getStartDate();\n }",
"public function startedBy(DateTimePeriod $period): bool\n {\n return\n $this->getStart() == $period->getStart() &&\n $period->getEnd() < $this->getEnd();\n }",
"function tab_print_recent_activity($course, $viewfullnames, $timestart) {\n global $CFG;\n\n return false; // True if anything was printed, otherwise false\n}",
"public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }",
"public function hasActivityGotTimesheetItems($activityId) {\n\t\treturn $this->projectDao->hasActivityGotTimesheetItems($activityId);\n\t}",
"public function isDeactivatedWithin(DatePeriod $period)\n {\n $record = $this->getInvoker();\n foreach ($period as $day)\n {\n if ($record->isDeactivated($day))\n return true;\n }\n \n return false;\n }",
"function contactmod_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function isActive(){\n return (bool) ($this->hasStarted() && ! $this->hasExpired() && !$this->isCancelled());\n }",
"static function canMatch($cat)\n {\n \tif(User::getCategoryCount($cat) > 9)\n \t\tif(!self::isWeekend(time()))\n \t\t\treturn true;\n \t\telse\n \t\t\treturn false;\n \telse\n \t\treturn false;\n \n }",
"function vitero_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false.\n}"
]
| [
"0.6129946",
"0.608839",
"0.59263957",
"0.57652843",
"0.57059205",
"0.56851333",
"0.5671095",
"0.5654171",
"0.564009",
"0.56324595",
"0.55978054",
"0.55362135",
"0.5536183",
"0.5535323",
"0.55160743",
"0.5508851",
"0.54894686",
"0.54801834",
"0.5477013",
"0.54604495",
"0.54604495",
"0.5456032",
"0.5412867",
"0.54088384",
"0.54056567",
"0.53648233",
"0.5361885",
"0.53612185",
"0.5353132",
"0.5346135"
]
| 0.6769645 | 0 |
Retrieve courses in term. Filters main query to only include immediate children of the current term. | function get_courses() {
global $wp_query;
$wp_query->set('tax_query', get_immediate_children());
$wp_query->get_posts();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function courses(){\n return Catalog::where('active',1)\n ->where('for_sale', 1)\n ->where('litmos_deleted', 0)\n ->orderBy('name')\n ->lists( 'name', 'id');\n }",
"function i4_lms_get_courses() {\n global $wpdb, $wpcwdb;\n\n $SQL = \"SELECT course_id, course_title\n\t\t\tFROM $wpcwdb->courses\n\t\t\tORDER BY course_title ASC\n\t\t\t\";\n\n $courses = $wpdb->get_results($SQL);\n\n return $courses;\n }",
"public static function find_courses($search) {\n global $DB;\n\n // Validate parameters passed from web service.\n $params = self::validate_parameters(self::find_courses_parameters(), array('search' => $search));\n\n // Capability check.\n if (!has_capability('moodle/course:viewhiddencourses', context_system::instance())) {\n return false;\n }\n\n // Build query.\n $searchsql = '';\n $searchparams = array();\n $searchlikes = array();\n $searchfields = array('c.shortname', 'c.fullname', 'c.idnumber');\n for ($i = 0; $i < count($searchfields); $i++) {\n $searchlikes[$i] = $DB->sql_like($searchfields[$i], \":s{$i}\", false, false);\n $searchparams[\"s{$i}\"] = '%' . $search . '%';\n }\n // We exclude the front page.\n $searchsql = '(' . implode(' OR ', $searchlikes) . ') AND c.id != 1';\n\n // Run query.\n $fields = 'c.id,c.idnumber,c.shortname,c.fullname';\n $sql = \"SELECT $fields FROM {course} c WHERE $searchsql ORDER BY c.shortname ASC\";\n $courses = $DB->get_records_sql($sql, $searchparams, 0);\n return $courses;\n }",
"function cicleinscription_get_courses_all(){\n\tglobal $DB;\n\t$sort = 'fullname ASC';\n\t$courses = $DB->get_records_sql(\"\n\t\t\tSELECT\n\t\t\t\tid,\n\t\t\t\tfullname,\n\t\t\t\tshortname \n\t\t\tFROM {course}\n\t\t\tWHERE\n\t\t\t\tcategory <> 0\n\t\t\tORDER BY {$sort}\");\n\n\treturn $courses;\n}",
"private function getCoursesWithLogs()\n {\n return $this->entityManager->createQueryBuilder()\n ->select('course')\n ->from(Course::class, 'course')\n ->innerJoin(ActionLog::class, 'log', Expr\\Join::WITH, 'course.id = log.course')\n ->andWhere('course.sandbox = :false')\n ->andWhere('course.id in (:ids)')\n ->setParameter('false', false)\n ->setParameter('ids', $this->getAvailableCoursesIds())\n ->orderBy('course.info.title', 'ASC')\n ->getQuery()\n ->getResult();\n }",
"public function getCourses()\n {\n return $this->hasMany(Course::className(), ['language' => 'ISO']);\n }",
"function get_immediate_children( $course_type = null ) {\n\tif (empty($course_type)) {\n\t\t$course_type = get_term_by('slug', get_query_var('term'), 'course_type');\n\t}\n\n\treturn array(\n\t\t'relation' => 'AND',\n\t\tarray(\n\t\t\t'taxonomy' => 'course_type',\n\t\t\t'terms' => $course_type->term_id\n\t\t),\n\t\tarray(\n\t\t\t'taxonomy' => 'course_type',\n\t\t\t'terms' => get_term_children( $course_type->term_id, 'course_type'),\n\t\t\t'operator' => 'NOT IN'\n\t\t)\n\t);\n}",
"public function getCourses()\n {\n return $this->courses;\n }",
"function i4_get_all_courses() {\n global $wpcwdb, $wpdb;\n\n $course_table_name = $wpdb->prefix . 'wpcw_courses';\n\n $wpdb->show_errors();\n\n $SQL = \"SELECT course_id, course_title FROM $course_table_name ORDER BY course_title\";\n $results = $wpdb->get_results($SQL, OBJECT_K);\n return $this->results_to_course_array($results);\n }",
"public function get_courses(){\n return $this->courses;\n }",
"public function courses()\n {\n return $this->morphedByMany(Course::class, 'subjectables');\n }",
"public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }",
"public function get_courses(){\n\t\t$query = $this->db->get('course');\n\t\treturn $query->result();\n\t}",
"public function frontpage_available_courses() {\r\n global $CFG;\r\n require_once($CFG->libdir. '/coursecatlib.php');\r\n\r\n $chelper = new coursecat_helper();\r\n $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED)->\r\n set_courses_display_options(array(\r\n 'recursive' => true,\r\n 'limit' => $CFG->frontpagecourselimit,\r\n 'viewmoreurl' => new moodle_url('/course/index.php'),\r\n 'viewmoretext' => new lang_string('fulllistofcourses')));\r\n\r\n $chelper->set_attributes(array('class' => 'frontpage-course-list-all'));\r\n $courses = coursecat::get(0)->get_courses($chelper->get_courses_display_options());\r\n $totalcount = coursecat::get(0)->get_courses_count($chelper->get_courses_display_options());\r\n if (!$totalcount && !$this->page->user_is_editing() && has_capability('moodle/course:create', context_system::instance())) {\r\n // Print link to create a new course, for the 1st available category.\r\n return $this->add_new_course_button();\r\n }\r\n return $this->frontpage_courseboxes($chelper, $courses);\r\n }",
"public function find($account_id, $search_term) {\n $uri = \"/api/v1/accounts/$account_id/courses?search_term=$search_term\";\n $response = $this->get($uri);\n if (!is_null($response)) {\n foreach ($response as $entry) {\n $courseResult = new CourseResult($entry);\n if ($search_term === $courseResult->sis_course_id) {\n return $courseResult;\n }\n }\n }\n return new CourseResult();\n }",
"public function courses()\n {\n return $this->hasMany('\\T4KModels\\Course')->orderBy('title');\n }",
"public function getCourses()\n {\n return $this->hasMany(Section::className(), ['course_id' => 'course_id', 'sec_id' => 'sec_id', 'semester' => 'semester', 'year' => 'year'])->viaTable('teaches', ['ID' => 'ID']);\n }",
"public function frontpage_my_courses() {\n\n global $USER, $CFG, $DB;\n $content = html_writer::start_tag('div', array('class' => 'frontpage-enrolled-courses') );\n $content .= html_writer::start_tag('div', array('class' => 'container'));\n $content .= html_writer::tag('h2', get_string('mycourses'));\n $coursehtml = parent::frontpage_my_courses();\n if ($coursehtml == '') {\n\n $coursehtml = \"<div id='mycourses'><style> #frontpage-course-list.frontpage-mycourse-list { display:none;}\";\n $coursehtml .= \"</style></div>\";\n }\n $content .= $coursehtml;\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n\n return $content;\n }",
"public function courses()\t{\n\t\treturn $this->hasMany('Course');\n\t}",
"public static function courses()\n {\n return Course::all()->toArray();\n }",
"public static function getCourses()\n {\n global $cont;\n $courses = $cont->prepare(\"SELECT courses.id AS courseId , courses.title AS title , courses.price AS price , courses.body AS body , courses.image AS `image` , categories.name AS catName FROM courses INNER JOIN categories ON courses.catagory_id = categories.id\");\n $courses->execute();\n return $courses;\n }",
"public function meCourses()\n {\n return Course::where('user_id', Auth::user()->id)->simplePaginate(10);\n }",
"function get_sections($crn,$term,$course) {\n global $dbh;\n \n // get all courses offered in same term with same course name\n $query = 'SELECT term_code,crn FROM courses WHERE term_code = ? and concat(subject_code,\" \",course_number) = ? ORDER BY section_number';\n \n $resultset = prepared_query($dbh, $query, array($term,$course));\n \n $sections = array();\n while ($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n // if the CRN does not match current course, add it as a different section\n if ($row['crn'] != $crn) $sections[] = '<a href=\"javascript:void(0);\" onclick=\"getDetail('.$row['term_code'].','.$row['crn'].')\">'.$row['crn'].'</a>';\n }\n return $sections; \n}",
"public function getAllCourses()\n {\n $courses = TableRegistry::getTableLocator()->get('Courses');\n $courses = $courses->find('all')->distinct('id')->toArray();\n return $courses;\n }",
"function local_mediacore_fetch_courses() {\n global $DB;\n $query = \"SELECT *\n FROM {course}\n WHERE format != :format\n AND visible = :visible\n ORDER BY shortname ASC\";\n return $DB->get_records_sql($query, array(\n 'format' => 'site',\n 'visible' => '1',\n ));\n}",
"public function getCourses($online_only = false)\n {\n $query = '';\n if ($this->parent_target_group instanceof self) {\n // If object IS a child\n $query = 'SELECT courses.course_id FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups AS c2t '\n .'LEFT JOIN '. rex::getTablePrefix() .'d2u_courses_courses AS courses ON c2t.course_id = courses.course_id '\n .'LEFT JOIN '. rex::getTablePrefix() .'d2u_courses_2_categories AS c2c ON c2c.course_id = courses.course_id '\n .'WHERE c2t.target_group_id = '. $this->parent_target_group->target_group_id .' '\n .'AND c2c.category_id = '. $this->target_group_id .' ';\n } else {\n // If object is NOT a child\n $query = 'SELECT courses.course_id FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups AS c2t '\n .'LEFT JOIN '. rex::getTablePrefix() .'d2u_courses_courses AS courses ON c2t.course_id = courses.course_id '\n .'WHERE c2t.target_group_id = '. $this->target_group_id .' ';\n }\n if ($online_only) {\n $query .= \"AND online_status = 'online' \"\n .'AND ('. d2u_courses_frontend_helper::getShowTimeWhere() .') ';\n }\n $query .= 'GROUP BY course_id '\n .'ORDER BY date_start, name';\n $result = rex_sql::factory();\n $result->setQuery($query);\n\n $courses = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $courses[] = new Course((int) $result->getValue('course_id'));\n $result->next();\n }\n return $courses;\n }",
"public function actionCourses()\n\t{\n\t\t//echo \"In Courses\";\n\t\tif (!isset($_REQUEST['username'])){\n\t\t\t$_REQUEST['username'] = Yii::app()->user->name;\n\t\t}\n\t\t//if (!Yii::app()->user->checkAccess('admin')){\n\t\t//\t$this->model=User::model()->findByPk(Yii::app()->user->name);\n\t\t//} else {\n\t\t\t$this->model = DrcUser::loadModel();\n\t\t\t//}\n\t\t//$title = \"Title\";\n\t\t//$contentTitle = \"Courses: title\";\n\t\t$title = \"({$this->model->username}) {$this->model->first_name} {$this->model->last_name}\";\n\t\t$contentTitle = \"Courses: {$this->model->term->description}\";\n\t\tif (!Yii::app()->user->checkAccess('admin') && !Yii::app()->user->checkAccess('staff')){\n\t\t\t$title = $this->model->term->description;\n\t\t\t$contentTitle = \"Courses\";\n\t\t}\n\t\t$this->renderView(array(\n\t\t\t'title' => $title,\n\t\t\t'contentView' => '../course/_list',\n\t\t\t'contentTitle' => $contentTitle,\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t\t'menuRoute' => 'drcUser/courses',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('drcUser/update', array('term_code'=> $this->model->term_code, 'username'=>$this->model->username)) . '\"><i class=\"icon-plus\"></i> User Profile</a>',\n\t\t));\n\t}",
"protected function showmycourses() {\n global $USER, $PAGE;\n\n // Create a navigation cache to point at the same node as the main navigation\n // cache\n $cache = new navigation_cache('navigation');\n\n // If the user isn't logged in or is a guest we don't want to display anything\n if (!isloggedin() || isguestuser()) {\n return false;\n }\n\n // Check the cache to see if we have loaded my courses already\n // there is a very good chance that we have\n if (!$cache->cached('mycourses')) {\n $cache->mycourses = get_my_courses($USER->id);\n }\n $courses = $cache->mycourses;\n\n // If no courses to display here, return before adding anything\n if (!is_array($courses) || count($courses)==0) {\n return false;\n }\n\n // Add a branch labelled something like My Courses\n $mymoodle = $PAGE->navigation->get('mymoodle', navigation_node::TYPE_CUSTOM);\n $mycoursesbranch = $mymoodle->add(get_string('mycourses'), null,navigation_node::TYPE_CATEGORY, null, 'mycourses');\n $PAGE->navigation->add_courses($courses, 'mycourses');\n $mymoodle->get($mycoursesbranch)->type = navigation_node::TYPE_CUSTOM;\n return true;\n }",
"function listDescendantCourses() {\n $courses = courselist_roftools::get_courses_from_parent_rofpath($this->getRofPathId());\n return array_keys($courses);\n }",
"public function getCursos($id){\n\t\treturn $this->query(\"SELECT fullname FROM mdl_course WHERE category = ? \",array($id));\n\t\t\n\t}"
]
| [
"0.6011304",
"0.58016616",
"0.579713",
"0.5718078",
"0.5711828",
"0.553655",
"0.5533967",
"0.54997486",
"0.54840714",
"0.5471198",
"0.5442092",
"0.54361",
"0.5424699",
"0.53994745",
"0.538072",
"0.5361214",
"0.53362775",
"0.5317572",
"0.53126884",
"0.5290739",
"0.5289793",
"0.5270822",
"0.5246299",
"0.5243164",
"0.52358365",
"0.5213789",
"0.52126837",
"0.5199325",
"0.5193673",
"0.5185855"
]
| 0.68748456 | 0 |
Get the location of the export directory for the user accounts Get the location of the export directory for the user accounts | function getExportDirectory()
{
$export_dir = ilUtil::getDataDir()."/usrf_data/export";
return $export_dir;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$export_dir = ilUtil::getDataDir().\"/svy_data\".\"/svy_\".$this->getId().\"/export\";\n\n\t\treturn $export_dir;\n\t}",
"function getExportPath() {\n\t\t$exportPath = Config::getVar('files', 'files_dir') . '/' . $this->getPluginSettingsPrefix();\n\t\tif (!file_exists($exportPath)) {\n\t\t\t$fileManager = new FileManager();\n\t\t\t$fileManager->mkdir($exportPath);\n\t\t}\n\t\tif (!is_writable($exportPath)) {\n\t\t\t$errors = array(\n\t\t\t\tarray('plugins.importexport.common.export.error.outputFileNotWritable', $exportPath)\n\t\t\t);\n\t\t\treturn $errors;\n\t\t}\n\t\treturn realpath($exportPath) . '/';\n\t}",
"function getExportDirectory() {\n\n $upload_dir = wp_upload_dir();\n\n $path = $upload_dir['basedir'] . '/form_entry_exports';\n\n // Create the backups directory if it doesn't exist\n if ( is_writable( dirname( $path ) ) && ! is_dir( $path ) )\n mkdir( $path, 0755 );\n\n // Secure the directory with a .htaccess file\n $htaccess = $path . '/.htaccess';\n\n $contents[]\t= '# ' . sprintf( 'This %s file ensures that other people cannot download your export files' , '.htaccess' );\n $contents[] = '';\n $contents[] = '<IfModule mod_rewrite.c>';\n $contents[] = 'RewriteEngine On';\n $contents[] = 'RewriteCond %{QUERY_STRING} !key=334}gtrte';\n $contents[] = 'RewriteRule (.*) - [F]';\n $contents[] = '</IfModule>';\n $contents[] = '';\n\n if ( ! file_exists( $htaccess ) && is_writable( $path ) && require_once( ABSPATH . '/wp-admin/includes/misc.php' ) )\n insert_with_markers( $htaccess, 'BackUpWordPress', $contents );\n\n return $path;\n }",
"function createExportDirectory()\n\t{\n\t\tif (!@is_dir($this->getExportDirectory()))\n\t\t{\n\t\t\t$usrf_data_dir = ilUtil::getDataDir().\"/usrf_data\";\n\t\t\tilUtil::makeDir($usrf_data_dir);\n\t\t\tif(!is_writable($usrf_data_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Userfolder data directory (\".$usrf_data_dir\n\t\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t\t$export_dir = $usrf_data_dir.\"/export\";\n\t\t\tilUtil::makeDir($export_dir);\n\t\t\tif(!@is_dir($export_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Creation of Userfolder Export Directory failed.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\t\t}\n\t}",
"public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}",
"protected function generateUploadDir()\n\t{\n\t\treturn self::EXPORT_PATH;\n\t}",
"protected function getDefaultImportExportFolder() {}",
"protected function getDefaultImportExportFolder() {}",
"protected function action_getUserMainDir() {}",
"public function getTemporaryFilesPathForExport() {}",
"public function export()\n\t\t {\n\t\t\t return Excel::download(new UsersExport, 'users.xlsx');\n\t\t }",
"protected function getStoragePath()\n {\n return Command::getDataDir() . self::STORAGE_DIR . DIRECTORY_SEPARATOR . self::CSV_DATASTORE;\n }",
"function getDownloadDirectory()\n{\n $settings = getSettings();\n\n return $settings['downloadDirectory'] . '/';\n}",
"function createExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t\n\t\t// create learning module directory (data_dir/lm_data/lm_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t$export_dir = $svy_dir.\"/export\";\n\t\tilUtil::makeDir($export_dir);\n\t\tif(!@is_dir($export_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Export Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }",
"public static function get_specific_export_user() {\n // at first, we have a look if a specific user for course exports has been defined\n $specific_export_username = get_config('local_remote_backup_provider', 'specific_export_username');\n if (!empty($specific_export_username)){\n global $DB;\n // now we look up the user in the DB:\n $specific_export_user = $DB->get_record('user', array('username' => $specific_export_username ));\n if (!empty($specific_export_user)){\n return $specific_export_user;\n }\n }\n // if no specific export user can be found, we return false\n return false;\n }",
"public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }",
"public function getBackupDirectory()\n {\n\n return Bourbon::getInstance()->getDataDirectory() . 'backups' . DIRECTORY_SEPARATOR;\n\n }",
"function getAccountDirectory() {\n \n if (!($windir = getWindowsDirectory()))\n return false;\n\n $ini_file = $windir . '/' . FILE_NAME_Inc;\n if (!($ini = parse_ini_file($ini_file, true)))\n return false;\n\n return $ini[SECTION_System][VALUE_AccountDirectory];\n}",
"public function export_csv()\n {\n return Excel::download(new UsersExport, 'user.xlsx');\n }",
"function init__user_export()\n{\n define('USER_EXPORT_ENABLED', false);\n define('USER_EXPORT_MINUTES', 60 * 24);\n\n define('USER_EXPORT_DELIM', ',');\n\n define('USER_EXPORT_PATH', 'data_custom/modules/user_export/out.csv');\n\n define('USER_EXPORT_IPC_AUTO_REEXPORT', false);\n define('USER_EXPORT_IPC_URL_EDIT', null); // add or edit\n define('USER_EXPORT_IPC_URL_DELETE', null);\n define('USER_EXPORT_EMAIL', null);\n\n global $USER_EXPORT_WANTED;\n $USER_EXPORT_WANTED = array(\n // LOCAL => REMOTE\n 'id' => 'Composr member ID',\n 'm_username' => 'Username',\n 'm_email_address' => 'E-mail address',\n );\n}",
"public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}",
"public function export()\n {\n return Excel::download(new UsersExport, 'users.xlsx');\n }",
"public static function getDataDir()\n {\n return self::getDir('getDataHome');\n }",
"function wp_privacy_exports_dir()\n {\n }",
"function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}",
"function rlip_get_export_filename($plugin, $tz = 99) {\n global $CFG;\n $tempexportdir = $CFG->dataroot . sprintf(RLIP_EXPORT_TEMPDIR, $plugin);\n $export = basename(get_config($plugin, 'export_file'));\n $timestamp = get_config($plugin, 'export_file_timestamp');\n if (!empty($timestamp)) {\n $timestamp = userdate(time(), get_string('export_file_timestamp',\n $plugin), $tz);\n if (($extpos = strrpos($export, '.')) !== false) {\n $export = substr($export, 0, $extpos) .\n \"_{$timestamp}\" . substr($export, $extpos);\n } else {\n $export .= \"_{$timestamp}.csv\";\n }\n }\n if (!file_exists($tempexportdir) && !@mkdir($tempexportdir, 0777, true)) {\n error_log(\"/blocks/rlip/lib.php::rlip_get_export_filename('{$plugin}', {$tz}) - Error creating directory: '{$tempexportdir}'\");\n }\n return $tempexportdir . $export;\n}",
"public function getFolderPath(){}",
"public function export()\n {\n return $this->connector->exportLoginData();\n }",
"private function get_reports_dir(Application $app) : string {\n\n\t\t//Generate path directory\n\t\treturn $this->config->item(\"data_directory\").\"reports/\".$app->id.\"/\";\n\n\t}"
]
| [
"0.77157414",
"0.7433574",
"0.70509726",
"0.6722199",
"0.6703358",
"0.6395572",
"0.63304895",
"0.63304895",
"0.6227603",
"0.61589086",
"0.6032105",
"0.60036784",
"0.5987433",
"0.59700906",
"0.5887101",
"0.5882436",
"0.5869087",
"0.58589864",
"0.5856343",
"0.5844826",
"0.58379686",
"0.583199",
"0.5830543",
"0.58151674",
"0.57578456",
"0.57331866",
"0.57066405",
"0.56962854",
"0.5686479",
"0.566438"
]
| 0.8034237 | 0 |
Get a list of the already exported files in the export directory Get a list of the already exported files in the export directory | function getExportFiles()
{
$dir = $this->getExportDirectory();
// quit if export dir not available
if (!@is_dir($dir) or
!is_writeable($dir))
{
return array();
}
// open directory
$dir = dir($dir);
// initialize array
$file = array();
// get files and save the in the array
while ($entry = $dir->read())
{
if ($entry != "." and
$entry != ".." and
preg_match("/^[0-9]{10}_{2}[0-9]+_{2}([a-z0-9]{3})_usrf\.[a-z]{1,3}\$/", $entry, $matches))
{
$filearray["filename"] = $entry;
$filearray["filesize"] = filesize($this->getExportDirectory()."/".$entry);
array_push($file, $filearray);
}
}
// close import directory
$dir->close();
// sort files
sort ($file);
reset ($file);
return $file;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function FetchExporterList()\n\t{\n\t\t$exporterRoot = APP_ROOT.\"/includes/converter/exporters/\";\n\t\t$files = scandir($exporterRoot);\n\n\t\tforeach($files as $file) {\n\t\t\tif(!is_file($exporterRoot.$file) || isc_substr($file, -3) != \"php\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trequire_once $exporterRoot.$file;\n\t\t\t$file = isc_substr($file, 0, isc_strlen($file)-4);\n\t\t\t$className = \"ISC_ADMIN_EXPORTER_\".isc_strtoupper($file);\n\t\t\tif(!class_exists($className)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$exporter = new $className;\n\t\t\t$exporters[$file] = array(\n\t\t\t\t\"title\" => $exporter->title,\n\t\t\t\t\"configuration\" => \"\"\n\t\t\t);\n\t\t\tif(method_exists($exporter, \"Configure\")) {\n\t\t\t\t$exporters[$file]['configuration'] = $exporter->Configure();\n\t\t\t}\n\t\t}\n\t\treturn $exporters;\n\t}",
"abstract public function getAvailableExports();",
"public static function GetExportFileTypeList()\n\t{\n\t\t$files = scandir(TYPE_ROOT);\n\n\t\t$types = array();\n\n\t\tforeach($files as $file) {\n\t\t\tif(!is_file(TYPE_ROOT . $file) || isc_substr($file, -3) != \"php\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trequire_once TYPE_ROOT . $file;\n\n\t\t\t$file = isc_substr($file, 0, isc_strlen($file) - 4);\n\t\t\t/*\n\t\t\t$pos = isc_strrpos($file, \".\");\n\t\t\t$typeName = isc_strtoupper(isc_substr($file, $pos + 1));\n\t\t\t*/\n\t\t\t$className = \"ISC_ADMIN_EXPORTFILETYPE_\" . strtoupper($file); //$typeName;\n\t\t\tif(!class_exists($className)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$obj = new $className;\n\t\t\tif (!$obj->ignore) {\n\t\t\t\t$types[$file] = $obj->GetTypeDetails();\n\t\t\t}\n\t\t}\n\n\t\treturn $types;\n\t}",
"function _generateFilesList() {\n return array();\n }",
"public function getNfsExports()\n {\n return $this->nfs_exports;\n }",
"protected function getExistingDumps()\n\t{\n\t\t$files = glob($this->backupDir . '/*.' . $this->extension);\n\t\t$dumps = array();\n\t\tforeach ($files as $filename)\n\t\t{\n\t\t\t$time = $this->getTime(basename($filename));\n\t\t\tif ($time !== FALSE)\n\t\t\t{\n\t\t\t\t$dumps[] = array(\n\t\t\t\t\t'path' => $filename,\n\t\t\t\t\t'time' => $time,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $dumps;\n\t}",
"public function findExports();",
"public function exportedAssets(): array\n {\n $exported = [];\n\n foreach ($this->tagsByType('ExportAssets') as $export) {\n $characterId = $export->tags->item;\n\n foreach ($export->names->item as $name) {\n $exported[(string) $name] = (int) $characterId;\n }\n }\n\n return $exported;\n }",
"public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }",
"private function exportAll()\n {\n $files = Mage::getModel('factfinder/export_type_product')->saveAll();\n echo \"Successfully generated the following files:\\n\";\n foreach ($files as $file) {\n echo $file . \"\\n\";\n }\n }",
"public function clearExports()\n {\n $location = \"application/export/files/*.*\";\n $files = glob($location); \n foreach($files as $file){\n unlink($file); \n }\n return;\n }",
"protected function _getFiles() {\n\t\t$Directory = new RecursiveDirectoryIterator(BACKUPS);\n\t\t$It = new RecursiveIteratorIterator($Directory);\n\t\t$Regex = new RegexIterator($It, '/dbdump_.*?[\\.sql|\\.gz]$/', RecursiveRegexIterator::GET_MATCH);\n\t\t$files = array();\n\t\tforeach ($Regex as $v) {\n\t\t\t$files[] = $v[0];\n\t\t}\n\t\t$files = array_reverse($files);\n\t\treturn $files;\n\t}",
"private function exportFilesAndClear()\n {\n foreach (File::allFiles(Auth()->user()->getPublicPath()) as $file) {\n if (strpos($file, \".jpg\") !== false || strpos($file, \".png\") !== false) {\n $name = $this->reformatName($file);\n File::move($file, Auth()->user()->getPublicPath() . '/' . $name);\n }\n }\n $files = scandir(Auth()->user()->getPublicPath());\n foreach ($files as $key => $file) {\n if (is_dir(Auth()->user()->getPublicPath() . '/' . $file)) {\n if ($file[0] != '.') {\n File::deleteDirectory(Auth()->user()->getPublicPath() . '/' . $file);\n }\n } else {\n if (strpos($file, \".jpg\") === false && strpos($file, \".png\") === false) {\n File::delete(Auth()->user()->getPublicPath() . '/' . $file);\n }\n }\n }\n return null;\n }",
"public function getList() {\n\t\treturn Cgn_Module_Manager_File::getListStatic();\n\t}",
"public function get_h5p_exports_list($ids = NULL) {\n global $wpdb;\n\n // Determine where part of SQL\n $where = ($ids ? \"WHERE id IN (\" . implode(',', $ids) . \")\" : '');\n\n // Look up H5P IDs\n $results = $wpdb->get_results(\n \"SELECT hc.id,\n hc.slug\n FROM {$wpdb->prefix}h5p_contents hc\n {$where}\"\n );\n\n // Format output\n $data = array();\n $baseurl = $this->get_h5p_url(true);\n foreach ($results as $h5p) {\n $slug = ($h5p->slug ? $h5p->slug . '-' : '');\n $data[] = array(\n 'id' => $h5p->id,\n 'url' => \"{$baseurl}/exports/{$slug}{$h5p->id}.h5p\"\n );\n }\n return $data;\n }",
"function getExportDirectory()\n\t{\n\t\t$export_dir = ilUtil::getDataDir().\"/usrf_data/export\";\n\n\t\treturn $export_dir;\n\t}",
"function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}",
"function getExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$export_dir = ilUtil::getDataDir().\"/svy_data\".\"/svy_\".$this->getId().\"/export\";\n\n\t\treturn $export_dir;\n\t}",
"public function getFileList()\n {\n return array_map(\n function (FileEntry $file) {\n return $file->getFilename();\n },\n $this->pharchive->getFiles()\n );\n }",
"protected function getModuleFileNames()\n {\n $results = db_query('SELECT name, filename FROM {system} WHERE status = 1 ORDER BY weight ASC, name ASC')->fetchAllAssoc('name');\n\n return array_map(function ($value) {\n return DRUPAL_ROOT.DIRECTORY_SEPARATOR.$value->filename;\n }, $results);\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }",
"protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}",
"function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t$output[] = $row['lead_id'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->display(\"Query failed: $query\" . mysql_error($this->conn));\n\t\t}\n\n\t\treturn $output;\n\t}",
"function DNUI_get_backup() {\r\n $basePlugin = plugin_dir_path(__FILE__) . '../backup/';\r\n $urlBase = plugin_dir_url(__FILE__) . '../backup/';\r\n\r\n $out = array();\r\n $backups = DNUI_scan_dir($basePlugin);\r\n foreach ($backups as $backup) {\r\n $file = DNUI_scan_dir($basePlugin . $backup);\r\n array_push($out, array('id' => $backup, 'urlBase' => $urlBase, 'files' => $file));\r\n }\r\n return $out;\r\n}",
"public function export() {\n $data = array();\n foreach ($this->elements as $element) {\n $data[$element->getName()] = $element->export();\n }\n return $data;\n }",
"function getExportPath() {\n\t\t$exportPath = Config::getVar('files', 'files_dir') . '/' . $this->getPluginSettingsPrefix();\n\t\tif (!file_exists($exportPath)) {\n\t\t\t$fileManager = new FileManager();\n\t\t\t$fileManager->mkdir($exportPath);\n\t\t}\n\t\tif (!is_writable($exportPath)) {\n\t\t\t$errors = array(\n\t\t\t\tarray('plugins.importexport.common.export.error.outputFileNotWritable', $exportPath)\n\t\t\t);\n\t\t\treturn $errors;\n\t\t}\n\t\treturn realpath($exportPath) . '/';\n\t}",
"public function getFiles ();",
"public function export_all()\n\t{\n\t\tforeach ($this->collection as $image)\n\t\t{\n\t\t\t$image->export();\n\t\t}\t\n\t}",
"static function getList()\n {\n $out = array();\n\n if ($dh = opendir(__DIR__ . '/../img/')) {\n while (($file = readdir($dh)) !== false) {\n if (substr($file, -4) === '.jpg') {\n $filename = substr($file, 0, -4);\n $out[$filename] = realpath(__DIR__ . '/../img/' . $file);\n }\n }\n\n closedir($dh);\n }\n\n return $out;\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }"
]
| [
"0.73119366",
"0.6505552",
"0.64573514",
"0.63354045",
"0.6275798",
"0.62234676",
"0.6104274",
"0.60710806",
"0.6069981",
"0.60503703",
"0.59917426",
"0.59884036",
"0.59783393",
"0.59728575",
"0.5964481",
"0.5882239",
"0.58674145",
"0.5851655",
"0.58128285",
"0.57794315",
"0.5776116",
"0.5774126",
"0.57705975",
"0.575993",
"0.5758907",
"0.57486105",
"0.56861806",
"0.56711584",
"0.5660773",
"0.5655934"
]
| 0.8022613 | 0 |
Get all exportable user defined fields | function getUserDefinedExportFields()
{
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$udf_obj =& ilUserDefinedFields::_getInstance();
$udf_ex_fields = array();
foreach($udf_obj->getDefinitions() as $definition)
{
if ($definition["export"] != FALSE)
{
$udf_ex_fields[] = array("name" => $definition["field_name"],
"id" => $definition["field_id"]);
}
}
return $udf_ex_fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExportFields(): array;",
"public function getFieldsForExport()\n {\n return $this->fields;\n }",
"public function getFieldsForExport()\n {\n return $this->fields;\n }",
"public function getAllFields();",
"public function exportFields()\r\n\t{\r\n\t\treturn $this->exportOptions;\r\n\t}",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getUserFields()\r\n {\r\n return CrugeFactory::get()->getICrugeFieldListModels();\r\n }",
"final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }",
"public function getGroupExportableFields()\n\t{\n\t\tforeach($this->definitions as $id => $definition)\n\t\t{\n\t\t\tif($definition['group_export'])\n\t\t\t{\n\t\t\t\t$cexp_definition[$id] = $definition;\n\t\t\t}\n\t\t}\n\t\treturn $cexp_definition ? $cexp_definition : array();\n\t}",
"public function getFields() {}",
"public function getFields() {}",
"public function getFields() {}",
"static function custom_get_creatable_fields() {\n # use this functionality to get a list of all field in the table\n return self::default_get_updatable_fields();\n }",
"public function getExportFields()\n {\n $fields = parent::getExportFields();\n \n if ($this->modelClass == 'Product') {\n $fields[\"URLSegment\"] = \"URLSegment\";\n $fields[\"Content\"] = \"Content\";\n $fields[\"StockID\"] = \"StockID\";\n $fields[\"Images.first.AbsoluteLink\"] = \"ImageLink\";\n }\n\n $this->extend(\"updateExportFields\", $fields);\n \n return $fields;\n }",
"abstract public function getFields();",
"abstract public function getFields();",
"public function getExportFields(): array\n {\n $summaryFields = $this->modelClass::config()->get('summary_fields') ?? [];\n $extraFields = $this->modelClass::config()->get('extra_export_fields') ?? [];\n\n if ($extraFields) {\n return array_merge($summaryFields, $extraFields);\n }\n\n return $summaryFields;\n }",
"function getFields();",
"public function fields();",
"public function fields();",
"public function fields();",
"public function fields();",
"public function fields();",
"public function getAllFields()\n {\n return $this->fields;\n }",
"public function getFields(): array;"
]
| [
"0.8024037",
"0.76265126",
"0.76265126",
"0.7204274",
"0.71236205",
"0.7002998",
"0.7002998",
"0.7002998",
"0.7002998",
"0.7002998",
"0.7002998",
"0.6957784",
"0.6915152",
"0.69085884",
"0.69043565",
"0.69043565",
"0.69043565",
"0.6840719",
"0.6826699",
"0.68175596",
"0.68175596",
"0.67935616",
"0.67618173",
"0.6744545",
"0.6744545",
"0.6744545",
"0.6744545",
"0.6744545",
"0.6740018",
"0.6697317"
]
| 0.804589 | 0 |
creates data directory for export files (data_dir/usrf_data/export, depending on data directory that is set in ILIAS setup/ini) | function createExportDirectory()
{
if (!@is_dir($this->getExportDirectory()))
{
$usrf_data_dir = ilUtil::getDataDir()."/usrf_data";
ilUtil::makeDir($usrf_data_dir);
if(!is_writable($usrf_data_dir))
{
$this->ilias->raiseError("Userfolder data directory (".$usrf_data_dir
.") not writeable.",$this->ilias->error_obj->MESSAGE);
}
// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
$export_dir = $usrf_data_dir."/export";
ilUtil::makeDir($export_dir);
if(!@is_dir($export_dir))
{
$this->ilias->raiseError("Creation of Userfolder Export Directory failed.",$this->ilias->error_obj->MESSAGE);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t\n\t\t// create learning module directory (data_dir/lm_data/lm_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t$export_dir = $svy_dir.\"/export\";\n\t\tilUtil::makeDir($export_dir);\n\t\tif(!@is_dir($export_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Export Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"function getExportDirectory()\n\t{\n\t\t$export_dir = ilUtil::getDataDir().\"/usrf_data/export\";\n\n\t\treturn $export_dir;\n\t}",
"function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }",
"function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"function buildExportFile($a_mode = \"userfolder_export_excel_x86\", $user_data_filter = FALSE)\n\t{\n\t\tglobal $ilBench;\n\t\tglobal $log;\n\t\tglobal $ilDB;\n\t\tglobal $ilias;\n\t\tglobal $lng;\n\n\t\t//get Log File\n\t\t$expDir = $this->getExportDirectory();\n\t\t//$expLog = &$log;\n\t\t//$expLog->delete();\n\t\t//$expLog->setLogFormat(\"\");\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"Start export of user data\");\n\n\t\t// create export directory if needed\n\t\t$this->createExportDirectory();\n\n\t\t//get data\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"User data export: build an array of all user data entries\");\n\t\t$settings =& $this->getExportSettings();\n\t\t\n\t\t// user languages\n\t\t$query = \"SELECT * FROM usr_pref WHERE keyword = \".$ilDB->quote('language','text');\n\t\t$res = $ilDB->query($query);\n\t\t$languages = array();\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t$languages[$row['usr_id']] = $row['value'];\n\t\t}\n\t\t\n\t\t\n\t\t$data = array();\n\t\t$query = \"SELECT usr_data.* FROM usr_data \".\n\t\t\t\" ORDER BY usr_data.lastname, usr_data.firstname\";\n\t\t$result = $ilDB->query($query);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif(isset($languages[$row['usr_id']]))\n\t\t\t{\n\t\t\t\t$row['language'] = $languages[$row['usr_id']];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row['language'] = $lng->getDefaultLanguage();\n\t\t\t}\n\t\t\t\n\t\t\tif (is_array($user_data_filter))\n\t\t\t{\n\t\t\t\tif (in_array($row[\"usr_id\"], $user_data_filter)) array_push($data, $row);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($data, $row);\n\t\t\t}\n\t\t}\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"User data export: build an array of all user data entries\");\n\n\t\t$fullname = $expDir.\"/\".$this->getExportFilename($a_mode);\n\t\tswitch ($a_mode)\n\t\t{\n\t\t\tcase \"userfolder_export_excel_x86\":\n\t\t\t\t$this->createExcelExport($settings, $data, $fullname, \"latin1\");\n\t\t\t\tbreak;\n\t\t\tcase \"userfolder_export_csv\":\n\t\t\t\t$this->createCSVExport($settings, $data, $fullname);\n\t\t\t\tbreak;\n\t\t\tcase \"userfolder_export_xml\":\n\t\t\t\t$this->createXMLExport($settings, $data, $fullname);\n\t\t\t\tbreak;\n\t\t}\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"Finished export of user data\");\n\n\t\treturn $fullname;\n\t}",
"private function create_downloads_dir(){\r\n\t\t$wp_upload_dir = wp_upload_dir();\r\n\r\n\t\t$downloads_dir = $wp_upload_dir['basedir'].'/downloads';\r\n\t\t$archived_dir = $wp_upload_dir['basedir'].'/archived';\r\n\r\n\t\t$reports_dir = $downloads_dir.'/reports';\r\n\t\t$archived_reports_dir = $archived_dir.'/reports';\r\n\r\n\t\tif(!file_exists($downloads_dir)){ mkdir($downloads_dir, 0777); }\r\n\t\tif(!file_exists($archived_dir)){ mkdir($archived_dir, 0777); }\r\n\r\n\t\tif(!file_exists($reports_dir)){ mkdir($reports_dir, 0777); }\r\n\t\tif(!file_exists($archived_reports_dir)){ mkdir($archived_reports_dir, 0777); }\r\n\r\n\t\t$rslt['reports_dir'] = $reports_dir;\r\n\t\t$rslt['archived_reports_dir'] = $archived_reports_dir;\r\n\r\n\t\treturn $rslt;\r\n\t}",
"function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}",
"public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }",
"function getExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$export_dir = ilUtil::getDataDir().\"/svy_data\".\"/svy_\".$this->getId().\"/export\";\n\n\t\treturn $export_dir;\n\t}",
"function init__user_export()\n{\n define('USER_EXPORT_ENABLED', false);\n define('USER_EXPORT_MINUTES', 60 * 24);\n\n define('USER_EXPORT_DELIM', ',');\n\n define('USER_EXPORT_PATH', 'data_custom/modules/user_export/out.csv');\n\n define('USER_EXPORT_IPC_AUTO_REEXPORT', false);\n define('USER_EXPORT_IPC_URL_EDIT', null); // add or edit\n define('USER_EXPORT_IPC_URL_DELETE', null);\n define('USER_EXPORT_EMAIL', null);\n\n global $USER_EXPORT_WANTED;\n $USER_EXPORT_WANTED = array(\n // LOCAL => REMOTE\n 'id' => 'Composr member ID',\n 'm_username' => 'Username',\n 'm_email_address' => 'E-mail address',\n );\n}",
"public static function getDataDir()\n {\n return self::getDir('getDataHome');\n }",
"function local_powerprouserexport_write_user_data($config, $runhow = 'auto', $data = null) {\n global $CFG, $DB;\n\n if (empty($config->usercsvlocation)) {\n $config->usercsvlocation = $CFG->dataroot.'/powerprouserexport';\n }\n if (!isset($config->usercsvprefix)) {\n $config->usercsvprefix = '';\n }\n if (!isset($config->lastrun)) {\n $config->lastrun = 0;\n }\n\n // Open the file for writing.\n $filename = '';\n\n if ($data) {\n $filename = $config->usercsvlocation.'/'.$config->usercsvprefix.date(\"Ymd\").'-'.date(\"His\").'.csv';\n } else {\n $filename = $config->usercsvlocation.'/'.$config->usercsvprefix.date(\"Ymd\").'.csv';\n }\n\n if ($fh = fopen($filename, 'w')) {\n\n // Write the headers first.\n fwrite($fh, implode(',', local_powerprouserexport_get_user_csv_headers()).\"\\r\\n\");\n\n $users = local_powerprouserexport_get_user_data($config->lastrun, $data);\n\n if ($users->valid()) {\n\n // Cycle through data and add to file.\n foreach ($users as $user) {\n\n // profile_load_custom_fields($user);\n\n $user->profile = (array)profile_user_record($user->id);\n $employer = ($user->profile['employer'] == 'Other'\n and !empty($user->profile['employerother'])\n and strtolower($user->profile['employerother']) != 'n/a')\n ? $user->profile['employerother']\n : $user->profile['employer'];\n\n // Write the line to CSV file.\n fwrite($fh,\n implode(',', array(\n $user->username,\n $user->email,\n $user->firstname,\n $user->lastname,\n $user->country,\n $user->profile['DOB'],\n $user->profile['streetnumber'],\n $user->profile['streetname'],\n $user->profile['addresslocation'],\n $user->profile['postcode'],\n $user->profile['state'],\n $user->profile['gender'],\n $user->profile['postaldetails'],\n $employer,\n $user->profile['UniqueStudentID'],\n $user->profile['Phonenumber'])\n ).\"\\r\\n\");\n }\n\n // Close the recordset to free up RDBMS memory.\n $users->close();\n }\n // Close the file.\n fclose($fh);\n\n return true;\n } else {\n return false;\n }\n}",
"public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }",
"public function createExportFile()\n {\n $this->csvFile = self::tempFile('export.csv');\n $this->photoZip = self::tempFile('photos.zip');\n $this->exportFile = sys_get_temp_dir() . '/' . $this->datestamp . '-marcato.zip';\n\n $this->createCSV();\n $this->createPhotoZipfile();\n\n $zip = new ZipArchive();\n $result = $zip->open($this->exportFile, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n if ($result !== true) {\n throw new RuntimeException(\"Failed to create zip archive result=[$result]\");\n }\n $zip->addFile($this->csvFile, $this->datestamp . '.csv');\n $zip->addFile($this->photoZip, $this->datestamp . '_ranger_photos.zip');\n $zip->close();\n }",
"private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}",
"public static function getDataFolder()\n {\n $class = get_called_class();\n $strip = explode('\\\\', $class);\n\n return RELEASE_NAME_DATA . '/' . strtolower(array_pop($strip)) . 's';\n }",
"public function create($data) {\n\t\t// Create an ID\n\t\t$id = $this->idCreate();\n\t\t// Write the data file\n\t\tfile_put_contents( $this->init['path']['data'] . $id . $this->init['data']['ext'] );\n\t}",
"function install($data='') {\r\n @umask(0);\r\n if (!Is_Dir(ROOT.\"./cms/products/\")) {\r\n mkdir(ROOT.\"./cms/products/\", 0777);\r\n }\r\n parent::install();\r\n }",
"protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}",
"private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }",
"protected function createDirectory() {}",
"public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creating the directory failed\n\t\t\t\tthrow new Exception(elgg_echo('userexport:error:nofiledir'));\n\t\t\t}\n\t\t}\n\n\t\t// Delete any existing file\n\t\tunlink($this->filename);\n\t}",
"function logonscreener_destination_prepare() {\n if (is_file(LOGONSCREENER_DESTINATION_PATH)) {\n chmod(LOGONSCREENER_DESTINATION_PATH, 0777);\n }\n else {\n $directory = dirname(LOGONSCREENER_DESTINATION_PATH);\n\n if (!is_dir($directory)) {\n mkdir($directory, 0, TRUE);\n }\n }\n}",
"protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }",
"protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }",
"protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }",
"function getExportDirectory() {\n\n $upload_dir = wp_upload_dir();\n\n $path = $upload_dir['basedir'] . '/form_entry_exports';\n\n // Create the backups directory if it doesn't exist\n if ( is_writable( dirname( $path ) ) && ! is_dir( $path ) )\n mkdir( $path, 0755 );\n\n // Secure the directory with a .htaccess file\n $htaccess = $path . '/.htaccess';\n\n $contents[]\t= '# ' . sprintf( 'This %s file ensures that other people cannot download your export files' , '.htaccess' );\n $contents[] = '';\n $contents[] = '<IfModule mod_rewrite.c>';\n $contents[] = 'RewriteEngine On';\n $contents[] = 'RewriteCond %{QUERY_STRING} !key=334}gtrte';\n $contents[] = 'RewriteRule (.*) - [F]';\n $contents[] = '</IfModule>';\n $contents[] = '';\n\n if ( ! file_exists( $htaccess ) && is_writable( $path ) && require_once( ABSPATH . '/wp-admin/includes/misc.php' ) )\n insert_with_markers( $htaccess, 'BackUpWordPress', $contents );\n\n return $path;\n }",
"function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }",
"protected function generateUploadDir()\n\t{\n\t\treturn self::EXPORT_PATH;\n\t}",
"abstract function exportData();"
]
| [
"0.71233654",
"0.6599585",
"0.6466034",
"0.6425255",
"0.6224391",
"0.59461343",
"0.58316",
"0.5826815",
"0.5776275",
"0.577291",
"0.5707089",
"0.5669395",
"0.5567984",
"0.5466869",
"0.5404557",
"0.5390497",
"0.5372604",
"0.53137654",
"0.5299719",
"0.5281254",
"0.5279568",
"0.527415",
"0.5266727",
"0.5228414",
"0.52153945",
"0.52087694",
"0.51771337",
"0.51729",
"0.5135885",
"0.5135104"
]
| 0.77968264 | 0 |
Get profile fields (DEPRECATED, use ilUserProfile() instead) | static function &getProfileFields()
{
include_once("./Services/User/classes/class.ilUserProfile.php");
$up = new ilUserProfile();
$up->skipField("username");
$up->skipField("roles");
$up->skipGroup("preferences");
$fds = $up->getStandardFields();
foreach ($fds as $k => $f)
{
$profile_fields[] = $k;
}
return $profile_fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getProfileFields(){\n \n\t\tif(self::$profileFields == null){\n\t\t\t$prefix = Engine_Db_Table::getTablePrefix();\n\t\t\t$adapter = Engine_Db_Table::getDefaultAdapter();\n\t\t\t$sql = \"SELECT engine4_user_fields_meta.* FROM `engine4_user_fields_maps` \n\t\t\t\t\tjoin engine4_user_fields_meta on (engine4_user_fields_maps.child_id = engine4_user_fields_meta.field_id )\n\t\t\t\t\twhere engine4_user_fields_maps.option_id = 1 \n\t\t\t\t\tand engine4_user_fields_meta.type NOT IN ('profile_type','heading','gender','birthdate')\n\t\t\t\t\t\";\n\t\t\t\n\t\t\tself::$profileFields = $adapter->fetchAll($sql);\n\t\t}\n\t\treturn self::$profileFields;\n\t}",
"public function getProfileInfo()\n\t{\n\t\t$data = $this->get($this->_objectType . $this->_objectId);\n\t\treturn $data;\n\t\t$fields = array();\n\t\tforeach ($data as $fieldName => $fieldValue)\n\t\t{\n\t\t\t$fields[$fieldName] = $fieldValue;\n\t\t}\n\t\t$this->_fields = $fields;\n\t\treturn $this->_fields;\n\t}",
"public static function get_mappable_profile_fields();",
"public function getUserProfile();",
"public static function sql_user_admin_profile() {\n\t\tglobal $wpdb;\n\n\t\t$profile_user_fields = $wpdb->get_results( \"SELECT * FROM {$wpdb->base_prefix}pp_profile_fields\" );\n\n\t\treturn $profile_user_fields;\n\t}",
"function get_profile($field, $user = \\false)\n {\n }",
"function auth_saml2_profile_get_custom_fields($onlyinuserobject = false) {\n global $DB, $CFG;\n\n // Get all the fields.\n $fields = $DB->get_records('user_info_field', null, 'id ASC');\n\n // If only doing the user object ones, unset the rest.\n if ($onlyinuserobject) {\n foreach ($fields as $id => $field) {\n require_once($CFG->dirroot . '/user/profile/field/' .\n $field->datatype . '/field.class.php');\n $newfield = 'profile_field_' . $field->datatype;\n $formfield = new $newfield();\n if (!$formfield->is_user_object_data()) {\n unset($fields[$id]);\n }\n }\n }\n\n return $fields;\n}",
"abstract protected function getUserProfile();",
"function profile_info() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }",
"public function getUserProfileDetails()\n {\n // Obtain the authenticated user's id.\n $id = Auth::id();\n\n // Query to obtain the user's profile details.\n $userDetails = User::select('first_name', 'last_name', 'email', 'max_fuel_limit', 'max_distance_limit')->where('user_id', $id)->first();\n\n // Return the selected details.\n return $userDetails;\n }",
"function theme_haarlem_intranet_get_profile_manager_profile_field($metadata_name) {\n\tstatic $fields;\n\t\n\tif (!isset($fields)) {\n\t\t$fields = array();\n\t\t\n\t\tif (elgg_is_active_plugin('profile_manager')) {\n\t\t\t$site = elgg_get_site_entity();\n\t\t\t\n\t\t\t$options = array(\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => ProfileManagerCustomProfileField::SUBTYPE,\n\t\t\t\t'limit' => false,\n\t\t\t\t'owner_guid' => $site->getGUID(),\n\t\t\t\t'site_guid' => $site->getGUID()\n\t\t\t);\n\t\t\t$profile_fields = elgg_get_entities($options);\n\t\t\tif (!empty($profile_fields)) {\n\t\t\t\tforeach ($profile_fields as $profile_field) {\n\t\t\t\t\t$fields[$profile_field->metadata_name] = $profile_field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn elgg_extract($metadata_name, $fields, false);\n}",
"public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }",
"public function getProfile()\n {\n return $this->getFieldValue(self::FIELD_PROFILE);\n }",
"function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }",
"function getProfile(){\n $profile = $this->loadUser();\n return $profile;\n }",
"public function getInfos($fields)\n {\n $users_infos = sfFacebook::getFacebookApi()->users_getInfo(array($this->getCurrentFacebookUid()),$fields);\n\n return reset($users_infos);\n }",
"function getUserProfile()\n\t{\n\t\t// ask kakao api for user infos\n\t\t$data = $this->api->api( \"user/me\" ); \n \n\t\tif ( ! isset( $data->id ) || isset( $data->error ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = @ $data->id; \n\t\t$this->user->profile->displayName = @ $data->properties->nickname;\n\t\t$this->user->profile->photoURL = @ $data->properties->thumbnail_image;\n\n\t\treturn $this->user->profile;\n\t}",
"public static function getListOfUserFields()\n {\n // so, list needs to be manually updated\n return array(\n \"morgid\",\n \"garageid\",\n \"talkid\",\n \"username\",\n \"password\",\n \"joindate\",\n \"title\",\n \"firstname\",\n \"lastname\",\n \"birthdate\",\n \"street\",\n \"postcode\",\n \"city\",\n \"country\",\n \"ccode\",\n \"email\",\n \"phone\",\n \"fax\",\n \"homepage\",\n \"jabber\",\n \"icq\",\n \"aim\",\n \"yahoo\",\n \"msn\",\n \"skype\",\n );\n }",
"public function getUserProfile(){\n\n\t\treturn $this->cnuser->getUserProfile($this->request->header('Authorization'));\n\t}",
"public function getProfile()\n {\n return $this->profile;\n }",
"public function getProfile()\n {\n return $this->profile;\n }",
"public function getProfile()\n {\n return $this->profile;\n }",
"public function loadProfileInformation() {\n\t\t\t$procedure = \"get\" . $this->mode_ . \"Information\"; \n\t\t\t$this->profileInformation_ = $this->dbHandler_->call($procedure, \"%d\", array($this->id_));\n\t\t}",
"function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}",
"public function raasGetCustomFields()\n {\n $url = RAAS_DOMAIN . \"/api/v2/userprofile/fields?apikey=\" . RAAS_API_KEY . \"&apisecret=\" . RAAS_SECRET_KEY;\n $response = $this->raasGetResponseFromRaas($url);\n return isset($response->CustomFields) ? $response->CustomFields : '';\n }",
"public function GetProfile()\n {\n return $this->profile;\n }",
"public function get_user_information($profile_id)\n\t{\n\t\treturn $this->ci->profile_model->get_user_information($profile_id);\n\t}",
"public function profile() {\n return $this->profile;\n }",
"public function get_profile_data() {\n\t\treturn $this->db->get_where('users', array('id' => $this->session->userdata('user_id')))->row_array();\n\t}",
"protected function getFields()\n {\n return array(\n 'user_id',\n 'name',\n 'oauth_user_id',\n 'username',\n 'pic_url',\n 'oauth_provider',\n 'token',\n 'secret'\n );\n }"
]
| [
"0.76904273",
"0.7676826",
"0.75186956",
"0.7189752",
"0.711803",
"0.69145244",
"0.6889209",
"0.67853636",
"0.66062826",
"0.6600881",
"0.6552911",
"0.6533339",
"0.6508206",
"0.64770323",
"0.6473083",
"0.6392423",
"0.6363981",
"0.6363373",
"0.6332004",
"0.63207716",
"0.63207716",
"0.63207716",
"0.6320767",
"0.63077164",
"0.62678874",
"0.6266028",
"0.62340355",
"0.6229942",
"0.62194496",
"0.62059534"
]
| 0.8419101 | 0 |
Update user folder assignment Typically called after deleting a category with local user accounts. These users will be assigned to the global user folder. | public static function _updateUserFolderAssignment($a_old_id,$a_new_id)
{
global $ilDB;
$query = "UPDATE usr_data SET time_limit_owner = ".$ilDB->quote($a_new_id, "integer")." ".
"WHERE time_limit_owner = ".$ilDB->quote($a_old_id, "integer")." ";
$ilDB->manipulate($query);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFolder() {\n if (isset($this->params['folder_id']) && $this->params['folder_id'] > 0) {\n $folderData = $this->getFolder($this->params['folder_id']);\n $data = array(\n 'permission_mode' => $this->params['permission_mode'],\n );\n $params = array(\n 'folder_id' => $this->params['folder_id'],\n );\n if ($this->params['permission_mode'] == 'inherited') {\n $this->databaseDeleteRecord(\n $this->tableFoldersPermissions,\n 'folder_id',\n $this->params['folder_id']\n );\n }\n if ($this->databaseUpdateRecord($this->tableFolders, $data, $params)) {\n $this->addMsg(MSG_INFO, $this->_gt('Folder updated.'));\n }\n if (isset($folderData[$this->lngSelect->currentLanguageId])) {\n $dataTrans = array(\n 'folder_name' => $this->params['folder_name'],\n );\n $paramsTrans = array(\n 'folder_id' => $this->params['folder_id'],\n 'lng_id' => $this->lngSelect->currentLanguageId,\n );\n if ($this->databaseUpdateRecord($this->tableFoldersTrans, $dataTrans, $paramsTrans)) {\n $this->addMsg(MSG_INFO, $this->_gt('Folder translation updated.'));\n }\n } else {\n $dataTrans = array(\n 'folder_id' => $this->params['folder_id'],\n 'lng_id' => $this->lngSelect->currentLanguageId,\n 'folder_name' => $this->params['folder_name'],\n );\n if ($this->databaseInsertRecord($this->tableFoldersTrans, NULL, $dataTrans)) {\n $this->addMsg(MSG_INFO, $this->_gt('Folder translation added.'));\n }\n }\n } else {\n $this->addMsg(MSG_INFO, $this->_gt('No folder selected.'));\n }\n }",
"function moveFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}",
"public function update_midrub_user_component() {\n \n // Verify if the Midrub's user component can be updated\n (new MidrubBaseAdminCollectionUpdateHelpers\\User_components)->verify();\n \n }",
"public function updateUserLinked\t(){\n\t\t\n\t\t}",
"private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }",
"protected function lstUsersAsAssessmentManager_Update() {\n\t\t\tif ($this->lstUsersAsAssessmentManager) {\n\t\t\t\t$this->objGroupAssessmentList->UnassociateAllUsersAsAssessmentManager();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsAssessmentManager->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objGroupAssessmentList->AssociateUserAsAssessmentManager(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected function updateUsersForSubshop()\n {\n $testConfig = $this->getTestConfig();\n if ($testConfig->getShopEdition() === 'EE' && $testConfig->isSubShop()) {\n #User demodata for subshop\n $aUserParams = array(\"oxshopid\" => $testConfig->getShopId());\n $aUsers = oxDb::getDb(oxDb::FETCH_MODE_NUM)->getAll('SELECT OXID FROM oxuser');\n foreach ($aUsers as $aUser) {\n $this->callShopSC(\"oxUser\", \"save\", $aUser[0], $aUserParams);\n }\n }\n }",
"function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}",
"private function setSubUserPermission($user, $assigned)\n {\n if (count($assigned) > 0) {\n $user_perms = $user->permissions()->get();\n foreach ($user_perms as $row) {\n $u_perm = UserPermission::where('user_id', $user->id)->where('permission_id', $row->id)->first();\n $checked = false;\n for ($i = 0; $i < count($assigned); $i++) {\n if ($row->id == $assigned[$i]) {\n $u_perm->permission = 1;\n $u_perm->save();\n $checked = true;\n break;\n }\n }\n\n if (!$checked) {\n $u_perm->permission = 0;\n $u_perm->save();\n }\n }\n }\n }",
"public function update($user, Folder $folder): bool\n {\n return $user->id === $folder->project->user_id;\n }",
"public function updateUserPreferences()\n {\n $userList = $this->_userDao->getUserList();\n\n // loop through every user and fix it\n foreach ($userList as $user) {\n /*\n * Because we do not get all users' properties from\n * getUserList, retrieve the users' settings from scratch\n */\n $user = $this->_userDao->getUser($user['userid']);\n\n // set the users' preferences\n $this->setSettingIfNot($user['prefs'], 'perpage', 25);\n $this->setSettingIfNot($user['prefs'], 'date_formatting', 'human');\n $this->setSettingIfNot($user['prefs'], 'normal_template', 'we1rdo');\n $this->setSettingIfNot($user['prefs'], 'mobile_template', 'mobile');\n $this->setSettingIfNot($user['prefs'], 'tablet_template', 'we1rdo');\n $this->setSettingIfNot($user['prefs'], 'count_newspots', true);\n $this->setSettingIfNot($user['prefs'], 'mouseover_subcats', true);\n $this->setSettingIfNot($user['prefs'], 'keep_seenlist', true);\n $this->setSettingIfNot($user['prefs'], 'auto_markasread', true);\n $this->setSettingIfNot($user['prefs'], 'keep_downloadlist', true);\n $this->setSettingIfNot($user['prefs'], 'keep_watchlist', true);\n $this->setSettingIfNot($user['prefs'], 'nzb_search_engine', 'nzbindex');\n $this->setSettingIfNot($user['prefs'], 'show_filesize', true);\n $this->setSettingIfNot($user['prefs'], 'show_reportcount', true);\n $this->setSettingIfNot($user['prefs'], 'minimum_reportcount', 1);\n $this->setSettingIfNot($user['prefs'], 'show_nzbbutton', true);\n $this->setSettingIfNot($user['prefs'], 'show_multinzb', true);\n $this->setSettingIfNot($user['prefs'], 'customcss', '');\n $this->setSettingIfNot($user['prefs'], 'newspotdefault_tag', $user['username']);\n $this->setSettingIfNot($user['prefs'], 'newspotdefault_body', '');\n $this->setSettingIfNot($user['prefs'], 'user_language', 'en_US');\n $this->setSettingIfNot($user['prefs'], 'show_avatars', true);\n $this->setSettingIfNot($user['prefs'], 'usemailaddress_for_gravatar', true);\n\n $this->setSettingIfNot($user['prefs']['nzbhandling'], 'action', 'disable');\n $this->setSettingIfNot($user['prefs']['nzbhandling'], 'local_dir', '/tmp');\n $this->setSettingIfNot($user['prefs']['nzbhandling'], 'prepare_action', 'merge');\n $this->setSettingIfNot($user['prefs']['nzbhandling'], 'command', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['sabnzbd'], 'url', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['sabnzbd'], 'apikey', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['sabnzbd'], 'username', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['sabnzbd'], 'password', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'host', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'port', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'ssl', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'username', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'password', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbget'], 'timeout', 15);\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbvortex'], 'host', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbvortex'], 'port', '');\n $this->setSettingIfNot($user['prefs']['nzbhandling']['nzbvortex'], 'apikey', '');\n\n $this->setSettingIfNot($user['prefs']['notifications']['growl'], 'host', '');\n $this->setSettingIfNot($user['prefs']['notifications']['growl'], 'password', '');\n /* Notifo and NMA are discontinued. */\n $this->unsetSetting($user['prefs']['notifications'], 'nma');\n $this->unsetSetting($user['prefs']['notifications'], 'notifo');\n $this->setSettingIfNot($user['prefs']['notifications']['prowl'], 'apikey', '');\n $this->setSettingIfNot($user['prefs']['notifications']['twitter'], 'screen_name', '');\n $this->setSettingIfNot($user['prefs']['notifications']['twitter'], 'request_token', '');\n $this->setSettingIfNot($user['prefs']['notifications']['twitter'], 'request_token_secret', '');\n $this->setSettingIfNot($user['prefs']['notifications']['twitter'], 'access_token', '');\n $this->setSettingIfNot($user['prefs']['notifications']['twitter'], 'access_token_secret', '');\n $notifProviders = Notifications_Factory::getActiveServices();\n foreach ($notifProviders as $notifProvider) {\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider], 'enabled', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'watchlist_handled', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'nzb_handled', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'retriever_finished', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'report_posted', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'spot_posted', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'user_added', false);\n $this->setSettingIfNot($user['prefs']['notifications'][$notifProvider]['events'], 'newspots_for_filter', false);\n } // foreach\n\n // make sure a sort preference is defined. An empty field means relevancy\n $this->setSettingIfNot($user['prefs'], 'defaultsortfield', '');\n\n // Remove deprecated preferences\n $this->unsetSetting($user['prefs'], 'search_url');\n $this->unsetSetting($user['prefs'], 'template');\n $this->unsetSetting($user['prefs']['notifications'], 'libnotify');\n\n // Make sure the user has a valid RSA key\n if ($user['userid'] > 2) {\n $rsaKey = $this->_userDao->getUserPrivateRsaKey($user['userid']);\n if (empty($rsaKey)) {\n // Creer een private en public key paar voor deze user\n $spotSigning = Services_Signing_Base::factory();\n $userKey = $spotSigning->createPrivateKey($this->_settings->get('openssl_cnf_path'));\n\n $this->_userDao->setUserRsaKeys($user['userid'], $userKey['public'], $userKey['private']);\n } // if\n } // if\n\n /*\n * In earlier versions, we always appended \"sabnzbd/\" to the URL, so we do this once\n * manually\n */\n if ($this->_settings->get('securityversion') < 0.31) {\n if (!empty($user['prefs']['nzbhandling']['sabnzbd']['url'])) {\n $user['prefs']['nzbhandling']['sabnzbd']['url'] = $user['prefs']['nzbhandling']['sabnzbd']['url'].'sabnzbd/';\n } // if\n } // if\n\n // update the user record in the database\n $this->_userDao->setUser($user);\n } // foreach\n }",
"public function testUpdateUser()\n {\n }",
"public function update(UpdateUserPermissionsRequest $request, User $user)\n {\n if (!$user->updatePermissions($request->folders)) {\n return redirect()->back()->withError('User permissions could not be updated.');\n }\n\n return redirect()->back()->withSuccess('User permissions have been updated successfully.');\n }",
"public function update()\n\t{\n\t\t$container = AssetService::getContainer($this->request->get('container'), 'local', 'Assets');\n\t\t$folder = $container->folder($this->request->get('path'));\n\t\t$folder->editFolder($this->request->get('basename'));\n\n\t\treturn [\n\t\t\t'success'\t=>\ttrue,\n\t\t\t'message'\t=> 'Folder was successfully updated',\n\t\t\t'folder'\t=> $folder->toArray()\n\t\t];\n\n\t}",
"protected function _updateUsers(Centixx_Model_Project $model)\n\t{\n\t\tif (!count($model->users)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$a = array();\n\t\tforeach ($model->users as $user ) {\n\t\t\t$a[$user->id] = $user->id;\n\t\t}\n\n\t\t$adapter = $this->getDbTable()->getAdapter()->query(\"UPDATE `users` SET `user_project` = NULL WHERE `user_project` = ?\",\n\t\t\tarray($model->id));\n\n\t\t$in = join(',', $a);\n\t\t$adapter = $this->getDbTable()->getAdapter()->query(\"UPDATE `users` SET `user_project` = ? WHERE `user_id` IN ($in)\",\n\t\t\tarray($model->id));\n\t}",
"function deleteFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'.$user_dir; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}",
"function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}",
"public function user_update($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_update', $data);\n\t\t\n\t\t// Update the permission cache table\n\t\t$this->CI->load->model('permissions_model');\n\t\t$this->CI->permissions_model->set_cache($data['u_id']);\n\t}",
"public function changeUserGroup()\n {\n $userId = $this->request->variable('user_id',0);\n $groupId = $this->request->variable('group_id',9999);\n\n if($userId === 0 || $groupId === 9999)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n /**\n * Group IDs\n * 5 - ADMIN\n * 4 - GLOBAL MOD\n * 2 - REGISTERED\n */\n $arrGroups = group_memberships(false, [$userId]);\n\n $arrCurrentGroupIds = [];\n\n // Get the user's current groups\n foreach($arrGroups as $group)\n {\n $arrCurrentGroupIds[$group['group_id']] = $group['group_id'];\n }\n\n // If the new group is 'registered user' we need to remove the user from\n // any admin or moderator groups they were previously in\n if($groupId < 4)\n {\n // User was an admin - remove them from the admin group\n if(in_array(5,$arrCurrentGroupIds))\n {\n group_user_del(5,[$userId]);\n }\n\n // User was a global mod - remove them from the global mod group\n if(in_array(4,$arrCurrentGroupIds))\n {\n group_user_del(4,[$userId]);\n }\n }\n\n // If the user is being made an admin, make sure they are a global mod too\n if($groupId == 5 AND !in_array(4,$arrCurrentGroupIds))\n {\n group_user_add(4, [$userId],false, false, false);\n }\n\n // User could already have the group they need if they are\n // being downgraded. Check if they have the group and\n // if not, add them. If they were, then make it the default\n if(!in_array($groupId,$arrCurrentGroupIds))\n {\n group_user_add($groupId, [$userId],false, false, true);\n }\n else\n {\n group_set_user_default($groupId,[$userId]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user\\'s group was updated',\n 'data' => [\n 'user_id' => $userId,\n 'group_id' => $groupId\n ]\n ]);\n }",
"protected function lstUsersAsCharity_Update() {\n\t\t\tif ($this->lstUsersAsCharity) {\n\t\t\t\t$this->objCharityPartner->UnassociateAllUsersAsCharity();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsCharity->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objCharityPartner->AssociateUserAsCharity(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function updateUser( UserDataInf $user )\n {\n \n $userName = $user->getName();\n \n $userId = $this->getUserId( $userName );\n $passwd = Password::passwordHash( $user->getPasswd() );\n \n $sqlUser = <<<SQL\nUPDATE wbfsys_role_user\nSET\n name = '{$userName}', \n inactive = FALSE, \n non_cert_login = TRUE,\n profile = '{$user->getProfile()}',\n level = '{$user->getLevel()}',\n password = '{$passwd}'\nWHERE rowid = {$userId}\n;\nSQL;\n \n $this->db->update( $sqlUser );\n \n $personId = $this->db->select( 'SELECT id_person from wbfsys_role_user where rowid = '.$userId );\n \n \n $sqlPerson = <<<SQL\nUPDATE core_person\nSET\nfirstname = '{$user->getFirstname()}', \nlastname = '{$user->getLastname()}'\nWHERE rowid = {$personId};\nSQL;\n\n $this->db->update( $sqlPerson );\n \n }",
"protected function removeGenomeUpdates() {\n // Retrieves genome uploads main folder (before users' folders)\n $rootDir = new Folder(WWW_ROOT . DS . 'files' . DS . 'genome_updates', false);\n\n // Checks if folder exists\n if(!$rootDir->Path) {\n $this->error('no-updates-root', 'Updates root folder has not been found');\n }\n\n // Loops users' folders\n foreach($rootDir->find() as $userId) {\n // Instances folder\n $userDir = new Folder($rootDir->pwd() . DS . $userId, false);\n // Checks if folder exists\n if($userDir->path) {\n // Searches user\n $user = $this->findUser($userId);\n // Case folder is not bound to any user\n if(!$user) {\n // Removes folder\n $userDir->remove();\n }\n // Case folder ha an user bound to istelf\n else {\n // Makes a list of files which should be stored into current user's directory\n $updates = array();\n foreach($user['configs'] as $config) {\n $updates = array_merge($updates, $config['updates']);\n }\n\n // Lists files into directory\n $folders = $userDir->find();\n // Loops every folder (should be named as update id)\n foreach($folders as $folder) {\n // Checks if name is present into uploads array\n if (!isset($updates[$folder]) || !$updates[$folder]) {\n $folder = new Folder($userDir->pwd() . DS . $folder, false);\n if($folder->path) {\n $folder->delete();\n }\n }\n }\n }\n }\n }\n }",
"function crushftp_update_ftp_folder_form_submit($form, &$form_state) {\n global $user;\n $path=\"/var/www/html/vsi-online-hr/ftp\";\n $ar=getDirectorySize($path); \n if ($handle = opendir('/var/www/html/vsi-online-hr/ftp')) {\n //echo \"Directory handle: $handle\\n\";\n //echo \"Entries:\\n\";\n // This is the correct way to loop over the directory. \n while (false !== ($entry = readdir($handle))) {\n //echo \"$entry :\";\n $path=\"/var/www/html/vsi-online-hr/ftp/$entry\"; \n $ar=getDirectorySize($path); \n $values = array('size' => sizeFormat($ar['size']));\n $return_value = NULL;\n // store crushftp details in crushftp databse in users table\n db_set_active('crushftp');\n try {\n $return_value = db_update('USERS')\n ->condition('username', $entry)\n ->fields ($values)\n ->execute();\n drupal_set_message(t('The FTP Folders are updated'));\n watchdog('crushftp', 'New crushftp user added (@user)', array('@user' => $user->uid), WATCHDOG_INFO);\n }\n catch (Exception $e) {\n drupal_set_message(t('db_insert failed. Message = %message, query= %query',\n array('%message' => $e->getMessage(), '%query' => $e->query_string)), 'error');\n } \n // Connecting to default drupal database.\n db_set_active();\n }\n closedir($handle);\n } \n}",
"function transferOwnership($oldUserId, $newUserId) {\n\t\t$submissionFiles =& $this->_getInternally(null, null, null, null, null, null, null, $oldUserId, null, null);\n\t\tforeach ($submissionFiles as $file) {\n\t\t\t$daoDelegate =& $this->_getDaoDelegateForObject($file);\n\t\t\t$file->setUploaderUserId($newUserId);\n\t\t\t$daoDelegate->updateObject($file, $file); // nothing else changes\n\t\t}\n\t}",
"function _update_userdata($userdata){\r\n $userdata = (array)$userdata;\r\n $userdata2['user_email'] = server(get_sso_option('user_email'));\r\n $nickname = server(get_option('sso_user_nickname'));\r\n if($nickname !== FALSE AND $nickname !== $userdata['nickname']) $userdata2['nickname'] = $nickname;\r\n $firstname = server(get_option('sso_user_firstname'));\r\n if($firstname !== FALSE AND $firstname !== $userdata['firstname']) $userdata2['first_name'] = $firstname;\r\n $lastname = server(get_option('sso_user_lastname'));\r\n if($lastname !== FALSE AND $lastname !== $userdata['lastname']) $userdata2['last_name'] = $lastname;\r\n\r\n update_user($userdata['ID'], (array)$userdata2);\r\n //require_once(WPINC . DIRECTORY_SEPARATOR . 'registration.php');\r\n //wp_update_user((array)$userdata);\r\n \r\n set_user_groups();\r\n}",
"function rename_folder()\n\t{\n\t\t$this->db->set('name', $this->input->post('edit_folder_name'));\n\t\t$this->db->where('id_folder', $this->input->post('id_folder'));\n\t\t$this->db->update('user_folders');\n\t}",
"public function changeOwner($path, $group = null, $user = null);",
"public function update(User $user, PortfolioCategory $portfolioCategory)\n {\n //\n }",
"protected function update_user_is () {\n\t\t$this->is_guest = $this->user_id == User::GUEST_ID;\n\t\t$this->is_user = false;\n\t\t$this->is_admin = false;\n\t\tif ($this->is_guest) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Checking of user type\n\t\t */\n\t\t$groups = User::instance()->get_groups($this->user_id) ?: [];\n\t\tif (in_array(User::ADMIN_GROUP_ID, $groups)) {\n\t\t\t$this->is_admin = true;\n\t\t\t$this->is_user = true;\n\t\t} elseif (in_array(User::USER_GROUP_ID, $groups)) {\n\t\t\t$this->is_user = true;\n\t\t}\n\t}",
"public function updateUser(array $config = []);"
]
| [
"0.57592154",
"0.5544456",
"0.5530402",
"0.5491209",
"0.5377705",
"0.5372368",
"0.5371325",
"0.5353898",
"0.53189975",
"0.5292237",
"0.5277547",
"0.5261769",
"0.5208596",
"0.5164006",
"0.5154794",
"0.5138336",
"0.5127323",
"0.5094131",
"0.5090181",
"0.5084386",
"0.50835055",
"0.5081844",
"0.50790316",
"0.5075722",
"0.50703925",
"0.5062282",
"0.5055635",
"0.5055424",
"0.5045114",
"0.5039881"
]
| 0.6122778 | 0 |
Gets the public 'doctrine.dbal.default_connection' shared service. | protected function getDoctrine_Dbal_DefaultConnectionService()
{
$a = new \Doctrine\DBAL\Logging\LoggerChain();
$a->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger(${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->services['logger'] = new \Symfony\Component\HttpKernel\Log\Logger()) && false ?: '_'}, NULL));
$a->addLogger(new \Doctrine\DBAL\Logging\DebugStack());
$b = new \Doctrine\DBAL\Configuration();
$b->setSQLLogger($a);
$c = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
$c->addEventListener(array(0 => 'loadClassMetadata'), ${($_ = isset($this->services['doctrine.orm.default_listeners.attach_entity_listeners']) ? $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] : $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] = new \Doctrine\ORM\Tools\AttachEntityListenersListener()) && false ?: '_'});
return $this->services['doctrine.dbal.default_connection'] = ${($_ = isset($this->services['doctrine.dbal.connection_factory']) ? $this->services['doctrine.dbal.connection_factory'] : $this->services['doctrine.dbal.connection_factory'] = new \Doctrine\Bundle\DoctrineBundle\ConnectionFactory(array())) && false ?: '_'}->createConnection(array('driver' => 'pdo_mysql', 'charset' => 'utf8mb4', 'url' => $this->getEnv('resolve:DATABASE_URL'), 'host' => 'localhost', 'port' => NULL, 'user' => 'root', 'password' => NULL, 'driverOptions' => array(), 'serverVersion' => '5.7', 'defaultTableOptions' => array('charset' => 'utf8mb4', 'collate' => 'utf8mb4_unicode_ci')), $b, $c, array());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultConnection()\n {\n return $this->getConnection('default');\n }",
"public function getDefaultConnection()\n {\n return $this->resolver->getDefaultConnection();\n }",
"public static function getConnection() {\n return self::$defaultConnection;\n }",
"public function getDefaultConnection(): Connection\n {\n return $this->getConnection($this->default);\n }",
"public function getDefaultConnection()\n {\n return $this->default;\n }",
"public static function getDefaultConnection(){\n return self::get_dba('default');\n\t}",
"public function getDefaultConnection()\n {\n return config::get('database.default');\n }",
"public function getDefaultConnection(): string;",
"public function getDefaultConnection(): string\n {\n return $this->app['config']['manticore.defaultConnection'];\n }",
"function getDefaultConnection()\n{\n\tglobal $cman;\n\treturn $cman->getDefault();\n}",
"public function getDefaultConnection(): string\n {\n return $this->default ?? '';\n }",
"protected function getDefaultConnection()\n {\n return $this->app['config']['quickbooks_manager.default_connection'];\n }",
"protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }",
"public function getDefaultConnectionName()\n {\n return $this->defaultConnection;\n }",
"public static function getDefaultConnection()\n {\n }",
"protected function getConnection()\n {\n $pdo = new PDO(DB_DSN, DB_USER, DB_PASS);\n return new DefaultConnection($pdo, DB_NAME);\n }",
"public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }",
"public function getDefaultConnection()\n {\n if (null === $this->defaultConnectionName) {\n throw new \\RuntimeException('There is not default connection name.');\n }\n\n if (!isset($this->connections[$this->defaultConnectionName])) {\n throw new \\RuntimeException(sprintf('The default connection \"%s\" does not exists.', $this->defaultConnectionName));\n }\n\n return $this->connections[$this->defaultConnectionName];\n }",
"function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getDefaultConnectionName(): string\n {\n return $this->default;\n }",
"public function getDefaultConnectionName()\n {\n return 'default';\n }",
"public function getDefaultConnection()\n {\n if (null !== $this->defaultConnectionName) {\n if (!isset($this->connections[$this->defaultConnectionName])) {\n throw new \\RuntimeException(sprintf('The default connection \"%s\" does not exists.', $this->defaultConnectionName));\n }\n\n $connection = $this->connections[$this->defaultConnectionName];\n } elseif (!$connection = reset($this->connections)) {\n throw new \\RuntimeException('There is not connections.');\n }\n\n return $connection;\n }",
"public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}",
"public function getDefaultConnectionName()\n {\n return $this->defaultConnectionName;\n }",
"public function getDefaultConnectionName()\n {\n return $this->defaultConnectionName;\n }",
"public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }",
"public function getDoctrineConnection()\n {\n $driver = $this->getDoctrineDriver ();\n $data = array (\n 'pdo' => $this->pdo,\n 'dbname' => $this->getConfig ( 'database' )\n );\n return new \\Doctrine\\DBAL\\Connection ( $data, $driver );\n }",
"public static function defaultConnectionName()\n {\n return 'default';\n }",
"public function getDoctrineConnection()\n {\n if(self::$doctrine_connection === null) {\n \n $config = new \\Doctrine\\DBAL\\Configuration();\n \n $connectionParams = array(\n 'dbname' => $GLOBALS['DB_DBNAME'],\n 'user' => $GLOBALS['DB_USER'],\n 'password' => $GLOBALS['DB_PASSWD'],\n 'host' => 'localhost',\n 'driver' => 'pdo_mysql',\n );\n \n self::$doctrine_connection = \\Doctrine\\DBAL\\DriverManager::getConnection($connectionParams, $config);\n }\n \n return self::$doctrine_connection;\n \n }",
"protected function getDatabaseConnection( )\n {\n if( sfConfig::get('sf_use_database') )\n {\n try\n {\n return Doctrine_Manager::connection();\n }\n catch( Doctrine_Connection_Exception $e )\n {\n new sfDatabaseManager(sfContext::getInstance()->getConfiguration());\n return Doctrine_Manager::connection();\n }\n }\n\n return null;\n }"
]
| [
"0.81350857",
"0.79463524",
"0.7825295",
"0.77760863",
"0.7753064",
"0.77185494",
"0.7701747",
"0.74805605",
"0.7440557",
"0.7440329",
"0.7239404",
"0.723882",
"0.7122834",
"0.70731086",
"0.70431226",
"0.70157063",
"0.6971493",
"0.6964537",
"0.6956631",
"0.6914261",
"0.68930346",
"0.6853388",
"0.6835133",
"0.6834074",
"0.6834074",
"0.68243164",
"0.6791901",
"0.6766311",
"0.675814",
"0.6733641"
]
| 0.8255185 | 0 |
Gets the public 'doctrine_cache.providers.doctrine.orm.default_metadata_cache' shared service. | protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()
{
$this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache();
$instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function defaultCache() : Repository\n {\n return Cache::store();\n }",
"public static function getDefaultCache()\n {\n return self::$_defaultCache;\n }",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }",
"public function getDefaultCacheStore(): Store|null;",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"protected function defaultShareProvider() {\n\t\tif ($this->defaultProvider === null) {\n\t\t\t$this->defaultProvider = new DefaultShareProvider(\n\t\t\t\t$this->serverContainer->getDatabaseConnection(),\n\t\t\t\t$this->serverContainer->getUserManager(),\n\t\t\t\t$this->serverContainer->getGroupManager(),\n\t\t\t\t$this->serverContainer->getLazyRootFolder(),\n\t\t\t\t$this->serverContainer->getMailer(),\n\t\t\t\t$this->serverContainer->query(Defaults::class),\n\t\t\t\t$this->serverContainer->getL10NFactory(),\n\t\t\t\t$this->serverContainer->getURLGenerator(),\n\t\t\t\t$this->serverContainer->getConfig()\n\t\t\t);\n\t\t}\n\n\t\treturn $this->defaultProvider;\n\t}",
"public function getDefaultCacheFactory(): ?Factory\n {\n return Cache::getFacadeRoot();\n }",
"protected function getLiipImagine_Cache_Resolver_DefaultService()\n {\n return $this->services['liip_imagine.cache.resolver.default'] = new \\Liip\\ImagineBundle\\Imagine\\Cache\\Resolver\\WebPathResolver($this->get('filesystem'), ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'}, ($this->targetDirs[3].'/app/../web'), 'media/cache');\n }",
"protected function getDoctrine_Dbal_DefaultConnectionService()\n {\n $a = new \\Doctrine\\DBAL\\Logging\\LoggerChain();\n $a->addLogger(new \\Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger(${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->services['logger'] = new \\Symfony\\Component\\HttpKernel\\Log\\Logger()) && false ?: '_'}, NULL));\n $a->addLogger(new \\Doctrine\\DBAL\\Logging\\DebugStack());\n\n $b = new \\Doctrine\\DBAL\\Configuration();\n $b->setSQLLogger($a);\n\n $c = new \\Symfony\\Bridge\\Doctrine\\ContainerAwareEventManager($this);\n $c->addEventListener(array(0 => 'loadClassMetadata'), ${($_ = isset($this->services['doctrine.orm.default_listeners.attach_entity_listeners']) ? $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] : $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] = new \\Doctrine\\ORM\\Tools\\AttachEntityListenersListener()) && false ?: '_'});\n\n return $this->services['doctrine.dbal.default_connection'] = ${($_ = isset($this->services['doctrine.dbal.connection_factory']) ? $this->services['doctrine.dbal.connection_factory'] : $this->services['doctrine.dbal.connection_factory'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ConnectionFactory(array())) && false ?: '_'}->createConnection(array('driver' => 'pdo_mysql', 'charset' => 'utf8mb4', 'url' => $this->getEnv('resolve:DATABASE_URL'), 'host' => 'localhost', 'port' => NULL, 'user' => 'root', 'password' => NULL, 'driverOptions' => array(), 'serverVersion' => '5.7', 'defaultTableOptions' => array('charset' => 'utf8mb4', 'collate' => 'utf8mb4_unicode_ci')), $b, $c, array());\n }",
"protected function getEntityManager()\n {\n $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n return $em;\n }",
"public function getDefaultDriver()\n {\n return Arr::get($this->container['config']['cache'], 'default');\n }",
"public function getDefaultManagerName()\n {\n return $this->entityManager;\n }",
"protected function getCache_AnnotationsService()\n {\n return $this->services['cache.annotations'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('o2NSV3WKIW', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }",
"protected function getDoctrine_Orm_DefaultEntityManagerService($lazyLoad = true)\n {\n $a = new \\Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriverChain();\n $a->addDriver(new \\Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver(${($_ = isset($this->services['annotation_reader']) ? $this->services['annotation_reader'] : $this->getAnnotationReaderService()) && false ?: '_'}, array(0 => ($this->targetDirs[3].'/src/Entity'))), 'App\\\\Entity');\n\n $b = new \\Doctrine\\ORM\\Configuration();\n $b->setEntityNamespaces(array('App' => 'App\\\\Entity'));\n $b->setMetadataCacheImpl(${($_ = isset($this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache']) ? $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] : $this->getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()) && false ?: '_'});\n $b->setQueryCacheImpl(${($_ = isset($this->services['doctrine_cache.providers.doctrine.orm.default_query_cache']) ? $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] : $this->getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()) && false ?: '_'});\n $b->setResultCacheImpl(${($_ = isset($this->services['doctrine_cache.providers.doctrine.orm.default_result_cache']) ? $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] : $this->getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()) && false ?: '_'});\n $b->setMetadataDriverImpl($a);\n $b->setProxyDir(($this->targetDirs[0].'/doctrine/orm/Proxies'));\n $b->setProxyNamespace('Proxies');\n $b->setAutoGenerateProxyClasses(true);\n $b->setClassMetadataFactoryName('Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataFactory');\n $b->setDefaultRepositoryClassName('Doctrine\\\\ORM\\\\EntityRepository');\n $b->setNamingStrategy(new \\Doctrine\\ORM\\Mapping\\UnderscoreNamingStrategy());\n $b->setQuoteStrategy(new \\Doctrine\\ORM\\Mapping\\DefaultQuoteStrategy());\n $b->setEntityListenerResolver(${($_ = isset($this->services['doctrine.orm.default_entity_listener_resolver']) ? $this->services['doctrine.orm.default_entity_listener_resolver'] : $this->services['doctrine.orm.default_entity_listener_resolver'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Mapping\\ContainerAwareEntityListenerResolver($this)) && false ?: '_'});\n $b->setRepositoryFactory(new \\Doctrine\\Bundle\\DoctrineBundle\\Repository\\ContainerRepositoryFactory(new \\Symfony\\Component\\DependencyInjection\\ServiceLocator(array('App\\\\Repository\\\\TestRepository' => function () {\n return ${($_ = isset($this->services['App\\Repository\\TestRepository']) ? $this->services['App\\Repository\\TestRepository'] : $this->load('getTestRepositoryService.php')) && false ?: '_'};\n }))));\n\n $this->services['doctrine.orm.default_entity_manager'] = $instance = \\Doctrine\\ORM\\EntityManager::create(${($_ = isset($this->services['doctrine.dbal.default_connection']) ? $this->services['doctrine.dbal.default_connection'] : $this->getDoctrine_Dbal_DefaultConnectionService()) && false ?: '_'}, $b);\n\n ${($_ = isset($this->services['doctrine.orm.default_manager_configurator']) ? $this->services['doctrine.orm.default_manager_configurator'] : $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array())) && false ?: '_'}->configure($instance);\n\n return $instance;\n }",
"public function getDoctrine_Orm_DefaultEntityManagerService($lazyLoad = true)\n {\n if ($lazyLoad) {\n\n return $this->services['doctrine.orm.default_entity_manager'] = DoctrineORMEntityManager_00000000428690af0000000049de23ef3bf08b917554782eb259376febf5d820::staticProxyConstructor(\n function (&$wrappedInstance, \\ProxyManager\\Proxy\\LazyLoadingInterface $proxy) {\n $wrappedInstance = $this->getDoctrine_Orm_DefaultEntityManagerService(false);\n\n $proxy->setProxyInitializer(null);\n\n return true;\n }\n );\n }\n\n $a = $this->get('annotation_reader');\n\n $b = new \\Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver($a, array(0 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/AnalyticsBundle/Entity'), 1 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Entity'), 2 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessEntityBundle/Entity'), 3 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Entity'), 4 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CoreBundle/Entity'), 5 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CriteriaBundle/Entity'), 6 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/I18nBundle/Entity'), 7 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Entity'), 8 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Entity'), 9 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/QueryBundle/Entity'), 10 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SeoBundle/Entity'), 11 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Entity'), 12 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TwigBundle/Entity'), 13 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Entity'), 14 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/WidgetBundle/Entity'), 15 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/WidgetMapBundle/Entity')));\n\n $c = new \\Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriverChain();\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\AnalyticsBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\BlogBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\BusinessEntityBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\BusinessPageBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\CoreBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\CriteriaBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\I18nBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\MediaBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\PageBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\QueryBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\SeoBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\TemplateBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\TwigBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\UserBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\WidgetBundle\\\\Entity');\n $c->addDriver($b, 'Victoire\\\\Bundle\\\\WidgetMapBundle\\\\Entity');\n $c->addDriver(new \\Doctrine\\ORM\\Mapping\\Driver\\XmlDriver(new \\Doctrine\\Common\\Persistence\\Mapping\\Driver\\SymfonyFileLocator(array(($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/config/doctrine-mapping') => 'FOS\\\\UserBundle\\\\Model'), '.orm.xml')), 'FOS\\\\UserBundle\\\\Model');\n\n $d = new \\Doctrine\\ORM\\Configuration();\n $d->setEntityNamespaces(array('VictoireAnalyticsBundle' => 'Victoire\\\\Bundle\\\\AnalyticsBundle\\\\Entity', 'VictoireBlogBundle' => 'Victoire\\\\Bundle\\\\BlogBundle\\\\Entity', 'VictoireBusinessEntityBundle' => 'Victoire\\\\Bundle\\\\BusinessEntityBundle\\\\Entity', 'VictoireBusinessPageBundle' => 'Victoire\\\\Bundle\\\\BusinessPageBundle\\\\Entity', 'VictoireCoreBundle' => 'Victoire\\\\Bundle\\\\CoreBundle\\\\Entity', 'VictoireCriteriaBundle' => 'Victoire\\\\Bundle\\\\CriteriaBundle\\\\Entity', 'VictoireI18nBundle' => 'Victoire\\\\Bundle\\\\I18nBundle\\\\Entity', 'VictoireMediaBundle' => 'Victoire\\\\Bundle\\\\MediaBundle\\\\Entity', 'VictoirePageBundle' => 'Victoire\\\\Bundle\\\\PageBundle\\\\Entity', 'VictoireQueryBundle' => 'Victoire\\\\Bundle\\\\QueryBundle\\\\Entity', 'VictoireSeoBundle' => 'Victoire\\\\Bundle\\\\SeoBundle\\\\Entity', 'VictoireTemplateBundle' => 'Victoire\\\\Bundle\\\\TemplateBundle\\\\Entity', 'VictoireTwigBundle' => 'Victoire\\\\Bundle\\\\TwigBundle\\\\Entity', 'VictoireUserBundle' => 'Victoire\\\\Bundle\\\\UserBundle\\\\Entity', 'VictoireWidgetBundle' => 'Victoire\\\\Bundle\\\\WidgetBundle\\\\Entity', 'VictoireWidgetMapBundle' => 'Victoire\\\\Bundle\\\\WidgetMapBundle\\\\Entity'));\n $d->setMetadataCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_metadata_cache'));\n $d->setQueryCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_query_cache'));\n $d->setResultCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_result_cache'));\n $d->setMetadataDriverImpl($c);\n $d->setProxyDir((__DIR__.'/doctrine/orm/Proxies'));\n $d->setProxyNamespace('Proxies');\n $d->setAutoGenerateProxyClasses(false);\n $d->setClassMetadataFactoryName('Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataFactory');\n $d->setDefaultRepositoryClassName('Doctrine\\\\ORM\\\\EntityRepository');\n $d->setNamingStrategy(new \\Doctrine\\ORM\\Mapping\\UnderscoreNamingStrategy());\n $d->setQuoteStrategy(new \\Doctrine\\ORM\\Mapping\\DefaultQuoteStrategy());\n $d->setEntityListenerResolver($this->get('doctrine.orm.default_entity_listener_resolver'));\n\n $instance = \\Doctrine\\ORM\\EntityManager::create($this->get('doctrine.dbal.default_connection'), $d);\n\n $this->get('doctrine.orm.default_manager_configurator')->configure($instance);\n\n return $instance;\n }",
"public final function getSystemDoctrineService(): DoctrineService\n {\n return $this->systemDoctrineService;\n }",
"protected function getCache_DefaultClearerService()\n {\n $this->services['cache.default_clearer'] = $instance = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer();\n\n $instance->addPool($this->get('cache.app'));\n $instance->addPool($this->get('cache.system'));\n $instance->addPool(${($_ = isset($this->services['cache.validator']) ? $this->services['cache.validator'] : $this->getCache_ValidatorService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.serializer']) ? $this->services['cache.serializer'] : $this->getCache_SerializerService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.annotations']) ? $this->services['cache.annotations'] : $this->getCache_AnnotationsService()) && false ?: '_'});\n\n return $instance;\n }",
"protected function _getMetadataModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_MetadataEssential_Model_Metadata');\n\t}",
"private static function get_default_cache_tag()\n {\n return CacheableConfig::is_running_test() ? CACHEABLE_STORE_TAG_DEFAULT_TEST : CACHEABLE_STORE_TAG_DEFAULT;\n }",
"public static function getCache() {\n\t\treturn null;\n\t}",
"protected function getDoctrineService()\n {\n return $this->services['doctrine'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Registry($this, array('default' => 'doctrine.dbal.default_connection'), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default');\n }",
"protected function getDoctrine_Orm_DefaultEntityManager_PropertyInfoExtractorService()\n {\n return $this->services['doctrine.orm.default_entity_manager.property_info_extractor'] = new \\Symfony\\Bridge\\Doctrine\\PropertyInfo\\DoctrineExtractor($this->get('doctrine.orm.default_entity_manager')->getMetadataFactory());\n }",
"public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}",
"public function getManagedCache()\r\n\t{\r\n\t\tif ($this->managedCache == null)\r\n\t\t\t$this->managedCache = new \\Bitrix\\Main\\Data\\ManagedCache();\r\n\t\treturn $this->managedCache;\r\n\t}"
]
| [
"0.853291",
"0.75862014",
"0.7562599",
"0.72116524",
"0.71779937",
"0.6434227",
"0.634034",
"0.609408",
"0.6056222",
"0.5939375",
"0.5939375",
"0.5705965",
"0.56817466",
"0.56808627",
"0.5647003",
"0.5617541",
"0.56172186",
"0.5580735",
"0.5568569",
"0.55595183",
"0.5544308",
"0.552706",
"0.54981244",
"0.545925",
"0.5447604",
"0.54423094",
"0.5411007",
"0.54021955",
"0.539255",
"0.5382701"
]
| 0.85365456 | 0 |
Gets the public 'doctrine_cache.providers.doctrine.orm.default_query_cache' shared service. | protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()
{
$this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache();
$instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function defaultCache() : Repository\n {\n return Cache::store();\n }",
"public static function getDefaultCache()\n {\n return self::$_defaultCache;\n }",
"protected function getQueryCacheImpl(): CacheItemPoolInterface\n {\n return new NullAdapter();\n }",
"public function getDefaultCacheStore(): Store|null;",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }",
"protected function getCache_DefaultClearerService()\n {\n $this->services['cache.default_clearer'] = $instance = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer();\n\n $instance->addPool($this->get('cache.app'));\n $instance->addPool($this->get('cache.system'));\n $instance->addPool(${($_ = isset($this->services['cache.validator']) ? $this->services['cache.validator'] : $this->getCache_ValidatorService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.serializer']) ? $this->services['cache.serializer'] : $this->getCache_SerializerService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.annotations']) ? $this->services['cache.annotations'] : $this->getCache_AnnotationsService()) && false ?: '_'});\n\n return $instance;\n }",
"protected function getDoctrine_Dbal_DefaultConnectionService()\n {\n $a = new \\Doctrine\\DBAL\\Logging\\LoggerChain();\n $a->addLogger(new \\Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger(${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->services['logger'] = new \\Symfony\\Component\\HttpKernel\\Log\\Logger()) && false ?: '_'}, NULL));\n $a->addLogger(new \\Doctrine\\DBAL\\Logging\\DebugStack());\n\n $b = new \\Doctrine\\DBAL\\Configuration();\n $b->setSQLLogger($a);\n\n $c = new \\Symfony\\Bridge\\Doctrine\\ContainerAwareEventManager($this);\n $c->addEventListener(array(0 => 'loadClassMetadata'), ${($_ = isset($this->services['doctrine.orm.default_listeners.attach_entity_listeners']) ? $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] : $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] = new \\Doctrine\\ORM\\Tools\\AttachEntityListenersListener()) && false ?: '_'});\n\n return $this->services['doctrine.dbal.default_connection'] = ${($_ = isset($this->services['doctrine.dbal.connection_factory']) ? $this->services['doctrine.dbal.connection_factory'] : $this->services['doctrine.dbal.connection_factory'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ConnectionFactory(array())) && false ?: '_'}->createConnection(array('driver' => 'pdo_mysql', 'charset' => 'utf8mb4', 'url' => $this->getEnv('resolve:DATABASE_URL'), 'host' => 'localhost', 'port' => NULL, 'user' => 'root', 'password' => NULL, 'driverOptions' => array(), 'serverVersion' => '5.7', 'defaultTableOptions' => array('charset' => 'utf8mb4', 'collate' => 'utf8mb4_unicode_ci')), $b, $c, array());\n }",
"public function setGeneralDefaultQuery()\n {\n return $this;\n }",
"protected function getLiipImagine_Cache_Resolver_DefaultService()\n {\n return $this->services['liip_imagine.cache.resolver.default'] = new \\Liip\\ImagineBundle\\Imagine\\Cache\\Resolver\\WebPathResolver($this->get('filesystem'), ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'}, ($this->targetDirs[3].'/app/../web'), 'media/cache');\n }",
"public function getDefaultCacheFactory(): ?Factory\n {\n return Cache::getFacadeRoot();\n }",
"public function getDefaultDriver()\n {\n return Arr::get($this->container['config']['cache'], 'default');\n }",
"public final function getSystemDoctrineService(): DoctrineService\n {\n return $this->systemDoctrineService;\n }",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"public function getDefaultQuery()\n {\n return $this->model->newQuery()->where(function ($q) {\n $q->whereNull('team_id');\n $q->orWhere('team_id', app(ActiveTeam::class)->get()->id);\n });\n }",
"public static function getDefaultDriver(){\n return \\Illuminate\\Cache\\CacheManager::getDefaultDriver();\n }",
"protected function defaultShareProvider() {\n\t\tif ($this->defaultProvider === null) {\n\t\t\t$this->defaultProvider = new DefaultShareProvider(\n\t\t\t\t$this->serverContainer->getDatabaseConnection(),\n\t\t\t\t$this->serverContainer->getUserManager(),\n\t\t\t\t$this->serverContainer->getGroupManager(),\n\t\t\t\t$this->serverContainer->getLazyRootFolder(),\n\t\t\t\t$this->serverContainer->getMailer(),\n\t\t\t\t$this->serverContainer->query(Defaults::class),\n\t\t\t\t$this->serverContainer->getL10NFactory(),\n\t\t\t\t$this->serverContainer->getURLGenerator(),\n\t\t\t\t$this->serverContainer->getConfig()\n\t\t\t);\n\t\t}\n\n\t\treturn $this->defaultProvider;\n\t}",
"protected function getDefaultQueryCompiler()\n {\n return $this->withTablePrefix(new MsSQLCompiler());\n }",
"private static function get_default_cache_tag()\n {\n return CacheableConfig::is_running_test() ? CACHEABLE_STORE_TAG_DEFAULT_TEST : CACHEABLE_STORE_TAG_DEFAULT;\n }",
"protected function getQueryServiceName() {\n return 'entity.query.null';\n }",
"protected function getCache_SystemService()\n {\n return $this->services['cache.system'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('oF4uGKF1Zr', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }",
"protected function getDoctrineService()\n {\n return $this->services['doctrine'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Registry($this, array('default' => 'doctrine.dbal.default_connection'), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default');\n }",
"public static function hasDefaultCache();",
"public static function get($key, $default = null){\n return \\Illuminate\\Cache\\Repository::get($key, $default);\n }",
"public function getFilterCache($entity, $default=array())\n {\n $cacheId = $this->getCacheId();\n if (isset($this->filterCache[$cacheId][$entity])) {\n return $this->filterCache[$cacheId][$entity];\n }\n return $default;\n }"
]
| [
"0.86607194",
"0.76459724",
"0.76295567",
"0.73168004",
"0.7298351",
"0.6500934",
"0.6238524",
"0.59537226",
"0.5944275",
"0.58803606",
"0.58335924",
"0.5699514",
"0.5644874",
"0.5579449",
"0.5557641",
"0.5508757",
"0.54441965",
"0.5409987",
"0.5409987",
"0.5357156",
"0.5318416",
"0.53136593",
"0.53022605",
"0.5296984",
"0.52939785",
"0.52640927",
"0.5200058",
"0.51894116",
"0.51535064",
"0.5153271"
]
| 0.8665333 | 0 |
Gets the public 'doctrine_cache.providers.doctrine.orm.default_result_cache' shared service. | protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()
{
$this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache();
$instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function defaultCache() : Repository\n {\n return Cache::store();\n }",
"public static function getDefaultCache()\n {\n return self::$_defaultCache;\n }",
"protected function getLiipImagine_Cache_Resolver_DefaultService()\n {\n return $this->services['liip_imagine.cache.resolver.default'] = new \\Liip\\ImagineBundle\\Imagine\\Cache\\Resolver\\WebPathResolver($this->get('filesystem'), ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'}, ($this->targetDirs[3].'/app/../web'), 'media/cache');\n }",
"protected function getCache_DefaultClearerService()\n {\n $this->services['cache.default_clearer'] = $instance = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer();\n\n $instance->addPool($this->get('cache.app'));\n $instance->addPool($this->get('cache.system'));\n $instance->addPool(${($_ = isset($this->services['cache.validator']) ? $this->services['cache.validator'] : $this->getCache_ValidatorService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.serializer']) ? $this->services['cache.serializer'] : $this->getCache_SerializerService()) && false ?: '_'});\n $instance->addPool(${($_ = isset($this->services['cache.annotations']) ? $this->services['cache.annotations'] : $this->getCache_AnnotationsService()) && false ?: '_'});\n\n return $instance;\n }",
"public function getResultService()\n {\n return $this->container->get('seip.service.result');\n }",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }",
"protected function getQueryCacheImpl(): CacheItemPoolInterface\n {\n return new NullAdapter();\n }",
"public function getDefaultCacheFactory(): ?Factory\n {\n return Cache::getFacadeRoot();\n }",
"public function getDefaultCacheStore(): Store|null;",
"public static function get($key, $default = null){\n return \\Illuminate\\Cache\\Repository::get($key, $default);\n }",
"public function getDefaultDriver()\n {\n return Arr::get($this->container['config']['cache'], 'default');\n }",
"protected function getRouting_ResourcesLocator_DefaultService()\n {\n return $this->services['routing.resources_locator.default'] = new \\phpbb\\routing\\resources_locator\\default_resources_locator('./../', 'production', ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n }",
"private function _readDefaultCache() {\n $settingFile = APPLICATION_PATH . '/application/settings/restapi_cache.php';\n $defaultFilePath = APPLICATION_PATH . '/temporary/restapicache';\n\n if (file_exists($settingFile)) {\n $currentCache = include $settingFile;\n } else {\n $currentCache = array(\n 'default_backend' => 'File',\n 'frontend' => array(\n 'automatic_serialization' => true,\n 'cache_id_prefix' => 'Engine4_restapi',\n 'lifetime' => '300',\n 'caching' => true,\n 'status' => true,\n 'gzip' => true,\n ),\n 'backend' => array(\n 'File' => array(\n 'file_locking' => true,\n 'cache_dir' => APPLICATION_PATH . '/temporary/restapicache',\n ),\n ),\n );\n }\n $currentCache['default_file_path'] = $defaultFilePath;\n\n return $currentCache;\n }",
"public static function getDefaultDriver(){\n return \\Illuminate\\Cache\\CacheManager::getDefaultDriver();\n }",
"public function result($key = NULL, $default = 0)\n\t{\n\t\tif (is_null($this->_result)) return NULL;\n\n\t\tif (isset($key))\n\t\t{\n\t\t\treturn array_get($this->_result, $key, $default);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_result;\t\n\t\t}\n\t}",
"public function getCache();",
"public function getFromCache($key, $default_return=null){\n $cached_response= Cache::get($key);\n return (bool)$cached_response ? $cached_response : $default_return;\n }",
"public function getResults($default = false)\n\t{\n\t\treturn count($this->_results) ? $this->_results : $default;\n\t}",
"private static function get_default_cache_tag()\n {\n return CacheableConfig::is_running_test() ? CACHEABLE_STORE_TAG_DEFAULT_TEST : CACHEABLE_STORE_TAG_DEFAULT;\n }",
"protected function getCacheService()\n {\n return $this->services['cache'] = new \\phpbb\\cache\\service(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, './../', 'php');\n }",
"public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }",
"public static function hasDefaultCache();",
"public function getCaching()\n {\n return (!is_null($this->_cache) ? $this->_cache : Cache::instance('redis'));\n }",
"public static function getCache() {\n\t\treturn null;\n\t}",
"protected function getCache_SystemService()\n {\n return $this->services['cache.system'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('oF4uGKF1Zr', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }"
]
| [
"0.86435807",
"0.76219445",
"0.76211333",
"0.6833611",
"0.6819532",
"0.6507174",
"0.6368295",
"0.6008313",
"0.5956899",
"0.5604679",
"0.548948",
"0.5455574",
"0.544233",
"0.5436743",
"0.5431846",
"0.54301",
"0.5398462",
"0.539615",
"0.53681433",
"0.5363936",
"0.5323601",
"0.5319066",
"0.5316195",
"0.5313002",
"0.5290819",
"0.5243258",
"0.52425796",
"0.52420807",
"0.522727",
"0.5225503"
]
| 0.86590713 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.