query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
/ Chat helper functions.
function render_active_members($sql){ $members = $sql->QueryItem( "select count(*) from ppl_online where member = true AND activity > (now() - CAST('30 minutes' AS interval))"); $membersTotal = $sql->QueryItem("select count(*) from ppl_online where member = true"); return "<div class='active-members-count'> Active Members: ".($members?$members : '0')." / ".($membersTotal?$membersTotal : '0')." </div>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function chat( $charac = Hello) {\n }", "public static function chatbot()\n {\n // no code needed.\n }", "public function chat_exec()\r\n {\r\n if(isset($_POST['method']) === true && empty($_POST['method']) === false){\r\n $method = trim($_POST['method']);\r\n if($method === 'fetch'){\r\n $messages = $this->Ajax->fetchMessages();\r\n if(empty($messages) === true){\r\n echo 'There are currently no messages in the chat';\r\n } else {\r\n foreach ($messages as $message){?>\r\n <div class=\"message\"><?php\r\n if(strlen($message['user_id']) === 10){?>\r\n <a href=\"#\"><?=Sessions::get('user')?></a> says:<?php\r\n }else{ ?>\r\n <a href=\"#\"><?=$message['username']?></a> says:<?php\r\n }?>\r\n <p><?=nl2br($message['message'])?></p>\r\n </div><?php \r\n }\r\n }\r\n }else if($method === 'throw' && isset($_POST['message']) === true){\r\n $message = trim($_POST['message']);\r\n if(empty($message) === false){\r\n $arrData = array('user' => $_SESSION['user_id'], 'message' => $message);\r\n $this->Ajax->throwMessage($arrData);\r\n }\r\n }\r\n }\r\n }", "public function chat()\n {\n $errors = [];\n $formValid = false;\n $params = [\n // dans la vue, les clés deviennent des variables\n 'formValid' => $formValid,\n 'errors' => $errors,\n ];\n\n // Affichage du chat seulement si connecté\n if(!empty($this->getUser())){\n $this->show('chat/chat', $params);\n }\n else{{\n $this->showNotFound(); // sinon page 404\n }}\n\n }", "function playerChat($chat) {\n\n\t\t// verify login\n\t\tif ($chat[1] == '' || $chat[1] == '???') {\n\t\t\ttrigger_error('playerUid ' . $chat[0] . 'has login [' . $chat[1] . ']!', E_USER_WARNING);\n\t\t\t$this->console('playerUid {1} attempted to use chat command \"{2}\"',\n\t\t\t $chat[0], $chat[2]);\n\t\t\treturn;\n\t\t}\n\n\t\t// ignore master server messages on relay\n\t\tif ($this->server->isrelay && $chat[1] == $this->server->relaymaster['Login'])\n\t\t\treturn;\n\n\t\t// check for chat command '/' prefix\n\t\t$command = $chat[2];\n\t\tif ($command != '' && $command[0] == '/') {\n\t\t\t// remove '/' prefix\n\t\t\t$command = substr($command, 1);\n\n\t\t\t// split strings at spaces and add them into an array\n\t\t\t$params = explode(' ', $command, 2);\n\t\t\t$translated_name = str_replace('+', 'plus', $params[0]);\n\t\t\t$translated_name = str_replace('-', 'dash', $translated_name);\n\n\t\t\t// check if the function and the command exist\n\t\t\tif (function_exists('chat_' . $translated_name)) {\n\t\t\t\t// insure parameter exists & is trimmed\n\t\t\t\tif (isset($params[1]))\n\t\t\t\t\t$params[1] = trim($params[1]);\n\t\t\t\telse\n\t\t\t\t\t$params[1] = '';\n\n\t\t\t\t// get & verify player object\n\t\t\t\tif (($author = $this->server->players->getPlayer($chat[1])) &&\n\t\t\t\t $author->login != '') {\n\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('player {1} used chat command \"/{2} {3}\"',\n\t\t\t\t\t $chat[1], $params[0], $params[1]);\n\n\t\t\t\t\t// save circumstances in array\n\t\t\t\t\t$chat_command = array();\n\t\t\t\t\t$chat_command['author'] = $author;\n\t\t\t\t\t$chat_command['params'] = $params[1];\n\t\n\t\t\t\t\t// call the function which belongs to the command\n\t\t\t\t\tcall_user_func('chat_' . $translated_name, $this, $chat_command);\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error('Player object for \\'' . $chat[1] . '\\' not found!', E_USER_WARNING);\n\t\t\t\t\t$this->console('player {1} attempted to use chat command \"/{2} {3}\"',\n\t\t\t\t\t $chat[1], $params[0], $params[1]);\n\t\t\t\t}\n\t\t\t} elseif ($params[0] == 'version' || $params[0] == 'serverlogin') {\n\t\t\t\t// log built-in commands\n\t\t\t\t$this->console('player {1} used built-in command \"/{2}\"',\n\t\t\t\t $chat[1], $command);\n\t\t\t} else {\n\t\t\t\t// optionally log bogus chat commands too\n\t\t\t\tif ($this->settings['log_all_chat']) {\n\t\t\t\t\tif ($chat[0] != $this->server->id) {\n\t\t\t\t\t\t$this->console('({1}) {2}', $chat[1], stripColors($chat[2], false));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// optionally log all normal chat too\n\t\t\tif ($this->settings['log_all_chat']) {\n\t\t\t\tif ($chat[0] != $this->server->id && $chat[2] != '') {\n\t\t\t\t\t$this->console('({1}) {2}', $chat[1], stripColors($chat[2], false));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getChatMessage($name) {\n\n\t\treturn htmlspecialchars_decode($this->chat_messages[$name][0]);\n\t}", "function render_chat_messages($sql, $chatlength, $show_elipsis=null){\n // Eventually there might be a reason to abstract out get_chats();\n $sql->Query(\"SELECT send_from, message FROM chat ORDER BY id DESC LIMIT $chatlength\");// Pull messages\n $chats = $sql->fetchAll();\n $message_rows = '';\n $messageCount = $sql->QueryItem(\"select count(*) from chat\");\n if (!isset($show_elipsis) && $messageCount>$chatlength){\n\t$show_elipsis = true;\n }\n $res = \"<div class='chatMessages'>\";\n foreach($chats AS $messageData) {\n\t// *** PROBABLY ALSO A SPEED PROBLEM AREA.\n\t$message_rows .= \"[<a href='player.php?player={$messageData['send_from']}'\n\t target='main'>{$messageData['send_from']}</a>]: \".out($messageData['message']).\"<br>\\n\";\n }\n $res .= $message_rows;\n if ($show_elipsis){ // to indicate there are more chats available\n\t$res .= \".<br>.<br>.<br>\";\n }\n $res .= \"</div>\";\n return $res;\n}", "function playerChat($chat) {\n\n\t\t// check for chat command ...\n\t\t$command = $chat[2];\n\t\tif (substr($command, 0, 1) == '/') {\n\n\t\t\t// remove the '/' prefix ...\n\t\t\t$command = substr($command, 1);\n\t\t\t// split strings at spaces and add them into an array ...\n\t\t\t$params = explode(' ', $command, 2);\n\n\t\t\t$translated_name = str_replace('+', 'plus', $params[0]);\n\t\t\t$translated_name = str_replace('-', 'dash', $translated_name);\n\n\t\t\t// if the function and the command were registered ...\n\t\t\tif (function_exists('chat_' . $translated_name)) {\n\n\t\t\t\t// show message in console ...\n\t\t\t\t$this->console('{1} used chat command \"{2} {3}\"',\n\t\t\t\t\t$chat[1],\n\t\t\t\t\t$params[0],\n\t\t\t\t\t$params[1]);\n\n\t\t\t\t// save curricumstances in array ...\n\t\t\t\t$chat_command['author'] = $this->server->players->getPlayer($chat[1]);\n\t\t\t\t$chat_command['params'] = $params[1];\n\n\t\t\t\t// call the function which belongs to the command ...\n\t\t\t\tcall_user_func('chat_' . $translated_name, $this, $chat_command);\n\t\t\t}\n\t\t}\n\t}", "function chat_lese(\n $o_id,\n $raum,\n $u_id,\n $sysmsg,\n $ignore,\n $back,\n $nur_privat = FALSE,\n $nur_privat_user = \"\")\n{\n // $raum = ID des aktuellen Raums\n // $u_id = ID des aktuellen Users\n \n global $dbase, $user_farbe, $letzte_id, $chat, $system_farbe, $t, $chat_status_klein, $admin;\n global $u_farbe_alle, $u_farbe_noise, $u_farbe_priv, $u_farbe_sys, $u_farbe_bg, $u_nick, $u_level, $u_smilie, $u_systemmeldungen;\n global $show_spruch_owner, $farbe_user_fest, $id, $http_host;\n global $user_nick, $conn;\n \n // Systemfarbe setzen\n if ($u_farbe_sys != \"-\")\n $system_farbe = $u_farbe_sys;\n \n // Workaround, falls User in Community ist\n if (!$raum)\n $raum = \"-1\";\n \n // Voreinstellung\n $text_ausgegeben = FALSE;\n $erste_zeile = TRUE;\n $br = \"<BR>\\n\";\n $qquery = \"\";\n \n // Optional keine Systemnachrichten\n if (!$sysmsg)\n $qquery .= \" AND c_typ!='S'\";\n \n // Optional keine öffentlichen oder versteckten Nachrichten\n if ($nur_privat)\n $qquery .= \" AND c_typ!='H' AND c_typ!='N'\";\n \n if ($nur_privat_user) {\n #echo \"nur_privat_user ist gesetzt! $nur_privat_user | $u_id\";\n $txt = \"<b>$u_nick flüstert an \" . $user_nick . \":</b>\";\n $len = strlen($txt);\n #print $txt;\n $qquery .= \" AND (c_an_user = '$u_id' and c_von_user_id != '0' and ( (c_von_user_id = '$u_id' and left(c_text,$len) = '$txt') or c_von_user_id = '$nur_privat_user') )\";\n #print htmlentities($qquery);\n }\n if ($back == 1) {\n \n // o_chat_id lesen\n $query = \"SELECT HIGH_PRIORITY o_chat_id FROM online WHERE o_id=$o_id\";\n $result = mysql_query($query, $conn);\n if ($result && mysql_num_rows($result) == 1) {\n $o_chat_id = mysql_result($result, 0, \"o_chat_id\");\n } else {\n $o_chat_id = 0;\n }\n ;\n mysql_free_result($result);\n \n // Nachrichten ab o_chat_id (Merker) in Tabelle online ausgeben\n // Nur Nachrichten im aktuellen Raum anzeigen, außer Typ P oder S und an User adressiert\n $query = \"SELECT c_id FROM chat WHERE c_raum='$raum' AND c_id >= $o_chat_id\"\n . $qquery;\n \n unset($rows);\n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n mysql_free_result($result);\n \n $query = \"SELECT c_id FROM chat WHERE c_typ IN ('P','S') AND c_an_user=$u_id AND c_id >= $o_chat_id\"\n . $qquery;\n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n mysql_free_result($result);\n if (isset($rows) && is_array($rows))\n sort($rows);\n \n } elseif ($back > 1) {\n \n // o_chat_id lesen (nicht bei Admins)\n // Admins dürfen alle Nachrichten sehen\n if (!$admin) {\n $query = \"SELECT HIGH_PRIORITY o_chat_id FROM online WHERE o_id=$o_id\";\n $result = mysql_query($query, $conn);\n if ($result && mysql_num_rows($result) == 1) {\n $o_chat_id = mysql_result($result, 0, \"o_chat_id\");\n } else {\n $o_chat_id = 0;\n }\n ;\n mysql_free_result($result);\n } else {\n $o_chat_id = 0;\n }\n \n // $back-Zeilen in Tabelle online ausgeben, höchstens aber ab o_chat_id\n // Nur Nachrichten im aktuellen Raum anzeigen, außer Typ P oder S und an User adressiert\n $query = \"SELECT c_id FROM chat WHERE c_raum='$raum' AND c_id >= $o_chat_id\"\n . $qquery;\n \n unset($rows);\n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n mysql_free_result($result);\n \n $query = \"SELECT c_id FROM chat WHERE c_typ IN ('P','S') AND c_an_user=$u_id AND c_id >= $o_chat_id\"\n . $qquery;\n \n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n mysql_free_result($result);\n if (isset($rows) && is_array($rows))\n sort($rows);\n \n // Erste Zeile ausrechnen, ab der Nachrichten ausgegeben werden\n // Chat-Zeilen vor $o_chat_id löschen\n if (isset($rows)) {\n $zeilen = count($rows);\n } else {\n $zeilen = 0;\n }\n if ($zeilen > $back) {\n $o_chat_id = $rows[($zeilen - intval($back))];\n foreach ($rows as $key => $value) {\n if ($value < $o_chat_id) {\n unset($rows[$key]);\n }\n }\n }\n \n } else {\n \n // Die letzten Nachrichten seit $letzte_id ausgeben\n // Nur Nachrichten im aktuellen Raum anzeigen, außer Typ P oder S und an User adressiert\n $query = \"SELECT c_id FROM chat WHERE c_raum=$raum AND c_id > $letzte_id\"\n . $qquery;\n \n unset($rows);\n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n @mysql_free_result($result);\n \n $query = \"SELECT c_id FROM chat WHERE c_typ IN ('P','S') AND c_an_user=$u_id AND c_id > $letzte_id\"\n . $qquery;\n \n $result = mysql_query($query, $conn);\n if ($result) {\n while ($row = mysql_fetch_row($result)) {\n $rows[] = $row[0];\n }\n }\n @mysql_free_result($result);\n if (isset($rows) && is_array($rows))\n sort($rows);\n \n }\n \n // + für regulären Ausdruck filtern\n $nick = str_replace(\"+\", \"\\\\+\", $u_nick);\n \n // Query aus Array erzeugen und die Chatzeilen lesen\n if (isset($rows) && is_array($rows)) {\n $query = \"SELECT * FROM chat WHERE c_id IN (\" . implode(\",\", $rows)\n . \") ORDER BY c_id\";\n $result = mysql_query($query, $conn);\n } else {\n unset($result);\n }\n \n // Nachrichten zeilenweise ausgeben\n if (isset($result) && $result) {\n \n $text_weitergabe = \"\";\n while ($row = mysql_fetch_object($result)) {\n \n // Falls ID ignoriert werden soll -> Ausgabe überspringen\n // Falls noch kein Text ausgegeben wurde und es eine Zeile in \n // der Mitte oder am Ende einer Serie ist -> Ausgabe überspringen\n \n // Systemnachrichten, die <<< oder >>> an Stelle 4-16 enthalten herausfiltern\n $ausgeben = true;\n if ($u_systemmeldungen == \"N\") {\n if (($row->c_typ == \"S\")\n && (substr($row->c_text, 3, 12) == \"&gt;&gt;&gt;\"\n || substr($row->c_text, 3, 12) == \"&lt;&lt;&lt;\")) {\n $ausgeben = false;\n }\n }\n \n // Die Ignorierten User rausfiltern \n if (isset($ignore[$row->c_von_user_id])\n && $ignore[$row->c_von_user_id]) {\n $ausgeben = false;\n }\n \n if ($ausgeben\n && ($text_ausgegeben || $row->c_br == \"normal\"\n || $row->c_br == \"erste\")) {\n \n // Alter Code \n // if (!$ignore[$row->c_von_user_id] && ($text_ausgegeben || $row->c_br==\"normal\" || $row->c_br==\"erste\")){\n \n // Letzte ID merken\n $letzte_id = $row->c_id;\n \n // Userfarbe setzen\n if (strlen($row->c_farbe) == 0) :\n $row->c_farbe = \"#\" . $user_farbe;\n else :\n $row->c_farbe = \"#\" . $row->c_farbe;\n endif;\n \n // Student: 29.08.07 - Problem ML BGSLH\n // Wenn das 255. Zeichen ein leerzeichen\n // ist, dann wird es in der Datenbank nicht\n // gespeichert, da varchar feld\n // hier wird es reingehängt, wenn es in sequenz am\n // anfang oder in der mitte, und der text nur 254\n // zeichen breit ist\n if ((strlen($row->c_text) == 254)\n && (($row->c_br == \"erste\") || ($row->c_br == \"mitte\"))) {\n $row->c_text .= ' ';\n }\n \n // Text filtern\n $c_text = stripslashes($row->c_text);\n $c_text = $text_weitergabe . $c_text;\n $text_weitergabe = \"\";\n \n // Merken, dass Text ausgegeben wurde\n $text_ausgegeben = TRUE;\n \n // Smilies ausgeben oder unterdrücken\n if ($u_smilie == \"N\") {\n $c_text = str_replace(\"<SMIL\",\n \"<small>&lt;SMILIE&gt;</small><!--\", $c_text);\n $c_text = str_replace(\"SMIL>\", \"-->\", $c_text);\n } else {\n $c_text = str_replace(\"<SMIL\", \"<IMG\", $c_text);\n $c_text = str_replace(\"SMIL>\", \">\", $c_text);\n }\n \n // bugfix: gegen große Is... wg. verwechslung mit kleinen Ls ...\n // $row->c_von_user=str_replace(\"I\",\"i\",$row->c_von_user);\n \n if ($chat_status_klein) {\n $sm1 = \"<small>\";\n $sm2 = \"</small>\";\n } else {\n $sm1 = \"\";\n $sm2 = \"\";\n }\n \n // In Zeilen mit c_br=letzte das Zeilenende/-umbruch ergänzen\n if ($row->c_br == \"erste\" || $row->c_br == \"mitte\") {\n $br = \"\";\n } else {\n $br = \"<BR>\\n\";\n }\n ;\n \n // im Text die Session-IDs in den Platzhalter <ID> einfügen\n if ($id)\n $c_text = str_replace(\"<ID>\", $id, $c_text);\n \n // alternativ, falls am ende der Zeile, und das \"<ID>\" auf 2 Zeilen verteilt wird\n if (($id)\n && (($row->c_br == \"erste\") || ($row->c_br == \"mitte\"))) {\n if (substr($c_text, -3) == '<ID') {\n $text_weitergabe = substr($c_text, -3);\n $c_text = substr($c_text, 0, -3);\n }\n \n if (substr($c_text, -2) == '<I') {\n $text_weitergabe = substr($c_text, -2);\n $c_text = substr($c_text, 0, -2);\n }\n \n if (substr($c_text, -1) == '<') {\n $text_weitergabe = substr($c_text, -1);\n $c_text = substr($c_text, 0, -1);\n }\n }\n \n // im Text die HTTP_HOST in den Platzhalter <HTTP_HOST> einfügen\n $c_text = str_replace(\"<HTTP_HOST>\", $http_host, $c_text);\n \n // Verschienen Nachrichtenarten unterscheiden und Nachricht ausgeben\n switch ($row->c_typ) {\n \n case \"S\":\n if (($admin || $u_level == \"A\")) {\n $c_text = str_replace(\"<!--\", \"\", $c_text);\n $c_text = str_replace(\"-->\", \"\", $c_text);\n }\n // S: Systemnachricht\n if ($row->c_an_user) {\n // an aktuellen User\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $zanfang = $sm1\n . \"<FONT COLOR=\\\"$system_farbe\\\" TITLE=\\\"$row->c_zeit\\\">\";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $sm2 . $br;\n }\n } else {\n // an alle User\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $zanfang = $sm1\n . \"<FONT COLOR=\\\"$system_farbe\\\" TITLE=\\\"$row->c_zeit\\\"><B>$chat:</B>&nbsp;\";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $sm2 . $br;\n }\n }\n break;\n \n case \"P\":\n // P: Privatnachricht an einen User\n \n // Falls dies eine Folgezeile ist, Von-Text unterdrücken\n \n if (strlen($row->c_von_user) != 0) {\n if ($u_farbe_priv != \"-\")\n $row->c_farbe = \"#$u_farbe_priv\";\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $temp_von_user = str_replace(\"<ID>\", $id,\n $row->c_von_user);\n $temp_von_user = str_replace(\"<HTTP_HOST>\",\n $http_host, $temp_von_user);\n $zanfang = \"<FONT COLOR=\\\"\" . $row->c_farbe\n . \"\\\" TITLE=\\\"$row->c_zeit\\\"><B>\"\n . $temp_von_user\n . \"&nbsp;($t[chat_lese1]):</B> \";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $br;\n }\n } else {\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $temp_von_user = str_replace(\"<ID>\", $id,\n $row->c_von_user);\n $temp_von_user = str_replace(\"<HTTP_HOST>\",\n $http_host, $temp_von_user);\n $zanfang = $sm1\n . \"<FONT COLOR=\\\"$system_farbe\\\" TITLE=\\\"$row->c_zeit\\\"><B>\"\n . $temp_von_user\n . \"&nbsp;($t[chat_lese1]):</B> \";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $sm2 . $br;\n }\n }\n break;\n \n case \"H\":\n // H: Versteckte Nachricht an alle ohne Absender\n if ($show_spruch_owner && ($admin || $u_level == \"A\")) {\n $c_text = str_replace(\"<!--\", \"<b>\", $c_text);\n $c_text = str_replace(\"-->\", \"</b>\", $c_text);\n }\n if ($row->c_von_user_id != 0) {\n // eigene Farbe für noise, falls gesetzt.\n if ($u_farbe_noise != \"-\")\n $row->c_farbe = \"#$u_farbe_noise\";\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $zanfang = \"<FONT COLOR=\\\"$row->c_farbe\\\" TITLE=\\\"$row->c_zeit\\\"><I>&lt;\";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"&gt;</I></FONT>\" . $br;\n }\n } else {\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $zanfang = $sm1\n . \"<FONT COLOR=\\\"$system_farbe\\\" TITLE=\\\"$row->c_zeit\\\"><I>&lt;\";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"&gt;</I></FONT>\" . $sm2 . $br;\n }\n }\n break;\n \n default:\n // N: Normal an alle mit Absender\n // eigene Farbe, falls gesetzt\n if ($row->c_von_user_id != $u_id\n && $u_farbe_alle != \"-\")\n $row->c_farbe = $u_farbe_alle;\n \n // eigene Farbe für nachricht an Privat, falls gesetzt.\n if (preg_match(\"/\\[.*&nbsp;$nick\\]/i\", $c_text)\n && $u_farbe_priv != \"-\")\n $row->c_farbe = $u_farbe_priv;\n \n // Nur Nick in Userfarbe oder ganze Zeile\n if ($farbe_user_fest) {\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $temp_von_user = str_replace(\"<ID>\", $id,\n $row->c_von_user);\n $temp_von_user = str_replace(\"<HTTP_HOST>\",\n $http_host, $temp_von_user);\n $zanfang = \"<FONT COLOR=\\\"\" . $row->c_farbe\n . \"\\\" TITLE=\\\"$row->c_zeit\\\"><B>\"\n . $temp_von_user\n . \":</B> </FONT><FONT COLOR=\\\"$system_farbe\\\" TITLE=\\\"$row->c_zeit\\\"> \";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $br;\n }\n } else {\n if (!$erste_zeile) {\n $zanfang = \"\";\n } else {\n $temp_von_user = str_replace(\"<ID>\", $id,\n $row->c_von_user);\n $temp_von_user = str_replace(\"<HTTP_HOST>\",\n $http_host, $temp_von_user);\n $zanfang = \"<FONT COLOR=\\\"\" . $row->c_farbe\n . \"\\\" TITLE=\\\"$row->c_zeit\\\">\" . \"<B>\"\n . $temp_von_user . \":</B> \";\n }\n if ($br == \"\") {\n $zende = \"\";\n } else {\n $zende = \"</FONT>\" . $br;\n }\n }\n }\n // Chatzeile ausgeben\n echo $zanfang . $c_text . $zende;\n \n // Ist aktuelle Zeile die erste Zeile oder eine Folgezeile einer Serie ?\n // Eine Serie steht immer am Stück in der DB (schreiben mit Lock Table)\n // Falls br gesetzt ist, ist nächste Zeile eine neue Zeile (erste zeile einer Serie)\n if ($br) {\n $erste_zeile = TRUE;\n } else {\n $erste_zeile = FALSE;\n }\n \n }\n }\n }\n \n if (isset($result))\n mysql_free_result($result);\n \n flush();\n return ($text_ausgegeben);\n \n}", "public abstract function sendMessage();", "function customGetChat($cid){\n return _custom_chat_get_room($cid);\n}", "public function messages();", "public function messages();", "public function messages();", "public function action_chat() {\n\t\t$recepient = $this->request->param('id');\n\t\t$sender = $this->_current_user;\n\t\t$avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png';\n\t\t//STEP1: Save the chat message;\n\t\t$message = ORM::factory('Message');\n\t\t$message->values($this->request->post());\n\t\t$message->sender = $sender;\n\t\t$message->recepient = $recepient;\n\t\t$message->time = time();\n\t\ttry {\n\t\t\t$message->save();\n\t\t\t//STEP2: Send Chat Notification to Recepient\n\t\t\t$date = gmdate('m/d/Y H:i:s', $message->time) . \" UTC\";\n\t\t\t$payload = array(\n\t\t\t\t'msg_id' => $message->message_id,\n\t\t\t\t'msg' => $message->message,\n\t\t\t\t'time' => $date,\n\t\t\t\t'id' => $sender->id,\n\t\t\t\t'username' => $sender->username,\n\t\t\t\t'avatar' => 'assets/avatars/' . $avatar,\n\t\t\t\t\"local_time\" => Date::local_time(\"now\", \"m/d/Y H:i:s\", \"UTC\")\n\t\t\t);\n\t\t\t$this->_push('appchat', $payload, array(\n\t\t\t\t'id' => $recepient,\n\t\t\t\t'pushUid'=> Kohana::$config->load(\"pusher.pushUid\")\n\t\t\t));\n\t\t\t$this->_set_msg('Successful sent message', 'success', $payload);\n\t\t} catch(ORM_Validation_Exception $e) {\n\t\t\t$this->_set_msg('Someone slept on the job', 'error', TRUE);\n\t\t}\n\t}", "public function abrir_chat()\n\t{\n\t\t$usuario=$this->session->userdata('id');\n\t\t$id_otro_usuario=$_REQUEST['id_otro_usuario'];\n\t\t\n\t\t//var_dump($_REQUEST);\n\t\t\n\t\t$mensajes=$this->Mensaje_model->buscar_mensajes_chat($usuario,$id_otro_usuario);//TODO cambiar por $usuario\n\t\techo(json_encode($mensajes));\n\t}", "public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $response = array(\n 'status' => (bool)$result\n );\n\n // encode return array\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "function get_chtrm_name($chatid){\r\n\r\n}", "function sendMessage($vars) {\r\n extract($vars);\r\n\t\r\n\tlist($dbconn) = lnDBGetConn();\r\n\t$lntable = lnDBGetTables();\r\n\r\n\t$privmsgstable = $lntable['privmsgs'];\r\n\t$privmsgscolumn = &$lntable['privmsgs_column'];\r\n\r\n\t$id = getMaxPrivMsgID();\r\n\t$type = _MESSAGESEND; \r\n\t$send_time = time();\r\n\t$ip = getenv(\"REMOTE_ADDR\");\r\n\tif (empty($from_uid)) {\r\n\t\t$from_uid = lnSessionGetVar('uid');\r\n\t}\r\n\tif (empty($to_uid)) {\r\n\t\t$to_uid = lnUserGetUid($nickname);\r\n\t\tmessageHead($vars);\r\n\t}\r\n\t\r\n\tif (empty($to_uid)) {\r\n\t\techo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR=\"#FF0000\" HEIGHT=\"50\"><TR><TD BGCOLOR=\"#FFFFFF\" ALIGN=\"CENTER\">';\r\n\t\techo '<B>Sorry but no such user exists</B>';\r\n\t\techo '<P><< <A HREF=\"javascript:history.go(-1)\">Back</A>';\r\n\t\techo '</TD></TR></TABLE>';\r\n\t}\r\n\telse {\r\n\t\t$query = \"INSERT INTO $privmsgstable (\r\n\t\t\t\t\t\t$privmsgscolumn[id],\r\n\t\t\t\t\t\t$privmsgscolumn[type],\r\n\t\t\t\t\t\t$privmsgscolumn[priority],\r\n\t\t\t\t\t\t$privmsgscolumn[subject],\r\n\t\t\t\t\t\t$privmsgscolumn[message],\r\n\t\t\t\t\t\t$privmsgscolumn[from_uid],\r\n\t\t\t\t\t\t$privmsgscolumn[to_uid],\r\n\t\t\t\t\t\t$privmsgscolumn[date],\r\n\t\t\t\t\t\t$privmsgscolumn[ip],\r\n\t\t\t\t\t\t$privmsgscolumn[enable]\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tVALUES (\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($id) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($type) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($priority) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($subject) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($message) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($from_uid) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($to_uid) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($send_time) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($ip) .\"',\r\n\t\t\t\t\t\t'1'\r\n\t\t\t\t\t\t) \";\r\n\t\t\t$result = $dbconn->Execute($query);\r\n\r\n\t\t\t/*\r\n\t\t\techo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR=\"#0066CC\" HEIGHT=\"50\"><TR><TD BGCOLOR=\"#FFFFFF\" ALIGN=\"CENTER\">';\r\n\t\t\techo '<B>Your message has been sent</B>';\r\n\t\t\techo '<P>Click <A HREF=\"index.php?mod=Private_Messages&amp;op=inbox\">Here</A> to return to your Inbox';\r\n\t\t\techo '</TD></TR></TABLE>';\r\n\t\t\t*/\r\n\r\n\r\n\t}\r\n}", "private function send_msg() {\r\n }", "function get_chtrm($chatid){\r\n\r\n}", "function view_chat($demand_id)\n {\n }", "function chatUpdater($owner, $msg) {\n $path = \"../Tables/TableCreatedBy_\" . $owner . \"/chat.txt\";\n fwrite(fopen($path, 'a'), \"<div class='msgln'>(\" . date(\"g:i A\") . \") <b>\" . $_SESSION['user'] . \"</b>: \" .\n str_replace(\"\\n\", \"\", stripslashes(htmlspecialchars($msg))) . \"</div>\\n\");\n echo \"Done\";\n}", "function chat_view($guid = NULL) {\n\t$return = array();\n\n\telgg_require_js('chat/messaging');\n\n\t$chat = get_entity($guid);\n\n\t// no header or tabs for viewing an individual chat\n\t$return['filter'] = '';\n\n\tif (!elgg_instanceof($chat, 'object', 'chat') || !$chat->isMember() ) {\n\t\t$return['content'] = elgg_echo('noaccess');\n\t\treturn $return;\n\t}\n\n\tif ($chat->canEdit()) {\n\t\t// Delete chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_delete',\n\t\t\t'href' => \"action/chat/delete?guid=$guid\",\n\t\t\t'text' => elgg_echo('delete'),\n\t\t\t'link_class' => 'elgg-button elgg-button-delete',\n\t\t\t'confirm' => elgg_echo('chat:delete:confirm'),\n\t\t\t'is_action' => true,\n\t\t));\n\t\t// Edit chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_edit',\n\t\t\t'href' => \"chat/edit/$guid\",\n\t\t\t'text' => elgg_echo('chat:edit'),\n\t\t\t'link_class' => 'elgg-button elgg-button-action',\n\t\t));\n\t} else {\n\t\t// Leave chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_leave',\n\t\t\t'href' => \"action/chat/leave?guid=$guid\",\n\t\t\t'text' => elgg_echo('chat:leave'),\n\t\t\t'link_class' => 'elgg-button elgg-button-delete',\n\t\t\t'confirm' => elgg_echo('chat:leave:confirm'),\n\t\t\t'is_action' => true,\n\t\t));\n\t}\n\t// Add users button\n\tchat_register_addusers_button($chat);\n\n\t$return['title'] = htmlspecialchars($chat->title);\n\n\telgg_push_breadcrumb($chat->title);\n\t$return['content'] = elgg_view_entity($chat, array('full_view' => true));\n\t$return['content'] .= elgg_view('chat/messages', array('entity' => $chat));\n\n\treturn $return;\n}", "function getChatMessage($name) {\n\t\treturn $this->chat_messages[$name][0];\n\t}", "function fechar_janela_conversa_chat(){\n\n// seta usuario de chat de sessao\n$_SESSION[CONFIG_MD5_IDUSUARIO_CHAT] = null;\n\n}", "public function InsertChatMessage(){\n include \"conn.php\";\n\n $req=$bdd->prepare('INSERT INTO chats(ChatUserId,ChatText) VALUES(:ChatUserId,:ChatText)');\n $req->execute(array(\n 'ChatUserId'=>$this->getChatUserId(),\n 'ChatText'=>$this->getChatText()\n ));\n }", "function welcome_user_msg_filter($text)\n {\n }", "protected abstract function _message();", "public function onCommandChat(CommandSender $p, Command $cmd, $label, array $args) {\n if ($p instanceof Player) {\n $p->sendMessage(\"Chat was called...\");\n\n # Pruefe Anzahl der Parameter\n if (count($args)<2) {\n $p->sendMessage(\"Parameter missing, read the help\");\n }\n\n # Verbinde hintere Parameter zu einer Message\n $message=$args[1];\n for ($i=2; $i<count($args); $i=$i+1) { \n $message=$message . \" \" . $args[$i];\n $this->getLogger()->info($message);\n }\n\n # Suche den Adressaten der Message\n $playername=$args[0];\n $player=$this->getServer()->getPlayer($playername);\n\n # Wenn gefunden, schicke die Message\n if ($player==null) {\n $p->sendMessage(\"Player is offline\");\n } else {\n $player->sendMessage($message);\n } \n }\n }", "public function getChat()\n {\n return $this->get(self::_CHAT);\n }", "function onTextmessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)\n{\n global $ts3, $name, $debug; \n $msg = $event[\"msg\"];\n $invoker = $event[\"invokername\"];\n \n if($invoker != $name) {\n \n if($debug) echo($invoker.\": \".$msg.\"\\n\");\n \n if($debug) echo(\"User \".$invoker.\" passed security check\\n\");\n \n $invoker_db = $ts3->clientGetByName($invoker);\n \n if($invoker_db[\"client_unique_identifier\"] == \"DOgQ0YV9+wZ9YMdD3JPfhvlv/xqM=\" OR $invoker_db[\"client_unique_identifier\"] == \"gWszaxdv1W+8KlIHafUe+ZdOaiI=\") {\n\n // preparing the command arguments\n $block = array(11, 26, 2);\n $values[1] = intval( $uid );\n $id_a = $ts3->getId();\n $arguments = explode(\" \", $msg);\n if($debug) echo(\"Arguments:\\n\"); print_r($arguments);echo(\"\\n\"); \n switch ($arguments[0]) {\n\tcase \"!ping\":\n\t\tgizisent(\"Pong!\",$ts3,$id_a);\n\t\tbreak;\n\tcase \"!add\":\n\t\tif (in_array($arguments[1], $block)){\n\t\tgizisent(\"Access denied\",$ts3,$id_a);\n\t\t} else {\n\t\t$ts3->serverGroupClientAdd($arguments[1],$arguments[2]);\t\t\n\t\tgizisent(\"Rank was add\",$ts3,$id_a);\n\t\t}\n\t\tbreak;\t \n\tcase \"!del\":\n\t\tif (in_array($arguments[1], $block)){\n\t\tgizisent(\"Access denied\",$ts3,$id_a);\n\t\t} else {\n\t\t$ts3->serverGroupClientDel($arguments[1],$arguments[2]);\t\t\n\t\tgizisent(\"Rank was remove\",$ts3,$id_a);\n\t\t}\n\t\tbreak;\t\t\t\n\tcase \"!info\":\n\t\tgizisent(\"Project GzPro.net\",$ts3,$id_a);\n\t\tbreak;\t \n\tcase \"!help\":\n\t\tgizisent(\"Commands:\n\t\t!ping - test\n\t\t!add <id ServerGroup> <dbid user> - Giving Rank\n\t\t!del <id ServerGroup> <dbid user> - Remove Rank\n\t\t!info - Information Bot\",$ts3,$id_a);\n }\n \n}\n}\n}", "function sendMenu0($chat,$text,$messenger='',$menu=[]){\r\n $keyboard = array();\r\n\t\r\n\tif (count($menu)>0) $keyboard=$menu;\r\n\r\n\tif ((MESSENGER=='viber')||($messenger=='viber')){\r\n\t\t//sendMsg($chat,$help);\r\n\t\tviberMenu($chat,$text,'',$keyboard);\r\n\t}\r\n\r\n\tif ((MESSENGER=='telegram')||($messenger=='telegram')){\r\n //hideMenu($chat);\r\n sendKeyboard($chat, \"$text\" , 'html',0 , $keyboard,0);\r\n\t}\r\n}", "function initChat(User $user){\n \n}", "public function C_obtenerChat($output){\n\t\t$this->Dashboard_model->M_marcarMensajesLeidos();\n\t\t$msgBox =\"\";\n\t\t// Obtener todos los mensajes enviados por mi y/o recibido por id_usuario_para\n\t\t\t$mensajes = $this->Dashboard_model->M_obtenerMensajes($this->input->post(\"para\"));\n\t\t\t$data[\"para\"] = $this->input->post(\"para\");\n\n\t\t\tforeach ($mensajes as $fila) {\n\t\t\t\tif ($this->session->userdata('id_usuario') == $fila->id_usuario_de) {\n\t\t\t\t\t$msgBox .=\"<div class='box3 sb13'>\".$fila->mensaje.\"</div>\";\n\t\t\t\t}else{\n\t\t\t\t\t$msgBox .=\"<div class='box4 sb14'><p>\".$fila->mensaje.\"</p></div>\";\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tif ($output == 1){\n\t\t\techo $msgBox;\n\t\t}else{\n\t\t\treturn $msgBox;\n\t\t}\n\t}", "public function hasChat(){\n return $this->_has(19);\n }", "public function chat(Request $request){\n\n $this->validate( $request,[\n 'message' => 'required', \n ]);\n $user = Auth::user();\n \n $message = new Message();\n \n $message->user_id = $user->id;\n $message->messageText = strip_tags($request->message);\n $message->save();\n return response()->json([\n 'success' => true\n ]);\n }", "public function sendMessage(){\n\n\n }", "function ShowOnlineChat()\n{\n\n\t$str0=\"select value1 from options where name='chat'\";\n\t$result0=mysql_query($str0) or\n\t\tdie(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{\n\t\techo(\"<tr><td height='58' valign='top' style=\\\"border:1px solid #22496c;\\\">\");\n\t\techo(\"<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>\");\n\t\techo(\"<tr><td colspan='2' valign='middle' bgcolor='\");\n\t\techo(background()); \n\t\techo(\"' class='leftmenumainitem'><img src='image/point.jpg' />&nbsp;&nbsp;\");\n\t\techo(getPara('chat','value2'));\n\t\techo(\"</td></tr>\");\n\t\t$str2=\"select * from chat\";\n\t\t$result2=mysql_query($str2) or\n\t\t\tdie(mysql_error());\n\t\twhile ($row2=mysql_fetch_array($result2))\n\t\t{\n\t\t\techo(\"<tr><td width='106' height='30' align='center' valign='middle'>\");\n\t\t\techo(\"&nbsp;&nbsp;\".$row2['name'].\":</td>\");\n\t\t\techo(\"<td width='87' align='center' valign='middle'><div align='center'>\");\n\t\t\techo('<a href=\"ymsgr:sendim?'.$row2['yahooid']);\n\t\t\techo('&m=Xin chào\"><img border=0 src=\"http://opi.yahoo.com/online?u=');\n\t\t\techo($row2['yahooid'].'&m=g&t=2&l=us\" alt=\"\" title=\"\"></a></div></td></tr>');\n\t\t}\n\t\tmysql_free_result($result2);\n\t\techo(\"</table></td></tr>\");\n\t}\n\tmysql_free_result($result0);\n}", "function createChatBoxMessage($chat_user,$chat_box_message,$code,$users,$miis) {\n //FIX MESSAGE FORMAT\n $messArray = null;\n if($code == 1){\n $mess = \"<div>\".$chat_box_message . \"</div>\";\n array_push($this->chatHistory,$chat_box_message);\n $messArray = array('message'=>$mess,'users'=>$users,'miiInfo'=>$miis,'message_type'=>'enter');\n }\n elseif($code == 0){\n $mess = \"<div>\".$chat_user . \":\" . $chat_box_message . \"</div>\";\n array_push($this->chatHistory,$chat_user . \":\" . $chat_box_message);\n $messArray = array('message'=>$mess,'users'=>$users,'message_type'=>'chat');\n }\n elseif($code == 2){\n $mess = \"<div>\".$chat_box_message . \"</div>\";\n array_push($this->chatHistory,$chat_box_message);\n $messArray = array('message'=>$mess,'users'=>$users,'message_type'=>'exit');\n }\n \n if(count($this->chatHistory) == 25){\n $this->chatHistory = array_shift($this->chatHistory);\n }\n $chatMessage = $this->encloseMessage(json_encode($messArray));\n return $chatMessage;\n }", "function processMessage($message) {\n $message_id = $message['message_id'];\n $chat_id = $message['chat']['id'];\n if (isset($message['text'])) {\n \n $text = $message['text'];//texto recebido na mensagem\n if (strpos($text, \"/start\") === 0) {\n\t\t//envia a mensagem ao usuário\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Olá, '. $message['from']['first_name'].\n\t\t'! Eu sou um bot que informa a previsao do tempo na sua cidade?', 'reply_markup' => array(\n 'keyboard' => array(array('São Paulo', 'Porto Alegre'),array('Curitiba','Florianópolis')),\n 'one_time_keyboard' => true)));\n } else if ($text === \"São Paulo\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Porto Alegre\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Florianópolis\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Curitiba\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather( $text)));\n } else {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Desculpe, mas não entendi essa mensagem. :('));\n }\n } else {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Desculpe, mas só compreendo mensagens em texto'));\n }\n}", "public function chat_messagesAction()\n\t{\n\t\t$chat_id = $this->request->getQuery(\"chat_id\");\n\n\t\t$user = $this->user;\n $user_id = $user['id'];\n $application_id = $user['Application_ID'];\n\n $messages = MessagesRelation::find([\n \"application_id = {$application_id} AND data_cms_id = {$chat_id}\"\n ]);\n\n\t\t$data = [];\n\t\tforeach ($messages as $key => $msg) {\n\t\t\t$data[\"messages\"][$key][\"from_user\"] = $msg->sender->Title;\n\t\t\t$data[\"messages\"][$key][\"from_user_id\"] = $msg->sender->ID;\n\t\t\t$data[\"messages\"][$key][\"last_message\"] = $msg->message->content;\n\t\t\t$data[\"messages\"][$key][\"last_message_time\"] = $msg->message->created_at;\n\t\t}\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => $data\n ];\n\n return $this->sendJson($response);\n\t}", "public function message ();", "public function chat($player, $mex, $style){ \n $style_mex= $style;\n $p= \"[SignShop] \";\n switch($style_mex){\n case 1:\n $player->sendMessage(TextFormat::RED.$p.$mex);\n break;\n case 2:\n $player->sendMessage(TextFormat::YELLOW.$p.$mex);\n break;\n case 3:\n $player->sendMessage(TextFormat::GREEN.$p.$mex);\n break;\n case 4:\n $player->sendMessage(TextFormat::AQUA.$p.$mex);\n break;\n default:\n $player->sendMessage($p.$mex);\n break;\n }\n }", "public function msg($msg);", "public function showMessage(){\n\t\t\n\n\t\ttry {\n\n\t\t\tif(!empty($_POST)){// si un commentaire est poter\n\t\t\t\tTchatModel::setMessage($_POST[\"message\"],$_POST[\"idUsr\"]);\n\t\t\t}\n\n\t\t\t$data = TchatModel::getMessage();\n\t\t} catch (Exception $e) {\n\t\t\t$data = TchatModel::getMessage();\n\t\t\t$warning = $e->getMessage();\n\t\t}\n\t\trequire_once'ViewFrontend/tchat.php';\n\t}", "function wsOnMessage($clientID, $message, $messageLength, $binary) {\n\tglobal $Server;\n\tglobal $userlist;\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\n\n\tif ($messageLength == 0) {\n\t\t$Server->wsClose($clientID);\n\t\treturn;\n\t}\n\t\n\t// TODO: Add handling of different events\n\t// addmms\n\t// chatmsg\n\t// accept\n\t// decline\n\t\n\t// Params contain type and data\n\t$params = json_decode($message, true);\n\n\t// Parse command based on type\n\tswitch ($params['type']) {\n\t\tcase 'chatmsg':\n//The speaker is the only person in the room. Don't let them feel lonely.\n//\t\tif ( sizeof($Server->wsClients) == 1 ) {\n//\t\t\t$Server->wsSend($clientID, 'You are the only one here.');\n//\t\t}\n\t\t\t$message = $params['data'][0];\n\t\t\t$data = array(\n\t\t\t\t'clientid' => $clientID,\n\t\t\t\t'ip' => $ip,\n\t\t\t\t'nickname' => $userlist[$clientID],\n\t\t\t\t'message' => $message\n\t\t\t);\n\t\t\tSendToAllClients('chatmsg', $data);\n\t\tbreak;\n\t\t\t\n\t\tcase 'setnick':\n\t\t\t// If clientID already has a nick, we pass the old nickname on aswell\n\t\t\t$oldnickname = array_key_exists($clientID, $userlist) ? $userlist[$clientID] : '';\n\t\t\t$newnickname = $params['data'][0]; \n\t\t\t\n\t\t\t// Avoid confusion, disallow two users the same nickname, add trailing number\n\t\t\t$i = 0;\n\t\t\tforeach ($userlist as $id => $nickname) {\n\t\t\t\tif ($i > 0 && $newnickname.$i == $nickname) {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\tif ($newnickname == $nickname) {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($i > 0) {\n\t\t\t\t$newnickname = $newnickname.$i;\n\t\t\t}\n\t\t\t$userlist[$clientID] = $newnickname;\n\n\t\t\t$data = array(\n\t\t\t\t'clientid' => $clientID,\n\t\t\t\t'ip' => $ip,\n\t\t\t\t'newnickname' => $newnickname,\n\t\t\t\t'oldnickname' => $oldnickname\n\t\t\t);\n\t\t\tSendToAllClientsExcept($clientID, 'setnick', $data);\n\t\t\t$data = array(\n\t\t\t\t'userlist' => $userlist\n\t\t\t);\n\t\t\tSendToAllClients('updateuserlist', $data); // At the moment this means that userlist is updated whenver anyone connects\n\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\t// :|\n\t\tbreak;\n\t}\n}", "function member_message($type='',$new=''){\r\n //type: in / out => tin da nhan / tin da gui\r\n global $mysql,$lang,$tpl,$table_prefix,$htm,$t;\r\n $userid = $_SESSION['userid'];\r\n if($new){\r\n $n = \"and readed=0\";\r\n }\r\n if($type=='out'){\r\n $q = $mysql->query(\"select * from \".$table_prefix.\"message where mfrom=\".$userid.\" \".$n.\" and fromdel=0 order by id DESC\");\r\n }else{\r\n $q = $mysql->query(\"select * from \".$table_prefix.\"message where mto=\".$userid.\" \".$n.\" and todel=0 order by id DESC\");\r\n }\r\n // $q = $mysql->query(\"select * from \".$table_prefix.\"message\");\r\n while($r=$mysql->fetch_array($q)){\r\n $date = timezones(0);\r\n $year = substr($date,0,4);\r\n $month = substr($date,4,2);\r\n $day = substr($date,6,2);\r\n if($r['date']==$day.'-'.$month.'-'.$year){\r\n $time = $r['time'];\r\n }else{\r\n $time = $r['date'];\r\n }\r\n if($type=='out'){\r\n $img = \"<img src='images/icon/sended.gif' title='Sended'>\";\r\n $tool = \"<img src='images/icon/delete.gif' height='25' onclick=\\\"del('member=message_del&type=from&abc',\".$r['id'].\",'','','message');\\\" class='folder' style='cursor: pointer;' title='Delete'>\";\r\n $url = \"show_wish(\".$r['id'].\",'member=message_read&type=from','message')\";\r\n }else{\r\n if($r['readed']=='0'){\r\n $img = \"<img src='images/icon/unread.gif' title='Unread'>\";\r\n }else{\r\n $img = \"<img src='images/icon/readed.gif' title'Readed'>\";\r\n }\r\n $tool = \"<img src='images/icon/delete.gif' height='25' onclick=\\\"del('member=message_del&type=to&abc',\".$r['id'].\",'','','message');\\\" class='folder' style='cursor: pointer;' title='Delete'>\";\r\n $url = \"show_wish(\".$r['id'].\",'member=message_read&type=to','message')\";\r\n }\r\n $list .= $tpl->replace_tem($t['message.list'],array(\r\n 'id' => $r['id'],\r\n 'title' => $r['title'],\r\n 'time' => $time,\r\n 'content' => cut_str($r['message'],40),\r\n 'readed' => $readed,\r\n 'img' => $img,\r\n 'tool' => $tool,\r\n 'url' => $url,\r\n )\r\n );\r\n }\r\n $show = $new?'none':'block';\r\n $main = $tpl->replace_tem($t['message.top'],array(\r\n 'skin.link' => $_SESSION['template'],\r\n 'list' => $list,\r\n 'tool.show' => $show,\r\n )\r\n );\r\n $htm = $tpl->replace_block($htm,array(\r\n 'html' => $main,\r\n )\r\n );\r\nreturn $htm;\r\n}", "abstract public function get_message();", "function api_chat_me_info() {\n\tif (session_check()) {\n\t\t$db = new db;\n\t\t$info = $db->getRow(\"SELECT CONCAT(fname, ' ', lname) as fio, avatar,id FROM users WHERE id = ?i\", $_SESSION[\"user_id\"]);\n\t\taok($info);\n\t} else {\n\t\taerr(array(\"Пожалуйста войдите.\"));\n\t}\n\t\n}", "public function actionChat(){\n header(\"content-type:application/json\");\n $data = array();\n $data['sukses'] = 0;\n $data['pesan'] = 'Error 404 : Request tidak valid. Cek parameter';\n if(isset($_GET['chat_from']) && isset($_GET['chat_to']) && isset($_GET['chat_message'])){\n $transaction = Yii::app()->db->beginTransaction();\n try{\n $model = new MOChat();\n $model->chat_from = $_GET['chat_from'];\n $model->chat_to = $_GET['chat_to'];\n $model->chat_sent = date(\"Y-m-d H:i:s\");\n $model->chat_message = str_replace('\"','',str_replace(\"'\",\"\",$_GET['chat_message']));\n \n if($model->save()){\n $transaction->commit();\n $data['sukses'] = 1;\n $data['pesan'] = 'Pesan terkirim!';\n }else{\n $transaction->rollback();\n $data['sukses'] = 0;\n $data['pesan'] = 'Pesan gagal terkirim!<br>'.CHtml::errorSummary($model);\n }\n }catch (Exception $exc) {\n $transaction->rollback();\n $data['sukses'] = 0;\n $data['pesan'] = 'Pesan gagal terkirim!'.MyExceptionMessage::getMessage($exc,true);\n }\n \n }\n $encode = CJSON::encode($data);\n echo \"jsonCallback(\".$encode.\")\";\n Yii::app()->end();\n }", "function AddChat()\r\n{\r\n if (session_id() == '')\r\n {\r\n session_start();\r\n }\r\n if (isset($_SESSION))\r\n {\r\n if (!empty($_SESSION) && !empty($_SESSION['EMAIL']))\r\n {\r\n echo '<div id=ChatSystem>\r\n <div id=\"messageBox\">\r\n <div id=\"id\" class=\"chat\"></div>\r\n <form id=\"messageBoxForm\" onsubmit=\"event.preventDefault()\">\r\n <textarea onkeydown=\"SubmitFormEnter(event)\" cols=\"40\" rows=\"1\" name=\"chatMessage\" id=\"chat_input\" placeholder=\"Type a message...\" autocomplete=\"off\" autocapitalize=off resize=off></textarea>\r\n <input type=\"submit\" id=\"submitText\"><label title=\"Send message\" id=\"submitMessageLabel\" for=\"submitText\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Layer_1\" viewBox=\"0 0 55 55\" x=\"0px\" y=\"0px\" width=\"55\" height=\"55\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs43\"><linearGradient id=\"linearGradient5980\" xmlns:osb=\"http://www.openswatchbook.org/uri/2009/osb\" osb:paint=\"solid\"><stop id=\"stop5978\" style=\"stop-color: rgb(174, 174, 174); stop-opacity: 1;\" offset=\"0\" /></linearGradient></defs><g id=\"g8\" transform=\"matrix(0.0661397 0 0 0.0661397 1.06883 11.809)\"><g id=\"g6\"><path id=\"path2\" style=\"fill: none; fill-opacity: 0.995536; stroke: #2b2b2b; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 244.8 489.6 c 135 0 244.8 -109.8 244.8 -244.8 C 489.6 109.8 379.8 0 244.8 0 C 109.8 0 0 109.8 0 244.8 c 0 135 109.8 244.8 244.8 244.8 Z m 0 -469.8 c 124.1 0 225 100.9 225 225 c 0 124.1 -100.9 225 -225 225 c -124.1 0 -225 -100.9 -225 -225 c 0 -124.1 100.9 -225 225 -225 Z\" /><path id=\"path4\" style=\"fill: #767e88; fill-opacity: 1; stroke: #0063b1; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 210 326.1 c 1.9 1.9 4.5 2.9 7 2.9 c 2.5 0 5.1 -1 7 -2.9 l 74.3 -74.3 c 1.9 -1.9 2.9 -4.4 2.9 -7 c 0 -2.6 -1 -5.1 -2.9 -7 L 224 163.5 c -3.9 -3.9 -10.1 -3.9 -14 0 c -3.9 3.9 -3.9 10.1 0 14 l 67.3 67.3 l -67.3 67.3 c -3.8 3.9 -3.8 10.2 0 14 Z\" /></g></g><g id=\"g10\" transform=\"translate(0 -434.6)\" /><g id=\"g12\" transform=\"translate(0 -434.6)\" /><g id=\"g14\" transform=\"translate(0 -434.6)\" /><g id=\"g16\" transform=\"translate(0 -434.6)\" /><g id=\"g18\" transform=\"translate(0 -434.6)\" /><g id=\"g20\" transform=\"translate(0 -434.6)\" /><g id=\"g22\" transform=\"translate(0 -434.6)\" /><g id=\"g24\" transform=\"translate(0 -434.6)\" /><g id=\"g26\" transform=\"translate(0 -434.6)\" /><g id=\"g28\" transform=\"translate(0 -434.6)\" /><g id=\"g30\" transform=\"translate(0 -434.6)\" /><g id=\"g32\" transform=\"translate(0 -434.6)\" /><g id=\"g34\" transform=\"translate(0 -434.6)\" /><g id=\"g36\" transform=\"translate(0 -434.6)\" /><g id=\"g38\" transform=\"translate(0 -434.6)\" /></svg></label></form>\r\n </div>\r\n <div id=\"contactsPart\">\r\n <input type=\"checkbox\" id=\"hideContacts\"><label id=\"contactsButton\" for=\"hideContacts\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Capa_1\" viewBox=\"0 0 48 48\" x=\"0px\" y=\"0px\" width=\"48\" height=\"48\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs37\"></defs><path id=\"path2\" style=\"stroke: #000000; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 0.4;\" d=\"M 32.3384 29.1299 L 29.1539 27.5378 C 28.8536 27.3875 28.6669 27.0855 28.6669 26.7495 v -1.12706 c 0.07634 -0.09334 0.156675 -0.199676 0.239679 -0.317015 c 0.41302 -0.583363 0.744037 -1.23273 0.984716 -1.9331 C 30.3617 23.1566 30.667 22.6916 30.667 22.1666 v -1.3334 c 0 -0.321016 -0.120006 -0.632032 -0.33335 -0.875044 v -1.77309 c 0.01867 -0.183343 0.09201 -1.27473 -0.697368 -2.17511 c -0.684701 -0.781039 -1.79576 -1.17706 -3.30283 -1.17706 c -1.50707 0 -2.61813 0.39602 -3.30283 1.17673 c -0.478357 0.545694 -0.639365 1.16039 -0.688034 1.60175 c -0.571362 -0.295348 -1.24473 -0.445022 -2.00943 -0.445022 c -3.46317 0 -3.66485 2.95181 -3.66685 3.00015 v 1.52641 c -0.216011 0.235345 -0.33335 0.507025 -0.33335 0.776705 v 1.15139 c 0 0.359685 0.161008 0.695035 0.437022 0.921713 c 0.275014 1.03672 0.951381 1.82009 1.21473 2.0951 v 0.914379 c 0 0.262346 -0.142674 0.503025 -0.390353 0.638365 l -2.21778 1.39107 C 14.5272 30.045 13.9995 30.934 13.9995 31.9014 v 1.26573 h 4.6669 h 0.6667 h 14.6674 v -1.34773 c 0 -1.14606 -0.637032 -2.17678 -1.66208 -2.68947 Z M 18.6664 31.7544 v 0.746037 h -4.0002 v -0.59903 c 0 -0.723369 0.394686 -1.38807 1.04705 -1.74442 l 2.21744 -1.39107 c 0.444355 -0.242346 0.720369 -0.707035 0.720369 -1.21373 v -1.19706 l -0.106005 -0.099 c -0.0087 -0.008 -0.894378 -0.844709 -1.15606 -1.9851 l -0.03034 -0.132012 l -0.114006 -0.07334 c -0.153341 -0.09934 -0.245012 -0.26568 -0.245012 -0.444689 v -1.15139 c 0 -0.120006 0.08167 -0.26268 0.223678 -0.391353 l 0.109672 -0.09901 l -0.000667 -1.79342 c 0.006 -0.09567 0.179676 -2.35278 3.00082 -2.35278 c 0.797707 0 1.46941 0.184343 2.0001 0.548027 v 1.57708 c -0.213344 0.243012 -0.33335 0.554028 -0.33335 0.875044 v 1.3334 c 0 0.101338 0.01167 0.20101 0.03367 0.297682 c 0.009 0.03867 0.027 0.074 0.03933 0.111338 c 0.01833 0.056 0.033 0.113673 0.05867 0.166675 c 0.000333 0.000667 0.000667 0.001 0.001 0.0017 c 0.08534 0.176009 0.209677 0.33335 0.366352 0.459023 c 0.0017 0.0063 0.0037 0.012 0.0053 0.018 c 0.02 0.07634 0.041 0.152341 0.06367 0.226678 l 0.027 0.087 c 0.0047 0.01533 0.01033 0.031 0.01533 0.04634 c 0.01167 0.036 0.023 0.07167 0.035 0.107005 c 0.02 0.05834 0.041 0.118673 0.06534 0.184343 c 0.01033 0.02734 0.02167 0.052 0.03233 0.079 c 0.02734 0.06967 0.05467 0.137007 0.08334 0.203677 c 0.007 0.016 0.013 0.03334 0.02 0.049 l 0.01867 0.042 c 0.0087 0.01933 0.01767 0.03667 0.02633 0.05567 c 0.03267 0.07134 0.06467 0.14034 0.09801 0.20701 c 0.0053 0.01067 0.01033 0.02234 0.01567 0.033 c 0.021 0.04167 0.042 0.081 0.063 0.121006 c 0.036 0.06867 0.07134 0.13334 0.106672 0.19601 c 0.01733 0.03067 0.03433 0.06067 0.05134 0.08967 c 0.048 0.082 0.09367 0.157341 0.138007 0.227344 c 0.0097 0.015 0.019 0.03067 0.02834 0.045 c 0.08067 0.125006 0.150674 0.226344 0.208677 0.305348 c 0.01533 0.021 0.02867 0.039 0.04167 0.05667 c 0.0073 0.0097 0.01733 0.02367 0.02367 0.03233 v 1.10306 c 0 0.322683 -0.176009 0.618697 -0.459023 0.773372 l -0.882044 0.481024 l -0.153675 -0.01367 l -0.06267 0.131673 l -1.87543 1.02305 c -0.966712 0.528016 -1.56708 1.5394 -1.56708 2.64079 Z m 14.6674 0.746037 H 19.3331 v -0.746037 c 0 -0.857043 0.467357 -1.64475 1.21973 -2.05477 l 2.97381 -1.62208 c 0.497692 -0.27168 0.806707 -0.792706 0.806707 -1.35907 v -1.3394 v -0.000333 l -0.06467 -0.07734 l -0.01267 -0.015 c -0.000667 -0.001 -0.02134 -0.026 -0.055 -0.07 c -0.002 -0.0027 -0.004 -0.0053 -0.0063 -0.008 c -0.01767 -0.023 -0.03834 -0.05067 -0.062 -0.08367 c -0.000333 -0.000667 -0.000666 -0.001 -0.001 -0.0017 c -0.04967 -0.069 -0.112005 -0.158674 -0.181342 -0.26668 c -0.0017 -0.0023 -0.003 -0.005 -0.0047 -0.0073 c -0.03267 -0.051 -0.06734 -0.106672 -0.102672 -0.165675 c -0.0027 -0.0043 -0.0053 -0.0087 -0.008 -0.01333 c -0.07537 -0.126347 -0.155375 -0.269354 -0.235046 -0.427696 c 0 0 -0.000333 -0.000333 -0.000333 -0.000666 c -0.04234 -0.08501 -0.08467 -0.174342 -0.126007 -0.267347 v 0 c -0.0057 -0.013 -0.01167 -0.02567 -0.01733 -0.03867 v 0 c -0.01833 -0.04167 -0.03667 -0.08534 -0.05534 -0.130339 c -0.0067 -0.01633 -0.01333 -0.03334 -0.02 -0.05 c -0.01733 -0.04367 -0.035 -0.08767 -0.05367 -0.138007 c -0.034 -0.09067 -0.066 -0.185342 -0.09667 -0.283014 l -0.01833 -0.05934 c -0.002 -0.0067 -0.0043 -0.01333 -0.0063 -0.02033 c -0.03134 -0.105338 -0.06134 -0.21301 -0.08667 -0.323682 L 23.089 22.7989 L 22.9753 22.7256 C 22.7819 22.6009 22.6666 22.3919 22.6666 22.1666 v -1.3334 c 0 -0.187009 0.07934 -0.361351 0.223344 -0.491691 l 0.110006 -0.09901 V 18.1664 V 18.0484 l -0.009 -0.007 c -0.01133 -0.240679 0.003 -0.978383 0.541027 -1.59208 c 0.552361 -0.630365 1.49507 -0.949714 2.80147 -0.949714 c 1.30173 0 2.24244 0.317016 2.79547 0.942714 c 0.649033 0.733703 0.541694 1.67242 0.541027 1.68042 l -0.003 2.11977 l 0.110006 0.09934 c 0.144007 0.130007 0.223344 0.304349 0.223344 0.491358 v 1.3334 c 0 0.291015 -0.190676 0.545694 -0.474024 0.633032 l -0.166008 0.051 l -0.05334 0.165008 c -0.223011 0.693702 -0.540694 1.3344 -0.944714 1.90443 c -0.09901 0.14034 -0.195343 0.26468 -0.279014 0.359685 l -0.083 0.09467 v 1.37507 c 0 0.590029 0.327683 1.12039 0.855376 1.3844 l 3.18449 1.59208 c 0.79804 0.39902 1.29373 1.20106 1.29373 2.09344 Z\" /><g id=\"g4\" transform=\"translate(0 -12)\" /><g id=\"g6\" transform=\"translate(0 -12)\" /><g id=\"g8\" transform=\"translate(0 -12)\" /><g id=\"g10\" transform=\"translate(0 -12)\" /><g id=\"g12\" transform=\"translate(0 -12)\" /><g id=\"g14\" transform=\"translate(0 -12)\" /><g id=\"g16\" transform=\"translate(0 -12)\" /><g id=\"g18\" transform=\"translate(0 -12)\" /><g id=\"g20\" transform=\"translate(0 -12)\" /><g id=\"g22\" transform=\"translate(0 -12)\" /><g id=\"g24\" transform=\"translate(0 -12)\" /><g id=\"g26\" transform=\"translate(0 -12)\" /><g id=\"g28\" transform=\"translate(0 -12)\" /><g id=\"g30\" transform=\"translate(0 -12)\" /><g id=\"g32\" transform=\"translate(0 -12)\" /></svg></label>\r\n <div id=\"contacts_bar\">';\r\n echo '</div></div></div>';\r\n }\r\n }\r\n}", "function fetch_user_chat_history($from_user_id, $to_channel_id, $link) {\n\n $sql = \"SELECT * FROM chat_message WHERE (from_user_id = '\" . $from_user_id .\"' AND to_channel_id = '\" . $to_channel_id .\"')\n OR (to_channel_id = '\" . $to_channel_id .\"')\n ORDER BY timestamp ASC\";\n\n\n $output = \"\";\n if($stmt = mysqli_prepare($link, $sql)) {\n // Attempt to execute the prepared statement\n if(mysqli_stmt_execute($stmt)) {\n mysqli_stmt_store_result($stmt);\n \n // Bind result variables\n mysqli_stmt_bind_result($stmt, $sql_chat_message_id, $sql_to_channel_id, $sql_from_user_id, $sql_chat_message, $sql_timestamp, $sql_status);\n $output .= '<ul id=\"chat_history_list\" class=\"list-unstyled\">';\n while(mysqli_stmt_fetch($stmt)) {\n if($sql_from_user_id == $from_user_id) {\n $user_name = '<b class=\"text-success\">'.$_SESSION['username'].'</b>';\n } else {\n $user_name = '<b class=\"text-danger\">' . get_user_name($sql_from_user_id, $link) .'</b>'; \n }\n\n $output .= '\n <li style=\"border-bottom:1px dotted #ccc\">\n <p>'.$user_name.' - '.$sql_chat_message.'\n <div align=\"right\">\n - <small><em>'.$sql_timestamp.'</em></small>\n </div>\n </p>\n </li>';\n }\n\n } \n }\n\n $output .= \"</ul>\";\n\n return $output;\n\n}", "public function onMessage($clientChat, $receivedText)\n\t{\n\t}", "function registerChatCommands() {\n\t\tif ($this->debug) {\n\t\t\tif (isset($this->chat_commands)) {\n\t\t\t\tforeach ($this->chat_commands as $command) {\n\t\t\t\t\t// display message if debug mode is set to true ...\n\t\t\t\t\t$this->console_text('register chat command: ' . $command->name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function leaveChat()\n\t{\n\t\t//validate user\n\t\t$leaveChat_response=$this->validateUserLogin();\n\n\t\t$db=JFactory::getDBO();\n\t\t$user=JFactory::getUser();\n\t\t$actorid=$user->id;\n\n\t\t//get node id\n\t\t$input=JFactory::getApplication()->input;\n\t\t$nid=$input->post->get('nid','','INT');//9\n\n\t\t//validate participant id - check if pid is specified\n\t\tif(!$nid){\n\t\t\t$leaveChat_response['validate']->error=1;\n\t\t\t$leaveChat_response['validate']->error_msg=JText::_('COM_JBOLO_INVALID_NODE_ID');;\n\t\t\treturn $leaveChat_response;\n\t\t}\n\t\t$leaveChat_response=$this->validateNodeParticipant($actorid,$nid);\n\n\t\t//use nodes helper\n\t\t$nodesHelper=new nodesHelper();\n\t\t$nodeType=$nodesHelper->getNodeType($nid);//important Coz only group chat can be left\n\n\t\tif($nodeType==2)//called from group chat\n\t\t{\n\t\t\t//mark user as inactive for this group chat\n\t\t\t$query=\"UPDATE #__jbolo_node_users\n\t\t\tSET status=0\n\t\t\tWHERE node_id=\".$nid.\"\n\t\t\tAND user_id=\".$actorid;\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->query($query))\n\t\t\t{\n\t\t\t\techo $db->stderr();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//broadcast msg\n\t\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t\t//show username OR name\n\t\t\tif($params->get('chatusertitle')){\n\t\t\t\t//$chattitle='username';\n\t\t\t\t$broadcast_msg=JFactory::getUser($actorid)->username.' <i>'.JText::_('COM_JBOLO_GC_LEFT_CHAT_MSG').'</i>';\n\t\t\t}else{\n\t\t\t\t//$chattitle='name';\n\t\t\t\t$broadcast_msg=JFactory::getUser($actorid)->name.' <i>'.JText::_('COM_JBOLO_GC_LEFT_CHAT_MSG').'</i>';\n\t\t\t}\n\n\t\t\t//use broadcast helper\n\t\t\t$chatBroadcastHelper=new chatBroadcastHelper();\n\t\t\t//send to one who left chat\n\t\t\t$chatBroadcastHelper->pushChat('gbc',$nid,$broadcast_msg,$actorid,0);\n\t\t\t//send to all\n\t\t\t$chatBroadcastHelper->pushChat('gbc',$nid,$broadcast_msg,0,0);\n\n\t\t\t//set message to be sent back to ajax request\n\t\t\t$leaveChat_response['lcresponse']->msg=JText::_('COM_JBOLO_YOU').' '.JText::_('COM_JBOLO_GC_LEFT_CHAT_MSG');\n\n\t\t\treturn $leaveChat_response;\n\t\t}\n\t}", "private function _messageFor()\n {\n // First, get the message\n //$message_for = preg_match('^!messagefor-[$1]', $this->_data->message)\n //preg_match('/^!messagefor-(.*):/', '!messagefor-Mike I missed you', $matches); var_dump($matches);\n try {\n // Connect\n $dbh = $this->_connectToDb();\n\n // Insert\n $stmt = $dbh->prepare(\"INSERT INTO message(`nick`, `message`, `when`, `from`) VALUES (:nick, :message, NOW(), :from)\");\n\n $stmt->bindParam(':nick', $message_for, PDO::PARAM_STR);\n $stmt->bindParam(':message', $message_payload, PDO::PARAM_STR);\n $stmt->bindParam(':from', $this->_data->nick, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $dbh = null;\n\n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "public function talk();", "function warquest_home_messages() {\r\n \r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $offset;\r\n\t\r\n\t/* output */\r\n\tglobal $page;\r\n\tglobal $player;\r\n\tglobal $output;\r\n\t\r\n\t/* Clear new flag */\r\n\t$player->comment_notification=0;\r\n\t\t\r\n\t$output->title = t('HOME_MESSAGES_TITLE');\r\n\t\r\n\t$limit=30;\r\n\t\r\n\t$query = 'select pid1 from comment where pid2='.$player->pid.' and deleted=0';\r\n\t$result = warquest_db_query($query); \r\n\t$total = warquest_db_num_rows($result);\r\n\t\r\n\t$query = 'select a.id, a.pid1, a.pid2, a.date, a.comment, a.cid, b.name, b.country from comment a, player b ';\r\n $query .= 'where ((a.pid1=b.pid and pid2='.$player->pid.') or (a.pid2=b.pid and pid1='.$player->pid.')) ';\r\n\t$query .= 'and deleted=0 order by a.date desc ';\r\n\t$query .= 'limit '.$offset.','.$limit;\r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\t\t\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_MESSAGES_TITLE').'</div>';\r\n\t\r\n\tif ($count==0) {\r\n\t\t\r\n\t\t$page .= warquest_box_icon(\"info\",t('HOME_NO_MESSAGES'));\r\n\t\t\r\n\t} else {\r\n\t\t\r\n\t\t$page .= '<div class=\"box rows\">';\r\n\t\r\n\t\t$count=0;\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 1);\r\n\t\t\r\n\t\t$page .= '<table>';\r\n\t\t\r\n\t\t$page .= '<tr>';\r\n\t\t$page .= '<th width=\"75\" >'.t('GENERAL_AGO').'</th>';\r\n\t\t$page .= '<th width=\"390\">'.t('GENERAL_MESSAGE').'</th>';\r\n\t\t$page .= '<th width=\"55\" align=\"right\">'.t('GENERAL_ACTION').'</th>';\r\n\t\t$page .= '</tr>';\r\n\t\t\r\n\t\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\r\n\t\t\t$count++;\r\n\t\t\r\n\t\t\t$page .= '<tr valign=\"top\">';\r\n\t\t\t$page .= '<td>';\r\n\t\t\t$page .= warquest_ui_ago($data->date);\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td>';\r\n\t\t\t\r\n\t\t\t$page .= '<span class=\"subparagraph2\">';\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= player_format($data->pid1, $data->name, $data->country);\r\n\t\t\t\t$page .= ' -> '.player_format($player->pid, $player->name, $player->country);\r\n\t\t\t} else {\r\n\t\t\t\t$page .= player_format($player->pid, $player->name, $player->country);\r\n\t\t\t\t$page .= ' -> ';\r\n\t\t\t\t\r\n\t\t\t\tif ($data->cid > 0) {\r\n\t\t\t\t\t$clan = warquest_db_clan($data->cid);\r\n\t\t\t\t\t$page .= clan_format($clan).' clan';\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ($data->pid2==0) {\r\n\t\t\t\t\t$page .= t('GENERAL_ALL');\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$page .= player_format($data->pid2, $data->name, $data->country);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$page .= '</span>';\r\n\t\t\t$page .= '<br/>';\r\n\t\t\t$page .= warquest_parse_smilies(wordwrap($data->comment, 40, \"\\n\\r\", true));\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td align=\"right\">';\r\n\t\t\t\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid1, t('LINK_REPLY'), \"reply\".$count);\t\r\n\t\t\t} else if ($player->pid==$data->pid1) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid2.'&uid='.$data->id, t('LINK_EDIT'), 'edit'.$count);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '</table>';\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 0);\r\n\t\t$page .= '</div>';\n\t\r\n\t} \r\n}", "function create_response($text, $message)\r\n{\r\n global $usernamebot;\r\n \r\n // inisiasi variable hasil yang mana merupakan hasil olahan pesan\r\n $hasil = ''; \r\n \r\n $chatid = $message[\"chat\"][\"id\"]; // variable penampung id chat\r\n \r\n\r\n // variable penampung username nya user\r\n isset($message[\"from\"][\"username\"])\r\n ? $chatuser = $message[\"from\"][\"username\"]\r\n : $chatuser = '';\r\n \r\n\r\n // variable penampung nama user\r\n\r\n isset($message[\"from\"][\"last_name\"]) \r\n ? $namakedua = $message[\"from\"][\"last_name\"] \r\n : $namakedua = ''; \r\n\r\n $namauser = $message[\"from\"][\"first_name\"]. ' ' .$namakedua;\r\n\r\n $pecah = explode(' ', $text); \r\n\t\r\n // identifikasi perintah (yakni kata pertama, atau array pertamanya)\r\n switch ($pecah[0]) {\r\n \r\n case '/start':\r\n if(str_word_count($text)<=1){\r\n $_SESSION['namauser']=$namauser;\r\n\r\n $hasil = \"Hai 💁 `{$_SESSION['namauser']}` .. Selamat datang di `Sistem Informasi Jadwal Laboratorium FASILKOM-TI` Universitas Sumatera Utara! \\n\\n\";\r\n $hasil .= '💁🏼 Aku adalah *bot SisLabTI* ver.`'.myVERSI.\"`\\n\";\r\n $hasil .= \"🎓 yang dibuat oleh :\\n\";\r\n $hasil .= \" _Indana Fariza Hidayat 161402082_\\n\";\r\n $hasil .= \" _Gistya Fakhrani 161402094_\\n\";\r\n $hasil .= \" _Rina Ayu Wulan Sari 161402097_\\n \";\r\n $hasil .= \" _Sinta Anjelina 161402100_\\n\";\r\n $hasil .= \" _Dea Amanda 161402118_\\n⌛️\".lastUPDATE.\"\\n\\n\";\r\n $hasil .= \"‼️ Notes ‼️ \\n `Bot hanya mengerti bahasa instruksi yang disediakan` 🔻 \\n `Jika` instruksi sudah sesuai namun `bot sedang lambat & tidak merespons`. `Ketikkan instruksi ulang` 🔻\\n\\n\";\r\n\r\n $hasil .= \"Silahkan _login_ terlebih dahulu. ketik: /login\\n\";\r\n $_SESSION['step']= \"/login\";\r\n } else {\r\n $hasil= '⛔️ *ERROR:* _Tidak ada instruksi tersebut . Panggil bot sesuai instruksi!_';\r\n $hasil .= \"\\n\".'ingat /start ya ! 😅'; \r\n }\r\n break;\r\n\r\n // balasan default jika pesan tidak di definisikan\r\n default:\r\n\t\t\t//if(isset($_SESSION['chatid'])){\r\n\t\t\t\tif(isset($_SESSION['step'])){\r\n\t\t\t\t\tswitch($_SESSION['step']){\r\n case '/login':\r\n var_dump($text);\r\n $hasil = start($text);\r\n break;\r\n case 'level_user':\r\n $hasil = level_user($text);\r\n // return $hasil;\r\n break;\r\n case 'menupraktikan':\r\n $hasil = menupraktikan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'menuaslab':\r\n $hasil = menuaslab($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'nim':\r\n //tampung dulu nimnya ke SESSION\r\n var_dump($text);\r\n $_SESSION['nim'] = $text;\r\n var_dump($_SESSION['nim']);\r\n $hasil = login($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'password':\r\n var_dump($text);\r\n $_SESSION['password'] = $text; \r\n $hasil = password($text);\r\n $_SESSION['chat_id'] = $chatid; \r\n break;\r\n case 'term': \r\n $_SESSION['semester'] = $text;\r\n $hasil = term($text);\r\n $_SESSION['chat_id']=$chatid;\r\n break;\r\n case 'matakuliah':\r\n $_SESSION['id_matkul']= $text;\r\n $hasil = matakuliah($text);\r\n $_SESSION['chat_id']=$chatid;\r\n break;\r\n case 'hari':\r\n $_SESSION['hari'] = $text;\r\n $hasil = hari($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'waktu':\r\n $_SESSION['waktu'] = $text;\r\n $hasil = waktu($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'ruangan':\r\n $_SESSION['ruangan'] = $text;\r\n $hasil = ruangan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'kom':\r\n $_SESSION['kom'] = $text;\r\n $hasil = kom($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n\r\n case 'menu': \r\n $hasil = menu($_SESSION['nama_aslab']);\r\n break;\r\n\r\n case 'gantihari':\r\n $_SESSION['hariganti'] = $text;\r\n $hasil = gantihari($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'gantiwaktu':\r\n $_SESSION['waktuganti'] = $text;\r\n $hasil = gantiwaktu($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'gantiruangan':\r\n $_SESSION['ruanganganti'] = $text;\r\n $hasil = gantiruangan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'update':\r\n $text = strtolower($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n if($text == 'ya'){\r\n $hasil .=upselesai();\r\n return $hasil;\r\n }\r\n elseif ($text== 'tidak') {\r\n # code...\r\n var_dump($_SESSION['nama_aslab']);\r\n $hasil = \"🅾️ Anda tidak jadi mengubah jadwal.\\n\\n\";\r\n $_SESSION['step']='menuaslab';\r\n $hasil .= menu($_SESSION['nama_aslab']);\r\n \r\n }\r\n else {\r\n $hasil = \"Masukkan sesuai perintah (ya/tidak)\\n\";\r\n $_SESSION['step'] ='update';\r\n break; \r\n }\r\n break;\r\n\r\n case 'upselesai':\r\n $hasil .= upselesai();\r\n break;\r\n\r\n\r\n \r\n\t\t\t\t\t\tcase 'verifikasi':\r\n $text = strtolower($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n\t\t\t\t\t\t\tif($text == 'ya'){\r\n $hasil .=selesai();\r\n return $hasil;\r\n\t\t\t\t\t\t\t}\r\n elseif ($text== 'tidak') {\r\n # code...\r\n $hasil = \"Silahkan ulangi dengan perintah /tambah\";\r\n $_SESSION['step']='menuaslab';\r\n }\r\n else {\r\n $hasil = \"Masukkan sesuai perintah (ya/tidak)\\n\";\r\n $_SESSION['step'] ='verifikasi';\r\n break; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'selesai':\r\n\t\t\t\t\t\t\t// simpan ke database\r\n $hasil=selesai();\r\n\t\t\t\t\t\t\t//return $hasil;\r\n\t\t\t\t\t\t\t//session_destroy();\r\n\t\t\t\t\t\t\tbreak;\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\t\r\n\t\t\t\t} else {\r\n\t\t\t\t $hasil = \"😥 Instruksi tidak tersedia jika `anda belum memanggil Bot`.\\n Panggil bot dengan `/start` ya! 😅\";\r\n\t\t\t\t}\r\n\t\t\t//}\r\n break;\r\n\t\t\t\r\n }\r\n\t\r\n\tprint_r($_SESSION);\r\n\r\n return $hasil;\r\n}", "public static function display_irc_chat_rules() {\n ?>\n <ol>\n <?= Lang::get('rules', 'chat_forums_irc') ?>\n </ol>\n<?\n }", "function message_everyone($title, $msg)\n{\n $all_users = sql_query(\"SELECT id FROM users WHERE `id`=558\");\n $dt = sqlesc(date(\"Y-m-d H:i:s\"));\n while ($dat = mysql_fetch_assoc($all_users)) {\n sql_query(\"INSERT INTO messages (sender, receiver, added, subject, msg) VALUES (0, $dat[id], $dt, \" . sqlesc(\"系统公告:\" . $title) . \", \" . sqlesc($msg . \"\\r\\n\\r\\n详见首页公告\") . \")\") or sqlerr(__FILE__, __LINE__);\n }\n}", "function getMsg($param) {\n global $msg;\n $msg = \"\";\n $msgCount = 1;\n for($i = 0; $i < strlen('$str'); $i++) {\n if($str[$i] != \"*\" && $msgCount == $param && $activeMsg) {\n $msg .= $str[$i];\n } else if($str[$i] == \"*\") {\n $msgCount++;\n $activeAuthor = true;\n $activeMsg = false;\n } else if($str[$i] == \":\") {\n $activeAuthor = false;\n $activeMsg = true;\n }\n }\n }", "function chatform(){\r\necho'\r\n<div id=\"wrapper\">\r\n<div id=\"menu\">\r\n<p class=\"welcome\">Welcome, <b>'; echo $_SESSION[\"name\"]; echo'</b></p>\r\n<p class=\"logout\"><a id=\"exit\" href=\"#\">Exit Chat</a></p>\r\n<div style=\"clear:both\"></div>\r\n</div>\r\n\r\n<div id=\"chatbox\"></div>\r\n';\r\n\r\n//checking whether a pair of friends are chatting\r\nif((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend2']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend2.html\") && filesize(\"friend1_friend2.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend2.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend2.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend3.html\") && filesize(\"friend1_friend3.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend3.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend3.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend4']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend4.html\") && filesize(\"friend1_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_friend3.html\") && filesize(\"friend2_friend3.html\") > 0){\r\n $handle1 = fopen(\"friend2_friend3.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_friend3.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend4']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_friend4.html\") && filesize(\"friend2_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend2_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend4'))\r\n{\r\nif(file_exists(\"friend3_friend4.html\") && filesize(\"friend3_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend3_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend3_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_Subhadra.html\") && filesize(\"friend1_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend1_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_Subhadra.html\") && filesize(\"friend2_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend2_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3'))\r\n{\r\nif(file_exists(\"friend3_Subhadra.html\") && filesize(\"friend3_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend3_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend3_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4'))\r\n{\r\nif(file_exists(\"friend4_Subhadra.html\") && filesize(\"friend4_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend4_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend4_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\n\r\necho '\r\n<form name=\"message\" action=\"\">\r\n<input name=\"usermsg\" type=\"text\" id=\"usermsg\" size=\"63\" />\r\n<input name=\"submitmsg\" type=\"submit\" id=\"submitmsg\" value=\"Send\" />\r\n</form>\r\n</div>\r\n\r\n<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js\">\r\n</script>\r\n\r\n<script type=\"text/javascript\">\r\n\r\n$(document).ready(function(){\r\n \r\n $(\"#exit\").click(function(){';\r\n //when exit chat button is clicked\r\n if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend2'))|| (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend2=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend3'))|| (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend3=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Friend3'))|| (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_friend3=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_3']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend3_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_3']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend3_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_4']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend4_Subhadra=true\";}'; }\r\n\t echo '\r\n });\r\n\r\n\r\n $(\"#submitmsg\").click(function(){\r\n var clientmsg = $(\"#usermsg\").val();';\r\n\t //passing values to post.php\r\n\t if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend2\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend3\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_friend3\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend3_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend3_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend4_Subhadra\";';\r\n\t }\t \r\n\t echo'\r\n $.post(\"post.php\", {text: clientmsg, text2: clientmsg2});\r\n $(\"#usermsg\").attr(\"value\", \"\");\r\n return false;\r\n });\r\n \r\n setInterval (loadLog, 1000); \r\n\r\nfunction loadLog(){\r\n var oldscrollHeight = $(\"#chatbox\").attr(\"scrollHeight\") - 20;\r\n\r\n\t\r\n $.ajax({ url:'; \r\n\tif((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend2.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend3.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_friend3.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) \r\n\t{ echo '\"friend3_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) \r\n\t{ echo '\"friend3_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4'))\r\n\t{ echo '\"friend4_Subhadra.html\",';\r\n\t}\r\n\r\n\techo'\r\n cache: false,\r\n success: function(html){\r\n $(\"#chatbox\").html(html);\r\n var newscrollHeight = $(\"#chatbox\").attr(\"scrollHeight\") - 20;\r\n if(newscrollHeight > oldscrollHeight){\r\n $(\"#chatbox\").animate({ scrollTop: newscrollHeight }, \"normal\"); \r\n }\r\n },\r\n });\r\n}\r\n});\r\n</script>\r\n';\r\n}", "public function getChat()\n {\n return view('chat');\n }", "function formatMessage($msg, $userLabel = '', $roomLabel = '', $timestamp = '')\r\n\t{\r\n\t\tglobal $isAjax;\r\n\t\t$color = $isAjax ? $_GET['notifColor'] : htmlColor($GLOBALS['fc_config']['themes'][$_REQUEST['theme']]['enterRoomNotify']);\r\n\t\t// end of fix\r\n\t\treturn \"<font color=\\\"$color\\\">\" . parseMessage($msg, $userLabel, $roomLabel, $timestamp) . '</font><br>';\r\n\t}", "public function responseMsg()\n {\n\n include('ctr_user.php');\n function register($input, $openID){\n if(!$input){\n return -1;\n }else{\n $regData = explode(\"+\",$input);\n if (count($regData) <= 1){\n return 0;\n }else{\n $name = $regData[0];\n $id = $regData[1];\n $content = array(\n 'userID' => $id,\n 'ecardID' => $id,\n 'name' => $name,\n 'descri' => '',\n 'regTime' => time(),\n 'status' => 1);\n addNewUser($openID, $content);\n $fb = fopen('../database/debug.txt',\"a\");\n fputs($fb,date(\"m/d H:i:s\").\" Wechat $id|$name|$openID|$input <br>\");\n fclose($fb);\n return 1;\n }\n }\n }\n function transText($keyword, $fromUsername){\n // 不知道是否能调用同级函数中的include\n if($keyword==\"功能\" || $keyword==\"菜单\" || $keyword==\"m\" ){\n $transContent = array(\n 'type' => 'text',\n 'str' => \"请回复以下数字办理考研自习室业务:\\n 1.绑定帐号\\n 2.选座\\n 3.座位排队\\n 4.关注官方微博\\n(ฅ• . •ฅ)[测试消息,认真你就输辣]\\n警察蜀黍,就是他做的系统\\n zhangpeng96.com\"\n );\n // 以数组的形式返回数据的内容和类型,注意转义符需要用双引号\n }else if(strlen($keyword) < 2){\n\n $uid = getUserID($fromUsername);\n switch($keyword){\n case 1:\n $transContent = array(\n 'type' => 'text',\n 'str' => \"首次关注,请绑定信息。\\n发送 姓名+学号(如“张鹏+20140349”)绑定帐号。\"\n );\n break;\n case 2:\n $transContent = array(\n 'type' => 'text',\n 'str' => \"戳开链接:http://tikumm.duapp.com/select.php?uid=$uid\"\n );\n break;\n case 3:\n $transContent = array(\n 'type' => 'text',\n 'str' => \"戳开链接:http://tikumm.duapp.com/queue.php?uid=$uid\"\n );\n break; \n case 4:\n $transContent = array(\n 'type' => 'text',\n 'str' => \"戳开链接:http://weibo.com/u/5231945858\"\n );\n break;\n }\n }else{ \n switch(register($keyword, $fromUsername)){\n case 0:\n $transContent = array(\n 'type' => 'text',\n 'str' => '输入错误'\n );\n break;\n case 1:\n $transContent = array(\n 'type' => 'text',\n 'str' => '成功绑定!'\n ); \n break;\n }\n }\n return $transContent; \n }\n\n\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n \n if(!empty( $keyword ))\n {\n $strData = transText($keyword, $fromUsername);\n $msgType = $strData['type'];\n $contentStr = $strData['str'];\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "public function run()\n {\n //\n $chat = new Message();\n $chat->room_id = 1;\n $chat->send_account_id = 1;\n $chat->receive_account_id = 2;\n $chat->text = \"こんにちは\";\n $chat->is_read = true;\n $chat->save();\n\n //\n $chat2 = new Message();\n $chat2->room_id = 1;\n $chat2->send_account_id = 2;\n $chat2->receive_account_id = 1;\n $chat2->text = \"よろしくお願いします。\";\n $chat2->is_read = true;\n $chat2->save();\n\n }", "public function addChat($text)\n {\n $this->addEvent(\"chat\", $text);\n }", "function buildr_messages_script()\n{\n require_lang('buildr');\n require_lang('chat');\n require_css('buildr');\n\n $member_id = get_member();\n $rows = $GLOBALS['SITE_DB']->query_select('w_members', array('location_realm', 'location_x', 'location_y'), array('id' => $member_id), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n list($realm, $x, $y) = array($rows[0]['location_realm'], $rows[0]['location_x'], $rows[0]['location_y']);\n\n $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_messages WHERE location_x=' . strval($x) . ' AND location_y=' . strval($y) . ' AND location_realm=' . strval($realm) . ' AND (destination=' . strval($member_id) . ' OR destination IS NULL OR originator_id=' . strval($member_id) . ') ORDER BY m_datetime DESC');\n $messages = new Tempcode();\n foreach ($rows as $myrow) {\n $message_sender = $GLOBALS['FORUM_DRIVER']->get_username($myrow['originator_id']);\n if (is_null($message_sender)) {\n $message_sender = do_lang('UNKNOWN');\n }\n $messages->attach(do_template('W_MESSAGE_' . (is_null($myrow['destination']) ? 'ALL' : 'TO'), array('MESSAGESENDER' => $message_sender, 'MESSAGE' => comcode_to_tempcode($myrow['m_message'], $myrow['originator_id']), 'DATETIME' => get_timezoned_date($myrow['m_datetime']))));\n }\n\n $tpl = do_template('W_MESSAGES_HTML_WRAP', array('_GUID' => '05b40c794578d3221e2775895ecf8dbb', 'MESSAGES' => $messages));\n $tpl->evaluate_echo();\n}", "private function _whereAreYou()\n {\n $channels = '';\n foreach($this->_currentChannels AS $channel)\n {\n $channels .= $channel .\", \";\n }\n\n $this->_message($this->_data->nick .\": I am in \". $channels);\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"Welcome to wechat world!\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"\";\n \texit;\n }\n }", "function chat_write($write) {\n global $USER_ID, $fn;\n // Maximum line count\n $maxlines = 35;\n if (trim($write) == '') return;\n // Create the chat file if neccessary\n if (!file_exists($fn)) {\n touch($fn);\n chmod($fn, 0644);\n }\n // Open the chat file and get the current line number\n $f = fopen($fn, 'r+');\n flock($f, 2);\n $offset = 0;\n fscanf($f, \"%s\\n\", $offset);\n // Increase by one as we're adding a new line now\n $offset++;\n $i = 0;\n $chat = '';\n // First we have to read the whole file\n // Lines are being read one by one until we're at the end or until we reach $maxlines\n while (($i < $maxlines) && ($s = fgets($f))) {\n $chat .= $s;\n $i++;\n }\n // This is the actual line we're adding\n // You see: The chat file contains JavaScript calls\n // This way no parsing of the lines is neccessary\n // We'll just need to eval() them in our JavaScript\n $time = date('H:i:s');\n $js = \"cs($offset,$USER_ID,'$time','User','$write','');\\n\";\n // Go to the top\n fseek($f, 0);\n // Empty the file\n ftruncate($f, 0);\n // Write the new offset\n fwrite($f, \"$offset\\n\");\n // Write the new line\n fwrite($f, $js);\n // And then the rest\n fwrite($f, $chat);\n // Close the file\n flock($f, 3);\n fclose($f);\n // We'll return the last added line to the calling\n return $js;\n}", "public function setChat($val)\n {\n $this->_propDict[\"chat\"] = $val;\n return $this;\n }", "public function messagefrom($usercheck)\n {\n \t\n\n }", "function uti_chat_callback($args) {\n\n\t\t$settings = get_option('utility_theme_options');\n\n\t\tif(!isset($settings['uti_chat'])) {\n\t\t\t$settings['uti_chat'] = \"\";\n\t\t}\n\n\t\t$output = \"\";\n\n\t\t$output .= '<div id=\"uti_chat\">';\n\t\t\t$output .= '<input type=\"checkbox\" value=\"true\" '.checked( $settings['uti_chat'], 'true', false) . ' id=\"utility_theme_options[uti_chat]\" name=\"utility_theme_options[uti_chat]\" >';\n\t\t\tif (!empty($args[0])) {$output .= '<div></div><p class=\"enovathemes-front-end-panel-info\">'.$args[0].'</p>';}\n\t\t$output .= '</div>';\n\t\techo $output;\n\t \n\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)) {\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if (!empty($keyword)) {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n\n } else {\n echo \"\";\n exit;\n }\n }", "function sendMsg($to,$frm, $sbj, $msg){\n\t$msg=wordwrap($msg, 70);\n\t$msg_fot='Copyright &copy; '.date('Y').' <a href=\"http://www.plus256.com\" target=\"_NEW\">Plus256 Network, Ltd</a>';\n\t//HTML message formatting/////////////////////////////////////////////////////////////////////////////////////////////////\n\t$html_msg='<html>';\n\t$html_msg.='<head>';\n\t/////////The Style Sheet//////////////////////////////////////////////////////////////////\n\t$html_msg.='<style type=\"text/css\">';\n\t$html_msg.='a{text-decoration:none; color:#09F;} a:hover{text-decoration:underline;}';\n\t$html_msg.='</style>';\n\t/////////////////////////////////////////////////////////////////////////////////////////\n\t$html_msg.='</head>';\n\t$html_msg.='<body style=\"width:70%; margin:auto; font-family:Verdana, Geneva, sans-serif; font-size:120%; color:#036; background:#FFF;\">';\n\t///////////////////\n\t$html_msg.='<div style=\"padding:10px; background:rgb(251, 174, 23); color:#FFF; font-weight:bold; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0;\">';\n\t$html_msg.=$sbj;\n\t$html_msg.='</div>';\n\t///////////////////////////\n\t$html_msg.='<div style=\"padding:10px;\">';\n\t$html_msg.=$msg;\n\t$html_msg.='</div>';\n\t//////////////////////////\n\t$html_msg.='<div style=\"padding:10px; font-size:85%; color:#A1A1A1; text-align:center; border:1px solid #EAEAEA; border-radius:0 0 10px 10px; -moz-border-radius:0 0 10px 10px; -webkit-border-radius:0 0 10px 10px;\">';\n\t$html_msg.=$msg_fot;\n\t$html_msg.='</div>';\n\t//////////////////////////\n\t$html_msg.='</body>';\n\t$html_msg.='</html>';\n\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t$hed='From: '.$frm.''.\"\\r\\n\";\n\t$hed.='Reply-To: '.$frm.''.\"\\r\\n\";\n\t//headers to send HTML email\n\t$hed.='MIME-Version: 1.0'.\"\\r\\n\";\n\t$hed.='Content-type: text/html; charset=iso-8859-1'.\"\\r\\n\";\n\tif(mail($to, $sbj, $html_msg, $hed)){\n\t\techo \"2\";\n\t}\n\telse{\n\t\techo \"3\";\n\t}\n}", "function sendMenu1($chat,$text,$messenger=''){\r\n $keyboard = [\t['/w1 Я студент', '/w2 Я преподаватель']];\r\n//\t\t ['/h Помощь', '/start Сброс']];\r\nglobal $BASE_KEYBOARD;\r\n$keyboard[]=$BASE_KEYBOARD;\r\n\tsendMenu0($chat,$text,$messenger,$keyboard);\r\n}", "function laceListener($fromListener = true)\r\n{\r\n\t$cookie_name = cookieVar(LACE_NAME_COOKIE, false);\r\n\r\n\t$post_name = postVar('name', false); // name\r\n\t$post_text = postVar('text', false); // text\r\n\r\n\tif ($post_name !== false && $post_text !== false)\r\n\t{\r\n\t\tif (validateSession() === false)\r\n\t\t\treturn '\"chat\":{\"nodata\":\"1\"}';\r\n\r\n\t\tif (isFlooding() === true)\r\n\t\t\treturn '\"chat\":{\"nodata\":\"1\"}';\r\n\r\n\t\t$message = prepareMessage($post_name, $post_text);\r\n\r\n\t\tif ($message !== false)\r\n\t\t{\r\n\t\t\tif ($cookie_name && $cookie_name != $post_name)\r\n\t\t\t{\r\n\t\t\t\taddNameChange($cookie_name, $post_name);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tglobal $A; // Activity object\r\n\t\t\t\tjoinMessage($post_name);\r\n\t\t\t\t$A->update($post_name);\r\n\t\t\t}\r\n\r\n\t\t\t// Reset $name just in case it has been changed\r\n\t\t\tglobal $name;\r\n\t\t\t$name = $post_name;\r\n\t\t\tsetcookie(LACE_NAME_COOKIE, $post_name, time() + 259200, LACE_URL_REL);\r\n\r\n\t\t\taddMessage($message);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($fromListener)\r\n\t{\r\n\t\t$chatHash = postVar('chatHash', false);\r\n\r\n\t\tif ($chatHash)\r\n\t\t{\r\n\t\t\t$hash = getMessageHash();\r\n\r\n\t\t\tif (validateSession() === false || $chatHash == $hash)\r\n\t\t\t{\r\n\t\t\t\treturn '\"chat\":{\"nodata\":\"\"}';\r\n\t\t\t}\r\n\r\n\t\t\t$json = '\"chat\":{\"hash\":\"'.$hash.'\",\"data\":\"';\r\n\t\t\t$json.= addslashes(str_replace(\"\\n\", \"\", printFileContentsHTML())).'\"}';\r\n\t\t\treturn $json;\r\n\t\t}\r\n\r\n\t\treturn '\"chat\":{\"nodata\":\"\"}';\r\n\t}\r\n\r\n\treturn '\"chat\":{\"nodata\":\"\"}';\r\n}", "protected function renderMessage() {}", "private function _hello()\n {\n // if _we_ join, don't greet ourself, just jump out via return\n if ($this->_data->nick == $this->_irc->_nick)\n return;\n \n $greetings = array(\n 'Mirëdita' => 'Albanian friends',\n 'Ahalan' => 'Arabic',\n 'Parev' => 'Armenian',\n 'Zdravei' => 'Bulgarian',\n 'Nei Ho' => 'Chinese',\n 'Dobrý den' => 'Czech',\n 'Goddag' => 'Danish',\n 'Goede dag' => 'Dutch',\n 'Hello' => 'English',\n 'Saluton' => 'Esperanto',\n 'Hei' => 'Finnish',\n 'Bonjour' => 'French',\n 'Guten Tag' => 'German',\n 'Gia\\'sou' => 'Greek',\n 'Aloha' => 'Hawaiian',\n 'Shalom' => 'Hebrew',\n 'Namaste' => 'Hindi',\n 'Jó napot' => 'Hungarian',\n 'Góðan daginn' => 'Icelandic',\n 'Halo' => 'Indonesian',\n 'Aksunai Qanuipit?' => ' Inuit',\n 'Dia dhuit' => 'Irish',\n 'Salve' => 'Italian',\n 'Kon-nichiwa' => 'Japanese',\n 'An-nyong Ha-se-yo' => ' Korean',\n 'Salvëte' => 'Latin',\n 'Ni hao' => 'Mandarin',\n 'Hallo' => 'Norwegian',\n 'Dzien\\' dobry' => 'Polish',\n 'Olá' => 'Portuguese',\n 'Bunã ziua' => 'Romanian',\n 'Zdravstvuyte' => 'Russian',\n 'Hola' => 'Spanish',\n 'Hujambo' => ' Swahili',\n 'Hej' => 'Swedish',\n 'Sa-wat-dee' => 'Thai',\n 'Merhaba' => 'Turkish',\n 'Vitayu' => 'Ukrainian',\n 'Xin chào' => 'Vietnamese',\n 'Hylo; Sut Mae?' => 'Welsh',\n 'Sholem Aleychem' => 'Yiddish',\n 'Sawubona' => 'Zulu');\n \n $greeting = array_rand($greetings);\n $language = $greetings[$greeting];\n $this->_privmessage($greeting .' '. $this->_data->nick .'! (That\\'s how you greet someone in '. $language .')', $this->_data->nick);\n $this->_privmessage('Type \"!help\" to find out what I can do for you.', $this->_data->nick);\n }", "public function message($msg=\"\"){// $msg its optional it may not be sent.\r\n\t\t\r\n\t\t if (!empty($msg)){\r\n\t\t\t \r\n\t\t\t // here \"set_message\"\r\n\t\t\t // make sure you understand why $this->message = $msg wouldn't work.//-> difference between global array SESSION and a object Session.\r\n\t\t\t $_SESSION['message']=$msg;\r\n\t\t\t \r\n\t\t }else{\r\n\t\t\t // here \"get_message\"\r\n\t\t\t return $this->message;\r\n\t\t }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function getData($lastID) {\r\n\r\n include(\"include/settings.php\"); # getting table prefix\r\n include(\"include/offset.php\");\r\n\r\n # discard it if we are editing\r\n $sid = isset($_GET[\"sid\"])?$_GET[\"sid\"]:0; # get shout id (sid)and set it to zero for bool\r\n\r\n \r\n $sql = \"SELECT * FROM {$TABLE_PREFIX}chat WHERE id > \".$lastID.\" AND id != \".$sid.\" ORDER BY id DESC\";\r\n $conn = his_getDBConnection(); # establishes the connection to the database\r\n $results = mysqli_query( $conn, $sql);\r\n \r\n # getting the data array\r\n while ($row = mysqli_fetch_array($results)) {\r\n \r\n # creating and naming array\r\n $id = $row[id];\r\n $uid = $row[uid];\r\n $time = $row[time];\r\n $name = $row[name];\r\n $text = $row[text];\r\n \r\n # if no name is present somehow, $name and $text are set to the strings under\r\n # we assume all must be ok, othervise no post will be made by javascript check\r\n # if ($name == '') { $name = 'Anonymous'; $text = 'No message'; }\r\n \r\n # we lego put together our chat using some conditions and css and javascript this time\r\n\r\n print \"<span class='name'>\".date(\"d/m/Y H:i:s\", $time - $offset).\" | <a href=\\\"javascript:windowunder('index.php?page=userdetails&amp;id=\".$uid.\"')\\\">\".$name.\"</a>:</span>\";\r\n\r\n global $CURUSER;\r\n \r\n if ($CURUSER[\"admin_access\"]!=\"yes\" && $CURUSER[\"uid\"]!=\"\".$uid.\"\") {}\r\n \r\n else {\r\n # edit/delete buttons -->\r\n print \"<div style='text-align:right;\r\n margin-top:-13px;\r\n margin-bottom:-3.5px;\r\n '>\r\n <a href='index.php?page=allshout&amp;sid=$id&amp;edit'><img border='0' class='EditSwap' src='images/canvas.gif' alt='' /></a>\r\n <a onclick=\\\"return confirm('\". str_replace(\"'\",\"\\'\",DELETE_CONFIRM).\"')\\\" href='index.php?page=allshout&amp;sid=$id&amp;delete'>\r\n <img border='0' class='DeleteSwap' src='images/canvas.gif' alt='' /></a>\r\n </div>\";\r\n \r\n }\r\n \r\n # chat output -->\r\n print \"<div class='chatoutput'>\".format_shout($text).\"</div>\"; \r\n }\r\n}", "public static function tcp_sender(): void\n {\n //Set TCP server host address and port\n sock::$host = self::host;\n sock::$port = self::port;\n\n //Set Socket type to 'tcp:sender'\n sock::$type = 'tcp:sender';\n\n //Create Socket (sender)\n $ok = sock::create();\n\n if (!$ok) exit('TCP Sender creation failed!');\n\n do {\n $data = [];\n\n echo 'Please input your commands, we will send it to others: ';\n\n $msg = fgets(STDIN);\n\n $data[] = ['msg' => $msg];\n\n //Send data to Server\n $result = sock::write($data);\n\n echo PHP_EOL . '============================================' . PHP_EOL;\n echo $result[0] ? 'Message: \"' . trim($msg) . '\" sent successfully!' : 'Send failed!';\n echo PHP_EOL . '============================================' . PHP_EOL;\n\n //Listen to TCP port\n sock::listen();\n\n //Read data from server\n $msg = sock::read();\n\n $received = current($msg)['msg'];\n\n $list = false !== strpos($received, PHP_EOL) ? explode(PHP_EOL, $received) : [$received];\n\n $list = array_filter($list);\n\n if (empty($list)) continue;\n\n if (1 < count($list) || 'OK! ' !== substr($list[0], 0, 4)) {\n echo PHP_EOL . 'Wow, you have messages unread!' . PHP_EOL;\n echo PHP_EOL . '↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓' . PHP_EOL . PHP_EOL;\n }\n\n foreach ($list as $cmd) {\n $cmd = trim($cmd);\n\n if ('OK! ' === substr($cmd, 0, 4)) {\n echo PHP_EOL . $cmd . PHP_EOL . PHP_EOL;\n continue;\n }\n\n echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' . PHP_EOL;\n echo $cmd . PHP_EOL;\n echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' . PHP_EOL . PHP_EOL;\n echo '!!!Do NOT execute the command that you don\\'t know!!!' . PHP_EOL;\n echo 'Execute the messages? (y/n): ';\n echo PHP_EOL . PHP_EOL;\n\n $input = fgets(STDIN);\n\n if ('y' === strtolower(trim($input))) {\n exec($cmd, $out);\n echo 'Executed. The command shows:' . PHP_EOL;\n echo '============================================' . PHP_EOL;\n var_dump($out);\n echo '============================================' . PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL;\n }\n }\n } while (true);\n }", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "public function toJSONChat() \n\t{\n\t\treturn json_encode(array('sender' => $this->sender,\n\t\t\t'message' => $this->message,\n\t\t\t'time' => $this->time));\t\t\n\t}", "public function actionChats()\n {\n $last_id = Yii::$app->request->get('lastID', 0);\n $query = UserChatMessage::find()->where([\n '>',\n 'id',\n $last_id\n ]);\n \n $response = [];\n foreach ($query->all() as $entry) {\n $response[] = [\n 'id' => $entry->id,\n 'message' => $entry->message,\n 'author' => [\n 'name' => $entry->user->displayName,\n 'gravatar' => $entry->user->getProfileImage()->getUrl(),\n 'profile' => Url::toRoute([ \n '/user/profile',\n 'uguid' => $entry->user->guid\n ])\n ],\n 'time' => [\n 'hours' => Yii::$app->formatter->asTime($entry->created_at, 'php:H'),\n 'minutes' => Yii::$app->formatter->asTime($entry->created_at, 'php:i')\n ]\n ];\n }\n Yii::$app->response->format = 'json';\n return $response;\n }", "private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n if (!empty($postStr)){\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch ($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->receiveText1($postObj);\n break;\n case \"event\":\n $resultStr = $this->receiveEvent($postObj);\n break;\n default:\n $resultStr = \"\";\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n // \t//extract post data\n\t\t// if (!empty($postStr)){\n // /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n // the best way is to check the validity of xml by yourself */\n // libxml_disable_entity_loader(true);\n // \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n // $fromUsername = $postObj->FromUserName;\n // $toUsername = $postObj->ToUserName;\n // $keyword = trim($postObj->Content);\n // $time = time();\n // $textTpl = \"<xml>\n\t\t// \t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t// \t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t// \t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t// \t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t// \t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t// \t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t// \t\t\t\t\t</xml>\"; \n\t\t// \t\tif(!empty( $keyword ))\n // {\n // \t\t$msgType = \"text\";\n // \t$contentStr = \"Welcome to wechat world!\";\n // \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n // \techo $resultStr;\n // }else{\n // \techo \"Input something...\";\n // }\n\n // }else {\n // \techo \"\";\n // \texit;\n // }\n }", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "public function send_chat_messageAction()\n\t{\n\t\t$user = $this->user;\n $user_id = $user['id'];\n\t\t$from = $user['id'];\n\t\t$data = json_decode($this->request->getPost(\"dataArray\"), true);\n\t\t$chat_id = $data['chat_id'];\n $application_id = $user['Application_ID'];\n\n // store the message\n\t\t$this->db->insert(\n\t\t 'data_messages',\n\t\t array($data['message'], time(), $application_id, 20195),\n\t\t array('content', 'created_at', 'application_id', 'module_id')\n\t\t);\n\t\t$messageid = $this->db->lastInsertId();\n\n\t\t// store the relation\n\t\t$this->db->insert(\n\t\t 'data_message_relations',\n\t\t array($messageid, 0, $from, $chat_id, $application_id, 20195),\n\t\t array('data_message_id', 'deleted', 'from_user_id', 'data_cms_id', 'application_id', 'module_id')\n\t\t);\n\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => []\n ];\n\n return $this->sendJson($response);\n\t}", "function printMessages()\n {\n //check if messages buffer contain any values\n if(isset($_SESSION['msg']))\n {\n echo \"{$_SESSION['msg']}\";\n unset($_SESSION['msg']);\n }\n }", "function _sendMessage($chatId, $text, $keyboard = null){\n if(isset($keyboard)) {\n $keyboard = json_encode($keyboard);\n }\n\n $data = [\n 'chat_id' => $chatId,\n 'parse_mode' => 'HTML',\n 'text' => $text,\n 'reply_markup' => $keyboard,\n ];\n \n return Request('sendMessage', $data);\n}", "public function getChatMessages($chat_id, $last_chat_time, $userId)\n\t{\n\t\t//echo \"time\" . $last_chat_time;\n\t\t$test = WIDebate::chatClass($chat_id, $userId);\n\t\t//echo \"test\" . $test;\n\t\t$sql = \"SELECT wi_msg.* FROM wi_msg INNER JOIN ( SELECT id FROM wi_msg WHERE chat_id = :chat_id ORDER BY id ASC) AS items ON wi_msg.id = items.id\";\n\t\t$stmt = $this->WIdb->prepare($sql);\n\t\t$stmt->bindParam( ':chat_id',$chat_id,PDO::PARAM_INT);\n $stmt->execute();\n\n\t\t while($chats = $stmt->fetchAll(PDO::FETCH_ASSOC)){\n \t\t\tforeach ($chats as $chat) {\n \t$msgUserId = $chat['user_id'];\n \t\t$username = WIDebate::chatUserName('username', $msgUserId);\n \t if ($test === $msgUserId) {\n \techo '<div class=\"message-row response-debate\" id=\"' . $chat['id'] . '\" data-op-id=\"0\">\n<div class=\"msg-date\">' . $chat['wtime'] . '</div>\n<span class=\"usr-tit\"><i class=\"material-icons chat-operators\">' . $username . ' </i></span><span>' . $username . ' says:</span>' . $chat['msg'] . '</div>';\n }\n else {\n \techo '<div class=\"message-row response-request\" id=\"' . $chat['id'] . '\" data-op-id=\"0\">\n<div class=\"msg-date\">' . $chat['wtime'] . '</div>\n<span><i class=\"material-icons chat-operators\">' . $username . ' </i></span><span>' . $username . ' says:</span>' . $chat['msg'] . '</div>';\n }\n \n \t\n \t\t\t}\n \t\t\t\n \t\t} \n\t\t\n\t}", "public function chat_post(){ // send message\n\n $message = array(\n 'req_id'=> $this->input->post('req_id'),\n 'from_id'=> $this->input->post('from_id'),\n 'to_id'=> $this->input->post('to_id'),\n 'message'=> $this->input->post('message'),\n 'date_created'=>date('Y-m-d H:i:a')\n );\n $fromdata = $this->User_model->select_data('*','tbl_users',array('id'=>$message['from_id']));\n $todata = $this->User_model->select_data('*','tbl_users',array('id'=>$message['to_id']));\n $message['fromUser_type'] = $fromdata[0]->user_type;\n $message['toUser_type'] = $todata[0]->user_type;\n $pushData['Utype'] = ($todata[0]->user_type == 2)?2:1;\n $toLoginData =$this->User_model->selectLogin($message['to_id']);\n $pushData['message'] = $message['message'];\n $pushData['action'] = \"chat\";\n $pushData['from_name'] = $fromdata[0]->fname.''.$fromdata[0]->lname;\n $pushData['profile_pic'] = $fromdata[0]->profile_pic;\n $pushData['req_id'] = $message['req_id'];\n $pushData['is_quote'] = '';\n $pushData['value'] = '';\n $pushData['from_id'] = $message['from_id'];\n $pushData['spMessage'] = \"You have recieved a message from \".$fromdata[0]->fname.''.$fromdata[0]->lname;\n foreach ($toLoginData as $pushVal) {\n $pushData['token'] = $pushVal->token_id;\n if($pushVal->device_id == 1){\n $this->User_model->iosPush($pushData);\n }else if($loginUsers->device_id == 0){\n $this->User_model->androidPush($pushData);\n }\n }\n\n $data = $this->User_model->insert_data('tbl_chat',$message);\n\n if(empty($data)){\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"chat\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Message not send\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"chat\",\n \"ResponseCode\" => true,\n \"MessageWhatHappen\" => \"Message send successfully\"\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "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 displayMessages()\n {\n global $db;\n $query = $db->query(\" SELECT * FROM messages\n WHERE messages.s = 'ilyes ouakouak' AND messages.r = 'IlyBot'\n \");\n\n $results = [];\n while ($result = $query->fetch()) {\n $results[] = $result;\n }\n\n return $results;\n }", "function message()\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$this->common_header('domessage', 'Board Message', 'You may change the configuration below. HTML is enabled, and BBCode will be enabled in later versions.');\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>Turn the message system off?</b>\",\r\n\t\t $SKIN->form_yes_no(\"global_message_on\", $INFO['global_message_on'])\r\n\t\t ));\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>The message to display</b>\",\r\n\t\t $SKIN->form_textarea(\"global_message\", $INFO['global_message'])\r\n\t\t ));\r\n\r\n\t\t$this->common_footer();\r\n\r\n\t}", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function SendTextMessage($answer, $sender, $accessToken, $input){\n\t$response = [\n\t 'recipient' => [ 'id' => $sender ],\n\t 'message' => [ 'text' => $answer ]\n\t];\n\n\t$ch = curl_init('https://graph.facebook.com/v3.3/me/messages?access_token='.$accessToken);\n\tcurl_setopt($ch, CURLOPT_POST, true);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($response));\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n\n\tif(!empty($input)){\n\t$result = curl_exec($ch);\n\t}\n\tcurl_close($ch);\n\t\n}" ]
[ "0.69176185", "0.67390865", "0.67303836", "0.67181855", "0.65749526", "0.6537105", "0.6471842", "0.6453678", "0.6404179", "0.6396799", "0.6349779", "0.6339672", "0.6339672", "0.6339672", "0.63150567", "0.6272789", "0.6198662", "0.6198259", "0.6192737", "0.61701316", "0.6164597", "0.61560553", "0.6137989", "0.61359864", "0.60892195", "0.6083178", "0.60789114", "0.60741454", "0.60689354", "0.6014597", "0.6010583", "0.5960868", "0.59587914", "0.59500366", "0.5909996", "0.5909628", "0.5904907", "0.5904547", "0.5901147", "0.58961946", "0.5893879", "0.5885402", "0.58801335", "0.58798844", "0.5854357", "0.5853714", "0.5842447", "0.5829261", "0.5822938", "0.5818097", "0.5785303", "0.5783369", "0.5759998", "0.57592976", "0.57577443", "0.5743468", "0.5742277", "0.572222", "0.5714322", "0.57003593", "0.5691201", "0.5688715", "0.5688358", "0.56874377", "0.5687241", "0.5684165", "0.56654835", "0.56635106", "0.56553346", "0.5654153", "0.56403947", "0.5622942", "0.56202036", "0.5595205", "0.5592323", "0.5592277", "0.55918455", "0.55796367", "0.5576318", "0.5573548", "0.55600977", "0.55546653", "0.5552316", "0.5544632", "0.55320144", "0.5531397", "0.5530077", "0.5528475", "0.55270153", "0.55231524", "0.55229896", "0.5518386", "0.55104494", "0.54885215", "0.54883444", "0.5480422", "0.5480415", "0.54801005", "0.54784966", "0.54655164", "0.5462654" ]
0.0
-1
Render the div full of chat messages.
function render_chat_messages($sql, $chatlength, $show_elipsis=null){ // Eventually there might be a reason to abstract out get_chats(); $sql->Query("SELECT send_from, message FROM chat ORDER BY id DESC LIMIT $chatlength");// Pull messages $chats = $sql->fetchAll(); $message_rows = ''; $messageCount = $sql->QueryItem("select count(*) from chat"); if (!isset($show_elipsis) && $messageCount>$chatlength){ $show_elipsis = true; } $res = "<div class='chatMessages'>"; foreach($chats AS $messageData) { // *** PROBABLY ALSO A SPEED PROBLEM AREA. $message_rows .= "[<a href='player.php?player={$messageData['send_from']}' target='main'>{$messageData['send_from']}</a>]: ".out($messageData['message'])."<br>\n"; } $res .= $message_rows; if ($show_elipsis){ // to indicate there are more chats available $res .= ".<br>.<br>.<br>"; } $res .= "</div>"; return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderChatView() {\n\n $messages = $this->loadMessages();\n require 'public/views/front/chatView.phtml';\n\n }", "function constructMessagesDiv($messageStr)\n{\n $codeSnippLanguagesArr=[\"html\",\"javascript\",\"python\",\"php\"];\n // echo $messageStr;\n $web_service = new WebService();\n $currentChannelMessages = json_decode($messageStr);\n // var_dump($currentChannelMessages);\n\n $msgStr='';\n $prevdate='';\n $prevUser='';\n $prevTime='';\n if ($currentChannelMessages!=null)\n {\n $remainingMessages= $currentChannelMessages->messageCount;\n // echo $remainingMessages;\n\n $lastmessageid= $currentChannelMessages->lastmessageid;\n // echo $lastmessageid;\n if($remainingMessages==0)\n echo '<div>This is the begining of Chat....</div>';\n else if($remainingMessages>0)\n echo '<div class=\"oldMessages\" id='.$lastmessageid.'><a>Loading more Messages...</a></div>';\n $currentChannelMessages=$currentChannelMessages->messages;\n\n date_default_timezone_set('America/New_York');\n $time= time();\n $today = date(\"l, F jS, o\", $time);\n foreach ($currentChannelMessages as $message)\n {\n// echo json_encode($message);\n $currentDate=$web_service->getFormatDate($message->created_at);\n $currentTime=$web_service->getFormatTime($message->created_at);\n $shortName= $message->first_name[0];\n if($message->last_name == '' || $message->last_name== null){\n $shortName.= $message->first_name[1];\n }else{\n $shortName.= $message->last_name[0];\n }\n $defUserPicBGColorArr = ['#3F51B5','#2196F3','#00BCD4','#CDDC39','#FF5722'];\n $defUserPicBGColor = $defUserPicBGColorArr[((int)$message->user_id)%5];\n if($currentDate==$today)\n $currentDate='Today';\n\n\n if($prevUser=='' && $prevTime=='')\n {\n if($prevdate!=$currentDate)\n {\n $msgStr.='<div class=\"row dayDividerWrapper\"><div class=\"daySeperatorLine col-xs-5 pull-left\"> </div><div class=\"dayDividerText col-xs-2\">'.$currentDate.'</div><div class=\"daySeperatorLine col-xs-5 pull-right\"> </div></div>';\n $prevdate=$currentDate;\n }\n// echo'in 1 if';\n\n $msgStr.='<div class=\"row messageSet\"><div class=\"col-xs-1 userPic\">';\n if($message->profile_pic_pref==1)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.get_gravatar($message->email_id) .') !important;background-size: 36px 36px !important;\">';\n }\n else if($message->profile_pic_pref==2)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.$message->github_avatar .') !important;background-size: 36px 36px !important;\">';\n }\n else if($message->profile_pic_pref==0)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.$message->profile_pic .') !important;background-size: 36px 36px !important;\">';\n }\n else\n {\n $msgStr.='<div class=\"defUserPic\" style=\"background:'.$defUserPicBGColor .';\">'. htmlspecialchars(strtoupper($shortName)); \n }\n $msgStr.='</div></div><div class=\"col-xs-11 message\"><div class=\"message_header\" userid=\"'. $message->user_id .'\" ><b>';\n \n $msgStr.=htmlspecialchars($message->first_name);\n $msgStr.=' '.htmlspecialchars($message->last_name).'</b><span class=\"message_time\"> ';\n $msgStr.=$currentTime;\n $msgStr.='</span></div>';\n $dynamicClassNameWithId = \"messagewithid_\".$message->message_id;\n $msgStr.='<div class=\"message_body '.$dynamicClassNameWithId.'\" id=\"'.$message->message_id.'\">';\n $msgStr.= messageContentHelper ($message); // this method construct the message content in the format need\n $msgStr.='<div class=\"msg_reactionsec\">';\n // print_r($message->emojis);\n if($message->emojis!='0')\n foreach ($message->emojis as $emoji)\n {\n $msgStr.='<div class=\"emojireaction\" emojiid=\"'.$emoji->emoji_id.'\"><i class=\"'.$emoji->emoji_pic.'\"></i><span class=\"reactionCount\">'.$emoji->count.'</span></div>';\n }\n if($message->is_threaded==1)\n {\n $thread=$message->threads->threadCount;\n $msgStr.=\"<div class='repliescount' title='view thread'><a href='#'><span>\".$thread.'</span> replies'.\"</a></div>\";\n\n }\n $msgStr.=' </div></div>';\n $prevUser=$message->first_name;\n $prevTime=$currentTime;\n\n }\n else if($prevUser==$message->first_name && $prevTime==$currentTime )\n {\n // echo'in 2 if';\n $dynamicClassNameWithId = \"messagewithid_\".$message->message_id;\n\n $msgStr.='<div class=\"message_body addOnMessages '.$dynamicClassNameWithId.'\" id=\"'.$message->message_id.'\">';\n $msgStr.= messageContentHelper ($message); // this method construct the message content in the format need\n $msgStr.='<div class=\"msg_reactionsec\">';\n if($message->emojis!='0')\n foreach ($message->emojis as $emoji)\n {\n $msgStr.='<div class=\"emojireaction\" emojiid=\"'.$emoji->emoji_id.'\"><i class=\"'.$emoji->emoji_pic.'\"></i><span class=\"reactionCount\">'.$emoji->count.'</span></div>';\n }\n if($message->is_threaded==1)\n {\n $thread=$message->threads->threadCount;\n $msgStr.=\"<div class='repliescount' title='view thread'><a href='#'><span>\".$thread.'</span> replies'.\"</a></div>\";\n\n }\n $msgStr.=' </div></div>';\n $prevUser=$message->first_name;\n $prevTime=$currentTime;\n }\n else if($prevUser!=$message->first_name || $prevTime!=$currentTime)\n {\n // echo'in 3 if';\n $msgStr.='</div></div>';\n if($prevdate!=$currentDate)\n {\n $msgStr.='<div class=\"row dayDividerWrapper\"><div class=\"daySeperatorLine col-xs-5 pull-left\"> </div><div class=\"dayDividerText col-xs-2\">'.$currentDate.'</div><div class=\"daySeperatorLine col-xs-5 pull-right\"> </div></div>';\n $prevdate=$currentDate;\n }\n // $msgStr.= $message->profile_pic;\n $msgStr.='<div class=\"row messageSet\"><div class=\"col-xs-1 userPic\">';\n if($message->profile_pic_pref==1)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.get_gravatar($message->email_id) .') !important;background-size: 36px 36px !important;\">';\n }\n else if($message->profile_pic_pref==2)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.$message->github_avatar .') !important;background-size: 36px 36px !important;\">';\n }\n else if($message->profile_pic_pref==0)\n {\n $msgStr.='<div class=\"defUserPic profilePic\" style=\"background-image:url('.$message->profile_pic .') !important;background-size: 36px 36px !important;\">';\n }\n else\n {\n $msgStr.='<div class=\"defUserPic\" style=\"background:'.$defUserPicBGColor .';\">'. htmlspecialchars(strtoupper($shortName)); \n }\n $msgStr.='</div></div><div class=\"col-xs-11 message\"><div class=\"message_header\" userid=\"'. $message->user_id .'\" ><b>';\n $msgStr.=htmlspecialchars($message->first_name);\n $msgStr.=' '.htmlspecialchars($message->last_name).'</b><span class=\"message_time\"> ';\n $msgStr.=$currentTime;\n $msgStr.='</span></div>';\n $dynamicClassNameWithId = \"messagewithid_\".$message->message_id;\n $msgStr.='<div class=\"message_body '.$dynamicClassNameWithId.'\" id=\"'.$message->message_id.'\">';\n $msgStr.= messageContentHelper ($message); // this method construct the message content in the format need\n $msgStr.='<div class=\"msg_reactionsec\">';\n if($message->emojis!='0')\n foreach ($message->emojis as $emoji)\n {\n $msgStr.='<div class=\"emojireaction\" emojiid=\"'.$emoji->emoji_id.'\"><i class=\"'.$emoji->emoji_pic.'\"></i><span class=\"reactionCount\">'.$emoji->count.'</span></div>';\n }\n if($message->is_threaded==1)\n {\n $thread=$message->threads->threadCount;\n $msgStr.=\"<div class='repliescount' title='view thread'><a href='#'><span>\".$thread.'</span> replies'.\"</a></div>\";\n\n }\n $msgStr.=' </div></div>';\n $prevUser=$message->first_name;\n $prevTime=$currentTime;\n }\n }\n $msgStr.='</div></div>';\n\n }\n else\n {\n $msgStr=\"<div>No messages in this channel..</div>\";\n }\n echo $msgStr;\n}", "function ajan_core_render_message() {\n\n\t// Get ActivityNotifications\n\t$ajan = activitynotifications();\n\n\tif ( !empty( $ajan->template_message ) ) :\n\t\t$type = ( 'success' === $ajan->template_message_type ) ? 'updated' : 'error';\n\t\t$content = apply_filters( 'ajan_core_render_message_content', $ajan->template_message, $type ); ?>\n\n\t\t<div id=\"message\" class=\"ajan-template-notice <?php echo esc_attr( $type ); ?>\">\n\n\t\t\t<?php echo $content; ?>\n\n\t\t</div>\n\n\t<?php\n\n\t\tdo_action( 'ajan_core_render_message' );\n\n\tendif;\n}", "public function render()\n\t{\n\t\tif (!$this->config->get('outmess::enabled')) return '';\n\n\t\t$output = '';\n\n\t\tforeach ($this->messages as $message)\n\t\t\t$output .= $this->renderOne($message);\n\n\t\treturn $output;\n\t}", "function show()\n {\n $messages = $this->Session->read( 'messages' );\n $html = '';\n \n // Add a div for each message using the type as the class\n foreach ($messages as $type => $msgs)\n {\n foreach ($msgs as $msg)\n {\n if (!empty($msg)) {\n $html .= \"<div class='$type'><p>$msg</p></div>\";\n } \n }\n }\n $html .= \"</div>\";\n \n // Clear the messages array from the session\n $this->Session->del( 'messages' );\n \n return $this->output( $html );\n }", "public function renderForm()\n\t{\n\t\t$this->beginForm();\n\t\t$this->renderMessageInput();\n\t\techo Html::beginTag('div', array('class' => 'chat-from-actions'));\n\t\t$this->renderSubmit();\n\t\techo Html::endTag('div');\n\t\t$this->endForm();\n\t}", "public static function render_messages()\n\t\t{\t$output = '';\n\t\t\tif ( !empty( self::$messages ) )\n\t\t\t{\t$output .= '<div class=\"wpvm_messages\">';\n\t\t\t\t$output .= implode( '', self::$messages );\n\t\t\t\t$output .= '</div>';\n\t\t\t}\n\n\t\t\treturn $output;\n\t\t}", "public function showReceivedMessages()\n {\n $messageService = $this->get(MessageService::class);\n $messages = $messageService->showReceivedMessages($this->getUser());\n\n return $this->render('message/receivedMessages.html.twig', array(\n 'messages' => $messages,\n ));\n\n }", "public function chat()\n {\n $errors = [];\n $formValid = false;\n $params = [\n // dans la vue, les clés deviennent des variables\n 'formValid' => $formValid,\n 'errors' => $errors,\n ];\n\n // Affichage du chat seulement si connecté\n if(!empty($this->getUser())){\n $this->show('chat/chat', $params);\n }\n else{{\n $this->showNotFound(); // sinon page 404\n }}\n\n }", "public function render()\n {\n // Pass messages by reference, as all messages are created after this function call\n $data = [ \"messages\" => &$this->messages ];\n $this->di->view->add($this->template, $data, $this->region);\n }", "public function getChat()\n {\n return view('chat');\n }", "public function getMessageHolder () {\n $messages = $this->getMessages();\n $messages_body = '';\n\n if ($messages) {\n $container_name = 'paddy-messenger with-messages';\n\n foreach ($messages as $namespace => $submessages) {\n foreach ($submessages as $message) {\n $messages_body .= '<li class=\"' . $namespace . '\">' . $message . '</li>';\n }\n }\n } else {\n $container_name = 'paddy-messenger no-messages';\n }\n\n return '<ul class=\"' . $container_name . '\">' . $messages_body . '</ul>';\n }", "public function render()\n {\n return view('components.create-message');\n }", "public function render() {\n\t\techo $this->header->toString();\n\t\techo $this->panel->toString();\n\t\techo $this->page->toString();\n\t\tif( $this->getMessages() != null ) {\n\t\t\techo $this->messages->toString();\n\t\t}\n\t\techo $this->footer->toString();\n\t}", "public function directchatmessagesAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $chatMessages = $em->getRepository('ReclamationBundle:ChatMessage')->findAll();\n\n return $this->render('chatmessage/direct_chat_messages.html.twig', array(\n 'chatMessages' => $chatMessages,\n 'page_title' => 'Chat'\n ));\n }", "public function run()\r\n\t{\r\n $this->render('MessageDisplay');\r\n\t}", "public function render() {\n\t\t$supportUrl = 'https://wpml.org/forums/forum/english-support/?utm_source=plugin&utm_medium=gui&utm_campaign=wpmltm';\n\t\t$supportLink = '<a target=\"_blank\" rel=\"nofollow\" href=\"' . esc_url( $supportUrl ) . '\">'\n\t\t . esc_html__( 'contact our support team', 'wpml-translation-management' )\n\t\t . '</a>';\n\n\n\t\t?>\n\t\t<div id=\"ams-ate-console\">\n\t\t\t<div class=\"notice inline notice-error\" style=\"display:none; padding:20px\">\n\t\t\t\t<?php echo sprintf(\n\t\t\t\t// translators: %s is a link with 'contact our support team'\n\t\t\t\t\tesc_html(\n\t\t\t\t\t\t__( 'There is a problem connecting to automatic translation. Please check your internet connection and try again in a few minutes. If you continue to see this message, please %s.', 'wpml-translation-management' )\n\t\t\t\t\t),\n\t\t\t\t\t$supportLink\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<span class=\"spinner is-active\" style=\"float:left\"></span>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\tsetTimeout(function () {\n\t\t\t\tjQuery('#ams-ate-console .notice').show();\n\t\t\t\tjQuery(\"#ams-ate-console .spinner\").removeClass('is-active');\n\t\t\t}, 20000);\n\t\t</script>\n\t\t<?php\n\t}", "public function chat_messagesAction()\n\t{\n\t\t$chat_id = $this->request->getQuery(\"chat_id\");\n\n\t\t$user = $this->user;\n $user_id = $user['id'];\n $application_id = $user['Application_ID'];\n\n $messages = MessagesRelation::find([\n \"application_id = {$application_id} AND data_cms_id = {$chat_id}\"\n ]);\n\n\t\t$data = [];\n\t\tforeach ($messages as $key => $msg) {\n\t\t\t$data[\"messages\"][$key][\"from_user\"] = $msg->sender->Title;\n\t\t\t$data[\"messages\"][$key][\"from_user_id\"] = $msg->sender->ID;\n\t\t\t$data[\"messages\"][$key][\"last_message\"] = $msg->message->content;\n\t\t\t$data[\"messages\"][$key][\"last_message_time\"] = $msg->message->created_at;\n\t\t}\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => $data\n ];\n\n return $this->sendJson($response);\n\t}", "public function outputMsgs() {\n\t\t$messages = $_SESSION['msg'];\n\t\t$output = null;\n\n\t\tif(isset($messages)) {\n\t\t\tforeach($messages as $key => $message) {\n\t\t\t\t$output .= '<div class=\"' . $message['type'] . '\"><p>' . $message['content'] . '</p></div>';\n\t\t\t}\n\t\t}\n\n\t\t\treturn $output;\n\t\t}", "protected function renderMessage() {}", "public function renderContents()\n {\n if ($this->close) {\n echo '<button class=\"close\" data-dismiss=\"alert\">&times</button>';\n }\n echo $this->message;\n }", "function messaging_inbox_page_output() {\n\tglobal $wpdb, $wp_roles, $current_user, $user_ID, $current_site, $messaging_official_message_bg_color, $messaging_max_inbox_messages, $messaging_max_reached_message, $wp_version;\n\n\tif (isset($_GET['updated'])) {\n\t\t?><div id=\"message\" class=\"updated fade\"><p><?php echo stripslashes(sanitize_text_field($_GET['updatedmsg'])) ?></p></div><?php\n\t}\n\n\t$action = isset($_GET[ 'action' ]) ? $_GET[ 'action' ] : '';\n\n\techo '<div class=\"wrap\">';\n\tswitch( $action ) {\n\t\t//---------------------------------------------------//\n\t\tdefault:\n\t\t\tif ( isset($_POST['Remove']) ) {\n\t\t\t\tmessaging_update_message_status(intval($_POST['mid']),'removed');\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode(__('Message removed.', 'messaging')) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\tif ( isset($_POST['Reply']) ) {\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&action=reply&mid=\" . intval($_POST['mid']) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status != %s\", $user_ID, 'removed'));\n\t\t\t$tmp_unread_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'unread'));\n\t\t\t$tmp_read_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'read'));\n\t\t\t?>\n <h2><?php _e('Inbox', 'messaging') ?> <a class=\"add-new-h2\" href=\"admin.php?page=messaging_new\"><?php _e('New Message', 'messaging') ?></a></h2>\n <?php\n\t\t\tif ($tmp_message_count == 0){\n\t\t\t?>\n <p><?php _e('No messages to display', 'messaging') ?></p>\n <?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Usage', 'messaging') ?></h3>\n <p>\n\t\t\t\t<?php _e('Maximum inbox messages', 'messaging') ?>: <strong><?php echo $messaging_max_inbox_messages; ?></strong>\n <br />\n <?php _e('Current inbox messages', 'messaging') ?>: <strong><?php echo $tmp_message_count; ?></strong>\n </p>\n <?php\n\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t?>\n <p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\tif ($tmp_unread_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Unread', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %s AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'unread');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t//=========================================================//\n\t\t\t\tif ($tmp_read_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Read', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'read');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"view\":\n\t\t\t$tmp_total_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d\", $user_ID));\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t\tif ($tmp_total_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t?>\n\t\t\t\t\t<p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t\t<?php\n\t\t\t\t\t} else {\n\t\t\t\t\tmessaging_update_message_status(intval($_GET['mid']),'read');\n\t\t\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t\t\t$tmp_message_status = $wpdb->get_var($wpdb->prepare(\"SELECT message_status FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_message_status = ucfirst($tmp_message_status);\n\t\t\t\t\t$tmp_message_status = __($tmp_message_status, 'messaging');\n\t\t\t\t\t$tmp_message_stamp = $wpdb->get_var($wpdb->prepare(\"SELECT message_stamp FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t?>\n\n\t\t\t\t\t<h2><?php _e('View Message: ', 'messaging') ?><?php echo intval($_GET['mid']); ?></h2>\n\t\t\t\t\t<form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging\">\n\t\t\t\t\t<input type=\"hidden\" name=\"mid\" value=\"<?php echo intval($_GET['mid']); ?>\" />\n\t\t\t\t\t<h3><?php _e('Sent', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message_stamp); ?></p>\n\t\t\t\t\t<h3><?php _e('Status', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_status; ?></p>\n\t\t\t\t\t<h3><?php _e('From', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_username; ?></p>\n\t\t\t\t\t<h3><?php _e('Subject', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_subject; ?></p>\n\t\t\t\t\t<h3><?php _e('Content', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_content; ?></p>\n <p class=\"submit\">\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Back', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Remove\" value=\"<?php _e('Remove', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-primary\" type=\"submit\" name=\"Reply\" value=\"<?php _e('Reply', 'messaging') ?>\" />\n </p>\n\t\t\t\t\t</form>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t?>\n <p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n <?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"remove\":\n\t\t\t//messaging_update_message_status($_GET['mid'],'removed');\n\t\t\tmessaging_remove_message(intval($_GET['mid']));\n\t\t\techo \"\n\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Message removed.') . \"';\n\t\t\t</script>\n\t\t\t\";\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply\":\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t$tmp_message_subject = __('RE: ', 'messaging') . $tmp_message_subject;\n\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t//$tmp_message_content = \"\\n\\n\" . $tmp_username . __(' wrote:') . '<hr>' . $tmp_message_content;\n\n\t\t\t$rows = get_option('default_post_edit_rows');\n if (($rows < 3) || ($rows > 100)){\n $rows = 12;\n\t\t\t}\n $rows = \"rows='$rows'\";\n\n if ( user_can_richedit() ){\n add_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t}\n\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n ?>\n\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo $tmp_username; ?>\" class=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_username; ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php echo $tmp_username . __(' wrote', 'messaging'); ?></th>\n <td><?php echo $tmp_message_content; ?>\n <br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td>\n\t\t\t<?php if (version_compare($wp_version, \"3.3\") >= 0 && user_can_richedit()) { ?>\n\t\t\t\t<?php wp_editor('', 'message_content'); ?>\n\t\t\t<?php } else { ?>\n\t\t\t\t<textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'></textarea>\n\t\t\t<?php } ?>\n\n\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form> <?php\n\t\t\t} else {\n\t\t\t?>\n\t\t\t<p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n\t\t\t<?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply_process\":\n\t\t\tif ($_POST['message_to'] == '' || $_POST['message_subject'] == '' || $_POST['message_content'] == ''){\n\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t$rows = 12;\n\t\t\t\t}\n\t\t\t\t$rows = \"rows='$rows'\";\n\n\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\tadd_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t\t}\n\t\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n\t\t\t\t?>\n\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n <p><?php _e('Please fill in all required fields', 'messaging') ?></p>\n\t\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n\t\t\t\t\t\tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n\t\t\t\t\t\tstyle=\"width: 95%\" maxlength=\"200\"\n\t\t\t\t\t\tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n\t\t\t\t\t<td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php _e('Required', 'messaging') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n\t\t\t\t</form>\n\t\t<?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//==========================================================//\n\t\t\t\t$tmp_usernames = sanitize_text_field($_POST['message_to']);\n\t\t\t\t//$tmp_usernames = str_replace( \",\", ', ', $tmp_usernames );\n\t\t\t\t//$tmp_usernames = ',,' . $tmp_usernames . ',,';\n\t\t\t\t//$tmp_usernames = str_replace( \" \", '', $tmp_usernames );\n\t\t\t\t$tmp_usernames_array = explode(\",\", $tmp_usernames);\n\t\t\t\t$tmp_usernames_array = array_unique($tmp_usernames_array);\n\n\t\t\t\t$tmp_username_error = 0;\n\t\t\t\t$tmp_error_usernames = '';\n\t\t\t\t$tmp_to_all_uids = '|';\n\n\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t$tmp_username = trim($tmp_username);\n\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t$tmp_username_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\tif ($tmp_username_count > 0){\n\t\t\t\t\t\t\t$tmp_user_id = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\t$tmp_to_all_uids = $tmp_to_all_uids . $tmp_user_id . '|';\n\t\t\t\t\t\t\t//found\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$tmp_username_error = $tmp_username_error + 1;\n\t\t\t\t\t\t\t$tmp_error_usernames = $tmp_error_usernames . $tmp_username . ', ';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tmp_error_usernames = trim($tmp_error_usernames, \", \");\n\t\t\t\t//==========================================================//\n\t\t\t\tif ($tmp_username_error > 0){\n\t\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t\t$rows = 12;\n\t\t\t\t\t}\n\t\t\t\t\t$rows = \"rows='$rows'\";\n\t\t\t\t\t?>\n\t\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t\t\t<p><?php _e('The following usernames could not be found in the system', 'messaging') ?> <em><?php echo $tmp_error_usernames; ?></em></p>\n <form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n \tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n \tstyle=\"width: 95%\" tabindex='1' maxlength=\"200\"\n \tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" tabindex='2' maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='3' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form>\n\t\t <?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//everything checked out - send the messages\n\t\t\t\t\t?>\n\t\t\t\t\t<p><?php _e('Sending message(s)...', 'messaging') ?></p>\n <?php\n\t\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t\t$tmp_to_uid = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\tmessaging_insert_message($tmp_to_uid,$tmp_to_all_uids,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']), 'unread', 0);\n\t\t\t\t\t\t\tmessaging_new_message_notification($tmp_to_uid,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmessaging_insert_sent_message($tmp_to_all_uids,$user_ID, sanitize_text_field($_POST['message_subject']),wp_kses_post($_POST['message_content']),0);\n\t\t\t\t\techo \"\n\t\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Reply Sent.') . \"';\n\t\t\t\t\t</script>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"test\":\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t}\n\techo '</div>';\n}", "public function MyMessages(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/myMessage';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Messages',\n\t\t\t'londontec' => $this->setting_model->Get_All('londontec_users'),\n\t\t\t'student' => $this->setting_model->Get_All('students'),\n\t\t\t'message' => $this->setting_model->Get_All_DESCENDING('message','message_id'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function render()\n {\n //rafraichir le chat\n if($_GET['function'] == 'refresh')\n {\n $this->model->refreshTchat();\n }\n \n // ajouter les commentaires\n else if($_GET['function'] == 'add') \n {\n $this->model->saveTchat();\n }\n\n //rafraichir le score\n else if($_GET['function'] == 'score')\n {\n $this->model->recupReponse();\n }\n\n require ROOT.\"/App/View/AjaxView.php\";\n }", "public function render() { ?>\n <!-- Message alert -->\n <div class=\"alert alert-dismissable fade in\" id=\"message-alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <h4 id=\"message-alert-title\"></h4>\n <span id=\"message-alert-body\"></span>\n </div>\n <!-- Message alert end -->\n <?php\n }", "public function index()\n {\n return view('chats.chat');\n }", "public function renderMessages()\n {\n // No messages available\n if(!$this->processor->messages) return;\n\n $messages = '';\n foreach($this->processor->messages as $message) {\n $messages .= $this->genMessage($message['type'], $message['text']);\n }\n return $messages;\n }", "public function messages(){\n $count = Auth::user()->newMessagesCount();\n $currentUserId = Auth::user()->id;\n // All threads that user is participating in\n $threads = Thread::forUser($currentUserId)->latest('updated_at')->get();\n\n return view('dashboard.messages', [\n 'heading' => 'Inbox',\n 'threads' => $threads,\n 'currentUserId' => $currentUserId,\n 'count' => $count\n ]);\n }", "public function showMessage(){\n\t\t\n\n\t\ttry {\n\n\t\t\tif(!empty($_POST)){// si un commentaire est poter\n\t\t\t\tTchatModel::setMessage($_POST[\"message\"],$_POST[\"idUsr\"]);\n\t\t\t}\n\n\t\t\t$data = TchatModel::getMessage();\n\t\t} catch (Exception $e) {\n\t\t\t$data = TchatModel::getMessage();\n\t\t\t$warning = $e->getMessage();\n\t\t}\n\t\trequire_once'ViewFrontend/tchat.php';\n\t}", "public function render()\n {\n\n// //直接显示view\n// return <<<'blade'\n// <div class=\"alert alert-danger\">\n// {{ $slot }}\n// </div>\n// blade;\n\n return view('components.message');\n }", "public function index()\n {\n return Inertia::render('User/Chats/Index', [\n 'chats' => Chat::get()\n ]);\n }", "static private function showMessages() {\n if (isset($_SESSION['messages'])) {\n\n $messages = new View(\"global.messages\", array(\"messages\" => $_SESSION['messages']));\n echo $messages->getHtml();\n // du coup on peut supprimer les messages\n unset($_SESSION['messages']);\n }\n }", "public function index()\n {\n return view('chat.chat');\n }", "public function index()\n {\n return view('chat.chat');\n }", "public function work() {\n\t\t$feedContent = $this->renderHead();\n\t\t$feedContent .=$this->renderChannels();\n\t\t$feedContent .=$this->renderItems();\n\t\t$feedContent .=$this->renderBottom();\n\t\treturn $feedContent;\n\t}", "public function render():string\n {\n return \"<div class='message button {$this->getType()}'>{$this->getText()}</div>\";\n }", "public function chatlog()\n {\n return view('admin.profile.chatlog');\n }", "public static function output()\n {\n self::processPendingRemoveIds();\n\n $info = '';\n $error = '';\n $success = '';\n\n $allMessages = self::getMessages();\n foreach ($allMessages as $type => $messages) {\n if (!empty($messages)) {\n $$type = '';\n\n $empty = true;\n foreach ($messages as $id => $data) {\n if (!($data['visibility'] === null || $data['visibility'] === false))\n continue;\n\n $message = $data['message'];\n\n $$type .= apply_filters('tflash_frontend_message_html', '<div class=\"tf-flash-message\"><p>'. nl2br($message) .'</p></div>', array(\n 'type' => $type,\n 'message' => $message,\n 'id' => $id\n ));\n\n unset($allMessages[$type][$id]);\n\n $empty = false;\n }\n\n if ($empty) {\n $$type = '';\n continue;\n }\n\n $$type = '<div class=\"tf-flash-type-'.$type.'\">'.$$type.'</div>';\n }\n }\n\n self::setMessages($allMessages);\n\n echo '<div class=\"tf-flash-messages\">';\n echo $success;\n echo $error;\n echo $info;\n echo '</div>';\n }", "protected function buildMessages()\n {\n\n $messageObject = Message::getActive();\n\n $html = '';\n\n // Gibet Fehlermeldungen? Wenn ja dann Raus mit\n if ($errors = $messageObject->getErrors()) {\n\n $html .= '<div id=\"wgt-box_error\" class=\"wgt-box error\">'.NL;\n\n foreach ($errors as $error)\n $html .= $error.'<br />'.NL;\n\n $html .= '</div>';\n\n } else {\n\n $html .= '<div style=\"display:none;\" id=\"wgt-box_error\" class=\"wgt-box error\"></div>'.NL;\n }\n\n\n // Gibet Systemmeldungen? Wenn ja dann Raus mit\n if ($warnings = $messageObject->getWarnings()) {\n\n $html .= '<div id=\"wgt-box_warning\" class=\"wgt-box warning\">'.NL;\n\n foreach ($warnings as $warn)\n $html .= $warn.\"<br />\".NL;\n\n $html .= '</div>';\n } else {\n\n $html .= '<div style=\"display:none;\" id=\"wgt-box_warning\" class=\"wgt-box warning\"></div>'.NL;\n }\n\n // Gibet Systemmeldungen? Wenn ja dann Raus mit\n if ($messages = $messageObject->getMessages()) {\n $html .= '<div id=\"wgt-box_message\" class=\"wgt-box message\" >'.NL;\n\n foreach ($messages as $message)\n $html .= $message.\"<br />\".NL;\n\n $html .= '</div>';\n } else {\n\n $html .= '<div style=\"display:none;\" id=\"wgt-box_message\" class=\"wgt-box message\"></div>'.NL;\n }\n\n // Meldungen zurückgeben\n return $html;\n\n }", "public function renderMessages($raw = true)\n\t{\n\t\t// Initialise variables.\n\t\t$buffer = null;\n\t\t$lists = null;\n\n\t\t// Get the message queue\n\t\t$messages = JFactory::getApplication()->getMessageQueue();\n\n\t\t$rawMessages = array();\n\t\t// Build the sorted message list\n\t\tif (is_array($messages) && !empty($messages))\n\t\t{\n\t\t\tforeach ($messages as $msg)\n\t\t\t{\n\t\t\t\tif (isset($msg['type']) && isset($msg['message']))\n\t\t\t\t{\n\t\t\t\t\t$lists[$msg['type']][] = $msg['message'];\n\t\t\t\t\t$rawMessages[] = $msg['message'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($raw)\n\t\t\treturn implode(\"\\n\", $rawMessages );\n\n\t\t// Build the return string\n\t\t$buffer .= \"\\n<div id=\\\"system-message-container\\\">\";\n\n\t\t// If messages exist render them\n\t\tif (is_array($lists))\n\t\t{\n\t\t\t$buffer .= \"\\n<dl id=\\\"system-message\\\">\";\n\t\t\tforeach ($lists as $type => $msgs)\n\t\t\t{\n\t\t\t\tif (count($msgs))\n\t\t\t\t{\n\t\t\t\t\t$buffer .= \"\\n<dt class=\\\"\" . strtolower($type) . \"\\\">\" . JText::_($type) . \"</dt>\";\n\t\t\t\t\t$buffer .= \"\\n<dd class=\\\"\" . strtolower($type) . \" message\\\">\";\n\t\t\t\t\t$buffer .= \"\\n\\t<ul>\";\n\t\t\t\t\tforeach ($msgs as $msg)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= \"\\n\\t\\t<li>\" . $msg . \"</li>\";\n\t\t\t\t\t}\n\t\t\t\t\t$buffer .= \"\\n\\t</ul>\";\n\t\t\t\t\t$buffer .= \"\\n</dd>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$buffer .= \"\\n</dl>\";\n\t\t}\n\n\t\t$buffer .= \"\\n</div>\";\n\t\treturn $buffer;\n\t}", "public function showMessages()\n {\n $messages = $this->getMessages();\n foreach ($messages as $message) {\n echo $message . \"\\n\";\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $chatMessages = $em->getRepository('ReclamationBundle:ChatMessage')->findAll();\n\n return $this->render('chatmessage/index.html.twig', array(\n 'chatMessages' => $chatMessages,\n 'page_title' => 'Chat'\n ));\n }", "function chat_view($guid = NULL) {\n\t$return = array();\n\n\telgg_require_js('chat/messaging');\n\n\t$chat = get_entity($guid);\n\n\t// no header or tabs for viewing an individual chat\n\t$return['filter'] = '';\n\n\tif (!elgg_instanceof($chat, 'object', 'chat') || !$chat->isMember() ) {\n\t\t$return['content'] = elgg_echo('noaccess');\n\t\treturn $return;\n\t}\n\n\tif ($chat->canEdit()) {\n\t\t// Delete chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_delete',\n\t\t\t'href' => \"action/chat/delete?guid=$guid\",\n\t\t\t'text' => elgg_echo('delete'),\n\t\t\t'link_class' => 'elgg-button elgg-button-delete',\n\t\t\t'confirm' => elgg_echo('chat:delete:confirm'),\n\t\t\t'is_action' => true,\n\t\t));\n\t\t// Edit chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_edit',\n\t\t\t'href' => \"chat/edit/$guid\",\n\t\t\t'text' => elgg_echo('chat:edit'),\n\t\t\t'link_class' => 'elgg-button elgg-button-action',\n\t\t));\n\t} else {\n\t\t// Leave chat button\n\t\telgg_register_menu_item('title', array(\n\t\t\t'name' => 'chat_leave',\n\t\t\t'href' => \"action/chat/leave?guid=$guid\",\n\t\t\t'text' => elgg_echo('chat:leave'),\n\t\t\t'link_class' => 'elgg-button elgg-button-delete',\n\t\t\t'confirm' => elgg_echo('chat:leave:confirm'),\n\t\t\t'is_action' => true,\n\t\t));\n\t}\n\t// Add users button\n\tchat_register_addusers_button($chat);\n\n\t$return['title'] = htmlspecialchars($chat->title);\n\n\telgg_push_breadcrumb($chat->title);\n\t$return['content'] = elgg_view_entity($chat, array('full_view' => true));\n\t$return['content'] .= elgg_view('chat/messages', array('entity' => $chat));\n\n\treturn $return;\n}", "public static function show_messages()\n {\n if (count(self::$errors) > 0) {\n foreach (self::$errors as $error) {\n echo '<div id=\"message\" class=\"error inline\"><p><strong>' . esc_html($error) . '</strong></p></div>';\n }\n } elseif (count(self::$messages) > 0) {\n foreach (self::$messages as $message) {\n echo '<div id=\"message\" class=\"updated inline\"><p><strong>' . esc_html($message) . '</strong></p></div>';\n }\n }\n }", "public function messagesPanel(){\n \n $messages = Message::paginate(10);\n return view('admin.messagesPanel', [\"messages\" => $messages]);\n }", "function render_message() {\n return $this->options['message_current'] ?\n xFormTemplate::apply($this->template_message, $this->options) :\n null;\n }", "abstract public function renderHtmlMessage();", "public function render()\n {\n $this->output->writeln('');\n\n $lineLength = $this->getTerminalWidth();\n\n $lines = explode(PHP_EOL, wordwrap($this->message, $lineLength - (strlen($this->blockStyles[$this->style]['prefix']) + 3), PHP_EOL, true));\n array_unshift($lines, ' ');\n array_push($lines, ' ');\n\n foreach ($lines as $i => $line) {\n $prefix = str_repeat(' ', strlen($this->blockStyles[$this->style]['prefix']));\n if ($i === 1) {\n $prefix = $this->blockStyles[$this->style]['prefix'];\n }\n\n $line = sprintf(' %s %s', $prefix, $line);\n $this->output->writeln(sprintf('<%s>%s%s</>', $this->blockStyles[$this->style]['style'], $line, str_repeat(' ', $lineLength - Helper::strlenWithoutDecoration($this->output->getFormatter(), $line))));\n }\n\n $this->output->writeln('');\n }", "function cis_login_get_messages() {\n\n\tglobal $cis_login_message;\n\t$html = \"<div id=\\\"message-1\\\" class=\\\"updated\\\"><ul>\\n\";\n\n\tif (!count($cis_login_message))\n\t\treturn false;\n\tforeach ($cis_login_message as $msg)\n\t\t$html .= \"<li>{$msg}</li>\\n\";\n\n\twp_enqueue_style('colors');\n\treturn $html .= \"</ul>\\n</div>\\n\";\n}", "function warquest_home_messages() {\r\n \r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $offset;\r\n\t\r\n\t/* output */\r\n\tglobal $page;\r\n\tglobal $player;\r\n\tglobal $output;\r\n\t\r\n\t/* Clear new flag */\r\n\t$player->comment_notification=0;\r\n\t\t\r\n\t$output->title = t('HOME_MESSAGES_TITLE');\r\n\t\r\n\t$limit=30;\r\n\t\r\n\t$query = 'select pid1 from comment where pid2='.$player->pid.' and deleted=0';\r\n\t$result = warquest_db_query($query); \r\n\t$total = warquest_db_num_rows($result);\r\n\t\r\n\t$query = 'select a.id, a.pid1, a.pid2, a.date, a.comment, a.cid, b.name, b.country from comment a, player b ';\r\n $query .= 'where ((a.pid1=b.pid and pid2='.$player->pid.') or (a.pid2=b.pid and pid1='.$player->pid.')) ';\r\n\t$query .= 'and deleted=0 order by a.date desc ';\r\n\t$query .= 'limit '.$offset.','.$limit;\r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\t\t\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_MESSAGES_TITLE').'</div>';\r\n\t\r\n\tif ($count==0) {\r\n\t\t\r\n\t\t$page .= warquest_box_icon(\"info\",t('HOME_NO_MESSAGES'));\r\n\t\t\r\n\t} else {\r\n\t\t\r\n\t\t$page .= '<div class=\"box rows\">';\r\n\t\r\n\t\t$count=0;\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 1);\r\n\t\t\r\n\t\t$page .= '<table>';\r\n\t\t\r\n\t\t$page .= '<tr>';\r\n\t\t$page .= '<th width=\"75\" >'.t('GENERAL_AGO').'</th>';\r\n\t\t$page .= '<th width=\"390\">'.t('GENERAL_MESSAGE').'</th>';\r\n\t\t$page .= '<th width=\"55\" align=\"right\">'.t('GENERAL_ACTION').'</th>';\r\n\t\t$page .= '</tr>';\r\n\t\t\r\n\t\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\r\n\t\t\t$count++;\r\n\t\t\r\n\t\t\t$page .= '<tr valign=\"top\">';\r\n\t\t\t$page .= '<td>';\r\n\t\t\t$page .= warquest_ui_ago($data->date);\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td>';\r\n\t\t\t\r\n\t\t\t$page .= '<span class=\"subparagraph2\">';\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= player_format($data->pid1, $data->name, $data->country);\r\n\t\t\t\t$page .= ' -> '.player_format($player->pid, $player->name, $player->country);\r\n\t\t\t} else {\r\n\t\t\t\t$page .= player_format($player->pid, $player->name, $player->country);\r\n\t\t\t\t$page .= ' -> ';\r\n\t\t\t\t\r\n\t\t\t\tif ($data->cid > 0) {\r\n\t\t\t\t\t$clan = warquest_db_clan($data->cid);\r\n\t\t\t\t\t$page .= clan_format($clan).' clan';\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ($data->pid2==0) {\r\n\t\t\t\t\t$page .= t('GENERAL_ALL');\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$page .= player_format($data->pid2, $data->name, $data->country);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$page .= '</span>';\r\n\t\t\t$page .= '<br/>';\r\n\t\t\t$page .= warquest_parse_smilies(wordwrap($data->comment, 40, \"\\n\\r\", true));\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td align=\"right\">';\r\n\t\t\t\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid1, t('LINK_REPLY'), \"reply\".$count);\t\r\n\t\t\t} else if ($player->pid==$data->pid1) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid2.'&uid='.$data->id, t('LINK_EDIT'), 'edit'.$count);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '</table>';\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 0);\r\n\t\t$page .= '</div>';\n\t\r\n\t} \r\n}", "public function index()\n {\n\n $messages = Message::select('from_user_id')->where('to_user_id', auth()->id())->groupBy('from_user_id')->get();\n $this->views['messages'] = $messages;\n\n return view('messages.index', $this->views);\n }", "public static function show_messages() {\n\t\tif ( sizeof( self::$errors ) > 0 ) {\n\t\t\tforeach ( self::$errors as $error ) {\n\t\t\t\techo '<div class=\"wrap\"><div class=\"kopa_message error fade inline\"><p><strong>' . esc_html( $error ) . '</strong></p></div></div>';\n\t\t\t}\n\t\t} elseif ( sizeof( self::$messages ) > 0 ) {\n\t\t\tforeach ( self::$messages as $message ) {\n\t\t\t\techo '<div class=\"wrap\"><div class=\"kopa_message updated fade inline\"><p><strong>' . esc_html( $message ) . '</strong></p></div></div>';\n\t\t\t}\n\t\t}\n\t}", "public function message($sid)\n {\n $services = $this->client->chat->v2->services->read();\n $messages = $this->client->chat->v2->services($services[0]->sid)->channels($sid)->messages->read();\n return view('chats/message', compact('messages'));\n }", "public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"flash success\">'.$feedback.'</div>';\n }\n }\n\n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"flash error\">'.$feedback.'</div>';\n }\n }\n\n // delete these messages (as they are not needed anymore and we want to avoid to show them twice\n Session::set('feedback_positive', null);\n Session::set('feedback_negative', null);\n }", "public function chat_roomsAction()\n\t{\n\t\t$user = $this->user;\n $user_id = $user['id'];\n $application_id = $user['Application_ID'];\n\n $user = UsersMobile::findFirst($user_id);\n\n $cms = $user->getCms([\n \t\"secured = 0 AND application_id = {$application_id}\"\n \t]);\n\n $data = [];\n\t\tforeach ($cms as $key => $chat) {\n\t\t\t$data[\"messages\"][$key][\"name\"] = $chat->title;\n\t\t\t$data[\"messages\"][$key][\"created_at\"] = $chat->datetime;\n\t\t\t$data[\"messages\"][$key][\"id\"] = $chat->id;\n\t\t}\n\n\t\t$final_array = $this->structureMessages($data[\"messages\"]);\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => $final_array\n ];\n\n return $this->sendJson($response);\n\t}", "public function renderErrorDiv(){\n $row = '';\n if(count($this->error_messages) > 0){\n $row .= \"<div class='invalid-feedback'>\";\n foreach($this->error_messages as $message){\n $row .= $message;\n }\n $row .= \"</div>\";\n }\n return $row;\n }", "function content() {\n echo \"<div class='container'>{$this->params['body']}\n <p style='background-color: #95a5a6; padding: 10px; text-align: center; margin-top: 10px; border-top-left-radius: 2px; border-top-right-radius: 2px;'><a href='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/unsubscribe/{$this->params['email']}/{$this->params['emailId']}' style='font-family: Arial; color: #333;'>Click here to unsubscribe from our updates</a></p>\n </div>\";\n }", "public function showMessage($msg){\n// $message += ($msg +\"<br/>\");\n// require APP . 'view/_templates/header.php';\n// require APP . 'view/home/message.php';\n// require APP . 'view/post/index.php';\n// require APP . 'view/_templates/footer.php';\n// return;\n }", "public function show()\n {\n return view('chat.show');\n }", "function AddChat()\r\n{\r\n if (session_id() == '')\r\n {\r\n session_start();\r\n }\r\n if (isset($_SESSION))\r\n {\r\n if (!empty($_SESSION) && !empty($_SESSION['EMAIL']))\r\n {\r\n echo '<div id=ChatSystem>\r\n <div id=\"messageBox\">\r\n <div id=\"id\" class=\"chat\"></div>\r\n <form id=\"messageBoxForm\" onsubmit=\"event.preventDefault()\">\r\n <textarea onkeydown=\"SubmitFormEnter(event)\" cols=\"40\" rows=\"1\" name=\"chatMessage\" id=\"chat_input\" placeholder=\"Type a message...\" autocomplete=\"off\" autocapitalize=off resize=off></textarea>\r\n <input type=\"submit\" id=\"submitText\"><label title=\"Send message\" id=\"submitMessageLabel\" for=\"submitText\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Layer_1\" viewBox=\"0 0 55 55\" x=\"0px\" y=\"0px\" width=\"55\" height=\"55\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs43\"><linearGradient id=\"linearGradient5980\" xmlns:osb=\"http://www.openswatchbook.org/uri/2009/osb\" osb:paint=\"solid\"><stop id=\"stop5978\" style=\"stop-color: rgb(174, 174, 174); stop-opacity: 1;\" offset=\"0\" /></linearGradient></defs><g id=\"g8\" transform=\"matrix(0.0661397 0 0 0.0661397 1.06883 11.809)\"><g id=\"g6\"><path id=\"path2\" style=\"fill: none; fill-opacity: 0.995536; stroke: #2b2b2b; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 244.8 489.6 c 135 0 244.8 -109.8 244.8 -244.8 C 489.6 109.8 379.8 0 244.8 0 C 109.8 0 0 109.8 0 244.8 c 0 135 109.8 244.8 244.8 244.8 Z m 0 -469.8 c 124.1 0 225 100.9 225 225 c 0 124.1 -100.9 225 -225 225 c -124.1 0 -225 -100.9 -225 -225 c 0 -124.1 100.9 -225 225 -225 Z\" /><path id=\"path4\" style=\"fill: #767e88; fill-opacity: 1; stroke: #0063b1; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 210 326.1 c 1.9 1.9 4.5 2.9 7 2.9 c 2.5 0 5.1 -1 7 -2.9 l 74.3 -74.3 c 1.9 -1.9 2.9 -4.4 2.9 -7 c 0 -2.6 -1 -5.1 -2.9 -7 L 224 163.5 c -3.9 -3.9 -10.1 -3.9 -14 0 c -3.9 3.9 -3.9 10.1 0 14 l 67.3 67.3 l -67.3 67.3 c -3.8 3.9 -3.8 10.2 0 14 Z\" /></g></g><g id=\"g10\" transform=\"translate(0 -434.6)\" /><g id=\"g12\" transform=\"translate(0 -434.6)\" /><g id=\"g14\" transform=\"translate(0 -434.6)\" /><g id=\"g16\" transform=\"translate(0 -434.6)\" /><g id=\"g18\" transform=\"translate(0 -434.6)\" /><g id=\"g20\" transform=\"translate(0 -434.6)\" /><g id=\"g22\" transform=\"translate(0 -434.6)\" /><g id=\"g24\" transform=\"translate(0 -434.6)\" /><g id=\"g26\" transform=\"translate(0 -434.6)\" /><g id=\"g28\" transform=\"translate(0 -434.6)\" /><g id=\"g30\" transform=\"translate(0 -434.6)\" /><g id=\"g32\" transform=\"translate(0 -434.6)\" /><g id=\"g34\" transform=\"translate(0 -434.6)\" /><g id=\"g36\" transform=\"translate(0 -434.6)\" /><g id=\"g38\" transform=\"translate(0 -434.6)\" /></svg></label></form>\r\n </div>\r\n <div id=\"contactsPart\">\r\n <input type=\"checkbox\" id=\"hideContacts\"><label id=\"contactsButton\" for=\"hideContacts\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Capa_1\" viewBox=\"0 0 48 48\" x=\"0px\" y=\"0px\" width=\"48\" height=\"48\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs37\"></defs><path id=\"path2\" style=\"stroke: #000000; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 0.4;\" d=\"M 32.3384 29.1299 L 29.1539 27.5378 C 28.8536 27.3875 28.6669 27.0855 28.6669 26.7495 v -1.12706 c 0.07634 -0.09334 0.156675 -0.199676 0.239679 -0.317015 c 0.41302 -0.583363 0.744037 -1.23273 0.984716 -1.9331 C 30.3617 23.1566 30.667 22.6916 30.667 22.1666 v -1.3334 c 0 -0.321016 -0.120006 -0.632032 -0.33335 -0.875044 v -1.77309 c 0.01867 -0.183343 0.09201 -1.27473 -0.697368 -2.17511 c -0.684701 -0.781039 -1.79576 -1.17706 -3.30283 -1.17706 c -1.50707 0 -2.61813 0.39602 -3.30283 1.17673 c -0.478357 0.545694 -0.639365 1.16039 -0.688034 1.60175 c -0.571362 -0.295348 -1.24473 -0.445022 -2.00943 -0.445022 c -3.46317 0 -3.66485 2.95181 -3.66685 3.00015 v 1.52641 c -0.216011 0.235345 -0.33335 0.507025 -0.33335 0.776705 v 1.15139 c 0 0.359685 0.161008 0.695035 0.437022 0.921713 c 0.275014 1.03672 0.951381 1.82009 1.21473 2.0951 v 0.914379 c 0 0.262346 -0.142674 0.503025 -0.390353 0.638365 l -2.21778 1.39107 C 14.5272 30.045 13.9995 30.934 13.9995 31.9014 v 1.26573 h 4.6669 h 0.6667 h 14.6674 v -1.34773 c 0 -1.14606 -0.637032 -2.17678 -1.66208 -2.68947 Z M 18.6664 31.7544 v 0.746037 h -4.0002 v -0.59903 c 0 -0.723369 0.394686 -1.38807 1.04705 -1.74442 l 2.21744 -1.39107 c 0.444355 -0.242346 0.720369 -0.707035 0.720369 -1.21373 v -1.19706 l -0.106005 -0.099 c -0.0087 -0.008 -0.894378 -0.844709 -1.15606 -1.9851 l -0.03034 -0.132012 l -0.114006 -0.07334 c -0.153341 -0.09934 -0.245012 -0.26568 -0.245012 -0.444689 v -1.15139 c 0 -0.120006 0.08167 -0.26268 0.223678 -0.391353 l 0.109672 -0.09901 l -0.000667 -1.79342 c 0.006 -0.09567 0.179676 -2.35278 3.00082 -2.35278 c 0.797707 0 1.46941 0.184343 2.0001 0.548027 v 1.57708 c -0.213344 0.243012 -0.33335 0.554028 -0.33335 0.875044 v 1.3334 c 0 0.101338 0.01167 0.20101 0.03367 0.297682 c 0.009 0.03867 0.027 0.074 0.03933 0.111338 c 0.01833 0.056 0.033 0.113673 0.05867 0.166675 c 0.000333 0.000667 0.000667 0.001 0.001 0.0017 c 0.08534 0.176009 0.209677 0.33335 0.366352 0.459023 c 0.0017 0.0063 0.0037 0.012 0.0053 0.018 c 0.02 0.07634 0.041 0.152341 0.06367 0.226678 l 0.027 0.087 c 0.0047 0.01533 0.01033 0.031 0.01533 0.04634 c 0.01167 0.036 0.023 0.07167 0.035 0.107005 c 0.02 0.05834 0.041 0.118673 0.06534 0.184343 c 0.01033 0.02734 0.02167 0.052 0.03233 0.079 c 0.02734 0.06967 0.05467 0.137007 0.08334 0.203677 c 0.007 0.016 0.013 0.03334 0.02 0.049 l 0.01867 0.042 c 0.0087 0.01933 0.01767 0.03667 0.02633 0.05567 c 0.03267 0.07134 0.06467 0.14034 0.09801 0.20701 c 0.0053 0.01067 0.01033 0.02234 0.01567 0.033 c 0.021 0.04167 0.042 0.081 0.063 0.121006 c 0.036 0.06867 0.07134 0.13334 0.106672 0.19601 c 0.01733 0.03067 0.03433 0.06067 0.05134 0.08967 c 0.048 0.082 0.09367 0.157341 0.138007 0.227344 c 0.0097 0.015 0.019 0.03067 0.02834 0.045 c 0.08067 0.125006 0.150674 0.226344 0.208677 0.305348 c 0.01533 0.021 0.02867 0.039 0.04167 0.05667 c 0.0073 0.0097 0.01733 0.02367 0.02367 0.03233 v 1.10306 c 0 0.322683 -0.176009 0.618697 -0.459023 0.773372 l -0.882044 0.481024 l -0.153675 -0.01367 l -0.06267 0.131673 l -1.87543 1.02305 c -0.966712 0.528016 -1.56708 1.5394 -1.56708 2.64079 Z m 14.6674 0.746037 H 19.3331 v -0.746037 c 0 -0.857043 0.467357 -1.64475 1.21973 -2.05477 l 2.97381 -1.62208 c 0.497692 -0.27168 0.806707 -0.792706 0.806707 -1.35907 v -1.3394 v -0.000333 l -0.06467 -0.07734 l -0.01267 -0.015 c -0.000667 -0.001 -0.02134 -0.026 -0.055 -0.07 c -0.002 -0.0027 -0.004 -0.0053 -0.0063 -0.008 c -0.01767 -0.023 -0.03834 -0.05067 -0.062 -0.08367 c -0.000333 -0.000667 -0.000666 -0.001 -0.001 -0.0017 c -0.04967 -0.069 -0.112005 -0.158674 -0.181342 -0.26668 c -0.0017 -0.0023 -0.003 -0.005 -0.0047 -0.0073 c -0.03267 -0.051 -0.06734 -0.106672 -0.102672 -0.165675 c -0.0027 -0.0043 -0.0053 -0.0087 -0.008 -0.01333 c -0.07537 -0.126347 -0.155375 -0.269354 -0.235046 -0.427696 c 0 0 -0.000333 -0.000333 -0.000333 -0.000666 c -0.04234 -0.08501 -0.08467 -0.174342 -0.126007 -0.267347 v 0 c -0.0057 -0.013 -0.01167 -0.02567 -0.01733 -0.03867 v 0 c -0.01833 -0.04167 -0.03667 -0.08534 -0.05534 -0.130339 c -0.0067 -0.01633 -0.01333 -0.03334 -0.02 -0.05 c -0.01733 -0.04367 -0.035 -0.08767 -0.05367 -0.138007 c -0.034 -0.09067 -0.066 -0.185342 -0.09667 -0.283014 l -0.01833 -0.05934 c -0.002 -0.0067 -0.0043 -0.01333 -0.0063 -0.02033 c -0.03134 -0.105338 -0.06134 -0.21301 -0.08667 -0.323682 L 23.089 22.7989 L 22.9753 22.7256 C 22.7819 22.6009 22.6666 22.3919 22.6666 22.1666 v -1.3334 c 0 -0.187009 0.07934 -0.361351 0.223344 -0.491691 l 0.110006 -0.09901 V 18.1664 V 18.0484 l -0.009 -0.007 c -0.01133 -0.240679 0.003 -0.978383 0.541027 -1.59208 c 0.552361 -0.630365 1.49507 -0.949714 2.80147 -0.949714 c 1.30173 0 2.24244 0.317016 2.79547 0.942714 c 0.649033 0.733703 0.541694 1.67242 0.541027 1.68042 l -0.003 2.11977 l 0.110006 0.09934 c 0.144007 0.130007 0.223344 0.304349 0.223344 0.491358 v 1.3334 c 0 0.291015 -0.190676 0.545694 -0.474024 0.633032 l -0.166008 0.051 l -0.05334 0.165008 c -0.223011 0.693702 -0.540694 1.3344 -0.944714 1.90443 c -0.09901 0.14034 -0.195343 0.26468 -0.279014 0.359685 l -0.083 0.09467 v 1.37507 c 0 0.590029 0.327683 1.12039 0.855376 1.3844 l 3.18449 1.59208 c 0.79804 0.39902 1.29373 1.20106 1.29373 2.09344 Z\" /><g id=\"g4\" transform=\"translate(0 -12)\" /><g id=\"g6\" transform=\"translate(0 -12)\" /><g id=\"g8\" transform=\"translate(0 -12)\" /><g id=\"g10\" transform=\"translate(0 -12)\" /><g id=\"g12\" transform=\"translate(0 -12)\" /><g id=\"g14\" transform=\"translate(0 -12)\" /><g id=\"g16\" transform=\"translate(0 -12)\" /><g id=\"g18\" transform=\"translate(0 -12)\" /><g id=\"g20\" transform=\"translate(0 -12)\" /><g id=\"g22\" transform=\"translate(0 -12)\" /><g id=\"g24\" transform=\"translate(0 -12)\" /><g id=\"g26\" transform=\"translate(0 -12)\" /><g id=\"g28\" transform=\"translate(0 -12)\" /><g id=\"g30\" transform=\"translate(0 -12)\" /><g id=\"g32\" transform=\"translate(0 -12)\" /></svg></label>\r\n <div id=\"contacts_bar\">';\r\n echo '</div></div></div>';\r\n }\r\n }\r\n}", "public static function GetMessages() {\n $messages = [];\n $users_messages_p = DB::table('usermessages')\n ->select('*')\n ->orderBy('created_at', 'desc')->paginate(15);\n foreach ($users_messages_p as $new_users_messages) {\n $messages[] = (array) $new_users_messages;\n }\n self::$data['messages'] = $messages;\n self::$data['messages_p'] = $users_messages_p;\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Messages';\n return view('cms.messages', self::$data);\n }", "function ajax_message() {\n\t\t$message_path = $this->get_message_path();\n\t\t$query_string = _http_build_query( $_GET, '', ',' );\n\t\t$current_screen = wp_unslash( $_SERVER['REQUEST_URI'] );\n\t\t?>\n\t\t<div class=\"jetpack-jitm-message\"\n\t\t\t data-nonce=\"<?php echo wp_create_nonce( 'wp_rest' ); ?>\"\n\t\t\t data-message-path=\"<?php echo esc_attr( $message_path ); ?>\"\n\t\t\t data-query=\"<?php echo urlencode_deep( $query_string ); ?>\"\n\t\t\t data-redirect=\"<?php echo urlencode_deep( $current_screen ); ?>\"\n\t\t></div>\n\t\t<?php\n\t}", "public function showSentMessages()\n {\n $messageService = $this->get(MessageService::class);\n $messages = $messageService->showSentMessages($this->getUser());\n\n return $this->render('message/sentMessages.html.twig', array(\n 'messages' => $messages,\n ));\n }", "public function index($id)\n {\n $messages = Message::where([\n ['user_id', Auth::id()],\n ['reciever_id', $id]\n ])\n ->orWhere([\n ['user_id', $id],\n ['reciever_id', Auth::id()] \n ])\n ->with('user')\n ->get();\n\n return request()->ajax() ? $messages : view('chat');\n }", "public function index()\n {\n $user = auth()->user();\n $user->group;\n $chatrooms = $user->chatrooms;\n $messages = [];\n\n foreach ($chatrooms as $chatroom){\n $chatroom['users'] = $chatroom->users()->where('users.id', '!=', $user->id)->get();\n $chatroom->latestMessage;\n }\n\n return view('chatrooms.index', [\n 'user' => $user,\n 'chatrooms' => $chatrooms,\n ]);\n }", "public function load() {\n\t\techo \"<h3 style=\\\"margin-left:20px;\\\">Your Message Centre</h3>\";\n\t\techo \"<div class=\\\"message-centre\\\">\";\n\t\t$this -> configure();\n\t\t$this -> template = TemplateManager::load(\"MessageCentre\");\n\t\t$messageTemplate = TemplateManager::load(\"Messages\");\n\t\t\n\t\t$messageTemplate -> insert(\"first\", \"From\");\n\t\t$messageTemplate -> insert(\"messages\", $this -> getMessages(\"received\"));\n\t\t$this -> template -> insert(\"received\", $messageTemplate -> getContents());\n\t\t\n\t\t$messageTemplate -> reset();\n\t\t$messageTemplate -> insert(\"first\", \"To\");\n\t\t$messageTemplate -> insert(\"messages\", $this -> getMessages(\"sent\"));\n\t\t$this -> template -> insert(\"sent\", $messageTemplate -> getContents());\n\t\t\n\t\t$messageTemplate -> reset();\n\t\t$messageTemplate -> insert(\"first\", \"From\");\n\t\t$messageTemplate -> insert(\"messages\", $this -> getMessages(\"read\"));\n\t\t$this -> template -> insert(\"read\", $messageTemplate -> getContents());\n\t\t$this -> display();\n\t\techo \"</div>\";\n\t}", "public function getChatTranscript()\n {\n $chat_output = '';\n $chat_rows = preg_split(\"/(\\r?\\n)+|(<br\\s*\\/?>\\s*)+/\", $this->getContent());\n $separator = ':';\n\n foreach ($chat_rows as $chat_row) {\n if (strpos($chat_row, $separator)) {\n $chat_row_split = explode($separator, trim($chat_row), 2);\n $chat_author = strip_tags(trim($chat_row_split[0]));\n $chat_text = trim($chat_row_split[1]);\n $chat_output .= '<div class=\"chat-row\">';\n $chat_output .= '<div class=\"chat-author '.sanitize_html_class(strtolower(\"chat-author-{$chat_author}\")).' vcard\"><cite class=\"fn\">'.$chat_author.'</cite>'.$separator.'</div>';\n $chat_output .= '<div class=\"chat-text\">'.str_replace(array(\"\\r\", \"\\n\", \"\\t\"), '', $chat_text).'</div>';\n $chat_output .= '</div><!-- .chat-row -->';\n } else {\n if (!empty($chat_row)) {\n $chat_output .= '<div class=\"chat-row\">';\n $chat_output .= '<div class=\"chat-text\">'.str_replace(array(\"\\r\", \"\\n\", \"\\t\"), '', $chat_row).'</div>';\n $chat_output .= '</div><!-- .chat-row -->';\n }\n }\n }\n\n return $chat_output;\n }", "public function output()\n {\n $out = '<div class=\"flash_messages\">';\n $stored_messages = isset($_SESSION['flash_messages']) ? $_SESSION['flash_messages'] : array();\n foreach ($stored_messages as $key => $val){\n $out .= '<div class=\"flash_message ' . htmlspecialchars($val['class']) . '\">';\n $out .= $this->useFA ? '<i class=\"' . htmlspecialchars($val['fa']) . '\"></i>' : null;\n $out .= htmlspecialchars($val['message']);\n $out .= '</div>';\n }\n $out .= '</div>';\n $this->deleteAll();\n return $out;\n }", "protected function _renderSystemMessage()\n {\n $msg = $this->_model->hasSystemMessage() ? $this->_model->renderSystemMessages() : '';\n\n return $this->_renderStaticBlock($msg, Html::TAG_DIV, $this->_systemMessageHtmlOptions, false);\n }", "public function index()\n {\n $chats = DB::table('chats')->where('author', '=', Auth::user()->email)->orWhere('sendto', '=', Auth::user()->email);\n return view('Chat', compact('chats'));\n }", "function show_message($content, $type=\"updated fade\") {\r\n if ($content)\r\n echo \"<div id=\\\"message\\\" class='$type' ><p>\" . $content . \"</p></div>\";\r\n }", "function ppmess_shortcode_all_messages_view(){\n\n\t$data = ppmess_shortcode_all_messages();\n\t\n\tif(isset($data['errors'])){\n\t\techo ('An error has occurred');\n\t\t// echo $data['errors']\t\t\n\t\treturn;\n\t}\n?>\t\t\n\t<!------------ Post info ------------>\n\t<div class=\"post-info-commun\">\n\t\t<?php echo __('Author of the post', 'ppmess');\n\t\t\tif($data['post_author'] == $data['user_id']):\t?>\n\t\t\t\t<!-- logged user is author of the post -->\n\t\t\t\t<span class=\"span-mark\"><?php echo esc_html($data['user_login']); ?></span>\n\t\t\t\t<a id=\"link-logout\" href=\"<?php echo wp_logout_url(); ?>\"><?php echo __('LogOut ?', 'ppmess'); ?></a>\n\t\t<?php \t\n\t\t\telse:\t?>\t\n\t\t\t\t<!-- user2 is author of the post -->\n\t\t\t\t<span class=\"span-mark\"><?php echo esc_html($data['user2_login']); ?></span>\n\t\t<?php\n\t\t\tendif;\n\t\t\t\n\t\t\techo ' | ';\n\t\t\techo __('Refers to post: ', 'ppmess');\t\t\n\t\t\tif( $data['post_status'] ):\t\t?>\n\t\t\t\t<!-- post is available -->\n\t\t\t\t<a id=\"id-post-ppmess\" href=\"<?php echo esc_url( get_permalink($data['post_id']) ); ?>\" title=\"<?php echo esc_attr( $data['post_title'] ); ?>\">\n\t\t\t\t\t<?php echo esc_html($data['post_title']); ?>\n\t\t\t\t</a>\n\t\t<?php \t\n\t\t\telse: ?>\n\t\t\t\t<!-- is no longer available -->\n\t\t\t\t<span><?php echo esc_html($data['post_title']); ?></span>\n\t\t<?php \t\n\t\t\tendif; ?>\n\t</div>\n\t\t\n\t<!---------- Sender info ---------->\n\t<div class=\"sender-info-commun\">\n\t\t<?php echo __('Talking with', 'ppmess'); // <!-- &#x20;&#x20; --><!-- space -->\n\t\t\tif($data['user_id'] != $data['post_author']):\t?>\n\t\t\t\t<span class=\"span-mark\" title=\"Logged user\"><?php echo esc_html($data['user_login']); ?></span>\n\t\t\t\t<a id=\"link-logout\" href=\"<?php echo wp_logout_url(); /* redirect: wp_logout_url(login-form) */ ?>\"><?php echo __('LogOut ?', 'ppmess'); ?></a>\t\t\t\t\n\t\t<?php \n\t\t\telse: ?>\n\t\t\t\t<span class=\"span-mark\" title=\"\"><?php echo esc_html($data['user2_login']); ?></span>\n\t\t<?php \n\t\t\tendif; ?>\n\t</div>\n\t\n\t<!-- Povratak na listu privatnih poruka -->\n\t<div class=\"ppmess-buck-link\">\n\t\t<a class=\"ppmess-tag-a ppmess-buck-a\" href=\"<?php echo $data['page_url']; ?>\">&#x21d0;&#x20;<?php echo __('Back', 'ppmess'); ?></a>\n\t</div>\n\t\n\t<!---------- All messages of the single communication ---------->\n\t<div class=\"single-commun-frame\">\n\t\t<div id=\"ppmessMessagesFrame\" class=\"single-messages-frame\">\n\t<?php \n\t\t\tif( ! empty($data['messages']) ): \n\t\n\t\t\t\tforeach($data['messages'] as $message):\n\t\t\t\t\tif($message['sender_id'] == $data['user_id']){\n\t\t\t\t\t\t$mess_style = 'background-color:#f0f0f0;text-align:left;';\n\t\t\t\t\t\t$sender = $data['user_login'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$mess_style = 'background-color:#ffffff;text-align:right;';\n\t\t\t\t\t\t$sender = $data['user2_login'];\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t\t<div id=\"ppmessage-<?php echo $message['message_id']; ?>\" class=\"single-message-frame\" style=\"<?php echo esc_attr( $mess_style ); ?>\">\t\n\t\t\t\t\t\t<p class=\"p-row1-pmess\">\n\t\t\t\t\t\t\t<?php echo __('from', 'ppmess'); ?>\n\t\t\t\t\t\t\t<span style=\"color:#0073aa;font-style:italic;\"><?php echo esc_html( ' ' . $sender); ?></span>\n\t\t\t\t\t\t\t<?php echo ' | '; ?>\n\t\t\t\t\t\t\t<?php echo __('date', 'ppmess'); ?>\n\t\t\t\t\t\t\t<span style=\"color:#0073aa;font-style:italic;\"><?php echo esc_html( date('d-M-Y ', strtotime($message['date_created'])) ); ?></span>\n\t\t\t\t\t\t\t<?php echo ' | '; ?>\n\t\t\t\t\t\t\t<?php echo __('time', 'ppmess'); ?>\n\t\t\t\t\t\t\t<span style=\"color:#0073aa;font-style:italic;\"><?php echo esc_html( date('G:i ', strtotime($message['date_created'])) ); ?></span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class=\"p-row2-pmess\"><?php echo $message['message_content']; ?></p>\n\t\t\t\t\t</div>\n\t\t<?php\tendforeach;\n\t\t\tendif;\t?>\n\t\t\t<!-------------- New Comment - AJAX ---------------------------->\n\t\t\t<!---- There is append new <div> element with a new message ---->\n\t\t\t<!-------------------------------------------------------------->\n\t\t</div>\n<?php \tif( $data['messages'] == FALSE ):\t// will never be happen ?>\n\t\t\t<!-- No messages -->\n\t\t\t<div class=\"ppmess-info-dark\">\n\t\t\t\t<?php echo __('No messages exists !', 'ppmess'); ?>\n\t\t\t</div>\n\t<?php \t\n\t\tendif;\n\t\t\n\t\t// post is available\n\t\tif( $data['post_status'] ):\t\t?>\t\t\t\n\t\t\t<h4 class=\"ppmess-h4\">\n\t\t\t\t<?php echo __('Send private message to author of the post', 'ppmess'); ?>\n\t\t\t</h4>\t\t\t\n\t\t\t<!-------------------- Error message -------------------------->\n\t\t\t<!----------- here will be displayed error if occurred -------->\t\n\t\t\t<!------------------------------------------------------------->\n\t\t\t\n\t\t\t<!------------------------ Form za slanje komentara ------------------------>\n\t\t\t<form id=\"ppmessNewMessForm\" method=\"POST\" action=\"\">\n\t\t\t\t<label for=\"ppmessMessageContent\"><?php /* echo __('Message', 'ppmess'); */ ?></label><br/>\n\t\t\t\t<textarea name=\"ppmess_message_content\" type=\"text\" id=\"ppmessMessageContent\" rows=\"10\" autofocus placeholder=\"<?php echo __('Leave the message', 'ppmess'); ?>\"></textarea>\n\t\t\t</form>\n\t\t\t<div class=\"single-commun-submit\">\n\t\t\t\t<?php\n\t\t\t\t\t$link = admin_url('admin-ajax.php?action=ppmess_send_message&post_id=' . $data['post_id'] . '&message_id=' . $data['message_id'] . '&user2_id=' . $data['user2_id'] . '&current_user=' . $data['user_id'] .\n\t\t\t\t\t\t'&message_content_id=ppmessMessageContent'\n\t\t\t\t\t);\n\t\t\t\t\techo '<a class=\"ppmess-tag-a ppmess-send-message ppmess-ajax\" data-post_id=\"' . $data['post_id'] . '\" data-message_id=\"' . $data['message_id'] . '\" \n\t\t\t\t\tdata-user2_id=\"' . $data['user2_id'] . '\" data-current_user=\"'. $data['user_id'] . \n\t\t\t\t\t'\" data-message_content_ID=\"ppmessMessageContent\" href=\"' . $link . '\">Send message</a>';\n\t\t\t\t?>\n\t\t\t</div>\t\n\t<?php \n\t\telse:\t?>\n\t\t\t<!-- post no longer available -->\n\t\t\t<div class=\"ppmess-info-dark\">\n\t\t\t\t<?php printf(__('Post %s no longer available !', 'ppmess'), '<span style=\"color:#1f3d7a;font-style:italic;\">' . $data['post_title'] . '</span>'); ?>\n\t\t\t</div>\n\t<?php \n\t\tendif;\t?>\n\t</div>\n\t\n\t<?php\n}", "public function index()\n \t{\n \t\t// load the header\n \t\t$this->displayHeader();\n\n \t\t// load the view\n \t\t$this->displayView(\"chat/index.php\");\n\n \t\t// load the footer\n \t\t$this->displayFooter();\n \t}", "function ppmess_shortcode_all_communications_view($atts = [], $content = null){\n\t\n\tglobal $post;\n\t\n\t$data = ppmess_shortcode_all_communications();\n?>\t\n\t<!--------- User info --------->\n\t<div class=\"post-info-commun\">\n\t\t<?php echo __('Logged user', 'ppmess'); ?>\n\t\t<span class=\"span-mark\"><?php echo esc_html($data['logged_user']['user_login']); ?></span>\n\t\t<a id=\"link-logout\" href=\"<?php echo wp_logout_url(); ?>\">\n\t\t\t<?php echo __('LogOut ?', 'ppmess'); ?>\n\t\t</a>\n\t\t<div class=\"circle-mark-div-frame\">\n\t\t\t<div class=\"ppmess-box-inline\">\n\t\t\t\t<span class=\"circle-mark-1\"></span>\n\t\t\t\t<span style=\"margin-left:5px;\"><?php echo __('my posts', 'ppmess'); ?></span>\n\t\t\t</div>\n\t\t\t<div class=\"ppmess-box-inline\">\n\t\t\t\t<span class=\"circle-mark-2\"></span>\n\t\t\t\t<span style=\"margin-left:5px;\"><?php echo __('sender\\'s posts', 'ppmess'); ?></span>\n\t\t\t</div>\n\t\t</div>\t\n\t</div>\n\t\t\t\n\t<div class=\"ppmess-commun-frame\">\n<?php\t\n\t\tif( ! empty($data['all_communs'])): ?>\n\t\t\t<!------------ List of the communications ------------>\n\t\t\t<div id=\"communsListFrame\" class=\"communsList-frame\">\t\t\t\t\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<div><?php echo __('Sender', 'ppmess'); ?></div>\n\t\t\t\t\t\t<div><?php echo __('Post title', 'ppmess'); ?></div>\n\t\t\t\t\t\t<div><?php echo __('Date', 'ppmess'); ?></div>\n\t\t\t\t\t\t<div><?php echo __('Status', 'ppmess'); ?></div>\n\t\t\t\t\t\t<div></div>\n\t\t\t\t\t</li>\n\t\t\t\t<?php\t\n\t\t\t\t\tforeach( $data['all_communs'] as $value ):\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$post_info = get_post($value['post_id']);\n\t\t\t\t\t\t$post_author_id = $post_info->post_author;\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Determining secound user\n\t\t\t\t\t\tif($value['sender_id'] != $data['logged_user']['user_id'])\n\t\t\t\t\t\t\t$sender = get_userdata($value['sender_id']);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$sender = get_userdata($value['receiver_id']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Mark new message\n\t\t\t\t\t\tif($value['sent_to'] == $data['logged_user']['user_id']){\n\t\t\t\t\t\t\t$status_class = 'ppmess-new-message';\n\t\t\t\t\t\t\t$status_mess = '';\n\t\t\t\t\t\t\t$title_mess = __('new message', 'ppmess');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$status_class = '';\t\n\t\t\t\t\t\t\t$status_mess = 'OK';\n\t\t\t\t\t\t\t$title_mess = __('message read', 'ppmess');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check if the post was deleted or not\n\t\t\t\t\t\tif( ! empty($post_info->post_title) )\n\t\t\t\t\t\t\t$post_title = $post_info->post_title;\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$post_title = $value['post_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// token\n\t\t\t\t\t\t$token_single_commun = md5(SALT_SINGLE_COMMUN_PPMESS . $value['message_id'] . $value['post_id'] . $data['logged_user']['user_id'] );\n\t\t\t\t\t\t$token_delete_commun = md5(SALT_DELETE_COMMUN_PPMESS . $value['message_id'] . $value['post_id'] . $data['logged_user']['user_id'] );\n\t\t\t\t\t?>\n\t\t\t\t\t\t<li onmouseover=\"ppmess_change_style(this)\" onmouseout=\"ppmess_return_style(this)\">\n\t\t\t\t\t\t\t<!----------------------- Sender ---------------------->\n\t\t\t\t\t\t\t<div><?php echo esc_html($sender->user_login); ?></div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<!-------------------- Post title -------------------->\n\t\t\t\t\t\t\t<?php if( !empty($post_info->post_status) && $post_info->post_status == 'publish'): ?>\n\t\t\t\t\t\t\t\t\t<div><?php echo esc_html($post_title); ?>\n\t\t\t\t\t\t\t\t\t\t<?php if($data['logged_user']['user_id'] == $post_author_id): ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<br/><span class=\"circle-mark-1\"></span>\n\t\t\t\t\t\t\t\t\t\t<?php else: if($sender->ID == $post_author_id): ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<br/><span class=\"circle-mark-2\"></span>\n\t\t\t\t\t\t\t\t\t\t<?php endif; endif; ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t\t\t\t\t<div><span style=\"font-style:italic;text-decoration:line-through;\">\n\t\t\t\t\t\t\t\t\t\t<?php echo esc_html($post_title); ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php if($data['logged_user']['user_id'] == $post_author_id): ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<br/><span class=\"circle-mark-1\"></span>\n\t\t\t\t\t\t\t\t\t\t<?php else: if($sender->ID == $post_author_id): ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<br/><span class=\"circle-mark-2\"></span>\n\t\t\t\t\t\t\t\t\t\t<?php endif; endif; ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php endif; ?>\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<!------------------ Created message date --------------------->\n\t\t\t\t\t\t\t<div><?php echo esc_html(date('d-M-Y', strtotime($value['date_created'])) ); ?></div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<!--------------------- Message status -------------------------->\n\t\t\t\t\t\t\t<div class=\"<?php echo esc_attr($status_class); ?>\" title=\"<?php echo esc_attr($title_mess); ?>\">\n\t\t\t\t\t\t\t\t<?php echo esc_html($status_mess); ?>\n\t\t\t\t\t\t\t\t<?php if($value['number_messages'] > 0): ?>\n\t\t\t\t\t\t\t\t\t<span class=\"colorMark-1\" style=\"float:right;\"><?php echo ' (' . $value['number_messages'] . ')'; ?></span>\n\t\t\t\t\t\t\t\t<?php endif;?>\t\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<!--------------------- View, Delete links --------------------->\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<!-------------- Delete single communication -------------->\n\t\t\t\t\t\t\t\t<a class=\"delete-commun-a\" title=\"<?php echo __('Delete the single communication', 'ppmess'); ?>\" href=\"<?php echo esc_url( get_permalink() . '?delete_commun=1&message_id=' . $value['message_id'] . \n\t\t\t\t\t\t\t\t\t\t'&post_id=' . $value['post_id'] . '&token_delete_commun=' . $token_delete_commun ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo __('Delete', 'ppmess'); ?>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<!-------------- View single communication -------------->\n\t\t\t\t\t\t\t\t<a class=\"view-commun-a\" title=\"<?php echo __('View the single communication', 'ppmess'); ?>\" href=\"<?php echo esc_url(get_permalink($post) . '?message_id=' . $value['message_id'] . \n\t\t\t\t\t\t\t\t\t\t'&post_id=' . $value['post_id'] . '&token_single_commun=' . $token_single_commun . '&single_commun=1#ppmessage-' . $value['message_id']); ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo __('View', 'ppmess'); ?>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t<?php\t\n\t\t\t\t\tendforeach;\t?>\n\t\t\t\t</ul>\n\t\t\t</div><!-- all-communications -->\n<?php\telse: ?>\n\t\t\t<div class=\"ppmess-info-light\">\n\t\t\t\t<span class=\"colorMark-1\"><?php echo __('No one communication established', 'ppmess'); ?></span>\n\t\t\t\t<br/><br/>\n\t\t\t\t<?php echo __('For start communication you need a looked to certain post first and send private message to author of the post', 'ppmess'); ?>\n\t\t\t</div>\n<?php \tendif; ?>\t\t\t\t\t\t\n\t</div><!-- ppmess-commun-frame -->\n\t\n\t<?php\n\treturn $content;\n}", "public function render()\n {\n if ($this->title === null && $this->message === null) {\n return \"\";\n }\n\n $this->addClass(\"alert-{$this->type}\");\n $this->addClass(\"alert\");\n\n $html = \"<div class='col-sm-12'><div style='margin-bottom: 10px; margin-top: 10px;' class='{$this->classes}'>\";\n\n if (!empty($this->title)) {\n $html .= \"<strong>\" . htmlentities($this->title) . \"</strong><br><br>\";\n }\n\n $html .= \"{$this->message}</div></div>\";\n\n return $html;\n }", "function load_conversation()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_load_conversation_start');\n\n $conversation=$this->get_input_vals();\n\n $data['messages']=$this->message_model->get_conversation_messages($this->user,array('conversation_id'=>$conversation['cid']));\n $data['user']=$this->user;\n\n $message_html=$this->load->view(\"template/node/message_stream\",$data,true);\n\n /* BENCHMARK */ $this->benchmark->mark('func_load_conversation_end');\n\n // success\n exit(json_encode($message_html));\n }", "public function getMessages() {\n // Message is the model...which seems to be a class that you \n // can call the all() method on.\n $messages = Message::all();\n\n // Return (render) the messages view template. It must be an\n // object because you can call the with method on it. Pass the \n // messages retrieved from the database into the messages template.\n return view('messages')->with('messages', $messages);\n }", "public function render()\n {\n $that = clone $this;\n if (count($this->tags)) {\n $that->addAttributeAsFirst($this->tags);\n }\n\n $that->addAttributeAsFirst(Converge\\icon_ion(Converge\\ht(\"div\", $this->postCount ?: 0)->addClass(\"post-count\"), \"chatbubbles\"));\n\n $object = $that->_parentRender();\n return $object;\n }", "public function index()\n {\n $uid = Auth::user()->id;\n $messages = Msgs::where('to', $uid);\n return view('msgs.index')->with(\n [\n 'msgs' => $messages,\n ]);\n }", "protected function renderMessage(){\n \t\tif (Yii::app()->session['message'] == NULL)\n \t\t\treturn \"\";\n \t\t\n \t\tswitch (Yii::app()->session['msgType']){\n \t\t\tcase 1:\n \t\t\t\t$res = \"<hr><strong>Success: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\t$res = \"<hr><strong>Error: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\t$res = \"<hr><strong>Unknown: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t}\n \t\t\n \t\tYii::app()->session['message'] = NULL;\n \t\t\n \t\treturn $res;\n \t}", "public function render() {\n\t\techo '<div id=\"neve-dashboard\"></div>';\n\t}", "public function chatBox(Request $request)\n {\n $get_data = SMSHistory::where('userid', Auth::guard('client')->user()->id)->where('send_by', 'receiver')->orderBy('updated_at', 'DESC');\n $sms_history = $get_data->paginate(15);\n $sms_count = $get_data->count();\n\n if ($request->ajax()) {\n if ($sms_history->count() > 0) {\n $view = view('client.get-chat-box', compact('sms_history'))->render();\n } else {\n $view = null;\n }\n return response()->json(['html' => $view]);\n }\n\n return view('client.chat-box', compact('sms_history', 'sms_count'));\n }", "function render() {\n return $this->render_label().$this->render_field().$this->render_message();\n }", "public function index()\n {\n $services = $this->client->chat->v2->services->read();\n $channels = array();\n $userChannels = array();\n if ($services) {\n $channels = $this->client->chat->v2->services($services[0]->sid)->channels->read();\n if (Session::has('user')) {\n $userChannels = $this->client->chat->v2->services($services[0]->sid)->users(Session::get('user.sid'))->userChannels->read();\n }\n }\n return view('chats.index', compact('channels', 'userChannels'));\n }", "public function render() {\n\t\t$logs = $this->logger->get_logs();\n\t\tforeach ( $logs as $log_id => $gist ) {\n\t\t\techo '<div class=\"b6go-gist-debug\">';\n\t\t\tforeach ( $gist as $entry ) {\n\t\t\t\t// Don't wpautop tabular data, as it adds <br> between line number spans.\n\t\t\t\techo ( false === strpos( $entry['message'], '<table' ) ) ? wpautop ( $entry['message'] ) : $entry['message'];\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t.b6go-gist-debug { margin: 2em 0; padding: 10px; background: #e8e8e8;}\n\t\t#querylist .b6go-gist-debug .gist .gist-file .gist-data .line_data pre {\n\t\t\toverflow: auto;\n\t\t\tword-wrap: normal;\n\t\t\t-moz-tab-size: 4;\n\t\t\t-o-tab-size: 4;\n\t\t\ttab-size: 4;}\n\t\t.b6go-gist-debug .gist .gist-file .gist-data .line_numbers span {font-size: 12px;}\n\t\t#querylist .b6go-gist-debug h2 {border: 0; float: none; font-size: 22px; text-align: left; margin: 0 !important; padding-left: 0;}\n\t\t</style>\n\t\t<?php\n\t}", "public function render()\r\n {\r\n ?>\r\n <script type=\"text/javascript\">\r\n jQuery(function ($) {\r\n $('#start-at').mask('9999/99/99 99:99:99', { placeholder:\"yyyy/mm/dd hh:ii:ss\" });\r\n $('#end-at').mask('9999/99/99 99:99:99', { placeholder:\"yyyy/mm/dd hh:ii:ss\" });\r\n });\r\n </script>\r\n \r\n <div class=\"wrap\" id=\"notification-builder\" ng-app=\"Bot\" ng-controller=\"BotController\"\r\n ng-init=\"initMessageBuilder();\">\r\n\r\n <h2>\r\n <?php\r\n if ( ! isset($_GET['id'])) {\r\n _e('New Notification', 'giga-messenger-bots');\r\n } else {\r\n _e('Update Notification', 'giga-messenger-bots');\r\n }\r\n ?>\r\n\r\n <a href=\"<?php echo admin_url('admin.php?page=notifications'); ?>\" class=\"page-title-action\">\r\n <?php _e('Add New', 'giga-messenger-bots'); ?>\r\n </a>\r\n </h2>\r\n \r\n <?php giga_load_component('admin-message'); ?>\r\n\r\n <table id=\"bot-builder-form\">\r\n <tr>\r\n <td id=\"builder-gui\">\r\n <form action=\"options.php\" method=\"post\">\r\n \r\n <?php require_once GIGA_INC_DIR . 'subscription/tpl/message-builder.php'; ?>\r\n\r\n <input type=\"hidden\" name=\"content\" value=\"{{node.answers}}\">\r\n <input type=\"hidden\" name=\"page\" value=\"notifications\">\r\n <input type=\"hidden\" name=\"id\" value=\"<?php echo $this->message->id; ?>\">\r\n </form>\r\n </td><!--#builder-gui-->\r\n\r\n <td class=\"conversation\" id=\"conversation\">\r\n <?php require_once GIGA_INC_DIR . 'builder/tpl/data-table.php'; ?>\r\n\r\n <h3><?php _e('Live Preview', 'giga-messenger-bots'); ?></h3>\r\n <dl ng-include src=\"'/data-table.html'\"></dl>\r\n </td><!--.conversation-->\r\n\r\n <td id=\"message-list\">\r\n <h3><?php _e('Notifications', 'giga-messenger-bots'); ?></h3>\r\n\r\n <table class=\"wp-list-table widefat fixed striped tags\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\" id=\"to-channel\"\r\n class=\"manage-column column-to-channel\"><?php _e('To Channels', 'giga-messenger-bots'); ?></th>\r\n <th scope=\"col\" id=\"name\"\r\n class=\"manage-column column-name\"><?php _e('Description', 'giga-messenger-bots'); ?></th>\r\n <th scope=\"col\" id=\"leads-count\"\r\n class=\"manage-column column-subscribers\"><?php _e('Subscribers', 'giga-messenger-bots'); ?></th>\r\n <th scope=\"col\" id=\"leads-count\"\r\n class=\"manage-column column-sent-count\"><?php _e('Sent Count', 'giga-messenger-bots'); ?></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <?php if (empty($this->messages)) : ?>\r\n <tr>\r\n <td class=\"getting-started\" colspan=\"4\">\r\n <p><?php _e('No Notification Found.', 'giga-messenger-bots'); ?></p>\r\n </td>\r\n </tr>\r\n <?php else :\r\n foreach ($this->messages as $message) : ?>\r\n <tr>\r\n <td>\r\n <a href=\"<?php echo add_query_arg('id', $message->id); ?>\"><?php echo $message->to_channel; ?></a>\r\n </td>\r\n <td>\r\n <a href=\"<?php echo add_query_arg('id', $message->id); ?>\"><?php echo $message->description; ?></a>\r\n </td>\r\n <td><?php echo $message->leadsCount(); ?></td>\r\n <td><?php echo $message->sent_count; ?></td>\r\n </tr>\r\n <?php endforeach;\r\n endif; ?>\r\n </tbody>\r\n </table>\r\n\r\n\r\n <div class=\"pull-right pagination\">\r\n <?php\r\n echo paginate_links([\r\n 'base' => add_query_arg('paged', '%#%'),\r\n 'format' => '?paged=%#%',\r\n 'current' => max(1, $this->paged),\r\n 'total' => $this->pages,\r\n ]);\r\n ?>\r\n </div><!--.pagination-->\r\n </td>\r\n </tr>\r\n </table>\r\n <?php require_once GIGA_INC_DIR . 'builder/tpl/buttons.php'; ?>\r\n </div><!--.wrap-->\r\n \r\n <?php\r\n }", "public function index()\n {\n return view('materialadmin::message.index')->with('messages', Message::where('to_user_id', \\Auth::id())->orderBy('created_at', 'desc')->paginate(15));\n }", "public function retrieveMessagesAction() {\n\n // Retrieve user from session.\n $user = $this->get('user_service')->getUser($this->get('session'));\n\n $messageService = $this->get('message_service');\n\n return new JsonResponse(array(\n 'html' => $this->renderView('@Chat/Chat/partial/_messages.html.twig', array(\n 'messages' => $messageService->getMessagesForUser($user),\n 'isModerator' => $user->getRole() === User::USER_ROLE_MODERATOR\n )),\n 'notifications' => $messageService->getNotificationsFor($user)\n ));\n }", "function buildr_messages_script()\n{\n require_lang('buildr');\n require_lang('chat');\n require_css('buildr');\n\n $member_id = get_member();\n $rows = $GLOBALS['SITE_DB']->query_select('w_members', array('location_realm', 'location_x', 'location_y'), array('id' => $member_id), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n list($realm, $x, $y) = array($rows[0]['location_realm'], $rows[0]['location_x'], $rows[0]['location_y']);\n\n $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_messages WHERE location_x=' . strval($x) . ' AND location_y=' . strval($y) . ' AND location_realm=' . strval($realm) . ' AND (destination=' . strval($member_id) . ' OR destination IS NULL OR originator_id=' . strval($member_id) . ') ORDER BY m_datetime DESC');\n $messages = new Tempcode();\n foreach ($rows as $myrow) {\n $message_sender = $GLOBALS['FORUM_DRIVER']->get_username($myrow['originator_id']);\n if (is_null($message_sender)) {\n $message_sender = do_lang('UNKNOWN');\n }\n $messages->attach(do_template('W_MESSAGE_' . (is_null($myrow['destination']) ? 'ALL' : 'TO'), array('MESSAGESENDER' => $message_sender, 'MESSAGE' => comcode_to_tempcode($myrow['m_message'], $myrow['originator_id']), 'DATETIME' => get_timezoned_date($myrow['m_datetime']))));\n }\n\n $tpl = do_template('W_MESSAGES_HTML_WRAP', array('_GUID' => '05b40c794578d3221e2775895ecf8dbb', 'MESSAGES' => $messages));\n $tpl->evaluate_echo();\n}", "function ap_core_chat_content( $content ) {\r\n global $ap_core_post_format_chat_ids;\r\n\r\n /* If this is not a 'chat' post, return the content. */\r\n if ( !has_post_format( 'chat' ) )\r\n return $content;\r\n\r\n /* Set the global variable of speaker IDs to a new, empty array for this chat. */\r\n $ap_core_post_format_chat_ids = array();\r\n\r\n /* Allow the separator (separator for speaker/text) to be filtered. */\r\n $separator = apply_filters( 'ap_core_chat_separator', ':' );\r\n\r\n /* Open the chat transcript div and give it a unique ID based on the post ID. */\r\n $chat_output = \"\\n\\t\\t\\t\" . '<ul id=\"chat-transcript-' . esc_attr( get_the_ID() ) . '\" class=\"chat-transcript list-group\">';\r\n\r\n /* Split the content to get individual chat rows. */\r\n $chat_rows = preg_split( \"/(\\r?\\n)+|(<br\\s*\\/?>\\s*)+/\", $content );\r\n\r\n /* Loop through each row and format the output. */\r\n foreach ( $chat_rows as $chat_row ) {\r\n\r\n /* If a speaker is found, create a new chat row with speaker and text. */\r\n if ( strpos( $chat_row, $separator ) ) {\r\n\r\n /* Split the chat row into author/text. */\r\n $chat_row_split = explode( $separator, trim( $chat_row ), 2 );\r\n\r\n /* Get the chat author and strip tags. */\r\n $chat_author = strip_tags( trim( $chat_row_split[0] ) );\r\n\r\n /* Get the chat text. */\r\n $chat_text = trim( $chat_row_split[1] );\r\n\r\n /* Get the chat row ID (based on chat author) to give a specific class to each row for styling. */\r\n $speaker_id = ap_core_chat_row_id( $chat_author );\r\n\r\n /* Open the chat row. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\" . '<li class=\"list-group-item chat-row ' . sanitize_html_class( \"chat-speaker-{$speaker_id}\" ) . '\">';\r\n\r\n /* Add the chat row author. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\\t\" . '<div class=\"pull-left chat-author ' . sanitize_html_class( strtolower( \"chat-author-{$chat_author}\" ) ) . ' vcard\"><cite class=\"fn\">' . apply_filters( 'ap_core_chat_author', $chat_author, $speaker_id ) . '</cite>' . $separator . '</div>';\r\n\r\n /* Add the chat row text. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\\t\" . '<div class=\"chat-text\">' . str_replace( array( \"\\r\", \"\\n\", \"\\t\" ), '', apply_filters( 'ap_core_chat_text', $chat_text, $chat_author, $speaker_id ) ) . '</div>';\r\n\r\n /* Close the chat row. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\" . '</li><!-- .chat-row -->';\r\n }\r\n\r\n /**\r\n * If no author is found, assume this is a separate paragraph of text that belongs to the\r\n * previous speaker and label it as such, but let's still create a new row.\r\n */\r\n else {\r\n\r\n /* Make sure we have text. */\r\n if ( !empty( $chat_row ) ) {\r\n\r\n /* Open the chat row. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\" . '<li class=\"list-group-item chat-row ' . sanitize_html_class( \"chat-speaker-{$speaker_id}\" ) . '\">';\r\n\r\n /* Don't add a chat row author. The label for the previous row should suffice. */\r\n\r\n /* Add the chat row text. */\r\n $chat_output .= \"\\n\\t\\t\\t\\t\\t\" . '<div class=\"chat-text\">' . str_replace( array( \"\\r\", \"\\n\", \"\\t\" ), '', apply_filters( 'ap_core_chat_text', $chat_row, $chat_author, $speaker_id ) ) . '</div>';\r\n\r\n /* Close the chat row. */\r\n $chat_output .= \"\\n\\t\\t\\t</li><!-- .chat-row -->\";\r\n }\r\n }\r\n }\r\n\r\n /* Close the chat transcript div. */\r\n $chat_output .= \"\\n\\t\\t\\t</ul><!-- .chat-transcript -->\\n\";\r\n\r\n /* Return the chat content and apply filters for developers. */\r\n return apply_filters( 'ap_core_chat_content', $chat_output );\r\n}", "public function index()\n\t{\n\t\t$uuid = $this->get_uuid();\n\t\t$peers = $this->get_peers();\n\t\t$next_msg = 0;\n\n\t\tif (isset($peers[site_url('lab5/receive_message')]))\n\t\t{\n\t\t\t$next_msg = $peers[site_url('lab5/receive_message')][\"WeHave\"] + 1;\n\t\t}\n\n\t\t$this->load->view(\"header\");\n\t\t$this->load->view(\"view_messages\", \n\t\t\tarray(\"messages\" => $this->get_ordered_messages(), \n\t\t\t\t\"peers\" => $peers,\n\t\t\t\t\"uuid\" => $uuid,\n\t\t\t\t\"next_msg\" => $next_msg));\n\t}", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "public function index()\n {\n $messages = Message::where('receiver_id','=',Auth::user()->id)->paginate(10);\n\n return view('messages.index')->with('messages', $messages);\n }", "public function index()\n {\n $groups = $this->Chat->getAllRoom();\n $this->set(['title' => 'Chat Online', 'groups' => $groups]);\n $this->render('index');\n }", "private function _messages ()\n\t{\n\t\t$string = '<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t <meta charset=\"utf-8\">\n\t\t <title>Generator script Phutv</title>\n\t\t <script type=\"text/javascript\">\n\n\t\t\t\tsetInterval(function () {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}, 1000);\n\n\t\t\t\t</script>\n\t\t</head>\n\t\t<body style=\"background: #FCF7E3;\">\n\t\t\t<div style=\"width: 600px; margin: 40px auto; font-family: arial, sans-serif; background: #fff; border: 1px dotted #000; padding: 30px; \">\n\t\t\t<h1>Generator script run Phutv</h1>\n\t\t\t\t' . ul($this->msg) . '\n\t\t\t</div>\n\t\t</body>\n\t\t</html>';\n\t\treturn $string;\n\t\t\n\t}", "public function run()\n {\n echo \"\\n\" . $this->renderBodyEnd();\n echo \"\\n\" . Html::endTag('div');\n\n }", "public function render()\n {\n return view('turbo-laravel::components.stream-from', [\n 'channel' => $this->source instanceof HasBroadcastChannel ? $this->source->broadcastChannel() : $this->source,\n ]);\n }", "public function render()\n {\n\n $this->setUp();\n \n $html = '';\n \n // $html .= $this->panelTitle();\n $html .= $this->panelMenu();\n // $html .= $this->panelButtons();\n \n if ($this->subPannel) {\n foreach ($this->subPannel as $subPanel) {\n if (is_string($subPanel))\n $html .= $subPanel;\n else\n $html .= $subPanel->render();\n }\n }\n \n return $html;\n \n }", "public function renderFlashMessages() {}", "public function renderLogContainer(array $htmlOptions = array())\n\t{\n\t\t$defaultHtmlOptions = array(\n\t\t\t'id' => $this->getLogContainerId(),\n\t\t\t'class' => 'chat-log-container',\n\t\t);\n\t\t$htmlOptions = array_merge($defaultHtmlOptions, $htmlOptions);\n\t\techo Html::tag('div', '', $htmlOptions);\n\t}" ]
[ "0.7262978", "0.701824", "0.68080693", "0.6728015", "0.67100793", "0.66324675", "0.6518114", "0.64994365", "0.64758414", "0.6472092", "0.646367", "0.63670653", "0.6335312", "0.6320743", "0.6303965", "0.62456906", "0.62416136", "0.621546", "0.6212046", "0.61697", "0.6165605", "0.61510247", "0.61465263", "0.61177516", "0.60960436", "0.6089397", "0.6087987", "0.6040832", "0.60372865", "0.60340154", "0.600377", "0.597443", "0.5968549", "0.5968549", "0.5940202", "0.5923077", "0.59204775", "0.5907808", "0.5905673", "0.59021264", "0.589669", "0.58908516", "0.5888833", "0.5881241", "0.5879909", "0.58744484", "0.58644336", "0.5862421", "0.58435327", "0.5837488", "0.583519", "0.58303905", "0.5814239", "0.581258", "0.5809967", "0.58033055", "0.5786629", "0.57756597", "0.5770751", "0.57482594", "0.57460606", "0.574139", "0.5729497", "0.5727916", "0.5727869", "0.57203865", "0.5719948", "0.5718743", "0.5715382", "0.57116866", "0.57029176", "0.57016957", "0.56923556", "0.56859076", "0.5682454", "0.56793004", "0.56640285", "0.5650607", "0.56431407", "0.56423354", "0.5635985", "0.5629748", "0.56215066", "0.56210774", "0.5619209", "0.5615707", "0.56081647", "0.56053674", "0.5604986", "0.5601901", "0.5594368", "0.5587148", "0.558383", "0.55821866", "0.55747926", "0.5572225", "0.55650175", "0.5564269", "0.55639434", "0.5562856" ]
0.7145096
1
Render the "refresh chat periodically" js.
function render_chat_refresh($not_mini=null){ $location = "mini_chat.php"; $frame = 'mini_chat'; if($not_mini){ $location = "village.php"; $frame = 'main'; } ob_start(); ?> <script type="text/javascript"> function refreshpage<?php echo $frame; ?>(){ parent.<?php echo $frame; ?>.location="<?php echo $location; ?>"; } setInterval("refreshpage<?php echo $frame; ?>()",300*1000); </script> <?php $res = ob_get_contents(); ob_end_clean(); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshIntervalHeader() {\n\t\techo \"<h3>\".__('Adjust cache update interval (student)', lepress_textdomain).\"</h3>\";\n\t}", "function refresh();", "private function _messages ()\n\t{\n\t\t$string = '<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t <meta charset=\"utf-8\">\n\t\t <title>Generator script Phutv</title>\n\t\t <script type=\"text/javascript\">\n\n\t\t\t\tsetInterval(function () {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}, 1000);\n\n\t\t\t\t</script>\n\t\t</head>\n\t\t<body style=\"background: #FCF7E3;\">\n\t\t\t<div style=\"width: 600px; margin: 40px auto; font-family: arial, sans-serif; background: #fff; border: 1px dotted #000; padding: 30px; \">\n\t\t\t<h1>Generator script run Phutv</h1>\n\t\t\t\t' . ul($this->msg) . '\n\t\t\t</div>\n\t\t</body>\n\t\t</html>';\n\t\treturn $string;\n\t\t\n\t}", "public function run()\n {\n if (Yii::$app->user->isGuest)\n return;\n\n return $this->render('overview', array(\n 'update' => \\humhub\\modules\\notification\\controllers\\ListController::getUpdates()\n ));\n }", "public function refresh() {}", "public function refresh();", "public function refresh();", "public function reactRefresh()\n {\n if (! is_file(public_path('/hot'))) {\n return;\n }\n\n $url = rtrim(file_get_contents(public_path('/hot')));\n\n return new HtmlString(\n sprintf(\n <<<'HTML'\n <script type=\"module\">\n import RefreshRuntime from '%s/@react-refresh'\n RefreshRuntime.injectIntoGlobalHook(window)\n window.$RefreshReg$ = () => {}\n window.$RefreshSig$ = () => (type) => type\n window.__vite_plugin_react_preamble_installed__ = true\n </script>\n HTML,\n $url\n )\n );\n }", "function messaging_show_online_dot_js() {\n\t\tob_start(); ?>\n\n\t\t<span class=\"um-online-status <# if ( conversation.online ) { #>online<# } else { #>offline<# } #>\"><i class=\"um-faicon-circle\"></i></span>\n\n\t\t<?php ob_end_flush();\n\t}", "function dashboard_widget_display() {\n\t\techo '<div class=\"escalate-dashboard-loading\">Loading Stats</div>';\n\t}", "function dashboard_widget() {\n\t\tif(!empty($this->options['stats_last_cache'])):\n\t\t\t$last_cache = '<em>Last Updated ' . date(\"m/d/y @ h:i:s\", $this->options['stats_last_cache']) . '</em>';\n\t\telse:\n\t\t\t$last_cache = '';\n\t\tendif;\n\t\twp_add_dashboard_widget('escalate_network_stats', 'Escalate Network Stats'.$last_cache, array($this,'dashboard_widget_display'));\t\n\t}", "public function getRefreshListeMessages() {\n\t\t$messages = \\App\\Models\\Message::orderBy('created_at','ASC')->get();\n\t\t$d = view('_messages',array('messages'=>$messages));\n\t\treturn $d; // html\n }", "function Refresh();", "public function render() {\n\t\t$supportUrl = 'https://wpml.org/forums/forum/english-support/?utm_source=plugin&utm_medium=gui&utm_campaign=wpmltm';\n\t\t$supportLink = '<a target=\"_blank\" rel=\"nofollow\" href=\"' . esc_url( $supportUrl ) . '\">'\n\t\t . esc_html__( 'contact our support team', 'wpml-translation-management' )\n\t\t . '</a>';\n\n\n\t\t?>\n\t\t<div id=\"ams-ate-console\">\n\t\t\t<div class=\"notice inline notice-error\" style=\"display:none; padding:20px\">\n\t\t\t\t<?php echo sprintf(\n\t\t\t\t// translators: %s is a link with 'contact our support team'\n\t\t\t\t\tesc_html(\n\t\t\t\t\t\t__( 'There is a problem connecting to automatic translation. Please check your internet connection and try again in a few minutes. If you continue to see this message, please %s.', 'wpml-translation-management' )\n\t\t\t\t\t),\n\t\t\t\t\t$supportLink\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<span class=\"spinner is-active\" style=\"float:left\"></span>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\tsetTimeout(function () {\n\t\t\t\tjQuery('#ams-ate-console .notice').show();\n\t\t\t\tjQuery(\"#ams-ate-console .spinner\").removeClass('is-active');\n\t\t\t}, 20000);\n\t\t</script>\n\t\t<?php\n\t}", "public function refresh(): void;", "function refresh_list() {\n\tob_clean();\n\t$this->show_inactive = !$this->show_inactive;\n\t$list = $this->show_list();\n\t$HTML = \"@var me = document.getElementById('\".$this->list_ID.\"');\\n\";\n\t$HTML .= \"var myHTML = '';\\n\";\n\tforeach ($list as $value) {\n\t\t$HTML .= \"myHTML += \\\"\".$value.\"\\\";\\n\";\n\t}\t\n\t$HTML .= \"me.innerHTML=myHTML;\\n\";\n\treturn $HTML;\n}", "function refresh($cooldown){\r\n\t\techo(\"<meta http-equiv='refresh' content='0'>\"); \r\n\r\n\t}", "private function renderJS()\n {\n return '<script>var host = \\'' . config('notifier.host') . '\\';' .\n 'var port = \\'' . config('notifier.port') . '\\';' .\n 'var socket = new WebSocket(\\'' . config('notifier.connection') . '://\\' + host + \\':\\' + port);' .\n 'socket.onopen = function(e) {' .\n 'socket.send(location.pathname);' .\n 'console.log(\"Connection established!\");' .\n '};' .\n '</script>' . PHP_EOL;\n }", "public function printRefreshScript()\n {\n if (isset($_GET['post']) && is_numeric($_GET['post']) && isset($_GET['action']) && $_GET['action'] == \"edit\") {\n\n //Store post id to var\n $post_id = $_GET['post'];\n\n //Check if is published && url is valid\n if (get_post_status($post_id) == 'publish') {\n $url = get_permalink($post_id);\n\n if (!filter_var($url, FILTER_VALIDATE_URL) === false) {\n if (function_exists('curl_init')) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n curl_setopt($ch, CURLOPT_TIMEOUT_MS, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_exec($ch);\n curl_close($ch);\n echo '<!-- Cache redone for ' . $url . ' -->';\n }\n }\n }\n }\n }", "public function dashboard_widget_content() {\n\t\t$is_authed = ( MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed() );\n\n\t\tif ( ! $is_authed ) {\n\t\t\t$this->widget_content_no_auth();\n\t\t} else {\n\t\t\tmonsterinsights_settings_error_page( 'monsterinsights-dashboard-widget', '', '0' );\n\t\t\tmonsterinsights_settings_inline_js();\n\t\t}\n\n\t}", "public function run()\r\n\t{\r\n $this->render('MessageDisplay');\r\n\t}", "public function render()\n {\n Admin::script($this->script());\n\n $refresh = trans('Tải lại');\n\n return <<<EOT\n<a class=\"btn btn-sm btn-primary grid-refresh\" title=\"$refresh\"><i class=\"fa fa-refresh\"></i><span class=\"hidden-xs\"> $refresh</span></a>\nEOT;\n }", "public function render()\n {\n //rafraichir le chat\n if($_GET['function'] == 'refresh')\n {\n $this->model->refreshTchat();\n }\n \n // ajouter les commentaires\n else if($_GET['function'] == 'add') \n {\n $this->model->saveTchat();\n }\n\n //rafraichir le score\n else if($_GET['function'] == 'score')\n {\n $this->model->recupReponse();\n }\n\n require ROOT.\"/App/View/AjaxView.php\";\n }", "function index() {\n UserConfigOptions::setValue('status_update_last_visited', new DateTimeValue(), $this->logged_user);\n \n // Popup\n if($this->request->isAsyncCall()) {\n $this->skip_layout = true;\n \n $this->setTemplate(array(\n 'template' => 'popup',\n 'controller' => 'status',\n 'module' => STATUS_MODULE,\n ));\n \n $last_visit = UserConfigOptions::getValue('status_update_last_visited', $this->logged_user);\n $new_messages_count = StatusUpdates::countNewMessagesForUser($this->logged_user, $last_visit);\n \n $limit = $new_messages_count > 10 ? $new_messages_count : 10;\n \n $latest_status_updates = StatusUpdates::findVisibleForUser($this->logged_user, $limit);\n $this->smarty->assign(array(\n 'status_updates' => $latest_status_updates,\n \"rss_url\" => assemble_url('status_updates_rss', array(\n 'token' => $this->logged_user->getToken(true),\n )),\n ));\n \n // Archive\n } else {\n $this->setTemplate(array(\n 'template' => 'messages',\n 'controller' => 'status',\n 'module' => STATUS_MODULE,\n ));\n \n $visible_users = $this->logged_user->visibleUserIds();\n $selected_user_id = $this->request->getId('user_id');\n if($selected_user_id) {\n if(!in_array($selected_user_id, $visible_users)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $selected_user = Users::findById($selected_user_id);\n if(!instance_of($selected_user, 'User')) {\n $this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n } else {\n $selected_user = null;\n } // if\n \n if($this->request->isApiCall()) {\n if($selected_user) {\n $this->serveData(StatusUpdates::findByUser($selected_user), 'messages');\n } else {\n $this->serveData(StatusUpdates::findVisibleForUser($this->logged_user, 50), 'messages');\n } // if\n } else {\n $per_page = $this->status_updates_per_page; // Messages per page\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n \n if($selected_user) {\n $rss_url = assemble_url('status_updates_rss', array(\n \"user_id\" => $selected_user_id,\n 'token' => $this->logged_user->getToken(true),\n ));\n $rss_title = clean($selected_user->getDisplayName()). ': '.lang('Status Updates');\n list($status_updates, $pagination) = StatusUpdates::paginateByUser($selected_user, $page, $per_page);\n $this->smarty->assign(array(\n \"selected_user\" => $selected_user,\n \"rss_url\" => $rss_url\n ));\n } else {\n $rss_url = assemble_url('status_updates_rss', array('token' => $this->logged_user->getToken(true)));\n $rss_title = lang('Status Updates');\n list($status_updates, $pagination) = StatusUpdates::paginateByUserIds($visible_users, $page, $per_page);\n $this->smarty->assign(array(\n \"rss_url\" => $rss_url\n ));\n } // if\n \n $this->wireframe->addRssFeed(\n $rss_title,\n $rss_url,\n FEED_RSS \n );\n \n $this->smarty->assign(array(\n \"visible_users\" => Users::findUsersDetails($visible_users),\n \"status_updates\" => $status_updates,\n \"pagination\" => $pagination\n ));\n } // if\n } // if\n }", "function atu_showthread()\n{\n\tglobal $mybb, $atujq, $atujs, $atu_link, $tid, $fid;\n\n\tif(can_auto_update())\n\t{\n\t\n\t\t$atujq = '<script src=\"http://code.jquery.com/jquery-latest.js\"></script>\n\t<script>\n\tjQuery.noConflict();\n\t</script>';\n\t\t\n\t\t$atujs = '<script type=\"text/javascript\">\n\tvar time = '.TIME_NOW.';\n\tvar refreshId = setInterval(function()\n\t{\n\t\tjQuery.get(\\'getnewposts.php?tid='.$tid.'}&timestamp=\\'+time,\n\t\tfunction(result) {\n\t\t\tjQuery(\\'#autorefresh\\').append(\\'<span style=\"display: none;\" class=\"new-post\" name=\"post[]\">\\'+result+\\'</span>\\');\n\t\t\tjQuery(\\'#autorefresh\\').find(\".new-post:last\").fadeIn(\\'slow\\');\n\t\t});\n\n\t\ttime = Math.round((new Date()).getTime() / 1000);\n\n\t}, '.intval($mybb->settings['atu_refreshrate']).');\n\t</script>';\n\t} else {\n\t\t$atujq = '';\n\t\t$atujs = '';\n\t}\n\n\tif($mybb->usergroup['cancp'])\n\t{\n\t\t$on = true;\n\t\t$display = true;\n\t\t\n\t\tif($mybb->settings['atu_tf_wlbl'] != 'all')\n\t\t{\n\t\t\t$perms = explode(\"|\",$mybb->settings['atu_tf_wlbl']);\n\t\t\t$ids = explode(\",\",$perms[2]);\n\t\t\t\n\t\t\tif($perms[0] == 'threads')\n\t\t\t{\n\t\t\t\t$thread_in_list = in_array($tid,$ids);\n\t\t\t\t\n\t\t\t\tif($thread_in_list && $perms[1] == 'blacklist')\n\t\t\t\t{\n\t\t\t\t\t$on = false;\n\t\t\t\t} elseif(!$thread_in_list && $perms[1] == 'whitelist') {\n\t\t\t\t\t$on = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$display = false;\n\t\t\t}\n\t\t}\n\t\tif($display)\n\t\t{\n\t\t\tif($on)\n\t\t\t{\n\t\t\t\t$atu_link = '<a href=\"showthread.php?tid='.$tid.'&amp;toggle_atu=true&amp;my_post_key='.$mybb->post_code.'\">Turn off auto thread updating in this thread</a><br />';\n\t\t\t} else {\n\t\t\t\t$atu_link = '<a href=\"showthread.php?tid='.$tid.'&amp;toggle_atu=true&amp;my_post_key='.$mybb->post_code.'\">Turn on auto thread updating in this thread</a><br />';\n\t\t\t}\n\t\t}\n\t}\n}", "abstract public function refresh();", "function ajan_core_render_message() {\n\n\t// Get ActivityNotifications\n\t$ajan = activitynotifications();\n\n\tif ( !empty( $ajan->template_message ) ) :\n\t\t$type = ( 'success' === $ajan->template_message_type ) ? 'updated' : 'error';\n\t\t$content = apply_filters( 'ajan_core_render_message_content', $ajan->template_message, $type ); ?>\n\n\t\t<div id=\"message\" class=\"ajan-template-notice <?php echo esc_attr( $type ); ?>\">\n\n\t\t\t<?php echo $content; ?>\n\n\t\t</div>\n\n\t<?php\n\n\t\tdo_action( 'ajan_core_render_message' );\n\n\tendif;\n}", "function timezonecalculator_ajax_refresh() {\r\n\r\n\t$fieldsPre=\"timezones_\";\r\n\r\n\tif(get_option($fieldsPre.'Use_Ajax_Refresh')=='1') { \r\n\t\t$refreshTime = get_option($fieldsPre.'Refresh_Time');\r\n\r\n\t\t//regex taken from php.net by mark at codedesigner dot nl\r\n\t\tif (!preg_match('@^[-]?[0-9]+$@',$refreshTime) || $refreshTime<1)\r\n\t\t\t$refreshTime=30;\r\n\t?>\r\n\r\n<script type=\"text/javascript\" language=\"javascript\">\r\n\r\n\t/* <![CDATA[ */\r\n\r\n\t/*\r\n\tTimeZoneCalculator AJAX Refresh\r\n\t*/\r\n\r\n\tvar timezones_divclassname='timezonecalculator-refreshable-output';\r\n\r\n\tfunction timezones_refresh() {\r\n\t\tvar params = 'timezonecalculator-refresh=1';\r\n\t\tnew Ajax.Request(\r\n\t\t\t'<?php echo(get_option('home'). '/'); ?>',\r\n\t\t\t{\r\n\t\t\t\tmethod: 'post',\r\n\t\t\t\tparameters: params,\r\n\t\t\t\tonSuccess: timezones_handleReply\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction timezones_handleReply(response) {\r\n\t\tif (200 == response.status){\r\n\t\t\tvar resultText=response.responseText;\r\n\r\n\t\t\tif (resultText.indexOf('<div class=\"'+timezones_divclassname+'\"')>-1) {\r\n\t\t\t\tvar timezones_blocks=$$('div.'+timezones_divclassname);\r\n\t\t\t\tfor (var i=0;i<timezones_blocks.length;i++) {\r\n\t\t\t\t\tElement.replace(timezones_blocks[i], resultText);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tEvent.observe(window, 'load', function(e){ if ($$('div.'+timezones_divclassname).length>0) new PeriodicalExecuter(timezones_refresh, <?php echo($refreshTime); ?>); });\r\n\r\n\t/* ]]> */\r\n\r\n</script>\r\n\r\n\t<?php }\r\n}", "protected function renderStats() {\n\t\t$stats = WCF::getCache()->get('stat');\n\t\tWCF::getTPL()->assign('stats', $stats);\n\t}", "function count_new_messages() {\n $this->renderText(NotificationsActivityLogs::countSinceLastVisit($this->logged_user));\n }", "function refreshTime(){\n\n global $refreshTime;\n getChannel();\n if ((getChannel()[Name] == 'SmartPolitech') || (getChannel()[Name] == 'NoticiasEpcc')){\n $refreshTime = 960;\n }\n return $refreshTime;\n}", "public function myResults_console_fct()\n\t{\n \t\t\t\n\t$string_console = '<div id=\"auto_load_console_div\" class=\"auto_load_div\"></div>';\n\n\t?>\n\n\n \t<script>\n\tvar $jq = jQuery.noConflict();\n\t\n \tfunction auto_load_console(){\n \t$jq.ajax({\n \turl: \"/wp-content/plugins/myResults/console.php\",\n \tcache: false,\n \tsuccess: function(data){\n \t$jq(\"#auto_load_console_div\").html(data);\n \t} \n \t});\n \t}\n\t\n \t$jq(document).ready(function(){\n\t\n \tauto_load_console(); //Call auto_load() function when DOM is Ready\n\t\n \t});\n\n \t //Refresh auto_load() function after 500 milliseconds\n \t setInterval(auto_load_console,500);\n \t </script>\n\t<?php\n\n\treturn $string_console;\n\t}", "public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}", "public function track_helper_subscriptions_refresh() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_update' );\n\t}", "function app_auto_refresh(int $delay)\n{\n header('Refresh: ' . $delay . '; ' . $_SERVER['REQUEST_URI']);\n}", "public function refresh()\n {\n }", "function auto_update_javascript()\n\t{\n\t\treturn 'var zhoutQueue = [];var first_state_update = false;var autoTimeoutId = 0;var autoIntervalId =0; \n\t\t\t\tfunction autoUpdate()\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (zhoutQueue.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//console.log(\\'%o\\',\\'masuk-2\\');\n\t\t\t\t\t autoIntervalId = setInterval(\\'fetchDataZhout()\\','.$this->_INTERVAL_TIME_AT_SECOND.');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (! first_state_update)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log(\\'%o\\',\\'masuk-1\\');\n\t\t\t\t\t\t\tgetLatestZhout();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log(\\'%o\\',\\'masuk\\');\n\t\t\t\t\t\tautoTimeoutId = setTimeout(\\'getLatestZhout()\\','.$this->_INTERVAL_TIME_AT_FIRST.');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}';\n\t}", "protected function script()\n {\n $message = trans('admin.refresh_succeeded');\n\n return <<<EOT\n\n$('.grid-refresh').on('click', function() {\n $.pjax.reload('#pjax-container');\n toastr.success('{$message}');\n});\n\nEOT;\n }", "public function scheduler() {\n\n\t\t$user = \\Auth::User();\n\n\t\t$station_id = $user->station->id;\n//\t\t$talk_shows = \\App\\ConnectContent::where('content_type_id', ContentType::GetTalkContentTypeID())\n//\t\t\t->orderBy('start_date')\n//\t\t\t->where('station_id', $station_id)\n//\t\t\t->get();\n\n\t\treturn view('airshrconnect.scheduler')\n\t\t\t->with('WebSocketURL', \\Config::get('app.WebSocketURL'))\n\t\t\t->with('content_type_list', ContentType::$CONTENT_TYPES)\n\t\t\t->with('content_type_list_for_connect', ContentType::$CONTENT_TYPES_FOR_CONNECT)\n\t\t\t->with('content_type_id_for_talkshow', ContentType::GetTalkShowContentTypeID());\n//\t\t\t->with('talk_shows', $talk_shows);\n\n\t}", "public function update() {\n\t\treturn $this->render(array('head' => true, 'status' => 501));\n\t}", "function index() {\n ConfigOptions::setValueFor('fmn_last_visited', $this->logged_user, new DateTimeValue());\n\t \n // Popup\n if($this->request->isAsyncCall()) {\n $this->setView(array(\n 'template' => 'popup',\n 'controller' => 'frosso_mail_notify',\n 'module' => FROSSO_MAILN_MODULE,\n ));\n\t\t\n\t\t// $this->response->assign(array(\n // 'mail_updates' => time(),\n // ));\n\n\t } else {\n\t \t// $this->response->forbidden();\n } // if\n }", "public function showChatPopup()\n {\n Cookie::queue('chatPopupShow', 'true', 60);\n $this->chatPopupVisibility = true;\n\n // load chat history by reloading the page\n $this->dispatchBrowserEvent('reload-page');\n }", "public function render() {\n\n /* returned HTML string */ \n $render = '';\n\n /* cache file available */\n $cache = $this->cache . $this->ID . '_' . $this->count . '.html';\n\n /* we can calculate the number of seconds which have expired since the file was created (assuming it exists) */\n $cacheage = (file_exists($cache) ? time() - filemtime($cache) : -1 );\n\n /* if the file doesn't exists or the number of seconds is greater than $cacheFor \n * we need to re-generate the HTML widget cache file. \n */\n if($cacheage < 0 || $cacheage > $this->cacheFor) {\n\n /* fetch feed */\n $json = $this->fetchFeed();\n\n if($json) {\n \n $widget = '';\n $status = '';\n\n /* examine all tweets */ \n for($i=0, $j=count($json); $i<$j; $i++) {\n\n if($i == 0) {\n \n $widget .= $this->parseStatus($json[$i], $this->widgetTemplate);\n }\n\n $status .= $this->parseStatus($json[$i], $this->tweetTemplate);\n\n }//endfor\n\n $render = str_replace('{TWEETS}', $status, $widget); \n\n /* if the HTML is correctly generated in our $render string, \n we can save it to our cache file \n */\n file_put_contents($cache, $render);\n }\n\n }//endif\n\n /*\n * the $render string will be empty if a valid cache file exists.\n * it will be empty if the Twitter API call falls; \n * in that situation, we'll retrieve the last available cached file.\n * fetch from cache file.\n */\n if($render == '' && $cacheage > 0) {\n\n $render = file_get_contents($cache);\n }\n \n /* \n * to complete our method, we return $render to the calling code. However, we must\n * parse the dates first.\n */\n return $this->parseDates($render);\n\n }", "public function renderChatView() {\n\n $messages = $this->loadMessages();\n require 'public/views/front/chatView.phtml';\n\n }", "public function refresh() {\n $logged_user = $_SESSION['logged_user'];\n\n if ($logged_user) {\n $this->load->model(\"topic_model\", \"topics\");\n\n $this->topics->update_user_topics($logged_user);\n }\n }", "function messaging_inbox_page_output() {\n\tglobal $wpdb, $wp_roles, $current_user, $user_ID, $current_site, $messaging_official_message_bg_color, $messaging_max_inbox_messages, $messaging_max_reached_message, $wp_version;\n\n\tif (isset($_GET['updated'])) {\n\t\t?><div id=\"message\" class=\"updated fade\"><p><?php echo stripslashes(sanitize_text_field($_GET['updatedmsg'])) ?></p></div><?php\n\t}\n\n\t$action = isset($_GET[ 'action' ]) ? $_GET[ 'action' ] : '';\n\n\techo '<div class=\"wrap\">';\n\tswitch( $action ) {\n\t\t//---------------------------------------------------//\n\t\tdefault:\n\t\t\tif ( isset($_POST['Remove']) ) {\n\t\t\t\tmessaging_update_message_status(intval($_POST['mid']),'removed');\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode(__('Message removed.', 'messaging')) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\tif ( isset($_POST['Reply']) ) {\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&action=reply&mid=\" . intval($_POST['mid']) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status != %s\", $user_ID, 'removed'));\n\t\t\t$tmp_unread_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'unread'));\n\t\t\t$tmp_read_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'read'));\n\t\t\t?>\n <h2><?php _e('Inbox', 'messaging') ?> <a class=\"add-new-h2\" href=\"admin.php?page=messaging_new\"><?php _e('New Message', 'messaging') ?></a></h2>\n <?php\n\t\t\tif ($tmp_message_count == 0){\n\t\t\t?>\n <p><?php _e('No messages to display', 'messaging') ?></p>\n <?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Usage', 'messaging') ?></h3>\n <p>\n\t\t\t\t<?php _e('Maximum inbox messages', 'messaging') ?>: <strong><?php echo $messaging_max_inbox_messages; ?></strong>\n <br />\n <?php _e('Current inbox messages', 'messaging') ?>: <strong><?php echo $tmp_message_count; ?></strong>\n </p>\n <?php\n\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t?>\n <p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\tif ($tmp_unread_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Unread', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %s AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'unread');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t//=========================================================//\n\t\t\t\tif ($tmp_read_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Read', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'read');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"view\":\n\t\t\t$tmp_total_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d\", $user_ID));\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t\tif ($tmp_total_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t?>\n\t\t\t\t\t<p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t\t<?php\n\t\t\t\t\t} else {\n\t\t\t\t\tmessaging_update_message_status(intval($_GET['mid']),'read');\n\t\t\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t\t\t$tmp_message_status = $wpdb->get_var($wpdb->prepare(\"SELECT message_status FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_message_status = ucfirst($tmp_message_status);\n\t\t\t\t\t$tmp_message_status = __($tmp_message_status, 'messaging');\n\t\t\t\t\t$tmp_message_stamp = $wpdb->get_var($wpdb->prepare(\"SELECT message_stamp FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t?>\n\n\t\t\t\t\t<h2><?php _e('View Message: ', 'messaging') ?><?php echo intval($_GET['mid']); ?></h2>\n\t\t\t\t\t<form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging\">\n\t\t\t\t\t<input type=\"hidden\" name=\"mid\" value=\"<?php echo intval($_GET['mid']); ?>\" />\n\t\t\t\t\t<h3><?php _e('Sent', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message_stamp); ?></p>\n\t\t\t\t\t<h3><?php _e('Status', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_status; ?></p>\n\t\t\t\t\t<h3><?php _e('From', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_username; ?></p>\n\t\t\t\t\t<h3><?php _e('Subject', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_subject; ?></p>\n\t\t\t\t\t<h3><?php _e('Content', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_content; ?></p>\n <p class=\"submit\">\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Back', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Remove\" value=\"<?php _e('Remove', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-primary\" type=\"submit\" name=\"Reply\" value=\"<?php _e('Reply', 'messaging') ?>\" />\n </p>\n\t\t\t\t\t</form>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t?>\n <p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n <?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"remove\":\n\t\t\t//messaging_update_message_status($_GET['mid'],'removed');\n\t\t\tmessaging_remove_message(intval($_GET['mid']));\n\t\t\techo \"\n\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Message removed.') . \"';\n\t\t\t</script>\n\t\t\t\";\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply\":\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t$tmp_message_subject = __('RE: ', 'messaging') . $tmp_message_subject;\n\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t//$tmp_message_content = \"\\n\\n\" . $tmp_username . __(' wrote:') . '<hr>' . $tmp_message_content;\n\n\t\t\t$rows = get_option('default_post_edit_rows');\n if (($rows < 3) || ($rows > 100)){\n $rows = 12;\n\t\t\t}\n $rows = \"rows='$rows'\";\n\n if ( user_can_richedit() ){\n add_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t}\n\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n ?>\n\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo $tmp_username; ?>\" class=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_username; ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php echo $tmp_username . __(' wrote', 'messaging'); ?></th>\n <td><?php echo $tmp_message_content; ?>\n <br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td>\n\t\t\t<?php if (version_compare($wp_version, \"3.3\") >= 0 && user_can_richedit()) { ?>\n\t\t\t\t<?php wp_editor('', 'message_content'); ?>\n\t\t\t<?php } else { ?>\n\t\t\t\t<textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'></textarea>\n\t\t\t<?php } ?>\n\n\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form> <?php\n\t\t\t} else {\n\t\t\t?>\n\t\t\t<p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n\t\t\t<?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply_process\":\n\t\t\tif ($_POST['message_to'] == '' || $_POST['message_subject'] == '' || $_POST['message_content'] == ''){\n\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t$rows = 12;\n\t\t\t\t}\n\t\t\t\t$rows = \"rows='$rows'\";\n\n\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\tadd_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t\t}\n\t\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n\t\t\t\t?>\n\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n <p><?php _e('Please fill in all required fields', 'messaging') ?></p>\n\t\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n\t\t\t\t\t\tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n\t\t\t\t\t\tstyle=\"width: 95%\" maxlength=\"200\"\n\t\t\t\t\t\tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n\t\t\t\t\t<td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php _e('Required', 'messaging') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n\t\t\t\t</form>\n\t\t<?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//==========================================================//\n\t\t\t\t$tmp_usernames = sanitize_text_field($_POST['message_to']);\n\t\t\t\t//$tmp_usernames = str_replace( \",\", ', ', $tmp_usernames );\n\t\t\t\t//$tmp_usernames = ',,' . $tmp_usernames . ',,';\n\t\t\t\t//$tmp_usernames = str_replace( \" \", '', $tmp_usernames );\n\t\t\t\t$tmp_usernames_array = explode(\",\", $tmp_usernames);\n\t\t\t\t$tmp_usernames_array = array_unique($tmp_usernames_array);\n\n\t\t\t\t$tmp_username_error = 0;\n\t\t\t\t$tmp_error_usernames = '';\n\t\t\t\t$tmp_to_all_uids = '|';\n\n\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t$tmp_username = trim($tmp_username);\n\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t$tmp_username_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\tif ($tmp_username_count > 0){\n\t\t\t\t\t\t\t$tmp_user_id = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\t$tmp_to_all_uids = $tmp_to_all_uids . $tmp_user_id . '|';\n\t\t\t\t\t\t\t//found\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$tmp_username_error = $tmp_username_error + 1;\n\t\t\t\t\t\t\t$tmp_error_usernames = $tmp_error_usernames . $tmp_username . ', ';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tmp_error_usernames = trim($tmp_error_usernames, \", \");\n\t\t\t\t//==========================================================//\n\t\t\t\tif ($tmp_username_error > 0){\n\t\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t\t$rows = 12;\n\t\t\t\t\t}\n\t\t\t\t\t$rows = \"rows='$rows'\";\n\t\t\t\t\t?>\n\t\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t\t\t<p><?php _e('The following usernames could not be found in the system', 'messaging') ?> <em><?php echo $tmp_error_usernames; ?></em></p>\n <form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n \tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n \tstyle=\"width: 95%\" tabindex='1' maxlength=\"200\"\n \tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" tabindex='2' maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='3' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form>\n\t\t <?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//everything checked out - send the messages\n\t\t\t\t\t?>\n\t\t\t\t\t<p><?php _e('Sending message(s)...', 'messaging') ?></p>\n <?php\n\t\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t\t$tmp_to_uid = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\tmessaging_insert_message($tmp_to_uid,$tmp_to_all_uids,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']), 'unread', 0);\n\t\t\t\t\t\t\tmessaging_new_message_notification($tmp_to_uid,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmessaging_insert_sent_message($tmp_to_all_uids,$user_ID, sanitize_text_field($_POST['message_subject']),wp_kses_post($_POST['message_content']),0);\n\t\t\t\t\techo \"\n\t\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Reply Sent.') . \"';\n\t\t\t\t\t</script>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"test\":\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t}\n\techo '</div>';\n}", "public function watchAction() {\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$this->view->series = $dbseries->getNotMySeries($this->userid);\n\t}", "public function onRefresh()\n {\n $this->prepareVars();\n return ['#'.$this->getId() => $this->makePartial('list')];\n }", "function refresh($params) {\n $this->data['question'] = $this->helper->question = $this->CI->model('SocialQuestion')->get(intval($params['questionID']))->result;\n $this->data['bestAnswers'] = $this->getBestAnswers($this->CI->model('SocialQuestion')->getBestAnswers($this->data['question'])->result);\n $this->helper->bestAnswerTypes = $this->bestAnswerTypes;\n $content = ($this->data['bestAnswers']) ? $this->render('BestAnswers', array('bestAnswers' => $this->data['bestAnswers'])) : '';\n\n header('Content-Length: ' . strlen($content));\n header('Content-type: text/html');\n echo $content;\n }", "function update_right_now_message()\n {\n }", "function ZopimLiveChatJS($vars) {\n\n $scripts = \"\";\n\n $q = @mysql_query(\"SELECT * FROM tbladdonmodules WHERE module = 'zopimlivechat'\");\n while ($arr = mysql_fetch_array($q)) {\n $settings[$arr['setting']] = $arr['value'];\n }\n\n if (isset($settings['z_user'])) {\n $q2 = @mysql_query(\"SELECT * FROM mod_zopimlivechat WHERE user = '\" . $settings['z_user'] . \"' \");\n $arr2 = mysql_fetch_array($q2);\n $code = $arr2['key'];\n $table = \"mod_zopimlivechat\";\n $fields = \"user,salt,key\";\n $where = array(\"user\" => $settings['z_user']);\n $result = select_query($table, $fields, $where);\n $data = mysql_fetch_array($result);\n\n\n $scripts = \"<!--Start of Zopim Live Chat Script-->\n<script type=\\\"text/javascript\\\">\nwindow.\\$zopim||(function(d,s){var z=\\$zopim=function(c){z._.push(c)},$=z.s=\nd.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.\n_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');\n$.src='//cdn.zopim.com/?\" . $code . \"';z.t=+new Date;$.\ntype='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');\n</script>\n<!--End of Zopim Live Chat Script-->\";\n\n if ($_SESSION['uid']) {\n $userid = $_SESSION['uid'];\n $result = mysql_query(\"SELECT firstname,lastname,email FROM tblclients WHERE id=$userid\");\n $data = mysql_fetch_array($result);\n $firstname = $data[\"firstname\"];\n $lastname = $data[\"lastname\"];\n $email = $data[\"email\"];\n\n $scripts .= \"<script type=\\\"text/javascript\\\">\n \\$zopim(function() {\n \\$zopim.livechat.setName('\" . $firstname . \" \" . $lastname . \"');\n \\$zopim.livechat.setEmail('\" . $email . \"');\n });\n</script>\n\";\n }\n }\n\n\n\n return $scripts;\n}", "public function update_monitor_page() {\n //$plugins = json_encode(get_plugins(), JSON_PRETTY_PRINT);\n $plugins = print_r(get_plugins(), true);\n require_once plugin_dir_path(__FILE__)\n . 'partials/update-monitor-admin-display.php';\n }", "function training_ajax_callback_text() {\n drupal_add_js(drupal_get_path('module', 'training') . '/js/training.js');\n $commands = array();\n $commands[] = array(\n 'command' => 'reload',\n 'some_param' => rand(2, 4),\n );\n print ajax_render($commands);\n exit;\n}", "function livepress_update_box() {\n\tstatic $called = 0;\n\tif($called++) return;\n\tif (LivePress_Updater::instance()->has_livepress_enabled()) {\n\t\techo '<div id=\"lp-update-box\"></div>';\n\t}\n}", "public function updateScheduleSMS()\n {\n return view('client.update-schedule-sms');\n }", "public function Opening_hours_fct()\n\t{\n\t\t$string_warning = '<div id=\"auto_load_warning_div\"></div>';\n\n\t\t?>\n\n\t\t<script>\n\t\t\n\t\tvar $jq = jQuery.noConflict();\n\t\t\n\t\t\tfunction auto_load_warning(){\n\t\t\t\t$jq.ajax({\n\t\t\t\turl: \"/wp-content/plugins/Opening_hours/Opening_hours_warning.php\",\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\t$jq(\"#auto_load_warning_div\").html(data);\n\t\t\t\t} \n\t\t\t\t});\n\t\t\t}\n\t\t\n\t\t\t$jq(document).ready(function(){\n\t\t\n\t\t\t\tauto_load_warning(); //Call auto_load() function when DOM is Ready\n\t\t\n\t\t\t});\n\n\t\t\t //Refresh auto_load() function after 500 milliseconds\n\t\t\t setInterval(auto_load_warning,3000);\n\t\t </script>\n\t\t<?php\n\n\t\treturn $string_warning;\n\t}", "public function refresh ($blnReload = false) {\n $this->mctHut->refresh($blnReload);\n\t}", "public function refreshUpdateAt() {\n // Get session\n $securitySession = $this->getSecuritySession();\n if($securitySession != null) {\n $securitySession[self::SESS_UPDATED_AT] = time();\n $this->setSecuritySessionFromArray($securitySession);\n }\n }", "protected function buildUi() {\n if (empty($this->reloadDiv)) {\n $this->reloadDiv = 'div-' . Yii::$app->uniqueId;\n }\n\n $url = Url::to(['/notify/default/notify-tool']);\n $options = $this->options;\n $options['id'] = $this->reloadDiv;\n $options['data-url'] = $url;\n $view = \\Yii::$app->getView();\n $view->registerJs(\"\n getUiAjax('{$url}', '{$this->reloadDiv}');\n \");\n\n return Html::tag('div', '<div class=\"sdloader\"><i class=\"sdloader-icon\"></i></div>', $options);\n }", "public static function displayUpdate() {\n\n\t\t\tself::display('Main/Status/Update', 'STATUS_TITLE_UPDATE', STATUS_CODE_503);\n\t\t}", "public function render(): void {\r\n $pages = MJKGTAPI::pages();\r\n $wp_cron = get_option('cron');\r\n\r\n $this->render_css();\r\n\r\n printf('<div class=\"wrap\">');\r\n $this->output_intro();\r\n printf('<div id=\"%s\">', self::id_main);\r\n $this->output_sections($pages, $wp_cron);\r\n printf('</div></div>');\r\n }", "public function displaySynced() \n {\n if ($this->is_synced) {\n return '<i style=\"font-size:25px;color:#449D44;\" class=\"fa fa-check\" aria-hidden=\"true\"></i>';\n } else {\n return '<i style=\"font-size:25px;color:#C9302C;\" class=\"fa fa-times\" aria-hidden=\"true\"></i>';\n }\n }", "public function notification_message_time_update()\n {\n echo $this->Home_model->notification_message_time_update_model();\n }", "public function notificationAction(){\n\t\t$this->loadLayout(); \n\t\t$this->renderLayout();\n\t}", "function ajax_message() {\n\t\t$message_path = $this->get_message_path();\n\t\t$query_string = _http_build_query( $_GET, '', ',' );\n\t\t$current_screen = wp_unslash( $_SERVER['REQUEST_URI'] );\n\t\t?>\n\t\t<div class=\"jetpack-jitm-message\"\n\t\t\t data-nonce=\"<?php echo wp_create_nonce( 'wp_rest' ); ?>\"\n\t\t\t data-message-path=\"<?php echo esc_attr( $message_path ); ?>\"\n\t\t\t data-query=\"<?php echo urlencode_deep( $query_string ); ?>\"\n\t\t\t data-redirect=\"<?php echo urlencode_deep( $current_screen ); ?>\"\n\t\t></div>\n\t\t<?php\n\t}", "public function render()\n {\n $queue_size = $this->manager->getQueueSize();\n $worker_statuses = $this->manager->getWorkerStatuses();\n\n $this->clear();\n $this->line('Spider Manager Dashboard. Press Ctrl+C to exit.');\n $this->line('Queue size: ' . $queue_size);\n\n $this->hr();\n foreach ($worker_statuses as $i => $status) {\n $status = $status == WorkerStatus::WORKING ? $this->green($status) : $this->gray($status);\n $this->line('Worker '.sprintf('%04d', $i).': '.$status);\n }\n $this->hr();\n }", "public function index(){\n $_SESSION['time'] = time();//存储当前时间\n $this->display();\n }", "function refresh(){\n\n $this->autoRender = false;\n $array = Configure::read('lm_in');\n\n\t \n\t $obj = new ff_event($array);\t \n\n\t if ($obj -> auth != true) {\n \t die(printf(\"Unable to authenticate\\r\\n\"));\n\t }\n\n\t $message_entries = array();\n\n \t \twhile ($entry = $obj->getNext('delete')){\n\n\t $created = intval(floor($entry['Event-Date-Timestamp']/1000000));\n\t $length = intval(floor(($entry['FF-FinishTimeEpoch']-$entry['FF-StartTimeEpoch'])/1000)); \n\t $mode = $entry['FF-CallerID'];\n\t $value = $entry['FF-CallerName'];\n\n//$this->PhoneDirectory->execute_query(\"select recipient_name from phone_directory where phone_no = '+13154805045'\", \"phone_directory\")\n\n\t $data= array ( 'sender' => $this->sanitizePhoneNumber($entry['FF-CallerID']),\n\t \t \t 'file' => $entry['FF-FileID'],\n\t \t \t 'created' => $created,\n\t\t\t \t\t'length' => $length,\n\t \t\t 'url' => $entry['FF-URI'],\n\t \t\t 'instance_id' => $entry['FF-InstanceID'],\n \t\t\t 'quick_hangup' => $entry['FF-OnQuickHangup'],\n );\n\t $this->log('[INFO] NEW MESSAGE, Sender: '.$entry['FF-CallerID'], 'message');\t\n\t $this->create();\n\t $this->save($data);\n\n\t \t\t//collecting message info - Ping 201603\n\t \t\t$message_entry = array();\n\t \t\t$message_entry['instance_id'] = $entry['FF-InstanceID'];\n\t \t\t$message_entry['sender'] = $this->sanitizePhoneNumber($entry['FF-CallerID']);\n\t \t\t$message_entry['created'] = $created;\n\n\t \t\tarray_push($message_entries, $message_entry);\n\n //Check if CDR with the same call_id exists with length=false\n $this->query(\"UPDATE cdr set length = \".$length.\", quick_hangup = '\".$entry['FF-OnQuickHangup'].\"' where call_id = '\".$entry['FF-FileID'].\"' and channel_state='CS_ROUTING'\");\n\n } \n\n // perform LmMenuRule lookup and triage rule - Ping 201603\n if(count($message_entries) > 0){\n \tforeach($message_entries as $message_entry) {\n\n\t\t $lm_menu_lookup = $this->query(\"SELECT id, title from lm_menus where instance_id = \".$message_entry['instance_id']);\n\t\t \t$lm_menu_id = $lm_menu_lookup[0]['lm_menus']['id'];\n\t\t \t$lm_menu_title = $lm_menu_lookup[0]['lm_menus']['title'];\n\t\t\t \t$lm_menu_rule_lookup = $this->query(\"SELECT lm_menu_type, designated_recipient from lm_menu_rule where lm_menu_id = \".$lm_menu_id);\n\n\t\t\t \tif($lm_menu_rule_lookup[0]['lm_menu_rule']['lm_menu_type'] == 'Priority') {\n\t\t\t \t\t// deliver sms to designaed recipient\n\t\t\t \t\t$designated_recipient = $lm_menu_rule_lookup[0]['lm_menu_rule']['designated_recipient'];\n\t\t\t \t\t\n\t\t\t \t\t$data = array(\n\t\t\t \t\t\t\t\t\t'title' => $lm_menu_title,\n\t\t\t \t\t\t\t\t\t'recipient' => $designated_recipient,\n\t\t\t \t\t\t\t\t\t'sender' => $message_entry['sender'],\n\t\t\t \t\t\t\t\t\t'created' => $message_entry['created'],\n\t\t\t \t\t\t\t\t);\n\n\t\t\t \t\t// bypassing Controller function - not recommended but ¯\\_(ツ)_/¯ \n\t\t\t \t\tApp::import('Controller', 'Batches');\n\t\t $batches = new BatchesController;\n\t\t $batches->addLAMBatch($data); \n\t\t\t \t}\n\n \t}\n } \n\n /* \n //test bed\n \t$lm_menu_lookup = $this->query(\"SELECT id from lm_menus where instance_id = 112\");\n \t$lm_menu_id = $lm_menu_lookup[0]['lm_menus']['id'];\n\t \t$lm_menu_rule_lookup = $this->query(\"SELECT lm_menu_type, designated_recipient from lm_menu_rule where lm_menu_id = \".$lm_menu_id);\n\n\t \tif($lm_menu_rule_lookup[0]['lm_menu_rule']['lm_menu_type'] == 'Priority') {\n\t \t\t$designated_recipient = $lm_menu_rule_lookup[0]['lm_menu_rule']['designated_recipient'];\n\t \t\techo $designated_recipient;\n\t \t}\n\t\t*/\n\n }", "public static function refresh(int $interval): MetaTag {\n return static::httpEquiv('refresh', $interval);\n }", "public function ajaxpingAction()\r\n\t{\r\n\t\t$sid = $this->request->getParam(\"session\");\r\n\t\t$arr['live'] = $this->engine->ping($sid);\r\n $this->request->setParam(\"format\", \"json\");\r\n $this->request->setParam(\"render\", \"false\");\r\n $response = $this->getResponse(); \r\n $response->setContent(json_encode($arr)); \r\n // returned to View\\Listener\r\n return $response;\r\n\t}", "public function run()\n {\n if (!addon_installed('chat')) {\n return new Tempcode();\n }\n\n require_code('chat_stats');\n require_lang('chat');\n\n $bits = new Tempcode();\n\n if (get_option('chat_show_stats_count_users') == '1') {\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '904a46b83a84728243f3fd655705cc04', 'KEY' => do_lang_tempcode('COUNT_CHATTERS'), 'VALUE' => integer_format(get_num_chatters()))));\n }\n if (get_option('chat_show_stats_count_rooms') == '1') {\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'adf12b729fd23b6fa7115758a64155c6', 'KEY' => do_lang_tempcode('CHATROOMS'), 'VALUE' => integer_format(get_num_chatrooms()))));\n }\n if (get_option('chat_show_stats_count_messages') == '1') {\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '0e86e89171ddd8225ac41e14b18ecdb0', 'KEY' => do_lang_tempcode('COUNT_CHATPOSTS'), 'VALUE' => integer_format(get_num_chatposts()))));\n }\n if ($bits->is_empty_shell()) {\n return new Tempcode();\n }\n\n $chat = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '4d688c45e01ed34f257fd03100a6be6d', 'SECTION' => do_lang_tempcode('SECTION_CHAT'), 'CONTENT' => $bits));\n\n return $chat;\n }", "function amwscp_add_xml_refresh_interval()\n{\n $current_delay = get_option('amwscpf_feed_delay');\n return array(\n 'refresh_interval' => array('interval' => $current_delay, 'display' => 'Amazon Feed refresh interval'),\n );\n}", "public function index()\n {\n $groups = $this->Chat->getAllRoom();\n $this->set(['title' => 'Chat Online', 'groups' => $groups]);\n $this->render('index');\n }", "public function refresh(Request $request){\n\t\t$class = '\\App\\\\'.ucwords($request->method);\n\t\t$data = $class::find($request->id);\n\t\treturn response(view('partials.templates.main_'.rtrim($request->method,'s'), [rtrim($request->method,'s') => $data])->render(), 200);\n\t}", "function messaging_show_online_dot() {\n\t\tif ( $this->is_hidden_status( um_user('ID') ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$args['is_online'] = UM()->Online()->is_online( um_user('ID') );\n\n\t\tob_start();\n\n\t\tUM()->get_template( 'online-marker.php', um_online_plugin, $args, true );\n\n\t\tob_end_flush();\n\t}", "public function render() {\n\t\techo '<div id=\"neve-dashboard\"></div>';\n\t}", "public function getUpdateNotification(){\n\t\t//render the view\n\t\treturn $this->renderView('update-notification-partial');\n\t}", "function get_lastload_display($id = 0) {\n global $CFG, $USER;\n\n $format = '%A, %B %e, %l:%M:%S %P';\n\n $element_id = 'refresh_report';\n if(!empty($id)) {\n $element_id .= '_' . $id;\n }\n\n $timezone = 99;\n if(isset($USER->timezone)) {\n $timezone = $USER->timezone;\n }\n $lastload = time();\n $a = userdate($lastload, $format, $timezone);\n\n return '<form id=\"' . $element_id . '\" action=\"' . $CFG->wwwroot . '/blocks/php_report/dynamicreport.php\" ' .\n 'onsubmit=\"start_throbber(); return true;\" >' .\n '<input type=\"hidden\" id=\"id\" name=\"id\" value=\"' . $id . '\" />' .\n '<p align=\"center\" class=\"php_report_caching_info\">' . get_string('infocurrent', 'block_php_report', $a) . '<br/>' .\n '<input id=\"' . $element_id . '\" type=\"submit\" value=\"Refresh\"/>' . '</p>' .\n '</form>';\n }", "public function refreshLifetimeAction()\n {\n return $this->_forward('refreshLifetime', 'report_statistics');\n }", "public function displaynow()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" displaynow ? ?\");\n\t}", "public function wp_ajax_update_widget()\n {\n }", "protected function heartbeat() {\n\t\techo '{\"status\":\"alive\"}'; \n\t}", "function wp_ajax_toggle_auto_updates()\n {\n }", "function render_chat_messages($sql, $chatlength, $show_elipsis=null){\n // Eventually there might be a reason to abstract out get_chats();\n $sql->Query(\"SELECT send_from, message FROM chat ORDER BY id DESC LIMIT $chatlength\");// Pull messages\n $chats = $sql->fetchAll();\n $message_rows = '';\n $messageCount = $sql->QueryItem(\"select count(*) from chat\");\n if (!isset($show_elipsis) && $messageCount>$chatlength){\n\t$show_elipsis = true;\n }\n $res = \"<div class='chatMessages'>\";\n foreach($chats AS $messageData) {\n\t// *** PROBABLY ALSO A SPEED PROBLEM AREA.\n\t$message_rows .= \"[<a href='player.php?player={$messageData['send_from']}'\n\t target='main'>{$messageData['send_from']}</a>]: \".out($messageData['message']).\"<br>\\n\";\n }\n $res .= $message_rows;\n if ($show_elipsis){ // to indicate there are more chats available\n\t$res .= \".<br>.<br>.<br>\";\n }\n $res .= \"</div>\";\n return $res;\n}", "public static function setNotificationBubble()\n {\n $on = self::checkNotificationsOn();\n\n if ($on == \"on\") {\n $con = $GLOBALS[\"con\"];\n $user = $_SESSION[\"staff_id\"];\n $sql = \"SELECT notification_counter from user where staff_id = $user\";\n $result = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($result)) {\n $count = $row['notification_counter'];\n if ($count != 0) {\n return \"<script>document.getElementById(\\\"notify-container\\\");</script>\" . $count;\n } else {\n return \"<script>document.getElementById(\\\"notify-container\\\").style.display = \\\"none\\\";</script>\";\n }\n }\n }\n }", "public function sync() {\n\t\t# First, set the content of the template with a view file\n\t\t\t$this->template->content = View::instance('v_google_sync');\n\n\t\t# Now set the <title> tag\n\t\t\t$this->template->title = \"Google Sync\"; \n\n\t\t\t$email = $this->user->email;\n\n\t\t# Pass data to the view\n\t\t\t$this->template->content->email = $email;\n\n \t\t$q = \"SELECT user_id\n \t\t FROM users\n \t\t WHERE email = '\".$this->user->email.\"'\";\n\t \n\t $user_id = DB::instance(DB_NAME)->select_field($q);\n\t \n\t # Pass data to the view\n\t\t\t$this->template->content->user_id = $user_id;\n\t \t\t\n\t\t# Render the view\n\t\t\techo $this->template;\n\n\t}", "public function refreshSession() {}", "public function render() {\n\t\t\t/**\n\t\t\t * do not render for logged users\n\t\t\t */\n\t\t\t$logged = is_user_logged_in();\n\t\t\tif ( $logged ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t/**\n\t\t\t * check sites options\n\t\t\t */\n\t\t\t$sites = $this->get_value( 'mode', 'sites' );\n\t\t\tif ( 'selected' == $sites ) {\n\t\t\t\t$sites = $this->get_current_sites();\n\t\t\t\tif ( empty( $sites ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$blog_id = get_current_blog_id();\n\t\t\t\tif ( ! in_array( $blog_id, $sites ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * check status\n\t\t\t */\n\t\t\t$status = $this->get_value( 'mode', 'mode' );\n\t\t\tif ( 'off' == $status ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t/**\n\t\t\t * check timer\n\t\t\t */\n\t\t\t$v = $this->get_value( 'timer' );\n\t\t\tif (\n\t\t\t\tisset( $v['use'] )\n\t\t\t\t&& 'on' == $v['use']\n\t\t\t\t&& isset( $v['show'] )\n\t\t\t\t&& 'on' == $v['show']\n\t\t\t\t&& isset( $v['till_date'] )\n\t\t\t\t&& isset( $v['till_date']['alt'] )\n\t\t\t) {\n\t\t\t\t$date = $v['till_date']['alt'].' '.(isset( $v['till_time'] )? $v['till_time']:'00:00');\n\t\t\t\t$distance = strtotime( $date ) - time();\n\t\t\t\tif ( 0 > $distance ) {\n\t\t\t\t\t$value = $this->get_value();\n\t\t\t\t\t$value['mode']['mode'] = 'off';\n\t\t\t\t\t$this->update_value( $value );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * set headers\n\t\t\t */\n\t\t\tif ( 'maintenance' == $status ) {\n\t\t\t\theader( 'HTTP/1.1 503 Service Temporarily Unavailable' );\n\t\t\t\theader( 'Status: 503 Service Temporarily Unavailable' );\n\t\t\t\theader( 'Retry-After: 86400' ); // retry in a day\n\t\t\t\t$maintenance_file = WP_CONTENT_DIR.'/maintenance.php';\n\t\t\t\tif ( ! empty( $enable_maintenance_php ) and file_exists( $maintenance_file ) ) {\n\t\t\t\t\tinclude_once( $maintenance_file );\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prevetn Plugins from caching\n\t\t\t// Disable caching plugins. This should take care of:\n\t\t\t// - W3 Total Cache\n\t\t\t// - WP Super Cache\n\t\t\t// - ZenCache (Previously QuickCache)\n\t\t\tif ( ! defined( 'DONOTCACHEPAGE' ) ) {\n\t\t\t\tdefine( 'DONOTCACHEPAGE', true );\n\t\t\t}\n\t\t\tif ( ! defined( 'DONOTCDN' ) ) {\n\t\t\t\tdefine( 'DONOTCDN', true );\n\t\t\t}\n\t\t\tif ( ! defined( 'DONOTCACHEDB' ) ) {\n\t\t\t\tdefine( 'DONOTCACHEDB', true );\n\t\t\t}\n\t\t\tif ( ! defined( 'DONOTMINIFY' ) ) {\n\t\t\t\tdefine( 'DONOTMINIFY', true );\n\t\t\t}\n\t\t\tif ( ! defined( 'DONOTCACHEOBJECT' ) ) {\n\t\t\t\tdefine( 'DONOTCACHEOBJECT', true );\n\t\t\t}\n\t\t\theader( 'Cache-Control: max-age=0; private' );\n\t\t\t$template = $this->get_default_template();\n\t\t\t$this->set_data();\n\t\t\t$body_classes = array(\n\t\t\t\t'ultimate-branding-maintenance',\n\t\t\t);\n\t\t\t/**\n\t\t\t * Add defaults.\n\t\t\t */\n\t\t\tif ( empty( $this->data['document']['title'] ) && empty( $this->data['document']['content'] ) ) {\n\t\t\t\t$this->data['document']['title'] = __( 'We&rsquo;ll be back soon!', 'ub' );\n\t\t\t\t$this->data['document']['content'] = __( 'Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. We&rsquo;ll be back online shortly!', 'ub' );\n\t\t\t\tif ( 'coming-soon' == $status ) {\n\t\t\t\t\t$this->data['document']['title'] = __( 'Coming Soon', 'ub' );\n\t\t\t\t\t$this->data['document']['content'] = __( 'Stay tuned!', 'ub' );\n\t\t\t\t}\n\t\t\t\t$this->data['document']['content_meta'] = $this->data['document']['content'];\n\t\t\t}\n\t\t\tforeach ( $this->data as $section => $data ) {\n\t\t\t\tforeach ( $data as $name => $value ) {\n\t\t\t\t\tif ( empty( $value ) ) {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! is_string( $value ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$re = sprintf( '/{%s_%s}/', $section, $name );\n\t\t\t\t\t$template = preg_replace( $re, stripcslashes( $value ), $template );\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * javascript\n\t\t\t */\n\t\t\t$head = '';\n\t\t\t$v = $this->get_value( 'timer' );\n\t\t\tif (\n\t\t\t\tisset( $v['use'] )\n\t\t\t\t&& 'on' == $v['use']\n\t\t\t\t&& isset( $v['show'] )\n\t\t\t\t&& 'on' == $v['show']\n\t\t\t\t&& isset( $v['till_date'] )\n\t\t\t\t&& isset( $v['till_date']['alt'] )\n\t\t\t) {\n\t\t\t\t$date = $v['till_date']['alt'].' '.(isset( $v['till_time'] )? $v['till_time']:'00:00');\n\t\t\t\t$distance = strtotime( $date ) - time();\n\t\t\t\t$body_classes[] = 'has-counter';\n\t\t\t\t$head .= '\n<script type=\"text/javascript\">\nvar distance = '.$distance.';\nvar ultimate_branding_counter = setInterval(function() {\n var days = Math.floor( distance / ( 60 * 60 * 24));\n var hours = Math.floor((distance % ( 60 * 60 * 24)) / ( 60 * 60));\n var minutes = Math.floor((distance % ( 60 * 60)) / ( 60));\n var seconds = Math.floor((distance % ( 60)));\n var value = \"\";\n if ( 0 < days ) {\n value += days + \"'._x( 'd', 'day letter of timer', 'ub' ).'\" + \" \";\n }\n if ( 0 < hours ) {\n value += hours + \"'._x( 'h', 'hour letter of timer', 'ub' ).'\" + \" \";\n }\n if ( 0 < minutes ) {\n value += minutes + \"'._x( 'm', 'minute letter of timer', 'ub' ).'\" + \" \";\n }\n if ( 0 < seconds ) {\n value += seconds + \"'._x( 's', 'second letter of timer', 'ub' ).'\";\n }\n if ( \"\" == value ) {\n value = \"'.__( 'We are back now!', 'ub' ).'\";\n }\n document.getElementById(\"counter\").innerHTML = value;\n if (distance < 0) {\n window.location.reload();\n }\n distance--;\n}, 1000);\n</script>';\n\t\t\t}\n\t\t\t/**\n\t\t\t * social_media\n\t\t\t */\n\t\t\t$social_media = '';\n\t\t\t$v = $this->get_value( 'social_media_settings' );\n\t\t\tif ( isset( $v['show'] ) && 'on' === $v['show'] ) {\n\t\t\t\tif ( isset( $v['colors'] ) && 'on' === $v['colors'] ) {\n\t\t\t\t\t$body_classes[] = 'use-color';\n\t\t\t\t}\n\t\t\t\t$target = ( isset( $v['social_media_link_in_new_tab'] ) && 'on' === $v['social_media_link_in_new_tab'] )? ' target=\"_blank\"':'';\n\t\t\t\t$v = $this->get_value( 'social_media' );\n\t\t\t\tif ( ! empty( $v ) ) {\n\t\t\t\t\tforeach ( $v as $key => $url ) {\n\t\t\t\t\t\tif ( empty( $url ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$social_media .= sprintf(\n\t\t\t\t\t\t\t'<li><a href=\"%s\"%s><span class=\"social-logo social-logo-%s\"></span>',\n\t\t\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\t\t\t$target,\n\t\t\t\t\t\t\tesc_attr( $key )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $social_media ) ) {\n\t\t\t\t\t\t$body_classes[] = 'has-social';\n\t\t\t\t\t\t$social_media = '<ul>'.$social_media.'</ul>';\n\t\t\t\t\t\t$head .= sprintf(\n\t\t\t\t\t\t\t'<link rel=\"stylesheet\" id=\"social-logos-css\" href=\"%s\" type=\"text/css\" media=\"all\" />',\n\t\t\t\t\t\t\t$this->make_relative_url( $this->get_social_logos_css_url() )\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$template = preg_replace( '/{social_media}/', $social_media, $template );\n\t\t\t/**\n\t\t\t * head\n\t\t\t */\n\t\t\t$head .= sprintf(\n\t\t\t\t'<link rel=\"stylesheet\" id=\"maintenance\" href=\"%s?version=%s\" type=\"text/css\" media=\"all\" />',\n\t\t\t\t$this->make_relative_url( plugins_url( 'assets/maintenance.css', __FILE__ ) ),\n\t\t\t\t$this->build\n\t\t\t);\n\t\t\t$template = preg_replace( '/{head}/', $head, $template );\n\t\t\t/**\n\t\t\t * css\n\t\t\t */\n\t\t\t$css = '';\n\t\t\t/**\n\t\t\t * page\n\t\t\t */\n\t\t\t$v = $this->get_value( 'document' );\n\t\t\t$css .= '.page{';\n\t\t\tif ( isset( $v['background'] ) ) {\n\t\t\t\t$css .= $this->css_background_color( $v['background'] );\n\t\t\t}\n\t\t\tif ( isset( $v['color'] ) ) {\n\t\t\t\t$css .= $this->css_color( $v['color'] );\n\t\t\t}\n\t\t\tif ( isset( $v['width'] ) ) {\n\t\t\t\t$css .= $this->css_width( $v['width'] );\n\t\t\t}\n\n\t\t\t$css .= '}';\n\n\t\t\t/**\n\t\t\t * Background\n\t\t\t */\n\t\t\t$v = $this->get_value( 'background', 'color' );\n\t\t\tif ( ! empty( $v ) ) {\n\t\t\t\t$css .= sprintf( 'body{%s}', $this->css_background_color( $v ) );\n\t\t\t}\n\t\t\t$v = $this->get_value( 'background', 'image_meta' );\n\t\t\tif ( isset( $v[0] ) ) {\n\t\t\t\t$css .= sprintf('\nhtml {\n background: url(%s) no-repeat center center fixed;\n -webkit-background-size: cover;\n -moz-background-size: cover;\n -o-background-size: cover;\n background-size: cover;\n}\nbody {\n background-color: transparent;\n}', esc_url( $v[0] ) );\n\t\t\t}\n\t\t\t/**\n\t\t\t * Logo\n\t\t\t */\n\t\t\t$logo = '';\n\t\t\t$show = $this->get_value( 'logo', 'show', false );\n\t\t\tif ( 'on' == $show ) {\n\t\t\t\t/**\n\t\t\t\t * Logo position\n\t\t\t\t */\n\t\t\t\t$position = $this->get_value( 'logo', 'position', false );\n\t\t\t\t$margin = '0 auto';\n\t\t\t\tswitch ( $position ) {\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\t$margin = '0 auto 0 0';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\t$margin = '0 0 0 auto';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$image_meta = $this->get_value( 'logo', 'image_meta' );\n\t\t\t\tif ( is_array( $image_meta ) && 4 == count( $image_meta ) ) {\n\t\t\t\t\t$width = $this->get_value( 'logo', 'width' );\n\t\t\t\t\t$height = $image_meta[2] * $width / $image_meta[1];\n\t\t\t\t\t$css .= sprintf('\n#logo {\n background: url(%s) no-repeat center center;\n -webkit-background-size: contain;\n -moz-background-size: contain;\n -o-background-size: contain;\n background-size: contain;\n width: %dpx;\n height: %dpx;\n display: block;\n margin: %s;\n}\n', esc_url( $image_meta[0] ), $width, $height, $margin );\n\t\t\t\t\t$logo = '<div id=\"logo\"></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$template = preg_replace( '/{logo}/', $logo, $template );\n\t\t\t/**\n\t\t\t * replace css\n\t\t\t */\n\t\t\t$template = preg_replace( '/{css}/', $css, $template );\n\t\t\t/**\n\t\t\t * body classes\n\t\t\t */\n\t\t\t$template = preg_replace( '/{body_class}/', implode( ' ', $body_classes ), $template );\n\n\t\t\techo $template;\n\t\t\texit();\n\n\t\t}", "public function render() { ?>\n <!-- Message alert -->\n <div class=\"alert alert-dismissable fade in\" id=\"message-alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <h4 id=\"message-alert-title\"></h4>\n <span id=\"message-alert-body\"></span>\n </div>\n <!-- Message alert end -->\n <?php\n }", "public function getRouteRefresh() {\n\t\treturn \"/refresh_\";\n\t}", "public function RenderContentAjax(): void {\n $this->showContent(TRUE);\n }", "protected function render() {\n $settings = $this->get_settings_for_display();\n\n if ( is_array( $settings['filterpanel'] ) ) {\n $settings['filterpanel'] = $this->rehub_filter_values( $settings['filterpanel'] );\n $settings['filterpanel'] = rawurlencode( json_encode( $settings['filterpanel'] ) );\n }\n // print_r($settings);\n $this->normalize_arrays( $settings );\n $this->render_custom_js();\n echo recent_posts_function( $settings );\n }", "public function refreshTimestamp();", "public function displayScores() {\n SJTTournamentTools::getInstance()->getServer()->broadcastMessage('Please wait while the judges decide on the scores...');\n }", "public function dashboard_widget_control() {\n\t\tif ( !$widget_options = get_option( 'vfb_dashboard_widget_options' ) )\n\t\t\t$widget_options = array();\n\n\t\tif ( !isset( $widget_options['vfb_dashboard_recent_entries'] ) )\n\t\t\t$widget_options['vfb_dashboard_recent_entries'] = array();\n\n\t\tif ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['vfb-widget-recent-entries'] ) ) {\n\t\t\t$number = absint( $_POST['vfb-widget-recent-entries']['items'] );\n\t\t\t$widget_options['vfb_dashboard_recent_entries']['items'] = $number;\n\t\t\tupdate_option( 'vfb_dashboard_widget_options', $widget_options );\n\t\t}\n\n\t\t$number = isset( $widget_options['vfb_dashboard_recent_entries']['items'] ) ? (int) $widget_options['vfb_dashboard_recent_entries']['items'] : '';\n\n\t\techo sprintf(\n\t\t\t'<p>\n\t\t\t<label for=\"comments-number\">%1$s</label>\n\t\t\t<input id=\"comments-number\" name=\"vfb-widget-recent-entries[items]\" type=\"text\" value=\"%2$d\" size=\"3\" />\n\t\t\t</p>',\n\t\t\t__( 'Number of entries to show:', 'visual-form-builder-pro' ),\n\t\t\t$number\n\t\t);\n\t}", "function buildr_messages_script()\n{\n require_lang('buildr');\n require_lang('chat');\n require_css('buildr');\n\n $member_id = get_member();\n $rows = $GLOBALS['SITE_DB']->query_select('w_members', array('location_realm', 'location_x', 'location_y'), array('id' => $member_id), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n list($realm, $x, $y) = array($rows[0]['location_realm'], $rows[0]['location_x'], $rows[0]['location_y']);\n\n $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_messages WHERE location_x=' . strval($x) . ' AND location_y=' . strval($y) . ' AND location_realm=' . strval($realm) . ' AND (destination=' . strval($member_id) . ' OR destination IS NULL OR originator_id=' . strval($member_id) . ') ORDER BY m_datetime DESC');\n $messages = new Tempcode();\n foreach ($rows as $myrow) {\n $message_sender = $GLOBALS['FORUM_DRIVER']->get_username($myrow['originator_id']);\n if (is_null($message_sender)) {\n $message_sender = do_lang('UNKNOWN');\n }\n $messages->attach(do_template('W_MESSAGE_' . (is_null($myrow['destination']) ? 'ALL' : 'TO'), array('MESSAGESENDER' => $message_sender, 'MESSAGE' => comcode_to_tempcode($myrow['m_message'], $myrow['originator_id']), 'DATETIME' => get_timezoned_date($myrow['m_datetime']))));\n }\n\n $tpl = do_template('W_MESSAGES_HTML_WRAP', array('_GUID' => '05b40c794578d3221e2775895ecf8dbb', 'MESSAGES' => $messages));\n $tpl->evaluate_echo();\n}", "function ghactivity_sync_settings_callback() {\n\techo '<p>';\n\tesc_html_e( 'By default, Ghactivity only gathers data about the last 100 issues in your watched repositories, and then automatically logs all future issues. This section will allow you to perform a full synchronization of all the issues, at once.', 'ghactivity' );\n\techo '</p>';\n}", "public function dashboard() {\n\t\t$template = \"dashboard.tpl\";\n\t\t$data['name'] = $_SESSION['first'] . \" \" . $_SESSION['last'];\n\t\t$data['html'] = $this->paint_screen();\n\t\t$this->load_smarty($data,$template);\n\t}", "private function Reload(){\t\t\t\t\r\n\t $this->valueLatestPeriod();\t \r\n\t $this->prepareGridData(); //ADDING TO OUTPUT\t\t\r\n\t}", "function UI($pollsecs=5)\n\t{\n\tglobal $ADODB_LOG_CONN;\n\n $perf_table = adodb_perf::table();\n\t$conn = $this->conn;\n\n\t$app = $conn->host;\n\tif ($conn->host && $conn->database) $app .= ', db=';\n\t$app .= $conn->database;\n\n\tif ($app) $app .= ', ';\n\t$savelog = $this->conn->LogSQL(false);\n\t$info = $conn->ServerInfo();\n\tif (isset($_GET['clearsql'])) {\n\t\t$this->clearsql();\n\t}\n\t$this->conn->LogSQL($savelog);\n\n\t// magic quotes\n\n\tif (isset($_GET['sql']) && get_magic_quotes_gpc()) {\n\t\t$_GET['sql'] = $_GET['sql'] = str_replace(array(\"\\\\'\",'\\\"'),array(\"'\",'\"'),$_GET['sql']);\n\t}\n\n\tif (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;\n\telse $nsql = $_SESSION['ADODB_PERF_SQL'];\n\n\t$app .= $info['description'];\n\n\n\tif (isset($_GET['do'])) $do = $_GET['do'];\n\telse if (isset($_POST['do'])) $do = $_POST['do'];\n\t else if (isset($_GET['sql'])) $do = 'viewsql';\n\t else $do = 'stats';\n\n\tif (isset($_GET['nsql'])) {\n\t\tif ($_GET['nsql'] > 0) $nsql = $_SESSION['ADODB_PERF_SQL'] = (integer) $_GET['nsql'];\n\t}\n\techo \"<title>ADOdb Performance Monitor on $app</title><body bgcolor=white>\";\n\tif ($do == 'viewsql') $form = \"<td><form># SQL:<input type=hidden value=viewsql name=do> <input type=text size=4 name=nsql value=$nsql><input type=submit value=Go></td></form>\";\n\telse $form = \"<td>&nbsp;</td>\";\n\n\t$allowsql = !defined('ADODB_PERF_NO_RUN_SQL');\n\tglobal $ADODB_PERF_MIN;\n\t$app .= \" (Min sql timing \\$ADODB_PERF_MIN=$ADODB_PERF_MIN secs)\";\n\n\tif (empty($_GET['hidem']))\n\techo \"<table border=1 width=100% bgcolor=lightyellow><tr><td colspan=2>\n\t<b><a href=http://adodb.sourceforge.net/?perf=1>ADOdb</a> Performance Monitor</b> <font size=1>for $app</font></tr><tr><td>\n\t<a href=?do=stats><b>Performance Stats</b></a> &nbsp; <a href=?do=viewsql><b>View SQL</b></a>\n\t &nbsp; <a href=?do=tables><b>View Tables</b></a> &nbsp; <a href=?do=poll><b>Poll Stats</b></a>\",\n\t $allowsql ? ' &nbsp; <a href=?do=dosql><b>Run SQL</b></a>' : '',\n\t \"$form\",\n\t \"</tr></table>\";\n\n\n\t \tswitch ($do) {\n\t\tdefault:\n\t\tcase 'stats':\n\t\t\tif (empty($ADODB_LOG_CONN))\n\t\t\t\techo \"<p>&nbsp; <a href=\\\"?do=viewsql&clearsql=1\\\">Clear SQL Log</a><br>\";\n\t\t\techo $this->HealthCheck();\n\t\t\t//$this->conn->debug=1;\n\t\t\techo $this->CheckMemory();\n\t\t\tbreak;\n\t\tcase 'poll':\n\t\t\t$self = htmlspecialchars($_SERVER['PHP_SELF']);\n\t\t\techo \"<iframe width=720 height=80%\n\t\t\t\tsrc=\\\"{$self}?do=poll2&hidem=1\\\"></iframe>\";\n\t\t\tbreak;\n\t\tcase 'poll2':\n\t\t\techo \"<pre>\";\n\t\t\t$this->Poll($pollsecs);\n\t\t\tbreak;\n\n\t\tcase 'dosql':\n\t\t\tif (!$allowsql) break;\n\n\t\t\t$this->DoSQLForm();\n\t\t\tbreak;\n\t\tcase 'viewsql':\n\t\t\tif (empty($_GET['hidem']))\n\t\t\t\techo \"&nbsp; <a href=\\\"?do=viewsql&clearsql=1\\\">Clear SQL Log</a><br>\";\n\t\t\techo($this->SuspiciousSQL($nsql));\n\t\t\techo($this->ExpensiveSQL($nsql));\n\t\t\techo($this->InvalidSQL($nsql));\n\t\t\tbreak;\n\t\tcase 'tables':\n\t\t\techo $this->Tables(); break;\n\t\t}\n\t\tglobal $ADODB_vers;\n\t\techo \"<p><div align=center><font size=1>$ADODB_vers Sponsored by <a href=http://phplens.com/>phpLens</a></font></div>\";\n\t}" ]
[ "0.62965596", "0.60119236", "0.59628624", "0.5957472", "0.5863687", "0.5836182", "0.5836182", "0.58355594", "0.5812319", "0.57540625", "0.5751699", "0.5685934", "0.5652984", "0.560982", "0.56054866", "0.5548973", "0.55390656", "0.55240715", "0.54952013", "0.54640794", "0.5456441", "0.54549474", "0.5448927", "0.54456323", "0.54274094", "0.54057765", "0.53905565", "0.5386628", "0.53644526", "0.536032", "0.5358064", "0.53405464", "0.5338938", "0.5336322", "0.5319714", "0.5302384", "0.52972525", "0.5286076", "0.5258206", "0.5229512", "0.52129185", "0.52109647", "0.52085257", "0.5207449", "0.52052265", "0.5194328", "0.5168378", "0.5140487", "0.51171124", "0.51143634", "0.510139", "0.5096401", "0.5093607", "0.5083709", "0.5073421", "0.50605565", "0.50529784", "0.5046814", "0.50465435", "0.50384367", "0.5031917", "0.50319153", "0.50274783", "0.5012924", "0.50016254", "0.49959674", "0.49944267", "0.4992272", "0.49841025", "0.4977311", "0.4973749", "0.49736157", "0.49664104", "0.49542066", "0.4952912", "0.49469778", "0.49406242", "0.49395174", "0.49385604", "0.4932368", "0.49175608", "0.49149796", "0.4912663", "0.49118343", "0.49116218", "0.491066", "0.4902697", "0.49010444", "0.4899165", "0.4898127", "0.4894741", "0.48946846", "0.48922643", "0.4890554", "0.48842895", "0.48802754", "0.48751935", "0.4874392", "0.48717126", "0.48619565" ]
0.6793729
0
Display the chat input form.
function render_chat_input($target='mini_chat.php', $field_size=20){ return "<form id=\"post_msg\" action=\"$target\" method=\"post\" name=\"post_msg\">\n <input id=\"message\" type=\"text\" size=\"$field_size\" maxlength=\"490\" name=\"message\" class=\"textField\">\n <input id=\"command\" type=\"hidden\" value=\"postnow\" name=\"command\"> <input type=\"submit\" value=\"Send\" class=\"formButton\">\n </form>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderForm()\n\t{\n\t\t$this->beginForm();\n\t\t$this->renderMessageInput();\n\t\techo Html::beginTag('div', array('class' => 'chat-from-actions'));\n\t\t$this->renderSubmit();\n\t\techo Html::endTag('div');\n\t\t$this->endForm();\n\t}", "public function chat()\n {\n $errors = [];\n $formValid = false;\n $params = [\n // dans la vue, les clés deviennent des variables\n 'formValid' => $formValid,\n 'errors' => $errors,\n ];\n\n // Affichage du chat seulement si connecté\n if(!empty($this->getUser())){\n $this->show('chat/chat', $params);\n }\n else{{\n $this->showNotFound(); // sinon page 404\n }}\n\n }", "function showInputForm()\n {\n $user = common_current_user();\n\n $profile = $user->getProfile();\n\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_settings',\n 'action' => $this->selfLink()));\n\n $this->hidden('token', common_session_token());\n\n $this->elementStart('fieldset', array('id' => 'settings_feeds'));\n\n $this->elementStart('ul', 'form_data');\n $this->elementStart('li');\n $this->input('profile',\n // TRANS: Field label for a field that takes an OStatus user address.\n _m('Subscribe to'),\n $this->profile_uri,\n // TRANS: Tooltip for field label \"Subscribe to\".\n _m('OStatus user\\'s address, like [email protected] or http://example.net/nickname.'));\n $this->elementEnd('li');\n $this->elementEnd('ul');\n // TRANS: Button text.\n $this->submit('validate', _m('BUTTON','Continue'));\n\n $this->elementEnd('fieldset');\n\n $this->elementEnd('form');\n }", "public function show( $chat)\n {\n //\n }", "public function showMessage(){\n\t\t\n\n\t\ttry {\n\n\t\t\tif(!empty($_POST)){// si un commentaire est poter\n\t\t\t\tTchatModel::setMessage($_POST[\"message\"],$_POST[\"idUsr\"]);\n\t\t\t}\n\n\t\t\t$data = TchatModel::getMessage();\n\t\t} catch (Exception $e) {\n\t\t\t$data = TchatModel::getMessage();\n\t\t\t$warning = $e->getMessage();\n\t\t}\n\t\trequire_once'ViewFrontend/tchat.php';\n\t}", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "function show_form()\n\t\t{\n\t\t\t//set a global template for interactive activities\n\t\t\t$this->t->set_file('run_activity','run_activity.tpl');\n\t\t\t\n\t\t\t//set the css style files links\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'run_activity_css_link'\t=> $this->get_css_link('run_activity', $this->print_mode),\n\t\t\t\t'run_activity_print_css_link'\t=> $this->get_css_link('run_activity', true),\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t// draw the activity's title zone\n\t\t\t$this->parse_title($this->activity_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_name to the requested one or the stored name\n\t\t\t// the requested one handle the looping in activity form\n\n\t\t\t$wf_name = get_var('wf_name','post',$this->instance->getName());\n\t\t\t$this->parse_instance_name($wf_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_set_owner to the requested one or the stored owner\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$wf_set_owner = get_var('wf_set_owner','post',$this->instance->getOwner());\n\t\t\t$this->parse_instance_owner($wf_set_owner);\n\t\t\t\n\t\t\t// draw the activity central user form\n\t\t\t$this->t->set_var(array('activity_template' => $this->wf_template->parse('output', 'template')));\n\t\t\t\n\t\t\t//draw the select priority box\n\t\t\t// init priority to the requested one or the stored priority\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$priority = get_var('wf_priority','post',$this->instance->getPriority());\n\t\t\t$this->parse_priority($priority);\n\t\t\t\n\t\t\t//draw the select next_user box\n\t\t\t// init next_user to the requested one or the stored one\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$next_user = get_var('wf_next_user','POST',$this->instance->getNextUser());\n\t\t\t$this->parse_next_user($next_user);\n\t\t\t\n\t\t\t//draw print_mode buttons\n\t\t\t$this->parse_print_mode_buttons();\n\t\t\t\n\t\t\t//draw the activity submit buttons\t\n\t\t\t$this->parse_submit();\n\t\t\t\n\t\t\t//draw the info zone\n\t\t\t$this->parse_info_zone();\n\t\t\t\n\t\t\t//draw the history zone if user wanted it\n\t\t\t$this->parse_history_zone();\n\t\t\t\n\t\t\t$this->translate_template('run_activity');\n\t\t\t$this->t->pparse('output', 'run_activity');\n\t\t\t$GLOBALS['egw']->common->egw_footer();\n\t\t}", "public function run()\n\t{\n\t\t\n\t\tlist($name,$id)=$this->resolveNameID();\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\n\t\t$this->registerClientScript($id);\n\t\t$this->htmlOptions[\"class\"]=\"form-control\";\n\t\t\n\t\techo \"<small class=\\\"text-muted\\\"><em>Here a message for user</em></small>\";\n\t\techo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);\n\t\t\n\t}", "public function show(Chat $chat)\n {\n //\n }", "public function displayParticipantsFormAction() {\n $params = t3lib_div::_GET('libconnect');\n //include CSS\n $this->decideIncludeCSS();\n //include js\n $this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"' . t3lib_extMgm::siteRelPath('libconnect') . 'Resources/Public/Js/ezb.js\" ></script>'); \n\n $ParticipantsList = $this->ezbRepository->getParticipantsList($params['jourid']);\n\n $config['partnerPid'] = 0;\n $journal = $this->ezbRepository->loadDetail($params['jourid'], $config);\n $titel = $journal['title'];\n unset($journal);\n\n //variables for template\n $this->view->assign('ParticipantsList', $ParticipantsList);\n $this->view->assign('jourid', $params['jourid']);\n $this->view->assign('titel', $titel);\n }", "function AddChat()\r\n{\r\n if (session_id() == '')\r\n {\r\n session_start();\r\n }\r\n if (isset($_SESSION))\r\n {\r\n if (!empty($_SESSION) && !empty($_SESSION['EMAIL']))\r\n {\r\n echo '<div id=ChatSystem>\r\n <div id=\"messageBox\">\r\n <div id=\"id\" class=\"chat\"></div>\r\n <form id=\"messageBoxForm\" onsubmit=\"event.preventDefault()\">\r\n <textarea onkeydown=\"SubmitFormEnter(event)\" cols=\"40\" rows=\"1\" name=\"chatMessage\" id=\"chat_input\" placeholder=\"Type a message...\" autocomplete=\"off\" autocapitalize=off resize=off></textarea>\r\n <input type=\"submit\" id=\"submitText\"><label title=\"Send message\" id=\"submitMessageLabel\" for=\"submitText\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Layer_1\" viewBox=\"0 0 55 55\" x=\"0px\" y=\"0px\" width=\"55\" height=\"55\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs43\"><linearGradient id=\"linearGradient5980\" xmlns:osb=\"http://www.openswatchbook.org/uri/2009/osb\" osb:paint=\"solid\"><stop id=\"stop5978\" style=\"stop-color: rgb(174, 174, 174); stop-opacity: 1;\" offset=\"0\" /></linearGradient></defs><g id=\"g8\" transform=\"matrix(0.0661397 0 0 0.0661397 1.06883 11.809)\"><g id=\"g6\"><path id=\"path2\" style=\"fill: none; fill-opacity: 0.995536; stroke: #2b2b2b; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 244.8 489.6 c 135 0 244.8 -109.8 244.8 -244.8 C 489.6 109.8 379.8 0 244.8 0 C 109.8 0 0 109.8 0 244.8 c 0 135 109.8 244.8 244.8 244.8 Z m 0 -469.8 c 124.1 0 225 100.9 225 225 c 0 124.1 -100.9 225 -225 225 c -124.1 0 -225 -100.9 -225 -225 c 0 -124.1 100.9 -225 225 -225 Z\" /><path id=\"path4\" style=\"fill: #767e88; fill-opacity: 1; stroke: #0063b1; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 24.4788;\" d=\"m 210 326.1 c 1.9 1.9 4.5 2.9 7 2.9 c 2.5 0 5.1 -1 7 -2.9 l 74.3 -74.3 c 1.9 -1.9 2.9 -4.4 2.9 -7 c 0 -2.6 -1 -5.1 -2.9 -7 L 224 163.5 c -3.9 -3.9 -10.1 -3.9 -14 0 c -3.9 3.9 -3.9 10.1 0 14 l 67.3 67.3 l -67.3 67.3 c -3.8 3.9 -3.8 10.2 0 14 Z\" /></g></g><g id=\"g10\" transform=\"translate(0 -434.6)\" /><g id=\"g12\" transform=\"translate(0 -434.6)\" /><g id=\"g14\" transform=\"translate(0 -434.6)\" /><g id=\"g16\" transform=\"translate(0 -434.6)\" /><g id=\"g18\" transform=\"translate(0 -434.6)\" /><g id=\"g20\" transform=\"translate(0 -434.6)\" /><g id=\"g22\" transform=\"translate(0 -434.6)\" /><g id=\"g24\" transform=\"translate(0 -434.6)\" /><g id=\"g26\" transform=\"translate(0 -434.6)\" /><g id=\"g28\" transform=\"translate(0 -434.6)\" /><g id=\"g30\" transform=\"translate(0 -434.6)\" /><g id=\"g32\" transform=\"translate(0 -434.6)\" /><g id=\"g34\" transform=\"translate(0 -434.6)\" /><g id=\"g36\" transform=\"translate(0 -434.6)\" /><g id=\"g38\" transform=\"translate(0 -434.6)\" /></svg></label></form>\r\n </div>\r\n <div id=\"contactsPart\">\r\n <input type=\"checkbox\" id=\"hideContacts\"><label id=\"contactsButton\" for=\"hideContacts\"><svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Capa_1\" viewBox=\"0 0 48 48\" x=\"0px\" y=\"0px\" width=\"48\" height=\"48\" version=\"1.1\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xml:space=\"preserve\"><defs id=\"defs37\"></defs><path id=\"path2\" style=\"stroke: #000000; stroke-dasharray: none; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 0.4;\" d=\"M 32.3384 29.1299 L 29.1539 27.5378 C 28.8536 27.3875 28.6669 27.0855 28.6669 26.7495 v -1.12706 c 0.07634 -0.09334 0.156675 -0.199676 0.239679 -0.317015 c 0.41302 -0.583363 0.744037 -1.23273 0.984716 -1.9331 C 30.3617 23.1566 30.667 22.6916 30.667 22.1666 v -1.3334 c 0 -0.321016 -0.120006 -0.632032 -0.33335 -0.875044 v -1.77309 c 0.01867 -0.183343 0.09201 -1.27473 -0.697368 -2.17511 c -0.684701 -0.781039 -1.79576 -1.17706 -3.30283 -1.17706 c -1.50707 0 -2.61813 0.39602 -3.30283 1.17673 c -0.478357 0.545694 -0.639365 1.16039 -0.688034 1.60175 c -0.571362 -0.295348 -1.24473 -0.445022 -2.00943 -0.445022 c -3.46317 0 -3.66485 2.95181 -3.66685 3.00015 v 1.52641 c -0.216011 0.235345 -0.33335 0.507025 -0.33335 0.776705 v 1.15139 c 0 0.359685 0.161008 0.695035 0.437022 0.921713 c 0.275014 1.03672 0.951381 1.82009 1.21473 2.0951 v 0.914379 c 0 0.262346 -0.142674 0.503025 -0.390353 0.638365 l -2.21778 1.39107 C 14.5272 30.045 13.9995 30.934 13.9995 31.9014 v 1.26573 h 4.6669 h 0.6667 h 14.6674 v -1.34773 c 0 -1.14606 -0.637032 -2.17678 -1.66208 -2.68947 Z M 18.6664 31.7544 v 0.746037 h -4.0002 v -0.59903 c 0 -0.723369 0.394686 -1.38807 1.04705 -1.74442 l 2.21744 -1.39107 c 0.444355 -0.242346 0.720369 -0.707035 0.720369 -1.21373 v -1.19706 l -0.106005 -0.099 c -0.0087 -0.008 -0.894378 -0.844709 -1.15606 -1.9851 l -0.03034 -0.132012 l -0.114006 -0.07334 c -0.153341 -0.09934 -0.245012 -0.26568 -0.245012 -0.444689 v -1.15139 c 0 -0.120006 0.08167 -0.26268 0.223678 -0.391353 l 0.109672 -0.09901 l -0.000667 -1.79342 c 0.006 -0.09567 0.179676 -2.35278 3.00082 -2.35278 c 0.797707 0 1.46941 0.184343 2.0001 0.548027 v 1.57708 c -0.213344 0.243012 -0.33335 0.554028 -0.33335 0.875044 v 1.3334 c 0 0.101338 0.01167 0.20101 0.03367 0.297682 c 0.009 0.03867 0.027 0.074 0.03933 0.111338 c 0.01833 0.056 0.033 0.113673 0.05867 0.166675 c 0.000333 0.000667 0.000667 0.001 0.001 0.0017 c 0.08534 0.176009 0.209677 0.33335 0.366352 0.459023 c 0.0017 0.0063 0.0037 0.012 0.0053 0.018 c 0.02 0.07634 0.041 0.152341 0.06367 0.226678 l 0.027 0.087 c 0.0047 0.01533 0.01033 0.031 0.01533 0.04634 c 0.01167 0.036 0.023 0.07167 0.035 0.107005 c 0.02 0.05834 0.041 0.118673 0.06534 0.184343 c 0.01033 0.02734 0.02167 0.052 0.03233 0.079 c 0.02734 0.06967 0.05467 0.137007 0.08334 0.203677 c 0.007 0.016 0.013 0.03334 0.02 0.049 l 0.01867 0.042 c 0.0087 0.01933 0.01767 0.03667 0.02633 0.05567 c 0.03267 0.07134 0.06467 0.14034 0.09801 0.20701 c 0.0053 0.01067 0.01033 0.02234 0.01567 0.033 c 0.021 0.04167 0.042 0.081 0.063 0.121006 c 0.036 0.06867 0.07134 0.13334 0.106672 0.19601 c 0.01733 0.03067 0.03433 0.06067 0.05134 0.08967 c 0.048 0.082 0.09367 0.157341 0.138007 0.227344 c 0.0097 0.015 0.019 0.03067 0.02834 0.045 c 0.08067 0.125006 0.150674 0.226344 0.208677 0.305348 c 0.01533 0.021 0.02867 0.039 0.04167 0.05667 c 0.0073 0.0097 0.01733 0.02367 0.02367 0.03233 v 1.10306 c 0 0.322683 -0.176009 0.618697 -0.459023 0.773372 l -0.882044 0.481024 l -0.153675 -0.01367 l -0.06267 0.131673 l -1.87543 1.02305 c -0.966712 0.528016 -1.56708 1.5394 -1.56708 2.64079 Z m 14.6674 0.746037 H 19.3331 v -0.746037 c 0 -0.857043 0.467357 -1.64475 1.21973 -2.05477 l 2.97381 -1.62208 c 0.497692 -0.27168 0.806707 -0.792706 0.806707 -1.35907 v -1.3394 v -0.000333 l -0.06467 -0.07734 l -0.01267 -0.015 c -0.000667 -0.001 -0.02134 -0.026 -0.055 -0.07 c -0.002 -0.0027 -0.004 -0.0053 -0.0063 -0.008 c -0.01767 -0.023 -0.03834 -0.05067 -0.062 -0.08367 c -0.000333 -0.000667 -0.000666 -0.001 -0.001 -0.0017 c -0.04967 -0.069 -0.112005 -0.158674 -0.181342 -0.26668 c -0.0017 -0.0023 -0.003 -0.005 -0.0047 -0.0073 c -0.03267 -0.051 -0.06734 -0.106672 -0.102672 -0.165675 c -0.0027 -0.0043 -0.0053 -0.0087 -0.008 -0.01333 c -0.07537 -0.126347 -0.155375 -0.269354 -0.235046 -0.427696 c 0 0 -0.000333 -0.000333 -0.000333 -0.000666 c -0.04234 -0.08501 -0.08467 -0.174342 -0.126007 -0.267347 v 0 c -0.0057 -0.013 -0.01167 -0.02567 -0.01733 -0.03867 v 0 c -0.01833 -0.04167 -0.03667 -0.08534 -0.05534 -0.130339 c -0.0067 -0.01633 -0.01333 -0.03334 -0.02 -0.05 c -0.01733 -0.04367 -0.035 -0.08767 -0.05367 -0.138007 c -0.034 -0.09067 -0.066 -0.185342 -0.09667 -0.283014 l -0.01833 -0.05934 c -0.002 -0.0067 -0.0043 -0.01333 -0.0063 -0.02033 c -0.03134 -0.105338 -0.06134 -0.21301 -0.08667 -0.323682 L 23.089 22.7989 L 22.9753 22.7256 C 22.7819 22.6009 22.6666 22.3919 22.6666 22.1666 v -1.3334 c 0 -0.187009 0.07934 -0.361351 0.223344 -0.491691 l 0.110006 -0.09901 V 18.1664 V 18.0484 l -0.009 -0.007 c -0.01133 -0.240679 0.003 -0.978383 0.541027 -1.59208 c 0.552361 -0.630365 1.49507 -0.949714 2.80147 -0.949714 c 1.30173 0 2.24244 0.317016 2.79547 0.942714 c 0.649033 0.733703 0.541694 1.67242 0.541027 1.68042 l -0.003 2.11977 l 0.110006 0.09934 c 0.144007 0.130007 0.223344 0.304349 0.223344 0.491358 v 1.3334 c 0 0.291015 -0.190676 0.545694 -0.474024 0.633032 l -0.166008 0.051 l -0.05334 0.165008 c -0.223011 0.693702 -0.540694 1.3344 -0.944714 1.90443 c -0.09901 0.14034 -0.195343 0.26468 -0.279014 0.359685 l -0.083 0.09467 v 1.37507 c 0 0.590029 0.327683 1.12039 0.855376 1.3844 l 3.18449 1.59208 c 0.79804 0.39902 1.29373 1.20106 1.29373 2.09344 Z\" /><g id=\"g4\" transform=\"translate(0 -12)\" /><g id=\"g6\" transform=\"translate(0 -12)\" /><g id=\"g8\" transform=\"translate(0 -12)\" /><g id=\"g10\" transform=\"translate(0 -12)\" /><g id=\"g12\" transform=\"translate(0 -12)\" /><g id=\"g14\" transform=\"translate(0 -12)\" /><g id=\"g16\" transform=\"translate(0 -12)\" /><g id=\"g18\" transform=\"translate(0 -12)\" /><g id=\"g20\" transform=\"translate(0 -12)\" /><g id=\"g22\" transform=\"translate(0 -12)\" /><g id=\"g24\" transform=\"translate(0 -12)\" /><g id=\"g26\" transform=\"translate(0 -12)\" /><g id=\"g28\" transform=\"translate(0 -12)\" /><g id=\"g30\" transform=\"translate(0 -12)\" /><g id=\"g32\" transform=\"translate(0 -12)\" /></svg></label>\r\n <div id=\"contacts_bar\">';\r\n echo '</div></div></div>';\r\n }\r\n }\r\n}", "public function show()\n {\n return view('chat.show');\n }", "public static function chatbot()\n {\n // no code needed.\n }", "function showInputFields(){\n \t$HTML = '';\n\n \t//name field\n\t\t\tif ($this->shownamefield) {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"text\" size=\"'. $this->fieldsize.'\" value=\"'. addslashes(_JNEWS_NAME).'\" class=\"inputbox\" name=\"name\" onblur=\"if(this.value==\\'\\') this.value=\\''. addslashes(_JNEWS_NAME).'\\';\" onfocus=\"if(this.value==\\''. addslashes(_JNEWS_NAME).'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t} else {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"hidden\" value=\"\" name=\"name\" />';\n\t\t\t}\n\n\t\t //email field\n\t\t $text = '<input id=\"wz_12\" type=\"email\" size=\"' .$this->fieldsize .'\" value=\"\" class=\"inputbox\" name=\"email\" placeholder=\"'.addslashes(_JNEWS_YOUR_EMAIL_ADDRESS).'\"/>';\n\t\t //onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes(_JNEWS_EMAIL) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes(_JNEWS_EMAIL) .'\\') this.value=\\'\\' ; \" \n\t\t $HTML .= jnews::printLine($this->linear, $text);\n\n\t\t\t//for field columns\n\t\t\tif($GLOBALS[JNEWS.'level'] > 2){//check if the version of jnews is pro\n\n\t\t\t\tif ($this->column1){//show column1 in the subscribers module\n\t\t\t\t\t$text = '<input id=\"wz_13\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\" class=\"inputbox\" name=\"column1\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t\t}\n\n\t\t\t if ($this->column2){//show column2 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_14\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\" class=\"inputbox\" name=\"column2\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column3){//show column3 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_15\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\" class=\"inputbox\" name=\"column3\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column4){//show column4 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_16\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\" class=\"inputbox\" name=\"column4\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t if ($this->column5){//show column5 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_17\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\" class=\"inputbox\" name=\"column5\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t}\n\n\t\t\treturn $HTML;\n }", "function liveitchina_user_connectivity_form($requestee, $relationship){\n $recipients = array($requestee);\n module_load_include('pages.inc','privatemsg');\n \n $form = drupal_get_form('privatemsg_new',$recipients,'');\n \n $form['recipient']['#input'] = false;\n $form['recipient']['#prefix'] = '<div class = \"block-remove-recipient\" style=\"display:none\">';\n $form['recipient']['#suffix'] = '</div>';\n\n $form['reply']['#markup'] = '<div class = \"block-title-highlight\"><div> <h7>Here you will find the greatest tools for mutual learning with your Tutor / Exchange Partner.</h7></div><div><h7> Stay Tuned!</h7></div></div>';\n $form['reply']['#weight'] = '-100';\n \n drupal_set_title('My Tutor/Exchange Partner');\n //print_r($form);\n return $form;\n}", "private function displayForm()\n {\n // Preparation des paramètres du mail.\n $data['headerTitle'] = 'Contact';\n $data['headerDescription'] = 'Page de contact';\n $data['title'] = 'Contact';\n\n // Affichage du formulaire.\n $this->load->view('templates/header', $data);\n $this->load->view('templates/alert', $data);\n $this->load->view('contact/index', $data);\n $this->load->view('templates/footer', $data);\n }", "public function contact_form()\n\t{\n\t\tif ($this->errstr)\n\t\t{\n\t\t\tFsb::$tpl->set_switch('error');\n\t\t}\n\n\t\tFsb::$tpl->set_file('user/user_contact.html');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'ERRSTR' =>\t\t\tHtml::make_errstr($this->errstr),\n\t\t));\n\t\t\n\t\t// Champs contacts crees par l'administrateur\n\t\tProfil_fields_forum::form(PROFIL_FIELDS_CONTACT, 'contact', Fsb::$session->id());\n\t}", "function content() {\n echo \"\n <form action='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/add' method='post'>\n <input name='token' type='hidden' value='{$this->params['token']}'>\n <label for='username'>Name</label>\n <input name='name' placeholder='Name' id='name' type='text' required>\n <label for='description'>Description</label>\n <input name='description' placeholder='Description (Optional)' id='description' type='text'>\n <input type='submit' value='Create List'>\n </form>\n \";\n }", "public function communication()\n\t\t{\n\t\t\t $this->addElement('textarea','c_massage',array(\n\t\t\t\t\t 'class' => 'form-control required user_text userChatMsgInput' ,\n\t\t\t\t\t \"required\"=>true,\n\t\t\t\t\t \"rows\"=>3, \n\t\t\t\t\t \"label\"=>\"Write Message...\",\n\t\t\t\t\t \"placeholder\"=>\"Enter your Message.....\",\n\t\t\t\t\t \"filter\"=> array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\t\t\"validators\"=> array(\n\t\t\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Enter comment \"))\n\t\t\t\t\t\t\t\t),\t\t\n\t\t\t ));\n\t\t// save btn\n\t\t\t\t$this->addElement('button', 'savebtn', array (\n\t\t\t\t\t'class' => 'btn-lg blue site_button ',\n\t\t\t\t\t'ignore'=>true,\n\t\t\t\t\t'type'=>'button',\n\t\t\t\t\t'label'=>'Send',\n\t\t\t\t\t'escape'=>false\n\t\t\t));\n\t\t\t\t\t$this->savebtn->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' =>'form-actions text-right'))\t));\n\t\t\t\n\t\t//cancel btn\n\t\t\t\t $this->addElement('button','cancelbtn',array(\n\t\t\t\t\t\t 'class'=> 'btn sign_inn login_btnn',\n\t\t\t\t\t\t 'type' => 'reset',\n\t\t\t\t\t\t 'ignore'=>true,\n\t\t\t\t\t\t 'label'=>'Cancel',\n\t\t\t\t\t\t 'escape'=>false\n\t\t\t\t ));\n\t\t\t\t\t $this->cancelbtn->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-actions'))\t));\t\t \n\t\t}", "public function getChat()\n {\n return view('chat');\n }", "protected function form()\n {\n return Admin::form(Message::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->switch('state');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "function MessagingForm(){\n $messaging = new \\Project\\Models\\ContactFormManager();\n $allMessaging = $messaging->contactMessaging();\n\n require 'app/views/back/contactForm.php';\n }", "public function chat_exec()\r\n {\r\n if(isset($_POST['method']) === true && empty($_POST['method']) === false){\r\n $method = trim($_POST['method']);\r\n if($method === 'fetch'){\r\n $messages = $this->Ajax->fetchMessages();\r\n if(empty($messages) === true){\r\n echo 'There are currently no messages in the chat';\r\n } else {\r\n foreach ($messages as $message){?>\r\n <div class=\"message\"><?php\r\n if(strlen($message['user_id']) === 10){?>\r\n <a href=\"#\"><?=Sessions::get('user')?></a> says:<?php\r\n }else{ ?>\r\n <a href=\"#\"><?=$message['username']?></a> says:<?php\r\n }?>\r\n <p><?=nl2br($message['message'])?></p>\r\n </div><?php \r\n }\r\n }\r\n }else if($method === 'throw' && isset($_POST['message']) === true){\r\n $message = trim($_POST['message']);\r\n if(empty($message) === false){\r\n $arrData = array('user' => $_SESSION['user_id'], 'message' => $message);\r\n $this->Ajax->throwMessage($arrData);\r\n }\r\n }\r\n }\r\n }", "function show()\n {\n $messages = $this->Session->read( 'messages' );\n $html = '';\n \n // Add a div for each message using the type as the class\n foreach ($messages as $type => $msgs)\n {\n foreach ($msgs as $msg)\n {\n if (!empty($msg)) {\n $html .= \"<div class='$type'><p>$msg</p></div>\";\n } \n }\n }\n $html .= \"</div>\";\n \n // Clear the messages array from the session\n $this->Session->del( 'messages' );\n \n return $this->output( $html );\n }", "protected function form()\n {\n $form = new Form(new WechatMessage);\n\n $form->select('msg_type', '消息类型')\n ->options(WechatMessageController::getType())\n ->addElementClass('msg_type');\n $form->text('media_id', '素材id')\n ->addElementClass('media_id');\n $form->text('title', '标题')->required();\n $form->textarea('description', '描述/内容');\n $form->hasMany('news_item', '图文', function (Form\\NestedForm $form) {\n $form->text('title', '标题');\n $form->textarea('description', '描述');\n $form->file('image', '图片')->uniqueName();\n $form->text('url', '跳转URL');\n });\n //$form->textarea('news_item', 'News item');\n\n $form->saving(function (Form $form) {\n $newsItem = $form->news_item;\n if (is_array($newsItem)) {\n foreach ($newsItem as &$v) {\n if (empty($v['id'])) {\n unset($v['id']);\n }\n }\n $form->input('news_item', $newsItem);\n }\n });\n\n $this->showMediaJs();\n return $form;\n }", "function chatform(){\r\necho'\r\n<div id=\"wrapper\">\r\n<div id=\"menu\">\r\n<p class=\"welcome\">Welcome, <b>'; echo $_SESSION[\"name\"]; echo'</b></p>\r\n<p class=\"logout\"><a id=\"exit\" href=\"#\">Exit Chat</a></p>\r\n<div style=\"clear:both\"></div>\r\n</div>\r\n\r\n<div id=\"chatbox\"></div>\r\n';\r\n\r\n//checking whether a pair of friends are chatting\r\nif((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend2']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend2.html\") && filesize(\"friend1_friend2.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend2.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend2.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend3.html\") && filesize(\"friend1_friend3.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend3.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend3.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend4']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_friend4.html\") && filesize(\"friend1_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend1_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_friend3.html\") && filesize(\"friend2_friend3.html\") > 0){\r\n $handle1 = fopen(\"friend2_friend3.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_friend3.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend4']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_friend4.html\") && filesize(\"friend2_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend2_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend3']) && $_SESSION['name'] == 'Friend4'))\r\n{\r\nif(file_exists(\"friend3_friend4.html\") && filesize(\"friend3_friend4.html\") > 0){\r\n $handle1 = fopen(\"friend3_friend4.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend3_friend4.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1'))\r\n{\r\nif(file_exists(\"friend1_Subhadra.html\") && filesize(\"friend1_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend1_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend1_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2'))\r\n{\r\nif(file_exists(\"friend2_Subhadra.html\") && filesize(\"friend2_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend2_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend2_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3'))\r\n{\r\nif(file_exists(\"friend3_Subhadra.html\") && filesize(\"friend3_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend3_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend3_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\nelse if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4'))\r\n{\r\nif(file_exists(\"friend4_Subhadra.html\") && filesize(\"friend4_Subhadra.html\") > 0){\r\n $handle1 = fopen(\"friend4_Subhadra.html\", \"r\");\r\n $contents1 = fread($handle1, filesize(\"friend4_Subhadra.html\"));\r\n fclose($handle1);\r\n echo $contents1;\r\n}\r\n}\r\n\r\necho '\r\n<form name=\"message\" action=\"\">\r\n<input name=\"usermsg\" type=\"text\" id=\"usermsg\" size=\"63\" />\r\n<input name=\"submitmsg\" type=\"submit\" id=\"submitmsg\" value=\"Send\" />\r\n</form>\r\n</div>\r\n\r\n<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js\">\r\n</script>\r\n\r\n<script type=\"text/javascript\">\r\n\r\n$(document).ready(function(){\r\n \r\n $(\"#exit\").click(function(){';\r\n //when exit chat button is clicked\r\n if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend2'))|| (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend2=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend3'))|| (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend3=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Friend3'))|| (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_friend3=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_3']) && ($_SESSION['name'] == 'Friend4'))|| (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend3_friend4=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_1']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend1_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_2']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend2_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_3']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend3_Subhadra=true\";}'; }\r\n\t \r\n\t if((isset($_GET['friend_4']) && ($_SESSION['name'] == 'Subhadra'))|| (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4')) {\r\n\t echo'\r\n var exit = confirm(\"Are you sure you want to end the session?\");\r\n if(exit==true){window.location = \"index.php?logout_friend4_Subhadra=true\";}'; }\r\n\t echo '\r\n });\r\n\r\n\r\n $(\"#submitmsg\").click(function(){\r\n var clientmsg = $(\"#usermsg\").val();';\r\n\t //passing values to post.php\r\n\t if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend2\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend3\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_friend3\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend3_friend4\";';\r\n\t }\r\n\t else if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend1_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend2_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend3_Subhadra\";';\r\n\t }\r\n\t else if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4')) {\r\n\t echo'\r\n\t var clientmsg2 = \"friend4_Subhadra\";';\r\n\t }\t \r\n\t echo'\r\n $.post(\"post.php\", {text: clientmsg, text2: clientmsg2});\r\n $(\"#usermsg\").attr(\"value\", \"\");\r\n return false;\r\n });\r\n \r\n setInterval (loadLog, 1000); \r\n\r\nfunction loadLog(){\r\n var oldscrollHeight = $(\"#chatbox\").attr(\"scrollHeight\") - 20;\r\n\r\n\t\r\n $.ajax({ url:'; \r\n\tif((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend2') || (isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend2.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend3.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend3') || (isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_friend3.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Friend4') || (isset($_GET['friend_4']) && $_SESSION['name'] == 'Friend3')) \r\n\t{ echo '\"friend3_friend4.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_1']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend1'))\r\n\t{ echo '\"friend1_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_2']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend2'))\r\n\t{ echo '\"friend2_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_3']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend3')) \r\n\t{ echo '\"friend3_Subhadra.html\",';\r\n\t}\r\n\telse if((isset($_GET['friend_4']) && $_SESSION['name'] == 'Subhadra') || (isset($_GET['user_click']) && $_SESSION['name'] == 'Friend4'))\r\n\t{ echo '\"friend4_Subhadra.html\",';\r\n\t}\r\n\r\n\techo'\r\n cache: false,\r\n success: function(html){\r\n $(\"#chatbox\").html(html);\r\n var newscrollHeight = $(\"#chatbox\").attr(\"scrollHeight\") - 20;\r\n if(newscrollHeight > oldscrollHeight){\r\n $(\"#chatbox\").animate({ scrollTop: newscrollHeight }, \"normal\"); \r\n }\r\n },\r\n });\r\n}\r\n});\r\n</script>\r\n';\r\n}", "protected function OnInput()\n\t{\n\t\t\n\t\t$this->title = 'Beefreelancer.com';\n\t\t$this->content = '';\n\t\t\n\t\t//Menager\n\t\t$mUsers = M_Users::Instance();\n\n\t\t// Curatirea sesiunelor vechi\n\t\t$mUsers->clearSessions();\n\n\t\t// Utilizatorul curent.\n\t\t$this->user = $mUsers->getUserById();\n\n\t\tif($this -> needLogin)\n\t\t{ \n\t\t\t\n\t\t\tif($this->user == null)\n\t\t\t{\n\t\t\t\theader(\"Location: index.php\");\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\tif ($this->IsPost())\n\t\t{\n\t\t\tif (isset($_POST['login']))\n\t\t\t{\n\t\t\t\tif($this->issetAndNotEmpty(trim($_POST['email'])) and\n\t\t\t\t\t\t$this->issetAndNotEmpty(trim($_POST['password'])))\n\t\t\t\t{\n\t\t\t\t\tif ($mUsers->login(trim($_POST['email']),\n\t\t\t\t\t\t\ttrim($_POST['password']),\n\t\t\t\t\t\t\tisset($_POST['remember'])))\n\t\t\t\t\t{\n\t\t\t\t\t\theader('Location:' . $_SERVER['REQUEST_URI']);\n\t\t\t\t\t\tdie();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($_POST['logout']))\n\t\t\t{\n\t\t\t\t$mUsers->logout();\n\t\t\t\theader('Location: index.php');\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\t$this->categories= $mUsers->getCategories();\n\n\t}", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'no_void' => '正常',\n 'void' => '作废',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('status')->value('void');\n\n $this->radio('status', '是否作废')->options($check_status)->default('void');\n $this->textarea('reason', '作废原因');\n }", "public function index()\n \t{\n \t\t// load the header\n \t\t$this->displayHeader();\n\n \t\t// load the view\n \t\t$this->displayView(\"chat/index.php\");\n\n \t\t// load the footer\n \t\t$this->displayFooter();\n \t}", "public function renderMessageInput(array $options = array())\n\t{\n\t\t$defaultOptions = array(\n\t\t\t'rows' => 4,\n\t\t);\n\t\t$options = array_merge($defaultOptions, $options);\n\t\techo $this->_form->field($this->getMessageModel(), 'content')->textArea($options);\n\t}", "public function index()\n {\n return view('chat.chat');\n }", "public function index()\n {\n return view('chat.chat');\n }", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "protected function formCreate() {\n\t\t\t// Define the Simple Message Dialog Box\n\t\t\t$this->dlgSimpleMessage = new \\QCubed\\Project\\Jqui\\Dialog($this);\n\t\t\t$this->dlgSimpleMessage->Title = \"Hello World!\";\n\t\t\t$this->dlgSimpleMessage->Text = '<p><em>Hello, world!</em></p><p>This is a standard, no-frills dialog box.</p><p>Notice how the contents of the dialog '.\n\t\t\t\t'box can scroll, and notice how everything else in the application is grayed out.</p><p>Because we set <strong>MatteClickable</strong> to <strong>true</strong> ' .\n\t\t\t\t'(by default), you can click anywhere outside of this dialog box to \"close\" it.</p><p>Additional text here is just to help show the scrolling ' .\n\t\t\t\t'capability built-in to the panel/dialog box via the \"Overflow\" property of the control.</p>';\n\t\t\t$this->dlgSimpleMessage->AutoOpen = false;\n\n\t\t\t// Make sure this Dialog Box is \"hidden\"\n\t\t\t// Like any other \\QCubed\\Control\\Panel or QControl, this can be toggled using the \"Display\" or the \"Visible\" property\n\t\t\t$this->dlgSimpleMessage->Display = false;\n\n\t\t\t// The First \"Display Simple Message\" button will utilize an AJAX call to Show the Dialog Box\n\t\t\t$this->btnDisplaySimpleMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplaySimpleMessage->Text = t('Display Simple Message \\QCubed\\Project\\Jqui\\Dialog');\n\t\t\t$this->btnDisplaySimpleMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnDisplaySimpleMessage_Click'));\n\n\t\t\t// The Second \"Display Simple Message\" button will utilize Client Side-only JavaScripts to Show the Dialog Box\n\t\t\t// (No postback/postajax is used)\n\t\t\t$this->btnDisplaySimpleMessageJsOnly = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplaySimpleMessageJsOnly->Text = 'Display Simple Message \\QCubed\\Project\\Jqui\\Dialog (ClientSide Only)';\n\t\t\t$this->btnDisplaySimpleMessageJsOnly->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\ShowDialog($this->dlgSimpleMessage));\n\n\t\t\t$this->pnlAnswer = new \\QCubed\\Control\\Panel($this);\n\t\t\t$this->pnlAnswer->Text = 'Hmmm';\n\t\t\t\n\t\t\t$this->btnDisplayYesNo = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplayYesNo->Text = t('Do you love me?');\n\t\t\t$this->btnDisplayYesNo->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('showYesNoClick'));\n\t\t\t\n\t\t\t\n\t\t\t// Define the CalculatorWidget example. passing in the Method Callback for whenever the Calculator is Closed\n\t\t\t// This is example uses \\QCubed\\Project\\Jqui\\Button's instead of the JQuery UI buttons\n\t\t\t$this->dlgCalculatorWidget = new CalculatorWidget($this);\n\t\t\t$this->dlgCalculatorWidget->setCloseCallback('btnCalculator_Close');\n\t\t\t$this->dlgCalculatorWidget->Title = \"Calculator Widget\";\n\t\t\t$this->dlgCalculatorWidget->AutoOpen = false;\n\t\t\t$this->dlgCalculatorWidget->Resizable = false;\n\t\t\t$this->dlgCalculatorWidget->Modal = false;\n\n\t\t\t// Setup the Value Textbox and Button for this example\n\t\t\t$this->txtValue = new \\QCubed\\Project\\Control\\TextBox($this);\n\n\t\t\t$this->btnCalculator = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnCalculator->Text = 'Show Calculator Widget';\n\t\t\t$this->btnCalculator->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnCalculator_Click'));\n\n\t\t\t// Validate on JQuery UI buttons\n\t\t\t$this->dlgValidation = new \\QCubed\\Project\\Jqui\\Dialog($this);\n\t\t\t$this->dlgValidation->AddButton ('OK', 'ok', true, true); // specify that this button causes validation and is the default button\n\t\t\t$this->dlgValidation->AddButton ('Cancel', 'cancel');\n\n\t\t\t// This next button demonstrates a confirmation button that is styled to the left side of the dialog box.\n\t\t\t// This is a QCubed addition to the jquery ui functionality\n\t\t\t$this->dlgValidation->AddButton ('Confirm', 'confirm', true, false, 'Are you sure?', array('class'=>'ui-button-left'));\n\t\t\t$this->dlgValidation->Width = 400; // Need extra room for buttons\n\n\t\t\t$this->dlgValidation->AddAction (new \\QCubed\\Event\\DialogButton(), new \\QCubed\\Action\\Ajax('dlgValidate_Click'));\n\t\t\t$this->dlgValidation->Title = 'Enter a number';\n\n\t\t\t// Set up a field to be auto rendered, so no template is needed\n\t\t\t$this->dlgValidation->AutoRenderChildren = true;\n\t\t\t$this->txtFloat = new \\QCubed\\Control\\FloatTextBox($this->dlgValidation);\n\t\t\t$this->txtFloat->Placeholder = 'Float only';\n\t\t\t$this->txtFloat->PreferredRenderMethod = 'RenderWithError'; // Tell the panel to use this method when rendering\n\n\t\t\t$this->btnValidation = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnValidation->Text = 'Show Validation Example';\n\t\t\t$this->btnValidation->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\ShowDialog($this->dlgValidation));\n\n\t\t\t/*** Alert examples ***/\n\n\t\t\t$this->btnErrorMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnErrorMessage->Text = 'Show Error';\n\t\t\t$this->btnErrorMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnErrorMessage_Click'));\n\n\t\t\t$this->btnInfoMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnInfoMessage->Text = 'Get Info';\n\t\t\t$this->btnInfoMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnGetInfo_Click'));\n\t\t}", "public function run()\n\t{\n\t\tlist($name,$id)=$this->resolveNameID();\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\n\t\t#$this->registerClientScript($id);\n\t\t#$this->htmlOptions[\"class\"]=\"form-control\";\n\t\t$this->htmlOptions=array_merge($this->htmlOptions,array(\n\t\t\t// 'htmlOptions'=>array('container'=>null),\n\t\t\t'labelOptions'=>array('style'=>'width: 100%;height: 100%;cursor:pointer','class'=>'ptm pbm mbn'),\n\t\t\t'template'=>'<div class=\"col-lg-1\"><a href=\"#\" class=\"thumbnail text-center\" style=\"margin-left: -10px;margin-right: -10px;\">{beginLabel}{labelTitle}<div class=\"text-center\">{input}</div>{endLabel}</a></div>',\n\t\t\t'separator'=>'',\n\t\t));\n\t\t\n\t\t#echo \"<small class=\\\"text-muted\\\"><em>Here a message for user</em></small>\";\n\t\t#echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);\n\t\techo '<div class=\"row\">'.Chtml::activeRadioButtonList($this->model,$this->attribute,\n\t\t $this->listData,$this->htmlOptions).'</div>';\n\t}", "function form($instance) {\n\t\techo '<p>Place on any sidebar to display Twitter feed.</p>';\n\t}", "public function forms()\n\t{\n\t\techo view('sketchpad::help/output/form', ['form' => Sketchpad::$form]);\n\t}", "public function showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "public function feedForm()\n {\n $this -> connector -> write(self::FF);\n }", "function display_form() {\n global $messages;\n if ($messages == null){\n\t $messages = array();\n }\n // Get input value if any\n $name = ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") ? \"\" : $_POST[\"name\"];\n $pass = ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") ? \"\" : $_POST[\"password\"];\n \n if (!array_key_exists(\"name\", $messages)) {\n $messages[\"name\"] = \"\";\n }\n else {\n $messages[\"name\"] = \"<span style='color: red;'>$messages[name]</span>\";\n }\n \n if (!array_key_exists(\"password\", $messages)) {\n $messages[\"password\"] = \"\";\n }\n else {\n $messages[\"password\"] = \"<span style='color: red;'>$messages[password]</span>\";\n }\n \n if (!array_key_exists(\"loginResponse\", $messages)) {\n $messages[\"loginResponse\"] = \"\";\n }\n else {\n $messages[\"loginResponse\"] = \"<span style='color: red;'>$messages[loginResponse]</span>\";\n }\n \n //print $messages[\"loginResponse\"];\t\n // Print the form\n print <<<END_FORM\n <form class=\"form-signin\" id=\"loginForm\" method=\"POST\">\n\t$messages[loginResponse]\n\t<label class=\"sr-only\">Username</label>\n <input class=\"form-control\" id=\"name\" type=\"text\" name=\"name\" value=\"$name\" placeholder=\"Last name or Email\"/>$messages[name]\n\t\n\t\n\t<label class=\"sr-only\">Password</label>\n <input class=\"form-control\" id=\"password\" type=\"password\" name=\"password\" placeholder=\"password\"/> $messages[password]\n\t\n\t\n <button id=\"login\" class=\"btn btn-lg btn-primary btn-block\">Log In</button>\n\t\n </form>\nEND_FORM;\n}", "protected function form(){\n $form = new Form(new Clients());\n \n $this->configure($form);\n\t\t\n\t\t$id = $this->_id;\n \n $form->text('name'\t\t\t, __('admin.clients.name'))->rules('required|min:2|max:100');\n \n $form->text('username'\t\t, __('admin.clients.username'))->rules('max:30');\n \n $form->text('phone'\t\t\t, __('admin.clients.phone'))->rules('max:21');\n\t\t\n\t\t//$form->text('address'\t\t, __('admin.clients.address'))->rules('max:200');\n \n $form->decimal('chat_id'\t, __('admin.clients.chat_id'));\n \n $form->radio('status' , __('admin.clients.status.label'))\n\t\t\t\t\t\t->options([\n\t\t\t\t\t\t\t'new' => __('admin.clients.status.new'),\n 'approved' => __('admin.clients.status.approved'),\n 'rejected' => __('admin.clients.status.rejected')\n\t\t\t\t\t\t])\n\t\t\t\t\t\t->default('new')\n\t\t\t\t\t\t->rules('required');\n\t\t\n $form->text('note'\t\t , __('admin.clients.note'));\n \n\t\t// callback before save\n\t\t$form->saving(function (Form $form){\n\t\t\t$form->name\t\t\t= trim($form->name);\n $form->username\t\t= trim($form->username);\n //$form->phone\t\t= trim($form->phone);\n \n $form->phone \t = (string)preg_replace('/[^0-9]/', '', $form->phone);\n \n if($form->chat_id && $form->status != \"new\"){\n $client = Clients::query()->where('chat_id', $form->chat_id)->first();\n \n if($client){\n if($form->status != $client->status){\n $this->sendMessage([\n 'chat_id'\t\t=> $form->chat_id, \n 'text'\t\t\t=> __('telegram.request_'.$form->status)\n ]);\n }\n }else{\n $this->sendMessage([\n 'chat_id'\t\t=> $form->chat_id, \n 'text'\t\t\t=> __('telegram.request_'.$form->status)\n ]);\n }\n \n if($form->status == \"approved\"){\n $this->commandCategoryList($form->chat_id);\n }\n }\n\t\t});\n \n $form->saved(function(Form $form){\n \n });\n\t\t\n return $form;\n }", "function showPreviewForm()\n {\n $ok = $this->preview();\n if (!$ok) {\n // @todo FIXME maybe provide a cancel button or link back?\n return;\n }\n\n $this->elementStart('div', 'entity_actions');\n $this->elementStart('ul');\n $this->elementStart('li', 'entity_subscribe');\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_remote_authorize',\n 'action' =>\n $this->selfLink()));\n $this->elementStart('fieldset');\n $this->hidden('token', common_session_token());\n $this->hidden('profile', $this->profile_uri);\n if ($this->oprofile->isGroup()) {\n // TRANS: Button text.\n $this->submit('submit', _m('Join'), 'submit', null,\n // TRANS: Tooltip for button \"Join\".\n _m('BUTTON','Join this group'));\n } else {\n // TRANS: Button text.\n $this->submit('submit', _m('BUTTON','Confirm'), 'submit', null,\n // TRANS: Tooltip for button \"Confirm\".\n _m('Subscribe to this user'));\n }\n $this->elementEnd('fieldset');\n $this->elementEnd('form');\n $this->elementEnd('li');\n $this->elementEnd('ul');\n $this->elementEnd('div');\n }", "public function index()\n {\n return view('chats.chat');\n }", "public function form()\n {\n $this->switch('auto_df_switch', __('message.tikuanconfig.auto_df_switch'));\n $this->timeRange('auto_df_stime', 'auto_df_etime', '开启时间');\n $this->text('auto_df_maxmoney', __('message.tikuanconfig.auto_df_maxmoney'))->setWidth(2);\n $this->text('auto_df_max_count', __('message.tikuanconfig.auto_df_max_count'))->setWidth(2);\n $this->text('auto_df_max_sum', __('message.tikuanconfig.auto_df_max_sum'))->setWidth(2);\n\n }", "function displayForm() {\n $output = '<form action=\"\" method=\"post\" name=\"commentForm\">' . \"\\n\";\n\n if ( $this->allow ) {\n $pos = strpos(\n strtoupper( addslashes( $this->allow ) ),\n strtoupper( addslashes( $this->getUser()->getName() ) )\n );\n }\n\n // 'comment' user right is required to add new comments\n if ( !$this->getUser()->isAllowed( 'comment' ) ) {\n $output .= wfMessage( 'comments-not-allowed' )->parse();\n } else {\n // Blocked users can't add new comments under any conditions...\n // and maybe there's a list of users who should be allowed to post\n // comments\n if ( $this->getUser()->isBlocked() == false && ( $this->allow == '' || $pos !== false ) ) {\n $output .= '<div class=\"c-form-title\">' . wfMessage( 'comments-submit' )->plain() . '</div>' . \"\\n\";\n $output .= '<div id=\"replyto\" class=\"c-form-reply-to\"></div>' . \"\\n\";\n // Show a message to anons, prompting them to register or log in\n if ( !$this->getUser()->isLoggedIn() ) {\n $login_title = SpecialPage::getTitleFor( 'Userlogin' );\n $register_title = SpecialPage::getTitleFor( 'Userlogin', 'signup' );\n $output .= '<div class=\"c-form-message\">' . wfMessage(\n 'comments-anon-message',\n htmlspecialchars( $register_title->getFullURL() ),\n htmlspecialchars( $login_title->getFullURL() )\n )->text() . '</div>' . \"\\n\";\n }\n\n $output .= '<textarea name=\"commentText\" id=\"comment\" rows=\"5\" cols=\"64\"></textarea>' . \"\\n\";\n $output .= '<div class=\"c-form-button\"><input type=\"button\" value=\"' .\n wfMessage( 'comments-post' )->plain() . '\" class=\"site-button\" /></div>' . \"\\n\";\n }\n $output .= '<input type=\"hidden\" name=\"action\" value=\"purge\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"pageId\" value=\"' . $this->id . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentid\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"lastCommentId\" value=\"' . $this->getLatestCommentID() . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentParentId\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"' . $this->pageQuery . '\" value=\"' . $this->getCurrentPagerPage() . '\" />' . \"\\n\";\n $output .= Html::hidden( 'token', $this->getUser()->getEditToken() );\n }\n $output .= '</form>' . \"\\n\";\n return $output;\n }", "function reply_form($btnText = 'Reply', $errorMsg = 'Please log in to reply') {\n\tglobal $discussion_title;\n\n\tif (auth::isLoggedIn()) {\n\t\techo '\n\t\t<form name=\"input\" action=\"' . BASE . 'discussion' . DS . discussion::encode_title($discussion_title) . DS . 'reply' . '\" method=\"post\">\n\t\t\t<textarea rows=\"7\" placeholder=\"Just type...\" name=\"content\" class=\"boxsizingBorder\"></textarea><br/>\n\t\t\t<input type=\"submit\" class=\"submit small\" value=\"' . $btnText .'\"/>\n\t\t</form>\n\t\t';\n\t} else {\n\t\techo '<a href=\"http://' . getenv(DOMAIN_NAME) . BASE . 'login' . '\">' . $errorMsg . '</a>';\n\t}\n}", "function renderForm()\n{\n ?>\n <form method=\"POST\">\n <label>Nome <input name=\"name\" value=\"<?php echo $_POST['name'] ?? '' ?>\"></label><br/>\n <label>Messaggio <input name=\"message\" value=\"<?php echo $_POST['message'] ?? '' ?>\"></label><br/>\n <input type=\"submit\" value=\"Invia\">\n </form>\n <?php\n}", "public function form()\n {\n\n $this->display('id', '申请ID')->default($this->payload['id']);\n $this->display('uid', '申请人UID')->default($this->payload['uid']);\n $this->display('status', '状态')->default(\\App\\Admin\\Repositories\\BusinessApply::$statusLabel[$this->payload['status']]);\n\n\n $this->radio('process', '处理')\n ->options([\n 1 => '通过',\n 2 => '拒绝',\n ]);\n\n $this->text('msg', '审核回复');\n\n }", "public function showMessages()\n {\n $messages = $this->getMessages();\n foreach ($messages as $message) {\n echo $message . \"\\n\";\n }\n }", "public function render()\n {\n return view('components.form.input');\n }", "protected function form()\n {\n return $this->view\n ->template('Moss:Sample:login')\n ->set('method', __METHOD__)\n ->set('flash', $this->app->get('flash'))\n ->render();\n }", "function displayForm() {\n\t\t$session = new SessionManager();\n\t\t$session->sessionLoad();\n\t\t$categorys = new CategoryModel();\n\t\t$rows = $categorys->readAll();\n\t\t$view = new View(\"view/uploadPic.php\");\n\t\t$upload_error = \"\";\n\t\tif( isset($_GET[\"error\"])){\n\t\t\t$upload_error = $_GET[\"error\"];\n\t\t}\n\t\t$view->upload_error = $upload_error;\n\t\t$view->rows = $rows;\n\t\t$view->isLogdin = $session->getIsLogdin();\n\t\t$view->userName = $session->username;\n\t\t$view->display();\n\t}", "public function form()\n {\n return view('buffet.form');\n }", "function display_popup_form($form_html)\r\n {\r\n Display :: normal_message($form_html);\r\n }", "public function renderChatView() {\n\n $messages = $this->loadMessages();\n require 'public/views/front/chatView.phtml';\n\n }", "public function comment_form() {\n\n\t\t/** Don't do anything if we are in the admin */\n\t\tif ( is_admin() )\n\t\t\treturn;\n\n\t\t/** Don't do anything unless the user has already logged in and selected a list */\n/*\t\tif ( empty( $tgm_mc_options['current_list_id'] ) )\n\t\t\treturn;\n*/\n\t\t$clear = CTCT_Settings::get('comment_form_clear') ? 'style=\"clear: both;\"' : '';\n\t\t$checked_status = ( ! empty( $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) && 'checked' == $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) ? true : false;\n\t\t$checked = $checked_status ? 'checked=\"checked\"' : '';\n\t\t$status = ''; //$this->get_viewer_status();\n\n\t\tif ( 'admin' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_admin_text') . '</p>';\n\t\t}\n\t\telseif ( 'subscribed' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_subscribed_text') . '</p>';\n\t\t}\n\t\telseif ( 'pending' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_pending_text') . '</p>';\n\t\t}\n\t\telse {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>';\n\n\t\t\t\techo sprintf('<label for=\"ctct-comment-subscribe\"><input type=\"checkbox\" name=\"ctct-subscribe\" id=\"ctct-comment-subscribe\" value=\"subscribe\" style=\"width: auto;\" %s /> %s</label>', $checked, CTCT_Settings::get('comment_form_check_text'));\n\t\t\techo '</p>';\n\t\t}\n\n\t}", "public function form()\n\t{\n\t\tglobal $L;\n\t\t$sentEmails = $this->getSentEmailsArray();\n\n\t\t$html = '<div class=\"alert alert-primary\" role=\"alert\">';\n\t\t$html .= $this->description();\n\t\t$html .= '</div>';\n\n\t\t$html .= '<div>';\n\t\t// API key\n\t\t$html .= '<label><strong>Buttondown API Key</strong></label>';\n\t\t$html .= '<input id=\"apiKey\" name=\"apiKey\" type=\"text\" value=\"'.$this->getValue('apiKey').'\">';\n\t\t$html .= '<span class=\"tip\">Copy your API key on https://buttondown.email/settings/programming </span>';\n\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('paused').'</label>';\n\t\t$html .= '<select id=\"paused\" name=\"paused\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('paused')===true?'selected':'').'>'.$L->get('is-paused').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('paused')===false?'selected':'').'>'.$L->get('is-active').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('paused-tip').'</span>';\n\n\t\t// Start date\n\t\t$html .= '<label>'.$L->get('send-after').'</label>';\n\t\t$html .= '<input id=\"startDate\" name=\"startDate\" type=\"text\" value=\"'.$this->getValue('startDate').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('send-after-tip').'</span>';\n\t\t// Subject Prefix\n\t\t$html .= '<label>'.$L->get('subject-prefix').'</label>';\n\t\t$html .= '<input id=\"subjectPrefix\" name=\"subjectPrefix\" type=\"text\" value=\"'.$this->getValue('subjectPrefix').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('subject-prefix-tip').'</span>';\n\t\t\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('include-cover').'</label>';\n\t\t$html .= '<select id=\"includeCover\" name=\"includeCover\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('includeCover')===true?'selected':'').'>'.$L->get('yes').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('includeCover')===false?'selected':'').'>'.$L->get('no').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('include-cover-tip').'</span>';\n\t\t$html .= '</div><hr>';\n\t\t// List of page keys for which mail was sent \n\t\t$html .= '<h4>'.$L->get('sent-list').'</h4>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('sent-list-tip').'</span>';\n\t\t$html .= '<div style=\"overflow-y: scroll; height:400px;\"><ul>';\n\t\tforeach ($sentEmails as $sentKey):\n\t\t\t$html .= '<li>'.$sentKey.'</li>';\n\t\tendforeach;\n\t\t$html .= '</ul></div>';\n\t\t$html .= '<div><a target=\"_blank\" rel=\"noopener\" href=\"https://buttondown.email/archive\">Buttondown Archive</a></div>';\n\t\treturn $html;\n\t}", "function profileForm(){\r\n\t\t$this->view('profileForm');\r\n\t}", "public function form($hInstance)\n {\n echo $this->generateForm($hInstance);\n\t}", "public function gui()\n {\n require_code('form_templates');\n\n require_css('recommend');\n\n $page_title = get_param_string('page_title', null, true);\n\n $submit_name = (!is_null($page_title)) ? make_string_tempcode($page_title) : do_lang_tempcode('SEND');\n $post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF', null, true);\n\n $hidden = new Tempcode();\n\n $name = post_param_string('name', is_guest() ? '' : $GLOBALS['FORUM_DRIVER']->get_username(get_member(), true));\n $recommender_email_address = post_param_string('recommender_email_address', $GLOBALS['FORUM_DRIVER']->get_member_email_address(get_member()));\n\n $fields = new Tempcode();\n $fields->attach(form_input_line(do_lang_tempcode('YOUR_NAME'), '', 'name', $name, true));\n $fields->attach(form_input_email(do_lang_tempcode('YOUR_EMAIL_ADDRESS'), '', 'recommender_email_address', $recommender_email_address, true));\n $already = array();\n foreach ($_POST as $key => $email_address) {\n if (substr($key, 0, 14) != 'email_address_') {\n continue;\n }\n\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n $already[] = $email_address;\n }\n\n if (is_guest()) {\n $fields->attach(form_input_email(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), '', 'email_address_0', array_key_exists(0, $already) ? $already[0] : '', true));\n } else {\n if (get_option('enable_csv_recommend') == '1') {\n $set_name = 'people';\n $required = true;\n $set_title = do_lang_tempcode('TO');\n $field_set = alternate_fields_set__start($set_name);\n\n $email_address_field = form_input_line_multi(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), do_lang_tempcode('THEIR_ADDRESS'), 'email_address_', $already, 1, null, 'email');\n $field_set->attach($email_address_field);\n\n //add an upload CSV contacts file field\n $_help_url = build_url(array('page' => 'recommend_help'), get_page_zone('recommend_help'));\n $help_url = $_help_url->evaluate();\n\n $field_set->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD_CSV_FILE', escape_html($help_url)), 'upload', false, null, null, false));\n\n $fields->attach(alternate_fields_set__end($set_name, $set_title, '', $field_set, $required));\n } else {\n $email_address_field = form_input_line_multi(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), do_lang_tempcode('THEIR_ADDRESS'), 'email_address_', $already, 1, null, 'email');\n $fields->attach($email_address_field);\n }\n }\n\n if (may_use_invites()) {\n $invites = get_num_invites(get_member());\n if ($invites > 0) {\n require_lang('cns');\n $invite = (count($_POST) == 0) ? true : (post_param_integer('invite', 0) == 1);\n $fields->attach(form_input_tick(do_lang_tempcode('USE_INVITE'), do_lang_tempcode('USE_INVITE_DESCRIPTION', $GLOBALS['FORUM_DRIVER']->is_super_admin(get_member()) ? do_lang('NA_EM') : integer_format($invites)), 'invite', $invite));\n }\n }\n $message = post_param_string('message', null);\n $subject = get_param_string('subject', do_lang('RECOMMEND_MEMBER_SUBJECT', get_site_name()), true);\n if (is_null($message)) {\n $message = get_param_string('s_message', '', true);\n if ($message == '') {\n $from = get_param_string('from', null, true);\n if (!is_null($from)) {\n $resource_title = get_param_string('title', '', true);\n if ($resource_title == '') { // Auto download it\n $downloaded_at_link = http_download_file($from, 3000, false);\n if (is_string($downloaded_at_link)) {\n $matches = array();\n if (cms_preg_match_safe('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#mi', $downloaded_at_link, $matches) != 0) {\n $resource_title = trim(str_replace('&ndash;', '-', str_replace('&mdash;', '-', @html_entity_decode($matches[1], ENT_QUOTES, get_charset()))));\n $resource_title = preg_replace('#^' . preg_quote(get_site_name(), '#') . ' - #', '', $resource_title);\n $resource_title = cms_preg_replace_safe('#\\s+[^\\d\\s][^\\d\\s]?[^\\d\\s]?\\s+' . preg_quote(get_site_name(), '#') . '$#i', '', $resource_title);\n }\n }\n }\n if ($resource_title == '') {\n $resource_title = do_lang('THIS'); // Could not find at all, so say 'this'\n } else {\n $subject = get_param_string('subject', do_lang('RECOMMEND_MEMBER_SUBJECT_SPECIFIC', get_site_name(), $resource_title));\n }\n\n $message = do_lang('FOUND_THIS_ON', get_site_name(), comcode_escape($from), comcode_escape($resource_title));\n }\n }\n if (get_param_integer('cms', 0) == 1) {\n $message = do_lang('RECOMMEND_COMPOSR', brand_name(), get_brand_base_url());\n }\n }\n\n $text = is_null($page_title) ? do_lang_tempcode('RECOMMEND_SITE_TEXT', escape_html(get_site_name())) : new Tempcode();\n\n if (!is_null(get_param_string('from', null, true))) {\n $submit_name = do_lang_tempcode('SEND');\n $text = do_lang_tempcode('RECOMMEND_AUTO_TEXT', get_site_name());\n $need_message = true;\n } else {\n $hidden->attach(form_input_hidden('wrap_message', '1'));\n $need_message = false;\n }\n\n handle_max_file_size($hidden);\n\n $fields->attach(form_input_line(do_lang_tempcode('SUBJECT'), '', 'subject', $subject, true));\n $fields->attach(form_input_text_comcode(do_lang_tempcode('MESSAGE'), do_lang_tempcode('RECOMMEND_SUP_MESSAGE', escape_html(get_site_name())), 'message', $message, $need_message, null, true));\n\n if (addon_installed('captcha')) {\n require_code('captcha');\n if (use_captcha()) {\n $fields->attach(form_input_captcha());\n $text->attach(' ');\n $text->attach(do_lang_tempcode('FORM_TIME_SECURITY'));\n }\n }\n\n $hidden->attach(form_input_hidden('comcode__message', '1'));\n\n $javascript = (function_exists('captcha_ajax_check') ? captcha_ajax_check() : '');\n\n return do_template('FORM_SCREEN', array(\n '_GUID' => '08a538ca8d78597b0417f464758a59fd',\n 'JAVASCRIPT' => $javascript,\n 'SKIP_WEBSTANDARDS' => true,\n 'TITLE' => $this->title,\n 'PREVIEW' => true,\n 'HIDDEN' => $hidden,\n 'FIELDS' => $fields,\n 'URL' => $post_url,\n 'SUBMIT_ICON' => 'buttons__send',\n 'SUBMIT_NAME' => $submit_name,\n 'TEXT' => $text,\n 'SUPPORT_AUTOSAVE' => true,\n 'TARGET' => '_self',\n ));\n }", "public function form( $instace ){\n echo '<p><strong>Widget ini belum bisa diubag secara Manual!</strong><br> Hubungi developer untuk melakukan perubahan</p>'; \n }", "protected function form()\n {\n return Admin::form(Messages::class, function (Form $form) {\n $userid = admin::user()->id;\n $role = getRole($userid);//获取权限.1管理员.2公司负责人.3普通员工.4总监\n $pid = admin::user()->pid;\n if ($role == 1) {\n $cid = 0;\n }else if($role == 2){\n $cid = $userid;\n }else{\n $cid = $pid;\n }\n $form->hidden('id', 'ID');\n $form->hidden('cid', '公司id')->default($cid);\n $form->text('title','标题*')->setwidth(3);\n $form->textarea('content','内容*')->setwidth(5);\n $form->text('url','链接')->help('如果有活动海报链接.')->setwidth(5);\n $form->image('image','消息图片')->setWidth(4)->uniqueName();\n $form->radio('type','消息类型')->options([0=>'本地消息',1=>'推送消息']);\n if ($role == 1) {\n $data[0] = '全部';\n $com = DB::table('admin_users')->where('pid',0)->select('id','name')->get();\n foreach ($com as $k => $v) {\n $data[$v->id] = $v->name;\n }\n // $data = array_merge($data,$com1);\n $form->select('senduser','发送人群')->options($data)->setwidth(3);\n }\n $form->hidden('addtime','修改时间')->default(date('Y-m-d H:i:s'));\n // $form->display('created_at', 'Created At');\n // $form->display('updated_at', 'Updated At');\n $form->saved(function(Form $form) use($role){\n if ($role == 1) {\n $senduser = $form->senduser;\n }else{\n $senduser = $form->cid;\n }\n if ($form->type == 0) {//本地消息\n if ($senduser == 0) {\n $user = DB::table('user')->pluck('id');\n }else{\n $user = DB::table('user')->where('cid',$senduser)->pluck('id');\n }\n foreach ($user as $k => $v) {\n $data = [\n 'uid'=>$v,\n 'mid'=>$form->model()->id,\n 'sendtime'=>date('Y-m-d H:i:s'),\n ];\n DB::table('messages_user')->insert($data);\n }\n } \n if ($form->type == 1) {//推送\n $after_open = 'go_app';\n if ($form->url) {\n $after_open = 'go_url';\n }\n $predefined = [\n 'ticker'=>'ticker',\n \"title\"=>$form->title,\n \"text\"=>$form->content, \n \"after_open\" => $after_open,\n ];\n if ($senduser == 0) {//广播\n Umeng::android()->sendBroadcast($predefined);\n }else{//组播\n $filter = '{\"where\":{\"and\":[{\"or\":[{\"tag\":'.$senduser.'}]}]}}';\n // $filter = ['where'=>['and'=>['or'=>['tag'=>$senduser]]]];\n $extraField = array(\"test\"=>\"helloworld\");\n Umeng::android()->sendGroupcast($filter, $predefined,$extraField);\n }\n } \n \n \n });\n });\n }", "public static function display_irc_chat_rules() {\n ?>\n <ol>\n <?= Lang::get('rules', 'chat_forums_irc') ?>\n </ol>\n<?\n }", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "public function display() {\r\n\t\t$this->echoOptionHeader();\r\n\t\t$dateFormat = 'Y-m-d H:i';\r\n\t\t$placeholder = 'YYYY-MM-DD HH:MM';\r\n\t\tif ( $this->settings['date'] && ! $this->settings['time'] ) {\r\n\t\t\t$dateFormat = 'Y-m-d';\r\n\t\t\t$placeholder = 'YYYY-MM-DD';\r\n\t\t} else if ( ! $this->settings['date'] && $this->settings['time'] ) {\r\n\t\t\t$dateFormat = 'H:i';\r\n\t\t\t$placeholder = 'HH:MM';\r\n\t\t}\r\n\r\n\t\tprintf('<input class=\"input-date%s%s\" name=\"%s\" placeholder=\"%s\" id=\"%s\" type=\"text\" value=\"%s\" /> <p class=\"description\">%s</p>',\r\n\t\t\t( $this->settings['date'] ? ' date' : '' ),\r\n\t\t\t( $this->settings['time'] ? ' time' : '' ),\r\n\t\t\t$this->getID(),\r\n\t\t\t$placeholder,\r\n\t\t\t$this->getID(),\r\n\t\t\tesc_attr( ($this->getValue() > 0) ? date( $dateFormat, $this->getValue() ) : '' ),\r\n\t\t\t$this->settings['desc']\r\n\t\t);\r\n\t\t$this->echoOptionFooter( false );\r\n\t}", "protected function form()\n {\n return Admin::form(Reply::class, function (Form $form) {\n\n $form->text('reply_content', '回复')->rules('required');\n $form->radio('visible', '是否可见')->options([\n '1' => '是',\n '0' => '否',\n ]);\n });\n }", "public function abrir_chat()\n\t{\n\t\t$usuario=$this->session->userdata('id');\n\t\t$id_otro_usuario=$_REQUEST['id_otro_usuario'];\n\t\t\n\t\t//var_dump($_REQUEST);\n\t\t\n\t\t$mensajes=$this->Mensaje_model->buscar_mensajes_chat($usuario,$id_otro_usuario);//TODO cambiar por $usuario\n\t\techo(json_encode($mensajes));\n\t}", "public function render()\n {\n return view('sendportal::components.text-field');\n }", "function DisplayTopicForm()\n {\n global $DB, $userinfo;\n\n if(!$this->conf->forum_arr['forum_id'])\n {\n // user is trying to break the script\n $this->conf->RedirectPageDefault('<strong>'.$this->conf->plugin_phrases_arr['err_invalid_forum_id'] . '</strong>',true);\n return;\n }\n\n $content = GetVar('forum_post', '', 'string', true, false);\n $title = GetVar('forum_topic_title', '', 'string', true, false);\n $sticky = GetVar('stick_topic', 0, 'bool', true, false)?1:0;\n $closed = GetVar('closed', 0, 'bool', true, false)?1:0;\n $moderate = GetVar('moderate_topic', 0, 'bool', true, false)?1:0;\n $prefix_id = GetVar('prefix_id', 0, 'whole_number', true, false);\n $tags = GetVar('tags', '', 'string', true, false);\n\n //SD343: display prefixes available to user (based on sub-forum/usergroup)\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $tconf = array(\n 'elem_name' => 'prefix_id',\n 'elem_size' => 1,\n 'elem_zero' => 1,\n 'chk_ugroups' => !$this->conf->IsSiteAdmin,\n 'pluginid' => $this->conf->plugin_id,\n 'objectid' => 0,\n 'tagtype' => 2,\n 'ref_id' => 0,\n 'allowed_id' => $this->conf->forum_id,\n 'selected_id' => $prefix_id,\n );\n\n echo '\n <h2>' . $this->conf->forum_arr['title'] . '</h2>\n <form '.($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ? 'id=\"forum-admin\" ':'').\n 'action=\"' . $this->conf->current_page . '\" enctype=\"multipart/form-data\" method=\"post\">\n '.PrintSecureToken(FORUM_TOKEN).'\n <input type=\"hidden\" name=\"forum_action\" value=\"insert_topic\" />\n <input type=\"hidden\" name=\"forum_id\" value=\"'.$this->conf->forum_arr['forum_id'].'\" />\n <div class=\"form-wrap\">\n <h2 style=\"margin:4px\">'.$this->conf->plugin_phrases_arr['new_topic'].'</h2>\n <p style=\"margin:8px 4px 0px 4px\">\n <label>'.$this->conf->plugin_phrases_arr['topic_title'].'</label>\n <input type=\"text\" name=\"forum_topic_title\" value=\"'.$title.'\" /></p>\n ';\n\n DisplayBBEditor(SDUserCache::$allow_bbcode, 'forum_post', $content, FORUM_REPLY_CLASS, 80, 10);\n\n $out = '\n <fieldset>';\n\n $prefix = SD_Tags::GetPluginTagsAsSelect($tconf);\n if(strlen($prefix))\n {\n $out .= '\n <p style=\"padding-top:10px\">\n <label for=\"prefix_id\">\n '.$this->conf->plugin_phrases_arr['topic_prefix'].'\n '.$prefix.'</label></p>';\n }\n\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator)\n {\n $out .= '\n <p style=\"padding-top:10px\">\n <label for=\"ft_sticky\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'sticky.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_sticky\" name=\"stick_topic\" value=\"1\"'.($sticky?' checked=\"checked\"':'').' /> '.\n ($this->conf->plugin_phrases_arr['topic_options_stick_topic']).'</label></p>\n <p style=\"padding-top:10px\">\n <label for=\"ft_closed\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'lock.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_closed\" name=\"closed\" value=\"1\"'.($closed?' checked=\"checked\"':'').' /> '.\n ($this->conf->plugin_phrases_arr['topic_options_lock_topic']).'</label></p>\n <p style=\"padding-top:10px\">\n <label for=\"ft_moderated\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'attention.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_moderated\" name=\"moderate_topic\" value=\"1\"'.($moderate?' checked=\"checked\"':'').' /> '.\n $this->conf->plugin_phrases_arr['topic_options_moderate_topic'].'</label></p>\n ';\n }\n\n $tag_ug = sd_ConvertStrToArray($this->conf->plugin_settings_arr['tag_submit_permissions'],'|');\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($tag_ug) && @array_intersect($userinfo['usergroupids'], $tag_ug)))\n {\n $out .= '\n <p style=\"padding-top:10px\"><label for=\"ft_tags\">'.$this->conf->plugin_phrases_arr['topic_tags'].'\n <input type=\"text\" id=\"ft_tags\" name=\"tags\" maxlength=\"200\" size=\"35\" value=\"'.$tags.'\" />\n <br />'.$this->conf->plugin_phrases_arr['topic_tags_hint'].'</label></p>';\n }\n\n if(!empty($this->conf->plugin_settings_arr['attachments_upload_path']) &&\n ($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($this->conf->plugin_settings_arr['valid_attachment_types']) &&\n (!empty($userinfo['plugindownloadids']) && @in_array($this->conf->plugin_id, $userinfo['plugindownloadids'])))) )\n {\n $out .= '\n <p style=\"padding-top:10px\"><label for=\"post_attachment\">'.$this->conf->plugin_phrases_arr['upload_attachments'].'\n <input id=\"post_attachment\" name=\"attachment\" type=\"file\" size=\"35\" /> (' .\n $this->conf->plugin_settings_arr['valid_attachment_types'] . ')</label></p>';\n }\n\n $out .= '\n </fieldset>';\n\n if(strlen($out))\n {\n echo '\n <p>'.$out.'</p>';\n }\n\n if(!($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator) ||\n !empty($userinfo['require_vvc'])) //SD340: require_vvc\n {\n DisplayCaptcha(true,'amihuman');\n }\n\n echo '<br />\n <input type=\"submit\" name=\"create_topic\" value=\"'.strip_alltags($this->conf->plugin_phrases_arr['create_topic']).'\" />\n </div>\n </form>\n<script type=\"text/javascript\">\njQuery(document).ready(function() {\n (function($){ $(\"textarea#forum_post\").focus(); })(jQuery);\n});\n</script>\n';\n\n }", "public function display() {\n\t\techo '<iframe src=\"http://norulesweb.com/contact/\" width=\"800\" height=\"400\"></iframe>';\n\t}", "public function form(): string {\n\n\t\twp_enqueue_style( 'subscribe' );\n\t\twp_enqueue_script( 'subscribe' );\n\n\t\tob_start();\n\t\trequire SUBSCRIBE_PATH . 'templates/subscribe-form.php';\n\n\t\treturn (string) ob_get_clean();\n\t}", "public function playAction() {\n $els = array('name'=>'user','elements'=>array(\n array('input'=>'html','content'=>\"<h2>This is the Form</h2>\"),\n array('input'=>'html','content'=>\"<div class='el-wrapper'>\"),\n 'testtext'=>array('label'=>'Label for Text Field',\n 'name'=>'text_data',\n 'value'=>\"This is O'Rielly's text stuff\"),\n 'testtextarea'=>array('label'=>\"Label For TextArea Input\",\n 'input'=>'textarea', 'name'=>'textaarea_data', \n 'content'=>\"This is text area O'Brien's\\nSong\"),\n 'subform' => array('subform' => array('elements'=>array(\n array('input'=>'html','content'=>\"<h2>This is the SubForm</h2>\"),\n\n ))),\n\n array('input'=>'html','content'=>\"</div>\"),\n ));\n $form = new BaseForm($els);\n $data['form'] = $form;\n return $data;\n }", "public function showChatPopup()\n {\n Cookie::queue('chatPopupShow', 'true', 60);\n $this->chatPopupVisibility = true;\n\n // load chat history by reloading the page\n $this->dispatchBrowserEvent('reload-page');\n }", "public function chatlog()\n {\n return view('admin.profile.chatlog');\n }", "public function displayForm() {\n\t\t$output = $this->getOutput();\n\n\t\t$form_class = $this->adapter->getFormClass();\n\t\t// TODO: use interface. static ctor.\n\t\tif ( $form_class && class_exists( $form_class ) ){\n\t\t\t$form_obj = new $form_class();\n\t\t\t$form_obj->setGateway( $this->adapter );\n\t\t\t$form_obj->setGatewayPage( $this );\n\t\t\t$form = $form_obj->getForm();\n\t\t\t$output->addModules( $form_obj->getResources() );\n\t\t\t$output->addModuleStyles( $form_obj->getStyleModules() );\n\t\t\t$output->addHTML( $form );\n\t\t} else {\n\t\t\t$this->logger->error( \"Displaying fail page for bad form class '$form_class'\" );\n\t\t\t$this->displayFailPage( false );\n\t\t}\n\t}", "public function displayForm() {\n\t\t$output = $this->getOutput();\n\n\t\t$form_class = $this->adapter->getFormClass();\n\t\t// TODO: use interface. static ctor.\n\t\tif ( $form_class && class_exists( $form_class ) ) {\n\t\t\t$form_obj = new $form_class();\n\t\t\t$form_obj->setGateway( $this->adapter );\n\t\t\t$form_obj->setGatewayPage( $this );\n\t\t\t$form = $form_obj->getForm();\n\t\t\t$output->addModules( $form_obj->getResources() );\n\t\t\t$output->addModuleStyles( $form_obj->getStyleModules() );\n\t\t\t$output->addHTML( $form );\n\t\t} else {\n\t\t\t$this->logger->error( \"Displaying fail page for bad form class '$form_class'\" );\n\t\t\t$this->displayFailPage( false );\n\t\t}\n\t}", "public function renderInput();", "protected function form()\n {\n return Admin::form(Reply::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->select('thread_id', '问题')->options(Thread::all()->pluck('title', 'id'));\n $form->select('user_id', '回复者')->options(User::all()->pluck('name', 'id'));\n $form->textarea('body', '回复内容');\n $form->number('favorites_count', '点赞');\n $form->display('created_at', '回复时间');\n // $form->display('updated_at', 'Updated At');\n });\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function index()\n {\n $chats = DB::table('chats')->where('author', '=', Auth::user()->email)->orWhere('sendto', '=', Auth::user()->email);\n return view('Chat', compact('chats'));\n }", "public function output_setup_form() {\n\t\t$related_api = Thrive_Dash_List_Manager::connection_instance( 'mandrill' );\n\t\tif ( $related_api->is_connected() ) {\n\t\t\t$credentials = $related_api->get_credentials();\n\t\t\t$this->set_param( 'email', $credentials['email'] );\n\t\t\t$this->set_param( 'mandrill-key', $credentials['key'] );\n\t\t}\n\n\t\t$this->output_controls_html( 'mailchimp' );\n\t}", "public function C_obtenerChat($output){\n\t\t$this->Dashboard_model->M_marcarMensajesLeidos();\n\t\t$msgBox =\"\";\n\t\t// Obtener todos los mensajes enviados por mi y/o recibido por id_usuario_para\n\t\t\t$mensajes = $this->Dashboard_model->M_obtenerMensajes($this->input->post(\"para\"));\n\t\t\t$data[\"para\"] = $this->input->post(\"para\");\n\n\t\t\tforeach ($mensajes as $fila) {\n\t\t\t\tif ($this->session->userdata('id_usuario') == $fila->id_usuario_de) {\n\t\t\t\t\t$msgBox .=\"<div class='box3 sb13'>\".$fila->mensaje.\"</div>\";\n\t\t\t\t}else{\n\t\t\t\t\t$msgBox .=\"<div class='box4 sb14'><p>\".$fila->mensaje.\"</p></div>\";\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tif ($output == 1){\n\t\t\techo $msgBox;\n\t\t}else{\n\t\t\treturn $msgBox;\n\t\t}\n\t}", "public function create()\n {\n $chatroom = ChatRoom::all();\n return view('superadmin::autochat.create', compact('chatroom'));\n }", "public function start()\n\t{\n\t\t$attrs = \"\";\n\t\tforeach($this->_attributes as $key => $val)\n\t\t\t$attrs .= \"$key=\\\"$val\\\" \";\n\n\t\t$attrs = trim($attrs);\n\t\techo \"<form $attrs>\\n\";\n\t}", "public function displayFormAction() {\n $params = t3lib_div::_GET('libconnect');\n\n //include CSS\n $this->decideIncludeCSS();\n\n $cObject = t3lib_div::makeInstance('tslib_cObj');\n $form = $this->ezbRepository->loadForm();\n\n //variables for template\n $this->view->assign('vars', $params['search']);\n $this->view->assign('form', $form);\n $this->view->assign('siteUrl', $cObject->getTypolink_URL($GLOBALS['TSFE']->id));//current URL\n $this->view->assign('listUrl', $cObject->getTypolink_URL($this->settings['flexform']['listPid']));//url to search\n $this->view->assign('listPid', $this->settings['flexform']['listPid']);//ID of list view\n }", "public function form()\r\n {\r\n $this->tab(admin_trans('menu.titles.email_test'), function () {\r\n $this->text('to', admin_trans('email-test.labels.to'))->required();\r\n $this->text('title', admin_trans('email-test.labels.title'))->default('这是一条测试邮件')->required();\r\n $this->editor('body', admin_trans('email-test.labels.body'))->default(\"这是一条测试邮件的正文内容<br/><br/>正文比较长<br/><br/>非常长<br/><br/>测试测试测试\")->required();\r\n });\r\n }", "public static function display_create_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=save' method='post'>\";\n echo \"Name: <input type='text' name='name' /><br />\";\n echo \"Description: <textarea name='description'></textarea><br />\";\n echo \"<input type='submit' value='Save' />\";\n echo \"</form>\";\n }", "protected function form()\n {\n return Admin::form(Channel::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->text('name', '标题');\n $form->text('slug', '英文标识')->rules('required|regex:/^[a-z]+$/|min:4')->help('至少为4个字母');\n $form->icon('icon', trans('admin.icon'))->default('fa-bars')->rules('required')->help($this->iconHelp());\n $form->textarea('desc', '简述');\n // $form->display('created_at', 'Created At');\n // $form->display('updated_at', 'Updated At');\n });\n }", "function chat_prepare_form_vars($chat = NULL) {\n\t$user = elgg_get_logged_in_user_entity();\n\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => NULL,\n\t\t'description' => NULL,\n\t\t'access_id' => ACCESS_LOGGED_IN,\n\t\t'container_guid' => NULL,\n\t\t'guid' => NULL,\n\t\t'members' => NULL,\n\t);\n\n\tif ($chat) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($chat->$field)) {\n\t\t\t\t$values[$field] = $chat->$field;\n\t\t\t}\n\t\t}\n\t\t$values['members'] = $chat->getMemberGuids();\n\t}\n\n\tif (elgg_is_sticky_form('chat')) {\n\t\t$sticky_values = elgg_get_sticky_values('chat');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\n\t\t// This is not a property of chat so add separately\n\t\t$values['description'] = $sticky_values['message'];\n\t}\n\n\telgg_clear_sticky_form('chat');\n\n\treturn $values;\n}", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $msg = html_div(\"ft_form_msg\") ;\r\n $msg->add(html_p(html_b(\"Processing the SDIF Queue requires\r\n processing swimmers, swim meets, and/or swim teams which are\r\n not currently stored in the database. Specify how unknown\r\n data should be processed.\"), html_br())) ;\r\n\r\n $td = html_td(null, null, $msg) ;\r\n $td->set_tag_attribute(\"colspan\", \"2\") ;\r\n $table->add_row($td) ;\r\n $table->add_row($this->element_label(\"Swimmers\"), $this->element_form(\"Swimmers\")) ;\r\n $table->add_row($this->element_label(\"Swim Meets\"), $this->element_form(\"Swim Meets\")) ;\r\n $table->add_row($this->element_label(\"Swim Teams\"), $this->element_form(\"Swim Teams\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function run()\r\n\t{\r\n $this->render('MessageDisplay');\r\n\t}", "static function numberForm (ViewRegistry $context) {\n $form=\"<form action=\\\"\\\" method=\\\"get\\\" id=\\\"messageNumber\\\" drawer=\\\"Rec\\\"><p>\".l(\"Message\").\"&nbsp;(\".$context->g(\"forumBegin\").\"..\".$context->g(\"forumEnd\").\"): \";\n $form.=\"<input type=\\\"text\\\" name=\\\"begin\\\" style=\\\"width:5em;\\\" value=\\\"\".$context->g(\"begin\").\"\\\" />\";\n $form.=\"<input type=\\\"hidden\\\" name=\\\"length\\\" value=\\\"\".$context->g(\"length\").\"\\\" />\";\n $form.=\"</p></form>\";\n return ($form);\n }", "public function index() {\n $this->users = (new UsersModel())->getUsers($_SESSION['user_id']);\n\n if ($this->isPost) {\n $friendId = $_POST['user-id'];\n $_SESSION['friend_id'] = $friendId;\n $this->redirect('messages', 'chat');\n }\n }", "function text_message_form($form, &$form_state, $arg = NULL) {\n $form = array();\n $form['title_msg'] = array(\n '#type' => 'textfield',\n '#title' => 'Title',\n '#required' => TRUE,\n );\n $form['body_msg'] = array(\n '#type' => 'textarea',\n '#title' => 'Text',\n '#required' => TRUE,\n );\n $form['id_msg'] = array(\n '#type' => 'hidden',\n '#value' => NULL,\n );\n $form['submit_msg'] = array(\n '#type' => 'submit',\n '#value' => t('Send'),\n );\n $form['#submit'][] = 'text_message_submit';\n\n if (isset($arg)) {\n $query = db_select('text_message', 'tm');\n $query\n ->fields('tm', array('title', 'body'))\n ->condition('tm.id', $arg);\n $result = $query->execute()->fetchAssoc();\n $form['title_msg']['#default_value'] = $result['title'];\n $form['body_msg']['#default_value'] = $result['body'];\n $form['id_msg']['#value'] = $arg;\n }\n\n return $form;\n}", "function showContent()\n {\n if ($this->oprofile) {\n $this->showPreviewForm();\n } else {\n $this->showInputForm();\n }\n }", "public function index()\n {\n $helloMessage = (array)Config::get('messageConfig.HELLO') +\n ['title' => '', 'message' => '', 'icon' => ''];\n $providerMessage = (array)Config::get('messageConfig.PROVIDER') +\n ['title' => '', 'message' => '', 'icon' => ''];\n return view(\"admin.message.global.form\")\n ->with('helloMessage', $helloMessage)\n ->with('providerMessage', $providerMessage);\n }", "public function getAction()\n {\n\n if(Auth::hasLastChatId())\n {\n\n $_POST['last_chat_id'] = Auth::getLastChatId();\n $chat = new Chat($_POST);\n\n if ($chat->hasChatAfter())\n {\n $chats = $chat->getAfter(Auth::getLastChatId());\n\n View::renderTemplate('App/chat.html', [\n 'chats' => $chats\n ]);\n\n Auth::setLastChatId($chat->getLastChatId());\n }\n\n }\n else\n {\n Auth::setLastChatId(0);\n\n }\n }", "function show_forms()\n {\n }", "public function qode_membership_render_login_form() {\n\t\techo qode_membership_get_widget_template_part( 'login-widget', 'login-modal-template' );\n\t}", "function Form()\n\t{\n\t\tprint '<form name=\"myform\" action=\"' . THIS_PAGE . '\" method=\"post\">';\n\t\tforeach($this->aQuestion as $question)\n\t\t{//print data for each\n\t\t\t$this->createInput($question);\n\t\t}\n\t\tprint '<input type=\"hidden\" name=\"SurveyID\" value=\"' . $this->SurveyID . '\" />';\t\n\t\tprint '<input type=\"submit\" value=\"Submit!\" />';\t\n\t\tprint '</form>';\n\t}" ]
[ "0.7801312", "0.74928266", "0.6767614", "0.6429939", "0.6362129", "0.6341432", "0.6180339", "0.614269", "0.60477126", "0.6046342", "0.599658", "0.5994614", "0.5962506", "0.5958476", "0.59507793", "0.5937071", "0.5927495", "0.59255874", "0.5909474", "0.5899719", "0.5809194", "0.5793113", "0.57667863", "0.57456636", "0.5728232", "0.5724299", "0.5717161", "0.57144344", "0.5710876", "0.5700812", "0.56922144", "0.56922144", "0.5689775", "0.56868756", "0.567937", "0.56643146", "0.56613296", "0.5656456", "0.56561506", "0.56484526", "0.5645994", "0.5622395", "0.56082517", "0.5602747", "0.560004", "0.5599704", "0.5574924", "0.55663353", "0.55631185", "0.5563033", "0.55581284", "0.55544513", "0.5544188", "0.55403847", "0.55366087", "0.5535695", "0.55194384", "0.5512168", "0.55071443", "0.5496613", "0.54963106", "0.5492662", "0.5492266", "0.54773045", "0.5473634", "0.54695404", "0.54688704", "0.54622966", "0.54604185", "0.5457754", "0.545173", "0.54485035", "0.5437768", "0.5434181", "0.54334444", "0.5430859", "0.5425901", "0.5423904", "0.5423594", "0.5419747", "0.541571", "0.5415603", "0.54083025", "0.5405016", "0.53968513", "0.53889644", "0.5383896", "0.5378397", "0.5376259", "0.53734463", "0.53600776", "0.5359969", "0.5358901", "0.5346153", "0.53427494", "0.53406996", "0.534026", "0.53271836", "0.5326034", "0.531966" ]
0.664746
3
Boot function from laravel.
protected static function boot() { parent::boot(); static::created(function ($model) { $notification = self::find($model->id); broadcast(new SiteNotification($notification)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function boot(){\n \\Illuminate\\Foundation\\Application::boot();\n }", "public function boot(){}", "public function boot()\n {\n static::bootMethods();\n }", "public function boot() {\n \n }", "protected static function boot()\n {\n }", "public function boot()\n {}", "public function boot()\n {}", "public function boot(){\n // ...\n }", "public static function bootstrap(){\n //Method inherited from \\Illuminate\\Foundation\\Console\\Kernel \n \\App\\Console\\Kernel::bootstrap();\n }", "public function boot() {\n\n\t\t// Version specific booting\n\t\tswitch($this->version()) {\n\t\t\tcase 4: $this->bootLaravel4(); break;\n\t\t\tcase 5: $this->bootLaravel5(); break;\n\t\t\tcase 6: $this->bootLaravel5(); break;\n\t\t\tdefault: throw new Exception('Unsupported Laravel version');\n\t\t}\n\n\t\t// Register compilers\n\t\t$this->registerHamlCompiler();\n\t\t$this->registerHamlBladeCompiler();\n\n\t\t$customDirectives = $this->app['blade.compiler']->getCustomDirectives();\n\t\tforeach ($customDirectives as $name => $closure) {\n\t\t\t$this->app['Bkwld\\LaravelHaml\\HamlBladeCompiler']->directive($name, $closure);\n\t\t}\t\t\n\t}", "public function boot() {\n\t}", "public function boot() {\n\t}", "public function boot()\n {\n\n if(config('app.env') === 'production') {\n URL::forceScheme('https');\n }\n\n\n View::composer(['user_ver.layouts.app', 'company_ver.layouts.app', 'auth.passwords.app'], function ($view) {\n\n $agent = new Agent();\n\n $device = ($agent->isDesktop()) ? 'pc' : 'mobile';\n\n $main_hd = array(\n \"\",\n \"home\",\n );\n\n $url = explode('?',$_SERVER['REQUEST_URI']);\n $pagename = explode('/',$url[0]);\n \n if(count($pagename) == 2){\n if($pagename[1] == 'login' || $pagename[1] == 'register'){\n $pagename[2] = '-';\n }else{\n $pagename[2] = '';\n }\n }\n\n $view->device = $device;\n $view->main_hd = $main_hd;\n $view->pagename = $pagename;\n $view->main_hd = $main_hd;\n\n return $view;\n\n\n });\n }", "public function boot() {\n //\n }", "public function boot()\n { }", "public function boot()\n { }", "public function boot() {\n\n }", "public function boot ()\n {\n\n }", "public function bootstrap();", "public function bootstrap();", "public function boot()\r\n {\r\n }", "public function boot() {\n //\n }", "public function boot() {\n //\n }", "public function boot() {\n //\n }", "public function boot()\n {\n \n }", "public function boot(): void\n {\n\n }", "protected function bootstrap()\n {\n }", "public function boot()\r\n {\r\n //\r\n }", "public function boot()\r\n {\r\n //\r\n }", "public function boot()\r\n {\r\n //\r\n }", "public function boot()\r\n {\r\n //\r\n }", "public function boot();", "public function boot();", "public function boot();", "public function boot();", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot()\n {\n \n }", "public function boot()\n {\n \n }", "public function boot()\n {\n \n }", "public function boot()\n {\n require app_path('Library/Libs/helper.php');\n require app_path('Library/Libs/models.php');\n }", "public function boot(): void\n {\n View::composer(\n '*', CspViewComposer::class\n );\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot(): void\n {\n }", "public function boot(): void\n {\n }", "public function boot()\n {\n //\n }", "public function boot()\n {\n //\n }", "public function boot()\n {\n //\n }", "public function boot() : void;", "public function boot() {\n\t\t//\n\t}", "public function boot() {\n\t\t//\n\t}", "public function boot()\n {\n\t\t//\n }", "public function boot()\n {\n // Nothing to boot\n }", "protected function boot()\n {\n //Nothing to do here, but you can override this function in child classes.\n }", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n {\n //\n \n }", "public function boot()\r\n\t{\r\n\t\t\r\n\t}", "protected static function boot()\n {\n parent::boot();\n }", "public function boot()\n {\n // date format status\n Blade::directive('datetime', function ($expression) {\n return \"<?php echo date('d/m/Y H:i A', strtotime($expression)); ?>\";\n });\n // Use boostrap pagination\n Paginator::useBootstrap();\n // Shere pages data with pages layout\n View::composer(['layouts.pages'], 'App\\Http\\View\\Composers\\PagesComposer');\n // Share messages data with admin layout\n View::composer(['layouts.admin'], 'App\\Http\\View\\Composers\\MessagesComposer');\n // Shere website data\n View::composer([\n 'layouts.pages',\n 'layouts.admin',\n 'layouts.user',\n 'includes.head',\n 'includes.footer',\n 'includes.admin.head',\n 'pages.home',\n 'pages.download',\n ],\n 'App\\Http\\View\\Composers\\WebsiteDataComposer'\n );\n }", "public function boot(): void;" ]
[ "0.7512592", "0.74421084", "0.7282135", "0.7280009", "0.7258808", "0.72482264", "0.72482264", "0.7225605", "0.72120905", "0.71873945", "0.718641", "0.718641", "0.71708345", "0.7161728", "0.715562", "0.715562", "0.71400213", "0.7130275", "0.71063566", "0.71063566", "0.710567", "0.71041155", "0.71041155", "0.71041155", "0.7103555", "0.71005684", "0.70972025", "0.70927256", "0.70927256", "0.70927256", "0.70927256", "0.7085029", "0.7085029", "0.7085029", "0.7085029", "0.70762324", "0.7066846", "0.7061538", "0.7061538", "0.7061538", "0.7061538", "0.70525223", "0.70525223", "0.70525223", "0.7045031", "0.70449495", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.70291543", "0.7020839", "0.7020839", "0.7018997", "0.7018997", "0.7018997", "0.7018286", "0.70150393", "0.70150393", "0.7004985", "0.70012933", "0.69845724", "0.69730955", "0.69730955", "0.69730955", "0.69652665", "0.6960557", "0.6960279", "0.69561785", "0.6951267" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'tenant_id' => 'required|numeric|exists:tenant,id', 'url' => 'required|url|unique:tenant_domain', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
function to test if a file should be 304 or not.
function caching_headers ($file, $timestamp) { $is_304 = false; if (!$timestamp) { $timestamp = time(); } $gmt_mtime = gmdate('r', $timestamp); header('ETag: "' . md5($timestamp . $file) .'"'); if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmt_mtime) || (isset($_SERVER['HTTP_IF_NONE_MATCH']) && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == md5($timestamp.$file))) { header('HTTP/1.1 304 Not Modified'); $is_304 = true; } } return array( 'time_stamp' => $gmt_mtime, 'is_304' => $is_304 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cond_304($time, $etag = null) {\n header('Status: 304 Not Modified');\n cond_headers($time, $etag);\n}", "protected function serveNotModified($file)\n {\n $oInput = Factory::service('Input');\n if (function_exists('apache_request_headers')) {\n\n $headers = apache_request_headers();\n\n } elseif ($oInput->server('HTTP_IF_NONE_MATCH')) {\n\n $headers = array();\n $headers['If-None-Match'] = $oInput->server('HTTP_IF_NONE_MATCH');\n\n } elseif (isset($_SERVER)) {\n\n /**\n * Can we work the headers out for ourself?\n * Credit: http://www.php.net/manual/en/function.apache-request-headers.php#70810\n **/\n\n $headers = array();\n $rxHttp = '/\\AHTTP_/';\n foreach ($_SERVER as $key => $val) {\n\n if (preg_match($rxHttp, $key)) {\n\n $arhKey = preg_replace($rxHttp, '', $key);\n $rxMatches = array();\n\n /**\n * Do some nasty string manipulations to restore the original letter case\n * this should work in most cases\n **/\n\n $rxMatches = explode('_', $arhKey);\n\n if (count($rxMatches) > 0 && strlen($arhKey) > 2) {\n\n foreach ($rxMatches as $ak_key => $ak_val) {\n $rxMatches[$ak_key] = ucfirst($ak_val);\n }\n\n $arhKey = implode('-', $rxMatches);\n }\n\n $headers[$arhKey] = $val;\n }\n }\n\n } else {\n\n // Give up.\n return false;\n }\n\n if (isset($headers['If-None-Match']) && $headers['If-None-Match'] == '\"' . md5($file) . '\"') {\n\n header($oInput->server('SERVER_PROTOCOL') . ' 304 Not Modified', true, 304);\n return true;\n }\n\n // --------------------------------------------------------------------------\n\n return false;\n }", "public function notModified()\n\t{\n\t\t$protocol = filter_input(INPUT_SERVER, \"SERVER_PROTOCOL\");\n\t\t$this->header($protocol .\" 304 Not Modified\");\n\t\t$this->app->quit();\n\t}", "function send_modified_header($mdate, $etag=null, $skip_check=false)\n{\n if (headers_sent())\n return;\n \n $iscached = false;\n $etag = $etag ? \"\\\"$etag\\\"\" : null;\n\n if (!$skip_check)\n {\n if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)\n $iscached = true;\n \n if ($etag)\n $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);\n }\n \n if ($iscached)\n header(\"HTTP/1.x 304 Not Modified\");\n else\n header(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $mdate).\" GMT\");\n \n header(\"Cache-Control: private, must-revalidate, max-age=0\");\n header(\"Expires: \");\n header(\"Pragma: \");\n \n if ($etag)\n header(\"Etag: $etag\");\n \n if ($iscached)\n {\n ob_end_clean();\n exit;\n }\n}", "function cond_maybe_respond($time, $etag = null) {\n\n if (!array_key_exists('REQUEST_METHOD', $_SERVER)\n && $_SERVER['REQUEST_METHOD'] != 'GET'\n && $_SERVER['REQUEST_METHOD'] != 'HEAD')\n return false;\n\n $check_etag = (isset($etag) && array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER));\n $check_ims = (isset($time) && array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER));\n\n if ($check_etag && $check_ims) {\n if (cond_if_modified_since($time) && cond_if_none_match($etag)) {\n\t cond_304($time, $etag);\n\t return true;\n\t}\n } elseif ($check_etag) {\n if (cond_if_none_match($etag)) {\n\t cond_304($time, $etag);\n\t return true;\n\t}\n } elseif ($check_ims) {\n if (cond_if_modified_since($time)) {\n cond_304($time, $etag);\n return true;\n }\n }\n \n return false;\n}", "public function checkNotModified(CakeRequest $request) {\n\t\t$etags = preg_split('/\\s*,\\s*/', $request->header('If-None-Match'), null, PREG_SPLIT_NO_EMPTY);\n\t\t$modifiedSince = $request->header('If-Modified-Since');\n\t\tif ($responseTag = $this->etag()) {\n\t\t\t$etagMatches = in_array('*', $etags) || in_array($responseTag, $etags);\n\t\t}\n\t\tif ($modifiedSince) {\n\t\t\t$timeMatches = strtotime($this->modified()) === strtotime($modifiedSince);\n\t\t}\n\t\t$checks = compact('etagMatches', 'timeMatches');\n\t\tif (empty($checks)) {\n\t\t\treturn false;\n\t\t}\n\t\t$notModified = !in_array(false, $checks, true);\n\t\tif ($notModified) {\n\t\t\t$this->notModified();\n\t\t}\n\t\treturn $notModified;\n\t}", "public function isExpired(): bool\n {\n if (!FS::isFile($this->resultFile)) {\n return true;\n }\n\n $fileAge = \\time() - (int)\\filemtime($this->resultFile);\n $fileAge = \\abs($fileAge);\n\n if ($fileAge >= $this->cacheTtl) {\n return true;\n }\n\n $firstLine = \\trim((string)FS::firstLine($this->resultFile));\n $expected = \\trim($this->getHeader());\n\n return $expected !== $firstLine;\n }", "function getFile($url, $filename) {\n if (file_exists($filename)) {\n $local = strtotime(date(\"F d Y H:i:s.\", filemtime($filename)));\n $headers = get_headers($url, 1);\n $remote = strtotime($headers[\"Last-Modified\"]);\n \n if ($local < $remote) {\n file_put_contents($filename, file_get_contents($url));\n }\n }\n else {\n $file_contents = file_get_contents($url);\n if ($file_contents)\n file_put_contents($filename, file_get_contents($url));\n } \n}", "public function isSuccessful(): bool\n {\n $statusCode = $this->getStatusCode();\n\n return ($statusCode >= 200 && $statusCode < 300) || $statusCode == 304;\n }", "function check_cache ( $url ) {\n $this->ERROR = \"\";\n $filename = $this->file_name( $url );\n \n if ( file_exists( $filename ) ) {\n // find how long ago the file was added to the cache\n // and whether that is longer then MAX_AGE\n $mtime = filemtime( $filename );\n $age = time() - $mtime;\n if ( $this->MAX_AGE > $age ) {\n // object exists and is current\n return 'HIT';\n }\n else {\n // object exists but is old\n return 'STALE';\n }\n }\n else {\n // object does not exist\n return 'MISS';\n }\n }", "private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }", "private function check_cache()\n\t{\n\t\t$cache_file = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t$this->skip = FALSE;\n\t\t\n\t\tif (is_file($cache_file))\n\t\t{\n\t\t\t// touch file. helps determine if template was modified\n\t\t\ttouch($cache_file);\n\t\t\t// check if template has been mofilemtime($cache_file)dified and is newer than cache\n\t\t\t// allow $cache_time difference\n\t\t\tif ((filemtime($this->file)) > (filemtime($cache_file)+$this->cache_time))\n\t\t\t\t$this->skip = TRUE;\n\t\t}\n\t\t\n\t\treturn $cache_file;\n\t}", "function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }", "function check_send_etag($branch, $what=null)\n{\n\t$etag = get_etag($branch, $what);\n\n\t// process If-None-Match header used to poll running script results\n\tif (isset($_SERVER['HTTP_IF_NONE_MATCH']) && substr($_SERVER['HTTP_IF_NONE_MATCH'], 1, -1) == $etag)\n\t{\n\t\theader('HTTP/1.1 304 Not Modified');\n\t\texit;\n\t}\n\theader('ETag: \"'.$etag.'\"');\n\n\treturn $etag;\n}", "function httpcache_by_lastupdate($modif_time = -1) {\r\n // If the last modified date on web browser equals the server, then return HTTP 304 response without body.\r\n // http://www.web-caching.com/mnot_tutorial/how.html\r\n if ($modif_time == -1) {\r\n global $app;\r\n $modif_time = $app['last-modified'];\r\n }\r\n\r\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and gmdate('D, d M Y H:i:s', $modif_time).' GMT' == trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {\r\n header('HTTP/1.0 304 Not Modified');\r\n header('Content-Length: 0');\r\n exit();\r\n }\r\n header('Last-Modified: '.gmdate('D, d M Y H:i:s',$modif_time).' GMT');\r\n}", "public function getAssetFileLastModified()\n {\n if ($this->isAssetFilePathUrl()) {\n if (\n //Retrieve headers\n ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))\n //Assert return is OK\n && strstr($aHeaders[0], '200') !== false\n //Retrieve last modified as DateTime\n && !empty($aHeaders['Last-Modified']) && $oLastModified = new \\DateTime($aHeaders['Last-Modified'])\n ) {\n return $oLastModified->getTimestamp();\n } else {\n $oCurlHandle = curl_init($sAssetFilePath);\n curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);\n curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($oCurlHandle, CURLOPT_FILETIME, true);\n if (curl_exec($oCurlHandle) === false) {\n return null;\n }\n return curl_getinfo($oCurlHandle, CURLINFO_FILETIME) ? : null;\n }\n } else {\n \\Zend\\Stdlib\\ErrorHandler::start();\n $iAssetFileFilemtime = filemtime($this->getAssetFilePath());\n \\Zend\\Stdlib\\ErrorHandler::stop(true);\n return $iAssetFileFilemtime ? : null;\n }\n }", "function urlOK($url)\n{\n $headers = @get_headers($url);\n if(strpos($headers[0],'200')===false){return false;}else{return true;}\n}", "public static function validate_cache(int $last_mod, ?string $etag = null): bool {\n\n\t\tif (isset($_SERVER[\"HTTP_IF_NONE_MATCH\"]) && $etag !== null) {\n\t\t\treturn EntityTag::header_list_weak_match($_SERVER[\"HTTP_IF_NONE_MATCH\"], $etag);\n\t\t} else if (isset($_SERVER[\"HTTP_IF_MODIFIED_SINCE\"])) {\n\t\t\t$if_mod_since = Utils::parse_http_header_date($_SERVER[\"HTTP_IF_MODIFIED_SINCE\"]);\n\t\t\treturn $if_mod_since !== false && $last_mod <= $if_mod_since;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isUpdateRequired()\n {\n $CacheCreated = filemtime($this->cachedPath);\n $CacheRenewal = $CacheCreated + $this->CacheLife;\n if(time() >= $CacheRenewal)\n return true;\n else\n return false;\n }", "function _cacheFileExpired($sFile) {\n // Use setting to check age of files.\n $iCacheDays = $this->cache_days + 0;\n\n // dont update image once it is cached\n if ($iCacheDays == 0 && file_exists($sFile)) {\n return false;\n // check age of file and if file exists return false, otherwise recache the file\n } else {\n $iCutoff = time() - (3600 * 24 * $iCacheDays);\n return (!file_exists($sFile) || filemtime($sFile) <= $iCutoff);\n }\n }", "public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }", "public function notModified() {\n\t\t$this->statusCode(304);\n\t\t$this->body('');\n\t\t$remove = array(\n\t\t\t'Allow',\n\t\t\t'Content-Encoding',\n\t\t\t'Content-Language',\n\t\t\t'Content-Length',\n\t\t\t'Content-MD5',\n\t\t\t'Content-Type',\n\t\t\t'Last-Modified'\n\t\t);\n\t\tforeach ($remove as $header) {\n\t\t\tunset($this->_headers[$header]);\n\t\t}\n\t}", "public function is_cached($file_name){\n\t\t\n\t\t$file_name = $this->path . $file_name;\n\t\tif(file_exists($file_name) && (filemtime($file_name) + $this->cache_time >= time())) return true;\t\n\n\t\treturn false;\n\t}", "protected function _modified_headers($last_modified)\n {\n $modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))\n ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE'])\n : FALSE;\n\n if ( ! $modified_since OR $modified_since != $last_modified)\n return;\n\n // Nothing has changed since their last request - serve a 304 and exit\n header('HTTP/1.1 304 Not Modified');\n header('Connection: close');\n exit();\n }", "function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }", "public function mtime() {\n return false;\n }", "private function isCacheOld($cacheFile) {\n\t\t// time now - cache lifetime\n\t\t$goodTime = time() - ($this->expiry * 60);\n\t\t$cacheAge = filemtime($cacheFile);\n\t\t// return TRUE if file age 'within' good time\n\t\treturn ($goodTime < $cacheAge) ? FALSE : TRUE;\n\t}", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "function wplastfm_update($file, $src) {\r\n global $wplastfm_options;\r\n \r\n if (time()-$wplastfm_options['cache'] > @filemtime($file)) {\r\n $data = wplastfm_get_recenttracks($src);\r\n if (!empty($data)) {\r\n $handle = fopen($file, \"w\");\r\n fwrite($handle, $data);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public function hasLastModifiedMs()\n {\n return $this->LastModifiedMs !== null;\n }", "public function checkModified($timestamp)\n {\n\n $sourceFilePath = $this->getData($this->code . '_file_path');\n\n if (!$this->metadata) {\n $this->metadata = $this->getMetadata($sourceFilePath);\n }\n\n $modified = strtotime($this->metadata['client_modified']);\n\n return ($timestamp != $modified) ? $modified : false;\n }", "function is_cached($filename, $cachetime = false) {\n\t$cachetime = (!$cachetime ? strtotime(\"-1 day\") : $cachetime);\n\treturn (file_exists($filename) && filemtime($filename) > $cachetime);\n}", "public function isExpired()\n\t{\n\t\tif ($this->lastModified) {\n\t\t\t$modifiedHeader = filter_input(INPUT_SERVER, \"HTTP_IF_MODIFIED_SINCE\");\n\t\t\t$modified = strtotime($modifiedHeader) !== $this->lastModified;\n\t\t\t\n\t\t\treturn $modified;\n\t\t}\n\t\t\n\t\tif ($this->expires) {\n\t\t\t$now = new \\DateTime();\n\t\t\treturn $now > $this->expires;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function getIfModifiedSince() {\n if (isset($this->ifModifiedSince)) {\n return $this->ifModifiedSince;\n }\n\n $header = $this->getHeader(Header::HEADER_IF_MODIFIED_SINCE);\n if (!$header) {\n return $this->ifModifiedSince = null;\n }\n\n return $this->ifModifiedSince = Header::parseTime($header);\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}", "protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }", "public function checkMarkFile( ){\n if( isset( $GLOBALS['config']['dir_database'] ) && is_file( $GLOBALS['config']['dir_database'].'database-last-modification' ) && ( time( ) - file_get_contents( $GLOBALS['config']['dir_database'].'database-last-modification' ) ) <= 1 ){\n return false;\n }\n else\n return true;\n }", "public function isCached($key)\n {\n if (!is_readable($this->path . '/' . $key)) {\n return false;\n }\n if(!is_null($this->duration)) {\n $now = time();\n $expires = $this->duration * 60 * 60;\n $fileTime = filemtime($this->path . '/' . $key);\n if (($now - $expires) < $fileTime) {\n return false;\n }\n }\n return true;\n }", "protected function isCached($file){\n $cache = $this->cacheName($file);\n return !empty($this->cache) \n && is_readable($cache) \n && ($this->no_update || filemtime($file) < filemtime($cache));\n }", "function _bellcom_check_if_file_in_url_exists($file_url) {\n $file_headers = @get_headers($file_url);\n\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n return FALSE;\n }\n else {\n return TRUE;\n }\n}", "public function cacheCheck(){\n \n if(file_exists($this->cacheName)){\n\t \n $cTime = intval(filemtime($this->cacheName));\n \n if( $cTime + $this->cacheTime > time() ) {\n\t \n echo file_get_contents( $this->cacheName );\n \n ob_end_flush();\n \n exit;}\t\t\t\t\t\n \n \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n return false;\n \n}", "public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}", "function http_send_last_modified($timestamp = null) {}", "public function testHas()\n {\n $this->assertFalse(self::$cache->has('Potato'), 'Has does not return false on missing file.');\n\n //Test with expired date\n self::$cache->set('Toaster', 'Test', -5);\n\n $this->assertFalse(self::$cache->has('Toaster'), 'File not counted as expired by Has.');\n\n //Test with okay file\n self::$cache->set('Toaster', 'Test', 5);\n\n $this->assertTrue(self::$cache->has('Toaster'), 'Has did not take into acount that the file is there.');\n }", "public function is_cachable()\n {\n $h = $this->server_reply_headers;\n\n if (isset($h['Content-Range']) && substr($h['Content-Range'],0,strlen(\"bytes 0-\"))!=\"bytes 0-\") {\n $this->log(1,__FUNCTION__,\"Uncachable: Content-Range header is present: [{$h['Content-Range']}].\");\n return FALSE;\n }\n\n if (!isset($h['Content-Type'])) {\n $this->log(1,__FUNCTION__,\"Uncachable: No Content-Type header.\");\n return FALSE;\n }\n else if (strncasecmp($h['Content-Type'], 'video/', 6)) {\n $this->log(1,__FUNCTION__,\"Uncachable: Content-Type is not video: [{$h['Content-Type']}].\");\n return FALSE;\n }\n\n if (!isset($h['Content-Length'])) {\n $this->log(1,__FUNCTION__,\"Uncachable: No Content-Length header.\");\n return FALSE;\n }\n\n if ($this->cache_request==\"\") {\n $this->log(2,__FUNCTION__,\"EMPTY request, original url [{$this->original_url}]\");\n return FALSE;\n }\n \n if (isset($this->parsed_url['begin']) && (int)$this->parsed_url['begin']>0) {\n //\n // The user is not downloading the whole video, but seeking within it.\n // TODO How to deal with this?\n // Maybe nginx's FLV module could help.\n //\n $this->log(1,__FUNCTION__,\"Uncachable: begin is set: [{$this->parsed_url['begin']}]\");\n return FALSE;\n }\n \n if ($this->parsed_url['sver'] != '3') {\n //\n // Stream Version?\n //\n // All requests seem to have this field set to the number 3.\n // If this ever changes, we should look at the new requests to make\n // sure that they are still compatible with this script.\n //\n $this->log(2,__FUNCTION__,\"Uncachable: sver is not 3: [{$this->parsed_url['sver']}]\");\n return FALSE;\n }\n \n return TRUE;\n }", "public function cache_is_obsolete($delete_if_obsolete = TRUE)\n {\n if (!$this->cache_exists())\n {\n return TRUE;\n }\n\n $is_obsolete = FALSE;\n\n foreach ($this->assets AS $asset)\n {\n if ($asset->is_cachable())\n {\n\n if ($asset->cache_is_obsolete())\n {\n\n $is_obsolete = TRUE;\n }\n }\n }\n\n // validate cache head\n $filename = $this->cache_filename();\n $destination = self::$_config_defaults[$this->_type]['cache']['dir'] . $filename;\n\n // read control file\n $lines = file($destination . '.control', FILE_IGNORE_NEW_LINES);\n\n foreach ($lines AS $line)\n {\n if (!$line)\n {\n continue;\n }\n try\n {\n $pieces = explode('-', $line);\n\n if (!isset($pieces[1]))\n {\n continue;\n }\n\n foreach ($this->assets AS $asset)\n {\n if ($pieces[0] == $asset->get('hash'))\n {\n if ($asset->is_cachable())\n {\n if ($pieces[1] < $asset->cache_get('date_modified'))\n {\n $is_obsolete = TRUE;\n }\n }\n }\n }\n } catch (Exception $e)\n {\n throw new Kohana_Exception($e);\n }\n }\n\n // delete cache if necessary\n if ($is_obsolete && $delete_if_obsolete)\n {\n $this->cache_delete();\n }\n\n return $is_obsolete;\n }", "function cond_headers($time, $etag = null) {\n if (isset($time))\n header('Last-Modified: ' . gmstrftime('%a, %d %b %Y %H:%M:%S GMT', $time));\n if (isset($etag))\n header('ETag: W/' . cond_quote_etag($etag));\n}", "private function isUpdated($viewFile,$cacheFile) {\n\t\tif (file_exists($cacheFile)) {\n\t\t\t$cacheMTime = filemtime($cacheFile);\n\t\t\t$fileMTime = filemtime($viewFile);\n\t\t\treturn ($cacheMTime<$fileMTime);\n\t\t}\n\t\treturn true;\n\t}", "public function getModifiedTime()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filemtime($this->_path);\n\t}", "public function hasCacheFile($image)\r\n\t{\r\n\t\t$image = $this->getCachePath().$image.self::IMAGE_FILE_EXTENSION;\r\n\t\tif(file_exists($image))\r\n\t\t{\r\n\t\t\tif(filemtime($image) < TIME - $this->getConfig()->getChildren(\"cache\")->getInteger(\"expires\"))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isExpired($name, $filename);", "#[Pure]\nfunction http_cache_last_modified($timestamp_or_expires = null) {}", "public static function _lastModified($time) {\n self::response()->header('Last-Modified', date(DATE_RFC1123, $time));\n\n if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) === $time) {\n self::halt(304);\n }\n }", "public static function getLastModified() {}", "protected function _noChange()\n\t{\n\t\t$app = JFactory::getApplication();\n\n\t\t// Send not modified header and exit gracefully\n\t\theader('HTTP/1.x 304 Not Modified', true);\n\t\t$app->close();\n\t}", "function remote_file_exists($source, $extra_mile = 0) {# # EXTRA MILE = 1////////////////////////////////// Is it an image?\n if ($extra_mile === 1) {\n $img = @getimagesize($source);\n if (!$img)\n return 0;\n else {\n switch ($img[2]) {\n case 0: return 0;\n break;\n case 1:return $source;\n break;\n case 2:return $source;\n break;\n case 3:return $source;\n break;\n case 6:return $source;\n break;\n default:return 0;\n break;\n }\n }\n } else {\n if (@FClose(@FOpen($source, 'r')))\n return 1;\n else\n return 0;\n }\n }", "function remote_file_exists( $source, $extra_mile = 0 ) {\r\n ////////////////////////////////// Does it exist? \r\n # EXTRA MILE = 1 \r\n ////////////////////////////////// Is it an image? \r\n \r\n if ( $extra_mile === 1 ) { \r\n $img = @getimagesize($source); \r\n \r\n if ( !$img ) return 0; \r\n else \r\n { \r\n switch ($img[2]) \r\n { \r\n case 0: \r\n return 0; \r\n break; \r\n case 1: \r\n return $source; \r\n break; \r\n case 2: \r\n return $source; \r\n break; \r\n case 3: \r\n return $source; \r\n break; \r\n case 6: \r\n return $source; \r\n break; \r\n default: \r\n return 0; \r\n break; \r\n } \r\n } \r\n } \r\n else \r\n { \r\n if (@FClose(@FOpen($source, 'r'))) \r\n return 1; \r\n else \r\n return 0; \r\n } \r\n }", "function expired() {\r\n if(!file_exists($this->cachefile)) return true;\r\n # compare new m5d to existing cached md5\r\n elseif($this->hash !== $this->get_current_hash()) return true;\r\n else return false;\r\n }", "public function It_should_be_able_to_skip_when_there_is_no_response_entity_body()\n\t{\n\t\t$response = $this->buildResponse( 304, array(), 'gzip' );\n\t\t\n\t\t$this->assertEquals( 304, $response[ 0 ] );\n\t\t$this->assertEquals( array(), $response[ 1 ] );\n\t\t$this->assertEquals( array(), $response[ 2 ] );\n\t}", "public function wasModified()\n\t{\n\t\tif ($this->get('modified') && $this->get('modified') != '0000-00-00 00:00:00')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "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}", "public function isFileModified($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '-m', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files -m --error-unmatch` command didn't find the given file among modified files and has\n\t\t\t\t// yelled an error number 1. This exception can be considered normal. We can just report that the file is\n\t\t\t\t// not modified and continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file is modified.\n\t\treturn true;\n\t}", "public function VerificaCache($filename) {\n\t\t$caminho = '../cache_dia/';\n\t\t$filename = $caminho.$filename;\n\t\tif (file_exists($filename)) {\n\t\t\t$data_arquivo = date (\"d\", filemtime($filename));\n\t\t\tif($data_arquivo != date('d')){\n\t\t\t\tunlink($filename);\n\t\t\t}\t\n\t\t}\n\t\tif($data_arquivo != date('d')) return false;\n\t\telse return true;\n\t}", "public function getModified($file);", "public function checkFileStatus(){\n\t\tclearstatcache(true,$this->filePath); // clear cache\n\t\t// create file\n\t\tif(!$this->existed && file_exists($this->filePath)){\n\t\t\t$this->existed = true;\n\t\t\t$this->lastModifiedDate = filemtime($this->filePath);\n\t\t\treturn new FileEvent($this,FileEvent::CREATED,'created');\n\t\t}\n\t\t// delete file\n\t\tif($this->existed && !file_exists($this->filePath)){\n\t\t\t$this->existed = false;\n\t\t\treturn new FileEvent($this,FileEvent::DELETED,'deleted');\n\t\t}\n\t\t// modify file\n\t\tif($this->existed && $this->isModified()){\n\t\t\t$this->lastModifiedDate = filemtime($this->filePath);\n\t\t\treturn new FileEvent($this,FileEvent::CHANGED,'changed');\n\t\t}\n\t\treturn '';\n\t\t//return new FileEvent($this,FileEvent::UNCHANGED,'unchanged');\n\t}", "public function isAlreadyDownloaded(): bool\n {\n return file_exists($this->getFilePath());\n }", "public function dirty()\n\t{\n\t\tif ( ! $this->app['files']->exists($this->cacheFilePath))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function check_cache($cachefile, $cachetime)\n\t{\n\t\t$cachefile = $this->folder . $cachefile . '.html';\n\t\tif (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function wasCached();", "public static function isResponseCacheable(Google_HttpRequest $resp) {\n // First, check if the HTTP request was cacheable before inspecting the\n // HTTP response.\n if (false == self::isRequestCacheable ( $resp )) {\n return false;\n }\n\n $code = $resp->getResponseHttpCode ();\n if (! in_array ( $code, self::$CACHEABLE_STATUS_CODES )) {\n return false;\n }\n\n // The resource is uncacheable if the resource is already expired and\n // the resource doesn't have an ETag for revalidation.\n $etag = $resp->getResponseHeader ( \"etag\" );\n if (self::isExpired ( $resp ) && $etag == false) {\n return false;\n }\n\n // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT\n // store any part of either this response or the request that elicited it.\n $cacheControl = $resp->getParsedCacheControl ();\n if (isset ( $cacheControl ['no-store'] )) {\n return false;\n }\n\n // Pragma: no-cache is an http request directive, but is occasionally\n // used as a response header incorrectly.\n $pragma = $resp->getResponseHeader ( 'pragma' );\n if ($pragma == 'no-cache' || strpos ( $pragma, 'no-cache' ) !== false) {\n return false;\n }\n\n // [rfc2616-14.44] Vary: * is extremely difficult to cache. \"It implies that\n // a cache cannot determine from the request headers of a subsequent request\n // whether this response is the appropriate representation.\"\n // Given this, we deem responses with the Vary header as uncacheable.\n $vary = $resp->getResponseHeader ( 'vary' );\n if ($vary) {\n return false;\n }\n\n return true;\n }", "protected function isCached(): bool\n {\n $cacheTime = self::CACHE_TIME * 60;\n\n if (!is_file($this->pathCache)) {\n return false;\n }\n\n $cachedTime = filemtime($this->pathCache);\n $cacheAge = $this->time - $cachedTime;\n\n return $cacheAge < $cacheTime;\n }", "private static function lastModificationDate($file = null, $content = null)\n\t{\n\t\t$last_modified_time = $file ? filemtime($file) : mktime();\n\t\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $last_modified_time).\" GMT\");\n\t\tif( is_null($file) || (Common::getExtention($file) == 'php' && !self::$activateCache) || Client::isOldMSIE() )\n\t\t{\n\t\t\theader(\"Cache-Control: no-cache, must-revalidate\");\n\t\t\theader(\"Pragma: no-cache\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Expires: \" . gmdate(\"D, d M Y H:i:s\", filemtime($file) + 3600) . \" GMT\");\n\t\t\theader(\"Cache-Control: public\");\n\t\t\t\n\t\t\t// Additional stuff: force the cache to be activated !!!!\n\t\t\t$etag = md5($content);\n\t\t\tif( @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag )\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.1 304 Not Modified\"); // File cached !!! No need to re-sent it !\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "public function isModified(): bool;", "public function hasACacheableStatus()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n if (($http_status = (string) $this->httpStatus()) && $http_status[0] !== '2' && $http_status !== '404') {\n return $is = false; // A non-2xx & non-404 status code.\n }\n foreach ($this->headersList() as $_key => $_header) {\n if (!preg_match('/^(?:Retry\\-After\\:\\s+(?P<retry>.+)|Status\\:\\s+(?P<status>[0-9]+)|HTTP\\/[0-9]+(?:\\.[0-9]+)?\\s+(?P<http_status>[0-9]+))/ui', $_header, $_m)) {\n continue; // Not applicable; i.e., Not a header that is worth checking here.\n } elseif (!empty($_m['retry']) || (!empty($_m['status']) && $_m['status'][0] !== '2' && $_m['status'] !== '404')\n || (!empty($_m['http_status']) && $_m['http_status'][0] !== '2' && $_m['http_status'] !== '404')) {\n return $is = false; // Not a cacheable status.\n }\n } // unset($_key, $_header, $_m); // Housekeeping.\n\n return $is = true;\n }", "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 isCached(): bool;", "public function validateUpdate()\n\t{\n\t\tBlocks::log('Validating MD5 for '.$this->_downloadFilePath, \\CLogger::LEVEL_INFO);\n\t\t$sourceMD5 = IOHelper::getFileName($this->_downloadFilePath, false);\n\n\t\t$localMD5 = IOHelper::getFileMD5($this->_downloadFilePath);\n\n\t\tif ($localMD5 === $sourceMD5)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function lastModified();", "public function lastModified();", "function checkExternalFile($url)\n{\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_exec($ch);\n $retCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return $retCode;\n}", "public static function getRemoteFileMTime($uri) {\n if (file_exists($uri)) {\n return filemtime($uri);\n }\n\n $uri = parse_url($uri);\n $handle = @fsockopen($uri['host'], 80);\n if (!$handle) {\n return 0;\n }\n\n fputs($handle, \"HEAD $uri[path] HTTP/1.1\\r\\nHost: $uri[host]\\r\\n\\r\\n\");\n $result = 0;\n while (!feof($handle)) {\n $line = fgets($handle, 1024);\n if (!trim($line)) {\n break;\n }\n\n $col = strpos($line, ':');\n if ($col !== false) {\n $header = trim(substr($line, 0, $col));\n $value = trim(substr($line, $col + 1));\n if (strtolower($header) == 'last-modified') {\n $result = strtotime($value);\n break;\n }\n }\n }\n fclose($handle);\n return $result;\n }", "public function get_timestamp() {\n\n\t\tif ( file_exists( $this->get_path( 'file' ) ) ) {\n\t\t\treturn filemtime( $this->get_path( 'file' ) );\n\t\t}\n\t\treturn false;\n\t}", "public function isCached() {}", "public function needs_Update_timestamp($Path_To_Cache,$Path_To_File)\r\n\t\t\t{\r\n\t\t\t\t$Display = new sql();\r\n\t\t\t\t$sql = 'SELECT * FROM updates';\r\n\t\t\t\t$result = $Display->Display_Info($sql);\r\n\t\t\t\tforeach($result as $rows)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$TimeStamp = strtotime($rows->TimeStamp);\r\n\t\t\t\t\t}\r\n\t\t\t\tif(file_exists($Path_To_Cache) && ($TimeStamp < filemtime($Path_To_Cache)))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t}", "function headers_sent(&$file, &$line)\n{\n if (MockHttp::$headers_sent) {\n $file = __FILE__;\n $line = __LINE__;\n return true;\n } else {\n return false;\n }\n}", "protected function _lockIsExpired()\n {\n $varDir = Mage::getConfig()->getVarDir('locks');\n $file = $varDir . DS . 'buckaroo_process_'.$this->getId().'.lock';\n\n if(!is_file($file)){\n $fp = fopen($file, 'x');\n fwrite($fp, date('r'));\n fclose($fp);\n return false;\n }\n\n\n $fiveMinAgo = time() - 300;//300\n $contents = file_get_contents($file);\n $time = strtotime($contents);\n $debug = 'current contents: '.$contents . \"\\n\"\n . 'contents in timestamp: '.$time . \"\\n\"\n . '5 minutes ago in timestamp: '.$fiveMinAgo;\n\n if($time <= $fiveMinAgo){\n $fp = fopen($file, 'w');\n flock($fp, LOCK_UN);\n return true;\n }\n\n return false;\n }", "function cacheObjectTimedOut ()\n {\n if ($this->cacheObjectExists()) {\n if (time() - filemtime($this->cacheObjectId) > $this->timeout) {\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = TRUE;\n }\n\n return $return;\n }", "public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function is_new_data() {\n $rv = FALSE;\n if ($this->is_remote($this->url)) {\n $ts_standard = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_COUNTIES);\n }\n else {\n $ts_standard = filemtime($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = filemtime($this->url . FileFetcher::FILE_COUNTIES);\n }\n $ts = 0;\n if ($this->last_fetch == '' || $ts_standard > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_standard;\n }\n if ($this->last_fetch == '' || $ts_counties > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_counties;\n }\n if ($rv) {\n update_option(\"hecc_standard_last_update_datetime\", $ts);\n }\n return $rv;\n }", "private function isCacheExpired(): bool\n\t{\n\t\t$path = $this->_cacheFolder . $this->generateCacheName();\n\t\tif (file_exists($path)) {\n\t\t\t$filetime = filemtime($path);\n\t\t\treturn $filetime < (time() - $this->_cacheTtl);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public static function isUpdateSourceFileAvailable( $forcedUpdate = false ) {\n $now = time();\n if ( ! $forcedUpdate ) {\n $lastFetched = FileUtils::readCookie( self::COOKIE_LAST_FETCH_RIVM );\n $lastChecked = FileUtils::readCookie( self::COOKIE_LAST_CHECK_RIVM );\n if ( date('j',$now) == date('j',$lastFetched ) ) return false; // only one update each day.\n $hour = date('H',$now);\n if( $hour > 13 && $hour < 16 ) { //updates usually appear in this time slot.\n $checkInterval = 180; // 60*3 is three minutes \n } else {\n $checkInterval = 1800; // 60*30 is half hour \n }\n if ( ( $now - $lastChecked ) < $checkInterval ) return false; \n }\n\n // Do the check\n FileUtils::writeCookie( self::COOKIE_LAST_CHECK_RIVM, $now );\n $headers = get_headers( self::RIVM_REMOTE_SOURCE_CSV_FILE, 1 );\n //Convert the array keys to lower case to prevent possible mistakes\n $headers = array_change_key_case( $headers );\n $remoteFileSize = false;\n if( isset( $headers['content-length'] ) ) {\n $remoteFileSize = $headers['content-length'];\n }\n $localFileSize = ( file_exists( self::RIVM_SOURCE_CSV_FILE ) ) ? filesize( self::RIVM_SOURCE_CSV_FILE ) : false;\n return ( $remoteFileSize !== false && ( $remoteFileSize > $localFileSize ) ) ? true : false;\n }", "function urlfiledate($url){\n if (file_exists($url)){\n $aktuell = date(\"Y-m-d H:i:s\",filemtime($url));\n } else {\n $aktuell = date(\"Y-m-d H:i:s\");\n } \n return $aktuell;\n}", "protected function isCacheFileExpired($filename, $min_days)\n\t{\n\t\tif(!$mtime = @filemtime($filename)) return false;\n\t\tif(($mtime + (60 * 60 * 24 * $min_days)) < time()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function matchesCache($lastModified): bool\n {\n return @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'] ?? '') === $lastModified;\n }", "private static function hasCacheFile() {\r\n if (!isset(self::$_hasCacheFile)) {\r\n self::$_hasCacheFile = File::exists(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n }\r\n return self::$_hasCacheFile;\r\n }", "protected function serveFileResumable ($uri) {\n if (!file_exists($file)) {\n header(\"HTTP/1.1 404 Not Found\");\n exit;\n }\n\n $fileTime = filemtime($file);\n\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))\n {\n error_log('we did get the http if modiefed...');\n if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $fileTime)\n {\n error_log('and we answered, not modified');\n header('HTTP/1.0 304 Not Modified');\n exit;\n }\n else\n {\n error_log('and we answered, yes modified, continue loading.');\n }\n } \n\n\n\n\n\n\n\n // Get the 'Range' header if one was sent\n if (isset($_SERVER['HTTP_RANGE'])) \n {\n $range = $_SERVER['HTTP_RANGE']; // IIS/Some Apache versions\n }\n else \n {\n $range = FALSE; // We can't get the header/there isn't one set\n }\n\n // Get the data range requested (if any)\n $filesize = filesize($file);\n if ($range) {\n $partial = true;\n list($param,$range) = explode('=',$range);\n if (strtolower(trim($param)) != 'bytes') { // Bad request - range unit is not 'bytes'\n header(\"HTTP/1.1 400 Invalid Request\");\n exit;\n }\n $range = explode(',',$range);\n $range = explode('-',$range[0]); // We only deal with the first requested range\n if (count($range) != 2) { // Bad request - 'bytes' parameter is not valid\n header(\"HTTP/1.1 400 Invalid Request\");\n exit;\n }\n if ($range[0] === '') { // First number missing, return last $range[1] bytes\n $end = $filesize - 1;\n $start = $end - intval($range[0]);\n } else if ($range[1] === '') { // Second number missing, return from byte $range[0] to end\n $start = intval($range[0]);\n $end = $filesize - 1;\n } else { // Both numbers present, return specific range\n $start = intval($range[0]);\n $end = intval($range[1]);\n if ($end >= $filesize || (!$start && (!$end || $end == ($filesize - 1)))) $partial = false; // Invalid range/whole file specified, return whole file\n }\n $length = $end - $start + 1;\n } else $partial = false; // No range requested\n\n header('Accept-Ranges: bytes');\n\n // if requested, send extra headers and part of file...\n if ($partial) {\n header('Content-Length: '.$length);\n header('HTTP/1.1 206 Partial Content');\n header(\"Content-Range: bytes $start-$end/$filesize\");\n if (!$fp = fopen($file, 'r')) { // Error out if we can't read the file\n header(\"HTTP/1.1 500 Internal Server Error\");\n exit;\n }\n if ($start) fseek($fp,$start);\n while ($length) { // Read in blocks of 8KB so we don't chew up memory on the server\n $read = ($length > 8192) ? 8192 : $length;\n $length -= $read;\n print(fread($fp,$read));\n }\n fclose($fp);\n } else \n {\n header('Content-Length: '.$filesize);\n readfile($file); // ...otherwise just send the whole file\n }\n\n // Exit here to avoid accidentally sending extra content on the end of the file\n exit;\n\n }" ]
[ "0.7184284", "0.65566987", "0.6384896", "0.62856704", "0.62784624", "0.62766355", "0.62256163", "0.6202818", "0.60430616", "0.60165274", "0.594899", "0.5948544", "0.59246385", "0.58995575", "0.58388543", "0.5837061", "0.58144003", "0.58062005", "0.5793251", "0.5790372", "0.5789634", "0.57320195", "0.5722953", "0.5710578", "0.5697377", "0.5676635", "0.56746745", "0.56694484", "0.5663854", "0.5651121", "0.5645212", "0.56442285", "0.56311476", "0.5630794", "0.56172454", "0.56155366", "0.5612929", "0.56071675", "0.55986524", "0.55904865", "0.5582382", "0.5582207", "0.5562062", "0.55589527", "0.55549425", "0.554842", "0.5542571", "0.55329007", "0.55124694", "0.5498409", "0.5483806", "0.5478369", "0.54769474", "0.54745144", "0.54595417", "0.5457351", "0.5457269", "0.54448605", "0.5441412", "0.5438064", "0.5430046", "0.5425303", "0.54210585", "0.54205674", "0.53999645", "0.5395007", "0.5394347", "0.5383879", "0.5382498", "0.53810567", "0.5380948", "0.5365099", "0.53552073", "0.5347181", "0.53417397", "0.53383917", "0.5337812", "0.5331028", "0.5331028", "0.53253067", "0.5317735", "0.53159904", "0.5314826", "0.5310388", "0.5300771", "0.52974874", "0.52966297", "0.5295677", "0.52925575", "0.52925575", "0.52925575", "0.52925575", "0.5280353", "0.52793944", "0.52767444", "0.52759117", "0.526669", "0.525879", "0.52578723", "0.52575827" ]
0.62921715
3
Transforms weather from provider to generic weather
public function transformWeather($weather): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function decodeCurrentWeather() {\n //if delte between two rains with time distance 10m > 0.1 - raining\n if ($this->getRainInLast(10) > 0.1) {\n return (object)[\n 'name' => $this->lang->weathers->rain,\n 'icon' => $GLOBALS['weather_icons']->rain\n ];\n } else if ($this->getCurrentWind()['speed'] > 10) {\n // when wind is > 35KPH\n return (object)[\n 'name' => $this->lang->weathers->wind,\n 'icon' => $GLOBALS['weather_icons']->wind\n ];\n } else if ($this->getCurrentDewPoint() - $this->getCurrentTemp() < 2.5) {\n //when delta between dew point and temperature is < 2.5 C\n return (object)[\n 'name' => $this->lang->weathers->mist,\n 'icon' => $GLOBALS['weather_icons']->mist\n ];\n } else {\n $hour = date(\"H\");\n\n //others I cant detect easy just say its partly_cloudy\n return (object)[\n 'name' => $this->lang->weathers->partly_cloudy,\n 'icon' => ($hour > 6 && $hour < 20) ? $GLOBALS['weather_icons']->partly_cloudy->day : $GLOBALS['weather_icons']->partly_cloudy->night\n ];\n }\n \n }", "public function getWeather()\n {\n return $this->apiWeather === 'WeatherBit.io' ? $this->getWeatherBit() : $this->getOpenWeatherMap();\n }", "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 }", "private function initWeather() {\n\t\t$weather = $this->_workflow->read ( $this->_query );\n\t\t$file_time = $this->_workflow->filetime ( $this->_query );\n\t\tif (! empty ( $weather ) && $file_time && time () - $file_time <= self::LIFETIME) {\n\t\t\t$this->_weather = $weather;\n\t\t\treturn;\n\t\t}\n\t\tif ($this->_query == self::QUERY_DEFAULT) {\n\t\t\t$url = sprintf ( self::ENDPOINT, '' );\n\t\t} else {\n\t\t\t$url = sprintf ( self::ENDPOINT, $this->_query );\n\t\t}\n\t\t$response = $this->_get ( $url );\n\t\t$response && $response = json_decode ( $response, true );\n\t\tif (0 == $response ['errNo'] && isset ( $response ['data'] ['weather'] ['content'] )) {\n\t\t\t$this->_weather = $response ['data'] ['weather'] ['content'];\n\t\t\t$this->_workflow->write ( $this->_weather, $this->_query );\n\t\t} elseif (! empty ( $weather ) && $file_time) {\n\t\t\t$this->_weather = $weather;\n\t\t} else {\n\t\t\tthrow new Exception ( 'response_error' );\n\t\t}\n\t}", "function parseWeather()\n\t{\n\t\tif(sizeof($this->racine->loc->dnam)>0)\n\t\t{\n\t\t$this->stationNom = $this->racine->loc->dnam;\n\t\t$this->stationLat = $this->racine->loc->lat;\n\t\t$this->stationLon = $this->racine->loc->lon;\n\t\t\n\t\t$this->dirVentDeg = $this->racine->cc->wind->d;\n\t\t$this->dirVentTxt = $this->racine->cc->wind->t;\n\t\t$this->vitVentKmh = $this->racine->cc->wind->s;\n\t\t$this->rafaleVent = $this->racine->cc->wind->gust;\n\t\t$this->vitVentUs = $this->racine->head->us;\n\t\t$this->vitVentMps = 1000*$this->vitVentKmh/3600.0;\n\t\t\n\t\t$this->pressionAt = $this->racine->cc->bar->r;\n\t\t$this->pressionUp = $this->racine->head->up;\n\t\t$evol = $this->racine->cc->bar->d;\n\t\tswitch($evol){\n\t\t\tcase 'rising':$this->pressEvol = \"en hausse\";break;\n\t\t\tdefault: $this->pressEvol = $evol;\n\t\t}\n\t\t\n\t\t$this->humidite = $this->racine->cc->hmid;\n\t\t$this->visibilite = $this->racine->cc->vis;\n\t\t\n\t\t$this->forceUVval = $this->racine->cc->uv->i;\n\t\t$this->forceUVtxt = $this->racine->cc->uv->t;\n\t\t\n\t\t$this->dewPoint = $this->racine->cc->dewp;\n\t\t\n\t\t$this->temperature = $this->racine->cc->tmp;\n\t\t\n\t\t$this->lastMesure = $this->racine->cc->lsup;\n\t\t\n\t\t$couvert = $this->racine->cc->t;\n\t\tswitch($couvert){\n\t\t\tcase 'Mostly Cloudy':$this->couverture = 'Nuages épars';break;\n\t\t\tcase 'Cloudy':$this->couverture = 'Quelques Nuages';break;\n\t\t\tdefault: $this->couverture = $couvert; break;\n\t\t}\n\t\t\n\t\t$phase = $this->racine->cc->moon->t;\n\t\tswitch($phase){\n\t\t\tcase 'Waxing Crescent':$this->phaseLune='1er croissant';break;\n\t\t\tdefault: $this->phaseLune=$phase;break;\n\t\t}\n\t }\n\t}", "public function provides()\n {\n return [Weather::class, 'weather'];\n }", "function shortcode_weather_handler($atts)\n{\n\t$args = shortcode_atts(array('city' => '', 'country' => ''), $atts);\n\t$url = 'http://api.openweathermap.org/data/2.5/weather?q=' . $args['city'] . ',' . $args['country'] . '&APPID=e8a25e6e27e357bbb70b8cacfe652bff';\n\t$json = file_get_contents($url);\n\t$data = json_decode($json, true);\n\t$output = '<h3>CITY INFO</h3>';\n\t$output .= 'Name: ' . $data['name'] . '<br>';\n\t$output .= 'Country: ' . $data['sys']['country'] . '<br>';\n\t$output .= 'Location: ' . $data['coord']['lon'] . ', ' . $data['coord']['lat'] . '<br>';\n\t$output .= '<h3>WEATHER INFO ' . \"<img src='http://openweathermap.org/img/w/\" . $data['weather'][0]['icon'] . \".png'>\" . '</h3>';\n\t$output .= 'Main: ' . $data['weather'][0]['main'] . '<br>';\n\t$output .= 'Description: ' . ucfirst($data['weather'][0]['description']) . '<br>';\n\t$output .= 'Temperature: ' . $data['main']['temp'] . ' K' . '<br>';\n\t$output .= 'Pressure: ' . $data['main']['pressure'] . ' hPa' . '<br>';\n\t$output .= 'Humidity: ' . $data['main']['humidity'] . ' %' . '<br>';\n\t$output .= 'Wind: ' . $data['wind']['speed'] . ' m/s' . '<br>';\n\t$output .= 'Cloudness: ' . $data['clouds']['all'] . ' %' . '<br>';\n\treturn $output;\n}", "function getWeather($options = array()) {\n\t\tif ($this->getWeatherData($options)) {\n\t\t\t$this->processingWeatherData();\n\t\t\t// register hit data to weather\n\t\t\tif ((bool)$this->register_hits)\n\t\t\t$this->_registerHits();\n\t\t}\n\t\treturn $this->weather_data;\n\t}", "public function getWeatherInfo()\n {\n if ($this->currently !== null) {\n return array_merge(\n $this->getInfo(),\n $this->getGeoInfo(),\n array(\n \"pos\" => $this->ipAddress,\n \"positionName\" => $this->getPosition(),\n \"currently\" => $this->currently(),\n \"hours\" => $this->hourly(),\n \"days\" => $this->daily(),\n \"pastDays\" => $this->pastDays(),\n \"script\" => $this->generateScript()\n )\n );\n } else {\n return array_merge(\n $this->getInfo(),\n array(\n \"pos\" => $this->ipAddress\n )\n );\n }\n }", "public function ttsWeather() {\n\t\t// https://www.prevision-meteo.ch/uploads/pdf/recuperation-donnees-meteo.pdf\n\t\t$data = json_decode(file_get_contents(Flight::get(\"ttsWeather\")),true);\n\n\t\t$txt = \"Bonjour, voici la météo pour aujourd'hui: Il fait actuellement \".$data['current_condition']['tmp'].\"°.\";\n\t\t$txt .= \" Les températures sont prévues entre \".$data['fcst_day_0']['tmin'].\" et \".$data['fcst_day_0']['tmax'].\"°.\";\n\t\t$txt .= \" Conditions actuelles: \".$data['current_condition']['condition'].\", Conditions pour la journée: \".$data['fcst_day_0']['condition'];\n\t\tself::playTTS($txt);\n\t}", "function getWeather(){\n\t\t$this->racine->asXml();\n\t}", "public function getWeather($town, $platform = 'fb')\n {\n require_once 'Weather.php';\n \n $message = '\"text\" : \"Sorry, Supported towns are Manzini, Mbabane, Matsapha and Ezulwini\"';\n $results_template = '';\n $c = 1;\n \n $weather = new Weather();\n $answer = $weather->getForecast($town);\n \n if(count($answer) >= 1){\n if($platform == 'fb'){\n foreach ($answer as $row) {\n if($c != 1){\n $results_template .= ',';\n }\n else{\n $c++;\n }\n \n $results_template .= '{\n \"title\": \"Hi: '.$row['hi'].' Low: '.$row['low'].'\",\n \"subtitle\": \"'.$row['description'].'\"\n }';\n }\n \n $message = '\"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"generic\",\n \"elements\":[\n '.$results_template.'\n ]\n }\n }';\n }\n else if($platform == 'twitter'){\n \n }\n }\n else{\n $message = '\"text\" : \"There is no weather update available currently\"';\n }\n return $message;\n }", "abstract public function convertFromResponse(SimplifiedResponse $response);", "function owm_get_current_weather($location) {\n\t$location_slug = str_replace(' ', '_', strtolower(trim($location)));\n\t$transient_key = \"owm_cw_\" . $location_slug;\n\n\t// 2. Try to get cached data using transient key\n\t$data = get_transient($transient_key);\n\n\t// 3. If no cached data exists (or has expired), get new, fresh data\n\tif ($data === false) {\n\t\t// 4. Get current weather from OpenWeatherMap's API\n\t\t$payload = owm_get_json(\"https://api.openweathermap.org/data/2.5/weather?q={$location}&units=metric&appid=\" . ww_get_owm_appid());\n\n\t\t// Make sure we get a valid response\n\t\tif (is_wp_error($payload) || (!is_object($payload) && wp_remote_retrieve_response_code($payload) !== 200)) {\n\t\t\treturn [\n\t\t\t\t'success' => false,\n\t\t\t\t'error' => wp_remote_retrieve_response_code($payload), // 404\n\t\t\t];\n\t\t}\n\n\t\t// 5. Extract needed data\n\t\t$data = [];\n\t\t$data['temperature'] = $payload->main->temp;\n\t\t$data['feels_like'] = $payload->main->feels_like;\n\t\t$data['humidity'] = $payload->main->humidity;\n\t\t$data['cloudiness'] = $payload->clouds->all;\n\t\t$data['wind_speed'] = $payload->wind->speed;\n\t\t$data['wind_direction'] = $payload->wind->deg;\n\t\t$data['last_updated'] = $payload->dt;\n\n\t\t// 5.1. transform weather-conditions\n\t\t$data['conditions'] = array_map(function($weather) {\n\t\t\treturn [\n\t\t\t\t'main' => $weather->main,\n\t\t\t\t'description' => $weather->description,\n\t\t\t\t'image' => \"https://openweathermap.org/img/wn/{$weather->icon}@2x.png\",\n\t\t\t];\n\t\t}, $payload->weather);\n\n\t\t// 6. Cache data for location\n\t\t// set_transient($transient_key, $data, 10 * MINUTE_IN_SECONDS);\n\t}\n\n\t// 7. Return data to caller\n\treturn [\n\t\t'success' => true,\n\t\t'data' => $data\n\t];\n}", "private function extractOpenWeatherMapResult($json)\n {\n // check response status field\n if (!isset($json->cod)) {\n $this->errorMsg = \"'cod' field not found in the response object!\";\n return false;\n }\n \n // check response status field has success code\n if ($json->cod !== '200') {\n $this->errorMsg = \"API error! status code=\" . $json->cod;\n return false;\n }\n\n // check main data field\n if (!isset($json->list) || count($json->list) === 0) {\n $this->errorMsg = \"Weather forecast data not found in the response object!\";\n return false;\n }\n \n // display units will be different depends on selection\n $degree_simbol = $this->unit === 'FAHRENHEIT' ? \"<span>&#8457;&nbsp;</span>\" : \"<span>&#8451;&nbsp;</span>\";\n $wind_unit = $this->unit === 'FAHRENHEIT' ? \" m/h\" : \" m/s\";\n \n // OpenWeatherMap provide forecast data for every 3 hours.\n // calculating daily min, max temperature\n $prev = '';\n $count = 0;\n foreach ($json->list as $hour_data) {\n // convert timestamp in UTC to Japan time and extract day part\n $dt = gmdate(\"Y-m-d\", intval($hour_data->dt)+9*60*60);\n if ($dt === $prev) {\n // find dialy max values\n $weather->wind = max($weather->wind, floatval($hour_data->wind->speed));\n $weather->humidity = max($weather->humidity, floatval($hour_data->main->humidity));\n $weather->temp = max($weather->temp, intval($hour_data->main->temp));\n $weather->temp_min = min($weather->temp_min, intval($hour_data->main->temp_min));\n if ($weather->temp_max < intval($hour_data->main->temp_max)) {\n $weather->temp_max = intval($hour_data->main->temp_max);\n // get icon and description for max temp\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n } else {\n if ($prev !== '') {\n // format and add object to the Area, if there are previos records\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n // 3 days forecast required\n if (++$count>2) {\n break;\n }\n }\n \n // next day start\n $weather = (object)[];\n $weather->dt = $dt;\n $prev = $dt;\n $weather->wind = floatval($hour_data->wind->speed);\n $weather->humidity = floatval($hour_data->main->humidity);\n $weather->temp = intval($hour_data->main->temp);\n $weather->temp_min = intval($hour_data->main->temp_min);\n $weather->temp_max = intval($hour_data->main->temp_max);\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n }\n // if days are less than 3, add last object\n if ($count<2) {\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n }\n return true;\n }", "function make_new_cachedata() {\n\n\t// End this function if the weather feed cannot be found\n\t$weather_url_headers = get_headers(WEATHER_URL);\n\tif ($weather_url_headers[0] == \"HTTP/1.1 200 OK\") {}\n\telseif ($weather_url_headers[0] == \"HTTP/1.0 200 OK\") {}\n\telse {\n\t\treturn;\n\t}\n\n\t// Setup an empty array for weather data\n\t$weather = array(\n\t\t'condition'\t\t\t=> '',\n\t\t'temp'\t\t\t\t=> '',\n\t\t'imgCode'\t\t\t=> '',\n\t\t'feedUpdatedAt'\t\t=> '',\n\t);\n\n\t// Set a timeout and grab the weather feed\n\t$opts = array('http' => array(\n\t\t\t\t\t\t\t'method' => 'GET',\n\t\t\t\t\t\t\t'timeout' => 5\t\t// seconds\n\t\t\t\t\t\t\t));\n\t$context = stream_context_create($opts);\n\t$raw_weather = file_get_contents(WEATHER_URL, false, $context);\n\n\t// If the weather feed can be fetched, grab and sanatize the needed information\n\tif ($raw_weather) {\n\t\t$xml = simplexml_load_string($raw_weather);\n\n\t\t$imgCodeNoExtension = explode(\".png\", $xml->icon_url_name);\n\n\t\t$weather['condition'] \t\t= htmlentities((string)$xml->weather);\n\t\t$weather['temp']\t\t\t= htmlentities(number_format((string)$xml->temp_f)); // strip decimal place and following\n\t\t$weather['imgCode']\t\t\t= htmlentities((string)$imgCodeNoExtension[0]);\n\t\t$weather['feedUpdatedAt'] \t= htmlentities((string)$xml->observation_time_rfc822);\n\t}\n\n\t// Setup a new string for caching\n\t$weather_string = json_encode($weather);\n\n\t// Write the new string of data to the cache file\n\t$filehandle = fopen(CACHEDATA_FILE, 'w') or die('Cache file open failed.');\n\tfwrite($filehandle, $weather_string);\n\tfclose($filehandle);\n\n\t// Return the newly grabbed content\n\treturn $weather;\n}", "public function handle(Model $weather)\n {\n $madrid = Http::get('http://api.openweathermap.org/data/2.5/weather?q=Madrid,spain&units=metric&APPID=c169250aeaa47aaa7d3c2f50f6da6d46');\n $barcelona = Http::get('http://api.openweathermap.org/data/2.5/weather?q=Barcelona,spain&units=metric&APPID=c169250aeaa47aaa7d3c2f50f6da6d46');\n if($madrid['main']['temp'] >30 ) $status=\"hot weather\";\n else if($madrid['main']['temp'] < 4) $status=\"cold weather\";\n else $status=\"Good weather\";\n $weather::create([\n 'city_name' => $madrid['name'],\n 'description' => $madrid['weather']['0']['description'],\n 'lon' => $madrid['coord']['lon'],\n 'lat' => $madrid['coord']['lat'],\n 'wind_speed' => $madrid['wind']['speed'],\n 'humidity' => $madrid['main']['humidity'],\n 'pressure' => $madrid['main']['pressure'],\n 'temp' => $madrid['main']['temp'],\n 'temp_max' => $madrid['main']['temp_max'],\n 'temp_min' => $madrid['main']['temp_min'],\n 'status' => $status,\n ]);\n if($barcelona['main']['temp'] >30 ) $status=\"hot weather\";\n else if($barcelona['main']['temp'] < 4) $status=\"cold weather\";\n else $status=\"Good weather\";\n $weather::create([\n 'city_name' => $barcelona['name'],\n 'description' => $barcelona['weather']['0']['description'],\n 'lon' => $barcelona['coord']['lon'],\n 'lat' => $barcelona['coord']['lat'],\n 'wind_speed' => $barcelona['wind']['speed'],\n 'humidity' => $barcelona['main']['humidity'],\n 'pressure' => $barcelona['main']['pressure'],\n 'temp' => $barcelona['main']['temp'],\n 'temp_max' => $barcelona['main']['temp_max'],\n 'temp_min' => $barcelona['main']['temp_min'],\n 'status' => $status,\n ]);\n \\Log::info(\"This Message Sucessfully Saved in DB !\");\n\n $this->info('This Message Sucessfully Saved in DB !');\n\n }", "public function getWeatherData() {\n\t\t$this->cleanCache();\n\t\tif (!$this->useCache || !file_exists($this->cache_path) || @filemtime(($this->cache_path) + $this ->cachtime < time()) || file_get_contents($this->cache_path) == \"\") {\n\t\t\t$weather_api_url = \"http://query.yahooapis.com/v1/public/yql?q=select+%2A+from+weather.forecast+where+woeid%3D%22\".$this->location_code.\"%22+and+u%3D%22\".$this->unit.\"%22&format=json\";\n\t\t\t$rss_api_url = \"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%27http%3A%2F%2Fweather.yahooapis.com%2Fforecastrss%3Fw%3d\".$this->location_code.\"%26u%3d\".$this->unit.\"%27&format=json\";\n\n\t\t\t$data = $this->getContentFromUrl($weather_api_url);\n\t\t\t$data_forecast = $this->getContentFromUrl($rss_api_url);\n\t\t\tif ($this->isJson($data) && $this->isJson($data_forecast)) {\n\t\t\t\t$weather_assoc = json_decode($data, true);\n\t\t\t\tif ($weather_assoc[\"query\"][\"results\"][\"channel\"][\"title\"] == \"Yahoo! Weather - Error\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$weather_assoc_forecast = json_decode($data_forecast,true);\n\t\t\t\t$weather_assoc[\"query\"][\"results\"][\"channel\"][\"item\"][\"forecast\"]=$weather_assoc_forecast[\"query\"][\"results\"][\"item\"][\"forecast\"];\n\t\t\t\tif ($this->useCache) {\n\t\t\t\t\tfile_put_contents($this->cache_path.$this->cache_name, json_encode($weather_assoc));\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$weather_assoc = json_decode(file_get_contents($this->cache_path.$this->cache_name));\n\t\t}\n\t\t\n\t\treturn $weather_assoc[\"query\"][\"results\"][\"channel\"];\n\t}", "public function getCurrentWeather() {\n\t\t$weather = $this->APIRequest([\n\t\t\t'lat' => $this->lat,\n\t\t\t'lon' => $this->lng,\n\t\t\t'units' => 'metric'\n\t\t]);\n\t\t\n\t\t$weather = $this->getRelevantData($weather);\n\t\t$this->weatherReportCache = $weather;\n\t\t\n\t\treturn $weather;\n\t}", "abstract protected function doActualConvert();", "function transformEntry($timeTrackerEntry);", "public function getWeather(WeatherRequest $weatherRequest): Weather\n {\n /** GuzzleHttp\\Psr7\\Request */\n $request = new Request(\n self::METHOD,\n self::YANDEX_API_URL . http_build_query(\n [\n 'lat' => $weatherRequest->getLat(),\n 'lon' => $weatherRequest->getLon(),\n 'lang' => $weatherRequest->getLang(),\n 'limit' => $weatherRequest->getLimit(),\n 'hours' => $weatherRequest->getHours(),\n 'extra' => $weatherRequest->getExtra()\n ]\n ),\n ['X-Yandex-API-Key' => $this->yandexApiKey]\n );\n $result = $this->sendRequest($request);\n\n $weather = new Weather();\n $weather->setSettlement($weatherRequest->getSettlement());\n $weather->setFactTemp($result->fact->temp);\n $weather->setFactFeelsLike($result->fact->feels_like);\n $weather->setFactIcon(sprintf(self::YANDEX_WEATHER_ICON_URL_TEMPLATE,$result->fact->icon));\n\n return $weather;\n }", "public function fetchWeatherInfo()\n {\n if ($this->latitude && $this->latitude) {\n $cUrl = $this->di->get(\"callurl\");\n $args = $this->buildArgs();\n $apiResult = $cUrl->fetchConcurrently(\n $args[\"urls\"],\n $args[\"params\"],\n $args[\"queries\"]\n );\n\n if (isset($apiResult[0][\"error\"])) {\n $this->setErrorMessage(\"DarkSkyError: \" . $apiResult[0]['error']);\n }\n\n $pastDays = array(\"data\" => []);\n\n $resultCount = count($apiResult);\n\n for ($i=1; $i<$resultCount; $i++) {\n if ($apiResult[$i] && isset($apiResult[$i][\"daily\"][\"data\"][0])) {\n array_push($pastDays[\"data\"], $apiResult[$i][\"daily\"][\"data\"][0]);\n }\n }\n\n // var_dump($apiResult);\n\n if ($apiResult[0]) {\n $this->fillInfo(\n array_merge($apiResult[0], array(\"pastDays\" => $pastDays)),\n [\n \"currently\",\n \"hourly\",\n \"daily\",\n \"pastDays\"\n ]\n );\n } else {\n $this->setErrorMessage(\"DarkSkyError: daily usage limit exceeded\");\n }\n }\n return $this->getWeatherInfo();\n }", "public function weather(): array\n {\n return $this->weather;\n }", "public function getWeather() {\n\n return $this->weather;\n }", "public function mapFor()\n {\n return Forecast::class;\n }", "public function setWeather( Weather $weather ) {\n\n $this->weather = $weather;\n }", "public function convert();", "public function getWeather($city)\n {\n $this->secondWeatherApi->loadWeatherData($city);\n\n return new Adapter\\Weather(\n $this->secondWeatherApi->getTemperature(),\n $this->secondWeatherApi->getHumidity(),\n $this->secondWeatherApi->getPressure()\n );\n }", "public static function _ServiceWeather($parm=false)\n\t{\n\t\t$data = $parm == false ? self::$_args : $parm;\n\n\t\tif($data == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t \tif(method_exists('cURLs','access_curl'))\n\t\t \t{\n\t\t\t\t$server = self::BASE_API;\n\t\t\t\t$key = isset($data['key']) ? $data['key'] : self::$_api_key;\n\t\t\t\t$lang = isset($data['lang']) ? $data['lang'] : self::BASE_LANG;\n\t\t\t\t$city = isset($data['city']) ? $data['city'] : self::BASE_CITY;\n\t\t\t\t$city = preg_replace('/ /','',$city);\n\t\t\t\t$forecast = isset($data['forecast']) ? ($data['forecast'] == true ? 'forecast/' : '') : '';\n\t\t\t\t$API_ENDPOINT = $server.'/'.$key.'/conditions/'.$forecast.'lang:'.$lang.'/q/'.$city.'.json';\n\n\t\t\t\t$cURL = new cURLs(array('url'=>$API_ENDPOINT,'type'=>'data'));\n\t\t\t\t$get = $cURL->access_curl();\n\n\t\t\t\t$decode = json_decode($get,true);\n\n\t\t\t\tif(isset($decode['response']['error']) || \n\t\t\t\t\tisset($decode['response']['results']))\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $get;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function getWeatherMap()\n {\n return $this->renderView(\n __DIR__ . DIRECTORY_SEPARATOR . 'views/weather_map.php',\n [\n 'center_id' => $this->centerID,\n 'token' => $this->token,\n 'wx_base_url' => $this->wxBaseUrl,\n 'wx_map_zones' => $this->wxMapZones,\n 'external_modal_links' => $this->externalModalLinks\n ]\n );\n }", "function api_apply_template($templatename, $type, $data){\n\n\t\tswitch($type){\n\t\t\tcase 'xml':\n\t\t\t\tif($data) {\n\t\t\t\t\tforeach($data as $k => $v)\n\t\t\t\t\t\t$ret = arrtoxml(str_replace('$','',$k),$v);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'json':\n\t\t\tdefault:\n\t\t\t\tif($data) {\n\t\t\t\t\tforeach($data as $rv) {\n\t\t\t\t\t\t$ret = json_encode($rv);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function getWeather($city = NULL, $code = NULL) {\n if (empty($this->hasKey)) {\n return NULL;\n }\n if (empty($city)) {\n if (empty($this->city) || empty($this->code)) {\n return NULL;\n }\n $city = $this->city;\n if (empty($code)) {\n $code = $this->code;\n }\n }\n $code = !empty($code) ? mb_strtolower($code) : $code;\n $cid = 'weather:' . $city . ':' . ($code ?? 'no_code');\n $cache = $this->cacheBin->get($cid, TRUE);\n if (isset($cache->expire) && $cache->expire < $this->time->getCurrentTime()) {\n $this->cacheBin->delete($cid);\n $cache = FALSE;\n }\n if (!isset($cache->data) || empty($cache->data)) {\n $q = [];\n $q[] = $city;\n if (!empty($code)) {\n $q[] = $code;\n }\n $requestsParametrs = NestedArray::mergeDeep($this->defaultRequestOptions, [\n \\GuzzleHttp\\RequestOptions::QUERY => [\n 'q' => implode(',', $q),\n 'units' => 'metric',\n ],\n ]);\n $response = $this->httpClient->request('GET', '', $requestsParametrs);\n $code = $response->getStatusCode();\n $content = '';\n if ($code >= 200 && $code < 300) {\n $content = $response->getBody()->getContents();\n if (!empty($content)) {\n $content = Json::decode($content);\n }\n $this->cacheBin->set($cid, $content, $this->time->getCurrentTime() + 90);\n }\n $cache = (object) ['data' => $content];\n }\n return $cache->data;\n }", "public static function createDetailedForLocation(\n string $provider, array $details, float $locationLatitude, float $locationLongitude\n ): CurrentWeather\n {\n $weather = new self($provider, $details);\n $weather->setLocation($locationLatitude, $locationLongitude);\n return $weather;\n }", "function simplecontext_convert($context, $type) {\n switch ($type) {\n case 'item1':\n return $context->data->item1;\n case 'item2':\n return $context->data->item2;\n case 'description':\n return $context->data->description;\n }\n}", "function get_weather_data() {\n\n\tdate_default_timezone_set(TIMEZONE);\n\n\t// Check if cached weather data already exists and if the cache has expired\n\tif ( ( file_exists(CACHEDATA_FILE) ) && ( date('YmdHis', filemtime(CACHEDATA_FILE)) > date('YmdHis', strtotime('Now -'.WEATHER_CACHE_DURATION.' seconds')) ) ) {\n\t\t$weather_string = file_get_contents(CACHEDATA_FILE) or make_new_cachedata();\n\t\t$weather = (json_decode($weather_string, true));\n\t\treturn $weather;\n\t}\n\n\telse {\n\t\treturn make_new_cachedata();\n\t}\n\n}", "public function export(WeatherDataDto $weatherDataDto): string;", "abstract public function convertFromRawValue($value);", "function demos_convert($context, $type) {\n switch ($type) {\n case 'item1':\n return $context->data->item1;\n case 'item2':\n return $context->data->item2;\n case 'description':\n return $context->data->description;\n }\n}", "function convertTemp($temp, $unit1, $unit2)\n { $newTemp = 0;\n if ($unit1 == 'celsius') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 32;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp + 273.15;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp;\n }\n } \n if ($unit1 == 'fahrenheit') {\n if ($unit2 == 'celsius') {\n $newTemp = ($temp -32) * 5/9;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = ($temp + 459.67) * 5/9;\n } elseif ($unit2 == 'fahrenheit') {\n $newTemp = $temp;\n } \n } \n if ($unit1 == 'kelvin') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 459.67;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp - 273.15;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp;\n } \n } \n return $newTemp;\n }", "function theme_meteologic_noaa_forecast($variables) {\n\n $data = $variables['data']['data'];\n\n$display_out = '<div class=\"forecast-wrapper\">';\nfor ($i = 0; $i < 5; $i++) {\n $dayindex = $i * 2;\n $nightindex = $dayindex + 1; \n $daystamp = strtotime($data['time-layout'][0]['start-valid-time'][$i]);\n $dow = date('l',$daystamp);\n $forecast_icon1 = $data['parameters']['conditions-icon']['icon-link'][$dayindex];\n $forecast_icon2 = $data['parameters']['conditions-icon']['icon-link'][$nightindex];\n $hi = $data['parameters']['temperature'][0]['value'][$i];\n $lo = $data['parameters']['temperature'][1]['value'][$i];\n $pop1 = $data['parameters']['probability-of-precipitation']['value'][$dayindex];\n $pop2 = $data['parameters']['probability-of-precipitation']['value'][$nightindex];\n $weather1 = $data['parameters']['weather']['weather-conditions'][$dayindex]['@attributes']['weather-summary'];\n $weather2 = $data['parameters']['weather']['weather-conditions'][$nightindex]['@attributes']['weather-summary'];;\n if($i == 0 && is_array($forecast_icon1)){\n $forecast_icon1 = $forecast_icon2;\n $dow = 'Tonight';\n }\n $display_out .= '<div class=\"forecast-day-wrapper\">';\n $display_out .= '<div class=\"forecast-day-inner\">';\n $display_out .= '<div class=\"forecast-day-heading\">'.$dow.'</div>';\n $display_out .= '<div class=\"forecast-day-icon\"><img class=\"scalable\" width=\"55\" height=\"58\" src=\"'.$forecast_icon1.'\"></div>';\n $display_out .= '<div class=\"forecast-day-weather\">'.$weather1.'</div>';\n $display_out .= '<div class=\"forecast-day-hilo\">HI:'.$hi.' / LO:'.$lo.'</div>';\n $display_out .= '<div class=\"forecast-day-pop\">Probablilty of Precipitation: '.$pop1.'%</div>';\n $display_out .= '</div>';\n $display_out .= '</div>';\n\n}\n$display_out .= '</div>';\n // @TODO do something with these results.\nreturn $display_out;\n}", "abstract public function convertFromRequest(SimplifiedRequest $request);", "abstract public function transform();", "function ww_ajax_get_current_weather() {\n $current_weather = owm_get_current_weather($_POST['city'], $_POST['country']);\n // Send the data our PHP code gets from OWM API\n wp_send_json($current_weather);\n}", "protected function get_temperature( ) {\n// depending on the temperature, Heat Index or Wind Chill Temperature is calculated.\n// Format is tt/dd where tt = temperature and dd = dew point temperature. All units are\n// in Celsius. A 'M' preceeding the tt or dd indicates a negative temperature. Some\n// stations do not report dew point, so the format is tt/ or tt/XX.\n\n if (preg_match('#^(M?[0-9]{2})/(M?[0-9]{2}|[X]{2})?$#',$this->current_group_text,$pieces)) {\n $tempC = (integer) strtr($pieces[1], 'M', '-');\n $tempF = round(1.8 * $tempC + 32);\n $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_F'] = $tempF;\n $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_F'] = $tempF;\n $this->get_wind_chill($tempF);\n if (strlen($pieces[2]) != 0 && $pieces[2] != 'XX') {\n $dewC = (integer) strtr($pieces[2], 'M', '-');\n $dewF = convertTempToF($dewC);\n $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_C'] = $dewC;\n// $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_F'] = $dewF;\n $rh = round(100 * pow((112 - (0.1 * $tempC) + $dewC) / (112 + (0.9 * $tempC)), 8),1);\n $this->wxInfo['ITEMS'][$this->tend]['HUMIDITY'] = $rh;\n $this->get_heat_index($tempF, $rh);\n }\n $this->wxInfo['ITEMS'][$this->tend]['CODE_TEMPERATURE'] = $this->current_group_text;\n $this->current_ptr++;\n $this->current_group++;\n }\n else {\n $this->current_group++;\n }\n }", "public function currentWeather($city_id) {\n\t\t$API_KEY = '91d6ff6cfa05fd51f54773c8dca55123';\n\t\t$API_URL = \"http://api.openweathermap.org/data/2.5/weather?\";\n\t\t$API_IMG_URL = \"http://openweathermap.org/img/w/\";\n\t\t\n\t\ttry {\n\t\t\t$client = \\Drupal::httpClient();\n\t\t\t$apiURL = $API_URL.'id='.$city_id.'&lang=en&units=metric&appid='.$API_KEY;\n\t\t\t$response = $client->request('GET', $apiURL, ['verify' => FALSE]);\n \t\t$response = $response->getBody();\n\n\t\t\t$data = Json::decode($response);\n\t\t\n\t\t\t$weatherArr = array(\n\t\t\t\t'name' => $data['name'],\n\t\t\t\t'curday' => date('l g:i a'),\n\t\t\t\t'curdate' => date('jS F, Y'),\n\t\t\t\t'type' => $data['weather'][0]['description'],\n\t\t\t\t'imageUrl' => $API_IMG_URL.$data['weather'][0]['icon'].'.png',\n\t\t\t\t'minTemp' => $data['main']['temp_min'],\n\t\t\t\t'maxTemp' => $data['main']['temp_max'],\n\t\t\t\t'humidity' => $data['main']['humidity'].'%',\n\t\t\t\t'wind' => $data['wind']['speed'].' km/h',\n\t\t\t);\n\t\n\t\t\treturn array(\n\t\t\t\t'#theme' => 'weather',\n\t\t\t\t'#items' => $weatherArr,\n\t\t\t\t'#title' => 'Weather Report'\t\n\t\t\t);\n\t\t}\n\t\tcatch (GuzzleException $e) {\n\t\t\twatchdog_exception('current_weather', $e);\n\t\t\treturn FALSE;\n\t\t}\t\n\t}", "public function getWeatherDetail() : array\n {\n $response = array(\n \"weather_type\" => $this->type,\n \"temperature\" => $this->temperature,\n \"wind\" => array(\n \"speed\" => $this->windSpeed,\n \"direction\" => $this->windDirection\n )\n );\n\n return $response;\n }", "function ckan_map($server, $map, $dataset) {\n $type = $server['source_type'];\n\n //an empty new dataset\n $new_dataset = array(\n 'extras' => array(),\n );\n\n foreach ($map as $key => $value) {\n //skip resources fields\n if ($value[1] == 2) {\n continue;\n }\n\n //dataset from some sources (e.g. ckan) has some fields in extras.\n //flatten them to the root level.\n //hopefully no key collisions.\n if (isset($value[2]) && $value[2]) {\n $dataset[$value[0]] = _find_extras_value($dataset, $value[0]);\n }\n\n switch (\"$type:$key\") {\n\n case 'json:tags':\n case 'ckan:tags':\n $new_dataset[$key] = array();\n $tags = $dataset[$value[0]];\n if (is_string($tags)) {\n $tags = str_replace(array(\";\", \"\\r\\n\", \"\\r\", \"\\n\", \"\\t\"), ',', $dataset[$value[0]]);\n $tags = explode(',', $tags);\n }\n foreach ($tags as $tag) {\n $clean_tag = preg_replace('/[^a-zA-Z0-9_-]+/', ' ', $tag);\n $clean_tag = trim($clean_tag);\n $max_length = 100;\n if (strlen($clean_tag) > $max_length) {\n //cut at last space before 100th char.\n $clean_tag = preg_replace('/\\s+?(\\S+)?$/', '', substr($clean_tag, 0, $max_length));\n }\n if (strlen($clean_tag) > 1) {\n $new_dataset[$key][] = array('name' => $clean_tag);\n }\n }\n\n break;\n\n case 'json:temporal':\n $new_date = get_new_date($dataset[$value[0]]);\n $new_dataset[$key] = $new_date?$new_date:\"0000\";\n break;\n\n case 'ckan:temporal':\n $new_date = \"0000\";\n //do our best to get date out of the string, ideally into startdate/enddate\n $date_value = trim($dataset[$value[0]]);\n $ret = guess_new_date($date_value);\n if ($ret) {\n $new_date = $ret;\n }\n else {\n //it is string that php does not understand.\n //let us try to split it to see if it is two date in the format of \"start to end\".\n $split = str_replace(array('to', 'through'), \",\", $date_value);\n $split = explode(',', $split);\n if ($split && count($split) == 2) {\n $start_date = guess_new_date(trim($split[0]));\n $end_date = guess_new_date(trim($split[1]));\n if ($start_date && $end_date) {\n $new_date = $start_date . '/' . $end_date;\n }\n }\n else {\n //try again with splitting \"-\"\n $split = explode('-', $date_value);\n if ($split && count($split) == 2) {\n $start_date = guess_new_date(trim($split[0]));\n $end_date = guess_new_date(trim($split[1]));\n if ($start_date && $end_date) {\n $new_date = $start_date . '/' . $end_date;\n }\n }\n }\n }\n $new_dataset[$key] = $new_date;\n break;\n\n case 'json:release_date':\n $new_dataset[$key] = $new_date;\n if (empty($dataset[$value[0]])) {\n $new_dataset[$key] = '0000';\n }\n break;\n\n case 'json:homepage_url':\n case 'ckan:homepage_url':\n case 'json:system_of_records':\n // must be a valid url or nothing\n $url_value = trim($dataset[$value[0]]);\n if (filter_var($url_value, FILTER_VALIDATE_URL) !== FALSE) {\n $new_dataset[$key] = $url_value;\n }\n break;\n\n case 'json:data_dictionary':\n case 'ckan:data_dictionary':\n // must be a valid url\n $url_value = trim($dataset[$value[0]]);\n if (filter_var($url_value, FILTER_VALIDATE_URL) !== FALSE) {\n $new_dataset[$key] = $url_value;\n }\n else {\n $new_dataset[$key] = \"http://localdomain.local/\";\n }\n break;\n\n case 'json:data_quality':\n // cant left empty\n $quality_value = strtolower(trim($dataset[$value[0]]));\n if (in_array($quality_value, array('off', 'false', 'no', '0'))) {\n $quality_value = false;\n }\n else {\n $quality_value = true;\n }\n $new_dataset[$key] = $quality_value;\n break;\n\n case 'ckan:publisher':\n // TODO for now hard-coded to $dataset.organization.title\n $new_dataset[$key] = trim($dataset['organization']['title']);\n break;\n\n case 'ckan:public_access_level':\n // use default if missing value\n $new_dataset[$key] = trim($dataset[$value[0]])?trim($dataset[$value[0]]):'public';\n break;\n\n default:\n $new_dataset[$key] = $dataset[$value[0]];\n if (is_string($new_dataset[$key])) {\n $new_dataset[$key] = trim($new_dataset[$key]);\n }\n\n }\n }\n\n\n //create necessary new fields:\n // 1. name\n if ($type == 'ckan') {\n $new_dataset['name'] = $dataset['name'];\n }\n else {\n //replace anything weird with \"-\"\n $new_dataset['name'] = preg_replace('/[\\s\\W]+/', '-', strtolower($new_dataset['title']));\n $new_dataset['name'] = substr($new_dataset['name'], 0, 100);\n $new_dataset['name'] = trim($new_dataset['name'], '-');\n }\n // 2. owner_org\n if ($type == 'ckan' && $server['ckan_use_src_org'] && isset($dataset['organization']['name'])) {\n //use src org\n $org_name = $dataset['organization']['name'];\n if (isset($server['ckan_src_org_map'][$org_name]) && strlen($server['ckan_src_org_map'][$org_name]) !== 0) {\n $org_name = $server['ckan_src_org_map'][$org_name];\n }\n $new_dataset['owner_org'] = $org_name;\n }\n else {\n //use default org supplied by command argument\n $new_dataset['owner_org'] = $server['org'];\n }\n\n //clean up work.\n $new_dataset['publisher'] = strlen($new_dataset['publisher'])?$new_dataset['publisher']:\"N/A\";\n $new_dataset['publisher'] = substr($new_dataset['publisher'], 0, 300);\n $new_dataset['contact_name'] = strlen($new_dataset['contact_name'])?$new_dataset['contact_name']:\"N/A\";\n $new_dataset['contact_email'] = (strpos($new_dataset['contact_email'], \"@\")!==false)?$new_dataset['contact_email']:\"[email protected]\";\n\n //validator can goes here\n //\n\n //not sure what is with this ckan\n //but we have to replicate some keys in both root and extras\n foreach ($map as $key => $value) {\n\n switch ($key) {\n\n case 'publisher':\n case 'contact_email':\n case 'contact_name':\n case 'homepage_url':\n case 'system_of_records':\n case 'related_documents':\n case 'data_dictionary':\n if (isset($new_dataset[$key]) && !empty($new_dataset[$key])) {\n $new_dataset['extras'][] = array(\n 'key' => $key,\n 'value' => $new_dataset[$key],\n );\n }\n break;\n\n case 'accrual_periodicity':\n case 'category':\n case 'language':\n if (isset($new_dataset[$key]) && !empty($new_dataset[$key])) {\n $new_dataset['extras'][] = array(\n 'key' => $key,\n 'value' => $new_dataset[$key],\n );\n }\n //something additional to do. remove not used keys\n unset($new_dataset[$key]);\n break;\n\n default:\n //\n }\n }\n\n return $new_dataset;\n}", "function meteoGreg(){\r\n $curl = curl_init();\r\n \r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => \"api.openweathermap.org/data/2.5/find?q=Prévenchères&units=metric&appid=d196fbd705116ddcd1911b5c8606c6e0&lang=fr\",\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_TIMEOUT => 30,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => \"GET\",\r\n CURLOPT_HTTPHEADER => array(\r\n \"cache-control: no-cache\"\r\n ),\r\n ));\r\n \r\n $response = curl_exec($curl);\r\n \r\n curl_close($curl);\r\n \r\n $response = json_decode($response, true);\r\n echo(\"<p style='text-align:center; color:#373737;'>Le temps à <b>Prévenchères</b> est actuellement <b>\".$response['list'][0]['weather'][0]['description'].\"</b> et la température est de <b>\".intval($response['list'][0]['main']['temp']).\"°C</b></p>\");\r\n}", "abstract public function transformResource($resource);", "public function generic_town()\n\t{\n\t\t//<TOWN><www.town.ag > <partner of www.ssl-news.info > [02/24] - \"Dragons.Den.UK.S11E02.HDTV.x264-ANGELiC.nfo\" - 288,96 MB yEnc\n\t\t//<TOWN><www.town.ag > <SSL - News.Info> [6/6] - \"TTT.Magazine.2013.08.vol0+1.par2\" - 33,47 MB yEnc\n\t\tif (preg_match('/^<TOWN>.+?town\\.ag.+?(www\\..+?|News)\\.[iI]nfo.+? \\[\\d+\\/\\d+\\]( -)? \"(.+?)(-sample)?' . $this->e0 . ' - \\d+[.,]\\d+ [kKmMgG][bB]M? yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[3];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ 1080p ] - [320/352] - \"Gq7YGEWLy8wAA2NhbZx5LukEa.vol000+5.par2\" - 17.09 GB yEnc\n\t\tif (preg_match('/^\\[\\s*TOWN\\s*\\][-_\\s]{0,3}\\[\\s*www\\.town\\.ag\\s*\\][-_\\s]{0,3}\\[\\s*partner of www\\.ssl-news\\.info\\s*\\][-_\\s]{0,3}\\[\\s* .*\\s*\\][-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,4}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e2, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //<TOWN><www.town.ag > <download all our files with>>> www.ssl-news.info <<< >IP Scanner Pro 3.21-Sebaro - [1/3] - \"IP Scanner Pro 3.21-Sebaro.rar\" yEnc\n\t\tif (preg_match('/^<TOWN>.+?town\\.ag.+?(www\\..+?|News)\\.[iI]nfo.+? \\[\\d+\\/\\d+\\]( -)? \"(.+?)(-sample)?' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(05/10) -<TOWN><www.town.ag > <partner of www.ssl-news.info > - \"D.Olivier.Wer Boeses.saet-gsx-.part4.rar\" - 741,51 kB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) -<TOWN><www\\.town\\.ag >\\s+<partner.+> - (\"|#34;)([\\w. ()-]{8,}?\\b)(\\.par2|-\\.part\\d+\\.rar|\\.nfo)(\"|#34;) - \\d+[.,]\\d+ [kKmMgG][bB]( -)? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [14/19] - \"Night.Vision.2011.DVDRip.x264-IGUANA.part12.rar\" - 660,80 MB yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ partner of www\\.ssl-news\\.info \\][ _-]{0,3}\\[ .* \\] \\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;)(.+)((\\.part\\d+\\.rar)|(\\.vol\\d+\\+\\d+\\.par2))(\"|#34;)[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [01/84] - \"The.Butterfly.Effect.2.2006.1080p.BluRay.x264-LCHD.par2\" - 7,49 GB yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ partner of www\\.ssl-news\\.info \\][ _-]{0,3}\\[ .* \\] \\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;)(.+)\\.(par2|rar|nfo|nzb)(\"|#34;)[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [22/22] - \"Arsenio.Hall.2013.09.11.Magic.Johnson.720p.HDTV.x264-2HD.vol31+11.par2\" - 1,45 GB yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ partner of www\\.ssl-news\\.info \\][ _-]{0,3}(\\[ TV \\] )?\\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;)(.+)((\\.part\\d+\\.rar)|(\\.vol\\d+\\+\\d+\\.par2)|\\.nfo|\\.vol\\d+\\+\\.par2)(\"|#34;)[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [01/28] - \"Arsenio.Hall.2013.09.18.Dr.Phil.McGraw.HDTV.x264-2HD.par2\" - 352,58 MB yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ partner of www\\.ssl-news\\.info \\][ _-]{0,3}(\\[ TV \\] )?\\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;)(.+)\\.par2(\"|#34;)[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //4675.-.Wedding.Planner.multi3.(EU) <TOWN><www.town.ag > <partner of www.ssl-news.info > <Games-NDS > [01/10] - \"4675.-.Wedding.Planner.multi3.(EU).par2\" - 72,80 MB - yEnc\n\t\tif (preg_match('/^\\d+\\.-\\.(.+) <TOWN><www\\.town\\.ag >\\s+<partner .+>\\s+<.+>\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;).+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//4675.-.Wedding.Planner.multi3.(EU) <TOWN><www.town.ag > <partner of www.ssl-news.info > <Games-NDS > [01/10] - \"4675.-.Wedding.Planner.multi3.(EU).par2\" - 72,80 MB - yEnc\n\t\t// Some have no yEnc\n\t\tif (preg_match('/^\\d+\\.-\\.(.+) <TOWN><www\\.town\\.ag >\\s+<partner .+>\\s+<.+>\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS <TOWN><www.town.ag > <partner of www.ssl-news.info > [01/13] - \"Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2\" - 92,12 MB - yEnc\n\t\tif (preg_match('/^(\\w.+) <TOWN><www\\.town\\.ag >\\s+<partner.+>\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;).+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS <TOWN><www.town.ag > <partner of www.ssl-news.info > [01/13] - \"Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2\" - 92,12 MB - yEnc\n\t\t// Some have no yEnc\n\t\tif (preg_match('/^(\\w.+) <TOWN><www\\.town\\.ag >\\s+<partner.+>\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<TOWN><www.town.ag > <partner of www.ssl-news.info > JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - \"JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2\" - 200,77 MB - yEnc\n\t\tif (preg_match('/^<TOWN><www\\.town\\.ag >\\s+<partner .+>\\s+(.+)\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;).+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//<TOWN><www.town.ag > <partner of www.ssl-news.info > JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - \"JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2\" - 200,77 MB - yEnc\n\t\t// Some have no yEnc\n\t\tif (preg_match('/^<TOWN><www\\.town\\.ag >\\s+<partner .+>\\s+(.+)\\s+\\[\\d+\\/\\d+\\] - (\"|#34;).+/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<TOWN><www.town.ag > <partner of www.ssl-news.info > [01/18] - \"2012-11.-.Supurbia.-.Volume.Tw o.Digital-1920.K6-Empire.par2\" - 421,98 MB yEnc\n\t\tif (preg_match('/^[ <\\[]{0,2}TOWN[ >\\]]{0,2}[ _-]{0,3}[ <\\[]{0,2}www\\.town\\.ag[ >\\]]{0,2}[ _-]{0,3}[ <\\[]{0,2}partner of www.ssl-news\\.info[ >\\]]{0,2}[ _-]{0,3}\\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;)(.+)\\.(par|vol|rar|nfo).*?(\"|#34;).+?yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //<TOWN> www.town.ag > sponsored by www.ssl-news.info > (1/3) \"HolzWerken_40.par2\" - 43,89 MB - yEnc\n\t\tif (preg_match('/^<TOWN> www\\.town\\.ag > sponsored by www\\.ssl-news\\.info > \\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' - \\d+[,.]\\d+ [mMkKgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/9)<<<www.town.ag>>> sponsored by ssl-news.info<<<[HorribleSubs]_AIURA_-_01_[480p].mkv \"[HorribleSubs]_AIURA_-_01_[480p].par2\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\).+?www\\.town\\.ag.+?sponsored by (www\\.)?ssl-news\\.info<+?.+? \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ Assassins.Creed.IV.Black.Flag.XBOX360-COMPLEX ]-[ partner of www.ssl-news.info ] [074/195]- \"complex-ac4.bf.d1.r71\" yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ (.+?) \\][ _-]{0,3}\\[ partner of www\\.ssl-news\\.info \\][ _-]{0,3}\\[\\d+\\/(\\d+\\])[ _-]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[ _-]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(TOWN)(www.town.ag ) (partner of www.ssl-news.info ) Twinz-Conversation-CD-FLAC-1995-CUSTODES [01/23] - #34;Twinz-Conversation-CD-FLAC-1995-CUSTODES.par2#34; - 266,00 MB - yEnc\n\t\tif (preg_match('/^\\(TOWN\\)\\(www\\.town\\.ag \\)[ _-]{0,3}\\(partner of www\\.ssl-news\\.info \\)[ _-]{0,3} (.+?) \\[\\d+\\/(\\d+\\][ _-]{0,3}(\"|#34;).+?)\\.(par2|rar|nfo|nzb)(\"|#34;)[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<TOWN><www.town.ag > <partner of www.ssl-news.info > Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ [01/22] - \"Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ.par2\" - 526,99 MB - yEnc\n\t\tif (preg_match('/^<TOWN><www\\.town\\.ag > <partner of www\\.ssl-news\\.info > (.+) \\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;).+?(\"|#34;).+?yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ TOWN ]-[ www.town.ag ]-[ ANIME ] [01/17] - \"[Chyuu] Nanatsu no Taizai - 12 [720p][D1F49539].par2\" - 585,03 MB yEnc\n\t\tif (preg_match('/^\\[ TOWN \\][ _-]{0,3}\\[ www\\.town\\.ag \\][ _-]{0,3}\\[ .* \\][ _-]{0,3}\\[\\d+\\/\\d+\\][ _-]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e2,\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function tempus(): TimeConverter\n {\n return new TimeConverter();\n }", "private function _getWeatherLink () {\n return sprintf(\n 'https://forecast.weather.gov/MapClick.php?textField1=%.4f&textField2=%.4f',\n $this->lat,\n $this->lon\n );\n }", "private function extractWeatherBitResult($json)\n {\n // check main data field\n if (!isset($json->data)) {\n $this->errorMsg = \"'data' field not found in the response object!\";\n return false;\n }\n // check main data field has records \n if (count($json->data) === 0) {\n $this->errorMsg = \"Weather forecast data not found in the response object!\";\n return false;\n }\n \n // display units will be different depends on selection\n $degree_simbol = $this->unit === 'FAHRENHEIT' ? \"<span>&#8457;&nbsp;</span>\" : \"<span>&#8451;&nbsp;</span>\";\n $wind_unit = $this->unit === 'FAHRENHEIT' ? \" m/h\" : \" m/s\";\n\n // weatherBit provide daily forecast data\n foreach ($json->data as $day_data) {\n $weather = (object)[];\n $weather->dt = $day_data->valid_date; // date\n $weather->wind = number_format(floatval($day_data->wind_spd), 2) . $wind_unit;\n $weather->humidity = $day_data->rh . \"%\";\n $weather->temp = $day_data->temp . $degree_simbol;\n $weather->temp_min = round($day_data->min_temp) . $degree_simbol;\n $weather->temp_max = round($day_data->max_temp) . $degree_simbol;\n $weather->description = $day_data->weather->description;\n // make icon image url using icon code\n $weather->icon = \"https://www.weatherbit.io/static/img/icons/\" . $day_data->weather->icon . \".png\";\n array_push($this->forecast, $weather);\n } \n return true;\n }", "public function transformTemperature(float $temperature): float;", "public function getWeatherData()\n {\n return $this->service->getWeatherData();\n }", "public function convert($name);", "abstract public function Convert($data);", "public function convertToSite($data){\n\t\tforeach($data as $fieldName => $value){\n\n\t\t\tif(isset($this -> convertMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteId($this -> convertMap[$fieldName], $data[$fieldName]);\n\t\t\t}\n\n\t\t\tif(isset($this -> convertTimeMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteTime($data[$fieldName]);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getWeather($xml_path,$country){\n\t\t// code of beirut (w=56051360)\n\t\t// type of temp:u=c\n\t\t// Current Conditions: static words in the xml file.\n\t\t//$xml_path = \"http://weather.yahooapis.com/forecastrss?w=56051360&u=c\";\n\t\t$xmlInfo = simplexml_load_file ( $xml_path );\n\t\t\n\t\t// Mostly Cloudy, 50 F (la virgule utiliser dans la methode et la mem utilise de ce ligne);\n\t\t$arrayWeather=explode(',',$xmlInfo->channel->item->description) ;\n\t\t$arrayWeather=explode('<BR />',$arrayWeather[1]) ;\n\t\t$info= str_replace ( '<br/>', ' ', $arrayWeather[0] );\n\t\treturn $country.\" \".$info;\n\t}", "protected function _parseCurrent($current)\n {\n // The Current object takes care of the parsing/mapping.\n return new Horde_Service_Weather_Current_WeatherUnderground((array)$current, $this);\n }", "function pull_weather_for_day( \n $y = 2014,\n $m = 01,\n $d = 01,\n &$error = false )\n {\n // Build the URL to fetch\n //\n $date = date( 'Y', mktime( 0, 0, 0, $m, $d, $y ) )\n .date( 'm', mktime( 0, 0, 0, $m, $d, $y ) )\n .date( 'd', mktime( 0, 0, 0, $m, $d, $y ) );\n $url = sprintf( $this->_api, WU_KEY, $date );\n\n // Get the url and create a json object\n //\n if ( ! $contents = @file_get_contents( $url ) ) {\n $error = \"Error getting the file contents\";\n return false;\n }\n $json = json_decode( $contents );\n\n // Run through the array and build out the hours\n //\n $observations = $json->history->observations;\n $conditions = array();\n if ( is_array( $observations ) && count( $observations ) > 0 ) {\n foreach ( $observations as $key => $data ) {\n $hour = $data->date->hour;\n $conditions[$hour][ 'temp' ] = $data->tempi;\n $conditions[$hour][ 'cond' ] = $data->conds;\n }\n } else {\n $error = \"The observations json object was empty\";\n return false;\n }\n\n // Now get the daily summary and make it key 24\n //\n $summary = $json->history->dailysummary;\n if ( is_array( $summary ) && count( $summary ) > 0 ) {\n foreach ( $summary as $data ) {\n $conditions[ 'day' ][ 'mint' ] = $data->mintempi;\n $conditions[ 'day' ][ 'maxt' ] = $data->maxtempi;\n $conditions[ 'day' ][ 'noon' ] = $conditions[12][ 'cond' ];\n $conditions[ 'day' ][ 'rain' ] = $data->rain;\n $conditions[ 'day' ][ 'fog' ] = $data->fog;\n $conditions[ 'day' ][ 'snow' ] = $data->snow;\n $conditions[ 'day' ][ 'hail' ] = $data->hail;\n $conditions[ 'day' ][ 'thunder' ] = $data->thunder;\n $conditions[ 'day' ][ 'tornado' ] = $data->tornado;\n }\n } else {\n $error = \"The daily summary json object was empty\";\n return false;\n }\n\n return $conditions;\n }", "public function mapDateTimeHandlesDifferentFieldEvaluationsDataProvider() {}", "public function getWeatherData($cityname){\r\n$ch = curl_init();\r\n$url = str_replace(\"<CITY_NAME>\", $cityname, OPENWEATHER_SERVICE_URI);\r\ncurl_setopt($ch , CURLOPT_HEADER,0);\r\ncurl_setopt($ch,CURLOPT_URL,$url);\r\ncurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\ncurl_setopt($ch,CURLOPT_VERBOSE,1);\r\ncurl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);\r\n$result = json_decode(curl_exec($ch),true);\r\n\r\n$http_status = curl_getinfo($ch ,CURLINFO_HTTP_CODE);\r\n\r\nif($http_status == 200){\r\n\t$this->openweatherData =$result;\r\n\tcurl_close($ch);\r\n}else{\r\n\t\r\n\t\r\n\t$errorMsg=$result['cod'];\r\n\t$errorDesc = $result['message'];\r\n\t\theader(\"Location: ./error.php?msg=\".$errorMsg.\"&desc=\".$errorDesc);\r\n}\r\n\r\n\r\n\r\n}", "function _wp_iso_convert($matches)\n {\n }", "private function getInterface() {\n return App::make(WeatherInterface::class);\n }", "public function __construct() {\n parent::__construct(\n 'get_weather',\n 'Get Weather Forecast',\n ['description' => __('A widget for showing weather forecast', 'getweather')]\n );\n }", "function local_to_iso($date,$date_format)\n{\n $list_date=explode (\"-\",$date);\n if ($date_format=='fr')\n {\n $date=$list_date[2].'-'.$list_date[1].'-'.$list_date[0];\n }\n elseif ($date_format=='en')\n $date=$list_date[2].'-'.$list_date[0].'-'.$list_date[1];\n return $date;\n}", "function local_to_iso($date,$date_format)\n{\n $list_date=explode (\"-\",$date);\n if ($date_format=='fr')\n {\n $date=$list_date[2].'-'.$list_date[1].'-'.$list_date[0];\n }\n elseif ($date_format=='en')\n $date=$list_date[2].'-'.$list_date[0].'-'.$list_date[1];\n return $date;\n}", "function convertTemp($temp, $unit1, $unit2)\n{\n // switch statement to see which unit the temp to be converted is set to\n // Then nested cases check which converted temp unit the user set\n // then based on each case a formula is applied and sets the $convertedTemp variable to be returned\n\n\n switch ($unit1) {\n case 'celsius':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 + 32;\n break;\n\n case 'kelvin':\n $convertedTemp = $temp + 273.15;\n break; \n }\n break; \n\n case 'kelvin':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 - 459.67;\n break;\n\n case 'celsius':\n $convertedTemp = $temp - 273.15;\n break;\n \n } \n break; \n\n case 'fahrenheit':\n switch ($unit2) {\n\n case 'celsius':\n $convertedTemp = ($temp - 32) * 5/9;\n break;\n\n case 'kelvin':\n $convertedTemp = ($temp + 459.67) * 5/9;\n break; \n }\n break;\n \n \n \n }\n // echo $convertedTemp; for testing and dev\n return $convertedTemp;\n\n // conversion formulas\n // Celsius to Fahrenheit = T(°C) × 9/5 + 32\n // Celsius to Kelvin = T(°C) + 273.15\n // Fahrenheit to Celsius = (T(°F) - 32) × 5/9\n // Fahrenheit to Kelvin = (T(°F) + 459.67)× 5/9\n // Kelvin to Fahrenheit = T(K) × 9/5 - 459.67\n // Kelvin to Celsius = T(K) - 273.15 \n\n}", "public function getData()\n\t{\n $data = [];\n\n $temperatures = new WorldTemperatures;\n\n foreach ($this->cities as $city) {\n $temperateInCelsius = $temperatures->fromLatLng($city['name'], $city['lat'], $city['long']);\n\n $celsius = round($temperateInCelsius);\n $fahrenheit = round(($temperateInCelsius * 1.8) + 32);\n\n $data[\"{$city['name']}\"] = \"{$celsius}/{$fahrenheit}\";\n }\n\n $data['dallas_season'] = $this->currentSeason();\n\n return $data;\n\t}", "public function fetchWeatherData($city) {\n $app_id = $this->configFactory->getEditable('weather.settings')->get('activities_d8.settings.appid');\n $url_string = \"https://api.openweathermap.org/data/2.5/weather?q=\" . $city . \"&appid=\" . $app_id;\n try {\n $res = $this->client->get($url_string);\n return Json::decode($res->getBody()->getContents())['main'];\n }\n catch (Exception $e) {\n return 'An error occured while fetching data';\n }\n }", "public function callPastWeather($loc_string, $date_safe) {\r\n $premiumurl = sprintf('http://api.worldweatheronline.com/premium/v1/past-weather.ashx?key=%s&q=%s&date=%s&format=json&tp=24', \r\n $this->_apikey, $loc_string, $date_safe);\r\n\r\n \r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $premiumurl);\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); \r\n $jsonResponse = curl_exec($ch);\r\n \r\n curl_close($ch);\r\n\r\n if (!$jsonResponse) {\r\n throw new WeatherException(\"Can't get past weather conditions\", WeatherException::SERVERERROR);\r\n }\r\n\r\n return json_decode($jsonResponse, false);\r\n }", "public function providerTransform()\n {\n return [\n [\"But Gollum, and the evil one\", Strings::TR_LOWER, \"but gollum, and the evil one\"],\n [\"Leaves are falling all around\", Strings::TR_UPPER, \"LEAVES ARE FALLING ALL AROUND\"],\n [\"It's timE I waS on my waY\", Strings::TR_TITLE, \"It's Time I Was On My Way\"],\n [\"sometimes I grow so tired\", Strings::TR_UC_FIRST, \"Sometimes I grow so tired\"],\n [\"But Gollum, and the evil one\", Strings::TR_LC_FIRST, \"but Gollum, and the evil one\"],\n [\"MaryHadALittleLamb\", Strings::TR_UNDERSCORE, \"mary_had_a_little_lamb\"],\n [\"mary_had_a_little_lamb\", Strings::TR_CAMEL_CASE, \"MaryHadALittleLamb\"]\n ];\n }", "public function getActual(string $location): array\n {\n $data = $this->askApi('weather?q=' . $location);\n $local_timestamp = $data['dt'] + $data['timezone'];\n\n $weather = [\n 'temp' => $data['main']['temp'],\n 'description' => $data['weather'][0]['description'],\n 'date' => new DateTime(\"@$local_timestamp\")\n ];\n\n return $weather;\n }", "public function testItReturnsFullWeatherReport()\n {\n $weather = json_decode($this->api->full_weather_report($this->location));\n\n $this->assertObjectHasAttribute('weather', $weather);\n $this->assertObjectHasAttribute('main', $weather);\n $this->assertObjectHasAttribute('wind', $weather);\n $this->assertObjectHasAttribute('clouds', $weather);\n }", "function get_tours_info($type){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t}\n\t$object = json_decode(file_get_contents($patch));\n\tforeach($object[0] as $key => $value){\n\t\tfor($i = 1; $i < count($value); $i++){\n\t\t\t$img_patch = $value[$i]->img;\n\t\t\t$scan = scandir('../../'.$img_patch);\n\t\t\tarray_splice($scan,0,2);\n\t\t\t$res_img = array();\n\t\t\tfor($j = 0; $j < count($scan); $j++){\n\t\t\t\t$img_res_patch = $img_patch.'/'.$scan[$j];\n\t\t\t\tarray_push($res_img,$img_res_patch);\n\t\t\t}\n\t\t\t$value[$i]->img = $res_img;\n\t\t}\n\t}\n\treturn json_encode($object[0]);\n}", "private function getOpenWeatherMap()\n {\n $url = 'https://api.openweathermap.org/data/2.5/forecast';\n $url .= '?lat=' . $this->location->lat;\n $url .= '&lon=' . $this->location->lng;\n $url .= '&units=' . ($this->unit === \"FAHRENHEIT\" ? \"imperial\" : \"metric\");\n $url .= '&appid=' . $GLOBALS['apikey_openweathermap'];\n $result = $this->callAPI($url);\n return $result ? $this->extractOpenWeatherMapResult(json_decode($result)) : false;\n }", "function entity_rewrite($entity_type, &$entity)\n{\n $translate = entity_type_translate_array($entity_type);\n\n // By default, fill $entity['entity_name'] with name_field contents.\n if (isset($translate['name_field'])) { $entity['entity_name'] = $entity[$translate['name_field']]; }\n\n // By default, fill $entity['entity_shortname'] with shortname_field contents. Fallback to entity_name when field name is not set.\n if (isset($translate['shortname_field'])) { $entity['entity_shortname'] = $entity[$translate['name_field']]; } else { $entity['entity_shortname'] = $entity['entity_name']; }\n\n // By default, fill $entity['entity_descr'] with descr_field contents.\n if (isset($translate['descr_field'])) { $entity['entity_descr'] = $entity[$translate['descr_field']]; }\n\n // By default, fill $entity['entity_id'] with id_field contents.\n if (isset($translate['id_field'])) { $entity['entity_id'] = $entity[$translate['id_field']]; }\n\n switch($entity_type)\n {\n case \"bgp_peer\":\n // Special handling of name/shortname/descr for bgp_peer, since it combines multiple elements.\n\n if (Net_IPv6::checkIPv6($entity['bgpPeerRemoteAddr']))\n {\n $addr = Net_IPv6::compress($entity['bgpPeerRemoteAddr']);\n } else {\n $addr = $entity['bgpPeerRemoteAddr'];\n }\n\n $entity['entity_name'] = \"AS\".$entity['bgpPeerRemoteAs'] .\" \". $addr;\n $entity['entity_shortname'] = $addr;\n $entity['entity_descr'] = $entity['astext'];\n break;\n\n case \"sla\":\n $entity['entity_name'] = 'SLA #' . $entity['sla_index'];\n if (!empty($entity['sla_target']) && ($entity['sla_target'] != $entity['sla_tag']))\n {\n if (get_ip_version($entity['sla_target']) === 6)\n {\n $sla_target = Net_IPv6::compress($entity['sla_target'], TRUE);\n } else {\n $sla_target = $entity['sla_target'];\n }\n $entity['entity_name'] .= ' (' . $entity['sla_tag'] . ': ' . $sla_target . ')';\n } else {\n $entity['entity_name'] .= ' (' . $entity['sla_tag'] . ')';\n }\n $entity['entity_shortname'] = \"#\". $entity['sla_index'] . \" (\". $entity['sla_tag'] . \")\";\n break;\n\n case \"pseudowire\":\n $entity['entity_name'] = $entity['pwID'] . ($entity['pwDescr'] ? \" (\". $entity['pwDescr'] . \")\" : '');\n $entity['entity_shortname'] = $entity['pwID'];\n break;\n }\n}", "public function testConvert() {\n $this->assertEquals(new Temperature('230.85', TemperatureUnit::CELSIUS), $this->temperatureKelvin->convert('C')->round(2));\n $this->assertEquals(new Temperature('447.53', TemperatureUnit::FAHRENHEIT), $this->temperatureKelvin->convert('F')->round(2));\n\n $this->assertEquals(new Temperature('32', TemperatureUnit::FAHRENHEIT), $this->temperatureCelsius->convert('F')->round());\n $this->assertEquals(new Temperature('273.15', TemperatureUnit::KELVIN), $this->temperatureCelsius->convert('K')->round(2));\n\n $this->assertEquals(new Temperature('18', TemperatureUnit::CELSIUS), $this->temperatureFahrenheit->convert('C')->round());\n $this->assertEquals(new Temperature('291.48', TemperatureUnit::KELVIN), $this->temperatureFahrenheit->convert('K')->round(2));\n }", "public function transformTweet($tweet){\n\t\t\t$t = array(); $e = array(); \n\t\t\tforeach(get_object_vars($tweet) as $k => $v){\n\t\t\t\tif(array_key_exists($k, $this->dbMap)){\n\t\t\t\t\t$key = $this->dbMap[$k];\n\t\t\t\t\t$val = $v;\n\t\t\t\t\tif(in_array($key, array(\"text\", \"source\"))){\n\t\t\t\t\t\t$val = (string) $v;\n\t\t\t\t\t} elseif(in_array($key, array(\"tweetid\", \"id\"))){\n\t\t\t\t\t\t$val = (string) $v; // Yes, I pass tweet id as string. It's a loooong number and we don't need to calc with it.\n\t\t\t\t\t} elseif($key == \"time\"){\n\t\t\t\t\t\t$val = strtotime($v);\n\t\t\t\t\t}\n\t\t\t\t\t$t[$key] = $val;\n\t\t\t\t} elseif($k == \"user\"){\n\t\t\t\t\t$t['userid'] = (string) $v->id_str;\n\t\t\t\t} elseif($k == \"retweeted_status\"){\n\t\t\t\t\t$rt = array(); $rte = array();\n\t\t\t\t\tforeach(get_object_vars($v) as $kk => $vv){\n\t\t\t\t\t\tif(array_key_exists($kk, $this->dbMap)){\n\t\t\t\t\t\t\t$kkey = $this->dbMap[$kk];\n\t\t\t\t\t\t\t$vval = $vv;\n\t\t\t\t\t\t\tif(in_array($kkey, array(\"text\", \"source\"))){\n\t\t\t\t\t\t\t\t$vval = (string) $vv;\n\t\t\t\t\t\t\t} elseif(in_array($kkey, array(\"tweetid\", \"id\"))){\n\t\t\t\t\t\t\t\t$vval = (string) $vv;\n\t\t\t\t\t\t\t} elseif($kkey == \"time\"){\n\t\t\t\t\t\t\t\t$vval = strtotime($vv);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$rt[$kkey] = $vval;\n\t\t\t\t\t\t} elseif($kk == \"user\"){\n\t\t\t\t\t\t\t$rt['userid'] = (string) $vv->id_str;\n\t\t\t\t\t\t\t$rt['screenname'] = (string) $vv->screen_name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$rte[$kk] = $vv;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$rt['extra'] = $rte;\n\t\t\t\t\t$e['rt'] = $rt;\n\t\t\t\t} else {\n\t\t\t\t\t$e[$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$t['extra'] = $e;\n\t\t\t$tt = hook(\"enhanceTweet\", $t, true);\n\t\t\tif(!empty($tt) && is_array($tt) && $tt['text']){\n\t\t\t\t$t = $tt;\n\t\t\t}\n\t\t\treturn $t;\n\t\t}", "public function getToday(){\n\t\ttry{\n\t\t\tif(!empty($this->_city) && !empty($this->_country)){\n\t\t\t\t//get the xml for the weather\n\t\t\t\t$this->url = str_replace(\"city\",$this->_city, $this->url);\n\t\t\t\t$this->url = str_replace(\"country\",$this->_country, $this->url);\n\t\t\t\t$this->url = str_replace(\" \",\"\",$this->url);\n\t\t\t\t$xml = utf8_encode(file_get_contents($this->url));\n\t\t\t\t$xml = simplexml_load_string($xml);\n\n\t\t\t\tif($xml->weather->current_conditions->condition['data']){ \n\t\t\t\t\t$this->today['currentWeather'] = $xml->weather->current_conditions->condition['data'];\n\t\t\t\t\t$this->today['currentTemperature'] = $xml->weather->current_conditions->temp_f['data'];\n\t\t\t\t\t$this->today['picture'] = $this->url_image.$xml->weather->current_conditions->icon['data'];\n\t\t\t\t\treturn $this->today;\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//log error +\n\t\t\tthrow new Exception (\"Error - please try again.\");\n\t\t}\n\t}", "protected function _parseStation($station)\n {\n // @TODO: Create a subclass of Station for wunderground, parse the\n // \"close stations\" and \"pws\" properties - allow for things like\n // displaying other, nearby weather station conditions etc...\n $properties = array(\n 'city' => $station->city,\n 'state' => $station->state,\n 'country' => $station->country_iso3166,\n 'country_name' => $station->country_name,\n 'tz' => $station->tz_long,\n 'lat' => $station->lat,\n 'lon' => $station->lon,\n 'zip' => $station->zip,\n 'code' => str_replace('/q/', '', $station->l)\n );\n\n return new Horde_Service_Weather_Station($properties);\n }", "public function convert($data);", "function fix_terr_unit (&$terr_unit, &$country) {\n\t\t//\tnew values\n\t\tswitch ($terr_unit) {\n\t\t\n\t\t\tcase 'WTF':\n\t\t\tcase 'XX':\n\t\t\t\t$terr_unit=null;\n\t\t\t\tbreak;\n\t\t\tcase 'GA':\n\t\t\t//\tWho even did this?\n\t\t\tcase 'Atlanta':\n\t\t\t\t$terr_unit='Georgia';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tcase 'SK':\n\t\t\t\t$terr_unit='Saskatchewan';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'BC':\n\t\t\t\t$terr_unit='British Columbia';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'ON':\n\t\t\t\t$terr_unit='Ontario';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'AB':\n\t\t\t\t$terr_unit='Alberta';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'QC':\n\t\t\t\t$terr_unit='Quebec';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'YK':\n\t\t\t\t$terr_unit='Yukon';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NT':\n\t\t\t\t$terr_unit='Northwest Territories';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NF':\n\t\t\t\t$terr_unit='Newfoundland and Labrador';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'MB':\n\t\t\t\t$terr_unit='Manitoba';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'CA':\n\t\t\t\t$terr_unit='California';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tcase 'NU':\n\t\t\t\t$terr_unit='Nunavut';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NB':\n\t\t\t\t$terr_unit='New Brunswick';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'MA':\n\t\t\t\t$terr_unit='Massachusetts';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tdefault:break;\n\t\t\n\t\t}\n\t\n\t}", "protected function get_wind( ) {\n// Format is dddssKT where ddd = degrees from North, ss = speed, KT for knots,\n// or dddssGggKT where G stands for gust and gg = gust speed. (ss or gg can be a 3-digit number.)\n// KT can be replaced with MPH for meters per second or KMH for kilometers per hour.\n\n if (preg_match('#^([0-9G]{5,10}|VRB[0-9]{2,3})(KT|MPS|KMH)$#',$this->current_group_text,$pieces)) {\n $this->wxInfo['ITEMS'][$this->tend]['CODE_WIND'] = $this->current_group_text;\n $this->current_group_text = $pieces[1];\n $unit = $pieces[2];\n if ($this->current_group_text == '00000') {\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = '0'; // no wind\n }\n else {\n preg_match('#([0-9]{3}|VRB)([0-9]{2,3})G?([0-9]{2,3})?#',$this->current_group_text,$pieces);\n if ($pieces[1] == 'VRB') {\n $direction = 'VAR';\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n }\n else {\n $angle = (integer) $pieces[1];\n $compass = array('N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW');\n $direction = $compass[round($angle / 22.5) % 16];\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION'] = round($angle / 22.5)*22.5;\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n// $this->wxInfo['WIND_DIRECTION_TEXT'] =round($angle / 22.5);\n }\n\n if (isset($pieces[3]) && trim($pieces[3])!='') $this->wxInfo['ITEMS'][$this->tend]['WIND_GUST'] = $this->convertSpeed($pieces[3], $unit);\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = $this->convertSpeed($pieces[2], $unit);\n }\n $this->current_ptr++;\n }\n $this->current_group++;\n }", "function transformServiceTemp(int $servicenumber): float {\n // 63 = 125 deg C\n\n $k = ((125 - 24) / (735 - 63))*-1;\n $m = (($k * 735) - 24)*-1;\n\n return $k*$servicenumber+$m;\n}", "function convert_this(){\r\n// keeping this around for history but we never want it to run by accident.\r\nreturn;\r\n\t$html = '<h3>Converting Yo!</h3>';\r\n\r\n\t$found_args = array(\r\n\t\t'posts_per_page' => 10,\r\n\t\t'post_type' => 'emc_content_focus', // emc_content_focus emc_common_core\r\n\t);\r\n\t$found = get_posts( $found_args );\r\n\r\n\tforeach( $found as $f ){\r\n\t\t$html .= get_the_title( $f->ID ) . '<br />';\r\n\r\n\t\t$related = get_post( $f->ID );\r\n\r\n\t\t$connected = get_posts( array(\r\n\t\t\t'connected_type' => 'content_foci_to_posts', // content_foci_to_posts common_core_to_posts\r\n\t\t\t'connected_items' => $related,\r\n\t\t\t'nopaging' => true,\r\n\t\t\t'suppress_filters' => false,\r\n\t\t\t'posts_per_page' => -1,\r\n\t\t));\r\n\r\n\t\t$term_title = get_the_title( $f->ID );\r\n\r\n\t\t$term_id = wp_insert_term( $term_title, 'emc_tax_found' ); // emc_tax_found, emc_tax_common_core\r\n\r\n\t\tforeach( $connected as $c ){\r\n\t\t\t$html .= '&nbsp; &nbsp;' . get_the_title( $c->ID ) .'<br />';\r\n\r\n\t\t\twp_set_post_terms( $c->ID, $term_id, 'emc_tax_found' ); // emc_tax_found, emc_tax_common_core\r\n\r\n\t\t} // foreach\r\n\r\n\r\n\t} // foreach\r\n\r\n//////////////////////\r\n\r\n\t$found_args = array(\r\n\t\t'posts_per_page' => 10,\r\n\t\t'post_type' => 'emc_common_core', // emc_content_focus emc_common_core\r\n\t);\r\n\t$found = get_posts( $found_args );\r\n\r\n\tforeach( $found as $f ){\r\n\t\t$html .= get_the_title( $f->ID ) . '<br />';\r\n\r\n\t\t$related = get_post( $f->ID );\r\n\r\n\t\t$connected = get_posts( array(\r\n\t\t\t'connected_type' => 'common_cores_to_posts', // content_foci_to_posts common_core_to_posts\r\n\t\t\t'connected_items' => $related,\r\n\t\t\t'nopaging' => true,\r\n\t\t\t'suppress_filters' => false,\r\n\t\t\t'posts_per_page' => -1,\r\n\t\t));\r\n\t\t$term_title = get_the_title( $f->ID );\r\n\r\n\t\t$term_id = wp_insert_term( $term_title, 'emc_tax_common_core' ); // emc_tax_found, emc_tax_common_core\r\n\r\n\t\tforeach( $connected as $c ){\r\n\t\t\t$html .= '&nbsp; &nbsp;' . get_the_title( $c->ID ) .'<br />';\r\n\r\n\t\t\twp_set_post_terms( $c->ID, $term_id, 'emc_tax_common_core' ); // emc_tax_found, emc_tax_common_core\r\n\t\t} // foreach\r\n\t} // foreach\r\n\treturn $html;\r\n}", "public function getDataWithTypeTsfe() {}", "function convertDevise ($montant,$devise) { // fonction de convertion euro/dollar\n \n if ($devise == 'euro') { // si la devise fourni est l'euro\n $resultat = $montant * 1.08596; \n $retour = array('resultat'=>$resultat,'devise'=>'dollars americains'); // on crée un tableau de retour\n } else {\n $resultat = $montant / 1.08596; // si la devise fourni est le dollar\n $retour = array('resultat'=>$resultat,'devise'=>'euro'); // on crée un tableau de retour\n }\n return $retour; // On renvoit le tableau de retour\n}", "public function convertCurrency($transaction) {\n if (is_array($transaction)) {\nreturn $this->convertCurrencyByArray($transaction);\n} else {\nreturn $this->convertCurrencyByAmount($transaction);\n}\n}", "abstract protected function transformItem($item);", "function convertInterest($interest)\n{\n $converted = $interest * .01;\n return $converted;\n}", "private function getWeatherBit()\n {\n $url = 'https://api.weatherbit.io/v2.0/forecast/daily';\n $url .= '?lat=' . $this->location->lat;\n $url .= '&lon=' . $this->location->lng;\n $url .= '&units=' . ($this->unit === \"FAHRENHEIT\" ? \"I\" : \"M\");\n $url .= '&days=3'; // default return 16 days forecast. Using forecast of 3 days.\n $url .= '&key=' . $GLOBALS['apikey_weatherbit'];\n $result = $this->callAPI($url);\n return $result ? $this->extractWeatherBitResult(json_decode($result)) : false;\n }", "abstract public function convert_from_storage($source);", "private function cleanSource()\n {\n $array = array();\n if ($this->source === 'ecb') {\n $array['base'] = 'EUR';\n foreach($this->data->Cube->Cube->Cube as $rate) {\n $array['rates'][(string) $rate['currency']] = (float) $rate['rate'];\n }\n $array['rates']['EUR'] = (float) 1.00;\n } else {\n $array['base'] = 'USD';\n foreach ($this->data->list->resources as $r) {\n foreach ($r->resource as $key => $val) {\n // only scrape currencies\n if ($key === 'fields') {\n if (stripos($val->name, '/') !== false) {\n $array['rates'][(string) substr($val->name, -3)] = (float) $val->price;\n }\n }\n }\n }\n $array['rates']['USD'] = (float) 1.00;\n }\n // sort alphabetically\n ksort($array['rates']);\n $this->data = $array;\n }", "public function fetchWeatherWeekly(){\n\t $url = \"http://opendata.cwb.gov.tw/opendata/MFC/F-C0032-005.xml\"; // 7days\n\t $forecasting = $this->fetchWeather($url);\n\t \n\t return $forecasting;\n\t}", "function reverse_geocode_data($data,$lat=0,$lng=0)\n{\n $data = @json_decode($data, 1);\n\n $_locale = [\"lat\"=>$lat,\"lng\"=>$lng,\"city\" => \"\", \"state\" => \"\", \"country\" => \"\", \"success\" => false];\n\n if (!isset($data['status']) || $data['status'] != \"OK\") {\n return $_locale;\n }\n\n foreach ($data['results'] as $localities) {\n\n foreach ($localities as $locality) {\n if(is_array($locality)) {\n foreach ($locality as $key => $locale) {\n\n if (isset($locale['types'])) {\n $types = $locale['types'];\n\n if ($types[0] == \"locality\") {\n $_locale['city'] = $locale['long_name'];\n }\n\n if ($types[0] == \"administrative_area_level_1\") {\n $_locale['state'] = $locale['long_name'];\n }\n\n if ($types[0] == \"country\") {\n $_locale['country'] = $locale['long_name'];\n }\n\n }\n }\n }\n }\n\n }\n\n $_locale['success'] = true;\n\n return $_locale;\n}", "function convertir($devisefrom, $montant)\n\n//verifie sie le montant est numerique sinon il me faut un nombre\n\n{\n\n if(!is_numeric(($montant))) return 'il me faut un nombre';\n if($devisefrom = \"EUR\"){\n $total=$montant*1.15023; //1 EUR =1,15023USD\n }\n else {\n $total=$montant*0.869310; //1 USD = 0,869310 EUR\n }\n return ($total);\n}", "function _fly_transform($new_source) {\n $tempFilename = tempnam(\"/tmp\", \"MODS_xml_initial_\");\n $data = str_replace(\n array('{|', '|}', '}', '{'), \n array('?', '?', '>', '<'), '{{|xml version=\"1.0\" |}}\n{xsl:stylesheet version=\"1.0\"\n xmlns:mods=\"http://www.loc.gov/mods/v3\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"}\n {xsl:template match=\"/ | @* | node()\"}\n {xsl:copy}\n {xsl:apply-templates select=\"@* | node()\" /}\n {/xsl:copy}\n {/xsl:template}\n {xsl:template match=\"/mods:mods/mods:relatedItem[@type=\\'host\\']/mods:titleInfo\"}{mods:titleInfo}{mods:title}' . $new_source . '{/mods:title}{/mods:titleInfo}{/xsl:template}\n{/xsl:stylesheet}');\n\n file_put_contents($tempFilename, $data);\n return $tempFilename;\n}" ]
[ "0.59779954", "0.52490383", "0.5229614", "0.52015024", "0.50478345", "0.50279", "0.50232196", "0.49629226", "0.49298123", "0.48858732", "0.48819107", "0.48781005", "0.48732093", "0.48292264", "0.4721378", "0.46817118", "0.46811825", "0.46627316", "0.4662636", "0.46371263", "0.46185556", "0.46063128", "0.45886415", "0.4576083", "0.45731062", "0.45727786", "0.45683452", "0.45616645", "0.45571202", "0.4556286", "0.45416844", "0.4540873", "0.45348334", "0.45328686", "0.45291045", "0.45099175", "0.4501735", "0.44879258", "0.44831467", "0.44421676", "0.44044453", "0.44018134", "0.4396305", "0.43850824", "0.4354277", "0.435379", "0.43305102", "0.43276215", "0.432133", "0.43009606", "0.4280196", "0.4279171", "0.42767704", "0.42720774", "0.4266593", "0.4259002", "0.42460948", "0.42405283", "0.42378917", "0.42259675", "0.42252854", "0.4224197", "0.42202818", "0.42139435", "0.42089048", "0.42069033", "0.4195108", "0.41925046", "0.41925046", "0.4191459", "0.41906556", "0.41716275", "0.41581705", "0.41267404", "0.41086298", "0.41022334", "0.40848982", "0.40824586", "0.4076845", "0.40765962", "0.4065113", "0.40636885", "0.4056416", "0.40533298", "0.40480098", "0.40477595", "0.40327534", "0.4020504", "0.40050358", "0.4004688", "0.40037754", "0.39873907", "0.3977575", "0.39731503", "0.3971566", "0.3961746", "0.39574632", "0.39556527", "0.39504918", "0.3947321" ]
0.68279433
0
Transforms temperature from provider
public function transformTemperature(float $temperature): float;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformServiceTemp(int $servicenumber): float {\n // 63 = 125 deg C\n\n $k = ((125 - 24) / (735 - 63))*-1;\n $m = (($k * 735) - 24)*-1;\n\n return $k*$servicenumber+$m;\n}", "private function calcTemp()\n\t{\n#\t\t#define CCS811_R_NTC 10000 // resistance of NTC at a reference temperature\n#\t\t#define CCS811_R_NTC_TEMP 25 // reference temperature for NTC\n#\t\t#define CCS811_BCONSTANT 3380 // B constant\n#\n#\t\t// get NTC resistance\n#\t\tuint32_t r_ntc = ccs811_get_ntc_resistance (sensor, CCS811_R_REF);\n#\n#\t\t// calculation of temperature from application note ams AN000372\n#\t\tdouble ntc_temp;\n#\t\tntc_temp = log((double)r_ntc / self::R_NTC); // 1\n#\t\tntc_temp /= self::B; // 2\n#\t\tntc_temp += 1.0 / (self::R_NTC_TEMP + 273.15); // 3\n#\t\tntc_temp = 1.0 / ntc_temp; // 4\n#\t\tntc_temp -= 273.15; // 5\n\t}", "public function getTemperature();", "function convertTemp($temp, $unit1, $unit2)\n{\n // switch statement to see which unit the temp to be converted is set to\n // Then nested cases check which converted temp unit the user set\n // then based on each case a formula is applied and sets the $convertedTemp variable to be returned\n\n\n switch ($unit1) {\n case 'celsius':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 + 32;\n break;\n\n case 'kelvin':\n $convertedTemp = $temp + 273.15;\n break; \n }\n break; \n\n case 'kelvin':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 - 459.67;\n break;\n\n case 'celsius':\n $convertedTemp = $temp - 273.15;\n break;\n \n } \n break; \n\n case 'fahrenheit':\n switch ($unit2) {\n\n case 'celsius':\n $convertedTemp = ($temp - 32) * 5/9;\n break;\n\n case 'kelvin':\n $convertedTemp = ($temp + 459.67) * 5/9;\n break; \n }\n break;\n \n \n \n }\n // echo $convertedTemp; for testing and dev\n return $convertedTemp;\n\n // conversion formulas\n // Celsius to Fahrenheit = T(°C) × 9/5 + 32\n // Celsius to Kelvin = T(°C) + 273.15\n // Fahrenheit to Celsius = (T(°F) - 32) × 5/9\n // Fahrenheit to Kelvin = (T(°F) + 459.67)× 5/9\n // Kelvin to Fahrenheit = T(K) × 9/5 - 459.67\n // Kelvin to Celsius = T(K) - 273.15 \n\n}", "function convertTemp($temp, $unit1, $unit2)\n { $newTemp = 0;\n if ($unit1 == 'celsius') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 32;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp + 273.15;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp;\n }\n } \n if ($unit1 == 'fahrenheit') {\n if ($unit2 == 'celsius') {\n $newTemp = ($temp -32) * 5/9;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = ($temp + 459.67) * 5/9;\n } elseif ($unit2 == 'fahrenheit') {\n $newTemp = $temp;\n } \n } \n if ($unit1 == 'kelvin') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 459.67;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp - 273.15;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp;\n } \n } \n return $newTemp;\n }", "public function transformWeather($weather): string;", "function transformBrewTemp(int $brewnumber): float {\n // 173 = 93 deg C\n\n $k = ((93 - 24) / (754 - 173))*-1;\n $m = (($k * 754) - 24)*-1;\n\n return $k*$brewnumber+$m;\n}", "protected function get_temperature( ) {\n// depending on the temperature, Heat Index or Wind Chill Temperature is calculated.\n// Format is tt/dd where tt = temperature and dd = dew point temperature. All units are\n// in Celsius. A 'M' preceeding the tt or dd indicates a negative temperature. Some\n// stations do not report dew point, so the format is tt/ or tt/XX.\n\n if (preg_match('#^(M?[0-9]{2})/(M?[0-9]{2}|[X]{2})?$#',$this->current_group_text,$pieces)) {\n $tempC = (integer) strtr($pieces[1], 'M', '-');\n $tempF = round(1.8 * $tempC + 32);\n $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_F'] = $tempF;\n $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_F'] = $tempF;\n $this->get_wind_chill($tempF);\n if (strlen($pieces[2]) != 0 && $pieces[2] != 'XX') {\n $dewC = (integer) strtr($pieces[2], 'M', '-');\n $dewF = convertTempToF($dewC);\n $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_C'] = $dewC;\n// $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_F'] = $dewF;\n $rh = round(100 * pow((112 - (0.1 * $tempC) + $dewC) / (112 + (0.9 * $tempC)), 8),1);\n $this->wxInfo['ITEMS'][$this->tend]['HUMIDITY'] = $rh;\n $this->get_heat_index($tempF, $rh);\n }\n $this->wxInfo['ITEMS'][$this->tend]['CODE_TEMPERATURE'] = $this->current_group_text;\n $this->current_ptr++;\n $this->current_group++;\n }\n else {\n $this->current_group++;\n }\n }", "abstract public function convertFromCelsius(float $degrees): float;", "function tempus(): TimeConverter\n {\n return new TimeConverter();\n }", "function temperaturConversion()\n {\n echo \"Enter temperature: \\n\";\n $temp = AlgorithmsUtility::get_Integer();\n echo \"Enter C for Celsius or F for Fahrenheit for the temperature you have input. \\n\";\n $chtemp = AlgorithmsUtility::get_String();\n\n if (strpos($chtemp, \"c\") === false && strpos($chtemp, \"C\") === false) {\n $conv = ($temp * 9 / 5) + 32;\n } else {\n $conv = ($temp - 32) * 5 / 9;\n }\n\n echo \"converted temperature is \" . $conv . \"\\n\";\n }", "public function getTemperature()\n {\n //no-op\n }", "public function testConvert() {\n $this->assertEquals(new Temperature('230.85', TemperatureUnit::CELSIUS), $this->temperatureKelvin->convert('C')->round(2));\n $this->assertEquals(new Temperature('447.53', TemperatureUnit::FAHRENHEIT), $this->temperatureKelvin->convert('F')->round(2));\n\n $this->assertEquals(new Temperature('32', TemperatureUnit::FAHRENHEIT), $this->temperatureCelsius->convert('F')->round());\n $this->assertEquals(new Temperature('273.15', TemperatureUnit::KELVIN), $this->temperatureCelsius->convert('K')->round(2));\n\n $this->assertEquals(new Temperature('18', TemperatureUnit::CELSIUS), $this->temperatureFahrenheit->convert('C')->round());\n $this->assertEquals(new Temperature('291.48', TemperatureUnit::KELVIN), $this->temperatureFahrenheit->convert('K')->round(2));\n }", "private function sensorsReadTemp()\n {\n // python's script using to read data from sensors\n $cmd = \"python /home/eker/Pulpit/tmp.py \";\n // read pin numbers for each room\n foreach ($this->rooms as $key => $value) {\n $cmd .= (string)$value[0] . ' ';\n }\n // var_dump($cmd);\n // exec return string, getFloats changes it to floats array\n // $temps = $this->getFloats(exec($cmd));\n $temps = [20, 21, 22, 19, 19];\n $i = 0;\n // for each room set current temperature\n foreach ($this->rooms as $key => $value) {\n $this->rooms[$key][1] = $temps[$i++];\n }\n }", "public function setTempCelsius() {\n\t\t$this->unit = 'celsius';\n\t}", "public function getTemperature(): string\n {\n return $this->temperature;\n }", "public function temperature() {\r\n\t\tApp::uses('TemperatureLib', 'Tools.Lib');\r\n\t\t$temperatureLib = new TemperatureLib();\r\n\t\t$units = $temperatureLib->getSupported();\r\n\t\t$this->set(compact('units'));\r\n\t\t$result = '';\r\n\t\tif ($this->Common->isPosted()) {\r\n\t\t\t$temperatureLib->set($this->request->data['Math']['value'], $this->request->data['Math']['unit']);\r\n\t\t\t$result = $temperatureLib->get($this->request->data['Math']['targetUnit'], true);\r\n\t\t}\r\n\r\n\t\t$this->set(compact('result'));\r\n\t}", "function convertToTsp ($inputUnit, $inputValue) {\n\tswitch ($inputUnit) {\n\t\tcase 'tsp':\n\t\t\t$valueConverted = $inputValue;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'tbsp':\n\t\t\t$valueConverted = $inputValue * 3;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'flOz':\n\t\t\t$valueConverted = $inputValue * 6;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'cp':\n\t\t\t$valueConverted = $inputValue * 48;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'pt':\n\t\t\t$valueConverted = $inputValue * 96;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'qt':\n\t\t\t$valueConverted = $inputValue * 192;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t\tcase 'gal':\n\t\t\t$valueConverted = $inputValue * 768;\n\t\t\treturn $valueConverted;\n\t\t\tbreak;\n\t}\n}", "function f2c($tempValue)\r\n{\r\n\t$celsius=($tempValue-32)*(5/9);\r\n return round($celsius,2);\r\n}", "abstract public function transform();", "function convertir($devisefrom, $montant)\n\n//verifie sie le montant est numerique sinon il me faut un nombre\n\n{\n\n if(!is_numeric(($montant))) return 'il me faut un nombre';\n if($devisefrom = \"EUR\"){\n $total=$montant*1.15023; //1 EUR =1,15023USD\n }\n else {\n $total=$montant*0.869310; //1 USD = 0,869310 EUR\n }\n return ($total);\n}", "public function getTemperature() {\n\t\treturn $this->temperature;\n\t}", "public function provideValidTemperature() {\n return [\n [32],\n [41.0],\n [99.9]\n ];\n }", "public function convertFahrenheitToCelsius($tempF){\n\t\t$tempC = ($tempF - 32)*0.556;\n\t\treturn $tempC;\n\t}", "public function transform($value);", "public function get_temperature($port_num)\n {\n $current_temp = floatval($this->xml->ports->port[$port_num]->condition[0]->currentReading);\n \n return $current_temp;\n }", "function read_temperater()\n{\n $path = '/sys/bus/w1/devices/28-000008e54110/w1_slave';\n\t$lines = file($path);\n\t$temp = explode('=', $lines[1]);\n $temp = number_format($temp[1] / 1000,2,'.','');\n \n\treturn $temp;\n\t\n}", "public function getTemperature() {\n\t\treturn $this->_temperature;\n\t}", "private function setTemperature($chosenCity) {\n $this->cityTemperature = $this->cities[$chosenCity]['Temp']; \n }", "function f2c ($value){\n $celsius=($value-32)/9*5;\n return $celsius;\n }", "function transformEntry($timeTrackerEntry);", "public function ttsWeather() {\n\t\t// https://www.prevision-meteo.ch/uploads/pdf/recuperation-donnees-meteo.pdf\n\t\t$data = json_decode(file_get_contents(Flight::get(\"ttsWeather\")),true);\n\n\t\t$txt = \"Bonjour, voici la météo pour aujourd'hui: Il fait actuellement \".$data['current_condition']['tmp'].\"°.\";\n\t\t$txt .= \" Les températures sont prévues entre \".$data['fcst_day_0']['tmin'].\" et \".$data['fcst_day_0']['tmax'].\"°.\";\n\t\t$txt .= \" Conditions actuelles: \".$data['current_condition']['condition'].\", Conditions pour la journée: \".$data['fcst_day_0']['condition'];\n\t\tself::playTTS($txt);\n\t}", "function kelvin_to_celcius($k){\r\n $d = $k - 273.15;\r\n return $d;\r\n }", "function Photonfill_Transform() {\n\treturn Photonfill_Transform::instance();\n}", "public function transform($transformationType, $value);", "function convertToCp ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0208333;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 2;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 4;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 16;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "public function provideInvalidTemperature() {\n return [\n [100.1],\n [200],\n [-1],\n [28],\n [31.9],\n ['Whoops!'],\n ['39.7° F'],\n ];\n }", "public static function transformatorUscatJT(){\n $joasaTensiune=array(\n \"loj\" => Converter::from('length.mm')->to('length.m')->convert(1.5)->getValue(),\n \"g_oj\" => Converter::from('length.mm')->to('length.m')->convert(1)->getValue(),\n //2*0.5carton mm\n \"aoj\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n return $joasaTensiune;\n }", "function convertDevise ($montant,$devise) { // fonction de convertion euro/dollar\n \n if ($devise == 'euro') { // si la devise fourni est l'euro\n $resultat = $montant * 1.08596; \n $retour = array('resultat'=>$resultat,'devise'=>'dollars americains'); // on crée un tableau de retour\n } else {\n $resultat = $montant / 1.08596; // si la devise fourni est le dollar\n $retour = array('resultat'=>$resultat,'devise'=>'euro'); // on crée un tableau de retour\n }\n return $retour; // On renvoit le tableau de retour\n}", "public function setTemperature($value) {\n\t\t$this->_temperature = $value;\n\t}", "public function getTintTransform() {}", "public function getTintTransform() {}", "public static function transformer();", "public function transform($value)\n {\n return $value;\n }", "public function setTempFahrenheit() {\n\t\t$this->unit = 'fahrenheit';\n\t}", "public static function convertFahrenheitToCelsius($value)\n {\n if (is_array($value)) {\n foreach ($value as $key=>$v) {\n $value[$key] = self::convertFahrenheitToCelsius($v);\n }\n } else {\n $value = ($value - 32) * 5 / 9;\n }\n\n return $value;\n }", "public function convert();", "public function toCelsius(): self\n {\n return new static($this->value);\n }", "abstract public function convertToCelsius(float $degrees): float;", "function convertInterest($interest)\n{\n $converted = $interest * .01;\n return $converted;\n}", "abstract protected function doActualConvert();", "function c2f ($value){\n $fahrenheit=$value/5*9+32;\n return $fahrenheit;\n }", "function darkSky_getTemp($latlong) {\n\tglobal $client;\n\ttry {\n\t\t$response = $client->request('get',\"$latlong\");\n\t} catch (Exception $e) {\n\t\tprint \"error on get temp from dark web $lat $long\\n\";\n\t\t$a=print_r($e,true);\n\t\terror_log($a);\n\t\treturn \"Temperature Error on fetch\";\n\t}\n\t$body = (string) $response->getBody();\n\t$jbody = json_decode($body);\n\tif (!$jbody) {\n\t\treturn \"error on decoding json\";\n\t}\n\n\treturn $jbody->currently->temperature;\n}", "function translit($name)\r\n{\r\n $rus = array('а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я', ' ');\r\n $rusUp = array('А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', ' ');\r\n $lat = array('a', 'b', 'v', 'g', 'd', 'e', 'e', 'zh', 'z', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sh', '', 'i', '', 'e', 'u', 'ya', '-');\r\n $characters = 'abcdefghijklmnopqrstuvwxyz1234567890-_';\r\n\r\n $res = str_replace($rus, $lat, trim($name));\r\n $res = str_replace($rusUp, $lat, $res);\r\n\r\n $return = '';\r\n\r\n for ($i = 0; $i < strlen($res); $i++) {\r\n $c = strtolower(substr($res, $i, 1));\r\n if (strpos($characters, $c) === false)\r\n $c = '';\r\n $return .= $c;\r\n }\r\n\r\n $r = $return;\r\n\r\n if (DEV)\r\n xlogc('translit', $r, $name);\r\n\r\n return $r;\r\n\r\n}", "function convertToGal ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00130208;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00390625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.0078125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 0.125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 0.25;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "abstract public function convertFromRawValue($value);", "public function getTemperatureData($degreesC = True) { \n\t\t\n\t\tif(!count($this->sensors)) { \n\t\t\tthrow new Exception(\"No Sensors configured.\");\n\t\t}\n\n\t\t$hasTempSensor = False;\n\t\tforeach($this->sensors as $thisSensor) { \n\t\t\tif($thisSensor['type'] == self::sensorTypeTemperature) { \n\t\t\t\t$hasTempSensor = True;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!count($this->sensors)) { \n\t\t\tthrow new Exception(\"No Temperature Sensors configured.\");\n\t\t}\n\t\t\n\t\t/**\n\t\t * 1. Write the config file\n\t\t * 2. run the program polling all sensors\n\t\t * 3. parse the output and return an array keyed on sensor address\n\t\t */\n\t\t\n\t\t$this->writeConf();\n\t\t\n\t\tlist($status,$output) = $this->runBashCommand(\n\t\t\t$this->programFile\n\t\t\t\t.' -qa'\n\t\t\t\t.\" -c {$this->configFileName}\"\n\t\t\t,\"Polling all temperature sensors\"\n\t\t);\n\n\t\tif($status == 0) { \n\t\t\t$tempDataPos = ($degreesC ? $this->CPos : $this->FPos);\n\t\t\t$tempData = array();\n\t\t\tforeach($output as $outputLine) { \n\t\t\t\t$data = explode(' ', $outputLine);\n\t\t\t\tif(isset($data[$this->SPos]) && $data[$this->SPos] == $this->SWord ) { \n\t\t\t\t\t$tempData[$data[$this->APos]] = $data[$tempDataPos];\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn($tempData);\n\t\t} else { \n\t\t\tthrow new Exception(implode(\"\\n\", $output));\n\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t}", "public function getTempUnitSign() {\n\t\tif( $this->getTempUnit() == 'celsius' ) {\n\t\t\treturn 'C';\n\t\t} else {\n\t\t\treturn 'F';\n\t\t}\n\t}", "public function testTemperatureSummary()\n {\n }", "public function getData()\n\t{\n $data = [];\n\n $temperatures = new WorldTemperatures;\n\n foreach ($this->cities as $city) {\n $temperateInCelsius = $temperatures->fromLatLng($city['name'], $city['lat'], $city['long']);\n\n $celsius = round($temperateInCelsius);\n $fahrenheit = round(($temperateInCelsius * 1.8) + 32);\n\n $data[\"{$city['name']}\"] = \"{$celsius}/{$fahrenheit}\";\n }\n\n $data['dallas_season'] = $this->currentSeason();\n\n return $data;\n\t}", "public function setTemps($temps)\n {\n $this->temps = $temps;\n\n return $this;\n }", "public function resolveTransformedValue($value)\n {\n return transform($value, $this->transformCallback ?? function ($value) {\n return $value;\n });\n }", "function translate($latitude, $longitude, $lateralMeters, $longitudalMeters) {\n\t\t$longitudal = $this -> translateLongitude($latitude, $longitude, $longitudalMeters);\n\t\treturn $this -> translateLatitude($longitudal[0], $longitudal[1], $lateralMeters);\n\t}", "protected function transform($key, $value)\n {\n if (in_array($key, $this->except, true)) {\n return $value;\n }\n\n preg_match('/[1-9]\\d*(\\,\\d+)?/', $value, $matches);\n\n if (count($matches) == 1) {\n $value = str_replace(',', '.', $value);\n\n return $value;\n }\n\n return $value;\n }", "public function getTempUnit() {\n return $this->cTempUnit;\n }", "function getTempo()\r\n {\r\n return $this->getData(DATE_FORMAT_UNIXTIME);\r\n }", "private function decodeCurrentWeather() {\n //if delte between two rains with time distance 10m > 0.1 - raining\n if ($this->getRainInLast(10) > 0.1) {\n return (object)[\n 'name' => $this->lang->weathers->rain,\n 'icon' => $GLOBALS['weather_icons']->rain\n ];\n } else if ($this->getCurrentWind()['speed'] > 10) {\n // when wind is > 35KPH\n return (object)[\n 'name' => $this->lang->weathers->wind,\n 'icon' => $GLOBALS['weather_icons']->wind\n ];\n } else if ($this->getCurrentDewPoint() - $this->getCurrentTemp() < 2.5) {\n //when delta between dew point and temperature is < 2.5 C\n return (object)[\n 'name' => $this->lang->weathers->mist,\n 'icon' => $GLOBALS['weather_icons']->mist\n ];\n } else {\n $hour = date(\"H\");\n\n //others I cant detect easy just say its partly_cloudy\n return (object)[\n 'name' => $this->lang->weathers->partly_cloudy,\n 'icon' => ($hour > 6 && $hour < 20) ? $GLOBALS['weather_icons']->partly_cloudy->day : $GLOBALS['weather_icons']->partly_cloudy->night\n ];\n }\n \n }", "function convertToFlOz ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.166667;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 8;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 16;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 32;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 128;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "private function modelToNorm(mixed $value): mixed\n {\n try {\n foreach ($this->config->getModelTransformers() as $transformer) {\n $value = $transformer->transform($value);\n }\n } catch (TransformationFailedException $exception) {\n throw new TransformationFailedException(sprintf('Unable to transform data for property path \"%s\": ', $this->getPropertyPath()).$exception->getMessage(), $exception->getCode(), $exception, $exception->getInvalidMessage(), $exception->getInvalidMessageParameters());\n }\n\n return $value;\n }", "function getTemp($latlong) {\n\t$cache = getTemperatureFromCache($latlong);\n\n\tif ($cache != null) {\n\t\t$diff = time()-$cache['updateTime'];\n\t\tif ($diff < 3600) {\n\t\t\t$temp = $cache['temp'];\n\t\t\t$t =$cache['updateTime'];\n\t\t\treturn array(\"temp\"=>$temp,\"updateTime\"=>$t,\"cache\"=>\"y\");\n\t\t}\n\t}\n\n\t$temp = darksky_getTemp($latlong);\n\n\taddTemp($latlong,$temp);\n\treturn array(\"temp\"=>$temp,\"updateTime\"=>time());\n}", "public function getInputTempUnit() {\n return $this->cInputTempUnit;\n }", "function check_temp($temperature){\n\tif($temperature < 18 || $temperature > 27){\n\t\treturn '<td class =\"fail_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t} else {\n\t\treturn '<td class =\"ok_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t}\n }", "public function getTemperature($from, $to = null) {\n $temperatureMapper = new Application_Model_TemperatureMapper();\n $temperatures = $temperatureMapper->fetchAll($from, $to);\n $temperature = array();\n $humidity = array();\n\n foreach ($temperatures as $tp) {\n $data = array(strtotime($tp->getTimestamp()) * 1000, $tp->getTemperature());\n $temperature[] = $data;\n $data = array(strtotime($tp->getTimestamp()) * 1000, $tp->getHumidity());\n $humidity[] = $data;\n }\n\n return array('temperature' => $temperature, 'humidity' => $humidity);\n }", "function lat_long_conversion_to_numbers($originalSref) {\n $splitOriginalSref = explode(' ', $originalSref);\n //if the last character of the latitude is S (south) then the latitude is negative.\n if (substr($splitOriginalSref[0], -1)==='S')\n $splitOriginalSref[0] = '-'.$splitOriginalSref[0];\n //always chop off the N or S from the end of the latitude.\n $splitOriginalSref[0] = substr_replace($splitOriginalSref[0],\"\",-1);\n //convert from string to a number for actual use.\n $convertedSref['lat'] = floatval($splitOriginalSref[0]);\n //if the last character of the latitude is W (west) then the longitude is negative.\n if (substr($splitOriginalSref[1], -1)==='W')\n $splitOriginalSref[1] = '-'.$splitOriginalSref[1];\n //always chop off the E or W from the end of the longitude.\n $splitOriginalSref[1] = substr_replace($splitOriginalSref[1],\"\",-1);\n //convert from string to a number for actual use.\n $convertedSref['long'] = floatval($splitOriginalSref[1]);\n return $convertedSref;\n }", "function celciusToFahrenheit($celcius)\n{\n $conversi=($celcius*9/5)+32;\n\n echo \"$celcius celcius = $conversi fahrenheit\";\n}", "function parseWeather()\n\t{\n\t\tif(sizeof($this->racine->loc->dnam)>0)\n\t\t{\n\t\t$this->stationNom = $this->racine->loc->dnam;\n\t\t$this->stationLat = $this->racine->loc->lat;\n\t\t$this->stationLon = $this->racine->loc->lon;\n\t\t\n\t\t$this->dirVentDeg = $this->racine->cc->wind->d;\n\t\t$this->dirVentTxt = $this->racine->cc->wind->t;\n\t\t$this->vitVentKmh = $this->racine->cc->wind->s;\n\t\t$this->rafaleVent = $this->racine->cc->wind->gust;\n\t\t$this->vitVentUs = $this->racine->head->us;\n\t\t$this->vitVentMps = 1000*$this->vitVentKmh/3600.0;\n\t\t\n\t\t$this->pressionAt = $this->racine->cc->bar->r;\n\t\t$this->pressionUp = $this->racine->head->up;\n\t\t$evol = $this->racine->cc->bar->d;\n\t\tswitch($evol){\n\t\t\tcase 'rising':$this->pressEvol = \"en hausse\";break;\n\t\t\tdefault: $this->pressEvol = $evol;\n\t\t}\n\t\t\n\t\t$this->humidite = $this->racine->cc->hmid;\n\t\t$this->visibilite = $this->racine->cc->vis;\n\t\t\n\t\t$this->forceUVval = $this->racine->cc->uv->i;\n\t\t$this->forceUVtxt = $this->racine->cc->uv->t;\n\t\t\n\t\t$this->dewPoint = $this->racine->cc->dewp;\n\t\t\n\t\t$this->temperature = $this->racine->cc->tmp;\n\t\t\n\t\t$this->lastMesure = $this->racine->cc->lsup;\n\t\t\n\t\t$couvert = $this->racine->cc->t;\n\t\tswitch($couvert){\n\t\t\tcase 'Mostly Cloudy':$this->couverture = 'Nuages épars';break;\n\t\t\tcase 'Cloudy':$this->couverture = 'Quelques Nuages';break;\n\t\t\tdefault: $this->couverture = $couvert; break;\n\t\t}\n\t\t\n\t\t$phase = $this->racine->cc->moon->t;\n\t\tswitch($phase){\n\t\t\tcase 'Waxing Crescent':$this->phaseLune='1er croissant';break;\n\t\t\tdefault: $this->phaseLune=$phase;break;\n\t\t}\n\t }\n\t}", "function convertToTbsp ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.333333;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 2;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 16;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 32;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 64;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 256;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "function convertToPt ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0208333;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 2;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 8;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "public function providerTransform()\n {\n return [\n [\"But Gollum, and the evil one\", Strings::TR_LOWER, \"but gollum, and the evil one\"],\n [\"Leaves are falling all around\", Strings::TR_UPPER, \"LEAVES ARE FALLING ALL AROUND\"],\n [\"It's timE I waS on my waY\", Strings::TR_TITLE, \"It's Time I Was On My Way\"],\n [\"sometimes I grow so tired\", Strings::TR_UC_FIRST, \"Sometimes I grow so tired\"],\n [\"But Gollum, and the evil one\", Strings::TR_LC_FIRST, \"but Gollum, and the evil one\"],\n [\"MaryHadALittleLamb\", Strings::TR_UNDERSCORE, \"mary_had_a_little_lamb\"],\n [\"mary_had_a_little_lamb\", Strings::TR_CAMEL_CASE, \"MaryHadALittleLamb\"]\n ];\n }", "public function temperature()\n {\n return $this->hasOne(Temperature::class)->select(['min_temp', 'max_temp']);\n }", "public function getGroundSignTemperature()\n {\n return substr($this->rawGroundWithoutSnow, 2, 1);\n }", "function getMontantTTCArticle($numserie) {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->article[$numserie]['montantTTC']));\n else return 0;\n }", "public function transformTelNum($num, $format)\r\n {\r\n if ($format == \"00\") {\r\n if (strpos($num, \"+\") !== false) {\r\n return substr_replace($num, '00', 0, -12);\r\n } elseif (strpos($num, \"00\") !== false) {\r\n return $num;\r\n } else {\r\n return \"0030\" . $num;\r\n }\r\n } elseif ($format == \"+\") {\r\n if (strpos($num, '+') !== false) {\r\n return $num;\r\n } elseif (strpos($num, '00') !== false) {\r\n return substr_replace($num, '+', 0, -12);\r\n } else {\r\n return \"+30\" . $num;\r\n }\r\n } else {\r\n if (strpos($num, \"+\") !== false) {\r\n return $num;\r\n } elseif (strpos($num, \"00\") !== false) {\r\n return substr_replace($num, '+', 0, -12);\r\n } else {\r\n return \"+30\" . $num;\r\n }\r\n }\r\n }", "function convert_cm_to_feet($cm_value)\n{\n\t//TODO: Convert cm to feet eg. 5'7\n\treturn $cm_value;\n}", "public function transform($location, array $options = []);", "protected function doTransform($value)\n {\n $value = mb_trim($value);\n $regex = '/^(\\d\\d?)[\\.\\:]?(\\d\\d)?\\s*(am|pm)?$/i';\n $matches = null;\n if (!preg_match($regex,$value,$matches)) $this->triggerError();\n $hour = $matches[1];\n $min = isset($matches[2]) ? $matches[2] : false;\n\t\t$am_or_pm = isset($matches[3]) ? $matches[3] : false;\n\t\tif ($min===false && $am_or_pm===false) $this->triggerError();\n $hour = (int) ltrim($hour,'0');\n if ($hour>23 || ($am_or_pm!==false && $hour>12)) $this->triggerError();\n $min = (int) ltrim($min,'0');\n if ($min>59) $this->triggerError();\n\n if (strcasecmp($am_or_pm,'pm')===0) {\n $hour += 12;\n if ($hour==24) $hour=12;\n } elseif (strcasecmp($am_or_pm,'am')===0 && $hour==12) {\n $hour = 0;\n }\n\n return $hour*60*60 + $min*60;\n }", "function conv($t) {\n$t*=1.8;\n$t+=32;\nreturn($t);}", "function getMontantTVAArticle($numserie) {\n // if ($this->calculmontant) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantTTC'] - $this->article[$numserie]['montantHT'])));\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantHT'] * ($this->TVA / 100))));\n else return 0;\n }", "public function transform($value, $field, $source, $destination);", "public function renderAppliesCorrectTimestampConversionDataProvider() {}", "abstract public function transformResource($resource);", "private static function getTSFE() {}", "public static function fromArray($mashTemperatureInfo)\n {\n // build a Temperature object from the subarray\n $temperatureInfo = $mashTemperatureInfo[\"temp\"];\n $temperatureObject = Temperature::fromArray($temperatureInfo);\n\n // build and return a new MashTemperature object\n return new MashTemperature(\n $temperatureObject,\n $mashTemperatureInfo[\"duration\"]\n );\n }", "private function _pxToCm($value) {\n return $value * 0.264583333; //($value*25.4)/150;\n }", "public function convert_timepoints_to_numbers($array) {\n\n // Just the first row\n $header = $array[0];\n // We don't want to filter the header\n $data = array_slice($array, 1);\n\n // Get an array of the timepoint column indices, ordered properly.\n // See function for details.\n $ordered_levels = array_keys(self::ordered_columns_of_type($header, 0));\n\n // Loop through the data, casting each timepoint column value to a float.\n foreach ($data as $m => $row) {\n foreach ($ordered_levels as $n) {\n $data[$m][$n] = (float) $data[$m][$n];\n }\n }\n\n // Prepend the header row back on and then return it.\n array_unshift($data, $header);\n return $data;\n }", "function fix_terr_unit (&$terr_unit, &$country) {\n\t\t//\tnew values\n\t\tswitch ($terr_unit) {\n\t\t\n\t\t\tcase 'WTF':\n\t\t\tcase 'XX':\n\t\t\t\t$terr_unit=null;\n\t\t\t\tbreak;\n\t\t\tcase 'GA':\n\t\t\t//\tWho even did this?\n\t\t\tcase 'Atlanta':\n\t\t\t\t$terr_unit='Georgia';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tcase 'SK':\n\t\t\t\t$terr_unit='Saskatchewan';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'BC':\n\t\t\t\t$terr_unit='British Columbia';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'ON':\n\t\t\t\t$terr_unit='Ontario';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'AB':\n\t\t\t\t$terr_unit='Alberta';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'QC':\n\t\t\t\t$terr_unit='Quebec';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'YK':\n\t\t\t\t$terr_unit='Yukon';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NT':\n\t\t\t\t$terr_unit='Northwest Territories';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NF':\n\t\t\t\t$terr_unit='Newfoundland and Labrador';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'MB':\n\t\t\t\t$terr_unit='Manitoba';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'CA':\n\t\t\t\t$terr_unit='California';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tcase 'NU':\n\t\t\t\t$terr_unit='Nunavut';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'NB':\n\t\t\t\t$terr_unit='New Brunswick';\n\t\t\t\t$country='Canada';\n\t\t\t\tbreak;\n\t\t\tcase 'MA':\n\t\t\t\t$terr_unit='Massachusetts';\n\t\t\t\t$country='United States of America';\n\t\t\t\tbreak;\n\t\t\tdefault:break;\n\t\t\n\t\t}\n\t\n\t}", "function convertMoeda(&$valorMoeda){\r\n\t\t$valorMoedaAux = explode('.' , $valorMoeda);\r\n\t\tif(isset ($valorMoedaAux[1])){\r\n\t\t\t$valorMoeda= \"R$ \".$valorMoedaAux[0].','.$valorMoedaAux[1];\r\n\t\t}else{\r\n\t\t\t$valorMoeda = \"R$ \".$valorMoedaAux[0].','.'00';\r\n\t\t}\r\n\t\treturn $valorMoeda;\r\n\t}", "protected function getTypo3TempStatistics() {}", "public static function transformatorUscatIT($UIncercare){\n if($UIncercare<=3000)//Un[V]\n { \n $intaltaTensiune = array(\n \"loi\" => Converter::from('length.mm')->to('length.m')->convert(15)->getValue(),\n \"g_oi\" => Converter::from('length.mm')->to('length.m')->convert(1)->getValue(),\n //2*0.5carton mm\n \"aji\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n \"aii\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n }elseif($UIncercare<=10000 && $UIncercare>3000)\n {\n $intaltaTensiune = array(\n \"loi\" => Converter::from('length.mm')->to('length.m')->convert(20)->getValue(),\n \"g_oi\" => Converter::from('length.mm')->to('length.m')->convert(2.5)->getValue(),\n \"aji\" => Converter::from('length.mm')->to('length.m')->convert(15)->getValue(),\n \"aii\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n }elseif($UIncercare<=16000 && $UIncercare>10000)\n {\n $intaltaTensiune = array(\n \"loi\" => Converter::from('length.mm')->to('length.m')->convert(45)->getValue(),\n \"g_oi\" => Converter::from('length.mm')->to('length.m')->convert(4)->getValue(),\n \"aji\" => Converter::from('length.mm')->to('length.m')->convert(22)->getValue(),\n \"aii\" => Converter::from('length.mm')->to('length.m')->convert(25)->getValue(),\n );\n }\n \n return $intaltaTensiune;\n \n }", "public function convert() {\n $this->user->convert();\n }" ]
[ "0.65222853", "0.603927", "0.59274817", "0.58856416", "0.5828933", "0.57124704", "0.5670281", "0.56466025", "0.5594973", "0.55406135", "0.54981387", "0.5377333", "0.52948713", "0.5256976", "0.5212288", "0.52039695", "0.5155609", "0.5070553", "0.5015944", "0.49884307", "0.494129", "0.4935914", "0.4935577", "0.49291342", "0.49228433", "0.4896734", "0.48691285", "0.48494077", "0.48297024", "0.47974482", "0.4797158", "0.478511", "0.47747216", "0.4719298", "0.46947068", "0.46387145", "0.46254367", "0.46232224", "0.46202928", "0.46094275", "0.4607948", "0.4607948", "0.45822376", "0.456583", "0.45387673", "0.45331055", "0.4529864", "0.45262656", "0.44951615", "0.44667757", "0.44424084", "0.4433209", "0.442443", "0.4422843", "0.4412876", "0.44055128", "0.44006807", "0.4395963", "0.4395929", "0.43898666", "0.4366761", "0.4365863", "0.43493116", "0.4305442", "0.43017995", "0.42974222", "0.42925084", "0.42910904", "0.427417", "0.4270249", "0.42624146", "0.4250683", "0.42425695", "0.4241634", "0.4233468", "0.42233357", "0.42075086", "0.41978958", "0.41822097", "0.41806862", "0.41804743", "0.4173635", "0.41661835", "0.41611037", "0.41589504", "0.41576883", "0.4151869", "0.4151779", "0.41490772", "0.41377372", "0.4135902", "0.4133093", "0.41297278", "0.41196346", "0.41172054", "0.41115916", "0.41101283", "0.41064942", "0.41064852", "0.4103502" ]
0.67334455
0
Bootstrap any application services.
public function boot() { view()->composer('layout-front.front', 'App\Http\Composers\FrontComposer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67912513", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.0
-1
Register any application services.
public function register() { $this->app->bind('App\SkinnyDope\Interfaces\ProductInterface', 'App\SkinnyDope\Repositories\ProductRepo'); $this->app->bind('App\SkinnyDope\Interfaces\ImageInterface', 'App\SkinnyDope\Repositories\ImageRepo'); $this->app->bind('App\SkinnyDope\Interfaces\CartInterface', 'App\SkinnyDope\Repositories\CartRepo'); $this->app->bind('App\SkinnyDope\Interfaces\BlurbInterface', 'App\SkinnyDope\Repositories\BlurbRepo'); $this->app->bind('App\SkinnyDope\Interfaces\EventInterface', 'App\SkinnyDope\Repositories\EventRepo'); $this->app->bind('App\SkinnyDope\Interfaces\UserInterface', 'App\SkinnyDope\Repositories\UserRepo'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
This method will add missing permissions for a user
private function addGroupsAccordingToMapping(MediawikiGroups $mediawiki_groups, PFUser $user, Group $project) { $mediawiki_groups->add('*'); if ($user->isAnonymous()) { return; } if ($this->doesUserHaveSpecialAdminPermissions($user)) { $dar = $this->dao->getAllMediawikiGroups($project); } else { $dar = $this->dao->getMediawikiGroupsMappedForUGroups($user, $project); } foreach ($dar as $row) { $mediawiki_groups->add($row['real_name']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerPermissions(): void\n {\n Gate::before(static function (Authorizable $user, string $ability) {\n if (method_exists($user, 'checkPermissionTo')) {\n return $user->checkPermissionTo($ability) ?: NULL;\n }\n });\n }", "protected function fixPermission() {}", "public function an_authenticated_user_can_add_new_permissions()\n {\n $this->be($user = factory('App\\User')->create());\n\n \t$newPermission = factory('App\\Permission')->make();\n \t$request = $newPermission->toArray();\n \t$request['create'] = 1;\n \t$request['read'] = 1;\n \t$request['update'] = 1;\n \t$request['delete'] = 1;\n\n \t\n \t$this->post('permissions', $request);\n $this->assertDatabaseHas('permissions',[\n \t'name' => $newPermission->name . ' create'\n ]);\n\t\t$this->assertDatabaseHas('permissions',[\n \t'name' => $newPermission->name . ' read'\n ]);\n \t$this->assertDatabaseHas('permissions',[\n \t'name' => $newPermission->name . ' update'\n ]);\n $this->assertDatabaseHas('permissions',[\n \t'name' => $newPermission->name . ' delete'\n ]);\n }", "public function testThatAddPermissionsThrowsExceptionIfPermissionsAreMissing()\n {\n $api = new MockManagementApi();\n\n try {\n $api->call()->users()->addPermissions( '__test_user_id__', [] );\n $caught_exception = false;\n } catch (InvalidPermissionsArrayException $e) {\n $caught_exception = true;\n }\n\n $this->assertTrue( $caught_exception );\n }", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function elevatePremissions() {\n\t\tif($user->group == 'USR'){\n\t\t\t$user->group = \"ROOT\";\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('This user group cannot elevate permissions');\n\t\t}\n\t}", "function updatePermissionsForUser($request, $user)\n{\n $userPermissionModel = new UserPermission;\n $userpermissions =\n $userPermissionModel->where([\n 'user_id' => $user->id\n ])->get();\n\n // store the permission IDs for the user in an array\n $permissionids = [];\n foreach ($userpermissions as $userpermission) {\n $permissionids[] = $userpermission->permission_id;\n }\n\n // check if the permissions $_POST array is empty and if it is make it an empty array\n if (!empty($request['permissions'])) {\n $permissions = $request['permissions'];\n } else {\n $permissions = [];\n }\n\n // delete permissions which were in tcp_user_permissions but have not been selected\n foreach ($permissionids as $userpermissionId) {\n if (!in_array($userpermissionId, $permissions)) {\n $userPermissionModel->where([\n 'permission_id' => $userpermissionId,\n 'user_id' => $user->id\n ])->delete();\n }\n }\n\n // add permissions which were not in tcp_user_permissions but have been selected\n foreach ($permissions as $permission) {\n if (!in_array($permission, $permissionids)) {\n $userPermissionModel->create([\n 'permission_id' => $permission,\n 'user_id' => $user->id\n ]);\n }\n }\n}", "function addUserPermissions($userRoleId, $userId)\n{\n $basePermissions = UserRole::find($userRoleId)->base_permissions;\n $permission = new Permission;\n $permission->getPermissions($basePermissions, $userId);\n\n return true;\n}", "public function registerUserPermissions()\n {\n return array(\n 'accessAmFormsExports' => array(\n 'label' => Craft::t('Access to exports')\n ),\n 'accessAmFormsFields' => array(\n 'label' => Craft::t('Access to fields')\n ),\n 'accessAmFormsForms' => array(\n 'label' => Craft::t('Access to forms')\n ),\n 'accessAmFormsSettings' => array(\n 'label' => Craft::t('Access to settings')\n )\n );\n }", "public function testThatAddPermissionsThrowsExceptionIfUserIdIsMissing()\n {\n $api = new MockManagementApi();\n\n try {\n $api->call()->users()->addPermissions( '', [] );\n $caught_message = '';\n } catch (EmptyOrInvalidParameterException $e) {\n $caught_message = $e->getMessage();\n }\n\n $this->assertContains( 'Empty or invalid user_id', $caught_message );\n }", "public function testPolicyPermissions()\n {\n // User of super admin role always has permission\n $role = factory(\\App\\Models\\Role::class)->make(['name' => 'Admin']);\n $this->roleRepository->create($role);\n $admin = $this->createUser(['role' => $role]);\n $this->assertTrue($admin->isSuperAdmin());\n $this->assertTrue($admin->can('create', User::class));\n\n // User of normal role does not have permission ...\n $user = $this->createUser();\n $this->assertFalse($user->isSuperAdmin());\n $this->assertFalse($user->can('create', User::class));\n $this->assertFalse($user->can('list', User::class));\n\n // ... even if it has module permission ..\n $role = $user->getRole();\n $this->roleRepository->addPermission($role, $this->permissionRepository->findBy('name', 'use-access-module'));\n $this->assertTrue($user->can('access', 'module'));\n $this->assertFalse($user->can('master', 'module'));\n $this->assertFalse($user->can('create', User::class));\n\n // ... until final permission is added\n $this->roleRepository->addPermission($role, $this->permissionRepository->findBy('name', 'user-create'));\n $this->assertTrue($user->can('create', User::class));\n $this->assertFalse($user->can('list', User::class));\n }", "function check_import_new_users($permission)\n {\n }", "public function shouldReturnForbiddenWhenUserDoesNotHavePermissions()\n {\n $this->user->permissions()->delete();\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint), [])->assertForbidden();\n }", "public function shouldReturnForbiddenWhenUserDoesNotHavePermissions()\n {\n $this->user->permissions()->delete();\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint), [])->assertForbidden();\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function testAddUserFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_users\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_user();\n }", "public function registerPermissions()\n {\n return [];\n }", "public function registerPermissions()\n {\n return [];\n }", "function upgradePermissions166()\n{\n Permission::model()->refreshMetaData(); // Needed because otherwise Yii tries to use the outdate permission schema for the permission table\n $oUsers=User::model()->findAll();\n foreach($oUsers as $oUser)\n {\n if ($oUser->create_survey==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='surveys';\n $oPermission->create_p=1;\n $oPermission->save();\n }\n if ($oUser->create_user==1 || $oUser->delete_user==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='users';\n $oPermission->create_p=$oUser->create_user;\n $oPermission->delete_p=$oUser->delete_user;\n $oPermission->update_p=1;\n $oPermission->read_p=1;\n $oPermission->save();\n }\n if ($oUser->superadmin==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='superadmin';\n $oPermission->read_p=1;\n $oPermission->save();\n }\n if ($oUser->configurator==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='settings';\n $oPermission->update_p=1;\n $oPermission->read_p=1;\n $oPermission->save();\n }\n if ($oUser->manage_template==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='templates';\n $oPermission->create_p=1;\n $oPermission->read_p=1;\n $oPermission->update_p=1;\n $oPermission->delete_p=1;\n $oPermission->import_p=1;\n $oPermission->export_p=1;\n $oPermission->save();\n }\n if ($oUser->manage_label==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='labelsets';\n $oPermission->create_p=1;\n $oPermission->read_p=1;\n $oPermission->update_p=1;\n $oPermission->delete_p=1;\n $oPermission->import_p=1;\n $oPermission->export_p=1;\n $oPermission->save();\n }\n if ($oUser->participant_panel==1)\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='global';\n $oPermission->uid=$oUser->uid;\n $oPermission->permission='participantpanel';\n $oPermission->create_p=1;\n $oPermission->save();\n }\n }\n $sQuery = \"SELECT * FROM {{templates_rights}}\";\n $oResult = Yii::app()->getDb()->createCommand($sQuery)->queryAll();\n foreach ( $oResult as $aRow )\n {\n $oPermission=new Permission;\n $oPermission->entity_id=0;\n $oPermission->entity='template';\n $oPermission->uid=$aRow['uid'];\n $oPermission->permission=$aRow['folder'];\n $oPermission->read_p=1;\n $oPermission->save();\n }\n}", "public static function addPermissionToUser($user_id, $permission_name){\n if (\\Yii::$app->authManager\n ->checkAccess($user_id,\n $permission_name) === false) {\n\n if (self::authManager()->getPermission($permission_name) == NULL) {\n self::createPermission($permission_name, 'The permission for one account\\'s credentials data.');\n }\n\n $role = self::authManager()->createRole($permission_name . '-r4uid-' . $user_id);\n\n // add parent item.\n self::authManager()->add($role);\n $permission = self::authManager()->getPermission($permission_name);\n // add child item.\n self::authManager()->addChild($role, $permission);\n\n // assign role to user by id.\n self::authManager()->assign($role, $user_id);\n }\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function syncPermissions(): void {\n\t\t$FinalPermissions = discover_permissions( false );\n\t\t$RolesExists = Permission::query()->whereIn( 'name', $FinalPermissions )->get();\n\t\tif ( $RolesExists->count() > 0 ) {\n\t\t\t$FinalPermissionsCollection = collect( $FinalPermissions )->filter( static function ( $item ) use ( $RolesExists ) {\n\t\t\t\treturn ! $RolesExists->contains( 'name', '=', $item );\n\t\t\t} );\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissionsCollection as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tif ( ! empty( $CreateRoles ) ) {\n\t\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t\t}\n\t\t} else {\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissions as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t}\n\t}", "public function testErrorIsReturnedIfAssigningPermissionsNotAssignedToSelf()\n {\n [$user, $server] = $this->generateTestAccount([\n Permission::ACTION_USER_CREATE,\n Permission::ACTION_USER_READ,\n Permission::ACTION_CONTROL_CONSOLE,\n ]);\n\n $response = $this->actingAs($user)->postJson($this->link($server) . '/users', [\n 'email' => $email = $this->faker->email,\n 'permissions' => [\n Permission::ACTION_USER_CREATE,\n Permission::ACTION_USER_UPDATE, // This permission is not assigned to the subuser.\n ],\n ]);\n\n $response->assertForbidden();\n $response->assertJsonPath('errors.0.code', 'HttpForbiddenException');\n $response->assertJsonPath('errors.0.detail', 'Cannot assign permissions to a subuser that your account does not actively possess.');\n }", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function refreshUserACLs() {\r\n if ($this->modx->getUser()) {\r\n $this->modx->user->getAttributes(array(), '', true);\r\n }\r\n }", "public function getAddPermission(Request $request)\n {\n\t\t$user = null;\n\t\t$nope = false;\n\t\t$v = \"\";\n\t\t\n\t\t$signals = $this->helpers->signals;\n\t\t$plugins = $this->helpers->getPlugins();\n\t\t$permissions = $this->helpers->permissions;\n\t\t#$this->helpers->populateTips();\n $cpt = ['user','signals','plugins'];\n\t\t\t\t\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_users','edit_users']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n \n\t\t\t\tif(isset($req['xf']))\n\t\t\t\t{\n\t\t\t\t\t$xf = $req['xf'];\n\t\t\t\t\t$v = \"add-permissions\";\n\t\t\t\t\t$uu = User::where('id',$xf)\n\t\t\t\t\t ->orWhere('email',$xf)->first();\n\t\t\t\t\t\t\t \n\t\t\t\t\tif($uu == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsession()->flash(\"invalid-user-status-error\",\"ok\");\n\t\t\t\t\t\treturn redirect()->intended('users');\n\t\t\t\t\t}\n\t\t\t\t $u = $this->helpers->getUser($xf);\n\t\t\t\t\t\n\t\t\t\t\tif(count($u) < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsession()->flash(\"invalid-user-status-error\",\"ok\");\n\t\t\t\t\t\treturn redirect()->intended('users');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($cpt,'u'); \n\t\t\t\t\t\tarray_push($cpt,'permissions'); \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"validation-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('users');\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\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$v = \"login\";\n\t\t}\n\t\treturn view($v,compact($cpt));\n }", "function permissions() {\r\n\t\treturn false;\r\n\t}", "public function shouldAttachAllPermissionsToAdminRole()\n {\n Permission::insert([\n ['name' => 'books.read', 'guard_name' => ''],\n ['name' => 'books.create', 'guard_name' => ''],\n ['name' => 'books.delete', 'guard_name' => ''],\n ]);\n\n $this->assertEmpty(Role::first()->permissions);\n\n $this->artisan('authorization:refresh-admin-permissions')->assertExitCode(0);\n\n $this->assertCount(3, Role::first()->permissions);\n }", "public function removeAddPermission($user, $permission) {\n global $MYSQL, $TANGO;\n $user = $TANGO->user($user);\n if( !empty($user) ) {\n $current_perms = array();\n foreach( $user['additional_permissions'] as $ap ) {\n $current_perms[$ap] = $ap;\n }\n unset($current_perms[$permission]);\n if( !empty($current_perms) ) {\n $new_perms = array();\n foreach( $current_perms as $parent => $child ) {\n $MYSQL->where('permission_name', $id_perms);\n $p_query = $MYSQL->get('{prefix}permissions');\n $new_perms[] = $p_query['id'];\n }\n $new_perms = implode(',', $new_perms);\n $update = array(\n 'additional_permissions' => $new_perms\n );\n } else {\n $update = array(\n 'additional_permissions' => '0'\n );\n }\n $MYSQL->where('id', $user['id']);\n if( $MYSQL->update('{prefix}users', $update) ) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function hook_roomify_rights_alter(&$permissions) {\n // Remove permission 'access content' for anonymous users.\n unset($permissions['anonymous user']['access content']);\n}", "public function grant($user, $permission, $comment=null, $expire=null);", "public function testPostPermissions_addsPermissionCorrectly() {\r\n\t\t$this->jc->putResource('/', $this->test_folder);\r\n\t\t$joeuser = $this->jc->getUsers('joeuser');\r\n\t\t$perms[] = new Permission('32', $joeuser[0], $this->test_folder->getUriString());\r\n\t\t$this->jc->updatePermissions($this->test_folder->getUriString(), $perms);\r\n\t\t$test_folder_perms = $this->jc->getPermissions($this->test_folder->getUriString());\r\n\t\t$this->jc->deleteResource($this->test_folder->getUriString());\r\n\t\t$this->assertEquals(sizeof($test_folder_perms), 1);\r\n\t\t$this->assertEquals($test_folder_perms[0]->getPermissionMask(), $perms[0]->getPermissionMask());\r\n\t\t$this->assertEquals($test_folder_perms[0]->getPermissionRecipient()->getUsername(), $perms[0]->getPermissionRecipient()->getUsername());\r\n\t}", "public function permission_assignment(Request $request, User $user)\n {\n $this->authorize('assign_permission', $user);\n $user->permissions()->sync($request->permissions);\n alert('Exito', 'Permisos asignados', 'success');\n return redirect()->route('backoffice.user.show', $user);\n }", "public function testAddPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_perms\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_permission();\n }", "public function checkPermissions();", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "public function create() {\n// $role = Sentinel::findRoleById(1);\n// $roles = Rol::get();\n// foreach($roles as $role){\n// $role->removePermission(0);\n// $role->removePermission(1);\n// $role->save();\n// }\n// dd(Sentinel::getUser()->hasAccess('sds'));\n// dd(\\Modules\\Permissions\\Entities\\ModulePermission::where('module_id', 10)->where('permission', 'like', '%.view')->orderBy('menu_id')->lists('permission')->toArray());\n }", "private function seedPermissions()\n {\n (new \\Naraki\\Permission\\Models\\Permission())->insert([\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::GROUPS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::GROUPS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n ]);\n\n }", "public function grantPermissionToUserAction()\n {\n $data['email'] = $this->params()->fromPost('email','');\n $data['featureName'] = $this->params()->fromPost('featureName','');\n \n $user = $this->entityManager->getRepository(Usersso::class)->findOneByEmail($data['email']);\n $role = $this->entityManager->getRepository(Role::class)->find($user->getRole()); //\n\n $permission = $this->entityManager->getRepository(Permission::class)->findOneByName($data['featureName']);\n\n // $permissions \n $permissions = $role->getPermissions();\n $data['permissions'] = array();\n $data['permissions'][] = $data['featureName'];\n\n foreach($permissions as $p)\n {\n $data['permissions'][] = $p->getName();\n }\n \n $this->httpStatusCode = 403;\n $this->apiResponse['canAccess'] = 0;\n if ($this->roleManager->updateRolePermissions($role, $data)) {\n $this->httpStatusCode = 200; \n $this->apiResponse['canAccess'] = 1; \n }\n \n return $this->createResponse();\n \n }", "protected function _initPermissions () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aPermissionListing = $oAclCache->load(self::CACHE_IDENTIFIER_PERMISSIONS)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Privileges from the Database\r\n\t\t\t$oDaoRoleResourcePrivilege = Kwgl_Db_Table::factory('System_Role_Resource_Privilege');\r\n\t\t\t//$aPermissionListing = $oDaoRoleResource->fetchAll();\r\n\t\t\t$aPermissionListing = $oDaoRoleResourcePrivilege->getPermissions();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aPermissionListing, self::CACHE_IDENTIFIER_PERMISSIONS);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aPermissionListing as $aPermissionDetail) {\r\n\t\t\t$sRoleName = $aPermissionDetail['role_name'];\r\n\t\t\t$sResourceName = $aPermissionDetail['resource_name'];\r\n\t\t\t$sPrivilegeName = null;\r\n\t\t\tif (!is_null($aPermissionDetail['privilege_name'])) {\r\n\t\t\t\t$sPrivilegeName = $aPermissionDetail['privilege_name'];\r\n\t\t\t}\r\n\t\t\t$sPermissionType = $aPermissionDetail['permission'];\r\n\r\n\t\t\t// Check the Permission to see if you should allow or deny the Resource/Privilege to the Role\r\n\t\t\tswitch ($sPermissionType) {\r\n\t\t\t\tcase self::PERMISSION_TYPE_ALLOW:\r\n\t\t\t\t\t$this->allow($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::PERMISSION_TYPE_DENY:\r\n\t\t\t\t\t$this->deny($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "public function testUpdatePermissionSet()\n {\n }", "public function prepare_permissions($user)\n\t{\n\t\t$roles = NULL;\n\t\t$child = NULL;\n\t\t\n\t\tif ($user)\n\t\t{\n\t\t\t$roles = $user->roles->find_all()->as_array();\n\t\t\t$child = $user->username;\n\t\t}\n\n\t\t\n\t\tif ( ! empty($roles))$this->add_user_role($roles, $child);\n\t\t\n\t\treturn $this;\n\t}", "public function givePermission($user, $permission) {\n global $MYSQL, $TANGO;\n $user = $TANGO->user($user);\n if( !empty($user) ) {\n $perm = $TANGO->perm->perm($permission);\n if( $user['additional_permissions'] == \"0\" ) {\n $update = array(\n 'additional_permissions' => $perm['permission_name']\n );\n } else {\n $ap_array = array();\n foreach( $user['additional_permissions'] as $ap ) {\n $MYSQL->where('permission_name', $ap);\n $ap_query = $MYSQL->get('{prefix}permissions');\n if( $ap_query ) {\n $ap_array[] = $ap_query['0']['id'];\n }\n }\n $additional_permissions = implode(',', $ap_array);\n $update = array(\n 'additional_permissions' => $additional_permissions . ',' . $perm['permission_name']\n );\n }\n $MYSQL->where('id', $user['id']);\n if( $MYSQL->update('{prefix}users', $update) ) {\n return true;\n } else {\n return false;\n }\n } else { \n return false;\n }\n }", "public function RegisterRolesAndPermissions()\n {\n //create role by defined default data in config->permission.php\n //if don't exist in database\n if (Role::where('name', config('permission.default_roles')[0])->count() <1){\n foreach (config('permission.default_roles') as $role){\n Role::create([\n 'name' => $role,\n ]);\n }\n }\n\n //create permission by defined default data in config->permission.php\n //if don't exist in database\n if (Permission::where('name', config('permission.default_permission')[0])->count() <1) {\n foreach (config('permission.default_permission') as $permission) {\n Permission::create([\n 'name' => $permission,\n ]);\n }\n }\n }", "public function testPermissionSet()\n {\n }", "public function testUpdatePermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_perms\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_permission();\n }", "public function run()\n {\n Permission::insert(config('permissions', true));\n }", "protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }", "public function givePermission($permissions);", "function set_can_create_user ($permission)\r\n {\r\n $_SESSION[\"can_create_user\"] = $permission;\r\n }", "protected function setRequiredAccessLevelsForPost() {\n $this->post_required_access_levels = array(\"owner\",\"admin\",\"collaborator\");\n }", "public function run()\n {\n foreach (config('admins.user_has_permission') as $user_permission){\n $user = \\App\\User::find($user_permission['user_id']);\n if ($user) {\n $user->permissions()->attach(\\App\\Permission::find($user_permission['permission_id']),[\n 'create'=>$user_permission['create'],\n 'update'=>$user_permission['update'],\n 'delete'=>$user_permission['delete'],\n 'read'=>$user_permission['read'],\n ]);\n }\n }\n }", "public function initializePermissions() {\n\t\tLoader::helper('clov_permissions', 'clov');\n\t\t$page = $this->getCollectionObject();\n\t\t\n\t\tClovPermissionsHelper::setBaselinePermissions($page);\n\t\t\n\t\t// Project managers and employees can add new expenses.\n\t\t$clovGroups = Loader::package('clov')->getGroups();\n\t\t$page->assignPermissions($clovGroups[ClovPackage::PROJECT_MANAGERS], array('add_subpage'));\n\t\t$page->assignPermissions($clovGroups[ClovPackage::EMPLOYEES], array('add_subpage'));\n\t\t\n\t\t// Only allow clov_expense pages under this one.\n\t\tClovPermissionsHelper::restrictSubpageType($page, CollectionType::getByHandle('clov_expense'));\n\t}", "public function addRoutesToPermissionTable()\n {\n try {\n $permissionsRepo = repo('permissions');\n $permissionsRepo->insertModulePermissions($this->moduleName);\n } catch (\\Throwable $th) {\n // this wil silent the not found repository if there is no permissions repository \n }\n }", "public function getAllPermissionsForUser($user): array;", "public function testAdminCanNotAddARoleWithoutAnyPermissionAssigned()\n {\n $params = [\n 'name' => $this->faker->name(),\n 'permissions' => [],\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/roles', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n $this->assertEquals('The permissions field is required.', $errors->get('permissions')[0]);\n }", "protected function addAdmins(){\n\t\t\n\t\t$users = $this->getOption('users');\n\t\tif (!$users) $this->setError('noUsers');\n\t\tforeach ($users as $userid)\n\t\t\tif (!is_numeric($userid) || !$this->doesUserExists($userid,$this->isDebug())) throw new ForumMException('user id ('.$userid.') is invalid');\t\t\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$name = $this->getName();\n\t\tif (!$name){\n\t\t\t$this->retrieveForumInfo($this->getId(),$this->isDebug());\n\t\t\t$name = $this->getName();\n\t\t} \n\t\t\n\t\t$this->retrieveForumPermissions($name,$this->isDebug());\n\t\t\n\t\t$this->setAdmins($users,$this->isDebug());\t\t\n\t}", "function permissions_grant_user ($user, $dir, $file, $action)\n{\n\t$permissions = user_get_permissions($user);\n\n\t// determine the permission definitions\n\t$permdefs = permissions_get();\n\n\t// the user with the name \"admin\" always has admin rights\n\tif ($action == \"admin\" && $user == \"admin\")\n\t\treturn true;\n\n\t// check if the action is allowed\n\treturn ($permdefs[$action] & $permissions) != 0;\n}", "public function testPostPermissionsToResource_addsPermissionCorrectly() {\r\n $this->jc->putResource('/', $this->test_folder);\r\n $resource = JasperTestUtils::createImage($this->test_folder);\r\n $this->jc->putResource('', $resource, dirname(__FILE__).'/resources/pitbull.jpg');\r\n $resource = $this->jc->getResource($resource->getUriString());\r\n $joeuser = $this->jc->getUsers('joeuser');\r\n $perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $perm = new Permission('32', $joeuser[0], $resource->getUriString());\r\n $perms[] = $perm;\r\n $this->jc->updatePermissions($resource->getUriString(), $perms);\r\n\r\n $updated_perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $this->jc->deleteResource($this->test_folder->getUriString());\r\n\r\n $this->assertEquals(sizeof($perms), sizeof($updated_perms));\r\n $this->assertEquals($perm->getPermissionMask(), $updated_perms[count($updated_perms)-1]->getPermissionMask());\r\n $this->assertEquals($perm->getPermissionRecipient(), $updated_perms[count($updated_perms)-1]->getPermissionRecipient());\r\n }", "public function run()\n {\n App\\Role::find(1)->attachPermission(1);\n App\\Role::find(1)->attachPermission(2);\n App\\Role::find(1)->attachPermission(3);\n }", "function addPermission($permission, $user) {\n global $mysqli, $db_table_prefix;\n $i = 0;\n $stmt = $mysqli->prepare(\"INSERT INTO \" . $db_table_prefix . \"user_permission_matches (\n\t\tpermission_id,\n\t\tuser_id\n\t\t)\n\t\tVALUES (\n\t\t?,\n\t\t?\n\t\t)\");\n if (is_array($permission)) {\n foreach ($permission as $id) {\n $stmt->bind_param(\"ii\", $id, $user);\n $stmt->execute();\n $i++;\n }\n } elseif (is_array($user)) {\n foreach ($user as $id) {\n $stmt->bind_param(\"ii\", $permission, $id);\n $stmt->execute();\n $i++;\n }\n } else {\n $stmt->bind_param(\"ii\", $permission, $user);\n $stmt->execute();\n $i++;\n }\n $stmt->close();\n return $i;\n}", "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "public function setPermissions($permissions) {}", "public function testCreatePermissionSet()\n {\n }", "function _gizra_access_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create profile content\n $permissions[] = array(\n 'name' => 'create profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own profile content\n $permissions[] = array(\n 'name' => 'edit own profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view field_hidden_field\n $permissions[] = array(\n 'name' => 'view field_hidden_field',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "public function run()\n {\n Permission::factory(SC::PERMISSIONS_COUNT)->create();\n }", "function hook_roomify_rights_group_alter(&$permissions) {\n // Remove permission 'add member' for group_manager users.\n unset($permissions['group_manager']['add member']);\n}", "public function userPermissions()\n\t{\n\t\treturn $this->belongsToMany('Regulus\\Identify\\Models\\Permission', Auth::getTableName('user_permissions'))\n\t\t\t->withTimestamps()\n\t\t\t->orderBy('display_order')\n\t\t\t->orderBy('name');\n\t}", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "public function testAllPermissions()\n {\n }", "public function create(User $user)\n {\n return User::isAdmin($user);\n return $user->tipouser->permission()->get()->contains(\"nomePermissao\",\"Adicionar Eventos\");\n }", "public function store(UserRequest $request)\n\t{\n//\n $request['created_by'] = Auth::id();\n $request['password'] = bcrypt($request->input('password'));\n User::create($request->all());\n $permissions = $request->get('permission_ids');\n// dd ($permissions);\n if ($permissions != null) {\n foreach ($permissions as $permission) {\n Permission_User::create(['user_id' => User::all()->last()->id, 'permission_id' => $permission]);\n }\n }\n \\Session::flash('flash_message', 'User Created');\n return redirect('users');\n \t}", "private function initializePermissions(): void\n {\n foreach ($this->data as $field) {\n\n /**\n * Ignore everything that doesnt have a seeCallback function\n */\n if (!method_exists($field, 'seeCallback')) {\n\n continue;\n\n }\n\n $originalCallback = $field->seeCallback;\n\n $field->seeCallback = function (...$arguments) use ($originalCallback) {\n\n $selfIsCallable = is_callable($this->seeCallback);\n $originalIsCallable = is_callable($originalCallback);\n\n if ($selfIsCallable && $originalIsCallable) {\n\n return call_user_func($this->seeCallback, ...$arguments) && $originalCallback(...$arguments);\n\n }\n\n if ($selfIsCallable) {\n\n return call_user_func($this->seeCallback, ...$arguments);\n\n }\n\n if ($originalIsCallable) {\n\n return $originalCallback(...$arguments);\n\n }\n\n return true;\n\n };\n\n }\n\n }", "static function canAdd(IUser $user, $context = null) {\n return $user instanceof User && $user->isAdministrator();\n }", "public function create(User $user)\n {\n $permission = strpos($user->group->permission, \"rappers_create\");\n return !is_int($permission);\n }", "public function store(StoreRequest $request)\n{\n $AgentPermission=Permission::where('name','like','%Order%')->get();\n\n $user = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password'=>Hash::make($request->password),\n 'password_confirmation'=>Hash::make($request->password_confirmation),\n 'mobile'=>$request->mobile,\n 'work'=>$request->work,\n 'is_agent'=>'1'\n ]);\n\n $user->assignRole([3]);\n\n foreach($AgentPermission as $a)\n {\n $user->givePermissionTo($a->id);\n\n }\n\n return $user;\n}", "protected function isPermissionCorrect() {}", "public function attachPermissions($permissions);", "public function installFallbackAcl();", "public function created(User $user)\n {\n $permissions = require resource_path('roles/defaults.php');\n\n $user->allow($permissions[get_class($user)]);\n $this->userService->attachAbility($user);\n }", "private function syncPermissions(Request $request, $user)\n {\n // Get the submitted roles\n $roles = $request->get('roles', []);\n $permissions = $request->get('permissions', []);\n\n // Get the roles\n $roles = Role::find($roles);\n\n // check for current role changes\n if( ! $user->hasAllRoles( $roles ) ) {\n // reset all direct permissions for user\n $user->permissions()->sync([]);\n } else {\n // handle permissions\n $user->syncPermissions($permissions);\n }\n\n $user->syncRoles($roles);\n\n return $user;\n }", "public function grantUserRolePermissions(User $user, array $permissions): void\n {\n $newRole = $this->userRoleProvider->createRole($permissions);\n $user->attachRole($newRole);\n $user->load('roles');\n $user->clearPermissionCache();\n }", "protected function editLockPermissions() {}", "function wporphanageex_adopt_all_orphans() {\n\tforeach ( wporphanageex_get_all_users() as $user_id ) {\n\t\t$user = new WP_User( $user_id );\n\t\tif ( ! user_can( $user_id, 'read' ) ) {\n\t\t\t$user->set_role( wporphanageex_search_user_role( $user_id ) );\n\t\t}\n\t}\n}", "private function syncPermissions(Request $request, $user)\n {\n $roles = $request->get('roles', []);\n $permissions = $request->get('permissions', []);\n\n // Get the roles\n $roles = Role::find($roles);\n\n // check for current role changes\n if (!$user->hasAllRoles($roles)) {\n // reset all direct permissions for user\n $user->permissions()->sync([]);\n } else {\n // handle permissions\n $user->syncPermissions($permissions);\n }\n\n $user->syncRoles($roles);\n return $user;\n }", "private function syncPermissions(Request $request, $user)\n {\n $roles = $request->get('roles', []);\n $permissions = $request->get('permissions', []);\n\n // Get the roles\n $roles = Role::find($roles);\n\n // check for current role changes\n if (!$user->hasAllRoles($roles)) {\n // reset all direct permissions for user\n $user->permissions()->sync([]);\n } else {\n // handle permissions\n $user->syncPermissions($permissions);\n }\n\n $user->syncRoles($roles);\n return $user;\n }", "private function syncPermissions(Request $request, $user)\n {\n // Get the submitted roles\n $roles = $request->get('roles', []);\n $permissions = $request->get('permissions', []);\n\n // Get the roles\n $roles = Role::find($roles);\n\n // check for current role changes\n if (! $user->hasAllRoles($roles)) {\n // reset all direct permissions for user\n $user->permissions()->sync([]);\n } else {\n // handle permissions\n $user->syncPermissions($permissions);\n }\n\n $user->syncRoles($roles);\n\n return $user;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public function getUserPermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $user = $this->user->find($this->argument('needle'));\n if ($user) {\n $permissions = $user->abilities;\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n foreach ($permission as $ability=>$perm) {\n $vals = [$ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No user found!\");\n }\n }", "public function setAsRegularUserIfRequired(int $id)\n {\n $user = User::withCount('category')\n ->where('id', $id)\n ->firstOrFail();\n\n # we will take no action if he is an admin\n if ($user->isAdmin()) {\n return;\n }\n\n # we will take no action if he still moderate some categories\n if ($user->category_count > 0) {\n return;\n }\n\n # sorry man, you are fired - :'( -\n $user->privilege = 1;\n $user->save();\n }", "public function create(User $user)\n {\n if ($user->can('create_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "function add()\n {\n if($this->checkAccess('permission.add') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n {\n $this->load->model('permission_model');\n \n $this->global['pageTitle'] = 'School : Add New Permission';\n\n $this->loadViews(\"permission/add\", $this->global, NULL, NULL);\n }\n }" ]
[ "0.7046331", "0.64810675", "0.6391796", "0.6242915", "0.62394774", "0.61527604", "0.6113058", "0.61015415", "0.60756385", "0.60563385", "0.6033746", "0.60041445", "0.59997934", "0.59997934", "0.5987202", "0.5987202", "0.5987202", "0.5987202", "0.5987202", "0.5978397", "0.5941706", "0.5941706", "0.59365505", "0.59335065", "0.589976", "0.58843106", "0.587387", "0.5872157", "0.5867036", "0.58569694", "0.5852809", "0.58493763", "0.5845857", "0.58322895", "0.58094096", "0.5804928", "0.5776199", "0.5764405", "0.5756409", "0.5724946", "0.57099515", "0.5699722", "0.56990105", "0.5674342", "0.5673576", "0.5670945", "0.5666014", "0.56629556", "0.5661256", "0.56540936", "0.5646747", "0.56113076", "0.5592934", "0.558333", "0.5578473", "0.5577993", "0.55753314", "0.5565545", "0.5560235", "0.55510354", "0.5550128", "0.5549751", "0.5535087", "0.5534987", "0.5532822", "0.553275", "0.55308455", "0.55241984", "0.5522081", "0.5515752", "0.55144185", "0.5512455", "0.54919857", "0.5489661", "0.54862994", "0.54790026", "0.54750854", "0.5473637", "0.54703355", "0.5466844", "0.54663944", "0.5465245", "0.546482", "0.54633135", "0.5455156", "0.5450031", "0.544778", "0.5444907", "0.54435045", "0.5439179", "0.543804", "0.543804", "0.54277074", "0.54269886", "0.54269886", "0.54269886", "0.54269886", "0.5422216", "0.54203737", "0.5413789", "0.54107213" ]
0.0
-1
Run the database seeds.
public function run() { Product::insert([ ['code' => '43763','name' => 'Molho de Buteco', 'size' => '150.00', 'quantity' => '60', 'measure_id' => '2', 'type_id' => '5'], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Function which defines the IssueForm inputs
public function buildForm(FormBuilderInterface $builder, array $options) { $translationManager = $this->translationManager; $userManager = $this->userManager; $builder->add('code', 'text'); /*$builder->add('title', 'text');*/ $builder->add( 'project', 'entity', array( 'class' => 'VladBugtrackerBundle:Project', 'property' => 'name', 'query_builder' => function ($er) use ($userManager) { return $er->getByUser($userManager->getUser()->getId(), $userManager->isAdmin()); } ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function issues_prepare_form_vars($issue = null, \n $item_guid = 0, \n $referrer = null, \n $description = null) {\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'start_date' => '',\n\t\t'end_date' => '',\n\t\t'issue_type' => '',\n\t\t'issue_number' => '',\n\t\t'status' => '',\n\t\t'assigned_to' => '',\n\t\t'percent_done' => '',\n\t\t'work_remaining' => '',\n\t\t'aspect' => 'issue',\n 'referrer' => $referrer,\n 'description' => $description,\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'write_access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $issue,\n\t\t'item_guid' => $item_guid,\n\t);\n\n\tif ($issue) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($issue->$field)) {\n\t\t\t\t$values[$field] = $issue->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('jot')) {\n\t\t$sticky_values = elgg_get_sticky_values('jot');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n//\telgg_clear_sticky_form('jot');\n\n\treturn $values;\n}", "public static function input_fields()\n {\n }", "function getInputValues();", "function simplenews_admin_issues_validate($form, &$form_state) {\n if (isset($form_state['input']['operation'])) {\n $nids = array_keys(array_filter($form_state['input']['issues']));\n if (empty($nids)) {\n form_set_error('', t('No items selected.'));\n }\n }\n}", "abstract function setupform();", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "function create_inputs($id, $isRequired)\n{\n $inputs = get_application_inputs($id);\n\n $required = $isRequired? ' required' : '';\n\n foreach ($inputs as $input)\n {\n /*\n echo '<p>DataType::STRING = ' . \\Airavata\\Model\\AppCatalog\\AppInterface\\DataType::STRING . '</p>';\n echo '<p>DataType::INTEGER = ' . \\Airavata\\Model\\AppCatalog\\AppInterface\\DataType::INTEGER . '</p>';\n echo '<p>DataType::FLOAT = ' . \\Airavata\\Model\\AppCatalog\\AppInterface\\DataType::FLOAT . '</p>';\n echo '<p>DataType::URI = ' . \\Airavata\\Model\\AppCatalog\\AppInterface\\DataType::URI . '</p>';\n\n echo '<p>$input->type = ' . $input->type . '</p>';\n */\n\n switch ($input->type)\n {\n case DataType::STRING:\n echo '<div class=\"form-group\">\n <label for=\"experiment-input\">' . $input->name . '</label>\n <input type=\"text\" class=\"form-control\" name=\"' . $input->name .\n '\" id=\"' . $input->name .\n '\" placeholder=\"' . $input->userFriendlyDescription . '\"' . $required . '>\n </div>';\n break;\n case DataType::INTEGER:\n case DataType::FLOAT:\n echo '<div class=\"form-group\">\n <label for=\"experiment-input\">' . $input->name . '</label>\n <input type=\"number\" class=\"form-control\" name=\"' . $input->name .\n '\" id=\"' . $input->name .\n '\" placeholder=\"' . $input->userFriendlyDescription . '\"' . $required . '>\n </div>';\n break;\n case DataType::URI:\n echo '<div class=\"form-group\">\n <label for=\"experiment-input\">' . $input->name . '</label>\n <input type=\"file\" class=\"\" name=\"' . $input->name .\n '\" id=\"' . $input->name . '\" ' . $required . '>\n <p class=\"help-block\">' . $input->userFriendlyDescription . '</p>\n </div>';\n break;\n default:\n print_error_message('Input data type not supported!\n Please file a bug report using the link in the Help menu.');\n break;\n }\n }\n}", "public function populateForm() {}", "public function getInputValues();", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "function simplenews_admin_issues_submit($form, &$form_state) {\n // Call operation functions as defined in hook_simplenews_issue_operations().\n $operations = module_invoke_all('simplenews_issue_operations');\n $operation = $operations[$form_state['values']['operation']];\n // Filter out unchecked list issues\n $nids = array_filter($form_state['values']['issues']);\n if ($function = $operation['callback']) {\n // Add in callback arguments if present.\n if (isset($operation['callback arguments'])) {\n $args = array_merge(array($nids), $operation['callback arguments']);\n }\n else {\n $args = array($nids);\n }\n call_user_func_array($function, $args);\n }\n else {\n // We need to rebuild the form to go to a second step. For example, to\n // show the confirmation form for the deletion of nodes.\n $form_state['rebuild'] = TRUE;\n }\n}", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-post.php');\n\t$table.=\"<form name = 'myform' method=\\\"POST\\\" action='\" . $link_admin_post . \"' id = \\\"form1\\\">\";\n\n\t// Input for Faculty member\n\t$table.= \"\t<br>\";\n\t$table.= \" <div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Tag\\\">Faculty Member/Tag: </label></p>\";\n\t$list_of_names = wp_post_tag_names();\n\t$table.=\"\t<select name=\\\"Tag\\\">\" . $list_of_names . \"</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for PMID\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"PMID\\\">PMID*: </label></p>\";\n\t$table.=\"\t<input type=\\\"number\\\" name=\\\"PMID\\\" id=\\\"PMID\\\" required>\";\n\t\n\t//autofill button\n\t$table.=' <a class=\"pmid\" data-test=\"hi\"><button id=\"autofill_btn\" type=\"button\" >Auto-Fill</button></a>';\n\t$table.=\"\t</div>\";\n\t\t\n\t// Input for Journal Issue\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label style=\\\"width: 200px;\\\" for=\\\"Journal_Issue\\\">Journal Issue: </label></p>\";\n\t$table.=\"\t<input id = 'issue' type=\\\"number\\\" name=\\\"Journal_Issue\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Volume\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Volume\\\">Journal Volume: </label></p>\";\n\t$table.=\"\t<input id = 'journal_volume' type=\\\"number\\\" name=\\\"Journal_Volume\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Title\\\">Journal Title: </label></p>\";\n\t$table.=\"\t<input id = 'journal_title' type=\\\"text\\\" name=\\\"Journal_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Year\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Year\\\">Journal Year: </label></p>\";\n\t$table.=\"\t<input id = 'year' value=\\\"2000\\\" type=\\\"number\\\" name=\\\"Journal_Year\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Month\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Month\\\">Journal Month: </label></p>\";\n\t$table.=\"\t<select id='journal_month' name=\\\"Journal Month\\\">\";\n\t$table.=\"\t\t<option value=\\\"01\\\">Jan</option>\";\n\t$table.=\"\t\t<option value=\\\"02\\\">Feb</option>\";\n\t$table.=\"\t\t<option value=\\\"03\\\">Mar</option>\";\n\t$table.=\"\t\t<option value=\\\"04\\\">Apr</option>\";\n\t$table.=\"\t\t<option value=\\\"05\\\">May</option>\";\n\t$table.=\"\t\t<option value=\\\"06\\\">Jun</option>\";\n\t$table.=\"\t\t<option value=\\\"07\\\">Jul</option>\";\n\t$table.=\"\t\t<option value=\\\"08\\\">Aug</option>\";\n\t$table.=\"\t\t<option value=\\\"09\\\">Sep</option>\";\n\t$table.=\"\t\t<option value=\\\"10\\\">Oct</option>\";\n\t$table.=\"\t\t<option value=\\\"11\\\">Nov</option>\";\n\t$table.=\"\t\t<option value=\\\"12\\\">Dec</option>\";\n\t$table.=\"\t</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Day\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Day\\\">Journal Day: </label></p>\";\n\t$table.=\"\t<input id = 'journal_day' type=\\\"text\\\" name=\\\"Journal_Day\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Date\\\">Journal Date: </label></p>\";\n\t$table.=\"\t<input id = 'journal_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Journal_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Abbreviation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Abbreviation\\\">Journal Abbreviation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_ab' type=\\\"text\\\" name=\\\"Journal_Abbreviation\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Journal Citation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Citation\\\">Journal Citation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_citation' type=\\\"text\\\" name=\\\"Journal_Citation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Title\\\">Article Title: </label></p>\";\n\t$table.=\"\t<input id=\\\"article_title\\\" type=\\\"text\\\" name=\\\"Article_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for article abstract\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Abstract\\\">Article Abstract: </label></p>\";\n\t$table.=\" <textarea id='abstract' rows = '4' cols = '60' name=\\\"Article_Abstract\\\"></textarea>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article URL\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_URL\\\">Article URL: </label></p>\";\n\t$table.=\"\t<input id = 'article_url' type=\\\"text\\\" name=\\\"Article_URL\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Pagination\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Pagination\\\">Article Pagination: </label></p>\";\n\t$table.=\"\t<input id='pages' type=\\\"text\\\" name=\\\"Article_Pagination\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Date\\\">Article Date: </label></p>\";\n\t$table.=\"\t<input id='article_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Article_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Authors\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Authors\\\">Article Authors: </label></p>\";\n\t$table.=\"\t<input id='article_authors' type=\\\"text\\\" name=\\\"Article_Authors\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Affiliations\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Affiliation\\\">Article Affiliation: </label></p>\";\n\t$table.=\"\t<input id = 'article_affiliation' type=\\\"text\\\" name=\\\"Article_Affiliation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Created\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Created\\\">Date Created: </label></p>\";\n\t$table.=\"\t<input id='date_created' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Created\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Completed\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Completed\\\">Date Completed: </label></p>\";\n\t$table.=\"\t<input id='date_completed' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Completed\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Date Revised\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Revised\\\">Date Revised: </label></p>\";\n\t$table.=\"\t<input id='date_revised' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Revised\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Hidden input (for specifying hook)\n\t$table.=\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new_article_form\\\">\";\n\t\n\t// Submit and reset buttons\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div id=\\\"form_btns\\\">\"; \n\t$table.=\"\t<button class=\\\"form_btn\\\"><input type=\\\"reset\\\" value=\\\"Reset!\\\" onclick=\\\"window.location.reload()\\\"></button>\";\n\t$table.=\"\t<input class=\\\"form_btn\\\" type=\\\"submit\\\" value=\\\"Submit\\\">\"; \n\t$table.=\"\t</div>\";\n\t$table.=\"</form>\";\n\n\t// Styling of the form (needs to be put in a seperate stylesheet)\n\t$table.=\"<style type=\\\"text/css\\\">\";\n\t$table.=\"\t#form_btns {\";\n\t$table.=\"\t\tmargin-left: 150px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.form_btn {\";\n\t$table.=\"\t\twidth: 80px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.label {\";\n\t$table.=\"\t\twidth: 150px;\";\n\t$table.=\"\t\tmargin: 0;\";\n\t$table.=\"\t\tfloat: left;\";\n\t$table.=\"\t}\";\n\t$table.=\"\tinput::placeholder {\";\n\t$table.=\"\t\tcolor: #a4a4a4;\";\n\t$table.=\"\t}\";\n\t$table.=\"</style>\";\n\t\n\t$table.=\"<script type='text/javascript' src=\" . plugin_dir_url(__FILE__) . \"js/autofill_ajax.js></script>\";\n\n \techo $table;\n}", "function simplenews_admin_issues() {\n // Build an 'Update options' form.\n $form['options'] = array(\n '#type' => 'fieldset',\n '#title' => t('Update options'),\n '#prefix' => '<div class=\"container-inline\">',\n '#suffix' => '</div>',\n );\n $options = array();\n foreach (module_invoke_all('simplenews_issue_operations') as $operation => $array) {\n $options[$operation] = $array['label'];\n }\n $form['options']['operation'] = array(\n '#type' => 'select',\n '#options' => $options,\n '#default_value' => 'activate',\n );\n $form['options']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Update'),\n '#submit' => array('simplenews_admin_issues_submit'),\n '#validate' => array('simplenews_admin_issues_validate'),\n );\n\n if (variable_get('simplenews_last_cron', '')) {\n $form['last_sent'] = array(\n '#markup' => '<p>' . format_plural(variable_get('simplenews_last_sent', 0), 'Last batch: 1 mail sent at !time.', 'Last batch: !count mails sent at !time.', array('!time' => format_date(variable_get('simplenews_last_cron', ''), 'small'), '!count' => variable_get('simplenews_last_sent', 0))) . \"</p>\\n\",\n );\n }\n // Table header. Used as tablesort default\n $header = array(\n 'title' => array(\n 'data' => t('Title'),\n 'specifier' => 'title',\n 'type' => 'property',\n ),\n 'newsletter' => array(\n 'data' => t('Newsletter'),\n 'specified' => array(\n 'field' => variable_get('simplenews_newsletter_field', 'simplenews_newsletter'),\n 'column' => 'target_id',\n ),\n 'type' => 'field',\n ),\n 'created' => array(\n 'data' => t('Created'),\n 'specifier' => 'created',\n 'sort' => 'desc',\n 'type' => 'property',\n ),\n 'published' => array('data' => t('Published')),\n 'sent' => array('data' => t('Sent')),\n 'subscribers' => array('data' => t('Subscribers')),\n 'operations' => array('data' => t('Operations')),\n );\n\n $query = new EntityFieldQuery();\n simplenews_build_issue_filter_query($query);\n $result = $query\n ->entityCondition('entity_type', 'node')\n ->tableSort($header)\n ->entityCondition('bundle', simplenews_get_content_types())\n ->pager(30)\n ->execute();\n\n $nids = !empty($result['node']) ? array_keys($result['node']) : array();\n $options = array();\n\n module_load_include('inc', 'simplenews', 'includes/simplenews.mail');\n $categories = simplenews_newsletter_list();\n foreach (node_load_multiple($nids) as $node) {\n $subscriber_count = simplenews_count_subscriptions(simplenews_issue_newsletter_id($node));\n $pending_count = simplenews_count_spool(array('entity_id' => $node->nid, 'entity_type' => 'node'));\n $send_status = simplenews_issue_status($node) == SIMPLENEWS_STATUS_SEND_PENDING ? $subscriber_count - $pending_count : theme('simplenews_status', array('source' => 'sent', 'status' => simplenews_issue_status($node)));\n\n $options[$node->nid] = array(\n 'title' => l($node->title, 'node/' . $node->nid),\n 'newsletter' => simplenews_issue_newsletter_id($node) && isset($categories[simplenews_issue_newsletter_id($node)]) ? $categories[simplenews_issue_newsletter_id($node)] : t('- Unassigned -'),\n 'created' => format_date($node->created, 'small'),\n 'published' => theme('simplenews_status', array('source' => 'published', 'status' => $node->status)),\n 'sent' => $send_status,\n 'subscribers' => $subscriber_count,\n 'operations' => l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => drupal_get_destination())),\n );\n }\n\n $form['issues'] = array(\n '#type' => 'tableselect',\n '#header' => $header,\n '#options' => $options,\n '#empty' => t('No newsletters available.'),\n );\n\n $form['pager'] = array('#theme' => 'pager');\n\n return $form;\n}", "private function input(){\n $this->params['controller_name'] = $this->ask('Controller name');\n $this->params['crud_url'] = $this->ask('CRUD url');\n $this->params['model_name'] = $this->ask('Model name');\n $this->params['table_name'] = $this->ask('Table name');\n $this->params['author'] = env('PACKAGE_AUTHOR');\n }", "public function getInputErrors();", "public function input($ref, $params = null) {\n if($this->Fields[$ref]) {\n //atributo principal\n $i['name'] = $ref;\n $i['id'] = strtolower(get_called_class().\"-\".$ref);\n \n //atributos setados sem a necessidade de tratamento ex.: id=\"id\"\n $commonAttrs = \"autocomplete|checked|class|disabled|id|name|maxlength|placeholder|size|style|type|value\";\n $validateAttrs = \"required|email|integer|onlyLetterNumber\";\n\n //verifica quais atributos ja foram setados anteriormente na classe\n foreach (explode(\"|\", $commonAttrs) as $attr) {\n if(isset($this->Fields[$ref][$attr])) $i[$attr] = $this->Fields[$ref][$attr];\n }\n \n //processa os campos de validacao passados pela classe\n foreach (explode(\"|\", $validateAttrs) as $attr) {\n if(isset($this->Fields[$ref][$attr])) $v[$attr] = $this->Fields[$ref][$attr];\n if($this->Fields[$ref][$attr] === true) $v[$attr] = true;\n }\n \n // se FormMode == \"add\" e houverem dados no $_POST do navegador, printa os dados no value do input\n // isso evita que o usuario tenha de redigitar todos os dados em caso de erro ao processar o formulario\n // semelhante como os formularios ja estao preenchidos ao disparar o evento javascript:history.back();\n // do navegador\n if($this->FormMode === \"add\" && !is_null($_POST[$ref])) $i['value'] = $_POST[$ref];\n \n // se FormMode == \"edit\" e houverem dados no objeto da class, printa os dados no value do input\n if($this->FormMode === \"edit\" && !is_null($this->$ref)) $i['value'] = $this->$ref;\n\n //processa todos os paramentos passados pela funcao\n if(is_array($params)) {\n foreach($params as $attr => $value) {\n if(preg_match(\"/^($commonAttrs)/i\", $attr)) {\n //atributos globais\n $i[$attr] = $value;\n } else\n if(preg_match(\"/^($validateAttrs)/i\", $attr)) {\n //atributos para validacao\n if($value === true) {\n $v[$attr] = true;\n } else {\n unset($v[$attr]);\n }\n } else {\n //atributos de html5 data-* sao passados diretamente\n if(preg_match(\"/^data-/i\", $attr)) $i[$attr] = $value;\n }\n }\n }\n\n //Se $v[$attr] => true transforma para class=\"validate[$attr]\"; sera validado com js posteriormente\n if(is_array($v) && count($v) > 0) {\n $i['class'] .= \" validate[\";\n $first = true;\n foreach($v as $attr => $val) {\n if($first === false) $i['class'] .= \",\";\n switch ($attr) {\n case \"email\":\n $i['class'] .= \"custom[email]\";\n break;\n case \"onlyLetterNumber\":\n $i['class'] .= \"custom[onlyLetterNumber]\";\n break;\n default:\n $i['class'] .= $attr;\n break;\n }\n $first = false;\n }\n $i['class'] .= \"]\";\n }\n\n //Se os campos forem type=radio|checkbox, o formulario seja 'edit' e o valor do campo $this->$ref corresponder, seta checked=\"checked\"\n if($this->FormMode === \"edit\" && ($this->$ref === $i['value'] || $_POST[$ref] == $i['value']) && ($i['type'] === \"radio\" || $i['type'] === \"checkbox\")) $i['checked'] = \"checked\";\n \n if($this->FormMode === \"add\" && ($_POST[$ref] == $i['value']) && ($i['type'] === \"radio\" || $i['type'] === \"checkbox\")) $i['checked'] = \"checked\";\n \n \n // remove os espacos no final e no comeco do atributo classe\n $i['class'] = trim($i['class']);\n \n if(!$i['type']) $i['type'] = \"text\";\n \n //monta o input com parametros mais relevantes primeiro\n if($i['type'] === \"textarea\") {\n $input = '<textarea name=\"'.$i['name'].'\" ';\n\n //remove os parametros relevantes para evitar repeticao\n unset($i['type']);\n unset($i['name']);\n\n //monta o input\n foreach ($i as $attr => $value) {\n if($attr !== \"value\") $input .= $attr.'=\"'.$value.'\" ';\n }\n \n $input .= \">\".$i['value'].\"</textarea>\\n\";\n } else {\n $input = '<input type=\"'.$i['type'].'\" name=\"'.$i['name'].'\" ';\n\n //remove os parametros relevantes para evitar repeticao\n unset($i['type']);\n unset($i['name']);\n\n //monta o input\n foreach ($i as $attr => $value) {\n $input .= $attr.'=\"'.$value.'\" ';\n }\n\n $input .= \" />\\n\";\n }\n \n //FUS-RO-DA!\n echo $input;\n } else {\n echo \"<!-- error input $ref -->\";\n }\n }", "abstract public function forms();", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "function tower_custom_input_validation($message, $field, $request_data, $form_location) {\n\n}", "public function valiteForm();", "function inputField($type, $name, $value=\"\", $attrs=NULL, $data=NULL, $help_text=NULL) {\n global $loc;\n $s = \"\";\n if (isset($_SESSION['postVars'])) {\n $postVars = $_SESSION['postVars'];\n } else {\n $postVars = array();\n }\n if (isset($postVars[$name])) {\n $value = $postVars[$name];\n }\n if (isset($_SESSION['pageErrors'])) {\n $pageErrors = $_SESSION['pageErrors'];\n } else {\n $pageErrors = array();\n }\n if (isset($pageErrors[$name])) {\n $s .= '<div id=\"myModal\" class=\"modal fade\" role=\"dialog\">\n <div class=\"modal-dialog\">\n\n <!-- Modal content-->\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <!--<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>-->\n <h4 class=\"modal-title\">Error</h4>\n </div>\n <div class=\"modal-body\">\n <h5 style=\"margin: 0px\">'.H($pageErrors[$name]).'</h5>\n </div>\n <div class=\"modal-footer\">\n <button id=\"close\" type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</button>\n </div>\n </div>\n\n </div>\n </div>';\n }\n if (!$attrs) {\n $attrs = array();\n }\n if (!isset($attrs['onChange'])) {\n $attrs['onChange'] = 'modified=true';\n }\n switch ($type) {\n // TODO: radio\n case 'select':\n $s .= '<select class=\"form-control\" id=\"'.H($name).'\" name=\"'.H($name).'\" ';\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \">\\n\";\n foreach ($data as $val => $desc) {\n $s .= '<option value=\"'.H($val).'\" ';\n if (strtolower($value) == strtolower($val)) {\n $s .= \" selected\";\n }\n $s .= \">\".H($desc).\"</option>\\n\";\n }\n $s .= \"</select>\\n\";\n break;\n\n case 'textarea':\n $s .= '<textarea class=\"form-control\" name=\"'.H($name).'\" ';\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \">\".H($value).\"</textarea>\";\n break;\n\n case 'checkbox':\n $s .= '<input type=\"checkbox\" ';\n $s .= 'name=\"'.H($name).'\" ';\n $s .= 'value=\"'.H($data).'\" ';\n if ($value == $data) {\n $s .= \"checked \";\n }\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \"/>\";\n break;\n\n case 'date':\n $thisDate = explode(' ', date('d m Y'));\n $dateInputName = H($name);\n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_day\" name=\"'.$dateInputName.'_day\">' . \"\\n\";\n for ($i = 1; $i <= 31; $i++) {\n $day = str_pad($i, 2, '0', STR_PAD_LEFT); \n $s .= ' <option value=\"' . $i . '\" ' . ($i == 0 + $thisDate[0] ? ' selected=\"selected\"':'') . '>' . $i . \"</option>\\n\";\n }\n $s .= \"</select><br>\\n\";\n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_month\" name=\"'.$dateInputName.'_month\">' . \"\\n\";\n for ($i = 1; $i <= 12; $i++) {\n $mon = str_pad($i, 2, '0', STR_PAD_LEFT); \n $s .= ' <option value=\"' . $mon . '\"' . ($mon == $thisDate[1] ? ' selected=\"selected\"':'') . '>' . $loc->getText('reportDateMonth' . $mon) . \"</option>\\n\";\n }\n $s .= \"</select><br>\\n\";\n \n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_year\" name=\"'.$dateInputName.'_year\">' . \"\\n\";\n \n for ($i = -20; $i <= 20; $i++) {\n $y = $thisDate[2] + $i;\n $s .= ' <option value=\"' . $y . '\" '. ($i == 0 ? 'selected=\"select\"' : '') . '>' . $y . \"</option>\\n\";\n }\n $s .= \"</select>\\n\";\n \n // Javascript code for collecting date\n $s .= '<input type=\"hidden\" id=\"' . $dateInputName . '\" name=\"' . $dateInputName . '\">\n <script>\n var updateDateInput_' . $dateInputName . ' = function() {\n document.getElementById(\"' . $dateInputName . '\").value = \n document.getElementById(\"' . $dateInputName . '_year\").value + \"-\" +\n document.getElementById(\"' . $dateInputName . '_month\").value + \"-\" +\n document.getElementById(\"' . $dateInputName . '_day\").value;\n \n console.log(day.value);\n };\n \n document.getElementById(\"' . $dateInputName . '_day\").onchange = updateDateInput_' . $dateInputName . ';\n document.getElementById(\"' . $dateInputName . '_month\").onchange = updateDateInput_' . $dateInputName . ';\n document.getElementById(\"' . $dateInputName . '_year\").onchange = updateDateInput_' . $dateInputName . ';\n </script>\n ';\n \n break;\n\n default:\n $s .= '<input class=\"form-control\" type=\"'.H($type).'\" ';\n $s .= 'id=\"' . str_replace(array('[',']'),array(''), H($name)).'\" name=\"'.H($name).'\" ';\n if ($value != \"\") {\n $s .= 'value=\"'.H($value).'\" ';\n }\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \"/>\";\n\n // Display a help text under the widget.\n // TODO: add this into another widgets.\n if (isset($help_text)) {\n $s .= \"<div>\". $help_text .\"</div>\";\n }\n\n break;\n\n }\n return $s;\n}", "function vistaportal_malpractice_insurance_form($form, &$form_state){\n\t$form = array();\n\t//liability carrier history\n\t$form['liability']['desc_1'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart I<br />Professional Liability Carrier History<br />\n\t\tHCP MUST CONDUCT CLAIMS-HISTORY VERIFICATIONS FROM ALL PROFESSIONAL LIABILITY CARRIERS<br />\n\t\tList ALL carriers for the last five (5) years if you are seeking locum tenens opportunities \n\t\tin commercial facilities<br />If you are seeking locum tenens work in government facilities, \n\t\tcarrier history covering ten (10) years is to be added on the “Application Addendum”<br />\n\t\t(You may submit copies of policy declaration pages for each carrier covering all periods \n\t\tof time)<br /></p>';\n\t$ins_fields['company_name'] = textfield('Company Name');\n\t$ins_fields['policy_num'] = textfield('Policy Number');\n\t$ins_fields['limits'] = textfield('Limits of Liability');\t\n\t$ins_fields['covered_from'] = date_popup('Covered From');\n\t$ins_fields['covered_to'] = date_popup('Covered To');\n\t$ins_fields['claims'] = textfield('Claims-Made Policy?');\n\t$ins_fields['retro'] = date_popup('Retro Exclusion Date for Prior Acts');\n\t$form['liability']['carrier'] = '<p>IF YOUR COVERAGE WAS/IS THROUGH AN EMPLOYER’S OR LOCUM \n\t\tTENENS ORGANIZATION’S CARRIER, BUT YOU DO NOT KNOW THE CARRIER INFORMATION, LIST EMPLOYER \n\t\tOR LOCUM TENENS COMPANY NAME AND THE PERIODS YOU WERE/ARE COVERED.</p>';\n\t$coverage_fields['name'] = textfield('Employer or Company Name');\n\t$coverage_fields['date'] = date_popup('Dates you were covered');\t\n\t$form['liability'][0]['ins_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['ins_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_ins'] = vistaportal_set($ins_fields, \n\t\t'Add another carrier', 'Remove another carrier', 3);\n\t$form['liability'][0]['coverage_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['coverage_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_cov'] = vistaportal_set($coverage_fields, \n\t\t'Add another employer', 'Remove another employer', 3);\n\t$form['liability'][0]['history'] = radios_yesno('Have there ever been, or are there currently pending\n\t\tany malpractice claims, suits, settlements or arbitration proceedings involving your \n\t\tprofessional practice? If “yes”, complete a Supplemental Claim History for each claim or suit.\n\t\t(If you have history of more than three claims or suits you may print additional Supplemental \n\t\tClaim History forms to complete.)');\n\t$form['liability'][0]['suit'] = radios_yesno('Are you aware of any acts, errors, omissions or \n\tcircumstances which may result in a malpractice claim or suit being made or brought against you?\n\tIf “yes”, complete a Supplemental Claim History sheet for each occurrence.');\t\n\t\n\t$form['liability'][0]['application_terms'] = terms_1($terms_desc); //@TODO\n\t$form['liability'][0]['application_terms']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms required';\n\t$form['liability'][0]['application_terms']['#title'] = 'I Accept Terms';\n\t$form['liability'][0]['application_terms']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_2'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart II<br />Supplemental Claims History<br />Please provide the following regarding \n\t\tany incident, claim, or suit or incident which may give rise to a claim whether dismissed,\n\t\tsettled out of court, judgment or pending. Answer all questions completely.This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.<br /></p>';\n\t\t\n\t$form['liability'][1]['defendant'] = textfield(\"Defendant's Name\");\n\t$form['liability'][1]['plaintiff'] = textfield(\"Claimant (Plaintiff’s) ID:\");\n\t$form['liability'][1]['location'] = textfield(\"Where did incident/alleged error occur?\");\n\t$form['liability'][1]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][1]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][1]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][1]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][1]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\t\n\t$form['liability'][1]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][1]['status'] = fieldset('STATUS OF COMPLAINT');\n\t$form['liability'][1]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][1]['defendant_amount'] = textfield('Amount paid on your behalf:');\n\t$form['liability'][1]['total_amount'] = textfield('Total Settlement against all parties:');\n\t$form['liability'][1]['date_closed'] = date_popup('Date of closure, settlement, or dismissal');\n\t$form['liability'][1]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][1]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][1]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][1]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][1]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][1]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][1]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][1]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][1]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][1]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][1]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_3'] = '<p>Please provide the following regarding any incident, \n\t\tclaim, or suit or incident which may give rise to a claim whether dismissed, settled \n\t\tout of court, judgment or pending. Answer all questions completely. This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.</p>';\n\t$form['liability'][2]['defendant_name'] = textfield(\"Defendant's Name\");\n\t$form['liability'][2]['plaintiff_id'] = textfield('Claimant (Plaintiff’s) ID:');\n\t$form['liability'][2]['error_date'] = date_popup('Date of alleged error:');\n\t$form['liability'][2]['location'] = textfield('Where did incident/alleged error occur?');\n\t$form['liability'][2]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][2]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][2]['company_name'] = textfield('Name of Insurer');\n\t$form['liability'][2]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][2]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][2]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\n\t$form['liability'][2]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][2]['status'] = fieldset('STATUS OF COMPLAINT');\t\n\t$form['liability'][2]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][2]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][2]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][2]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][2]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][2]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][2]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][2]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][2]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][2]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][2]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][2]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\t\n\t\t\t\t\t\t\t\t\t\nreturn $form;\n\t\n}", "function alter_comment_form_fields($fields){\n \n $fields = array(\n 'author' =>\n '<div class=\"row\"><div class=\"col-md-6 comment-form-author \"><div class=\"action-wrapper\">' . \n '<input id=\"author\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"author\">' . __( 'Name', 'domainreference' ) . '</label> ' .\n '</div></div>',\n\n 'email' =>\n '<div class=\"col-md-6 comment-form-email\"><div class=\"action-wrapper\">' . \n '<input id=\"email\" name=\"email\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author_email'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"email\">' . __( 'Email', 'domainreference' ) . '</label> ' .\n '</div></div></div>',\n\n 'url' => '',\n );\n\n return $fields;\n}", "protected function get_inputs_rules(){return $this->input['inputs_rules'];}", "public function postPartnerFormEdits()\n {\n $input_array = array();\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\n {\n $input_array['title'] = $this->test_input($_POST['title']);\n $input_array['sub_title'] = $this->test_input($_POST['sub-title']);\n $input_array['desc_head'] = $this->test_input($_POST['desc-head']);\n $input_array['desc_body'] = $this->test_input($_POST['desc-body']);\n $input_array['desc_list_head'] = $this->test_input($_POST['desc-list-head']);\n $input_array['desc_list_data'] = $this->test_input($_POST['desc-list-data']);\n $input_array['desc_footer_head'] = $this->test_input($_POST['desc-footer-head']);\n $input_array['desc_footer_body'] = $this->test_input($_POST['desc-footer-body']);\n $input_array['info_head'] = $this->test_input($_POST['info-head']);\n $input_array['info_body'] = $this->test_input($_POST['info-body']);\n $input_array['info_list_head'] = $this->test_input($_POST['info-list-head']);\n $input_array['info_list_data'] = $this->test_input($_POST['info-list-data']);\n $input_array['info_footer_head'] = $this->test_input($_POST['info-footer-head']);\n $input_array['info_footer_body'] = $this->test_input($_POST['info-footer-body']);\n $input_array['footer_head'] = $this->test_input($_POST['footer-head']);\n $input_array['footer_body'] = $this->test_input($_POST['footer-body']);\n $input_array['footer_list_head'] = $this->test_input($_POST['footer-list-head']);\n $input_array['footer_list_data'] = $this->test_input($_POST['footer-list-data']);\n $input_array['contact_name'] = $this->test_input($_POST['contact-name']);\n $input_array['contact_title'] = $this->test_input($_POST['contact-title']);\n $input_array['contact_desc'] = $this->test_input($_POST['contact-desc']);\n $input_array['contact_phone'] = $this->test_input($_POST['contact-phone']);\n $input_array['contact_email'] = $this->test_input($_POST['contact-email']);\n\n if(!empty($_FILES[\"usr-file-upload\"][\"name\"]))\n {\n $img_path = $this->fileUpload();\n\n if(!is_array($img_path))\n {\n $input_array['img_path'] = $img_path;\n }\n else\n {\n $this->_errors = $img_path;\n }\n }\n else\n {\n $input_array['img_path'] = $this->test_input($_POST['img-path']);\n }\n $input_array['link'] = $this->test_input($_POST['link']);\n $input_array['link_text'] = $this->test_input($_POST['link-text']);\n }\n\n if(is_array($img_path))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n if(is_array($img_path))\n {\n foreach ($img_path as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n }\n echo '</div>';\n echo '</div>';\n }\n else\n {\n $database = new Database();\n\n if($database->updatePartner($input_array, $this->_params['id']))\n {\n $url = '/Admin/edit-partner/' . $this->_params['id'];\n $this->_f3->reroute($url . '/success');\n }\n else\n {\n $errors = $database->getErrors();\n\n if(!empty($errors))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n foreach($errors as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n echo '</div>';\n echo '</div>';\n }\n }\n }\n }", "function getInput()\r\n\t{\r\n\t\t$this->name = trim($_POST['name']);\r\n\r\n\t\t$this->desg = trim($_POST['desg']);\r\n\r\n\t\t$this->gender = trim($_POST['gender']);\r\n\r\n\t\t\r\n\t\tif(strcmp($this->gender, 'M') == 0)\r\n\t\t{\r\n\t\t\t$this->addr = trim($_POST['office']);\r\n\t\t}\t\r\n\r\n\t\telseif(strcmp($this->gender, 'F') == 0)\r\n\t\t\t$this->addr = trim($_POST['resd']);\r\n\r\n\t\t\r\n\t\t$this->contacts = array(trim($_POST['con1']));\r\n\t\tarray_push($this->contacts, trim($_POST['con2']), trim($_POST['con3']), trim($_POST['con4']), trim($_POST['con5']));\r\n\r\n\t\t$this->emails = array(trim($_POST['email1']));\r\n\t\tarray_push($this->emails, trim($_POST['email2']));\r\n\r\n\t\t//print_r($this->emails);\r\n\r\n\t\t$this->validateInput();\r\n\r\n\t}", "abstract function getForm();", "protected function _readFormFields() {}", "abstract protected function getForm();", "function issue_prepare_brief_view_vars($issue = null) {\n\t$fields = array(\n 'Title' => $issue->title,\n 'Description' => $issue->description,\n 'Status' => $issue->status,\n 'Issue #' => $issue->number,\n 'Asset' => get_entity($issue->asset)->title,\n 'Tags' => $issue->tags,\n\t);\n\n\tif ($issue) {\n\t\tforeach (array_keys($fields) as $field) {\n\t\t\tif (isset($issue->$field)) {\n\t\t\t\t$values[$field] = $issue->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('jot')) {\n\t\t$sticky_values = elgg_get_sticky_values('jot');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$fields[$key] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('jot');\n\n\treturn $fields;\n}", "abstract public function getFormDesc();", "public function setupControl()\n\t{\n\t\t$this->addText('referenceNumber', 'Reference number:');\n\t\t$this->addSelect('priority', 'Priority:', PriorityEnum::getOptions());\n\t\t$this->addTextArea('symptoms', 'Symptoms:', 40, 8)\n\t\t\t->addRule(Form::FILLED, 'Symptoms are required.');\n\t\t$this->addText('problemOwner', 'Problem owner:');\n\t\t$this->addSelect('status', 'State:', array(\n\t\t\tOperationProblem::STATUS_NEW => 'new',\n\t\t\tOperationProblem::STATUS_INVESTIGATED => 'investigated',\n\t\t\tOperationProblem::STATUS_RESOLVED => 'resolved',\n\t\t\tOperationProblem::STATUS_CLOSED => 'closed'\n\t\t));\n\n\t\t$this->addSelect('category', 'Category:', array('' => $this->noCategoryText) + $this->getCategoriesOptions());\n\n\t\t$this->addTextArea('onEventRaw', 'onEvent:');\n\n\t\t$this->addSubmit('save', 'Save problem');\n\n\t\t$this->onValidate[] = $this->onValidateForm;\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "public function getFormValues()\n {\n return array(\n 'title' => $this->issue['subject'],\n 'reference' => $this->issue['id'],\n 'date_started' => $this->issue['start_date'],\n 'description' => $this->issue['description']\n );\n }", "abstract protected function getFormTypeParams();", "private function resetInputFields(){\n $this->name = '';\n $this->content = '';\n $this->todo_id = '';\n }", "public function input() {\n $this->is_loggedIn();\n $this->is_admin();\n // Populate username for form field username\n $operators = $this->populateOperator();\n // Populate vin for form field plate_number and serial_number\n $plate_number = $this->populateVin();\n $data = [\n 'username'=>$operators['username'],\n 'oId'=>$operators['oId'],\n 'plate_number'=>$plate_number,\n ];\n $this->load->view('template_administrator/header');\n $this->load->view('template_administrator/sidebar');\n $this->load->view('administrator/lk_dt_form',$data);\n $this->load->view('template_administrator/footer');\n }", "abstract function form();", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "function campos_formulario( $fields) {\n\n //Variables necesarias básicas como que el email es obligatorio\n $commenter = wp_get_current_commenter();\n $req = get_option( 'require_name_email' );\n\t$aria_req = ( $req ? \" aria-required='true'\" : '' );\n\t\n // campos por defecto del formulario que vamos a introducir con nuestros cambios\n $fields = array(\n\t\t\n // NOMBRE\n 'author' =>\n\t'<input id=\"author\" placeholder=\"Nombre\" \n\tclass=\"nombre\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) . \n\t'\" size=\"30\"' . $aria_req . ' />',\n\n // EMAIL\n 'email' =>\n\t'<input id=\"email\" placeholder=\"Email\" \n\tclass=\"email\" name=\"email\" type=\"email\" value=\"' . esc_attr( $commenter['comment_author_email'] ) . '\" size=\"30\"' . $aria_req . ' />',\n\t);\n\t\n\treturn $fields;\n }", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "protected function createFormFields() {\n\t}", "public function handleUserEntry()\n {\n $sessionClass = ReporticoSession();\n\n // First look for a parameter beginning \"submit_\". This will identify\n // What the user wanted to do.\n\n $hide_area = false;\n $show_area = false;\n $maintain_sql = false;\n $xmlsavefile = false;\n $xmldeletefile = false;\n if (($k = $this->getMatchingPostItem(\"/^submit_/\"))) {\n // Strip off \"_submit\"\n preg_match(\"/^submit_(.*)/\", $k, $match);\n\n // Now we should be left with a field element and an action\n // Lets strip the two\n $match1 = preg_split('/_/', $match[0]);\n $fld = $match1[1];\n $action = $match1[2];\n\n switch ($action) {\n case \"ADD\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->addMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"DELETE\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->deleteMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEUP\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->moveupMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEDOWN\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->movedownMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"SET\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->updateMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"REPORTLINK\":\n case \"REPORTLINKITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"link\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"REPORTIMPORT\":\n case \"REPORTIMPORTITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"import\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"SAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n if (!$xmlsavefile) {\n trigger_error(ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\"), E_USER_ERROR);\n }\n\n break;\n\n case \"PREPARESAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n $sessionClass::setReporticoSessionParam(\"execute_mode\", \"PREPARE\");\n\n if (!$xmlsavefile) {\n header(\"HTTP/1.0 404 Not Found\", true);\n echo '<div class=\"reportico-error-box\">' . ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\") . \"</div>\";\n die;\n }\n\n break;\n\n case \"DELETEREPORT\":\n $xmldeletefile = $this->query->xmloutfile;\n break;\n\n case \"HIDE\":\n $hide_area = $fld;\n break;\n\n case \"SHOW\":\n $show_area = $fld;\n break;\n\n case \"SQL\":\n $show_area = $fld;\n if ($fld == \"mainquerqury\") {\n // Main Query SQL Generation.\n $sql = stripslashes($_REQUEST[\"mainquerqury_SQL\"]);\n\n $maintain_sql = $sql;\n if (Authenticator::login()) {\n $p = new SqlParser($sql);\n if ($p->parse()) {\n $p->importIntoQuery($qr);\n if ($this->query->datasource->connect()) {\n $p->testQuery($this->query, $sql);\n }\n\n }\n }\n } else {\n // It's a lookup\n if (preg_match(\"/mainquercrit(.*)qury/\", $fld, $match1)) {\n $lookup = (int) $match1[1];\n $lookup_char = $match1[1];\n\n // Access the relevant crtieria item ..\n $qc = false;\n $ak = array_keys($this->query->lookup_queries);\n if (array_key_exists($lookup, $ak)) {\n $q = $this->query->lookup_queries[$ak[$lookup]]->lookup_query;\n } else {\n $q = new Reportico();\n }\n\n // Parse the entered SQL\n $sqlparm = $fld . \"_SQL\";\n $sql = $_REQUEST[$sqlparm];\n $q->maintain_sql = $sql;\n $q = new Reportico();\n $p = new SqlParser($sql);\n if ($p->parse()) {\n if ($p->testQuery($this->query, $sql)) {\n $p->importIntoQuery($q);\n $this->query->setCriteriaLookup($ak[$lookup], $q, \"WHAT\", \"NOW\");\n }\n }\n }\n }\n\n break;\n\n }\n }\n\n // Now work out what the maintainance screen should be showing by analysing\n // whether user pressed a SHOW button a HIDE button or keeps a maintenance item\n // show by presence of a shown value\n if (!$show_area) {\n // User has not pressed SHOW_ button - this would have been picked up in previous submit\n // So look for longest shown item - this will allow us to draw the maintenace screen with\n // the correct item maximised\n foreach ($_REQUEST as $k => $req) {\n if (preg_match(\"/^shown_(.*)/\", $k, $match)) {\n $containee = \"/^\" . $hide_area . \"/\";\n $container = $match[1];\n if (!preg_match($containee, $container)) {\n if (strlen($match[1]) > strlen($show_area)) {\n $show_area = $match[1];\n }\n }\n }\n }\n\n }\n\n if (!$show_area) {\n $show_area = \"mainquer\";\n }\n\n $xmlout = new XmlWriter($this->query);\n $xmlout->prepareXmlData();\n\n // If Save option has been used then write data to the named file and\n // use this file as the defalt input for future queries\n if ($xmlsavefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->writeFile($xmlsavefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", $xmlsavefile);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENOSAVE\"), E_USER_ERROR);\n }\n\n }\n\n // If Delete Report option has been used then remove the file\n // use this file as the defalt input for future queries\n if ($xmldeletefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->removeFile($xmldeletefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", false);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENODEL\"), E_USER_ERROR);\n }\n\n }\n\n $xml = $xmlout->getXmldata();\n $this->query->xmlintext = $xml;\n\n $this->query->xmlin = new XmlReader($this->query, false, $xml);\n $this->query->xmlin->show_area = $show_area;\n $this->query->maintain_sql = false;\n }", "private function generateFormConstantes()\n {\n $inputs = array();\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Seuil de Calcul Prime fichier',\n 'name' => 'co_seuil_prime_fichier',\n 'desc' => 'Montant du seuil de calcul de la prime',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prime fichier',\n 'name' => 'co_prime_fichier',\n 'desc' => 'Montant de la prime fichier',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prime parrainage',\n 'name' => 'co_prime_parrainage',\n 'desc' => 'Montant de la prime parrainage',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prospects par jour',\n 'name' => 'co_prospects_jour',\n 'desc' => 'Nombre de prospects affectés par jour travaillé',\n 'class' => 'input fixed-width-md',\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prospects par heure',\n 'name' => 'co_prospects_heure',\n 'desc' => 'Nombre de prospects par heure travaillé',\n 'class' => 'input fixed-width-md',\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Ancienneté des prospects',\n 'name' => 'co_prospects_jour_max',\n 'desc' => 'Nombre de jour maximum d\\'ancienneté des prospects pour l\\'atribution',\n 'class' => 'input fixed-width-md',\n 'suffix' => 'jour'\n );\n\n $fields_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Configuration'),\n 'icon' => 'icon-cogs'\n ),\n 'input' => $inputs,\n 'submit' => array(\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => 'submitConfiguration'\n )\n )\n );\n\n $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));\n $helper = new HelperForm();\n $helper->default_form_language = $lang->id;\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name\n . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigConfiguration(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id\n );\n return $helper->generateForm(array($fields_form));\n\n }", "function print_input_fields()\n{\n\t$fields = func_get_args();\n\tforeach ($fields as $field)\n\t{\n\t\t$value = array_key_value($_POST,$field,'');\n\t\t$label = ucwords(str_replace('_',' ',$field));\n\t\tprint <<<EOQ\n <tr>\n <td valign=top align=right>\n <b>$label:</b>\n </td>\n <td valign=top align=left>\n <input type=\"text\" name=\"$field\" size=\"40\" value=\"$value\">\n </td>\n </tr>\nEOQ;\n\t}\n}", "private function resetInputFields(){\n $this->teacher_id = '';\n $this->lending_id = '';\n $this->note = '';\n $this->device_id = '';\n $this->org_id_1 = '';\n $this->org_id_2 = '';\n $this->lendingDate = '';\n $this->returnDate = '';\n }", "function monthly_vehicle_inspection_report_form($form, &$form_state) {\n\n // Array to help build our (similar) form elements\n $ele_arr = array(\n 'engine_oil' => t('Engine Oil'),\n 'coolant_level' => t('Coolant Level'),\n 'trans_fluid_level' => t('Transmission Fluid Level'),\n 'seat_belts' => t('Seat Belts'),\n 'battery' => t('Battery'),\n 'tires' => t('Tires'),\n 'fan_belts' => t('Fan Belts'),\n 'headlights' => t('Headlights'),\n 'tail_lights' => t('Tail Lights'),\n 'brake_lights' => t('Brake Lights'),\n 'turn_signals' => t('Turn Signals'),\n 'all_glass_and_mirrors' => t('All Glass and Mirrors'),\n 'body_damage' => t('Body Damage'),\n 'overall_vehicle_cleanliness' => t('Overall Vehicle Cleanliness'),\n 'hoses' => t('Hoses'),\n 'gauges' => t('Gauges'),\n 'vehicle_accident_kit' => t('Vehicle Accident Kit'),\n 'fire_extinguisher' => t('Fire Extinguisher'),\n 'parking_brake' => t('Parking Brake'),\n 'horn' => t('Horn'),\n 'steering_wheel_play' => t('Steering Wheel Play'),\n 'first_aid_kit' => t('First Aid Kit'),\n 'brakes' => t('Brakes'),\n );\n\n $form['main_container'] = array(\n '#type' => 'fieldset',\n '#title' => t('Monthly Vehicle Inspection Report Form'),\n );\n\n $form['main_container']['make'] = array(\n '#type' => 'textfield',\n '#title' => t('Make'),\n '#description' => 'Make of vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"vehicle-make\">',\n '#suffix' => '</div>',\n// '#required' => TRUE,\n );\n\n $form['main_container']['license_plate_num'] = array(\n '#type' => 'textfield',\n '#title' => t('License Plate Number'),\n '#description' => 'License Plate Number on vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"license-plate-num\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['model'] = array(\n '#type' => 'textfield',\n '#title' => t('Model'),\n '#description' => 'Model of vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"vehicle-model\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['mileage'] = array(\n '#type' => 'textfield',\n '#title' => t('Mileage'),\n '#description' => 'Mileage on vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"vehicle-mileage\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['assigned_to'] = array(\n '#type' => 'textfield',\n '#title' => t('Assigned To'),\n '#description' => 'Person assigned to this vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"vehicle-assigned-to\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['vehicle_data'] = array(\n '#type' => 'fieldset',\n '#tree' => TRUE,\n '#prefix' => '<div class=\"cont-container\">',\n '#suffix' => '</div>',\n );\n\n\n // Build our elements that are all similar except the tires element\n foreach($ele_arr as $key => $val) {\n\n $form['main_container']['vehicle_data'][$key] = array(\n '#type' => 'fieldset',\n '#title' => $val,\n '#prefix' => '<div class=\"cont-title\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['vehicle_data'][$key][$key . '_radio'] = array(\n '#type' => 'radios',\n '#title' => t(''),\n '#options' => array(\n 'satisfactory' => t('Satisfactory'),\n 'replace' => t('Replace'),\n 'na' => t('Not Applicable'),\n ),\n '#description' => '',\n '#prefix' => '<div class=\"cont-radio\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['vehicle_data'][$key][$key . '_comm'] = array(\n '#type' => 'textfield',\n '#title' => t('Comments'),\n// '#title_display' => 'invisible',\n '#default_value' => $key === 'tires' ? 'FL: FR: RL: RR:' : '',\n '#prefix' => '<div class=\"cont-comm\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n }\n\n $form['main_container']['remarks'] = array(\n '#type' => 'textarea',\n '#title' => t('Remarks'),\n '#description' => 'Any remarks about the vehicle.',\n '#default_value' => '',\n '#prefix' => '<div class=\"remarks\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['date'] = array(\n '#type' => 'textfield',\n '#title' => t('Date'),\n '#default_value' => date('M d, Y'),\n '#prefix' => '<div class=\"date\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['managers_sign'] = array(\n '#type' => 'textfield',\n '#title' => t('Manager\\'s Signature'),\n '#default_value' => '',\n '#prefix' => '<div class=\"managers-sign\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n $form['main_container']['drivers_sign'] = array(\n '#type' => 'textfield',\n '#title' => t('Drivers Signature'),\n '#default_value' => '',\n '#prefix' => '<div class=\"drivers-sign\">',\n '#suffix' => '</div>',\n // '#required' => TRUE,\n );\n\n// $form['main_container']['drivers_date'] = array(\n// '#type' => 'textfield',\n// '#title' => t('Date'),\n// '#default_value' => '',\n// '#prefix' => '<div class=\"drivers-date\">',\n// '#suffix' => '</div>',\n// // '#required' => TRUE,\n// );\n\n $form['main_container']['submit_button'] = array(\n '#type' => 'submit',\n '#value' => 'Submit Monthly Vehicle Inspection Report Form',\n '#prefix' => '<div class=\"submit-button\">',\n '#suffix' => '</div>',\n );\n\n\n return $form;\n}", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "protected function inputAttributes()\n {\n $this->input_attributes['name'] = $this->name;\n $this->input_attributes['type'] = 'submit';\n $this->input_attributes['value'] = $this->params['title'];\n }", "public function getForm();", "protected function _getInput($args)\n {\n extract($args);\n switch($type) {\n case 'checkbox-switch':\n return $this->switch($fieldName, $options);\n// case 'date':\n// return $this->date();\n default:\n return parent::_getInput($args);\n }\n }", "function inputDashboardTemplate ($idHtml, $labelHtml, $type, $eventFunction, $projectName) {\n\tswitch($type){\n\t\tcase \"INPUT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml:</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" />\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\t$idHtmltemp= getOptions($idHtml);\n\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($idHtmltemp);$i++){\n\t\t\t\tif(strstr($idHtmltemp[$i],\":\")){\n\t\t\t\t\t$idHtmltemp1=explode(\":\",$idHtmltemp[$i]);\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp1[0]</option>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp[$i]</option>\";\n\t\t\t}\n\t\t\techo \"<option value =\\\"Rejected\\\">Rejected</option>\";\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT_ARRAY\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($projectName);$i++){\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\">$projectName[$i]</option>\";\n\t\t\t}\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\t\tcase \"DATE\":\n\t\t\techo\"<br>\";\n echo \"<label for=\\\"$idHtml\\\">$labelHtml: (yyyy-mm-dd)</label>\";\n echo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n echo \" value = \\\"$value\\\"\";\n if ($disabled==\"D\")\n echo \"Disabled=\\\"Disabled\\\"\";\n echo \" />\";\n $idHtmlbtn=\"$idHtml\".\"btn\";\n echo \"<button id= \\\"$idHtmlbtn\\\"\";\n if ($disabled==\"D\")\n echo \"Disabled=\\\"Disabled\\\"\";\n echo \">:::</button>\";\n echo \"<script type=\\\"text/javascript\\\">\";\n echo \"var cal = Calendar.setup({\";\n echo \"onSelect: function(cal) { cal.hide() }\";\n echo \"});\";\n echo \"cal.manageFields( \\\"$idHtmlbtn\\\",\\\"$idHtml\\\", \\\"%Y-%m-%d\\\");\";\n echo \"cal.manageFields( \\\"$idHtmlbtn\\\", \\\"$idHtml\\\",\\\"%Y-%m-%d\\\");\";\n echo \"</script>\";\n echo\"<br>\";\n break;\n\t}\n}", "function emc_comment_form_args( $args ) {\r\n\t$args[ 'fields' ] = array(\r\n\t\t'author' => '<div class=\"comment-form-author\"><label for=\"author\">' . esc_html__( 'Name', 'emc' ) . '</label><input type=\"text\" class=\"field\" name=\"author\" id=\"author\" aria-required=\"true\" placeholder=\"' . esc_attr__( 'Name', 'emc' ) . '\" /></div><!-- .comment-form-author -->',\r\n\t\t'email' => '<div class=\"comment-form-email\"><label for=\"email\">' . esc_html__( 'Email', 'emc' ) . '</label><input type=\"text\" class=\"field\" name=\"email\" id=\"email\" aria-required=\"true\" placeholder=\"' . esc_attr__( 'Email', 'emc' ) . '\" /></div><!-- .comment-form-email -->',\r\n\t\t'url' => '<div class=\"comment-form-url\"><label for=\"url\">' . esc_html__( 'Website', 'emc' ) . '</label><input type=\"text\" class=\"field\" name=\"url\" id=\"url\" placeholder=\"' . esc_attr__( 'Website', 'emc' ) . '\" /></div><!-- .comment-form-url -->'\r\n\t);\r\n\t$args[ 'comment_field' ] = '<div class=\"comment-form-comment\"><label for=\"comment\">' . esc_html__( 'Comment', 'emc' ) . '</label><textarea id=\"comment\" class=\"field\" name=\"comment\" rows=\"8\" aria-required=\"true\" placeholder=\"' . esc_attr__( 'Comment', 'emc' ) . '\"></textarea></div><!-- .comment-form-comment -->';\r\n\t$args[ 'comment_notes_before' ] = '<p class=\"comment-notes\">' . esc_html__( 'Your email will not be published. Name and Email fields are required.', 'emc' ) . '</p>';\r\n\treturn $args;\r\n}", "protected function setDbalInputFieldsToRender() {}", "function vals_soc_admin_frontpage_form($form, $form_state) {\n $complete_this_section = t('Complete this section');\n $intro_header = variable_get('vals_intro_header', 'How VALS Semester of Code Works');\n $form['vals_intro_header'] = array(\n '#type' => 'textfield',\n '#title' => t('Header 4 of the introduction'),\n '#default_value' => $intro_header,\n );\n\n $intro_input = variable_get('vals_intro_text', array('value' => $complete_this_section, 'format' => 'full_html'));\n $form['vals_intro_text'] = array(\n '#format' => $intro_input['format'],\n '#type' => 'text_format',\n '#base_type' => 'textarea',\n '#title' => t('Introduction of the frontpage'),\n '#default_value' => $intro_input['value'],\n '#suffix' => '<p></p>',\n );\n $intro_input = variable_get('vals_intro_text_no_schedule', array('value' => $complete_this_section, 'format' => 'full_html'));\n $form['vals_intro_text_no_schedule'] = array(\n '#format' => $intro_input['format'],\n '#type' => 'text_format',\n '#base_type' => 'textarea',\n '#title' => t('Introduction of the frontpage when no time schedule is used'),\n '#default_value' => $intro_input['value'],\n '#suffix' => '<p></p>',\n );\n $news_input = variable_get('vals_news_text', array('value' => $complete_this_section, 'format' => 'full_html'));\n $form['vals_news_text'] = array(\n '#format' => $news_input['format'],\n '#type' => 'text_format',\n '#base_type' => 'textarea',\n '#title' => t('News block text'),\n '#default_value' => $news_input['value'],\n '#suffix' => '<p></p>',\n );\n //$form['#validate'][] = 'vals_soc_admin_messages_form_validate';\n //Seems to be done automatically $form['#submit'][] = 'vals_soc_admin_messages_form_submit';\n return system_settings_form($form);\n}", "function process_form()\n {\n }", "public function getEditInput();", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "function new_prescript() {\n\n echo \"<label for='Patient'> PID: </label>\";\n echo \"<input type='text' name='Patient' required><br>\";\n\n echo \"<label for='Prescript_Name'> Drug Name: </label>\";\n echo \"<input type='text' name='Prescript_Name' required><br>\";\n\n echo \"<label for='Dosage'> Dosage: </label>\";\n echo \"<input type='text' name='Dosage' required><br><br>\";\n\n echo \"Refill allowed?<br>\";\n echo \"<label for='Y'> Yes </label>\";\n echo \"<input type='radio' name='Refill' value='Y' required><br>\";\n echo \"<label for='N'> No </label>\";\n echo \"<input type='radio' name='Refill' value='N'><br><br>\";\n\n echo \"Expiration Date: <br>\";\n echo \"<input type='datetime-local' step=1800 name='Expiration_date'><br><br>\";\n }", "public function fixAction()\n {\n $mMainReq = Qss_Model_Db::Table('OYeuCauMuaSam');\n $mMainReq->where(sprintf('IFID_M412 = %1$d', $this->_form->i_IFID));\n $oMainReq = $mMainReq->fetchOne();\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n\n $this->html->main = $oMainReq;\n $this->html->sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function checkFormsIssues(ContextInterface $ctx): CheckFormsIssuesResponse;", "function getInputForm() {\n\t\treturn new \\Flux\\LeadSplit();\n\t}", "function gatherFormFields($submitType)\n{\n\t// then pass the data to the appropriate function for\n\t// editing or insertion.\n\t\n\t$arrFields = array(); // To hold the sanitized values\n\t\n\t// Field: ID\n\tif (isset($_POST['dealid']))\n\t{\n\t\t$id = (int)$_POST['dealid'];\n\t}\n\telse\n\t{\n\t\t$submitType = 'new';\t// Even if this was submitted as an edit, if no dealid was provided, create a new record.\n\t}\n\t\n\t// Field: company\n\tif (isset($_POST['edit_company']))\n\t{\n\t\t$arrFields['store'] = intval($_POST['edit_company']);\n\t}\n\telse\n\t{\n\t\t$arrFields['store'] = null;\n\t}\n\t\n\t// Field: dealurl\n\tif (isset($_POST['edit_dealurl']))\n\t{\n\t\t$arrFields['dealurl'] = mysql_real_escape_string($_POST['edit_dealurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['dealurl'] = '';\n\t}\n\n\t// Field: img\n\tif (isset($_POST['edit_image']))\n\t{\n\t\t$arrFields['img'] = mysql_real_escape_string($_POST['edit_image']);\n\t}\n\telse\n\t{\n\t\t$arrFields['img'] = '';\n\t}\n\n\t// Field: imgurl\n\tif (isset($_POST['edit_imageurl']))\n\t{\n\t\t$arrFields['imgurl'] = mysql_real_escape_string($_POST['edit_imageurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['imgurl'] = '';\n\t}\n\n\t// Field: showdate\n\tif (isset($_POST['edit_show_date']))\n\t{\n\t\t$arrFields['showdate'] = mysql_real_escape_string($_POST['edit_show_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['showdate'] = date('Y-m-d H:i:s');\n\t}\n\n\t// Field: expire\n\tif (isset($_POST['edit_expiration_date']))\n\t{\n\t\t$arrFields['expire'] = mysql_real_escape_string($_POST['edit_expiration_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['expire'] = null;\n\t}\n\n\t// Field: valid\n\tif (isset($_POST['edit_valid']))\n\t{\n\t\t$arrFields['valid'] = intval($_POST['edit_valid']);\n\t}\n\telse\n\t{\n\t\t$arrFields['valid'] = 1;\n\t}\n\t\n\t// Field: invalidreason\n\tif (isset($_POST['edit_invalidreason']))\n\t{\n\t\t$arrFields['invalidreason'] = mysql_real_escape_string($_POST['edit_invalidreason']);\n\t}\n\telse\n\t{\n\t\t$arrFields['invalidreason'] = '';\n\t}\n\t\n\t// Field: subject\n\tif (isset($_POST['edit_subject']))\n\t{\n\t\t$arrFields['subject'] = mysql_real_escape_string($_POST['edit_subject']);\n\t}\n\telse\n\t{\n\t\t$arrFields['subject'] = '';\n\t}\n\t\n\t// Field: brief\n\tif (isset($_POST['edit_brief']))\n\t{\n\t\t$arrFields['brief'] = mysql_real_escape_string($_POST['edit_brief']);\n\t\t$arrFields['verbose'] = mysql_real_escape_string($_POST['edit_brief']);\n\t}\n\telse\n\t{\n\t\t$arrFields['brief'] = '';\n\t\t$arrFields['verbose'] = '';\n\t}\n\n\t// Field: updated\n\t$arrFields['updated']\t\t= date('Y-m-d H:i:s');\n\t$arrFields['whoupdated']\t= $_SESSION['firstname'];\n\t\n\tif ($submitType == 'edit')\n\t{\n\t\tsaveEdit($arrFields, $id);\n\t}\n\telse\n\t{\n\t\tsaveNew($arrFields);\n\t}\n}", "public function getEditForm();", "public function get_input()\n {\n }", "function istpgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 24) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(780);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('istpgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('istpgr_school_check_780', 'Select a VCCS College/Agency', 780);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(853);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('istpgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('istpgr_job_check_853', 'Select a Job Type', 853);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(782);\n $email_check = $ninja_forms_processing->get_field_value(783);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('istpgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('istpgr_email_check_782', 'Email addresses must match', 782);\n $ninja_forms_processing->add_error('istpgr_email_check_783', 'Email addresses must match', 783);\n }\n }\n}", "private function getFormItBuilderOutput(){\n\t\t$s_submitVar = 'submitVar_'.$this->_id;\n\t\t$b_customSubmitVar=false;\n\t\tif(empty($this->_submitVar)===false){\n\t\t\t$s_submitVar = $this->_submitVar;\n\t\t\t$b_customSubmitVar=true;\n\t\t}\n\t\t$s_recaptchaJS='';\n\t\t$b_posted = false;\n\t\tif(isset($_REQUEST[$s_submitVar])===true){\n\t\t\t$b_posted=true;\n\t\t}\n\t\t$nl=\"\\r\\n\";\n\n\t\t//process and add form rules\n\t\t$a_fieldProps=array();\n\t\t$a_fieldProps_jqValidate=array();\n\t\t$a_fieldProps_jqValidateGroups=array();\n\t\t$a_fieldProps_errstringFormIt=array();\n\t\t$a_fieldProps_errstringJq=array();\n\t\t\n\t\t$a_formProps=array();\n\t\t$a_formProps_custValidate=array();\n\t\t$a_formPropsFormItErrorStrings=array();\n\n\t\tforeach($this->_rules as $rule){\n\t\t\t$o_elFull = $rule->getElement();\n\t\t\tif(is_array($o_elFull)===true){\n\t\t\t\t$o_el = $o_elFull[0];\n\t\t\t}else{\n\t\t\t\t$o_el = $o_elFull;\n\t\t\t}\n\t\t\t$elId = $o_el->getId();\n\t\t\t$elName = $o_el->getName();\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_jqValidate[$elId])===false){\n\t\t\t\t$a_fieldProps_jqValidate[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringFormIt[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringFormIt[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringJq[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringJq[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_formProps_custValidate[$elId])===false){\n\t\t\t\t$a_formProps_custValidate[$elId]=array();\n\t\t\t}\n\t\t\t\n\t\t\t$s_validationMessage=$rule->getValidationMessage();\n\t\t\tswitch($rule->getType()){\n\t\t\t\tcase FormRuleType::email:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'email';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextEmailInvalid=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'email:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'email:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::fieldMatch:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'password_confirm=^'.$o_elFull[1]->getId().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextPasswordConfirm=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'equalTo:\"#'.$o_elFull[1]->getId().'\"';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'equalTo:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','maxLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'maxLength=^'.$rule->getValue().'^';\n\t\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t}\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'maxlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'maxlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'maxValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'max:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'max:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}\n\t\t\t\t\t//Made own validation rule cause FormIt doesnt behave with required.\n\t\t\t\t\t//$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'minlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'minlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'minValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'min:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'min:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::numeric:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'isNumber';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextIsNumber=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'digits:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'digits:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::required:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementMatrix')){\n\t\t\t\t\t\t$s_type=$o_el->getType();\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementMatrix_'.$s_type,'required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_rows = $o_el->getRows();\n\t\t\t\t\t\t$a_columns = $o_el->getColumns();\n\t\t\t\t\t\t$a_namesForGroup=array();\n\t\t\t\t\t\tswitch($s_type){\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\tfor($col_cnt=0; $col_cnt<count($a_columns); $col_cnt++){\n\t\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt.'_'.$col_cnt;\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\t\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\tbreak;\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'check':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$s_fieldName = $elName.'_'.$row_cnt.'[]';\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$s_fieldName;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$s_fieldName][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$s_fieldName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$a_fieldProps_jqValidateGroups[$elName]=implode(' ',$a_namesForGroup);\n\t\t\t\t\t}else if(is_a($o_el, 'FormItBuilder_elementDate')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementDate','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_0'][] = 'required:true,dateElementRequired:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_0'][] = 'required:\"'.$s_validationMessage.'\",dateElementRequired:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'required:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::date:\n\t\t\t\t\t$s_thisVal = $rule->getValue();\n\t\t\t\t\t$s_thisErrorMsg = str_replace('===dateformat===',$s_thisVal,$s_validationMessage);\n\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'date','fieldFormat'=>$s_thisVal,'errorMessage'=>$s_thisErrorMsg);\n\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'dateFormat:\\''.$s_thisVal.'\\'';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'dateFormat:\"'.$s_thisErrorMsg.'\"';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//if some custom validation options were found (date etc) then add formItBuilder custom validate snippet to the list\n\t\tif(count($a_formProps_custValidate)>0){\n\t\t\t$GLOBALS['FormItBuilder_customValidation']=$a_formProps_custValidate;\n\t\t\tif(empty($this->_customValidators)===false){\n\t\t\t\t$this->_customValidators.=',';\n\t\t\t}\n\t\t\t$this->_customValidators.='FormItBuilder_customValidation';\n\t\t}\n\t\t\n\t\t//build inner form html\n\t\t$b_attachmentIncluded=false;\n\t\t$s_form='<div>'.$nl\n\t\t.$nl.'<div class=\"process_errors_wrap\"><div class=\"process_errors\">[[!+fi.error_message:notempty=`[[!+fi.error_message]]`]]</div></div>'\n\t\t.$nl.($b_customSubmitVar===false?'<input type=\"hidden\" name=\"'.$s_submitVar.'\" value=\"1\" />':'')\n\t\t.$nl.'<input type=\"hidden\" name=\"fke'.date('Y').'Sp'.date('m').'Blk:blank\" value=\"\" /><!-- additional crude spam block. If this field ends up with data it will fail to submit -->'\n\t\t.$nl;\n\t\tforeach($this->_formElements as $o_el){\n\t\t\t$s_elClass=get_class($o_el);\n\t\t\tif($s_elClass=='FormItBuilder_elementFile'){\n\t\t\t\t$b_attachmentIncluded=true;\n\t\t\t}\n\t\t\tif(is_a($o_el,'FormItBuilder_elementHidden')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else if(is_a($o_el,'FormItBuilder_htmlBlock')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else{\n\t\t\t\t$s_typeClass = substr($s_elClass,14,strlen($s_elClass)-14);\n\t\t\t\t$forId=$o_el->getId();\n\t\t\t\tif(\n\t\t\t\t\tis_a($o_el,'FormItBuilder_elementRadioGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementCheckboxGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementDate')===true\n\t\t\t\t){\n\t\t\t\t\t$forId=$o_el->getId().'_0';\n\t\t\t\t}else if(is_a($o_el,'FormItBuilder_elementMatrix')){\n\t\t\t\t\t$forId=$o_el->getId().'_0_0';\n\t\t\t\t}\n\t\t\t\t$s_forStr = ' for=\"'.htmlspecialchars($forId).'\"';\n\t\t\t\t\n\t\t\t\tif(is_a($o_el,'FormItBuilder_elementReCaptcha')===true){\n\t\t\t\t\t$s_forStr = ''; // dont use for attrib for Recaptcha (as it is an external program outside control of formitbuilder\n\t\t\t\t\t$s_recaptchaJS=$o_el->getJsonConfig();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$s_extraClasses='';\n\t\t\t\t$a_exClasses=$o_el->getExtraClasses();\n\t\t\t\tif(count($a_exClasses)>0){\n\t\t\t\t\t$s_extraClasses = ' '.implode(' ',$o_el->getExtraClasses());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$b_required = $o_el->isRequired();\n\t\t\t\t$s_form.='<div title=\"'.$o_el->getLabel().'\" class=\"formSegWrap formSegWrap_'.htmlspecialchars($o_el->getId()).' '.$s_typeClass.($b_required===true?' required':'').$s_extraClasses.'\">';\n\t\t\t\t\t$s_labelHTML='';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_desc=$o_el->getDescription();\n\t\t\t\t\t\tif(empty($s_desc)===false){\n\t\t\t\t\t\t\t$s_desc='<span class=\"description\">'.$s_desc.'</span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s_labelHTML='<label class=\"mainElLabel\"'.$s_forStr.'><span class=\"before\"></span><span class=\"mainLabel\">'.$o_el->getLabel().'</span>'.$s_desc.'<span class=\"after\"></span></label>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$s_element='<div class=\"elWrap\">'.$nl.' <span class=\"before\"></span>'.$o_el->outputHTML().'<span class=\"after\"></span>';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_element.='<div class=\"errorContainer\"><label class=\"formiterror\" '.$s_forStr.'>[[+fi.error.'.htmlspecialchars($o_el->getId()).']]</label></div>';\n\t\t\t\t\t}\n\t\t\t\t\t$s_element.='</div>';\n\t\t\t\t\t\n\t\t\t\t\tif($o_el->getLabelAfterElement()===true){\n\t\t\t\t\t\t$s_form.=$s_element.$s_labelHTML;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$s_form.=$s_labelHTML.$s_element;\n\t\t\t\t\t}\n\t\t\t\t$s_form.=$nl.'</div>'.$nl;\n\t\t\t}\n\t\t}\n\t\t$s_form.=$nl.'</div>';\n\n\t\t//wrap form elements in form tags\n\t\t$s_form='<form action=\"'.$this->_formAction.'\" method=\"'.htmlspecialchars($this->_method).'\"'.($b_attachmentIncluded?' enctype=\"multipart/form-data\"':'').' class=\"form\" id=\"'.htmlspecialchars($this->_id).'\">'.$nl\n\t\t.$s_form.$nl\n\t\t.'</form>';\n\t\t\n\t\t//add all formit validation rules together in one array for easy implode\n\t\t$a_formItCmds=array();\n\t\t$a_formItErrorMessage=array();\n\t\tforeach($a_fieldProps as $fieldID=>$a_fieldProp){\n\t\t\tif(count($a_fieldProp)>0){\n\t\t\t\t$a_formItCmds[]=$fieldID.':'.implode(':',$a_fieldProp);\n\t\t\t}\n\t\t}\n\t\t//add formIT error messages\n\t\tforeach($a_fieldProps_errstringFormIt as $fieldID=>$msgArray){\n\t\t\tforeach($msgArray as $msg){\n\t\t\t\t$a_formItErrorMessage[]='&'.$fieldID.'.'.$msg;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor($i=0; $i<count($a_formProps); $i++){\n\t\t\t$a_formItCmds[]=$a_formProps[$i];\n\t\t\tif(empty($a_formPropsFormItErrorStrings[$i])===false){\n\t\t\t\t$a_formItErrorMessage[]=$a_formPropsFormItErrorStrings[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if using database table then add call to final hook\n\t\t$b_addFinalHooks=false;\n\t\t$GLOBALS['FormItBuilder_hookCommands']=array('formObj'=>&$this,'commands'=>array());\n\t\tif(empty($this->_databaseTableObjectName)===false){\n\t\t\t$GLOBALS['FormItBuilder_hookCommands']['commands'][]=array('name'=>'dbEntry','value'=>array('tableObj'=>$this->_databaseTableObjectName,'mapping'=>$this->_databaseTableFieldMapping));\n\t\t\t$b_addFinalHooks=true;\n\t\t}\n\t\tif($b_addFinalHooks===true){\n\t\t\t$this->_hooks[]='FormItBuilder_hooks';\n\t\t}\n\t\t\n\t\t//rebuild hooks system\n\t\t$s_hooksStr = '';\n\t\tif(empty($this->_postHookName)===false){\n\t\t $s_hooksStr.=$this->_postHookName;\n\t\t}\n\t\tif(count($this->_hooks)>0){\n\t\t if(empty($this->_postHookName)===false){\n\t\t\t$s_hooksStr.=',';\n\t\t }\n\t\t $s_hooksStr.=implode(',',$this->_hooks);\n\t\t}\n\t\t$s_fullHooksParam='';\n\t\tif(empty($s_hooksStr)===false){\n\t\t $s_fullHooksParam=$nl.'&hooks=`'.$s_hooksStr.'`';\n\t\t}\n\t\t\n\t\t$s_formItCmd='[[!FormIt?'\n\t\t.$s_fullHooksParam\t\t\t\t\n\t\t.(empty($s_recaptchaJS)===false?$nl.'&recaptchaJs=`'.$s_recaptchaJS.'`':'')\n\t\t.(empty($this->_customValidators)===false?$nl.'&customValidators=`'.$this->_customValidators.'`':'')\n\t\t\t\n\t\t.(empty($this->_emailTpl)===false?$nl.'&emailTpl=`'.$this->_emailTpl.'`':'')\n\t\t.(empty($this->_emailToAddress)===false?$nl.'&emailTo=`'.$this->_emailToAddress.'`':'')\n\t\t.(empty($this->_emailToName)===false?$nl.'&emailToName=`'.$this->_emailToName.'`':'')\n\t\t.(empty($this->_emailFromAddress)===false?$nl.'&emailFrom=`'.$this->_emailFromAddress.'`':'')\n\t\t.(empty($this->_emailFromName)===false?$nl.'&emailFromName=`'.$this->_emailFromName.'`':'')\n\t\t.(empty($this->_emailReplyToAddress)===false?$nl.'&emailReplyTo=`'.$this->_emailReplyToAddress.'`':'')\n\t\t.(empty($this->_emailReplyToName)===false?$nl.'&emailReplyToName=`'.$this->_emailReplyToName.'`':'')\n\t\t.(empty($this->_emailCCAddress)===false?$nl.'&emailCC=`'.$this->_emailCCAddress.'`':'')\n\t\t.(empty($this->_emailCCName)===false?$nl.'&emailCCName=`'.$this->_emailCCName.'`':'')\n\t\t.(empty($this->_emailBCCAddress)===false?$nl.'&emailBCC=`'.$this->_emailBCCAddress.'`':'')\n\t\t.(empty($this->_emailBCCName)===false?$nl.'&emailBCCName=`'.$this->_emailBCCName.'`':'')\n\t\t\n\t\t.(empty($this->_autoResponderTpl)===false?$nl.'&fiarTpl=`'.$this->_autoResponderTpl.'`':'')\n\t\t.(empty($this->_autoResponderSubject)===false?$nl.'&fiarSubject=`'.$this->_autoResponderSubject.'`':'')\n\t\t.(empty($this->_autoResponderToAddressField)===false?$nl.'&fiarToField=`'.$this->_autoResponderToAddressField.'`':'')\n\t\t.(empty($this->_autoResponderFromAddress)===false?$nl.'&fiarFrom=`'.$this->_autoResponderFromAddress.'`':'')\n\t\t.(empty($this->_autoResponderFromName)===false?$nl.'&fiarFromName=`'.$this->_autoResponderFromName.'`':'')\n\t\t.(empty($this->_autoResponderReplyTo)===false?$nl.'&fiarReplyTo=`'.$this->_autoResponderReplyTo.'`':'')\n\t\t.(empty($this->_autoResponderReplyToName)===false?$nl.'&fiarReplyToName=`'.$this->_autoResponderReplyToName.'`':'')\n\t\t.(empty($this->_autoResponderCC)===false?$nl.'&fiarCC=`'.$this->_autoResponderCC.'`':'')\n\t\t.(empty($this->_autoResponderCCName)===false?$nl.'&fiarCCName=`'.$this->_autoResponderCCName.'`':'')\n\t\t.(empty($this->_autoResponderBCC)===false?$nl.'&fiarBCC=`'.$this->_autoResponderBCC.'`':'')\n\t\t.(empty($this->_autoResponderBCCName)===false?$nl.'&fiarBCCName=`'.$this->_autoResponderBCCName.'`':'')\n\t\t.$nl.'&fiarHtml=`'.($this->_autoResponderHtml===false?'0':'1').'`'\t\t\t\t\n\t\t\t\t\n\t\t.$nl.'&emailSubject=`'.$this->_emailSubject.'`'\n\t\t.$nl.'&emailUseFieldForSubject=`1`'\n\t\t.$nl.'&redirectTo=`'.$this->_redirectDocument.'`'\n\t\t.(empty($this->_redirectParams)===false?$nl.'&redirectParams=`'.$this->_redirectParams.'`':'')\n\t\t.$nl.'&store=`'.($this->_store===true?'1':'0').'`'\n\t\t.$nl.'&submitVar=`'.$s_submitVar.'`'\n\t\t.$nl.implode($nl,$a_formItErrorMessage)\n\t\t.$nl.'&validate=`'.(isset($this->_validate)?$this->_validate.',':'').implode(','.$nl.' ',$a_formItCmds).','.$nl.'`]]'.$nl;\n\t\t\n\t\tif($this->_jqueryValidation===true){\n\t\t\t$s_js='\t\n$().ready(function() {\n\njQuery.validator.addMethod(\"dateFormat\", function(value, element, format) {\n\tvar b_retStatus=false;\n\tvar s_retValue=\"\";\n\tvar n_retTimestamp=0;\n\tif(value.length==format.length){\n\t\tvar separator_only = format;\n\t\tvar testDate;\n\t\tif(format.toLowerCase()==\"yyyy\"){\n\t\t\t//allow just yyyy\n\t\t\ttestDate = new Date(value, 1, 1);\n\t\t\tif(testDate.getFullYear()==value){\n\t\t\t\tb_retStatus=true;\n\t\t\t}\n\t\t}else{\n\t\t\tseparator_only = separator_only.replace(/m|d|y/g,\"\");\n\t\t\tvar separator = separator_only.charAt(0)\n\n\t\t\tif(separator && separator_only.length==2){\n\t\t\t\tvar dayPos; var day; var monthPos; var month; var yearPos; var year;\n\t\t\t\tvar s_testYear;\n\t\t\t\tvar newStr = format;\n\n\t\t\t\tdayPos = format.indexOf(\"dd\");\n\t\t\t\tday = parseInt(value.substr(dayPos,2),10)+\"\";\n\t\t\t\tif(day.length==1){day=\"0\"+day;}\n\t\t\t\tnewStr=newStr.replace(\"dd\",day);\n\n\t\t\t\tmonthPos = format.indexOf(\"mm\");\n\t\t\t\tmonth = parseInt(value.substr(monthPos,2),10)+\"\";\n\t\t\t\tif(month.length==1){month=\"0\"+month;}\n\t\t\t\tnewStr=newStr.replace(\"mm\",month);\n\n\t\t\t\tyearPos = format.indexOf(\"yyyy\");\n\t\t\t\tyear = parseInt(value.substr(yearPos,4),10);\n\t\t\t\tnewStr=newStr.replace(\"yyyy\",year);\n\n\t\t\t\ttestDate = new Date(year, month-1, day);\n\n\t\t\t\tvar testDateDay=(testDate.getDate())+\"\";\n\t\t\t\tif(testDateDay.length==1){testDateDay=\"0\"+testDateDay;}\n\n\t\t\t\tvar testDateMonth=(testDate.getMonth()+1)+\"\";\n\t\t\t\tif(testDateMonth.length==1){testDateMonth=\"0\"+testDateMonth;}\n\n\t\t\t\tif (testDateDay==day && testDateMonth==month && testDate.getFullYear()==year) {\n\t\t\t\t\tb_retStatus = true;\n\t\t\t\t\t$(element).val(newStr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Please enter a valid date.\");\n\njQuery.validator.addMethod(\"dateElementRequired\", function(value, element, format) {\n\tvar el=element;\n\tb_retStatus=true;\n\tvar elBaseId=element.id.substr(0,element.id.length-2);\n\tif($(\"#\"+elBaseId+\"_0\").val()==\"\" || $(\"#\"+elBaseId+\"_1\").val()==\"\" || $(\"#\"+elBaseId+\"_2\").val()==\"\"){\n\t\tb_retStatus=false;\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Date element is required.\");\n\n//Main validate call\nvar thisFormEl=$(\"#'.$this->_id.'\");\nthisFormEl.validate({errorPlacement:function(error, element) {\n\tvar labelEl = element.parents(\".formSegWrap\").find(\".errorContainer\");\n\terror.appendTo( labelEl );\n},success: function(element) {\n\telement.addClass(\"valid\");\n\tvar formSegWrapEl = element.parents(\".formSegWrap\");\n\tformSegWrapEl.children(\".mainElLabel\").removeClass(\"mainLabelError\");\n},highlight: function(el, errorClass, validClass) {\n\tvar element= $(el);\n\telement.addClass(errorClass).removeClass(validClass);\n\telement.parents(\".formSegWrap\").children(\".mainElLabel\").addClass(\"mainLabelError\");\n},invalidHandler: function(form, validator){\n\t//make nice little animation to scroll to the first invalid element instead of an instant jump\n\tvar jumpEl = $(\"#\"+validator.errorList[0].element.id).parents(\".formSegWrap\");\n\t$(\"html,body\").animate({scrollTop: jumpEl.offset().top});\n if(FormItBuilderInvalidCallback){FormItBuilderInvalidCallback();}\n},ignore:\":hidden\",'.\n\t\t\t\t\t\n$this->jqueryValidateJSON(\n\t$a_fieldProps_jqValidate,\n\t$a_fieldProps_errstringJq,\n\t$a_fieldProps_jqValidateGroups\n).'});\n\t\n'.\n//Force validation on load if already posted\n($b_posted===true?'thisFormEl.valid();':'')\n.'\n\t\n});\n';\n\t\t}\n\t\t\n\t\t//Allows output of the javascript into a paceholder so in can be inserted elsewhere in html (head etc)\n\t\tif(empty($this->_placeholderJavascript)===false){\n\t\t\t$this->modx->setPlaceholder($this->_placeholderJavascript,$s_js);\n\t\t\treturn $s_formItCmd.$s_form;\n\t\t}else{\n\t\t\treturn $s_formItCmd.$s_form.\n'<script type=\"text/javascript\">\n// <![CDATA[\n'.$s_js.'\n// ]]>\n</script>';\n\t\t}\n\t}", "function pdfbulletin_edit_form(&$node, $form_state) {\n $type = node_get_types('type', $node);\n $pdfbulletin = $node->pdfbulletin;\n $form['pdfbulletin'] = array(\n '#type' => 'value',\n '#value' => $pdfbulletin,\n );\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => check_plain($type->title_label),\n '#required' => TRUE,\n '#default_value' => $node->title,\n '#weight' => -5,\n );\n\n $form['header_format'] = array(\n '#tree' => FALSE,\n );\n $form['header_format']['header'] = array(\n '#title' => t('Header'),\n '#type' => 'textarea',\n '#default_value' => $pdfbulletin->header,\n );\n $form['header_format']['format'] = filter_form($pdfbulletin->header_format, NULL, array('header_format'));\n\n $form['footer_format'] = array(\n '#tree' => FALSE,\n );\n $form['footer_format']['footer'] = array(\n '#title' => t('Footer'),\n '#type' => 'textarea',\n '#default_value' => $pdfbulletin->footer,\n );\n $form['footer_format']['format'] = filter_form($pdfbulletin->footer_format, NULL, array('footer_format'));\n\n $form['email_format'] = array(\n '#tree' => FALSE, \n );\n $form['email_format']['email'] = array(\n '#title' => t('Text for e-mail'),\n '#type' => 'textarea',\n '#default_value' => $pdfbulletin->email,\n );\n $form['email_format']['format'] = filter_form($pdfbulletin->email_format, NULL, array('email_format'));\n\n $form['empty_text_format'] = array(\n '#tree' => FALSE,\n );\n $form['empty_text_format']['empty_text'] = array(\n '#title' => t('Empty text'),\n '#type' => 'textarea',\n '#default_value' => $pdfbulletin->empty_text,\n '#description' => t('Text for e-mail if it is sent with an empty bulletin.'),\n );\n $form['empty_text_format']['format'] = filter_form($pdfbulletin->empty_text_format, NULL, array('empty_text_format'));\n\n $paper_sizes = pdfbulletin_util_settings('paper_size');\n $form['paper_size'] = array(\n '#title' => t('Paper size'),\n '#type' => 'select',\n '#default_value' => $pdfbulletin->paper_size,\n );\n foreach ($paper_sizes as $key => $value) {\n $form['paper_size']['#options'][$key] = t($key);\n }\n\n $css = pdfbulletin_css();\n $form['css_file'] = array(\n '#title' => t('Style'),\n '#type' => 'select',\n '#default_value' => $pdfbulletin->css_file,\n );\n foreach ($css as $key => $value) {\n $form['css_file']['#options'][$key] = check_plain($value);\n }\n\n\n return $form;\n}", "function eve_api_enter_api_form($form, &$form_state) {\n $form['verify']['info'] = array(\n '#type' => 'item',\n '#title' => t('Verify Blue Status'),\n '#description' => t('Please enter your EVE API Key in order to verify you qualify for an account. Please ensure your key matches the options listed below.'),\n '#weight' => 0,\n );\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? t('You may set an expiry, but the preferred method is to tick the box \"No Expiry\".') : t('Please tick the box \"No Expiry\".');\n $allow_type = variable_get('eve_api_require_type', TRUE) ? t('Please set this to \"All\".') : t('You may select your main character or \"All\".');\n\n $form['verify']['help_character'] = array(\n '#type' => 'item',\n '#title' => t('Character:'),\n '#description' => $allow_type,\n '#weight' => 10,\n );\n\n $form['verify']['help_type'] = array(\n '#type' => 'item',\n '#title' => t('Type:'),\n '#description' => t('Please set this to \"Character\".'),\n '#weight' => 20,\n );\n\n $form['verify']['help_expire'] = array(\n '#type' => 'item',\n '#title' => t('Expires:'),\n '#description' => $allow_expires,\n '#weight' => 30,\n );\n\n $form['verify']['help_mask'] = array(\n '#type' => 'item',\n '#title' => t('Access Mask:'),\n '#description' => t('Click <a href=\"@mask\" target=\"_blank\">here</a> to create a new key with the correct access mask pre-selected.', array('@mask' => 'http://community.eveonline.com/support/api-key/CreatePredefined?accessMask=' . variable_get('eve_api_access_mask', 268435455))),\n '#weight' => 40,\n );\n\n $form['verify']['keyID'] = array(\n '#type' => 'textfield',\n '#title' => t('Key ID'),\n '#description' => t('Please enter your Key ID.'),\n '#required' => TRUE,\n '#size' => 20,\n '#maxlength' => 15,\n '#weight' => 50,\n );\n\n $form['verify']['vCode'] = array(\n '#type' => 'textfield',\n '#title' => t('Verification Code'),\n '#description' => t('Please enter your Verification Code.'),\n '#required' => TRUE,\n '#size' => 80,\n '#maxlength' => 64,\n '#weight' => 60,\n );\n\n if (!variable_get('eve_api_enable', FALSE)) {\n drupal_set_message(t('Registrations temporarily disabled.'), 'error', FALSE);\n $form['buttons']['next']['#disabled'] = TRUE;\n }\n\n $form['#validate'][] = 'eve_api_enter_api_form_validate';\n\n return $form;\n}", "function daedalus_manage_outcomes_form($form) {\n\n // When loading the page after a failed submit, a user should\n // not have to reload all the textfields they filled in. This\n // checks the post data values and adds a boolean at index to\n // tell the autocomplete to hide the value or not.\n\n $show_prereq = array(); $show_covering = array();\n foreach ($form['post'] as $key => $value) {\n\n if (strpos($key, 'prereq') !== FALSE) {\n\n if (trim($value) != '') {\n $show_prereq[] = TRUE;\n }\n else {\n $show_prereq[] = FALSE;\n }\n\n }\n elseif (strpos($key, 'covering') !== FALSE) {\n\n if (trim($value) != '') {\n $show_covering[] = TRUE;\n }\n else {\n $show_covering[] = FALSE;\n }\n\n }\n\n }\n\n // Get all setting for the page.\n $result = db_query(\"SELECT setting, value\n FROM {dae_settings}\n WHERE setting='checkmark' OR\n setting='question mark' OR\n setting='question mark2' OR\n setting='exclamation mark' OR\n setting='title each autocomplete textfield' OR\n setting='autocomplete iteration' OR\n setting='manage courses' OR\n setting='manage learning outcomes' OR\n setting='learning outcome rank iteration' OR\n setting='tag cloud max font size' OR\n setting='tag cloud height percent' OR\n setting='show tag cloud settings' OR\n setting='tag seperate character' OR\n setting='manage term reviews'\");\n\n $page_settings = array();\n while ($row = db_fetch_array($result)) {\n $page_settings[$row['setting']] = $row['value'];\n }\n\n // Get the outcome information once, so there\n // is no need for multiple database accesses\n // throughout the script.\n $page_outcomes = array();\n $result = db_query(\"SELECT * FROM {dae_slo}\");\n while ($row = db_fetch_array($result)) {\n $page_outcomes[$row['id']]['slo_text'] = $row['slo_text'];\n $page_outcomes[$row['id']]['slo_rank'] = $row['slo_rank'];\n }\n\n global $base_url;\n\n // Get the images\n $check_src = $base_url . '/' . $page_settings['checkmark'];\n $question2_src = $base_url . '/' . $page_settings['question mark2'];\n $exclamation_src = $base_url . '/' . $page_settings['exclamation mark'];\n $show_help = '<img class=\"show-help\" src=\"' . $base_url . '/' . $page_settings['question mark'] . '\" alt=\"?\" />';\n\n // URL Information\n $page_url = $help_url = $page_settings['manage learning outcomes'];\n $course_url = $base_url . '/' . $page_settings['manage courses'];\n\n // URL Parameters\n $page_url_length = sizeof(explode('/', $page_url));\n $page_url = $base_url . '/' . $page_url;\n\n $param = array();\n $param[0] = arg(0+$page_url_length);\n $param[1] = arg(1+$page_url_length);\n $param[2] = arg(2+$page_url_length);\n $param[3] = arg(3+$page_url_length);\n\n // Name some of the parameters\n // to help with code clarity..\n $selected_slo_id = $param[0];\n $tags = $param[1];\n $sort_type = $param[2];\n\n drupal_set_title(t('Manage Learning Outcomes !help', array('!help' => $show_help)));\n\n // Get access information\n $build_access = user_access('daedalus build');\n\n $form = array();\n\n // Add the hidden help form. Paramaters are\n // (help url, show border, show break).\n $form = daedalus_help_form($help_url, 1, 1);\n\n // Only execute code if magellan database tables are installed.\n // This will popup a session timeout warning if the user is a\n // Magellan advisor and they are in session\n if (module_exists('magellan')) {\n\n // Determine the user id\n global $user;\n $user_id = $user->uid;\n\n // If the current user is a Magellan Advisor determine\n // if there is a current advising session open.\n if (magellan_advisor($user_id)) {\n\n $result = db_query(\"SELECT id, add_time FROM {mag_advisor_session} WHERE advisor_id=%d\", $user_id);\n while ($row = db_fetch_array($result)) {\n $session_id = $row['id'];\n $add_time = $row['add_time'];\n }\n\n // Get the session name.\n $current_session = $_COOKIE[session_name()];\n\n // If in session, set the user name as\n // to the selected students username.\n if ($session_id == $current_session) {\n\n // Get the current session time\n $session_time = db_result(db_query(\"SELECT session_time\n FROM {mag_session_log}\n WHERE advisor_id=%d\n AND session_id='%s'\", $user_id, $session_id ));\n\n // Add the session timeout warning.\n $form[] = daedalus_session_timeout_warning($session_time, $add_time, 'browse_learning_outcomes', 'advisor');\n\n }\n\n }\n\n // If the current user is a Magellan Support determine\n // if there is a current support session open.\n if (magellan_support($user_id)) {\n\n $result = db_query(\"SELECT id, add_time FROM {mag_support_session} WHERE support_id=%d\", $user_id);\n while ($row = db_fetch_array($result)) {\n $session_id = $row['id'];\n $add_time = $row['add_time'];\n }\n\n // Get the session name.\n $current_session = $_COOKIE[session_name()];\n\n // If in session, set the user name as\n // to the selected students username.\n if ($session_id == $current_session) {\n\n // Get the current session time\n $session_time = db_result(db_query(\"SELECT session_time FROM {mag_session_log} WHERE support_id=%d AND session_id='%s'\", $user_id, $session_id ));\n\n // Add the session timeout warning.\n $form[] = daedalus_session_timeout_warning($session_time, $add_time, 'browse_learning_outcomes', 'support');\n\n }\n\n }\n\n }\n\n // If the url says to delete something, see what to delete,\n // inform user, and delete appropriate relationship\n if ($param[1] == 'delete') {\n\n if (is_numeric($param[3]) || $param[2] == 'this') {\n\n switch ($param[2]) {\n\n case 'covering':\n\n db_query(\"DELETE FROM {dae_course_slo} WHERE course_id=%d and slo_id=%d\", $param[3], $selected_slo_id);\n\n break;\n\n case 'prereq':\n\n db_query(\"DELETE FROM {dae_prereq_slo} WHERE target=%d and pre_slo=%d\", $selected_slo_id, $param[3]);\n\n // Calculate new slo rank after removal\n daedalus_calculate_slo_rank();\n\n break;\n\n case 'tag':\n\n db_query(\"DELETE FROM {dae_slo_tag} WHERE slo_id=%d and tag_id=%d\", $selected_slo_id, $param[3]);\n\n break;\n\n case 'this':\n\n // Must give a confirmation before deleting a learning outcome\n drupal_set_title(t('Delete Confirmation !help', array('!help' => $show_help)));\n\n $this_message = '<br />' . t('Are you sure you want to delete the learning outcome');\n $this_message .= ' <strong><u>' . $page_outcomes[$selected_slo_id]['slo_text'] . '</u></strong>? ' . t('This can not be undone.');\n $this_message .= '<br /><br /><ul>';\n $this_message .= '<li>' . t('This will delete all references to prerequisite learning outcomes.') . '</li>';\n $this_message .= '<li>' . t('This will delete all references to any associated courses..') . '</li>';\n $this_message .= '</ul><br />' . t('Are you sure you want to continue?');\n\n $form[] = array(\n '#value' => $this_message,\n '#type' => 'item',\n );\n\n $form['delete-forward'] = array(\n '#type' => 'submit',\n '#value' => t('I understand the consequences. Delete this learning outcome forever.'),\n );\n\n $form['delete-reverse'] = array(\n '#type' => 'submit',\n '#value' => t('On second thought, I better not. Take me back'),\n );\n\n break;\n\n }\n\n }\n else {\n drupal_set_message(t('An error has occurred. Please contact a system administrator'), 'error');\n }\n\n }\n\n elseif ($param[0] == 'rank') {\n\n /**\n * Dr. Blouin's Sudo Code\n *\n * Sorting Slo (cron job)\n *\n * 1. Reset all ranks to -1 (or NULL)\n * x <- SELECT ALL SLOs of rank 0\n * r <- 0\n * while x != 0\n * x <- All SLOs which rank == NULL ^ has 1+ prerequisites of rank r\n * Assign rank r+1 to all SLOs E(subset) x\n * r <- r+1\n *\n * Quick & Dirty rank assignment of SLOs (real time)\n * Caution: A SLO x is updated/created with 1+ prerequisite\n * r <- min(union of ranks of all prerequiste of x)\n * Assign x the rank of 1\n *\n * [optimally recursivly apply Q+D reranking to all post-requisite of x and get rid of the cron job.]\n *\n * Q. Can php make system calls or spawn new processes?\n *\n */\n\n drupal_set_title(t('Rank Calculation !help', array('!help' => $show_help)));\n\n $rank_depth = $page_settings['learning outcome rank iteration'];\n\n $form[] = array(\n '#type' => 'item',\n '#title' => t('If marked as valid the learning outcome (preslo) has an assigned prerequisite student learing outcome'),\n '#description' => t('Valid learning outcomes are given the rank of the iteration + 1'),\n );\n\n $form['new-depth'] = array(\n '#title' => t('Set new rank iteration depth'),\n '#type' => 'select',\n '#options' => array(\n '5' => t('5'),\n '6' => t('6'),\n '7' => t('7'),\n '8' => t('8'),\n '9' => t('9'),\n '10' => t('10'),\n '11' => t('11'),\n '12' => t('12'),\n '13' => t('13'),\n '14' => t('14'),\n '15' => t('15'),\n '16' => t('16'),\n '17' => t('17'),\n '18' => t('18'),\n '19' => t('19'),\n '20' => t('20'),\n '21' => t('21'),\n '22' => t('22'),\n '23' => t('23'),\n '24' => t('24'),\n '25' => t('25'),\n ),\n '#default_value' => $rank_depth,\n );\n\n $form['submit-depth'] = array(\n '#type' => 'submit',\n '#value' => t('Submit rank depth'),\n );\n\n $preslo_ids = array();\n\n // Select all SLO's with a prerequisite SLO\n $result = db_query(\"SELECT DISTINCT target FROM {dae_prereq_slo} ORDER BY target\");\n while ($row = db_fetch_array($result)) {\n $preslo_ids[] = $row['target'];\n }\n\n if ($preslo_ids) {\n\n // Set all SLO ranks to -1\n db_query(\"UPDATE {dae_slo} SET slo_rank=-1\");\n\n // Select all SLO's\n $result = db_query(\"SELECT DISTINCT id FROM {dae_slo} ORDER BY id\");\n while ($row = db_fetch_array($result)) {\n $slo_ids[] = $row['id'];\n }\n\n // Create an array of SLO's that have no prerequisite SLO's\n // and make the query to set each slo to a rank of zero.\n $rank_zero = array_diff($slo_ids, $preslo_ids);\n\n // Create the placeholders for each id that will be updated.\n $query_placeholders = implode(' OR ', array_fill(0, count($rank_zero), 'id=%d'));\n\n db_query(\"UPDATE {dae_slo} SET slo_rank=0 WHERE \" . $query_placeholders, $rank_zero);\n\n // I think this is a slight variation to Christians sudo code. Here the list of all SLO's\n // that have a prerequisite SLO are iterated checking to see if the have a prerequisite SLO\n // at the current iteration depth. If a prereq SLO is found the current SLO is given a rank\n // of the iteration plus 1.\n for ($i=0; $i <= $rank_depth; $i++) {\n\n $title = 'Iteration - ' . $i;\n\n $values = '';\n\n foreach ($preslo_ids as $id) {\n\n $values .= '<li>ID: ' . $id . ' Preslos: ';\n\n $result = db_query(\"SELECT * FROM {dae_prereq_slo} WHERE target=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n $values .= $row['pre_slo'] . ', ';\n\n if (db_result(db_query(\"SELECT COUNT(*) FROM {dae_slo} WHERE slo_rank=%d AND id=%d\", $i, $row['pre_slo']))) {\n\n $values .= ' <-- VALID</li>';\n\n $valid = TRUE;\n\n db_query(\"UPDATE {dae_slo} SET slo_rank=%d WHERE id=%d\", ($i+1), $id);\n\n break;\n\n }\n\n }\n\n if (!$valid) {\n $values .= '</li>';\n }\n else {\n $valid = FALSE;\n }\n\n }\n\n $form[] = array(\n '#title' => check_plain($title),\n '#type' => 'item',\n '#value' => '<ul>' . $values . '</ul>',\n );\n\n }\n\n }\n else {\n\n // Set all SLO ranks to 0\n db_query(\"UPDATE {dae_slo} SET slo_rank=0\");\n\n }\n\n }\n\n elseif ($param[0] == 'tag' || $param[0] == 'split' || $param[0] == 'merge' || $param[0] == 'delete' || $param[0] == 'remove') {\n\n switch ($param[0]) {\n\n // Tag the outcomes selected\n // from the tag cloud.\n case 'tag':\n\n // Include the pages JavaScript file.\n drupal_add_js(drupal_get_path('module', 'daedalus') . '/javascript/daedalus_manage_outcome_tags.js');\n\n drupal_set_title(t('Tag Learning Outcomes !help', array('!help' => $show_help)));\n\n $slos_to_tag = explode('_', $param[1]);\n\n natcasesort($slos_to_tag);\n\n foreach ($slos_to_tag as $v) {\n $selected .= '<li>' . $page_outcomes[$v]['slo_text'] . '</li>';\n }\n\n $form[] = array(\n '#type' => 'item',\n '#title' => t('Selected Learning Outcomes'),\n '#value' => '<ul>' . $selected . '</ul>',\n );\n\n $form['tags-to-add'] = array(\n '#type' => 'textfield',\n '#title' => t('Add Tags'),\n '#autocomplete_path' => 'autocomp/tag',\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n );\n\n $form['tags-add-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n break;\n\n // Split the outcomes selected\n // from the tag cloud.\n case 'split':\n\n drupal_set_title(t('Splitting learning outcome !help', array('!help' => $show_help)));\n\n // Both of these are required. But the required field isn't being used,\n // because it's not nescessary for them to have values if the user is\n // switching the operation they're doing.\n $form['split-a'] = array(\n '#type' => 'textfield',\n '#title' => t('New Learning Outcome #1'),\n '#required' => TRUE,\n );\n $form['split-b'] = array(\n '#type' => 'textfield',\n '#title' => t('New Learning Outcome #2'),\n '#required' => TRUE,\n '#description' => t('You may create two new learning outcomes or select the original learning outcome and one created outcome.'),\n );\n $form['button-split-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n break;\n\n // Merge the outcomes selected\n // from the tag cloud.\n case 'merge':\n\n drupal_set_title(t('Merging 2 learning outcomes !help', array('!help' => $show_help)));\n\n $merging_tags = explode('_', $param[1]);\n\n if (count($merging_tags) == 2) {\n\n $merge_message = t('Merging the following learning outcomes:') . '<ul>';\n $merge_message .= '<li>' . $page_outcomes[$merging_tags[0]]['slo_text'] . '</li>';\n $merge_message .= '<li>' . $page_outcomes[$merging_tags[1]]['slo_text'] . '</li></ul>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $merge_message,\n );\n\n $form['new-merged'] = array(\n '#title' => t('Enter new learning outcome'),\n '#type' => 'textfield',\n '#autocomplete_path' => 'autocomp/slo',\n '#required' => TRUE,\n '#description' => t('You may enter an entirly new learning outcome or select one of the two being merged.'),\n );\n\n $form['button-merge-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n }\n else{\n drupal_set_message(t('An error occured, please contact a system administrator.'), 'error');\n }\n\n break;\n\n // Delete selected outcomes\n // from the tag cloud.\n case 'delete':\n\n drupal_set_title(t('Delete Learning Outcomes !help', array('!help' => $show_help)));\n\n $deleting = array();\n\n $slo_ids = explode('_', $param[1]);\n\n foreach ($slo_ids as $id) {\n $deleting[] = $page_outcomes[$id]['slo_text'];\n }\n\n if ($deleting) {\n\n natcasesort($deleting);\n\n $delete_message = t('Are you sure you want to delete the following learning outcomes?') . '<ul>';\n\n foreach ($deleting as $slo_text) {\n $delete_message .= '<li>' . $slo_text . '</li>';\n }\n\n $delete_message .= '</ul><strong><b><u>' . t('This can not be undone.') . '</u></b></strong>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $delete_message,\n );\n\n $form['button-delete-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n }\n\n break;\n\n // Remove multiple tags from SLOs\n // selected from the tag cloud.\n case 'remove':\n\n drupal_set_title(t('Remove Multiple Tags !help', array('!help' => $show_help)));\n\n $slo_ids = explode('_', $param[1]);\n $tag_ids = explode('_', $param[2]);\n\n if (count($tag_ids) > 1) {\n $tag_plural = \"'s\";\n }\n\n if (count($slo_ids) > 1) {\n $slo_plural = \"'s\";\n }\n\n foreach ($tag_ids as $id) {\n $tag_list .= '\"' . db_result(db_query(\"SELECT tag_label FROM {dae_tag} WHERE id=%d\", $id)) . '\" ';\n }\n\n $remove_message = t('Are you sure you want to remove the selected tag!plural ',\n array('!plural' => $tag_plural));\n\n $remove_message .= '<b>' . $tag_list . '</b>' . t(' from the following learning outcome!plural?.',\n array('!plural' => $slo_plural)) . '<ul>';\n\n foreach ($slo_ids as $sid) {\n $remove_message .= '<li>' . $page_outcomes[$sid]['slo_text'] . '</li>';\n }\n\n $remove_message .= '</ul><strong><b><u>' . t('This can not be undone.') . '</u></b></strong>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $remove_message,\n );\n\n $form['button-remove-multiple-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Multiple Tags'),\n );\n\n break;\n\n }\n\n // Add cancel button using the\n // URL parameter as the lablel.\n if (!is_numeric($param[0]) && $param[0] != 'selected') {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<small><a href=\"' . $page_url . '\">' . t('cancel !p0', array('!p0' => $param[0])) . '</a></small><br/><br/><hr><br/>',\n );\n\n }\n\n }\n\n elseif ($param[0] == 'courses') {\n\n // Display autocomplete course box to submit for slo display\n if (!$param[1]) {\n\n // Based on the settings make a textfield\n $form['course-slos'] = array(\n '#type' => 'textfield',\n '#title' => t('View learning outcomes by selecting a course'),\n '#autocomplete_path' => 'autocomp/course',\n );\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('Submit course'),\n );\n\n $form['view-by-tags'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n );\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />',\n );\n\n }\n else {\n\n ///////////////////////////////////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////////////////////////////////\n // View By Course /////////////////////////////////////////////////////////////////\n $selected_course_info = db_fetch_array(db_query(\"SELECT id, course_name FROM {dae_course} WHERE course='%s'\", $param[1]));\n $selected_course_name = $selected_course_info['course_name'];\n $selected_course_id = $selected_course_info['id'];\n\n $form['view-by-tags'] = array(\n '#type' => 'submit',\n '#value' => t('View by tags'),\n );\n\n $form['course-display'] = array(\n '#type' => 'item',\n '#title' => t('Selected course'),\n '#value' => $param[1] . ' - ' . $selected_course_name,\n );\n\n $selected_slos = array();\n\n $result = db_query(\"SELECT slo_id FROM {dae_course_slo} WHERE course_id=%d\", $selected_course_id);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['slo_id']] = $page_outcomes[$row['slo_id']]['slo_text'];\n }\n\n if ($selected_slos) {\n\n asort($selected_slos);\n\n $form['checkboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $selected_slos,\n );\n\n $form['button-merge-top'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n $form['button-delete-top'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n $form['button-split-top'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n $form['button-tag-top'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n }\n else {\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('View by course'),\n '#weight' => -10,\n );\n\n $form['tags'] = array(\n '#value' => '<ul><li><i>' . t('No matches found') . '</i></li></ul>',\n '#type' => 'item',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////\n ////// /////////////////////////////////////////\n ////// TAG CLOUD /////////////////////////////////////////\n////// /////////////////////////////////////////\n ///// If the passed learning outcome isn't an id, then change it.\n //// Here the tag cloud is created and the selected tag string.\n elseif (!is_numeric($param[0]) && $build_access) {\n\n $i = 0; $cloud_string = '';\n\n // If a tag is not selected display the entire tag cloud\n if ($param[0] != 'selected') {\n\n $tag_array = array();\n $min = -1; $max = -1;\n\n // Create the tag array\n $result = db_query(\"SELECT * FROM {dae_tag} ORDER BY tag_label\");\n while ($row = db_fetch_array($result)) {\n\n $tag_count = db_result(db_query(\"SELECT COUNT(*) FROM {dae_slo_tag} WHERE tag_id=%d\", $row['id']));\n\n $tag_array[$i]['tag_id'] = $row['id'];\n $tag_array[$i]['label'] = $row['tag_label'];\n $tag_array[$i]['count'] = $tag_count;\n $i++;\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if ($min == -1) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min && $tag_count != 0) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n // Log scale formula found online\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n // Show the number of times the SLO has been tagged.\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n if ($value['count'] == 0) {\n $cloud_string .= '<a style=\"color: #8B0000\"><b>#' . $value['label'] . '</b></a>' . $par_count . ' &nbsp;';\n }\n else {\n\n if ($param[0] == 'alpha') {\n\n $cloud_url = $page_url . '/selected/' . $value['tag_id'] . '/' . $param[0];\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n else {\n\n $cloud_url = $page_url . '/selected/' . $value['tag_id'];\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n\n }\n else {\n\n // Else a tag has been selected so narrow the tags in the\n // cloud tag accoring to the select tag. tag tag tag.\n\n $label_index = array();\n\n // Make a list of ids and their tag labels to reduce\n // the amount of database access required for the script.\n $result = db_query(\"SELECT * FROM {dae_tag} ORDER BY tag_label\");\n while ($row = db_fetch_array($result)) {\n $label_index[$row['id']] = $row['tag_label'];\n }\n\n // If the tags are not delimited by an underscore\n // select the results with only the singel tag.\n if (!strrpos($tags, '_')) {\n\n // Deselect all tags\n $selected_tags = '<a href=\"' . $page_url . '/' . $sort_type . '\">#' . $label_index[$tags] . '</a>';\n\n // Get all the slo id's.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d ORDER BY slo_id\", $tags);\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n $result_tag = array();\n\n // Create the query string placeholder to select the slos.\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n if ($row['tag_id'] != $tags) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $ordered_tags = array();\n\n // Create the query string placeholder to select the tags again in alphabetical order.\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array();\n//@todo Figure out some fancy sql to merge these queries to get the tag count\n // Calculate the total number of\n // SLO's associated the first tag.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n//$bill_count = 0;\n//$result = db_query(\"select distinct slo_id from {dae_slo_tag} where tag_id=%d and slo_id in (SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d)\", $tags, $current_tag);\n//while ($row = db_fetch_array($result)) {\n// $bill_count++;\n//}\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n//echo \"Current_Tag = $current_tag Tags = $tags TagCOUNT $tag_count BillCOUNT $bill_count<br />\";\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n if ($value['count'] == 0) {\n $cloud_string .= '<a style=\"color: #8B0000\"><b>#' . $value['label'] . '</b></a>' . $par_count . ' &nbsp;';\n }\n else {\n\n $cloud_url = $page_url . '/selected/' . $tags . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n\n }\n else {\n\n // Now the url parameter has more than one tag\n // selected. Turn the tags into an array of tags.\n $tags = explode('_', $tags);\n\n // Create the selected tag string with a twist. When two tags or more\n // have been selected, the selected tags string now has the option of\n // deselecting one of the tags or all of them.\n if (count($tags) == 2) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d OR tag_id=%d ORDER BY slo_id\", $tags[0], $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n // Remove duplicate values.\n $slo_array = array_unique($slo_array);\n\n // Create the query string placeholder to select the slos.\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n // Create the query string placeholder to select the tags again in alphabetical order.\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n // Show the number of times the SLO has been tagged.\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 3) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id\n FROM {dae_slo_tag}\n WHERE tag_id=%d OR tag_id=%d OR tag_id=%d\n ORDER BY slo_id\", $tags[0], $tags[1], $tags[2]);\n\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n $slo_array = array_unique($slo_array);\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array(); $slo_array4 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 3.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_intersect($slo_array4, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 4) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Remove 4th tag.\n $url4 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url4 . '\">#' . $label_index[$tags[3]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id\n FROM {dae_slo_tag}\n WHERE tag_id=%d OR tag_id=%d OR tag_id=%d OR tag_id=%d\n ORDER BY slo_id\", $tags[0], $tags[1], $tags[2], $tags[3]);\n\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n\n }\n\n $slo_array = array_unique($slo_array);\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array();\n $slo_array4 = array(); $slo_array5 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 3.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 4.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with Tag 1. the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array5[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_intersect($slo_array4, $temp_slos);\n $temp_slos = array_intersect($slo_array5, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // If there are any tag cloud values at this point just make\n // the tag size 15 and call it a !&^#%@ #&&)(#* day!\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= '&nbsp;' . $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '<b/></a>' . $big_end . ' <small>(' . $value['count'] . ')</small>&nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 5) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Remove 4th tag.\n $url4 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url4 . '\">#' . $label_index[$tags[3]] . '</a>';\n\n // Remove 5th tag.\n $url5 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url5 . '\">#' . $label_index[$tags[4]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">deselect all</a></b>';\n\n }\n\n }\n\n }\n\n if ($cloud_string) {\n // Add the line height daedalus setting here since the value\n // (as far as I know) can not be retrieved within a css file.\n $cloud_display = '<div class=\"cloud\" style=\"line-height: ' . $page_settings['tag cloud height percent'] . '%;\">' . $cloud_string . '</div>';\n }\n else {\n $cloud_display = '<div class=\"cloud\"><div class=\"cloud-item\" style=\"font-size: 13px;\"><b>' . t('#No matches found') . '</b></div></div>';\n $hide_info = TRUE;\n }\n\n // Hide buttons if no SLOs\n if (!$hide_info) {\n\n // Display buttons according to the sort order\n if ($build_access) {\n\n if ($param[0] == 'alpha' || $param[2] == 'alpha') {\n $form['order-rank'] = array(\n '#type' => 'submit',\n '#value' => t('Order by rank')\n );\n }\n else {\n $form['order-alpha'] = array(\n '#type' => 'submit',\n '#value' => t('Order alphabetically')\n );\n }\n\n }\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('View by course'),\n );\n\n $form['calculate-rank'] = array(\n '#type' => 'submit',\n '#value' => t('Calculate rank'),\n );\n\n // Some debugging information for adjusting the appearance of\n // the tag cloud form of buttons. No setting, just change it\n // to true when you want to change the database values based\n // on visual cues instead of guessing the numbers.\n if ($page_settings['show tag cloud settings']) {\n\n $form['increase-percent'] = array(\n '#type' => 'submit',\n '#value' => t('Increase spacing'),\n );\n $form['decrease-percent'] = array(\n '#type' => 'submit',\n '#value' => t('Decrease spacing'),\n\n );\n $form['increase-max'] = array(\n '#type' => 'submit',\n '#value' => t('Increase font'),\n );\n $form['decrease-max'] = array(\n '#type' => 'submit',\n '#value' => t('Decrease font'),\n );\n }\n\n }\n\n $form['tags'] = array(\n '#title' => t('Tags to narrow search ') . '<small>(<i>' . t('red tags are not linked to a student learning outcome') . '</i>)</small>',\n '#value' => $cloud_display,\n '#type' => 'item',\n );\n\n if ($param[0] == 'selected') {\n $form['selected'] = array(\n '#title' => t('Selected tags'),\n '#value' => $selected_tags,\n '#type' => 'item',\n );\n\n }\n\n if ($tags) {\n\n if (is_array($tags)) {\n\n // Combine the arrays according to the amount of tags selected\n if (count($tags) == 2) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n\n }\n\n elseif (count($tags) == 3) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n\n }\n\n elseif (count($tags) == 4) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 4th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n $slo_array = array_intersect($slo_array4, $slo_array);\n\n }\n\n elseif (count($tags) == 5) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 4th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 5th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[4]);\n while ($row = db_fetch_array($result)) {\n $slo_array5[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n $slo_array = array_intersect($slo_array4, $slo_array);\n $slo_array = array_intersect($slo_array5, $slo_array);\n\n }\n\n // Get the SLO's from the selected array\n if ($sort_type == 'alpha') {\n\n foreach ($slo_array as $sid) {\n $selected_slos[$sid] = $page_outcomes[$sid]['slo_text'];\n }\n\n asort($selected_slos);\n\n }\n else {\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'id=%d'));\n\n $result = db_query(\"SELECT * FROM {dae_slo} WHERE \" . $slo_placeholders . \" ORDER BY slo_rank ASC, slo_text ASC\", $slo_array);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n else {\n\n // Use the $slo array created earlier\n if ($sort_type == 'alpha') {\n\n foreach ($slo_array as $sid) {\n $selected_slos[$sid] = $page_outcomes[$sid]['slo_text'];\n }\n\n asort($selected_slos);\n\n }\n else {\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'id=%d'));\n\n $result = db_query(\"SELECT * FROM {dae_slo} WHERE \" . $slo_placeholders . \" ORDER BY slo_rank ASC, slo_text ASC\", $slo_array);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n\n }\n else {\n\n // Make a list of every slo as a checkbox\n if ($param[0] == 'alpha') {\n\n $result = db_query(\"SELECT id, slo_text FROM {dae_slo} ORDER BY slo_text\");\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'];\n }\n\n }\n else {\n\n $result = db_query(\"SELECT * FROM {dae_slo} ORDER BY slo_rank ASC, slo_text ASC\");\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n\n // When all the SLOs are selected it may be a long list. Here we can\n // display the function buttons at the top as well as the bottom.\n // Only show the top select buttons if there are no tags selected or\n // there are more than 10 learning outcomes displayed.\n if (!$hide_info) {\n\n if (!$tags || (count($selected_slos) >= 14)) {\n\n $form['button-merge-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n $form['button-delete-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n $form['button-split-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n $form['button-tag-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n // If a tag is selected the user may\n // now remove muliple tags from the\n // checked learning outcomes.\n if ($param[0] == 'selected') {\n\n $form['remove-multiple-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Multiple Tags'),\n );\n\n }\n\n }\n\n }\n\n $form['checkboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $selected_slos,\n );\n\n if ($selected_slos) {\n\n $form['button-merge-top'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n $form['button-delete-top'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n $form['button-split-top'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n $form['button-tag-top'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n if ($param[0] == 'selected') {\n\n $form['remove-multiple-top'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Muliple Tags'),\n );\n\n // Pass hidden tags to the submit function. Create\n // a list of tag ids delimited by an underscore.\n if (is_array($tags)) {\n $form['tag_list'] = array( '#type' => 'value', '#value' => implode('_', $tags) );\n }\n else {\n $form['tag_list'] = array( '#type' => 'value', '#value' => $tags );\n }\n\n }\n\n }\n\n }\n\n //////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////\n //// ////////////////////////////////\n //// MANAGE STUDENT LEARNING OUTCOMES ////////////////////////////////\n //// ////////////////////////////////\n ////\n /// Linked from Browse Learning Outcomes, when $slo_id is numeric then\n // everything above is bypassed and we come to this last section of code.\n elseif (is_numeric($param[0])) {\n\n // Include the pages JavaScript file.\n drupal_add_js(drupal_get_path('module', 'daedalus') . '/javascript/daedalus_manage_outcomes.js');\n\n $selected_slo_text = $page_outcomes[$selected_slo_id]['slo_text'];\n\n // Get the course information once, so there\n // is no need for multiple database accesses\n // throughout the script.\n $page_courses = array();\n $result = db_query(\"SELECT * FROM {dae_course}\");\n while ($row = db_fetch_array($result)) {\n $page_courses[$row['id']]['course_code'] = $row['course_code'];\n $page_courses[$row['id']]['course_number'] = $row['course_number'];\n $page_courses[$row['id']]['course_name'] = $row['course_name'];\n $page_courses[$row['id']]['course'] = $row['course'];\n $page_courses[$row['id']]['mapped'] = $row['mapped'];\n $page_courses[$row['id']]['viewable'] = $row['viewable'];\n }\n\n // Get the access arguments\n $build_outcomes_access = user_access('daedalus build learning outcomes');\n $delete_slo_access = user_access('daedalus delete slo');\n $manage_access = user_access('daedalus manage');\n\n // Set the title\n drupal_set_title(t('@slo !help', array('@slo' => html_entity_decode($selected_slo_text), '!help' => $show_help)));\n\n // Set form weights\n $weight['core'] = -10;\n $weight['suggest'] = 0;\n $weight['prereq'] = 10;\n $weight['postreq'] = 20;\n $weight['covering'] = 30;\n $weight['tags'] = 40;\n $weight['taughtrev'] = 50;\n $weight['prereqrev'] = 60;\n $weight['covercomm'] = 70;\n\n ////////////////////////////////////////////////////////////////////////////\n // Core Settings\n ////////////////////////////////////////////////////////////////////////////\n\n if ($build_outcomes_access) {\n\n $form['tags']['new_tags'] = array(\n '#type' => 'textfield',\n '#title' => t('Enter new tags'),\n '#autocomplete_path' => 'autocomp/tag',\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n );\n\n $form['core'] = array(\n '#type' => 'fieldset',\n '#title' => t('Core Settings'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#required' => TRUE,\n '#weight' => $weight['core'],\n );\n\n $form['core']['slo_text'] = array(\n '#title' => t('Learning Outcome Text'),\n '#type' => 'textarea',\n '#required' => TRUE,\n '#default_value' => html_entity_decode($selected_slo_text),\n '#rows' => 2,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Prerequisite Learning Outcomes\n ////////////////////////////////////////////////////////////////////////////\n\n $prereq_slos = $preslo_ids = array();\n\n $result = db_query(\"SELECT pre_slo FROM {dae_prereq_slo} WHERE target = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n\n $prereq_slos[$row['pre_slo']] = $page_outcomes[$row['pre_slo']]['slo_text'];\n\n // An array to compare against the suggested slos.\n $preslo_ids[] = $row['pre_slo'];\n\n }\n\n natsort($prereq_slos);\n $prereqs_display = '';\n\n foreach ($prereq_slos as $id => $text) {\n\n $prereqs_display .= '<li>';\n $course_display = ''; // Reset the course display\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] '; // Leave the space at the end.\n\n }\n\n // Display the rank for users that have\n // build access, admin and builder type.\n if ($build_access) {\n $prereqs_display .= '<a href=\"' . $page_url . '/' . $id .'\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small> ';\n }\n else {\n $prereqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small> ';\n }\n\n // Link to delete relationship\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you want to remove the prerequisite learning outcome \\'' . $text . '\\'?';\n\n $slo_url = $page_url . '/' . $param[0] . '/delete/prereq/' . $id;\n\n $prereqs_display .= '<a href=\"' . $slo_url . '\" class=\"removable\" message=\"' . $message . '\"><strong>delete</strong></a>';\n\n }\n\n $prereqs_display .= '</li>';\n\n }\n\n // Notify if no matches were found.\n if (!$prereqs_display) {\n $prereqs_display = '<li><i>' . t('No matches found') . '</i></li>';\n $prereqs_flag = TRUE;\n }\n\n if (!$prereqs_flag || $manage_access) {\n\n $form['prereq'] = array(\n '#type' => 'fieldset',\n '#title' => t('Prerequiste Learning Outcomes'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#description' => '&nbsp;&nbsp;&nbsp; ' . t('What the student is assumed to know before learning this outcome.'),\n '#weight' => $weight['prereq'],\n );\n\n $form['prereq'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $prereqs_display . '</ul>',\n '#weight' => $weight['prereq']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Postrequisite Learning Outcomes (Why do I need to know that?)\n ////////////////////////////////////////////////////////////////////////////\n\n $postreq_slos = array();\n\n $result = db_query(\"SELECT target FROM {dae_prereq_slo} WHERE pre_slo = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $postreq_slos[$row['target']] = $page_outcomes[$row['target']]['slo_text'];\n }\n\n natsort($postreq_slos);\n $postreqs_display = '';\n\n foreach ($postreq_slos as $id => $text) {\n\n $postreqs_display .= '<li>';\n $course_display = ''; // Reset the course display\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] ';\n\n }\n\n if ($build_access) {\n $postreqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small></li>';\n }\n else {\n $postreqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small></li>';\n }\n\n }\n\n // Notify if no matches were found.\n if (!$postreqs_display) {\n $postreqs_display = '<li><i>' . t('No matches found') . '</i></li>';\n $postreqs_flag = TRUE;\n }\n\n // Only display the postrequisite SLOs\n // if there are some to display.\n if (!$postreqs_flag) {\n\n $form['postreq'] = array(\n '#type' => 'fieldset',\n '#title' => t('Why do I need to know that?'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#description' => '&nbsp;&nbsp;&nbsp; ' . t('These are the student\n learning outcome(s) that directly require this student learning outcome.'),\n '#weight' => $weight['postreq'],\n );\n\n $form['postreq'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $postreqs_display . '</ul>',\n '#weight' => $weight['postreq']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Courses Covering This Learning Outcome\n ////////////////////////////////////////////////////////////////////////////\n\n $courses_covering = array(); $prereq_courses = array();\n\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $courses_covering[$row['course_id']] = $page_courses[$row['course_id']]['course'];\n }\n\n natsort($courses_covering);\n $covering_display = '';\n\n // List of courses covering\n foreach ($courses_covering as $id => $text) {\n\n $covering_display .= '<li>';\n\n // Seperate the string to get the course\n // code[0] and number[1] for the URL.\n $course_info = explode(' ', $text);\n\n // Make the url for editing the course\n $course_edit_url = $base_url . '/' . $page_settings['manage courses'] . '/' . $course_info[0] . '/' . $course_info[1];\n\n $covering_display .= '<a href=\"' . $course_edit_url . '\">' . $text . '</a>';\n\n // If user has permission to delete links, the link to delete the relationship should be visible\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you no longer want \\'' . $text . '\\' to cover this learning outcome?';\n\n $url = $page_url . '/' . $param[0] . '/delete/covering/' . $id;\n\n $covering_display .= ' - <a href=\"' . $url . '\" class=\"removable\" message=\"' . $message . '\"><strong>delete</strong></a>';\n\n }\n\n $covering_display .= '</li>';\n\n // Retrieve the the prereq course information to determine\n // the suggested learning outcome later in the script.\n $result = db_query(\"SELECT prereq_id FROM {dae_prereq_course} WHERE course_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n $prereq_courses[$row['prereq_id']] = $row['prereq_id'];\n }\n\n }\n\n // Notify that no matches were found.\n if (!$covering_display) {\n $covering_display = '<li><i>' . t('No matches found') . '</i></li>';\n $covering_flag = 1;\n }\n\n if (!$covering_flag || $manage_access) {\n\n $form['covering'] = array(\n '#type' => 'fieldset',\n '#title' => t('Courses Covering This Learning Outcome'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => $weight['covering'],\n );\n\n $form['covering'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $covering_display . '</ul>',\n '#weight' => $weight['covering']-1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Courses Covering && Prerequisite Learning Outcome Textfields\n ////////////////////////////////////////////////////////////////////////////\n\n if ($build_outcomes_access) {\n\n for ($i = 0; $i < $page_settings['autocomplete iteration']; $i++) {\n\n // The settings for the first will be\n // different for all the remaining.\n if ($i == 0) {\n\n // Not hidden\n $ishid_prereq = $ishid_covering = 'no';\n\n // Singular opening titles\n $prereq_title = t('Prerequisite learning outcome');\n $covering_title = t('Course covering learning outcome');\n\n $prereq_description = '[<a class=\"show-preslo-help\">' . t('info') . '</a>]';\n\n }\n else {\n\n // See if the textfield is hidden\n if ($show_prereq[$i] == TRUE) {\n $ishid_prereq = 'no';\n }\n else {\n $ishid_prereq = 'yes';\n }\n\n if ($show_covering[$i] == TRUE) {\n $ishid_covering = 'no';\n }\n else {\n $ishid_covering = 'yes';\n }\n\n // Hidden field titles with iteration number.\n // If each text field is to be be titled or not.\n if ($page_settings['title each autocomplete textfield']) {\n $prereq_title = '<small>' . t('Prerequisite learning outcome') . ' (' . ($i+1) . ')</small>';\n $covering_title = '<small>' . t('Course covering learning outcome') . ' (' . ($i+1) . ')</small>';\n }\n else {\n $prereq_title = $covering_title = '';\n }\n\n $prereq_description = '';\n\n }\n\n $form['prereq'][\"prereq_$i\"] = array(\n '#type' => 'textfield',\n '#title' => $prereq_title,\n '#maxlength' => 255,\n '#size' => 115,\n '#description' => $prereq_description,\n '#prefix' => '<div class=\"hide-prereq-slo\" is_hidden=\"' . $ishid_prereq . '\"><blockquote>',\n '#suffix' => '</blockquote></div>',\n '#autocomplete_path' => 'autocomp/slo',\n '#weight' => $weight['prereq']+($i/1000),\n );\n\n $form['covering'][\"covering_$i\"] = array(\n '#type' => 'textfield',\n '#title' => $covering_title,\n '#autocomplete_path' => 'autocomp/course',\n '#prefix' => '<div class=\"hide-covering-course\" is_hidden=\"' . $ishid_covering . '\"><blockquote>',\n '#suffix' => '</blockquote></div>',\n '#weight' => $weight['covering'] + ($i/1000),\n );\n\n // Make the buttons that will unhide 1 hidden textfield\n // at the end of the textfields. (as per javascript)\n if ($i == ($page_settings['autocomplete iteration'] - 1)) {\n\n $form['prereq'][] = array(\n '#type' => 'item',\n '#value' => '<input type=\"submit\" class=\"add-prereq-slo add-another\" value=\"Add another\">',\n '#weight' => $weight['prereq'] + 1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $form['covering'][] = array(\n '#type' => 'item',\n '#value' => '<input type=\"submit\" class=\"add-covering-course add-another\" value=\"Add another\">',\n '#weight' => $weight['covering']+1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Tags\n ////////////////////////////////////////////////////////////////////////////\n\n $current_tags = array();\n\n //generate a list of current tags\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE slo_id = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $current_tags[$row['tag_id']] = db_result(db_query(\"SELECT tag_label FROM {dae_tag} WHERE id = %d\", $row['tag_id']));\n }\n\n natsort($current_tags);\n $tags_display = '';\n\n foreach ($current_tags as $tid => $label) {\n\n // Add the tag capitalized.\n $tags_display .= '<li>' . ucwords($label);\n\n // Give link to delete relationship\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you want to remove the tag \\'' . $label . '\\' from this learning outcome?';\n\n $url = $page_url . '/' . $param[0] . '/delete/tag/' . $tid;\n\n $tags_display .= ' - <a href=\"' . $url . '\" class=\"removable\" message=\"' . $message . '\"><strong>' . t('delete') . '</strong></a>';\n\n }\n\n $tags_display .= '</li>';\n\n }\n\n // Notify if no matches were found\n if (!$tags_display) {\n $tags_display = '<li><i>' . t('No matches found') . '</i></li>';\n $currtag_flag = TRUE;\n }\n\n if ($build_outcomes_access) {\n\n if (!$currtag_flag || $manage_access) {\n $form['tags'] = array(\n '#type' => 'fieldset',\n '#title' => t('Tags'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => $weight['tags'],\n );\n\n $form['tags'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $tags_display . '</ul>',\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n }\n\n $form['tags']['new_tags'] = array(\n '#type' => 'textfield',\n '#title' => t('Tags'),\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n '#weight' => $weight['tags'],\n '#cols' => 2,\n '#autocomplete_path' => 'autocomp/tag',\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote><br />',\n );\n }\n\n // At this point if all the flags are TRUE then a user will see nothing\n // when selecting a learning outcome. Create a message informing the\n // user that there are no prerequiste courses or SLOS\n if ($covering_flag && $prereqs_flag && $postreqs_flag && $currtag_flag && !$manage_access) {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<ul><li><i>' . t('This learning outcome has not been assigned any values.') . '</i></li></ul>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Suggested Prerequisite Learning Outcomes\n ////////////////////////////////////////////////////////////////////////////\n\n // Set the user access to\n // view suggested outcomes.\n if ($manage_access) {\n\n $suggested_slos = array(); $suggested_outcomes = array(); $suggest_array = array();\n//COMBINE INTO MYSQL JOIN....\n if ($prereq_courses) {\n\n foreach ($prereq_courses as $id) {\n\n $result = db_query(\"SELECT slo_id FROM {dae_course_slo} WHERE course_id=%d AND slo_id <> %d\", $id, $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $suggested_slos[$row['slo_id']] = $row['slo_id'];\n }\n\n }\n\n }\n\n if ($current_tags) {\n\n foreach ($current_tags as $tid => $label) {\n\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d AND slo_id <> %d\", $tid, $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $suggested_slos[$row['slo_id']] = $row['slo_id'];\n }\n\n }\n\n }\n\n if (count($suggested_slos)) {\n\n // Remove any duplicates that are already prereq SLOs.\n $suggested_slos = array_diff($suggested_slos, $preslo_ids);\n\n // Count the SLOs again as the all may have\n // been removed with the array_diff execution.\n if (count($suggested_slos)) {\n\n sort($suggested_slos);\n\n $suggested_slo_placeholders = implode(' OR ', array_fill(0, count($suggested_slos), 'id=%d'));\n\n // The formatting of this query is important, make\n // sure there is a space between the WHERE and ORDER.\n // If the space is removed it will run into the placeholder.\n $result = db_query(\"SELECT id, slo_text\n FROM {dae_slo}\n WHERE \" . $suggested_slo_placeholders .\n \" ORDER BY slo_rank ASC, slo_text ASC\", $suggested_slos);\n while ($row = db_fetch_array($result)) {\n $suggested_outcomes[$row['id']] = $row['slo_text'];\n }\n\n foreach ($suggested_outcomes as $id => $text) {\n\n // reset the course display\n $course_display = '';\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] ';\n\n }\n\n if ($build_access) {\n $suggest_array[$id] = '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small>';\n }\n else {\n $suggest_array[$id] = '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small>';\n }\n\n }\n\n $form['suggest'] = array(\n '#type' => 'fieldset',\n '#title' => t('Suggested Prerequiste Learning Outcomes'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['suggest'],\n );\n\n $form['suggest']['suggestboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $suggest_array,\n '#weight' => $weight['suggest']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $form['suggest']['submit-slo-suggestions'] = array(\n '#type' => 'submit',\n '#value' => t('Save suggestions'),\n '#weight' => $weight['suggest']-1,\n '#prefix' => '<br /><blockquote>',\n '#suffix' => '</blockquote><br /><br />',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Term Reviews Rating this Learning Outcome as Taught\n ////////////////////////////////////////////////////////////////////////////\n if (user_access('daedalus browse term reviews')) {\n\n // Table heading for the Term Review dropdowns.\n $table_header = '<table>\n <tr>\n <th><b>' . t('Ranking') . '</b></th>\n <th><b>' . t('Course') . '</b></th>\n <th><b>' . t('Instructor') . '</b></th>\n <th><b>' . t('Term') . '</b></th>\n <th><b>' . t('Academic Year') . '</b></th>\n </tr>';\n\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d AND type='taught'\", $selected_slo_id);\n\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n // This function sorts an array such that array indices maintain their correlation\n // with the array elements they are associated with. This is used mainly when\n // sorting associative arrays where the actual element order is significant.\n asort($review_info);\n\n if ($review_info) {\n\n $review_list = $table_header;\n\n $form['taughtrev'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Reviews Rating this Learning Outcome as Taught'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['taughtrev'],\n );\n\n // Foreach term Review ID\n foreach ($review_info as $rid => $year) {\n\n // Calculate the Average Coverage Rating for each Term Review.\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE term_review_form_id=%d\", $rid);\n $i = 0;\n $total = 0;\n\n while ($row = db_fetch_array($result)) {\n $total += $row['rating'];\n $i++;\n }\n\n if ($i == 0) {\n $rating = '<img src=\"' . $question2_src . '\" alt=\"?\" />';\n }\n elseif (round($total / $i) >= 1) {\n $rating = '<img src=\"' . $check_src . '\" alt=\"?\" />';\n }\n else {\n $rating = '<img src=\"' . $exclamation_src . '\" alt=\"!\" />';\n }\n\n // Display Extra Review Information\n $extra_info = db_fetch_array(db_query(\"SELECT course, instructor, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $course_id = $extra_info['course'];\n $instructor = $extra_info['instructor'];\n $term = $extra_info['term'];\n\n $course = $page_courses[$course_id]['course'] . ' - ' . $page_courses[$course_id]['course_name'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_course = '<a href=\"' . $url . '\">' . ucwords($course) . '</a>';\n\n $review_list .= \"<tr>\n <th>\" . $rating . \"</th>\n <th>\" . $disp_course . \"</th>\n <th>\" . $instructor . \"</th>\n <th>\" . $term . \"</th>\n <th>\" . $year . \"/\" . ($year+1) . \"</th>\n </tr>\";\n }\n\n $form['taughtrev'][] = array(\n '#type' => 'item',\n '#value' => $review_list . '</table>',\n '#weight' => $weight['taughtrev'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Term Reviews Rating this Learning Outcome as Prerequisite\n ////////////////////////////////////////////////////////////////////////////\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d AND type='prereq'\", $selected_slo_id);\n\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n asort($review_info );\n\n if ($review_info) {\n\n $review_list = $table_header;\n\n $form['prereqrev'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Reviews Rating this Learning Outcome as a Prerequisite'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['prereqrev'],\n );\n\n // Foreach term Review ID and Year\n foreach ($review_info as $rid => $year) {\n\n $i = $total = 0;\n\n // Calculate the Average Coverage Rating for each Term Review\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE term_review_form_id=%d\", $rid);\n while ($row = db_fetch_array($result)) {\n $total += $row['rating'];\n $i++;\n }\n\n if ($i == 0) {\n $rating = '<img src=\"' . $question2_src . '\" alt=\"?\" />';\n }\n elseif (round($total / $i) >= 1) {\n $rating = '<img src=\"' . $check_src . '\" alt=\"?\" />';\n }\n else {\n $rating = '<img src=\"' . $exclamation_src . '\" alt=\"!\" />';\n }\n\n // Display Extra Review Information\n $extra_info = db_fetch_array(db_query(\"SELECT course, instructor, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $course_id = $extra_info['course'];\n $instructor = $extra_info['instructor'];\n $term = $extra_info['term'];\n\n $course = $page_courses[$course_id]['course'] . ' - ' . $page_courses[$course_id]['course_name'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_course = '<a href=\"' . $url . '\">' . ucwords($course) . '</a>';\n\n $review_list .= \"<tr>\n <th>\" . $rating . \"</th>\n <th>\" . $disp_course . \"</th>\n <th>\" . $instructor . \"</th>\n <th>\" . $term . \"</th>\n <th>\" . $year . \"/\" . ($year+1) . \"</th>\n </tr>\";\n }\n\n $form['prereqrev'][] = array(\n '#type' => 'item',\n '#value' => $review_list . '</table>',\n '#weight' => $weight['prereqrev'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Average Coverage Rating and Comments\n ////////////////////////////////////////////////////////////////////////////\n\n $act_total = $max_total = 0;\n\n // Calculate the Average Coverage Rating for the Term Reviews\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE slo=%d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $act_total += $row['rating'];\n $max_total += 2;\n }\n\n if ($max_total > 0) {\n\n $avg_cover = round( ( ($act_total / $max_total) * 100 ), 2 ) . '%';\n\n $form['covercomm'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Coverage Rating and Comments'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['covercomm'],\n );\n\n $form['covercomm'][] = array(\n '#title' => t('Average Coverage Rating'),\n '#value' => t($avg_cover),\n '#type' => 'item',\n '#weight' => $weight['covercomm'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n asort($review_info);\n\n $review_comm = '<ul>';\n\n // Foreach term Review ID and Year\n foreach ($review_info as $rid => $year) {\n\n // Get SLO comments\n $comment = db_result(db_query(\"SELECT comment\n FROM {dae_term_review_ratings}\n WHERE term_review_form_id=%d\n AND slo=%d\", $rid, $selected_slo_id));\n\n if ($comment) {\n\n // Display Extra Review Information\n $review_row = db_fetch_array(db_query(\"SELECT course, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $review_course_id = $reveiw_row['course'];\n $term = $review_row['term'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_comment = '<a href=\"' . $url . '\">' . ucwords($comment) . '</a>';\n\n $review_comm .= '<li>' . $disp_comment . ' &nbsp;&nbsp;&nbsp;&nbsp;(' . $year . '/' . ($year+1) . ' ' . $term . ' ' . $page_courses[$review_course_id]['course'] . ')';\n\n }\n\n }\n\n if ($review_comm == '<ul>') {\n $review_comm .= '<li>' . t('No matches found') . '</li></ul>';\n }\n else {\n $review_comm .= '</ul>';\n }\n\n $form['covercomm'][] = array(\n '#type' => 'item',\n '#title' => t('Term Review Learning Outcome Comments'),\n '#value' => $review_comm,\n '#weight' => $weight['covercomm'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n }\n\n if ($build_outcomes_access) {\n\n $form['submit-slo-changes'] = array(\n '#type' => 'submit',\n '#value' => t('Update Learning Outcome'),\n '#weight' => max($weight)+50,\n );\n\n }\n\n if ($delete_slo_access) {\n\n $form['delete-slo'] = array(\n '#type' => 'submit',\n '#value' => t('Delete Learning Outcome'),\n '#weight' => max($weight)+51,\n );\n\n }\n\n // Lengthen the form when building to prevent the\n // tag autocomplete results from being cut off.\n if ($build_access) {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />',\n '#weight' => max($weight) + 100,\n );\n\n }\n\n }\n\n // Submit hidden information to pass\n // to the validate and submit hooks.\n $form['pass-manage-learning-outcomes'] = array( '#type' => 'value', '#value' => $page_settings['manage learning outcomes'], );\n $form['pass-autocomplete-iteration'] = array( '#type' => 'value', '#value' => $page_settings['autocomplete iteration'], );\n $form['pass-tag-seperate-character'] = array( '#type' => 'value', '#value' => $page_settings['tag seperate character'], );\n $form['pass-tag-cloud-height-percent'] = array( '#type' => 'value', '#value' => $page_settings['tag cloud height percent'], );\n $form['pass-tag-cloud-max-font-size'] = array( '#type' => 'value', '#value' => $page_settings['tag cloud max font size'], );\n\n return $form;\n\n}", "function input_filter($components, $args)\n {\n $mmdTypes = array( \"disputed\", \"generated\", \"proofread\", \"erroneous\");\n $element = $args['element'];\n $record = $args['record'];\n $elementName = $element->name;\n $recordId = $record->id;\n $inputHtml = $components['input'];\n \n $newHtml = $inputHtml . \"<p>Bonus field input: <input type='text' name='Item-$recordId-$elementName-additional'/></p>\";\n $components['input'] = $newHtml;\n return $components;\n }", "function getInputForm() {\n\t\treturn new \\Flux\\Lead();\n\t}", "private function FormItems($x, $action) {\n $out = ''; \n $type = $x['FORM_TYPE']; // set all the values to someting sane \n $name = $x['FORM_NAME']; \n $hide = $x['FORM_HIDE'];\n $label = $x['FORM_LABEL'];\n $size = $x['FORM_SIZE']; \n $max = $x['FORM_MAXLENGTH']; \n $value = isset($x['VALUE']) ? $x['VALUE'] : ''; \n $now = date('Y-m-d H:i:s'); \n \n if ($hide === 'hidden') {\n $type = 'hidden'; \n }\n \n if ($type === 'hidden') {\n $out .= \"<input type='$type' name='$name' value='$value'>\"; \n }\n \n if ($type === 'text') {\n $out .= \"<p>\\n\"; \n $out .= \"<label for='$label'> $label </label><br>\\n \"; \n $out .= \"<input type='$type' name='$name' value='$value' size='$size' maxlength='$max' required>\\n\";\n $out .= \"</p>\\n\"; \n }\n \n // datetime row created \n if ($type === 'datetime') {\n \n if($action === 'crf') {\n $value = $now; \n } \n if($action === 'uf') {\n $value = $value; \n }\n $out .= \"<input type='hidden' name='$name' value='$value'>\\n\";\n }\n \n // datetime row updated \n if ($type === 'timestamp') {\n \n if($action === 'crf') {\n $value = '';\n }\n if($action === 'uf'){\n $value = $now; \n }\n $out .= \"<input type='hidden' name='$name' value='$value'>\\n\";\n }\n \n if ($type === 'textarea') {\n $out .= \"<p>\\n\";\n $out .= \"<label for='$label'> $label </label><br>\\n\"; \n $out .= \"<textarea \" . TEXTAREA_ROWS_COLS . \" name='$name'>$value</textarea>\"; // set the rows and col in a global config (work on wrap) \n $out .= \"</p>\\n\"; \n }\n \n \n // ADD SUPPORT FOR DATE (expires)\n //\n // ACTIVE / INACTIVE BOOL? \n //\n // ADD SUPPORT FOR TEXT / TEXTAREA \n \n \n //var_dump($x); \n \n return $out; \n }", "public function buildForm()\n {\n }", "public function getInput() {}", "public function viewForm($issue)\n {\n $article = ArticlesList::where('issue', '=', $issue)->get();\n foreach ($article as $key => $value) {\n $articleCount = $value['articleNo'];\n }\n if (isset($article[0])) {\n return View::make('uploadArticle')\n ->with('title', 'Add Article')\n ->with('articleNo', $articleCount + 1)\n ->with('issue', $issue);\n } else {\n return View::make('uploadArticle')\n ->with('title', 'Add Article')\n ->with('articleNo', 1)\n ->with('issue', $issue);\n }\n }", "public function formAction() {}", "public function form()\n {\n\n $this->hidden('key', '字段名')->rules('required');\n $this->editor('val', '平台规则')->rules('required');\n }", "function form_data($args)\n {\n }", "private function inputs(){\n\t\tswitch($_SERVER['REQUEST_METHOD']){ // Make switch case so we can add additional \n\t\t\tcase \"GET\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"GET\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"POST\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"PUT\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"DELETE\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->response('Forbidden',403);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function form()\n {\n $this->select('type', '计算类型')\n ->options(Interest::$typeMap)\n ->default(Interest::TYPE_FUTURE)->required();\n\n $this->number('value', '计算值')->required();\n $this->number('years', '存入年限')->required();\n $this->rate('rate', '年化利率')->required();\n }", "abstract public function getForm() : void;", "function acf_get_text_input($attrs = array())\n{\n}", "function createFieldForm($arrLang)\n{\n\n $arrFields = array(\"conference_name\" => array(\"LABEL\" => $arrLang['Conference Name'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:300px;\"),\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_owner\" => array(\"LABEL\" => $arrLang['Conference Owner'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_number\" => array(\"LABEL\" => $arrLang['Conference Number'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_pin\" => array(\"LABEL\" => $arrLang['Moderator PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_1\" => array(\"LABEL\" => $arrLang['Moderator Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_pin\" => array(\"LABEL\" => $arrLang['User PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_1\" => array(\"LABEL\" => $arrLang['User Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_3\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"start_time\" => array(\"LABEL\" => $arrLang['Start Time (PST/PDT)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"DATE\",\n \"INPUT_EXTRA_PARAM\" => array(\"TIME\" => true, \"FORMAT\" => \"%Y-%m-%d %H:%M\",\"TIMEFORMAT\" => \"12\"),\n \"VALIDATION_TYPE\" => \"ereg\",\n \"VALIDATION_EXTRA_PARAM\" => \"^(([1-2][0,9][0-9][0-9])-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))) (([0-1][0-9]|2[0-3]):[0-5][0-9])$\"),\n \"duration\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"duration_min\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n/*\n \"recurs\" => array(\"LABEL\" => $arrLang['Recurs'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"reoccurs_period\" => array(\"LABEL\" => $arrLang[\"Reoccurs\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_period,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n \"reoccurs_days\" => array(\"LABEL\" => $arrLang[\"for\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_days,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n*/\n \"max_participants\" => array(\"LABEL\" => $arrLang['Max Participants'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:50px;\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n );\n return $arrFields;\n}", "function ivan_comment_form_fields($fields) {\r\n \r\n\t$commenter = wp_get_current_commenter();\r\n\t$req = get_option( 'require_name_email' );\r\n\t$aria_req = ( $req ? \" aria-required='true'\" : '' );\r\n \r\n\t$fields['author'] = \r\n\t\t'<div class=\"comment-form-field comment-form-author col-xs-12 col-sm-4 col-md-4 no-padding-left-xs no-padding-right-xs no-padding-left-sm no-padding-left-lg\">\r\n\t\t\t<input required minlength=\"3\" placeholder=\"'. __('Your Name', 'ivan_domain') .'*\" id=\"author\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) .\r\n\t'\"' . $aria_req . ' />\r\n\t\t</div>';\r\n \r\n\t$fields['email'] = \r\n\t\t'<div class=\"comment-form-field comment-form-email col-xs-12 col-sm-4 col-md-4 no-padding-left-xs no-padding-right-xs \">\r\n\t\t\t<input required placeholder=\"'. __('Your Email', 'ivan_domain') .'*\" id=\"email\" name=\"email\" type=\"email\" value=\"' . esc_attr( $commenter['comment_author_email'] ) .\r\n\t'\"' . $aria_req . ' />\r\n\t\t</div>';\r\n \r\n\t$fields['url'] = \r\n\t\t'<div class=\"comment-form-field comment-form-url col-xs-12 col-sm-4 col-md-4 no-padding-left-xs no-padding-right-xs no-padding-right-sm no-padding-right-lg\">\r\n\t\t\t<input placeholder=\"'. __('Your Website', 'ivan_domain') .'\" id=\"url\" name=\"url\" type=\"url\" value=\"' . esc_attr( $commenter['comment_author_url'] ) .\r\n\t'\" />\r\n\t\t</div>';\r\n \r\n\treturn $fields;\r\n}", "private function resetInputFields()\n {\n $this->agency_id = '';\n $this->state_id = '';\n $this->name = '';\n $this->logo = '';\n $this->email = '';\n $this->phone = '';\n $this->fax = '';\n $this->address = '';\n $this->facebook = '';\n $this->instagram = '';\n $this->youtube = '';\n $this->viber = '';\n $this->whatsapp = '';\n $this->url = '';\n }", "function display_form( $org ) { ?>\n\n\t\t<form action=\"<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>\" method=\"POST\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Organisation name\n\t\t\t\t\t\t<input type=\"text\" name=\"title\" value=\"<?php echo esc_attr( $org->columns['Title'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Telephone\n\t\t\t\t\t\t<input type=\"text\" name=\"telephone\" value=\"<?php echo esc_attr( $org->columns['Telephone'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Telephone alternative number\n\t\t\t\t\t\t<input type=\"text\" name=\"telephonealternative\" value=\"<?php echo esc_attr( $org->columns['TelephoneAlternative'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Email\n\t\t\t\t\t\t<input type=\"email\" name=\"email\" value=\"<?php echo esc_attr( $org->columns['Email'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Website URL\n\t\t\t\t\t\t<input type=\"text\" name=\"website_url\" value=\"<?php echo esc_url( $org->columns['Website_URL'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Address\n\t\t\t\t\t\t<textarea name=\"address\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\">NOT USED</textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Location\n\t\t\t\t\t\t<-- ie: parish -->\n\t\t\t\t\t\t<input type=\"text\" name=\"location\" value=\"NOT USED\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Town / City\n\t\t\t\t\t\t<input type=\"text\" name=\"cityortown\" value=\"<?php echo esc_attr( $org->columns['CityOrTown'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>County\n\t\t\t\t\t\t<input type=\"text\" name=\"county\" value=\"<?php echo esc_attr( $org->columns['County'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Postcode\n\t\t\t\t\t\t<input type=\"text\" name=\"postcode\" value=\"<?php echo esc_attr( $org->columns['Postcode'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Country\n\t\t\t\t\t\t<input type=\"text\" name=\"country_id\" value=\"<?php echo esc_attr( $org->columns['Country_ID'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Latitude\n\t\t\t\t\t\t<input type=\"text\" name=\"latitude\" value=\"<?php echo esc_attr( $org->columns['Latitude'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Longitude\n\t\t\t\t\t\t<input type=\"text\" name=\"longitude\" value=\"<?php echo esc_attr( $org->columns['Longitude'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Opening Hours\n\t\t\t\t\t\t<textarea name=\"openinghours\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\"><?php echo esc_textarea( $org->columns['OpeningHours'] ); ?></textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\n\t\t\t\t<?php // Get a list of all the services\n\t\t\t\t$services = $this->get_service_list();\n\n\t\t\t\tif ( ! $services || empty( $services ) ) {\n\t\t\t\t\t// Error retrieving Services\n\t\t\t\t\tconsole_debug( 'There was a problem retrieving the services from the database' );\n\t\t\t\t} else {\n\n\t\t\t\t\t// Outputs the services checkboxes, ticking any that are selected for this organisation\n\t\t\t\t\t// TODO: Need to find out which are selected for this organisation if we're editing it\n\t\t\t\t\t?>\n\t\t\t\t\t<fieldset class=\"services-checkboxes\">\n\t\t\t\t\t\t<legend>Services</legend>\n\n\t\t\t\t\t\t<?php foreach ( $services as $service ) {\n\t\t\t\t\t\t\t$id = $service['ID'];\n\t\t\t\t\t\t\t$title = $service['Title'];\n\n\t\t\t\t\t\t\techo '<input id=\"service-' . $id . '\" type=\"checkbox\" name=\"services[]\" value=\"' . $id . '\"> <label for=\"service-' . $id . '\">' . $title . '</label>';\n\t\t\t\t\t\t} ?>\n\n\t\t\t\t\t</fieldset>\n\n\t\t\t\t<?php } // endif ?>\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Other Information\n\t\t\t\t\t\t<textarea name=\"information\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\"><?php echo esc_textarea( $org->columns['Information'] ); ?></textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\n\t\t\t\t<?php // Hidden field of id. Will be 'null' if a new record.\n\n\t\t\t\tif ( $org->columns['ID'] == null ) {\n\t\t\t\t\t$the_id = 'null';\n\t\t\t\t} else {\n\t\t\t\t\t$the_id = $org->columns['ID'];\n\t\t\t\t}\n\n\t\t\t\techo '<input type=\"hidden\" name=\"id\" value=\"' . esc_attr( $the_id ) . '\" />'; ?>\n\n\t\t\t\t<?php // Set the action handler for wordpress ?>\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"add_edit_org\"/>\n\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Save\">\n\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Cancel\" formnovalidate>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\n\t<?php }" ]
[ "0.6808425", "0.6416986", "0.6098156", "0.60136986", "0.5997963", "0.5986787", "0.59490174", "0.5942862", "0.5938425", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5930165", "0.5852034", "0.58178747", "0.5751405", "0.57418734", "0.57398635", "0.5668791", "0.56617415", "0.5656195", "0.5651327", "0.5603512", "0.5602469", "0.55781126", "0.55750316", "0.55477804", "0.5547386", "0.5539049", "0.5529001", "0.552424", "0.5504976", "0.5496833", "0.5494996", "0.54941034", "0.5489052", "0.5484454", "0.54802823", "0.5478946", "0.54747903", "0.5473961", "0.54686475", "0.5468328", "0.5464394", "0.5429414", "0.54283553", "0.5422501", "0.541537", "0.54145", "0.5407667", "0.5391459", "0.5386434", "0.5381044", "0.5380579", "0.5376318", "0.53736925", "0.5362858", "0.53587794", "0.5353141", "0.5351738", "0.53463143", "0.53418595", "0.5336814", "0.5326493", "0.5324446", "0.53230774", "0.5320903", "0.53165936", "0.5313248", "0.53110653", "0.53026396", "0.5298659", "0.5296228", "0.5290695", "0.52901065", "0.528992", "0.52880853", "0.5282014", "0.5281337", "0.52805704", "0.5268362", "0.5263252", "0.52622247", "0.52596414", "0.52506596", "0.5246839", "0.52408874", "0.5239585", "0.5238636", "0.5232704", "0.52281886", "0.52276576" ]
0.0
-1
Function which set the IssueForm default options
public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults( array( 'data_class' => 'Vlad\BugtrackerBundle\Entity\Issue' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDefaults() {\r\n\t\t$this->requiredBold=true;\r\n\t\t$this->saveButton=true;\r\n\t\t$this->backButton=false;\r\n\t\t$this->actionFrameName='form_actionFrame_'.self::$instances;\r\n\t\t$this->target=$this->actionFrameName;\r\n\t\t$this->triggerFile=$_SERVER['SCRIPT_NAME'];\r\n\r\n\t\t$this->showCaption=true;\r\n\t\t$this->showDescription=true;\r\n\r\n\t\t$this->method=\"POST\";\r\n\t\t$this->jsFiles=array(\r\n\t\t\tLIB_PATH.'jsfunc.validateform.js',\r\n\t\t\tLIB_PATH.'jsfunc.tooltip.js',\r\n\t\t);\r\n\t}", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "protected function setDefaultValueExtra()\n {\n $this->default_data['address'] = 'xxx.atlassian.net';\n $this->default_data['rest_api_resource'] = '/rest/api/latest/';\n $this->default_data['timeout'] = 60;\n\n $this->default_data['clones']['mappingTicket'] = array(\n array(\n 'Arg' => self::ARG_SUMMARY,\n 'Value' => 'Issue {include file=\"file:$centreon_open_tickets_path/providers/' .\n 'Abstract/templates/display_title.ihtml\"}'\n ),\n array('Arg' => self::ARG_DESCRIPTION, 'Value' => '{$body}'),\n array('Arg' => self::ARG_PROJECT, 'Value' => '{$select.jira_project.id}'),\n array('Arg' => self::ARG_ASSIGNEE, 'Value' => '{$select.jira_assignee.id}'),\n array('Arg' => self::ARG_PRIORITY, 'Value' => '{$select.jira_priority.id}'),\n array('Arg' => self::ARG_ISSUETYPE, 'Value' => '{$select.jira_issuetype.id}'),\n );\n }", "protected function _getDefaultOptions()\n {\n }", "protected function setDefaultOptions()\n {\n $this->unsigned = false;\n }", "function my_comment_form_defaults( $defaults ) {\n\n $defaults['comment_notes_before'] = null;\n return $defaults;\n\n}", "public function getDefaultOptions();", "public function getDefaultOptions();", "public function populateDefaults() {\n\t\t$this->owner->ShowInMenus = false;\n\t\t$this->owner->ShowInSearch = false;\n\t\t$this->owner->SubmitButtonText = \"Show my results\";\n \t}", "static public function change_gform_options()\n {\n update_option( 'rg_gforms_disable_css', '1' );\n \tupdate_option( 'rg_gforms_enable_html5', '1' );\n }", "private function setOptions()\n\t{\n\t\t$this->site = ( isset($_POST['site']) ) ? sanitize_text_field($_POST['site']) : null;\n\t\t$this->feed_type = ( isset($_POST['type']) && $_POST['type'] !== 'search' ) ? sanitize_text_field($_POST['type']) : 'search';\n\t\t$this->post_id = ( isset($_POST['id']) ) ? sanitize_text_field($_POST['id']) : null;\n\t\t$this->feed_format = ( isset($_POST['format']) && $_POST['format'] !== 'unformatted' ) ? sanitize_text_field($_POST['format']) : 'unformatted';\n\t}", "public function setDefaultOptions()\n {\n // Set event data\n foreach ($this->events as $event => $handler) {\n $this->options['data']['widget-action-' . $event] = $handler;\n }\n\n if($this->jsWidget) {\n $this->options['data']['ui-widget'] = $this->jsWidget;\n }\n\n if($this->fadeIn) {\n $fadeIn = $this->fadeIn === true ? 'fast' : $this->fadeIn;\n $this->options['data']['widget-fade-in'] = $fadeIn;\n $this->visible = false;\n }\n\n if (!empty($this->init)) {\n $this->options['data']['ui-init'] = $this->init;\n }\n }", "protected function getDefaultOptions()\n {\n $this->barcodeLength = 2;\n }", "function room_reservations_admin_settings_default_email($form, &$form_state) {\n $options = array(\n '0' => t('Do not set a default email address.'),\n '1' => t('Set the default email address equal to the user ID.'),\n '2' => t('Set the default email address equal to the user ID plus the domain name entered below.'),\n );\n $default_option = _room_reservations_get_variable('default_email_address');\n $default_domain = _room_reservations_get_variable('default_email_domain');\n $form['options'] = array(\n '#title' => t('Options'),\n '#type' => 'radios',\n '#options' => $options,\n '#description' => t('Options for including a default email address\n in the Reminders - Email Addresses field on the reservation form.'),\n '#default_value' => $default_option,\n '#weight' => -100,\n );\n $form['domain'] = array(\n '#title' => t('Domain Name'),\n '#type' => 'textfield',\n '#description' => t('The domain name that is added to the user\n name to create the default email address on the reservation form.\n Required if the third option above is selected.'),\n '#default_value' => $default_domain,\n '#maxlength' => 80,\n '#size' => 80,\n '#weight' => -90,\n );\n $form['save'] = array(\n '#type' => 'submit',\n '#value' => t('Save configuration'),\n '#weight' => 100,\n );\n $form['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset to defaults'),\n '#weight' => 101,\n );\n\n return $form;\n}", "private function setDefaults() {\r\n\t\t$this->type=formElement::TYPE_TEXT;\r\n\t\t$this->mulitple=false;\r\n\t\t$this->readOnly=false;\r\n\t\t$this->size=50;\r\n\t\t$this->max=0;\r\n\t\t$this->cols=100;\r\n\t\t$this->rows=10;\r\n\t\t$this->fieldWidth=300;\r\n\r\n\r\n\t\t$this->CSS='\r\n.form_text {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_text_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_select {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_select_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tfont-weight:bold;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#980000;\r\n\tcolor:#FFFFFF;\r\n}\r\n\r\n.form_checkbox {\r\n\r\n}\r\n\r\n.form_textarea {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_textarea_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n}';\r\n\r\n\t\t$this->JS='\r\nfunction submitIfEnter(event, frm) {\r\n \tif (event && event.keyCode == 13) {\r\n \t\tfrm.onsubmit();\r\n \t} else {\r\n \t\treturn true;\r\n \t}\r\n}';\r\n\t}", "function setDefaultValues() {}", "private static function default_options()\n\t{\n\t\t$options = array(\n\t\t\t'jambo__send_to' => $_SERVER['SERVER_ADMIN'],\n\t\t\t'jambo__subject' => _t('[CONTACT FORM] %s', 'jambo'),\n\t\t\t'jambo__show_form_on_success' => 1,\n\t\t\t'jambo__success_msg' => _t('Thank you for your feedback. I\\'ll get back to you as soon as possible.', 'jambo'),\n\t\t\t);\n\t\treturn Plugins::filter('jambo_default_options', $options);\n\t}", "public function setDefaultSettings() {\n $defaultSettings = array(\n \"media_buttons\" => false,\n \"textarea_name\" => $this->getNameAttribute(),\n \"textarea_rows\" => 10,\n \"teeny\" => false,\n \"quicktags\" => false\n );\n $this->setWpEditorSettings($defaultSettings);\n }", "public function setDefaults (array $options = []);", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function setDefaultOptions(array $options);", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }", "protected function _initOptions()\n\t{\n\t\t\n\t\t$this->options = array_merge( [\n\t\t\t'role' => 'dialog',\n\t\t\t'tabindex' => false,\n\t\t], $this->options );\n\t\t\n\t\tHtml::addCssClass( $this->options, [ 'type' => 'fade modal' ] );\n\t\t\n\t\tif( is_array( $this->clientOptions ) ) {\n\t\t\t$this->clientOptions = array_merge( [ 'show' => false ], $this->clientOptions );\n\t\t}\n\t\t\n\t\tif( is_array( $this->url ) ) {\n\t\t\t$this->url = Url::to( $this->url );\n\t\t}\n\t\t\n\t\tif( is_array( $this->closeButton ) ) {\n\t\t\t\n\t\t\t$this->closeButton = array_merge( [\n\t\t\t\t'data-dismiss' => 'modal',\n\t\t\t\t'aria-hidden' => 'true',\n\t\t\t\t'class' => 'close',\n\t\t\t], $this->closeButton );\n\t\t\t\n\t\t}\n\t\t\n\t\tif( is_array( $this->toggleButton ) ) {\n\t\t\t\n\t\t\t$this->toggleButton = array_merge( [\n\t\t\t\t'data-toggle' => 'modal',\n\t\t\t], $this->toggleButton );\n\t\t\t\n\t\t\tif( !isset( $this->toggleButton['data-target'] ) && !isset( $this->toggleButton['href'] ) ) {\n\t\t\t\t$this->toggleButton['data-target'] = '#' . $this->options['id'];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function setDefaultOverrideOptions() {\n\tglobal $fm_module_options;\n\t\n\t$config = null;\n\t$server_os_distro = isDebianSystem($_POST['server_os_distro']) ? 'debian' : strtolower($_POST['server_os_distro']);\n\t\n\tswitch ($server_os_distro) {\n\t\tcase 'debian':\n\t\t\t$config = array(\n\t\t\t\t\t\t\tarray('cfg_type' => 'global', 'server_serial_no' => $_POST['SERIALNO'], 'cfg_name' => 'pid-file', 'cfg_data' => '/var/run/named/named.pid')\n\t\t\t\t\t\t);\n\t}\n\t\n\tif (is_array($config)) {\n\t\tif (!isset($fm_module_options)) include(ABSPATH . 'fm-modules/' . $_SESSION['module'] . '/classes/class_options.php');\n\t\t\n\t\tforeach ($config as $config_data) {\n\t\t\t$fm_module_options->add($config_data);\n\t\t}\n\t}\n}", "public function getDefaultOptions()\n {\n\n return array('validation_groups' => array('admEdit', 'Default'));\n\n }", "public function set_options()\n {\n // Attempt to retrieve our feature default settings so that we can compare against our post types query\n $defaults = get_option(self::FEATURE_DEFAULTS);\n\n // Retrieve all post types for the given instance and filter down to only publicly accessible types\n $types = get_post_types([\n 'public' => true,\n 'show_in_menu' => true,\n 'exclude_from_search' => false\n ]);\n\n // Remove all post types that we don't want to support duplication for\n $post_types = array_keys(\n array_filter(\n $types,\n function ($key) {\n return !in_array($key, ['attachment']);\n },\n ARRAY_FILTER_USE_KEY\n )\n );\n\n $this->defaults = [\n 'post_types' => $post_types\n ];\n\n // We don't want to ALWAYS update our feature defaults option unless\n // we know that new post types have been added/deleted\n if (isset($defaults) && $post_types === $defaults['post_types']) {\n return;\n }\n\n update_option(self::FEATURE_DEFAULTS, $this->defaults);\n }", "function _setDefaults() {}", "protected function defineOptions() {\r\n $options = parent::defineOptions();\r\n $options['view_type'] = array('default' => 'web');\r\n\t$options['image_style'] = array('default' => '');\r\n\t$options['link_to_entity'] = array('default' => '');\r\n\r\n return $options;\r\n }", "function __construct($opts = array()) {\n $this->setOptionDefault('name', '');\n $this->setOptionDefault('rows', '');\n $this->setOptionDefault('cols', '');\n $this->setOptionDefault('value', '');\n $this->setOptionDefault('required', '');\n $this->setOptionDefault('position', 'bottom'); /* possible values bottom, right */\n $this->setOptionDefault('jpm_foreign_collection', '');\n $this->setOptionDefault('jpm_foreign_title_fields', '');\n $this->setOptionDefault('dataClassName', '');\n /* update options with input */\n parent::__construct($opts);\n }", "private function initMailOptionsForm()\n\t{\n\t\tglobal $ilCtrl, $ilSetting, $lng, $ilUser;\t\n\t\t\n\t\tinclude_once 'Services/Form/classes/class.ilPropertyFormGUI.php';\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));\n\t\t$this->form->setTitle($lng->txt('mail_settings'));\n\t\t\t\n\t\t// BEGIN INCOMING\n\t\tinclude_once 'Services/Mail/classes/class.ilMailOptions.php';\n\t\tif($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')\n\t\t{\n\t\t\t$options = array(\n\t\t\t\tIL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), \n\t\t\t\tIL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),\n\t\t\t\tIL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')\n\t\t\t);\n\t\t\t$si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');\n\t\t\t$si->setOptions($options);\n\t\t\tif(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||\n\t\t\t $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')\n\t\t\t{\n\t\t\t\t$si->setDisabled(true);\t\n\t\t\t}\n\t\t\t$this->form->addItem($si);\n\t\t}\n\t\t\n\t\t// BEGIN LINEBREAK_OPTIONS\n\t\t$options = array();\n\t\tfor($i = 50; $i <= 80; $i++)\n\t\t{\n\t\t\t$options[$i] = $i; \n\t\t}\t\n\t\t$si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');\n\t\t$si->setOptions($options);\t\t\t\n\t\t$this->form->addItem($si);\n\t\t\n\t\t// BEGIN SIGNATURE\n\t\t$ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');\n\t\t$ta->setRows(10);\n\t\t$ta->setCols(60);\t\t\t\n\t\t$this->form->addItem($ta);\n\t\t\n\t\t// BEGIN CRONJOB NOTIFICATION\n\t\tif($ilSetting->get('mail_notification'))\n\t\t{\n\t\t\t$cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');\t\t\t\n\t\t\t$cb->setInfo($lng->txt('mail_cronjob_notification_info'));\n\t\t\t$cb->setValue(1);\n\t\t\t$this->form->addItem($cb);\n\t\t}\t\t\n\t\t\n\t\t$this->form->addCommandButton('saveMailOptions', $lng->txt('save'));\n\t}", "protected function loadDefaultOptions()\r\n {\r\n $this->options = [\r\n 'offsettop' => 0,\r\n 'offsetleft' => 0,\r\n 'merge' => false,\r\n 'backcolor' => 0xffffff,\r\n ];\r\n }", "protected function setDefaults()\n {\n return;\n }", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "protected function _setDefaultVars()\r\n\t{\r\n\t\t// Mediawiki globals\r\n\t\tglobal $wgScript, $wgUser, $wgRequest;\r\n\t\t\r\n\t\t$this->action = $this->getAction();\r\n\t\t$this->pageKey = $this->getNamespace('dbKey');\r\n\t\t$this->project = $this->getNamespace('dbKey');\t\t\r\n\t\t$this->pageTitle = $this->getNamespace('text');\r\n\t\t$this->formAction = $wgScript;\r\n\t\t$this->url = $wgScript . '?title=' . $this->pageKey . '&bt_action=';\r\n\t\t$this->viewUrl = $this->url . 'view&bt_issueid=';\r\n\t\t$this->addUrl = $this->url . 'add';\r\n\t\t$this->editUrl = $this->url . 'edit&bt_issueid=';\r\n\t\t$this->deleteUrl = $this->url . 'archive&bt_issueid=';\r\n\t\t$this->isLoggedIn = $wgUser->isLoggedIn();\r\n\t\t$this->isAllowed = $wgUser->isAllowed('protect');\r\n\t\t$this->hasDeletePerms = $this->hasPermission('delete');\r\n\t\t$this->hasEditPerms = $this->hasPermission('edit');\r\n\t\t$this->hasViewPerms = $this->hasPermission('view');\r\n\t\t$this->search = true;\r\n\t\t$this->filter = true;\r\n\t\t$this->auth = true;\r\n\t\t$this->issueType = $this->_config->getIssueType();\r\n\t\t$this->issueStatus = $this->_config->getIssueStatus();\r\n\t\t\r\n\t\t// Request vars\r\n\t\t$this->filterBy = $wgRequest->getVal('bt_filter_by');\r\n\t\t$this->filterStatus = $wgRequest->getVal('bt_filter_status');\r\n\t\t$this->searchString = $wgRequest->getVal('bt_search_string');;\r\n\t}", "function options_form(&$form, &$form_state) {\n parent::options_form($form, $form_state);\n\n // Add an option to control the format of the summary.\n $options = array(\n '' => t('Default format'),\n 'custom' => t('Custom format'),\n );\n $example_month = date_format_date(date_example_date(), 'custom', $this->date_handler->views_formats('month', 'display'));\n $example_day = date_format_date(date_example_date(), 'custom', $this->date_handler->views_formats('day', 'display'));\n\n $form['title_format'] = array(\n '#type' => 'select',\n '#title' => t('Date format options'),\n '#default_value' => $this->options['title_format'],\n '#options' => $options,\n '#description' => t('The date format used in titles and summary links for this argument. The default format is based on the granularity of the filter, i.e. month: @example_month, day: @example_day.', array('@example_month' => $example_month, '@example_day' => $example_day)),\n '#attributes' => array('class' => array('dependent-options')),\n '#states' => array(\n 'visible' => array(\n ':input[name=\"options[default_action]\"]' => array('value' => 'summary')\n ),\n ),\n );\n\n $form['title_format_custom'] = array(\n '#type' => 'textfield',\n '#title' => t('Custom summary date format'),\n '#default_value' => $this->options['title_format_custom'],\n '#description' => t(\"A custom format for the title and summary date format. Define a php date format string like 'm-d-Y H:i' (see <a href=\\\"@link\\\">http://php.net/date</a> for more details).\", array('@link' => 'http://php.net/date')),\n '#attributes' => array('class' => array('dependent-options')),\n '#states' => array(\n 'visible' => array(\n ':input[name=\"options[title_format]\"]' => array('value' => 'custom')\n ),\n ),\n );\n\n $options = $this->date_handler->date_parts();\n unset($options['second'], $options['minute']);\n $options += array('week' => t('Week', array(), array('context' => 'datetime')));\n $form['granularity'] = array(\n '#title' => t('Granularity'),\n '#type' => 'radios',\n '#options' => $options,\n '#default_value' => $this->options['granularity'],\n '#multiple' => TRUE,\n '#description' => t(\"Select the type of date value to be used in defaults, summaries, and navigation. For example, a granularity of 'month' will set the default date to the current month, summarize by month in summary views, and link to the next and previous month when using date navigation.\"),\n );\n\n $form['year_range'] = array(\n '#title' => t('Date year range'),\n '#type' => 'textfield',\n '#default_value' => $this->options['year_range'],\n '#description' => t(\"Set the allowable minimum and maximum year range for this argument, either a -X:+X offset from the current year, like '-3:+3' or an absolute minimum and maximum year, like '2005:2010' . When the argument is set to a date outside the range, the page will be returned as 'Page not found (404)' .\"),\n );\n\n $form['use_fromto'] = array(\n '#type' => 'radios',\n '#title' => t('Dates to compare'),\n '#default_value' => $this->options['use_fromto'],\n '#options' => array('' => t('Start/End date range'), 'no' => t('Only this field')),\n '#description' => t(\"If selected the view will check if any value starting with the 'Start' date and ending with the 'End' date matches the view criteria. Otherwise the view will be limited to the specifically selected fields. Comparing to the whole Start/End range is the recommended setting when using this filter in a Calendar. When using the Start/End option, it is not necessary to add both the Start and End fields to the filter, either one will do.\"),\n );\n\n $access = TRUE;\n if (!empty($this->definition['field_name'])) {\n $field = field_info_field($this->definition['field_name']);\n $access = $field['cardinality'] != 1;\n }\n $form['add_delta'] = array(\n '#type' => 'radios',\n '#title' => t('Add multiple value identifier'),\n '#default_value' => $this->options['add_delta'],\n '#options' => array('' => t('No'), 'yes' => t('Yes')),\n '#description' => t('Add an identifier to the view to show which multiple value date fields meet the filter criteria. Note: This option may introduce duplicate values into the view. Required when using multiple value fields in a Calendar or any time you want the node view of multiple value dates to display only the values that match the view filters.'),\n // Only let mere mortals tweak this setting for multi-value fields\n '#access' => $access,\n );\n\n }", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function updateDefaultsFromObject() {\n parent::updateDefaultsFromObject();\n // Tags\n if(isset($this->widgetSchema['tags'])) {\n $tags = $this->getObject()->getTags();\n if($this->getUser()->getAttribute('enable_keyboard', false)) {\n $tags = implode(', ', $tags);\n }\n $this->widgetSchema['tags']->setDefault($tags);\n }\n // Elements\n if(isset($this->widgetSchema['elements_list'])) {\n $this->widgetSchema['elements_list']->setDefault($this->getObject()->getElements());\n }\n if($this->getUser()->getAttribute('enable_keyboard', false) && isset($this->widgetSchema['demandeur_id']) && !$this->isNew())\n {\n $this->setDefault('demandeur_id', $this->getObject()->getDemandeur()->getName());\n }\n }", "public function options_init() {\n\t\t\tglobal $allowedtags;\n\t\t\t$allowedtags['p'] = array();\n\t\t\t$this->allowedtags = $allowedtags;\n\n\t\t // set options equal to defaults\n\t\t $this->_options = get_option( $this->options_group[0]['options_name'] );\n\t\t if ( false === $this->_options ) {\n\t\t\t\t$this->_options = $this->get_defaults();\n\t\t }\n\t\t if ( isset( $_GET['undo'] ) && !isset( $_GET['settings-updated'] ) && is_array( $this->get_option('previous') ) ) {\n\t\t \t$this->_options = $this->get_option('previous');\n\t\t }\n\t\t update_option( $this->options_group[0]['options_name'], $this->_options );\t\t\n\t\t \n\t\t}", "function options_form(&$form, &$form_state) {\r\n parent::options_form($form, $form_state);\r\n $options = $this->date_handler->date_parts();\r\n unset($options['second'], $options['minute']);\r\n $options += array('week' => date_t('Week', 'datetime'));\r\n $form['granularity'] = array(\r\n '#title' => t('Granularity'),\r\n '#type' => 'radios',\r\n '#options' => $options,\r\n '#default_value' => $this->options['granularity'],\r\n '#multiple' => TRUE,\r\n '#description' => t(\"Select the type of date value to be used in defaults, summaries, and navigation. For example, a granularity of 'month' will set the default date to the current month, summarize by month in summary views, and link to the next and previous month when using date navigation.\"),\r\n );\r\n\r\n $form['year_range'] = array(\r\n '#title' => t('Date year range'),\r\n '#type' => 'textfield',\r\n '#default_value' => $this->options['year_range'],\r\n '#description' => t(\"Set the allowable minimum and maximum year range for this argument, either a -X:+X offset from the current year, like '-3:+3' or an absolute minimum and maximum year, like '2005:2010'. When the argument is set to a date outside the range, the page will be returned as 'Page not found (404)'.\"),\r\n );\r\n \r\n $fields = date_api_fields($this->definition['base']);\r\n $options = array();\r\n foreach ($fields['name'] as $name => $field) {\r\n $options[$name] = $field['label'];\r\n }\r\n $form['date_fields'] = array(\r\n '#title' => t('Date field(s)'),\r\n '#type' => 'checkboxes',\r\n '#options' => $options,\r\n '#default_value' => $this->options['date_fields'],\r\n '#multiple' => TRUE,\r\n '#description' => t(\"Select one or more date fields to filter with this argument. Do not select both the 'From date' and 'To date' for CCK date fields, only one of them is needed.\"),\r\n );\r\n $form['date_method'] = array(\r\n '#title' => t('Method'),\r\n '#type' => 'radios',\r\n '#options' => array('OR' => t('OR'), 'AND' => t('AND')),\r\n '#default_value' => $this->options['date_method'],\r\n '#description' => t('Method of handling multiple date fields in the same query. Return items that have any matching date field (date = field_1 OR field_2), or only those with matches in all selected date fields (date = field_1 AND field_2).'),\r\n );\r\n \r\n }", "public function initOptions() {\n\t\t$this->loadModel( 'RiskClassificationType' );\n\n\t\t$bcps = $this->BusinessContinuity->BusinessContinuityPlan->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'BusinessContinuityPlan.security_service_type_id !=' => SECURITY_SERVICE_DESIGN\n\t\t\t),\n\t\t\t'order' => array('BusinessContinuityPlan.title' => 'ASC'),\n\t\t\t'recursive' => -1\n\t\t));\n\n\t\t$mitigate_id = RISK_MITIGATION_MITIGATE;\n\n\t\t$accept_id = RISK_MITIGATION_ACCEPT;\n\n\t\t$transfer_id = RISK_MITIGATION_TRANSFER;\n\n\t\t$this->set('classifications', $this->BusinessContinuity->getFormClassifications());\n\t\t$this->set('bcps', $bcps);\n\t\t$this->set('mitigate_id', $mitigate_id);\n\t\t$this->set('accept_id', $accept_id);\n\t\t$this->set('transfer_id', $transfer_id);\n\t\t$this->set('calculationMethod', $this->BusinessContinuity->getMethod());\n\t}", "function _setDefaults()\n {\n $this->options['dsn'] = null;\n $this->options['table'] = 'sessiondata';\n $this->options['autooptimize'] = false;\n }", "function initialize_options()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\t$defaults = array(\n\t\t\t\t'minimum_age' => 4,\n\t\t\t\t'maximum_age' => 0,\n\t\t\t);\n\t\t\tforeach ($defaults as $option => $default)\n\t\t\t{\n\t\t\t\tif (!isset($config[$option]))\n\t\t\t\t{\n\t\t\t\t\tset_config($option, $default);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function simplenews_admin_issues() {\n // Build an 'Update options' form.\n $form['options'] = array(\n '#type' => 'fieldset',\n '#title' => t('Update options'),\n '#prefix' => '<div class=\"container-inline\">',\n '#suffix' => '</div>',\n );\n $options = array();\n foreach (module_invoke_all('simplenews_issue_operations') as $operation => $array) {\n $options[$operation] = $array['label'];\n }\n $form['options']['operation'] = array(\n '#type' => 'select',\n '#options' => $options,\n '#default_value' => 'activate',\n );\n $form['options']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Update'),\n '#submit' => array('simplenews_admin_issues_submit'),\n '#validate' => array('simplenews_admin_issues_validate'),\n );\n\n if (variable_get('simplenews_last_cron', '')) {\n $form['last_sent'] = array(\n '#markup' => '<p>' . format_plural(variable_get('simplenews_last_sent', 0), 'Last batch: 1 mail sent at !time.', 'Last batch: !count mails sent at !time.', array('!time' => format_date(variable_get('simplenews_last_cron', ''), 'small'), '!count' => variable_get('simplenews_last_sent', 0))) . \"</p>\\n\",\n );\n }\n // Table header. Used as tablesort default\n $header = array(\n 'title' => array(\n 'data' => t('Title'),\n 'specifier' => 'title',\n 'type' => 'property',\n ),\n 'newsletter' => array(\n 'data' => t('Newsletter'),\n 'specified' => array(\n 'field' => variable_get('simplenews_newsletter_field', 'simplenews_newsletter'),\n 'column' => 'target_id',\n ),\n 'type' => 'field',\n ),\n 'created' => array(\n 'data' => t('Created'),\n 'specifier' => 'created',\n 'sort' => 'desc',\n 'type' => 'property',\n ),\n 'published' => array('data' => t('Published')),\n 'sent' => array('data' => t('Sent')),\n 'subscribers' => array('data' => t('Subscribers')),\n 'operations' => array('data' => t('Operations')),\n );\n\n $query = new EntityFieldQuery();\n simplenews_build_issue_filter_query($query);\n $result = $query\n ->entityCondition('entity_type', 'node')\n ->tableSort($header)\n ->entityCondition('bundle', simplenews_get_content_types())\n ->pager(30)\n ->execute();\n\n $nids = !empty($result['node']) ? array_keys($result['node']) : array();\n $options = array();\n\n module_load_include('inc', 'simplenews', 'includes/simplenews.mail');\n $categories = simplenews_newsletter_list();\n foreach (node_load_multiple($nids) as $node) {\n $subscriber_count = simplenews_count_subscriptions(simplenews_issue_newsletter_id($node));\n $pending_count = simplenews_count_spool(array('entity_id' => $node->nid, 'entity_type' => 'node'));\n $send_status = simplenews_issue_status($node) == SIMPLENEWS_STATUS_SEND_PENDING ? $subscriber_count - $pending_count : theme('simplenews_status', array('source' => 'sent', 'status' => simplenews_issue_status($node)));\n\n $options[$node->nid] = array(\n 'title' => l($node->title, 'node/' . $node->nid),\n 'newsletter' => simplenews_issue_newsletter_id($node) && isset($categories[simplenews_issue_newsletter_id($node)]) ? $categories[simplenews_issue_newsletter_id($node)] : t('- Unassigned -'),\n 'created' => format_date($node->created, 'small'),\n 'published' => theme('simplenews_status', array('source' => 'published', 'status' => $node->status)),\n 'sent' => $send_status,\n 'subscribers' => $subscriber_count,\n 'operations' => l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => drupal_get_destination())),\n );\n }\n\n $form['issues'] = array(\n '#type' => 'tableselect',\n '#header' => $header,\n '#options' => $options,\n '#empty' => t('No newsletters available.'),\n );\n\n $form['pager'] = array('#theme' => 'pager');\n\n return $form;\n}", "protected function useDefaultValuesForNotConfiguredOptions() {}", "protected function initOptions()\n {\n }", "function resetOptions()\n {\n $this->options = $this->_defaultOptions;\n }", "function comments_block_form_defaults($fields)\n {\n }", "private function _setDefaults(): void {\n\t\t// default query options\n\t\t$options['limit'] = 50;\n\t\t$options['offset'] = false;\n\t\t$options['sort'] = false;\n\t\t$options['sortDirection'] = false;\n\t\t$this->setQueryOptions($options);\n\t}", "function setDefaults()\n {\n }", "protected function defaultOptions()\n {\n return [\n 'title_pattern' => '{{name}}',\n 'value_pattern' => '{{id}}',\n 'label_pattern' => '{{name}}',\n 'subtext_pattern' => 'Web ID: {{id}}',\n 'query_parameters' => []\n ];\n }", "public function __construct(){\n\t\tdate_default_timezone_set('Asia/Jakarta');\n\n\t\t$this->form = new Formly()->set_options(\n\t\t\tarray(\n\t\t\t\t'framework'=>$this->form_framework,\n\t\t\t\t'form_class'=>$this->form_class;\n\t\t\t)\n\t\t);\n\n\t}", "function initDefaultOptions(){\n\n\t\t\t$defaults = $this->defaultOptions();\n\t\t\treturn update_option( $this->optionsKey, $defaults );\n\t\t}", "protected function setDefaults()\n {\n $this->options['dsn'] = null;\n $this->options['table'] = 'sessiondata';\n $this->options['autooptimize'] = false;\n }", "abstract function setupform();", "protected function initFieldOptions(&$options)\n {\n $this->initFieldSize($options, 'lg');\n $this->initFieldSize($options, 'sm');\n if ($this->autoPlaceholder) {\n $label = $this->model->getAttributeLabel(Html::getAttributeName($this->attribute));\n $this->inputOptions['placeholder'] = $label;\n $options['placeholder'] = $label;\n }\n $this->addErrorClassBS4($options);\n }", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "function osa_admin_settings() {\r\n $form = array();\r\n\r\n $form['osa'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('OSA configuration'),\r\n '#collapsible' => FALSE,\r\n '#collapsed' => FALSE,\r\n );\r\n\r\n $form['osa']['osa_start_date'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Membership Start Date'),\r\n '#default_value' => variable_get('osa_start_date', 'first day of September'),\r\n '#description' => t('Set start date for new memberships. See PHP Supported Date and Time Formats (http://www.php.net/manual/en/datetime.formats.php)'),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['osa']['osa_discount_types'] = array(\r\n '#type' => 'textarea',\r\n '#title' => t('Discount types'),\r\n '#default_value' => variable_get('osa_discount_types'),\r\n '#description' => '<p>' . t('List all of the different Discount types offered.') . '<br />' .\r\n t('Enter one value per line. The amount of each discount is controlled by Pricing rules') . '<br />' .\r\n t('ONLY ADD TO THE END. Do not remove discount types or add new types into the middle of the list.') . '</p>',\r\n );\r\n \r\n return system_settings_form($form);\r\n}", "abstract function fields_options();", "function __construct(array $options=array()) {\n $this->options = $options + static::getDefaults();\n }", "function of_option_setup()\t{\n\t\n\tglobal $of_options, $options_machine;\n\t\n\t$options_machine = new Options_Machine($of_options);\n\t\t\n\tif (!get_option(OPTIONS)){\n\t\t\n\t\t$defaults = (array) $options_machine->Defaults;\n\t\tupdate_option(OPTIONS,$defaults);\n\t\tgenerate_options_css($defaults); \n\t\t\n\t}\n\t\n\t\n}", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n $request = DRequest::load();\n $this->setFieldValue(self::FIELD_IP_ADDRESS, $request->getIpAddress());\n $this->setFieldValue(self::FIELD_URL, self::getRequestUrl());\n }", "function propanel_of_reset_options($options,$page = ''){\n\n\t\t\t//@since 2.0 mod by denzel, reset defaults\n\t\t\t//replace of_reset_options() function..\t\t\t\n\t\t\t$template = get_option('of_template');\n\n\t\t\tforeach($template as $t):\n\t\t\t\t@$option_name = $t['id'];\n\t\t\t\t@$default_value = $t['std'];\n\t\t\t\tupdate_option(\"$option_name\",\"$default_value\");\n\t\t\tendforeach;\t\t\n\t\t\t//end of mod\t\n\n}", "protected function applyCustomSettings()\n {\n $this->disable(array('read_counter', 'edit_counter', 'deleted_at', 'version', 'creator_user_id', 'created_at'));\n \n $this['updated_at']->setMetaWidgetClassName('ullMetaWidgetDate');\n \n //configure subject\n $this['subject']\n ->setLabel('Subject')\n ->setWidgetAttribute('size', 50)\n ->setMetaWidgetClassName('ullMetaWidgetLink');\n \n //configure body\n $this['body']\n ->setMetaWidgetClassName('ullMetaWidgetFCKEditor')\n ->setLabel('Text');\n \n // configure access level\n $this['ull_wiki_access_level_id']->setLabel(__('Access level', null, 'ullWikiMessages'));\n \n $this['is_outdated']->setLabel(__('Is outdated', null, 'ullWikiMessages'));\n \n // configure tags\n $this['duplicate_tags_for_search']\n ->setLabel('Tags')\n ->setMetaWidgetClassName('ullMetaWidgetTaggable');\n \n if ($this->isCreateOrEditAction())\n {\n $this->disable(array('id', 'updator_user_id', 'updated_at'));\n } \n\n if ($this->isListAction())\n {\n $this->disableAllExcept(array('id', 'subject'));\n $this->enable(array('updator_user_id', 'updated_at'));\n } \n }", "function setfield( $field_name, $options ) {\n\n//if( $this->debug ) {\n//print \"<pre>\";\n//print \"Options:\\n-----------------------------\\n\";\n//print_r( $options );\n//print $options['name'];\n//print $options['value'];\n//print \"\\n--------------------------------------\\n\";\n//print \"</pre>\";\n//}\n\n/*\n Options (to this function, not an HTML menu option) is an associative array, which gives\n you great flexibility in setting any number\n of options you want.\n \n\tarray(\n\t\t'name' => 'email',\n\t\t'value'\t=> '[email protected]',\n\t\t'label' => 'Email Address',\n\t\t'required' => 1\n\t\t);\n */\n \n$this->fields[$field_name]['name'] = ( $options['name'] ) ? $options['name'] : '';\n\n$this->fields[$field_name]['value'] = ( $options['value'] )\t? $options['value'] : '';\n\nif( $this->debug ) {\nprint \"<pre>\";\nprint \"Value (option): \" . $options['value'] . \"\\n\";\nprint \"Value: \" . $this->fields[$field_name]['value'] . \"\\n\";\nprint \"</pre>\";\n}\n\n$this->fields[$field_name]['label'] = ( $options['label'] )\t? $options['label'] : '';\n\n$this->fields[$field_name]['required'] = ( $options['required'] ) ? $options['required'] : '';\n\n/*\nthe short circuit are a little space saving, but not too much, perl is much more elegant\nthis might be clearest\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][name] = $options['name'];\n\t}\n\tif( $options['value'] ) {\n\t\t$this->fields[$field_name][value] = $options['name']\n\t}\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][label] = $options['name']\n\t}\n\tif( $options['name'] ) {\n\t\t$this->fields[$field_name][is_required] = $options['name']\n\t}\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][invalid] = $options['name']\n\t}\n*/\n\t//$this->fields[$field_name][error] ???\n\n}", "public function init()\n {\n parent::init();\n\n //customize the form\n $this->getElement('passwd')->setRequired(false);\n $this->getElement('passwdVerify')->setRequired(false);\n $this->getElement('submit')->setLabel('Save User');\n }", "abstract protected function getDefaultViewForm();", "function ajb_options_init(){\n\tregister_setting( 'ajb_option_group', 'ajb_options', 'ajb_options_validate' );\n}", "function ttp_form_webform_client_form_4_alter(&$form, &$form_state, $form_id){\n $node = menu_get_object();\n //$form['submitted']['info']['#access'] = false;\n if ($node){\n $form['submitted']['info']['#default_value'] = $node->title;\n } else {\n $form['submitted']['info']['#default_value'] = 'Home page';\n }\n}", "protected function get_options()\n\t{}", "public function options() {}", "protected function _initDefaultOptions()\n {\n $this->_options[self::OPT_STOP_PROMPTING_ON_DTMF] = self::STOP_PROMPTING_ON_DTMF_DEFAULT;\n $this->_options[self::OPT_NO_INPUT_PROMPT_PLAYLIST] = array();\n $this->_options[self::OPT_END_READING_KEY] = Streamwide_Engine_Dtmf_Handler::KEY_POUND;\n $this->_options[self::OPT_RETURN_ALL_INPUT] = self::RETURN_ALL_INPUT_DEFAULT;\n $this->_options[self::OPT_TRIES] = self::DEFAULT_NUMBER_OF_TRIES;\n }", "private function setDefaultValues()\n {\n // Set default payment action.\n if (empty($this->paymentAction)) {\n $this->paymentAction = 'Sale';\n }\n\n // Set default locale.\n if (empty($this->locale)) {\n $this->locale = 'en_US';\n }\n\n // Set default value for SSL validation.\n if (empty($this->validateSSL)) {\n $this->validateSSL = false;\n }\n }", "function options_form() {\n return array(\n );\n }", "public static function get_default_options() {\n\t\treturn array(\n\t\t\t'mailgun' => array(\n\t\t\t\t'region' => 'us',\n\t\t\t\t'api_key' => '',\n\t\t\t\t'domain'=> '',\n\t\t\t),\n\t\t\t'double_opt_in' => '0',\n\t\t\t'use_honeypot' => '1',\n\t\t);\n\t}", "protected function setFormDefaults($filters) {\n $filters['date']['from'] = set_datepicker_date_format($filters['date']['from']);\n $filters['date']['to'] = set_datepicker_date_format($filters['date']['to']); \n $filters['entitlement'] = number_format($filters['entitlement'], 2);\n \n $this->form->setDefaults($filters);\n }", "function post_comments_form_block_form_defaults($fields)\n {\n }", "function options_form(&$form, &$form_state) {\r\n // It is very important to call the parent function here:\r\n parent::options_form($form, $form_state);\r\n\r\n switch ($form_state['section']) {\r\n // Only add if section is allow because this is called for all sections for some reason.\r\n case 'allow':\r\n // Add allow option to the form.\r\n $form['allow']['#options']['expose_imagestyle'] = t('Expose imagestyle settings');\r\n break;\r\n }\r\n }", "public function init()\n\t\t{\n\t\t\t$this->SetHelpText(GetLang('EmailChangeHelpText'));\n\t\t\t$this->ShowSaveAndCancelButtons(false);\n\t\t}", "function optionsframework_options() {\n\n\t$options = array();\n\n\t$options[] = array( \"name\" => \"Variables\",\n\t\t\"type\" => \"heading\" );\n\n\t$options[\"icon\"] = array(\n\t\t\"name\" => \"Fontawesome Icon\",\n\t\t\"id\" => \"icon\",\n\t\t\"std\" => \"fa-cogs\",\n\t\t\"type\" => \"text\");\n\n\t$options[\"claim\"] = array(\n\t\t\"name\" => \"Claim\",\n\t\t\"id\" => \"claim\",\n\t\t\"std\" => \"Sorry, we are down for scheduled maintenance. Come back soon!\",\n\t\t\"type\" => \"text\");\n\n\treturn $options;\n}", "public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}", "protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}", "function option_definition() {\n $options = parent::option_definition();\n $options['year_range'] = array('default' => '-3:+3');\n $options['granularity'] = array('default' => 'month');\n $options['default_argument_type']['default'] = 'date';\n $options['add_delta'] = array('default' => '');\n $options['use_fromto'] = array('default' => '');\n $options['title_format'] = array('default' => '');\n $options['title_format_custom'] = array('default' => '');\n return $options;\n }", "function tweet_comment_comment_form_defaults( $defaults ) {\n\treturn $defaults;\t\n}", "function form_options($options) {\n }", "public function options()\n {\n $options = apply_filters(\n $this->id . '_option_fields',\n [\n 'id' => $this->id, // upstream_milestones\n 'title' => $this->title,\n 'menu_title' => $this->menu_title,\n 'desc' => $this->description,\n 'show_on' => ['key' => 'options-page', 'value' => [$this->id],],\n 'show_names' => true,\n 'fields' => [\n [\n 'name' => upstream_milestone_label_plural(),\n 'id' => 'milestone_title',\n 'type' => 'title',\n ],\n [\n 'name' => 'Milestone Categories',\n 'id' => 'enable_milestone_categories',\n 'type' => 'radio',\n 'description' => '',\n 'options' => [\n '1' => __('Enabled', 'upstream'),\n '0' => __('Disabled', 'upstream'),\n ],\n 'default' => '0',\n ],\n ],\n ]\n );\n\n return $options;\n }", "protected function initOptions()\n {\n Html::addCssClass($this->options, 'uk-alert uk-alert-'.$this->type);\n $this->options['uk-alert'] = true;\n }", "protected function assignDefaults() {\n\t\t$this->view->assignMultiple(\n\t\t\tarray(\n\t\t\t\t'timestamp'\t\t\t=> time(),\n\t\t\t\t'submission_date'\t=> date('d.m.Y H:i:s', time()),\n\t\t\t\t'randomId'\t\t\t=> Tx_Formhandler_Globals::$randomID,\n\t\t\t\t'fieldNamePrefix'\t=> Tx_Formhandler_Globals::$formValuesPrefix,\n\t\t\t\t'ip'\t\t\t\t=> t3lib_div::getIndpEnv('REMOTE_ADDR'),\n\t\t\t\t'pid'\t\t\t\t=> $GLOBALS['TSFE']->id,\n\t\t\t\t'currentStep'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('currentStep'),\n\t\t\t\t'totalSteps'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('totalSteps'),\n\t\t\t\t'lastStep'\t\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('lastStep'),\n\t\t\t\t// f:url(absolute:1) does not work correct :(\n\t\t\t\t'baseUrl'\t\t\t=> t3lib_div::locationHeaderUrl('')\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->gp['generated_authCode']) {\n\t\t\t$this->view->assign('authCode', $this->gp['generated_authCode']);\n\t\t}\n\t\t\n\t\t/*\n\t\tStepbar currently removed - probably this should move in a partial\n\t\t$markers['###step_bar###'] = $this->createStepBar(\n\t\t\tTx_FormhandlerFluid_Session::get('currentStep'),\n\t\t\tTx_FormhandlerFluid_Session::get('totalSteps'),\n\t\t\t$prevName,\n\t\t\t$nextName\n\t\t);\n\t\t*/\n\t\t\n\t\t/*\n\t\tNot yet realized\n\t\t$this->fillCaptchaMarkers($markers);\n\t\t$this->fillFEUserMarkers($markers);\n\t\t$this->fillFileMarkers($markers);\n\t\t*/\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "function options(&$options) {\r\n parent::options($options);\r\n $options['date_fields'] = array();\r\n $options['year_range'] = '-3:+3';\r\n $options['date_method'] = 'OR';\r\n $options['granularity'] = 'month';\r\n }", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "function options_form(&$form, &$form_state) {\n $form['link_to_record'] = array(\n '#title' => t('Link this field to the record edit form'),\n '#description' => t(\"Enable to override this field's links.\"),\n '#type' => 'checkbox',\n '#default_value' => !empty($this->options['link_to_record']),\n );\n\n parent::options_form($form, $form_state);\n \n \n }", "function quasar_alter_default_comment_form($defaults){\n\t$fields = array('author' => '<div class=\"large-4 columns\"><input name=\"author\" id=\"author\" class=\"comments-field inputs-class\" title=\"'.__('Name :','quasar').'\" type=\"text\" value=\"'.__('Name :','quasar').'\"></div>',\n\t\t\t\t\t'email' => '<div class=\"large-4 columns\"><input name=\"email\" id=\"email\" class=\"comments-field inputs-class\" style=\"margin-right:0px;\" title=\"'.__('Email :','quasar').'\" type=\"text\" value=\"'.__('Email :','quasar').'\"></div>',\n\t\t\t\t\t'url' => '<div class=\"large-4 columns\"><input name=\"url\" id=\"url\" class=\"comments-field inputs-class\" title=\"'.__('Website :','quasar').'\" type=\"text\" value=\"'.__('Website :','quasar').'\"></div>');\n\t\n\t$defaults['fields'] = apply_filters( 'comment_form_default_fields', $fields );\n\t$defaults['title_reply'] = '<div class=\"leave-a-comment large-12 columns\">'.__('Leave a Comment','quasar').'</div>';\n $defaults['comment_notes_before'] = '';\n $defaults['comment_notes_after'] = '';\n\t$defaults['comment_field'] = '<div class=\"large-12 columns\"><textarea class=\"comments-field inputs-class\" title=\"'.__('Your Message :','quasar').'\" name=\"comment\" id=\"comment\" cols=\"45\" rows=\"45\">'.__('Your Message :','quasar').'</textarea></div>';\n\t$defaults['id_submit'] = 'comments-submit';\n\n return $defaults;\n\t//apply_filters( 'comment_form_defaults', $defaults );\n}", "function getSetupForm($options = array()){\n $form = parent::getSetupForm($options);\n $form->setLegend('Category Options');\n \n $set = $form->createElement('select', 'set');\n $set->setLabel('Set: ');\n $set->setRequired('true');\n \n $service = new Content_Model_CategorySet_Service();\n $results = $service->getObjects();\n\n $options = array();\n foreach($results as $value){\n $options[$value->id] = $value->title;\n }\n\n //$template->addMultiOption('None','');\n $set->setMultiOptions($options);\n $form->addElement($set);\n \n return $form;\n }", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}", "public static function optionsframework_before_action() {\n\t\t\t?>\n <style type=\"text/css\">\n #optionsframework-submit .reset-button {\n display: none;\n }\n </style>\n\t\t\t<?php\n\t\t}", "abstract public function setOptions($options = array());", "function container_ctools_content_types_container_template_edit_form_submit($form, &$form_state) {\n $defaults = array();\n if (isset($form_state['subtype']['defaults'])) {\n $defaults = $form_state['subtype']['defaults'];\n }\n elseif (isset($form_state['plugin']['defaults'])) {\n $defaults = $form_state['plugin']['defaults'];\n }\n\n foreach (array_keys($defaults) as $key) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n}", "function _webform_defaults_email() {\r\n return array(\r\n 'name' => '',\r\n 'form_key' => NULL,\r\n 'pid' => 0,\r\n 'weight' => 0,\r\n 'value' => '',\r\n 'mandatory' => 0,\r\n 'email' => 1,\r\n 'extra' => array(\r\n 'width' => '',\r\n 'disabled' => 0,\r\n 'email' => 0,\r\n 'description' => '',\r\n 'attributes' => array(),\r\n ),\r\n );\r\n}", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "function tb_default_options() {\n $defaults = array (\n 'banner_id' => '',\n 'banner_link' => '',\n 'city' => ''\n );\n return apply_filters( \"tb_default_options\", $defaults );\n}" ]
[ "0.6591192", "0.6453835", "0.64151466", "0.6386499", "0.63676673", "0.6216274", "0.6118875", "0.6118875", "0.6100952", "0.6039187", "0.59988433", "0.5967271", "0.59633404", "0.59508145", "0.5940756", "0.58974445", "0.58774924", "0.5872588", "0.58297807", "0.5814943", "0.58077884", "0.5768871", "0.57629997", "0.5762433", "0.5758835", "0.5754834", "0.57412165", "0.5733103", "0.57325983", "0.57251656", "0.572456", "0.5723467", "0.5717388", "0.57160515", "0.57132906", "0.5712606", "0.57117444", "0.5709512", "0.570803", "0.57014364", "0.56990373", "0.569847", "0.56963843", "0.569578", "0.567945", "0.56776035", "0.56762433", "0.5665298", "0.5664973", "0.5664962", "0.56607884", "0.5652859", "0.5636056", "0.56318283", "0.56299555", "0.562564", "0.5617732", "0.56130534", "0.56007236", "0.55989647", "0.5591731", "0.55865926", "0.55749923", "0.55656606", "0.55651975", "0.556407", "0.5562972", "0.5562406", "0.5557702", "0.5552031", "0.5548367", "0.55437636", "0.55413985", "0.55338234", "0.55301857", "0.5524471", "0.55219483", "0.5514747", "0.55089986", "0.5508358", "0.54977524", "0.54923457", "0.5491221", "0.549112", "0.54899555", "0.5484379", "0.54785275", "0.5474976", "0.54728645", "0.5463561", "0.5460058", "0.545622", "0.54488224", "0.54477215", "0.5446767", "0.5440151", "0.5434848", "0.54326177", "0.54305834", "0.54289126", "0.5420922" ]
0.0
-1
Function which returns the IssueForm alias
public function getName() { return 'vlad_bugtracker_issue'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormName(){\n return $this->form_name ?? 'form';\n }", "abstract protected function getFormName();", "public function getFormName();", "public function getFormName();", "protected function getFormObjectName() {}", "public function getFormName()\n {\n return $this->getModelSimpleName() .'Form';\n }", "public function FormName()\n {\n return $this->getTemplateHelper()->generateFormID($this);\n }", "final public function getFormName(): string\n {\n\n return str_replace('.', '__', $this->getName());\n }", "protected function getNameFormFileIn()\n {\n $formName = str_replace(' ', '', ucwords(str_replace('-', ' ', $this->owner->id)));\n return \"Form\" . $formName . ucfirst($this->owner->action->actionMethod) . 'In';\n }", "protected function getForm( $html=false ) { return $this->form_name; }", "public function getFormId() {\n return 'ever_form';\n }", "function _getFullName() {\n\t\treturn \"document.{$this->form_name}.elements['{$this->field_name}']\";\n\t}", "abstract protected function getFormType(): string;", "public function getManageFormTypeName()\n {\n return 'default';\n }", "public static function form(){\n\t\treturn \"\";\n\t}", "public function getIssuePrefix() : string;", "public function getInteractionFormName()\n {\n return self::INTERACTION_FORM_NAME;\n }", "public function FormAction()\n {\n return Controller::join_links($this->_widgetEditor->Link('field'), str_replace('\\\\', '_', $this->_widget->ClassName), '');\n }", "protected function get_form_identifier() {\n\n $formid = $this->_customdata->id.'_'.get_class($this);\n return $formid;\n }", "abstract public function getFormDesc();", "public function getName() {\n return 'form';\n }", "public function getEditForm();", "public function FormName()\n {\n return ($this->_widgetEditor->getForm() ? $this->_widgetEditor->getForm()->FormName() : false);\n }", "public function getFormId()\n {\n return 'lei_entity_type_settings';\n }", "protected function getNameFormFileOut()\n {\n return \"Form\" . ucfirst($this->owner->id) . ucfirst($this->owner->action->actionMethod) . 'Out';\n }", "public function getName()\n {\n return 'form';\n }", "abstract protected function getForm();", "function get_form_type()\n {\n return is_array($this->object->context) ? $this->object->context[0] : $this->object->context;\n }", "public function getFormId() {\n return 'tfa_settings_reset_form';\n }", "abstract function getForm();", "public function getCurrentStructureFormPrefix() {}", "public function formItem(): HtmlString\n {\n return $this->formItem;\n }", "public function getFormEntry()\n {\n return $this->form->getEntry();\n }", "public function getFormId() {\n return 'form_task32';\n }", "public function getFieldContext(): string\n {\n return 'simple-forms';\n }", "public function getFormAction() { return $this->_formAction; }", "public static function getForm();", "function getFormJsObjectName() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getJsObjectName( );\n\t\t\t}\n\n\t\t}", "public function getFieldContext()\n\t{\n\t\treturn 'sproutForms:'.$this->id;\n\t}", "function fyc_project_menu_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "public function getForm();", "public function form(){\n\t\treturn $this->form;\n\t}", "function getFormHtmlIdPrefix() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getFormHtmlIdPrefix( );\n\t\t\t}\n\n\t\t}", "public function getFormPrefix() {}", "public function getFormAction()\n {\n return $this->getUrl('faq/index/email');\n }", "public function getFormId()\n {\n return 'partner_referral_form';\n }", "function existingQueryForm () { return \"\"; }", "public function getFormId() {\n return 'alexandrie_config_form';\n }", "function getForm()\n {\n return $this->getAttribute(\"form\");\n }", "public function getFormId()\n {\n return $this->formId;\n }", "function um_add_form_identifier( $args ) {\r\n\t?>\r\n\t\t<input type=\"hidden\" name=\"form_id\" id=\"form_id_<?php echo $args['form_id']; ?>\" value=\"<?php echo $args['form_id']; ?>\" />\r\n\t<?php\r\n}", "public function getFormId() {\n return 'cohesion_elements_settings_form';\n }", "public function getFormSelector()\n {\n return '#form-' . $this->formId;\n }", "public function getFormId() {\n return 'session_email_admin';\n }", "function elife_article_jumpto_edit($form, &$form_state) {\n return $form;\n}", "function getInputElement($alias,$label)\n {\n return new T_Form_Text($alias,$label);\n }", "function elife_article_markup_doi_edit($form, &$form_state) {\n return $form;\n}", "public function getFormKey()\n {\n return $this->formKey->getFormKey();\n }", "private function key() {\n return sprintf('form_%s_%d', $this->module->name, $this->module->id);\n }", "public function FormAction()\n {\n if ($this->formActionPath) {\n return $this->formActionPath;\n }\n\n // Get action from request handler link\n return $this->getRequestHandler()->Link();\n }", "public function getPasswordResetForm();", "public function aliasField(string $field): string;", "public function getFormType();", "function getFormHtmlId() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getHtmlId( );\n\t\t\t}\n\n\t\t}", "function getCaptchaFieldName()\n\t{\t\t\n\t\treturn $this->pSet->captchaEditFieldName();\n\t}", "function getFormTarget()\n {\n return $this->getAttribute(\"formtarget\");\n }", "function getForm() {\n return $this->form;\n }", "public function getLegalForm(): ?string;", "public function getForm() {\n return $this->form;\n }", "public function getFormId() {\n return 'FedoraResource_settings';\n }", "public function getFormId() {\n return 'my_database.report_delete';\n }", "public function settingsForm()\n {\n return 'forecastio-form-settings';\n }", "public function getFormTemplate(): string\n {\n return static::FORM_TEMPLATE;\n }", "function getFormAction()\n {\n return $this->getAttribute(\"formaction\");\n }", "public function getFormId()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->tag));\n\t}", "public function getForm(): string\n {\n return $this->html;\n }", "protected function getFormTool()\n {\n return $this->mod->getFormTool();\n }", "public function editForm() {\n return tpl::load(__DIR__ . DS . 'form.php', array('field' => $this));\n }", "public function getName()\r\n {\r\n return 'context_form';\r\n }", "public function issue()\n {\n return Issue::i();\n }", "public function form($form = null);", "function getFormType()\n {\n return $this->formType;\n }", "public function getIssueOfComponent() {\n return $this->issueOfComponent;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getUserDefinedForm()\n {\n if ($userFormsController = $this->getUserFormController()) {\n return $userFormsController->Form();\n }\n\n return null;\n }", "public function getAlias(): string;", "public function viewForm($issue)\n {\n $article = ArticlesList::where('issue', '=', $issue)->get();\n foreach ($article as $key => $value) {\n $articleCount = $value['articleNo'];\n }\n if (isset($article[0])) {\n return View::make('uploadArticle')\n ->with('title', 'Add Article')\n ->with('articleNo', $articleCount + 1)\n ->with('issue', $issue);\n } else {\n return View::make('uploadArticle')\n ->with('title', 'Add Article')\n ->with('articleNo', 1)\n ->with('issue', $issue);\n }\n }", "public abstract function getProjectFieldName();", "public function preferenceForm()\r\n\t{\r\n\t\treturn null;\r\n\t}", "public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}", "function issues_prepare_form_vars($issue = null, \n $item_guid = 0, \n $referrer = null, \n $description = null) {\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'start_date' => '',\n\t\t'end_date' => '',\n\t\t'issue_type' => '',\n\t\t'issue_number' => '',\n\t\t'status' => '',\n\t\t'assigned_to' => '',\n\t\t'percent_done' => '',\n\t\t'work_remaining' => '',\n\t\t'aspect' => 'issue',\n 'referrer' => $referrer,\n 'description' => $description,\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'write_access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $issue,\n\t\t'item_guid' => $item_guid,\n\t);\n\n\tif ($issue) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($issue->$field)) {\n\t\t\t\t$values[$field] = $issue->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('jot')) {\n\t\t$sticky_values = elgg_get_sticky_values('jot');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n//\telgg_clear_sticky_form('jot');\n\n\treturn $values;\n}", "public function getFormId()\n {\n return 'pubcid_cookie_management_settings';\n }", "protected function form()\n {\n return new Form(new Attention);\n }", "public function alias ()\n {\n return $this->_alias;\n }", "public function getOrderForm()\n {\n return $this->order_form;\n }", "function getSearchType()\n {\n return 'issues';\n }", "abstract public function getForm() : void;", "abstract function builder_form(): string;", "public function getName()\n {\n return \"event_form\";\n }" ]
[ "0.6184945", "0.6118085", "0.60495746", "0.60495746", "0.5984015", "0.59559107", "0.59304726", "0.5803831", "0.5732726", "0.5708038", "0.5674893", "0.56666183", "0.56559473", "0.56542134", "0.56462574", "0.5578487", "0.5567472", "0.5565864", "0.554948", "0.5547062", "0.55127686", "0.5506894", "0.5500193", "0.5493677", "0.54805046", "0.5469751", "0.54655725", "0.5459891", "0.54565996", "0.54418147", "0.54336196", "0.54249495", "0.54216504", "0.54196596", "0.54132634", "0.54126805", "0.53984594", "0.53837395", "0.53739977", "0.53695387", "0.5358483", "0.5348659", "0.5347332", "0.53389806", "0.5334451", "0.5309258", "0.5303338", "0.52938676", "0.5291087", "0.52808565", "0.5267799", "0.52669543", "0.5264179", "0.5261311", "0.52536803", "0.5249732", "0.52472484", "0.5245438", "0.52398825", "0.5229653", "0.5228562", "0.52188027", "0.52166927", "0.52154964", "0.52137125", "0.52012897", "0.51996756", "0.5199039", "0.5198287", "0.5198017", "0.5192122", "0.519081", "0.5182198", "0.51622874", "0.5155438", "0.5149829", "0.51492685", "0.5148348", "0.51455754", "0.5142325", "0.51410586", "0.5139604", "0.51160425", "0.5106856", "0.5106856", "0.51006156", "0.50970197", "0.5096689", "0.5095933", "0.5087162", "0.5084011", "0.5080561", "0.5076685", "0.50736624", "0.5073557", "0.5072891", "0.5072655", "0.5071489", "0.5053278", "0.5039485" ]
0.5286314
49
Handle the incoming request.
public function home(Request $request) { $users = DB::table('users')->get(); return view("admin/home", ["users" => $users]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest() {}", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "function handleRequest() ;", "abstract public function handleRequest(Request $request);", "abstract public function handleRequest($request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "protected function handle(Request $request) {}", "public function handle($request);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function processRequest();", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "public function handle(Request $request);", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "abstract public function processRequest();", "public abstract function processRequest();", "abstract protected function process(Request $request);", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public static function process_http_request()\n {\n }", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest(Request $request, Response $response);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function handle(array $request);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle(ServerRequestInterface $request);", "public function serve_request()\n {\n }", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "abstract function handle(Request $request, $parameters);", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function handle(Request $request): Response;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function handle(array $request = []);", "function handle(Request $request = null, Response $response = null);", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "public function runRequest() {\n }", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function listen() {\n\t\t$requestType = $this->getRequestType();\n\t\t$prefix = '';\n\t\t$params = array();\n\t\tswitch ($requestType) {\n\t\t\tcase 'GET':\n\t\t\t\t$prefix = 'get';\n\t\t\t\t$params = $_GET;\n\t\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\t\t\t\t$prefix = 'post';\n\t\t\t\t$params = $_POST;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PUT':\n\t\t\t\t$prefix = 'put';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\n\t\t\tcase 'DELETE':\n\t\t\t\t$prefix = 'delete';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new CHttpException(400, 'Invalid request');\n\t\t}\n\n\t\ttry {\n\t\t\t$paramsSet = $this->getActionParamsSet($params['cmd']);\n\t\t\tif ($this->validateRequestParams($params, $paramsSet)) {\n\t\t\t\t$accessTokenModel = $this->getAccessTokenModel();\n\t\t\t\t$method = $prefix . $params['cmd'];\n\t\t\t\tif (method_exists($this, $method)) {\n\t\t\t\t\tif ($this->accessRules()) {\n\t\t\t\t\t\t$this->_appAccessControlFilter->checkFiler($this->getApplicationModel(), $method);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->prolongAccessTokenLifeTime) {\n\t\t\t\t\t\t$this->prolongAccessTokenLifeTime($accessTokenModel);\n\t\t\t\t\t}\n\n\t\t\t\t\t$result = call_user_func(array($this, $method), $params);\n\n\t\t\t\t\treturn $this->composeResult($result, 200);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new CHttpException(400, 'Unknown command');\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (CHttpException $exc) {\n\t\t\treturn $this->composeResult(null, $exc->statusCode, $exc->getMessage());\n\t\t}\n\t\tcatch (CException $exc) {\n\t\t\treturn $this->composeResult(null, 500, $exc->getMessage());\n\t\t}\n\t}", "final public function handle() : void\n {\n $method = strtolower($this->context->web()->method());\n $res = (object) [\n 'rest' => $this->context->rest(),\n 'method' => $method,\n 'data' => $this->context->formdata($method == 'patch' ? 'put' : $method)->fetchRaw(),\n ];\n $this->context->web()->sendJSON($res);\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }", "public function DispatchRequest ();", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function handler() {\n\t\t$type = Router::verify_type();\n\n\t\tswitch ( $type ) {\n\t\t\tcase self::TYPE_REFRESH_MAP:\n\t\t\t\t$this->cls( 'Crawler_Map' )->gen();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->empty_map();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_empty();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_DEL:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_del( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_ADD:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_add( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Handle the ajax request to proceed crawler manually by admin\n\t\t\tcase self::TYPE_START:\n\t\t\t\tself::start( true );\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_RESET:\n\t\t\t\t$this->reset_pos();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tAdmin::redirect();\n\t}", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function request();", "function handle_request() {\n global $subrosa_config, $cfg, $mt;\n // Initialize SubRosa and handle request\n $subrosa_config = init_subrosa_config();\n\n require_once( 'SubRosa/DebuggingEnv.php' );\n $senv = new SubRosa_DebuggingEnv();\n\n $cfg =& $subrosa_config;\n require_once( $cfg['subrosa_path'] );\n\n apache_setenv('SUBROSA_EVALUATED', 1);\n apache_note('SUBROSA_EVALUATED', '1');\n $_SERVER['SUBROSA_EVALUATED'] = 1;\n $_SESSION['SUBROSA_EVALUATED'] = 1;\n\n $mt = new SubRosa( null, $_SERVER['SUBROSA_BLOG_ID'] );\n if (isset($_GET['debug'])) $mt->debugging = true;\n $mt->bootstrap();\n}", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "public function handle($request, $next);", "public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n }\n\n disconnectFromDB();\n }\n }", "public function handle() {}", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n } else if (array_key_exists('displayTuples', $_GET)) {\n\t\t handleDisplayRequest();\n\t\t} else if (array_key_exists('deleteTuple', $_GET)) {\n\t\t handleDeleteRequest();\n\t\t}\n\n disconnectFromDB();\n }\n }", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function run()\n {\n $post = file_get_contents($this->getInputFile());\n if (substr($post, 0, 5) == '<?xml') {\n //pingback\n $xs = xmlrpc_server_create();\n xmlrpc_server_register_method(\n $xs, 'pingback.ping', array($this, 'handlePingbackPing')\n );\n $out = xmlrpc_server_call_method($xs, $post, null);\n\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 200 OK');\n $resp->sendXml($out);\n\n } else if (isset($_POST['source']) && isset($_POST['target'])) {\n //webmention\n $res = $this->handleRequest($_POST['source'], $_POST['target']);\n $resp = $this->getWebmentionResponder();\n $resp->send($res);\n\n } else {\n //unknown\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 400 Bad Request');\n $resp->sendHeader('Content-Type: text/html');\n $resp->sendOutput($this->unknownRequest);\n }\n }", "function onRequest(){\n\n\t// check if we need to reload the application\n\tcheckApplicationState();\n\n\t// initialize the ViewSate for every request\n\tsetViewState( getFactory()->getBean( 'ViewState' ) );\n\n\t// decide what to do, the front controller\n\thandleAction();\n\n\t// render the application\n\trenderApplication();\n}", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }", "protected function handleGET() {\n /* ... Do the stuff ... */\n\n return $this->render('default.html', array());\n }" ]
[ "0.81443435", "0.80565155", "0.8054052", "0.8054052", "0.8054052", "0.8012054", "0.76565933", "0.7453767", "0.7427182", "0.74211967", "0.73596436", "0.7341611", "0.7303668", "0.72207993", "0.71966445", "0.71955097", "0.71865135", "0.71590275", "0.7092262", "0.7065288", "0.7045881", "0.7045278", "0.7036542", "0.70256114", "0.6975252", "0.68973315", "0.6868569", "0.6863603", "0.68358356", "0.6784327", "0.67840457", "0.67543256", "0.67304766", "0.6724813", "0.6715296", "0.670899", "0.66867405", "0.66831625", "0.6657759", "0.6627255", "0.66260797", "0.6602456", "0.65990335", "0.6583801", "0.6576244", "0.65641546", "0.65635693", "0.65503633", "0.65183526", "0.6509255", "0.6501781", "0.64996064", "0.64884627", "0.645482", "0.6446267", "0.64323944", "0.6419897", "0.64137155", "0.6398115", "0.63862145", "0.63509065", "0.6330968", "0.6321741", "0.632154", "0.63173103", "0.6306707", "0.6304785", "0.62610155", "0.6245076", "0.6226863", "0.62268484", "0.62240636", "0.6201359", "0.61768043", "0.6157829", "0.61539936", "0.6126824", "0.6126824", "0.6126824", "0.6115132", "0.6114553", "0.61085683", "0.6094312", "0.6086701", "0.60811746", "0.6080727", "0.60746986", "0.6071301", "0.6067646", "0.60660446", "0.6065167", "0.6064856", "0.6060916", "0.6053187", "0.6035924", "0.602004", "0.6015193", "0.60114783", "0.6009538", "0.60087067", "0.6006069" ]
0.0
-1
Display a listing of the resource.
public function index() { $articles = Article::all(); $articles = Article::orderBy('created_at', 'desc')->paginate(9); return view('articles.index', [ 'articles' => $articles, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('articles.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(ArticleRequest $request) { // if ( isset ( $request file('image') ) ){ // $request->file('image')->isValid()) // } $data = $request->all(); if ($logo = $request->file('image')) { $image_name = $logo->getRealPath(); // Cloudinaryへアップロード Cloudder::upload($image_name, null); // 直前にアップロードした画像のユニークIDを取得します。 $publicId = Cloudder::getPublicId(); // URLを生成します $logoUrl = Cloudder::show($publicId, [ 'width' => 500, 'height' => 500 ]); } $article = new Article; $auth_id = Auth::id(); $article->user_id = $auth_id; $article->title = $request->title; $article->image = $logoUrl; $article->img_article = $request->img_article; $article->movie_link = $request->movie_link; $article->movie_link2 = $request->movie_link2; $article->movie_link3 = $request->movie_link3; $article->movie_link4 = $request->movie_link4; $article->movie_link5 = $request->movie_link5; $article->movie_link6 = $request->movie_link6; $article->movie_link7 = $request->movie_link7; $article->movie_link8 = $request->movie_link8; $article->movie_link9 = $request->movie_link9; $article->movie_link10 = $request->movie_link10; $article->comment = $request->comment; $article->method = $request->method; $article->phrase = $request->phrase; $article->goal = $request->goal; // if( $request->file('image')){ // $filename = $request->file('image')->store('public/image'); // $article->image = basename($filename); // } $article->save(); return redirect('articles')->with('message', '記事を追加しました。'); //return redirect()->route('articles.index', ['id' => $request->article_id]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\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()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show($id) { $article = Article::findOrFail($id); $article->load('user', 'comments.user'); return view('articles.show', compact('article')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\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->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\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 viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $article = Article::find($id); return view('articles.edit', compact('article')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(ArticleRequest $request, $id) { $data = $request->all(); if ($image = $request->file('image')) { $image_pass = $image->getRealPath(); // Cloudinaryへアップロード Cloudder::upload($image_pass, null); list($width, $height) = getimagesize($image_pass); // 直前にアップロードした画像のユニークIDを取得します。 $image_id = Cloudder::getPublicId(); // URLを生成します $imageUrl = Cloudder::show($image_id, [ 'width' => $width, 'height' => $height ]); } $article = Article::findOrFail($id); $auth_id = Auth::id(); $article->user_id = $auth_id; $article->title = $request->title; $article->image = $imageUrl; $article->img_article = $request->img_article; $article->movie_link = $request->movie_link; $article->movie_link2 = $request->movie_link2; $article->movie_link3 = $request->movie_link3; $article->movie_link4 = $request->movie_link4; $article->movie_link5 = $request->movie_link5; $article->movie_link6 = $request->movie_link6; $article->movie_link7 = $request->movie_link7; $article->movie_link8 = $request->movie_link8; $article->movie_link9 = $request->movie_link9; $article->movie_link10 = $request->movie_link10; $article->comment = $request->comment; $article->method = $request->method; $article->phrase = $request->phrase; $article->goal = $request->goal; $article->save(); // $article->update($request->validated()); // dd($article); return redirect()->route('articles.index'); // $rules = [ // 'title' => 'required', // 'method'=> 'required', // 'phrase' => 'required', // 'goal'=> 'required', // ]; // $validated = $this->validate($request, $rules); // Article::create($validated); // return redirect('articles')>with('message', '編集しました。'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $article = Article::findOrFail($id); $article->delete(); return redirect('articles')->with('message', '記事を削除しました。'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
/ Composr Copyright (c) ocProducts, 20042016 See text/EN/licence.txt for full licencing information. NOTE TO PROGRAMMERS: Do not edit this file. If you need to make changes, save your changed file to the appropriate _custom folder If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes
function init__hooks__modules__admin_import__smf() { global $TOPIC_FORUM_CACHE; $TOPIC_FORUM_CACHE = array(); global $STRICT_FILE; $STRICT_FILE = false; // Disable this for a quicker import that is quite liable to go wrong if you don't have the files in the right place }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modify_left_copyright() {\n \t ?><p>© <?php echo date('Y'); ?> AI Scripts <a href=\"<?php echo admin_url();?>\" title=\"Login to the backend of WordPress.\" />Login.</a></p>\n \t<?php\n }", "function ms_deprecated_blogs_file()\n {\n }", "function cl_version_in_header() {\n echo '<meta name=\"generator\" content=\"Custom Login v' . CUSTOM_LOGIN_VERSION . '\" />' . \"\\n\";\n }", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "function ms_deprecated_blogs_file() {}", "function intromvc()\n {\n $data['$option'] = \"doc/intromvc\";\n $this->loadContent('doc/home', $data);\n }", "function maxDoc_inc_custom_inc(){\n\n\t/**\n\t * Place your custom functions below so you can upgrade common_inc.php without trashing\n\t * your custom functions.\n\t *\n\t * An example function is commented out below as a documentation example\n\t *\n\t * View common_inc.php for many more examples of documentation and starting\n\t * points for building your own functions!\n\t */\n}", "function webbusiness_save_custom_css() {\n\tdelete_transient('webbusiness_custom_css');\n\twebbusiness_cache_custom_css();\n\tset_theme_mod('save-custom-css', time() + 3);\n}", "function main()\t{\n\n\t\t$content = '';\n\n\t\t$content .= '<br /><b>Change table tx_realurl_redirects:</b><br />\n\t\tRemove the field url_hash from the table tx_realurl_redirects, <br />because it\\'s not needed anymore and it\\'s replaced by the standard TCA field uid as soon as you do <br />the DB updates by the extension manager in the main view of this extension.<br /><br />ALTER TABLE tx_realurl_redirects DROP url_hash<br />ALTER TABLE tx_realurl_redirects ADD uid int(11) auto_increment PRIMARY KEY';\n\t\t\n\t\t$import = t3lib_div::_GP('update');\n\n\t\tif ($import == 'Update') {\n\t\t\t$result = $this->updateRedirectsTable();\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<p>Result: '.$result.'</p>';\n\t\t\t$content2 .= '<p>Done. Please accept the update suggestions of the extension manager now!</p>';\n\t\t} else {\n\t\t\t$content2 = '</form>';\n\t\t\t$content2 .= '<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">';\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<input type=\"submit\" name=\"update\" value=\"Update\" />';\n\t\t\t$content2 .= '</form>';\n\t\t} \n\n\t\treturn $content.$content2;\n\t}", "function dw2_header_prive($flux) {\r\n\t\t$flux .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'._DIR_PLUGIN_DW2.'dw2_styles.css\" />'.\"\\n\";\r\n\t\t$flux .= '<script type=\"text/javascript\" src=\"'._DIR_PLUGIN_DW2.'dw2_back.js\"></script>'.\"\\n\";\r\n\t\treturn $flux;\r\n\t}", "function update_file() {\r\n\t\tset_transient( 'av5_css_file', true );\r\n\t}", "function uds_pricing_admin(){include 'pricing-admin.php';}", "function removelinks(){\n\n Vtiger_Link::deleteLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\t}", "function sportal_credits()\n{\n\tglobal $sourcedir, $context, $txt;\n\n\trequire_once($sourcedir . '/PortalAdminMain.php');\n\tloadLanguage('SPortalAdmin', sp_languageSelect('SPortalAdmin'));\n\n\tsportal_information(false);\n\n\t$context['page_title'] = $txt['sp-info_title'];\n\t$context['sub_template'] = 'information';\n}", "function dcs_dropship_admin_page()\r\n{\r\n\tinclude( 'dcs-dropship-admin.php' );\r\n}", "function acf_upgrade_500()\n{\n}", "function spreadshop_checkout()\n{\ninclude(plugin_dir_path(__FILE__).'/checkout.php');\nadd_filter('wp_head', 'sources');\n}", "function of_admin_head() {\n\t\tdo_action( 'lcarsframework_custom_scripts' );\n\t}", "function upgrade_290()\n {\n }", "function ozh_yourls_gsb_admin_page() {\n include_once dirname( __FILE__ ) . '/includes/admin-page.php';\n ozh_yourls_gsb_display_page();\n}", "function sem_usaepay_admin_page()\r\n{\r\n\tinclude( 'sem-usaepay-admin.php' );\r\n}", "function head()\r\n{\r\n\t\t?>\r\n\t\t<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />\r\n\t\t<meta name=\"generator\" content=\"Adobe GoLive\" />\r\n\t\t<!--<meta name=\"keywords\" content=\"engagement rings, loose diamonds, hatton garden, diamond rings, earrings, wedding rings, diamonds, diamond rings hatton garden\"/>-->\r\n\t\t<meta name=\"author\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"language\" content=\"EN\"/>\r\n\t\t<meta name=\"Classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"copyright\" content=\"www.marcpierrediamonds.co.uk\"/>\r\n\t\t<meta name=\"robots\" content=\"index, follow\"/>\r\n\t\t<meta name=\"revisit-after\" content=\"7 days\"/>\r\n\t\t<meta name=\"document-classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"document-type\" content=\"Public\"/>\r\n\t\t<meta name=\"document-rating\" content=\"Safe for Kids\"/>\r\n\t\t<meta name=\"document-distribution\" content=\"Global\"/>\r\n\t\t<meta name=\"robots\" content=\"noodp\" />\r\n\t\t<meta name=\"GOOGLEBOT\" content=\"NOODP\" />\r\n\t\t<!--[if IE 6]>\r\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo DIR_WS_SITE?>css/iecss.css\" />\r\n\t\t<![endif]-->\r\n\t\t<!--[if lt IE 7.]>\r\n\t\t\t<script defer type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>javascript/pngfix.js\"></script>\r\n\t\t<![endif]-->\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>js/boxOver.js\"></script>\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>control/js/jquery-1.2.6.min.js\"></script>\r\n\t\t<link href=\"<?=DIR_WS_SITE_CSS?>style.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\">\r\n\t\t<?\r\n\t\t\r\n\t\t\r\n\t\t\r\n}", "function wp_start_scraping_edited_file_errors()\n {\n }", "private function includes() {\n\t\trequire_once( PRODUCT_LIST_DIR . 'classes/class-product_list.php' );\n\t\t//require_once( PRODUCT_LIST_DIR . 'classes/class-yc_admin_cursos-settings.php' );\n\t}", "function insert_tracking_code() {\n require( 'includes/C6_Page_Close_Tracking.php' );\n}", "public function include_files(){\r\n\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/helper-function.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.assest_management.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.widgets_control.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.my_account.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.wc-shortcode-products.php' );\r\n if( !empty( woolentor_get_option_pro( 'productcheckoutpage', 'woolentor_woo_template_tabs', '0' ) ) ){\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.checkout_page.php' );\r\n }\r\n\r\n // Admin Setting file\r\n if( is_admin() ){\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/licence/WooLentorPro.php' );\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/custom-metabox.php' );\r\n }\r\n\r\n // Builder File\r\n if( woolentor_get_option_pro( 'enablecustomlayout', 'woolentor_woo_template_tabs', 'on' ) == 'on' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/wl_woo_shop.php' );\r\n if( !is_admin() && woolentor_get_option_pro( 'enablerenamelabel', 'woolentor_rename_label_tabs', 'off' ) == 'on' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO.'includes/rename_label.php' );\r\n }\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.third_party.php' );\r\n }\r\n\r\n // Sale Notification\r\n if( woolentor_get_option_pro( 'enableresalenotification', 'woolentor_sales_notification_tabs', 'off' ) == 'on' ){\r\n if( woolentor_get_option_pro( 'notification_content_type', 'woolentor_sales_notification_tabs', 'actual' ) == 'fakes' ){\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO. 'includes/class.sale_notification_fake.php' );\r\n }else{\r\n include( WOOLENTOR_ADDONS_PL_PATH_PRO. 'includes/class.sale_notification.php' );\r\n }\r\n }\r\n \r\n // WooLentor Extension\r\n require( WOOLENTOR_ADDONS_PL_PATH_PRO.'classes/class.extension.php' );\r\n\r\n }", "function clientele_support_page() {\n require('clientele-support.php');\n }", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "function acf_upgrade_550()\n{\n}", "function cacheplugin_admin_menu_old() {\r\n \t\t\t echo '<h3><a href=\"#\">Cache Plugin</a></h3>\r\n \t\t\t\t <ul>\r\n \t\t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/conf.php') . '\">&raquo; ' . __('Settings', 'cacheplugin') . '</a></li>\r\n \t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/help.php') . '\">&raquo; ' . __('Help', 'cacheplugin') . '</a></li>\r\n \t\t\t </ul>';\r\n \t\t }", "function wpec_gold_cart_plugin_updater() {\n\t$license_key = 'b8cb6359b1d2544059586cdc58852860';\n\t// setup the updater\n\t$wpec_updater = new WPEC_Product_Licensing_Updater( 'http://dev.devsource.co', __FILE__, array(\n\t\t\t'version' \t=> '0.9', \t\t\t\t// current version number\n\t\t\t'license' \t=> $license_key, \t\t// license key (used get_option above to retrieve from DB)\n\t\t\t'item_id' \t=> 278 \t// Product ID as per the website\n\t\t)\n\t);\n}", "function addlinks(){\n Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\n\t}", "function convert_local_inc() {\n if(defined('TZR_IS5')) {\n msg('Not converting local.inc file');\n return;\n }\n msg('Converting local.inc file');\n \n // verification du / à la fin du home_root_url\n if(!eregi('(.*)/$',$GLOBALS['HOME_ROOT_URL'])) $GLOBALS['HOME_ROOT_URL'].='/';\n $txt='<?php'.\"\\n\";\n $txt.='// converted to release 5 with update script'.\"\\n\";\n $txt.='define(\"TZR_IS5\",1);'.\"\\n\";\n $txt.='$DATABASE_USER = \"'.$GLOBALS['DATABASE_USER'].'\";'.\"\\n\";\n $txt.='$DATABASE_PASSWORD = \"'.$GLOBALS['DATABASE_PASSWORD'].'\";'.\"\\n\";\n $txt.='$DATABASE_HOST = \"'.$GLOBALS['DATABASE_HOST'].'\";'.\"\\n\";\n $txt.='$DATABASE_NAME = \"'.$GLOBALS['DATABASE_NAME'].'\";'.\"\\n\";\n $txt.='$LANG_DATA = \"'.$GLOBALS['LANG_DATA'].'\";'.\"\\n\";\n $txt.='$LANG_USER = \"'.$GLOBALS['LANG_USER'].'\";'.\"\\n\";\n $txt.='$HOME = \"'.$GLOBALS['HOME'].'\";'.\"\\n\";\n $txt.='$LIBTHEZORRO = \"/home/tzr-master/tzr-4.6/\";'.\"\\n\";\n $txt.='$HOME_ROOT_URL = \"'.$GLOBALS['HOME_ROOT_URL'].'\";'.\"\\n\";\n $txt.='$SELF_PREFIX = \"\";'.\"\\n\";\n if($GLOBALS['START_CLASS']=='tzrgenericsite')\n $txt.='$START_CLASS = \\'Corail\\';'.\"\\n\";\n else\n $txt.='$START_CLASS = \"'.$GLOBALS['START_CLASS'].'\";'.\"\\n\";\n if($GLOBALS['LANG_DATA']=='FR') \n $txt.='$TZR_LANGUAGES=array(\"FR\"=>\"FR\");'.\"\\n\";\n else\n $txt.='$TZR_LANGUAGES=array(\"GB\"=>\"en\");'.\"\\n\";\n $txt.=\"session_cache_limiter('private, must-revalidate');\\n\";\n $txt.=\"?>\\n\";\n if($GLOBALS['_opt_backup']) copy($GLOBALS['_opt_config_inc'], $GLOBALS['backup'].'local.inc');\n $fp=fopen($GLOBALS['_opt_config_inc'],\"w\");\n fwrite($fp, $txt);\n fclose($fp);\n msg(\"Local file converted. Restart the procedure.\",0);\n die('');\n}", "public function hookbackOfficeHeader()\n\t{\n\t\tif (isset(Context::getContext()->controller) && $this->context->controller != null)\n\t\t\t$this->context->controller->addJS($this->_path.'js/clickline_order.js');\n\n//Ponemos el css para el admin\n\t\tif ((int) strcmp((version_compare(_PS_VERSION_, '1.5', '>=') ? Tools::getValue('configure') : Tools::getValue('module_name')), $this->name) == 0)\n\t\t{\n\n\t\t\tif (isset(Context::getContext()->controller) && $this->context->controller != null)\n\t\t\t{\n\t\t\t\t$this->context->controller->addCSS(_MODULE_DIR_.$this->name.'/css/admin.css');\n\t\t\t\t$this->context->controller->addJS(_MODULE_DIR_.$this->name.'/js/admin.js');\n\t\t\t}\n\t\t}\n\t}", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "function modifyThemeFooter() {\n?>\n<!-- W3TC-include-js-head -->\n<?php\n}", "function copyright()\n {\n return \"<table border=\\\"0\\\" width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"2\\\">\".\"\\n\".\n \"<tr><td><br class=\\\"h10\\\"/></td></tr>\".\"\\n\".\n \"<tr><td align=\\\"center\\\" class=\\\"ppfooter\\\">E-Commerce Engine Copyright &copy; 2000-2004 <a href=\\\"http://www.oscommerce.com\\\" class=\\\"copyright\\\" target=\\\"_blank\\\">osCommerce</a><br/>osCommerce provides no warranty and is redistributable under the <a href=\\\"http://www.fsf.org/licenses/gpl.txt\\\" class=\\\"copyright\\\" target=\\\"_blank\\\">GNU General Public License</a></td></tr>\".\"\\n\".\n \"<tr><td><br class=\\\"h10\\\"/></td></tr><tr><td align=\\\"center\\\" class=\\\"ppfooter\\\"><a href=\\\"http://www.oscommerce.com\\\" target=\\\"_blank\\\" class=\\\"poweredByButton\\\"><span class=\\\"poweredBy\\\">Powered By</span><span class=\\\"osCommerce\\\">\" . PROJECT_VERSION . \"</span></a></td></tr><tr><td><br class=\\\"h10\\\"/></td></tr></table>\";\n }", "function admin_head()\n {\n }", "function webbusiness_save_css() {\n\t$save_custom_css = get_theme_mod('save-custom-css');\n\tif (get_theme_mod('save-custom-css') != \"\" && get_theme_mod('save-custom-css') < time()) {\n\t\t$data = webbusiness_load_custom_css();\n\t\tremove_theme_mod('save-custom-css');\n\t\t\n\t\t// write to file\n\t\t$uploads = wp_upload_dir();\n\t\t$uploads_dir = trailingslashit($uploads[\"basedir\"]);\n\t\t$img_path = get_template_directory_uri();\n\t\t$data = str_replace(\"../img/\", $img_path . \"/img/\", $data);\n\t\t\n\t\tfile_put_contents($uploads_dir . \"webbusiness.css\", $data);\n\t\tdelete_transient('webbusiness_custom_css');\n\t}\n}", "function CK12()\n {\n global $template;\n global $id,$top_url;\n\n $val_item = array ( \"supply_code\"=>\"공급처 코드\" );\n $this->validate ( $val_item );\n\n // 상세 정보 가져온다\n $data = $this->get_detail( $id );\n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }", "function in_admin_header()\n {\n }", "function spreadshop_assortment()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortment.php');\nadd_filter('wp_head', 'sources');\n}", "function admin_footer () {\n\techo '<a href=\"http://www.drumcreative.com\" target=\"_blank\">&copy;' . date('Y') . ' Drum Creative</a>';\n}", "function _getLanguageFile()\n\t{\n\t\tglobal $_CB_framework;\n\t\t$UElanguagePath=$_CB_framework->getCfg('absolute_path').'/components/com_comprofiler/plugin/user/plug_cbjemmyattending';\n\t\tif (file_exists($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php')) {\n\t\t\tinclude_once($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php');\n\t\t} else {\n\t\t\tinclude_once($UElanguagePath.'/language/english.php');\n\t\t}\n\t}", "function copyright_headv1(){\r\n\r\nglobal $wpdb;\r\n\t$fivesdrafts = $wpdb->get_results(\"SELECT*FROM copyrightpro\");\r\n\r\n\tforeach ($fivesdrafts as $fivesdraft) {\r\n\t\t\t$result[0]=$fivesdraft->copy_click;\r\n\t\t\t$result[1]=$fivesdraft->copy_selection;\r\n\t}\r\n\t\r\nif ($result[0]==\"y\"){?>\r\n<script language=\"Javascript\">\r\n<!-- Begin\r\ndocument.oncontextmenu = function(){return false}\r\n// End -->\r\n</script>\r\n<?php }\r\n\r\nif ($result[1]==\"y\"){?>\r\n<script type=\"text/javascript\">\r\n// IE Evitar seleccion de texto\r\ndocument.onselectstart=function(){\r\nif (event.srcElement.type != \"text\" && event.srcElement.type != \"textarea\" && event.srcElement.type != \"password\")\r\nreturn false\r\nelse return true;\r\n};\r\n// FIREFOX Evitar seleccion de texto\r\nif (window.sidebar){\r\ndocument.onmousedown=function(e){\r\nvar obj=e.target;\r\nif (obj.tagName.toUpperCase() == \"INPUT\" || obj.tagName.toUpperCase() == \"TEXTAREA\" || obj.tagName.toUpperCase() == \"PASSWORD\")\r\nreturn true;\r\n/*else if (obj.tagName==\"BUTTON\"){\r\nreturn true;\r\n}*/\r\nelse\r\nreturn false;\r\n}\r\n}\r\n// End -->\r\n</script>\r\n\r\n<?php }\r\n\r\n}", "function enfold_customization_admin_css() {\n\techo \"<style>\n\t\t\t\ta[href='#avia_sc_contact'] { display: none; }\n\t\t\t\ta[href='#avia_sc_tab'] { display: none; }\n\t\t\t\ta[href='#avia_sc_toggle'] { display: none; }\n\t\t\t\ta[href='#avia_sc_comments_list'] { display: none; }\n\t\t\t</style>\";\n}", "function add_head() {\r\n\t\tglobal $locale;\r\n\t\t$wpca_settings = get_option('wpcareers');\r\n\t\techo \"<link rel=\\\"stylesheet\\\" href=\\\"\" . $this->plugin_url . \"/themes/default/css/default.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\">\";\r\n\t\tif($wpca_settings['edit_style']==null || $wpca_settings['edit_style']=='plain') {\r\n\t\t\t// nothing\r\n\t\t} elseif($wpca_settings['edit_style']=='tinymce') {\r\n\t\t\t// activate these includes if the user chooses tinyMCE on the settings page\r\n\t\t\t$mce_path = get_option('siteurl');\r\n\t\t\t$mce_path .= '/wp-includes/js/tinymce/tiny_mce.js';\r\n\t\t\techo '<script type=\"text/javascript\" src=\"' . $mce_path . '\"></script>';\r\n\t\t}\r\n\t}", "function publisher_cpHeader()\r\n{\r\n xoops_cp_header();\r\n\r\n //cannot use xoTheme, some conflit with admin gui\r\n echo '<link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/jquery-ui-1.7.1.custom.css\" rel=\"stylesheet\" />\r\n <link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/publisher.css\" rel=\"stylesheet\" />\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/funcs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/cookies.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.core.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.tabs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ajaxupload.3.9.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/publisher.js\"></script>\r\n ';\r\n}", "function sunrise_theme_create_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "function displayCopyRight() {\t\t\r\n\t\techo '<div class=\"copyright\" style=\"text-align:center;margin-top: 5px;\"><a href=\"http://joomdonation.com/components/membership-pro.html\" target=\"_blank\"><strong>Membership Pro</strong></a> version 1.5.0, Copyright (C) 2010-2012 <a href=\"http://joomdonation.com\" target=\"_blank\"><strong>Ossolution Team</strong></a></div>' ;\r\n\t}", "function upgrade_350()\n {\n }", "function addLittleShopCSS(){\n if(littleShopTakeEffect() === TRUE){\n\t echo '<link media=\"screen\" type=\"text/css\" href=\"'.myOwnLittleEbayShopPluginURL().'/my-own-little-ebay-shop-css.css\" rel=\"stylesheet\"/>';\n\t\n\t}\n}", "function fsnat_settings_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-custom-css.php');\n}", "function customs()\n\t{\n\t\t$custom = $this->ipsclass->load_class( ROOT_PATH.'mod_install/'.$this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'].'.php', $this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'] );\n\t\t$custom->xml_array =& $this->xml_array;\n\t\t\n\t\tif ( $this->ipsclass->input['un'] )\n\t\t{\n\t\t\t$custom->uninstall();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom->install();\n\t\t}\n\t}", "function common_pre_header() {\r\n global $current_screen;\r\n\r\n $browser = WPI_Functions::browser();\r\n $screen_id = $current_screen->id;\r\n\r\n if (!$screen_id) {\r\n return;\r\n }\r\n\r\n //* Load Global Script and CSS Files */\r\n if (file_exists(WPI_Path . '/core/css/jquery-ui-1.8.21.custom.css')) {\r\n wp_register_style('wpi-custom-jquery-ui', WPI_URL . '/core/css/jquery-ui-1.8.21.custom.css');\r\n }\r\n\r\n if (file_exists(WPI_Path . '/core/css/wpi-admin.css')) {\r\n wp_register_style('wpi-admin-css', WPI_URL . '/core/css/wpi-admin.css', array(), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Page Conditional Script and CSS Files if they exist*/\r\n if (file_exists(WPI_Path . \"/core/css/{$screen_id}.css\")) {\r\n wp_register_style('wpi-this-page-css', WPI_URL . \"/core/css/{$screen_id}.css\", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load IE 7 fix styles */\r\n if (file_exists(WPI_Path . \"/core/css/ie7.css\") && $browser['name'] == 'ie' && $browser['version'] == 7) {\r\n wp_register_style('wpi-ie7', WPI_URL . \"/core/css/ie7.css\", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Page Conditional Script and CSS Files if they exist*/\r\n if (file_exists(WPI_Path . \"/core/js/{$screen_id}.js\")) {\r\n wp_register_script('wpi-this-page-js', WPI_URL . \"/core/js/{$screen_id}.js\", array('wp-invoice-events'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Conditional Metabox Files */\r\n if (file_exists(WPI_Path . \"/core/ui/metabox/{$screen_id}.php\")) {\r\n include_once WPI_Path . \"/core/ui/metabox/{$screen_id}.php\";\r\n }\r\n }", "function opinionstage_settings_load_header(){\n}", "function changelog()\n\t{\n\t\t?>\n\t\t<pre>\n\t\t\t<?php\n\t\t\treadfile( JPATH_SITE.'/CHANGELOG.php' );\n\t\t\t?>\n\t\t</pre>\n\t\t<?php\n\t}", "function udesign_html_before() {\r\n do_action('udesign_html_before');\r\n}", "function adminbartweak_version() {return \"1.0.0\";}", "public function testUpdateSite()\n {\n }", "function display_site_info()\r\n{\r\n?>\r\n <? /*<ul>\r\n <li>Сервер статистики пользователей\r\n <li>Управление пользователями\r\n <li>Подключение и переподключение\r\n </ul> */ ?>\r\n<?\r\n}", "function oscimp_admin() {\r\n\t// include('goods_transform/import_admin.php');\r\n\t// include('goods_transform/import_goods.php');\r\n\t// include('goods_transform/update_goods_image.php');\t//指定image 然后刷新数量\r\n\t// include('goods_transform/update_goods_gallery.php');\t//gallery 机制\r\n\t// include('goods_transform/import_article.php');\r\n\t// include('goods_transform/update_article_image.php');\r\n\t// include('goods_transform/update_article_gallery.php');\t//gallery 机制\r\n\r\n\t// include('download_parse.php');\r\n\r\n}", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "public function Copyright(){\n\t\treturn 'For The Win forums version 2.5 <br /> copyright &copy; FTW Entertainment LLC, 2008-'.date(\"Y\").', all rights reserved.';\n\t}", "function bl_version_head() {\r\n\techo '<meta name=\"generator\" content=\"Beaverlodge v' . EDD_BEAVERLODGE_VERSION . '\"/>' ;\r\n}", "function change_admin_footer_text() {\n return 'Powered by <a href=\"http://mist.ac.bd\" target=\"_blank\" title=\"Military Inistitute of Science & Technology (MIST)\">Military Inistitute of Science & Technology (MIST)</a>';\n }", "public function payment_scripts() {\n\n \t}", "function addRedirectorCopyright()\n{\n global $context;\n\n if ($context['current_action'] == 'credits') {\n $context['copyrights']['mods'][] = '<a href=\"https://mysmf.net/mods/redirector\" target=\"_blank\">Redirector</a> &copy; 2015-2020, digger';\n }\n}", "function my_custom_login() {\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . SALES_PATH . 'custom-css/imm-sale-custom-login-styles.css.css\" />';\n}", "static function PageAutoload()\r\n\t{\r\n\t\t\r\n\t}", "function my_own_little_ebay_style_and_magic(){\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.myOwnLittleEbayShopPluginURLDirect().'/my-own-little-ebay-shop-option-css.css\" />';\n\t//A Bit of magic\n\techo '<script type=\"text/javascript\" src=\"'.myOwnLittleEbayShopPluginURLDirect().'/my-own-little-ebay-shop-option-js.js\" /></script>';\n}", "function render_page($license=false) {\n \tglobal $settings, $locale, $userdata, $aidlink, $theme_width, $bottom_navbar_string, $ver;\n\n\t//Header\n\techo \"<table cellpadding='0' cellspacing='0' width='$theme_width' align='center'><tr>\";\n\techo \"<td class='full-header'>&nbsp;</td>\";\n\techo \"<td class='sub-header'>\".showsublinks(\"\",\"white\").\"\";\n\techo \"<td class='sub-headerright'>&nbsp;</td>\";\n\techo \"</tr></table>\";\n\techo \"<table cellpadding='0' cellspacing='0' width='100%'><tr>\";\n\techo \"<td class='ad'>&nbsp;</td>\";\n\techo \"</tr></table>\";\n\n\n\t//Content\n\n\techo \"<table cellpadding='0' cellspacing='0' width='$theme_width' align='center'><tr>\\n\";\n\tif (LEFT) { echo \"<td class='side-border-left' valign='top'>\".LEFT.\"</td>\"; }\n\techo \"<td class='main-bg' valign='top'>\".U_CENTER.CONTENT.L_CENTER.\"</td>\";\n\tif (RIGHT) { echo \"<td class='side-border-right' valign='top'>\".RIGHT.\"</td>\"; }\n\techo \"</tr>\\n</table>\\n\";\n\n \t//Footer\n\n \techo \"<table cellpadding='0' cellspacing='0' width='$theme_width' align='center'>\\n<tr>\\n\";\n\techo \"<td><img src='\".THEME.\"/images/pfboxfooterleft.jpg' align='right' alt='image' /></td>\\n\";\n \techo \"<td align='left' class='bottom-footer' width='50%'>ArcSite CMS v$ver by The_Red<br/>Built Using <a target='_blank' href='http://www.php-fusion.co.uk/'>PHP-Fusion v7.00.07</a><br/></td>\\n\";\n\techo \"<td align='right' class='bottom-footer' width='50%'>$bottom_navbar_string<br/>\".showcounter().\"</td>\\n\";\n \techo \"<td><img src='\".THEME.\"/images/pfboxfooterright.jpg' align='left' alt='image' /></td>\\n\";\n\techo \"</tr>\\n</table>\\n\";\n }", "function sunrise_theme_settings_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "function upgrade_130()\n {\n }", "function labs_admin_header_style() {\n?>\n<?php\n}", "function add_admin_header() {\n }", "public function payment_scripts() {\n \n\t \t}", "function extamus_change_admin_footer(){\n\t echo '<span id=\"footer-note\">Please dont hesitate to reach out to your friends at <a href=\"http://www.extamus.com/\" target=\"_blank\">Extamus Media</a> with any questions.</span>';\n\t}", "public function alterMe()\n {\n return \"splendiferous\";\n }", "function CK04()\n {\n global $template;\n global $id,$param, $top_url;\n\n//echo \"top: $top_url\";\n\n // 상세 정보 가져온다\n $data = $this->get_detail( $id );\n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }", "function upgrade_630()\n {\n }", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function CK07()\n {\n global $template;\n global $connect;\n global $id,$param;\n\n $query = \"select * from products\n where stock_manage=1\n and org_id='$id'\";\n\n $result = mysql_query ( $query, $connect ); \n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }", "function add_support_script_frontend(){\n}", "function sitemgr_upgrade0_9_15_007()\n{\n\t$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_sitemgr_pages',array(\n\t\t'fd' => array(\n\t\t\t'page_id' => array('type' => 'auto','nullable' => False),\n\t\t\t'cat_id' => array('type' => 'int','precision' => '4'),\n\t\t\t'sort_order' => array('type' => 'int','precision' => '4'),\n\t\t\t'hide_page' => array('type' => 'int','precision' => '4'),\n\t\t\t'name' => array('type' => 'varchar','precision' => '100'),\n\t\t\t'state' => array('type' => 'int','precision' => '2')\n\t\t),\n\t\t'pk' => array('page_id'),\n\t\t'fk' => array(),\n\t\t'ix' => array('cat_id',array('state','cat_id','sort_order'),array('name','cat_id')),\n\t\t'uc' => array()\n\t));\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '0.9.15.008';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "public function get_copyright()\n {\n }", "public function get_copyright()\n {\n }", "public function get_copyright()\n {\n }", "function fileEdit($file=NULL)\r\n{\r\n global $PH;\r\n\r\n if(!$file) {\r\n $id= getOnePassedId('file','files_*'); # WARNS if multiple; ABORTS if no id found\r\n if(!$file= File::getEditableById($id)) {\r\n $PH->abortWarning(\"ERROR: could not get File\");\r\n return;\r\n }\r\n }\r\n\r\n if(!$project=Project::getVisibleById($file->project)) {\r\n $PH->abortWarning(\"ERROR: could not get Project\",ERROR_BUG);\r\n }\r\n\r\n ### set up page and write header ####\r\n {\r\n\r\n\r\n $page= new Page(array('use_jscalendar'=>true, 'autofocus_field'=>'file_name'));\r\n initPageForFile($page, $file, $project);\r\n\r\n if($file->id) {\r\n $page->title=__('Edit File','page title');\r\n }\r\n else {\r\n $page->title=__('New file','page title');\r\n }\r\n\r\n #$page->title_minor= sprintf(__('On project %s','page title add on'),$project->name);\r\n\r\n\r\n echo(new PageHeader);\r\n }\r\n echo (new PageContentOpen);\r\n\r\n $block=new PageBlock(array(\r\n 'id' =>'edit',\r\n 'reduced_header' => true,\r\n ));\r\n $block->render_blockStart();\r\n\r\n ### write form #####\r\n {\r\n require_once(confGet('DIR_STREBER') . 'render/render_form.inc.php');\r\n\r\n $form=new PageForm();\r\n $form->button_cancel=true;\r\n\r\n $form->add($file->fields['name']->getFormElement(&$file));\r\n\r\n $form->add($file->fields['description']->getFormElement(&$file));\r\n\r\n /**\r\n * until new file is added to database keep details in hiddenfields\r\n */\r\n if($file->id == 0) {\r\n $form->add(new Form_HiddenField('file_mimetype', '',urlencode($file->mimetype)));\r\n $form->add(new Form_HiddenField('file_filesize', '',intval($file->filesize)));\r\n $form->add(new Form_HiddenField('file_org_filename', '',urlencode($file->org_filename)));\r\n $form->add(new Form_HiddenField('file_tmp_filename', '',urlencode($file->tmp_filename)));\r\n $form->add(new Form_HiddenField('file_tmp_dir', '',$file->tmp_dir));\r\n $form->add(new Form_HiddenField('file_is_image', '',$file->is_image));\r\n $form->add(new Form_HiddenField('file_version', '',$file->version));\r\n $form->add(new Form_HiddenField('file_parent_item', '',$file->parent_item));\r\n $form->add(new Form_HiddenField('file_org_file', '',$file->org_file));\r\n }\r\n $form->add(new Form_HiddenField('file', '',$file->id));\r\n $form->add(new Form_HiddenField('file_project', '',$file->project));\r\n\r\n\r\n\r\n ### status ###\r\n {\r\n $st=array();\r\n global $g_status_names;\r\n foreach($g_status_names as $s=>$n) {\r\n if($s >= STATUS_NEW) {\r\n $st[$s]=$n;\r\n }\r\n }\r\n $form->add(new Form_Dropdown('file_status',\"Status\",array_flip($st), $file->status));\r\n }\r\n\r\n ### public-level ###\r\n if(($pub_levels= $file->getValidUserSetPublevel())\r\n && count($pub_levels)>1) {\r\n $form->add(new Form_Dropdown('file_pub_level', __(\"Publish to\"),$pub_levels,$file->pub_level));\r\n }\r\n\r\n echo ($form);\r\n\r\n $PH->go_submit='fileEditSubmit';\r\n }\r\n $block->render_blockEnd();\r\n\r\n echo (new PageContentClose);\r\n echo (new PageHtmlEnd);\r\n}", "function sr_admin() { \n\tinclude('StandardsReader-admin.php'); \n}", "public function getCode() {\n\n $licence = '/*\n * Auto Generated Code for HomeNet\n *\n * Copyright (c) 2011 HomeNet.\n *\n * This file is part of HomeNet.\n *\n * HomeNet is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * HomeNet is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with HomeNet. If not, see <http ://www.gnu.org/licenses/>.\n */';\n return $licence;\n }", "function mpcth_add_admin_head() {\r\n\tmpcth_admin_alternative_styles();\r\n}", "function admin_css() {\n?>\n<style type=\"text/css\">\n\t.plugin-update-tr .update-message-ignore {\n\t\tmargin: 5px;\n\t\tpadding: 3px 5px;\n\t\tborder-width: 1px;\n\t\tborder-style: solid;\n\t\t-moz-border-radius: 5px;\n\t\t-khtml-border-radius: 5px;\n\t\t-webkit-border-radius: 5px;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #ffebe8;\n\t\tborder-color: #c00;\n\t\tfont-weight: bold;\n\t}\n\t.error a {\n\t\tcolor: #c00;\n\t}\n</style>\n<?php\n\t}", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}", "static function link_rewriter_menupage(){\n\t \tinclude self::get_script_location('link_rewriter_menupage.php');\n\t }", "function rst_settings()\n{\n require_once('inc/inc.rst-settings.php');\n}", "function upgrade_340()\n {\n }", "function mainHTML()\n {\n ?>\n <h1>Upgrade Andromeda From Subversion</h1>\n \n <br/>\n This program will pull the latest release code for\n Andromeda directly from our Sourceforget.net Subversion tree. \n\n <br/>\n <br/>\n <b>This program directly overwrites the running Node Manager\n Code.</b> <span style=\"color:red\"><b>If you have been making changes to your Andromeda\n code on this machine all of those changes will be lost!</b><span>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_pullsvna&gp_out=none')\"\n >Step 1: Pull Code Now</a>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_builder&gp_out=none&txt_application=andro')\"\n >Step 2: Rebuild Node Manager</a>\n \n <?php\n \n }", "public function customizer() {\n\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'googlefont-array.php';\n //require_once DF_CUSTOMIZER_CONTROL_DIR . 'interface.php';\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'sanitization.php';\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'setup.php';\n /* Backup Import / Export */\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'backup.php';\n\n }", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}" ]
[ "0.6528785", "0.605369", "0.6002915", "0.5966986", "0.5961562", "0.59486187", "0.5927586", "0.5861302", "0.58021337", "0.5799938", "0.5793617", "0.57668763", "0.57509804", "0.57505876", "0.57439876", "0.5737104", "0.57265484", "0.57179403", "0.57119566", "0.5693963", "0.56881243", "0.5675708", "0.56743205", "0.56700397", "0.56623757", "0.56576735", "0.5656995", "0.5651013", "0.56177104", "0.56123555", "0.5611791", "0.5607361", "0.559757", "0.55929863", "0.55891204", "0.55882657", "0.5582736", "0.558046", "0.55777377", "0.55687267", "0.55674607", "0.55565166", "0.5555947", "0.5553196", "0.55486643", "0.55481267", "0.55445164", "0.5539483", "0.55304503", "0.5527314", "0.5521223", "0.5516244", "0.55136627", "0.55110294", "0.55106264", "0.5509287", "0.5506881", "0.5503996", "0.5503087", "0.5489775", "0.54854244", "0.54848486", "0.54828084", "0.5481478", "0.54784805", "0.5476277", "0.5474966", "0.54726", "0.5470117", "0.5468213", "0.5467872", "0.5466979", "0.5459272", "0.5457686", "0.5447463", "0.5443939", "0.5443304", "0.5443125", "0.5441903", "0.54335356", "0.54330915", "0.54297477", "0.54297477", "0.54289675", "0.54262674", "0.54260224", "0.5425541", "0.5424295", "0.5422915", "0.5421539", "0.5421387", "0.5416708", "0.54158705", "0.54125583", "0.5411197", "0.5408691", "0.540589", "0.5404676", "0.54017395", "0.5397671", "0.53951895" ]
0.0
-1
Standard importer hook info function.
public function info() { $info = array(); $info['supports_advanced_import'] = false; $info['product'] = 'SMF 1.1.x'; $info['prefix'] = 'smf_'; $info['import'] = array( 'config', 'cns_groups', 'cns_members', 'cns_member_files', 'ip_bans', 'cns_forum_groupings', 'cns_forums', 'cns_topics', 'cns_private_topics', 'cns_posts', 'cns_post_files', 'cns_polls_and_votes', 'notifications', 'wordfilter', 'calendar' ); $info['dependencies'] = array( // This dependency tree is overdefined, but I wanted to make it clear what depends on what, rather than having a simplified version 'cns_members' => array('cns_groups'), 'cns_member_files' => array('cns_members'), 'cns_forums' => array('cns_forum_groupings', 'cns_members', 'cns_groups'), 'cns_topics' => array('cns_forums', 'cns_members'), 'cns_polls_and_votes' => array('cns_topics', 'cns_members'), 'cns_posts' => array('cns_topics', 'cns_members'), 'cns_post_files' => array('cns_posts', 'cns_private_topics'), 'notifications' => array('cns_topics', 'cns_members', 'cns_polls_and_votes'), 'cns_private_topics' => array('cns_members') ); $_cleanup_url = build_url(array('page' => 'admin_cleanup'), get_module_zone('admin_cleanup')); $cleanup_url = $_cleanup_url->evaluate(); $info['message'] = (get_param_string('type', 'browse') != 'import' && get_param_string('type', 'browse') != 'hook') ? new Tempcode() : do_lang_tempcode('FORUM_CACHE_CLEAR', escape_html($cleanup_url)); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ft_hook_info() {}", "public function hook();", "function hook_file_formatter_info_alter(&$info) {\n // @todo Add example.\n}", "private function public_hooks()\n\t{\n\t}", "public function hook() {\n\t\t// the WPML API is not included by default\n\t\trequire_once ICL_PLUGIN_PATH . '/inc/wpml-api.php';\n\n\t\t$this->hook_actions();\n\t\t$this->hook_filters();\n\t}", "public static function import_process() {}", "function register_importer() {\n\t\tglobal $wp_importers;\n\n\t\tif( ! isset( $wp_importers['wgobd_the_events_calendar'] ) ) {\n\t\t\t$wp_importers['wgobd_the_events_calendar'] = array(\n\t\t\t\t__( 'The Events Calendar → All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\t__( 'Imports events created using The Events Calendar plugin into the All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\tarray( &$this, 'import_the_events_calendar' )\n\t\t\t);\n\t\t}\n\t}", "public function init_hooks() {\n\t}", "public function extraInfo();", "abstract protected function setup_info();", "function ft_hook_init() {}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_import_order_xml', 'WooCommerce Order XML', __('Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'OrderImpExpXML_Importer::order_importer');\n register_importer('woocommerce_wf_import_order_xml_cron', 'WooCommerce Order XML Cron', __('Cron Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'WF_OrderImpExpXML_ImportCron::orderxml_importer');\n }", "public function getImported();", "public function wp_parser_starting_import() {\n\t\t$importer = new Importer;\n\n\t\tif ( ! $this->p2p_tables_exist() ) {\n\t\t\t\\P2P_Storage::init();\n\t\t\t\\P2P_Storage::install();\n\t\t}\n\n\t\t$this->post_types = array(\n\t\t\t'hook' => $importer->post_type_hook,\n\t\t\t'method' => $importer->post_type_method,\n\t\t\t'function' => $importer->post_type_function,\n\t\t);\n\t}", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "protected function getInfoModule() {}", "function get_importers()\n {\n }", "private function hooks() {\n\n\t\t$plugin_admin = shortbuild_bu_hooks();\n add_filter( 'advanced_import_demo_lists', array( $plugin_admin, 'add_demo_lists' ), 10, 1 );\n add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 );\n add_filter( 'wp_ajax_shortbuild_bu_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 );\n\n /*Replace terms and post ids*/\n add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 );\n }", "private function hooks() {\n\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// Add template folder\n\t\t\tadd_filter( 'affwp_template_paths', array( $this, 'template' ) );\n\n\t\t}", "protected function info()\n\t\t{\n\t\t}", "protected function initializeImport() {}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_order_csv', 'WooCommerce Order (CSV/XML)', __('Import <strong>Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrderImpExpCsv_Importer::order_importer');\n register_importer('order_csv_cron', 'WooCommerce Orders (CSV/XML)', __('Cron Import <strong>order</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrdImpExpCsv_ImportCron::order_importer');\n }", "function init__hooks__modules__admin_import__phpbb3()\n{\n\tglobal $TOPIC_FORUM_CACHE;\n\t$TOPIC_FORUM_CACHE=array();\n\n\tglobal $STRICT_FILE;\n\t$STRICT_FILE=false; // Disable this for a quicker import that is quite liable to go wrong if you don't have the files in the right place\n\n\tglobal $OLD_BASE_URL;\n\t$OLD_BASE_URL=NULL;\n\n\t// Profile Field Types\n\tdefine('FIELD_INT', 1);\n\tdefine('FIELD_STRING', 2);\n\tdefine('FIELD_TEXT', 3);\n\tdefine('FIELD_BOOL', 4);\n\tdefine('FIELD_DROPDOWN', 5);\n\tdefine('FIELD_DATE', 6);\n}", "public function define_hooks()\n\t{\n\t\t$base = new Base;\n\t\t$this->loader->add_action('init', $base, 'add_post_types');\n\t}", "public function import_hook( array $data, $parent_post_id = 0, $import_ignored = false ) {\n\t\t/**\n\t\t * Check external by example Akimet plugin not use WordPress DocBlock comment\n\t\t */\n\t\tif ( apply_filters( 'sublime_skip_duplicate_by_name', false, $data ) )\n\t\t\treturn false;\n\n\t\t/**\n\t\t * Use regex beacuse some hooks not use WordPress DockBlock comment\n\t\t */\n\t\tif ( preg_match( '/^This (filter|action) is documented in/', $data['doc']['description'] ) )\n\t\t\treturn false;\n\n\t\tif (\n\t\t\t'' === $data['doc']['description'] &&\n\t\t\t'' === $data['doc']['long_description'] &&\n\t\t\tpreg_match( '/wp-(admin|includes)/', $this->file_meta['term_id'] )\n\t\t) {\n\t\t\t/**\n\t\t\t * Use for filter unknown hooks some hooks exists but not exists phpdoc\n\t\t\t */\n\t\t\tif ( apply_filters( 'wp_parser_skip_duplicate_with_empty_phpdoc', true, $data['name'], $this->file_meta['term_id'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$hook_id = $this->import_item( $data, $parent_post_id, $import_ignored, array( 'post_type' => $this->post_type_hook ) );\n\n\t\tif ( ! $hook_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tupdate_post_meta( $hook_id, '_wp-parser_hook_type', $data['type'] );\n\n\t\treturn $hook_id;\n\t}", "function _silver_feeds_importer_default_helper($field_info, &$feeds_importer, $additional = ''){\n foreach($field_info as $key => $field){\n $field_info = field_info_field($field['field_name']);\n switch($field_info['type']){\n case 'file':\n // Do nothing. We can't import files in an Excel template.\n break;\n case 'country':\n // We use iso3 country codes\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('ISO alpha-2') . ')',\n 'target' => $additional . $key . ':iso2',\n 'unique' => 0\n );\n break;\n case 'date':\n // Add the from date, and also the to date if required.\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Start') . ')',\n 'target' => $key . ':start',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('End') . ')',\n 'target' => $key . ':end',\n 'unique' => 0\n );\n break;\n case 'link_field':\n // Add the from date, and also the to date if required.\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('URL') . ')',\n 'target' => $key . ':url',\n 'unique' => 0\n );\n break;\n case 'user_reference':\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (UID)',\n 'target' => $key . ':uid:duplicates',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Name on site') . ')',\n 'target' => $key . ':name:duplicates',\n 'unique' => 0\n );\n break;\n case 'node_reference':\n // We add two columns for the node reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (NID)',\n 'target' => $key . ':nid:duplicates',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Title') . ')',\n 'target' => $key . ':title:duplicates',\n 'unique' => 0\n );\n break;\n case 'taxonomy_term_reference':\n // We add three columns for the term reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Name') . ')',\n 'target' => $key,\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (TID)',\n 'target' => $key . ':tid',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (GUID)',\n 'target' => $key . ':guid',\n 'unique' => 0\n );\n break;\n default:\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => trim($field['label']),\n 'target' => $key,\n 'unique' => 0\n );\n }\n }\n}", "protected function hook1(): void { }", "private function hooks(): void {\n\t\t// Steps loader hooks.\n\n\t\tadd_filter(\n\t\t\t'learndash_breezy_localize_script_data',\n\t\t\t$this->container->callback( Steps\\Loader::class, 'add_scripts_data' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_nopriv_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t}", "public function import()\n {\n \n }", "function _manually_load_importer() {\n\tif ( ! class_exists( 'WP_Import' ) ) {\n\t\trequire dirname( dirname( __FILE__ ) ) . '/src/wordpress-importer.php';\n\t}\n}", "public function metaImport($data);", "function ft_hook_filename($file) {}", "public function prepareImport();", "abstract public function process($hook, $input = 'php://input');", "function erp_importer_notices() {\n if ( ! isset( $_REQUEST['page'] ) || $_REQUEST['page'] != 'erp-tools' || ! isset( $_REQUEST['tab'] ) || $_REQUEST['tab'] != 'import' ) {\n return;\n }\n\n if ( isset( $_REQUEST['imported'] ) ) {\n if ( intval( $_REQUEST['imported'] ) == 0 ) {\n $message = __( 'Nothing to import or items are already exists.', 'erp' );\n echo \"<div class='notice error'><p>\" . esc_html( $message ) . \"</p></div>\";\n } else {\n $message = sprintf( __( '%s items successfully imported.', 'erp' ),\n number_format_i18n( sanitize_text_field( wp_unslash( $_REQUEST['imported'] ) ) )\n );\n echo \"<div class='notice updated'><p>\" . esc_html( $message ) . \"</p></div>\";\n }\n }\n}", "public static function hooks() {\n add_filter( 'inbound_menu_debug' , array (__CLASS__ , 'load_debug_links') , 10 , 2);\n }", "function dk_speakup_loadimporter(){\n\t\tif(function_exists('dk_speakup_meta_links')){\n\t\t\tload_plugin_textdomain( 'speakupimport', false, 'speakup-email-petitions-importer/languages' );\n\t\t\tinclude_once( dirname( __FILE__ ) . '/class.importer.php' );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( 'dk_Speakup_Import', 'scripts'));\n\t\t\t\n\t\t\tadd_action('admin_menu', array( 'dk_Speakup_Import', 'menu'),1000);\n\t\t}\n\t}", "function ft_hook_fileextras($file, $dir) {}", "public function plugin_info()\n {\n }", "function info()\n\t{\n\t\t$info=array();\n\t\t$info['supports_advanced_import']=false;\n\t\t$info['product']='HTML website (page extraction and basic themeing)';\n\t\t$info['import']=array(\n\t\t\t\t\t\t\t\t'pages',\n\t\t\t\t\t\t\t);\n\t\treturn $info;\n\t}", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "public function load_hooks() {\n\t\tadd_action( 'init', [ $this, 'updater' ] );\n\t\t$this->load_settings();\n\t}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('coupon_csv', 'WooCommerce Coupons (CSV)', __('Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_Importer::coupon_importer');\n register_importer('coupon_csv_cron', 'WooCommerce Coupons (CSV)', __('Cron Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_ImportCron::coupon_importer');\n wp_enqueue_script('woocommerce-order-xml-importer', plugins_url(basename(plugin_dir_path(WF_OrderImpExpXML_FILE)) . '/js/hf_order_admin.js', basename(__FILE__)), array(), '1.0.0', true);\n }", "public function importAction()\n {\n $this->importParameters = $this->importParameters + $this->_importExtraParameters;\n\n parent::importAction();\n }", "function get_entry_points()\n\t{\n\t\treturn array('misc'=>'XML_DATA_MANAGEMENT');\n\t}", "function install_plugin_information()\n {\n }", "public function hook() {\n add_filter('pre_get_document_title', [$this, 'getTitle'], 10);\n add_filter('wp_head', [$this, 'outputMetaDescription'], 1);\n add_filter('wp_head', [$this, 'ogTags'], 2 );\n }", "abstract protected function register_hook_callbacks();", "public function import() {\n\t\t$this->status = new WPSEO_Import_Status( 'import', false );\n\n\t\tif ( ! $this->detect_helper() ) {\n\t\t\treturn $this->status;\n\t\t}\n\n\t\t$this->import_metas();\n\n\t\treturn $this->status->set_status( true );\n\t}", "public function import();", "protected function initHookObjects() {}", "protected function initHookObjects() {}", "public function registerHooks() {\n\t\t// Nothing to do here right now\n\t\t// Others might want to know about this and get a chance to do their own work (like messing with our's :) )\n\t\tdo_action( 'pixelgrade_portfolio_registered_hooks' );\n\t}", "protected function initHookObjects() {}", "function wp_import_handle_upload()\n {\n }", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('DpagesMar');\n\n\t\t$m->addHook('Page(pw_template=arproc)::subfunctionUrl', function($event) {\n\t\t\t$event->return = self::subfunctionUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::arprocUrl', function($event) {\n\t\t\t$event->return = self::arprocUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::glmainUrl', function($event) {\n\t\t\t$event->return = self::glmainUrl($event->arguments(0));\n\t\t});\n\t}", "function import_STE()\n{\n}", "function init__hooks__modules__admin_import__smf()\n{\n global $TOPIC_FORUM_CACHE;\n $TOPIC_FORUM_CACHE = array();\n\n global $STRICT_FILE;\n $STRICT_FILE = false; // Disable this for a quicker import that is quite liable to go wrong if you don't have the files in the right place\n}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_subscription_order_csv', 'WooCommerce Subscription Order (CSV)', __('Import <strong>Subcription Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'wf_subcription_orderImpExpCsv_Importer::subscription_order_importer');\n register_importer('woocommerce_subscription_csv_cron', 'WooCommerce Subscription Order Cron(CSV)', __('Cron Import <strong>subscription orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_SubscriptionOrderImpExpCsv_ImportCron::subcription_order_importer');\n }", "function load_moniker_hooks()\n{\n if (running_script('install')) {\n return;\n }\n\n global $CONTENT_OBS;\n if ($CONTENT_OBS === null) {\n $CONTENT_OBS = function_exists('persistent_cache_get') ? persistent_cache_get('CONTENT_OBS') : null;\n if ($CONTENT_OBS !== null) {\n foreach ($CONTENT_OBS as $ob_info) {\n if (($ob_info['title_field'] !== null) && (strpos($ob_info['title_field'], 'CALL:') !== false)) {\n require_code('hooks/systems/content_meta_aware/' . $ob_info['_hook']);\n }\n }\n\n return;\n }\n\n $no_monikers_in = array( // FUDGE: Optimisation, not ideal! But it saves file loading and memory\n 'author' => true,\n 'banner' => true,\n 'banner_type' => true,\n 'calendar_type' => true,\n 'catalogue' => true,\n 'post' => true,\n 'wiki_page' => true,\n 'wiki_post' => true,\n );\n\n $CONTENT_OBS = array();\n $hooks = find_all_hooks('systems', 'content_meta_aware');\n foreach ($hooks as $hook => $sources_dir) {\n if (isset($no_monikers_in[$hook])) {\n continue;\n }\n\n $info_function = extract_module_functions(get_file_base() . '/' . $sources_dir . '/hooks/systems/content_meta_aware/' . $hook . '.php', array('info'), null, false, 'Hook_content_meta_aware_' . $hook);\n if ($info_function[0] !== null) {\n $ob_info = is_array($info_function[0]) ? call_user_func_array($info_function[0][0], $info_function[0][1]) : eval($info_function[0]);\n\n if ($ob_info === null) {\n continue;\n }\n if (!isset($ob_info['view_page_link_pattern'])) {\n continue;\n }\n $ob_info['_hook'] = $hook;\n $CONTENT_OBS[$ob_info['view_page_link_pattern']] = $ob_info;\n\n if (($ob_info['title_field'] !== null) && (strpos($ob_info['title_field'], 'CALL:') !== false)) {\n require_code('hooks/systems/content_meta_aware/' . $hook);\n }\n }\n }\n\n if (function_exists('persistent_cache_set')) {\n persistent_cache_set('CONTENT_OBS', $CONTENT_OBS);\n }\n }\n}", "public function import(): void;", "function manual_import_feedback($info, $type) {\n\n\t$info = addslashes($info);\n\n\tif ($type == 'proc') {\n\t\t$type = 'p';\n\t} elseif ($type == 'current') {\n\t\t$type = 'c';\n\t} else {\n\t\t$type = 'm';\n\t}\n\n\techo \"<script type=\\\"text/javascript\\\">$type('$info');</script>\";\n}", "public function info();", "public function info();", "private function hooks() {\n\t\t\t// check for EDD when plugin is activated\n\t\t\tadd_action( 'admin_init', array( $this, 'activation' ), 1 );\n\t\t\t\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// settings link on plugin page\n\t\t\tadd_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ), 10, 2 );\n\t\t\t\n\t\t\t// insert actions\n\t\t\tdo_action( 'edd_sd_setup_actions' );\n\t\t}", "public function init()\n\t{\n\t\t$this->title( __( 'Aggregated Hook Usage', 'debug-bar' ) );\n\t}", "protected function importInstructions()\n {\n return [];\n }", "private function registerImporter()\n {\n $this->singleton(Contracts\\ImporterManager::class, ImporterManager::class);\n $this->singleton('arcanedev.excel.importer', Contracts\\ImporterManager::class);\n }", "function onCustomInfo(&$man, &$file, $type, &$custom) {\r\n\t\treturn true;\r\n\t}", "function infoDictionary() {}", "function on_add_extra()\r\n\t{\r\n\t}", "private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }", "private function add_hooks_and_filters() {\n add_filter( 'slp_version_report_' . $this->addon->short_slug , array( $this , 'show_activated_modules' ) );\n }", "private function define_hooks() {\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'hook_add_meta_boxes' ), 10, 1 );\n\n\t\tadd_action( 'save_post', array( $this, 'hook_save_post' ), 10, 1 );\n\n\t\treturn;\n\t}", "function index() {\n\t\t$hook_link = $this->hook('format');\n\t\tif( $hook_link ) { require($hook_link); }\t\t\n\t}", "public function __construct(Importer $importer)\n\t{\n\t\t$this->importer = $importer;\n\t\tparent::__construct();\n\t}", "function sa_dumpHooks($hookname = NULL,$exclude = false,$actions = false){\n\tglobal $plugins;\n $sa_plugins = $plugins;\n $collapsestr= '<span class=\"sa_expand sa_icon_open\"></span><span class=\"sa_collapse\">'; \n\t$bmark_str = bmark_line();\n $hookdump = '<span class=\"titlebar\">Dumping live hooks: ' . (isset($hookname) ? $hookname : 'All') .$bmark_str.'</span>'.$collapsestr;\n \n asort($sa_plugins);\n \n foreach ($sa_plugins as $hook)\t{\n\t\tif(substr($hook['hook'],-8,9) == '-sidebar'){\n\t\t\t$thishook = 'sidebar';\n\t\t}else\n\t\t{\n\t\t\t$thishook = $hook['hook'];\n\t\t}\n\t\n # _debugLog($hook);\n if(isset($hookname) and $thishook != $hookname and $exclude==false) continue; \n if(isset($hookname) and $thishook == $hookname and $exclude==true) continue; \n if($actions == true and ( $thishook == 'sidebar' or $thishook == 'nav-tab')) continue; \n \n if($hook['file']=='sa_development.php') continue; // remove noisy debug hooks\n\t\t\t\t\t\n # debugPair($hook['hook'],implode(', ',$hook['args'])); \n\n $return = '<span class=\"cm-default\"><span><b>'.$hook['hook'] .'</b><span class=\"cm-tag\"> &rarr; </span></span>'\n .'<span class=\"cm-variable\">' . $hook['function'] . '</span>'\n .'<span class=\"cm-bracket\">(</span>'\n .'<span class=\"\">' . arr_to_csv_line($hook['args']) .'</span>'\n .'<span class=\"cm-bracket\">)</span>'\n .'<span class=\"cm-comment\"> File </span>'\n .'<span class=\"cm-bracket\">[</span>'\n .'<span class=\"cm-atom\" title=\"'.$hook['file'].'\">'. sa_get_path_rel($hook['file']) .'</span>'\n .':'\n .'<span class=\"cm-string\">'. $hook['line'] .'</span>'\n .'<span class=\"cm-bracket\">]</span>' . '</span>';\n \n $hookdump.=$return.'<br/>';\n }\n return $hookdump.'</span>';\n}", "abstract public function register_hook_callbacks();", "public function init_hooks()\n {\n register_activation_hook(__FILE__, array($this, 'run_install'));\n register_deactivation_hook(__FILE__, array($this, 'run_uninstall'));\n }", "public function hook()\n {\n // Add the settings tab\n// $this->on('!wprss_options_tabs', array($this, 'addTab'), null, 100);\n // Register the settings option, sections and fields\n// $this->on('!wprss_admin_init', array($this, 'register'));\n\n parent::hook();\n }", "function coder_upgrade_cache_info_hooks($item, $recursive = TRUE) {\n// cdp(\"inside \" . __FUNCTION__);\n global $_coder_upgrade_module_name, $upgrade_theme_registry, $upgrade_menu_registry;\n static $ignore = array('.', '..', 'CVS', '.svn');\n static $extensions = array('module', 'inc');\n\n $dirname = $item['old_dir'];\n\n // Determine module name.\n coder_upgrade_module_name($dirname, $item);\n $_coder_upgrade_module_name = $item['module'] ? $item['module'] : $_coder_upgrade_module_name;\n\n // Find hook_theme for this module and cache its result.\n $filenames = scandir($dirname . '/');\n foreach ($filenames as $filename) {\n if (!in_array($filename, $ignore)) {\n if (is_dir($dirname . '/' . $filename)) {\n if ($recursive) {\n // TODO Fix this!!!\n $new_item = array(\n 'name' => $item['name'],\n 'old_dir' => $dirname . '/' . $filename,\n );\n coder_upgrade_cache_info_hooks($new_item, $recursive);\n // Reset the module name.\n $_coder_upgrade_module_name = $item['module'];\n }\n }\n elseif (in_array(pathinfo($filename, PATHINFO_EXTENSION), $extensions)) {\n $cur = file_get_contents($dirname . '/' . $filename);\n // Create reader object.\n $reader = PGPReader::getInstance();\n $reader->setSnippet($cur);\n $reader->addTokenNames();\n $reader->buildGrammar();\n\n $functions = $reader->getFunctions();\n foreach ($functions as $function) {\n// cdp(\"name = {$function->data->name}\");\n if ($function->data->name == $_coder_upgrade_module_name . '_theme') {\n $module_theme = eval($function->data->body->toString());\n foreach ($module_theme as $key => &$value) {\n $value['variables'] = isset($value['arguments']) ? $value['arguments'] : array();\n unset($value['arguments']);\n// $module_theme[$key] = $value;\n }\n $upgrade_theme_registry = array_merge($upgrade_theme_registry, $module_theme);\n// break 2;\n }\n elseif ($function->data->name == $_coder_upgrade_module_name . '_menu') {\n coder_upgrade_convert_return($function->data->body, 'menu', '', 1, 1);\n// break 2;\n }\n }\n // Free up memory.\n $reader->reset();\n pgp_log_memory_use('reset reader');\n }\n }\n }\n}", "function bfImport() {\n\t\t$this->__construct();\n\t}", "public function onLoad() {\n $this->addFileNameHook(array($this, 'parseFileName'));\n }", "function init_hooks() {\n\tregister_activation_hook( __FILE__, __NAMESPACE__ . '\\activate_plugin' );\n\tregister_deactivation_hook( __FILE__, __NAMESPACE__ . '\\deactivate_plugin' );\n\tregister_uninstall_hook( __FILE__, __NAMESPACE__ . '\\uninstall_plugin' );\n}", "private function import_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Import/Export', 'formidable' ) . '</h3>'\n\t\t\t . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',\n\t\t\t'prev_page' => 'styles',\n\t\t\t'next_page' => 'settings',\n\t\t\t'selector' => '.inside.with_frm_style',\n\t\t\t'position' => array( 'edge' => 'bottom', 'align' => 'top' ),\n\t\t);\n\t}", "function register_demo_handler($hook, $type, $return, $params) {\n\t$label = elgg_echo('csv_process:handler:label');\n\t$handler = __NAMESPACE__ . '\\\\demo_handler';\n\t\n\t$return[$handler] = $label;\n\t\n\treturn $return;\n}", "abstract protected function doImport(Finder $finder, InputInterface $input, OutputInterface $output);", "function getInfo();", "protected function setup_hooks(){\n add_action('add_meta_boxes', [$this, 'add_custom_meta_box']);\n add_action('save_post', [$this, 'save_post_meta_data']);\n }", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('WarehouseManagement');\n\n\t\t$m->addHook('Page(pw_template=whse-find-item)::printableUrl', function($event) {\n\t\t\t$event->return = self::printableUrl($event->arguments(0));\n\t\t});\n\t}", "public function extra();", "public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}", "static public function init() {\n\n\t\tadd_action( 'plugins_loaded', __CLASS__ . '::setup_hooks' );\n\t}", "public function info()\n {\n $this->appendLog('info', \\func_get_args());\n }", "public function set_hooks() {\n\t\t\t$this->hook_prefix = photonfill_hook_prefix();\n\n\t\t\t// Override Photon arg.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_array', array( $this, 'set_photon_args' ), 5, 2 );\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_string', array( $this, 'set_photon_args' ), 5, 2 );\n\n\t\t\t// If we're using the photonfill_bypass_image_downsize, we skip downsize, and now need to\n\t\t\t// ensure the Photon args are being set (but with a lower priority).\n\t\t\tif ( apply_filters( 'photonfill_bypass_image_downsize', false ) ) {\n\t\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'set_photon_args' ), 4, 3 );\n\t\t\t}\n\n\t\t\t// Transform our Photon url.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'transform_photon_url' ), 5, 1 );\n\t\t}", "public function replace_3rd_party_pugins_hooks(){\n }", "function hook_libraries_info_alter(&$libraries) {\n $files = array(\n 'php' => array('example_module.php_spellchecker.inc'),\n );\n $libraries['php_spellchecker']['integration files']['example_module'] = $files;\n}", "abstract public function information();", "protected function set_hooks() {\n\t\t// Compatibility with Cart Notices plugin\n\t\tadd_filter('wc_cart_notices_order_thresholds', array($this, 'wc_cart_notices_order_thresholds'), 20);\n\t\tadd_action('wc_cart_notices_process_notice_before', array($this, 'wc_cart_notices_process_notice_before'), 20);\n\t}" ]
[ "0.6945782", "0.63400716", "0.6090805", "0.60342723", "0.59742683", "0.58907", "0.5878238", "0.58147293", "0.57938075", "0.57554984", "0.5749422", "0.5748124", "0.5724679", "0.57077706", "0.5704346", "0.5704346", "0.5687976", "0.56407356", "0.56139016", "0.55939215", "0.55922", "0.5554502", "0.5551067", "0.5538794", "0.5533855", "0.5512772", "0.5503801", "0.54739183", "0.5466779", "0.5452983", "0.5416151", "0.54096824", "0.539278", "0.5376645", "0.5369406", "0.5366409", "0.53582484", "0.53503585", "0.5338542", "0.53284574", "0.5326478", "0.5325566", "0.530648", "0.52883005", "0.52874255", "0.52864647", "0.52858084", "0.52716285", "0.52693045", "0.52689046", "0.52563524", "0.5243108", "0.5243108", "0.52423954", "0.5242354", "0.52404517", "0.52344006", "0.5232394", "0.5224042", "0.5220549", "0.52183133", "0.52087194", "0.5206938", "0.52055264", "0.52055264", "0.5200609", "0.51937556", "0.51806927", "0.51802045", "0.5166153", "0.51647484", "0.5156026", "0.51541466", "0.51489884", "0.51439226", "0.5137537", "0.5133887", "0.51283807", "0.51033163", "0.510219", "0.5100595", "0.5096894", "0.5092773", "0.5091143", "0.5090647", "0.50871605", "0.5084856", "0.50822926", "0.50795794", "0.5078983", "0.5076387", "0.50676", "0.5066276", "0.50519276", "0.50481045", "0.50480646", "0.5041725", "0.502195", "0.5017607", "0.5017205" ]
0.51655966
70
Probe a file path for DB access details.
public function probe_db_access($file_base) { $db_name = ''; $db_user = ''; $db_passwd = ''; $db_prefix = ''; $db_server = ''; if (!file_exists($file_base . '/Settings.php')) { warn_exit(do_lang_tempcode('BAD_IMPORT_PATH', escape_html('Settings.php'))); } require($file_base . '/Settings.php'); return array($db_name, $db_user, $db_passwd, $db_prefix, $db_server); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function probe_db_access($file_base)\n\t{\n\t\treturn array(NULL,NULL,NULL,NULL); // No DB connection needed\n\t}", "function probe_db_access($file_base)\n\t{\n\t\t$dbname='';\n\t\t$dbuser='';\n\t\t$dbpasswd='';\n\t\t$table_prefix='';\n\t\tif (!file_exists($file_base.'/config.php'))\n\t\t\twarn_exit(do_lang_tempcode('BAD_IMPORT_PATH',escape_html('config.php')));\n\t\trequire($file_base.'/config.php');\n\t\t$INFO=array();\n\t\t$INFO['sql_database']=$dbname;\n\t\t$INFO['sql_user']=$dbuser;\n\t\t$INFO['sql_pass']=$dbpasswd;\n\t\t$INFO['sql_tbl_prefix']=$table_prefix;\n\n\t\treturn array($INFO['sql_database'],$INFO['sql_user'],$INFO['sql_pass'],$INFO['sql_tbl_prefix']);\n\t}", "abstract protected static function get_db_file_path();", "public function getDbPath()\n {\n return $this->getSettingArray()[\"db_path\"];\n }", "public function getRealPath()\n\t{\n\t\t// Unfortunately we'd need to store the fake directory hierarchy\n\t\t// in the database, too...\n\t\tthrow new DatabaseFileException('Obtaining the real path is not supported for database files.');\n\t}", "public function checkDatabaseFile()\n {\n return file_exists($this->getDatabasePath());\n }", "public function openSQLite($pathToDB){\r\n //We check the type of file if it exists\r\n if(file_exists($pathToDB)){\r\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\r\n if(finfo_file($finfo, $pathToDB) != \"application/octet-stream\"){\r\n exit(\"Error: Trying to open a \"\r\n . \"non-application/octet-stream type file !\");\r\n }\r\n }\r\n \r\n //Generating PDO params\r\n $pdoParams = \"sqlite:\".$pathToDB;\r\n \r\n //Opening DataBase\r\n $this->openDB($pdoParams);\r\n }", "public function pathToSQLFile();", "public function testCustomDBPath() {\n $dbdata = HermesHelper::getMagentoDBConfig($this->_dbFile);\n $this->assertNotNull((string)$dbdata->host);\n $this->assertNotNull((string)$dbdata->username);\n $this->assertNotNull((string)$dbdata->password);\n $this->assertNotNull((string)$dbdata->dbname);\n\n //From phpunit path, the config file shouldn't be found.\n set_exit_overload(function($message) { Etailers_HermesHelper_Test::setMessage($message); return FALSE; });\n $dbdata = HermesHelper::getMagentoDBConfig();\n unset_exit_overload();\n $this->assertEquals('Unable to load magento db config file.', self::$message);\n }", "public function _db_path($dbname){\n return $this->_db_root_dir.$dbname;\n }", "function db_connect ($path = '') {\n static $db = null;\n \n if ($db === null) {\n $db = new PDO(\"sqlite:$path\");\n $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n \n return $db;\n}", "function mdb( $dsn='Please enter DataSource!' )\n {\n $this->strRealPath = realpath( $dsn );\n if( strlen( $this->strRealPath ) > 0 )\n {\n $this->strDataSource = 'Data Source='.$this->strRealPath;\n $result = true;\n }\n else\n {\n echo \"<br>mdb::mdb() File not found $dsn<br>\";\n $result = false;\n }\n \n $this->RecordsAffected = new VARIANT();\n \n $this->open();\n \n }", "private function fetchDBDump()\n {\n foreach ($this->manifest->files() as $file) {\n if (pathinfo($file, PATHINFO_EXTENSION) == 'sql') {\n return $this->tempDirectory->path($file);\n }\n }\n\n return false;\n }", "function dba_open($path, $mode, $handlername, $param4) {}", "public function getDatabasePath()\n {\n $cityPath = $this->getLibDir() . DS . 'GeoLiteCity.dat';\n $countryPath = $this->getLibDir() . DS . 'GeoIP.dat';\n\n if ($this->isCityDbType()) {\n return $cityPath;\n } else {\n return $countryPath;\n }\n\n return $path;\n }", "public static function useDatabasePath($path){\n return \\Illuminate\\Foundation\\Application::useDatabasePath($path);\n }", "private function connectDB()\n {\n $this->file_db = new \\PDO('sqlite:bonsaitrial.sqlite3');\n // Set errormode to exceptions\n $this->file_db->setAttribute(\n \\PDO::ATTR_ERRMODE,\n \\PDO::ERRMODE_EXCEPTION\n );\n }", "protected static function fileIsAccessible($path)\n {\n }", "public function getFileMountRecords() {}", "static public function set_file($file)\n\t{\n\t\tif (!is_null(self::$dbh) || !file_exists($file))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::$db = $file;\n\t\t\treturn true;\n\t\t}\n\t}", "static public function get_connection($file = null)\n\t{\n\t\tif (is_null(self::$dbh))\n\t\t{\n\t\t\tif (!is_null($file))\n\t\t\t{\n\t\t\t\tself::set_file($file);\n\t\t\t}\n\t\t\tif (empty(self::$dbfile))\n\t\t\t{\n\t\t\t\tthrow new CC_Exception('No database filename given', self);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$this->dbh = new PDO('sqlite:' . self::$dbfile);\n\t\t\t}\n\t\t\tcatch(PdoException $e) {\n\t\t\t\tthrow new CC_Exception('Could not open database file %s', self::$dbfile);\n\t\t\t}\n\t\t}\n\t\treturn self::$dbh;\n\t}", "public function databasePath($path = '')\n {\n return ($this->basePath . DIRECTORY_SEPARATOR . 'database') . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "protected function getDbFile(): string\n {\n $src = $this->options->getDbSource() ?: $this->guessSource();\n $validOptions = ['lando', 'ddev', 'drush', 'file'];\n if (!in_array($src, $validOptions)) {\n throw new InvalidOptionException(\"db-source can only be one of 'lando', 'ddev', 'drush', or 'file'\");\n }\n\n $this->output->writeln(\"<info>Getting SQL file from source '{$src}'</info>\");\n\n if ($src == 'file') {\n if (!$this->input->getOption('db-file')) {\n throw new InvalidOptionException(\"db-file is required if db-source is set to 'file'\");\n }\n return realpath($this->input->getOption('db-file'));\n }\n\n // Get SQL from Lando or Drush.\n $sqlFileName = tempnam(sys_get_temp_dir(), 'axldb');\n $drushCmd = 'drush sql:dump > ' . $sqlFileName;\n if ($src == 'lando') {\n $drushCmd = 'lando ' . $drushCmd;\n }\n if ($src == 'ddev') {\n $drushCmd = 'ddev ' . $drushCmd;\n }\n\n $this->execCmd($drushCmd);\n return $sqlFileName;\n }", "function readDB() {\n\n\t\t// READ FROM MYSQL, kh_mod 0.3.0, add\n\t\treturn ($this->sqldatabase)?\n\t\t\t\t $this->readDBSQL()\n\t\t\t\t :\n\t\t\t\t $this->readDBFlatfile();\n\t}", "public function __construct($fileName){\n // load db credentials from protected secrets file \n \t$secretsFile = fopen($fileName,\"r\") or die (\"Unable to open file! \" . $fileName);\n\n $servername = trim(fgets($secretsFile)); \n $username = trim(fgets($secretsFile)); \n $password = trim(fgets($secretsFile));\n\n fclose($secretsFile); \n \n $this->db = new dbConnect($servername, $username, $password); \n }", "function loadServer($db, $file)\n{\n if ((int) $file['serverId'])\n {\n // load from the db\n $db = dbConnect();\n $stmt = $db->query(\"SELECT * FROM file_server WHERE id = \" . (int) $file['serverId']);\n $uploadServerDetails = $stmt->fetch(PDO::FETCH_ASSOC);\n if (!$uploadServerDetails)\n {\n return false;\n }\n\n return $uploadServerDetails;\n }\n\n return false;\n}", "private function getCrendentials()\n {\n $db = parse_ini_file('db.ini');\n $this->username = $db['user'];\n $this->password = $db['password'];\n $this->host = $db['host'];\n $this->dbname = $db['dbname'];\n }", "public function getDatabaseMounts() {}", "public static function openDatabaseFile($file, iKey $mkey, &$error)\r\n\t{\r\n\t\t$reader = ResourceReader::openFile($file);\r\n\t\tif($reader == null)\r\n\t\t{\r\n\t\t\t$error = \"file '\" . $file . '\" does not exist.';\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$db = Database::loadFromKdbx($reader, $mkey, $error);\r\n\t\t$reader->close();\r\n\t\treturn $db;\r\n\t}", "function get_file_info( $fn ) {\n // Prepare SELECT statement to search for the file.\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $row = $stmt->fetch();\n\n return $row;\n }", "public function databasePath($path = '')\n {\n return $this->basePath('database').($path ? DIRECTORY_SEPARATOR.$path : $path);\n }", "public function databasePath($path = '')\n {\n return ($this->databasePath ?? $this->basePath.DIRECTORY_SEPARATOR.'database').($path ? DIRECTORY_SEPARATOR.$path : $path);\n }", "public function open_readable_database() {\n\t\treturn $this->open_writable_database();\n\t}", "function probe() {\n $this->probe_errors = array();\n if (!function_exists('mysql_connect')){\n $this->probe_errors[] = sprintf(DB_ERR_EXTENSION_UNAVAILABLE,'MySQL');\n return false;\n }\n if (!($conn = @mysql_connect($this->server.(($this->port==\"\")?\"\":\":\".$this->port),\n $this->login,\n $this->password )) ) {\n $this->probe_errors[] = sprintf(DB_ERR_CONNECT_SERVER,$this->server);\n return false;\n }\n if (!@mysql_select_db($this->db,$conn)){\n $this->probe_errors[] = sprintf(DB_ERR_CONNECT_DATABASE,$this->db);\n return false;\n }\n return true;\n }", "protected function _readDbConfig()\n {\n $this->_host = Config::DB_HOST;\n $this->_user = Config::DB_USER;\n $this->_password = Config::DB_PASS;\n $this->_dbName = Config::DB_NAME;\n }", "function GetFileRecord($pkey, $pvalue)\n {\n //if (isset($this->cache_filerecord[$pvalue]))\n //\treturn $this->cache_filerecord[$pvalue];\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n if ( !preg_match(\"/\\\\/$/si\",$this->datafile) )\n {\n //echo \"f=\".$this->datafile;\n return $this->datafile;\n }\n //guardo prima quelo con la chiave primaria\n if ( file_exists($this->datafile . \"/\" . urlencode($pvalue) . \".php\") )\n {\n $data = file_get_contents($this->datafile . \"/\" . urlencode($pvalue) . \".php\");\n $data = removexmlcomments($data);\n //dprint_xml($data);\n if ( preg_match('/<' . $tablename . '>(.*)<' . $pkey . '>' . xmlenc(encode_preg($pvalue)) . '<\\/' . $pkey . '>/s',$data) )\n {\n $this->cache_filerecord[$pvalue] = $this->datafile . \"/\" . urlencode($pvalue) . \".php\";\n return $this->datafile . \"/\" . urlencode($pvalue) . \".php\";\n }\n }\n //cerco in tutti i files\n $pvalue = xmlenc($pvalue);\n $pvalue = encode_preg($pvalue);\n //dprint_r($pvalue);\n if ( !file_exists($this->datafile) )\n return false;\n $handle = opendir($this->datafile);\n while (false !== ($file = readdir($handle)))\n {\n $tmp2 = null;\n if ( preg_match('/.php$/s',$file) and !is_dir($this->datafile . \"/$file\") )\n {\n $data = file_get_contents($this->datafile . \"/$file\");\n $data = removexmlcomments($data);\n //dprint_r(strlen($data));\n //if (preg_match('/<' . $tablename . '>(.*)<' . $pkey . '>' . $pvalue . '<\\/' . $pkey . '>/s', $data))\n if ( preg_match('/<' . $pkey . '>' . $pvalue . '<\\/' . $pkey . '>/s',$data) )\n {\n $this->cache_filerecord[$pvalue] = $this->datafile . \"/$file\";\n return $this->datafile . \"/$file\";\n }\n }\n }\n return false;\n }", "public function getDatabaseAccess(): array{\n if(!$this->logged) throw new ClientNotLogged();\n else\n return $this->rootClient ? LPGP_CONF[\"mysql\"][\"ext_root\"] : LPGP_CONF[\"mysql\"][\"ext_normal\"];\n }", "public static function getLookupPath() {\n return self::$lookup_path;\n }", "public static function checkDB($name){\nif(!(\\Storage::disk('masterDB')->exists($name))){\nnew \\SQLite3(database_path('master').DS.$name);\n}\n}", "public function getDbName(): string\n {\n $parts = pathinfo($this->dbPath);\n\n return $parts['filename'];\n }", "public function database($fileName = '/Lib.db.php')\n {\n require_once __LIBRARY_PATH.$fileName;\n $this->db = new Database();\n }", "public function read($path)\n {\n }", "function cemhub_retrieve_file_details($filename) {\n $file_info = db_select('file_managed', 'f')\n ->fields('f', array('fid'))\n ->condition('filename', $filename, '=')\n ->execute()\n ->fetchAssoc();\n\n $file = NULL;\n if (!empty($file_info['fid'])) {\n $file = file_load($file_info['fid']);\n }\n\n return $file;\n}", "public static function databasePath(){\n return \\Illuminate\\Foundation\\Application::databasePath();\n }", "public function getDatabaseInfo();", "public function databasePath($path = ''): string\n {\n return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path != '' ? DIRECTORY_SEPARATOR.$path : '');\n }", "protected function initializeDbMountpointsInWorkspace() {}", "function el_access($attr, $path, $data, $volume)\n{\n\tglobal $cfg, $usr, $el_usr_limits, $el_pfs_size;\n\n\t// Hide files starting with dot\n\tif (strpos(basename($path), '.') === 0)\n\t{\n\t\t// set read+write to false, other (locked+hidden) set to true\n\t\treturn !($attr == 'read' || $attr == 'write');\n\t}\n\n\t// Check write permission\n\tif ($attr == 'write' && !$usr['auth_write'])\n\t{\n\t\treturn false;\n\t}\n\n\treturn null; // let elFinder decide it itself\n}", "private function _getPathInfo ($file)\n {\n return pathinfo($file);\n }", "public function testWith_DsnIsDriverAndPathOptExt()\n {\n $config = Config::with(\"dir:{$this->dir}\", array('ext'=>'mock'));\n $this->checkWithResult($config);\n }", "public static function connectFromFile($file){\r\n if(!file_exists($file))\r\n {\r\n throw new main\\mgLibs\\exceptions\\System('DB Connection File does not exits', main\\mgLibs\\exceptions\\Codes::MYSQL_MISING_CONFIG_FILE);\r\n }\r\n \r\n self::$_instance = new self();\r\n \r\n include $file;\r\n \r\n foreach($config as $connectionName => $config)\r\n {\r\n if ($config['host']) \r\n {\r\n if(!extension_loaded('PDO'))\r\n {\r\n throw new main\\mgLibs\\exceptions\\System('Missing PDO Extension', main\\mgLibs\\exceptions\\Codes::MYSQL_MISING_PDO_EXTENSION);\r\n }\r\n\r\n try{ \r\n self::$_instance->connection[$connectionName] = new \\PDO(\"mysql:host=\".$config['host'].\";dbname=\".$config['name'], $config['user'], $config['pass']); \r\n\r\n self::$_instance->connection[$connectionName]->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\r\n } catch (\\Exception $ex) {\r\n throw new main\\mgLibs\\exceptions\\System('SQL Connection Error',exceptions\\Codes::MYSQL_CONNECTION_FAILED);\r\n } \r\n }\r\n }\r\n \r\n return true;\r\n }", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "function raw_db_open_database($database, $path = \"\", $u = null, $p = null)\r\n{\r\n global $g_current_db;\r\n\r\n if (!$path) {\r\n $path = pathinfo(__FILE__);\r\n $path = $path[\"dirname\"] . \"/\";\r\n }\r\n\r\n if (!file_exists($database))\r\n\r\n $database = $path . \"sqlite_\" . $database . \".db\";\r\n\r\n $g_current_db = sqlite_open($database, 0666, $sql_error);\r\n if (!$g_current_db) {\r\n trigger_error(__FUNCTION__ . $sql_error);\r\n return false;\r\n } else return $g_current_db;\r\n}", "public function get($filepath);", "abstract public function read($path);", "function db_connect($role) {\n // restrict access so that only users listed in the access.txt file can view data\n if ($role !== \"safety_manager_or_dean\" && $role !== \"facility_manager\") { // && $role !== \"lab_pi\") {\n return NULL;\n }\n \n\ttry {\n\t\t$conn = new PDO(\"mysql:host=fsdatabase.web.engr.illinois.edu;dbname=fsdataba_fsdatabase;charset=latin1\", \"\", \"\");\n\t\t$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n\t} catch (PDOException $e) {\n\t\techo \"<div>Could not connect to database</div>\";\n\t\t$conn = NULL;\n\t}\n\treturn $conn;\n}", "public function getDbTemplatePath()\n {\n return $this->getSettingArray()[\"db_template_path\"];\n }", "public function initializeTemporaryDBmount() {}", "function log_connection() {\r\n $USE_FILE = FALSE;\r\n\r\n if ($USE_FILE === TRUE) {\r\n _conn_log_file();\r\n } else {\r\n _conn_log_db();\r\n }\r\n}", "public function read($path);", "function __construct(){\n $this->open('S:\\DATABASE\\AP3500_PLUS.SQLite');\n\t \n }", "public static function readlink($path, &$retval) {\n\n Log::in(\"passthru - readlink\");\n\n $retval = readlink($path);\n if ( $retval === false ) {\n Log::out(\"passthru - readlink - failed\");\n return -FUSE_ENOENT;\n }\n\n Log::out(\"passthru - readlink\");\n return 0;\n\n }", "function get_res_odbc_data(){\n\t$data = Null;\n\t$res_odbc = '/etc/asterisk/res_odbc.conf';\n\tif (file_exists($res_odbc)){\n\t\t$data = parse_ini_file($res_odbc, true);\n\t}\n\treturn $data;\n}", "protected function getInstancePath() {}", "public function getFoundPath() {}", "function readDBFlatfile($pathDB='default') {\n\n\t\t// INIT RETURN VALUES\n\t\t$readFolders = $readImages = false;\n\n\t\t// GET DEFAULT PATH\n\t\tif ($pathDB === 'default') {\n\t\t\t$fDB = DATA_FOLDER .'mg2db_fdatabase.php';\n\t\t\t$iDB = DATA_FOLDER .'mg2db_idatabase.php';\n\t\t}\n\t\t// GET RESTORE PATH (ADMIN ONLY)\n\t\telseif ($backup = $this->getBackupPath($pathDB)) {\n\t\t\t$fDB = sprintf($backup, 'fdatabase');\n\t\t\t$iDB = sprintf($backup, 'idatabase');\n\t\t}\n\t\telse return array($readFolders, $readImages);\t// no valid path\n\n\t\t// ************************************ FOLDER DATABASE ************************************ //\n\n\t\t// RESET FOLDER ARRAY\n\t\t$this->all_folders = array();\n\t\t$this->folderautoid = 0;\n\n\t\t$now = time();\t// in order to check if the folder or image date in future\n\t\tdo {\n\t\t\tif (!is_file($fDB)) {\n\t\t\t\t$this->folderautoid = 1;\n\t\t\t\t$this->all_folders[$this->folderautoid] = $this->getDefaultRootFolder();\n\t\t\t\tbreak; \t\t\t\t\t\t\t\t// no data file\n\t\t\t}\n\n\t\t\t$fp = fopen($fDB,'rb');\n\t\t\tif (!is_resource($fp))\tbreak;\t// cannot open data file\n\n\t\t\t$num_records\t\t = 0;\n\t\t\t$this->folderautoid = (int)fgets($fp, 16);\n\t\t\tif (defined('USER_ADMIN')) {\n\t\t\t\twhile (!feof($fp)) {\n\t\t\t\t\tif (fgets($fp, 2) !== '#')\t\t\t\t\tcontinue;\t// no data row?\n\t\t\t\t\t$record = fgetcsv($fp, 4600, \"\\t\");\n\t\t\t\t\tif (($folderID = (int)$record[0]) < 1) continue;\t// invalid folder id\n\t\t\t\t\t$this->all_folders[$folderID] = $record;\n\t\t\t\t\t$num_records++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\twhile (!feof($fp)) {\n\t\t\t\t\tif (fgets($fp, 2) !== '#')\t\t\t\t\tcontinue;\t// no data row?\n\t\t\t\t\t$record = fgetcsv($fp, 4600, \"\\t\");\n\t\t\t\t\tif (($folderID = (int)$record[0]) < 1) continue;\t// invalid folder id\n\t\t\t\t\tif ((int)$record[4] > $now)\t\t\t\tcontinue;\t// date in future?\n\t\t\t\t\tif ((int)$record[5] < 0) \t\t\t\tcontinue;\t// folder locked?\n\t\t\t\t\t$this->all_folders[$folderID] = $record;\n\t\t\t\t\t$num_records++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t\t$readFolders = $num_records;\n\t\t}\n\t\twhile(0);\n\n\t\t// ************************************ IMAGE DATABASE ************************************ //\n\n\t\t// RESET IMAGE ARRAY\n\t\t$this->all_images\t= array();\n\t\t$this->autoid\t\t= 0;\n\n\t\tdo {\n\t\t\tif (!is_file($iDB)) \t\tbreak;\t// no data file\n\n\t\t\t$fp = fopen($iDB,'rb');\n\t\t\tif (!is_resource($fp))\tbreak;\t// cannot open data file\n\n\t\t\t$num_records = 0;\n\t\t\t$this->autoid = (int)fgets($fp, 16);\n\t\t\tif (defined('USER_ADMIN')) {\n\t\t\t\twhile (!feof($fp)) {\n\t\t\t\t\tif (fgets($fp, 2) !== '#')\t\t\t\t\tcontinue;\t// no data row?\n\t\t\t\t\t$record = fgetcsv($fp, 4600, \"\\t\");\n\t\t\t\t\tif (($imageID = (int)$record[0]) < 1)\tcontinue;\t// invalid image id\n\t\t\t\t\t$this->all_images[$imageID] = $record;\n\t\t\t\t\t$num_records++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\twhile (!feof($fp)) {\n\t\t\t\t\tif (fgets($fp, 2) !== '#')\t\t\t\t\tcontinue;\t// no data row?\n\t\t\t\t\t$record = fgetcsv($fp, 4600, \"\\t\");\n\t\t\t\t\tif (($imageID = (int)$record[0]) < 1)\tcontinue;\t// invalid image id\n\t\t\t\t\tif ((int)$record[4] > $now)\t\t\t\tcontinue;\t// date in future?\n\t\t\t\t\tif ((int)$record[5] < 0) \t\t\t\tcontinue;\t// folder locked?\n\t\t\t\t\t$this->all_images[$imageID] = $record;\n\t\t\t\t\t$num_records++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t\t$readImages = $num_records;\n\t\t}\n\t\twhile(0);\n\n\t\treturn array($readFolders, $readImages);\n\t}", "function getDatabaseConfig()\n{\n $dsnDetail = [];\n $databaseConfig = require dirname(__FILE__) . \"/../config/database.php\";\n preg_match(\"/mysql:host=(.+);dbname=([^;.]+)/\", $databaseConfig[\"dsn\"], $dsnDetail);\n $dsnDetail[3] = $databaseConfig[\"username\"];\n $dsnDetail[4] = $databaseConfig[\"password\"];\n return $dsnDetail;\n}", "function readConfigDB($dbHandle) {\n // virtual\n $this->debugLog(\"this configReader does not implement readConfigDB()\");\n }", "public function getDatabase(){\n $url = $this->urlWrapper() . URLResources::DATABASE;\n return $this->makeRequest($url, \"GET\", 2);\n }", "function open($save_path, $session_name)\n {\n if (MDB2::isError($this->_connect($this->options['dsn']))) {\n return false;\n } else {\n return true;\n }\n }", "abstract public function getLocalPathByFileHandle($handle);", "function getDetails($file_id)\n {\n $file_id = Misc::escapeInteger($file_id);\n $stmt = \"SELECT\n *\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment,\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment_file\n WHERE\n iat_id=iaf_iat_id AND\n iaf_id=$file_id\";\n $res = DB_Helper::getInstance()->getRow($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return \"\";\n } else {\n // don't allow customers to reach internal only files\n if (($res['iat_status'] == 'internal')\n && (User::getRoleByUser(Auth::getUserID(), Issue::getProjectID($res['iat_iss_id'])) <= User::getRoleID('Customer'))) {\n return '';\n } else {\n return $res;\n }\n }\n }", "public function testRetrieveFilePath()\n {\n $this->file = 'test';\n\n self::assertEquals('test', $this->getFile());\n }", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }", "public function access() {\n if ( ! isset($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']) ) {\n return false;\n }\n return true;\n }", "protected function getDatabase() {}", "function get_dbname() { return reset(explode('.', $_SERVER['SERVER_NAME'])); }", "function openSqliteDB(){\n\t//Create (connect) SQLite database in file\n\t$db = new PDO('sqlite:../service/celab.sqlite');\n\t//Set erromode to exceptions\n\t$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\t\n\treturn $db;\n}", "public function loadDBProperties()\n\t{\n\t\t$xml = simplexml_load_file(self::DB_PROPERTIES);\n\t\t$this->hostname = (string)$xml->hostname;\n\t\t$this->username = (string)$xml->username;\n\t\t$this->password = (string)$xml->password;\n\t\t$this->database = (string)$xml->database;\n\t}", "function is_file_in_db( $fn ) {\n // Prepare SELECT statement to search for the file.\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $rows = count($stmt->fetchAll());\n\n if( $rows ) {\n return true;\n } else {\n return false;\n }\n }", "public static function getConnection()\n {\n $dbLocation = $_SERVER['DOCUMENT_ROOT'].'\\\\src\\\\Demo\\\\PhpApi\\\\Config\\\\demo.db';\n\n try {\n $pdo = new \\PDO('sqlite:'.$dbLocation); \n } catch (PDOException $exception) {\n echo \"Error:\" . $exception->getMessage();\n }\n return $pdo; \n }", "public function runFile($path)\n\t{\n\t\ttry{\n\t\t\tif(!($sql = file_get_contents($path)))\n\t\t\t\tthrow new DatabaseConnectionNotice('SQL file not found at ' . $path);\n\n\t\t\tif($this->multi_query($sql))\n\t\t\t{\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif($result = $this->store_result())\n\t\t\t\t\t\t$result->free();\n\t\t\t\t}while($this->more_results() && $this->next_result());\n\t\t\t}else{\n\t\t\t\t$this->throwError();\n\t\t\t}\n\t\t\treturn true;\n\t\t}catch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "function DataAccessManager() {\r\n\t\t@session_start();\r\n\t\t//Assumes that if settings are not in current directory, they're one directory up.\r\n\t\tif( file_exists('./settings.php') ) {\r\n\t\t\t$file = fopen('./settings.php', 'rb');\r\n\t\t}\r\n\t\telse if( file_exists( '../settings.php') ) {\r\n\t\t\t$file = fopen('../settings.php', 'rb');\r\n\t\t}\r\n\t\t\r\n\t\tif($file){\r\n\t\t\tfor($i = 0; !feof($file); $i++){\r\n\t\t\t\t$input = fgets($file);\r\n\t\t\t\tif (strpos($input, ':') !== FALSE){\r\n\t\t\t\t\t$input = explode(':', $input);\r\n\t\t\t\t\t$$input[0] = trim($input[1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->success = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->dbname = $name;\r\n\t\tfclose($file);\r\n\t\t@$this->link = mysql_connect($host, $user, $pass);\r\n\t\tif(!$this->link){\r\n\t\t\techo \"<br>Could not connect to database. Please try again later.<br>\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tmysql_select_db($name);\r\n\t\t$this->success = true;\r\n\t}", "protected function openLogFile() {}", "public function testWith_DsnIsExtOptPath()\n {\n $config = Config::with('mock', array('path'=>$this->dir));\n $this->checkWithResult($config);\n }", "public static function load_db_conf(){\n $db_config = include(CONFIGPATH.'db.conf.php');\n return $db_config;\n }", "public function getSchemaPath() {\n\t\tglobal $IP;\n\t\tif ( file_exists( \"$IP/maintenance/\" . $this->getType() . \"/tables.sql\" ) ) {\n\t\t\treturn \"$IP/maintenance/\" . $this->getType() . \"/tables.sql\";\n\t\t} else {\n\t\t\treturn \"$IP/maintenance/tables.sql\";\n\t\t}\n\t}", "function establishConn($iniFile) {\n\n if ($GLOBALS['dbConn'] != null) {\n\n $db = parse_ini_file($iniFile);\n\n $user = $db['user'];\n $pass = $db['pass'];\n $name = $db['name'];\n $host = $db['host'];\n $type = $db['type'];\n\n // NOTE: Make sure you close this by making dbConn = null anytime you\n // expect the server to crash / shut down for whatever reason.\n $GLOBALS['dbConn'] = new PDO($type . \":host=\" . $host . \";dbname=\" . $name,\n $user, $pass, array(PDO::ATTR_PERSISTENT => true));\n\n }\n\n return $GLOBALS['dbConn'];\n\n}", "protected function openFile() {}", "private static function access()\n {\n $files = ['Path', 'Url'];\n $folder = static::$root.'Access'.'/';\n\n self::call($files, $folder);\n }", "private static function getConf(){\n if(!self::$conf){\n self::$conf = require('db.conf.php');\n }\n\n return self::$conf;\n }", "private static function _readCacheFile() {\r\n if (!self::$_hasCacheFile) {\r\n self::_createCacheFile();\r\n }\r\n\r\n $paths = array();\r\n require(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n self::$_paths = $paths;\r\n }", "private function connect(){\n $cred = parse_ini_file(dirname(__FILE__) . \"/../db_key.ini\");\n\n try{\n\t\t $conn = new PDO(\"mysql:host=$cred[servername];dbname=$cred[dbname]\", $cred['username'], $cred['password']);\n\n\t\t // set the PDO error mode to exception\n\t\t $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t return $conn;\n }\n\t\tcatch(PDOException $e){\n\t\t \techo \"Connection failed: \" . $e->getMessage();\n }\n\t\treturn null;\n\t}", "function __construct() {\n if (!file_exists($this->path)) {\n $database = fopen($this->path, 'w');\n fclose($database);\n }\n }", "function xmldatabaseexists($databasename, $path = \".\", $conn = false)\n{\n return (file_exists(\"$path/$databasename\"));\n}", "function getDatabaseConnection($dbKey){\n $url = parse_url($dbKey);\n $host = $url[\"host\"];\n $db = substr($url[\"path\"], 1);\n $user = $url[\"user\"];\n $pass = $url[\"pass\"];\n return new PDO(\"mysql:host=$host;dbname=$db;\", $user, $pass);\n}", "function __construct () {\n $lines = file('../../dbinfo.txt');\n\t $dbserver = trim($lines[0]);\n\t $uid = trim($lines[1]);\n\t $pw = trim($lines[2]);\n\t $dbname = trim($lines[3]);\n \n //Connect to the mysql server and get back our link_identifier\n $link = mysqli_connect($dbserver, $uid, $pw, $dbname)\n \t\t\tor die('Could not connect: ' . mysqli_error($link));\n $this->link = $link;\n }", "function getFile($file_id) {\n global $pdo;\n $statement = $pdo->prepare('SELECT * FROM `file` WHERE `sid` = :id');\n $statement->bindParam(\":id\", $file_id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "public function connect($schema=':memory:') { \t\n \tif (null != $this->sqlite3) {\n \t\treturn $this->sqlite3;\n \t}\n \t\n if(!$this->sqlite3=new SQLite3($schema)){\n \tY::errors(403,'sqlite cache file: $sqliteDbFile can\\'t open!');\t \t\n } ;\t\n return $this->sqlite3;\n }", "public function list_dbs(){\n \t$db=array();\n \t$d=dir($this->_db_root_dir);\n \twhile ($tmp=$d->read()){\n if(is_dir($this->_db_root_dir.$tmp) && substr($tmp,0,1)!='.' )\n $db[]=$tmp;\n \t}\t\n \treturn $db;\n }" ]
[ "0.68069917", "0.6443201", "0.6162542", "0.54332876", "0.5347867", "0.5033905", "0.50252146", "0.50097924", "0.50057846", "0.4993126", "0.49599037", "0.4949606", "0.49376366", "0.4861799", "0.48533604", "0.4835742", "0.4825499", "0.48177904", "0.48081613", "0.48027727", "0.47928044", "0.47486487", "0.47441128", "0.47395742", "0.47351053", "0.47339398", "0.4729366", "0.47246936", "0.47237483", "0.4711174", "0.46834695", "0.46702275", "0.46571037", "0.46425074", "0.46041125", "0.46007892", "0.45957083", "0.45923233", "0.45770207", "0.4568976", "0.45644826", "0.45623258", "0.45550907", "0.45493135", "0.45286086", "0.45229426", "0.45119992", "0.45087576", "0.45044363", "0.4499863", "0.44565567", "0.44512495", "0.44410726", "0.44383398", "0.44361132", "0.44276845", "0.44244847", "0.44050577", "0.44040245", "0.4401696", "0.4400438", "0.43935215", "0.43893906", "0.4387524", "0.4382555", "0.43724376", "0.43671483", "0.4364768", "0.43557617", "0.43483204", "0.43476948", "0.434534", "0.4340215", "0.4338288", "0.43376827", "0.4334516", "0.4332897", "0.43263555", "0.43222424", "0.43203786", "0.43179163", "0.43163148", "0.43153685", "0.4313353", "0.43125433", "0.43124726", "0.43078852", "0.4307103", "0.4306412", "0.43060705", "0.4304887", "0.42999482", "0.42994338", "0.42990413", "0.42957577", "0.42953876", "0.42938608", "0.42915612", "0.4290241", "0.42884943" ]
0.6098885
3
Convert an IP address from phpBB hexadecimal string format.
protected function _un_phpbb_ip($ip) { if (strlen($ip) < 8) { return '127.0.0.1'; } $_ip = strval(hexdec($ip[0] . $ip[1])) . '.' . strval(hexdec($ip[2] . $ip[3])) . '.' . strval(hexdec($ip[4] . $ip[5])) . '.' . strval(hexdec($ip[6] . $ip[7])); return $_ip; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex2ip($hex) {\n if (strlen($hex)==8) {\n $ret=hexdec(substr($hex,0,2)).'.'\n .hexdec(substr($hex,2,2)).'.'\n .hexdec(substr($hex,4,2)).'.'\n .hexdec(substr($hex,6,2));\n } elseif (strlen($hex)==32) {\n $ret=substr($hex,0,4).':'\n .substr($hex,4,4).':'\n .substr($hex,8,4).':'\n .substr($hex,12,4).':'\n .substr($hex,16,4).':'\n .substr($hex,20,4).':'\n .substr($hex,24,4).':'\n .substr($hex,28,4);\n } else {\n $ret=$hex;\n }\n return $ret;\n}", "function bintoip($ip) {\n\t\t\tif (!preg_match(\"/^[0-1]{0,128}$/\", $ip))\n\t\t\t\treturn false;\n\n\t\t\t$ip = sprintf(\"%0128s\", $ip);\n\n\t\t\t$ip = str_split($ip, 4);\n\t\t\tforeach ($ip as $index => $value)\n\t\t\t\t$ip[$index] = dechex(bindec($value));\n\n\t\t\treturn implode(\":\", str_split(implode(\"\", $ip), 4));\n\t\t}", "function decode_ip($ip)\n{\n\tif (filter_var($ip, FILTER_VALIDATE_IP)) {\n\t\t// We have a valid IPv4 or IPv6 address, return it.\n\t\treturn $ip;\n\t}\n\n\tif (strlen($ip) == 8) {\n\t\t// Convert hex IPv4 address to dotted IP form (mainly used in phpBB).\n\t\t// For example: 7f000000 -> 127.0.0.1\n\t\t$ip = hexdec(substr($ip, 0, 2)) .'.'. hexdec(substr($ip, 2, 2)) .'.'. hexdec(substr($ip, 4, 2)) .'.'. hexdec(substr($ip, 6, 2));\n\t\treturn $ip;\n\t}\n\n\tif (is_numeric($ip)) {\n\t\t// Convert a numeric (long) encoded IP address.\n\t\treturn long2ip(\"0x{$ip}\");\n\t}\n\n\treturn '127.0.0.1';\n}", "function _un_phpbb_ip($ip)\n\t{\n\t\tif (strlen($ip)<8) return '127.0.0.1';\n\n\t\t$_ip=strval(hexdec($ip[0].$ip[1])).'.'.strval(hexdec($ip[2].$ip[3])).'.'.strval(hexdec($ip[4].$ip[5])).'.'.strval(hexdec($ip[6].$ip[7]));\n\t\treturn $_ip;\n\t}", "private static function IPv6ToRawHex( $ip ) {\n $ip = self::sanitizeIP( $ip );\n if ( !$ip ) {\n return null;\n }\n $r_ip = '';\n foreach ( explode( ':', $ip ) as $v ) {\n $r_ip .= str_pad( $v, 4, 0, STR_PAD_LEFT );\n }\n return $r_ip;\n }", "function decode_ip($encoded_ip)\n{\n\t$ip_sep[0] = substr($encoded_ip, 0, 2);\n\t$ip_sep[1] = substr($encoded_ip, 2, 2);\n\t$ip_sep[2] = substr($encoded_ip, 4, 2);\n\t$ip_sep[3] = substr($encoded_ip, 6, 2);\n\n\treturn hexdec($ip_sep[0]).'.'.hexdec($ip_sep[1]).'.'.hexdec($ip_sep[2]).'.'.hexdec($ip_sep[3]);\n}", "protected function _ipFromHex($hex='')\n {\n $quad = \"\";\n if(strlen($hex) == 8) {\n $quad .= hexdec(substr($hex, 0, 2)) . \".\";\n $quad .= hexdec(substr($hex, 2, 2)) . \".\";\n $quad .= hexdec(substr($hex, 4, 2)) . \".\";\n $quad .= hexdec(substr($hex, 6, 2));\n }\n\n return $quad;\n }", "protected function _un_phpbb_ip($ip)\n {\n $_ip = strval(hexdec($ip[0] . $ip[1])) . '.' . strval(hexdec($ip[2] . $ip[3])) . '.' . strval(hexdec($ip[4] . $ip[5])) . '.' . strval(hexdec($ip[6] . $ip[7]));\n return $_ip;\n }", "static private function filterIP($input) {\n $in_addr = @inet_pton($input);\n if ($in_addr === false) {\n return 'badip-' . self::filterEvilInput($input, self::HEX_EXTENDED);\n }\n return inet_ntop($in_addr);\n }", "public function decodeIp($ipaddress = '')\n {\n return inet_ntop($ipaddress);\n }", "public static function convertIpAddress($ip_address){\n return long2ip($ip_address);\n }", "protected function _phpbb_ip($ip)\n {\n $ip_apart = explode('.', $ip);\n $_ip = dechex($ip_apart[0]) . dechex($ip_apart[1]) . dechex($ip_apart[2]) . dechex($ip_apart[3]);\n return $_ip;\n }", "function ipToDec($ipbin) {\n\n $expl = explode('.',$ipbin);\n\n $n = \"\";\n\n for($i=0; $i<4; $i++) {\n\n $n.= (string) bindec($expl[$i]);\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $n.=\".\";\n }\n \n }\n\n return $n;\n\n}", "function ints_to_ip6($a) {\n\t$b = array();\n\tforeach ($a as $i) {\n\t\t$b[] = dechex($i);\n\t}\n\t$s = implode(':', $b);\n\t$s = preg_replace('/(^|:)0(:0)+(:|$)/', '::', $s, 1);\n\treturn $s;\n}", "protected static function fixIpv6($ip){\n\t\t\t// fix double colon\n\t\t\tif(strpos($ip,'::')!==false)$ip=str_replace('::',str_repeat(':',9-substr_count($ip,':')),$ip);\n\t\t\t// fix each slot\n\t\t\t$ip=explode(':',$ip);\n\t\t\tforeach($ip as $k=>$v){\n\t\t\t\t// fix empty/compressed slots\n\t\t\t\t$ip[$k]=$v=str_pad($v,4,'0',STR_PAD_LEFT);\n\t\t\t\t// fix ipv4-style slot\n\t\t\t\tif(strpos($v,'.')!==false){\n\t\t\t\t\t// initially empty buffer\n\t\t\t\t\t$ip[$k]='';\n\t\t\t\t\t// replace each number(byte) with a two-digit hex representation\n\t\t\t\t\tforeach(explode('.',$v) as $v2){\n\t\t\t\t\t\t$v=dechex(min((int)$v2,255));\n\t\t\t\t\t\tif(strlen($v)==1)$v='0'.$v;\n\t\t\t\t\t\t$ip[$k].=$v;\n\t\t\t\t\t}\n\t\t\t\t\t// add colon in between two pairs(bytes) (FFFFFFFF=>FFFF:FFFF)\n\t\t\t\t\t$ip[$k]=implode(':',str_split($ip[$k],4));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn strtoupper(implode(':',$ip));\n\t\t}", "Function ip2float($ipstring) {\r\n $num = (float)sprintf(\"%u\",ip2long($ipstring));\r\n return $num;\r\n}", "function uncompress($ip) {\n\t\t\tif (!($type = IPv6::validate_ip($ip)))\n\t\t\t\treturn false;\n\n\t\t\t// Add additional colon's, until 7 (or 6 in case of an IPv4 (mapped) address\n\t\t\twhile (substr_count($ip, \":\") < (substr_count($ip, \".\") == 3 ? 6 : 7))\n\t\t\t\t$ip = substr_replace($ip, \"::\", strpos($ip, \"::\"), 1);\n\n\t\t\t$ip = explode(\":\", $ip);\n\n\t\t\t// Replace the IPv4 address with hexadecimals if needed\n\t\t\tif (in_array($type, array(\"ipv4\", \"ipv4_mapped\"))) {\n\t\t\t\t$ipv4 = $ip[count($ip)-1];\n\t\t\t\t$ipv4hex = IPv4::iptohex($ipv4);\n\t\t\t\t$hex = sprintf(\"%08s\", IPv4::iptohex($ipv4));\n\t\t\t\t$ip[count($ip)-1] = substr($hex, 0, 4);\n\t\t\t\t$ip[] = substr($hex, 4, 4);\n\t\t\t}\n\n\t\t\t// Add leading 0's in every part, up until 4 characters\n\t\t\tforeach ($ip as $index => $part)\n\t\t\t\t$ip[$index] = sprintf(\"%04s\", $part);\n\n\t\t\treturn implode(\":\", $ip);\n\t\t}", "private function ipToHex($ipAddress)\n {\n $hex = '';\n if (strpos($ipAddress, ',') !== false)\n {\n $splitIp = explode(',', $ipAddress);\n $ipAddress = trim($splitIp[0]);\n }\n $isIpV6 = false;\n $isIpV4 = false;\n if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false)\n {\n $isIpV6 = true;\n }\n elseif (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false)\n {\n $isIpV4 = true;\n }\n if (! $isIpV4 && ! $isIpV6)\n {\n return false;\n }\n // IPv4 format\n if ($isIpV4)\n {\n $parts = explode('.', $ipAddress);\n for ($i = 0; $i < 4; $i++)\n {\n $parts[ $i ] = str_pad(dechex($parts[ $i ]), 2, '0', STR_PAD_LEFT);\n }\n $ipAddress = '::' . $parts[0] . $parts[1] . ':' . $parts[2] . $parts[3];\n $hex = implode('', $parts);\n } // IPv6 format\n else\n {\n $parts = explode(':', $ipAddress);\n // If this is mixed IPv6/IPv4, convert end to IPv6 value\n if (filter_var($parts[ count($parts) - 1 ], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false)\n {\n $partsV4 = explode('.', $parts[ count($parts) - 1 ]);\n for ($i = 0; $i < 4; $i++)\n {\n $partsV4[ $i ] = str_pad(dechex($partsV4[ $i ]), 2, '0', STR_PAD_LEFT);\n }\n $parts[ count($parts) - 1 ] = $partsV4[0] . $partsV4[1];\n $parts[] = $partsV4[2] . $partsV4[3];\n }\n $numMissing = 8 - count($parts);\n $expandedParts = [];\n $expansionDone = false;\n foreach ($parts as $part)\n {\n if (! $expansionDone && $part == '')\n {\n for ($i = 0; $i <= $numMissing; $i++)\n {\n $expandedParts[] = '0000';\n }\n $expansionDone = true;\n }\n else\n {\n $expandedParts[] = $part;\n }\n }\n foreach ($expandedParts as &$part)\n {\n $part = str_pad($part, 4, '0', STR_PAD_LEFT);\n }\n $ipAddress = implode(':', $expandedParts);\n $hex = implode('', $expandedParts);\n }\n // Validate the final IP\n if (! filter_var($ipAddress, FILTER_VALIDATE_IP))\n {\n return false;\n }\n\n return strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));\n }", "public static function sanitizeIP( $ip ) {\n $ip = trim( $ip );\n if ( $ip === '' ) {\n return null;\n }\n if ( self::isIPv4( $ip ) || !self::isIPv6( $ip ) ) {\n return $ip; // nothing else to do for IPv4 addresses or invalid ones\n }\n // Remove any whitespaces, convert to upper case\n $ip = strtoupper( $ip );\n // Expand zero abbreviations\n $abbrevPos = strpos( $ip, '::' );\n if ( $abbrevPos !== false ) {\n // We know this is valid IPv6. Find the last index of the\n // address before any CIDR number (e.g. \"a:b:c::/24\").\n $CIDRStart = strpos( $ip, \"/\" );\n $addressEnd = ( $CIDRStart !== false )\n ? $CIDRStart - 1\n : strlen( $ip ) - 1;\n // If the '::' is at the beginning...\n if ( $abbrevPos == 0 ) {\n $repeat = '0:';\n $extra = ( $ip == '::' ) ? '0' : ''; // for the address '::'\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is at the end...\n } elseif ( $abbrevPos == ( $addressEnd - 1 ) ) {\n $repeat = ':0';\n $extra = '';\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is in the middle...\n } else {\n $repeat = ':0';\n $extra = ':';\n $pad = 8; // 6+2 (due to '::')\n }\n $ip = str_replace( '::',\n str_repeat( $repeat, $pad - substr_count( $ip, ':' ) ) . $extra,\n $ip\n );\n }\n // Remove leading zereos from each bloc as needed\n $ip = preg_replace( '/(^|:)0+(' . RE_IPV6_WORD . ')/', '$1$2', $ip );\n return $ip;\n }", "function ip_to_numbers($val) {\r\n\tlist($A, $B, $C, $D) = explode('.', $val);\r\n\t\r\n\treturn\r\n substr(\"000\".$A,-3). \r\n substr(\"000\".$B,-3). \r\n substr(\"000\".$C,-3). \r\n substr(\"000\".$D,-3);\r\n}", "function iptobin($ip) {\n\t\t\tif (!($type = IPv6::validate_ip($ip)))\n\t\t\t\treturn false;\n\n\t\t\t$ip = IPv6::uncompress($ip);\n\t\t\t$ip = explode(\":\", $ip);\n\n\t\t\t$binip = \"\";\n\t\t\tforeach ($ip as $value)\n\t\t\t\t$binip .= sprintf(\"%016s\", decbin(hexdec($value)));\n\n\t\t\treturn $binip;\n\t\t}", "function inet_to_bits($inet)\n{\n // Unpacks from a binary string into an array\n $unpacked = unpack('A*', $inet);\n $unpacked = str_split($unpacked[1]);\n $ip_bits = '';\n foreach ($unpacked as $char) {\n $ip_bits .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);\n }\n return $ip_bits;\n}", "function inet6_compress($addr)\r\n{\r\n /* PHP provides a shortcut for this operation */\r\n $result = inet_ntop(inet_pton($addr));\r\n return $result;\r\n}", "function encode_ip($dotquad_ip)\n{\n\t$ip_sep = explode('.', $dotquad_ip);\n\treturn sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);\n}", "function myip2long($a) {\r\n $inet = 0.0;\r\n $t = explode(\".\", $a);\r\n for ($i = 0; $i < 4; $i++) {\r\n $inet *= 256.0;\r\n $inet += $t[$i];\r\n };\r\n return $inet;\r\n}", "public static function IP($string){\n\t\treturn filter_var($string, FILTER_VALIDATE_IP);\n\t}", "public static function _inet_pton($ip) {\n\t\t// IPv4\n\t\tif (preg_match('/^(?:\\d{1,3}(?:\\.|$)){4}/', $ip)) {\n\t\t\t$octets = explode('.', $ip);\n\t\t\t$bin = chr($octets[0]) . chr($octets[1]) . chr($octets[2]) . chr($octets[3]);\n\t\t\treturn $bin;\n\t\t}\n\n\t\t// IPv6\n\t\tif (preg_match('/^((?:[\\da-f]{1,4}(?::|)){0,8})(::)?((?:[\\da-f]{1,4}(?::|)){0,8})$/i', $ip)) {\n\t\t\tif ($ip === '::') {\n\t\t\t\treturn \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\";\n\t\t\t}\n\t\t\t$colon_count = wfWAFUtils::substr_count($ip, ':');\n\t\t\t$dbl_colon_pos = wfWAFUtils::strpos($ip, '::');\n\t\t\tif ($dbl_colon_pos !== false) {\n\t\t\t\t$ip = str_replace('::', str_repeat(':0000',\n\t\t\t\t\t\t(($dbl_colon_pos === 0 || $dbl_colon_pos === wfWAFUtils::strlen($ip) - 2) ? 9 : 8) - $colon_count) . ':', $ip);\n\t\t\t\t$ip = trim($ip, ':');\n\t\t\t}\n\n\t\t\t$ip_groups = explode(':', $ip);\n\t\t\t$ipv6_bin = '';\n\t\t\tforeach ($ip_groups as $ip_group) {\n\t\t\t\t$ipv6_bin .= pack('H*', str_pad($ip_group, 4, '0', STR_PAD_LEFT));\n\t\t\t}\n\n\t\t\treturn wfWAFUtils::strlen($ipv6_bin) === 16 ? $ipv6_bin : false;\n\t\t}\n\n\t\t// IPv4 mapped IPv6\n\t\tif (preg_match('/^((?:0{1,4}(?::|)){0,5})(::)?ffff:((?:\\d{1,3}(?:\\.|$)){4})$/i', $ip, $matches)) {\n\t\t\t$octets = explode('.', $matches[3]);\n\t\t\treturn \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\" . chr($octets[0]) . chr($octets[1]) . chr($octets[2]) . chr($octets[3]);\n\t\t}\n\n\t\treturn false;\n\t}", "public static function ipToBin($ip_str) {\n $ip_int = self::ipToInt($ip_str);\n return ip4_int2bin($ip_int);\n }", "public static function IPv6Bin2HexDataProviderCorrect() {}", "private function _convertBinaryToIPAddress($binary)\n {\n return long2ip(base_convert($binary, 2, 10));\n }", "public static function expandIPv6Address($ip) {\n\t\t$hex = bin2hex(self::inet_pton($ip));\n\t\t$ip = wfWAFUtils::substr(preg_replace(\"/([a-f0-9]{4})/i\", \"$1:\", $hex), 0, -1);\n\t\treturn $ip;\n\t}", "public static function unPadHex($string) {\n\n if (!self::hasHexPrefix($string)) {\n $string = '0x' . $string;\n }\n // Remove leading zeros.\n // See: https://regex101.com/r/O2Rpei/1\n $matches = array();\n if (preg_match('/^0x[0]*([1-9,a-f][0-9,a-f]*)$/is', $string, $matches)) {\n $address = '0x' . $matches[1];\n // Throws an Exception if not valid.\n if (self::isValidAddress($address, TRUE)) {\n return $address;\n }\n }\n return NULL;\n }", "public static function IPv6Hex2BinDataProviderCorrect() {}", "private function formatIp(string $host): string\n {\n $ip = substr($host, 1, -1);\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return $host;\n }\n\n static $ip_future = '/^\n v(?<version>[A-F0-9])+\\.\n (?:\n (?<unreserved>[a-z0-9_~\\-\\.])|\n (?<sub_delims>[!$&\\'()*+,;=:]) # also include the : character\n )+\n $/ix';\n if (preg_match($ip_future, $ip, $matches) && !in_array($matches['version'], ['4', '6'], true)) {\n return $host;\n }\n\n if (false === ($pos = strpos($ip, '%'))) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n static $gen_delims = '/[:\\/?#\\[\\]@ ]/'; // Also includes space.\n if (preg_match($gen_delims, rawurldecode(substr($ip, $pos)))) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n $ip = substr($ip, 0, $pos);\n if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n //Only the address block fe80::/10 can have a Zone ID attach to\n //let's detect the link local significant 10 bits\n static $address_block = \"\\xfe\\x80\";\n\n if (substr(inet_pton($ip) & $address_block, 0, 2) === $address_block) {\n return $host;\n }\n\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }", "public function filter($value)\n {\n\n\n\n $ip = long2ip(hexdec($value));\n\n return $ip;\n $validate = new Zend_Validate_Ip();\n if ($validate->isValid($ip)) {\n return $ip;\n }\n return false;\n }", "public static function prettifyIP( $ip ) {\n $ip = self::sanitizeIP( $ip ); // normalize (removes '::')\n if ( self::isIPv6( $ip ) ) {\n // Split IP into an address and a CIDR\n if ( strpos( $ip, '/' ) !== false ) {\n list( $ip, $cidr ) = explode( '/', $ip, 2 );\n } else {\n list( $ip, $cidr ) = array( $ip, '' );\n }\n // Get the largest slice of words with multiple zeros\n $offset = 0;\n $longest = $longestPos = false;\n while ( preg_match(\n '!(?:^|:)0(?::0)+(?:$|:)!', $ip, $m, PREG_OFFSET_CAPTURE, $offset\n ) ) {\n list( $match, $pos ) = $m[0]; // full match\n if ( strlen( $match ) > strlen( $longest ) ) {\n $longest = $match;\n $longestPos = $pos;\n }\n $offset += ( $pos + strlen( $match ) ); // advance\n }\n if ( $longest !== false ) {\n // Replace this portion of the string with the '::' abbreviation\n $ip = substr_replace( $ip, '::', $longestPos, strlen( $longest ) );\n }\n // Add any CIDR back on\n if ( $cidr !== '' ) {\n $ip = \"{$ip}/{$cidr}\";\n }\n // Convert to lower case to make it more readable\n $ip = strtolower( $ip );\n }\n return $ip;\n }", "public function ip_v6_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%x:%x:%x:%x:%x:%x:%x:%x',\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535)\n\t\t\t);\n\t\t}", "public static function _inet_ntop($ip) {\n\t\t// IPv4\n\t\tif (wfWAFUtils::strlen($ip) === 4) {\n\t\t\treturn ord($ip[0]) . '.' . ord($ip[1]) . '.' . ord($ip[2]) . '.' . ord($ip[3]);\n\t\t}\n\n\t\t// IPv6\n\t\tif (wfWAFUtils::strlen($ip) === 16) {\n\n\t\t\t// IPv4 mapped IPv6\n\t\t\tif (wfWAFUtils::substr($ip, 0, 12) == \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t\treturn \"::ffff:\" . ord($ip[12]) . '.' . ord($ip[13]) . '.' . ord($ip[14]) . '.' . ord($ip[15]);\n\t\t\t}\n\n\t\t\t$hex = bin2hex($ip);\n\t\t\t$groups = str_split($hex, 4);\n\t\t\t$collapse = false;\n\t\t\t$done_collapse = false;\n\t\t\tforeach ($groups as $index => $group) {\n\t\t\t\tif ($group == '0000' && !$done_collapse) {\n\t\t\t\t\tif (!$collapse) {\n\t\t\t\t\t\t$groups[$index] = ':';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$groups[$index] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$collapse = true;\n\t\t\t\t} else if ($collapse) {\n\t\t\t\t\t$done_collapse = true;\n\t\t\t\t\t$collapse = false;\n\t\t\t\t}\n\t\t\t\t$groups[$index] = ltrim($groups[$index], '0');\n\t\t\t}\n\t\t\t$ip = join(':', array_filter($groups));\n\t\t\t$ip = str_replace(':::', '::', $ip);\n\t\t\treturn $ip == ':' ? '::' : $ip;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function inet() {}", "private static function InetToBits($inet)\n\t{\n\t\t$unpacked = @unpack('A16', $inet);\n\t\tif ($unpacked===false) {\n\t\t\treturn false;\n\t\t}\n\t\t$unpacked = str_split($unpacked[1]);\n\t\t$binaryip = '';\n\t\tforeach ($unpacked as $char) {\n\t\t\t$binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);\n\t\t}\n\t\treturn $binaryip;\n\t}", "function wp_privacy_anonymize_ip($ip_addr, $ipv6_fallback = \\false)\n {\n }", "Function ip6floatA($ipstring) {\r\n $ip6 = explode(':', $ipstring);\r\n $num = array_reverse($ip6); # We want the least significant as [0]\r\n return $num;\r\n}", "private function inetToBits(string $ipv6): string\n {\n $unpck = \\str_split(\\unpack('A16', \\inet_pton($ipv6))[1]);\n\n foreach ($unpck as $key => $char) {\n $unpck[$key] = \\str_pad(\\decbin(\\ord($char)), 8, '0', STR_PAD_LEFT);\n }\n\n return \\implode('', $unpck);\n }", "function int64_to_inet6($val)\r\n{\r\n /* Make sure input is an array with 2 numerical strings */\r\n $result = false;\r\n if ( ! is_array($val) || count($val) != 2) return $result;\r\n $p1 = gmp_strval(gmp_init($val[0]), 16);\r\n $p2 = gmp_strval(gmp_init($val[1]), 16);\r\n while (strlen($p1) < 16) $p1 = '0' . $p1;\r\n while (strlen($p2) < 16) $p2 = '0' . $p2;\r\n $addr = $p1 . $p2;\r\n for ($i = 0; $i < 8; $i++) {\r\n $result .= substr($addr, $i * 4, 4);\r\n if ($i != 7) $result .= ':';\r\n } // for\r\n return inet6_compress($result);\r\n}", "protected static function _anonymizeIp($ip)\n {\n $strlen = strlen($ip);\n if ($strlen > 6) {\n $divider = (int)floor($strlen / 4) + 1;\n $ip = substr_replace($ip, '…', $divider, $strlen - (2 * $divider));\n }\n\n return $ip;\n }", "public static function ipToInt($ip_str) {\n $octets = array_map(function ($oc) {\n return (int) $oc;\n }, explode('.', $ip_str));\n\n return ($octets[0] * pow(256, 3)) +\n ($octets[1] * pow(256, 2)) +\n ($octets[2] * pow(256, 1)) +\n ($octets[3] * pow(256, 0));\n }", "function myip2long_r($a) {\r\n $inet = 0.0;\r\n $t = explode(\".\", $a);\r\n for ($i = 3; $i >= 0; $i --) {\r\n $inet *= 256.0;\r\n $inet += $t[$i];\r\n };\r\n return $inet;\r\n}", "private function inet_to_bits($inet, $IPv6) \r\n\t{\r\n\t\t$unpacked = unpack('A16', $inet);\r\n\t\t$unpacked = str_split($unpacked[1]);\r\n\t\t$binaryip = '';\r\n\t\t\r\n\t\tforeach ($unpacked as $char) {\r\n\t\t\t$binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);\r\n\t\t}\r\n\t\treturn $binaryip;\r\n\t}", "function vIP( $ip )\r\n\t\t{\r\n\t\t return filter_var( $ip, FILTER_VALIDATE_IP );\r\n\t\t \r\n\t\t}", "public function ObtenerIp()\n { \n\n return str_replace(\".\",\"\",$this->getIP()); //Funcion que quita los puntos de la IP\n\n }", "public static function compressIp($ip){\n\t\t\tif(strpos($ip,':')!==false){ // ipv6\n\t\t\t\t$ip=str_split(str_replace(':','',self::fixIpv6($ip)),2);\n\t\t\t\tforeach($ip as $k=>$v)$ip[$k]=chr(hexdec($v));\n\t\t\t\treturn implode('',$ip);\n\t\t\t}elseif(strpos($ip,'.')!==false){ // ipv4\n\t\t\t\t$ip=explode('.',$ip);\n\t\t\t\tif(count($ip)!=4)$ip=array(0,0,0,0);\n\t\t\t\treturn chr($ip[0]).chr($ip[1]).chr($ip[2]).chr($ip[3]);\n\t\t\t}else throw new Exception('Unrecognized IP format: '.Security::snohtml($ip));\n\t\t}", "protected function _ipToHex($quad='')\n {\n $hex = \"\";\n if ($quad == \"\") $quad = gethostbyname(php_uname('n'));\n $quads = explode('.', $quad);\n for ($i = 0; $i <= count($quads) - 1; $i++) {\n $hex .= substr(\"0\" . dechex($quads[$i]), -2);\n }\n\n return $hex;\n }", "public function ip_v4_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%d.%d.%d.%d',\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255)\n\t\t\t);\n\t\t}", "private static function ip2addr($intIp) {\n $arrUnknown = array(\n \"region\" => \"(unknown)\",\n \"address\" => \"(unknown)\"\n );\n $fileIp = fopen(__DIR__ . self::IPFILE, \"rb\");\n if (!$fileIp) return 1;\n $strBuf = fread($fileIp, 4);\n $intFirstRecord = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 4);\n $intLastRecord = self::bin2dec($strBuf);\n $intCount = floor(($intLastRecord - $intFirstRecord) / 7);\n if ($intCount < 1) return 2;\n $intStart = 0;\n $intEnd = $intCount;\n while ($intStart < $intEnd - 1) {\n $intMid = floor(($intStart + $intEnd) / 2);\n $intOffset = $intFirstRecord + $intMid * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intMidStartIp = self::bin2dec($strBuf);\n if ($intIp == $intMidStartIp) {\n $intStart = $intMid;\n break;\n }\n if ($intIp > $intMidStartIp) $intStart = $intMid;\n else $intEnd = $intMid;\n }\n $intOffset = $intFirstRecord + $intStart * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intStartIp = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intEndIp = self::bin2dec($strBuf);\n if ($intIp < $intStartIp || $intIp > $intEndIp) return $arrUnknown;\n $intOffset += 4;\n while (($intFlag = ord(fgetc($fileIp))) == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n switch ($intFlag) {\n case 0:\n return $arrUnknown;\n break;\n case 2:\n $intOffsetAddr = $intOffset + 4;\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) return $arrUnknown;\n $arrAddr = array(\n \"region\" => chr($intFlag)\n );\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n fseek($fileIp, $intOffsetAddr);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n break;\n default:\n $arrAddr = array(\"region\" => chr($intFlag));\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n }\n }", "public function addrFormat($addr)\n {\n }", "function esip($ip_addr)\n\t{\n\t\t if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) \n\t\t {\n\t\t\t //now all the intger values are separated \n\t\t\t $parts=explode(\".\",$ip_addr); \n\t\t\t //now we need to check each part can range from 0-255 \n\t\t\t foreach($parts as $ip_parts) \n\t\t\t {\n\t\t\t\t if(intval($ip_parts)>255 || intval($ip_parts)<0) \n\t\t\t\t return FALSE; //if number is not within range of 0-255\n\t\t\t }\n\t\t\t return TRUE; \n\t\t }\n\t\t else return FALSE; //if format of ip address doesn't matches \n\t}", "function validateIp($ip) {\n\treturn inet_pton($ip);\n }", "public static function is_ip6($ip) {\r\n\t\t$ret = false;\r\n\t\tif (function_exists('filter_var')) {\r\n\t\t\t// This regards :: as valid, also ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t$ret = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// This regards :: as invalid, but ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t// Taken from here: http://regexlib.com/REDetails.aspx?regexp_id=1000\r\n\t\t\t$regex = \"@^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1,5}:((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1}:([0-9A-Fa-f]{1,4}:){0,4}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,2}:([0-9A-Fa-f]{1,4}:){0,3}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,3}:([0-9A-Fa-f]{1,4}:){0,2}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,4}:([0-9A-Fa-f]{1,4}:){1}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$@\";\r\n\t\t\t$ret = preg_match($regex, $ip);\r\n\t\t}\t\r\n\t\tif ($ret) {\r\n\t\t\t// :: in any combination (::, ::0, 0::0:0.0.0.0) is invalid!\r\n\t\t\t$regex = '@^[0.:]*$@'; // Contains only ., :, and 0\r\n\t\t\t$ret = !preg_match($regex, $ip);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public static function inet_pton($ip) {\n\t\t// convert the 4 char IPv4 to IPv6 mapped version.\n\t\t$pton = str_pad(self::hasIPv6Support() ? @inet_pton($ip) : self::_inet_pton($ip), 16,\n\t\t\t\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\x00\\x00\\x00\\x00\", STR_PAD_LEFT);\n\t\treturn $pton;\n\t}", "function inet6_expand($addr)\r\n{\r\n /* Check if there are segments missing, insert if necessary */\r\n if (strpos($addr, '::') !== false) {\r\n $part = explode('::', $addr);\r\n $part[0] = explode(':', $part[0]);\r\n $part[1] = explode(':', $part[1]);\r\n $missing = array();\r\n for ($i = 0; $i < (8 - (count($part[0]) + count($part[1]))); $i++)\r\n array_push($missing, '0000');\r\n $missing = array_merge($part[0], $missing);\r\n $part = array_merge($missing, $part[1]);\r\n } else {\r\n $part = explode(\":\", $addr);\r\n } // if .. else\r\n /* Pad each segment until it has 4 digits */\r\n foreach ($part as &$p) {\r\n while (strlen($p) < 4) $p = '0' . $p;\r\n } // foreach\r\n unset($p);\r\n /* Join segments */\r\n $result = implode(':', $part);\r\n /* Quick check to make sure the length is as expected */ \r\n if (strlen($result) == 39) {\r\n return $result;\r\n } else {\r\n return false;\r\n } // if .. else\r\n}", "function convert_ip_to_network_format($ip, $subnet) {\n\t$ipsplit = explode('.', $ip);\n\t$string = $ipsplit[0] . \".\" . $ipsplit[1] . \".\" . $ipsplit[2] . \".0/\" . $subnet;\n\treturn $string;\n}", "public static function int2ip($int) {\n return long2ip( -(4294967295 - ($int - 1)));\n }", "public static function fromString($string)\n {\n if (!Util::isIPv4($string)) {\n throw new InvalidIpException($string, \"Given value '\"\n . var_export($string, true)\n . \"' is not a valid IPv4 string\");\n }\n return self::fromFloat(Util::ipv4ToFloat($string));\n }", "public static function toHex( $ip ) {\n if ( self::isIPv6( $ip ) ) {\n $n = 'v6-' . self::IPv6ToRawHex( $ip );\n } else {\n $n = self::toUnsigned( $ip );\n if ( $n !== false ) {\n $n = wfBaseConvert( $n, 10, 16, 8, false );\n }\n }\n return $n;\n }", "function _ip2long_v6( $address ) {\n\t$int = inet_pton( $address );\n\n\tif ( false === $int ) {\n\t\treturn false;\n\t}\n\n\t$bits = 15;\n\t$ipv6long = 0;\n\n\twhile ( $bits >= 0 ) {\n\t\t$bin = sprintf( '%08b', ( ord( $int[ $bits ] ) ) );\n\n\t\tif ( $ipv6long ) {\n\t\t\t$ipv6long = $bin . $ipv6long;\n\t\t} else {\n\t\t\t$ipv6long = $bin;\n\t\t}\n\n\t\t$bits--;\n\t}\n\n\t$ipv6long = gmp_strval( gmp_init( $ipv6long, 2 ), 10 );\n\n\treturn $ipv6long;\n}", "function inet6_to_range($addr, $prefix)\r\n{\r\n $size = 128 - $prefix;\r\n $addr = gmp_init('0x' . str_replace(':', '', inet6_expand($addr)));\r\n $mask = gmp_init('0x' . str_replace(':', '', inet6_expand(inet6_prefix_to_mask($prefix))));\r\n $prefix = gmp_and($addr, $mask);\r\n $start = gmp_strval(gmp_add($prefix, '0x1'), 16);\r\n $end = '0b';\r\n for ($i = 0; $i < $size; $i++) $end .= '1';\r\n $end = gmp_strval(gmp_add($prefix, gmp_init($end)), 16);\r\n for ($i = 0; $i < 8; $i++) {\r\n $start_result .= substr($start, $i * 4, 4);\r\n if ($i != 7) $start_result .= ':';\r\n } // for\r\n for ($i = 0; $i < 8; $i++) {\r\n $end_result .= substr($end, $i * 4, 4);\r\n if ($i != 7) $end_result .= ':';\r\n } // for\r\n $result = array(inet6_compress($start_result), inet6_compress($end_result));\r\n return $result;\r\n}", "function parse_range($r) {\n\tglobal $IP1BYTE, $IP2BYTE, $IP3BYTE, $IP4BYTE, $IPRANGE, $CIDR, $CIDR1BYTE, $CIDR2BYTE, $CIDR3BYTE, $IP6ADDR, $IP6CIDR;\n\tif (preg_match($IP1BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], 0, 0, 0);\n\t\t$b = digits_to_int($m[1], 255, 255, 255);\n\t} elseif (preg_match($IP2BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], 0, 0);\n\t\t$b = digits_to_int($m[1], $m[2], 255, 255);\n\t} elseif (preg_match($IP3BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], 0);\n\t\t$b = digits_to_int($m[1], $m[2], $m[3], 255);\n\t} elseif (preg_match($IP4BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$b = $a;\n\t} elseif (preg_match($IPRANGE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$b = digits_to_int($m[5], $m[6], $m[7], $m[8]);\n\t} elseif (preg_match($CIDR, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$bits = intval($m[5]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR3BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], $m[3], 0);\n\t\t$bits = intval($m[4]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR2BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], 0, 0);\n\t\t$bits = intval($m[3]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR1BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], 0, 0, 0);\n\t\t$bits = intval($m[2]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($IP6ADDR, $r, $m)) {\n\t\t$a = $b = ip6_to_ints($m[1]);\n\t} elseif (preg_match($IP6CIDR, $r, $m)) {\n\t\t$a = $b = ip6_to_ints($m[1]);\n\t\t$bits = intval($m[2]);\n\n\t\tfor ($i = 0; $i < 128; $i += 16) {\n\t\t\t$idx = ($i / 16);\n\t\t\tif ($bits >= ($i+16)) {\n\t\t\t\t# this idx is all network\n\t\t\t} elseif ($bits > $i) {\n\t\t\t\t# this idx is partial\n\t\t\t\t$lobits = pow(2, 16-($bits-$i)) - 1;\n\t\t\t\t$hibits = 0xffff ^ $lobits;\n\t\t\t\t$a[$idx] &= $hibits;\n\t\t\t\t$b[$idx] = $a[$idx] | $lobits;\n\t\t\t} else {\n\t\t\t\t# this idx is all address\n\t\t\t\t$a[$idx] = 0x0000;\n\t\t\t\t$b[$idx] = 0xffff;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception(\"can't parse IP range '$r'\");\n\t}\n\treturn array($a, $b);\n}", "public function testIpAAddressWithParameter()\n {\n $ipV6Address = new Ipv6address(\"abc::\");\n $this->assertEquals(\"abc::\", $ipV6Address->getHexa());\n $this->assertEquals(\"00001010101111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\", $ipV6Address->getBinary());\n $this->assertEquals(128, strlen($ipV6Address->getBinary()));\n $this->assertCount(8, $ipV6Address->getAddressArray());\n $this->assertEquals(\"abc\", $ipV6Address->getAddressArray()[0]);\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[1]);\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[7]);\n }", "function inet6_to_int64($addr)\r\n{\r\n /* Expand the address if necessary */\r\n if (strlen($addr) != 39) {\r\n $addr = inet6_expand($addr);\r\n if ($addr == false) return false;\r\n } // if\r\n $addr = str_replace(':', '', $addr);\r\n $p1 = '0x' . substr($addr, 0, 16);\r\n $p2 = '0x' . substr($addr, 16);\r\n $p1 = gmp_init($p1);\r\n $p2 = gmp_init($p2);\r\n $result = array(gmp_strval($p1), gmp_strval($p2));\r\n return $result;\r\n}", "public static function get_valid_ip_address_from_anonymized( $ip_address ) {\n\t\t$ip_address = preg_replace( '/\\.x$/', '.0', $ip_address );\n\t\treturn $ip_address;\n\t}", "public function toByteString(): string\n {\n if ($this->ipVersion == 4 || self::ipv6Support()) {\n return inet_pton($this->addrStr);\n } else {\n throw new NotImplementedException('PHP must be compiled with IPv6 support');\n }\n }", "public static function inet_ntop($ip) {\n\t\t// trim this to the IPv4 equiv if it's in the mapped range\n\t\tif (wfWAFUtils::strlen($ip) == 16 && wfWAFUtils::substr($ip, 0, 12) == \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t$ip = wfWAFUtils::substr($ip, 12, 4);\n\t\t}\n\t\treturn self::hasIPv6Support() ? @inet_ntop($ip) : self::_inet_ntop($ip);\n\t}", "public static function convertip($ip) {\n\n $return = '';\n\n if(preg_match(\"/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/\", $ip)) {\n\n $iparray = explode('.', $ip);\n\n if($iparray[0] == 10 || $iparray[0] == 127 || ($iparray[0] == 192 && $iparray[1] == 168) || ($iparray[0] == 172 && ($iparray[1] >= 16 && $iparray[1] <= 31))) {\n $return = '- 本地';\n } elseif($iparray[0] > 255 || $iparray[1] > 255 || $iparray[2] > 255 || $iparray[3] > 255) {\n $return = '- 无效IP地址';\n } else {\n $tinyipfile = './ipdata/tinyipdata.dat';\n if(@file_exists($tinyipfile)) {\n $return = common::convertip_tiny($ip, $tinyipfile);\n } else{\n $return = '- IP地址文件不存在';\n }\n }\n }\n\n return $return;\n\n }", "public static function str2hex($str) {}", "function char_translate($u1)\n{ \n $conv = array(0,0xffff,0,0xffff); \n //echo \"len=\".mb_strlen($u1).\" , \".bin2hex($u1).\" , \".mb_decode_numericentity($u1,$conv).\"<br>\";\n switch (mb_strlen($u1))\n {\n case 1:\n $mask = 0x7f;\n break;\n case 2:\n $mask = 0x1f3f; /* U+80 - U+7ff : 110x-xxxx-10xx-xxxx */\n break;\n case 3:\n $mask = 0x0f3f3f; /* U+800 - U+ffff : 1110-xxxx-10xx-xxxx-10xx-xxxx */\n break;\n case 4:\n $mask = 0x073f3f3f; /* U+10000 - U+1fffff : 1111-0xxx-10xx-xxxx-10xx-xxxx-10xx-xxxx */\n break;\n }\n $a = intval(bin2hex($u1),16);\n $n = $a & $mask;\n $val = intval($n); \n //var_dump($a);\n //var_dump($mask);\n //var_dump($n);\n return $val;\n}", "public function getIPAddress(): string;", "function isValidIP($ip_addr){\n //first of all the format of the ip address is matched\n if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) {\n //now all the intger values are separated\n $parts=explode(\".\",$ip_addr);\n //now we need to check each part can range from 0-255\n foreach($parts as $ip_parts) {\n if(intval($ip_parts)>255 || intval($ip_parts)<0)\n return false; //if number is not within range of 0-255\n }\n return true;\n }\n else\n return false; //if format of ip address doesn't matches\n}", "function snmp_hexstring($string)\n{\n if (isHexString($string))\n {\n return hex2str(str_replace(' 00', '', $string)); // 00 is EOL\n } else {\n return $string;\n }\n}", "public static function formatHex( $hex ) {\n if ( substr( $hex, 0, 3 ) == 'v6-' ) { // IPv6\n return self::hexToOctet( substr( $hex, 3 ) );\n } else { // IPv4\n return self::hexToQuad( $hex );\n }\n }", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "function filter_hex($string)\n{\n return preg_replace('/[^a-fA-F0-9]+/', '', $string);\n}", "function inet6_prefix_to_mask($prefix)\r\n{\r\n /* Make sure the prefix is a number between 1 and 127 (inclusive) */\r\n $prefix = intval($prefix);\r\n if ($prefix < 0 || $prefix > 128) return false;\r\n $mask = '0b';\r\n for ($i = 0; $i < $prefix; $i++) $mask .= '1';\r\n for ($i = strlen($mask) - 2; $i < 128; $i++) $mask .= '0';\r\n $mask = gmp_strval(gmp_init($mask), 16);\r\n for ($i = 0; $i < 8; $i++) {\r\n $result .= substr($mask, $i * 4, 4);\r\n if ($i != 7) $result .= ':';\r\n } // for\r\n return inet6_compress($result);\r\n}", "protected function ip_address()\n\t{\n\t\t//return $this->ip2int(ipaddress::get());\n\t\t//return $this->ip2int(server('REMOTE_ADDR'));\n\t\treturn server('REMOTE_ADDR');\n\t}", "function ip6_to_ints($s) {\n\t$before = array();\n\t$zeroes = array();\n\t$after = array();\n\n\t$state = 0; // 0=before, 1=zeroes, 2=after\n\tforeach (explode(':', $s) as $p) {\n\t\tswitch ($state) {\n\t\tcase 0:\n\t\t\tif ($p === '') {\n\t\t\t\t$state ++;\n\t\t\t} else {\n\t\t\t\t$before[] = hexdec($p);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif ($p === '') {\n\t\t\t\t// ignore\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$state ++;\n\t\t\t// fall through\n\t\tcase 2:\n\t\t\t$after[] = hexdec($p);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$n0 = count($before);\n\t$n2 = count($after);\n\t$n1 = 8 - ($n0 + $n2);\n\tfor ($i = 0; $i < $n1; $i++) {\n\t\t$zeroes[] = 0;\n\t}\n\n\treturn array_merge($before, $zeroes, $after);;\n}", "function reverse_ip($ip)\n{\n\t$new_ip = array_reverse(explode('.', $ip));\n\t$new_ip = implode('.', $new_ip);\n\treturn $new_ip;\n}", "private function strtohex($input) {\n\n $output = '';\n\n foreach (str_split($input) as $c)\n $output.=sprintf(\"%02X\", ord($c));\n\n return $output;\n }", "public function testIpAAddress()\n {\n $ipV6Address = new Ipv6address();\n $this->assertEquals(\"::1\", $ipV6Address->getHexa());\n $this->assertEquals(\"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\", $ipV6Address->getBinary());\n $this->assertEquals(128, strlen($ipV6Address->getBinary()));\n $this->assertCount(8, $ipV6Address->getAddressArray());\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[0]);\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[1]);\n $this->assertEquals(\"1\", $ipV6Address->getAddressArray()[7]);\n }", "function mylong2ip($n) {\r\n $t=array(0,0,0,0);\r\n $msk = 16777216.0;\r\n $n += 0.0;\r\n if ($n < 1)\r\n return('&nbsp;');\r\n for ($i = 0; $i < 4; $i++) {\r\n $k = (int) ($n / $msk);\r\n $n -= $msk * $k;\r\n $t[$i]= $k;\r\n $msk /=256.0;\r\n };\r\n //$a=join('.', $t);\r\n\t$a = $t[3] . \".\" . $t[2] . \".\" . $t[1] . \".\" . $t[0];\r\n return($a);\r\n}", "public static function canonicalize( $addr ) {\n if ( self::isValid( $addr ) ) {\n return $addr;\n }\n // Turn mapped addresses from ::ce:ffff:1.2.3.4 to 1.2.3.4\n if ( strpos( $addr, ':' ) !== false && strpos( $addr, '.' ) !== false ) {\n $addr = substr( $addr, strrpos( $addr, ':' ) + 1 );\n if ( self::isIPv4( $addr ) ) {\n return $addr;\n }\n }\n // IPv6 loopback address\n $m = array();\n if ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) ) {\n return '127.0.0.1';\n }\n // IPv4-mapped and IPv4-compatible IPv6 addresses\n if ( preg_match( '/^' . RE_IPV6_V4_PREFIX . '(' . RE_IP_ADD . ')$/i', $addr, $m ) ) {\n return $m[1];\n }\n if ( preg_match( '/^' . RE_IPV6_V4_PREFIX . RE_IPV6_WORD .\n ':' . RE_IPV6_WORD . '$/i', $addr, $m ) )\n {\n return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );\n }\n\n return null; // give up\n }", "function getIP($remoteAddress) {\n if (empty($remoteAddress)) {\n return \"\";\n }\n\n // Capture the first three octects of the IP address and replace the forth\n // with 0, e.g. 124.455.3.123 becomes 124.455.3.0\n $regex = \"/^([^.]+\\.[^.]+\\.[^.]+\\.).*/\";\n if (preg_match($regex, $remoteAddress, $matches)) {\n return $matches[1] . \"0\";\n } else {\n return \"\";\n }\n }", "public function ip_v6 () {\n\t\t\treturn $this->ip_v6_address();\n\t\t}", "public static function pton($ip)\n {\n // Detect the IP version\n $ipv = self::detectIPVersion($ip);\n\n // Check for IPv4 first since that's most common\n if ($ipv === 4) {\n return current(unpack(\"A4\", inet_pton($ip)));\n }\n\n // Then attempt IPv6\n if ($ipv === 6) {\n return current(unpack(\"A16\", inet_pton($ip)));\n }\n\n // Throw an exception if an invalid IP was supplied\n throw new \\Exception(\"Invalid IP address supplied.\");\n }", "protected function IP2Bin($ip)\n {\n return sprintf(\"%032s\",base_convert($this->convertIp2Long($ip),10,2));\n }", "static public function ip__resolve($ip)\n\t{\n\t\tif(self::ip__validate($ip)){\n\t\t\t$url = gethostbyaddr($ip);\n\t\t\tif($url)\n\t\t\t\treturn $url;\n\t\t}\n\t\treturn $ip;\n\t}", "private static function inet_gmpton( $gmp )\n\t{\n\t\t// 16*8 == 128\n\t\t$addr = '';\n\t\tfor( $bits = 0; $bits < 16; $bits++ )\n\t\t{\n\t\t\t$byte = 0;\n\t\t\tfor( $b = 0; $b < 8; $b++ )\n\t\t\t{\n\t\t\t\tif( \\gmp_testbit( $gmp, (15-$bits)*8+$b ))\n\t\t\t\t{\n\t\t\t\t\t$byte |= 1<<$b;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$addr .= chr( $byte );\n\t\t}\n//\t\techo gmp_strval( $gmp, 16 ).' -> '.inet_ntop( $addr ).\"<br />\\n\";\n\t\treturn $addr;\n\t}", "function verifyAndCleanAddresses($data, $subnets_allowed = 'subnets-allowed') {\n\t/** Remove extra spaces */\n\t$data = preg_replace('/\\s\\s+/', ' ', $data);\n\t\n\t/** Swap delimiters for ; */\n\t$data = str_replace(array(\"\\n\", ';', ' ', ','), ',', $data);\n\t$data = str_replace(',,', ',', $data);\n\t$data = trim($data, ',');\n\t\n\t$addresses = explode(',', $data);\n\tforeach ($addresses as $ip_address) {\n\t\t$cidr = null;\n\n\t\t$ip_address = rtrim(trim($ip_address), '.');\n\t\tif (!strlen($ip_address)) continue;\n\t\t\n\t\t/** Handle negated addresses */\n\t\tif (strpos($ip_address, '!') === 0) {\n\t\t\t$ip_address = substr($ip_address, 1);\n\t\t}\n\t\t\n\t\tif (strpos($ip_address, '/') !== false && $subnets_allowed == 'subnets-allowed') {\n\t\t\t$cidr_array = explode('/', $ip_address);\n\t\t\tlist($ip_address, $cidr) = $cidr_array;\n\t\t}\n\t\t\n\t\t/** IPv4 checks */\n\t\tif (strpos($ip_address, ':') === false) {\n\t\t\t/** Valid CIDR? */\n\t\t\tif ($cidr && !checkCIDR($cidr, 32)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t\t\n\t\t\t/** Create full IP */\n\t\t\t$ip_octets = explode('.', $ip_address);\n\t\t\tif (count($ip_octets) < 4) {\n\t\t\t\t$ip_octets = array_merge($ip_octets, array_fill(count($ip_octets), 4 - count($ip_octets), 0));\n\t\t\t}\n\t\t\t$ip_address = implode('.', $ip_octets);\n\t\t} else {\n\t\t\t/** IPv6 checks */\n\t\t\tif ($cidr && !checkCIDR($cidr, 128)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t}\n\t\t\n\t\tif (verifyIPAddress($ip_address) === false) return sprintf(__('%s is not valid.'), $ip_address);\n\t}\n\t\n\treturn $data;\n}", "public static function formatFromFixed($bytes) {}", "function _foaf_normalize_hex($hex) {\n return strtoupper(preg_replace('/[^a-zA-Z0-9]/', '', $hex));\n}", "function compress($ip) {\n\t\t\tif (!IPv6::validate_ip($ip))\n\t\t\t\treturn false;\n\n\t\t\t// Uncompress the address, so we are sure the address isn't already compressed\n\t\t\t$ip = IPv6::uncompress($ip);\n\n\t\t\t// Remove all leading 0's; 0034 -> 34; 0000 -> 0\n\t\t\t$ip = preg_replace(\"/(^|:)0+(?=[a-fA-F\\d]+(?::|$))/\", \"$1\", $ip);\n\n\t\t\t// Find all :0:0: sequences\n\t\t\tpreg_match_all(\"/((?:^|:)0(?::0)+(?::|$))/\", $ip, $matches);\n\n\t\t\t// Search all :0:0: sequences and determine the longest\n\t\t\t$reg = \"\";\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t\tif (strlen($match) > strlen($reg))\n\t\t\t\t\t$reg = $match;\n\n\t\t\t// Replace the longst :0 sequence with ::, but do it only once\n\t\t\tif (strlen($reg))\n\t\t\t\t$ip = preg_replace(\"/$reg/\", \"::\", $ip, 1);\n\n\t\t\treturn $ip;\n\t\t}", "public static function hexToQuad( $ip_hex ) {\n // Pad hex to 8 chars (32 bits)\n $ip_hex = str_pad( strtoupper( $ip_hex ), 8, '0', STR_PAD_LEFT );\n // Separate into four quads\n $s = '';\n for ( $i = 0; $i < 4; $i++ ) {\n if ( $s !== '' ) {\n $s .= '.';\n }\n $s .= base_convert( substr( $ip_hex, $i * 2, 2 ), 16, 10 );\n }\n return $s;\n }" ]
[ "0.7371091", "0.715948", "0.6954196", "0.6657919", "0.6510177", "0.6487515", "0.64649606", "0.6463134", "0.63789153", "0.63276774", "0.62781626", "0.62224084", "0.6209609", "0.6206648", "0.61961615", "0.6104487", "0.6049283", "0.5993168", "0.5989523", "0.5952598", "0.59446675", "0.5915038", "0.5888475", "0.5852255", "0.5832886", "0.58212125", "0.5815625", "0.57626355", "0.57552975", "0.57547367", "0.5744209", "0.57336676", "0.57327443", "0.5724722", "0.57219505", "0.5718617", "0.5703488", "0.56812894", "0.56770915", "0.56650066", "0.56524014", "0.5612278", "0.5606243", "0.55947936", "0.5589687", "0.5584375", "0.5577048", "0.5559189", "0.5557921", "0.54942286", "0.54845864", "0.54844373", "0.5422173", "0.5421077", "0.5397104", "0.53930676", "0.53879213", "0.53822535", "0.5379315", "0.5357489", "0.53574127", "0.5350796", "0.5350587", "0.5346073", "0.5338192", "0.5324014", "0.531509", "0.53114885", "0.53046864", "0.53014046", "0.52905285", "0.52849144", "0.528059", "0.52514267", "0.52432424", "0.5242922", "0.52397656", "0.5228113", "0.5222577", "0.52195954", "0.5212849", "0.51996744", "0.5185412", "0.51843214", "0.51823133", "0.5156634", "0.51468366", "0.5144046", "0.51310885", "0.5126", "0.5118256", "0.5106089", "0.510237", "0.50893825", "0.5089322", "0.5078998", "0.5063547", "0.5059768", "0.5055097", "0.5045624" ]
0.63353556
9
Substitution callback for 'fix_links'.
protected function _fix_links_callback_topic($m) { return 'index.php?topic=' . strval(import_id_remap_get('topic', strval($m[2]), true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkfix($hook, $type, $returnvalue, $params) {\n\treturn handler_replace($returnvalue);\n}", "public function fixup_url_references($entry)\n\t\t{\n\t\t\t$entry->content = str_ireplace($this->_source_urls, $this->_target_urls, $entry->content);\n\t\t}", "function replace_links($content) {\r\n\tpreg_match_all(\"/<a\\s*[^>]*>(.*)<\\/a>/siU\", $content, $matches);\r\n\t//preg_match_all(\"/<a\\s[^>]*>(.*?)(</a>)/siU\", $content, $matches);\t\r\n\t$foundLinks = $matches[0];\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t\r\n\tforeach ($foundLinks as $theLink) {\r\n\t\t$uri = getAttribute('href',$theLink);\r\n\t\tif($wpbar_options[\"validateURL\"]) {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink) && isValidURL($uri)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\treturn $content;\r\n}", "function fix_links($post,$uid,$db,$table_prefix,$post_id=NULL,$is_pm=false)\n\t{\n\t\t$orig_post=$post;\n\n\t\t$post=preg_replace('#<!-- [mwl] --><a class=\"[\\w-]+\" href=\"([^\"]*)\"( onclick=\"window.open\\(this.href\\);\\s*return false;\")?'.'>(.*)</a><!-- [mwl] -->#U','[url=\"${3}\"]${1}[/url]',$post);\n\t\t$post=preg_replace('#<!-- e --><a href=\"mailto:(.*)\">(.*)</a><!-- e -->#U','[email=\"${2}\"]${1}[/email]',$post);\n\n\t\tglobal $OLD_BASE_URL;\n\t\tif (is_null($OLD_BASE_URL))\n\t\t{\n\t\t\t$rows=$db->query('SELECT * FROM '.$table_prefix.'config WHERE '.db_string_equal_to('config_name','server_name').' OR '.db_string_equal_to('config_name','server_port').' OR '.db_string_equal_to('config_name','script_path').' ORDER BY config_name');\n\t\t\t$server_path=$rows[0]['config_value'];\n\t\t\t$server_name=$rows[1]['config_value'];\n\t\t\t$server_port=$rows[2]['config_value'];\n\t\t\t$OLD_BASE_URL=($server_port=='80')?('http://'.$server_name.$server_path):('http://'.$server_name.':'.$server_port.$server_path);\n\t\t}\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewtopic\\.php\\?t=)(\\d*)#',array($this,'_fix_links_callback_topic'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewforum\\.php\\?f=)(\\d*)#',array($this,'_fix_links_callback_forum'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(profile\\.php\\?mode=viewprofile&u=)(\\d*)#',array($this,'_fix_links_callback_member'),$post);\n\t\t$post=preg_replace('#:[0-9a-f]{10}#','',$post);\n\n\t\t$matches=array();\n\t\t$count=preg_match_all('#\\[attachment=(\\d+)(:.*)?\\].*\\[\\/attachment(:.*)?\\]#Us',$post,$matches);\n\t\t$to=mixed();\n\t\tfor ($i=0;$i<$count;$i++)\n\t\t{\n\t\t\tif (!is_null($post_id))\n\t\t\t{\n\t\t\t\t$from=$matches[1][$i];\n\t\t\t\t$attachments=$db->query_select('attachments',array('attach_id'),array('post_msg_id'=>$post_id,'in_message'=>$is_pm?1:0),'ORDER BY attach_id');\n\t\t\t\t$to=array_key_exists(intval($from),$attachments)?$attachments[intval($from)]['attach_id']:-1;\n\t\t\t\t$to=import_id_remap_get('attachment',$to,true);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$to=NULL;\n\t\t\t}\n\t\t\tif (is_null($to))\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'(attachment removed)',$post);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'[attachment]'.strval($to).'[/attachment]',$post);\n\t\t\t}\n\t\t}\n\n\t\tif ($uid!='') $post=str_replace(':'.$uid,'',$post);\n\t\t$post=preg_replace('#<!-- s([^\\s]*) --><img src=\"\\{SMILIES_PATH\\}/[^\"]*\" alt=\"([^\\s]*)\" title=\"[^\"]*\" /><!-- s([^\\s]*) -->#U','${1}',$post);\n\n\t\t$post=preg_replace('#\\[size=\"?(\\d+)\"?\\]#i','[size=\"${1}%\"]',$post);\n\n\t\t$post=str_replace('{','\\{',$post);\n\n\t\treturn html_entity_decode($post,ENT_QUOTES);\n\t}", "public function detect_links()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:(?:https?|ftp):\\/\\/|(?:www|ftp)\\.)(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})(?::[0-9]{1,5})?(?:\\/[^\\s'\\\"]*)?(?:(?<![,\\)\\.])|[\\S])/\",\r\n\t\t\t$child->get_text(),\r\n\t\t\t$matches,\r\n\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\tif(substr($match[0], 0, 3) === 'ftp' && $match[0][3] !== ':')\r\n\t\t\t\t\t$url = 'ftp://' . $match[0];\r\n\t\t\t\telse if($match[0][0] === 'w')\r\n\t\t\t\t\t$url = 'http://' . $match[0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$url = $match[0];\r\n\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('url', array('default' => htmlentities($url, ENT_QUOTES | ENT_IGNORE, \"UTF-8\")));\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_URL));\r\n\r\n\t\treturn $this;\r\n\t}", "protected function addLinks()\n {\n }", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "function _ti_amg_fw_topics_do_drush_fix_urls($nid, &$context) {\n $node = node_load($nid);\n\n if (!empty($node->field_left_nav_links[LANGUAGE_NONE])) {\n foreach ($node->field_left_nav_links[LANGUAGE_NONE] as $delta => $link) {\n if (substr($link['url'], -1) == '/' && substr_count($link['url'], 'http://www.foodandwine.com')) {\n $node->field_left_nav_links[LANGUAGE_NONE][$delta]['url'] = substr($link['url'], 0, -1);\n\n $context['results'][$nid] = TRUE;\n }\n }\n }\n\n // Save it\n if ($context['results'][$nid]) {\n node_save($node);\n $context['message'] = t('Fixed links on page %title.',\n array('%title' => $node->title)\n );\n\n // Get it published\n if (function_exists('state_flow_load_state_machine')) {\n $state_flow = state_flow_load_state_machine($node);\n $state_flow->fire_event('publish', 1);\n }\n }\n else {\n $context['message'] = t('Links on page @title were already OK.',\n array('@title' => $node->title)\n );\n }\n}", "protected function updateBrokenLinks() {}", "protected function fix_supporting_file_references() {\r\n\t\tpreg_match_all('/<link([^<>]*?) href=\"([^\"]*?)\"([^<>]*?)\\/>/is', $this->code, $link_matches);\r\n\t\t/*$counter = sizeof($link_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t\r\n\t\t\t$counter--;\r\n\t\t}*/\r\n\t\t$array_replaces = array();\r\n\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t$href_content = $link_matches[2][$index];\r\n\t\t\tif($href_content[0] === '/' || strpos($href_content, 'http://') !== false) { // avoid root references and URLs\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$initial_href_content = $href_content;\r\n\t\t\t\t\t// first try looking closer\r\n\t\t\t\t\t$proper_reference = false;\r\n\t\t\t\t\twhile(!$proper_reference && substr($href_content, 0, 3) === '../') {\r\n\t\t\t\t\t\t$href_content = substr($href_content, 3);\r\n\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // try looking farther\r\n\t\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\t\twhile(!$proper_reference && $counter < 10) {\r\n\t\t\t\t\t\t\t$href_content = '../' . $href_content;\r\n\t\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$counter++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // give up or finish\r\n\t\t\t\t\t\tvar_dump($this->file, $href_content, $relative_path);exit(0);\r\n\t\t\t\t\t\tprint('<span style=\"color: red;\">Could not fix broken reference in &lt;link&gt;: ' . $value . '</span>');exit(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->logMsg('Reference ' . htmlentities($value) . ' was fixed.');\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\tforeach($array_replaces as $index => $value) {\r\n\t\t\t$this->code = str_replace($index, $value, $this->code);\r\n\t\t}\r\n\t}", "function substHREFsInHTML() {\n\t\tif (!is_array($this->theParts['html']['hrefs'])) return;\n\t\tforeach ($this->theParts['html']['hrefs'] as $urlId => $val) {\n\t\t\t\t// Form elements cannot use jumpurl!\n\t\t\tif ($this->jumperURL_prefix && ($val['tag'] != 'form') && ( !strstr( $val['ref'], 'mailto:' ))) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} elseif ( strstr( $val['ref'], 'mailto:' ) && $this->jumperURL_useMailto) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$substVal = $val['absRef'];\n\t\t\t}\n\t\t\t$this->theParts['html']['content'] = str_replace(\n\t\t\t\t$val['subst_str'],\n\t\t\t\t$val['quotes'] . $substVal . $val['quotes'],\n\t\t\t\t$this->theParts['html']['content']);\n\t\t}\n\t}", "function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }", "private function replaceURLsCallback($matches) {\n\n preg_match('/(http[s]?)?:\\/\\/([^\\/]+)(.*)?/', $matches[2], $url_matches);\n\n $replacement = $matches[0];\n\n if (!empty($url_matches[0])) {\n\n switch (drupal_strtoupper($this->https)) {\n case 'TO':\n $scheme = 'https';\n break;\n case 'FROM':\n $scheme = 'http';\n break;\n default:\n $scheme = $url_matches[1];\n break;\n }\n\n foreach($this->from_urls as $from_url) {\n\n $match_url = $url_matches[1] . '://' . $url_matches[2];\n\n if ($from_url == $match_url) {\n if (!$this->relative) {\n $replacement = $matches[1] . '=\"' . $scheme . '://';\n $replacement .= $this->toValue . $url_matches[3] . '\"';\n }\n else {\n $replacement = $matches[1] . '=\"' . $url_matches[3] . '\"';\n }\n break;\n }\n\n }\n\n }\n\n if ($replacement !== $matches[0]) {\n\n $this->debug && drush_print(\n t(\n 'URL: !from => !to',\n array(\n '!from' => $matches[0],\n '!to' => $replacement,\n )\n )\n );\n\n }\n\n return $replacement;\n\n }", "public function _rewrite_links_callback($text = '')\n {\n return _class('rewrite')->_rewrite_replace_links($text);\n }", "public function doLocalAnchorFix() {}", "private function rep_links_callback($match) {\t\r\n\t\t\r\n\t\t$query = substr($match[0],2,-2);\r\n\r\n\t\t$db_Article = Article::getArticle()->select($query);\r\n\t\t\r\n\t\tif($db_Article != FALSE) {\r\n\t\t\t$query = ' <a href=\"' . urlencode($query) . '\">' . $query . '</a> ';\r\n\t\t\t$this->links[$this->linkCount] = $db_Article;\r\n\t\t\t$this->linkCount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $query;\t\t\r\n\t}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "protected function prepare_links($theme)\n {\n }", "function rebound_links($links, $attributes = array()) {\n global $user;\n if (!$user->uid) {\n unset($links['links']['comment_forbidden']);\n }\n return theme_links($links, $attributes);\n}", "function tnsl_fCleanLinks(&$getNextGen) {\r\n\t$getNextGen = preg_replace('(&(?!([a-zA-Z]{2,6}|[0-9\\#]{1,6})[\\;]))', '&amp;', $getNextGen);\r\n\t$getNextGen = str_replace(array(\r\n\t\t'&amp;&amp;',\r\n\t\t'&amp;middot;',\r\n\t\t'&amp;nbsp;',\r\n\t\t'&amp;#'\r\n\t), array(\r\n\t\t'&&',\r\n\t\t'&middot;',\r\n\t\t'&nbsp;',\r\n\t\t'&#'\r\n\t), $getNextGen);\r\n\t// montego - following code is required to allow the new RNYA AJAX validations to work properly\r\n\t$getNextGen = preg_replace('/rnxhr.php\\?name=Your_Account&amp;file/', 'rnxhr.php\\?name=Your_Account&file', $getNextGen );\r\n\treturn;\r\n}", "function permalink_link()\n {\n }", "protected function prepare_links($item)\n {\n }", "protected function prepare_links($term)\n {\n }", "protected function prepare_links($term)\n {\n }", "function redlinks($_) {\n return preg_replace_callback(\"/<a href=\\\"?\\/([^'\\\">]+)\\\"?>/\", function($matches){\n if (is_link(filename($matches[1])))\n return $matches[0];\n else\n return preg_replace(\"/<a/\", \"<a class=redlink\", $matches[0]);\n }, $_);\n}", "protected function prepare_links($taxonomy)\n {\n }", "function url_to_link_callback($matches)\n{\n return '<a href=\"' . htmlspecialchars($matches[1]) . '\">' . $matches[1] . '</a>';\n}", "function node_link_alter(&$links, $node) {\n // Use 'Read more »' instead of 'Read more'\n if (isset($links['node_read_more'])) {\n $links['node_read_more']['title'] = t('Read more »');\n } \n \n // Remove Section on taxonomy term links\n foreach ($links as $module => $link) { \n if (strstr($module, 'taxonomy_term')) {\n foreach ($links as $key => $value) {\n if ($value['title'] == 'Life' || \n $value['title'] == 'Geek') {\n unset($links[$key]);\n }\n }\n }\n // Don't show language links in Today and other listing\n //unset($links['node_translation_ja']);\n //unset($links['node_translation_en']);\n }\n}", "function lean_links($links, $attributes = array('class' => 'links')) {\n \n // Link 'Add a comment' link to node page instead of comments reply page\n if($links['comment_add']['href']){\n $arr_linkparts = explode('/', $links['comment_add']['href']);\n $links['comment_add']['href'] = 'node/'.$arr_linkparts[2];\n }\n // Don't show 'reply' link for comments\n unset($links['comment_reply']);\n \n return theme_links($links, $attributes);\n}", "function _fix_links_callback_forum($m)\n\t{\n\t\treturn 'index.php?page=forumview&id='.strval(import_id_remap_get('forum',strval($m[2]),true));\n\t}", "protected function prepare_links($prepared)\n {\n }", "public function fix_links($post, $db, $table_prefix, $file_base = '')\n {\n $boardurl = '';\n\n require($file_base . '/Settings.php');\n $old_base_url = $boardurl;\n\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?topic=)(\\d*)#', array($this, '_fix_links_callback_topic'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?board=)(\\d*)#', array($this, '_fix_links_callback_forum'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?action=profile;u=)(\\d*)#', array($this, '_fix_links_callback_member'), $post);\n $post = preg_replace('#:[0-9a-f]{10}#', '', $post);\n return $post;\n }", "protected function prepare_links($sidebar)\n {\n }", "function dupeoff_actlinks( $links, $file ){\n\t//Static so we don't call plugin_basename on every plugin row.\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\t\n\tif ( $file == $this_plugin ){\n\t\t$settings_link = '<a href=\"options-general.php?page=dupeoff/dupeoff.php\">' . __('Settings') . '</a>';\n\t\tarray_unshift( $links, $settings_link ); // before other links\n\t\t}\n\treturn $links;\n}", "protected function getLinkHandlers() {}", "protected function getLinkHandlers() {}", "function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "public abstract function prepare_item_links($id);", "protected function prepare_links($post)\n {\n }", "protected function prepare_links($post)\n {\n }", "function callbackAddLinks($hookName, $args) {\n\t\t$request =& $this->getRequest();\n\t\tif ($this->getEnabled() && is_a($request->getRouter(), 'PKPPageRouter')) {\n\t\t\t$templateManager = $args[0];\n\t\t\t$currentJournal = $templateManager->get_template_vars('currentJournal');\n\t\t\t$announcementsEnabled = $currentJournal ? $currentJournal->getSetting('enableAnnouncements') : false;\n\n\t\t\tif (!$announcementsEnabled) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$displayPage = $currentJournal ? $this->getSetting($currentJournal->getId(), 'displayPage') : null;\n\n\t\t\t// Define when the <link> elements should appear\n\t\t\t$contexts = 'frontend';\n\t\t\tif ($displayPage == 'homepage') {\n\t\t\t\t$contexts = array('frontend-index', 'frontend-announcement');\n\t\t\t} elseif ($displayPage == 'announcement') {\n\t\t\t\t$contexts = 'frontend-' . $displayPage;\n\t\t\t}\n\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsAtom+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/atom+xml\" href=\"' . $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'atom')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRdf+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rdf+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRss+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rss+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss2')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn false;\n\t}", "protected function prepare_links($user)\n {\n }", "function _post_format_link($link, $term, $taxonomy)\n {\n }", "function _fix_links_callback_member($m)\n\t{\n\t\treturn 'index.php?page=members&type=view&id='.strval(import_id_remap_get('member',strval($m[2]),true));\n\t}", "function trans_link()\n{\n // --- mylinks ---\n // --- link table ---\n // lid int(11)\n // cid int(5) => multi\n // title varchar(100)\n // url varchar(250)\n // logourl varchar(60)\n // submitter int(11)\n // status tinyint(2) => not use\n // date int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n\n // --- mylinks_text table ---\n // lid int(11)\n // description text\n\n // --- weblinks ---\n // lid int(11)\n // cids varchar(100) : use catlink\n // title varchar(100)\n // url varchar(255)\n // banner varchar(255) : full url\n // uid int(5) : submitter\n // time_create int(10)\n // time_update int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n // description text\n //\n // search text default\n // passwd varchar(255)\n //\n // name varchar(255)\n // nameflag tinyint(2)\n // mail varchar(255)\n // mailflag tinyint(2)\n // company varchar(255)\n // addr varchar(255)\n // tel varchar(255)\n // admincomment text\n // width int(5)\n // height int(5)\n // recommend tinyint(2)\n // mutual tinyint(2)\n // broken int(11)\n // rss_url varchar(255)\n // rss_flag tinyint(3)\n // rss_xml mediumtext\n // rss_update int(10)\n // usercomment text\n // zip varchar(100)\n // state varchar(100)\n // city varchar(100)\n // addr2 varchar(255)\n // fax varchar(255)\n\n global $xoopsDB;\n global $LIMIT;\n global $cat_title_arr;\n\n echo '<h4>STEP 3: link table</h3>';\n\n global $MODULE_DIRNAME;\n $table_link = $xoopsDB->prefix($MODULE_DIRNAME . '_link');\n\n global $MODULE_URL;\n $shots_url_web = $MODULE_URL . '/images/shots/';\n\n $offset = 0;\n if (isset($_POST['offset'])) {\n $offset = $_POST['offset'];\n }\n $next = $offset + $LIMIT;\n\n $table = $xoopsDB->prefix('mylinks_links');\n $sql1 = \"SELECT count(*) FROM $table\";\n $res1 = sql_exec($sql1);\n $row1 = $xoopsDB->fetchRow($res1);\n $total = $row1[0];\n\n echo \"There are $total links <br />\\n\";\n echo \"Transfer $offset - $next th link <br /><br />\";\n\n $sql2 = \"SELECT * FROM $table ORDER BY lid\";\n $res2 = sql_exec($sql2, $LIMIT, $offset);\n\n while ($row = $xoopsDB->fetchArray($res2)) {\n $lid = $row['lid'];\n $uid = $row['submitter'];\n $cid = $row['cid'];\n $url = $row['url'];\n $hits = $row['hits'];\n $rating = $row['rating'];\n $votes = $row['votes'];\n $logourl = $row['logourl'];\n $comments = $row['comments'];\n $time_create = $row['date'];\n $time_update = $time_create;\n\n $title = addslashes($row['title']);\n\n $banner = '';\n $width = 0;\n $height = 0;\n\n if ($logourl) {\n $banner = $shots_url_web . $logourl;\n $size = getimagesize($banner);\n\n if ($size) {\n $width = (int)$size[0];\n $height = (int)$size[1];\n } else {\n echo \"<font color='red'>image size error: $banner</font><br />\";\n }\n\n $banner = addslashes($banner);\n }\n\n $desc = get_desc($lid);\n $desc = addslashes($desc);\n\n $cat = addslashes($cat_title_arr[$cid]);\n $search = \"$url $title $cat $desc\";\n\n $passwd = md5(rand(10000000, 99999999));\n\n echo \"$lid: $title <br />\";\n\n $sql = 'INSERT INTO ' . $table_link . ' (';\n $sql .= 'lid, uid, title, url, description, ';\n $sql .= 'search, passwd, time_create, time_update, ';\n $sql .= 'hits, rating, votes, comments, ';\n $sql .= 'banner, width, height';\n $sql .= ') VALUES (';\n $sql .= \"$lid, $uid, '$title', '$url', '$desc', \";\n $sql .= \"'$search', '$passwd', $time_create, $time_update, \";\n $sql .= \"$hits, $rating, $votes, $comments, \";\n $sql .= \"'$banner', $width, $height\";\n $sql .= ')';\n\n sql_exec($sql);\n\n insert_catlink($cid, $lid);\n }\n\n if ($total > $next) {\n form_next_link($next);\n } else {\n form_votedate();\n }\n}", "protected function prepare_links($id)\n {\n }", "protected function prepare_links($id)\n {\n }", "public function using_permalinks()\n {\n }", "protected function prepare_links($post_type)\n {\n }", "function ldap_mod_replace($link_identifier, $dn, $entry)\n{\n}", "function _fix_links_callback_topic($m)\n\t{\n\t\treturn 'index.php?page=topicview&id='.strval(import_id_remap_get('topic',strval($m[2]),true));\n\t}", "function smarty_function_mtlink($args, &$ctx) {\n // status: incomplete\n // parameters: template, entry_id\n static $_template_links = array();\n $curr_blog = $ctx->stash('blog');\n if (isset($args['template'])) {\n if (!empty($args['blog_id']))\n $blog = $ctx->mt->db()->fetch_blog($args['blog_id']);\n else\n $blog = $ctx->stash('blog');\n\n $name = $args['template'];\n $cache_key = $blog->id . ';' . $name;\n if (isset($_template_links[$cache_key])) {\n $link = $_template_links[$cache_key];\n } else {\n $tmpl = $ctx->mt->db()->load_index_template($ctx, $name, $blog->id);\n $site_url = $blog->site_url();\n if (!preg_match('!/$!', $site_url)) $site_url .= '/';\n $link = $site_url . $tmpl->template_outfile;\n $_template_links[$cache_key] = $link;\n }\n if (!$args['with_index']) {\n $link = _strip_index($link, $curr_blog);\n }\n return $link;\n } elseif (isset($args['entry_id'])) {\n $arg = array('entry_id' => $args['entry_id']);\n list($entry) = $ctx->mt->db()->fetch_entries($arg);\n $ctx->localize(array('entry'));\n $ctx->stash('entry', $entry);\n $link = $ctx->tag('EntryPermalink',$args);\n $ctx->restore(array('entry'));\n if ($args['with_index'] && preg_match('/\\/(#.*)$/', $link)) {\n $index = $ctx->mt->config('IndexBasename');\n $ext = $curr_blog->blog_file_extension;\n if ($ext) $ext = '.' . $ext; \n $index .= $ext;\n $link = preg_replace('/\\/(#.*)?$/', \"/$index\\$1\", $link);\n }\n return $link;\n }\n return '';\n}", "function TS_links_rte($value,$wrap='')\t{\n\t\t$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml_proc');\n\n\t\t$value = $htmlParser->TS_AtagToAbs($value);\n\t\t$wrap = explode('|',$wrap);\n\t\t\t// Split content by the TYPO3 pseudo tag \"<LINK>\":\n\t\t$blockSplit = $htmlParser->splitIntoBlock('link',$value,1);\n\t\tforeach($blockSplit as $k => $v)\t{\n\t\t\t$error = '';\n\t\t\tif ($k%2)\t{\t// block:\n\t\t\t\t$tagCode = t3lib_div::trimExplode(' ',trim(substr($htmlParser->getFirstTag($v),0,-1)),1);\n\t\t\t\t$link_param = $tagCode[1];\n\t\t\t\t$href = '';\n\t\t\t\t$siteUrl = $htmlParser->siteUrl();\n\t\t\t\t\t// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()\n\t\t\t\tif(strstr($link_param,'@'))\t{\t\t// mailadr\n\t\t\t\t\t$href = 'mailto:'.eregi_replace('^mailto:','',$link_param);\n\t\t\t\t} elseif (substr($link_param,0,1)=='#') {\t// check if anchor\n\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t} else {\n\t\t\t\t\t$fileChar=intval(strpos($link_param, '/'));\n\t\t\t\t\t$urlChar=intval(strpos($link_param, '.'));\n\n\t\t\t\t\t\t// Detects if a file is found in site-root OR is a simulateStaticDocument.\n\t\t\t\t\tlist($rootFileDat) = explode('?',$link_param);\n\t\t\t\t\t$rFD_fI = pathinfo($rootFileDat);\n\t\t\t\t\tif (trim($rootFileDat) && !strstr($link_param,'/') && (@is_file(PATH_site.$rootFileDat) || t3lib_div::inList('php,html,htm',strtolower($rFD_fI['extension']))))\t{\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} elseif($urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar))\t{\t// url (external): If doubleSlash or if a '.' comes before a '/'.\n\t\t\t\t\t\tif (!ereg('^[a-z]*://',trim(strtolower($link_param))))\t{$scheme='http://';} else {$scheme='';}\n\t\t\t\t\t\t$href = $scheme.$link_param;\n\t\t\t\t\t} elseif($fileChar)\t{\t// file (internal)\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} else {\t// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to tables.php!!)\n\t\t\t\t\t\t$link_params_parts = explode('#',$link_param);\n\t\t\t\t\t\t$idPart = trim($link_params_parts[0]);\t\t// Link-data del\n\t\t\t\t\t\tif (!strcmp($idPart,''))\t{ $idPart=$htmlParser->recPid; }\t// If no id or alias is given, set it to class record pid\n\t\t\t\t\t\tif ($link_params_parts[1] && !$sectionMark)\t{\n\t\t\t\t\t\t\t$sectionMark = '#'.trim($link_params_parts[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair\n\t\t\t\t\t\t$pairParts = t3lib_div::trimExplode(',',$idPart);\n\t\t\t\t\t\tif (count($pairParts)>1)\t{\n\t\t\t\t\t\t\t$idPart = $pairParts[0];\n\t\t\t\t\t\t\t// Type ? future support for?\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Checking if the id-parameter is an alias.\n\t\t\t\t\t\tif (!t3lib_div::testInt($idPart))\t{\n\t\t\t\t\t\t\tlist($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);\n\t\t\t\t\t\t\t$idPart = intval($idPartR['uid']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$page = t3lib_BEfunc::getRecord('pages', $idPart);//this doesnt work at the moment...no page exist check\n\t\t\t\t\t\t//if (is_array($page))\t{\t// Page must exist...\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t/*} else {\n\t\t\t\t\t\t\t#$href = '';\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t\t$error = 'No page found: '.$idPart;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Setting the A-tag:\n\t\t\t\t$bTag = '<a href=\"'.htmlspecialchars($href).'\"'.($tagCode[2]&&$tagCode[2]!='-' ? ' target=\"'.htmlspecialchars($tagCode[2]).'\"' : '').'>'.$wrap[0];\n\t\t\t\t$eTag = $wrap[1].'</a>';\n\t\t\t\t$blockSplit[$k] = $bTag.$htmlParser->TS_links_rte($htmlParser->removeFirstAndLastTag($blockSplit[$k])).$eTag;\n\t\t\t}\n\t\t}\n\n\t\t\t// Return content:\n\t\treturn implode('',$blockSplit);\n\t}", "function fixup_protocolless_urls($in)\n{\n require_code('urls2');\n return _fixup_protocolless_urls($in);\n}", "function bps_plugin_extra_links($links, $file) {\n\tstatic $this_plugin;\n\tif ( ! current_user_can('install_plugins') )\n\t\treturn $links;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ) {\n\t\t$links[2] = '<a href=\"http://forum.ait-pro.com/forums/topic/bulletproof-security-pro-version-release-dates/\" target=\"_blank\" title=\"BulletProof Security Pro Version Release Dates and Whats New\">' . __('Version Release Dates|Whats New', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"http://forum.ait-pro.com/\" target=\"_blank\" title=\"BulletProof Security Pro Forum\">' . __('Forum|Support', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"admin.php?page=bulletproof-security/admin/tools/tools.php#bps-tabs-15\" title=\"Pro Tools Plugin Update Check tool\">' . __('Manual Upgrade Check', 'bulleproof-security') . '</a>';\n\n/*\techo '<pre>';\n\tprint_r($links);\n\techo '</pre>';\n*/\t\n\t}\n\n\treturn $links;\n}", "function autoContentLinksContent($content)\r\n\t{\r\n\t\t$options = get_option('auto_content_links');\r\n\t\t\r\n\t\t// Set default value for autolink linking back to itself\r\n\t\tif(!isset($link['link_autolink'])) $link['link_autolink'] = true;\r\n\t\t\r\n\t\tif(isset($options['links']) AND !empty($options['links']))\r\n\t\t{\r\n\t\t\tforeach($options['links'] as $link)\r\n\t\t\t{\r\n\t\t\t\tif(!(preg_match(\"@\".preg_quote($link['url']) .'$@', autoContentLinksCurrentPageURL())) OR $link['link_autolink'] == true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$wordBoundary = '';\r\n\t\t\t\t\tif($link['match_whole_word'] == true) $wordBoundary = '\\b';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$newWindow = '';\r\n\t\t\t\t\tif($link['new_window'] == true) $newWindow = ' target=\"_blank\"';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$content = preg_replace('@('.$wordBoundary.$link['name'].$wordBoundary.')(?!([^<>]*<[^Aa<>]+>)*([^<>]+)?</[aA]>)(?!([^<\\[]+)?[>\\]])@', '<a'.$newWindow.' href=\"'.$link['url'].'\">'.$link['name'].'</a>', $content, $link['instances']);\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $content;\r\n\t}", "function renderLinks($links, $prefix = \"\") {\n\n $value = \"\";\n if (!isset($links[0])) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $links[\"url\"], \n $links[\"url\"], \n (\"\" != $links[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n );\n } else {\n\n reset($links);\n while (list($k, $link) = each($links)) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $link[\"url\"], \n $link[\"url\"], \n (\"\" != $link[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n ); \n }\n\n }\n\n $value = substr($value, 0, -2);\n $this->tpl->setCurrentBlock(strtolower($prefix) . \"links\");\n $this->tpl->setVariable(\"LINK\", $value);\n $this->tpl->parseCurrentBlock();\n\n }", "function feed_links($args = array())\n {\n }", "function wp_targeted_link_rel_callback($matches)\n {\n }", "function changeUrlUnparsedContentCode(&$tag, &$data)\n{\n global $txt, $modSettings, $context;\n loadLanguage('Redirector/Redirector');\n\n $data = strtr($data, ['<br />' => '']);\n $link_text = $data;\n\n // Skip local urls with #\n if (strpos($data, '#') === 0) {\n return;\n } else {\n if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0) {\n $data = 'http://' . $data;\n }\n }\n\n // Hide links from guests\n if (!empty($modSettings['redirector_hide_guest_links']) && !empty($context['user']['is_guest']) && !checkWhiteList(\n $data\n )) {\n $link_text = !empty($modSettings['redirector_hide_guest_custom_message']) ? $modSettings['redirector_hide_guest_custom_message'] : $txt['redirector_hide_guest_message'];\n }\n\n $data = getRedirectorUrl($data);\n\n $tag['content'] = '<a href=\"' . $data . '\" class=\"bbc_link\" ' . ((!empty($modSettings['redirector_nofollow_links']) && $modSettings['redirector_mode'] == 'immediate' && !checkWhiteList(\n $data\n )) ? 'rel=\"nofollow noopener noreferrer\" ' : '') . ($tag['tag'] == 'url' ? 'target=\"_blank\"' : '') . ' >' . $link_text . '</a>';\n}", "function onAcesefIlinks(&$text) {\r\n\t\tif (ACESEF_PACK == 'pro' && $this->AcesefConfig->ilinks_mode == '1') {\r\n\t\t\t$component = JRequest::getCmd('option');\r\n\t\t\t$ext_params\t= AcesefCache::getExtensionParams($component);\r\n\t\t\t\r\n\t\t\tif ($ext_params && class_exists('AcesefIlinks')) {\r\n\t\t\t\tAcesefIlinks::plugin($text, $ext_params, 'trigger', $component);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine whether the default automated URL handling has been replaced.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default')) {\n\n\t\t\t// Determine whether the URL segment or parent ID has been updated.\n\n\t\t\t$changed = $this->owner->getChangedFields();\n\t\t\tif((isset($changed['URLSegment']['before']) && isset($changed['URLSegment']['after']) && ($changed['URLSegment']['before'] != $changed['URLSegment']['after'])) || (isset($changed['ParentID']['before']) && isset($changed['ParentID']['after']) && ($changed['ParentID']['before'] != $changed['ParentID']['after']))) {\n\n\t\t\t\t// The link mappings should only be created for existing pages.\n\n\t\t\t\t$URL = (isset($changed['URLSegment']['before']) ? $changed['URLSegment']['before'] : $this->owner->URLSegment);\n\t\t\t\tif(strpos($URL, 'new-') !== 0) {\n\n\t\t\t\t\t// Determine the page URL.\n\n\t\t\t\t\t$parentID = (isset($changed['ParentID']['before']) ? $changed['ParentID']['before'] : $this->owner->ParentID);\n\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parentID}\");\n\t\t\t\t\twhile($parent) {\n\t\t\t\t\t\t$URL = Controller::join_links($parent->URLSegment, $URL);\n\t\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parent->ParentID}\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a link mapping for this page.\n\n\t\t\t\t\tsingleton(MisdirectionService::class)->createPageMapping($URL, $this->owner->ID);\n\n\t\t\t\t\t// Purge any link mappings that point back to the same page.\n\n\t\t\t\t\t$this->owner->regulateMappings(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link(), $this->owner->ID);\n\n\t\t\t\t\t// Recursively create link mappings for any children.\n\n\t\t\t\t\t$children = $this->owner->AllChildrenIncludingDeleted();\n\t\t\t\t\tif($children->count()) {\n\t\t\t\t\t\t$this->owner->recursiveMapping($URL, $children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function prepare_links($plugin)\n {\n }", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "function tumblrLinkBacks( $content ) {\n\tglobal $wp_query, $post;\n\t$post_id = get_post( $post->ID );\n\t$posttitle = $post_id->post_title;\n\t$permalink = get_permalink( get_post( $post->ID ) );\n\t$tumblr_keys = get_post_custom_keys( $post->ID );\n\tif( get_post_meta( $wp_query->post->ID, 'TumblrURL', true ) ) {\n\t\tif( $tumblr_keys ) {\n\t\t\tforeach( $tumblr_keys as $tumblr_key ) {\n\t\t\t\tif( $tumblr_key == 'TumblrURL' ) {\n\t\t\t\t\t$tumblr_vals = get_post_custom_values( $tumblr_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $tumblr_vals ) {\n\t\t\t\tif( is_feed() ) {\n\t\t\t\t\t$content .= '<p><a href=\"'.$tumblr_vals[0].'\" title=\"Direct link to featured article\">Direct Link to Article</a> &#8212; ';\n\t\t\t\t\t$content .= '<a href=\"'.$permalink.'\">Permalink</a></p>';\n\t\t\t\t\treturn $content;\n\t\t\t\t} else {\n\t\t\t\t\treturn $content;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$content = $content;\n\t\treturn $content;\n\t}\n}", "public function fixHreflang()\n {\n global $config, $languages, $listing_data, $currentPage;\n\n if (!$config['mf_geo_subdomains'] || !$config['mod_rewrite'] || count($languages) == 1) {\n return;\n }\n\n $hreflang = array();\n $url = RL_URL_HOME . $currentPage;\n\n foreach ($languages as $lang_item) {\n $lang_code = $lang_item['Code'] == $config['lang'] ? '' : $lang_item['Code'];\n\n if ($this->detailsPage) {\n $hreflang[$lang_item['Code']] = $this->buildListingUrl($url, $listing_data, $lang_code);\n } else {\n $hreflang[$lang_item['Code']] = $this->makeUrlGeo($url, $lang_code);\n }\n }\n\n $GLOBALS['rlSmarty']->assign('hreflang', $hreflang);\n }", "function replace_long_by_shorten_links($postId, $replacingList) \r\n{\r\n global $wpdb;\r\n\r\n $post = get_post($postId);\r\n $post_content = $post->post_content;\r\n\r\n foreach ($replacingList as $replaceContent) {\r\n $post_content = str_replace($replaceContent['source_link'], $replaceContent['result_link'], $post_content);\r\n } \r\n $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d\", $post_content, $postId ) );\r\n}", "public function add_links($links)\n {\n }", "function cleanLink($input) {\n\t// Prefix URL with http:// if it was missing from the input\n\tif(trim($input[url]) != \"\" && !preg_match(\"#^https?://.*$#\",$input[url])) { $input[url] = \"http://\" . $input[url]; } \t\n\t\t\n\t\t$curly = array(\"{\",\"}\");\n\t\t$curly_replace = array(\"&#123;\",\"&#125;\");\n\t\t\n\t\tforeach($input as $field => $data) {\n\t\t\t$input[$field] = filter_var(trim($data),FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t$input[$field] = str_replace($curly,$curly_replace,$input[$field]); // Replace curly brackets (needed for placeholders to work)\n\t\t\t\t\n\t\tif($field == \"url\") {\n\t\t\t$input[url] = str_replace(\"&#38;\",\"&\",$input[url]); // Put &s back into URL\n\t\t\n\t\t}\n\t}\t\n\treturn($input);\n}", "public static function Links($Mixed) {\n if (!is_string($Mixed))\n return self::To($Mixed, 'Links');\n else {\n $Mixed = preg_replace_callback(\n \"/\n (?<!<a href=\\\")\n (?<!\\\")(?<!\\\">)\n ((?:https?|ftp):\\/\\/)\n ([\\@a-z0-9\\x21\\x23-\\x27\\x2a-\\x2e\\x3a\\x3b\\/;\\x3f-\\x7a\\x7e\\x3d]+)\n /msxi\",\n array('Gdn_Format', 'LinksCallback'),\n $Mixed);\n\n return $Mixed;\n }\n }", "function automatic_feed_links($add = \\true)\n {\n }", "function feed_links_extra($args = array())\n {\n }", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function string_insert_hrefs( $p_string ) \r\n{\r\n\tif ( !config_get('html_make_links') ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$t_change_quotes = false;\r\n\tif( ini_get_bool( 'magic_quotes_sybase' ) ) {\r\n\t\t$t_change_quotes = true;\r\n\t\tini_set( 'magic_quotes_sybase', false );\r\n\t}\r\n\r\n\t// Find any URL in a string and replace it by a clickable link\r\n\t$p_string = preg_replace( '/(([[:alpha:]][-+.[:alnum:]]*):\\/\\/(%[[:digit:]A-Fa-f]{2}|[-_.!~*\\';\\/?%^\\\\\\\\:@&={\\|}+$#\\(\\),\\[\\][:alnum:]])+)/se',\r\n \"'<a href=\\\"'.rtrim('\\\\1','.').'\\\">\\\\1</a> [<a href=\\\"'.rtrim('\\\\1','.').'\\\" target=\\\"_blank\\\">^</a>]'\", $p_string);\r\n \r\n\tif( $t_change_quotes ) {\r\n\t\tini_set( 'magic_quotes_sybase', true );\r\n\t}\r\n\r\n\t# Set up a simple subset of RFC 822 email address parsing\r\n\t# We don't allow domain literals or quoted strings\r\n\t# We also don't allow the & character in domains even though the RFC\r\n\t# appears to do so. This was to prevent &gt; etc from being included.\r\n\t# Note: we could use email_get_rfc822_regex() but it doesn't work well\r\n\t# when applied to data that has already had entities inserted.\r\n\t#\r\n\t# bpfennig: '@' doesn't accepted anymore\r\n\t# achumakov: characters 0x80-0xFF aren't acceptable, too\r\n\t$t_atom = '[^\\'@\\'](?:[^()<>@,;:\\\\\\\".\\[\\]\\000-\\037\\177-\\377 &]+)';\r\n\r\n\t# In order to avoid selecting URLs containing @ characters as email\r\n\t# addresses we limit our selection to addresses that are preceded by:\r\n\t# * the beginning of the string\r\n\t# * a &lt; entity (allowing '<[email protected]>')\r\n\t# * whitespace\r\n\t# * a : (allowing 'send email to:[email protected]')\r\n\t# * a \\n, \\r, or > (because newlines have been replaced with <br />\r\n\t# and > isn't valid in URLs anyway\r\n\t#\r\n\t# At the end of the string we allow the opposite:\r\n\t# * the end of the string\r\n\t# * a &gt; entity\r\n\t# * whitespace\r\n\t# * a , character (allowing 'email [email protected], or ...')\r\n\t# * a \\n, \\r, or <\r\n\r\n\t$p_string = preg_replace( '/(?<=^|&quot;|&lt;|[\\s\\:\\>\\n\\r])('.$t_atom.'(?:\\.'.$t_atom.')*\\@'.$t_atom.'(?:\\.'.$t_atom.')*)(?=$|&quot;|&gt;|[\\s\\,\\<\\n\\r])/s',\r\n\t\t\t\t\t\t\t'<a href=\"mailto:\\1\">\\1</a>', $p_string);\r\n\r\n\treturn $p_string;\r\n}", "function modify_attachment_link( $markup, $id, $size, $permalink ) {\n global $post;\n if ( ! $permalink ) {\n $markup = str_replace( '<a href', '<a class=\"view\" data-rel=\"prettyPhoto[slides]-'. $post->ID .'\" href', $markup );\n }\n return $markup;\n }", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "public function autoLinkUrls($text) {\n\t\t$placeholders = [];\n\t\t$replace = [];\n\n\t\t$insertPlaceholder = function($matches) use (&$placeholders) {\n\t\t\t$key = md5($matches[0]);\n\t\t\t$placeholders[$key] = $matches[0];\n\n\t\t\treturn $key;\n\t\t};\n\n\t\t$pattern = '#(?<!href=\"|src=\"|\">)((?:https?|ftp|nntp)://[a-z0-9.\\-:]+(?:/[^\\s]*)?)#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\t$pattern = '#(?<!href=\"|\">)(?<!\\b[[:punct:]])(?<!http://|https://|ftp://|nntp://)www.[^\\n\\%\\ <]+[^<\\n\\%\\,\\.\\ <](?<!\\))#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\tforeach ($placeholders as $hash => $url) {\n\t\t\t$link = $url;\n\n\t\t\tif (!preg_match('#^[a-z]+\\://#', $url)) {\n\t\t\t\t$url = 'http://' . $url;\n\t\t\t}\n\t\t\t$replace[$hash] = \"<a href=\\\"{$url}\\\">{$link}</a>\";\n\t\t}\n\t\treturn strtr($text, $replace);\n\t}", "function setLinks($link) \n {\n $this->links = $link;\n }", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "function avia_link_content_filter($current_post)\n\t{\n\t\t$link \t\t= \"\";\n\t\t$newlink = false;\n\t\t$pattern1 \t= '$^\\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$i';\n\t\t$pattern2 \t= \"!^\\<a.+?<\\/a>!\";\n\t\t$pattern3 \t= \"!\\<a.+?<\\/a>!\";\n\n\t\t//if the url is at the begnning of the content extract it\n\t\tpreg_match($pattern1, $current_post['content'] , $link);\n\t\tif(!empty($link[0]))\n\t\t{\n\t\t\t$link = $link[0];\n\t\t\t$markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false));\n\t\t\t$current_post['title'] = \"<a href='$link' rel='bookmark' title='\".__('Link to:','avia_framework').\" \".the_title_attribute('echo=0').\"' $markup>\".get_the_title().\"</a>\";\n\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpreg_match($pattern2, $current_post['content'] , $link);\n\t\t\tif(!empty($link[0]))\n\t\t\t{\n\t\t\t\t$link = $link[0];\n\t\t\t\t$current_post['title'] = $link;\n\t\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t\t\t\n\t\t\t\t$newlink = get_url_in_content( $link );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpreg_match($pattern3, $current_post['content'] , $link);\n\t\t\t\tif(!empty($link[0]))\n\t\t\t\t{\n\t\t\t\t\t$current_post['title'] = $link[0];\n\t\t\t\t\t\n\t\t\t\t\t$newlink = get_url_in_content( $link[0] );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($link)\n\t\t{\n\t\t\tif(is_array($link)) $link = $link[0];\n\t\t\tif($newlink) $link = $newlink;\n\t\t\t\n\t\t\t$heading = is_singular() ? \"h1\" : \"h2\";\n\n\t\t\t//$current_post['title'] = \"<{$heading} class='post-title entry-title \". avia_offset_class('meta', false). \"'>\".$current_post['title'].\"</{$heading}>\";\n\t\t\t$current_post['title'] = \"<{$heading} class='post-title entry-title' \".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).\">\".$current_post['title'].\"</{$heading}>\";\n\t\t\t\n\t\t\t//needs to be set for masonry\n\t\t\t$current_post['url'] = $link;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$current_post = avia_default_title_filter($current_post);\n\t\t}\n\n\t\treturn $current_post;\n\t}", "public function getLinkFun() {}", "public static function link_to(){\n echo call_user_func_array('Laika::link_to', func_get_args() );\n }", "function fixURL($url, $includeHREF ) {\n $properURL = \"\"; \n\tswitch( substr($url, 0, 4) )\n {\n\tcase \"http\":\n \t$properURL= $url;\n\t break;\n\tcase \"www.\":\n \t$properURL=\"http://\".$url;\n\t\tbreak;\n\tdefault:\n \t$properURL=\"http://www.\".$url;\n\t\tbreak;\n\t}\n\tif ( $includeHREF == true )\n\t{\n\t\t$properURL = \"<a href=\".$properURL.\">\".$properURL.\"</a>\";\n\t}\n\treturn $properURL; \n}", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "function _links_add_base($m)\n {\n }", "protected function prepare_links($location)\n {\n }", "function wp_make_link_relative($link)\n {\n }", "function url_to_link($str)\n{\n $pattern = \"#(\\bhttps?://\\S+\\b)#\";\n return preg_replace_callback($pattern, 'url_to_link_callback', $str);\n}", "function autoLinkReferences(DOMNode $node) {\n\t// Don’t link inside .h-cite elements or headers\n\tif ($node->nodeType == XML_ELEMENT_NODE and strstr(' ' . $node->getAttribute('class') . ' ', ' h-cite '))\n\t\treturn;\n\t\n\tif ($node->nodeType == XML_TEXT_NODE):\n\t\t$node->data = preg_replace_callback('/Article \\d+/', function ($matches) {\n\t\t\treturn 'REPLACE_BEGIN_ELEMENTa href=\"#' . slugify($matches[0]) . '\"REPLACE_END_ELEMENT' . $matches[0] . 'REPLACE_BEGIN_ELEMENT/aREPLACE_END_ELEMENT';\n\t\t}, $node->data);\n\tendif;\n\t\n\t// Loop through each child node\n\tif ($node->hasChildNodes() and !isheader($node)):\n\t\tforeach ($node->childNodes as $n):\n\t\t\tautoLinkReferences($n);\n\t\tendforeach;\n\tendif;\n}", "function bps_plugin_actlinks( $links, $file ){\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ){\n\t$settings_link = '<a href=\"admin.php?page=bulletproof-security/admin/core/options.php\">' . __('Settings', 'bulletproof-security') . '</a>';\n\t\tarray_unshift( $links, $settings_link );\n\t}\n\treturn $links;\n}", "function layout_builder_post_update_discover_new_contextual_links() {\n // Empty post-update hook.\n}", "protected function generateLinks()\n {\n if ( ! is_null($this->links) ) {\n foreach ( $this->links as $link ) {\n $this->addLine('<url>');\n $this->addLine('<loc>');\n $this->addLine($this->helpers->url(\n $link->link,\n $this->protocol,\n $this->host\n ));\n $this->addLine('</loc>');\n $this->addLine('<lastmod>' . date_format($link->updated_at, 'Y-m-d') . '</lastmod>');\n $this->addLine('</url>');\n }\n }\n }", "function minorite_menu_link__links(array $variables) {\n $element = $variables['element'];\n $options = $variables['element']['#original_link']['options'];\n return '<option value=\"' . url($element['#href']) . '\">' . $element['#title'] . \"</option>\\n\";\n}", "private static function links()\n {\n $files = ['Link'];\n $folder = static::$root.'Http/Links'.'/';\n\n self::call($files, $folder);\n\n $files = ['LinkKeyNotFoundException'];\n $folder = static::$root.'Http/Links/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function InitLookupLinks()\r\n{\r\n\tglobal $lookupTableLinks;\r\n\r\n\t$lookupTableLinks = array();\r\n\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"][\"edit\"] = array(\"table\" => \"adm_meuplano\", \"field\" => \"idPlano\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"][\"edit\"] = array(\"table\" => \"login\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"atendimento_presencial\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"nome_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"ramo_empresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"estado_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"municipio_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}" ]
[ "0.7045814", "0.686694", "0.6711534", "0.66502124", "0.66446537", "0.66224885", "0.65817183", "0.6432874", "0.6428899", "0.6366067", "0.6361728", "0.6249323", "0.6161205", "0.61046034", "0.60852325", "0.60445845", "0.59877515", "0.59831333", "0.59817964", "0.59368", "0.593196", "0.5920706", "0.5916994", "0.5916994", "0.59039176", "0.58565617", "0.583072", "0.5828029", "0.58280253", "0.5801932", "0.5797788", "0.5796027", "0.5786061", "0.5770534", "0.57458425", "0.57458425", "0.5709149", "0.5707769", "0.5706252", "0.5697336", "0.5697336", "0.56955427", "0.56807977", "0.5679257", "0.56551903", "0.56291497", "0.5627745", "0.5627745", "0.56220585", "0.5613159", "0.56118536", "0.56038123", "0.5599441", "0.5591072", "0.5588116", "0.558426", "0.5583212", "0.5574627", "0.55707014", "0.556848", "0.55682653", "0.5565082", "0.5564862", "0.55577147", "0.5555877", "0.5546372", "0.5545613", "0.5543786", "0.5538622", "0.5534694", "0.5533031", "0.55307287", "0.5525496", "0.55119044", "0.5509862", "0.5509802", "0.54812086", "0.5476334", "0.5475084", "0.5473147", "0.5471543", "0.5471428", "0.5470716", "0.5469935", "0.54622495", "0.54622495", "0.54622495", "0.5455547", "0.5451316", "0.54465693", "0.5443467", "0.544168", "0.5440469", "0.5439743", "0.5429987", "0.5426145", "0.5424579", "0.5419704", "0.5419357", "0.5416479", "0.5416479" ]
0.0
-1
Substitution callback for 'fix_links'.
protected function _fix_links_callback_forum($m) { return 'index.php?board=' . strval(import_id_remap_get('forum', strval($m[2]), true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkfix($hook, $type, $returnvalue, $params) {\n\treturn handler_replace($returnvalue);\n}", "public function fixup_url_references($entry)\n\t\t{\n\t\t\t$entry->content = str_ireplace($this->_source_urls, $this->_target_urls, $entry->content);\n\t\t}", "function replace_links($content) {\r\n\tpreg_match_all(\"/<a\\s*[^>]*>(.*)<\\/a>/siU\", $content, $matches);\r\n\t//preg_match_all(\"/<a\\s[^>]*>(.*?)(</a>)/siU\", $content, $matches);\t\r\n\t$foundLinks = $matches[0];\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t\r\n\tforeach ($foundLinks as $theLink) {\r\n\t\t$uri = getAttribute('href',$theLink);\r\n\t\tif($wpbar_options[\"validateURL\"]) {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink) && isValidURL($uri)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\treturn $content;\r\n}", "function fix_links($post,$uid,$db,$table_prefix,$post_id=NULL,$is_pm=false)\n\t{\n\t\t$orig_post=$post;\n\n\t\t$post=preg_replace('#<!-- [mwl] --><a class=\"[\\w-]+\" href=\"([^\"]*)\"( onclick=\"window.open\\(this.href\\);\\s*return false;\")?'.'>(.*)</a><!-- [mwl] -->#U','[url=\"${3}\"]${1}[/url]',$post);\n\t\t$post=preg_replace('#<!-- e --><a href=\"mailto:(.*)\">(.*)</a><!-- e -->#U','[email=\"${2}\"]${1}[/email]',$post);\n\n\t\tglobal $OLD_BASE_URL;\n\t\tif (is_null($OLD_BASE_URL))\n\t\t{\n\t\t\t$rows=$db->query('SELECT * FROM '.$table_prefix.'config WHERE '.db_string_equal_to('config_name','server_name').' OR '.db_string_equal_to('config_name','server_port').' OR '.db_string_equal_to('config_name','script_path').' ORDER BY config_name');\n\t\t\t$server_path=$rows[0]['config_value'];\n\t\t\t$server_name=$rows[1]['config_value'];\n\t\t\t$server_port=$rows[2]['config_value'];\n\t\t\t$OLD_BASE_URL=($server_port=='80')?('http://'.$server_name.$server_path):('http://'.$server_name.':'.$server_port.$server_path);\n\t\t}\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewtopic\\.php\\?t=)(\\d*)#',array($this,'_fix_links_callback_topic'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewforum\\.php\\?f=)(\\d*)#',array($this,'_fix_links_callback_forum'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(profile\\.php\\?mode=viewprofile&u=)(\\d*)#',array($this,'_fix_links_callback_member'),$post);\n\t\t$post=preg_replace('#:[0-9a-f]{10}#','',$post);\n\n\t\t$matches=array();\n\t\t$count=preg_match_all('#\\[attachment=(\\d+)(:.*)?\\].*\\[\\/attachment(:.*)?\\]#Us',$post,$matches);\n\t\t$to=mixed();\n\t\tfor ($i=0;$i<$count;$i++)\n\t\t{\n\t\t\tif (!is_null($post_id))\n\t\t\t{\n\t\t\t\t$from=$matches[1][$i];\n\t\t\t\t$attachments=$db->query_select('attachments',array('attach_id'),array('post_msg_id'=>$post_id,'in_message'=>$is_pm?1:0),'ORDER BY attach_id');\n\t\t\t\t$to=array_key_exists(intval($from),$attachments)?$attachments[intval($from)]['attach_id']:-1;\n\t\t\t\t$to=import_id_remap_get('attachment',$to,true);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$to=NULL;\n\t\t\t}\n\t\t\tif (is_null($to))\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'(attachment removed)',$post);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'[attachment]'.strval($to).'[/attachment]',$post);\n\t\t\t}\n\t\t}\n\n\t\tif ($uid!='') $post=str_replace(':'.$uid,'',$post);\n\t\t$post=preg_replace('#<!-- s([^\\s]*) --><img src=\"\\{SMILIES_PATH\\}/[^\"]*\" alt=\"([^\\s]*)\" title=\"[^\"]*\" /><!-- s([^\\s]*) -->#U','${1}',$post);\n\n\t\t$post=preg_replace('#\\[size=\"?(\\d+)\"?\\]#i','[size=\"${1}%\"]',$post);\n\n\t\t$post=str_replace('{','\\{',$post);\n\n\t\treturn html_entity_decode($post,ENT_QUOTES);\n\t}", "public function detect_links()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:(?:https?|ftp):\\/\\/|(?:www|ftp)\\.)(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})(?::[0-9]{1,5})?(?:\\/[^\\s'\\\"]*)?(?:(?<![,\\)\\.])|[\\S])/\",\r\n\t\t\t$child->get_text(),\r\n\t\t\t$matches,\r\n\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\tif(substr($match[0], 0, 3) === 'ftp' && $match[0][3] !== ':')\r\n\t\t\t\t\t$url = 'ftp://' . $match[0];\r\n\t\t\t\telse if($match[0][0] === 'w')\r\n\t\t\t\t\t$url = 'http://' . $match[0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$url = $match[0];\r\n\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('url', array('default' => htmlentities($url, ENT_QUOTES | ENT_IGNORE, \"UTF-8\")));\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_URL));\r\n\r\n\t\treturn $this;\r\n\t}", "protected function addLinks()\n {\n }", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "function _ti_amg_fw_topics_do_drush_fix_urls($nid, &$context) {\n $node = node_load($nid);\n\n if (!empty($node->field_left_nav_links[LANGUAGE_NONE])) {\n foreach ($node->field_left_nav_links[LANGUAGE_NONE] as $delta => $link) {\n if (substr($link['url'], -1) == '/' && substr_count($link['url'], 'http://www.foodandwine.com')) {\n $node->field_left_nav_links[LANGUAGE_NONE][$delta]['url'] = substr($link['url'], 0, -1);\n\n $context['results'][$nid] = TRUE;\n }\n }\n }\n\n // Save it\n if ($context['results'][$nid]) {\n node_save($node);\n $context['message'] = t('Fixed links on page %title.',\n array('%title' => $node->title)\n );\n\n // Get it published\n if (function_exists('state_flow_load_state_machine')) {\n $state_flow = state_flow_load_state_machine($node);\n $state_flow->fire_event('publish', 1);\n }\n }\n else {\n $context['message'] = t('Links on page @title were already OK.',\n array('@title' => $node->title)\n );\n }\n}", "protected function updateBrokenLinks() {}", "protected function fix_supporting_file_references() {\r\n\t\tpreg_match_all('/<link([^<>]*?) href=\"([^\"]*?)\"([^<>]*?)\\/>/is', $this->code, $link_matches);\r\n\t\t/*$counter = sizeof($link_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t\r\n\t\t\t$counter--;\r\n\t\t}*/\r\n\t\t$array_replaces = array();\r\n\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t$href_content = $link_matches[2][$index];\r\n\t\t\tif($href_content[0] === '/' || strpos($href_content, 'http://') !== false) { // avoid root references and URLs\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$initial_href_content = $href_content;\r\n\t\t\t\t\t// first try looking closer\r\n\t\t\t\t\t$proper_reference = false;\r\n\t\t\t\t\twhile(!$proper_reference && substr($href_content, 0, 3) === '../') {\r\n\t\t\t\t\t\t$href_content = substr($href_content, 3);\r\n\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // try looking farther\r\n\t\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\t\twhile(!$proper_reference && $counter < 10) {\r\n\t\t\t\t\t\t\t$href_content = '../' . $href_content;\r\n\t\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$counter++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // give up or finish\r\n\t\t\t\t\t\tvar_dump($this->file, $href_content, $relative_path);exit(0);\r\n\t\t\t\t\t\tprint('<span style=\"color: red;\">Could not fix broken reference in &lt;link&gt;: ' . $value . '</span>');exit(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->logMsg('Reference ' . htmlentities($value) . ' was fixed.');\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\tforeach($array_replaces as $index => $value) {\r\n\t\t\t$this->code = str_replace($index, $value, $this->code);\r\n\t\t}\r\n\t}", "function substHREFsInHTML() {\n\t\tif (!is_array($this->theParts['html']['hrefs'])) return;\n\t\tforeach ($this->theParts['html']['hrefs'] as $urlId => $val) {\n\t\t\t\t// Form elements cannot use jumpurl!\n\t\t\tif ($this->jumperURL_prefix && ($val['tag'] != 'form') && ( !strstr( $val['ref'], 'mailto:' ))) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} elseif ( strstr( $val['ref'], 'mailto:' ) && $this->jumperURL_useMailto) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$substVal = $val['absRef'];\n\t\t\t}\n\t\t\t$this->theParts['html']['content'] = str_replace(\n\t\t\t\t$val['subst_str'],\n\t\t\t\t$val['quotes'] . $substVal . $val['quotes'],\n\t\t\t\t$this->theParts['html']['content']);\n\t\t}\n\t}", "function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }", "private function replaceURLsCallback($matches) {\n\n preg_match('/(http[s]?)?:\\/\\/([^\\/]+)(.*)?/', $matches[2], $url_matches);\n\n $replacement = $matches[0];\n\n if (!empty($url_matches[0])) {\n\n switch (drupal_strtoupper($this->https)) {\n case 'TO':\n $scheme = 'https';\n break;\n case 'FROM':\n $scheme = 'http';\n break;\n default:\n $scheme = $url_matches[1];\n break;\n }\n\n foreach($this->from_urls as $from_url) {\n\n $match_url = $url_matches[1] . '://' . $url_matches[2];\n\n if ($from_url == $match_url) {\n if (!$this->relative) {\n $replacement = $matches[1] . '=\"' . $scheme . '://';\n $replacement .= $this->toValue . $url_matches[3] . '\"';\n }\n else {\n $replacement = $matches[1] . '=\"' . $url_matches[3] . '\"';\n }\n break;\n }\n\n }\n\n }\n\n if ($replacement !== $matches[0]) {\n\n $this->debug && drush_print(\n t(\n 'URL: !from => !to',\n array(\n '!from' => $matches[0],\n '!to' => $replacement,\n )\n )\n );\n\n }\n\n return $replacement;\n\n }", "public function _rewrite_links_callback($text = '')\n {\n return _class('rewrite')->_rewrite_replace_links($text);\n }", "public function doLocalAnchorFix() {}", "private function rep_links_callback($match) {\t\r\n\t\t\r\n\t\t$query = substr($match[0],2,-2);\r\n\r\n\t\t$db_Article = Article::getArticle()->select($query);\r\n\t\t\r\n\t\tif($db_Article != FALSE) {\r\n\t\t\t$query = ' <a href=\"' . urlencode($query) . '\">' . $query . '</a> ';\r\n\t\t\t$this->links[$this->linkCount] = $db_Article;\r\n\t\t\t$this->linkCount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $query;\t\t\r\n\t}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "protected function prepare_links($theme)\n {\n }", "function rebound_links($links, $attributes = array()) {\n global $user;\n if (!$user->uid) {\n unset($links['links']['comment_forbidden']);\n }\n return theme_links($links, $attributes);\n}", "function tnsl_fCleanLinks(&$getNextGen) {\r\n\t$getNextGen = preg_replace('(&(?!([a-zA-Z]{2,6}|[0-9\\#]{1,6})[\\;]))', '&amp;', $getNextGen);\r\n\t$getNextGen = str_replace(array(\r\n\t\t'&amp;&amp;',\r\n\t\t'&amp;middot;',\r\n\t\t'&amp;nbsp;',\r\n\t\t'&amp;#'\r\n\t), array(\r\n\t\t'&&',\r\n\t\t'&middot;',\r\n\t\t'&nbsp;',\r\n\t\t'&#'\r\n\t), $getNextGen);\r\n\t// montego - following code is required to allow the new RNYA AJAX validations to work properly\r\n\t$getNextGen = preg_replace('/rnxhr.php\\?name=Your_Account&amp;file/', 'rnxhr.php\\?name=Your_Account&file', $getNextGen );\r\n\treturn;\r\n}", "function permalink_link()\n {\n }", "protected function prepare_links($item)\n {\n }", "protected function prepare_links($term)\n {\n }", "protected function prepare_links($term)\n {\n }", "function redlinks($_) {\n return preg_replace_callback(\"/<a href=\\\"?\\/([^'\\\">]+)\\\"?>/\", function($matches){\n if (is_link(filename($matches[1])))\n return $matches[0];\n else\n return preg_replace(\"/<a/\", \"<a class=redlink\", $matches[0]);\n }, $_);\n}", "protected function prepare_links($taxonomy)\n {\n }", "function url_to_link_callback($matches)\n{\n return '<a href=\"' . htmlspecialchars($matches[1]) . '\">' . $matches[1] . '</a>';\n}", "function node_link_alter(&$links, $node) {\n // Use 'Read more »' instead of 'Read more'\n if (isset($links['node_read_more'])) {\n $links['node_read_more']['title'] = t('Read more »');\n } \n \n // Remove Section on taxonomy term links\n foreach ($links as $module => $link) { \n if (strstr($module, 'taxonomy_term')) {\n foreach ($links as $key => $value) {\n if ($value['title'] == 'Life' || \n $value['title'] == 'Geek') {\n unset($links[$key]);\n }\n }\n }\n // Don't show language links in Today and other listing\n //unset($links['node_translation_ja']);\n //unset($links['node_translation_en']);\n }\n}", "function lean_links($links, $attributes = array('class' => 'links')) {\n \n // Link 'Add a comment' link to node page instead of comments reply page\n if($links['comment_add']['href']){\n $arr_linkparts = explode('/', $links['comment_add']['href']);\n $links['comment_add']['href'] = 'node/'.$arr_linkparts[2];\n }\n // Don't show 'reply' link for comments\n unset($links['comment_reply']);\n \n return theme_links($links, $attributes);\n}", "function _fix_links_callback_forum($m)\n\t{\n\t\treturn 'index.php?page=forumview&id='.strval(import_id_remap_get('forum',strval($m[2]),true));\n\t}", "protected function prepare_links($prepared)\n {\n }", "public function fix_links($post, $db, $table_prefix, $file_base = '')\n {\n $boardurl = '';\n\n require($file_base . '/Settings.php');\n $old_base_url = $boardurl;\n\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?topic=)(\\d*)#', array($this, '_fix_links_callback_topic'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?board=)(\\d*)#', array($this, '_fix_links_callback_forum'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?action=profile;u=)(\\d*)#', array($this, '_fix_links_callback_member'), $post);\n $post = preg_replace('#:[0-9a-f]{10}#', '', $post);\n return $post;\n }", "protected function prepare_links($sidebar)\n {\n }", "function dupeoff_actlinks( $links, $file ){\n\t//Static so we don't call plugin_basename on every plugin row.\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\t\n\tif ( $file == $this_plugin ){\n\t\t$settings_link = '<a href=\"options-general.php?page=dupeoff/dupeoff.php\">' . __('Settings') . '</a>';\n\t\tarray_unshift( $links, $settings_link ); // before other links\n\t\t}\n\treturn $links;\n}", "protected function getLinkHandlers() {}", "protected function getLinkHandlers() {}", "function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "public abstract function prepare_item_links($id);", "protected function prepare_links($post)\n {\n }", "protected function prepare_links($post)\n {\n }", "function callbackAddLinks($hookName, $args) {\n\t\t$request =& $this->getRequest();\n\t\tif ($this->getEnabled() && is_a($request->getRouter(), 'PKPPageRouter')) {\n\t\t\t$templateManager = $args[0];\n\t\t\t$currentJournal = $templateManager->get_template_vars('currentJournal');\n\t\t\t$announcementsEnabled = $currentJournal ? $currentJournal->getSetting('enableAnnouncements') : false;\n\n\t\t\tif (!$announcementsEnabled) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$displayPage = $currentJournal ? $this->getSetting($currentJournal->getId(), 'displayPage') : null;\n\n\t\t\t// Define when the <link> elements should appear\n\t\t\t$contexts = 'frontend';\n\t\t\tif ($displayPage == 'homepage') {\n\t\t\t\t$contexts = array('frontend-index', 'frontend-announcement');\n\t\t\t} elseif ($displayPage == 'announcement') {\n\t\t\t\t$contexts = 'frontend-' . $displayPage;\n\t\t\t}\n\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsAtom+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/atom+xml\" href=\"' . $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'atom')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRdf+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rdf+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRss+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rss+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss2')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn false;\n\t}", "protected function prepare_links($user)\n {\n }", "function _post_format_link($link, $term, $taxonomy)\n {\n }", "function _fix_links_callback_member($m)\n\t{\n\t\treturn 'index.php?page=members&type=view&id='.strval(import_id_remap_get('member',strval($m[2]),true));\n\t}", "function trans_link()\n{\n // --- mylinks ---\n // --- link table ---\n // lid int(11)\n // cid int(5) => multi\n // title varchar(100)\n // url varchar(250)\n // logourl varchar(60)\n // submitter int(11)\n // status tinyint(2) => not use\n // date int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n\n // --- mylinks_text table ---\n // lid int(11)\n // description text\n\n // --- weblinks ---\n // lid int(11)\n // cids varchar(100) : use catlink\n // title varchar(100)\n // url varchar(255)\n // banner varchar(255) : full url\n // uid int(5) : submitter\n // time_create int(10)\n // time_update int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n // description text\n //\n // search text default\n // passwd varchar(255)\n //\n // name varchar(255)\n // nameflag tinyint(2)\n // mail varchar(255)\n // mailflag tinyint(2)\n // company varchar(255)\n // addr varchar(255)\n // tel varchar(255)\n // admincomment text\n // width int(5)\n // height int(5)\n // recommend tinyint(2)\n // mutual tinyint(2)\n // broken int(11)\n // rss_url varchar(255)\n // rss_flag tinyint(3)\n // rss_xml mediumtext\n // rss_update int(10)\n // usercomment text\n // zip varchar(100)\n // state varchar(100)\n // city varchar(100)\n // addr2 varchar(255)\n // fax varchar(255)\n\n global $xoopsDB;\n global $LIMIT;\n global $cat_title_arr;\n\n echo '<h4>STEP 3: link table</h3>';\n\n global $MODULE_DIRNAME;\n $table_link = $xoopsDB->prefix($MODULE_DIRNAME . '_link');\n\n global $MODULE_URL;\n $shots_url_web = $MODULE_URL . '/images/shots/';\n\n $offset = 0;\n if (isset($_POST['offset'])) {\n $offset = $_POST['offset'];\n }\n $next = $offset + $LIMIT;\n\n $table = $xoopsDB->prefix('mylinks_links');\n $sql1 = \"SELECT count(*) FROM $table\";\n $res1 = sql_exec($sql1);\n $row1 = $xoopsDB->fetchRow($res1);\n $total = $row1[0];\n\n echo \"There are $total links <br />\\n\";\n echo \"Transfer $offset - $next th link <br /><br />\";\n\n $sql2 = \"SELECT * FROM $table ORDER BY lid\";\n $res2 = sql_exec($sql2, $LIMIT, $offset);\n\n while ($row = $xoopsDB->fetchArray($res2)) {\n $lid = $row['lid'];\n $uid = $row['submitter'];\n $cid = $row['cid'];\n $url = $row['url'];\n $hits = $row['hits'];\n $rating = $row['rating'];\n $votes = $row['votes'];\n $logourl = $row['logourl'];\n $comments = $row['comments'];\n $time_create = $row['date'];\n $time_update = $time_create;\n\n $title = addslashes($row['title']);\n\n $banner = '';\n $width = 0;\n $height = 0;\n\n if ($logourl) {\n $banner = $shots_url_web . $logourl;\n $size = getimagesize($banner);\n\n if ($size) {\n $width = (int)$size[0];\n $height = (int)$size[1];\n } else {\n echo \"<font color='red'>image size error: $banner</font><br />\";\n }\n\n $banner = addslashes($banner);\n }\n\n $desc = get_desc($lid);\n $desc = addslashes($desc);\n\n $cat = addslashes($cat_title_arr[$cid]);\n $search = \"$url $title $cat $desc\";\n\n $passwd = md5(rand(10000000, 99999999));\n\n echo \"$lid: $title <br />\";\n\n $sql = 'INSERT INTO ' . $table_link . ' (';\n $sql .= 'lid, uid, title, url, description, ';\n $sql .= 'search, passwd, time_create, time_update, ';\n $sql .= 'hits, rating, votes, comments, ';\n $sql .= 'banner, width, height';\n $sql .= ') VALUES (';\n $sql .= \"$lid, $uid, '$title', '$url', '$desc', \";\n $sql .= \"'$search', '$passwd', $time_create, $time_update, \";\n $sql .= \"$hits, $rating, $votes, $comments, \";\n $sql .= \"'$banner', $width, $height\";\n $sql .= ')';\n\n sql_exec($sql);\n\n insert_catlink($cid, $lid);\n }\n\n if ($total > $next) {\n form_next_link($next);\n } else {\n form_votedate();\n }\n}", "protected function prepare_links($id)\n {\n }", "protected function prepare_links($id)\n {\n }", "public function using_permalinks()\n {\n }", "protected function prepare_links($post_type)\n {\n }", "function ldap_mod_replace($link_identifier, $dn, $entry)\n{\n}", "function _fix_links_callback_topic($m)\n\t{\n\t\treturn 'index.php?page=topicview&id='.strval(import_id_remap_get('topic',strval($m[2]),true));\n\t}", "function smarty_function_mtlink($args, &$ctx) {\n // status: incomplete\n // parameters: template, entry_id\n static $_template_links = array();\n $curr_blog = $ctx->stash('blog');\n if (isset($args['template'])) {\n if (!empty($args['blog_id']))\n $blog = $ctx->mt->db()->fetch_blog($args['blog_id']);\n else\n $blog = $ctx->stash('blog');\n\n $name = $args['template'];\n $cache_key = $blog->id . ';' . $name;\n if (isset($_template_links[$cache_key])) {\n $link = $_template_links[$cache_key];\n } else {\n $tmpl = $ctx->mt->db()->load_index_template($ctx, $name, $blog->id);\n $site_url = $blog->site_url();\n if (!preg_match('!/$!', $site_url)) $site_url .= '/';\n $link = $site_url . $tmpl->template_outfile;\n $_template_links[$cache_key] = $link;\n }\n if (!$args['with_index']) {\n $link = _strip_index($link, $curr_blog);\n }\n return $link;\n } elseif (isset($args['entry_id'])) {\n $arg = array('entry_id' => $args['entry_id']);\n list($entry) = $ctx->mt->db()->fetch_entries($arg);\n $ctx->localize(array('entry'));\n $ctx->stash('entry', $entry);\n $link = $ctx->tag('EntryPermalink',$args);\n $ctx->restore(array('entry'));\n if ($args['with_index'] && preg_match('/\\/(#.*)$/', $link)) {\n $index = $ctx->mt->config('IndexBasename');\n $ext = $curr_blog->blog_file_extension;\n if ($ext) $ext = '.' . $ext; \n $index .= $ext;\n $link = preg_replace('/\\/(#.*)?$/', \"/$index\\$1\", $link);\n }\n return $link;\n }\n return '';\n}", "function TS_links_rte($value,$wrap='')\t{\n\t\t$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml_proc');\n\n\t\t$value = $htmlParser->TS_AtagToAbs($value);\n\t\t$wrap = explode('|',$wrap);\n\t\t\t// Split content by the TYPO3 pseudo tag \"<LINK>\":\n\t\t$blockSplit = $htmlParser->splitIntoBlock('link',$value,1);\n\t\tforeach($blockSplit as $k => $v)\t{\n\t\t\t$error = '';\n\t\t\tif ($k%2)\t{\t// block:\n\t\t\t\t$tagCode = t3lib_div::trimExplode(' ',trim(substr($htmlParser->getFirstTag($v),0,-1)),1);\n\t\t\t\t$link_param = $tagCode[1];\n\t\t\t\t$href = '';\n\t\t\t\t$siteUrl = $htmlParser->siteUrl();\n\t\t\t\t\t// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()\n\t\t\t\tif(strstr($link_param,'@'))\t{\t\t// mailadr\n\t\t\t\t\t$href = 'mailto:'.eregi_replace('^mailto:','',$link_param);\n\t\t\t\t} elseif (substr($link_param,0,1)=='#') {\t// check if anchor\n\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t} else {\n\t\t\t\t\t$fileChar=intval(strpos($link_param, '/'));\n\t\t\t\t\t$urlChar=intval(strpos($link_param, '.'));\n\n\t\t\t\t\t\t// Detects if a file is found in site-root OR is a simulateStaticDocument.\n\t\t\t\t\tlist($rootFileDat) = explode('?',$link_param);\n\t\t\t\t\t$rFD_fI = pathinfo($rootFileDat);\n\t\t\t\t\tif (trim($rootFileDat) && !strstr($link_param,'/') && (@is_file(PATH_site.$rootFileDat) || t3lib_div::inList('php,html,htm',strtolower($rFD_fI['extension']))))\t{\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} elseif($urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar))\t{\t// url (external): If doubleSlash or if a '.' comes before a '/'.\n\t\t\t\t\t\tif (!ereg('^[a-z]*://',trim(strtolower($link_param))))\t{$scheme='http://';} else {$scheme='';}\n\t\t\t\t\t\t$href = $scheme.$link_param;\n\t\t\t\t\t} elseif($fileChar)\t{\t// file (internal)\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} else {\t// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to tables.php!!)\n\t\t\t\t\t\t$link_params_parts = explode('#',$link_param);\n\t\t\t\t\t\t$idPart = trim($link_params_parts[0]);\t\t// Link-data del\n\t\t\t\t\t\tif (!strcmp($idPart,''))\t{ $idPart=$htmlParser->recPid; }\t// If no id or alias is given, set it to class record pid\n\t\t\t\t\t\tif ($link_params_parts[1] && !$sectionMark)\t{\n\t\t\t\t\t\t\t$sectionMark = '#'.trim($link_params_parts[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair\n\t\t\t\t\t\t$pairParts = t3lib_div::trimExplode(',',$idPart);\n\t\t\t\t\t\tif (count($pairParts)>1)\t{\n\t\t\t\t\t\t\t$idPart = $pairParts[0];\n\t\t\t\t\t\t\t// Type ? future support for?\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Checking if the id-parameter is an alias.\n\t\t\t\t\t\tif (!t3lib_div::testInt($idPart))\t{\n\t\t\t\t\t\t\tlist($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);\n\t\t\t\t\t\t\t$idPart = intval($idPartR['uid']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$page = t3lib_BEfunc::getRecord('pages', $idPart);//this doesnt work at the moment...no page exist check\n\t\t\t\t\t\t//if (is_array($page))\t{\t// Page must exist...\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t/*} else {\n\t\t\t\t\t\t\t#$href = '';\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t\t$error = 'No page found: '.$idPart;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Setting the A-tag:\n\t\t\t\t$bTag = '<a href=\"'.htmlspecialchars($href).'\"'.($tagCode[2]&&$tagCode[2]!='-' ? ' target=\"'.htmlspecialchars($tagCode[2]).'\"' : '').'>'.$wrap[0];\n\t\t\t\t$eTag = $wrap[1].'</a>';\n\t\t\t\t$blockSplit[$k] = $bTag.$htmlParser->TS_links_rte($htmlParser->removeFirstAndLastTag($blockSplit[$k])).$eTag;\n\t\t\t}\n\t\t}\n\n\t\t\t// Return content:\n\t\treturn implode('',$blockSplit);\n\t}", "function fixup_protocolless_urls($in)\n{\n require_code('urls2');\n return _fixup_protocolless_urls($in);\n}", "function bps_plugin_extra_links($links, $file) {\n\tstatic $this_plugin;\n\tif ( ! current_user_can('install_plugins') )\n\t\treturn $links;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ) {\n\t\t$links[2] = '<a href=\"http://forum.ait-pro.com/forums/topic/bulletproof-security-pro-version-release-dates/\" target=\"_blank\" title=\"BulletProof Security Pro Version Release Dates and Whats New\">' . __('Version Release Dates|Whats New', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"http://forum.ait-pro.com/\" target=\"_blank\" title=\"BulletProof Security Pro Forum\">' . __('Forum|Support', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"admin.php?page=bulletproof-security/admin/tools/tools.php#bps-tabs-15\" title=\"Pro Tools Plugin Update Check tool\">' . __('Manual Upgrade Check', 'bulleproof-security') . '</a>';\n\n/*\techo '<pre>';\n\tprint_r($links);\n\techo '</pre>';\n*/\t\n\t}\n\n\treturn $links;\n}", "function autoContentLinksContent($content)\r\n\t{\r\n\t\t$options = get_option('auto_content_links');\r\n\t\t\r\n\t\t// Set default value for autolink linking back to itself\r\n\t\tif(!isset($link['link_autolink'])) $link['link_autolink'] = true;\r\n\t\t\r\n\t\tif(isset($options['links']) AND !empty($options['links']))\r\n\t\t{\r\n\t\t\tforeach($options['links'] as $link)\r\n\t\t\t{\r\n\t\t\t\tif(!(preg_match(\"@\".preg_quote($link['url']) .'$@', autoContentLinksCurrentPageURL())) OR $link['link_autolink'] == true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$wordBoundary = '';\r\n\t\t\t\t\tif($link['match_whole_word'] == true) $wordBoundary = '\\b';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$newWindow = '';\r\n\t\t\t\t\tif($link['new_window'] == true) $newWindow = ' target=\"_blank\"';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$content = preg_replace('@('.$wordBoundary.$link['name'].$wordBoundary.')(?!([^<>]*<[^Aa<>]+>)*([^<>]+)?</[aA]>)(?!([^<\\[]+)?[>\\]])@', '<a'.$newWindow.' href=\"'.$link['url'].'\">'.$link['name'].'</a>', $content, $link['instances']);\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $content;\r\n\t}", "function renderLinks($links, $prefix = \"\") {\n\n $value = \"\";\n if (!isset($links[0])) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $links[\"url\"], \n $links[\"url\"], \n (\"\" != $links[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n );\n } else {\n\n reset($links);\n while (list($k, $link) = each($links)) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $link[\"url\"], \n $link[\"url\"], \n (\"\" != $link[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n ); \n }\n\n }\n\n $value = substr($value, 0, -2);\n $this->tpl->setCurrentBlock(strtolower($prefix) . \"links\");\n $this->tpl->setVariable(\"LINK\", $value);\n $this->tpl->parseCurrentBlock();\n\n }", "function feed_links($args = array())\n {\n }", "function wp_targeted_link_rel_callback($matches)\n {\n }", "function changeUrlUnparsedContentCode(&$tag, &$data)\n{\n global $txt, $modSettings, $context;\n loadLanguage('Redirector/Redirector');\n\n $data = strtr($data, ['<br />' => '']);\n $link_text = $data;\n\n // Skip local urls with #\n if (strpos($data, '#') === 0) {\n return;\n } else {\n if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0) {\n $data = 'http://' . $data;\n }\n }\n\n // Hide links from guests\n if (!empty($modSettings['redirector_hide_guest_links']) && !empty($context['user']['is_guest']) && !checkWhiteList(\n $data\n )) {\n $link_text = !empty($modSettings['redirector_hide_guest_custom_message']) ? $modSettings['redirector_hide_guest_custom_message'] : $txt['redirector_hide_guest_message'];\n }\n\n $data = getRedirectorUrl($data);\n\n $tag['content'] = '<a href=\"' . $data . '\" class=\"bbc_link\" ' . ((!empty($modSettings['redirector_nofollow_links']) && $modSettings['redirector_mode'] == 'immediate' && !checkWhiteList(\n $data\n )) ? 'rel=\"nofollow noopener noreferrer\" ' : '') . ($tag['tag'] == 'url' ? 'target=\"_blank\"' : '') . ' >' . $link_text . '</a>';\n}", "function onAcesefIlinks(&$text) {\r\n\t\tif (ACESEF_PACK == 'pro' && $this->AcesefConfig->ilinks_mode == '1') {\r\n\t\t\t$component = JRequest::getCmd('option');\r\n\t\t\t$ext_params\t= AcesefCache::getExtensionParams($component);\r\n\t\t\t\r\n\t\t\tif ($ext_params && class_exists('AcesefIlinks')) {\r\n\t\t\t\tAcesefIlinks::plugin($text, $ext_params, 'trigger', $component);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine whether the default automated URL handling has been replaced.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default')) {\n\n\t\t\t// Determine whether the URL segment or parent ID has been updated.\n\n\t\t\t$changed = $this->owner->getChangedFields();\n\t\t\tif((isset($changed['URLSegment']['before']) && isset($changed['URLSegment']['after']) && ($changed['URLSegment']['before'] != $changed['URLSegment']['after'])) || (isset($changed['ParentID']['before']) && isset($changed['ParentID']['after']) && ($changed['ParentID']['before'] != $changed['ParentID']['after']))) {\n\n\t\t\t\t// The link mappings should only be created for existing pages.\n\n\t\t\t\t$URL = (isset($changed['URLSegment']['before']) ? $changed['URLSegment']['before'] : $this->owner->URLSegment);\n\t\t\t\tif(strpos($URL, 'new-') !== 0) {\n\n\t\t\t\t\t// Determine the page URL.\n\n\t\t\t\t\t$parentID = (isset($changed['ParentID']['before']) ? $changed['ParentID']['before'] : $this->owner->ParentID);\n\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parentID}\");\n\t\t\t\t\twhile($parent) {\n\t\t\t\t\t\t$URL = Controller::join_links($parent->URLSegment, $URL);\n\t\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parent->ParentID}\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a link mapping for this page.\n\n\t\t\t\t\tsingleton(MisdirectionService::class)->createPageMapping($URL, $this->owner->ID);\n\n\t\t\t\t\t// Purge any link mappings that point back to the same page.\n\n\t\t\t\t\t$this->owner->regulateMappings(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link(), $this->owner->ID);\n\n\t\t\t\t\t// Recursively create link mappings for any children.\n\n\t\t\t\t\t$children = $this->owner->AllChildrenIncludingDeleted();\n\t\t\t\t\tif($children->count()) {\n\t\t\t\t\t\t$this->owner->recursiveMapping($URL, $children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function prepare_links($plugin)\n {\n }", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "function tumblrLinkBacks( $content ) {\n\tglobal $wp_query, $post;\n\t$post_id = get_post( $post->ID );\n\t$posttitle = $post_id->post_title;\n\t$permalink = get_permalink( get_post( $post->ID ) );\n\t$tumblr_keys = get_post_custom_keys( $post->ID );\n\tif( get_post_meta( $wp_query->post->ID, 'TumblrURL', true ) ) {\n\t\tif( $tumblr_keys ) {\n\t\t\tforeach( $tumblr_keys as $tumblr_key ) {\n\t\t\t\tif( $tumblr_key == 'TumblrURL' ) {\n\t\t\t\t\t$tumblr_vals = get_post_custom_values( $tumblr_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $tumblr_vals ) {\n\t\t\t\tif( is_feed() ) {\n\t\t\t\t\t$content .= '<p><a href=\"'.$tumblr_vals[0].'\" title=\"Direct link to featured article\">Direct Link to Article</a> &#8212; ';\n\t\t\t\t\t$content .= '<a href=\"'.$permalink.'\">Permalink</a></p>';\n\t\t\t\t\treturn $content;\n\t\t\t\t} else {\n\t\t\t\t\treturn $content;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$content = $content;\n\t\treturn $content;\n\t}\n}", "public function fixHreflang()\n {\n global $config, $languages, $listing_data, $currentPage;\n\n if (!$config['mf_geo_subdomains'] || !$config['mod_rewrite'] || count($languages) == 1) {\n return;\n }\n\n $hreflang = array();\n $url = RL_URL_HOME . $currentPage;\n\n foreach ($languages as $lang_item) {\n $lang_code = $lang_item['Code'] == $config['lang'] ? '' : $lang_item['Code'];\n\n if ($this->detailsPage) {\n $hreflang[$lang_item['Code']] = $this->buildListingUrl($url, $listing_data, $lang_code);\n } else {\n $hreflang[$lang_item['Code']] = $this->makeUrlGeo($url, $lang_code);\n }\n }\n\n $GLOBALS['rlSmarty']->assign('hreflang', $hreflang);\n }", "function replace_long_by_shorten_links($postId, $replacingList) \r\n{\r\n global $wpdb;\r\n\r\n $post = get_post($postId);\r\n $post_content = $post->post_content;\r\n\r\n foreach ($replacingList as $replaceContent) {\r\n $post_content = str_replace($replaceContent['source_link'], $replaceContent['result_link'], $post_content);\r\n } \r\n $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d\", $post_content, $postId ) );\r\n}", "public function add_links($links)\n {\n }", "function cleanLink($input) {\n\t// Prefix URL with http:// if it was missing from the input\n\tif(trim($input[url]) != \"\" && !preg_match(\"#^https?://.*$#\",$input[url])) { $input[url] = \"http://\" . $input[url]; } \t\n\t\t\n\t\t$curly = array(\"{\",\"}\");\n\t\t$curly_replace = array(\"&#123;\",\"&#125;\");\n\t\t\n\t\tforeach($input as $field => $data) {\n\t\t\t$input[$field] = filter_var(trim($data),FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t$input[$field] = str_replace($curly,$curly_replace,$input[$field]); // Replace curly brackets (needed for placeholders to work)\n\t\t\t\t\n\t\tif($field == \"url\") {\n\t\t\t$input[url] = str_replace(\"&#38;\",\"&\",$input[url]); // Put &s back into URL\n\t\t\n\t\t}\n\t}\t\n\treturn($input);\n}", "public static function Links($Mixed) {\n if (!is_string($Mixed))\n return self::To($Mixed, 'Links');\n else {\n $Mixed = preg_replace_callback(\n \"/\n (?<!<a href=\\\")\n (?<!\\\")(?<!\\\">)\n ((?:https?|ftp):\\/\\/)\n ([\\@a-z0-9\\x21\\x23-\\x27\\x2a-\\x2e\\x3a\\x3b\\/;\\x3f-\\x7a\\x7e\\x3d]+)\n /msxi\",\n array('Gdn_Format', 'LinksCallback'),\n $Mixed);\n\n return $Mixed;\n }\n }", "function automatic_feed_links($add = \\true)\n {\n }", "function feed_links_extra($args = array())\n {\n }", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function string_insert_hrefs( $p_string ) \r\n{\r\n\tif ( !config_get('html_make_links') ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$t_change_quotes = false;\r\n\tif( ini_get_bool( 'magic_quotes_sybase' ) ) {\r\n\t\t$t_change_quotes = true;\r\n\t\tini_set( 'magic_quotes_sybase', false );\r\n\t}\r\n\r\n\t// Find any URL in a string and replace it by a clickable link\r\n\t$p_string = preg_replace( '/(([[:alpha:]][-+.[:alnum:]]*):\\/\\/(%[[:digit:]A-Fa-f]{2}|[-_.!~*\\';\\/?%^\\\\\\\\:@&={\\|}+$#\\(\\),\\[\\][:alnum:]])+)/se',\r\n \"'<a href=\\\"'.rtrim('\\\\1','.').'\\\">\\\\1</a> [<a href=\\\"'.rtrim('\\\\1','.').'\\\" target=\\\"_blank\\\">^</a>]'\", $p_string);\r\n \r\n\tif( $t_change_quotes ) {\r\n\t\tini_set( 'magic_quotes_sybase', true );\r\n\t}\r\n\r\n\t# Set up a simple subset of RFC 822 email address parsing\r\n\t# We don't allow domain literals or quoted strings\r\n\t# We also don't allow the & character in domains even though the RFC\r\n\t# appears to do so. This was to prevent &gt; etc from being included.\r\n\t# Note: we could use email_get_rfc822_regex() but it doesn't work well\r\n\t# when applied to data that has already had entities inserted.\r\n\t#\r\n\t# bpfennig: '@' doesn't accepted anymore\r\n\t# achumakov: characters 0x80-0xFF aren't acceptable, too\r\n\t$t_atom = '[^\\'@\\'](?:[^()<>@,;:\\\\\\\".\\[\\]\\000-\\037\\177-\\377 &]+)';\r\n\r\n\t# In order to avoid selecting URLs containing @ characters as email\r\n\t# addresses we limit our selection to addresses that are preceded by:\r\n\t# * the beginning of the string\r\n\t# * a &lt; entity (allowing '<[email protected]>')\r\n\t# * whitespace\r\n\t# * a : (allowing 'send email to:[email protected]')\r\n\t# * a \\n, \\r, or > (because newlines have been replaced with <br />\r\n\t# and > isn't valid in URLs anyway\r\n\t#\r\n\t# At the end of the string we allow the opposite:\r\n\t# * the end of the string\r\n\t# * a &gt; entity\r\n\t# * whitespace\r\n\t# * a , character (allowing 'email [email protected], or ...')\r\n\t# * a \\n, \\r, or <\r\n\r\n\t$p_string = preg_replace( '/(?<=^|&quot;|&lt;|[\\s\\:\\>\\n\\r])('.$t_atom.'(?:\\.'.$t_atom.')*\\@'.$t_atom.'(?:\\.'.$t_atom.')*)(?=$|&quot;|&gt;|[\\s\\,\\<\\n\\r])/s',\r\n\t\t\t\t\t\t\t'<a href=\"mailto:\\1\">\\1</a>', $p_string);\r\n\r\n\treturn $p_string;\r\n}", "function modify_attachment_link( $markup, $id, $size, $permalink ) {\n global $post;\n if ( ! $permalink ) {\n $markup = str_replace( '<a href', '<a class=\"view\" data-rel=\"prettyPhoto[slides]-'. $post->ID .'\" href', $markup );\n }\n return $markup;\n }", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "public function autoLinkUrls($text) {\n\t\t$placeholders = [];\n\t\t$replace = [];\n\n\t\t$insertPlaceholder = function($matches) use (&$placeholders) {\n\t\t\t$key = md5($matches[0]);\n\t\t\t$placeholders[$key] = $matches[0];\n\n\t\t\treturn $key;\n\t\t};\n\n\t\t$pattern = '#(?<!href=\"|src=\"|\">)((?:https?|ftp|nntp)://[a-z0-9.\\-:]+(?:/[^\\s]*)?)#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\t$pattern = '#(?<!href=\"|\">)(?<!\\b[[:punct:]])(?<!http://|https://|ftp://|nntp://)www.[^\\n\\%\\ <]+[^<\\n\\%\\,\\.\\ <](?<!\\))#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\tforeach ($placeholders as $hash => $url) {\n\t\t\t$link = $url;\n\n\t\t\tif (!preg_match('#^[a-z]+\\://#', $url)) {\n\t\t\t\t$url = 'http://' . $url;\n\t\t\t}\n\t\t\t$replace[$hash] = \"<a href=\\\"{$url}\\\">{$link}</a>\";\n\t\t}\n\t\treturn strtr($text, $replace);\n\t}", "function setLinks($link) \n {\n $this->links = $link;\n }", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "function avia_link_content_filter($current_post)\n\t{\n\t\t$link \t\t= \"\";\n\t\t$newlink = false;\n\t\t$pattern1 \t= '$^\\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$i';\n\t\t$pattern2 \t= \"!^\\<a.+?<\\/a>!\";\n\t\t$pattern3 \t= \"!\\<a.+?<\\/a>!\";\n\n\t\t//if the url is at the begnning of the content extract it\n\t\tpreg_match($pattern1, $current_post['content'] , $link);\n\t\tif(!empty($link[0]))\n\t\t{\n\t\t\t$link = $link[0];\n\t\t\t$markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false));\n\t\t\t$current_post['title'] = \"<a href='$link' rel='bookmark' title='\".__('Link to:','avia_framework').\" \".the_title_attribute('echo=0').\"' $markup>\".get_the_title().\"</a>\";\n\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpreg_match($pattern2, $current_post['content'] , $link);\n\t\t\tif(!empty($link[0]))\n\t\t\t{\n\t\t\t\t$link = $link[0];\n\t\t\t\t$current_post['title'] = $link;\n\t\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t\t\t\n\t\t\t\t$newlink = get_url_in_content( $link );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpreg_match($pattern3, $current_post['content'] , $link);\n\t\t\t\tif(!empty($link[0]))\n\t\t\t\t{\n\t\t\t\t\t$current_post['title'] = $link[0];\n\t\t\t\t\t\n\t\t\t\t\t$newlink = get_url_in_content( $link[0] );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($link)\n\t\t{\n\t\t\tif(is_array($link)) $link = $link[0];\n\t\t\tif($newlink) $link = $newlink;\n\t\t\t\n\t\t\t$heading = is_singular() ? \"h1\" : \"h2\";\n\n\t\t\t//$current_post['title'] = \"<{$heading} class='post-title entry-title \". avia_offset_class('meta', false). \"'>\".$current_post['title'].\"</{$heading}>\";\n\t\t\t$current_post['title'] = \"<{$heading} class='post-title entry-title' \".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).\">\".$current_post['title'].\"</{$heading}>\";\n\t\t\t\n\t\t\t//needs to be set for masonry\n\t\t\t$current_post['url'] = $link;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$current_post = avia_default_title_filter($current_post);\n\t\t}\n\n\t\treturn $current_post;\n\t}", "public function getLinkFun() {}", "public static function link_to(){\n echo call_user_func_array('Laika::link_to', func_get_args() );\n }", "function fixURL($url, $includeHREF ) {\n $properURL = \"\"; \n\tswitch( substr($url, 0, 4) )\n {\n\tcase \"http\":\n \t$properURL= $url;\n\t break;\n\tcase \"www.\":\n \t$properURL=\"http://\".$url;\n\t\tbreak;\n\tdefault:\n \t$properURL=\"http://www.\".$url;\n\t\tbreak;\n\t}\n\tif ( $includeHREF == true )\n\t{\n\t\t$properURL = \"<a href=\".$properURL.\">\".$properURL.\"</a>\";\n\t}\n\treturn $properURL; \n}", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "function _links_add_base($m)\n {\n }", "protected function prepare_links($location)\n {\n }", "function wp_make_link_relative($link)\n {\n }", "function url_to_link($str)\n{\n $pattern = \"#(\\bhttps?://\\S+\\b)#\";\n return preg_replace_callback($pattern, 'url_to_link_callback', $str);\n}", "function autoLinkReferences(DOMNode $node) {\n\t// Don’t link inside .h-cite elements or headers\n\tif ($node->nodeType == XML_ELEMENT_NODE and strstr(' ' . $node->getAttribute('class') . ' ', ' h-cite '))\n\t\treturn;\n\t\n\tif ($node->nodeType == XML_TEXT_NODE):\n\t\t$node->data = preg_replace_callback('/Article \\d+/', function ($matches) {\n\t\t\treturn 'REPLACE_BEGIN_ELEMENTa href=\"#' . slugify($matches[0]) . '\"REPLACE_END_ELEMENT' . $matches[0] . 'REPLACE_BEGIN_ELEMENT/aREPLACE_END_ELEMENT';\n\t\t}, $node->data);\n\tendif;\n\t\n\t// Loop through each child node\n\tif ($node->hasChildNodes() and !isheader($node)):\n\t\tforeach ($node->childNodes as $n):\n\t\t\tautoLinkReferences($n);\n\t\tendforeach;\n\tendif;\n}", "function bps_plugin_actlinks( $links, $file ){\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ){\n\t$settings_link = '<a href=\"admin.php?page=bulletproof-security/admin/core/options.php\">' . __('Settings', 'bulletproof-security') . '</a>';\n\t\tarray_unshift( $links, $settings_link );\n\t}\n\treturn $links;\n}", "function layout_builder_post_update_discover_new_contextual_links() {\n // Empty post-update hook.\n}", "protected function generateLinks()\n {\n if ( ! is_null($this->links) ) {\n foreach ( $this->links as $link ) {\n $this->addLine('<url>');\n $this->addLine('<loc>');\n $this->addLine($this->helpers->url(\n $link->link,\n $this->protocol,\n $this->host\n ));\n $this->addLine('</loc>');\n $this->addLine('<lastmod>' . date_format($link->updated_at, 'Y-m-d') . '</lastmod>');\n $this->addLine('</url>');\n }\n }\n }", "function minorite_menu_link__links(array $variables) {\n $element = $variables['element'];\n $options = $variables['element']['#original_link']['options'];\n return '<option value=\"' . url($element['#href']) . '\">' . $element['#title'] . \"</option>\\n\";\n}", "private static function links()\n {\n $files = ['Link'];\n $folder = static::$root.'Http/Links'.'/';\n\n self::call($files, $folder);\n\n $files = ['LinkKeyNotFoundException'];\n $folder = static::$root.'Http/Links/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function InitLookupLinks()\r\n{\r\n\tglobal $lookupTableLinks;\r\n\r\n\t$lookupTableLinks = array();\r\n\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"][\"edit\"] = array(\"table\" => \"adm_meuplano\", \"field\" => \"idPlano\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"][\"edit\"] = array(\"table\" => \"login\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"atendimento_presencial\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"nome_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"ramo_empresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"estado_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"municipio_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}" ]
[ "0.7045814", "0.686694", "0.6711534", "0.66502124", "0.66446537", "0.66224885", "0.65817183", "0.6432874", "0.6428899", "0.6366067", "0.6361728", "0.6249323", "0.6161205", "0.61046034", "0.60852325", "0.60445845", "0.59877515", "0.59831333", "0.59817964", "0.59368", "0.593196", "0.5920706", "0.5916994", "0.5916994", "0.59039176", "0.58565617", "0.583072", "0.5828029", "0.58280253", "0.5801932", "0.5797788", "0.5796027", "0.5786061", "0.5770534", "0.57458425", "0.57458425", "0.5709149", "0.5707769", "0.5706252", "0.5697336", "0.5697336", "0.56955427", "0.56807977", "0.5679257", "0.56551903", "0.56291497", "0.5627745", "0.5627745", "0.56220585", "0.5613159", "0.56118536", "0.56038123", "0.5599441", "0.5591072", "0.5588116", "0.558426", "0.5583212", "0.5574627", "0.55707014", "0.556848", "0.55682653", "0.5565082", "0.5564862", "0.55577147", "0.5555877", "0.5546372", "0.5545613", "0.5543786", "0.5538622", "0.5534694", "0.5533031", "0.55307287", "0.5525496", "0.55119044", "0.5509862", "0.5509802", "0.54812086", "0.5476334", "0.5475084", "0.5473147", "0.5471543", "0.5471428", "0.5470716", "0.5469935", "0.54622495", "0.54622495", "0.54622495", "0.5455547", "0.5451316", "0.54465693", "0.5443467", "0.544168", "0.5440469", "0.5439743", "0.5429987", "0.5426145", "0.5424579", "0.5419704", "0.5419357", "0.5416479", "0.5416479" ]
0.0
-1
Substitution callback for 'fix_links'.
protected function _fix_links_callback_member($m) { return 'index.php?action=profile;u=' . strval(import_id_remap_get('member', strval($m[2]), true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkfix($hook, $type, $returnvalue, $params) {\n\treturn handler_replace($returnvalue);\n}", "public function fixup_url_references($entry)\n\t\t{\n\t\t\t$entry->content = str_ireplace($this->_source_urls, $this->_target_urls, $entry->content);\n\t\t}", "function replace_links($content) {\r\n\tpreg_match_all(\"/<a\\s*[^>]*>(.*)<\\/a>/siU\", $content, $matches);\r\n\t//preg_match_all(\"/<a\\s[^>]*>(.*?)(</a>)/siU\", $content, $matches);\t\r\n\t$foundLinks = $matches[0];\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t\r\n\tforeach ($foundLinks as $theLink) {\r\n\t\t$uri = getAttribute('href',$theLink);\r\n\t\tif($wpbar_options[\"validateURL\"]) {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink) && isValidURL($uri)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\treturn $content;\r\n}", "function fix_links($post,$uid,$db,$table_prefix,$post_id=NULL,$is_pm=false)\n\t{\n\t\t$orig_post=$post;\n\n\t\t$post=preg_replace('#<!-- [mwl] --><a class=\"[\\w-]+\" href=\"([^\"]*)\"( onclick=\"window.open\\(this.href\\);\\s*return false;\")?'.'>(.*)</a><!-- [mwl] -->#U','[url=\"${3}\"]${1}[/url]',$post);\n\t\t$post=preg_replace('#<!-- e --><a href=\"mailto:(.*)\">(.*)</a><!-- e -->#U','[email=\"${2}\"]${1}[/email]',$post);\n\n\t\tglobal $OLD_BASE_URL;\n\t\tif (is_null($OLD_BASE_URL))\n\t\t{\n\t\t\t$rows=$db->query('SELECT * FROM '.$table_prefix.'config WHERE '.db_string_equal_to('config_name','server_name').' OR '.db_string_equal_to('config_name','server_port').' OR '.db_string_equal_to('config_name','script_path').' ORDER BY config_name');\n\t\t\t$server_path=$rows[0]['config_value'];\n\t\t\t$server_name=$rows[1]['config_value'];\n\t\t\t$server_port=$rows[2]['config_value'];\n\t\t\t$OLD_BASE_URL=($server_port=='80')?('http://'.$server_name.$server_path):('http://'.$server_name.':'.$server_port.$server_path);\n\t\t}\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewtopic\\.php\\?t=)(\\d*)#',array($this,'_fix_links_callback_topic'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(viewforum\\.php\\?f=)(\\d*)#',array($this,'_fix_links_callback_forum'),$post);\n\t\t$post=preg_replace_callback('#'.preg_quote($OLD_BASE_URL).'/(profile\\.php\\?mode=viewprofile&u=)(\\d*)#',array($this,'_fix_links_callback_member'),$post);\n\t\t$post=preg_replace('#:[0-9a-f]{10}#','',$post);\n\n\t\t$matches=array();\n\t\t$count=preg_match_all('#\\[attachment=(\\d+)(:.*)?\\].*\\[\\/attachment(:.*)?\\]#Us',$post,$matches);\n\t\t$to=mixed();\n\t\tfor ($i=0;$i<$count;$i++)\n\t\t{\n\t\t\tif (!is_null($post_id))\n\t\t\t{\n\t\t\t\t$from=$matches[1][$i];\n\t\t\t\t$attachments=$db->query_select('attachments',array('attach_id'),array('post_msg_id'=>$post_id,'in_message'=>$is_pm?1:0),'ORDER BY attach_id');\n\t\t\t\t$to=array_key_exists(intval($from),$attachments)?$attachments[intval($from)]['attach_id']:-1;\n\t\t\t\t$to=import_id_remap_get('attachment',$to,true);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$to=NULL;\n\t\t\t}\n\t\t\tif (is_null($to))\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'(attachment removed)',$post);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$post=str_replace($matches[0][$i],'[attachment]'.strval($to).'[/attachment]',$post);\n\t\t\t}\n\t\t}\n\n\t\tif ($uid!='') $post=str_replace(':'.$uid,'',$post);\n\t\t$post=preg_replace('#<!-- s([^\\s]*) --><img src=\"\\{SMILIES_PATH\\}/[^\"]*\" alt=\"([^\\s]*)\" title=\"[^\"]*\" /><!-- s([^\\s]*) -->#U','${1}',$post);\n\n\t\t$post=preg_replace('#\\[size=\"?(\\d+)\"?\\]#i','[size=\"${1}%\"]',$post);\n\n\t\t$post=str_replace('{','\\{',$post);\n\n\t\treturn html_entity_decode($post,ENT_QUOTES);\n\t}", "public function detect_links()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:(?:https?|ftp):\\/\\/|(?:www|ftp)\\.)(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})(?::[0-9]{1,5})?(?:\\/[^\\s'\\\"]*)?(?:(?<![,\\)\\.])|[\\S])/\",\r\n\t\t\t$child->get_text(),\r\n\t\t\t$matches,\r\n\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\tif(substr($match[0], 0, 3) === 'ftp' && $match[0][3] !== ':')\r\n\t\t\t\t\t$url = 'ftp://' . $match[0];\r\n\t\t\t\telse if($match[0][0] === 'w')\r\n\t\t\t\t\t$url = 'http://' . $match[0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$url = $match[0];\r\n\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('url', array('default' => htmlentities($url, ENT_QUOTES | ENT_IGNORE, \"UTF-8\")));\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_URL));\r\n\r\n\t\treturn $this;\r\n\t}", "protected function addLinks()\n {\n }", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "function _ti_amg_fw_topics_do_drush_fix_urls($nid, &$context) {\n $node = node_load($nid);\n\n if (!empty($node->field_left_nav_links[LANGUAGE_NONE])) {\n foreach ($node->field_left_nav_links[LANGUAGE_NONE] as $delta => $link) {\n if (substr($link['url'], -1) == '/' && substr_count($link['url'], 'http://www.foodandwine.com')) {\n $node->field_left_nav_links[LANGUAGE_NONE][$delta]['url'] = substr($link['url'], 0, -1);\n\n $context['results'][$nid] = TRUE;\n }\n }\n }\n\n // Save it\n if ($context['results'][$nid]) {\n node_save($node);\n $context['message'] = t('Fixed links on page %title.',\n array('%title' => $node->title)\n );\n\n // Get it published\n if (function_exists('state_flow_load_state_machine')) {\n $state_flow = state_flow_load_state_machine($node);\n $state_flow->fire_event('publish', 1);\n }\n }\n else {\n $context['message'] = t('Links on page @title were already OK.',\n array('@title' => $node->title)\n );\n }\n}", "protected function updateBrokenLinks() {}", "protected function fix_supporting_file_references() {\r\n\t\tpreg_match_all('/<link([^<>]*?) href=\"([^\"]*?)\"([^<>]*?)\\/>/is', $this->code, $link_matches);\r\n\t\t/*$counter = sizeof($link_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t\r\n\t\t\t$counter--;\r\n\t\t}*/\r\n\t\t$array_replaces = array();\r\n\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t$href_content = $link_matches[2][$index];\r\n\t\t\tif($href_content[0] === '/' || strpos($href_content, 'http://') !== false) { // avoid root references and URLs\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$initial_href_content = $href_content;\r\n\t\t\t\t\t// first try looking closer\r\n\t\t\t\t\t$proper_reference = false;\r\n\t\t\t\t\twhile(!$proper_reference && substr($href_content, 0, 3) === '../') {\r\n\t\t\t\t\t\t$href_content = substr($href_content, 3);\r\n\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // try looking farther\r\n\t\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\t\twhile(!$proper_reference && $counter < 10) {\r\n\t\t\t\t\t\t\t$href_content = '../' . $href_content;\r\n\t\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$counter++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // give up or finish\r\n\t\t\t\t\t\tvar_dump($this->file, $href_content, $relative_path);exit(0);\r\n\t\t\t\t\t\tprint('<span style=\"color: red;\">Could not fix broken reference in &lt;link&gt;: ' . $value . '</span>');exit(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->logMsg('Reference ' . htmlentities($value) . ' was fixed.');\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\tforeach($array_replaces as $index => $value) {\r\n\t\t\t$this->code = str_replace($index, $value, $this->code);\r\n\t\t}\r\n\t}", "function substHREFsInHTML() {\n\t\tif (!is_array($this->theParts['html']['hrefs'])) return;\n\t\tforeach ($this->theParts['html']['hrefs'] as $urlId => $val) {\n\t\t\t\t// Form elements cannot use jumpurl!\n\t\t\tif ($this->jumperURL_prefix && ($val['tag'] != 'form') && ( !strstr( $val['ref'], 'mailto:' ))) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} elseif ( strstr( $val['ref'], 'mailto:' ) && $this->jumperURL_useMailto) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$substVal = $val['absRef'];\n\t\t\t}\n\t\t\t$this->theParts['html']['content'] = str_replace(\n\t\t\t\t$val['subst_str'],\n\t\t\t\t$val['quotes'] . $substVal . $val['quotes'],\n\t\t\t\t$this->theParts['html']['content']);\n\t\t}\n\t}", "function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }", "private function replaceURLsCallback($matches) {\n\n preg_match('/(http[s]?)?:\\/\\/([^\\/]+)(.*)?/', $matches[2], $url_matches);\n\n $replacement = $matches[0];\n\n if (!empty($url_matches[0])) {\n\n switch (drupal_strtoupper($this->https)) {\n case 'TO':\n $scheme = 'https';\n break;\n case 'FROM':\n $scheme = 'http';\n break;\n default:\n $scheme = $url_matches[1];\n break;\n }\n\n foreach($this->from_urls as $from_url) {\n\n $match_url = $url_matches[1] . '://' . $url_matches[2];\n\n if ($from_url == $match_url) {\n if (!$this->relative) {\n $replacement = $matches[1] . '=\"' . $scheme . '://';\n $replacement .= $this->toValue . $url_matches[3] . '\"';\n }\n else {\n $replacement = $matches[1] . '=\"' . $url_matches[3] . '\"';\n }\n break;\n }\n\n }\n\n }\n\n if ($replacement !== $matches[0]) {\n\n $this->debug && drush_print(\n t(\n 'URL: !from => !to',\n array(\n '!from' => $matches[0],\n '!to' => $replacement,\n )\n )\n );\n\n }\n\n return $replacement;\n\n }", "public function _rewrite_links_callback($text = '')\n {\n return _class('rewrite')->_rewrite_replace_links($text);\n }", "public function doLocalAnchorFix() {}", "private function rep_links_callback($match) {\t\r\n\t\t\r\n\t\t$query = substr($match[0],2,-2);\r\n\r\n\t\t$db_Article = Article::getArticle()->select($query);\r\n\t\t\r\n\t\tif($db_Article != FALSE) {\r\n\t\t\t$query = ' <a href=\"' . urlencode($query) . '\">' . $query . '</a> ';\r\n\t\t\t$this->links[$this->linkCount] = $db_Article;\r\n\t\t\t$this->linkCount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $query;\t\t\r\n\t}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "protected function prepare_links($theme)\n {\n }", "function rebound_links($links, $attributes = array()) {\n global $user;\n if (!$user->uid) {\n unset($links['links']['comment_forbidden']);\n }\n return theme_links($links, $attributes);\n}", "function tnsl_fCleanLinks(&$getNextGen) {\r\n\t$getNextGen = preg_replace('(&(?!([a-zA-Z]{2,6}|[0-9\\#]{1,6})[\\;]))', '&amp;', $getNextGen);\r\n\t$getNextGen = str_replace(array(\r\n\t\t'&amp;&amp;',\r\n\t\t'&amp;middot;',\r\n\t\t'&amp;nbsp;',\r\n\t\t'&amp;#'\r\n\t), array(\r\n\t\t'&&',\r\n\t\t'&middot;',\r\n\t\t'&nbsp;',\r\n\t\t'&#'\r\n\t), $getNextGen);\r\n\t// montego - following code is required to allow the new RNYA AJAX validations to work properly\r\n\t$getNextGen = preg_replace('/rnxhr.php\\?name=Your_Account&amp;file/', 'rnxhr.php\\?name=Your_Account&file', $getNextGen );\r\n\treturn;\r\n}", "function permalink_link()\n {\n }", "protected function prepare_links($item)\n {\n }", "protected function prepare_links($term)\n {\n }", "protected function prepare_links($term)\n {\n }", "function redlinks($_) {\n return preg_replace_callback(\"/<a href=\\\"?\\/([^'\\\">]+)\\\"?>/\", function($matches){\n if (is_link(filename($matches[1])))\n return $matches[0];\n else\n return preg_replace(\"/<a/\", \"<a class=redlink\", $matches[0]);\n }, $_);\n}", "protected function prepare_links($taxonomy)\n {\n }", "function url_to_link_callback($matches)\n{\n return '<a href=\"' . htmlspecialchars($matches[1]) . '\">' . $matches[1] . '</a>';\n}", "function node_link_alter(&$links, $node) {\n // Use 'Read more »' instead of 'Read more'\n if (isset($links['node_read_more'])) {\n $links['node_read_more']['title'] = t('Read more »');\n } \n \n // Remove Section on taxonomy term links\n foreach ($links as $module => $link) { \n if (strstr($module, 'taxonomy_term')) {\n foreach ($links as $key => $value) {\n if ($value['title'] == 'Life' || \n $value['title'] == 'Geek') {\n unset($links[$key]);\n }\n }\n }\n // Don't show language links in Today and other listing\n //unset($links['node_translation_ja']);\n //unset($links['node_translation_en']);\n }\n}", "function lean_links($links, $attributes = array('class' => 'links')) {\n \n // Link 'Add a comment' link to node page instead of comments reply page\n if($links['comment_add']['href']){\n $arr_linkparts = explode('/', $links['comment_add']['href']);\n $links['comment_add']['href'] = 'node/'.$arr_linkparts[2];\n }\n // Don't show 'reply' link for comments\n unset($links['comment_reply']);\n \n return theme_links($links, $attributes);\n}", "function _fix_links_callback_forum($m)\n\t{\n\t\treturn 'index.php?page=forumview&id='.strval(import_id_remap_get('forum',strval($m[2]),true));\n\t}", "protected function prepare_links($prepared)\n {\n }", "public function fix_links($post, $db, $table_prefix, $file_base = '')\n {\n $boardurl = '';\n\n require($file_base . '/Settings.php');\n $old_base_url = $boardurl;\n\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?topic=)(\\d*)#', array($this, '_fix_links_callback_topic'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?board=)(\\d*)#', array($this, '_fix_links_callback_forum'), $post);\n $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\\.php\\?action=profile;u=)(\\d*)#', array($this, '_fix_links_callback_member'), $post);\n $post = preg_replace('#:[0-9a-f]{10}#', '', $post);\n return $post;\n }", "protected function prepare_links($sidebar)\n {\n }", "function dupeoff_actlinks( $links, $file ){\n\t//Static so we don't call plugin_basename on every plugin row.\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\t\n\tif ( $file == $this_plugin ){\n\t\t$settings_link = '<a href=\"options-general.php?page=dupeoff/dupeoff.php\">' . __('Settings') . '</a>';\n\t\tarray_unshift( $links, $settings_link ); // before other links\n\t\t}\n\treturn $links;\n}", "protected function getLinkHandlers() {}", "protected function getLinkHandlers() {}", "function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "public abstract function prepare_item_links($id);", "protected function prepare_links($post)\n {\n }", "protected function prepare_links($post)\n {\n }", "function callbackAddLinks($hookName, $args) {\n\t\t$request =& $this->getRequest();\n\t\tif ($this->getEnabled() && is_a($request->getRouter(), 'PKPPageRouter')) {\n\t\t\t$templateManager = $args[0];\n\t\t\t$currentJournal = $templateManager->get_template_vars('currentJournal');\n\t\t\t$announcementsEnabled = $currentJournal ? $currentJournal->getSetting('enableAnnouncements') : false;\n\n\t\t\tif (!$announcementsEnabled) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$displayPage = $currentJournal ? $this->getSetting($currentJournal->getId(), 'displayPage') : null;\n\n\t\t\t// Define when the <link> elements should appear\n\t\t\t$contexts = 'frontend';\n\t\t\tif ($displayPage == 'homepage') {\n\t\t\t\t$contexts = array('frontend-index', 'frontend-announcement');\n\t\t\t} elseif ($displayPage == 'announcement') {\n\t\t\t\t$contexts = 'frontend-' . $displayPage;\n\t\t\t}\n\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsAtom+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/atom+xml\" href=\"' . $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'atom')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRdf+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rdf+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$templateManager->addHeader(\n\t\t\t\t'announcementsRss+xml',\n\t\t\t\t'<link rel=\"alternate\" type=\"application/rss+xml\" href=\"'. $request->url(null, 'gateway', 'plugin', array('AnnouncementFeedGatewayPlugin', 'rss2')) . '\">',\n\t\t\t\tarray(\n\t\t\t\t\t'contexts' => $contexts,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn false;\n\t}", "protected function prepare_links($user)\n {\n }", "function _post_format_link($link, $term, $taxonomy)\n {\n }", "function _fix_links_callback_member($m)\n\t{\n\t\treturn 'index.php?page=members&type=view&id='.strval(import_id_remap_get('member',strval($m[2]),true));\n\t}", "function trans_link()\n{\n // --- mylinks ---\n // --- link table ---\n // lid int(11)\n // cid int(5) => multi\n // title varchar(100)\n // url varchar(250)\n // logourl varchar(60)\n // submitter int(11)\n // status tinyint(2) => not use\n // date int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n\n // --- mylinks_text table ---\n // lid int(11)\n // description text\n\n // --- weblinks ---\n // lid int(11)\n // cids varchar(100) : use catlink\n // title varchar(100)\n // url varchar(255)\n // banner varchar(255) : full url\n // uid int(5) : submitter\n // time_create int(10)\n // time_update int(10)\n // hits int(11)\n // rating double(6,4)\n // votes int(11)\n // comments int(11)\n // description text\n //\n // search text default\n // passwd varchar(255)\n //\n // name varchar(255)\n // nameflag tinyint(2)\n // mail varchar(255)\n // mailflag tinyint(2)\n // company varchar(255)\n // addr varchar(255)\n // tel varchar(255)\n // admincomment text\n // width int(5)\n // height int(5)\n // recommend tinyint(2)\n // mutual tinyint(2)\n // broken int(11)\n // rss_url varchar(255)\n // rss_flag tinyint(3)\n // rss_xml mediumtext\n // rss_update int(10)\n // usercomment text\n // zip varchar(100)\n // state varchar(100)\n // city varchar(100)\n // addr2 varchar(255)\n // fax varchar(255)\n\n global $xoopsDB;\n global $LIMIT;\n global $cat_title_arr;\n\n echo '<h4>STEP 3: link table</h3>';\n\n global $MODULE_DIRNAME;\n $table_link = $xoopsDB->prefix($MODULE_DIRNAME . '_link');\n\n global $MODULE_URL;\n $shots_url_web = $MODULE_URL . '/images/shots/';\n\n $offset = 0;\n if (isset($_POST['offset'])) {\n $offset = $_POST['offset'];\n }\n $next = $offset + $LIMIT;\n\n $table = $xoopsDB->prefix('mylinks_links');\n $sql1 = \"SELECT count(*) FROM $table\";\n $res1 = sql_exec($sql1);\n $row1 = $xoopsDB->fetchRow($res1);\n $total = $row1[0];\n\n echo \"There are $total links <br />\\n\";\n echo \"Transfer $offset - $next th link <br /><br />\";\n\n $sql2 = \"SELECT * FROM $table ORDER BY lid\";\n $res2 = sql_exec($sql2, $LIMIT, $offset);\n\n while ($row = $xoopsDB->fetchArray($res2)) {\n $lid = $row['lid'];\n $uid = $row['submitter'];\n $cid = $row['cid'];\n $url = $row['url'];\n $hits = $row['hits'];\n $rating = $row['rating'];\n $votes = $row['votes'];\n $logourl = $row['logourl'];\n $comments = $row['comments'];\n $time_create = $row['date'];\n $time_update = $time_create;\n\n $title = addslashes($row['title']);\n\n $banner = '';\n $width = 0;\n $height = 0;\n\n if ($logourl) {\n $banner = $shots_url_web . $logourl;\n $size = getimagesize($banner);\n\n if ($size) {\n $width = (int)$size[0];\n $height = (int)$size[1];\n } else {\n echo \"<font color='red'>image size error: $banner</font><br />\";\n }\n\n $banner = addslashes($banner);\n }\n\n $desc = get_desc($lid);\n $desc = addslashes($desc);\n\n $cat = addslashes($cat_title_arr[$cid]);\n $search = \"$url $title $cat $desc\";\n\n $passwd = md5(rand(10000000, 99999999));\n\n echo \"$lid: $title <br />\";\n\n $sql = 'INSERT INTO ' . $table_link . ' (';\n $sql .= 'lid, uid, title, url, description, ';\n $sql .= 'search, passwd, time_create, time_update, ';\n $sql .= 'hits, rating, votes, comments, ';\n $sql .= 'banner, width, height';\n $sql .= ') VALUES (';\n $sql .= \"$lid, $uid, '$title', '$url', '$desc', \";\n $sql .= \"'$search', '$passwd', $time_create, $time_update, \";\n $sql .= \"$hits, $rating, $votes, $comments, \";\n $sql .= \"'$banner', $width, $height\";\n $sql .= ')';\n\n sql_exec($sql);\n\n insert_catlink($cid, $lid);\n }\n\n if ($total > $next) {\n form_next_link($next);\n } else {\n form_votedate();\n }\n}", "protected function prepare_links($id)\n {\n }", "protected function prepare_links($id)\n {\n }", "public function using_permalinks()\n {\n }", "protected function prepare_links($post_type)\n {\n }", "function ldap_mod_replace($link_identifier, $dn, $entry)\n{\n}", "function _fix_links_callback_topic($m)\n\t{\n\t\treturn 'index.php?page=topicview&id='.strval(import_id_remap_get('topic',strval($m[2]),true));\n\t}", "function smarty_function_mtlink($args, &$ctx) {\n // status: incomplete\n // parameters: template, entry_id\n static $_template_links = array();\n $curr_blog = $ctx->stash('blog');\n if (isset($args['template'])) {\n if (!empty($args['blog_id']))\n $blog = $ctx->mt->db()->fetch_blog($args['blog_id']);\n else\n $blog = $ctx->stash('blog');\n\n $name = $args['template'];\n $cache_key = $blog->id . ';' . $name;\n if (isset($_template_links[$cache_key])) {\n $link = $_template_links[$cache_key];\n } else {\n $tmpl = $ctx->mt->db()->load_index_template($ctx, $name, $blog->id);\n $site_url = $blog->site_url();\n if (!preg_match('!/$!', $site_url)) $site_url .= '/';\n $link = $site_url . $tmpl->template_outfile;\n $_template_links[$cache_key] = $link;\n }\n if (!$args['with_index']) {\n $link = _strip_index($link, $curr_blog);\n }\n return $link;\n } elseif (isset($args['entry_id'])) {\n $arg = array('entry_id' => $args['entry_id']);\n list($entry) = $ctx->mt->db()->fetch_entries($arg);\n $ctx->localize(array('entry'));\n $ctx->stash('entry', $entry);\n $link = $ctx->tag('EntryPermalink',$args);\n $ctx->restore(array('entry'));\n if ($args['with_index'] && preg_match('/\\/(#.*)$/', $link)) {\n $index = $ctx->mt->config('IndexBasename');\n $ext = $curr_blog->blog_file_extension;\n if ($ext) $ext = '.' . $ext; \n $index .= $ext;\n $link = preg_replace('/\\/(#.*)?$/', \"/$index\\$1\", $link);\n }\n return $link;\n }\n return '';\n}", "function TS_links_rte($value,$wrap='')\t{\n\t\t$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml_proc');\n\n\t\t$value = $htmlParser->TS_AtagToAbs($value);\n\t\t$wrap = explode('|',$wrap);\n\t\t\t// Split content by the TYPO3 pseudo tag \"<LINK>\":\n\t\t$blockSplit = $htmlParser->splitIntoBlock('link',$value,1);\n\t\tforeach($blockSplit as $k => $v)\t{\n\t\t\t$error = '';\n\t\t\tif ($k%2)\t{\t// block:\n\t\t\t\t$tagCode = t3lib_div::trimExplode(' ',trim(substr($htmlParser->getFirstTag($v),0,-1)),1);\n\t\t\t\t$link_param = $tagCode[1];\n\t\t\t\t$href = '';\n\t\t\t\t$siteUrl = $htmlParser->siteUrl();\n\t\t\t\t\t// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()\n\t\t\t\tif(strstr($link_param,'@'))\t{\t\t// mailadr\n\t\t\t\t\t$href = 'mailto:'.eregi_replace('^mailto:','',$link_param);\n\t\t\t\t} elseif (substr($link_param,0,1)=='#') {\t// check if anchor\n\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t} else {\n\t\t\t\t\t$fileChar=intval(strpos($link_param, '/'));\n\t\t\t\t\t$urlChar=intval(strpos($link_param, '.'));\n\n\t\t\t\t\t\t// Detects if a file is found in site-root OR is a simulateStaticDocument.\n\t\t\t\t\tlist($rootFileDat) = explode('?',$link_param);\n\t\t\t\t\t$rFD_fI = pathinfo($rootFileDat);\n\t\t\t\t\tif (trim($rootFileDat) && !strstr($link_param,'/') && (@is_file(PATH_site.$rootFileDat) || t3lib_div::inList('php,html,htm',strtolower($rFD_fI['extension']))))\t{\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} elseif($urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar))\t{\t// url (external): If doubleSlash or if a '.' comes before a '/'.\n\t\t\t\t\t\tif (!ereg('^[a-z]*://',trim(strtolower($link_param))))\t{$scheme='http://';} else {$scheme='';}\n\t\t\t\t\t\t$href = $scheme.$link_param;\n\t\t\t\t\t} elseif($fileChar)\t{\t// file (internal)\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} else {\t// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to tables.php!!)\n\t\t\t\t\t\t$link_params_parts = explode('#',$link_param);\n\t\t\t\t\t\t$idPart = trim($link_params_parts[0]);\t\t// Link-data del\n\t\t\t\t\t\tif (!strcmp($idPart,''))\t{ $idPart=$htmlParser->recPid; }\t// If no id or alias is given, set it to class record pid\n\t\t\t\t\t\tif ($link_params_parts[1] && !$sectionMark)\t{\n\t\t\t\t\t\t\t$sectionMark = '#'.trim($link_params_parts[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair\n\t\t\t\t\t\t$pairParts = t3lib_div::trimExplode(',',$idPart);\n\t\t\t\t\t\tif (count($pairParts)>1)\t{\n\t\t\t\t\t\t\t$idPart = $pairParts[0];\n\t\t\t\t\t\t\t// Type ? future support for?\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Checking if the id-parameter is an alias.\n\t\t\t\t\t\tif (!t3lib_div::testInt($idPart))\t{\n\t\t\t\t\t\t\tlist($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);\n\t\t\t\t\t\t\t$idPart = intval($idPartR['uid']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$page = t3lib_BEfunc::getRecord('pages', $idPart);//this doesnt work at the moment...no page exist check\n\t\t\t\t\t\t//if (is_array($page))\t{\t// Page must exist...\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t/*} else {\n\t\t\t\t\t\t\t#$href = '';\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t\t$error = 'No page found: '.$idPart;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Setting the A-tag:\n\t\t\t\t$bTag = '<a href=\"'.htmlspecialchars($href).'\"'.($tagCode[2]&&$tagCode[2]!='-' ? ' target=\"'.htmlspecialchars($tagCode[2]).'\"' : '').'>'.$wrap[0];\n\t\t\t\t$eTag = $wrap[1].'</a>';\n\t\t\t\t$blockSplit[$k] = $bTag.$htmlParser->TS_links_rte($htmlParser->removeFirstAndLastTag($blockSplit[$k])).$eTag;\n\t\t\t}\n\t\t}\n\n\t\t\t// Return content:\n\t\treturn implode('',$blockSplit);\n\t}", "function fixup_protocolless_urls($in)\n{\n require_code('urls2');\n return _fixup_protocolless_urls($in);\n}", "function bps_plugin_extra_links($links, $file) {\n\tstatic $this_plugin;\n\tif ( ! current_user_can('install_plugins') )\n\t\treturn $links;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ) {\n\t\t$links[2] = '<a href=\"http://forum.ait-pro.com/forums/topic/bulletproof-security-pro-version-release-dates/\" target=\"_blank\" title=\"BulletProof Security Pro Version Release Dates and Whats New\">' . __('Version Release Dates|Whats New', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"http://forum.ait-pro.com/\" target=\"_blank\" title=\"BulletProof Security Pro Forum\">' . __('Forum|Support', 'bulleproof-security').'</a>';\n\t\t$links[] = '<a href=\"admin.php?page=bulletproof-security/admin/tools/tools.php#bps-tabs-15\" title=\"Pro Tools Plugin Update Check tool\">' . __('Manual Upgrade Check', 'bulleproof-security') . '</a>';\n\n/*\techo '<pre>';\n\tprint_r($links);\n\techo '</pre>';\n*/\t\n\t}\n\n\treturn $links;\n}", "function autoContentLinksContent($content)\r\n\t{\r\n\t\t$options = get_option('auto_content_links');\r\n\t\t\r\n\t\t// Set default value for autolink linking back to itself\r\n\t\tif(!isset($link['link_autolink'])) $link['link_autolink'] = true;\r\n\t\t\r\n\t\tif(isset($options['links']) AND !empty($options['links']))\r\n\t\t{\r\n\t\t\tforeach($options['links'] as $link)\r\n\t\t\t{\r\n\t\t\t\tif(!(preg_match(\"@\".preg_quote($link['url']) .'$@', autoContentLinksCurrentPageURL())) OR $link['link_autolink'] == true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$wordBoundary = '';\r\n\t\t\t\t\tif($link['match_whole_word'] == true) $wordBoundary = '\\b';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$newWindow = '';\r\n\t\t\t\t\tif($link['new_window'] == true) $newWindow = ' target=\"_blank\"';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$content = preg_replace('@('.$wordBoundary.$link['name'].$wordBoundary.')(?!([^<>]*<[^Aa<>]+>)*([^<>]+)?</[aA]>)(?!([^<\\[]+)?[>\\]])@', '<a'.$newWindow.' href=\"'.$link['url'].'\">'.$link['name'].'</a>', $content, $link['instances']);\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $content;\r\n\t}", "function renderLinks($links, $prefix = \"\") {\n\n $value = \"\";\n if (!isset($links[0])) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $links[\"url\"], \n $links[\"url\"], \n (\"\" != $links[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n );\n } else {\n\n reset($links);\n while (list($k, $link) = each($links)) {\n $value .= sprintf('<a href=\"%s\" target=\"_blank\">%s</a>%s, ',\n $link[\"url\"], \n $link[\"url\"], \n (\"\" != $link[\"value\"]) ? \" - \" . $links[\"value\"] : \"\"\n ); \n }\n\n }\n\n $value = substr($value, 0, -2);\n $this->tpl->setCurrentBlock(strtolower($prefix) . \"links\");\n $this->tpl->setVariable(\"LINK\", $value);\n $this->tpl->parseCurrentBlock();\n\n }", "function feed_links($args = array())\n {\n }", "function wp_targeted_link_rel_callback($matches)\n {\n }", "function changeUrlUnparsedContentCode(&$tag, &$data)\n{\n global $txt, $modSettings, $context;\n loadLanguage('Redirector/Redirector');\n\n $data = strtr($data, ['<br />' => '']);\n $link_text = $data;\n\n // Skip local urls with #\n if (strpos($data, '#') === 0) {\n return;\n } else {\n if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0) {\n $data = 'http://' . $data;\n }\n }\n\n // Hide links from guests\n if (!empty($modSettings['redirector_hide_guest_links']) && !empty($context['user']['is_guest']) && !checkWhiteList(\n $data\n )) {\n $link_text = !empty($modSettings['redirector_hide_guest_custom_message']) ? $modSettings['redirector_hide_guest_custom_message'] : $txt['redirector_hide_guest_message'];\n }\n\n $data = getRedirectorUrl($data);\n\n $tag['content'] = '<a href=\"' . $data . '\" class=\"bbc_link\" ' . ((!empty($modSettings['redirector_nofollow_links']) && $modSettings['redirector_mode'] == 'immediate' && !checkWhiteList(\n $data\n )) ? 'rel=\"nofollow noopener noreferrer\" ' : '') . ($tag['tag'] == 'url' ? 'target=\"_blank\"' : '') . ' >' . $link_text . '</a>';\n}", "function onAcesefIlinks(&$text) {\r\n\t\tif (ACESEF_PACK == 'pro' && $this->AcesefConfig->ilinks_mode == '1') {\r\n\t\t\t$component = JRequest::getCmd('option');\r\n\t\t\t$ext_params\t= AcesefCache::getExtensionParams($component);\r\n\t\t\t\r\n\t\t\tif ($ext_params && class_exists('AcesefIlinks')) {\r\n\t\t\t\tAcesefIlinks::plugin($text, $ext_params, 'trigger', $component);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine whether the default automated URL handling has been replaced.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default')) {\n\n\t\t\t// Determine whether the URL segment or parent ID has been updated.\n\n\t\t\t$changed = $this->owner->getChangedFields();\n\t\t\tif((isset($changed['URLSegment']['before']) && isset($changed['URLSegment']['after']) && ($changed['URLSegment']['before'] != $changed['URLSegment']['after'])) || (isset($changed['ParentID']['before']) && isset($changed['ParentID']['after']) && ($changed['ParentID']['before'] != $changed['ParentID']['after']))) {\n\n\t\t\t\t// The link mappings should only be created for existing pages.\n\n\t\t\t\t$URL = (isset($changed['URLSegment']['before']) ? $changed['URLSegment']['before'] : $this->owner->URLSegment);\n\t\t\t\tif(strpos($URL, 'new-') !== 0) {\n\n\t\t\t\t\t// Determine the page URL.\n\n\t\t\t\t\t$parentID = (isset($changed['ParentID']['before']) ? $changed['ParentID']['before'] : $this->owner->ParentID);\n\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parentID}\");\n\t\t\t\t\twhile($parent) {\n\t\t\t\t\t\t$URL = Controller::join_links($parent->URLSegment, $URL);\n\t\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parent->ParentID}\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a link mapping for this page.\n\n\t\t\t\t\tsingleton(MisdirectionService::class)->createPageMapping($URL, $this->owner->ID);\n\n\t\t\t\t\t// Purge any link mappings that point back to the same page.\n\n\t\t\t\t\t$this->owner->regulateMappings(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link(), $this->owner->ID);\n\n\t\t\t\t\t// Recursively create link mappings for any children.\n\n\t\t\t\t\t$children = $this->owner->AllChildrenIncludingDeleted();\n\t\t\t\t\tif($children->count()) {\n\t\t\t\t\t\t$this->owner->recursiveMapping($URL, $children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function prepare_links($plugin)\n {\n }", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "function tumblrLinkBacks( $content ) {\n\tglobal $wp_query, $post;\n\t$post_id = get_post( $post->ID );\n\t$posttitle = $post_id->post_title;\n\t$permalink = get_permalink( get_post( $post->ID ) );\n\t$tumblr_keys = get_post_custom_keys( $post->ID );\n\tif( get_post_meta( $wp_query->post->ID, 'TumblrURL', true ) ) {\n\t\tif( $tumblr_keys ) {\n\t\t\tforeach( $tumblr_keys as $tumblr_key ) {\n\t\t\t\tif( $tumblr_key == 'TumblrURL' ) {\n\t\t\t\t\t$tumblr_vals = get_post_custom_values( $tumblr_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $tumblr_vals ) {\n\t\t\t\tif( is_feed() ) {\n\t\t\t\t\t$content .= '<p><a href=\"'.$tumblr_vals[0].'\" title=\"Direct link to featured article\">Direct Link to Article</a> &#8212; ';\n\t\t\t\t\t$content .= '<a href=\"'.$permalink.'\">Permalink</a></p>';\n\t\t\t\t\treturn $content;\n\t\t\t\t} else {\n\t\t\t\t\treturn $content;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$content = $content;\n\t\treturn $content;\n\t}\n}", "public function fixHreflang()\n {\n global $config, $languages, $listing_data, $currentPage;\n\n if (!$config['mf_geo_subdomains'] || !$config['mod_rewrite'] || count($languages) == 1) {\n return;\n }\n\n $hreflang = array();\n $url = RL_URL_HOME . $currentPage;\n\n foreach ($languages as $lang_item) {\n $lang_code = $lang_item['Code'] == $config['lang'] ? '' : $lang_item['Code'];\n\n if ($this->detailsPage) {\n $hreflang[$lang_item['Code']] = $this->buildListingUrl($url, $listing_data, $lang_code);\n } else {\n $hreflang[$lang_item['Code']] = $this->makeUrlGeo($url, $lang_code);\n }\n }\n\n $GLOBALS['rlSmarty']->assign('hreflang', $hreflang);\n }", "function replace_long_by_shorten_links($postId, $replacingList) \r\n{\r\n global $wpdb;\r\n\r\n $post = get_post($postId);\r\n $post_content = $post->post_content;\r\n\r\n foreach ($replacingList as $replaceContent) {\r\n $post_content = str_replace($replaceContent['source_link'], $replaceContent['result_link'], $post_content);\r\n } \r\n $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d\", $post_content, $postId ) );\r\n}", "public function add_links($links)\n {\n }", "function cleanLink($input) {\n\t// Prefix URL with http:// if it was missing from the input\n\tif(trim($input[url]) != \"\" && !preg_match(\"#^https?://.*$#\",$input[url])) { $input[url] = \"http://\" . $input[url]; } \t\n\t\t\n\t\t$curly = array(\"{\",\"}\");\n\t\t$curly_replace = array(\"&#123;\",\"&#125;\");\n\t\t\n\t\tforeach($input as $field => $data) {\n\t\t\t$input[$field] = filter_var(trim($data),FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t$input[$field] = str_replace($curly,$curly_replace,$input[$field]); // Replace curly brackets (needed for placeholders to work)\n\t\t\t\t\n\t\tif($field == \"url\") {\n\t\t\t$input[url] = str_replace(\"&#38;\",\"&\",$input[url]); // Put &s back into URL\n\t\t\n\t\t}\n\t}\t\n\treturn($input);\n}", "public static function Links($Mixed) {\n if (!is_string($Mixed))\n return self::To($Mixed, 'Links');\n else {\n $Mixed = preg_replace_callback(\n \"/\n (?<!<a href=\\\")\n (?<!\\\")(?<!\\\">)\n ((?:https?|ftp):\\/\\/)\n ([\\@a-z0-9\\x21\\x23-\\x27\\x2a-\\x2e\\x3a\\x3b\\/;\\x3f-\\x7a\\x7e\\x3d]+)\n /msxi\",\n array('Gdn_Format', 'LinksCallback'),\n $Mixed);\n\n return $Mixed;\n }\n }", "function automatic_feed_links($add = \\true)\n {\n }", "function feed_links_extra($args = array())\n {\n }", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function string_insert_hrefs( $p_string ) \r\n{\r\n\tif ( !config_get('html_make_links') ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$t_change_quotes = false;\r\n\tif( ini_get_bool( 'magic_quotes_sybase' ) ) {\r\n\t\t$t_change_quotes = true;\r\n\t\tini_set( 'magic_quotes_sybase', false );\r\n\t}\r\n\r\n\t// Find any URL in a string and replace it by a clickable link\r\n\t$p_string = preg_replace( '/(([[:alpha:]][-+.[:alnum:]]*):\\/\\/(%[[:digit:]A-Fa-f]{2}|[-_.!~*\\';\\/?%^\\\\\\\\:@&={\\|}+$#\\(\\),\\[\\][:alnum:]])+)/se',\r\n \"'<a href=\\\"'.rtrim('\\\\1','.').'\\\">\\\\1</a> [<a href=\\\"'.rtrim('\\\\1','.').'\\\" target=\\\"_blank\\\">^</a>]'\", $p_string);\r\n \r\n\tif( $t_change_quotes ) {\r\n\t\tini_set( 'magic_quotes_sybase', true );\r\n\t}\r\n\r\n\t# Set up a simple subset of RFC 822 email address parsing\r\n\t# We don't allow domain literals or quoted strings\r\n\t# We also don't allow the & character in domains even though the RFC\r\n\t# appears to do so. This was to prevent &gt; etc from being included.\r\n\t# Note: we could use email_get_rfc822_regex() but it doesn't work well\r\n\t# when applied to data that has already had entities inserted.\r\n\t#\r\n\t# bpfennig: '@' doesn't accepted anymore\r\n\t# achumakov: characters 0x80-0xFF aren't acceptable, too\r\n\t$t_atom = '[^\\'@\\'](?:[^()<>@,;:\\\\\\\".\\[\\]\\000-\\037\\177-\\377 &]+)';\r\n\r\n\t# In order to avoid selecting URLs containing @ characters as email\r\n\t# addresses we limit our selection to addresses that are preceded by:\r\n\t# * the beginning of the string\r\n\t# * a &lt; entity (allowing '<[email protected]>')\r\n\t# * whitespace\r\n\t# * a : (allowing 'send email to:[email protected]')\r\n\t# * a \\n, \\r, or > (because newlines have been replaced with <br />\r\n\t# and > isn't valid in URLs anyway\r\n\t#\r\n\t# At the end of the string we allow the opposite:\r\n\t# * the end of the string\r\n\t# * a &gt; entity\r\n\t# * whitespace\r\n\t# * a , character (allowing 'email [email protected], or ...')\r\n\t# * a \\n, \\r, or <\r\n\r\n\t$p_string = preg_replace( '/(?<=^|&quot;|&lt;|[\\s\\:\\>\\n\\r])('.$t_atom.'(?:\\.'.$t_atom.')*\\@'.$t_atom.'(?:\\.'.$t_atom.')*)(?=$|&quot;|&gt;|[\\s\\,\\<\\n\\r])/s',\r\n\t\t\t\t\t\t\t'<a href=\"mailto:\\1\">\\1</a>', $p_string);\r\n\r\n\treturn $p_string;\r\n}", "function modify_attachment_link( $markup, $id, $size, $permalink ) {\n global $post;\n if ( ! $permalink ) {\n $markup = str_replace( '<a href', '<a class=\"view\" data-rel=\"prettyPhoto[slides]-'. $post->ID .'\" href', $markup );\n }\n return $markup;\n }", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "public function autoLinkUrls($text) {\n\t\t$placeholders = [];\n\t\t$replace = [];\n\n\t\t$insertPlaceholder = function($matches) use (&$placeholders) {\n\t\t\t$key = md5($matches[0]);\n\t\t\t$placeholders[$key] = $matches[0];\n\n\t\t\treturn $key;\n\t\t};\n\n\t\t$pattern = '#(?<!href=\"|src=\"|\">)((?:https?|ftp|nntp)://[a-z0-9.\\-:]+(?:/[^\\s]*)?)#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\t$pattern = '#(?<!href=\"|\">)(?<!\\b[[:punct:]])(?<!http://|https://|ftp://|nntp://)www.[^\\n\\%\\ <]+[^<\\n\\%\\,\\.\\ <](?<!\\))#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\tforeach ($placeholders as $hash => $url) {\n\t\t\t$link = $url;\n\n\t\t\tif (!preg_match('#^[a-z]+\\://#', $url)) {\n\t\t\t\t$url = 'http://' . $url;\n\t\t\t}\n\t\t\t$replace[$hash] = \"<a href=\\\"{$url}\\\">{$link}</a>\";\n\t\t}\n\t\treturn strtr($text, $replace);\n\t}", "function setLinks($link) \n {\n $this->links = $link;\n }", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "function avia_link_content_filter($current_post)\n\t{\n\t\t$link \t\t= \"\";\n\t\t$newlink = false;\n\t\t$pattern1 \t= '$^\\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$i';\n\t\t$pattern2 \t= \"!^\\<a.+?<\\/a>!\";\n\t\t$pattern3 \t= \"!\\<a.+?<\\/a>!\";\n\n\t\t//if the url is at the begnning of the content extract it\n\t\tpreg_match($pattern1, $current_post['content'] , $link);\n\t\tif(!empty($link[0]))\n\t\t{\n\t\t\t$link = $link[0];\n\t\t\t$markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false));\n\t\t\t$current_post['title'] = \"<a href='$link' rel='bookmark' title='\".__('Link to:','avia_framework').\" \".the_title_attribute('echo=0').\"' $markup>\".get_the_title().\"</a>\";\n\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpreg_match($pattern2, $current_post['content'] , $link);\n\t\t\tif(!empty($link[0]))\n\t\t\t{\n\t\t\t\t$link = $link[0];\n\t\t\t\t$current_post['title'] = $link;\n\t\t\t\t$current_post['content'] = preg_replace(\"!\".str_replace(\"?\", \"\\?\", $link).\"!\", \"\", $current_post['content'], 1);\n\t\t\t\t\n\t\t\t\t$newlink = get_url_in_content( $link );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpreg_match($pattern3, $current_post['content'] , $link);\n\t\t\t\tif(!empty($link[0]))\n\t\t\t\t{\n\t\t\t\t\t$current_post['title'] = $link[0];\n\t\t\t\t\t\n\t\t\t\t\t$newlink = get_url_in_content( $link[0] );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($link)\n\t\t{\n\t\t\tif(is_array($link)) $link = $link[0];\n\t\t\tif($newlink) $link = $newlink;\n\t\t\t\n\t\t\t$heading = is_singular() ? \"h1\" : \"h2\";\n\n\t\t\t//$current_post['title'] = \"<{$heading} class='post-title entry-title \". avia_offset_class('meta', false). \"'>\".$current_post['title'].\"</{$heading}>\";\n\t\t\t$current_post['title'] = \"<{$heading} class='post-title entry-title' \".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).\">\".$current_post['title'].\"</{$heading}>\";\n\t\t\t\n\t\t\t//needs to be set for masonry\n\t\t\t$current_post['url'] = $link;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$current_post = avia_default_title_filter($current_post);\n\t\t}\n\n\t\treturn $current_post;\n\t}", "public function getLinkFun() {}", "public static function link_to(){\n echo call_user_func_array('Laika::link_to', func_get_args() );\n }", "function fixURL($url, $includeHREF ) {\n $properURL = \"\"; \n\tswitch( substr($url, 0, 4) )\n {\n\tcase \"http\":\n \t$properURL= $url;\n\t break;\n\tcase \"www.\":\n \t$properURL=\"http://\".$url;\n\t\tbreak;\n\tdefault:\n \t$properURL=\"http://www.\".$url;\n\t\tbreak;\n\t}\n\tif ( $includeHREF == true )\n\t{\n\t\t$properURL = \"<a href=\".$properURL.\">\".$properURL.\"</a>\";\n\t}\n\treturn $properURL; \n}", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "public function prepare_item_links($id)\n {\n }", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "function _links_add_base($m)\n {\n }", "protected function prepare_links($location)\n {\n }", "function wp_make_link_relative($link)\n {\n }", "function url_to_link($str)\n{\n $pattern = \"#(\\bhttps?://\\S+\\b)#\";\n return preg_replace_callback($pattern, 'url_to_link_callback', $str);\n}", "function autoLinkReferences(DOMNode $node) {\n\t// Don’t link inside .h-cite elements or headers\n\tif ($node->nodeType == XML_ELEMENT_NODE and strstr(' ' . $node->getAttribute('class') . ' ', ' h-cite '))\n\t\treturn;\n\t\n\tif ($node->nodeType == XML_TEXT_NODE):\n\t\t$node->data = preg_replace_callback('/Article \\d+/', function ($matches) {\n\t\t\treturn 'REPLACE_BEGIN_ELEMENTa href=\"#' . slugify($matches[0]) . '\"REPLACE_END_ELEMENT' . $matches[0] . 'REPLACE_BEGIN_ELEMENT/aREPLACE_END_ELEMENT';\n\t\t}, $node->data);\n\tendif;\n\t\n\t// Loop through each child node\n\tif ($node->hasChildNodes() and !isheader($node)):\n\t\tforeach ($node->childNodes as $n):\n\t\t\tautoLinkReferences($n);\n\t\tendforeach;\n\tendif;\n}", "function bps_plugin_actlinks( $links, $file ){\n\tstatic $this_plugin;\n\tif ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);\n\tif ( $file == $this_plugin ){\n\t$settings_link = '<a href=\"admin.php?page=bulletproof-security/admin/core/options.php\">' . __('Settings', 'bulletproof-security') . '</a>';\n\t\tarray_unshift( $links, $settings_link );\n\t}\n\treturn $links;\n}", "function layout_builder_post_update_discover_new_contextual_links() {\n // Empty post-update hook.\n}", "protected function generateLinks()\n {\n if ( ! is_null($this->links) ) {\n foreach ( $this->links as $link ) {\n $this->addLine('<url>');\n $this->addLine('<loc>');\n $this->addLine($this->helpers->url(\n $link->link,\n $this->protocol,\n $this->host\n ));\n $this->addLine('</loc>');\n $this->addLine('<lastmod>' . date_format($link->updated_at, 'Y-m-d') . '</lastmod>');\n $this->addLine('</url>');\n }\n }\n }", "function minorite_menu_link__links(array $variables) {\n $element = $variables['element'];\n $options = $variables['element']['#original_link']['options'];\n return '<option value=\"' . url($element['#href']) . '\">' . $element['#title'] . \"</option>\\n\";\n}", "private static function links()\n {\n $files = ['Link'];\n $folder = static::$root.'Http/Links'.'/';\n\n self::call($files, $folder);\n\n $files = ['LinkKeyNotFoundException'];\n $folder = static::$root.'Http/Links/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function InitLookupLinks()\r\n{\r\n\tglobal $lookupTableLinks;\r\n\r\n\t$lookupTableLinks = array();\r\n\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"adm_usuarios1.tipo_usuario\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"adm_usuarios1.plano_tipo\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"adm_usuarios1.pais\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"adm_usuarios1.municipio\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"adm_usuarios1.idEmpresa\"][\"edit\"] = array(\"table\" => \"adm_usuarios\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_planos\"][\"adm_meuplano1.idPlano\"][\"edit\"] = array(\"table\" => \"adm_meuplano\", \"field\" => \"idPlano\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"login.tipo_usuario\"][\"edit\"] = array(\"table\" => \"login\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.atendimento_presencial\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"atendimento_presencial\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.nome_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"nome_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.ramo_empresa\"][\"edit\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"ramo_empresa\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"Busca Profissional\"][\"buscar_profissionais.estado_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"estado_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"buscar_profissionais\"][\"buscar_profissionais.municipio_empresa\"][\"search\"] = array(\"table\" => \"buscar_profissionais\", \"field\" => \"municipio_empresa\", \"page\" => \"search\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_tipousuario\"][\"busca_profissional.tipo_usuario\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"tipo_usuario\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_plano_profissional\"][\"busca_profissional.plano_tipo\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"plano_tipo\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_pais\"][\"busca_profissional.pais\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"pais\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] )) {\r\n\t\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"ibge_municipios\"][\"busca_profissional.municipio\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"municipio\", \"page\" => \"edit\");\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"] ) ) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"] = array();\r\n\t\t}\r\n\t\tif( !isset( $lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] )) {\r\n\t\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"] = array();\r\n\t\t}\r\n\t\t$lookupTableLinks[\"adm_usuarios_dados_profissionais\"][\"busca_profissional.idEmpresa\"][\"edit\"] = array(\"table\" => \"Busca Profissional\", \"field\" => \"idEmpresa\", \"page\" => \"edit\");\r\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}" ]
[ "0.7045814", "0.686694", "0.6711534", "0.66502124", "0.66446537", "0.66224885", "0.65817183", "0.6432874", "0.6428899", "0.6366067", "0.6361728", "0.6249323", "0.6161205", "0.61046034", "0.60852325", "0.60445845", "0.59877515", "0.59831333", "0.59817964", "0.59368", "0.593196", "0.5920706", "0.5916994", "0.5916994", "0.59039176", "0.58565617", "0.583072", "0.5828029", "0.58280253", "0.5801932", "0.5797788", "0.5796027", "0.5786061", "0.5770534", "0.57458425", "0.57458425", "0.5709149", "0.5707769", "0.5706252", "0.5697336", "0.5697336", "0.56955427", "0.56807977", "0.5679257", "0.56551903", "0.56291497", "0.5627745", "0.5627745", "0.56220585", "0.5613159", "0.56118536", "0.56038123", "0.5599441", "0.5591072", "0.5588116", "0.558426", "0.5583212", "0.5574627", "0.55707014", "0.556848", "0.55682653", "0.5565082", "0.5564862", "0.55577147", "0.5555877", "0.5546372", "0.5545613", "0.5543786", "0.5538622", "0.5534694", "0.5533031", "0.55307287", "0.5525496", "0.55119044", "0.5509862", "0.5509802", "0.54812086", "0.5476334", "0.5475084", "0.5473147", "0.5471543", "0.5471428", "0.5470716", "0.5469935", "0.54622495", "0.54622495", "0.54622495", "0.5455547", "0.5451316", "0.54465693", "0.5443467", "0.544168", "0.5440469", "0.5439743", "0.5429987", "0.5426145", "0.5424579", "0.5419704", "0.5419357", "0.5416479", "0.5416479" ]
0.0
-1
Convert SMF URLs pasted in text fields into Composr ones.
public function fix_links($post, $db, $table_prefix, $file_base = '') { $boardurl = ''; require($file_base . '/Settings.php'); $old_base_url = $boardurl; $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\.php\?topic=)(\d*)#', array($this, '_fix_links_callback_topic'), $post); $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\.php\?board=)(\d*)#', array($this, '_fix_links_callback_forum'), $post); $post = preg_replace_callback('#' . preg_quote($old_base_url) . '/(index\.php\?action=profile;u=)(\d*)#', array($this, '_fix_links_callback_member'), $post); $post = preg_replace('#:[0-9a-f]{10}#', '', $post); return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_urls($text) {\r\n\t$text = strip_tags(lowercase($text));\r\n\t$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%',\r\n '^','&','*','(',')','+','{','}','|',':','\"',\r\n '<','>','?','[',']','\\\\',';',\"'\",',','/',\r\n '*','+','~','`','=','.');\r\n\t$code_entities_replace = array('','-','-','','','','','','','','','','','',\r\n '','','','','','','','','','','','','');\r\n\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n\t$text = urlencode($text);\r\n\t$text = str_replace('--','-',$text);\r\n\t$text = rtrim($text, \"-\");\r\n\treturn $text;\r\n}", "function clean_url($text)\n\t\t{\n\t\t\t$text=strtolower($text);\n\t\t\t$code_entities_match = array(' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','\"','<','>','?','[',']','\\\\',';',\"'\",',','.','/','*','+','~','`','=');\n\t\t\t$code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');\n\t\t\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\n\t\t\treturn $text;\n\t\t}", "public static function removeUrls($text){\n $text = preg_replace(\n \"#(^|[^\\\">])(https?://)([\\w]+[^ \\\"\\n\\r\\t< ]*)#\",\n \"\",\n $text\n );\n // ones without http.. starting with www or ftp..Replace urls with blank space\n $text = preg_replace(\n \"#(^|[\\n ])((www|ftp)\\.[^ \\\"\\t\\n\\r< ]*)#\",\n \"\",\n $text\n );\n\n return $text;\n }", "public function formatAsUrl() {\r\n $url_save_chars = array_merge(range('a','z'),range(0,9),['_','-']);\r\n \r\n $specials = array('ä','ü','ö','ß',' ','ç','é','â','ê','î','ô','û','à','è','ì','ò','ù','ë','ï','ü','&');\r\n $specials_replacements = array('ae','ue','oe','ss','_','c','e','a','e','i','o','u','a','e','i','o','u','e','i','u','');\r\n // make everything lowercase and replace umlaute and spaces\r\n $url_save_text = trim(str_replace($specials, $specials_replacements, mb_strtolower($this->text,'UTF-8')));\r\n // remove every invalid character thats left from text (replace with \"-\") \r\n for($i = 0; $i < strlen($url_save_text); $i++){\r\n if(!in_array($url_save_text[$i], $url_save_chars)){\r\n $url_save_text[$i] = \"-\";\r\n }\r\n } \r\n return $url_save_text;\r\n }", "function massimport_convertspip_uri($str) {\n\t return eregi_replace('[^(->)\\'\\\"]http://([^[:space:]<]*)', ' [http://\\\\1->http://\\\\1]', $str); \n}", "function translateFrom($text) {\n\t\t$text = str_replace('href=\"{[CCM:BASE_URL]}', 'href=\"' . BASE_URL . DIR_REL, $text);\n\t\t$text = str_replace('src=\"{[CCM:REL_DIR_FILES_UPLOADED]}', 'src=\"' . BASE_URL . REL_DIR_FILES_UPLOADED, $text);\n\n\t\t// we have the second one below with the backslash due to a screwup in the\n\t\t// 5.1 release. Can remove in a later version.\n\n\t\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t'/{\\[CCM:BASE_URL\\]}/i',\n\t\t\t\t'/{CCM:BASE_URL}/i'),\n\t\t\tarray(\n\t\t\t\tBASE_URL . DIR_REL,\n\t\t\t\tBASE_URL . DIR_REL)\n\t\t\t, $text);\n\t\t\t\n\t\t// now we add in support for the links\n\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:CID_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceCollectionID'),\n\t\t\t$text);\n\n\t\t$text = preg_replace_callback(\n\t\t\t'/<img [^>]*src\\s*=\\s*\"{CCM:FID_([0-9]+)}\"[^>]*>/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceImageID'),\n\t\t\t$text);\n\n\t\t// now we add in support for the files that we view inline\t\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:FID_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceFileID'),\n\t\t\t$text);\n\n\t\t// now files we download\n\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:FID_DL_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceDownloadFileID'),\n\t\t\t$text);\n\t\t\n\t\treturn $text;\n\t}", "function cleanUrl($text) {\r\n $text = strtolower($text);\r\n $code_entities_match = array('&quot;', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '{', '}', '|', ':', '\"', '<', '>', '?', '[', ']', '', ';', \"'\", ',', '.', '_', '/', '*', '+', '~', '`', '=', ' ', '---', '--', '--', '�');\r\n $code_entities_replace = array('', '-', '-', '', '', '', '-', '-', '', '', '', '', '', '', '', '-', '', '', '', '', '', '', '', '', '', '-', '', '-', '-', '', '', '', '', '', '-', '-', '-', '-');\r\n $text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n return $text;\r\n}", "function translateFromEditMode($text) {\n\t\t$text = str_replace('href=\"{[CCM:BASE_URL]}', 'href=\"' . BASE_URL . DIR_REL, $text);\n\t\t$text = str_replace('src=\"{[CCM:REL_DIR_FILES_UPLOADED]}', 'src=\"' . BASE_URL . REL_DIR_FILES_UPLOADED, $text);\n\n\t\t// we have the second one below with the backslash due to a screwup in the\n\t\t// 5.1 release. Can remove in a later version.\n\n\t\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t'/{\\[CCM:BASE_URL\\]}/i',\n\t\t\t\t'/{CCM:BASE_URL}/i'),\n\t\t\tarray(\n\t\t\t\tBASE_URL . DIR_REL,\n\t\t\t\tBASE_URL . DIR_REL)\n\t\t\t, $text);\n\t\t\t\n\t\t// now we add in support for the links\n\t\t\n\t\t$text = preg_replace(\n\t\t\t'/{CCM:CID_([0-9]+)}/i',\n\t\t\tBASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=\\\\1',\n\t\t\t$text);\n\n\t\t// now we add in support for the files\n\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:FID_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceFileIDInEditMode'),\n\t\t\t$text);\n\t\t\n\n\t\treturn $text;\n\t}", "function parseUrls($txt) {\n\t$parsed = '';\n\t$lines = preg_split('/<br \\/>/', $txt);\n\tforeach ($lines as $line) {\n\t\t$parsedLine = '';\n\t\tif ($line) {\n\t\t\t$words = preg_split('/[\\ ]/', $line);\n\t\t\tforeach ($words as $word) {\n\t\t\t\t$w = parseWordUrls($word);\n\t\t\t\t$parsedLine .= $w.' ';\n\t\t\t}\n\t\t}\n\t\t$parsed .= trim($parsedLine) . '<br />';\n\t}\n\treturn $parsed;\n}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "function raw_urls_to_links($text){\n\t\t$text = \" $text \";\n\t\t$text = preg_replace('#(https?://[^\\s<>{}()]+[^\\s.,<>{}()])#i', '<a href=\"$1\" rel=\"nofollow\">$1</a>', $text);\n\t\t$text = preg_replace('#(\\s)([a-z0-9\\-]+(?:\\.[a-z0-9\\-\\~]+){2,}(?:/[^ <>{}()\\n\\r]*[^., <>{}()\\n\\r])?)#i', \n\t\t\t'$1<a href=\"http://$2\" rel=\"nofollow\">$2</a>', $text);\n\n\t\t$text = trim($text);\n\t\treturn $text;\n\t}", "function _external_to_internal($content)\n\t{\n\t\t// replace hrefs\n\t\tpreg_match_all(\n\t\t\t\t'/(<[^>]+href=[\"\\']?)([^\"\\' >]+)([^\"\\'>]?[^>]*>)/i', \n\t\t\t\t$content, \n\t\t\t\t$regs, \n\t\t\t\tPREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$orig_href = $regs[2][$i];\n\t\t\t\t$new_href = weSiteImport::_makeInternalLink($orig_href);\n\t\t\t\tif ($new_href != $orig_href) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $new_href . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// replace src (same as href!!)\n\t\tpreg_match_all(\n\t\t\t\t'/(<[^>]+src=[\"\\']?)([^\"\\' >]+)([^\"\\'>]?[^>]*>)/i', \n\t\t\t\t$content, \n\t\t\t\t$regs, \n\t\t\t\tPREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$orig_href = $regs[2][$i];\n\t\t\t\t$new_href = weSiteImport::_makeInternalLink($orig_href);\n\t\t\t\tif ($new_href != $orig_href) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $new_href . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// url() in styles with style=\"\"\n\t\tpreg_match_all('/(<[^>]+style=\")([^\"]+)(\"[^>]*>)/i', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\tpreg_match_all('/(url\\(\\'?)([^\\'\\)]+)(\\'?\\))/i', $style, $regs2, PREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace($orig_url, $new_url, $newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// url() in styles with style=''\n\t\tpreg_match_all('/(<[^>]+style=\\')([^\\']+)(\\'[^>]*>)/i', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\tpreg_match_all('/(url\\(\"?)([^\"\\)]+)(\"?\\))/i', $style, $regs2, PREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace($orig_url, $new_url, $newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// url() in <style> tags\n\t\tpreg_match_all('/(<style[^>]*>)(.*)(<\\/style>)/isU', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\t// url() in styles with style=''\n\t\t\t\tpreg_match_all(\n\t\t\t\t\t\t'/(url\\([\\'\"]?)([^\\'\"\\)]+)([\\'\"]?\\))/iU', \n\t\t\t\t\t\t$style, \n\t\t\t\t\t\t$regs2, \n\t\t\t\t\t\tPREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace(\n\t\t\t\t\t\t\t\t\t$regs2[0][$z], \n\t\t\t\t\t\t\t\t\t$regs2[1][$z] . $new_url . $regs2[3][$z], \n\t\t\t\t\t\t\t\t\t$newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $content;\n\t}", "function getlinkfromcontent($text)\n{\n$reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n\n// The Text you want to filter for urls\n\n// Check if there is a url in the text\nif(preg_match($reg_exUrl, $text, $url)) {\n\n// make the urls hyper links\necho preg_replace($reg_exUrl, \"<a target='_new' href='\".$url[0].\"' target='_blank' style='color:#166cec;text-decoration:underline;'>\".$url[0].\"</a>\", $text);\n\n} else {\n\n// if no urls in the text just return the text\nreturn $text;\n\n}\n}", "function acf_strip_protocol($url)\n{\n}", "public function sanitizeFreeText()\n {\n $this->label = AdapterUtil::reencode($this->label);\n $this->street = AdapterUtil::reencode($this->street);\n $this->locality = AdapterUtil::reencode($this->locality);\n $this->region = AdapterUtil::reencode($this->region);\n $this->country = AdapterUtil::reencode($this->country);\n }", "function processWikitext($text, $links) {\n $result = $text;\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\n $differentLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$2</a>'\";\n $simpleLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$1</a>'\";\n if ( $links ) {\n\t$result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\n\t$result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\n\t$result = $result;\n } else {\n\t$result = preg_replace($differentLinkRegex, \"$2\", $result);\n\t$result = preg_replace($simpleLinkRegex, \"$1\", $result);\n }\n return $result;\n}", "function update_carrier_url()\n{\n // Get all carriers\n $sql = '\n\t\tSELECT c.`id_carrier`, c.`url`\n\t\tFROM `' . _DB_PREFIX_ . 'carrier` c';\n $carriers = Db::getInstance()->executeS($sql);\n\n // Check each one and erase carrier URL if not correct URL\n foreach ($carriers as $carrier) {\n if (empty($carrier['url']) || !preg_match('/^https?:\\/\\/[:#%&_=\\(\\)\\.\\? \\+\\-@\\/a-zA-Z0-9]+$/', $carrier['url'])) {\n Db::getInstance()->execute('\n\t\t\t\tUPDATE `' . _DB_PREFIX_ . 'carrier`\n\t\t\t\tSET `url` = \\'\\'\n\t\t\t\tWHERE `id_carrier`= ' . (int) ($carrier['id_carrier']));\n }\n }\n}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "public function detect_links()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:(?:https?|ftp):\\/\\/|(?:www|ftp)\\.)(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})(?::[0-9]{1,5})?(?:\\/[^\\s'\\\"]*)?(?:(?<![,\\)\\.])|[\\S])/\",\r\n\t\t\t$child->get_text(),\r\n\t\t\t$matches,\r\n\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\tif(substr($match[0], 0, 3) === 'ftp' && $match[0][3] !== ':')\r\n\t\t\t\t\t$url = 'ftp://' . $match[0];\r\n\t\t\t\telse if($match[0][0] === 'w')\r\n\t\t\t\t\t$url = 'http://' . $match[0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$url = $match[0];\r\n\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('url', array('default' => htmlentities($url, ENT_QUOTES | ENT_IGNORE, \"UTF-8\")));\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_URL));\r\n\r\n\t\treturn $this;\r\n\t}", "public static function text2link($text){\n \n\n // The Regular Expression filter\n\t\t $reg_wwwUrl = \"/(www)\\.[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n $reg_httpUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if(preg_match($reg_httpUrl, $text, $url)) {\n // make the urls hyper links\n $text = preg_replace($reg_httpUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\">'.$url[0].'</a>', $text);\n } else if(preg_match($reg_wwwUrl, $text, $url)){\n\t\t $text = preg_replace($reg_wwwUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\">'.$url[0].'</a>', $text);\n\t\t} // if no urls in the text just return the text\n return ($text);\n\t}", "function cleanLink($input) {\n\t// Prefix URL with http:// if it was missing from the input\n\tif(trim($input[url]) != \"\" && !preg_match(\"#^https?://.*$#\",$input[url])) { $input[url] = \"http://\" . $input[url]; } \t\n\t\t\n\t\t$curly = array(\"{\",\"}\");\n\t\t$curly_replace = array(\"&#123;\",\"&#125;\");\n\t\t\n\t\tforeach($input as $field => $data) {\n\t\t\t$input[$field] = filter_var(trim($data),FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t$input[$field] = str_replace($curly,$curly_replace,$input[$field]); // Replace curly brackets (needed for placeholders to work)\n\t\t\t\t\n\t\tif($field == \"url\") {\n\t\t\t$input[url] = str_replace(\"&#38;\",\"&\",$input[url]); // Put &s back into URL\n\t\t\n\t\t}\n\t}\t\n\treturn($input);\n}", "function amap_ma_get_entity_description($desc) {\n $entity_description = preg_replace('/[^(\\x20-\\x7F)]*/', '', $desc);\n $entity_description = amap_ma_remove_shits($entity_description);\n\n // code below replace the &quot; with \" from href of a tag. \n // The Regular Expression filter\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if (preg_match($reg_exUrl, $entity_description, $url)) {\n $temp1 = preg_replace($reg_exUrl, \"mmmfffmmm\", $entity_description);\n $temp2 = str_replace('&quot;', \"\\\"\", $url[0]);\n $entity_description = str_replace('&quot;mmmfffmmm', \"\\\"{$temp2}\", $temp1);\n }\n\n return $entity_description;\n}", "function hyperlinkText($text) {\n\n\t\tif (!$text) return \"N/A\";\n\n\t\t//$text = displayBlank($text);\n\n \t//Not perfect but it works - please help improve it.\n $text=preg_replace('/([^(\\'|\")]((f|ht){1}tp(s?):\\/\\/)[-a-zA-Z0-9@:%_\\+.~#?&;\\/\\/=]+[^(\\'|\")])/','<a href=\"\\\\1\" target=\"_blank\">\\\\1</a>', $text);\n $text=preg_replace(\"/(^|[ \\\\n\\\\r\\\\t])([^('|\\\")]www\\.([a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+)(\\/[^\\/ \\\\n\\\\r]*)*[^('|\\\")])/\", '\\\\1<a href=\"http://\\\\2\" target=\"_blank\">\\\\2</a>', $text);\n $text=preg_replace(\"/(^|[ \\\\n\\\\r\\\\t])([^('|\\\")][_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,4}[^('|\\\")])/\",'\\\\1<a href=\"mailto:\\\\2\" target=\"_blank\">\\\\2</a>', $text);\n\n return $text;\n\t}", "function get_links_from_text($raw) {\r\n\t// via http://stackoverflow.com/a/5289151/2496685\r\n\t$reg_exUrl = \"(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))\";\r\n\t$matches = array();\r\n\tpreg_match_all($reg_exUrl, $raw, $matches);\r\n\treturn $matches[0];\r\n}", "public function replace_urls_callback($text, $callback) {\n\t\t// Start off with a regex\n\t\tpreg_match_all('#(?:(?:https?|ftps?)://[^.\\s]+\\.[^\\s]+|(?:[^.\\s/]+\\.)+(?:museum|travel|[a-z]{2,4})(?:[:/][^\\s]*)?)#i', $text, $matches);\n\t\t\n\t\t// Then clean up what the regex left behind\n\t\t$offset = 0;\n\t\tforeach($matches[0] as $url) {\n\t\t\t$url = htmlspecialchars_decode($url);\n\t\t\t\n\t\t\t// Remove trailing punctuation\n\t\t\t$url = rtrim($url, '.?!,;:\\'\"`');\n\t\n\t\t\t// Remove surrounding parens and the like\n\t\t\tpreg_match('/[)\\]>]+$/', $url, $trailing);\n\t\t\tif (isset($trailing[0])) {\n\t\t\t\tpreg_match_all('/[(\\[<]/', $url, $opened);\n\t\t\t\tpreg_match_all('/[)\\]>]/', $url, $closed);\n\t\t\t\t$unopened = count($closed[0]) - count($opened[0]);\n\t\n\t\t\t\t// Make sure not to take off more closing parens than there are at the end\n\t\t\t\t$unopened = ($unopened > strlen($trailing[0])) ? strlen($trailing[0]):$unopened;\n\t\n\t\t\t\t$url = ($unopened > 0) ? substr($url, 0, $unopened * -1):$url;\n\t\t\t}\n\t\n\t\t\t// Remove trailing punctuation again (in case there were some inside parens)\n\t\t\t$url = rtrim($url, '.?!,;:\\'\"`');\n\t\t\t\n\t\t\t// Make sure we didn't capture part of the next sentence\n\t\t\tpreg_match('#((?:[^.\\s/]+\\.)+)(museum|travel|[a-z]{2,4})#i', $url, $url_parts);\n\t\t\t\n\t\t\t// Were the parts capitalized any?\n\t\t\t$last_part = (strtolower($url_parts[2]) !== $url_parts[2]) ? true:false;\n\t\t\t$prev_part = (strtolower($url_parts[1]) !== $url_parts[1]) ? true:false;\n\t\t\t\n\t\t\t// If the first part wasn't cap'd but the last part was, we captured too much\n\t\t\tif ((!$prev_part && $last_part)) {\n\t\t\t\t$url = substr_replace($url, '', strpos($url, '.'.$url_parts[2], 0));\n\t\t\t}\n\t\t\t\n\t\t\t// Capture the new TLD\n\t\t\tpreg_match('#((?:[^.\\s/]+\\.)+)(museum|travel|[a-z]{2,4})#i', $url, $url_parts);\n\t\t\t\n\t\t\t$tlds = array('ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa', 'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc', 'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'travel', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'ye', 'yt', 'yu', 'za', 'zm', 'zw');\n\t\n\t\t\tif (!in_array($url_parts[2], $tlds)) continue;\n\t\t\t\n\t\t\t// Call user specified func\n\t\t\t$modified_url = $callback($url);\n\t\t\t\n\t\t\t// Replace it!\n\t\t\t$start = strpos($text, $url, $offset);\n\t\t\t$text = substr_replace($text, $modified_url, $start, strlen($url));\n\t\t\t$offset = $start + strlen($modified_url);\n\t\t}\n\t\t\n\t\treturn $text;\n\t}", "public function formatLinks($text) {\n $text = preg_replace(\"/([\\w-?&;#~=\\.\\/]+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?))/i\",\"<a href=\\\"mailto:$1\\\">$1</a>\",$text);\n $text = str_replace(\"http://www.\",\"www.\",$text);\n $text = str_replace(\"www.\",\"http://www.\",$text);\n $text = preg_replace(\"/([\\w]+:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/i\",\"<a href=\\\"$1\\\">$1</a>\", $text);\n return $text;\n }", "function _xss_sanitization_esc_url( $url, $_context = 'display' ) {\n\n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n \n // Init\n $original_url = $url;\n \n // If blank, then no harm\n if ( '' == $url ) {\n return $url;\n }\n\n //Start cleaning\n $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n \n $strip = array('%0d', '%0a', '%0D', '%0A');\n $url = wp_deep_replace($strip, $url);\n\n // Make sure its not a ;//\n $url = str_replace(';//', '://', $url);\n \n /* If the URL doesn't appear to contain a scheme, we\n * presume it needs http:// appended (unless a relative\n * link starting with /, # or ? or a php file).\n */\n if ( strpos($url, ':') === false && \n ! in_array( $url[0], array( '/', '#', '?' ) ) &&\n ! preg_match('/^[a-z0-9-]+?\\.php/i', $url) \n ){\n $url = 'http://' . $url;\n }\n\n // Replace ampersands and single quotes only when displaying.\n if ( 'display' == $_context ) {\n $url = kses_normalize_entities( $url );\n $url = str_replace( '&amp;', '&#038;', $url );\n $url = str_replace( \"'\", '&#039;', $url );\n }\n\n if ( kses_bad_protocol( $url, $protocols ) != $url ){\n return '';\n }\n\n return $url;\n}", "function thinkup_extract_urls_filter ( $tu_post ) {\n\n $regex = '/[a-z]+:\\/\\/[a-z0-9-_]+\\.[a-z0-9-_@:~%&\\?\\+#\\/.=]+[^:\\.,\\)\\s*$]/i';\n\n if ( preg_match_all($regex, $tu_post->wp_post->post_content, $matches) ) {\n\n $tu_post->links = array_merge($tu_post->links, $matches[0]);\n\n }\n\n return $tu_post;\n\n}", "function parseText($text) {\r\n\t\r\n\t\r\n\t\t$parsed_text = $this->urlsTolinks($text);\r\n\t\t\r\n\t\t//if no paragraph or break tags replace \\n with <br />\r\n\t\t\r\n\t\tif (!eregi('(<p|<br)', $parsed_text)) {\r\n\t\t\t\r\n\t\t\t$parsed_text = nl2br($parsed_text);\r\n\t\t\r\n \t\t} \r\n\t\t\r\n\t\t$parsed_text = $this->replaceMediaPlaceholders($parsed_text);\r\n\t\t$parsed_text = $this->replaceUserVariables($parsed_text);\r\n\t\t$parsed_text = $this->textoGif($parsed_text);\r\n\t\t//$parsed_text = $this->popuplinks($parsed_text);\r\n\t\t \t\t\r\n\t\treturn $parsed_text;\r\n\t\r\n\t}", "function parseText($txt,$wrap){\n\t\t\t$txt = $this->TS_links_rte($txt, $wrap);\n\t\t\t//prepend relative paths with url\n\t\t\t$txt = $this->makeAbsolutePaths($txt);\n\t\t\t$txt = $this->cleanHTML($txt);\n\t\t\treturn $txt;\n\t\t\n\t}", "public static function textTagUrls($text)\r\n {\r\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\r\n\r\n\r\n // Check if there is a url in the text\r\n if(preg_match($reg_exUrl, $text, $url)) {\r\n // make the urls hyper links\r\n return preg_replace($reg_exUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\" target=\"_blank\">'.$url[0].'</a>', $text);\r\n } else {\r\n // if no urls in the text just return the text\r\n return $text;\r\n\r\n }\r\n }", "function origin_parse()\n\t\t{\n\t\t\t$text_data = $this->calendar->get_text_data();\n\t\t\t\n\t\t\t// loop through each text row and parse it into feilds\n\t\t\tforeach($text_data as $single_column)\n\t\t\t{\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$base_info = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+2);\n\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\n\t\t\t\t$code = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$city = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$state_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\tif(strpos($single_column->text_column, ',y,') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 4);\n\t\t\t\t\t\n\t\t\t\t} else if(strpos($single_column->text_column, ',n') !== FALSE ) {\n\t\t\t\t\t\n\t\t\t\t\t$on_site = 0;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 3);\n\t\t\t\t} else {\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$address = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\n\t\t\t\t$location_2 = strpos($single_column->text_column, ',\"');\n\t\t\t\t$phone_number = substr($single_column->text_column, 0, $location_2);\t\t\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+2);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$proper_data = substr($single_column->text_column, $location+2, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$start_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$end_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$course_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$instructor = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\t\t\n\t\t\t\t$course_cost = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$random_zero = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\t\t\t\n\t\t\t\t$description = substr($single_column->text_column, 2, (strlen($single_column->text_column) - 2));\n\t\n\t\t\t\t// setup the structure of a single new event parsed out as columns that have meaning\n\t\t\t\t$constructed_cal_row = array(\n\t\t\t\t\t'base_info' \t\t=> $base_info,\n\t\t\t\t\t'code'\t\t\t\t=> $code,\n\t\t\t\t\t'city' \t\t\t\t=> $city,\n\t\t\t\t\t'state_code'\t\t=> $state_code,\n\t\t\t\t\t'on_site'\t\t\t=> $on_site,\n\t\t\t\t\t'address'\t\t\t=> $address,\n\t\t\t\t\t'phone_number'\t\t=> $phone_number,\n\t\t\t\t\t'proper_data'\t\t=> $proper_data,\n\t\t\t\t\t'start_time'\t\t=> $start_time,\n\t\t\t\t\t'end_time'\t\t\t=> $end_time,\n\t\t\t\t\t'course_code'\t\t=> $course_code,\n\t\t\t\t\t'instructor'\t\t=> $instructor,\n\t\t\t\t\t'course_cost'\t\t=> $course_cost,\n\t\t\t\t\t'random_zero'\t\t=> $random_zero,\n\t\t\t\t\t'decsription'\t\t=> $description\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add that row to something that we can use\n\t\t\t\t$this->calendar->insert_calendar($constructed_cal_row);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->test('Done!');\n\t\t}", "public function format_text_to_links( $text ) {\r\n\t\tif( empty( $text ) ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((ht|f)tp(s)?:\\/\\/[\\w]+[^ \\,\\\"\\n\\r\\t<]*)/is\", \"$1$2<a href=\\\"$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((www|ftp)\\.[^ \\,\\\"\\t\\n\\r<]*)/is\", \"$1$2<a href=\\\"http://$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([a-z0-9&\\-_\\.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+)+)/i\", \"$1<a href=\\\"mailto:$2@$3\\\">$2@$3</a>\", $text );\r\n\t \r\n\t\treturn $text;\r\n\t}", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "function save_cwrc_data() {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $data = html_entity_decode(stripslashes($_POST['text']), ENT_QUOTES, 'UTF-8');\n $cwrc = str_replace('<br>', '<br />', $data);\n $cwrc = str_replace('&', '&amp;', $cwrc);\n $pid = ($_POST['file_pid']);\n save_cwrc_to_fedora($pid, $cwrc);\n echo \"Success\";\n}", "function feed_process_link($feed, $camp) {\n\t\n\t//detect encoding mbstring\n\tif(! function_exists('mb_detect_encoding')){\n\t\t echo '<br><span style=\"color:red;\">mbstring PHP extension that is responsible for text encoding is not installed,Install it. You may get encoding problems.</span>';\t\t\n\t}\n\t\n\t//php-xml check\n\tif(! function_exists('simplexml_load_string')){\n\t\techo '<br><span style=\"color:red;\">php-xml PHP extension that is responsible for parsing XML is not installed. Please <a href=\"https://stackoverflow.com/questions/38793676/php-xml-extension-not-installed\">install it</a> and try again</span>';\n\t}\n\t\n\t// ini\n\tif( stristr($camp->camp_general, 'a:') ) $camp->camp_general=base64_encode($camp->camp_general);\n\t$camp_general=unserialize( base64_decode( $camp->camp_general));\n\t$camp_general=array_map('wp_automatic_stripslashes', $camp_general);\n\t$camp_opt = unserialize ( $camp->camp_options );\n\t\n\t// Feed extraction method old format adaption\n\tif(in_array('OPT_FEED_CUSTOM_R', $camp_opt)){\n\t\t$camp_general['cg_feed_custom_regex'] = array($camp_general['cg_feed_custom_regex'],$camp_general['cg_feed_custom_regex2']);\n\t}\n\t\n\tif(in_array('OPT_FEED_CUSTOM', $camp_opt)){\n\t\t\n\t\t$camp_general['cg_feed_extraction_method'] = 'css';\n\t\t\n\t\t$camp_general['cg_custom_selector'] = array($camp_general['cg_custom_selector'] , $camp_general['cg_custom_selector2'] , $camp_general['cg_custom_selector3'] );\n\t\t$camp_general['cg_feed_custom_id'] = array($camp_general['cg_feed_custom_id'] , $camp_general['cg_feed_custom_id2'] , $camp_general['cg_feed_custom_id3'] );\n\t\t\n\t\t$cg_feed_css_size = array();\n\t\t$cg_feed_css_size[] = in_array('OPT_SELECTOR_SINGLE', $camp_options) ? 'single' : 'all' ;\n\t\t$cg_feed_css_size[] = in_array('OPT_SELECTOR_SINGLE2', $camp_options) ? 'single' : 'all' ;\n\t\t$cg_feed_css_size[] = in_array('OPT_SELECTOR_SINGLE3', $camp_options) ? 'single' : 'all' ;\n\t\t$camp_general['cg_feed_css_size'] = $cg_feed_css_size;\n\t\t\n\t\t$cg_feed_css_wrap = array();\n\t\t$cg_feed_css_wrap[] = in_array('OPT_SELECTOR_INNER',$camp_options) ? 'inner' : 'outer' ;\n\t\t$cg_feed_css_wrap[] = in_array('OPT_SELECTOR_INNER2',$camp_options) ? 'inner' : 'outer' ;\n\t\t$cg_feed_css_wrap[] = in_array('OPT_SELECTOR_INNER3',$camp_options) ? 'inner' : 'outer' ;\n\t\t$camp_general['cg_feed_css_wrap'] = $cg_feed_css_wrap;\n\t\t\n\t}\n\t\n\t\n\tif(isset($camp_general['cg_feed_extraction_method'])){\n\t\tswitch ($camp_general['cg_feed_extraction_method']) {\n\t\t\t\n\t\t\tcase 'summary':\n\t\t\t\t$camp_opt[] = 'OPT_SUMARRY_FEED';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'css':\n\t\t\t\t$camp_opt[] = 'OPT_FEED_CUSTOM';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'auto':\n\t\t\t\t$camp_opt[] = 'OPT_FULL_FEED';\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'regex':\n\t\t\t\t$camp_opt[] = 'OPT_FEED_CUSTOM_R';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'visual':\n\t\t\t\t$camp_opt[] = 'OPT_FEED_CUSTOM';\n\t\t\t\t$camp_general['cg_feed_extraction_method'] = 'css';\n\t\t\t\t\n\t\t\t\t$camp_general['cg_feed_custom_id'] = $camp_general['cg_feed_visual'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$cg_feed_css_size = array();\n\t\t\t\t$cg_feed_css_wrap = array();\n\t\t\t\t$cg_custom_selector = array();\n\t\t\t\t\n\t\t\t\tforeach ($camp_general['cg_feed_visual'] as $singleVisual){\n\t\t\t\t\t$cg_feed_css_size[] = 'single';\n\t\t\t\t\t$cg_feed_css_wrap[] = 'outer';\n\t\t\t\t\t$cg_custom_selector[] = 'xpath';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$camp_general['cg_feed_css_size'] = $cg_feed_css_size;\n\t\t\t\t$camp_general['cg_feed_css_wrap'] = $cg_feed_css_wrap;\n\t\t\t\t$camp_general['cg_custom_selector'] = $cg_custom_selector;\n\t\t\t\t\n\t\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n\t\n\tif(in_array('OPT_STRIP_CSS', $camp_opt) && ! is_array($camp_general['cg_feed_custom_strip_id'])){ \n\t\t\n\t\t$cg_feed_custom_strip_id[] = $camp_general['cg_feed_custom_strip_id'];\n\t\t$cg_feed_custom_strip_id[] = $camp_general['cg_feed_custom_strip_id2'];\n\t\t$cg_feed_custom_strip_id[] = $camp_general['cg_feed_custom_strip_id3'];\n\t\t\n\t\t$cg_custom_strip_selector[] = $camp_general['cg_custom_strip_selector'];\n\t\t$cg_custom_strip_selector[] = $camp_general['cg_custom_strip_selector2'];\n\t\t$cg_custom_strip_selector[] = $camp_general['cg_custom_strip_selector3'];\n\t\t\n\t\t$cg_feed_custom_strip_id = array_filter($cg_feed_custom_strip_id);\n\t\t$cg_custom_strip_selector = array_filter($cg_custom_strip_selector);\n\t\t\n\t\t$camp_general['cg_feed_custom_strip_id'] = $cg_feed_custom_strip_id;\n\t\t$camp_general['cg_custom_strip_selector'] = $cg_custom_strip_selector;\n\t\t\n\t}\n\n\t$feedMd5 = md5($feed);\n\t$isItemsEndReached = get_post_meta ( $camp->camp_id , $feedMd5.'_isItemsEndReached',1);\n\t$lastProcessedFeedUrl = get_post_meta ( $camp->camp_id , $feedMd5.'_lastProcessedFeedUrl',1);\n\t$lastFirstFeedUrl = get_post_meta ( $camp->camp_id , $feedMd5.'_lastFirstFeedUrl',1);\n\t\n\t// check last time adition\n\t$feed = trim ( $feed );\n\t$myfeed = addslashes ( $feed );\n\t\n\t//removed @ v3.24\n\t/*\n\t$query = \"select * from {$this->wp_prefix}automatic_feeds_list where feed='$myfeed' and camp_id = '$camp->camp_id' limit 1\";\n\t$feeds = $this->db->get_results ( $query );\n\t$feed_o = $feeds [0];\n\t*/\n\n\t// report processed feed\n\t$this->log ( 'Process Feed', '<a href=\"' . $feed . '\">' . $feed . '</a>' );\n\n\t// If force feed\n\t\n\tif(in_array('OPT_FEED_FORCE', $camp_opt)){\n\t\n\t\tif(! function_exists('wp_automatic_force_feed')){\n\t\t\tadd_action('wp_feed_options', 'wp_automatic_force_feed', 10, 1);\n\t\t\tfunction wp_automatic_force_feed($feed) {\n\t\t\t\t$feed->force_feed(true);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Wrong feed length fix\n\tif( ! function_exists('wp_automatic_setup_curl_options') ){\n\t\t//feed timeout\n\t\tfunction wp_automatic_setup_curl_options( $curl ) {\n\t\t\tif ( is_resource( $curl ) ) {\n\t\t\t\t//curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Expect:' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t\n\t \n\t// loading SimplePie\n\tinclude_once (ABSPATH . WPINC . '/feed.php');\n\t\n\t\n\n\t// Add action to fix the problem of curl transfer closed without complete data\n\tadd_action( 'http_api_curl', 'wp_automatic_setup_curl_options' );\n\tif( ! function_exists('wp_automatic_wp_feed_options') ){\n\t\tfunction wp_automatic_wp_feed_options($args){\n\n\t\t\t$args->set_useragent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 ');\n\t\t\t\t\n\t\t}\n\t\tadd_action('wp_feed_options','wp_automatic_wp_feed_options');\n\t}\n\n\t\n\t\n\t// Trim returned feed content because some feed add empty spaces before feed content \n\tif(!function_exists('wp_automatic_trim_feed_content')){\n\t\tfunction wp_automatic_trim_feed_content($args){\n\t\t\t\n\t\t\t \n\t\t\t$args['body'] = trim($args['body']);\n\t\t\t\n\t\t\t//$args['body'] = preg_replace('{article/(\\d+?)/}' , \"article/$1wpp/\", trim($args['body']) ) ; \n\t\t\t\n\t\t\treturn $args;\n\t\t}\n\t}\n\t\n\t\n\tadd_filter('http_response', 'wp_automatic_trim_feed_content');\n\n\tif(stristr($feed, 'news.google') && ! function_exists('wp_automatic_feed_options') ){\n\t\t\n\t\t// Fix Google news image stripped\n\t\t echo '<br>Google news feed found, disabling sanitization...';\n\t\t\n\t\tfunction wp_automatic_feed_options( $feed) {\n\t\t\n\t\t\t$feed->set_sanitize_class( 'SimplePie_Sanitize' );\n\t\t\t$feed->sanitize = new SimplePie_Sanitize;\n\t\t\n\t\t}\n\t\tadd_action( 'wp_feed_options', 'wp_automatic_feed_options' );\n\t}\n\t\n\t\n\t \n\t// If proxified download the feed content to a test file for\n\t//exclude multipage scraper as it is already a local feed /wp-content/uploads/277d7822fe5662e66d660a42eaae4910_837.xml\n\t$localFeed = '';\n\tif($this->isProxified && ! ( stristr( $feed , '.xml' ) && stristr( $feed , 'wp-content' ) ) ){\n\t\t//downloading the feed content \n\t\t//print_r( $this->download_file\n\t\t$downloadedFileUrl = $this->download_file($feed,'.html');\n\t\t\n\t\tif(trim($downloadedFileUrl) != ''){\n\t\t\t echo '<br>Feed downloaded using a proxy '.$downloadedFileUrl;\n\t\t\t$localFeed = $downloadedFileUrl.'?key='.md5(trim($feed));\n\t\t}\n\t\t\n\t\t\n\t}\n\t \n\t\n\t//fix ssl verification\n\tadd_filter( 'https_ssl_verify', '__return_false' );\n \n\t// Fetch feed content\n\tif(trim($localFeed) == ''){\n\t\t$rss = fetch_feed ( stripslashes( $feed ) );\n\t}else{\n\t\t echo '<br>Loaded locally';\n\t\t$rss = fetch_feed ($localFeed);\n\t}\n\t \n\tif(trim($rss->raw_data) == ''){\n\t\t echo '<br>Feed was loaded from cache';\n\t}else{\n\t\t echo '<br>Feed was freshly loaded from the source';\n\t}\n\t\n\t \n\t \n\t// Remove added filter\n\tremove_filter('http_response', 'wp_automatic_trim_feed_content');\n\n\tif (! is_wp_error ( $rss )){ // Checks that the object is created correctly\n\t\t// Figure out how many total items there are, but limit it to 5.\n\t\t$maxitems = $rss->get_item_quantity ();\n\t\t\n\t\t// Build an array of all the items, starting with element 0 (first element).\n\t\t$rss_items = $rss->get_items ( 0, $maxitems );\n\t\t\n\t\t//feed name \n\t\t$res['feed_name'] = $rss->get_title();\n\t\t \n\t\t//remove the expect again as it makes jetpack publicize to not work\n\t\tremove_action('http_api_curl', 'wp_automatic_setup_curl_options');\n\t\t\t\n\t\t\t\n\t}else{\n\t\t$error_string = $rss->get_error_message();\n\t\t echo '<br><strong>Error:</strong>' . $error_string ;\n\t}\n\t\n\tif (!isset($maxitems) || $maxitems == 0)\n\t\treturn false;\n\telse\n\t\t\t\n\t//reverse order if exists\n\tif(in_array('OPT_FEED_REVERSE', $camp_opt)){\n\t\t echo '<br>Reversing order';\n\t\t$rss_items = array_reverse($rss_items);\n\t}\n\n\t// Loop through each feed item and display each item as a hyperlink.\n\t$i = 0;\n\t$i2 = 0; // refer to items number in feed\n\t \n\tforeach ( $rss_items as $item ) :\n\t\n\t \n\t$url = esc_url ( $item->get_permalink () );\n\t$original_url = $url; // used for exclusion because the effective_url may change below\n\t\n\t//google news links correction \n\tif(stristr($url, 'news.google')){\n\t\t$urlParts = explode('url=', $url);\n\t\t$correctUrl = $urlParts[1];\n\t\t$url = $correctUrl;\n\t\t\n\t}\n\t\n\t//Google alerts links correction\n\tif(stristr($feed\t, 'alerts/feeds') && stristr($feed, 'google')){\n\t\tpreg_match('{url\\=(.*?)[&]}', $url,$urlMatches);\n\t\t$correctUrl = $urlMatches[1];\n\t\t\n\t\tif( trim($correctUrl) != '' ){\n\t\t\t$url =$correctUrl;\n\t\t}\n\t}\n\t\n\t//check if no new links: the last first url is the same\n\tif($i2 == 0){\n\t\t\n\t\tif($isItemsEndReached == 'yes'){\n\t\t\t\n\t\t\t//Last time there were no new links check if the case didn't change\n\t\t\tif( $lastFirstFeedUrl == md5($url) ){\n\t\t\t\t\n\t\t\t\t//still no new links stop checking now\n\t\t\t\t echo '<br>First url in the feed:'.$url;\n\t\t\t\t echo '<br>This link was the same as the last time we did not find new links so ... skipping till new posts get added <a href=\"#\" class=\"wp_automatic_ajax\" data-action=\"wp_automatic_ajax\" data-function=\"forget_lastFirstFeedUrl\" data-data=\"'.$feedMd5.'\" data-camp=\"'.$camp->camp_id.'\" >Forget this fact Now</a>.';\n\t\t\t\t\n\t\t\t\t//delete transient cache\n\t\t\t\tdelete_transient('feed_'.$feedMd5);\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//new links found remove the isItemsEndReached flag\n\t\t\t\tdelete_post_meta($camp->camp_id,$feedMd5.'_isItemsEndReached');\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t//Record first feed url\n\tif($i2 == 0){\n\t\tupdate_post_meta ( $camp->camp_id , $feedMd5.'_lastFirstFeedUrl',md5($url));\n\t}\n\t\n\t// one more link, increase index2\n\t$i2++;\n\t\t\n\tif(trim($url) == ''){\n\t\t echo '<br>item have no url skipping';\n\t\tcontinue;\n\t}\n\n\t// current post url\t\n\t echo '<br>Post url: '.$url;\n\t\n\t// post date\n\t$wpdate= $item->get_date ( \"Y-m-d H:i:s\");\n\t$publish_date = get_date_from_gmt($wpdate);\n\t echo '<br>- Published: '.$wpdate ;\n\t\n\t// post categories \n\t$cats= ($item->get_categories());\n\n\t// separate categories with commas\t\n\t$cat_str = '';\n\tif(isset($cats)){\n\t\tforeach($cats as $cat ){\n\t\t\tif(trim($cat_str) != '') $cat_str.= ',';\n\t\t\t$cat_str.= $cat->term;\n\t\t}\n\t}\n\t\t\n\t// fix empty titles\n\tif(trim($item->get_title ()) == ''){\n\t\t echo '<--Empty title skipping';\n\t\tcontinue;\n\t}\n\t\n\t//&# encoded chars\n\tif(stristr($url, '&#')){\n\t\t$url = html_entity_decode($url);\n\t}\n\t\t\n\t// check if execluded link due to exact match does not exists\n\tif( $this->is_execluded($camp->camp_id, $url)){\n\t\t echo '<-- Excluded link';\n\t\tcontinue;\n\t}\n\t\t\n\t// check if older than minimum date\n\tif($this->is_link_old($camp->camp_id, strtotime($wpdate) )){\n\t\t echo '<--old post execluding...';\n\t\tcontinue;\n\t}\n\t\t\n\t// check media images\n\tunset($media_image_url);\n\t$enclosures = $item->get_enclosures();\n\t\n\t $i=0;\n\tforeach ($enclosures as $enclosure){\n\n\t\tif(trim($enclosure->type) != ''){\n\t\t\n\t\t\t$enclosure_link = $enclosure->link;\n\t\t\t\n\t\t\t$res ['enclosure_link_'.$i] = $enclosure_link;\n\t\t\t\n\t\t\tif(isset($enclosure->type) && stristr($enclosure->type, 'image') && isset($enclosure->link) ){\n\t\t\t\t$media_image_url = $enclosure->link;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$i++;\n\t}\n\t\n\t\n\t\n\t\n\t// Duplicate check\n\tif (! $this->is_duplicate($url) ) {\n\n\t\t echo '<-- new link';\n\t \n\t\t$title = strip_tags( $item->get_title () );\n\t\t\n\t\t//fix &apos;\n\t\t$title = str_replace('&amp;apos;', \"'\", $title);\n\t\t$title = str_replace('&apos;', \"'\", $title);\n\t \n\t\t \n\t\t \n\t\t//check if there is a post published with the same title\n\t\tif(in_array('OPT_FEED_TITLE_SKIP',$camp_opt) ){\n\t\t\tif($this->is_title_duplicate($title,$camp->camp_post_type)){\n\t\t\t\t echo '<-- duplicate title skipping..';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\n\t\t$i ++;\n\t\t\n\t\t// Date\n\t\t$date = $item->get_date ( 'j F Y g:i a' );\n\t\t$wpdate= $item->get_date ( \"Y-m-d H:i:s\");\n \t\n\t\t// post content\n\t\t$html = $item->get_content ();\n \n\t\t$postAuthor = $item->get_author();\n\t\t@$authorName = $postAuthor->name;\n\t\t\n\t\tif(trim($authorName) == ''){\n\t\t\t@$authorName = $postAuthor->email;\n\t\t}\n\t\t\n\t\tif(trim($authorName) == ''){\n\t\t\t@$authorName = $postAuthor->link;\n\t\t}\n\t\t\n\t\t$res['author'] = $authorName;\n\t\t@$res['author_link'] = $postAuthor->link;\n \n\t\t//source domain\n\t\t$res['source_domain'] = $parse_url = parse_url($url, PHP_URL_HOST );\n\t \t\n\t\t//encoded URL\n\t\t$res['source_url_encoded'] = urlencode($url);\n\t\t\n\t\t// If empty content make content = title\n\t\tif(trim($html) == ''){\n\t\t\tif( trim($title) != '' ) $html =$title;\n\t\t}\n\t\t\n\t\t// loging the feeds \n\t\t$md5 = md5 ( $url );\n\t\t \n\n\t\t//if not image escape it\n\t\t$res ['cont'] = $html;\n\t\t$res ['original_content']=$html;\n\t\t$res ['title'] = $title;\n\t\t$res ['original_title'] = $title;\n\t\t$res ['matched_content'] = $html;\n\t\t$res ['source_link'] = $url;\n\t\t$res ['publish_date'] = $publish_date;\n\t\t$res ['wpdate']=$wpdate;\n\t\t$res ['cats'] = $cat_str;\n\t\t$res ['tags'] = '';\n\t\t$res ['enclosure_link'] = isset( $enclosure_link ) ? $enclosure_link : '' ;\n\t\t\n\t\t\n\t\t\n\t\t//custom atributes\n\t\t$arr=array();\n\t\t$arrValues = array_values($item->data['child']);\n\t\t\n\t\tforeach ($arrValues as $arrValue){\n\t\t\tif(is_array($arrValue)){\n\t\t\t\t$arr = array_merge($arr,$arrValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$res['attributes'] = $arr;\n\n\t\t$og_title_enabled = in_array('OPT_FEED_OG_TTL', $camp_opt) || ( isset($camp_general['cg_ml_ttl_method']) && trim($camp_general['cg_ml_ttl_method']) != 'auto' ) ;\n\t\t\n\t\t \n\t\t// original post content \n\t\tif ( in_array('OPT_FULL_FEED',$camp_opt) || in_array ( 'OPT_FEED_CUSTOM', $camp_opt ) || in_array ( 'OPT_FEED_CUSTOM_R', $camp_opt ) || in_array ( 'OPT_ORIGINAL_META', $camp_opt ) || in_array ( 'OPT_ORIGINAL_CATS', $camp_opt ) || in_array ( 'OPT_ORIGINAL_TAGS', $camp_opt ) || in_array ( 'OPT_ORIGINAL_AUTHOR', $camp_opt ) || in_array ( 'OPT_FEED_PTF', $camp_opt ) || in_array ( 'OPT_FEEDS_OG_IMG', $camp_opt ) || $og_title_enabled ) {\n\t\t\n\t\t\techo '<br>Loading original post content ...';\n\t\t\t\n\t\t\t//get content\n\t\t\t$x='error';\n\t\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( html_entity_decode( $url ) ));\n\t\t\t\n\t\t\t//encoding\n\t\t\tif(in_array('OPT_FEED_ENCODING' , $camp_opt )){\n\t\t\t\techo '<br>Clearing encoding..';\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_ENCODING , \"\");\n\t\t\t}\n\t\t\t\n\t\t\t// Source page html\n\t\t\ttimer_start();\n\t\t\t$original_cont = $this->curl_exec_follow ( $this->ch );\n\t\t\t$x = curl_error ( $this->ch );\n\t\t \t\n\t\t\techo ' <--' . strlen($original_cont) . ' chars returned in ' . timer_stop() . ' seconds';\n\t\t\t\n\t\t\t//converting encoding\n\t\t\tif(in_array('OPT_FEED_CONVERT_ENC', $camp_opt) ){\n\t\t\t\techo '<br>Converting encoding from '.$camp_general['cg_feed_encoding']. ' to utf-8';\n\t\t\t\t$original_cont = iconv( trim($camp_general['cg_feed_encoding']).'//IGNORE' , \"UTF-8//IGNORE\", $original_cont );\n\t\t\t}\n\t\t\t\n\t\t\t//fix images\n\t\t\t$original_cont = $this->fix_relative_paths($original_cont, $url);\n\t\t\t\n\t\t\t//fix lazy loading\n\t\t\tif(in_array('OPT_FEED_LAZY',$camp_opt)){\n\t\t\t\t\n\t\t\t\t$cg_feed_lazy = trim($camp_general['cg_feed_lazy']);\n\t\t\t\t\n\t\t\t\tif( $cg_feed_lazy == '' ) $cg_feed_lazy = 'data-src';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tpreg_match_all('{<img .*?>}s', $original_cont,$imgsMatchs);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$imgsMatchs = $imgsMatchs[0];\n\t\t\t\t\n\t\t\t\tforeach($imgsMatchs as $imgMatch){\n\t\t\t\t\t\n\t\t\t\t\tif(stristr($imgMatch,$cg_feed_lazy )){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$newImg = $imgMatch;\n\t\t\t\t\t\t$newImg = preg_replace('{ src=\".*?\"}', '', $newImg);\n\t\t\t\t\t\t$newImg = str_replace($cg_feed_lazy, 'src', $newImg);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$original_cont = str_replace($imgMatch, $newImg, $original_cont);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$original_cont = $this->lazy_loading_auto_fix( $original_cont );\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}//end-content-extraction\n\t\t\n\t\t\n\n\t\t// FULL CONTENT\n\t\tif ( in_array ( 'OPT_FULL_FEED', $camp_opt ) ) {\n\t\t\t \t\n\t\t\t \n\t\t\t// test url\n\t\t\t//$url =\"http://news.jarm.com/view/75431\";\n\t\t\t\t \n\t\t\t\n\t\t\t//get scripts\n\t\t\t$postponedScripts = array();\n\t\t\tpreg_match_all('{<script.*?</script>}s', $original_cont , $scriptMatchs);\n\t\t\t$scriptMatchs = $scriptMatchs[0];\n\t\t\t\n\t\t\t\n\t\t\tforeach ($scriptMatchs as $singleScript){\n\t\t\t\tif( stristr($singleScript, 'connect.facebook')){\n\t\t\t\t\t$postponedScripts[] = $singleScript;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$original_cont = str_replace($singleScript, '', $original_cont);\n\t\t\t}\n \t\t\t\n \t\t\t \n\t\t\t$x = curl_error ( $this->ch );\n\t\t\t$url = curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n\t\t\t\n\t\t\t \n\t\t\t\t\n\t\t\t// Redability instantiate\n\t\t\trequire_once 'inc/wp_automatic_readability/wp_automatic_Readability.php';\n\t\t\t\n\t\t\t$wp_automatic_Readability = new wp_automatic_Readability ( $original_cont, $url );\n\t\t\t\n\t\t\t$wp_automatic_Readability->debug = false;\n\t\t\t$result = $wp_automatic_Readability->init ();\n\t\t\t\t\n\t\t\tif ($result) {\n\t\t\t\t\n\t\t\t\t// Redability title\n\t\t\t\t$title = $wp_automatic_Readability->getTitle ()->textContent;\n\t\t\t\t\n\t\t\t\t// Redability Content\n\t\t\t\t$content = $wp_automatic_Readability->getContent ()->innerHTML;\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t//twitter embed fix\n\t\t\t\tif(stristr($content, 'twitter.com') && ! stristr($content, 'platform.twitter')){\n\t\t\t\t\t$content.='<script async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>';\n\t\t\t\t}\n\n\t\t\t\t// Remove wp_automatic_Readability attributes\n\t\t\t\t$content = preg_replace('{ wp_automatic_Readability\\=\".*?\"}s', '', $content);\n\t\t\t\t\n\t\t\t\t// Fix iframe if exists\n\t\t\t\tpreg_match_all('{<iframe[^<]*/>}s', $content,$ifrMatches);\n\t\t\t\t$iframesFound = $ifrMatches[0];\n\t\t\t\t\n\t\t\t\tforeach ($iframesFound as $iframeFound){\n\t\t\t\t\t\n\t\t\t\t\t$correctIframe = str_replace('/>','></iframe>',$iframeFound);\n\t\t\t\t\t$content = str_replace($iframeFound, $correctIframe, $content);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//add postponed scripts \n\t\t\t\tif(count($postponedScripts) > 0 ){\n\t\t\t\t\t$content.= implode('', $postponedScripts);\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t// Cleaning redability for better memory\n\t\t\t\tunset($wp_automatic_Readability);\n\t\t\t\tunset($result);\n\t\t\t\t\t\n\t\t\t\t// Check existence of title words in the content\n\t\t\t\t$title_arr=explode(' ', $title);\n\n\t\t\t\t$valid='';\n\t\t\t\t$nocompare=array('is','Is','the','The','this','This','and','And','or','Or','in','In','if','IF','a','A','|','-');\n\t\t\t\tforeach($title_arr as $title_word){\n\t\t\t\t\t\n\t\t\t\t\tif(strlen($title_word) > 3){\n\t\t\t\t\t\n\t\t\t\t\t\tif(! in_array($title_word, $nocompare) && preg_match('/\\b'. preg_quote(trim($title_word),'/') .'\\b/ui', $content)){\n\t\t\t\t\t\t\t echo '<br>Word '.$title_word .' exists';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t// echo $content;\n\t\t\t\t\t\t\t$valid='yeah';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t echo '<br>Word '.$title_word .' does not exists';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(trim($valid) != ''){\n\n\t\t\t\t\t$res ['cont'] = $content;\n\t\t\t\t\t$res ['matched_content'] = $content;\n\t\t\t\t\t$res ['og_img'] = '';\n\t\t\t\t\t\n\t\t\t\t\tif(! in_array('OPT_FEED_TITLE_NO', $camp_opt)){\n\t\t\t\t\t\t$res ['title'] = $title;\n\t\t\t\t\t\t$res['original_title'] = $title;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t// let's find og:image may be the content we got has no image\n\t\t\t\t\tpreg_match('{<meta[^<]*?property=[\"|\\']og:image[\"|\\'][^<]*?>}s', $html,$plain_og_matches);\n\n\t\t\t\t\tif( isset($plain_og_matches[0]) && @stristr($plain_og_matches[0], 'og:image')){\n\t\t\t\t\t\tpreg_match('{content=[\"|\\'](.*?)[\"|\\']}s', $plain_og_matches[0],$matches);\n\t\t\t\t\t\t$og_img = $matches[1];\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(trim($og_img) !=''){\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$res ['og_img']=$og_img ;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}// If og:image\n \t\n\t\t\t\t}else{\n\t\t\t\t\t echo '<br>Can not make sure if the returned content is the full content.. using excerpt instead.';\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t echo '<br>Looks like we couldn\\'t find the full content. :( returning summary';\n\t\t\t}\n\t\t\t\n\t\t// Class or ID extraction\n\t\t\n\t\t}elseif(in_array ( 'OPT_FEED_CUSTOM', $camp_opt )){\n\t\t\t\t \n\t\t\t\n\t\t\t// Load dom\n\t\t\trequire_once 'inc/class.dom.php';\n\t\t\t$wpAutomaticDom = new wpAutomaticDom($original_cont);\n\t\t\t\n\t\t\t\n\t\t\t$cg_custom_selector=$camp_general['cg_custom_selector'];\n\t\t\t$cg_feed_custom_id =$camp_general['cg_feed_custom_id'];\n\t\t\t$cg_feed_custom_id=array_filter($cg_feed_custom_id);\n\t\t\t$cg_feed_css_size = $camp_general['cg_feed_css_size'];\n\t\t\t$cg_feed_css_wrap = $camp_general['cg_feed_css_wrap'];\n\n\t\t\techo '<br>Extracting content from original post for ';\n\t\t\t\n\t\t\t\t \n\t\t\t//test url\n\t\t\t//$url = \"http://news.jarm.com/view/75431\";\n\t\t\t$wholeFound = '';\n\t\t\tif(1){\n \t\t\t\t$i=0;\n\t\t\t\tforeach ($cg_feed_custom_id as $cg_selecotr_data){\n\t\t\t\t\t\n\t\t\t\t\t$cg_selector = $cg_custom_selector[$i];\n\t\t\t\t\t$cg_feed_css_size_s = $cg_feed_css_size[$i];\n\t\t\t\t\t$cg_feed_css_wrap_s = $cg_feed_css_wrap[$i];\n\t\t\t\t\t\n\t\t\t\t\techo '<br>'.$cg_selector . ' = \"'.$cg_selecotr_data.'\"';\n\t\t\t\t\t\n\t\t\t\t\tif( $cg_feed_css_wrap_s == 'inner' ){\n\t\t\t\t\t\t$inner = true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$inner = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($cg_selector == 'xpath'){\n\t\t\t\t\t\t$ret= $wpAutomaticDom->getContentByXPath( stripslashes( $cg_selecotr_data ) ,$inner);\n\t\t\t\t\t\t \n\t\t\t\t\t}elseif($cg_selector == 'class'){\n\t\t\t\t\t\t$ret= $wpAutomaticDom->getContentByClass( $cg_selecotr_data,$inner);\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t}elseif($cg_selector== 'id'){\n\t\t\t\t\t\t$ret= $wpAutomaticDom->getContentByID( $cg_selecotr_data,$inner);\n\t\t\t\t\t}\n\t\n\t\t\t\t\t$extract='';\n\t\n\t\t\t\t\tforeach ($ret as $itm ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t $extract.= $itm;\n\t\n\t\t\t\t\t\tif( $cg_feed_css_size_s == 'single'){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t \n\t\t\t\t\t$rule_num = $i +1;\n\t\t\t\t\t$res['rule_'.$rule_num] = $extract;\n\t\t\t\t\t$res['rule_'.$rule_num.'_plain'] = strip_tags( $extract );\n\t\t\t\t\t\n\t\t\t\t\tif(trim($extract) == ''){\n\t\t\t\t\t\t echo '<br>Nothing found to extract for this rule' ;\n\t\t\t\t\t\t \n\t\t\t\t\t}else{\n\t\t\t\t\t\t echo ' <-- ' . strlen($extract) .' chars extracted';\n\t\t\t\t\t\t $wholeFound = (trim($wholeFound) == '' ) ? $extract : $wholeFound.'<br>'.$extract;\n\t\t\t\t\t\t \n\t\t\t\t\t}\n \t\t\t\t\t$i++;\n\t\t\t\t}\t\n\t\t\t\tif(trim($wholeFound) != ''){\n\t\t\t\t\t$res ['cont'] = $wholeFound;\n\t\t\t\t\t$res ['matched_content'] = $wholeFound;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t echo '<br>could not parse the content returning summary' ;\n\t\t\t}\n\t\t\t\n\t\t// REGEX EXTRACT\t\n\t\t}elseif(in_array ( 'OPT_FEED_CUSTOM_R', $camp_opt )){\n\t\t\t\t\n\t\t\techo '<br>Extracting content using REGEX ';\n\t\t\t$cg_feed_custom_regex = $camp_general['cg_feed_custom_regex'];\n\t\t\t\n\t\t\t$finalmatch = '';\n\t\t\t\t\n\t\t\tforeach ($cg_feed_custom_regex as $cg_feed_custom_regex_single){\n\t\t\t\n\t\t\t$cg_feed_custom_regex_single = html_entity_decode( $cg_feed_custom_regex_single );\n \t\t\t\t\n\t\t\tif(trim($cg_feed_custom_regex_single) != '' ){\n\n\t\t\t\t$finalmatch2 = '';\n\n\t\t\t\t//we have a regex\n\t\t\t\techo '<br>Regex :'. htmlspecialchars($cg_feed_custom_regex_single);\n\n\n\t\t\t\t//extracting\n\t\t\t\tif(trim($original_cont) !=''){\n\t\t\t\t\tpreg_match_all('{'.$cg_feed_custom_regex_single.'}is', $original_cont,$matchregex);\n\t\t\t\t\t\t\n\t\t\t\t\tfor( $i=1 ; $i < count($matchregex);$i++ ){\n\n\t\t\t\t\t\tforeach($matchregex[$i] as $newmatch){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(trim($newmatch) !=''){\n\t\t\t\t\t\t\t\tif(trim($finalmatch) !=''){\n\t\t\t\t\t\t\t\t\t$finalmatch.='<br>'.$newmatch;\n\t\t\t\t\t\t\t\t\t$finalmatch2.='<br>'.$newmatch;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$finalmatch.=$newmatch;\n\t\t\t\t\t\t\t\t\t$finalmatch2.=$newmatch;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\techo '<-- '.strlen($finalmatch2) .' chars found';\n\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\techo '<br>Can not load original content.';\n\t\t\t\t}\n \n\n\t\t\t}//rule not empty\n\n\t\t\t}//foreach rule\n\t\t\t\n\t\t\tif(trim($finalmatch) != ''){\n\t\t\t\t//overwirte\n\t\t\t\techo '<br>'. strlen($finalmatch) . ' chars extracted using REGEX';\n\t\t\t\t$res ['cont'] = $finalmatch;\n\t\t\t\t$res ['matched_content'] = $finalmatch;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo '<br>Nothing extracted using REGEX using summary instead..';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// redirect_url tag finding\n\t\t$redirect = '';\n\t\t$redirect = curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n\t\t \n\t\tif(trim($redirect) != ''){\n\t\t\t$res ['redirect_url'] = $redirect;\n\t\t}\n\n\t\t// Stripping content using id or class from $res[cont]\n\t\tif(in_array('OPT_STRIP_CSS', $camp_opt)){\n\t\t\t\t\n\t\t\t echo '<br>Stripping content using:- ';\n\t\t\t\t\n\t\t\t$cg_selector = $camp_general['cg_custom_strip_selector'];\n\t\t\t$cg_selecotr_data = $camp_general['cg_feed_custom_strip_id'];\n\t\t\t$cg_selecotr_data = array_filter($cg_selecotr_data);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Load dom\n\t\t\t$final_doc = new DOMDocument();\n\t\t\t\n\t\t\t//getting encoding \n\t\t\t\n\t\t\tpreg_match_all('{charset=[\"|\\']([^\"]+?)[\"|\\']}', $original_cont,$encMatches);\n\t\t\t$possibleCharSet = $encMatches[1];\n\t\t\t\n\t\t \n\t\t\t\n\t\t\t$possibleCharSet = isset($possibleCharSet[0]) ? $possibleCharSet[0] : '';\n\t\t\t\n\t\t\tif(trim($possibleCharSet) == '') $possibleCharSet = 'UTF-8';\n\t\t\t\n\t\t\t$charSetMeta = '<meta http-equiv=\"content-type\" content=\"text/html; charset=' . $possibleCharSet . '\"/>';\n\t\t\t\n\t\t\t$full_html = '<head>'.$charSetMeta.'</head><body>'. $res['cont'] . '</body>' ;\n\t\t\t$html_to_count = $full_html;\n\t\t\t\n\t\t\t@$final_doc->loadHTML( $full_html );\n\t\t\t\n\t\t\t$selector = new DOMXPath($final_doc);\n\t\t\t\n\t\t\t\n\t\t\t$i=0;\n\t\t\t$inner = false;\n\t\t\tforeach ( $cg_selecotr_data as $cg_selector_data_single ){\n\t\t\t\t\n\t\t\t\techo '<br> - ' . $cg_selector[$i]. ' = \"'.$cg_selector_data_single.'\" ';\n\t\t\t\t\n\t\t\t\tif(trim($cg_selector_data_single) != '' ){\n\t\t\t\t\t\n\t\t\t\t\tif($cg_selector[$i] == 'class'){\n\t\t\t\t\t\t$query_final = '//*[contains(attribute::class, \"' . trim($cg_selector_data_single) . '\")]';\n\t\t\t\t\t}elseif( $cg_selector[$i] == 'id'){\n\t\t\t\t\t\t$query_final = \"//*[@id='\" . trim($cg_selector_data_single) .\"']\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$countBefore = $this->chars_count( $html_to_count );\n\t\t\t\t\t\n\t\t\t\t\tforeach($selector->query($query_final) as $e ) {\n\t\t\t\t\t\t$e->parentNode->removeChild($e);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t$html_to_count = $final_doc->saveHTML($final_doc->documentElement);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$countAfter = $this->chars_count($res['cont']);\n\t\t\t\t\t\n\t\t\t\t\techo '<-- '. ( $countBefore - $countAfter ) . ' chars removed';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$contentAfterReplacement = $final_doc->saveHTML($final_doc->documentElement);\n\t\t\t$contentAfterReplacement = str_replace( array('<html>' , '</html>' , '<body>' , '</body>' , $charSetMeta ) , '' , $contentAfterReplacement );\n\t\t\t$contentAfterReplacement = preg_replace('{<head>.*?</head>}','' , $contentAfterReplacement );\n\t\t\t\n\t\t\t$res['cont'] = trim( $contentAfterReplacement );\n\t\t\t\t \n\t\t\t\t//overwirte\n\t\t\t\t$res ['matched_content'] = $res ['cont'];\n \n\n\t\t\t \n\t\t\t\t\n\t\t}\n\n\t\t// Stripping content using REGEX\n\t\tif(in_array('OPT_STRIP_R', $camp_opt)){\n\t\t\t$current_content =$res ['matched_content'] ;\n\t\t\t$current_title=$res['title'];\n\t\t\t$cg_post_strip = html_entity_decode($camp_general['cg_post_strip']);\n\t\t\t\t\n\t\t\t$cg_post_strip=explode(\"\\n\", $cg_post_strip);\n\t\t\t$cg_post_strip=array_filter($cg_post_strip);\n\t\t\t\t\n\t\t\tforeach($cg_post_strip as $strip_pattern){\n\t\t\t\tif(trim($strip_pattern) != ''){\n\n\t\t\t\t\t//$strip_pattern ='<img[^>]+\\\\>';\n\n\t\t\t\t\t echo '<br>Stripping using REGEX:'.htmlentities($strip_pattern);\n\t\t\t\t\t\n\t\t\t\t\t $countBefore = $this->chars_count( $current_content );\n\t\t\t\t\t \n\t\t\t\t\t $current_content= preg_replace('{'.trim($strip_pattern).'}is', '', $current_content);\n\t\t\t\t\t\n\t\t\t\t\t $countAfter = $this->chars_count($current_content);\n\t\t\t\t\t \n\t\t\t\t\t echo ' <-- '. ( $countBefore - $countAfter ) . ' chars removed'; \n\t\t\t\t\t \n\t\t\t\t\t$current_title= preg_replace('{'.trim($strip_pattern).'}is', '', $current_title);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t \n\t\t\tif(trim($current_content) !=''){\n\t\t\t\t$res ['matched_content'] =$current_content ;\n\t\t\t\t$res ['cont'] =$current_content ;\n\t\t\t}\n\t\t\t\t\n\t\t\tif(trim($current_title) !=''){\n\t\t\t\t$res ['matched_title'] =$current_title ;\n\t\t\t\t$res ['original_title'] =$current_title ;\n\t\t\t\t$res ['title'] =$current_title ;\n\n\t\t\t}\n\t\t\t\t\n\t\t}// end regex replace\n\t\t\n\t\t// strip tags\n\t\tif(in_array('OPT_STRIP_T', $camp_opt)){\n\t\t\t\n\t\t\t echo '<br>Stripping html tags...';\n\t\t\t\n\t\t\t$cg_allowed_tags = trim($camp_general['cg_allowed_tags']);\n\t\t\t\n\t\t\tif(! stristr($cg_allowed_tags, '<script')){\n\t\t\t\t$res ['matched_content'] = preg_replace( '{<script.*?script>}s', '', $res ['matched_content'] );\n\t\t\t\t$res ['cont'] = preg_replace( '{<script.*?script>}s', '', $res ['cont'] );\n\t\t\t\t\n\t\t\t\t$res ['matched_content'] = preg_replace( '{<noscript.*?noscript>}s', '', $res ['matched_content'] );\n\t\t\t\t$res ['cont'] = preg_replace( '{<noscript.*?noscript>}s', '', $res ['cont'] );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$res ['matched_content'] = strip_tags(\t$res ['matched_content'] , $cg_allowed_tags) ;\n\t\t\t$res ['cont'] =strip_tags($res ['cont'] , $cg_allowed_tags) ;\n\t\t}\n\t\t\n\t\t// validate content size\n\t\t\n\t\t//MUST CONTENT\n\t\tif(in_array('OPT_MUST_CONTENT', $camp_opt)){\n\t\t\n\t\t\tif(trim($res['cont']) == ''){\n\t\t\t\t echo '<--No content excluding';\n\t\t\t\t$this->link_execlude( $camp->camp_id, $original_url );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t//limit content\n\t\tif(in_array('OPT_MIN_LENGTH', $camp_opt)){\n\t\t\n\t\t\t$contentTextual = strip_tags($res['cont']);\n\t\t\t$contentTextual = str_replace(' ', '', $contentTextual);\n\t\t\t\n\t\t\tif(function_exists('mb_strlen'))\n\t\t\t{\n\t\t\t\t$contentLength = mb_strlen($contentTextual);\n\t\t\t}else{\n\t\t\t\t$contentLength = strlen($contentTextual);\n\t\t\t}\n\t\t\t\n\t\t\tunset($contentTextual);\n\t\t\n\t\t\t echo '<br>Content length:'.$contentLength;\n\t\t\n\t\t\tif( $contentLength < $camp_general['cg_min_length'] ){\n\t\t\t\t echo '<--Shorter than the minimum... Excluding';\n\t\t\t\t$this->link_execlude( $camp->camp_id, $original_url );\n\t\t\t\tcontinue;\n\t\t\n\t\t\t}\n\t\t\n\t\t}\n \n\t\t// Entity decode \n\t\tif(in_array('OPT_FEED_ENTITIES', $camp_opt)){\n\t\t\t echo '<br>Decoding html entities';\n\t\t\t\t\n\t\t\t//php 5.3 and lower convert &nbsp; to invalid charchters that broke everything\n\t\t\t\t\n\t\t\t$res ['original_title'] = str_replace('&nbsp;', ' ', $res ['original_title']);\n\t\t\t$res ['matched_content'] = str_replace('&nbsp;', ' ', $res ['matched_content']);\n\t\t\t\t\n\t\t\t$res ['original_title'] = html_entity_decode($res ['original_title'] , ENT_QUOTES | ENT_HTML401);\n\t\t\t$res ['title'] = html_entity_decode($res ['title'] , ENT_QUOTES | ENT_HTML401) ;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$res ['matched_content'] = html_entity_decode($res ['matched_content'],ENT_QUOTES | ENT_HTML401 );\n\t\t\t$res ['cont'] = $res ['matched_content'];\n\t\t\n\t\t}// end entity decode\n\t\t\n\t\t\n\t\t// Clean googleads and <script tag\n\t\t$res['cont'] = preg_replace('{<ins.*?ins>}s', '', $res['cont']);\n\t\t$res['cont'] = preg_replace('{<ins.*?>}s', '', $res['cont']);\n\t\t\n\t\tif(! in_array('OPT_FEED_SCRIPT', $camp_opt))\n\t\t$res['cont'] = preg_replace('{<script.*?script>}s', '', $res['cont']);\n\t\t\n\t\t$res['cont'] = preg_replace('{\\(adsbygoogle.*?\\);}s', '', $res['cont']);\n\t\t$res ['matched_content'] = $res['cont'];\n \n\t\t// meta tags\n\t\tif(in_array('OPT_ORIGINAL_META', $camp_opt)){\n\t\t\t\n\t\t \t\n\t\t\t//extract all metas \n\t\t\tpreg_match_all('{<meta.*?>}s', $original_cont,$metaMatches);\n\t\t\t\n\t\t\t$allMeta = $metaMatches[0];\n\t\t\t\n\t\t\tforeach ($allMeta as $singleMeta){\n\t\t\t\t\n\t\t\t\tif(stristr($singleMeta, 'keywords')){\n\t\t\t\t\t\n\t\t\t\t\tif(preg_match('{name[\\s]?=[\\s]?[\"\\']keywords[\"\\']}', $singleMeta) ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tpreg_match_all('{content[\\s]?=[\\s]?[\\'\"](.*?)[\\'\"]}s', $singleMeta,$realTagsMatches);\n\t\t\t\t\t\t$realTagsMatches = $realTagsMatches[1];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(trim($realTagsMatches[0]) != ''){\n\t\t\t\t\t\t \n\t\t\t\t\t\t\techo '<br>Meta tags:'.$realTagsMatches[0];\n\t\t\t\t\t\t\t$res['tags'] = $realTagsMatches[0];\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\t\n\t\t\t// Extract cats from original source\n\t\t\tif(in_array('OPT_ORIGINAL_CATS', $camp_opt) && trim($camp_general['cg_feed_custom_id_cat']) != ''){\n\t\t\t\t\n\t\t\t\techo '<br>Extracting original post categories ';\n\t\t\t\t\n\t\t\t\t$cg_selector_cat=$camp_general['cg_custom_selector_cat'];\n\t\t\t\t$cg_selecotr_data_cat=$camp_general['cg_feed_custom_id_cat'];\n\t\t\t\t$inner = false;\n\t\t\t\t\n\t\t\t\techo ' for '.$cg_selector_cat . ' = '.$cg_selecotr_data_cat;\n\t\t\t\t\n\t\t \n\t\t\t\t//dom class\n\t\t\t\tif(! isset($wpAutomaticDom)){\n\t\t\t\t\trequire_once 'inc/class.dom.php';\n\t\t\t\t\t$wpAutomaticDom = new wpAutomaticDom($original_cont);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(1){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$extract='';\n\t\t\t\t\t\n\t\t\t\t\tif ($cg_selector_cat == 'class') {\n\t\t\t\t\t\t$extract = $wpAutomaticDom->getContentByClass ( $cg_selecotr_data_cat, $inner );\n\t\t\t\t\t} elseif ($cg_selector_cat == 'id') {\n\t\t\t\t\t\t$extract = $wpAutomaticDom->getContentByID ( $cg_selecotr_data_cat, $inner );\n\t\t\t\t\t} elseif ($cg_selector_cat == 'xpath') {\n\t\t\t\t\t\t$extract = $wpAutomaticDom->getContentByXPath ( stripslashes ( $cg_selecotr_data_cat ), $inner );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($extract)){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array('OPT_SELECTOR_SINGLE_CAT', $camp_opt)){\n\t\t\t\t\t\t\t$extract = $extract[0];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$extract = implode(' ' , $extract);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(trim($extract) == ''){\n\t\t\t\t\t\techo '<br>Nothing found to extract for this category rule';\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br>Cat Rule extracted ' . strlen($extract) .' charchters ';\n\t\t\t\t\t\t\n \n\t\t\t\t\t\tif(stristr($extract, '<a')){\n\t\t\t\t\t\t\tpreg_match_all('{<a .*?>(.*?)</a}su', $extract,$cats_matches);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$cats_founds = $cats_matches[1];\n\t\t\t\t\t\t\t$cat_founds = array_map('strip_tags', $cats_founds);\n\t\t\t\t\t\t\t$cats_str = implode(',', $cat_founds);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo ' found cats:'.$cats_str;\n\t\t\t\t\t\t\t$res['cats'] =$cats_str;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t \n\t\t// Extract tags from original source\n\t\tif(in_array('OPT_ORIGINAL_TAGS', $camp_opt) && trim($camp_general['cg_feed_custom_id_tag']) != ''){\n\t\t\t\t\n\t\t\t echo '<br>Extracting original post tags ';\n\t\t\t\t\n\t\t\t$cg_selector_tag=$camp_general['cg_custom_selector_tag'];\n\t\t\t$cg_selecotr_data_tag=$camp_general['cg_feed_custom_id_tag'];\n\t\t\t$inner = false;\n\t\t\t \n\n\t\t\techo ' for '.$cg_selector_tag . ' = '.$cg_selecotr_data_tag;\n\n\t\t\t//dom class\n\t\t\tif(! isset($wpAutomaticDom)){\n\t\t\t\trequire_once 'inc/class.dom.php';\n\t\t\t\t$wpAutomaticDom = new wpAutomaticDom($original_cont);\n\t\t\t}\n\t\t\t\n\t\t\t \n\t\t\tif(1){\n\t\t\t\t\t\n\t\t\t \n\t\t\t\t$extract='';\n\t\t\t\t\t\n\t\t\t\tif ($cg_selector_tag == 'class') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByClass ( $cg_selecotr_data_tag, $inner );\n\t\t\t\t} elseif ($cg_selector_tag == 'id') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByID ( $cg_selecotr_data_tag, $inner );\n\t\t\t\t} elseif ($cg_selector_tag == 'xpath') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByXPath ( stripslashes ( $cg_selecotr_data_tag ), $inner );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(is_array($extract)){\n\t\t\t\t\t\n\t\t\t\t\tif(in_array('OPT_SELECTOR_SINGLE_TAG', $camp_opt)){\n\t\t\t\t\t\t$extract = $extract[0];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$extract = implode(' ' , $extract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t \t\n\t\t\t\tif(trim($extract) == ''){\n\t\t\t\t\t echo '<br>Nothing found to extract for this tag rule';\n\t\t\t\t}else{\n\t\t\t\t\t echo '<br>Tag Rule extracted ' . strlen($extract) .' charchters ';\n\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\tif(stristr($extract, '<a')){\n\t\t\t\t\t\tpreg_match_all('{<a .*?>(.*?)</a}su', $extract,$tags_matches);\n \n\t\t\t\t\t\t$tags_founds = $tags_matches[1];\n\t\t\t\t\t\t$tags_founds = array_map('strip_tags', $tags_founds); \n\t\t\t\t\t\t \n\t\t\t\t\t\t$tags_str = implode(',', $tags_founds);\n\n\t\t\t\t\t\t echo ' Found tags:'.$tags_str;\n\t\t\t\t\t\t $res['tags'] =$tags_str;\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t \n\t\t\t\t\n\t\t}elseif(in_array('OPT_ORIGINAL_TAGS', $camp_opt)){\n\t\t\t\n\t\t\t echo '<br>You must add a valid ID/Class to Extract tags, No tags will get extracted.';\n\t\t\t\n\t\t}//extract tags\n\n\t\t//extract author from original source\n\t\tif(in_array('OPT_ORIGINAL_AUTHOR', $camp_opt) && trim( $camp_general['cg_feed_custom_id_author'] ) != '' ){\n\n\t\t\t echo '<br>Extracting original post author ';\n\n\t\t\t$cg_selector_author=$camp_general['cg_custom_selector_author'];\n\t\t\t$cg_selecotr_data_author=$camp_general['cg_feed_custom_id_author'];\n\t\t\t$inner = false;\n\n\t\t\t echo ' for '.$cg_selector_author . ' = '.$cg_selecotr_data_author;\n \n\t\t\t\t \n\t\t\t //dom class\n\t\t\t if(! isset($wpAutomaticDom)){\n\t\t\t \trequire_once 'inc/class.dom.php';\n\t\t\t \t$wpAutomaticDom = new wpAutomaticDom($original_cont);\n\t\t\t }\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\tif(1){\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$extract='';\n\t\t\t\t\n\t\t\t\tif ($cg_selector_author == 'class') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByClass ( $cg_selecotr_data_author, $inner );\n\t\t\t\t} elseif ($cg_selector_author == 'id') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByID ( $cg_selecotr_data_author, $inner );\n\t\t\t\t} elseif ($cg_selector_author == 'xpath') {\n\t\t\t\t\t$extract = $wpAutomaticDom->getContentByXPath ( stripslashes ( $cg_selecotr_data_author ), $inner );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(is_array($extract)){\n\t\t\t\t\t\n\t\t\t\t\tif(in_array('OPT_SELECTOR_SINGLE_AUTHOR', $camp_opt)){\n\t\t\t\t\t\t$extract = $extract[0];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$extract = implode(' ' , $extract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Validate returned author\n\t\t\t\tif(trim($extract) == ''){\n\t\t\t\t\t echo '<br>Nothing found to extract for this author rule';\n\t\t\t\t}else{\n\t\t\t\t\t echo '<br>author Rule extracted ' . strlen($extract) .' charchters ';\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\tif(stristr($extract, '<a')){\n\t\t\t\t\t\tpreg_match_all('{<a .*?>(.*?)</a}su', $extract,$author_matches);\n\n\t\t\t\t\t\t$author_founds = $author_matches[1];\n\t\t\t\t\t\t$author_str = strip_tags($author_founds[0]);\n\n\t\t\t\t\t\t echo ' Found author:'.$author_str;\n\t\t\t\t\t\t$res['author'] =$author_str;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t \n\t\t\t}\n\n\n\t\t}elseif(in_array('OPT_ORIGINAL_AUTHOR', $camp_opt)){\n\t\t\t\n\t\t\tif( trim($res['author']) == '' ){\n\t\t\t\n\t\t\t\t echo '<br>You must add a valid ID/Class to Extract Author, No Author will get extracted.';\n\t\t\t}\n\t\t\t\n\t\t}//extract author\n\n\n\t\tif(! in_array('OPT_ENCLUSURE', $camp_opt)){\n\t\t\tif( isset($media_image_url) && ! stristr($res['cont'], '<img') ){\n\t\t\t\t echo '<br>enclosure image:'.$media_image_url;\n\t\t\t\t$res['cont'] = '<img src=\"'.$media_image_url.'\" /><br>' . $res['cont'];\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// Part to custom field OPT_FEED_PTF\n\t\t\n\t\t// Extracted custom fields ini\n\t\t$customFieldsArr = array();\n\t\t$ruleFields = array(); //fields names\n\t\t\n\t\tIf( in_array('OPT_FEED_PTF', $camp_opt) ){\n\t\t\t\n\t\t\techo '<br>Specific Part to custom field extraction';\n\t\t\t\n\t\t\t// Load rules\n\t\t\t$cg_part_to_field = trim( html_entity_decode( $camp_general['cg_part_to_field'] ) );\n\t\t\t$cg_part_to_field_parts = explode(\"\\n\", $cg_part_to_field);\n\t\t\t\n\t\t\t// Process rules\n\t\t\tforeach ( $cg_part_to_field_parts as $cg_part_to_field_part ){\n\t\t\t\t echo '<br>Rule:'.htmlentities($cg_part_to_field_part);\n\t\t\t\t\n\t\t\t\t// Validate format | \n\t\t\t\tif( ! stristr($cg_part_to_field_part, '|')){\n\t\t\t\t\t echo '<- Wrong format...';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Parse rule\n\t\t\t\t$rule_parts = explode('|', $cg_part_to_field_part);\n\t\t\t\t\n\t\t\t\t$rule_method = trim( $rule_parts[0] );\n\t\t\t\t$rule_value = trim( $rule_parts[1] );\n\t\t\t\t$rule_field = trim( $rule_parts[2] );\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$rule_single = 0;\n\t\t\t\t@$rule_single = $rule_parts[3];\n\t\t\t\t\n\t\t\t\t// Validate rule\n\t\t\t\tif(trim($rule_method) == '' || trim($rule_value) == '' || trim($rule_field) == ''){\n\t\t\t\t\t echo '<- Wrong format...';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ruleFields[] = $rule_field;\n\t\t\t\t\n\t\t\t\t// Validate rule method: class,id,regex,xpath\n\t\t\t\tif( $rule_method != 'id' && $rule_method != 'class' && $rule_method != 'regex' && $rule_method != 'xpath' ){\n\t\t\t\t\t echo '<- Wrong Method:'.$rule_method;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t \n\t\t\t\t\n\t\t\t \n\t\t\t\t \n\t\t\t\t// id,class,xPath\n\t\t\t\tif( $rule_method == 'id' || $rule_method == 'class' || $rule_method == 'xpath' ){\n\t\t\t\t\t\n\t\t\t\t\t// Dom object\n\t\t\t\t\t$doc = new DOMDocument;\n\t\t\t\t\t\n\t\t\t\t\t// Load Dom\n\t\t\t\t\t@$doc->loadHTML($original_cont);\n\t\t\t\t\t\n\t\t\t\t\t// xPath object\n\t\t\t\t\t$xpath = new DOMXPath($doc);\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t// xPath query\n\t\t\t\t\tif($rule_method != 'xpath'){\n\t\t\t\t\t\t$xpathMatches = $xpath->query(\"//*[@\".$rule_method.\"='\".$rule_value.\"']\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$xpathMatches = $xpath->query(\"$rule_value\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// Single item ? \n\t\t\t\t\tif($rule_single){\n\t\t\t\t\t\t$xpathMatches = array($xpathMatches->item(0));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Rule result ini\n\t\t\t\t\t$rule_result = '';\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\tforeach ($xpathMatches as $xpathMatch){\n\t\t\t\t\t\n\t\t\t\t\t\tif($rule_field == 'tags' || $rule_field == 'categories' ){\n\t\t\t\t\t\t\t$rule_result.= ',' . $xpathMatch->nodeValue;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$rule_result.= $xpathMatch->nodeValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// Store field to be added\n\t\t\t\t\tif(trim($rule_result) != ''){\n\t\t\t\t\t\t echo ' <--'.$this->chars_count($rule_result). ' chars extracted';\n\t\t\t\t\t\t\n\t\t\t\t\t\t if( $rule_field == 'categories' ){\n\t\t\t\t\t\t \t$res['cats'] = $rule_result;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t$customFieldsArr[] = array( $rule_field , $rule_result );\n\t\t\t\t\t\t }\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<-- nothing found';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t// Regex extract\n\t\t\t\t\t$matchregex = array();\n\t\t\t\t\t$finalmatch = '';\n\t\t\t\t\t\n\t\t\t\t\t// Match\n\t\t\t\t\tpreg_match_all('{'.trim($rule_value).'}is', $original_cont,$matchregex);\n\t\t\t\t\t\n\t\t\t\t\t$matchregex_vals = $matchregex[1];\n\t\t\t\t\t\n\t\t\t\t\tif(isset($matchregex[2])) $matchregex_vals = array_merge($matchregex_vals , $matchregex[2] );\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t//single match\n\t\t\t\t\tif($rule_single && count($matchregex_vals) > 1){\n\t\t\t\t\t\t$matchregex_vals = array($matchregex_vals[0]);\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// Read matches\n\t\t\t\t\t\tforeach($matchregex_vals as $newmatch){\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(trim($newmatch) !=''){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(trim($finalmatch) ==''){\n\t\t\t\t\t\t\t\t\t$finalmatch.=''.$newmatch;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($rule_field == 'tags' || $rule_field == 'categories' ){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$finalmatch.= ',' . $newmatch;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$finalmatch.=$newmatch;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// Store field to be added\n\t\t\t\t\tif(trim($finalmatch) != ''){\n\t\t\t\t\t\t\n\t\t\t\t\t\t echo ' <--'.$this->chars_count($finalmatch). ' chars extracted';\n\t\t\t\t\t \t\n\t\t\t\t\t\t \n\t\t\t\t\t\t if( $rule_field == 'categories' ){\n\t\t\t\t\t\t \t$res['cats'] = $finalmatch;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$customFieldsArr[] = array( $rule_field , $finalmatch );\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t \t\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<-- Nothing found';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t}//foreach rule\n\t\t\t\n\t\t\t\n\t\t}//if part to field enabled\n\t\t \n\t\t$res['custom_fields'] = $customFieldsArr;\n\t\t\n\t\tforeach( $ruleFields as $field_name ){\n\t\t\t\n\t\t\t$field_value = ''; //ini\n\t\t\t\t\t\n\t\t\tforeach($customFieldsArr as $fieldsArray){\n\t\t\t\t\n\t\t\t\tif($fieldsArray[0] == $field_name ){\n\t\t\t\t\t$field_value = $fieldsArray[1] ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$res[$field_name] = $field_value;\n\t\t\t\n\t\t}\n\t\t \n\t \n\t\t\n\t\t//og:image check\n\n\t\t//$url=\"kenh14.vn/kham-pha/5-hoi-chung-benh-ky-quac-nghe-thoi-cung-toat-mo-hoi-hot-20151219200950753.chn\";\n\t\n\t\t$currentOgImage = '' ; // for og:image found check \n\t\t\n\t\tif( in_array('OPT_FEEDS_OG_IMG', $camp_opt)){\n \n\t\t\t\t\n\t\t\t//getting the og:image\n\t\t\t//let's find og:image\n\n\t\t\t// if no http\n\t\t\t$original_cont = str_replace('content=\"//', 'content=\"http://', $original_cont );\n\n\t\t\techo '<br>Extracting og:image :';\n\t\t\t\t\n\t\t\t//let's find og:image may be the content we got has no image\n\t\t\tpreg_match('{<meta[^<]*?property=[\"|\\']og:image[\"|\\'][^<]*?>}s', $original_cont,$plain_og_matches);\n\t\t\t\n\t\t\tif( isset($plain_og_matches[0]) && stristr($plain_og_matches[0], 'og:image')){\n\t\t\t\tpreg_match('{content=[\"|\\'](.*?)[\"|\\']}s', $plain_og_matches[0],$matches);\n\t\t\t\t$og_img = $matches[1];\n\t\t\t\t\n\t\t\t\tif(trim($og_img) !=''){\n\n\t\t\t\t\t$og_img_short = preg_replace('{http://.*?/}', '', $og_img);\n\t\t\t\t\techo $og_img_short ;\n\t\t\t\t\tif(trim($og_img_short) == ''){\n\t\t\t\t\t\t$og_img_short = $og_img;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// get og_title\n\t\t\t\t\tpreg_match_all('/<img .*>/', $original_cont,$all_images);\n\t\t\t\t\t\n\t\t\t\t\t$all_images = $all_images[0];\n\t\t\t\t\t$foundAlt = '';//ini\n\t\t\t\t\tforeach ($all_images as $single_image) {\n\t\t\t\t\t\tif(stristr( $single_image , $og_img_short)){\n\t\t\t\t\t\t\t//extract alt text\n\t\t\t\t\t\t\tpreg_match('/alt=[\"|\\'](.*?)[\"|\\']/', $single_image,$alt_matches) ;\n\t\t\t\t\t\t\t$foundAlt = (isset($alt_matches[1])) ? $alt_matches[1] : '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t$res ['og_img']=$og_img ;\n\t\t\t\t\t$res['og_alt'] = $foundAlt;\n\t\t\t\t\t$currentOgImage = $og_img;\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t//fix FB embeds\n\t\tif(stristr($res['cont'], 'fb-post') && ! stristr($res['cont'], 'connect.facebook') ){\n\t\t\techo '<br>Possible Facebook embeds found adding embed scripts';\n\t\t\t$res['cont'].= '<div id=\"fb-root\"></div>\n<script async defer src=\"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2\"></script>';\n\t\t}\n\t\t\n\t\t//fix twitter embeds\n\t\tif(stristr($res['cont'], 'twitter.com') && ! stristr($res['cont'], 'platform.twitter') ){\n\t\t\techo '<br>Possible tweets found without twitter JS. adding JS';\n\t\t\t$res['cont'].= '<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>';\n\t\t}\n\t\t\n\t\t//fix instagram.com embeds\n\t\tif(stristr($res['cont'], 'instagram.com') && ! stristr($res['cont'], 'platform.instagram') ){\n\t\t\techo '<br>Possible Instagram embeds found without JS. adding JS';\n\t\t\t$res['cont'].= '<script async defer src=\"https://platform.instagram.com/en_US/embeds.js\"></script>';\n\t\t}\n\t\t\n\t\t//fix youtube no height embeds\n\t\tif(stristr($res['cont'], 'youtube.com/embed')){\n\t\t\t\n\t\t\tpreg_match_all('{<iframe[^>]*?youtube.com/embed/(.*?)\".*?>(?:</iframe>)?}',$res['cont'],$yt_matches);\n\t\t\t\n\t\t \n\t\t\t$yt_matches_full = $yt_matches[0];\n\t\t\t$yt_matches_ids = $yt_matches[1];\n\t\t\t\n\t\t\t\n\t\t\tif(count($yt_matches_full) > 0 ){\n\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($yt_matches_full as $embed){\n\t\t\t\t\t\n\t\t\t\t\techo '<br>Youtube video embed format changed to WordPress for video :'. $yt_matches_ids[$i] ;\n\t\t\t\t\t\n\t\t\t\t\t$res['cont'] = str_replace($embed , '[embed]https://www.youtube.com/watch?v=' . $yt_matches_ids[$i] . '[/embed]' , $res['cont'] ) ;\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t \n\t\t}\n\t\t\t\n\t\t//check if image or not\n\t\tif( in_array ( 'OPT_MUST_IMAGE', $camp_opt ) && ! stristr($res['cont'], '<img') && trim($currentOgImage) == '' ) {\n\t\t\t\n\t\t\t echo '<br>Post contains no images skipping it ...';\n\t\t\t\n\t\t\t// Excluding it \n\t\t\t$this->link_execlude($camp->camp_id, $original_url);\n\n\t\t}else{\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t//og image fix\n\t\t\tif( isset( $res ['og_img'] ) && trim($res ['og_img']) !=''){\n\t\t\t\t\n\t\t\t\t//make sure it has the domain\n\t\t\t\tif(! stristr($og_img, 'http:')){\n\t\t\t\t\tif(stristr($og_img, '//')){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$og_img = 'http:'. $og_img;\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\t//no domain at all\n\t\t\t\t\t\t$og_img = '/'.$og_img;\n\t\t\t\t\t\t$og_img = str_replace('//', '/', $og_img);\n\t\t\t\t\t\t$og_img = 'http://'.$host.$og_img;\n\t\t\t\t\t\t$res ['og_img']=$og_img ;\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\t\n\t\t \n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//og title or custom title extraction method\n\t\t\tif( in_array('OPT_FEED_OG_TTL', $camp_opt) || ( isset($camp_general['cg_ml_ttl_method']) && trim($camp_general['cg_ml_ttl_method']) != 'auto' ) ){\n\t\t\t\t\n\t\t\t\t \n\t\t\t\tif( in_array('OPT_FEED_OG_TTL', $camp_opt) ){\n\t\t\t\t\t// let's find og:image may be the content we got has no image\n\t\t\t\t\tpreg_match('{<meta[^<]*?property=[\"|\\']og:title[\"|\\'][^<]*?>}s', $original_cont,$plain_og_matches);\n\t\t\t\t\t\n\t\t \n\t\t\t\t\t\n\t\t\t\t\tif(@stristr($plain_og_matches[0], 'og:title')){\n\t\t\t\t\t\tpreg_match('{content[\\s]*=[\\s]*\"(.*?)\"}s', $plain_og_matches[0],$matches);\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t$og_ttl = $matches[1];\n\t\t\t\t\t\n\t\t\t\t\t\techo '<br>og:title:'. html_entity_decode( htmlspecialchars_decode($og_ttl));\n\t\t\t\t\t\t \n\t\t\t\t\t\tif(trim($og_ttl) !=''){\n\t\t\t\t\t\t\t$og_ttl = htmlspecialchars_decode($og_ttl,ENT_QUOTES);\n\t\t\t\t\t\t\t$res ['title'] = html_entity_decode( $og_ttl) ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}// If og:title\n\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t// custom extraction method\n\t\t\t\t\t$cg_ml_ttl_method = $camp_general['cg_ml_ttl_method'];\n\t\t\t\t\t\n\t\t\t\t\trequire_once 'inc/class.dom.php';\n\t\t\t\t\t$wpAutomaticDom = new wpAutomaticDom($original_cont);\n\t\t\t\t\t\n\t\t\t\t\t$finalContent = '';\n\t\t\t\t\t\n\t\t\t\t\tif ($cg_ml_ttl_method == 'visual') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cg_ml_visual = $camp_general ['cg_ml_visual'];\n\t\t\t\t\t\t$path = isset ( $cg_ml_visual [0] ) ? $cg_ml_visual [0] : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (trim ( $path ) == '') {\n\t\t\t\t\t\t\techo '<br>No path found for pagination, please set the extraction rule for pagination if you want to make use of pagination.';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $cg_ml_visual as $xpath ) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\techo '<br>Getting link for XPath:' . $path;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$finalContent = $wpAutomaticDom->getContentByXPath ( $xpath, false );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (is_array ( $finalContent ))\n\t\t\t\t\t\t\t\t\t$finalContent = implode ( '', $finalContent );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<-- ' . strlen ( $finalContent ) . ' chars';\n\t\t\t\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\t\t\t\techo '<br>Error:' . $e->getMessage ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($cg_ml_ttl_method == 'css') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cg_ml_css_type = $camp_general ['cg_ml_css_type'];\n\t\t\t\t\t\t$cg_ml_css = $camp_general ['cg_ml_css'];\n\t\t\t\t\t\t$cg_ml_css_wrap = $camp_general ['cg_ml_css_wrap'];\n\t\t\t\t\t\t$cg_ml_css_size = $camp_general ['cg_ml_css_size'];\n\t\t\t\t\t\t$finalContent = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $cg_ml_css_type as $singleType ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($cg_ml_css_wrap [$i] == 'inner') {\n\t\t\t\t\t\t\t\t$inner = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$inner = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<br>Extracting content by ' . $cg_ml_css_type [$i] . ' : ' . $cg_ml_css [$i];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($cg_ml_css_type [$i] == 'class') {\n\t\t\t\t\t\t\t\t$content = $wpAutomaticDom->getContentByClass ( $cg_ml_css [$i], $inner );\n\t\t\t\t\t\t\t} elseif ($cg_ml_css_type [$i] == 'id') {\n\t\t\t\t\t\t\t\t$content = $wpAutomaticDom->getContentByID ( $cg_ml_css [$i], $inner );\n\t\t\t\t\t\t\t} elseif ($cg_ml_css_type [$i] == 'xpath') {\n\t\t\t\t\t\t\t\t$content = $wpAutomaticDom->getContentByXPath ( stripslashes ( $cg_ml_css [$i] ), $inner );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (is_array ( $content )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($cg_ml_css_size [$i] == 'single') {\n\t\t\t\t\t\t\t\t\t$content = $content [0];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$content = implode ( \"\\n\", $content );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$finalContent .= $content . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<-- ' . strlen ( $content ) . ' chars';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i ++;\n\t\t\t\t\t\t} // foreach rule\n\t\t\t\t\t} elseif ($cg_ml_ttl_method == 'regex') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cg_ml_regex = $camp_general ['cg_ml_regex'];\n\t\t\t\t\t\t$finalContent = '';\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $cg_ml_regex as $cg_ml_regex_s ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<br>Extracting content by REGEX : ' . htmlentities ( stripslashes ( $cg_ml_regex_s ) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$content = $wpAutomaticDom->getContentByRegex ( stripslashes ( $cg_ml_regex_s ) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$content = implode ( $content );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<-- ' . strlen ( $content ) . ' chars';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (trim ( $content ) != '') {\n\t\t\t\t\t\t\t\t$finalContent .= $content . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$possibleTitle = '';\n\t\t\t\tif(trim($finalContent) != ''){\n\t\t\t\t\t$possibleTitle = strip_tags($finalContent);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(trim($possibleTitle) != ''){\n\t\t\t\t\t$res ['original_title'] = html_entity_decode( $possibleTitle , ENT_QUOTES | ENT_HTML401);\n\t\t\t\t\t$res ['title'] = html_entity_decode($possibleTitle , ENT_QUOTES | ENT_HTML401) ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t \n\t\t\treturn $res;\n\t\t}\n\n\t}else{\n\n\t\t//duplicated link\n\t\t echo ' <-- duplicate in post <a href=\"'. admin_url('post.php?post='.$this->duplicate_id.'&action=edit') .'\">#'.$this->duplicate_id.'</a>';\n\n\t}\n\tendforeach\n\t;\n\n\t echo '<br>End of feed items reached.';\n\t\n\t if(isset($camp->camp_sub_type) && $camp->camp_sub_type == 'Multi'){\n\t \t\n\t \tdelete_post_meta ( $camp->camp_id, 'wp_automatic_cache' );\n\t \t\n\t }else{\n\t \t\n\t \t// Set isItemsEndReached flag to yes\n\t \tupdate_post_meta($camp->camp_id,$feedMd5.'_isItemsEndReached' , 'yes' );\n\t }\n\t \n\t \n\t \n\t \n}", "function fsf_port_getAuthorsCleanURL()\n {\n global $fsfcms_api_url;\n\n $fsf_api_file = \"fsf.port.getAuthorsCleanURL.php\";\n $fsf_api_options = \"\"; \n $fsf_port_getAuthorsCleanURL_content = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n \n return $fsf_port_getAuthorsCleanURL_content; \n }", "function textToUrl($string) {\n //first replace % to %25\n $char = \"%\";\n $replace = \"$25\";\n $string = str_replace($char, $replace, $string);\n\n\n $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%23', '%5B', '%5D', '%20');\n $replacements = array('!', '*', \"'\", \"(\", \")\", \";\", \":\", \"@\", \"&\", \"=\", \"+\", \"$\", \",\", \"/\", \"?\", \"#\", \"[\", \"]\", \" \");\n return str_replace($replacements, $entities, urlencode($string));\n }", "public function autoLinkify($str)\n {\n return preg_replace_callback('/(?i)\\b((?:((?:ht|f)tps?:(?:\\/{1,3}|[a-z0-9%]))|[a-z0-9.\\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\\/)(?:[^\\s()<>{}\\[\\]]+|\\([^\\s()]*?\\([^\\s()]+\\)[^\\s()]*?\\)|\\([^\\s]+?\\))+(?:\\([^\\s()]*?\\([^\\s()]+\\)[^\\s()]*?\\)|\\([^\\s]+?\\)|[^\\s`!()\\[\\]{};:\\'\".,<>?«»“”‘’])|(?:(?<!@)[a-z0-9]+(?:[.\\-][a-z0-9]+)*[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\\b\\/?(?!@)))/i', \"self::processLinkify\", $str);\n }", "public function removeUrlsFromReferences()\n {\n foreach ($this->findAll() as $doc) {\n $ref = $doc->getReference();\n if (strpos($ref, 'http://esmeree.fr')) {\n $ref = preg_replace('#'.preg_quote('http://esmeree.fr', '#').'[^\\s]+#', '', $ref);\n $doc->setReference($ref);\n }\n }\n }", "function extract_hotlinks($content) {\n\n\n\n\t}", "function phpTrafficA_cleanTextBasic($text) {\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "public function sanitizeFreeText()\n {\n if ($this->locations) {\n foreach ($this->locations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->virtualLocations) {\n foreach ($this->virtualLocations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->links) {\n foreach ($this->links as $id => $lin) {\n $lin->sanitizeFreeText();\n }\n }\n if ($this->recurrenceOverrides) {\n foreach ($this->recurrenceOverrides as $id => $rec) {\n $rec->sanitizeFreeText();\n }\n }\n\n $this->title = AdapterUtil::reencode($this->title);\n $this->description = AdapterUtil::reencode($this->description);\n $this->keywords = AdapterUtil::reencode($this->keywords);\n }", "static public function parseURL($text)\n\t{\n\t $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n\n\t // trim\n\t $text = trim($text, '-');\n\n\t // transliterate\n\t $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n\n\t // lowercase\n\t $text = strtolower($text);\n\n\t // remove unwanted characters\n\t $text = preg_replace('~[^-\\w]+~', '', $text);\n\n\t if (empty($text))\n\t {\n\t\treturn 'n-a';\n\t }\n\n\t return $text;\n\t}", "function string_process_cvs_link( $p_string, $p_include_anchor = true ) {\n\t\t\tif ( config_is_set('cvs_web') ) {\n\t\t\t\t$t_cvs_web = config_get( 'cvs_web' );\t\t\t\t\n\n\t\t\t\tif( $p_include_anchor ) {\n\t\t\t\t\t$t_replace_with = '[CVS] <a href=\"' . $t_cvs_web . '\\\\1?rev=\\\\4\" target=\"_new\">\\\\1</a>\\\\5';\n\t\t\t\t} else {\n\t\t\t\t\t$t_replace_with = '[CVS] ' . $t_cvs_web . '\\\\1?rev=\\\\4\\\\5';\n\t\t\t\t}\n\n\t\t\t\treturn preg_replace( '/cvs:([^\\.\\s:,\\?!<]+(\\.[^\\.\\s:,\\?!<]+)*)(:)?(\\d\\.[\\d\\.]+)?([\\W\\s])?/i', $t_replace_with, $p_string );\t\t\t\t\n\t\t\t} else {\n\t\t\t\treturn $p_string;\n\t\t\t}\n\t\t}", "function esc_url( $url, $protocols = null, $_context = 'display' ) {\n\t$original_url = $url;\n\n\tif ( '' == $url )\n\t\treturn $url;\n\t$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n\t$strip = array('%0d', '%0a', '%0D', '%0A');\n\t$url = _deep_replace($strip, $url);\n\t$url = str_replace(';//', '://', $url);\n\t/* If the URL doesn't appear to contain a scheme, we\n\t * presume it needs http:// appended (unless a relative\n\t * link starting with /, # or ? or a php file).\n\t */\n\tif ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&\n\t\t! preg_match('/^[a-z0-9-]+?\\.php/i', $url) )\n\t\t$url = 'http://' . $url;\n\n\t// Replace ampersands and single quotes only when displaying.\n\tif ( 'display' == $_context ) {\n\t\t$url = wp_kses_normalize_entities( $url );\n\t\t$url = str_replace( '&amp;', '&#038;', $url );\n\t\t$url = str_replace( \"'\", '&#039;', $url );\n\t}\n\n\tif ( '/' === $url[0] ) {\n\t\t$good_protocol_url = $url;\n\t} else {\n\t\tif ( ! is_array( $protocols ) )\n\t\t\t$protocols = wp_allowed_protocols();\n\t\t$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );\n\t\tif ( strtolower( $good_protocol_url ) != strtolower( $url ) )\n\t\t\treturn '';\n\t}\n\n\t/**\n\t * Filter a string cleaned and escaped for output as a URL.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $good_protocol_url The cleaned URL to be returned.\n\t * @param string $original_url The URL prior to cleaning.\n\t * @param string $_context If 'display', replace ampersands and single quotes only.\n\t */\n\treturn apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );\n}", "function phpTrafficA_cleanText($text) {\n$text = str_replace(\"&\", \"&amp;\", $text);\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "public static function texturize($text) {\n\t\t$next = true;\n\t\t$output = '';\n\t\t$curl = '';\n\t\t$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t$stop = count($textarr);\n\t\n\t\t$static_characters = array_merge(array('---', ' -- ', '--', 'xn&#8211;', '...', '``', '\\'s', '\\'\\'', ' (tm)'), $cockney); \n\t\t$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', 'xn--', '&#8230;', '&#8220;', '&#8217;s', '&#8221;', ' &#8482;'), $cockneyreplace);\n\t\n\t\t$dynamic_characters = array('/\\'(\\d\\d(?:&#8217;|\\')?s)/', '/(\\s|\\A|\")\\'/', '/(\\d+)\"/', '/(\\d+)\\'/', '/(\\S)\\'([^\\'\\s])/', '/(\\s|\\A)\"(?!\\s)/', '/\"(\\s|\\S|\\Z)/', '/\\'([\\s.]|\\Z)/', '/(\\d+)x(\\d+)/');\n\t\t$dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1&#8220;$2', '&#8221;$1', '&#8217;$1', '$1&#215;$2');\n\t\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$curl = $textarr[$i];\n\t\n\t\t\tif (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag\n\t\t\t\t// static strings\n\t\t\t\t$curl = str_replace($static_characters, $static_replacements, $curl);\n\t\t\t\t// regular expressions\n\t\t\t\t$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);\n\t\t\t} elseif (strpos($curl, '<code') !== false || strpos($curl, '<pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) {\n\t\t\t\t$next = false;\n\t\t\t} else {\n\t\t\t\t$next = true;\n\t\t\t}\n\t\n\t\t\t$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);\n\t\t\t$output .= $curl;\n\t\t}\n\t\n\t\treturn $output;\n\t}", "function postlink($text){\n\t\t\t\n\t\t$listlink=array();\n\t\t//die('a '.count($listlink));\n\t\t$text1=' '.str_replace('<br/>',' <br/> ',str_replace('<br />',' <br /> ',$text)).' ';\n\t\t//die($text1);\n\t\tif (stristr($text1,' http://www.')){$listlink[]=' http://www.';\t\t}\n\t\tif (stristr($text1,' https://www.')){$listlink[]=' https://www.';\t\t}\n\t\tif (stristr($text1,' www.')){$listlink[]=' www.';\t\t}\n\t\tif (stristr($text1,' http://')){$listlink[]=' http://';\t\t}\n\t\tif (stristr($text1,' ftp://')){$listlink[]=' ftp://';\t\t}\n\t\tif (stristr($text1,' https://')){$listlink[]=' https://';\t\t}\t\n\t\t\n\t\tfor($i=0;$i<count($listlink);$i++){\n\t\t$linkstart=$listlink[$i];\n\t\t\n\t\tif (stristr($text1,$linkstart)){$textlinker=stristr($text1,$linkstart);\t\t} else{$textlinker=\"\";\t}\n\t\t\n\t\t\t$postholder=str_replace($textlinker,'',$text1);\t\n\n\t\t\twhile ($textlinker!=\"\"){\n\t\t\t$picklink=' '.strtok($textlinker,' ');\n\t\t\t//die($picklink);\n\t\t\t$postholder=$postholder.' '.'<a title=\"Visit link\" target=\"_blank\" href=\"'.trim(str_replace('ftp://http://','ftp://',str_replace('https://http://','http://',str_replace('http://http://','http://',str_replace('www.','http://',strtolower($picklink)))))).'\"><span style=\"word-break:break-all\">'.trim($picklink).'</span></a>';\n\t\t\t$textlinker=str_replace($picklink,'',$textlinker);\n\t\t\t//die($textlinker);\n\t\t\tif (stristr($textlinker,$linkstart)){$postholder=$postholder.' '.str_replace(stristr($textlinker,$linkstart),'',$textlinker);\t$textlinker=stristr($textlinker,$linkstart); \t\t} else{$postholder=$postholder.' '.$textlinker;\t$textlinker=\"\";\t}\n\n\t\t\t\t\t}\t\t\n\t\t\t\t\t$text1=$postholder;\n\t\t\t\t}\n\t\t\t\t\treturn($text1);\n\t\t\t}", "public function filter_fm_presave_alter_values_validate_social_urls( $values, $obj ) {\n if ( 'Fieldmanager_Link' !== get_class( $obj ) && 'Fieldmanager_TextField' !== get_class( $obj ) ) {\n return $values;\n }\n $whitelisted_labels = [\n 'Twitter URL',\n 'Instagram URL',\n 'LinkedIn URL',\n ];\n if ( ! isset( $obj->label ) || ! in_array( $obj->label, $whitelisted_labels ) ) {\n return $values;\n }\n\n if ( ! is_array( $values ) || empty( $values[0] ) ) {\n return $values;\n }\n $value = $values[0];\n\n // Strip @ symbols like @username\n $value = trim( $value, '@' );\n\n // Make sure the URL is https\n $value = str_ireplace( 'http:', 'https:', $value );\n\n // Remove any query parameters from the URL\n $parts = explode( '?', $value );\n $value = $parts[0];\n\n switch ( $obj->label ) {\n case 'Twitter URL':\n if ( 'twitter' != Utils::get_service_name_from_url( $value ) ) {\n $value = 'https://twitter.com/' . $value;\n }\n $value = untrailingslashit( $value );\n break;\n\n case 'Instagram URL':\n if ( 'instagram' != Utils::get_service_name_from_url( $value ) ) {\n $value = 'https://www.instagram.com/' . $value;\n }\n $value = trailingslashit( $value );\n break;\n\n case 'LinkedIn URL':\n if ( 'linkedin' != Utils::get_service_name_from_url( $value ) ) {\n $value = 'https://www.linkedin.com/in/' . $value;\n }\n break;\n }\n\n // Replace our sanitized $value\n $values[0] = $value;\n return $values;\n }", "function formlit($f, $url = true)\n{\n $suchmuster = \"/<llink:(.\\d+)>/\";\n $tref = preg_match_all($suchmuster, $f['in'], $treffer);\n for ($i = 0; $i < count($treffer[0]); $i++) {\n $id = $treffer[1][$i];\n $li = getlit($id);\n $f['in'] = $li['text'];\n }\n\n\n $text = $f['verfasser_vorname'];\n if ($text != '') $text = ', ' . $text;\n $hg = '';\n if ($f['code'] == 'H') $hg = ' (Hg.)';\n if ($f['verfasser_name']) $text = $f['verfasser_name'] . $text . $hg . ': ';\n if ($f['titel']) $text .= $f['titel'] . ', ';\n\n if ($f['in']) $text .= 'in: ' . $f['in'] . ', ';\n if ($f['ort']) {\n if ($f['verlag']) {\n $text .= $f['ort'] . ', ';\n } else {\n $text .= $f['ort'] . ' ';\n }\n }\n if ($f['verlag']) $text .= $f['verlag'] . ' ';\n if ($f['code'] == 'T') {\n if ($f['nummer']) $text .= $f['nummer'] . ' ';\n if ($f['jahr']) $text .= $f['jahr'];\n } else {\n if ($f['jahr']) $text .= $f['jahr'];\n if ($f['nummer']) $text .= ', ' . $f['nummer'];\n }\n\n if ($f['code'] == 'U' and $url) {\n if ($text[strlen($text) - 1] != ' ') $text .= ', ';\n $f['url'] = preg_replace(\"/http:\\/\\/(.*)/\", \"<a href=\\\"http://\\$1\\\" target=\\\"_new\\\">\\$1</a> \", $f['url']);\n $text .= $f['url'];\n }\n\n if ($f['seite']) {\n if ($text[strlen($text) - 1] != ' ') $text .= ', ';\n $text .= $f['seite'];\n }\n if ($text[strlen($text) - 1] != '.') $text .= '.';\n $f['text'] = clean_entry($text);\n return ($f);\n}", "function build_edit_textarea_urllist($name, $urllist)\n{\n\t$url_s = $this->build_edit_url($urllist);\n\t$text = $this->build_html_textarea($name, $url_s);\n\treturn $text;\n}", "function cms_url_decode_post_process($url_part)\n{\n if ((strpos($url_part, ':') !== false) && (can_try_url_schemes())) {\n $url_part = str_replace(array(':uhash:', ':amp:', ':slash:'), array('#', '&', '/'), $url_part);\n //$url_part = str_replace('(colon)', ':', $url_part);\n }\n return $url_part;\n}", "function mediaUrls($tweet, $txt){\n\t\tif(isset($tweet->entities->media) && $c = count($tweet->entities->media) > 0):\n\t\t\tfor($i=0; $i < $c; $i++){\n\t\t\t\t$shortened_url = $tweet->entities->media[$i]->url;\n\t\t\t\t$expanded_url = '<a class=\"entity\" href=\"http://'.$tweet->entities->media[$i]->display_url.'\">'.$tweet->entities->media[$i]->display_url.'</a>';\n\t\t\t\t// $expanded_url = '';\n\t\t\t\t$txt = str_replace($shortened_url, $expanded_url, $txt);\n\t\t\t}\n\t\tendif;\n\n\t\treturn $txt;\n\t}", "function smcf_filter($value) {\r\n\t$pattern = array(\"/\\n/\",\"/\\r/\",\"/content-type:/i\",\"/to:/i\", \"/from:/i\", \"/cc:/i\");\r\n\t$value = preg_replace($pattern, \"\", $value);\r\n\treturn $value;\r\n}", "function wp_extract_urls($content)\n {\n }", "function auto_link_text($text)\n{\n $pattern = '#\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))#';\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a rel=\"nofollow\" target=\"_blank\" href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "function modificar_url($url) {\n\t\t$find = array(' ');\n\t\t$repl = array('-');\n\t\t$url = str_replace ($find, $repl, $url);\n\t\t$find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n\t\t$repl = array('a', 'e', 'i', 'o', 'u', 'n');\n\t\t$url = str_replace ($find, $repl, utf8_encode($url));\n\t\t//utf8_decode();\n\t\t// Añaadimos los guiones\n\t\t$find = array(' ', '&', '\\r\\n', '\\n', '+');\n\t\t$url = str_replace ($find, '-', $url);\n\t\t\n\t\t// Eliminamos y Reemplazamos demás caracteres especiales\n\t\t$find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n\t\t$repl = array('', '_', '');\n\t\t$url = preg_replace ($find, $repl, $url);\n\t\tucwords($url);\n\t\n\treturn $url;\n\t}", "function regexmakeinternallink($text){\n\tsetlocale(LC_ALL, 'en_US.UTF8');\n\t$text = str_replace (\"ø\", \"oe\", $text);\n\n\t$text = iconv('UTF-8', 'ASCII//TRANSLIT', $text);\n\t\t//this doesn't work with the following characters\n\t\t\t//dotless i\n\t\t\t//tried to do the dotless i above, but had some problems\n\t\n\t//get rid of any urlencoding\n\t$text=urldecode($text);\n\n\t//replace spaces with underscores and make the string all lowercase\n\t$text=strtolower(str_replace(\" \", \"_\", $text));\n\t\n\t//take the text and get rid of everything but letters, numbers, underscores, and dashes\n\t$regex_pattern=\"/[^\\w-]+/\";\n\t$text=preg_replace($regex_pattern,'',$text);\n\n\t//replace repeated underscores with a single underscore\n\t$regex_pattern=\"/_{2,}/\";\n\t$text=preg_replace($regex_pattern,'_',$text);\n\t\n\t//replace any occurances of dashes surrounded by underscores with just the dash\t\n\t$regex_pattern=\"/_?-_?/\";\n\t$text=preg_replace($regex_pattern,'-',$text);\n\t\n\t//delete underscores and dashes at the beginning and ends of the string\n\t$regex_pattern=\"/^[-_]+|[-_]+$/\";\n\t$text=preg_replace($regex_pattern,'',$text);\n\t\n\tif($text==''){//if the text is a blank present a generic title \n\t\t$currenttime=time();\n\t\t$text=\"collabor8r_story_$currenttime\";\t\n\t}\n\t\n\t$text=regexmakelinkunique($text);\t\n\treturn $text;\n}", "function tnsl_fCleanLinks(&$getNextGen) {\r\n\t$getNextGen = preg_replace('(&(?!([a-zA-Z]{2,6}|[0-9\\#]{1,6})[\\;]))', '&amp;', $getNextGen);\r\n\t$getNextGen = str_replace(array(\r\n\t\t'&amp;&amp;',\r\n\t\t'&amp;middot;',\r\n\t\t'&amp;nbsp;',\r\n\t\t'&amp;#'\r\n\t), array(\r\n\t\t'&&',\r\n\t\t'&middot;',\r\n\t\t'&nbsp;',\r\n\t\t'&#'\r\n\t), $getNextGen);\r\n\t// montego - following code is required to allow the new RNYA AJAX validations to work properly\r\n\t$getNextGen = preg_replace('/rnxhr.php\\?name=Your_Account&amp;file/', 'rnxhr.php\\?name=Your_Account&file', $getNextGen );\r\n\treturn;\r\n}", "public function format_text( $text ) {\r\n\t\t$text = $this->format_text_to_links( $text );\r\n\t\t$text = $this->format_text_to_twitter( $text );\r\n\t\t\r\n\t\treturn $text;\r\n\t}", "function urlsTolinks($text) {\r\n\t\r\n\t\t// Make long URLs into links\r\n\t\t// Regexp improved by Bruce.\r\n\t\t$linked_text = eregi_replace(\"([[:space:].,\\(\\[])([[:alnum:]]{3,})://([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\",\r\n\t\t\t\t\t\t \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"newpage\\\">\\\\2://\\\\3\\\\4</a>\", $text);\r\n\r\n\t // Make short urls into links\r\n\t\t$linked_text = eregi_replace(\"([[:space:],\\(\\[])www\\.([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\", \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"newpage\\\">www.\\\\2\\\\3</a>\", $linked_text);\r\n\t\t\t\t\t\t \r\n\t\treturn $linked_text;\r\n\t\t\t\t\t\t \r\n\t\t\t\r\n\t}", "function esc_url_raw($url, $protocols = \\null)\n {\n }", "function convertURL($url)\n{\n\tif((substr_count($url, 'https://') > 0) or (substr_count($url, 'http://') > 0))\t{ $url = $url; }\n\telse { $url = 'http://'.$url; }\n\treturn($url);\n}", "private function replaceURLsCallback($matches) {\n\n preg_match('/(http[s]?)?:\\/\\/([^\\/]+)(.*)?/', $matches[2], $url_matches);\n\n $replacement = $matches[0];\n\n if (!empty($url_matches[0])) {\n\n switch (drupal_strtoupper($this->https)) {\n case 'TO':\n $scheme = 'https';\n break;\n case 'FROM':\n $scheme = 'http';\n break;\n default:\n $scheme = $url_matches[1];\n break;\n }\n\n foreach($this->from_urls as $from_url) {\n\n $match_url = $url_matches[1] . '://' . $url_matches[2];\n\n if ($from_url == $match_url) {\n if (!$this->relative) {\n $replacement = $matches[1] . '=\"' . $scheme . '://';\n $replacement .= $this->toValue . $url_matches[3] . '\"';\n }\n else {\n $replacement = $matches[1] . '=\"' . $url_matches[3] . '\"';\n }\n break;\n }\n\n }\n\n }\n\n if ($replacement !== $matches[0]) {\n\n $this->debug && drush_print(\n t(\n 'URL: !from => !to',\n array(\n '!from' => $matches[0],\n '!to' => $replacement,\n )\n )\n );\n\n }\n\n return $replacement;\n\n }", "function multi_file_url_callback($source, $item_key, $element_key, &$field, $settings) {\n if (!is_array($field)) {\n $field = array($field);\n }\n $out = array();\n foreach ($field as $f) {\n \t$out_tmp = preg_split(\"/http/\", $f, -1, PREG_SPLIT_NO_EMPTY);\n if(count($out_tmp)>0) {\n \t$out_tmp = \"http\".implode(\";http\",$out_tmp);\n $out_tmp = explode(\";\", $out_tmp);\n $out = array_merge($out, $out_tmp);\n }\n }\n $field = $out;\n}", "function hyperlink($text) {\n\n\n $regex = \"/(?#WebOrIP)((?#protocol)((http|https):\\/\\/)?(?#subDomain)(([a-zA-Z0-9]+\\.(?#domain)[a-zA-Z0-9\\-]+(?#TLD)(\\.[a-zA-Z]+){1,2})|(?#IPAddress)((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\\/((?#dirOrFileName)[a-zA-Z0-9_\\-\\%\\~\\+]+)?)*)?(?#extension)(\\.([a-zA-Z0-9_]+))?(?#parameters)(\\?([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?(?#additionalParameters)(\\&([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?)*)?/\";\n $text = preg_replace( $regex, \"<a href=\\\"http://$4\\\" style=\\\"font-weight: bold;\\\" target='_new'>$1</a>\", $text );\n\n/*\n // match protocol://address/path/\n $text = ereg_replace(\"[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $text);\n\n // match www.something\n $text = ereg_replace(\"(^| )(www([.]?[a-zA-Z0-9_/-])*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n*/\n return $text;\n }", "function processWikitext($wikilang, $text, $makelinks) {\r\n $result = $text;\r\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\r\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\r\n $wikiUrl = 'http://' . $wikilang . '.wikipedia.org/wiki/';\r\n $differentLinkReplace = \"'<a href=\\\"\" . $wikiUrl .\"' . rawurlencode('$1') . '\\\">$2</a>'\";\r\n $simpleLinkReplace = \"'<a href=\\\"\". $wikiUrl .\"' . rawurlencode('$1') . '\\\">$1</a>'\";\r\n if ( $makelinks ) {\r\n $result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\r\n $result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\r\n $result = $result;\r\n } else {\r\n $result = preg_replace($differentLinkRegex, \"$2\", $result);\r\n $result = preg_replace($simpleLinkRegex, \"$1\", $result);\r\n }\r\n return $result;\r\n}", "function auto_link_text($text) {\n\t// Pattern from http://daringfireball.net/2010/07/improved_regex_for_matching_urls\n $pattern = \"#(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))#\";\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "public function wt_parse_download_file_field($value) {\n // Absolute file paths.\n if (0 === strpos($value, 'http')) {\n return esc_url_raw($value);\n }\n // Relative and shortcode paths.\n return wc_clean($value);\n }", "function parseLinksOld($text)\n{\n\t// ADD LINE BREAKS\n\t$text = nl2br($text);\n\t\n\t/*\n\tthe counting method doesn't work - if there is, for example, a case with 1 instance of plain www and 3 instances of https://www,\n\tthen the count is < 0 and the www will not get replaced\n\t*/\n\t// COUNT THE NUMBER OF OCCURRENCES OF \"WWW\" WITHOUT A PRECEEDING \"HTTP\"\n\t$numWWW \t= substr_count ( $text, 'www.' );\n\t$numHTTPWWW = substr_count ( $text, '://www.' );\n\t$numHTTPSWWW = substr_count($text, 'https://www');\n\t$w = $numWWW - $numHTTPWWW - $numHTTPSWWW;\n\n\t// REPLACE ALL INSTANCES OF \"WWW\" WITH \"HTTP://WWW\" SO THAT PARSING FUNCTION WILL HANDLE ALL CASES\n\tif ($w > 0) { $text = str_replace ( 'www', 'http://www', $text, $w ); }\n\t\n\t// BEGIN PARSING\n\t$needle = 'http';\n\t$needleLength = strlen($needle);\n\t$needleCount = substr_count ( $text, $needle );\n\t\n\t// DECLARE ARRAYS FOR THE LINKS\n\t$needles = array();\n\t$tags = array();\n\t$hyperlinks = array();\n\n\t// LOOP THROUGH ALL LINKS AND PARSE THEM\n\tfor ( $i = 0; $i < $needleCount; $i++ )\n\t{\n\t\t// DETERMINE START POS OF LINK\n\t\t$needleStart = strpos($text, $needle, $needleStart + $needleLength );\n\n\t\t// DETERMINE ENDPOINT OF LINK - EITHER A SPACE OR LINE BREAK\n\t\t$distSpace \t= abs(stripos($text, ' ', $needleStart) - $needleStart); \n\t\t$distNL \t= abs(stripos($text, \"\\n\", $needleStart) - $needleStart); \n\t\t$distBR\t\t= abs(stripos($text, '<br>', $needleStart) - $needleStart);\n\t\tif ($distSpace <= $distNL) { $needleLength = $distSpace; } else { $needleLength = $distNL; } $needleLength += 0;\n\n\t\t// PARSE OUT THE LINK FROM BETWEEN THE START POS AND ENDPOINT\n\t\t$needleParsed = substr($text, $needleStart, $needleLength);\n\t\t$needleUntrimmed = $needleParsed;\n\n\t\t// TRIM EXTRA CHARACTERS ( periods or parentheses or <br> tags from end of string )\n\t\t$needleTrim1 = substr($needleParsed, 0, strlen($needleParsed)-1);\n\t\t$needleTrim2 = substr($needleParsed, 0, strlen($needleParsed)-2);\n\n\t\t$lastChar \t\t= substr($needleParsed, -1);\n\t\t$secondLastChar = substr($needleParsed, -2, 1);\n\n\t\tif ($lastChar == '.' or $lastChar == ',' or $lastChar == ')') \t\t\t\t\t\t{ $needleParsed = $needleTrim1; }\n\t\tif ($secondLastChar == '.' or $secondLastChar == ',' or $secondLastChar == ')') \t{ $needleParsed = $needleTrim2; }\n\n\t\t$needleTrimBR \t= substr($needleParsed, 0, strlen($needleParsed)-3);\n\t\tif ( substr_count ( $needleParsed, '<br') > 0 )\t\t\t\t\t\t\t\t\t\t{ $needleParsed = $needleTrimBR; }\n\n\t\t// THE LINK SHOULD NOW BE PROPERLY PARSED\t\n\n\t\t// CONSTRUCT THE <a> TAG\n\t\t$needleTag = '<a href = \"'.$needleParsed.'\" target = \"_blank\">'.$needleParsed.'</a>'; \n\t\t// COULD EVENTUALLY DEFINE A VALUE FOR HREF AND DISPLAY TEXT SEPARATELY?\n\n\t\t// UPDATE THE LINK ARRAYS\n\t\t$needles[$i] = $needleParsed;\n\t\t$tags[$i] = $needleTag;\n\t\t$hyperlinks[$i] = array($needleParsed, $needleTag);\n\t\t\n\t} // END FOR LOOP\n\n\t// REPLACE THE LINK TEXT WITH THE <a> TAGS (USING THE ARRAYS AS PARAMS IN THE STR REPLACE FUNCTION)\n\t$parsed = str_replace($needles, $tags, $text);\n\treturn $parsed;\n\n}", "private function formatContent($content){\n $hashtags = $this->extractHashTags($content);\n $direction = \"/org/afpa/CAKEPHP/Twiffer/tweets/index/\";\n foreach($hashtags[0] as $key => $hashtag){\n $replace = '<a href=\"'.$direction.$hashtags[1][$key].'\">'.$hashtag.'</a>';\n $content = str_replace($hashtag, $replace, $content);\n }\n return $content;\n }", "function normalizeContent($content,$client){\n\t\n}", "public function format_text_to_twitter($text) {\r\n\t\tif( empty( $text ) ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t $text = preg_replace( \"/(^|\\s)@([a-z0-9_]+)/i\", '<a href=\"http://www.twitter.com/$2\" target=\"_blank\">&#64;$2</a>', $text );\r\n\t\t$text = preg_replace( \"/([^&]|^)\\#([a-z0-9_\\-]+)/\", ' <a href=\"http://search.twitter.com/search?q=$2\" target=\"_blank\">&#35;$2</a>', $text );\r\n\t\t\r\n\t\treturn $text;\r\n\t}", "function linkify_tweet($tweet) {\n\n //Convert urls to <a> links\n $tweet = preg_replace(\"/([\\w]+\\:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/\", \"<a target=\\\"_blank\\\" href=\\\"$1\\\">$1</a>\", $tweet);\n\n //Convert hashtags to twitter searches in <a> links\n $tweet = preg_replace(\"/#([A-Za-z0-9\\/\\.]*)/\", \"<a target=\\\"_new\\\" href=\\\"http://twitter.com/search?q=$1\\\">#$1</a>\", $tweet);\n\n //Convert attags to twitter profiles in <a> links\n $tweet = preg_replace(\"/@([A-Za-z0-9\\/\\.]*)/\", \"<a href=\\\"http://www.twitter.com/$1\\\">@$1</a>\", $tweet);\n\n return $tweet;\n\n}", "function mgl_instagram_format_link($str)\n{\n // Remove http:// and https:// from url\n $str = preg_replace('#^https?://#', '', $str);\n return $str;\n}", "function TwitterFilter($string)\n{\n$content_array = explode(\" \", $string);\n$output = '';\n\nforeach($content_array as $content)\n{\n//starts with http://\nif(substr($content, 0, 7) == \"http://\")\n$content = '<a href=\"' . $content . '\">' . $content . '</a>';\n\n//starts with www.\nif(substr($content, 0, 4) == \"www.\")\n$content = '<a href=\"http://' . $content . '\">' . $content . '</a>';\n\nif(substr($content, 0, 8) == \"https://\")\n$content = '<a href=\"' . $content . '\">' . $content . '</a>';\n\nif(substr($content, 0, 1) == \"#\")\n$content = '<a href=\"https://twitter.com/search?src=hash&q=' . $content . '\">' . $content . '</a>';\n\nif(substr($content, 0, 1) == \"@\")\n$content = '<a href=\"https://twitter.com/' . $content . '\">' . $content . '</a>';\n\n$output .= \" \" . $content;\n}\n\n$output = trim($output);\nreturn $output;\n}", "function modificar_url($url) {\n $find = array(' ');\n $repl = array('-');\n $url = str_replace ($find, $repl, $url);\n\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace ($find, $repl, utf8_encode($url));\n\n $find = array('0', '1', '2', '3', '4', '5','6', '7', '8', '9');\n $repl = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');\n $url = str_replace ($find, $repl, utf8_encode($url));\n //utf8_decode();\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace ($find, '-', $url);\n\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '_', '');\n $url = preg_replace ($find, $repl, $url);\n $url= strtolower($url);\n //ucwords($url);\n\n return $url;\n }", "function &zariliaCodeDecode( &$text, $allowimage = 2 ) {\n $patterns = array();\n $replacements = array();\n\n\t\t$patterns[] = \"/\\[siteurl=(['\\\"]?)([^\\\"'<>]*)\\\\1](.*)\\[\\/siteurl\\]/sU\";\n $replacements[] = '<a href=\"' . ZAR_URL . '/\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)(http[s]?:\\/\\/[^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)(ftp?:\\/\\/[^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)([^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"http://\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[color=(['\\\"]?)([a-zA-Z0-9]*)\\\\1](.*)\\[\\/color\\]/sU\";\n $replacements[] = '<span style=\"color: #\\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[size=(['\\\"]?)([a-z0-9-]*)\\\\1](.*)\\[\\/size\\]/sU\";\n $replacements[] = '<span style=\"font-size: \\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[font=(['\\\"]?)([^;<>\\*\\(\\)\\\"']*)\\\\1](.*)\\[\\/font\\]/sU\";\n $replacements[] = '<span style=\"font-family: \\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[email]([^;<>\\*\\(\\)\\\"']*)\\[\\/email\\]/sU\";\n $replacements[] = '<a href=\"mailto:\\\\1\">\\\\1</a>';\n $patterns[] = \"/\\[b](.*)\\[\\/b\\]/sU\";\n $replacements[] = '<b>\\\\1</b>';\n $patterns[] = \"/\\[i](.*)\\[\\/i\\]/sU\";\n $replacements[] = '<i>\\\\1</i>';\n $patterns[] = \"/\\[u](.*)\\[\\/u\\]/sU\";\n $replacements[] = '<u>\\\\1</u>';\n $patterns[] = \"/\\[d](.*)\\[\\/d\\]/sU\";\n $replacements[] = '<del>\\\\1</del>';\n $patterns[] = \"/\\[object](.*)\\[\\/object\\]/s\";\n $replacements[] = '<b>\\\\1</b>';\n $patterns[] = \"/\\[media]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/media\\]/sU\";\n $replacements[] = '<a href=\"\\\\1\" target=\"_blank\">Play Item</a>';\n $patterns[] = \"/\\[img capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n $replacements[] = '<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table>';\n break;\n case 2:\n $replacements[] = '<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table>';\n break;\n } // switch\n\n\t\t$patterns[] = \"/\\[imgc capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/imgc\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n\t\t\t\t$replacements[] = '<div align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table></div>';\n break;\n case 2:\n $replacements[] = '<div align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table></div>';\n break;\n } // switch\n /*\n\t\t*\n\t\t*/\n $patterns[] = \"/\\[imgr capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/imgr\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n $replacements[] = '<table align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table>';\n break;\n case 2:\n $replacements[] = '<table align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table>';\n break;\n } // switch\n\n\n $patterns[] = \"/\\[img align=(['\\\"]?)(left|center|right)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img align=(['\\\"]?)(left|center|right)\\\\1 id=(['\\\"]?)([0-9]*)\\\\3]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img id=(['\\\"]?)([0-9]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n if ( $allowimage != 1 ) {\n $replacements[] = '<a href=\"\\\\3\" target=\"_blank\">\\\\3</a>';\n $replacements[] = '<a href=\"\\\\1\" target=\"_blank\">\\\\1</a>';\n $replacements[] = '<a href=\"' . ZAR_URL . '/image.php?id=\\\\4\" target=\"_blank\">\\\\4</a>';\n $replacements[] = '<a href=\"' . ZAR_URL . '/image.php?id=\\\\2\" target=\"_blank\">\\\\3</a>';\n } else {\n $replacements[] = '<img src=\"\\\\3\" align=\"\\\\2\" alt=\"\" />';\n $replacements[] = '<img src=\"\\\\1\" alt=\"\" />';\n $replacements[] = '<img src=\"' . ZAR_URL . '/image.php?id=\\\\4\" align=\"\\\\2\" alt=\"\\\\4\" />';\n $replacements[] = '<img src=\"' . ZAR_URL . '/image.php?id=\\\\2\" alt=\"\\\\3\" />';\n }\n\n\t\t$patterns[] = \"/\\[quote]/sU\";\n $replacements[] = _QUOTEC . '<div class=\"zariliaQuote\"><blockquote>';\n $patterns[] = \"/\\[\\/quote]/sU\";\n $replacements[] = '</blockquote></div>';\n $patterns[] = \"/javascript:/si\";\n $replacements[] = \"java script:\";\n $patterns[] = \"/about:/si\";\n $replacements[] = \"about :\";\n\n \t$patterns[] = \"/\\[zariliauplurl]/sU\";\n $replacements[] = ZAR_UPLOAD_URL;\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }", "function url_decode($text)\n {\n return base64_decode(str_pad(strtr($text, '-_', '+/'), strlen($text) % 4, '=', STR_PAD_RIGHT));\n }", "static protected function bbcodeLinkParser($text, &$list)\n {\n $list['in'] = array_merge(\n $list['in'],\n array('`([^=\\]])((?:https?|ftp)://\\S+[[:alnum:]]/?)`si',\n\t '`([^=\\]])((?<!//)(www\\.\\S+[[:alnum:]]/?))`si',\n\t '`\\[url(?:\\=?)(.*?)\\](.*?)\\[/url\\]`is',\n\t '`\\[img(.*?)\\](.*?)\\[/img\\]`is',\n\t )); \n $list['out'] = array_merge(\n $list['out'],\n array('<a href=\"$2\">$2</a>',\n\t '<a href=\"http://$2\">$2</a>',\n\t '<a href=\"$1\">$2</a>',\n\t '<img $1 src=\"$2\" />',\n\t ));\n }", "function convertStringUrl($string){\n\n $wasteValue = [3];\n $url = parse_url($string);\n\n $scheme = $url['scheme'];\n $host = $url['host'];\n $path = $url['path'];\n\n $query = explode('&', $url['query']);\n\n $params = getFilteredArrayFromString($query, $wasteValue);\n\n //sort params by value\n asort($params);\n\n //add path parameter from input link to array\n $params['url'] = $path;\n\n //form get params as a string\n $paramsString = http_build_query($params);\n\n //form a valid url as a string\n $result = $scheme . '://' . $host . '/?' . $paramsString;\n\n return $result;\n\n}", "function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}", "function fct_decode_lien_url ($urlpage) {\nglobal $url_parlante;\n\t// recupere ligne de produits et criteres (separes par _)\n\t$pos = strpos($urlpage, \"_\");\n\tif ($pos === false) {\n\t\t$gauche = $urlpage;\n\t} else {\n\t\t$gauche= substr($urlpage,0,$pos);\n\t\t$droite = substr($urlpage,$pos+1);\n\t\tif (substr($droite,-5) == \".html\") $droite = substr($droite,0,-5);\n\t}\n\t// remplace libelles criteres par ref et code critere (ex: tho = 00801)\n\tif (isset($droite)) {\n\t\t$paramd = explode(\"_\", $droite);\n\t\tforeach ($paramd as $libelle) {\t\n//echo \"url\";print_r($libelle);\n\n\t\t\t$code_paire = array_search($libelle, $url_parlante);\n//echo \"code $code_paire - \";\n\t\t\tif ($code_paire === false) $code_paire = $libelle;\n\t\t\t$pos = strpos($code_paire,\"~\"); \n\t\t\t$couple = explode(\"~\",$code_paire);\n\t\t\t$_GET[$couple[0]] = $couple[1]; \n\t\t}\n\t}\n}", "function replacespecialcharsurl($str){\n\t\t$str=trim($str);\n\t\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t\t$str=ereg_replace(\"-\",\"\",$str);\n\t\t$str=ereg_replace('\"',\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"#\",\"\",$str);\n\t\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t\t$str=ereg_replace(\",\",\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"&\",\"\",$str);\n\t\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t\t$str=ereg_replace(\":\",\"\",$str);\n\t\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t\t$str=ereg_replace(\" \",\" \",$str);\n\t\t$str=ereg_replace(\" \",\"-\",$str);\n\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=strtolower($str);\n\t\treturn $str;\n}", "function makeHtmlUrls($text,$chr_limit = 30,$add = '...') {\n\t\t\n\t\t$end_firstpart = round(1/3*$chr_limit);\n\t\t$begin_secondpart = $chr_limit - $end_firstpart - strlen($add);\n\n\t\t/*\n\t\t\t* is greedy\t\t\t*? is lazy\n\t\t\t{2,} is greedy\t\t{2,}? is lazy\n\t\t*/\n\t\t\n\t\t// An url can be terminated by a dot, a whitespace, a tab, a linebreak, parenthesis, or the end of the string:\n\t\t$termination = '(\\.{2,}|\\. | |,|\\.<|<|\\n|\\.\\n|\\t|\\)|\\.$|$)';\n\n\t\t\n\t\t/* Search for urls starting with http:// */\n\t\t$pattern = '('.\n\t\t\t'https?:\\/{2}'. \t\t \t\t\t// 1) http://\n\t\t\t'[\\w\\.]{3,}?'. \t\t \t\t\t// 2) at least 2 \"word\" characters (alphanumeric plus \"_\") or dots\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'<a href=\"%s\" title=\"%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t((strlen($matches[1]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[1], 0, $end_firstpart). $add . substr($matches[1], $begin_secondpart)\n\t\t\t\t\t\t: $matches[1]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[2]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for urls starting with www. */\n\t\t$pattern = '( |\\t|\\n|^)'. \t\t\t// 0) prefixed by linebreak, whitespace or tab\n\t\t\t'(www\\.'. \t\t \t\t\t\t// 1) www.\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'%s<a href=\"http://%s\" title=\"http://%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t((strlen($matches[2]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[2], 0, $end_firstpart). $add . substr($matches[2], $begin_secondpart)\n\t\t\t\t\t\t: $matches[2]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[3]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for email addresses */\n\t\t$pattern = '([\\w\\.-]{3,}@([\\w]+\\.)+[a-z]{2,3})';\n\t\t$replacement = \"<a href=\\\"mailto:\\\\1\\\">\\\\1</a>\";\n\t\t$text = preg_replace(\"/$pattern/i\", $replacement, $text);\n\n \n\t\treturn $text;\n\t}", "function cms_raw_url_encode($url_part, $can_try_url_schemes = null) // TODO: Rename function in v11 and document in codebook\n{\n // Slipstream for 99.99% of data\n $url_part_encoded = rawurlencode($url_part);\n if ($url_part_encoded === $url_part) {\n return $url_part_encoded;\n }\n\n if ($can_try_url_schemes === null) {\n $can_try_url_schemes = can_try_url_schemes();\n }\n if ($can_try_url_schemes) { // These interfere with URL Scheme processing because they get pre-decoded and make things ambiguous\n //$url_part = str_replace(':', '(colon)', $url_part); We'll ignore theoretical problem here- we won't expect there to be a need for encodings within redirect URL paths (params is fine, handles naturally)\n $url_part = str_replace(array('&', '#'), array(':amp:', ':uhash:'), $url_part); // horrible but mod_rewrite does it so we need to\n }\n $url_part = str_replace('%2F', '/', rawurlencode($url_part));\n return $url_part;\n}", "function str_to_site($string){\n\t$string = str_replace(\"http://\", \"\", $string);\n\t$string = str_replace(\"https://\", \"\", $string);\n\t$string = str_replace(\"www.\", \"\", $string);\n\treturn \"http://www.\".$string;\n}", "function doFilterRelUrl($sContent) {\n $aFilterSettings = getOutputFilterSettings();\n $key = preg_replace('=^.*?filter([^\\.\\/\\\\\\\\]+)(\\.[^\\.]+)?$=is', '\\1', __FILE__);\n if ($aFilterSettings[$key]) {\n $sAppUrl = rtrim(str_replace('\\\\', '/', WB_URL), '/').'/';\n $sAppPath = rtrim(str_replace('\\\\', '/', WB_PATH), '/').'/';\n $sAppRel = preg_replace('/^https?:\\/\\/[^\\/]*(.*)$/is', '$1', $sAppUrl);\n $sDocRoot = preg_replace('/^(.*?)'.preg_quote($sAppRel, '/').'$/', '$1', $sAppUrl);\n $sContent = preg_replace_callback(\n '/((?:href|src|action)\\s*=\\s*\")([^\\?\\\"]+?)/isU',\n function ($aMatches) use ($sAppUrl, $sAppPath, $sAppRel) {\n $aMatches[2] = str_replace('\\\\', '/', $aMatches[2]);\n if ($aMatches[2][0] ='/') { $aMatches[2] = rtrim($sAppUrl, '/').$aMatches[2]; }\n $aMatches[2] = preg_replace('/^'.preg_quote($sAppUrl, '/').'/is', '', $aMatches[2]);\n $aMatches[2] = preg_replace('/(\\.+\\/)|(\\/+)/', '/', $aMatches[2]);\n if (!is_readable($sAppPath.$aMatches[2])) {\n // in case of death link show original link\n return $aMatches[0];\n } else {\n return $aMatches[1].$sAppRel.$aMatches[2];\n }\n },\n $sContent\n );\n/* Original SP7 Manu Fix */\n // restore canonical relation links\n $sContent = preg_replace_callback(\n '/<link\\s[^>]*?\\\"canonical\\\"[^>]*?>/isU',\n function($aMatches) use ($sDocRoot) {\n return preg_replace(\n '/(href\\s*=\\s*\\\")([^\\\"]*?)/siU',\n '\\1'.rtrim($sDocRoot, '/').'\\2',\n $aMatches[0]\n );\n },\n $sContent\n );\n }\n return $sContent;\n }", "function cleanStringUrl($cadena){\n\t\t$cadena = strtolower($cadena);\n\t\t$cadena = trim($cadena);\n\t\t$cadena = strtr($cadena,\n\t\t\t\t\t\t\t\t\"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ\",\n\t\t\t\t\t\t\t\t\"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn\");\n\t\t$cadena = strtr($cadena,\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"abcdefghijklmnopqrstuvwxyz\");\n\t\t$cadena = preg_replace('#([^.a-z0-9]+)#i', '-', $cadena);\n\t\t$cadena = preg_replace('#-{2,}#','-',$cadena);\n \t$cadena = preg_replace('#-$#','',$cadena);\n \t\t$cadena = preg_replace('#^-#','',$cadena);\n\t\treturn $cadena;\n\t}", "public function evaluate()\n {\n $text = $this->fusionValue('value');\n\n if ($text === '' || $text === null) {\n return '';\n }\n\n if (!is_string($text)) {\n throw new Exception(sprintf('Only strings can be processed by this Fusion object, given: \"%s\".', gettype($text)), 1382624080);\n }\n\n $node = $this->fusionValue('node');\n\n if (!$node instanceof NodeInterface) {\n throw new Exception(sprintf('The current node must be an instance of NodeInterface, given: \"%s\".', gettype($text)), 1382624087);\n }\n\n if ($node->getContext()->getWorkspace()->getName() !== 'live' && !($this->fusionValue('forceConversion'))) {\n return $text;\n }\n\n $unresolvedUris = array();\n $linkingService = $this->linkingService;\n $controllerContext = $this->runtime->getControllerContext();\n\n $absolute = $this->fusionValue('absolute');\n\n $processedContent = preg_replace_callback(LinkingService::PATTERN_SUPPORTED_URIS, function (array $matches) use ($node, $linkingService, $controllerContext, &$unresolvedUris, $absolute) {\n switch ($matches[1]) {\n case 'node':\n $resolvedUri = $linkingService->resolveNodeUri($matches[0], $node, $controllerContext, $absolute);\n $this->runtime->addCacheTag('node', $matches[2]);\n break;\n case 'asset':\n $resolvedUri = $linkingService->resolveAssetUri($matches[0]);\n $this->runtime->addCacheTag('asset', $matches[2]);\n break;\n default:\n $resolvedUri = null;\n }\n\n if ($resolvedUri === null) {\n $unresolvedUris[] = $matches[0];\n return $matches[0];\n }\n\n return $resolvedUri;\n }, $text);\n\n if ($unresolvedUris !== array()) {\n $processedContent = preg_replace('/<a[^>]* href=\"(node|asset):\\/\\/[^\"]+\"[^>]*>(.*?)<\\/a>/', '$2', $processedContent);\n $processedContent = preg_replace(LinkingService::PATTERN_SUPPORTED_URIS, '', $processedContent);\n }\n\n $processedContent = $this->replaceLinkTargets($processedContent);\n\n return $processedContent;\n }", "function standardize_url($url) {\n if(empty($url)) return $url;\n return (strstr($url,'http://') OR strstr($url,'https://')) ? $url : 'http://'.$url;\n}", "function activate_links($txt){\r\n\t\t$txt = str_replace(' ',' ',$txt);\r\n\t\t$words = explode(' ',$txt);\r\n\t\t$ret = '';\r\n\t\tforeach($words as $word){\r\n\t\t\tif(strpos($word,'http://')===0) $word = '<a href=\"'.$word.'\" target=\"_blank\" google_event_tag=\"Home Page - Right Module 4|Click|Twitter Link\">'.$word.'</a>';\r\n\t\t\t$ret .= ' ' . $word;\r\n\t\t}\r\n\t\treturn trim($ret);\r\n\t}", "function tc_sanitize_url( $value) {\r\n $value = esc_url( $value);\r\n return $value;\r\n }", "function comcode_text_to_tempcode($comcode,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$is_all_semihtml,$structure_sweep,$check_only,$highlight_bits=NULL,$on_behalf_of_member=NULL)\n{\n\tglobal $ADVERTISING_BANNERS,$ALLOWED_ENTITIES,$POTENTIALLY_EMPTY_TAGS,$CODE_TAGS,$REVERSABLE_TAGS,$PUREHTML_TAGS,$DANGEROUS_TAGS,$VALID_COMCODE_TAGS,$BLOCK_TAGS,$POTENTIAL_JS_NAUGHTY_ARRAY,$TEXTUAL_TAGS,$LEET_FILTER,$IMPORTED_CUSTOM_COMCODE,$REPLACE_TARGETS;\n\n\t$wml=false; // removed feature from ocPortal now\n\t$print_mode=get_param_integer('wide_print',0)==1;\n\n\t$len=strlen($comcode);\n\n\tif ((function_exists('set_time_limit')) && (ini_get('max_execution_time')!='0')) @set_time_limit(300);\n\n\t$allowed_html_seqs=array('<table>','<table class=\"[^\"]*\">','<table class=\"[^\"]*\" summary=\"[^\"]*\">','<table summary=\"[^\"]*\">','</table>','<tr>','</tr>','<td>','</td>','<th>','</th>','<pre>','</pre>','<br />','<br/>','<br >','<br>','<p>','</p>','<p />','<b>','</b>','<u>','</u>','<i>','</i>','<em>','</em>','<strong>','</strong>','<li>','</li>','<ul>','</ul>','<ol>','</ol>','<del>','</del>','<dir>','</dir>','<s>','</s>','</a>','</font>','<!--','<h1 id=\"main_page_title\">','<h1 class=\"main_page_title\">','<h1 id=\"main_page_title\" class=\"main_page_title\">','</h1>','<img (class=\"inline_image\" )?alt=\"[^\"]*\" src=\"[^\"]*\" (complete=\"true\" )*/>','<img src=[\"\\'][^\"\\'<>]*[\"\\']( border=[\"\\'][^\"\\'<>]*[\"\\'])?( alt=[\"\\'][^\"\\'<>]*[\"\\'])?( )?(/)?'.'>','<a href=[\"\\'][^\"\\'<>]*[\"\\']( target=[\"\\'][^\"\\'<>]*[\"\\'])?'.'>'); // HTML tag may actually be used in very limited conditions: only the following HTML seqs will come out as HTML. This is, unless the blacklist filter is used instead.\n\tif ($as_admin)\n\t{\n\t\t$comcode_dangerous=true;\n\t\t$comcode_dangerous_html=true;\n\t} else\n\t{\n\t\t$comcode_dangerous=($GLOBALS['MICRO_BOOTUP']==0) && (has_specific_permission($source_member,'comcode_dangerous'));\n\t\t$comcode_dangerous_html=false;\n\t\tif ((has_specific_permission($source_member,'allow_html')) && (($is_all_semihtml) || (strpos($comcode,'[html')!==false) || (strpos($comcode,'[semihtml')!==false)))\n\t\t{\n\t\t\t$comcode_dangerous_html=true;\n\t\t\t/*foreach (array_keys($POTENTIALLY_EMPTY_TAGS) as $tag) // Find whether we really need to enable the computational-expensive filtering. Code disabled, not sure why this would have ever worked!\n\t\t\t{\n\t\t\t\tif (($tag!='html') && ($tag!='semihtml') && (strpos($comcode,'['.$tag)!==false))\n\t\t\t\t{\n\t\t\t\t\t$comcode_dangerous_html=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t}\n\tif (is_null($pass_id)) $pass_id=strval(mt_rand(0,32000)); // This is a unique ID that refers to this specific piece of comcode\n\tglobal $COMCODE_ATTACHMENTS;\n\tif (!array_key_exists($pass_id,$COMCODE_ATTACHMENTS)) $COMCODE_ATTACHMENTS[$pass_id]=array();\n\n\t// Tag level\n\t$current_tag='';\n\t$attribute_map=array();\n\t$tag_output=new ocp_tempcode();\n\t$continuation='';\n\t$close=mixed();\n\n\t// Properties that come from our tag\n\t$white_space_area=true;\n\t$textual_area=true;\n\t$formatting_allowed=true;\n\t$in_html=false;\n\t$in_semihtml=$is_all_semihtml;\n\t$in_separate_parse_section=false; // Not escaped because it has to be passed to a secondary filter\n\t$in_code_tag=false;\n\t$code_nest_stack=0;\n\n\t// Our state\n\t$status=CCP_NO_MANS_LAND;\n\t$lax=$GLOBALS['LAX_COMCODE'] || function_exists('get_member') && $source_member!=get_member() || count($_POST)==0; // if we don't want to produce errors for technically invalid Comcode\n\t$tag_stack=array();\n\t$pos=0;\n\t$line_starting=true;\n\t$just_ended=false;\n\t$none_wrap_length=0;\n\t$just_new_line=true; // So we can detect lists starting right away\n\t$just_title=false;\n\tglobal $NUM_LINES;\n\t$NUM_LINES=0;\n\t$queued_tempcode=new ocp_tempcode();\n\t$mindless_mode=false; // If we're doing a semi parse mode and going over a tag we don't actually process\n\t$tag_raw='';\n\n\tif ((!is_null($wrap_pos)) && (strtolower(get_charset())=='utf-8'))\n\t\t$wrap_pos*=2;\n\n\t$b_all=(get_option('admin_banners',true)==='1');\n\n\t$stupidity_mode=get_value('stupidity_mode'); // bork or leet\n\tif ($comcode_dangerous) $stupidity_mode=get_param('stupidity_mode','');\n\tif ($stupidity_mode=='leet')\n\t{\n\t\t$LEET_FILTER=array(\n\t\t'B'=>'8',\n\t\t'C'=>'(',\n\t\t'E'=>'3',\n\t\t'G'=>'9',\n\t\t'I'=>'1',\n\t\t'L'=>'1',\n\t\t'O'=>'0',\n\t\t'P'=>'9',\n\t\t'S'=>'5',\n\t\t'U'=>'0',\n\t\t'V'=>'\\/',\n\t\t'Z'=>'2'\n\t\t);\n\t}\n\n\t$smilies=$GLOBALS['FORUM_DRIVER']->find_emoticons(); // We'll be needing the smiley array\n\t$shortcuts=array('(EUR-)'=>'&euro;','{f.}'=>'&fnof;','-|-'=>'&dagger;','=|='=>'&Dagger;','{%o}'=>'&permil;','{~S}'=>'&Scaron;','{~Z}'=>'&#x17D;','(TM)'=>'&trade;','{~s}'=>'&scaron;','{~z}'=>'&#x17E;','{.Y.}'=>'&Yuml;','(c)'=>'&copy;','(r)'=>'&reg;','---'=>'&mdash;','--'=>'&ndash;','...'=>'&hellip;','-->'=>'&rarr;','<--'=>'&larr;');\n\n\t// Text syntax possibilities, that get maintained as our cursor moves through the text block\n\t$list_indent=0;\n\t$list_type='ul';\n\n\tif ($is_all_semihtml) filter_html($as_admin,$source_member,$pos,$len,$comcode,false,false); // Pre-filter the whole lot (note that this means during general output we do no additional filtering)\n\n\twhile ($pos<$len)\n\t{\n\t\t$next=$comcode[$pos];\n\t\t++$pos;\n\n\t\t// State machine\n\t\tswitch ($status)\n\t\t{\n\t\t\tcase CCP_NO_MANS_LAND:\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t// Look ahead to make sure it's a valid tag. If it's not then it's considered normal user input, not a tag at all\n\t\t\t\t\t$dif=(($pos<$len) && ($comcode[$pos]=='/'))?1:0;\n\t\t\t\t\t$ahead=substr($comcode,$pos+$dif,MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH);\n\t\t\t\t\t$equal_pos=strpos($ahead,'=');\n\t\t\t\t\t$space_pos=strpos($ahead,' ');\n\t\t\t\t\t$end_pos=strpos($ahead,']');\n\t\t\t\t\t$lax_end_pos=strpos($ahead,'[');\n\t\t\t\t\t$cl_pos=strpos($ahead,chr(10));\n\t\t\t\t\tif ($equal_pos===false) $equal_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($space_pos===false) $space_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($end_pos===false) $end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($lax_end_pos===false) $lax_end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($cl_pos===false) $cl_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\t$use_pos=min($equal_pos,$space_pos,$end_pos,$lax_end_pos,$cl_pos);\n\n\t\t\t\t\t$potential_tag=strtolower(substr($ahead,0,$use_pos));\n\t\t\t\t\tif (($use_pos!=22) && ((!$in_semihtml) || ($dif==1) || (($potential_tag!='html') && ($potential_tag!='semihtml'))) && ((!$in_html) || (($dif==1) && ($potential_tag=='html'))) && ((!$in_code_tag) || ((isset($CODE_TAGS[$potential_tag])) && ($potential_tag==$current_tag))) && ((!$structure_sweep) || ($potential_tag!='contents')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($in_code_tag)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($dif==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack--;\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$ok=($code_nest_stack==-1);\n\t\t\t\t\t\t} else $ok=true;\n\n\t\t\t\t\t\tif ($ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!isset($VALID_COMCODE_TAGS[$potential_tag]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$IMPORTED_CUSTOM_COMCODE)\n\t\t\t\t\t\t\t\t\t_custom_comcode_import($connection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((isset($VALID_COMCODE_TAGS[$potential_tag])) && (strtolower(substr($ahead,0,2))!='i ')) // The \"i\" bit is just there to block a common annoyance: [i] doesn't take parameters and we don't want \"[i think]\" (for example) being parsed.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($comcode[$pos]!='/') || (count($tag_stack)==0))\n\t\t\t\t\t\t\t\t\t$mindless_mode=($semiparse_mode) && /*(!isset($CODE_TAGS[$potential_tag])) && */((!isset($REVERSABLE_TAGS[$potential_tag])) || ((is_string($REVERSABLE_TAGS[$potential_tag])) && (preg_match($REVERSABLE_TAGS[$potential_tag],substr($comcode,$pos,100))!=0))) && (!isset($PUREHTML_TAGS[$potential_tag]));\n\t\t\t\t\t\t\t\telse $mindless_mode=$tag_stack[count($tag_stack)-1][7];\n\n\t\t\t\t\t\t\t\t$close=false;\n\t\t\t\t\t\t\t\t$current_tag='';\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\tif ((/*(($potential_tag=='html') || ($potential_tag=='semihtml')) && */($just_new_line)) || (isset($BLOCK_TAGS[$potential_tag])))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$status=CCP_STARTING_TAG;\n\t\t\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]!='/')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists($potential_tag,$BLOCK_TAGS))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep_block\">[';\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep\">[';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tag_raw='[';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tag_raw='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\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{\n\t\t\t\t\t\tif (($use_pos!=22) && ((($in_semihtml) || ($in_html)) && (($potential_tag=='html') || ($potential_tag=='semihtml'))) && (!$in_code_tag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ahc=strpos($ahead,']');\n\t\t\t\t\t\t\tif ($ahc!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pos+=$ahc+1;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((($in_html) || ((($in_semihtml) && (!$in_code_tag)) && (($next=='<') || ($next=='>') || ($next=='\"')))))\n\t\t\t\t{\n\t\t\t\t\tif ($next==chr(10)) ++$NUM_LINES;\n\n\t\t\t\t\tif ((!$comcode_dangerous_html) && ($next=='<')) // Special filtering required\n\t\t\t\t\t{\n\t\t\t\t\t\t$close=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t$portion=substr($comcode,$pos-1,$close-$pos+2);\n\t\t\t\t\t\t$seq_ok=false;\n\t\t\t\t\t\tforeach ($allowed_html_seqs as $allowed_html_seq)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (preg_match('#^'.$allowed_html_seq.'$#',$portion)!=0) $seq_ok=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$seq_ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// $next='&lt;'; //OLD STYLE\n\t\t\t\t\t\t\tif ($close!==false) $pos=$close+1; // NEW STYLE\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (substr($comcode,$pos-1,4)=='<!--') // To stop shortcut interpretation\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.='<!--';\n\t\t\t\t\t\t$pos+=3;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // Not in HTML\n\t\t\t\t{\n\t\t\t\t\t// Text-format possibilities\n\t\t\t\t\tif (($just_new_line) && ($formatting_allowed) && (!$wml))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($continuation!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List\n\t\t\t\t\t\t$found_list=false;\n\t\t\t\t\t\t$old_list_indent=$list_indent;\n\t\t\t\t\t\tif (($pos+2<$len) && (is_numeric($next)) && (((is_numeric($comcode[$pos])) && ($comcode[$pos+1]==')') && ($comcode[$pos+2]==' ')) || (($comcode[$pos]==')') && ($comcode[$pos+1]==' '))) && ((($list_type=='1') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n\\d+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='1'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($pos+2<$len) && (ord($next)>=ord('a')) && (ord($next)<=ord('z')) && ($comcode[$pos]==')') && ($comcode[$pos+1]==' ') && ((($list_type=='a') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n[a-z]+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='a'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='a';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($next==' ')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($old_list_indent!=0) && ($list_type!='ul'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$scan_pos=$pos-1;\n\t\t\t\t\t\t\t$list_indent=0;\n\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\tif (($scan_next=='-') && ($scan_pos+1<$len) && ($comcode[$scan_pos+1]==' '))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($scan_next==' ') ++$list_indent; else break;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$found_list) $list_indent=0; else $list_type='ul';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Rule?\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t$old_list_indent=0;\n\n\t\t\t\t\t\t\tif (($next=='-') && (!$just_title))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t\t$found_rule=true;\n\t\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\t\tif ($scan_next!='-')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($scan_next==chr(10))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else $found_rule=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($found_rule)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$_temp_tpl=do_template('COMCODE_TEXTCODE_LINE');\n\t\t\t\t\t\t\t\t\t$tag_output->attach($_temp_tpl);\n\t\t\t\t\t\t\t\t\t$pos=$scan_pos+1;\n\t\t\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List handling\n\t\t\t\t\t\tif (($list_indent==$old_list_indent) && ($old_list_indent!=0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ($i=$list_indent;$i<$old_list_indent;++$i) // Close any ended\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$temp_tpl=($list_type=='ul')?'</ul>':'</ol>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (($list_indent<$old_list_indent) && ($list_indent!=0)) // Go down one final level, because the list tag must have been nested within an li tag (we closed open li tags recursively except for the final one)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($found_list)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((($list_indent-$old_list_indent)>1) && (!$lax))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_LIST_JUMPYNESS'),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($i=$old_list_indent;$i<$list_indent;++$i) // Or open any started\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch ($list_type)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'ul':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ul><li>'; else $temp_tpl='<ul>';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"1\"><li>'; else $temp_tpl='<ol type=\"1\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"a\"><li>'; else $temp_tpl='<ol type=\"a\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$temp_tpl='<li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t$next='';\n\t\t\t\t\t\t\t$pos=$scan_pos+2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && ($print_mode) && ($list_indent==0)) // We might need to put some queued up stuff here: when we print, we can't float thumbnails\n\t\t\t\t\t{\n\t\t\t\t\t\t$tag_output->attach($queued_tempcode);\n\t\t\t\t\t\t$queued_tempcode=new ocp_tempcode();\n\t\t\t\t\t}\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && (!$in_semihtml) && ((!$just_ended) || ($semiparse_mode) || (substr($comcode,$pos,3)==' - '))) // Hard-new-lines\n\t\t\t\t\t{\n\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t$line_starting=true;\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\tif (($list_indent==0) && (!$just_ended))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\n\t\t\t\t\t\tif (($next==' ') && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($line_starting) || (($pos>1) && ($comcode[$pos-2]==' '))) // Hard spaces\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$next='&nbsp;';\n\t\t\t\t\t\t\t\t++$none_wrap_length;\n\t\t\t\t\t\t\t} else $none_wrap_length=0;\n\t\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($next==\"\\t\") && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t$tab_tpl=do_template('COMCODE_TEXTCODE_TAB');\n\t\t\t\t\t\t\t$_tab_tpl=$tab_tpl->evaluate();\n\t\t\t\t\t\t\t$none_wrap_length+=strlen($_tab_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($tab_tpl);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($next==' ') || ($next==\"\\t\") || ($just_ended)) $none_wrap_length=0; else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((!is_null($wrap_pos)) && ($none_wrap_length>=$wrap_pos) && ((strtolower(get_charset())!='utf-8') || (preg_replace(array('#[\\x09\\x0A\\x0D\\x20-\\x7E]#','#[\\xC2-\\xDF][\\x80-\\xBF]#','#\\xE0[\\xA0-\\xBF][\\x80-\\xBF]#','#[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}#','#\\xED[\\x80-\\x9F][\\x80-\\xBF]#','#\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}#','#[\\xF1-\\xF3][\\x80-\\xBF]{3}#','#\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}#'),array('','','','','','','',''),$continuation)=='')) && ($textual_area) && (!$in_semihtml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t} elseif ($textual_area) ++$none_wrap_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$line_starting=false;\n\t\t\t\t\t\t\t$just_ended=false;\n\n\t\t\t\t\t\t\t$differented=false; // If somehow via lookahead we've changed this to HTML and thus won't use it in raw form\n\n\t\t\t\t\t\t\t// Variable lookahead\n\t\t\t\t\t\t\tif ((!$in_code_tag) && (($next=='{') && (isset($comcode[$pos])) && (($comcode[$pos]=='$') || ($comcode[$pos]=='+') || ($comcode[$pos]=='!'))))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($comcode_dangerous)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_code_tag) && ((!$semiparse_mode) || (in_tag_stack($tag_stack,array('url','img','flash')))))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='+')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_end=$pos+5;\n\t\t\t\t\t\t\t\t\t\t\twhile ($p_end<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_end-($pos-1)+5);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count($p_portion,'{+START')==substr_count($p_portion,'{+END')) break;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_end++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len=1;\n\t\t\t\t\t\t\t\t\t\t\twhile ($pos+$p_len<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count(str_replace('{',' { ',$p_portion),'{')==substr_count(str_replace('}',' } ',$p_portion),'}')) break; // str_replace is to workaround a Quercus bug #4494\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len--;\n\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos+$p_len,$p_end-($pos+$p_len));\n\t\t\t\t\t\t\t\t\t\t\trequire_code('tempcode_compiler');\n\t\t\t\t\t\t\t\t\t\t\t$ret=template_to_tempcode(substr($comcode,$pos-1,$p_len+1).'{DIRECTIVE_EMBEDMENT}'.substr($comcode,$p_end,6));\n\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t$ret->singular_bind('DIRECTIVE_EMBEDMENT',comcode_text_to_tempcode($p_portion,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=$pos+$p_len;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_end+6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif ($comcode[$pos]=='!')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t\tif (($ret->parameterless(0)) && ($pos<$len)) // We want to take the lang string reference as Comcode if it's a simple lang string reference with no parameters\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\{\\!([\\w\\d\\_\\:]+)(\\}|$)#U',substr($comcode,$less_pos,$p_len-$less_pos),$matches)!=0) // Hacky code to extract the lang string name\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp_lang_string=$matches[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret=comcode_lang_string($temp_lang_string); // Recreate as a Comcode lang string\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\tif (($pos<=$len) || (!$lax))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($ret);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($comcode[$pos]=='$') && ($pos<$len-2) && ($comcode[$pos+1]==',') && (strpos($comcode,'}',$pos)!==false))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$pos=strpos($comcode,'}',$pos)+1;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Escaping of comcode tag starts lookahead\n\t\t\t\t\t\t\tif (($next=='\\\\') && (!$in_code_tag)) // We are changing \\[ to [ with the side-effect of blocking a tag start. To get \\[ literal, we need the symbols \\\\[... and add extra \\-pairs as needed. We are only dealing with \\ and [ (update: and now {) here, it's not a further extended means of escaping.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($pos!=$len) && (($comcode[$pos]=='\"') || (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=$mindless_mode?'&quot;':'\"';\n\t\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='&quot;';\n\t\t\t\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='['))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='[';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='{'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='{';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos==$len) || ($comcode[$pos]=='\\\\'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((($textual_area) || ($in_semihtml)) && (trim($next)!='') && (!$wml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Emoticon lookahead\n\t\t\t\t\t\t\t\t\tforeach ($smilies as $smiley=>$imgcode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($in_semihtml) $smiley=' '.$smiley.' ';\n\n\t\t\t\t\t\t\t\t\t\tif ($next==$smiley[0]) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($comcode,$pos-1,strlen($smiley))==$smiley)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($smiley)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_emoticon($imgcode));\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((trim($next)!='') && (!$in_code_tag) && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// CEDI pages\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='[') && ($pos+1<$len) && ($comcode[$pos]=='[') && (!$semiparse_mode) && (addon_installed('cedi')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\[([^\\[\\]]*)\\]\\]#',substr($comcode,$pos,200),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cedi_page_name=$matches[1];\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t$hash_pos=strpos($cedi_page_name,'#');\n\t\t\t\t\t\t\t\t\t\tif ($hash_pos!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$jump_to=substr($cedi_page_name,$hash_pos+1);\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_name=substr($cedi_page_name,0,$hash_pos);\n\t\t\t\t\t\t\t\t\t\t} else $jump_to='';\n\t\t\t\t\t\t\t\t\t\t$cedi_page_url=build_url(array('page'=>'cedi','type'=>'misc','find'=>$cedi_page_name),get_module_zone('cedi'));\n\t\t\t\t\t\t\t\t\t\tif ($jump_to!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_url->attach('#'.$jump_to);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_CEDI_LINK',array('_GUID'=>'ebcd7ba5290c5b2513272a53b4d666e5','URL'=>$cedi_page_url,'TEXT'=>$cedi_page_name)));\n\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Usernames\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='{') && ($pos+1<$len) && ($comcode[$pos]=='{') && (!$in_code_tag) && (!$semiparse_mode))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\{([^\"{}&\\'\\$<>]+)\\}\\}#',substr($comcode,$pos,80),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$username=$matches[1];\n\n\t\t\t\t\t\t\t\t\t\tif ($username[0]=='?')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$username_info=true;\n\t\t\t\t\t\t\t\t\t\t\t$username=substr($username,1);\n\t\t\t\t\t\t\t\t\t\t} else $username_info=false;\n\t\t\t\t\t\t\t\t\t\t$this_member_id=$GLOBALS['FORUM_DRIVER']->get_member_from_username($username);\n\t\t\t\t\t\t\t\t\t\tif ((!is_null($this_member_id)) && (!is_guest($this_member_id)))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\n\t\t\t\t\t\t\t\t\t\t\t$poster_url=$GLOBALS['FORUM_DRIVER']->member_profile_url($this_member_id,false,true);\n\t\t\t\t\t\t\t\t\t\t\tif ((get_forum_type()=='ocf') && ($username_info))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('ocf');\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('ocf_members2');\n\t\t\t\t\t\t\t\t\t\t\t\t$details=ocf_show_member_box($this_member_id);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('HYPERLINK_TOOLTIP',array('_GUID'=>'d8f4f4ac70bd52b3ef9ee74ae9c5e085','TOOLTIP'=>$details,'CAPTION'=>$username,'URL'=>$poster_url,'NEW_WINDOW'=>false)));\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(hyperlink($poster_url,$username));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Shortcut lookahead\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($in_semihtml) && (substr($comcode,$pos-1,3)=='-->')) // To stop shortcut interpretation\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='-->';\n\t\t\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tforeach ($shortcuts as $code=>$replacement)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (($next==$code[0]) && (substr($comcode,$pos-1,strlen($code))==$code))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($code)-1;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($replacement);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($replacement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Table syntax\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($pos<$len) && ($comcode[$pos]=='|'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$end_tbl=strpos($comcode,chr(10).'|}',$pos);\n\t\t\t\t\t\t\t\t\t\tif ($end_tbl!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$end_fst_line_pos=strpos($comcode,chr(10),$pos);\n\t\t\t\t\t\t\t\t\t\t\t$caption=substr($comcode,$pos+2,max($end_fst_line_pos-$pos-2,0));\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($caption)+1;\n\n\t\t\t\t\t\t\t\t\t\t\t$rows=preg_split('#(\\|-|\\|\\})#Um',substr($comcode,$pos,$end_tbl-$pos));\n\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)floats($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$caption=preg_replace('#(^|\\s)floats($|\\s)#','',$caption);\n\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $h=>$row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($h!=0) $tag_output->attach(do_template('BLOCK_SEPARATOR'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$num_cells_in_row=count($cells)/2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inter_padding=3.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_box_width=(100.0-$inter_padding*($num_cells_in_row-1));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Find which to float\n\t\t\t\t\t\t\t\t\t\t\t\t\t$to_float=NULL;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!$spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((strpos($cell,'!')!==false) || (is_null($to_float))) $to_float=$i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do floated one\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_1=(($to_float==1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_2=(($to_float!=1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($num_cells_in_row===1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount='0';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=($to_float===1)?0:(count($cells)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE_START',array('_GUID'=>'ced8c3a142f74296a464b085ba6891c9','WIDTH'=>$width,'FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_START',array('_GUID'=>'90be72fcbb6b9d8a312da0bee5b86cb3','WIDTH'=>array_key_exists($to_float,$ratios)?$ratios[$to_float]:'','FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(isset($cells[$to_float])?rtrim($cells[$to_float]):'',$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cells[$to_float],$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do non-floated ones\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i%2==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i!=$to_float)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE2_START',array('_GUID'=>'9bac42a1b62c5c9a2f758639fcb3bb2f','WIDTH'=>$width,'PADDING_AMOUNT'=>$padding_amount,'FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'')));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_2_START',array('_GUID'=>'0f15f9d5554635ed7ac154c9dc5c72b8','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START',array('SUMMARY'=>preg_replace('#(^|\\s)wide($|\\s)#','',$caption))));\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START_SUMMARY',array('_GUID'=>'0c5674fba61ba14b4b9fa39ea31ff54f','CAPTION'=>$caption)));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $table_row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$table_row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type=(strpos($cell,'!')!==false)?'th':'td';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_mid=comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_CELL',array('_GUID'=>'6640df8b503f65e3d36f595b0acf7600','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','C_TYPE'=>$c_type,'MID'=>$_mid,'PADDING'=>($cell_i==0)?'':'-left','PADDING_AMOUNT'=>(count($cells)==2)?'0':float_to_raw_string(5.0/(floatval(count($cells)-2)/2.0),2))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos=$end_tbl+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Advertising\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$semiparse_mode) && (!$in_code_tag) && (addon_installed('banners')) && (($b_all) || (!has_specific_permission($source_member,'banner_free'))))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Pick up correctly, including permission filtering\n\t\t\t\t\t\t\t\t\tif (is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ADVERTISING_BANNERS=array();\n\n\t\t\t\t\t\t\t\t\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.get_table_prefix().'banners b LEFT JOIN '.get_table_prefix().'banner_types t ON b.b_type=t.id WHERE t_comcode_inline=1 AND '.db_string_not_equal_to('b_title_text',''),NULL,NULL,true);\n\t\t\t\t\t\t\t\t\t\tif (!is_null($rows))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Filter out what we don't have permission for\n\t\t\t\t\t\t\t\t\t\t\tif (get_option('use_banner_permissions',true)=='1')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('permissions');\n\t\t\t\t\t\t\t\t\t\t\t\t$groups=_get_where_clause_groups($source_member);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($groups))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$perhaps=collapse_1d_complexity('category_name',$GLOBALS['SITE_DB']->query('SELECT category_name FROM '.get_table_prefix().'group_category_access WHERE '.db_string_equal_to('module_the_name','banners').' AND ('.$groups.')'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_rows=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (in_array($row['name'],$perhaps)) $new_rows[]=$row;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rows=$new_rows;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$trigger_text=$row['b_title_text'];\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (explode(',',$trigger_text) as $t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (trim($t)!='') $ADVERTISING_BANNERS[trim($t)]=$row;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Apply\n\t\t\t\t\t\t\t\t\tif (!is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($ADVERTISING_BANNERS as $ad_trigger=>$ad_bits)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($ad_trigger[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($ad_trigger)))==strtolower($ad_trigger))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('banners');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ad_text=show_banner($ad_bits['name'],$ad_bits['b_title_text'],get_translated_tempcode($ad_bits['caption']),$ad_bits['img_url'],'',$ad_bits['site_url'],$ad_bits['b_type']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('tooltip',array('param'=>$ad_text,'url'=>(url_is_local($ad_bits['site_url']) && ($ad_bits['site_url']!=''))?(get_custom_base_url().'/'.$ad_bits['site_url']):$ad_bits['site_url']),substr($comcode,$pos-1,strlen($ad_trigger)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($ad_trigger)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Search highlighting lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!is_null($highlight_bits)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($highlight_bits as $highlight_bit)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($highlight_bit[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($highlight_bit)))==strtolower($highlight_bit))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('highlight',array(),escape_html(substr($comcode,$pos-1,strlen($highlight_bit))),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($highlight_bit)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Link lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_semihtml) && ($next=='h') && ((substr($comcode,$pos-1,strlen('http://'))=='http://') || (substr($comcode,$pos-1,strlen('https://'))=='https://') || (substr($comcode,$pos-1,strlen('ftp://'))=='ftp://')))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_9=strpos($comcode,', ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_10=strpos($comcode,'. ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_11=strpos($comcode,\"'\",$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_12=strpos($comcode,'&nbsp;',$pos-1);\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_10!==false) && (($link_end_pos===false) || ($link_end_pos_10<$link_end_pos))) $link_end_pos=$link_end_pos_10;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_11!==false) && (($link_end_pos===false) || ($link_end_pos_11<$link_end_pos))) $link_end_pos=$link_end_pos_11;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_12!==false) && (($link_end_pos===false) || ($link_end_pos_12<$link_end_pos))) $link_end_pos=$link_end_pos_12;\n\t\t\t\t\t\t\t\t\t\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t\t\t\t\t\t\t\t\t\t$auto_link=preg_replace('#(keep|for)_session=[\\d\\w]*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-3)!='://')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-1)=='.')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$auto_link=substr($auto_link,0,strlen($auto_link)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t$link_end_pos--;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode->attach($auto_link);\n\t\t\t\t\t\t\t\t\t\t\tif (!$check_only)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$GLOBALS['SITE_DB']->query_value_null_ok('url_title_cache','t_title',array('t_url'=>$auto_link));\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ((is_null($link_captions_title)) || (substr($link_captions_title,0,1)=='!'))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['COMCODE_PARSE_URLS_CHECKED']++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (($GLOBALS['NO_LINK_TITLES']) || ($GLOBALS['COMCODE_PARSE_URLS_CHECKED']>=MAX_URLS_TO_READ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$downloaded_at_link=http_download_file($auto_link,3000,false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((is_string($downloaded_at_link)) && ($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE']!==NULL) && (strpos($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE'],'html')!==false) && ($GLOBALS['HTTP_MESSAGE']=='200'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#miU',$downloaded_at_link,$matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('character_sets');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=trim(str_replace('&ndash;','-',str_replace('&mdash;','-',@html_entity_decode(convert_to_internal_encoding($matches[1]),ENT_QUOTES,get_charset()))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (((strpos(strtolower($link_captions_title),'login')!==false) || (strpos(strtolower($link_captions_title),'log in')!==false)) && (substr($auto_link,0,strlen(get_base_url()))==get_base_url()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=''; // don't show login screen titles for our own website. Better to see the link verbatim\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['SITE_DB']->query_insert('url_title_cache',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_url'=>substr($auto_link,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_title'=>substr($link_captions_title,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),false,true); // To stop weird race-like conditions\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=mixed();\n\t\t\t\t\t\t\t\t\t\t\t\t$link_handlers=find_all_hooks('systems','comcode_link_handlers');\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (array_keys($link_handlers) as $link_handler)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('hooks/systems/comcode_link_handlers/'.$link_handler);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_handler_ob=object_factory('Hook_comcode_link_handler_'.$link_handler,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($link_handler_ob)) continue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=$link_handler_ob->bind($auto_link,$link_captions_title,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($embed_output)) break;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($embed_output))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$page_link=url_to_pagelink($auto_link,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($link_captions_title=='') $link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($page_link!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('page',array('param'=>$page_link),make_string_tempcode(escape_html($link_captions_title)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('url',array('param'=>$link_captions_title),$auto_link_tempcode,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t$pos+=$link_end_pos-$pos;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($stupidity_mode!='') && ($textual_area))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($stupidity_mode=='leet') && (mt_rand(0,1)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists(strtoupper($next),$LEET_FILTER)) $next=$LEET_FILTER[strtoupper($next)];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telseif (($stupidity_mode=='bork') && (mt_rand(0,60)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$next.='-bork-bork-bork-';\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\tif ((!$in_separate_parse_section) && ((!$in_semihtml) || ((!$comcode_dangerous_html)/*If we don't support HTML and we haven't done the all_semihtml pre-filter at the top*/ && (!$is_all_semihtml)))) // Display char. We try and support entities\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($next=='&')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ahead=substr($comcode,$pos,20);\n\t\t\t\t\t\t\t\t\t\t$ahead_lower=strtolower($ahead);\n\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t$entity=preg_match('#^(\\#)?([\\w]*);#',$ahead_lower,$matches)!=0; // If it is a SAFE entity, use it\n\n\t\t\t\t\t\t\t\t\t\tif (($entity) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (($matches[1]=='') && (($in_semihtml) || (isset($ALLOWED_ENTITIES[$matches[2]]))))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+1;\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t} elseif ((is_numeric($matches[2])) && ($matches[1]=='#'))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matched_entity=intval(base_convert($matches[2],16,10));\n\t\t\t\t\t\t\t\t\t\t\t\tif (($matched_entity<127) && (array_key_exists(chr($matched_entity),$POTENTIAL_JS_NAUGHTY_ARRAY)))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&#'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$continuation.=$next;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\t\t$current_attribute_name='param';\n\t\t\t\t}\n\t\t\t\telseif (trim($next)=='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$next=']';\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($close)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($formatting_allowed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($tag_stack)==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lax)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE',$current_tag),strrpos(substr($comcode,0,$pos),'['),$comcode,$check_only);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$has_it=false;\n\t\t\t\t\t\tforeach (array_reverse($tag_stack) as $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($t[0]==$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$has_it=true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (($in_semihtml) && (($current_tag=='html') || ($current_tag=='semihtml'))) // Only search one level for this\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($has_it)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\tif ($_last[0]!=$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$lax)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\n\t\t\t\t\t\t\t\t\tif (count($tag_stack)==0) // Hmm, it was never open. So let's pretend this tag close never happened\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twhile ($_last[0]!=$current_tag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extraneous_semihtml=((!$is_all_semihtml) && (!$in_semihtml)) || (($current_tag!='html') && ($current_tag!='semihtml'));\n\t\t\t\t\t\t\tif ((!$lax) && ($extraneous_semihtml))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do the comcode for this tag\n\t\t\t\t\t\tif ($in_semihtml) // We need to perform some magic to clean up the Comcode sections\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($_last[1] as $index=>$conv)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last[1][$index]=@html_entity_decode(str_replace('<br />',chr(10),$conv),ENT_QUOTES,get_charset());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mindless_mode=$_last[7];\n\n\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$embed_output=$tag_output;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (!$check_only)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\t\t\tif ($structure_sweep)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_structure_sweep=!in_tag_stack($tag_stack,array('title'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$_structure_sweep,$semiparse_mode,$highlight_bits,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\n\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t\t\t\tif (($print_mode) && ($_last[0]=='exp_thumb'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$queued_tempcode->attach($embed_output);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$just_ended=isset($BLOCK_TAGS[$current_tag]);\n\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((strlen($comcode)>$pos+1) && ($comcode[$pos]==chr(10)) && ($comcode[$pos+1]==chr(10))) // Linux newline\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$NUM_LINES+=2;\n\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($current_tag=='html') $in_html=false;\n\t\t\t\t\t\telseif ($current_tag=='semihtml') $in_semihtml=false;\n\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\tif (($close) && ($mindless_mode))\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp_tpl='</kbd>&#8203;';\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($status==CCP_IN_TAG_NAME) $current_tag.=strtolower($next);\n\t\t\t\tbreak;\n\t\t\tcase CCP_STARTING_TAG:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actual occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t}\n\t\t\t\telseif ($next=='/')\n\t\t\t\t{\n\t\t\t\t\t$close=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_tag.=strtolower($next);\n\t\t\t\t\t$status=CCP_IN_TAG_NAME;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTES:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_NAME;\n\t\t\t\t\t$current_attribute_name=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif (($attribute_map==array()) && (!$lax))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($attribute_map!=array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$at_map_keys=array_keys($attribute_map);\n\t\t\t\t\t\t$old_attribute_name=$at_map_keys[count($at_map_keys)-1];\n\t\t\t\t\t\t$attribute_map[$old_attribute_name].=' '.$current_attribute_name;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif ($next!=' ') $current_attribute_name.=strtolower($next);\n\t\t\t\telse $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT;\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_ATTRIBUTE_ERROR',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($next=='[')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($next==']')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE;\n\t\t\t\t\t$current_attribute_value='';\n\t\t\t\t}\n\t\t\t\telseif ($next!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE;\n\t\t\t\t\t$current_attribute_value=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE:\n\t\t\t\tif (($mindless_mode) && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==' ')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE:\n\t\t\t\tif ($mindless_mode) $tag_raw.=($next);\n\n\t\t\t\tif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($next=='\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='\"';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} elseif (substr($comcode,$pos-1,6)=='&quot;')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='&quot;';\n\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($comcode[$pos]=='\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='\\\\';\n\t\t\t\t\t\t\t$current_attribute_value.='\\\\';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t$tag_output->attach($continuation);\n\t$continuation='';\n\n\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t$tag_output->attach($close_list);\n\n\tif (($status!=CCP_NO_MANS_LAND) || (count($tag_stack)!=0))\n\t{\n\t\tif (!$lax)\n\t\t{\n\t\t\t$stack_top=array_pop($tag_stack);\n\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_BROKEN_END',is_null($stack_top)?$current_tag:$stack_top[0]),$pos,$comcode,$check_only);\n\t\t} else\n\t\t{\n\t\t\twhile (count($tag_stack)>0)\n\t\t\t{\n\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t/*if ($_last[0]=='title') Not sure about this\n\t\t\t\t{\n\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t$in_code_tag=false;\n\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t}\n\t\t}\n\t}\n\n//\t$tag_output->left_attach('<div class=\"xhtml_validator_off\">');\n//\t$tag_output->attach('</div>');\n\n\treturn $tag_output;\n}", "private static function translateLinks($text)\n {\n return preg_replace_callback('/(?<=^|\\s)(https?:\\/\\/(?:www\\.|(?!www))[^\\s\\.]+\\.[^\\s\\]\\)\\\\\"\\'\\<]{2,})(?=$|\\s)/', function ($hit) {\n $url = $hit[0];\n return UrlOembed::getOEmbed($url) ? '[' . $url . '](oembed:' . $url . ')' : $url;\n }, $text);\n }", "function submittext($URI, $formvars = \"\", $formfiles = \"\")\n\t{\n\t\tif($this->submit($URI,$formvars, $formfiles))\n\t\t{\t\t\t\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t{\n\t\t\t\t\t$this->results[$x] = $this->_striptext($this->results[$x]);\n\t\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t\t$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->results = $this->_striptext($this->results);\n\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t$this->results = $this->_expandlinks($this->results,$URI);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "private function ncc_v2_twitter_tweets_link_finder($tweet_text)\n {\n $parsed_text = preg_replace('!(http|https)(s)?:\\/\\/[a-zA-Z0-9.?&_/]+!',\n '<a href=\"\\\\0\" target=\"_blank\">\\\\0</a>',\n $tweet_text);\n\n return $parsed_text;\n }", "function booklink($term,$type,$custom=\"\"){\n$texturl=\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\";\n$esc_term=str_replace(\" \", \"+\", $term);\n$esc_term= str_replace('&+','',$esc_term);\n$texturl.=$esc_term.\"%22&amp;srchfield1=\";\nif($type==\"t\") $texturl.=\"TI%5ETITLE\";\nif($type==\"texact\") $texturl.=\"TI%5ETITLE&amp;match_on=EXACT\";\nif($type==\"a\") $texturl.=\"AU%5EAUTHOR\";\nif($type==\"i\") $texturl.=\"ISBN\";\nif($type==\"s\") $texturl.=\"GENERAL%5ESUBJECT\";\nif($custom==\"\")$custom=$term;\nif(($type==\"t\")||($type==\"texact\")) $custom=\"<i>\".$custom.\"</i>\";\necho \"<a href=\\\"\".$texturl.\"\\\">\".$custom.\"</a>\";\n\n}", "function getRenderedContent($pObj){\n\n\t\t$fRecs = $this->getRecs($pObj['records'],$pObj['orderBy'],$pObj['L'],$pObj['wrap']);\n\t\t$records = array();\n\t\tforeach($fRecs as $k=>$row){\n\t\t\t/*\n\t\t\tFAILED OR SEMIFAILED EFFORTS HERE\n\t\t\t*/\n\t\t\t//$cObj = t3lib_div::makeInstance('tslib_cObj');*/\n\t\t\t//$content = $cObj->TEXT(array('field' => 'bodytext','required' => 1,'parseFunc' => '< lib.parseFunc_RTE' ));//works but does nothing interesting!!!!!!!! But doesnt transform links\n\t\t\t//$content = $cObj->TEXT(array('field' => 'bodytext','stripHtml' => true)); //useful!!!\n\t\t\t//$content = $cObj->TEXT(array('field' => 'bodytext','makelinks'=>true,'parseFunc' => '< lib.parseFunc_RTE'));\n\t\t\t//$content = $cObj->http_makelinks($content,array());//this makes a search and replace\n\t\t\t\t\t\n\t\t\t//convert typolinks to real links\n\t\t\t//$row['bodytext'] = $this->TS_links_rte($row['bodytext'], $pObj['wrap']);\n\t\t\t//prepend relative paths with url\n\t\t\t//$row['bodytext'] = $this->makeAbsolutePaths($row['bodytext']);\n\t\t\t//$row['bodytext'] = $this->cleanHTML($row['bodytext']);\n\t\t\t\n\t\t\t//Moving these two into get recs so all bodytrext etc is extracted by default****************\n\t\t\t//$row['bodytext'] = $this->parseText($row['bodytext'],$pObj['wrap']);\n\n\n\t\t\t//if($row['header_link']){\n\t\t\t//\t$row['header_link'] = $this->TS_links_rte($row['header_link'], $pObj['wrap']);\n\t\t\t//}\n\n\t\t\t//****************************************\n\n\n\n\n\t\t\t//$content = t3lib_BEfunc::getRecord('pages', $pObj['id']);\n\t\t\t//$content = $htmlParser->TS_AtagToAbs($content);\n\t\t\t$records[] = $row;\n\t\t}\t\n\n\t\t$err = mysql_error(); \n\t\tif($err==''){\n\t\t\treturn array('result'=>$records,'callback'=>$pObj['callback']);\n\t\t}else {\n\t\t\t$error = array('errortype'=>1,'errormsg'=>$err);\n\t\t\treturn $error;\n\t\t}\n\n\t\t//$ceoConf = array('table' =>'tt_content','select.' => array('where' =>'uid='. $this->conf['reservation_email_record']));\n\n\t\t//output actual content\n\t\t//$htmlmessage = $this->cObj->CONTENT($ceoConf) .\n\t}", "function _make_url_clickable_cb($matches)\n{\n\t$ret = '';\n\t$url = $matches[2];\n\t$url = clean_url($url);\n\tif ( empty($url) )\n\t\treturn $matches[0];\n\t// removed trailing [.,;:] from URL\n\tif ( in_array(substr($url, -1), array('.', ',', ';', ':')) === true ) {\n\t\t$ret = substr($url, -1);\n\t\t$url = substr($url, 0, strlen($url)-1);\n\t}\n\treturn $matches[1] . '<a href=\"'.$url.'\"'.COMMENT_NOFOLLOW.'>'.$url.'</a>' . $ret;\n}" ]
[ "0.56089556", "0.55475175", "0.5531016", "0.54404455", "0.5396108", "0.539296", "0.53763217", "0.5354779", "0.5312818", "0.5295279", "0.5236856", "0.52172506", "0.5208449", "0.51988894", "0.5193275", "0.5192612", "0.5188484", "0.51531446", "0.5141555", "0.51037043", "0.5073847", "0.5063808", "0.5012801", "0.5003249", "0.4992701", "0.49606052", "0.49524984", "0.49456105", "0.49301082", "0.49207413", "0.4917422", "0.49143323", "0.4905548", "0.49032462", "0.48822677", "0.4874999", "0.48720804", "0.48659995", "0.48629814", "0.48576146", "0.48352426", "0.48310018", "0.48262775", "0.4824412", "0.48114437", "0.48062804", "0.48043633", "0.47780663", "0.47772822", "0.47704583", "0.47657502", "0.47621787", "0.47537926", "0.47522512", "0.4741781", "0.4737105", "0.47312993", "0.47229058", "0.47114784", "0.47086918", "0.47056624", "0.46964446", "0.4696048", "0.46878803", "0.46731952", "0.46692038", "0.46667093", "0.46665302", "0.4661785", "0.46580502", "0.46452737", "0.4643018", "0.4641199", "0.46368554", "0.46213812", "0.46101642", "0.46066815", "0.4599891", "0.45996916", "0.45976958", "0.45963553", "0.4587581", "0.45866516", "0.4583656", "0.45778966", "0.45771646", "0.4576501", "0.45757467", "0.457464", "0.4569674", "0.4565966", "0.45649308", "0.45591944", "0.45576984", "0.45440775", "0.4536756", "0.4528852", "0.45268533", "0.45188862", "0.45187685", "0.45163137" ]
0.0
-1
Convert an SMF database file to a Composr uploaded file (stored on disk).
public function data_to_disk($data, $filename, $sections, $db, $table_prefix = '', $output_filename = '', $file_base = '', $attachment_id = '') { $boardurl = ''; $boarddir = ''; require($file_base . '/Settings.php'); $homeurl = $boardurl; $forum_dir = preg_replace('#\\\\#', '/', $boarddir); // Full path to the forum folder $attachments_dir = $forum_dir . '/attachments/'; // Forum attachments directory // Start preparing the attachment file path by adding it's md5-ied filename and attachment id $file_stripped = preg_replace(array('/\s/', '/[^\w\.\-]/'), array('_', ''), $filename); $filename_fixed = ((strlen($attachment_id) > 0) ? ($attachment_id . '_' . str_replace('.', '_', $file_stripped) . md5($file_stripped)) : (str_replace('.', '_', $file_stripped) . md5($file_stripped))); $file_path = $attachments_dir . $filename_fixed; $data = ($data == '') ? @file_get_contents($file_path) : $data; $filename = ($output_filename == '') ? $filename_fixed : $output_filename; $filename = find_derivative_filename('uploads/' . $sections, $filename); $path = get_custom_file_base() . '/uploads/' . $sections . '/' . $filename; require_code('files'); cms_file_put_contents_safe($path, $data, FILE_WRITE_FIX_PERMISSIONS | FILE_WRITE_SYNC_FILE); $url = 'uploads/' . $sections . '/' . $filename; return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "function fileCommit(){\n\t\t// Target folder, make sure it is 777\n\t\t$target = \"uploads/\";\n\t\t\n\t\t// Appends the file name\n\t\t$target = $target . basename( $_FILES['file']['name']);\n\t\t\n\t\t// Moves the file to target\n\t\tmove_uploaded_file($_FILES['file']['tmp_name'], $target);\n\t\tif($_POST['sqlType'] == \"create\") {\n\t\t\t$result = mysql_query(createObject(getLangVar(\"userId\"), $_POST['objectText'], $_POST['parentId'], $_POST['objectTitle']));\n\t\t\t$result = mysql_query(createFile(fullURL($_FILES[\"file\"][\"name\"], \"uploads\"), $_FILES[\"file\"][\"size\"], $_FILES[\"file\"][\"type\"], mysql_insert_id()));\n\t\t\t$forwardId = mysql_insert_id();\n\t\t} else if($_POST['sqlType'] == \"edit\") {\n\t\t\t$result = mysql_query(editObject($_POST['objectText'], $_POST['parentId'], $_POST['objectTitle'], $_POST['objectId']));\n\t\t\t$result = mysql_query(editFile());\n\t\t\t$forwardId = $_POST['fileId'];\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"fileURL\") . $forwardId));\n\t}", "public function save() {\n\t $file = new File();\n\t $file->setName($this->name);\n\t $file->setPath($this->folder->getPath().'/'.$this->name);\n\t $file->setExtension($this->extension);\n\t $file->setSize(filesize($this->filename));\n\t \n\t $this->em->persist($file);\n\t \n\t $this->folder->addFile($file->getId());\n\t \n\t // Categorized file\n\t if ($file->isPicture()) {\n\t $image = getimagesize($this->filename);\n\t \n\t $fileType = new Picture($this->filename);\n\t $fileType->setWidth($image[0]);\n\t $fileType->setHeight($image[1]);\n\t }elseif ($file->isAudio()) {\n\t $fileType = new Audio();\n\t }elseif ($file->isVideo()) {\n\t $fileType = new Video();\n\t }else {\n\t $fileType = new Document();\n\t }\n\t \n\t if ($fileType !== null) {\n\t $fileType->setFile($file);\n\t $this->em->persist($fileType);\n\t }\n\t \n\t $this->em->flush();\n\t return $file;\n\t}", "function convert() {\n return $this->helper->post($this->fields, $this->files, $this->raw_data);\n }", "function convert($filename);", "public function storeDocument($file);", "public function convertDocument($file, ConversionRequestInterface $request): object;", "private function saveFile(AcornFile $file, $db)\n {\n \t$fileid = $file->getPrimaryKey();\n \t$zenddate = new Zend_Date();\n\t\t$filearray = array(\n \t\tself::DESCRIPTION => $file->getDescription(),\n \t\tself::FILE_TYPE => $file->getFileType(),\n \t\tself::PATH => $file->getPath(),\n \t\tself::FILE_NAME => $file->getFileName(),\n \t\tself::PKID => $file->getRelatedPrimaryKeyID(),\n \t\tself::LINK_TYPE => $file->getLinkType(),\n \t\tself::LAST_MODIFIED => $zenddate->toString(ACORNConstants::$ZEND_INTERNAL_DATETIME_FORMAT),\n \t\tself::UPLOAD_STATUS => $file->getUploadStatus(),\n \t);\n \t\n \tLogger::log($filearray);\n \t\n \tif (!is_null($file->getEnteredBy()))\n \t{\n \t\t$filearray[self::ENTERED_BY_ID] = $file->getEnteredBy()->getPrimaryKey();\n \t}\n \t\n \tif (is_null($fileid) || !$this->fileExists($fileid))\n \t{\n \t\t$filearray[self::DATE_ENTERED] = $zenddate->toString(ACORNConstants::$ZEND_INTERNAL_DATETIME_FORMAT);\n \t\t$db->insert($this->_name, $filearray);\n \t\t$fileid = $db->lastInsertId();\n \t}\n \telse \n \t{\n \t\tLogger::log('updating: ' . $fileid, Zend_Log::DEBUG);\n \t\t$db->update($this->_name, $filearray, 'FileID=' . $fileid);\n \t}\n \treturn $fileid;\n }", "function dbobject_importConvertDataFile($inputfile,$outputfile) {\n\t## first we open the file\n\t\n\t$content = file_get_contents($inputfile);\n\t$content = str_replace(\"\\r\",\"\\n\",$content);\n\t## write the file\n\t## open the file\n\t## we need to split the file into sections-\n\t## we will cut it up in slices of 1000 entries\t\t\n\t$fp = fopen($outputfile,'w');\n\tif($fp) {\n\t\t## write the data\n\t\tfwrite($fp,$content);\n\t\tfclose($fp);\n\t}\n\n }", "public function getFile($conn){\n\t\t//preparo lo statement che mi ricava tutte le informazioni \n\t\t//dalla tabella Filmato_Presentazione.\n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione\");\n\t\t$sth->execute();\n\t\treturn $sth; \n\t}", "function convert_fDB() {\n\t$start = microtime_float();\n\tglobal $mg2;\n\n\t$db_ok = false;\n\t$maxID = 0;\n\t$fDB = 'mg2db_fdatabase.php';\n\n\tif (count($mg2->all_folders) > 1) {\n\t\t$mg2->displaystatus(($mg2->sqldatabase)?\n\t\t\t\t\t'Folder data in sql table \\'mg2db_fdatabase\\' alredy exists!'\n\t\t\t\t\t:\n\t\t\t\t\t'Folder data in \\'data/'.$fDB.'\\' alredy exists!', 2\n\t\t\t\t);\n\t\treturn false;\n\t}\n\n\tdo {\n\t\t$mg2->all_folders = array();\n\t\tif (!is_file($fDB)) {\n\t\t\t$message = 'Found no folder database to import from the gallery root!';\n\t\t\tbreak;\n\t\t}\n\t\tif (!$fp = @fopen($fDB,'rb'))\tbreak;\t\t// cannot open data file\n\t\tif (!is_resource($fp))\t\t\tbreak;\t\t// $fp is no resource\n\n\t\t$mg2->folderautoid = trim(fgets($fp,16));\n\t\twhile (!feof($fp)) {\n\t\t\tif (fgets($fp,2) !== '*')\tcontinue;\t// no data row?\n\t\t\t$record = fgetcsv($fp,4600,'*');\n\t\t\t$mg2->all_folders[$record[0]] = $record;\n\t\t}\n\t\tfclose($fp);\n\n\t\tforeach ($mg2->all_folders as $key=>$record) {\n\t\t\tif (empty($record[0]))\t\tcontinue;\t// no record id found\n\n\t\t\tif ($maxID < (int)$key) $maxID = (int)$key;\n\t\t\t$mg2->all_folders[$key][1]\t = (trim($record[1])==='root')? 'root':(int)$record[1];\n\t\t\t$mg2->all_folders[$key][2]\t = str_replace(\"\\t\",' ',trim($record[2]));\n\t\t\t$mg2->all_folders[$key][3]\t = str_replace(\"\\t\",' ',trim($record[10]));\n\t\t\t$mg2->all_folders[$key][4] = (int)$record[6];\n\t\t\t$mg2->all_folders[$key][5] = (isset($record[11]))? (int)$record[11]:1;\n\t\t\t$mg2->all_folders[$key][6] = (isset($record[7]))? _getimage($record[7]):-1;\n\t\t\t$mg2->all_folders[$key][7]\t = _getsortby($record[3]);\t// sort by\n\t\t\t$mg2->all_folders[$key][7]\t|= (int)$record[4] << 4;\t// sort mode\n\t\t\t$mg2->all_folders[$key][8] = $record[5];\n\t\t\t$mg2->all_folders[$key][9] = '';\n\t\t\t$mg2->all_folders[$key][10] = '';\n\t\t\tif (isset($mg2->all_folders[$key][11])) unset($mg2->all_folders[$key][11]);\n\t\t}\n\t\tif ($maxID > $mg2->folderautoid) $mg2->folderautoid = $maxID;\n\t\t$db_ok = $mg2->write_fDB('all');\n\n\t\t// BUILD STATUS MESSAGE\n\t\t$takes = round(microtime_float() - $start,3);\n\t\t$records = count($mg2->all_folders);\n\t\t$message = 'Folder database imports '. $records .' records';\n\t\t$message.= ($db_ok)? ', it took '. $takes .' sek.':', Error!';\n\t}\n\twhile(0);\n\n\t// DISPLAY STATUS MESSAGE\n\t$mg2->displaystatus($message);\n}", "public function getFile()\r\n\t{\r\n\t\t// This if statement allows for you to continue using this class AFTER insert\r\n\t\t// basically it will only get the file if you plan on using it further which means that\r\n\t\t// otherwise it omits at least one database call each time\r\n\t\tif($this->_id instanceof ObjectID && !$this->_file instanceof GridFSDownload){\r\n\t\t\treturn $this->_file = $this->getCollection()->get($this->_id);\r\n\t\t}\r\n\t\treturn $this->_file;\r\n\t}", "public function saveFile(File $f){ \n $campi = array(\n 'id_utente' => $f->getIdUtente(),\n 'url_file' => $f->getUrlFile(),\n 'descrizione' => $f->getDescrizione()\n );\n \n $formato = array('%d', '%s', '%s');\n return parent::saveObject($campi, $formato);\n }", "function convertCSVOldFDS($directory) {\n\t\t//erase data\n\t\t$query = \"TRUNCATE TABLE old_fds\";\n\t\tmysql_query($query);\n\t\t//load file\n\t\t$files = array();\n\t\t$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));\n\t\twhile($it->valid()) {\n\t\t if (!$it->isDot()) {\n\t $files[] = $it->getSubPathName();; //add file name to array\n\t\t }\n\t\t $it->next();\n\t\t}\n\t\t//loop\n\t\t$j=1; //number\n\t\techo '= Importing transaction ='.PHP_EOL;\n\t\tfor($i=0;$i<sizeof($files);$i++) {\n\t echo $files[$i].PHP_EOL;\n\t \t\t$file = fopen($directory.$files[$i], \"r\");\n\t $emapData = fgetcsv($file, 10000, \",\");\n\t\t\twhile (($emapData = fgetcsv($file, 10000, \",\")) != false) {\n\t \t\t//solve ReDi date problem\n\t\t \t$Date_Time = $emapData[1];\n\t\t \t$Date_Time = toTimeStamp2($Date_Time);\n\t\t \t$Customer_Name = mysql_real_escape_string($emapData[4]); //biar bisa baca (')\n\t\t \t$Cust_ = explode(',', $Customer_Name);\n\t\t \t$CustomerLastName = mysql_real_escape_string($Cust_[0]);\n\t\t \t$Billing_Address = mysql_real_escape_string($emapData[18]); //biar bisa baca (')\n\t\t \t$IPID_State = mysql_real_escape_string($emapData[24]); //biar bisa baca (')\n\t\t \t$CurrentStatus = $emapData[33];\n\t\t \tif($CurrentStatus == 'NoScore') {\n\t\t \t\t$CurrentStatus = 'Deny';\n\t\t \t}\n\t\t \t$query = \"INSERT INTO old_fds (No, TxnTime, TxnId, CustomerName, CustomerEmailAddress, TxnValue, CardType, BillingAddress, BillingCountry, ShipZip, ShippingCountry, CustIPID, IPIDState, IPIDCountry, BINCountry, CurrentStatus, SubClient, CustomerLastName, ChargebackStatus, CompareStatus) VALUES ('$j', '$Date_Time', '$emapData[2]', '$Customer_Name', '$emapData[5]', '$emapData[6]', '$emapData[13]', '$Billing_Address', '$emapData[19]', '$emapData[20]', '$emapData[22]', '$emapData[23]', '$IPID_State', '$emapData[25]', '$emapData[26]', '$CurrentStatus', '$emapData[34]','$CustomerLastName', '$CurrentStatus', '-')\";\n\t\t \tif (!mysql_query($query)) {\n\t\t \t\techo 'Problem with '.$files[$i].' ';\n\t die(mysql_error()).PHP_EOL;\n\t }\n\t \t\t$j++;\n\t \t}\n\t\t}\n\t //DELETE NULL VALUE\n\t\tdeleteNullRecords('old_fds');\n\t echo 'Done'.PHP_EOL;\n\t}", "function setFileContent($db, $file, $localFilePath)\n{\n $storageType = 'local';\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n $uploadServerDetails = loadServer($db, $file);\n if ($uploadServerDetails != false)\n {\n $storageLocation = $uploadServerDetails['storagePath'];\n $storageType = $uploadServerDetails['serverType'];\n\n // if no storage path set & local, use system default\n if ((strlen($storageLocation) == 0) && ($storageType == 'local'))\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n\n if ($storageType == 'direct')\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n }\n\n // get subfolder\n $subFolder = current(explode(\"/\", $file['localFilePath']));\n $originalFilename = end(explode(\"/\", $file['localFilePath']));\n\n // use ssh to get contents of 'local' files\n if (($storageType == 'local') || ($storageType == 'direct'))\n {\n // get remote file path\n $remoteFilePath = $storageLocation . $file['localFilePath'];\n // first try setting the file locally\n $done = false;\n if ((ON_SCRIPT_INSTALL == true) && file_exists($remoteFilePath))\n {\n $done = copy($localFilePath, $remoteFilePath);\n if ($done)\n {\n return true;\n }\n }\n\n // try over ssh\n if ($done == false)\n {\n\t\t\t$sshHost = LOCAL_STORAGE_SSH_HOST;\n\t\t\t$sshUser = LOCAL_STORAGE_SSH_USER;\n\t\t\t$sshPass = LOCAL_STORAGE_SSH_PASS;\n\n\t\t\t// if 'direct' file server, get SSH details\n\t\t\t$serverDetails = getDirectFileServerSSHDetails($file['serverId']);\n\t\t\tif($serverDetails)\n\t\t\t{\n\t\t\t\t$sshHost = $serverDetails['ssh_host'];\n $sshPort = $serverDetails['ssh_port'];\n\t\t\t\t$sshUser = $serverDetails['ssh_username'];\n\t\t\t\t$sshPass = $serverDetails['ssh_password'];\n\t\t\t\t$basePath = $serverDetails['file_storage_path'];\n\t\t\t\tif(substr($basePath, strlen($basePath)-1, 1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$basePath = substr($basePath, 0, strlen($basePath)-1);\n\t\t\t\t}\n\t\t\t\t$remoteFilePath = $basePath . '/' . $file['localFilePath'];\n\t\t\t}\n \n if(strlen($sshPort) == 0)\n {\n $sshPort = 22;\n }\n\t\t\t\n // connect to 'local' storage via SSH\n $sftp = new Net_SFTP($sshHost, $sshPort);\n if (!$sftp->login($sshUser, $sshPass))\n {\n output(\"Error: Failed logging into \" . $sshHost . \" (Port: \".$sshPort.\") via SSH..\\n\");\n\n return false;\n }\n\n // overwrite file\n $rs = $sftp->put($remoteFilePath, $localFilePath, NET_SFTP_LOCAL_FILE);\n if ($rs)\n {\n return true;\n }\n\n output(\"Error: Failed uploading converted file to \" . LOCAL_STORAGE_SSH_HOST . \" (\" . $remoteFilePath . \") via SSH..\\n\");\n }\n\n return false;\n }\n\n // ftp\n if ($storageType == 'ftp')\n {\n // setup full path\n $prePath = $uploadServerDetails['storagePath'];\n if (substr($prePath, strlen($prePath) - 1, 1) == '/')\n {\n $prePath = substr($prePath, 0, strlen($prePath) - 1);\n }\n $remoteFilePath = $prePath . '/' . $file['localFilePath'];\n\n // connect via ftp\n $conn_id = ftp_connect($uploadServerDetails['ipAddress'], $uploadServerDetails['ftpPort'], 30);\n if ($conn_id === false)\n {\n output('Could not connect to ' . $uploadServerDetails['ipAddress'] . ' to upload file.');\n return false;\n }\n\n // authenticate\n $login_result = ftp_login($conn_id, $uploadServerDetails['ftpUsername'], $uploadServerDetails['ftpPassword']);\n if ($login_result === false)\n {\n output('Could not login to ' . $uploadServerDetails['ipAddress'] . ' with supplied credentials.');\n return false;\n }\n\n // get content\n $rs = ftp_put($conn_id, $remoteFilePath, $localFilePath, FTP_BINARY);\n if ($rs == true)\n {\n return true;\n }\n }\n\n output(\"Error: Failed uploading converted file to \" . $uploadServerDetails['ipAddress'] . \" via FTP..\\n\");\n\n return false;\n}", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "function upload()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',\t\t\tNOTSET,'any');\r\n\t\t$args->set('format_id', \tNOTSET,'any');\t\t\n\t\t$args->set('filename', \t\tNOTSET,'any');\t\t\r\n\t\t$args->set('userfile', \t\tNOTSET,'any');\t// must be the same declares in $_Files['userfile']\t\n\t\t$args->set('header', \t\t0,'any');\t\n\t\t$args->set('duplicate', \tNOTSET,'any');\n\t\t$args->set('related', \t\tNOTSET,'any');\t\t\t\t\t\t\t\r\n\t\t$args = $args->get(func_get_args());\r\n\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \n \n // set up the different files format supported\n\t\t$fileFormat = array(\r\n\t array ( 'format_id' => ',', \t\t'format_name' => lang('Generic CSV file with comma delimiter')),\r\n\t array ( 'format_id' => ';', \t\t'format_name' => lang('Generic CSV file with semicolon delimiter')),\r\n\t array ( 'format_id' => ' ', \t\t'format_name' => lang('Generic CSV file with space delimiter')),\r\n\t array ( 'format_id' => chr(9), \t\t'format_name' => lang('Generic CSV file with tab delimiter')),\n\t //array ( 'format_id' => 'xls2002', 'format_name' => lang('MS Excel 2002 file (.xls)')),\t \n\t //array ( 'format_id' => 'access', \t'format_name' => lang('MS Access 2002 file')),\t \t \n\t //array ( 'format_id' => 'xml', \t'format_name' => lang('XML file'))\t \r\n\t ); \n\t \n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display\r\n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) || !$GLOBALS['appshore']->rbac->checkPermissionOnFeature($this->appRole, 'import'))\r\n {\r\n\t\t\tmessagebox( ERROR_PERMISSION_DENIED, ERROR);\r\n\t\t\treturn execMethod( $this->appName.'.base.start', null, true);\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Next':\r\n\t\t\t\r\n\t\t\t\tif ( $args['header'] != 1)\r\n\t\t\t\t\t$args['header'] = 0;\n\t\t\t\tif ( $args['duplicate'] != 1)\r\n\t\t\t\t\t$args['duplicate'] = 0;\t\t\n\t\t\t\tif ( $args['related'] != 1)\r\n\t\t\t\t\t$args['related'] = 0;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t// test if upload gone well\r\n\t\t\t\tif (is_uploaded_file( $_FILES['userfile']['tmp_name']))\n\t\t\t\t{ \n\t\t\t\t\tmove_uploaded_file( $_FILES['userfile']['tmp_name'], $_FILES['userfile']['tmp_name'].'.imp');\n\t\t\t\t\t$args['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\n\t\t\t\t\t$_SESSION['import']['format_id'] = $args['format_id'] ;\n\t\t\t\t\t$_SESSION['import']['filename'] = $args['filename'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['userfile'] = $_FILES['userfile']['name'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['header'] = $args['header'];\n\t\t\t\t\t\n\t\t\t\t\tif( $this->isDuplicate )\t\t\n\t\t\t\t\t\t$_SESSION['import']['duplicate'] = $args['duplicate'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['duplicate']);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->isRelated )\t\t\n\t\t\t\t\t\t$_SESSION['import']['related'] = $args['related'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['related']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset( $args['key']);\t\t\t\t\t\t\n\t\t\t\t\t$result = $this->selectFields( $args);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t messagebox( ERROR_INVALID_DATA, ERROR);\t\n\t $result['error']['userfile'] = ERROR_MANDATORY_FIELD;\t\t\t\t\n\t\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t\t$result['format'] = $fileFormat;\t\n\t\t\t\t}\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\r\n\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t$result['format'] = $fileFormat;\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\n\t\t\t\t$result['import']['isDuplicate'] = $this->isDuplicate;\t\n\t\t\t\t$result['import']['isRelated'] = $this->isRelated;\t\t\t\t\t\t\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\r\n return $result;\r\n }", "public function save_file_to_db($table_name, $file_name_column, $file_content_column, $full_path_to_file, $where = '')\n {\n\n if (!is_file($full_path_to_file))\n return false;\n\n //Lay ten file\n $arr_path_info = pathinfo($full_path_to_file);\n $str_file_name = $this->db->qstr($arr_path_info['basename']);\n\n //Luu ten file\n $sql = \"Update $table_name set $file_name_column = $str_file_name\";\n $sql .= ($where == '') ? '' : \" where $where\";\n $this->db->Execute($sql);\n\n //Luu noi dung file\n $this->db->UpdateBlobFile($table_name, $file_content_column, $full_path_to_file, $where);\n }", "public function getFile() {}", "public function getFile() {}", "public function getFile();", "public function getFile();", "function uploadMaterial(){\n if(isset($_FILES['userfile'])) {\n // Make sure the file was sent without errors\n if($_FILES['userfile']['error'] == 0) {\n \n // Gather all required data \n $name = $_FILES['userfile']['name'];\n $type = $_FILES['userfile']['type'];\n $content = $_FILES['userfile']['tmp_name']; //this is the actual file\n \n // Create the SQL query\n $query = \"INSERT INTO _uploaded_mateirial('cwid','course_id','file_name', 'file_type','content')VALUES('$cwid','$courseID','$name', '$type','$content')\";\n \n // Execute the query\n $result = $this->connection->query($query);\n \n // Check if it was successfull\n if($result) {\n echo 'Success! Your file was successfully added!';\n }\n else {\n echo 'Error! Failed to insert the file'\n . \"<pre>{$this->connection->error}</pre>\";\n }\n }\n else {\n echo 'An error accured while the file was being uploaded. '\n .'Error code: '. intval($_FILES['userfile']['error']);\n }\n \n \n }\n else {\n echo 'Error! A file was not sent!';\n } \n\n }", "public function getFile ();", "protected function convert($file)\n {\n $image = Image::createFromFile($file);\n\n foreach ($this->operations as $operation) {\n call_user_func_array([$image, $operation[0]], $operation[1]);\n }\n\n $destination_path = preg_replace('/^'.preg_quote($this->origin, '/').'/', $this->destination, $file);\n\n $dir = dirname($destination_path);\n\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n\n $image->save($destination_path);\n }", "function uploadImageIntoDB($file)\n {\n $pfad = $file[tmp_name];\n $typ = GetImageSize($pfad);\n // Bild hochladen\n $filehandle = fopen($pfad,'r');\n $filedata = base64_encode(fread($filehandle, filesize($pfad)));\n $dbtype = $typ['mime'];\n return array(\"bild\"=>$filedata,\"typ\"=>$dbtype);\n }", "function convertFile($file) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"image-to-image\", \"The file must exist and not be empty.\", \"convert_file\"), 470);\n \n $this->files['file'] = $file;\n return $this->helper->post($this->fields, $this->files, $this->raw_data);\n }", "function convertToFile($file_path) {\n if (!($file_path != null && $file_path !== ''))\n throw new Error(create_invalid_value_message($file_path, \"file_path\", \"pdf-to-pdf\", \"The string must not be empty.\", \"convert_to_file\"), 470);\n \n $output_file = fopen($file_path, \"wb\");\n $this->convertToStream($output_file);\n fclose($output_file);\n }", "abstract public function convert_to_storage();", "protected function migrate_course_files() {\n $path = $this->converter->get_tempdir_path().'/course_files';\n $ids = array();\n $fileman = $this->converter->get_file_manager($this->converter->get_contextid(CONTEXT_COURSE), 'course', 'legacy');\n if (file_exists($path)) {\n $ids = $fileman->migrate_directory($path);\n $this->converter->set_stash('course_files_ids', $ids);\n }\n }", "public function pathToSQLFile();", "function convertFileToFile($file, $file_path) {\n if (!($file_path != null && $file_path !== ''))\n throw new Error(create_invalid_value_message($file_path, \"file_path\", \"image-to-image\", \"The string must not be empty.\", \"convert_file_to_file\"), 470);\n \n $output_file = fopen($file_path, \"wb\");\n if (!$output_file)\n throw new \\Exception(error_get_last()['message']);\n try\n {\n $this->convertFileToStream($file, $output_file);\n fclose($output_file);\n }\n catch(Error $why)\n {\n fclose($output_file);\n unlink($file_path);\n throw $why;\n }\n }", "function convertFile($file) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file must exist and not be empty.\", \"convert_file\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file name must have a valid extension.\", \"convert_file\"), 470);\n \n $this->files['file'] = $file;\n return $this->helper->post($this->fields, $this->files, $this->raw_data);\n }", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "function convertFile($file) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"image-to-pdf\", \"The file must exist and not be empty.\", \"convert_file\"), 470);\n \n $this->files['file'] = $file;\n return $this->helper->post($this->fields, $this->files, $this->raw_data);\n }", "private function convertFiles(){\n\n\t\t//Create folder in tmp for files\n\t\tmkdir('./tmp/course_files');\n\t\t$sectionCounter = 0;\n\t\n\t\t//Add section to manifest\n\t\tHelper::addIMSSection($this->manifest, $this->currentSectionCounter, $this->identifierCounter, 'Documents');\n\n\t\t$section = $this->manifest->organizations->organization->item->item[$this->currentSectionCounter];\n\t\t\n\t\t//Find all folders and documents\n\t\t$query = \"SELECT document.`path`,document.`filename`,document.`format`,document.`title` FROM document WHERE document.`course_id`=\".$this->course_id.\" ORDER BY path;\";\n\t\t$result = mysqli_query($this->link,$query);\n\t\t\n\t\twhile($data = $result->fetch_assoc())\n\t\t{\n\t\t\t//Find item level\n\t\t\t$level = substr_count($data['path'], '/') - 1;\n\n\t\t\t//If it is a file\n\t\t\tif($data['format']!='.dir')\n\t\t\t{\n\t\t\t\t$s_filename = Helper::sanitizeFilename($data['filename']);\n\t file_put_contents('./tmp/course_files/'.$s_filename, fopen($this->host.'/courses/'.$this->course['code'].'/document'.$data['path'], 'r'));\n\t\t\t\tHelper::addIMSItem($section, $this->manifest, $sectionCounter, $this->identifierCounter, $this->resourceCounter, 'file', $data, $level); \n\t\t\t}\n\t\t\t//If it is a directory\n\t\t\telse if($data['format']=='.dir')\n\t\t\t{\n\t\t\t\tHelper::addIMSLabel($section, $sectionCounter, $this->identifierCounter, $data['filename'], $level);\n\t\t\t}\n\t\t}\n\n\t\t//Proceed to next section\n\t\t$this->currentSectionCounter++;\n\t}", "public function storeFile()\n\t{\n\t\tif (!$this->blnIsModified)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$strFile = trim($this->strTop) . \"\\n\\n\";\n\t\t$strFile .= \"-- LESSON SEGMENT START --\\nCREATE TABLE `tl_cb_lessonsegment` (\\n\";\n\n\t\tforeach ($this->arrData as $k=>$v)\n\t\t{\n\t\t\t$strFile .= \" `$k` $v,\\n\";\n\t\t}\n\n\t\t$strFile .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n-- LESSON SEGMENT STOP --\\n\\n\";\n\n\t\tif ($this->strBottom != '')\n\t\t{\n\t\t\t$strFile .= trim($this->strBottom) . \"\\n\\n\";\n\t\t}\n\n\t\t$objFile = new File('system/modules/course_builder/config/database.sql');\n\t\t$objFile->write($strFile);\n\t\t$objFile->close();\n\t}", "public function convert(File $file, $hasHeaders);", "public function convert($file, $newVersion): void;", "function convertFile($file) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file must exist and not be empty.\", \"convert_file\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file name must have a valid extension.\", \"convert_file\"), 470);\n \n $this->files['file'] = $file;\n return $this->helper->post($this->fields, $this->files, $this->raw_data);\n }", "public function upload()\n\t {\n\t\t $this->validator->validate( Input::all() );\n\n\t\t $data = $this->upload->upload( Input::file('file') , Input::get('destination') );\n\n $colloque_file = $this->file->create(\n array(\n 'filename' => $data['name'],\n 'type' => Input::get('type'),\n 'colloque_id' => Input::get('colloque_id')\n )\n );\n\n return Redirect::back()->with( array('status' => 'success' , 'message' => 'Fichier ajouté') );\n\n\t }", "public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}", "function convertFileToFile($file, $file_path) {\n if (!($file_path != null && $file_path !== ''))\n throw new Error(create_invalid_value_message($file_path, \"file_path\", \"html-to-image\", \"The string must not be empty.\", \"convert_file_to_file\"), 470);\n \n $output_file = fopen($file_path, \"wb\");\n if (!$output_file)\n throw new \\Exception(error_get_last()['message']);\n try\n {\n $this->convertFileToStream($file, $output_file);\n fclose($output_file);\n }\n catch(Error $why)\n {\n fclose($output_file);\n unlink($file_path);\n throw $why;\n }\n }", "protected function migrateFileFromDamToFal(array $damRecord, \\TYPO3\\CMS\\Core\\Resource\\File $fileObject) {\n\t\t// in getProperties() we don't have the required UID of metadata record\n\t\t// if no metadata record is available it will automatically created within FAL\n\t\t$metadataRecord = $fileObject->_getMetaData();\n\n\t\tif (is_array($metadataRecord)) {\n\t\t\t// update existing record\n\t\t\t$this->database->exec_UPDATEquery(\n\t\t\t\t'sys_file_metadata',\n\t\t\t\t'uid = ' . $metadataRecord['uid'],\n\t\t\t\t$this->createArrayForUpdateInsertSysFileRecord($damRecord)\n\t\t\t);\n\n\t\t\t// add the migrated uid of the DAM record to the FAL record\n\t\t\t$this->database->exec_UPDATEquery(\n\t\t\t\t'sys_file',\n\t\t\t\t'uid = ' . $fileObject->getUid(),\n\t\t\t\tarray('_migrateddamuid' => $damRecord['uid'])\n\t\t\t);\n\t\t}\n\t}", "abstract public function store(File $file);", "function convertFileToFile($file, $file_path) {\n if (!($file_path != null && $file_path !== ''))\n throw new Error(create_invalid_value_message($file_path, \"file_path\", \"image-to-pdf\", \"The string must not be empty.\", \"convert_file_to_file\"), 470);\n \n $output_file = fopen($file_path, \"wb\");\n if (!$output_file)\n throw new \\Exception(error_get_last()['message']);\n try\n {\n $this->convertFileToStream($file, $output_file);\n fclose($output_file);\n }\n catch(Error $why)\n {\n fclose($output_file);\n unlink($file_path);\n throw $why;\n }\n }", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "public function uploadFileToCloud() {\n\n\t\ttry {\n\n\t\t\tif (!Request::hasFile('file')) throw new \\Exception(\"File is not present.\");\n\n\t\t\t$attachmentType = Request::input('attachment_type');\n\n\t\t\tif (empty($attachmentType)) throw new \\Exception(\"Attachment type is missing.\");\n\n\t\t\t$file = Request::file('file');\n\n\t\t\tif (!$file->isValid()) throw new \\Exception(\"Uploaded file is invalid.\");\n\n\t\t\t$fileExtension = strtolower($file->getClientOriginalExtension());\n\t\t\t$originalName = $file->getClientOriginalName();\n\n\t\t\tif ($attachmentType == 'image' || $attachmentType == 'logo') {\n\t\t\t\tif (!in_array($fileExtension, array('jpg', 'png', 'tiff', 'bmp', 'gif', 'jpeg', 'tif'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t} else if ($attachmentType == 'audio') {\n\t\t\t\tif (!in_array($fileExtension, array('mp3', 'wav'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t}\n\n\t\t\t$additionalImageInfoString = Request::input('additionalImageInfo');\n\n\t\t\t$attachmentObj = ConnectContentAttachment::createAttachmentFromFile(\\Auth::User()->station->id, $file, $attachmentType, $originalName, $fileExtension, $additionalImageInfoString);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('attachment_id' => $attachmentObj->id, 'filename' => $originalName, 'url' => $attachmentObj->saved_path)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "final function getFile();", "public function uploadFileManufacturer(){\r\n $file = Input::file('file');\r\n $manufacturerId = Input::get('MANUFACTURER');\r\n $adminId = Input::get('CONSULTANT');\r\n $manufacturer = Project::find($manufacturerId);\r\n if($manufacturer!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n if(!File::exists(\"files/manufacturerFiles/\".$manufacturerId.\"/\")) {\r\n File::makeDirectory(\"files/manufacturerFiles/\".$manufacturerId.\"/\", 0755, true);\r\n }\r\n $file->move(public_path().'/files/manufacturerFiles/'.$manufacturerId.'/', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = 0;\r\n $uploadFile->manufacturer_id = $manufacturerId;\r\n $uploadFile->url = \"files/manufacturerFiles/\".$manufacturerId.\"/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n Transaction::createTransaction($adminId,'','','UPLOAD_FILE_FROM_MANUFACTURER',$fileName,'','','','','','');\r\n }\r\n }\r\n }", "function _convert() {\n\t\tif ($this->hasError()) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t convert document, object has an error ...');\n\t\t\treturn false;\n\t\t}\n\t\t//get tmp path\n\t\t$tmpPath = CMS_file::getTmpPath();\n\t\tif (!$tmpPath) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t get temporary path to write in ...');\n\t\t\treturn false;\n\t\t}\n\t\t//generate random filename\n\t\t$filename = sensitiveIO::sanitizeAsciiString('filter_'.APPLICATION_LABEL.'_'.microtime());\n\t\twhile(is_file($tmpPath.'/'.$filename)) {\n\t\t\t$filename = sensitiveIO::sanitizeAsciiString('filter_'.APPLICATION_LABEL.'_'.microtime());\n\t\t}\n\t\t$this->_convertedDocument = $tmpPath.'/'.$filename;\n\t\tif (!touch($this->_convertedDocument)) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t create temporary document : '.$this->_convertedDocument);\n\t\t\treturn false;\n\t\t}\n\t\t//convert document\n\t\tif (!file_put_contents($this->_convertedDocument, html_entity_decode($this->stripTags(file_get_contents($this->_sourceDocument)), ENT_COMPAT, (strtolower(APPLICATION_DEFAULT_ENCODING) != 'utf-8' ? 'ISO-8859-1' : 'UTF-8')))) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t convert HTML document ... ');\n\t\t\treturn false;\n\t\t}\n\t\t//run some cleaning task on converted document command\n\t\t$this->_cleanConverted();\n\t\treturn true;\n\t}", "function value2db($rec)\n {\n // Let the customdir function set the storage dir for the documentfile\n $this->m_dir = $this->customdir($rec, $this->defaultdir($rec, \"dir\"));\n\n // Use the default value2db function\n $result = parent::value2db($rec);\n\n // Get the filename\n $filename = $this->m_dir . $rec[$this->fieldName()][\"filename\"];\n\n if (file_exists($filename))\n {\n // Modify the file rights:\n chmod($this->m_dir . $rec[$this->fieldName()][\"filename\"], 0660);\n\n // Modify the file group if set in config:\n if (atkconfig::get(\"docmanager\",\"docmanager_filegroup\") != \"\")\n chgrp($this->m_dir . $rec[$this->fieldName()][\"filename\"], atkconfig::get(\"docmanager\",\"docmanager_filegroup\"));\n }\n else\n {\n atkerror(\"documentFileAttribute->value2db: File '$filename' does not exist.\");\n }\n\n return $result;\n }", "public function uploadFileAttCS(){\r\n $file = Input::file('file');\r\n $attId = Input::get('CONSULTANT');\r\n $projectId = Input::get('PROJECT');\r\n $command = Input::get('COMMAND');\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n if(!File::exists(\"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/attClientServices\")) {\r\n File::makeDirectory(\"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/attClientServices\", 0755, true);\r\n }\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/attClientServices', $fileName);\r\n\r\n //create the row in upload file\r\n $uploadFile = UploadedFiles::where(['fileName'=>$fileName,'project_id'=>$projectId])->first();\r\n if($uploadFile != null){\r\n $uploadFile->delete();\r\n }\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/attClientServices/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->attorney = 1;\r\n $uploadFile->admin_id = $attId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n if($command == 'APP') {\r\n $otherFiles = UploadedFiles::where('project_id',$projectId)->where('filingReceipt',1)->get();\r\n foreach($otherFiles as $otherF){\r\n $otherF->filingReceipt=0;\r\n $otherF->save();\r\n }\r\n $uploadFile->filingReceipt = 1;\r\n }\r\n $uploadFile->save();\r\n\r\n Transaction::createTransaction($attId,'','','UPLOAD_FILE_CS_ATT',$fileName,$projectId,'','','','','');\r\n }\r\n }\r\n }", "function importDatabase($category) {\n\t\t\n\t\t//which file are we looking for?\n\t\t$files_by_category = array(\n\t\t\t'agents'=>'rapidnyc_agents.json',\n\t\t\t'listings'=>'rapidnyc_listings.json',\n\t\t\t'photos'=>'rapidnyc_photos.json'\t\t\t\n\t\t);\n\t\t$useFile = $files_by_category[$category];\n\t\tif (!$useFile) { exit; }\n\t\t\n\t\t//expand our time limit\n\t\t//ini_set('memory_limit', '150M');\n\t\tset_time_limit(300);\n\t\t\t\t\n\t\t//download the latest feed from cloud sites\n\t\t//Now lets create a new instance of the authentication Class.\n\t\t$auth = new CF_Authentication('alolli','ad44fbd40fe0a0d2e9cdf95ee2249d97');\n\t\t//Calling the Authenticate method returns a valid storage token and allows you to connect to the CloudFiles Platform.\n\t\t$auth->authenticate();\n\t\t//The Connection Class Allows us to connect to CloudFiles and make changes to containers; Create, Delete, Return existing containers. \n\t\t$conn = new CF_Connection($auth);\n\t\t//Get our container and object\n\t\t//$cont = $conn->get_container('Rapid_DatabaseSync');\n\t\t$cont = $conn->get_container('Rapid_ListingsPhotos_Deleted');\n\t\t$obj = $cont->get_object($useFile);\n\t\t//now stream into a local file\n\t\t$path = TMP . $useFile;\n\t\theader(\"Content-Type: \" . $obj->content_type);\n\t\t$output = fopen($path, 'w');\n\t\t$obj->stream($output); # stream object content to PHP's output buffer\n\t\tfclose($output);\n\t\t\n\t\t//open and decode our local file\n\t\t$data = file_get_contents($path);\n\t\t$data = json_decode($data, true);\n\t\t//echo '<pre>'; print_r($data); die;\n\t\t//delete our feed file\n\t\tunlink($path);\n\t\t\t\t\n\t\t//get import counts\n\t\t$agents_count = count($data['Agents']);\n\t\t$listings_count = count($data['Listings']);\n\t\t$listingPhotos_count = count($data['ListingPhotos']);\n\t\t$listingVideos_count = count($data['ListingVideos']);\n\t\t$neighborhoods_count = count($data['Neighborhoods']);\n\t\t$regions_count = count($data['Regions']);\n\t\t$offices_count = count($data['Offices']);\n\t\t\n\t\tif($data['Agents']){\n\t\t\t//AGENTS\n\t\t\tif ($agents_count>10) {\n\t\t\t\t$this->Agent->query(\"TRUNCATE TABLE agents\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['Agents'],100);\n\t\t\tunset($data['Agents']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->Agent->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\n\t\tif($data['Listings']){\n\t\t\t//LISTINGS\n\t\t\tif ($listings_count>30) { \n\t\t\t\t$this->Listing->query(\"TRUNCATE TABLE listings\"); \n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['Listings'],100);\n\t\t\tunset($data['Listings']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->Listing->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($data['ListingPhotos']){\n\t\t\t//LISTING PHOTOS\n\t\t\tif ($listingPhotos_count>20) {\n\t\t\t\t$this->ListingPhoto->query(\"TRUNCATE TABLE listing_photos\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['ListingPhotos'],200);\n\t\t\tunset($data['ListingPhotos']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->ListingPhoto->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif($data['ListingVideos']){\n\t\t\t//LISTING VIDEOS\n\t\t\tif ($listingVideos_count) {\n\t\t\t\t$this->Listing->query(\"TRUNCATE TABLE listing_videos\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['ListingVideos'],200);\n\t\t\tunset($data['ListingVideos']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->ListingVideo->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($data['Neighborhoods']){\n\t\t\t//NEIGHBORHOODS\n\t\t\tif ($neighborhoods_count>10) {\n\t\t\t\t$this->Neighborhood->query(\"TRUNCATE TABLE neighborhoods\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['Neighborhoods'],100);\n\t\t\tunset($data['Neighborhoods']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->Neighborhood->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\t\n\t\t\t\t\n\t\t\n\t\tif($data['Regions']){\n\t\t\t//REGIONS\n\t\t\tif ($regions_count>2) {\n\t\t\t\t$this->Region->query(\"TRUNCATE TABLE regions\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['Regions'],100);\n\t\t\tunset($data['Regions']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->Region->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t\n\t\tif($data['Offices']){\n\t\t\t//OFFICES\n\t\t\tif ($offices_count>5) {\n\t\t\t\t$this->Office->query(\"TRUNCATE TABLE offices\");\n\t\t\t}\n\t\t\t//break up into chunks and save\n\t\t\t$chunks = array_chunk($data['Offices'],100);\n\t\t\tunset($data['Offices']);\n\t\t\tforeach ($chunks as $chunk_k=>$chunk) {\n\t\t\t\t//save\n\t\t\t\t$this->Office->saveMany($chunk);\n\t\t\t\tunset($chunks[$chunk_k]);\n\t\t\t}\n\t\t}\t\n\t\t\t\n\t\t\n\t\t\n\t\t//setup results array\n\t\t$results = array(\n\t\t\t'Agents' => $agents_count,\n\t\t\t'Listings' => $listings_count,\n\t\t\t'Listing Photos' => $listingPhotos_count,\n\t\t\t'Listing Videos' => $listingVideos_count,\n\t\t\t'Neighborhoods' => $neighborhoods_count,\n\t\t\t'Regions' => $regions_count,\n\t\t\t'Offices' => $offices_count\n\t\t);\n\t\treturn $results;\n\t\t\n\t}", "function database_saving($file){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $dbname = \"demo\";\n\n// Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n// Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql = \"INSERT INTO uploaded_files (file_name)VALUES ('$file')\";\n $conn->query($sql);\n $conn->close();\n\n}", "function dest_path_and_file()\r\n{ \r\n global $xoopsDB, $xoopsUser;\r\n \r\n // Initialize magic_number. This number is used to create unique file names in order to guarantee that 2 file names\r\n // will not be identical if 2 users upload a file at the exact same time. 100000 will allow almost 100000 users to use\r\n // this system. Ok, the odds of this happening are slim; but, I want the odds to be zero.\r\n $magic_number = 100000; \r\n \r\n // Get the location of the document repository\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='doc_path'\";\r\n $file_sys_root = mysql_result(mysql_query($query),'data');\r\n \r\n // Get the current value of max_file_sys_counter\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='max_file_sys_counter'\";\r\n $max_file_sys_counter = (integer) mysql_result(mysql_query($query),'data');\r\n \r\n // Determine the path and filename of the new file\r\n $query = \"SELECT * from \".$xoopsDB->prefix(\"dms_file_sys_counters\");\r\n $dms_file_sys_counters = mysql_fetch_array(mysql_query($query));\r\n \r\n $file_sys_dir_1 = $dms_file_sys_counters['layer_1'];\r\n $file_sys_dir_2 = $dms_file_sys_counters['layer_2'];\r\n $file_sys_dir_3 = $dms_file_sys_counters['layer_3'];\r\n $file_sys_file = $dms_file_sys_counters['file'];\r\n $file_sys_file_name = ($file_sys_file * $magic_number) + $xoopsUser->getVar('uid');\r\n \r\n $dir_path_1 = $file_sys_root.\"/\".$file_sys_dir_1;\r\n $dir_path_2 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2;\r\n $dir_path_3 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n \r\n //$doc_path = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n $path_and_file = $file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3.\"/\".$file_sys_file_name;\r\n //$dest_path_and_file = $doc_path.\"/\".$file_sys_file_name;\r\n \r\n //print $path_and_file;\r\n //exit(0);\r\n \r\n // Determine the next file system counter values and save them for future use.\r\n $file_sys_file++;\r\n if ($file_sys_file > $max_file_sys_counter) \r\n {\r\n\t$file_sys_file = 1;\r\n\t$file_sys_dir_3++;\r\n\t} \r\n \r\n if ($file_sys_dir_3 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_3 = 1;\r\n\t$file_sys_dir_2++;\r\n\t}\r\n\t\r\n if ($file_sys_dir_2 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_2 = 1;\r\n\t$file_sys_dir_1++;\r\n\t}\r\n\t\r\n $query = \"UPDATE \".$xoopsDB->prefix(\"dms_file_sys_counters\").\" SET \";\r\n $query .= \"layer_1 = '\".(integer) $file_sys_dir_1.\"', \";\r\n $query .= \"layer_2 = '\".(integer) $file_sys_dir_2.\"', \";\r\n $query .= \"layer_3 = '\".(integer) $file_sys_dir_3.\"', \";\r\n $query .= \"file = '\".(integer) $file_sys_file. \"' \";\r\n \r\n mysql_query($query); \r\n\r\n // Ensure that the final destination directories exist...if not, then create the directory or directories.\r\n if (!is_dir($dir_path_1)) \r\n {\r\n\tmkdir($dir_path_1,0775);\r\n chmod($dir_path_1,0777);\r\n\t}\r\n \r\n if (!is_dir($dir_path_2))\r\n {\r\n\tmkdir($dir_path_2,0775); \r\n chmod($dir_path_2,0777);\r\n }\r\n\t\r\n if (!is_dir($dir_path_3)) \r\n {\r\n\tmkdir($dir_path_3,0775);\r\n chmod($dir_path_3,0777);\r\n\t}\r\n\t\r\n return($path_and_file);\r\n}", "public function save($file)\n\t{\n\t\t$f = fopen($file, 'w');\n\t\t$this->convert();\n\t\tstream_copy_to_stream($this->pipes[1], $f);\n\t\tfclose($f);\n\t\t$this->close();\n\t}", "public function save()\n {\n if (!$this->getResource(true)) {\n return $this;\n }\n\n $fileformat = $this->getVar('fileformat');\n\n\n\t\t\t\t/***\n\t\t\t\t**** Code if format is xls or xlsx\n\t\t\t\t***/\n if($fileformat=='xls' || $fileformat=='xlsx')\n {\n\t\t\t\t\t\tif($this->getVar('type')=='ftp')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->saveOnFtp();//copy local Excel file from temp folder(var/export/ftp) to remote server\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($this->getVar('type')=='sftp')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$file = 'var/export/ftp/export_file.'.$this->getVar('fileformat');//temp file path on local server\n\t\t\t\t\t\t\t\t$remote_file = $this->getVar('filename');\n\t\t\t\t\t\t\t\tif($this->getVar('path'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$remote_file = $this->getVar('path').'/'.$remote_file;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$result = $this->getResource()->write($remote_file, $file);\n\t\t\t\t\t\t}\n \n \t\treturn $this;\n }\n\n\n $batchModel = Mage::getSingleton('dataflow/batch');\n\n $dataFile = $batchModel->getIoAdapter()->getFile(true); \t\t\n \n\n $filename = $this->getVar('filename');\n\n if($this->getVar('path') && $this->getVar('type')=='sftp')\n\t\t\t\t{\n\t\t\t\t\t\t$filename = $this->getVar('path').'/'.$filename;\n\t\t\t\t}\n\n\n\n\t\t\t\t/**\n\t\t\t\t* Save products separately in case of all formats except xls and xlsx\n\t\t\t\t**/\n\t\t\t\t$profileId = Mage::registry('current_convert_profile')->getId();\n\n\t\t\t\t$entityType = Mage::registry('current_convert_profile')->getEntityType();\n\n\t\t\t\t$oopprofile = Mage::getModel('oopsprofile/oopsprofile')->getCollection()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->addFieldToFilter('dataflow_profile_id',$profileId)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getFirstItem();\n\n\t\t\t\t$saveMultipleCopies = $oopprofile->getSaveProductsSeparately();\n\t\t\t\tif($saveMultipleCopies==1 && $entityType=='product')//if \"Save Products Separately\" enable\n\t\t\t\t{\n\t\t\t\t\t\t$batchId = $batchModel->getId();\n\n\t\t\t\t\t\t//$i = 1;\n\t\t\t\t\t\t$fileName = $filename;\n\t\t\t\t\t\tforeach(glob('var/tmp/batch_'.$batchId.'*.tmp') as $dataFileName)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dFile1 = explode('.',$dataFileName);\n\t\t\t\t\t\t\t\t$dFile2 = explode('_',$dFile1[0]);\n\t\t\t\t\t\t\t\t$id = $dFile2[count($dFile2)-1];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$filename = '';\n\t\t\t\t\t\t\t\t$explodedata = explode('.',$fileName);\n\t\t\t\t\t\t\t\t$Name = $explodedata[0].'_'.$id;\n\t\t\t\t\t\t\t\t$filename = $Name.'.'.$explodedata[1];\n\t\t\t\t\t\t\t\t$result = $this->getResource()->write($filename, $dataFileName, 0777);\n\t\t\t\t\t\t\t\tif (false === $result) {\n\t\t\t\t\t\t\t\t\t $message = Mage::helper('dataflow')->__('Could not save file: %s.', $filename);\n\t\t\t\t\t\t\t\t\t Mage::throwException($message);\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t* Save Local copies in case of all formats except xls and xlsx\n\t\t\t\t\t\t\t\t\t\t**/\n\t\t\t\t\t\t\t\t\t\t$profileId = Mage::registry('current_convert_profile')->getId();\n\n\t\t\t\t\t\t\t\t\t\t$oopprofile = Mage::getModel('oopsprofile/oopsprofile')->getCollection()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->addFieldToFilter('dataflow_profile_id',$profileId)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getFirstItem();\n\n\t\t\t\t\t\t\t\t\t\t$saveLocalCopies = $oopprofile->getSaveLocalCopy();\n\n\t\t\t\t\t\t\t\t\t\tif($saveLocalCopies)//save if \"save local copies\" enable\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$localpath = 'oopsprofile/'.$oopprofile->getId();\n\t\t\t\t\t\t\t\t\t\t\t\t//create path if not exist\n\t\t\t\t\t\t\t\t\t\t\t\tif (!file_exists($localpath)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmkdir($localpath, 0777, true);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$fileWithPath = $localpath.'/'.$filename;\n\n\t\t\t\t\t\t\t\t\t\t\t\t$localResource = new Varien_Io_File();\n\n\t\t\t\t\t\t\t\t\t\t\t\t$localResource->write($fileWithPath, $dataFileName, 0777);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $message = Mage::helper('dataflow')->__('Saved successfully: \"%s\" [%d byte(s)].', $filename, $batchModel->getIoAdapter()->getFileSize());\n\t\t\t\t\t\t\t\t\t if ($this->getVar('link')) {\n\t\t\t\t\t\t\t\t\t $message .= Mage::helper('dataflow')->__('<a href=\"%s\" target=\"_blank\">Link</a>', $this->getVar('link'));\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t $this->addException($message);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t $result = $this->getResource()->write($filename, $dataFile, 0777);\n\n\t\t\t\t\t if (false === $result) {\n\t\t\t\t\t $message = Mage::helper('dataflow')->__('Could not save file: %s.', $filename);\n\t\t\t\t\t Mage::throwException($message);\n\t\t\t\t\t } else {\n\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t* Save Local copies in case of all formats except xls and xlsx\n\t\t\t\t\t\t\t\t**/\n\t\t\t\t\t\t\t\t$profileId = Mage::registry('current_convert_profile')->getId();\n\n\t\t\t\t\t\t\t\t$oopprofile = Mage::getModel('oopsprofile/oopsprofile')->getCollection()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->addFieldToFilter('dataflow_profile_id',$profileId)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getFirstItem();\n\n\t\t\t\t\t\t\t\t$saveLocalCopies = $oopprofile->getSaveLocalCopy();\n\n\t\t\t\t\t\t\t\tif($saveLocalCopies)//save if \"save local copies\" enable\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$localpath = 'oopsprofile/'.$oopprofile->getId();\n\t\t\t\t\t\t\t\t\t\t//create path if not exist\n\t\t\t\t\t\t\t\t\t\tif (!file_exists($localpath)) {\n\t\t\t\t\t\t\t\t\t\t\t\tmkdir($localpath, 0777, true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$fileWithPath = $localpath.'/'.$this->getVar('filename');\n\n\t\t\t\t\t\t\t\t\t\t$localResource = new Varien_Io_File();\n\n\t\t\t\t\t\t\t\t\t\t$localResource->write($fileWithPath, $dataFile, 0777);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t $message = Mage::helper('dataflow')->__('Saved successfully: \"%s\" [%d byte(s)].', $filename, $batchModel->getIoAdapter()->getFileSize());\n\t\t\t\t\t if ($this->getVar('link')) {\n\t\t\t\t\t $message .= Mage::helper('dataflow')->__('<a href=\"%s\" target=\"_blank\">Link</a>', $this->getVar('link'));\n\t\t\t\t\t }\n\t\t\t\t\t $this->addException($message);\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t\n return $this;\n }", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file name must have a valid extension.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "function sl_dal_storesave_cbf(){\n\tglobal $wpdb;\n\t$sl_gizmo_store = new Gizmo_Store();\n\t$sl_store_table = $sl_gizmo_store->sl_return_dbTable(\"SRO\");\n\tif(isSet($_POST[SL_PREFIX.'tbName'])){\n\t\t\t$iscustid \t= \t$_POST[SL_PREFIX.'tbiscustid'];\n\t\t\t$storeName \t= \t$_POST[SL_PREFIX.'tbName'];\n\t\t\t$Category\t= \ttrim($_POST[SL_PREFIX.'CatId']);\n\t\t\t$Address \t= \t$_POST[SL_PREFIX.'tbAddress'];\n\t\t\t$Lat\t\t=\t$_POST[SL_PREFIX.'tbLat'];\n\t\t\t$Lng \t\t=\t$_POST[SL_PREFIX.'tbLng'];\n\t\t\t$City\t\t=\t$_POST[SL_PREFIX.'tbCity'];\n\t\t\t$State \t\t=\t$_POST[SL_PREFIX.'tbState'];\n\t\t\t$Country\t=\t$_POST[SL_PREFIX.'tbCountry'];\n\t\t\t$Zip \t\t=\t$_POST[SL_PREFIX.'tbZip'];\n\t\t\t$Contact\t=\t$_POST[SL_PREFIX.'tbPhone'];\n\t\t\t$Fax \t\t=\t$_POST[SL_PREFIX.'tbFax'];\n\t\t\t$Email\t\t=\t$_POST[SL_PREFIX.'tbEmail'];\n\t\t\t$Web \t\t=\t$_POST[SL_PREFIX.'tbWeb'];\n\t\t\t$LabelId \t=\ttrim($_POST[SL_PREFIX.'hdfLabelId']);\n\t\t\t$LabelText \t=\t$_POST[SL_PREFIX.'tbLabelTxt'];\n\t\t\t$filename \t= \"\";\n\t\t\t$path_id\t= $sql_qry = \"\";\n\t\t\t$storeId\t= trim($_POST[SL_PREFIX.'storeId']);\n\t\t\tif($LabelId == \"0\" || $LabelId == \"\")\n\t\t\t\t$LabelId = \"1\";\n\t\t\tif(isset($_FILES[SL_PREFIX.\"fileLogo\"])){\n\t\t\t\t$filename = $_FILES[SL_PREFIX.\"fileLogo\"][\"name\"];\n\t\t\t\t$ext=findexts($filename);\n\t\t\t\t$newFileName = random_string( );\n\t\t\t\tmove_uploaded_file($_FILES[SL_PREFIX.\"fileLogo\"][\"tmp_name\"],SL_PLUGIN_PATH.\"Logo/\" . $newFileName .\".\". $ext);\n\t\t\t\t$path=\"Logo/\". $newFileName .\".\". $ext;\n\t\t\t}\n\t\t\t$path_id \t= trim($_POST[SL_PREFIX.'hdfLogoAdd']);\n\t\t\t$LogoType \t= trim($_POST[SL_PREFIX.'hdfLogoType']);\n\t\t\tif($LogoType == 'Default'){\n\t\t\t\t$LogoType ='D';\n\t\t\t}else{\n\t\t\t\t$LogoType ='S';\n\t\t\t}\n\t\t\tif($storeId == \"0\"){\n\t\t\t\t\t$sql_qry =\"INSERT INTO `$sl_store_table`(`iscustid`, `name`, `address`, `lat`, `lng`, `city`, `state`, `country`, `zip_code`, `phone`, `fax`, `email`, `website`, `type`, `logoid`, `logotype`, `labelid`, `labeltext`)\".\n\t\t\t\"VALUES ('$iscustid','$storeName', '$Address', '$Lat', '$Lng', '$City', '$State', '$Country', '$Zip', '$Contact', '$Fax', '$Email', '$Web', '$Category','$path_id', '$LogoType', '$LabelId', '$LabelText')\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$nPath = (!empty($path_id)) ? \" ,`LogoId` ='\". $path_id .\"'\" : \"''\";\n\t\t\t\t$sql_qry = \"UPDATE `$sl_store_table` SET `iscustid` = '$iscustid', `name`= '$storeName', `address`= '$Address', `lat`= '$Lat', `lng`= '$Lng', `city`= '$City', `state`= '$State', `country`= '$Country', `zip_code`= '$Zip', `phone`= '$Contact', `fax`= '$Fax', `email`= '$Email', `website`= '$Web', `type`= '$Category',`logoid` ='$path_id',`logotype`= '$LogoType', `labelid` = '$LabelId', `labeltext` = '$LabelText' WHERE `id` = $storeId\";\n\t\t\t}\n\t\t\t$sql_result = mysql_query($sql_qry) or die(mysql_error());\n\t\t\t$success_msg = __('Data has been saved successfully.', 'giz_store_locator');\n\t\t\t$error_msg = __('Error while saving data.', 'giz_store_locator');\n\t\t\tif($sql_result){\n\t\t\t\techo $success_msg.' - success';\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo $error_msg.' - error';\n\t\t\t}\n\t}\n\tdie();\n}", "public static function preProcessFileKliqBooth(Filesobject $file) {\r\n\t\t$fh \t\t\t\t= new Filehandler();\r\n\t\t$fh->table \t\t\t= 'apptbl_files';\r\n\t\t$objUserDb \t\t\t= Appdbmanager::getUserConnection();\r\n $dbh \t\t\t\t= new Db($objUserDb);\r\n \t// Store the file record in DB\r\n \tLogger::info(\"Saving the file into DB\");\r\n \t$file \t\t\t\t= self::saveFileToDBkliqBooth($file,$fh->table); \r\n \t$file->file_path \t= $fh->createStoreKey($file); \r\n \t$dbh->execute(\"update \".$fh->table.\" set file_path = '\".$file->file_path.\"' where file_id = '\".$file->file_id.\"'\");\r\n }", "public function save() {\n\t\t/** @var FieldtypeFile $fieldtype */\n\t\t$fieldtype = $this->field->type;\n\t\treturn $fieldtype->saveFile($this->page, $this->field, $this);\n\t}", "public static function getFile() {}", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"image-to-pdf\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"image-to-image\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "private function SaveToDatabase() {\n\n\t\t$db=$GLOBALS['db'];\n\n\t\t$user_id=$_SESSION['user_id'];\n\t\t//echo $_SESSION['user_id'].\" - userid<br>\";\n\n\t\t/* CHECK IF THE CATEGORY REQUIRES APPROVAL */\n\t\t$ci=new CategoryID;\n\t\t$ci->SetParameters($this->category_id);\n\t\tif ($ci->GetInfo(\"requires_approval\")==\"y\") { $sql_status_col=\"is_pending\"; } else { $sql_status_col=\"is_current\"; }\n\n\t\t/* GET THE STATUS ID */\n\t\t$status_id=GetColumnValue(\"status_id\",\"document_status_master\",$sql_status_col,\"y\",\"\");\n\t\tif ($status_id < 1) { $this->Errors(\"No status setup for this system\"); return False; }\n\n\t\t/* CHECK WHICH FUNCTION TO USE TO ESCAPE BINARY DATA */\n\t\tif ($GLOBALS['database_type']==\"postgres\") {\n\t\t\t$escape_binary_function=\"pg_escape_bytea\";\n\t\t}\n\t\telse {\n\t\t\t$escape_binary_function=\"mysql_escape_string\";\n\t\t}\n\n\n\t\t/* CREATE A DOWNLOAD KEY */\n\t\t//$anonymous_download_key=MD5($_SESSION['user_id'].$this->filename.$this->filetype.$this->filesize.microtime());\n\n\t\t$sql=\"INSERT INTO \".$GLOBALS['database_prefix'].\"document_files\n\t\t\t\t(category_id,status_id,date_start_publishing,user_id,date_added,filename,filetype,filesize,attachment,version_number,latest_version,anonymous_download_key)\n\t\t\t\tVALUES (\n\t\t\t\t'\".$this->category_id.\"',\n\t\t\t\t'\".$status_id.\"',\n\t\t\t\tnow(),\n\t\t\t\t'\".$_SESSION['user_id'].\"',\n\t\t\t\tnow(),\n\t\t\t\t'\".$this->filename.\"',\n\t\t\t\t'\".$this->filetype.\"',\n\t\t\t\t'\".$this->filesize.\"',\n\t\t\t\t'\".mysql_escape_string($this->attachment).\"',\n\t\t\t\t'\".$this->version_number.\"',\n\t\t\t\t'y',\n\t\t\t\t'\".$anonymous_download_key.\"'\n\t\t\t\t)\";\n\t\t//\n\t\t//echo $sql;\n\n\t\t$db->query($sql);\n\t\t//return \"\";\n\t\t/* GRAB THE LAST INSERTED ID */\n\t\t$this->document_id=$db->LastInsertId(\"s_document_files_document_id\");\n\t\t/* UPDATE ALL OTHER FILE VERSIONS */\n\t\t$this->UpdateLatestVersion();\n\t\treturn True;\n\t}", "public function fsToMySQL(): string {\n return $this->fsToString();\n }", "function uploadFileDB2($user,$name,$type,$filesize,$fileKey, $fileIV,$hint,$keyIV){\n $conn = db_connect();\n \n $fileName= mysql_real_escape_string($name);\n $fileType= mysql_real_escape_string($type);\n //$data= $conn->real_escape_string(file_get_contents($_FILES ['uploaded_file']['tmp_name']));\n $fileSize= intval($filesize);\n $hint = mysql_real_escape_string($hint);\n $fileKey = base64_encode($fileKey);\n $fileIV = base64_encode($fileIV);\n $keyIV= base64_encode($keyIV);\n\n // if ok, put in db\n $query = \"INSERT INTO testappdb.uploads (username,file_name, type, size,HashKey,IV,Hint,keyIV) VALUES ('$user','$fileName', '$fileType', '$fileSize', '$fileKey', '$fileIV','$hint', '$keyIV')\";\n \n $result = mysql_query($query);\n\n //Check if it was successfull\n if($result) {\n echo 'Success! Your file was successfully added!';\n echo \"<br>File $fileName uploaded<br>\";\n return true;\n}\nelse{\n echo 'Error! Failed to insert the file';\n return false;\n}\n\nmysql_close($conn);\n}", "public function uploadSource()\n {\n $entity = $this->getEntity();\n $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);\n $uploader->skipDbProcessing(true);\n $result = $uploader->save(self::getWorkingDir());\n $extension = pathinfo($result['file'], PATHINFO_EXTENSION);\n\n $uploadedFile = $result['path'] . $result['file'];\n if (!$extension) {\n unlink($uploadedFile);\n Mage::throwException(Mage::helper('storelocator')->__('Uploaded file has no extension'));\n }\n\n $sourceFile = self::getWorkingDir() . $entity;\n\n $sourceFile .= '.' . $extension;\n\n if (strtolower($uploadedFile) != strtolower($sourceFile)) {\n if (file_exists($sourceFile)) {\n unlink($sourceFile);\n }\n\n if (!@rename($uploadedFile, $sourceFile)) {\n Mage::throwException(Mage::helper('storelocator')->__('Source file moving failed'));\n }\n }\n\n // trying to create source adapter for file and catch possible exception to be convinced in its adequacy\n try {\n $this->_getSourceAdapter($sourceFile);\n } catch (Exception $e) {\n unlink($sourceFile);\n Mage::throwException($e->getMessage());\n }\n\n return $sourceFile;\n }", "public function saveAction()\n {\n foreach ($this->dms()->getHearders() as $key => $value) {\n $this->getResponse()->getHeaders()->addHeaderLine($key, $value);\n }\n\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n\n $ret = [];\n $request = $this->getRequest();\n $files = $request->getFiles()->toArray();\n foreach ($files as $name_file => $file) {\n if (isset($file['name'])) {\n $file = [$file];\n }\n foreach ($file as $f) {\n $document['support'] = Document::SUPPORT_FILE_MULTI_PART_STR;\n $document['coding'] = 'binary';\n $document['data'] = [$name_file => $f];\n $document['name'] = $f['name'];\n $document['type'] = $f['type'];\n $document['weight'] = $f['size'];\n\n $doc = $this->dms()->getService()->add($document);\n if (isset($ret[$name_file])) {\n if (is_array($ret[$name_file])) {\n $ret[$name_file][] = $doc;\n } else {\n $ret[$name_file] = [$ret[$name_file], $doc];\n }\n } else {\n $ret[$name_file] = $doc;\n }\n }\n }\n\n return new JsonModel($ret);\n }", "public function masiva(Request $request){\n $file = $request->file('file');\n $nombre = $file->getClientOriginalName();\n \\Storage::disk('local')->put($nombre, \\File::get($file));\n return \\redirect(\"/carga/\".$nombre);\n }", "function upload_file($CID,$formdata,$filedata,$holddir){\n\t\tif($filedata['uploadedfile']['name']){\n\t\t\tif(preg_match(\"/&/\",$filedata['uploadedfile']['name'])){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t$filedata['uploadedfile']['name'] = str_replace(\"%\",\"\",$filedata['uploadedfile']['name']);\n\t\t\t$filename=addslashes($filedata['uploadedfile']['name']);\n\t\t\t$filesize=$filedata['uploadedfile']['size'];\n\t\t\tif($filesize==0 || preg_match(\"/[`\\\"';]/\",$filename)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\t$status=$formdata['status'];\n\t\t\t$status=preg_replace(\"/>|<|\\\"|\\\\\\/\",\"\",$status);\n\t\t\t$status=addslashes($status);\n\t\t\t$comments=$formdata['comments'];\n\t\t\t$comments=preg_replace(\"/>|<|\\\"|\\\\\\/\",\"\",$comments);\n\t\t\t$comments=addslashes($comments);\n\t\t\t$fullpathtofile=$holddir.\"/\".$filedata['uploadedfile']['name'];\n //We need to see if the file already exists. If it does, it will be removed\n //and the new copy will be uploaded\n\t\t\t$this->db->set_query(\"select count(*) from upload_tracking where file_name='\".addslashes($filename).\"' and CID=$CID\");\n $this->db->execute_query();\n $row=$this->db->get_results(\"num\");\n\n if($row[0]>0){\n //get the fileiD\n $this->db->set_query(\"select ID from upload_tracking where file_name='\".addslashes($filename).\"' and CID=$CID\");\n\t\t\t\t$this->db->execute_query();\n $row=$this->db->get_results(\"num\");\n $fileID=$row[0];\n //remove the file\n $this->delete_file($fileID,$filename,$holddir);\n }\n\n\t\t\tmove_uploaded_file($filedata['uploadedfile']['tmp_name'],$holddir.\"/\".$filedata['uploadedfile']['name']);\n\t\t\t//Lets see if we can get teh mime type\n\t\t\t$filetype=$this->get_mime_type($fullpathtofile);\n\t\t\t//The files are up. Now lets place it in the database.\n\t\t\t$this->db=new DB(\"QuinnFM\");\n\t\t\t$this->db->set_query(\"insert into upload_tracking(\n\t\t\t\tCID,\n\t\t\t\tfile_name,\n\t\t\t\tfile_size,\n\t\t\t\tmime_type,\n\t\t\t\tupload_date,\n\t\t\t\tstatus,\n\t\t\t\tcomments)\n\t\t\t\tvalues (\n\t\t\t\t$CID,\n\t\t\t\t'$filename',\n\t\t\t\t$filesize,\n\t\t\t\t'$filetype',\n\t\t\t\tnow(),\n\t\t\t\t'$status',\n\t\t\t\t'$comments')\n\t\t\t\t\");\n\t\t\t\n\t\t\t$this->db->execute_query();\n\t\t\t//If file is uploaded, notify Vicki\n\t\t\t//Get Client Name\n\t\t\t$client_name=UserAdmin::get_client_name($CID);\n\t\t\t//Set temporary From\n\t\t\t$temp_from=\"From: \\\"Dictation Web Application\\\" <[email protected]>\";\n\t\t\t//mail(\"[email protected]\",\"Upload for $client_name\",\"\",\"$temp_from\");\n\t\t\tmail(\"[email protected]\",\"Upload for $client_name\",\"\",\"$temp_from\");\n\t\t}\n\t}", "function upload_file($target_dir,$encoded_string){\n\t\t\n\t\t/*$encoded_string = explode(\";base64,\", $encoded_string);\n\t\t$encoded_string=base64_decode($encoded_string[1]);*/\n\t\t\n\t //$target_dir = ''; // add the specific path to save the file\n\t $decoded_file = base64_decode($encoded_string); // decode the file\n\t $mime_type = finfo_buffer(finfo_open(), $decoded_file, FILEINFO_MIME_TYPE); // extract mime type\n\t $extension = $this->mime2ext($mime_type); // extract extension from mime type\n\t $file = uniqid() .'.'. $extension; // rename file as a unique name\n\t $file_dir = $target_dir . $file;\n\t file_put_contents($file_dir, $decoded_file); // save\n\t /*try {\n\t file_put_contents($file_dir, $decoded_file); // save\n\t database_saving($file);\n\t header('Content-Type: application/json');\n\t echo json_encode(\"File Uploaded Successfully\");\n\t } catch (Exception $e) {\n\t header('Content-Type: application/json');\n\t echo json_encode($e->getMessage());\n\t }*/\n\t\treturn $file;\n\t}", "function acf_upload_file($uploaded_file)\n{\n}", "public function scanAndConvert()\n {\n foreach ($this->getFileToConvert() as $file) {\n $output = array();\n $in = $file;\n $out = preg_replace('/.{3}$/', '', $in);\n foreach ($this->getSupportedFormat() as $ext) {\n $cmd = self::FFMPEG . \" -y -i \" . $this->inputDirectory . \"/\" . $in . \" \" . $this->outputDirectory . \"/\" . $out . $ext;\n exec($cmd, $output);\n foreach ($output as $line) {\n $this->logger->info($line);\n }\n }\n $cmd = self::RM . \" -rvf \" . $in;\n exec($cmd, $output);\n foreach ($output as $line) {\n $this->logger->info($line);\n }\n\n // update the entity\n $id = preg_replace('/-.*$/', '', $in);\n $this->updateEntity($id, $out);\n }\n }", "private function SaveFile($comicData, &$m=null)\n {\n // get MD5 hash (if one wasn't already provided)\n if (!$m)\n $m = md5($comicData);\n\n // check if the file is already here.\n $d1 = substr($m,0,2);\n $d2 = substr($m,2,2);\n $path = self::COMIC_DIR.\"$d1/$d2\";\n $fileName = \"{$path}/{$m}\";\n\n // if file exists, don't return anything.\n if (file_exists($fileName))\n $this->DebugMsg(\" - file {$fileName} already exists in the database.\");\n else\n {\n // create the folder (recursively)\n if (!is_dir($path))\n mkdir($path, 00777, true);\n\n // save the file, and create an ImageMagick object from it\n file_put_contents($fileName, $comicData);\n $this->DebugMsg(\" - file {$fileName} saved locally.\");\n\n return $fileName;\n }\n }", "function upload_file($encoded_string , $target_dir, $File_Name){\n //$target_dir = ''; // add the specific path to save the file\n $decoded_file = base64_decode($encoded_string); // decode the file\n $mime_type = finfo_buffer(finfo_open(), $decoded_file, FILEINFO_MIME_TYPE); // extract mime type\n $extension = mime2ext($mime_type); // extract extension from mime type\n $file = uniqid() .'.'. $extension; // rename file as a unique name\n $file_dir = $target_dir . uniqid() .'.'. $extension;\n try {\n file_put_contents($file_dir, $decoded_file); // save\n database_saving($file);\n header('Content-Type: application/json');\n echo json_encode(\"File Uploaded Successfully\");\n } catch (Exception $e) {\n header('Content-Type: application/json');\n echo json_encode($e->getMessage());\n }\n\n}", "private function fileEntityFieldToMedia(MigratePrepareRowEvent $event) {\n $row = $event->getRow();\n $source = $event->getSource();\n\n // Change the type from file to file_entity so it can be processed by\n // a migrate field plugin.\n // @see \\Drupal\\file_entity_migration\\Plugin\\migrate\\field\\FileEntity\n if (in_array($source->getPluginId(), [\n 'd7_field',\n 'd7_field_instance',\n 'd7_field_instance_per_view_mode',\n 'd7_field_instance_per_form_display',\n 'd7_view_mode',\n ])) {\n if ($row->getSourceProperty('type') == 'file') {\n $row->setSourceProperty('type', 'file_entity');\n }\n }\n\n // Skip migrating field instances whose destination bundle does not exist.\n if (in_array($source->getPluginId(), [\n 'd7_field_instance',\n 'd7_field_instance_per_view_mode',\n 'd7_field_instance_per_form_display',\n ])) {\n if ($row->getSourceProperty('entity_type') == 'file') {\n // Don't migrate bundles which don't exist in the destination.\n $media_bundle = $row->getSourceProperty('bundle');\n if (!\\Drupal::entityTypeManager()->getStorage('media_type')->load($media_bundle)) {\n $field_name = $row->getSourceProperty('field_name');\n throw new MigrateSkipRowException('Skipping field ' . $field_name . ' as its target is ' . $media_bundle . ', which does not exist in the destination.');\n }\n }\n }\n\n // Transform entity reference fields pointing to file entities so\n // they point to media ones.\n if (($source->getPluginId() == 'd7_field') && ($row->getSourceProperty('type') == 'entityreference')) {\n $settings = $row->getSourceProperty('settings');\n if ($settings['target_type'] == 'file') {\n $settings['target_type'] = 'media';\n $row->setSourceProperty('settings', $settings);\n }\n }\n\n // File types of type Document need to be mapped to the File media bundle.\n if (in_array($source->getPluginId(), ['d7_file_entity_type', 'd7_file_entity_item']) && ($row->getSourceProperty('type') == 'document')) {\n $row->setSourceProperty('type', 'file');\n }\n\n // Map path alias sources from file/1234 to media/1234.\n if (($source->getPluginId() == 'd7_url_alias') && (strpos($row->getSourceProperty('source'), 'file/') === 0)) {\n $source_url = preg_replace('/^file/', 'media', $row->getSourceProperty('source'));\n $row->setSourceProperty('source', $source_url);\n }\n\n // Map redirections from file/1234 to media/1234.\n if (($source->getPluginId() == 'd7_path_redirect') && (strpos($row->getSourceProperty('redirect'), 'file/') === 0)) {\n $redirect = preg_replace('/^file/', 'media', $row->getSourceProperty('redirect'));\n $row->setSourceProperty('redirect', $redirect);\n }\n\n // Map file menu links to media ones.\n if (($source->getPluginId() == 'menu_link') && (strpos($row->getSourceProperty('link_path'), 'file/') === 0)) {\n $link_path = preg_replace('/^file/', 'media', $row->getSourceProperty('link_path'));\n $row->setSourceProperty('link_path', $link_path);\n }\n }", "public function import_file(){\n\t\tif(isset($this->session->isactive)){\n\t\t\t// Uploading file given by user to @root/data files folder\n\t\t\t// and then dumping the data into student table\n\n\t\t\tif($_FILES['file']['tmp_name']){\n\t\t\t\tmove_uploaded_file($_FILES['file']['tmp_name'], 'data files/'.$_FILES['file']['name']);\n\t $path = str_replace('\\\\','/',realpath('data files/'.$_FILES['file']['name']));\n\n\t $this->load->database();\n\t $query = $this->db->query(\"LOAD DATA LOCAL INFILE '\".$path.\"'\n\t INTO TABLE tbl_students COLUMNS TERMINATED BY '\\\\t'\");\n\n\t\t\t\tif($query){\n\t\t\t\t\t$this->input->set_cookie('message_code','2',1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->input->set_cookie('message_code','4',1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->input->set_cookie('message_code','3',1);\n\t\t\t}\n\n\t\t\tredirect('import');\n\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file name must have a valid extension.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "public function executeGenerarfile(sfWebRequest $request)\n {\n\n // Variables\n $sqlUpdate='';\n\n // Redirige al inicio si no tiene acceso\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n // $archivo = Doctrine_Core::getTable('Actualizaciones')->find(array(2));\n\n $arr = explode(\".\", $archivo->getImagefile(), 2);\n $first = $arr[0];\n\n $nombre_archivo_upd = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/upd_'.$first.\".sql\";\n\n // DATOS conexion\n /*$dbhost = 'localhost';$dbname = 'circulo'; $dbuser = 'root'; $dbpass = 'root911';\n\n $pdo = new \\PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass, array(\n \\PDO::MYSQL_ATTR_LOCAL_INFILE => true\n ));*/\n\n\n // PRIMER PASO : ACTUALIZACION DE REGISTROS\n\n // SI existe el archivo previamente, lo borro\n if (file_exists($nombre_archivo_upd)) unlink($nombre_archivo_upd);\n\n // CONSULTA por registros a ACTUALIZAR (ya existe el email en la tabla de Pacientes)\n //$datoss = $archivo = Doctrine_Core::getTable('Actualizaciones')->obtenerRegistrosAActualizar();\n\n $fp=fopen($nombre_archivo_upd,\"w+\");\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('nombre','nombre','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('abreviacion','abreviacion','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idgrupotratamiento','idgrupotratamiento','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idobrasocial','idobrasocial','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idplan','idplan','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idontologia','idontologia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('garantia','garantia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importe','importe','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('coseguro','coseguro','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importeos','importeos','N');\n fwrite($fp,$sqlUpdate);\n\n\n\n fclose ($fp);\n\n return true;\n\n }", "public static function getRemoteCasusFile() {\n // check if a new file is available\n $headers = get_headers( self::RIVM_REMOTE_SOURCE_CASUS_CSV_FILE , 1 );\n $headers = array_change_key_case( $headers ); //Convert keys to lowercase to prevent possible mistakes\n $remoteFileSize = false;\n if( isset( $headers['content-length'] ) ) {\n $remoteFileSize = $headers['content-length'];\n }\n $localFileSize = ( file_exists( self::RIVM_SOURCE_CASUS_CSV_FILE ) ) ? filesize( self::RIVM_SOURCE_CASUS_CSV_FILE ) : false;\n if ( $remoteFileSize !== false && ( $remoteFileSize != $localFileSize ) ) {\n // we got a new file. Let's download it\n $contents = file_get_contents( self::RIVM_REMOTE_SOURCE_CASUS_CSV_FILE );\n if( ! $contents ) return false;\n $date = date( 'Ymd', filemtime( self::RIVM_SOURCE_CASUS_CSV_FILE ) );\n $newFileName = substr( self::RIVM_SOURCE_CASUS_CSV_FILE, 0, -4 ) . \".\" . $date . \".csv\";\n if( rename( self::RIVM_SOURCE_CASUS_CSV_FILE, $newFileName ) ) {\n if ( file_put_contents( self::RIVM_SOURCE_CASUS_CSV_FILE, $contents, LOCK_EX ) ) {\n FileUtils::writeCookie( self::COOKIE_LAST_FETCH_RIVM_CASUS, time() );\n return true;\n }\n }\n }\n return false;\n }", "public function store() {\n if (!$this->isPostRequest() ||\n !$this->isValidToken($_POST['token']))\n return Helper::redirect(HOME.'404');\n\n $this->destroyToken();\n\n if (empty($_FILES['docfile']['name'])) {\n $_SESSION['flash'] = NO_FILE_CHOSEN_ERROR;\n $_SESSION['status'] = 'error';\n return Helper::redirect(HOME.'uploads/create');\n }\n\n $upload = new RawFile(\n $_FILES['docfile']['name'],\n $_FILES['docfile']['size'],\n $_FILES['docfile']['tmp_name']\n );\n $store = $upload->saveFile();\n\n if (!$store['success']) {\n $_SESSION['flash'] = $store['error'];\n $_SESSION['status'] = 'error';\n return Helper::redirect(HOME.'uploads/create');\n }\n\n $_SESSION['flash'] = $store['message'];\n return Helper::redirect(HOME.'uploads');\n }", "public function convert()\n {\n //build URI\n $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '?format=' . $this->saveFormat;\n\n //sign URI\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $v_output = Utils::validateOutput($responseStream);\n\n if ($v_output === '') {\n if ($this->saveFormat == 'html') {\n $save_format = 'zip';\n } else {\n $save_format = $this->saveFormat;\n }\n\n $outputPath = AsposeApp::$outPutLocation . Utils::getFileName($this->getFileName()) . '.' . $save_format;\n Utils::saveFile($responseStream, $outputPath);\n return $outputPath;\n } else {\n return $v_output;\n }\n }", "public function export($file);", "function getFileContent($db, $file)\n{\n $localFilename = MD5(microtime()) . '.' . $file['extension'];\n $localFilePath = CACHE_PATH . '/' . $localFilename;\n\n // figure out server storage setup\n $storageType = 'local';\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n $uploadServerDetails = loadServer($db, $file);\n if ($uploadServerDetails != false)\n {\n $storageLocation = $uploadServerDetails['storagePath'];\n $storageType = $uploadServerDetails['serverType'];\n\n // if no storage path set & local, use system default\n if ((strlen($storageLocation) == 0) && ($storageType == 'local'))\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n\n if ($storageType == 'direct')\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n }\n\n // use ssh to get contents of 'local' files\n if (($storageType == 'local') || ($storageType == 'direct'))\n {\n // get remote file path\n $remoteFilePath = $storageLocation . $file['localFilePath'];\n\n // first try getting the file locally\n $done = false;\n if ((ON_SCRIPT_INSTALL == true) && file_exists($remoteFilePath))\n {\n \n $done = copy($remoteFilePath, $localFilePath);\n if ($done)\n {\n return $localFilePath;\n }\n }\n\n // try over ssh\n if ($done == false)\n {\n\t\t\t$sshHost = LOCAL_STORAGE_SSH_HOST;\n\t\t\t$sshUser = LOCAL_STORAGE_SSH_USER;\n\t\t\t$sshPass = LOCAL_STORAGE_SSH_PASS;\n\n\t\t\t// if 'direct' file server, get SSH details\n\t\t\t$serverDetails = getDirectFileServerSSHDetails($file['serverId']);\n\t\t\tif($serverDetails)\n\t\t\t{\n\t\t\t\t$sshHost = $serverDetails['ssh_host'];\n $sshPort = $serverDetails['ssh_port'];\n\t\t\t\t$sshUser = $serverDetails['ssh_username'];\n\t\t\t\t$sshPass = $serverDetails['ssh_password'];\n\t\t\t\t$basePath = $serverDetails['file_storage_path'];\n\t\t\t\tif(substr($basePath, strlen($basePath)-1, 1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$basePath = substr($basePath, 0, strlen($basePath)-1);\n\t\t\t\t}\n\t\t\t\t$remoteFilePath = $basePath . '/' . $file['localFilePath'];\n\t\t\t}\n \n if(strlen($sshPort) == 0)\n {\n $sshPort = 22;\n }\n\t\t\t\n // connect to 'local' storage via SSH\n $sftp = new Net_SFTP($sshHost, $sshPort);\n if (!$sftp->login($sshUser, $sshPass))\n {\n output(\"Error: Failed logging into \" . $sshHost . \" (port: \".$sshPort.\") via SSH..\\n\");\n\n return false;\n }\n\n // get file\n $rs = $sftp->get($remoteFilePath, $localFilePath);\n if ($rs)\n {\n return $localFilePath;\n }\n }\n\n return false;\n }\n\n // ftp\n if ($storageType == 'ftp')\n {\n // setup full path\n $prePath = $uploadServerDetails['storagePath'];\n if (substr($prePath, strlen($prePath) - 1, 1) == '/')\n {\n $prePath = substr($prePath, 0, strlen($prePath) - 1);\n }\n $remoteFilePath = $prePath . '/' . $file['localFilePath'];\n\n // connect via ftp\n $conn_id = ftp_connect($uploadServerDetails['ipAddress'], $uploadServerDetails['ftpPort'], 30);\n if ($conn_id === false)\n {\n output('Could not connect to ' . $uploadServerDetails['ipAddress'] . ' to upload file.');\n return false;\n }\n\n // authenticate\n $login_result = ftp_login($conn_id, $uploadServerDetails['ftpUsername'], $uploadServerDetails['ftpPassword']);\n if ($login_result === false)\n {\n output('Could not login to ' . $uploadServerDetails['ipAddress'] . ' with supplied credentials.');\n return false;\n }\n\n // get content\n $ret = ftp_get($conn_id, $localFilePath, $remoteFilePath, FTP_BINARY);\n while ($ret == FTP_MOREDATA)\n {\n $ret = ftp_nb_continue($conn_id);\n }\n }\n\n if (file_exists($localFilePath) && (filesize($localFilePath) > 0))\n {\n return $localFilePath;\n }\n\n return false;\n}", "public function create_from_file($file);", "function upload_from_file($sparql_endpoint, $triples_filename, $graph_key_name = 'context-uri', $graph_uri = '')\n{\n\t$url = $sparql_endpoint;\n\t\n\tif ($graph_uri == '')\n\t{\n\t}\n\telse\n\t{\n\t\t$url .= '?' . $graph_key_name . '=' . $graph_uri;\n\t}\n\t\n\t// text/x-nquads is US-ASCII WTF!?\n\t//$command = \"curl $url -H 'Content-Type: text/x-nquads' --data-binary '@$triples_filename'\";\n\n\t// text/rdf+n3 is compatible with NT and is UTF-8\n\t// see https://wiki.blazegraph.com/wiki/index.php/REST_API#RDF_data\n\t$command = \"curl $url -H 'Content-Type: text/rdf+n3' --data-binary '@$triples_filename'\";\n\n\techo $command . \"\\n\";\n\t\n\t$lastline = system($command, $retval);\n\t\n\t//echo \" Last line: $lastline\\n\";\n\t//echo \"Return value: $retval\\n\";\t\n\t\n\tif (preg_match('/data modified=\"0\"/', $lastline)) \n\t{\n\t\techo \"\\nError: no data added\\n\";\n\t\texit();\n\t}\n}", "function convertFileToFile($file, $file_path) {\n if (!($file_path != null && $file_path !== ''))\n throw new Error(create_invalid_value_message($file_path, \"file_path\", \"html-to-pdf\", \"The string must not be empty.\", \"convert_file_to_file\"), 470);\n \n $output_file = fopen($file_path, \"wb\");\n if (!$output_file)\n throw new \\Exception(error_get_last()['message']);\n try\n {\n $this->convertFileToStream($file, $output_file);\n fclose($output_file);\n }\n catch(Error $why)\n {\n fclose($output_file);\n unlink($file_path);\n throw $why;\n }\n }", "private function createConversion($format)\n {\n // extension\n $extension = $format == 'pdf' ? 'pdf' : 'zip';\n\n // hash\n $hash = base_convert(sha1(uniqid(mt_rand(), TRUE)), 16, 36);\n\n // get root path\n $root = static::$kernel->getRootDir();\n\n // create the file\n $fs = new Filesystem();\n $fs->copy(\n __DIR__.'/../Assets/'.$format.'.'.$format,\n $root.'/../files/input/'.$hash.'/1.'.$extension\n );\n\n // create the conversion\n $conversion = new Conversion();\n\n $conversion->setHash($hash);\n\n $conversion->setFormat($format);\n\n $conversion->setTotalFiles(1);\n\n $conversion->setUploadedFiles(1);\n\n $conversion->setStatus('uploaded');\n\n $conversion->setRetries(0);\n\n $this->em->persist($conversion);\n $this->em->flush();\n\n return $conversion;\n }", "abstract public function convert_from_storage($source);", "private function createFile($file)\n\t{\n\t\t//exit;\n\n\t\t$extension = $file->guessExtension();\n\t\t$dir = $this->getUploadDir();\n\t\tif (!$extension) {\n\t\t\t$extension = 'bin';\n\t\t}\n\t\t$newName = $this->createRandCode() . '.' . $extension;\n\t\t$file->move($dir, $newName);\n\t\t/*\n\t\t * Создание и сохранение информации о файле\n\t\t */\n\t\t$File = new File();\n\t\t$File->setName($newName);\n\t\t$File->setType($file->getClientMimeType());\n\t\t$File->setSize($file->getClientSize());\n\t\treturn $File;\n\t}", "function _migrate($filename) {\n\t\t$migrations = $this->migration;\n\n\t\t$this->conn->execute(file_get_contents(\"migrations/$filename\"));\n\t\t$migrations->save($migrations->newEntity(['migration_file' => $filename]));\n\t}", "public function saveFileAccess()\r\n {\r\n $fileId = Input::get('FILE');\r\n $field = Input::get('COL');\r\n $value = Input::get('VALUE');\r\n $file = UploadedFiles::find($fileId);\r\n if($file!=null){\r\n $file->$field = $value==\"true\"?1:0;\r\n $file->save();\r\n\r\n if($field == 'internal'){\r\n $project = $file->project;\r\n //create the row in inbox to let consultant know\r\n $msg = \"File uploaded By Admin.\\r\\n\";\r\n $msg .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msg .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"FILE Name: \".$file->fileName.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n if($field == 'vendor'){\r\n $project = $file->project;\r\n\r\n //create the row in inbox to let consultant know\r\n $msg = \"File uploaded By Patent Services USA.\\r\\n\";\r\n $msg .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msg .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"FILE Name: \".$file->fileName.\"\\r\\n\";\r\n\r\n $projectPD = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'designer'))->where('completed','!=',1)->first();\r\n if($projectPD != null){\r\n Inbox::createInbox($project->lead->id, $projectPD->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPU = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'university'))->where('completed','!=',1)->first();\r\n if($projectPU != null){\r\n Inbox::createInbox($project->lead->id, $projectPU->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPD2 = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'2D'))->where('completed','!=',1)->first();\r\n if($projectPD2 != null){\r\n Inbox::createInbox($project->lead->id, $projectPD2->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPW = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'writer'))->where('completed','!=',1)->first();\r\n if($projectPW != null){\r\n Inbox::createInbox($project->lead->id, $projectPW->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPAJH = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'attorneyjh'))->where('completed','!=',1)->first();\r\n if($projectPAJH != null){\r\n Inbox::createInbox($project->lead->id, $projectPAJH->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPAJK = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'attorneyjk'))->where('completed','!=',1)->first();\r\n if($projectPAJK != null){\r\n Inbox::createInbox($project->lead->id, $projectPAJK->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n $projectPAM = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'attorneyMike'))->where('completed','!=',1)->first();\r\n if($projectPAM != null){\r\n Inbox::createInbox($project->lead->id, $projectPAM->consultant_id, $msg, 'FILE UPLOADED', 'ADMIN');\r\n }\r\n }\r\n\r\n return \"1\";\r\n }\r\n return \"-1\";\r\n }", "function uploadFile()\n{\n $uploaddir = 'files/';\n\n // TODO: handle duplicate names?\n // get file description?\n $query = \"\n INSERT INTO clipboard\n SET\n name = '{$_FILES['clipfile']['name']}',\n path = $uploaddir . $_FILES['clipfile']['name']',\n description = '',\n date = now(),\n clip_id = NULL\";\n \n query($query);\n testError($query);\n \n move_uploaded_file($_FILES['clipfile']['tmp_name'], $uploaddir . $_FILES['clipfile']['name'])\n or die('fucking file failed');\n \n print \"file {$_FILES['clipfile']['name']} uploaded successfully. Word Up!\";\n}", "public function getFile()\n {\n if(Input::hasfile('report')){\n \n $files=Input::file('report');\n $file=fopen($files,\"r\");\n \n // dd($file);\n while(($data=fgetcsv($file, 10000,\",\")) !== FALSE)\n {\n // $filename = $this->doSomethingLikeUpload($file);\n \n // Return it's location\n //return $filename;\n foreach($data as $dat){\n $result=BdtdcLanguage::create(array(\n 'name'=>$dat[0]\n ));\n }\n dd($result->toArray());\n }\n \n \n }\n }", "public function convertDatabaseToUTF8();", "public function store(Request $request){\n $fileManager = new FileManager(AccountsManager::getInstance());\n $fileManager->processFile($request->file(\"file\")->getPathName());\n\n return redirect('companyList')->with('status', 'Archivo cargado correctamente!');\n }", "function file_storeData($page_id, $identifier) {\n\tglobal $Auth,$input_language;\n\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\t\n\t$userfile\t= $_FILES[$identifier]['tmp_name'];\n\t$file_name\t= $_FILES[$identifier]['name'];\n\t$file_size\t= $_FILES[$identifier]['size'];\n\t$file_type\t= $_FILES[$identifier]['type'];\n\t//$text\t\t= $_POST[$identifier.\"name\"];\n\t$text\t\t= mysql_real_escape_string($_POST[\"HEADLINE\"]);\n\n\t## for security and convenience reasons we have to convert the\n\t## supplied string\n\n\t## prepare the db-object\n\t$db_connectionStore = new DB_Sql();\n\n\t## okay we first create an upload object\n\t$f = new file_object(); \n\t##$userfile = stripslashes($userfile);\n\tif ($userfile != \"none\" && $userfile!='') { \n\t\t## then we upload the file\n\t\t$filename = $f->upload($userfile, $file_name,$file_size,$file_type, MATRIX_UPLOADDIR_DOCS);\n\t\tif($filename != -1) {\n\t\t\t## first we need to find out if the entry already exists\n\t\t\t$select_query = \"SELECT file_id,filename FROM \".PAGE_FILE.\" WHERE page_id = '$page_id' AND identifier = '$identifier' AND client_id='$client_id' AND language='$input_language'\";\n\t\t\t$result_pointer = $db_connectionStore->query($select_query);\t\n\t\n\t\t\tif($db_connectionStore->num_rows() == 0) { \n\t\t\t\t## no entry found\n\t\t\t\t$insert_query = \"INSERT INTO \".PAGE_FILE.\" (page_id, identifier, filename, text, mime_type, client_id,language) values ('$page_id', '$identifier', '$filename', '$text', '$file_type', '$client_id','$input_language')\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($insert_query);\n\t\t\t} else {\n\t\t\t\t$db_connectionStore->next_record();\n\t\t\t\t$file_id = $db_connectionStore->Record[\"file_id\"];\n\t\t\t\t$old_filename = $db_connectionStore->Record[\"filename\"];\n\t\t\t\t\n\t\t\t\t## delete the old file first\n\t\t\t\t$f->delete_file(MATRIX_UPLOADDIR_DOCS.$old_filename);\n\t\t\t\t\n\t\t\t\t$update_query = \"UPDATE \".PAGE_FILE.\" SET filename = '$filename', text='$text' WHERE file_id = '$file_id' AND client_id='$client_id' AND language='$input_language'\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($update_query);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t## in this case we will update the text element\n\t\t\t## first we need to find out if the entry already exists\n\t\t\t$select_query = \"SELECT file_id FROM \".PAGE_FILE.\" WHERE page_id = '$page_id' AND identifier = '$identifier' AND client_id='$client_id' AND language='$input_language'\";\n\t\t\t$result_pointer = $db_connectionStore->query($select_query);\t\n\t\n\t\t\tif($db_connectionStore->num_rows() == 0) { \n\t\t\t\t## no entry found\n\t\t\t\t$insert_query = \"INSERT INTO \".PAGE_FILE.\" (page_id, identifier, text, client_id,language) values ('$page_id', '$identifier', '$text','$client_id','$input_language')\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($insert_query);\n\t\t\t} else {\n\t\t\t\t$db_connectionStore->next_record();\n\t\t\t\t$file_id = $db_connectionStore->Record[\"file_id\"];\n\t\t\t\t$update_query = \"UPDATE \".PAGE_FILE.\" SET text='$text' WHERE file_id = '$file_id' AND client_id='$client_id' AND language='$input_language'\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($update_query);\n\t\t\t}\n\t\t}\n}" ]
[ "0.55921155", "0.5257457", "0.5241012", "0.51945174", "0.5162736", "0.513937", "0.5125015", "0.5118888", "0.50950223", "0.5086877", "0.50560254", "0.50297016", "0.5028477", "0.50158066", "0.50028414", "0.4993035", "0.49762043", "0.49587157", "0.4951985", "0.4951165", "0.4937931", "0.4937931", "0.49344638", "0.49295637", "0.49195924", "0.4911401", "0.49076906", "0.49015334", "0.48969758", "0.48921734", "0.48858175", "0.48663288", "0.48585847", "0.48453817", "0.483007", "0.4823293", "0.48040506", "0.48003986", "0.47864833", "0.4777634", "0.47750482", "0.47707716", "0.47579592", "0.47572932", "0.4754579", "0.4749236", "0.47120416", "0.47120416", "0.47120416", "0.47097352", "0.4709664", "0.4707807", "0.4704795", "0.47007832", "0.46829745", "0.46780172", "0.46725872", "0.46590623", "0.4658438", "0.4656025", "0.4655907", "0.46507928", "0.4649939", "0.46473923", "0.46427625", "0.4634288", "0.46254376", "0.46240997", "0.46238664", "0.46199027", "0.4610004", "0.46066117", "0.4604431", "0.46012098", "0.45999816", "0.45945266", "0.45916215", "0.45909503", "0.45905495", "0.4584865", "0.45737374", "0.45723632", "0.45711344", "0.45710564", "0.45708495", "0.45693234", "0.45609984", "0.45580772", "0.4555694", "0.45555493", "0.45541665", "0.4553838", "0.45494893", "0.4548338", "0.45450744", "0.45380196", "0.45321852", "0.4524829", "0.45243508", "0.45211995", "0.4520946" ]
0.0
-1
Convert a SMF topic icon code into a standard Composr theme image code.
public function convert_topic_emoticon($iconid) { switch ($iconid) { case 1: return 'cns_emoticons/smile'; case 2: return 'cns_emoticons/wink'; case 3: return 'cns_emoticons/cheeky'; case 4: return 'cns_emoticons/grin'; case 5: return 'cns_emoticons/angry'; case 6: return 'cns_emoticons/sad'; case 7: return 'cns_emoticons/shocked'; case 8: return 'cns_emoticons/cool'; case 10: return 'cns_emoticons/rolleyes'; case 13: return 'cns_emoticons/shutup'; case 14: return 'cns_emoticons/confused'; case 15: return 'cns_emoticons/kiss'; case 16: return 'cns_emoticons/cry'; case 17: return 'cns_emoticons/devil'; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_topic_icon($topic) {\n $file = TOPIC_ICON_DIR . '/' . $topic['topic_icon'];\n if (file_exists($file) && !empty($topic['topic_icon'])) {\n return TOPIC_ICON_URL . '/' . $topic['topic_icon'];\n }else\n return TOPIC_ICON_URL . '/dot.gif';\n }", "function rss2_site_icon()\n {\n }", "function convert_topic_emoticon($iconid)\n\t{\n\t\tswitch ($iconid)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\treturn 'ocf_emoticons/devil';\n\t\t\tcase 2:\n\t\t\t\treturn 'ocf_emoticons/angry';\n\t\t\tcase 3:\n\t\t\t\treturn 'ocf_emoticons/sick';\n\t\t\tcase 4:\n\t\t\t\treturn 'ocf_emoticons/wub';\n\t\t\tcase 5:\n\t\t\t\treturn 'ocf_emoticons/king';\n\t\t\tcase 6:\n\t\t\t\treturn 'ocf_emoticons/cyborg';\n\t\t\tcase 7:\n\t\t\t\treturn 'ocf_emoticons/confused';\n\t\t}\n\t\treturn '';\n\t}", "function emc_get_cpt_icon() {\r\n\r\n\t$cpt = get_post_type();\r\n\r\n\tswitch ( $cpt ) {\r\n\t\tcase 'emc_big_idea':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Big Ideas', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_content_focus':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Foundational Math Concepts', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_common_core':\r\n\t\t\t$icon = 'star';\r\n\t\t\t$alt = __( 'Star icon for Common Core Alignment', 'emc' );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t$url = get_template_directory_uri() . '/img/' . $icon . '.png';\r\n\t$html = sprintf( '<div class=\"emc-format\"><img class=\"emc-format-icon\" src=\"%1$s\" alt=\"%2$s\"/></div><!-- .emc-format -->',\r\n\t\tesc_url( $url ),\r\n\t\tesc_attr( $alt )\r\n\t);\r\n\r\n\treturn $html;\r\n\r\n}", "function news_icon() { ?>\n <style type=\"text/css\" media=\"screen\">\n #adminmenu .menu-icon-news div.wp-menu-image:before {\n content: \"\\f464\";\n }\n </style>\n <?php }", "function atom_site_icon()\n {\n }", "function wp_site_icon()\n {\n }", "function get_topic_icons() {\n $dir = TOPIC_ICON_DIR;\n\n $icons = glob($dir . '/*.png');\n $new_icons = '';\n foreach ($icons as $icon) {\n $icon_parts = explode('/', $icon);\n $icon_file = $icon_parts[count($icon_parts) - 1];\n $new_icons[] = array('file' => $icon_file, 'path' => $icon, 'url' => TOPIC_ICON_URL . '/' . $icon_file);\n }\n\n if (count($new_icons) > 0)\n return $new_icons;\n else\n return false;\n }", "function emc_get_content_icon() {\r\n\r\n\t$format = get_the_terms( get_the_ID(), 'emc_content_format' );\r\n\r\n\tif ( $format && ! is_wp_error( $format ) ) {\r\n\r\n\t\t$format = array_shift( $format );\r\n\t\t$url = get_template_directory_uri() . '/img/' . $format->slug . '.png';\r\n\t\t$title = sprintf( __( 'View all %s posts', 'emc' ), $format->name );\r\n\t\t$alt = sprintf( __( '%s icon', 'emc' ), $format->name );\r\n\t\t$html = sprintf( __( '<a href=\"%1$s\" title=\"%2$s\"><img class=\"emc-format-icon\" src=\"%3$s\" alt=\"%4$s\"/></a>', 'emc' ),\r\n\t\t\tesc_url( get_term_link( $format ) ),\r\n\t\t\tesc_attr( $title ),\r\n\t\t\tesc_url( $url ),\r\n\t\t\tesc_attr( $alt )\r\n\t\t);\r\n\t\treturn $html;\r\n\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}", "protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}", "protected function imageIcon(): string\n {\n $types = [\n 'image' => 'file-image',\n 'video' => 'file-video',\n 'document' => 'file-document',\n 'audio' => 'file-audio',\n 'code' => 'file-code',\n 'archive' => 'file-zip'\n ];\n\n $extensions = [\n 'xls' => 'file-spreadsheet',\n 'xlsx' => 'file-spreadsheet',\n 'csv' => 'file-spreadsheet',\n 'docx' => 'file-word',\n 'doc' => 'file-word',\n 'rtf' => 'file-word',\n 'mdown' => 'file-text',\n 'md' => 'file-text'\n ];\n\n return $extensions[$this->model->extension()] ??\n $types[$this->model->type()] ??\n parent::imageDefaults()['color'];\n }", "function quasar_get_post_format_icon(){\n\tglobal $post;\n\n\tif(!$post) return false;\n\t\n\t$post_format = get_post_format();\n\t\n\t$return = '';\n\t\n\t//Check if the post format is default\n\tif(!$post_format){\n\t\t//Post format is default. Default post format returns false from get_post_format() function\n\t\t$return = '<img src=\"'.F_WAY.'/images/icomoon/pencil.svg\" class=\"use_svg\" />';\n\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe005;\"></div>';\n\t}else{\n\t\tswitch($post_format){\n\t\t\tcase 'gallery':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe00e;\"></div>';\n\t\t\tbreak;\t\n\t\t\t\n\t\t\tcase 'image':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe00c;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'audio':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe011;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'video':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe013;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'aside':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe025;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'status':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe06d;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'link':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe0c3;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'quote':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe076;\"></div>';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'chat':\n\t\t\t$return = '<div class=\"icomoon-icon\" data-icomoon=\"&#xe06e;\"></div>';\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t\n\treturn $return;\n}", "function myousic_cpt_icon_shows(){\n?>\n\n<style>\n#adminmenu .menu-icon-shows div.wp-menu-image:before {\n content: \"\\f231\";\n}\n</style>\n\n<?php\n}", "public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}", "public function getIcon() {\r\n\t\r\n\t$fileType = $this->getType();\r\n\t\r\n\t$image = array(\r\n\t 'image/gif',\r\n\t 'image/png',\r\n\t 'image/jpg',\r\n\t 'image/jpeg'\r\n\t);\r\n\t\r\n\t$rarZip = array(\r\n\t 'application/zip',\r\n 'application/x-rar-compressed'\r\n\t);\r\n\t\r\n\t$audio = array(\r\n\t 'audio/mpeg'\r\n\t);\r\n\t\r\n\t$video = array(\r\n\t 'video/quicktime',\r\n\t 'video/mp4'\r\n\t);\r\n\t\r\n\t$pdf = array(\r\n\t 'application/pdf'\r\n\t);\r\n\t\r\n\t$wordExcelPptx = array(\r\n\t 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n\t 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n\t 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n\t 'application/msword',\r\n\t 'application/vnd.ms-excel',\r\n\t 'application/vnd.ms-powerpoint'\r\n\t);\r\n\t\r\n\tif (in_array($fileType, $image)) {\r\n\t return \"image.png\";\r\n\t} elseif (in_array($fileType, $audio)) {\r\n\t return \"audio.png\";\r\n\t} elseif (in_array($fileType, $video)) {\r\n\t return \"video.png\";\r\n\t} elseif (in_array($fileType, $rarZip)) {\r\n\t return \"rarZip.png\";\r\n\t} elseif (in_array($fileType, $pdf)) {\r\n\t return \"pdf.png\";\r\n\t} elseif (in_array($fileType, $wordExcelPptx)) {\r\n\t return \"wordExcelPptx.png\";\r\n\t} else {\r\n\t return \"default.png\";\r\n\t}\r\n\t\r\n }", "public function Icon()\n {\n $ext = strtolower($this->getExtension());\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = $this->appCategory();\n }\n\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }", "function get_icon($ending)\n{\n\tswitch($ending)\n\t{\n\t\tcase '.avi':\n\t\tcase 'mpeg':\n\t\tcase '.mpg':\n\t\tcase 'divx':\n\t\tcase '.mkv':\n\t\tcase '.ogm':\n\t\tcase '.mp4':\n\t\tcase '.wmv':\n\t\tcase '.vob':\n\t\tcase '.flv':\n\t\t\t$img = 'movie.png';\n\t\t\tbreak;\n\t\tcase '.pdf':\n\t\tcase '.dvi':\n\t\t\t$img = 'acroread.png';\n\t\t\tbreak;\n\t\tcase '.doc':\n\t\tcase 'docx':\n\t\tcase '.xls':\n\t\tcase 'xlsx':\n\t\tcase '.pps':\n\t\tcase 'ppsx':\n\t\tcase '.odt':\n\t\tcase '.odp':\n\t\tcase '.odx':\n\t\t\t$img = 'office.png';\n\t\t\tbreak;\n\t\tcase '.mp3':\n\t\tcase '.wma':\n\t\tcase '.aac':\n\t\tcase '.ogg':\n\t\tcase 'flac':\n\t\t\t$img = 'audio.png';\n\t\t\tbreak;\n\t\tcase '.mov':\n\t\tcase '.3gp':\n\t\t\t$img = 'quicktime.png';\n\t\t\tbreak;\n\t\tcase 'html':\n\t\tcase '.htm':\n\t\tcase '.php':\n\t\tcase '.cgi':\n\t\t\t$img = 'html.png';\n\t\t\tbreak;\n\t\tcase '.jpg':\n\t\tcase 'jpeg':\n\t\tcase '.png':\n\t\tcase '.bmp':\n\t\tcase 'tiff':\n\t\tcase '.xpm':\n\t\tcase '.gif':\n\t\tcase '.ico':\n\t\t\t$img = 'image.png';\n\t\t\tbreak;\n\t\tcase '.nfo':\n\t\tcase '.sfv':\n\t\t\t$img = 'info.png';\n\t\tbreak;\n\t\tcase '.tar':\n\t\t\t$img ='tar.png';\n\t\t\tbreak;\n\t\tcase '.tgz':\n\t\tcase 'r.gz':\n\t\tcase '.bz2':\n\t\tcase '.rar':\n\t\tcase '.zip':\n\t\t\t$img = 'tgz.png';\n\t\t\tbreak;\n\t\tcase '.iso':\n\t\tcase '.mdf':\n\t\tcase '.mds':\n\t\tcase '.ccd':\n\t\tcase '.bin':\n\t\tcase '.cue':\n\t\tcase '.nrg':\n\t\tcase '.vcd':\n\t\t\t$img = 'cdrom.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$img = 'file.png';\n\t\t\tbreak;\n\t}\n\treturn($img);\n}", "function getTopicStatusIcon($topicRead, $topicType, $topicStatus) {\n\t\t$topicStatusIcon = \"\";\n\t\t\n\t\t// What status icon should we use?\n\t\tif($_SESSION['username']) {\n\t\t\t// If we are logged in and the topic is new\n\t\t\tif(!$topicRead) {\n\t\t\t\t// New Posts\n\t\t\t\t$topicStatusIcon = ($topicStatus == TOPIC_LOCKED) ? \"images/board_icons/locked_new.jpg\" : \"images/board_icons/post_new.jpg\";\n\t\t\t\t$topicStatusIcon = ($topicType == POST_STICKY && $topicStatus != TOPIC_LOCKED) ? \"images/board_icons/sticky_new.jpg\" : $topicStatusIcon;\n\t\t\t\t$topicStatusIcon = (($topicType == POST_ANNOUNCE || $topicType == POST_GLOBAL_ANNOUNCE) && $topicStatus != TOPIC_LOCKED) ? \"images/board_icons/announcement_new.jpg\" : $topicStatusIcon;\n\t\t\t} \n\t\t\telse {\n\t\t\t\t// No new Posts\n\t\t\t\t$topicStatusIcon = ($topicStatus == TOPIC_LOCKED) ? \"images/board_icons/locked.jpg\" : \"images/board_icons/post.jpg\";\n\t\t\t\t$topicStatusIcon = ($topicType == POST_STICKY && $topic_status != TOPIC_LOCKED) ? \"images/board_icons/sticky.jpg\" : $topicStatusIcon;\n\t\t\t\t$topicStatusIcon = (($topicType == POST_ANNOUNCE || $topicType == POST_GLOBAL_ANNOUNCE) && $topicStatus != TOPIC_LOCKED) ? \"images/board_icons/announcement.jpg\" : $topicStatusIcon;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Guest is viewing the forum\n\t\t\t$topicStatusIcon = ($topicStatus == TOPIC_LOCKED) ? \"images/board_icons/locked.jpg\" : \"images/board_icons/post.jpg\";\n\t\t\t$topicStatusIcon = ($topicType == POST_STICKY && $topicStatus != TOPIC_LOCKED) ? \"images/board_icons/sticky.jpg\" : $topicStatusIcon;\n\t\t\t$topicStatusIcon = (($topicType == POST_ANNOUNCE || $topicType == POST_GLOBAL_ANNOUNCE) && $topicStatus != TOPIC_LOCKED) ? \"images/board_icons/announcement.jpg\" : $topicStatusIcon;\n\t\t}\n\t\t\n\t\treturn $topicStatusIcon;\n\t}", "public static function getFactoryIconUseIt() {\n }", "function add_menu_icons_styles(){\n?>\n \n<style>\n\n#menu-posts-galerie .wp-menu-image:before {\n\tcontent: \"\\f306\";\n}\n#menu-posts-reportage .wp-menu-image:before {\n\tcontent: \"\\f488\";\n}\n#menu-posts-publication .wp-menu-image:before {\n\tcontent: \"\\f497\";\n}\n#menu-posts-infos .wp-menu-image:before {\n\tcontent: \"\\f496\";\n}\n\n</style>\n \n<?php\n}", "function getPriorityIcon ($priority, $icon_theme_path) {\n $icon = '';\n\n switch ($priority) {\n case 1:\n case 2:\n $icon = getIcon($icon_theme_path, 'prio_high.png', create_span('!', 'high_priority'), _(\"High priority\"));\n break;\n case 5:\n $icon = getIcon($icon_theme_path, 'prio_low.png', create_span('&#8595;', 'low_priority'), _(\"Low priority\"));\n break;\n default:\n $icon = getIcon($icon_theme_path, 'transparent.png', '', _(\"Normal priority\"), 5);\n break;\n }\n\n return $icon;\n}", "static function Icon($icon_to_test)\n\t{\n\t\tif(in_array($icon_to_test, self::$_icons) )\n\t\t\treturn $icon_to_test;\n\t\tWdfException::Raise(\"Invalid Icon '$icon_to_test'\");\n return '';\n\t}", "public function getSpriteIconCode() {}", "public function get_icon() {\n\t\treturn 'eicon-image';\n\t}", "public function getIconReturnsReplacementIconWhenDeprecatedDataProvider() {}", "public function get_icon() {\n\t\tglobal $wc_authorize_sim;\n\n\t\t$icon = '';\n\n\t\t$icon = '<img src=\"' . esc_url( $wc_authorize_sim->force_ssl( $wc_authorize_sim->plugins_url('assets/images/authorize-net-co.png') ) ) . '\" alt=\"' . esc_attr( $this->title ) . '\" />';\n\n\t\treturn apply_filters( 'woocommerce_authorize_sim_icon', $icon, $this->id );\n\t}", "function getFlagIcon ($aFlags, $icon_theme_path) {\n /**\n * 0 = unseen\n * 1 = seen\n * 2 = deleted\n * 3 = deleted seen\n * 4 = answered\n * 5 = answered seen\n * 6 = answered deleted\n * 7 = answered deleted seen\n * 8 = flagged\n * 9 = flagged seen\n * 10 = flagged deleted\n * 11 = flagged deleted seen\n * 12 = flagged answered\n * 13 = flagged aswered seen\n * 14 = flagged answered deleted\n * 15 = flagged anserwed deleted seen\n * ...\n * 32 = forwarded\n * 33 = forwarded seen\n * 34 = forwarded deleted\n * 35 = forwarded deleted seen\n * ...\n * 41 = flagged forwarded seen\n * 42 = flagged forwarded deleted\n * 43 = flagged forwarded deleted seen\n */\n\n /**\n * Use static vars to avoid initialisation of the array on each displayed row\n */\n global $nbsp;\n static $flag_icons, $flag_values;\n if (!isset($flag_icons)) {\n // This is by no means complete...\n $flag_icons = array ( \n // Image icon name Text Icon Alt/Title Text\n // --------------- --------- --------------\n array ('msg_new.png', $nbsp, '('._(\"New\").')') ,\n array ('msg_read.png', $nbsp, '('._(\"Read\").')'),\n // i18n: \"D\" is short for \"Deleted\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_deleted.png', _(\"D\"), '('._(\"Deleted\").')'),\n array ('msg_read_deleted.png', _(\"D\"), '('._(\"Deleted\").')'),\n // i18n: \"A\" is short for \"Answered\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_reply.png', _(\"A\"), '('._(\"Answered\").')'),\n array ('msg_read_reply.png', _(\"A\"), '('._(\"Answered\").')'),\n array ('msg_new_deleted_reply.png', _(\"D\"), '('._(\"Answered\").')'),\n array ('msg_read_deleted_reply.png', _(\"D\"), '('._(\"Answered\").')'),\n // i18n: \"F\" is short for \"Flagged\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n // i18n: \"O\" is short for \"Forwarded\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_forwarded.png', _(\"O\"), '('._(\"Forwarded\").')'),\n array ('msg_read_forwarded.png', _(\"O\"), '('._(\"Forwarded\").')'),\n array ('msg_new_deleted_forwarded.png', _(\"D\"), '('._(\"Forwarded\").')'),\n array ('msg_read_deleted_forwarded.png', _(\"D\"), '('._(\"Forwarded\").')'),\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n );\n \n $flag_values = array('seen' => 1,\n 'deleted' => 2,\n 'answered' => 4,\n 'flagged' => 8,\n 'draft' => 16,\n 'forwarded' => 32);\n }\n\n /**\n * The flags entry contain all items displayed in the flag column.\n */\n $icon = '';\n\n $index = 0;\n foreach ($aFlags as $flag => $flagvalue) {\n switch ($flag) {\n case 'deleted':\n case 'answered':\n case 'forwarded':\n case 'seen':\n case 'flagged': if ($flagvalue) $index += $flag_values[$flag]; break;\n default: break;\n }\n }\n \n if (!empty($flag_icons[$index])) {\n $data = $flag_icons[$index];\n } else {\n//FIXME: previously this default was set to the last value of the $flag_icons array (when it was index 15 - flagged anserwed deleted seen) but I don't understand why... am changing it to flagged (index 15 just shows (only) the flag icon anyway)\n $data = $flag_icons[8]; // default to just flagged\n }\n\n $icon = getIcon($icon_theme_path, $data[0], $data[1], $data[2]);\n return $icon;\n}", "public function getCategoryIcon();", "protected function get__icon()\n\t{\n\t\treturn NULL;\n\t}", "function get_screen_icon()\n {\n }", "function inkpro_get_dashicon_css_unicode( $icon_slug ) {\r\n\r\n\t$dashicons_array = array(\r\n\t\t'admin-customizer' => '\\f540',\r\n\t\t'welcome-write-blog' => '\\f119',\r\n\t\t'welcome-view-site' => '\\f115',\r\n\t\t'menu' => '\\f333',\r\n\t\t'layout' => '\\f538',\r\n\t\t'editor-video' => '\\f219',\r\n\t\t'update' => '\\f463',\r\n\t\t'portfolio' => '\\f322',\r\n\t\t'images-alt' => '\\f232',\r\n\t\t'images-alt2' => '\\f233',\r\n\t\t'cart' => '\\f174',\r\n\t\t'calendar' => '\\f145',\r\n\t\t'calendar-alt' => '\\f508',\r\n\t\t'editor-textcolor' => '\\f215',\r\n\t\t'arrow-down-alt' => '\\f346',\r\n\t\t'format-image' => '\\f128',\r\n\t\t'camera' => '\\f306',\r\n\t\t'media-spreadsheet' => '\\f495',\r\n\t\t'format-audio' => '\\f127',\r\n\t\t'album' => '\\f514',\r\n\t\t'minus' => '\\f460',\r\n\t\t'editor-table' => '\\f535',\r\n\t\t'visibility' => '\\f177',\r\n\t);\r\n\r\n\tif ( isset( $dashicons_array[ $icon_slug ] ) ) {\r\n\t\treturn $dashicons_array[ $icon_slug ];\r\n\t}\r\n}", "public function icon(): string;", "public function getIconForResourceWithCustomImageMimeTypeReturnsImageIcon() {}", "function _getIcon($file)\r\n {\r\n $icon = '';\r\n if (is_file($file)) {\r\n $info = pathinfo($file);\r\n $icon = strtoupper($info['extension']);\r\n }\r\n \r\n $arrImageExt = array('JPEG', 'JPG', 'TIFF', 'GIF', 'BMP', 'PNG');\r\n $arrVideoExt = array('3GP', 'AVI', 'DAT', 'FLV', 'FLA', 'M4V', 'MOV', 'MPEG', 'MPG', 'OGG', 'WMV', 'SWF');\r\n $arrAudioExt = array('WAV', 'WMA', 'AMR', 'MP3', 'AAC');\r\n $arrPresentationExt = array('ODP', 'PPT', 'PPTX');\r\n $arrSpreadsheetExt = array('CSV', 'ODS', 'XLS', 'XLSX');\r\n $arrDocumentsExt = array('DOC', 'DOCX', 'ODT', 'RTF');\r\n \r\n switch (true) {\r\n case ($icon == 'TXT'):\r\n $icon = 'Text';\r\n break;\r\n case ($icon == 'PDF'):\r\n $icon = 'Pdf';\r\n break;\r\n case in_array($icon, $arrImageExt):\r\n $icon = 'Image';\r\n break;\r\n case in_array($icon, $arrVideoExt):\r\n $icon = 'Video';\r\n break;\r\n case in_array($icon, $arrAudioExt):\r\n $icon = 'Audio';\r\n break;\r\n case in_array($icon, $arrPresentationExt):\r\n $icon = 'Presentation';\r\n break;\r\n case in_array($icon, $arrSpreadsheetExt):\r\n $icon = 'Spreadsheet';\r\n break;\r\n case in_array($icon, $arrDocumentsExt):\r\n $icon = 'TextDocument';\r\n break;\r\n default :\r\n $icon = 'Unknown';\r\n break;\r\n }\r\n if (is_dir($file)) {\r\n $icon = 'Folder';\r\n }\r\n if (!file_exists(ASCMS_CORE_MODULE_PATH.'/FileBrowser/View/Media/'.$icon.'.png') or !isset($icon)) {\r\n $icon = '_blank';\r\n }\r\n return $this->_iconPath.$icon.'.png';\r\n }", "public static function post_format_icon($format) {\n\t\t?>\n\t\t<a class=\"single-post-format\" href=\"<?php echo esc_attr( add_query_arg( 'format_filter',$format, home_url()) ) ?>\" title=\"<?php echo get_post_format_string($format) ?>\">\n\t\t\t<?php echo do_shortcode('[icon name=\"'.WpvPostFormats::get_post_format_icon($format).'\"]') ?>\n\t\t</a>\n\t\t<?php\n\t}", "function wp_mime_type_icon($mime = 0)\n {\n }", "public function get_icon() {\n\t\t\treturn WC_SUMO_Sagepay_Common_Functions::get_icon( $this->cardtypes, $this->sagelink, $this->sagelogo, $this->id );\n\t\t}", "function geticon($extension)\n{\n\t// returns the appropriate icon according to the passed file extension\n\t\n\tglobal $template_icon;\n\tglobal $default_icon;\n\t\n\tswitch(strtolower($extension))\n\t{\n\t\tcase \"c\":\n\t\t\treturn ereg_replace(\"{ext}\",\"c\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"gif\":\n\t\t\treturn ereg_replace(\"{ext}\",\"gif\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"h\":\n\t\t\treturn ereg_replace(\"{ext}\",\"h\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"html\":\n\t\tcase \"htm\":\n\t\t\treturn ereg_replace(\"{ext}\",\"html\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"jpg\":\n\t\tcase \"jpeg\":\n\t\t\treturn ereg_replace(\"{ext}\",\"jpg\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"log\":\n\t\t\treturn ereg_replace(\"{ext}\",\"log\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"mp3\":\n\t\tcase \"wav\":\n\t\tcase \"aiff\":\n\t\tcase \"au\":\n\t\t\treturn ereg_replace(\"{ext}\",\"audio\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"php\":\n\t\tcase \"phps\":\n\t\t\treturn ereg_replace(\"{ext}\",\"php\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"png\":\n\t\t\treturn ereg_replace(\"{ext}\",\"png\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"psd\":\n\t\t\treturn ereg_replace(\"{ext}\",\"psd\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"swf\":\n\t\t\treturn ereg_replace(\"{ext}\",\"swf\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"ttf\":\n\t\tcase \"fon\":\n\t\t\treturn ereg_replace(\"{ext}\",\"font\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"txt\":\n\t\tcase \"text\":\n\t\t\treturn ereg_replace(\"{ext}\",\"txt\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"xml\":\n\t\t\treturn ereg_replace(\"{ext}\",\"xml\",$template_icon);\n\t\t\tbreak;\n\t\tcase \"xul\":\n\t\t\treturn ereg_replace(\"{ext}\",\"xul\",$template_icon);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn $default_icon;\n\t}\n}", "public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }", "function av_backend_icon($params)\n{\n\treturn avia_font_manager::backend_icon($params);\n}", "function plugin_geticon_nexmenu()\n{\n global $_CONF;\n\n return $_CONF['layout_url'] .'/nexmenu/images/admin/nexmenu.gif';\n}", "function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}", "public static function getIcon(): string\n {\n }", "public static function getIcon(): string\n {\n }", "public function getIcon() {}", "public function getIcon() {\n\t\t//regex is used to check if there's a filename within the iconFile string\n\t\treturn preg_replace('/^.*\\/([^\\/]+\\.(gif|png))?$/i', '\\1', $this->iconFile) ? $this->iconFile : '';\n\t}", "function add_transfers_icon_backend(){\n ?>\n <style type=\"text/css\">\n #menu-posts-transfers .wp-menu-image{\n background:transparent url(\"<?php bloginfo('stylesheet_directory'); ?>/images/transfers_icon.png\") no-repeat 50% 50% !important;\n background-size: 85% 85%!important;\n }\n #menu-posts-transfers .dashicons-before:before {\n content: none!important;\n }\n </style>\n <?php \n}", "function thememount_entry_icon( $echo = false ) {\n\t$postFormat = get_post_format();\n\tif( is_sticky() ){ $postFormat = 'sticky'; }\n\t$icon = 'pencil';\n\tswitch($postFormat){\n\t\tcase 'sticky':\n\t\t\t$icon = 'thumb-tack';\n\t\t\tbreak;\n\t\tcase 'aside':\n\t\t\t$icon = 'thumb-tack';\n\t\t\tbreak;\n\t\tcase 'audio':\n\t\t\t$icon = 'music';\n\t\t\tbreak;\n\t\tcase 'chat':\n\t\t\t$icon = 'comments';\n\t\t\tbreak;\n\t\tcase 'gallery':\n\t\t\t$icon = 'files-o';\n\t\t\tbreak;\n\t\tcase 'image':\n\t\t\t$icon = 'photo';\n\t\t\tbreak;\n\t\tcase 'link':\n\t\t\t$icon = 'link';\n\t\t\tbreak;\n\t\tcase 'quote':\n\t\t\t$icon = 'quote-left';\n\t\t\tbreak;\n\t\tcase 'status':\n\t\t\t$icon = 'envelope-o';\n\t\t\tbreak;\n\t\tcase 'video':\n\t\t\t$icon = 'film';\n\t\t\tbreak;\n\t}\n\t\n\t$iconCode = '<div class=\"thememount-post-icon-wrapper\">';\n\t\t$iconCode .= '<i class=\"tmicon-fa-'.$icon.'\"></i>';\n\t$iconCode .= '</div>';\n\t\n\t\n\t\n\t\n\t\n\tif ( $echo ){\n\t\techo $iconCode;\n\t} else {\n\t\treturn $iconCode;\n\t}\n}", "function DISPLAY_WIDGET_acurax_widget_icons_SC($atts)\r\n{\r\n\tglobal $acx_widget_si_icon_size, $acx_widget_si_sc_id;\r\n\textract(shortcode_atts(array(\r\n\t\"theme\" => '',\r\n\t\"size\" => $acx_widget_si_icon_size,\r\n\t\"autostart\" => 'false'\r\n\t), $atts));\r\n\tif ($theme > ACX_SOCIALMEDIA_WIDGET_TOTAL_THEMES) { $theme = \"\"; }\r\n\tif (!is_numeric($theme)) { $theme = \"\"; }\r\n\tif ($size > 55) { $size = $acx_widget_si_icon_size; }\r\n\tif (!is_numeric($size)) { $size = $acx_widget_si_icon_size; }\r\n\t\t$acx_widget_si_sc_id = $acx_widget_si_sc_id + 1;\r\n\t\tob_start();\r\n\t\techo \"<style>\\n\";\r\n\t\techo \"#short_code_si_icon img \\n {\";\r\n\t\techo \"width:\" . $size . \"px; \\n}\\n\";\r\n\t\techo \".scid-\" . $acx_widget_si_sc_id . \" img \\n{\\n\";\r\n\t\techo \"width:\" . $size . \"px !important; \\n}\\n\";\r\n\t\techo \"</style>\";\r\n\t\techo \"<div id='short_code_si_icon' style='text-align:center;' class='acx_smw_float_fix scid-\" . $acx_widget_si_sc_id . \"'>\";\r\n\t\tacurax_si_widget_simple($theme);\r\n\t\techo \"</div>\";\r\n\t\t$content = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\treturn $content;\r\n}", "function pp_post_type_icon( $supplied_args = array() ) {\n\n\t// Get the args\n\t$args = wp_parse_args( $supplied_args, array() );\n?>\n\t<style>\n\t\t.<?php echo $args['menu_class']; ?> div.wp-menu-image { opacity: .7; }\n\t\t.<?php echo $args['menu_class']; ?> div.wp-menu-image:before { content: ''; background: url(<?php echo $args['icon']; ?>) no-repeat center center; }\n\t\t.<?php echo $args['menu_class']; ?>:hover div.wp-menu-image { opacity: 1; }\n\t\t.<?php echo $args['menu_class']; ?>:hover div.wp-menu-image:before { content: ''; background: url(<?php echo $args['icon_hover']; ?>) no-repeat center center; }\n\t\t.<?php echo $args['menu_class']; ?>.wp-menu-open:hover div.wp-menu-image:before { content: ''; background: url(<?php echo $args['icon']; ?>) no-repeat center center; }\n\t\t.<?php echo $args['menu_class']; ?>.wp-menu-open div.wp-menu-image { opacity: 1; }\n\t</style>\n<?php\n}", "public function icon($icon);", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "function statusIcon() {\n\t\t// published, draft\n\t\t// page_white_clock.png\n\t\t// page_white_edit.png\n\n\t\tswitch ($this->status) {\n\t\t\tcase 'published':\n\t\t\t\t// varit, eller ska bli, publicerad?\n\t\t\t\t// $datePublish $dateUnpublish\n\t\t\t\tif ($this->isPublished()) {\n\t\t\t\t\treturn POLARBEAR_WEBPATH . 'images/silkicons/page_white_text.png';\n\t\t\t\t} else {\n\t\t\t\t\treturn POLARBEAR_WEBPATH . 'images/silkicons/page_white_text_clock.png';\n\t\t\t\t}\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'draft':\n\t\t\t\treturn POLARBEAR_WEBPATH . 'images/silkicons/page_white_text_edit.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn POLARBEAR_WEBPATH . 'images/silkicons/page_white_text.png';\n\t\t}\n\t\t\n\t}", "public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}", "public function getIcons($milestone)\n {\n // Compose the channel icon path\n $bundlePath = $milestone->getMilestoneModule()->getBundle()->getWebAssetsPath();\n $bundleName = $milestone->getMilestoneModule()->getBundle()->getName();\n $iconName = str_replace('campaignchain/', '', str_replace('-', '_', $bundleName)).'.png';\n $icon['16px'] = '/'.$bundlePath.'/images/icons/16x16/'.$iconName;\n $icon['24px'] = '/'.$bundlePath.'/images/icons/24x24/'.$iconName;\n\n return $icon;\n }", "function wp_super_emoticons_shortcode ($attr, $content = null ) {\n\t$attr = shortcode_atts(array(\n\t\t'file' => 'file',\n\t\t'title' => 'title'\n\t\t), $attr);\n\t\t\t\t\t\t\t\t \n\treturn '<img class=\"superemotions\" title=\"' . $attr['title'] . '\" alt=\"' . $attr['title'] . '\" border=\"0\" src=\"' . get_bloginfo('wpurl') . '/wp-includes/images/smilies/' . $attr['file'] . '\" />';\n}", "function emc_get_tax_icon( $taxonomy ) {\r\n\r\n\tif ( isset( $taxonomy ) ){\r\n\t\t$tax_slug = $taxonomy;\r\n\t} else {\r\n\t\tglobal $wp_query;\r\n\t\t$tax = $wp_query->get_queried_object();\r\n\t\t$tax_slug = $tax->taxonomy;\r\n\t}\r\n\r\n\tswitch ( $tax_slug ) {\r\n\t\tcase 'emc_big_idea':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Big Ideas', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_tax_found':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Foundational Math Concepts', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_tax_common_core':\r\n\t\t\t$icon = 'star';\r\n\t\t\t$alt = __( 'Star icon for Common Core Alignment', 'emc' );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t$url = get_template_directory_uri() . '/img/' . $icon . '.png';\r\n\t$html = sprintf( '<div class=\"emc-format\"><img class=\"emc-format-icon\" src=\"%1$s\" alt=\"%2$s\"/></div><!-- .emc-format -->',\r\n\t\tesc_url( $url ),\r\n\t\tesc_attr( $alt )\r\n\t);\r\n\r\n\treturn $html;\r\n\r\n}", "protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}", "public function get_menu_icon() {\n\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\n\n\t}", "function generate_do_icon_css() {\n\t$output = false;\n\n\tif ( 'font' === generate_get_option( 'icons' ) ) {\n\t\t$url = trailingslashit( get_template_directory_uri() );\n\n\t\t$output = '@font-face {\n\t\t\tfont-family: \"GeneratePress\";\n\t\t\tsrc: url(\"' . $url . 'fonts/generatepress.eot\");\n\t\t\tsrc: url(\"' . $url . 'fonts/generatepress.eot#iefix\") format(\"embedded-opentype\"),\n\t\t\t\t url(\"' . $url . 'fonts/generatepress.woff2\") format(\"woff2\"),\n\t\t\t\t url(\"' . $url . 'fonts/generatepress.woff\") format(\"woff\"),\n\t\t\t\t url(\"' . $url . 'fonts/generatepress.ttf\") format(\"truetype\"),\n\t\t\t\t url(\"' . $url . 'fonts/generatepress.svg#GeneratePress\") format(\"svg\");\n\t\t\tfont-weight: normal;\n\t\t\tfont-style: normal;\n\t\t}';\n\n\t\tif ( defined( 'GENERATE_MENU_PLUS_VERSION' ) ) {\n\t\t\t$output .= '.main-navigation .slideout-toggle a:before,\n\t\t\t.slide-opened .slideout-overlay .slideout-exit:before {\n\t\t\t\tfont-family: GeneratePress;\n\t\t\t}\n\n\t\t\t.slideout-navigation .dropdown-menu-toggle:before {\n\t\t\t\tcontent: \"\\f107\" !important;\n\t\t\t}\n\n\t\t\t.slideout-navigation .sfHover > a .dropdown-menu-toggle:before {\n\t\t\t\tcontent: \"\\f106\" !important;\n\t\t\t}';\n\t\t}\n\t}\n\n\tif ( 'svg' === generate_get_option( 'icons' ) ) {\n\t\t$output = 'button.menu-toggle:before,\n\t\t.search-item a:before,\n\t\t.dropdown-menu-toggle:before,\n\t\t.cat-links:before,\n\t\t.tags-links:before,\n\t\t.comments-link:before,\n\t\t.nav-previous .prev:before,\n\t\t.nav-next .next:before,\n\t\t.generate-back-to-top:before {\n\t\t\tdisplay: none;\n\t\t}';\n\t}\n\n\tif ( $output ) {\n\t\treturn str_replace( array( \"\\r\", \"\\n\", \"\\t\" ), '', $output );\n\t}\n}", "function title_icon_url2icon_filter($custom_field) {\n\t$img = $custom_field;\n\tif (preg_match('#\\[img\\](.+?)\\[/img\\]#i', $custom_field, $matches)) {\n\t\t$img = '<img src=\"'.$matches[1].'\" alt =\"\" />';\n\t}\n\treturn $img;\n}", "public function getIcon();", "public function getIcon();", "function av_icon_css_string($char)\n{\n\tglobal $avia_config;\n\treturn \"content:'\\\\\".str_replace('ue','E',$avia_config['font_icons'][$char]['icon']).\"'; font-family: '\".$avia_config['font_icons'][$char]['font'].\"';\";\n}", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/tool.png';\n }", "public function get_icon() {\n\t\treturn 'eicon-product-images';\n\t}", "public function getIconTag() {\n\t\treturn '<img class=\"languageIcon jsTooltip\" src=\"' . $this->getIconPath() . '\" title=\"' . $this->getTitle() . '\" alt=\"' . $this->getTitle() . '\" />';\n\t}", "public function get_icon()\n {\n return 'fa fa-image';\n }", "function i($code){\n $icon = '<i class=\"fa fa-'.$code.'\"></i>';\n return $icon;\n }", "public function getIcon()\n {\n }", "public static function process_smile($message){\n //Replace It With His Css Class\n foreach($GLOBALS['C']->POST_ICONS as $k=>$v) {\n\n //$txt = '<span class=\"smile-'.$parent_class.' smile-'.$v.'\"></span>';//Creating Span Class\n /**\n * Replace With How To Process Smile\n */\n $txt\t= '<img src=\"'.$GLOBALS['C']->IMG_URL.'icons/'.$v.'\" class=\"post_smiley\" alt=\"'.$k.'\" title=\"'.$k.'\" />';\n $message\t= str_replace($k, $txt, $message);\n }\n\n return $message;\n }", "function _caNavIconTypeToName($pn_type) {\n\t\t$vs_ca_class = '';\n\t\tswitch($pn_type) {\n\t\t\tcase __CA_NAV_ICON_ADD__:\n\t\t\t\t$vs_fa_class = 'fa-plus-circle';\t\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_DELETE__:\n\t\t\t\t$vs_fa_class = 'fa fa-times';\n\t\t\t\t$vs_ca_class = 'deleteIcon'; \n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_CANCEL__:\n\t\t\t\t$vs_fa_class = 'fa-minus-circle';\n\t\t\t\t$vs_ca_class = 'cancelIcon';\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase __CA_NAV_ICON_EDIT__:\n\t\t\t\t$vs_fa_class = 'fa-file';\n\t\t\t\t$vs_ca_class = 'editIcon'; \n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_BATCH_EDIT__:\n\t\t\t\t$vs_fa_class = 'fa-magic';\n\t\t\t\t$vs_ca_class = 'batchIcon'; \n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_ALERT__:\n\t\t\t\t$vs_fa_class = 'fa-exclamation-triangle';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_SEARCH__:\n\t\t\t\t$vs_fa_class = 'fa-search';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_INFO__:\n\t\t\t\t$vs_fa_class = 'fa-info-circle';\n\t\t\t\t$vs_ca_class = 'infoIcon';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_DOWNLOAD__:\n\t\t\t\t$vs_fa_class = 'fa-download';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_MAKE_PRIMARY__:\n\t\t\t\t$vs_fa_class = 'fa-check';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_APPROVE__:\n\t\t\t\t$vs_fa_class = 'fa-thumbs-o-up';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_UPDATE__:\n\t\t\t\t$vs_fa_class = 'fa-refresh';\n\t\t\t\t$vs_ca_class = 'updateIcon'; \n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_LOGIN__:\n\t\t\t\t$vs_fa_class = 'fa-check-circle-o';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_SAVE__:\n\t\t\t\t$vs_fa_class = 'fa-check-circle-o';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_HELP__:\n\t\t\t\t$vs_fa_class = 'fa-life-ring';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_GO__:\n\t\t\t\t$vs_fa_class = 'fa-chevron-circle-right';\n\t\t\t\t$vs_ca_class = 'hierarchyIcon';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_DEL_BUNDLE__:\n\t\t\t\t$vs_fa_class = 'fa-times-circle';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_CLOSE__:\n\t\t\t\t$vs_fa_class = 'fa-times';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_WATCH__:\n\t\t\t\t$vs_fa_class = 'fa-eye';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_UNWATCH__:\n\t\t\t\t$vs_fa_class = 'fa-eye caIconRed';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_ZOOM_IN__:\n\t\t\t\t$vs_fa_class = 'fa-search-plus';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_ZOOM_OUT__:\n\t\t\t\t$vs_fa_class = 'fa-search-minus';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_MAGNIFY__:\n\t\t\t\t$vs_fa_class = 'fa-search';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_OVERVIEW__:\n\t\t\t\t$vs_fa_class = 'fa-picture-o';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_PAN__:\n\t\t\t\t$vs_fa_class = 'fa-arrows';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_CHANGE__:\n\t\t\t\t$vs_fa_class = 'fa-retweet';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_INTERSTITIAL_EDIT_BUNDLE__:\n\t\t\t\t$vs_fa_class = 'fa-paperclip';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_COLLAPSE__:\n\t\t\t\t$vs_fa_class = 'fa-minus-circle';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_EXPAND__:\n\t\t\t\t$vs_fa_class = 'fa-plus-circle';\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\tcase __CA_NAV_ICON_COMMIT__:\n\t\t\t\t$vs_fa_class = 'fa-check-circle-o';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SETTINGS__:\n\t\t\t\t$vs_fa_class = 'fa-cog';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_FILTER__:\n\t\t\t\t$vs_fa_class = 'fa-sliders';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_EXPORT__:\n\t\t\t\t$vs_fa_class = 'fa-download';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_EXPORT_SMALL__:\n\t\t\t\t$vs_fa_class = 'fa-external-link-square';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SETS__:\n\t\t\t\t$vs_fa_class = 'fa-clone';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_RIGHT_ARROW__:\n\t\t\t\t$vs_fa_class = 'fa-chevron-right';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_VISUALIZE__:\n\t\t\t\t$vs_fa_class = 'fa-line-chart';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_ADD_WIDGET__:\n\t\t\t\t$vs_fa_class = 'fa-plus-circle';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_DUPLICATE__:\n\t\t\t\t$vs_fa_class = 'fa-files-o';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_CHILD__:\n\t\t\t\t$vs_fa_class = 'fa-child';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SCROLL_RT__:\n\t\t\t\t$vs_fa_class = 'fa-chevron-right';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SCROLL_LT__:\n\t\t\t\t$vs_fa_class = 'fa-chevron-left';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_MOVE__:\n\t\t\t\t$vs_fa_class = 'fa-truck';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_IMAGE__:\n\t\t\t\t$vs_fa_class = 'fa-file-image-o';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_DOT__:\n\t\t\t\t$vs_fa_class = 'fa-dot-cirle-o';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_PDF__:\n\t\t\t\t$vs_fa_class = 'fa-file-pdf-o';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SET_CENTER__:\n\t\t\t\t$vs_fa_class = 'fa-bullseye';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_VISIBILITY_TOGGLE__:\n \t\t\t\t$vs_fa_class = 'fa-arrow-circle-up';\n \t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_UP__:\n \t\t\t\t$vs_fa_class = 'fa-arrow-circle-up';\n \t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_DOWN__:\n \t\t\t\t$vs_fa_class = 'fa-arrow-circle-down';\n \t\t\t\tbreak;\t\t\t\t\n \t\t\tcase __CA_NAV_ICON_FOLDER__:\n \t\t\t\t$vs_fa_class = 'fa-folder';\t\n \t\t\t\tbreak;\t\t\t\t\n \t\t\tcase __CA_NAV_ICON_FOLDER_OPEN__:\n \t\t\t\t$vs_fa_class = 'fa-folder-open';\t\n \t\t\t\tbreak;\t\t\t\t\t\t\t\n \t\t\tcase __CA_NAV_ICON_FILE__:\n \t\t\t\t$vs_fa_class = 'fa-file';\t\n \t\t\t\tbreak;\t\t\n \t\t\tcase __CA_NAV_ICON_CLOCK__:\n \t\t\t\t$vs_fa_class = 'fa-clock-o';\t\n \t\t\t\tbreak;\t\t\t\t\n \t\t\tcase __CA_NAV_ICON_SPINNER__:\n \t\t\t\t$vs_fa_class = 'fa fa-cog fa-spin';\t\n \t\t\t\tbreak;\t\t\t\t\t\t\t\t\n \t\t\tcase __CA_NAV_ICON_HIER__:\n \t\t\t\t$vs_fa_class = 'fa fa-sitemap';\n \t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_SPREADSHEET__:\n\t\t\t\t$vs_fa_class = 'fa-table';\n\t\t\t\tbreak;\t\n\t\t\tcase __CA_NAV_ICON_VERTICAL_ARROWS__:\n\t\t\t\t$vs_fa_class = 'fa-arrows-v';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_MEDIA_METADATA__:\n\t\t\t\t$vs_fa_class = 'fa-file-audio-o';\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\tcase __CA_NAV_ICON_EXTRACT__:\n\t\t\t\t$vs_fa_class = 'fa-scissors';\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\tcase __CA_NAV_ICON_ROTATE__:\n\t\t\t\t$vs_fa_class = 'fa-undo';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_NUKE__:\n\t\t\t\t$vs_fa_class = 'fa-bomb';\n\t\t\t\tbreak;\n\t\t\tcase __CA_NAV_ICON_FULL_RESULTS__:\n\t\t\t\t$vs_fa_class = 'fa-bars';\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tprint \"INVALID CONSTANT $pn_type<br>\\n\";\n\t\t\t\treturn null;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn array('class' => trim(\"{$vs_fa_class} {$vs_ca_class}\"), 'fa-class' => $vs_fa_class, 'ca-class' => $vs_ca_class);\n\t}", "public function getIconForResourceWithPngFileReturnsIcon() {}", "function screen_icon()\n {\n }", "function loadIcon16($name) {\n echo \"<img src=\\\"icos/16-$name.png\\\" alt=\\\"\\\" width=\\\"16\\\" height=\\\"16\\\">\";\n }", "function av_icon($icon, $font = false, $string = 'string')\n{\t\n\treturn avia_font_manager::frontend_icon($icon, $font, $string);\n}", "public function getIcon() {\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n switch ($mime[0]) {\r\n case \"video\" : \r\n return [\r\n \"label\" => \"Video\",\r\n \"icon\" => '<i class=\"fa fa-file-video-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"image\" : \r\n return [\r\n \"label\" => \"Image\",\r\n \"icon\" => '<i class=\"fa fa-file-image-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n switch ($this->mime) {\r\n case \"application/msword\":\r\n case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":\r\n return [ \r\n \"label\" => \"Microsoft Word\",\r\n \"icon\" => '<i class=\"fa fa-file-word-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/vnd.ms-excel\":\r\n case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":\r\n return [ \r\n \"label\" => \"Microsoft Excel\",\r\n \"icon\" => '<i class=\"fa fa-file-excel-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/pdf\":\r\n case \"application/x-pdf\":\r\n return [ \r\n \"label\" => \"PDF\",\r\n \"icon\" => '<i class=\"fa fa-file-pdf-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n return [\r\n \"label\" => \"Unknown\",\r\n \"icon\" => '<i class=\"fa fa-file-o\"></i>'\r\n ];\r\n \r\n }", "function plugin_geticon_bad_behavior2 ()\n{\n global $_CONF;\n\n return $_CONF['site_url'] . '/' . BAD_BEHAVIOR_PLUGIN\n . '/images/bad_behavior2.png';\n}", "public function getIconName(): ?string;", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }", "public function updateHomeIcon()\n {\n if(! array_key_exists( 'home_icon', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['home_icon']);\n $hook = '<!-- bread_home_icon -->';\n $file = base_path($this->options['paths']['stubs']) . '/views/components/home_icon.blade.php';\n $this->updateFileContent($target, $hook, $file);\n\n //If no home path defined return\n if(! array_key_exists( 'home_icon_css', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['home_icon_css']);\n $hook = '/* bread_home_icon_css */';\n $file = base_path($this->options['paths']['stubs']) . '/views/components/home_icon_css.blade.php';\n $this->updateFileContent($target, $hook, $file);\n }", "function sl_add_toolbar_site_icon() {\n\t\tif ( ! is_admin_bar_showing() ) {\n\t\t\treturn;\n\t\t}\n\t\techo '<style>\n\t\t\t#wp-admin-bar-site-name > a.ab-item:before {\n\t\t\t\tfloat: left;\n\t\t\t\twidth: 16px;\n\t\t\t\theight: 16px;\n\t\t\t\tmargin: 5px 5px 0 -1px;\n\t\t\t\tdisplay: block;\n\t\t\t\tcontent: \"\";\n\t\t\t\topacity: 0.4;\n\t\t\t\tbackground: #000 url(\"http://www.google.com/s2/u/0/favicons?domain=' . parse_url( home_url(), PHP_URL_HOST ). '\");\n\t\t\t\tborder-radius: 16px;\n\t\t\t}\n\t\t\t#wp-admin-bar-site-name:hover > a.ab-item:before {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t</style>';\n\t}", "public function get_icon()\r\n {\r\n return 'eicon-posts-justified';\r\n }", "public function get_font_icon() {\n\t\t$icons = array(\n\t\t\t'twitter' => 'twitter',\n\t\t\t'instagram' => 'instagram'\n\t\t\t);\n\t\tif ( isset( $icons[ $this->get_embed_type() ] ) ) {\n\t\t\treturn $icons[ $this->get_embed_type() ];\n\t\t} else {\n\t\t\treturn 'flickr';\n\t\t}\n\t}", "public function get_icon2d(): string\n {\n return $this->_download('icon2d.png');\n }", "public function defaultIcon()\n {\n return 'mail';\n }", "private function createIconModifier($icon)\n {\n return $this->getBaseClass(\n str_replace(\"_\", \"-\", $icon),\n true\n );\n }", "function dt_sc_icon_box($attrs, $content = null, $shortcodename = \"\") {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'type' => '',\n\t\t\t\t'fontawesome_icon' => '',\n\t\t\t\t'custom_icon' => '',\n\t\t\t\t'inner_image'=>'',\n\t\t\t\t'title' => '',\n\t\t\t\t'link' => '',\n\t\t\t\t'color' =>''\n\t\t), $attrs ) );\n\t\t\n\t\t$content = DTCoreShortcodesDefination::dtShortcodeHelper ( $content );\n\t\t\n\t\t$out = \"<div class='dt-sc-ico-content {$type} {$color}'>\";\n\t\tif( !empty($fontawesome_icon) && empty($custom_icon) ){\n\t\t\t$out .= \"<div class='icon'> <span class='fa fa-{$fontawesome_icon}'> </span> </div>\";\n\t\t\n\t\t}elseif( !empty($custom_icon) ){\n\t\t\t$out .= \"<div class='icon'> <span> <img src='{$custom_icon}' alt=''/></span> </div>\";\t\n\t\t}\n\t\t\n\t\tif( !empty($link) ) :\n\t\t\t$out .= empty( $title ) ? $out : \"<h2><a href='{$link}'> {$title} </a></h2>\";\n\t\telse:\n\t\t\t$out .= empty( $title ) ? $out : \"<h2>{$title}</h2>\";\n\t\tendif;\n\n\t\tif( $type == \"type1\" && !empty($inner_image) ):\n\t\t\t$out .= \"<div class='image'><img src='{$inner_image}' alt='' title=''/></div>\";\n\t\tendif;\t\n\t\t\t\n\t\t\n\t\t$out .= $content;\n\t\t$out .= \"</div>\";\n\t\treturn $out;\n\t}", "public function get_icon() {\n\t\treturn 'eicon-posts-ticker';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-posts-ticker';\n\t}", "function convert_smilies($text)\n {\n }", "protected function getIcon()\n {\n /** @var IconFactory $iconFactory */\n $iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n return $iconFactory->getIcon('px-shopware-clear-cache', Icon::SIZE_SMALL)->render();\n }", "public function getIconName() {}", "public function getIconName() {}" ]
[ "0.6816528", "0.6178962", "0.60676557", "0.6058385", "0.6034404", "0.5954415", "0.59475636", "0.5906561", "0.58185065", "0.57810295", "0.57236284", "0.57144177", "0.5681124", "0.563186", "0.56192094", "0.5598491", "0.55973047", "0.55961406", "0.55905366", "0.55645037", "0.55555344", "0.5550339", "0.55332595", "0.5532294", "0.5504993", "0.5498398", "0.54875433", "0.5474453", "0.5473778", "0.5472534", "0.543097", "0.541526", "0.5391048", "0.53747946", "0.5374372", "0.53661066", "0.536116", "0.53548247", "0.5333149", "0.53326374", "0.5325329", "0.53234607", "0.53085864", "0.53085864", "0.529828", "0.5290742", "0.52872694", "0.52774817", "0.5243048", "0.5233962", "0.52301955", "0.52255386", "0.52255386", "0.5217326", "0.52114516", "0.52007776", "0.5196709", "0.5189449", "0.5184807", "0.5180222", "0.517592", "0.5162751", "0.5159643", "0.5159643", "0.5146883", "0.5121999", "0.5119572", "0.51098716", "0.5106524", "0.5097115", "0.5091088", "0.50882924", "0.5080448", "0.50758594", "0.5068645", "0.5066734", "0.5065769", "0.50619394", "0.50571233", "0.5056421", "0.50558937", "0.50558937", "0.50558937", "0.50558937", "0.50558937", "0.50558937", "0.5042124", "0.5033537", "0.5032473", "0.5025875", "0.5024624", "0.5024102", "0.5013884", "0.5012914", "0.5011095", "0.5011095", "0.5006692", "0.5002954", "0.5002167", "0.5002167" ]
0.5297309
45
return $this>render('intro',['model' => $model]);
public function actionPattern($model) { $patternList = Pattern::find() ->where(['design_patterns_id' => $pattern]) ->all(); $patternName = DesignPatterns::find() ->where(['id' => $pattern]) ->one(); return $this->render('pattern',['patternList' => $patternList,'pattern'=>$patternName]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render(){\n\n }", "public function render()\n {\n //\n }", "function introduction(){\n // show the introduction page\n echo Template::instance()->render('views/introduction.php');\n}", "public function render(){\n\t\t\n\t}", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function index() {\r\r\n $this->render('index', array('model' => $this->model));\r\r\n }", "public function actionView($id)\n{\n$this->render('view',array(\n'model'=>$this->loadModel($id),\n));\n}", "public function render()\n {\n viewAdd::renderAdds();\n ?>\n\n<?php\n\n }", "function render(){\n\t\t\n\t}", "protected function render(){\n //render view\n \n }", "function render()\n\t{\n\t}", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function render() {\r\n\t\t\r\n\t}", "public function compose(){\n\n $data=About::first();\n return view('backend.about.aboutcreate',compact('data'));\n}", "function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }", "function render()\n {\n }", "function render()\n {\n }", "public function actionView()\n {\n \n }", "public function index()\n {\n\n\n $this->view->render();\n }", "function render() {\n }", "function render() {\n }", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function Render()\n {\n }", "public function actionHome()\n {\n return $this->render('home');\n}", "public function index()\n {\n return $this->render('index', [\n 'model' => $this->model,\n ]);\n }", "function model(){\n $data['model'] = $this->m_rental->get_data('car_model')->result();\n $this->load->view('header');\n $this->load->view('admin/model', $data);\n $this->load->view('footer');\n }", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function render(){\r\n $productos2 = $this->model->get();\r\n $this->view->productos = $productos;\r\n $this->view->render('burger/index');\r\n }", "public function actionView($id_cat_puesto)\n{\n$this->render('view',array(\n'catPuesto'=>$this->loadModel($id_cat_puesto),\n));\n}", "public function index(){\n\n \t\t$compact = array();\n \t\t$compact['title']=$this->modName;\n \t\t$compact['models']=$this->model->where('parent_id',null)->orderBy('position')->get();\n \n \t\treturn view($this->viewPr.'index',['compact'=>$compact]);\n \t}", "function index() {\n\n $this->view->render();\n\n }", "public function view()\n {\n //\n }", "public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n {\n return view('empmodel');\n }", "public function render()\n {\n return view('components.pilihan');\n }", "function model()\n {\n return \"\";\n }", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();" ]
[ "0.7311483", "0.6938712", "0.69269764", "0.69018966", "0.6789951", "0.6789951", "0.6789951", "0.6789951", "0.6776813", "0.6772963", "0.67692435", "0.67626125", "0.6672227", "0.66621417", "0.6656979", "0.6655672", "0.66483825", "0.6646549", "0.66424584", "0.66163987", "0.66163987", "0.66034085", "0.6593828", "0.65788174", "0.65788174", "0.6557619", "0.6557619", "0.6557619", "0.6557619", "0.6557619", "0.6552764", "0.65418136", "0.65107435", "0.64890045", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466894", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.6466656", "0.64559156", "0.6455154", "0.6442285", "0.6431255", "0.6408895", "0.63936996", "0.63931155", "0.6372121", "0.63646245", "0.63642484", "0.63627684", "0.63627684", "0.63627684", "0.63627684", "0.63627684" ]
0.0
-1
[icons extra the icon]
public function icons($item) { // return keyExtractor($item, "icon") ?: "fa fa-circle-o"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}", "function addIcon($i){\n return $this->add('Icon',null,'Icon')->set($i)->addClass('atk-size-mega');\n }", "public function icon($icon);", "function TS_VCSC_Add_Icons_Element_Lean() {\r\n\t\t\t\tvc_lean_map('TS-VCSC-Font-Icons', \t\t\t\t\t\t\tarray($this, 'TS_VCSC_Add_Icons_Element'), null);\r\n\t\t\t}", "public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}", "protected function registerTCAIcons() {}", "protected function collectTcaSpriteIcons() {}", "protected function buildCssAndRegisterIcons() {}", "public function getIcon() {}", "function atom_site_icon()\n {\n }", "public function getIcon()\n {\n }", "function load_icons() {\n themify_get_icon( 'ti-import' );\n themify_get_icon( 'ti-export' );\n Themify_Enqueue_Assets::loadIcons();\n }", "public function icon(): string;", "public function setIcons() {\n\t\t$this->icons = array(\n\t\t\t'slider' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'carousel' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'testimonial' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'portfolio' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'options' => 'dashicons-admin-generic'\n\t\t);\n\t}", "function screen_icon()\n {\n }", "function wp_site_icon()\n {\n }", "public function getIcon();", "public function getIcon();", "protected function get__icon()\n\t{\n\t\treturn NULL;\n\t}", "function rss2_site_icon()\n {\n }", "function studeon_vc_iconpicker_type_fontawesome($icons) {\n\t\t$list = studeon_get_list_icons();\n\t\tif (!is_array($list) || count($list) == 0) return $icons;\n\t\t$rez = array();\n\t\tforeach ($list as $icon)\n\t\t\t$rez[] = array($icon => str_replace('icon-', '', $icon));\n\t\treturn array_merge( $icons, array(esc_html__('Theme Icons', 'studeon') => $rez) );\n\t}", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function setIcon($icon);", "public function get_icon()\n {\n return 'fa fa-image';\n }", "public function get_icon() {\n\t\treturn 'eicon-image';\n\t}", "protected function iconHelp()\n {\n return 'For more icons please see <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">http://fontawesome.io/icons/</a>';\n }", "private function appendIcons($icons): string\n {\n if (is_array($icons) && !isset($icons['utf8'])) {\n $icons = array_reverse($icons);\n }\n\n return ' ' . $this->prepareIcons($icons);\n }", "private function setIconPaths()\n {\n // Directory URL and path\n $plugin = CGIT_SOCIALIZE_PLUGIN;\n $dir = 'icons';\n $url = plugin_dir_url($plugin) . $dir;\n $path = plugin_dir_path($plugin) . $dir;\n\n // Apply filters for customization\n $ext = apply_filters('cgit_socialize_icon_extension', '.svg');\n $url = apply_filters('cgit_socialize_icon_url', $url);\n $path = apply_filters('cgit_socialize_icon_path', $path);\n\n // Make sure directories have trailing slashes\n $url = trailingslashit($url);\n $path = trailingslashit($path);\n\n // Add URLs and paths to each network\n foreach ($this->networks as $key => $value) {\n $this->networks[$key]['icon'] = $url . $key . $ext;\n $this->networks[$key]['icon_path'] = $path . $key . $ext;\n }\n }", "protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}", "function mod_escape_get_fontawesome_icon_map() {\n return [\n 'mod_escape:e/copy' => 'fa-clone',\n ];\n}", "function getAvailableIconNames() ;", "function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function _renderIcon()\n {\n return !empty($this->_icon) ? '<i class=\"' . $this->_icon . '\"></i>' : '';\n }", "public function icons() {\n\n\t\t$solid_icons = array(\n\t\t\t\"fas-f641\" => \"fas fa-ad\",\n\t\t\t\"fas-f2b9\" => \"fas fa-address-book\",\n\t\t\t\"fas-f2bb\" => \"fas fa-address-card\",\n\t\t\t\"fas-f042\" => \"fas fa-adjust\",\n\t\t\t\"fas-f5d0\" => \"fas fa-air-freshener\",\n\t\t\t\"fas-f037\" => \"fas fa-align-center\",\n\t\t\t\"fas-f039\" => \"fas fa-align-justify\",\n\t\t\t\"fas-f036\" => \"fas fa-align-left\",\n\t\t\t\"fas-f038\" => \"fas fa-align-right\",\n\t\t\t\"fas-f461\" => \"fas fa-allergies\",\n\t\t\t\"fas-f0f9\" => \"fas fa-ambulance\",\n\t\t\t\"fas-f2a3\" => \"fas fa-american-sign-language-interpreting\",\n\t\t\t\"fas-f13d\" => \"fas fa-anchor\",\n\t\t\t\"fas-f103\" => \"fas fa-angle-double-down\",\n\t\t\t\"fas-f100\" => \"fas fa-angle-double-left\",\n\t\t\t\"fas-f101\" => \"fas fa-angle-double-right\",\n\t\t\t\"fas-f102\" => \"fas fa-angle-double-up\",\n\t\t\t\"fas-f107\" => \"fas fa-angle-down\",\n\t\t\t\"fas-f104\" => \"fas fa-angle-left\",\n\t\t\t\"fas-f105\" => \"fas fa-angle-right\",\n\t\t\t\"fas-f106\" => \"fas fa-angle-up\",\n\t\t\t\"fas-f556\" => \"fas fa-angry\",\n\t\t\t\"fas-f644\" => \"fas fa-ankh\",\n\t\t\t\"fas-f5d1\" => \"fas fa-apple-alt\",\n\t\t\t\"fas-f187\" => \"fas fa-archive\",\n\t\t\t\"fas-f557\" => \"fas fa-archway\",\n\t\t\t\"fas-f358\" => \"fas fa-arrow-alt-circle-down\",\n\t\t\t\"fas-f359\" => \"fas fa-arrow-alt-circle-left\",\n\t\t\t\"fas-f35a\" => \"fas fa-arrow-alt-circle-right\",\n\t\t\t\"fas-f35b\" => \"fas fa-arrow-alt-circle-up\",\n\t\t\t\"fas-f0ab\" => \"fas fa-arrow-circle-down\",\n\t\t\t\"fas-f0a8\" => \"fas fa-arrow-circle-left\",\n\t\t\t\"fas-f0a9\" => \"fas fa-arrow-circle-right\",\n\t\t\t\"fas-f0aa\" => \"fas fa-arrow-circle-up\",\n\t\t\t\"fas-f063\" => \"fas fa-arrow-down\",\n\t\t\t\"fas-f060\" => \"fas fa-arrow-left\",\n\t\t\t\"fas-f061\" => \"fas fa-arrow-right\",\n\t\t\t\"fas-f062\" => \"fas fa-arrow-up\",\n\t\t\t\"fas-f0b2\" => \"fas fa-arrows-alt\",\n\t\t\t\"fas-f337\" => \"fas fa-arrows-alt-h\",\n\t\t\t\"fas-f338\" => \"fas fa-arrows-alt-v\",\n\t\t\t\"fas-f2a2\" => \"fas fa-assistive-listening-systems\",\n\t\t\t\"fas-f069\" => \"fas fa-asterisk\",\n\t\t\t\"fas-f1fa\" => \"fas fa-at\",\n\t\t\t\"fas-f558\" => \"fas fa-atlas\",\n\t\t\t\"fas-f5d2\" => \"fas fa-atom\",\n\t\t\t\"fas-f29e\" => \"fas fa-audio-description\",\n\t\t\t\"fas-f559\" => \"fas fa-award\",\n\t\t\t\"fas-f77c\" => \"fas fa-baby\",\n\t\t\t\"fas-f77d\" => \"fas fa-baby-carriage\",\n\t\t\t\"fas-f55a\" => \"fas fa-backspace\",\n\t\t\t\"fas-f04a\" => \"fas fa-backward\",\n\t\t\t\"fas-f7e5\" => \"fas fa-bacon\",\n\t\t\t\"fas-f666\" => \"fas fa-bahai\",\n\t\t\t\"fas-f24e\" => \"fas fa-balance-scale\",\n\t\t\t\"fas-f515\" => \"fas fa-balance-scale-left\",\n\t\t\t\"fas-f516\" => \"fas fa-balance-scale-right\",\n\t\t\t\"fas-f05e\" => \"fas fa-ban\",\n\t\t\t\"fas-f462\" => \"fas fa-band-aid\",\n\t\t\t\"fas-f02a\" => \"fas fa-barcode\",\n\t\t\t\"fas-f0c9\" => \"fas fa-bars\",\n\t\t\t\"fas-f433\" => \"fas fa-baseball-ball\",\n\t\t\t\"fas-f434\" => \"fas fa-basketball-ball\",\n\t\t\t\"fas-f2cd\" => \"fas fa-bath\",\n\t\t\t\"fas-f244\" => \"fas fa-battery-empty\",\n\t\t\t\"fas-f240\" => \"fas fa-battery-full\",\n\t\t\t\"fas-f242\" => \"fas fa-battery-half\",\n\t\t\t\"fas-f243\" => \"fas fa-battery-quarter\",\n\t\t\t\"fas-f241\" => \"fas fa-battery-three-quarters\",\n\t\t\t\"fas-f236\" => \"fas fa-bed\",\n\t\t\t\"fas-f0fc\" => \"fas fa-beer\",\n\t\t\t\"fas-f0f3\" => \"fas fa-bell\",\n\t\t\t\"fas-f1f6\" => \"fas fa-bell-slash\",\n\t\t\t\"fas-f55b\" => \"fas fa-bezier-curve\",\n\t\t\t\"fas-f647\" => \"fas fa-bible\",\n\t\t\t\"fas-f206\" => \"fas fa-bicycle\",\n\t\t\t\"fas-f84a\" => \"fas fa-biking\",\n\t\t\t\"fas-f1e5\" => \"fas fa-binoculars\",\n\t\t\t\"fas-f780\" => \"fas fa-biohazard\",\n\t\t\t\"fas-f1fd\" => \"fas fa-birthday-cake\",\n\t\t\t\"fas-f517\" => \"fas fa-blender\",\n\t\t\t\"fas-f6b6\" => \"fas fa-blender-phone\",\n\t\t\t\"fas-f29d\" => \"fas fa-blind\",\n\t\t\t\"fas-f781\" => \"fas fa-blog\",\n\t\t\t\"fas-f032\" => \"fas fa-bold\",\n\t\t\t\"fas-f0e7\" => \"fas fa-bolt\",\n\t\t\t\"fas-f1e2\" => \"fas fa-bomb\",\n\t\t\t\"fas-f5d7\" => \"fas fa-bone\",\n\t\t\t\"fas-f55c\" => \"fas fa-bong\",\n\t\t\t\"fas-f02d\" => \"fas fa-book\",\n\t\t\t\"fas-f6b7\" => \"fas fa-book-dead\",\n\t\t\t\"fas-f7e6\" => \"fas fa-book-medical\",\n\t\t\t\"fas-f518\" => \"fas fa-book-open\",\n\t\t\t\"fas-f5da\" => \"fas fa-book-reader\",\n\t\t\t\"fas-f02e\" => \"fas fa-bookmark\",\n\t\t\t\"fas-f84c\" => \"fas fa-border-all\",\n\t\t\t\"fas-f850\" => \"fas fa-border-none\",\n\t\t\t\"fas-f853\" => \"fas fa-border-style\",\n\t\t\t\"fas-f436\" => \"fas fa-bowling-ball\",\n\t\t\t\"fas-f466\" => \"fas fa-box\",\n\t\t\t\"fas-f49e\" => \"fas fa-box-open\",\n\t\t\t\"fas-f95b\" => \"fas fa-box-tissue\",\n\t\t\t\"fas-f468\" => \"fas fa-boxes\",\n\t\t\t\"fas-f2a1\" => \"fas fa-braille\",\n\t\t\t\"fas-f5dc\" => \"fas fa-brain\",\n\t\t\t\"fas-f7ec\" => \"fas fa-bread-slice\",\n\t\t\t\"fas-f0b1\" => \"fas fa-briefcase\",\n\t\t\t\"fas-f469\" => \"fas fa-briefcase-medical\",\n\t\t\t\"fas-f519\" => \"fas fa-broadcast-tower\",\n\t\t\t\"fas-f51a\" => \"fas fa-broom\",\n\t\t\t\"fas-f55d\" => \"fas fa-brush\",\n\t\t\t\"fas-f188\" => \"fas fa-bug\",\n\t\t\t\"fas-f1ad\" => \"fas fa-building\",\n\t\t\t\"fas-f0a1\" => \"fas fa-bullhorn\",\n\t\t\t\"fas-f140\" => \"fas fa-bullseye\",\n\t\t\t\"fas-f46a\" => \"fas fa-burn\",\n\t\t\t\"fas-f207\" => \"fas fa-bus\",\n\t\t\t\"fas-f55e\" => \"fas fa-bus-alt\",\n\t\t\t\"fas-f64a\" => \"fas fa-business-time\",\n\t\t\t\"fas-f1ec\" => \"fas fa-calculator\",\n\t\t\t\"fas-f133\" => \"fas fa-calendar\",\n\t\t\t\"fas-f073\" => \"fas fa-calendar-alt\",\n\t\t\t\"fas-f274\" => \"fas fa-calendar-check\",\n\t\t\t\"fas-f783\" => \"fas fa-calendar-day\",\n\t\t\t\"fas-f272\" => \"fas fa-calendar-minus\",\n\t\t\t\"fas-f271\" => \"fas fa-calendar-plus\",\n\t\t\t\"fas-f273\" => \"fas fa-calendar-times\",\n\t\t\t\"fas-f784\" => \"fas fa-calendar-week\",\n\t\t\t\"fas-f030\" => \"fas fa-camera\",\n\t\t\t\"fas-f083\" => \"fas fa-camera-retro\",\n\t\t\t\"fas-f6bb\" => \"fas fa-campground\",\n\t\t\t\"fas-f786\" => \"fas fa-candy-cane\",\n\t\t\t\"fas-f55f\" => \"fas fa-cannabis\",\n\t\t\t\"fas-f46b\" => \"fas fa-capsules\",\n\t\t\t\"fas-f1b9\" => \"fas fa-car\",\n\t\t\t\"fas-f5de\" => \"fas fa-car-alt\",\n\t\t\t\"fas-f5df\" => \"fas fa-car-battery\",\n\t\t\t\"fas-f5e1\" => \"fas fa-car-crash\",\n\t\t\t\"fas-f5e4\" => \"fas fa-car-side\",\n\t\t\t\"fas-f8ff\" => \"fas fa-caravan\",\n\t\t\t\"fas-f0d7\" => \"fas fa-caret-down\",\n\t\t\t\"fas-f0d9\" => \"fas fa-caret-left\",\n\t\t\t\"fas-f0da\" => \"fas fa-caret-right\",\n\t\t\t\"fas-f150\" => \"fas fa-caret-square-down\",\n\t\t\t\"fas-f191\" => \"fas fa-caret-square-left\",\n\t\t\t\"fas-f152\" => \"fas fa-caret-square-right\",\n\t\t\t\"fas-f151\" => \"fas fa-caret-square-up\",\n\t\t\t\"fas-f0d8\" => \"fas fa-caret-up\",\n\t\t\t\"fas-f787\" => \"fas fa-carrot\",\n\t\t\t\"fas-f218\" => \"fas fa-cart-arrow-down\",\n\t\t\t\"fas-f217\" => \"fas fa-cart-plus\",\n\t\t\t\"fas-f788\" => \"fas fa-cash-register\",\n\t\t\t\"fas-f6be\" => \"fas fa-cat\",\n\t\t\t\"fas-f0a3\" => \"fas fa-certificate\",\n\t\t\t\"fas-f6c0\" => \"fas fa-chair\",\n\t\t\t\"fas-f51b\" => \"fas fa-chalkboard\",\n\t\t\t\"fas-f51c\" => \"fas fa-chalkboard-teacher\",\n\t\t\t\"fas-f5e7\" => \"fas fa-charging-station\",\n\t\t\t\"fas-f1fe\" => \"fas fa-chart-area\",\n\t\t\t\"fas-f080\" => \"fas fa-chart-bar\",\n\t\t\t\"fas-f201\" => \"fas fa-chart-line\",\n\t\t\t\"fas-f200\" => \"fas fa-chart-pie\",\n\t\t\t\"fas-f00c\" => \"fas fa-check\",\n\t\t\t\"fas-f058\" => \"fas fa-check-circle\",\n\t\t\t\"fas-f560\" => \"fas fa-check-double\",\n\t\t\t\"fas-f14a\" => \"fas fa-check-square\",\n\t\t\t\"fas-f7ef\" => \"fas fa-cheese\",\n\t\t\t\"fas-f439\" => \"fas fa-chess\",\n\t\t\t\"fas-f43a\" => \"fas fa-chess-bishop\",\n\t\t\t\"fas-f43c\" => \"fas fa-chess-board\",\n\t\t\t\"fas-f43f\" => \"fas fa-chess-king\",\n\t\t\t\"fas-f441\" => \"fas fa-chess-knight\",\n\t\t\t\"fas-f443\" => \"fas fa-chess-pawn\",\n\t\t\t\"fas-f445\" => \"fas fa-chess-queen\",\n\t\t\t\"fas-f447\" => \"fas fa-chess-rook\",\n\t\t\t\"fas-f13a\" => \"fas fa-chevron-circle-down\",\n\t\t\t\"fas-f137\" => \"fas fa-chevron-circle-left\",\n\t\t\t\"fas-f138\" => \"fas fa-chevron-circle-right\",\n\t\t\t\"fas-f139\" => \"fas fa-chevron-circle-up\",\n\t\t\t\"fas-f078\" => \"fas fa-chevron-down\",\n\t\t\t\"fas-f053\" => \"fas fa-chevron-left\",\n\t\t\t\"fas-f054\" => \"fas fa-chevron-right\",\n\t\t\t\"fas-f077\" => \"fas fa-chevron-up\",\n\t\t\t\"fas-f1ae\" => \"fas fa-child\",\n\t\t\t\"fas-f51d\" => \"fas fa-church\",\n\t\t\t\"fas-f111\" => \"fas fa-circle\",\n\t\t\t\"fas-f1ce\" => \"fas fa-circle-notch\",\n\t\t\t\"fas-f64f\" => \"fas fa-city\",\n\t\t\t\"fas-f7f2\" => \"fas fa-clinic-medical\",\n\t\t\t\"fas-f328\" => \"fas fa-clipboard\",\n\t\t\t\"fas-f46c\" => \"fas fa-clipboard-check\",\n\t\t\t\"fas-f46d\" => \"fas fa-clipboard-list\",\n\t\t\t\"fas-f017\" => \"fas fa-clock\",\n\t\t\t\"fas-f24d\" => \"fas fa-clone\",\n\t\t\t\"fas-f20a\" => \"fas fa-closed-captioning\",\n\t\t\t\"fas-f0c2\" => \"fas fa-cloud\",\n\t\t\t\"fas-f381\" => \"fas fa-cloud-download-alt\",\n\t\t\t\"fas-f73b\" => \"fas fa-cloud-meatball\",\n\t\t\t\"fas-f6c3\" => \"fas fa-cloud-moon\",\n\t\t\t\"fas-f73c\" => \"fas fa-cloud-moon-rain\",\n\t\t\t\"fas-f73d\" => \"fas fa-cloud-rain\",\n\t\t\t\"fas-f740\" => \"fas fa-cloud-showers-heavy\",\n\t\t\t\"fas-f6c4\" => \"fas fa-cloud-sun\",\n\t\t\t\"fas-f743\" => \"fas fa-cloud-sun-rain\",\n\t\t\t\"fas-f382\" => \"fas fa-cloud-upload-alt\",\n\t\t\t\"fas-f561\" => \"fas fa-cocktail\",\n\t\t\t\"fas-f121\" => \"fas fa-code\",\n\t\t\t\"fas-f126\" => \"fas fa-code-branch\",\n\t\t\t\"fas-f0f4\" => \"fas fa-coffee\",\n\t\t\t\"fas-f013\" => \"fas fa-cog\",\n\t\t\t\"fas-f085\" => \"fas fa-cogs\",\n\t\t\t\"fas-f51e\" => \"fas fa-coins\",\n\t\t\t\"fas-f0db\" => \"fas fa-columns\",\n\t\t\t\"fas-f075\" => \"fas fa-comment\",\n\t\t\t\"fas-f27a\" => \"fas fa-comment-alt\",\n\t\t\t\"fas-f651\" => \"fas fa-comment-dollar\",\n\t\t\t\"fas-f4ad\" => \"fas fa-comment-dots\",\n\t\t\t\"fas-f7f5\" => \"fas fa-comment-medical\",\n\t\t\t\"fas-f4b3\" => \"fas fa-comment-slash\",\n\t\t\t\"fas-f086\" => \"fas fa-comments\",\n\t\t\t\"fas-f653\" => \"fas fa-comments-dollar\",\n\t\t\t\"fas-f51f\" => \"fas fa-compact-disc\",\n\t\t\t\"fas-f14e\" => \"fas fa-compass\",\n\t\t\t\"fas-f066\" => \"fas fa-compress\",\n\t\t\t\"fas-f422\" => \"fas fa-compress-alt\",\n\t\t\t\"fas-f78c\" => \"fas fa-compress-arrows-alt\",\n\t\t\t\"fas-f562\" => \"fas fa-concierge-bell\",\n\t\t\t\"fas-f563\" => \"fas fa-cookie\",\n\t\t\t\"fas-f564\" => \"fas fa-cookie-bite\",\n\t\t\t\"fas-f0c5\" => \"fas fa-copy\",\n\t\t\t\"fas-f1f9\" => \"fas fa-copyright\",\n\t\t\t\"fas-f4b8\" => \"fas fa-couch\",\n\t\t\t\"fas-f09d\" => \"fas fa-credit-card\",\n\t\t\t\"fas-f125\" => \"fas fa-crop\",\n\t\t\t\"fas-f565\" => \"fas fa-crop-alt\",\n\t\t\t\"fas-f654\" => \"fas fa-cross\",\n\t\t\t\"fas-f05b\" => \"fas fa-crosshairs\",\n\t\t\t\"fas-f520\" => \"fas fa-crow\",\n\t\t\t\"fas-f521\" => \"fas fa-crown\",\n\t\t\t\"fas-f7f7\" => \"fas fa-crutch\",\n\t\t\t\"fas-f1b2\" => \"fas fa-cube\",\n\t\t\t\"fas-f1b3\" => \"fas fa-cubes\",\n\t\t\t\"fas-f0c4\" => \"fas fa-cut\",\n\t\t\t\"fas-f1c0\" => \"fas fa-database\",\n\t\t\t\"fas-f2a4\" => \"fas fa-deaf\",\n\t\t\t\"fas-f747\" => \"fas fa-democrat\",\n\t\t\t\"fas-f108\" => \"fas fa-desktop\",\n\t\t\t\"fas-f655\" => \"fas fa-dharmachakra\",\n\t\t\t\"fas-f470\" => \"fas fa-diagnoses\",\n\t\t\t\"fas-f522\" => \"fas fa-dice\",\n\t\t\t\"fas-f6cf\" => \"fas fa-dice-d20\",\n\t\t\t\"fas-f6d1\" => \"fas fa-dice-d6\",\n\t\t\t\"fas-f523\" => \"fas fa-dice-five\",\n\t\t\t\"fas-f524\" => \"fas fa-dice-four\",\n\t\t\t\"fas-f525\" => \"fas fa-dice-one\",\n\t\t\t\"fas-f526\" => \"fas fa-dice-six\",\n\t\t\t\"fas-f527\" => \"fas fa-dice-three\",\n\t\t\t\"fas-f528\" => \"fas fa-dice-two\",\n\t\t\t\"fas-f566\" => \"fas fa-digital-tachograph\",\n\t\t\t\"fas-f5eb\" => \"fas fa-directions\",\n\t\t\t\"fas-f7fa\" => \"fas fa-disease\",\n\t\t\t\"fas-f529\" => \"fas fa-divide\",\n\t\t\t\"fas-f567\" => \"fas fa-dizzy\",\n\t\t\t\"fas-f471\" => \"fas fa-dna\",\n\t\t\t\"fas-f6d3\" => \"fas fa-dog\",\n\t\t\t\"fas-f155\" => \"fas fa-dollar-sign\",\n\t\t\t\"fas-f472\" => \"fas fa-dolly\",\n\t\t\t\"fas-f474\" => \"fas fa-dolly-flatbed\",\n\t\t\t\"fas-f4b9\" => \"fas fa-donate\",\n\t\t\t\"fas-f52a\" => \"fas fa-door-closed\",\n\t\t\t\"fas-f52b\" => \"fas fa-door-open\",\n\t\t\t\"fas-f192\" => \"fas fa-dot-circle\",\n\t\t\t\"fas-f4ba\" => \"fas fa-dove\",\n\t\t\t\"fas-f019\" => \"fas fa-download\",\n\t\t\t\"fas-f568\" => \"fas fa-drafting-compass\",\n\t\t\t\"fas-f6d5\" => \"fas fa-dragon\",\n\t\t\t\"fas-f5ee\" => \"fas fa-draw-polygon\",\n\t\t\t\"fas-f569\" => \"fas fa-drum\",\n\t\t\t\"fas-f56a\" => \"fas fa-drum-steelpan\",\n\t\t\t\"fas-f6d7\" => \"fas fa-drumstick-bite\",\n\t\t\t\"fas-f44b\" => \"fas fa-dumbbell\",\n\t\t\t\"fas-f793\" => \"fas fa-dumpster\",\n\t\t\t\"fas-f794\" => \"fas fa-dumpster-fire\",\n\t\t\t\"fas-f6d9\" => \"fas fa-dungeon\",\n\t\t\t\"fas-f044\" => \"fas fa-edit\",\n\t\t\t\"fas-f7fb\" => \"fas fa-egg\",\n\t\t\t\"fas-f052\" => \"fas fa-eject\",\n\t\t\t\"fas-f141\" => \"fas fa-ellipsis-h\",\n\t\t\t\"fas-f142\" => \"fas fa-ellipsis-v\",\n\t\t\t\"fas-f0e0\" => \"fas fa-envelope\",\n\t\t\t\"fas-f2b6\" => \"fas fa-envelope-open\",\n\t\t\t\"fas-f658\" => \"fas fa-envelope-open-text\",\n\t\t\t\"fas-f199\" => \"fas fa-envelope-square\",\n\t\t\t\"fas-f52c\" => \"fas fa-equals\",\n\t\t\t\"fas-f12d\" => \"fas fa-eraser\",\n\t\t\t\"fas-f796\" => \"fas fa-ethernet\",\n\t\t\t\"fas-f153\" => \"fas fa-euro-sign\",\n\t\t\t\"fas-f362\" => \"fas fa-exchange-alt\",\n\t\t\t\"fas-f12a\" => \"fas fa-exclamation\",\n\t\t\t\"fas-f06a\" => \"fas fa-exclamation-circle\",\n\t\t\t\"fas-f071\" => \"fas fa-exclamation-triangle\",\n\t\t\t\"fas-f065\" => \"fas fa-expand\",\n\t\t\t\"fas-f424\" => \"fas fa-expand-alt\",\n\t\t\t\"fas-f31e\" => \"fas fa-expand-arrows-alt\",\n\t\t\t\"fas-f35d\" => \"fas fa-external-link-alt\",\n\t\t\t\"fas-f360\" => \"fas fa-external-link-square-alt\",\n\t\t\t\"fas-f06e\" => \"fas fa-eye\",\n\t\t\t\"fas-f1fb\" => \"fas fa-eye-dropper\",\n\t\t\t\"fas-f070\" => \"fas fa-eye-slash\",\n\t\t\t\"fas-f863\" => \"fas fa-fan\",\n\t\t\t\"fas-f049\" => \"fas fa-fast-backward\",\n\t\t\t\"fas-f050\" => \"fas fa-fast-forward\",\n\t\t\t\"fas-f905\" => \"fas fa-faucet\",\n\t\t\t\"fas-f1ac\" => \"fas fa-fax\",\n\t\t\t\"fas-f52d\" => \"fas fa-feather\",\n\t\t\t\"fas-f56b\" => \"fas fa-feather-alt\",\n\t\t\t\"fas-f182\" => \"fas fa-female\",\n\t\t\t\"fas-f0fb\" => \"fas fa-fighter-jet\",\n\t\t\t\"fas-f15b\" => \"fas fa-file\",\n\t\t\t\"fas-f15c\" => \"fas fa-file-alt\",\n\t\t\t\"fas-f1c6\" => \"fas fa-file-archive\",\n\t\t\t\"fas-f1c7\" => \"fas fa-file-audio\",\n\t\t\t\"fas-f1c9\" => \"fas fa-file-code\",\n\t\t\t\"fas-f56c\" => \"fas fa-file-contract\",\n\t\t\t\"fas-f6dd\" => \"fas fa-file-csv\",\n\t\t\t\"fas-f56d\" => \"fas fa-file-download\",\n\t\t\t\"fas-f1c3\" => \"fas fa-file-excel\",\n\t\t\t\"fas-f56e\" => \"fas fa-file-export\",\n\t\t\t\"fas-f1c5\" => \"fas fa-file-image\",\n\t\t\t\"fas-f56f\" => \"fas fa-file-import\",\n\t\t\t\"fas-f570\" => \"fas fa-file-invoice\",\n\t\t\t\"fas-f571\" => \"fas fa-file-invoice-dollar\",\n\t\t\t\"fas-f477\" => \"fas fa-file-medical\",\n\t\t\t\"fas-f478\" => \"fas fa-file-medical-alt\",\n\t\t\t\"fas-f1c1\" => \"fas fa-file-pdf\",\n\t\t\t\"fas-f1c4\" => \"fas fa-file-powerpoint\",\n\t\t\t\"fas-f572\" => \"fas fa-file-prescription\",\n\t\t\t\"fas-f573\" => \"fas fa-file-signature\",\n\t\t\t\"fas-f574\" => \"fas fa-file-upload\",\n\t\t\t\"fas-f1c8\" => \"fas fa-file-video\",\n\t\t\t\"fas-f1c2\" => \"fas fa-file-word\",\n\t\t\t\"fas-f575\" => \"fas fa-fill\",\n\t\t\t\"fas-f576\" => \"fas fa-fill-drip\",\n\t\t\t\"fas-f008\" => \"fas fa-film\",\n\t\t\t\"fas-f0b0\" => \"fas fa-filter\",\n\t\t\t\"fas-f577\" => \"fas fa-fingerprint\",\n\t\t\t\"fas-f06d\" => \"fas fa-fire\",\n\t\t\t\"fas-f7e4\" => \"fas fa-fire-alt\",\n\t\t\t\"fas-f134\" => \"fas fa-fire-extinguisher\",\n\t\t\t\"fas-f479\" => \"fas fa-first-aid\",\n\t\t\t\"fas-f578\" => \"fas fa-fish\",\n\t\t\t\"fas-f6de\" => \"fas fa-fist-raised\",\n\t\t\t\"fas-f024\" => \"fas fa-flag\",\n\t\t\t\"fas-f11e\" => \"fas fa-flag-checkered\",\n\t\t\t\"fas-f74d\" => \"fas fa-flag-usa\",\n\t\t\t\"fas-f0c3\" => \"fas fa-flask\",\n\t\t\t\"fas-f579\" => \"fas fa-flushed\",\n\t\t\t\"fas-f07b\" => \"fas fa-folder\",\n\t\t\t\"fas-f65d\" => \"fas fa-folder-minus\",\n\t\t\t\"fas-f07c\" => \"fas fa-folder-open\",\n\t\t\t\"fas-f65e\" => \"fas fa-folder-plus\",\n\t\t\t\"fas-f031\" => \"fas fa-font\",\n\t\t\t\"fas-f44e\" => \"fas fa-football-ball\",\n\t\t\t\"fas-f04e\" => \"fas fa-forward\",\n\t\t\t\"fas-f52e\" => \"fas fa-frog\",\n\t\t\t\"fas-f119\" => \"fas fa-frown\",\n\t\t\t\"fas-f57a\" => \"fas fa-frown-open\",\n\t\t\t\"fas-f662\" => \"fas fa-funnel-dollar\",\n\t\t\t\"fas-f1e3\" => \"fas fa-futbol\",\n\t\t\t\"fas-f11b\" => \"fas fa-gamepad\",\n\t\t\t\"fas-f52f\" => \"fas fa-gas-pump\",\n\t\t\t\"fas-f0e3\" => \"fas fa-gavel\",\n\t\t\t\"fas-f3a5\" => \"fas fa-gem\",\n\t\t\t\"fas-f22d\" => \"fas fa-genderless\",\n\t\t\t\"fas-f6e2\" => \"fas fa-ghost\",\n\t\t\t\"fas-f06b\" => \"fas fa-gift\",\n\t\t\t\"fas-f79c\" => \"fas fa-gifts\",\n\t\t\t\"fas-f79f\" => \"fas fa-glass-cheers\",\n\t\t\t\"fas-f000\" => \"fas fa-glass-martini\",\n\t\t\t\"fas-f57b\" => \"fas fa-glass-martini-alt\",\n\t\t\t\"fas-f7a0\" => \"fas fa-glass-whiskey\",\n\t\t\t\"fas-f530\" => \"fas fa-glasses\",\n\t\t\t\"fas-f0ac\" => \"fas fa-globe\",\n\t\t\t\"fas-f57c\" => \"fas fa-globe-africa\",\n\t\t\t\"fas-f57d\" => \"fas fa-globe-americas\",\n\t\t\t\"fas-f57e\" => \"fas fa-globe-asia\",\n\t\t\t\"fas-f7a2\" => \"fas fa-globe-europe\",\n\t\t\t\"fas-f450\" => \"fas fa-golf-ball\",\n\t\t\t\"fas-f664\" => \"fas fa-gopuram\",\n\t\t\t\"fas-f19d\" => \"fas fa-graduation-cap\",\n\t\t\t\"fas-f531\" => \"fas fa-greater-than\",\n\t\t\t\"fas-f532\" => \"fas fa-greater-than-equal\",\n\t\t\t\"fas-f57f\" => \"fas fa-grimace\",\n\t\t\t\"fas-f580\" => \"fas fa-grin\",\n\t\t\t\"fas-f581\" => \"fas fa-grin-alt\",\n\t\t\t\"fas-f582\" => \"fas fa-grin-beam\",\n\t\t\t\"fas-f583\" => \"fas fa-grin-beam-sweat\",\n\t\t\t\"fas-f584\" => \"fas fa-grin-hearts\",\n\t\t\t\"fas-f585\" => \"fas fa-grin-squint\",\n\t\t\t\"fas-f586\" => \"fas fa-grin-squint-tears\",\n\t\t\t\"fas-f587\" => \"fas fa-grin-stars\",\n\t\t\t\"fas-f588\" => \"fas fa-grin-tears\",\n\t\t\t\"fas-f589\" => \"fas fa-grin-tongue\",\n\t\t\t\"fas-f58a\" => \"fas fa-grin-tongue-squint\",\n\t\t\t\"fas-f58b\" => \"fas fa-grin-tongue-wink\",\n\t\t\t\"fas-f58c\" => \"fas fa-grin-wink\",\n\t\t\t\"fas-f58d\" => \"fas fa-grip-horizontal\",\n\t\t\t\"fas-f7a4\" => \"fas fa-grip-lines\",\n\t\t\t\"fas-f7a5\" => \"fas fa-grip-lines-vertical\",\n\t\t\t\"fas-f58e\" => \"fas fa-grip-vertical\",\n\t\t\t\"fas-f7a6\" => \"fas fa-guitar\",\n\t\t\t\"fas-f0fd\" => \"fas fa-h-square\",\n\t\t\t\"fas-f805\" => \"fas fa-hamburger\",\n\t\t\t\"fas-f6e3\" => \"fas fa-hammer\",\n\t\t\t\"fas-f665\" => \"fas fa-hamsa\",\n\t\t\t\"fas-f4bd\" => \"fas fa-hand-holding\",\n\t\t\t\"fas-f4be\" => \"fas fa-hand-holding-heart\",\n\t\t\t\"fas-f95c\" => \"fas fa-hand-holding-medical\",\n\t\t\t\"fas-f4c0\" => \"fas fa-hand-holding-usd\",\n\t\t\t\"fas-f4c1\" => \"fas fa-hand-holding-water\",\n\t\t\t\"fas-f258\" => \"fas fa-hand-lizard\",\n\t\t\t\"fas-f806\" => \"fas fa-hand-middle-finger\",\n\t\t\t\"fas-f256\" => \"fas fa-hand-paper\",\n\t\t\t\"fas-f25b\" => \"fas fa-hand-peace\",\n\t\t\t\"fas-f0a7\" => \"fas fa-hand-point-down\",\n\t\t\t\"fas-f0a5\" => \"fas fa-hand-point-left\",\n\t\t\t\"fas-f0a4\" => \"fas fa-hand-point-right\",\n\t\t\t\"fas-f0a6\" => \"fas fa-hand-point-up\",\n\t\t\t\"fas-f25a\" => \"fas fa-hand-pointer\",\n\t\t\t\"fas-f255\" => \"fas fa-hand-rock\",\n\t\t\t\"fas-f257\" => \"fas fa-hand-scissors\",\n\t\t\t\"fas-f95d\" => \"fas fa-hand-sparkles\",\n\t\t\t\"fas-f259\" => \"fas fa-hand-spock\",\n\t\t\t\"fas-f4c2\" => \"fas fa-hands\",\n\t\t\t\"fas-f4c4\" => \"fas fa-hands-helping\",\n\t\t\t\"fas-f95e\" => \"fas fa-hands-wash\",\n\t\t\t\"fas-f2b5\" => \"fas fa-handshake\",\n\t\t\t\"fas-f95f\" => \"fas fa-handshake-alt-slash\",\n\t\t\t\"fas-f960\" => \"fas fa-handshake-slash\",\n\t\t\t\"fas-f6e6\" => \"fas fa-hanukiah\",\n\t\t\t\"fas-f807\" => \"fas fa-hard-hat\",\n\t\t\t\"fas-f292\" => \"fas fa-hashtag\",\n\t\t\t\"fas-f8c0\" => \"fas fa-hat-cowboy\",\n\t\t\t\"fas-f8c1\" => \"fas fa-hat-cowboy-side\",\n\t\t\t\"fas-f6e8\" => \"fas fa-hat-wizard\",\n\t\t\t\"fas-f0a0\" => \"fas fa-hdd\",\n\t\t\t\"fas-f961\" => \"fas fa-head-side-cough\",\n\t\t\t\"fas-f962\" => \"fas fa-head-side-cough-slash\",\n\t\t\t\"fas-f963\" => \"fas fa-head-side-mask\",\n\t\t\t\"fas-f964\" => \"fas fa-head-side-virus\",\n\t\t\t\"fas-f1dc\" => \"fas fa-heading\",\n\t\t\t\"fas-f025\" => \"fas fa-headphones\",\n\t\t\t\"fas-f58f\" => \"fas fa-headphones-alt\",\n\t\t\t\"fas-f590\" => \"fas fa-headset\",\n\t\t\t\"fas-f004\" => \"fas fa-heart\",\n\t\t\t\"fas-f7a9\" => \"fas fa-heart-broken\",\n\t\t\t\"fas-f21e\" => \"fas fa-heartbeat\",\n\t\t\t\"fas-f533\" => \"fas fa-helicopter\",\n\t\t\t\"fas-f591\" => \"fas fa-highlighter\",\n\t\t\t\"fas-f6ec\" => \"fas fa-hiking\",\n\t\t\t\"fas-f6ed\" => \"fas fa-hippo\",\n\t\t\t\"fas-f1da\" => \"fas fa-history\",\n\t\t\t\"fas-f453\" => \"fas fa-hockey-puck\",\n\t\t\t\"fas-f7aa\" => \"fas fa-holly-berry\",\n\t\t\t\"fas-f015\" => \"fas fa-home\",\n\t\t\t\"fas-f6f0\" => \"fas fa-horse\",\n\t\t\t\"fas-f7ab\" => \"fas fa-horse-head\",\n\t\t\t\"fas-f0f8\" => \"fas fa-hospital\",\n\t\t\t\"fas-f47d\" => \"fas fa-hospital-alt\",\n\t\t\t\"fas-f47e\" => \"fas fa-hospital-symbol\",\n\t\t\t\"fas-f80d\" => \"fas fa-hospital-user\",\n\t\t\t\"fas-f593\" => \"fas fa-hot-tub\",\n\t\t\t\"fas-f80f\" => \"fas fa-hotdog\",\n\t\t\t\"fas-f594\" => \"fas fa-hotel\",\n\t\t\t\"fas-f254\" => \"fas fa-hourglass\",\n\t\t\t\"fas-f253\" => \"fas fa-hourglass-end\",\n\t\t\t\"fas-f252\" => \"fas fa-hourglass-half\",\n\t\t\t\"fas-f251\" => \"fas fa-hourglass-start\",\n\t\t\t\"fas-f6f1\" => \"fas fa-house-damage\",\n\t\t\t\"fas-f965\" => \"fas fa-house-user\",\n\t\t\t\"fas-f6f2\" => \"fas fa-hryvnia\",\n\t\t\t\"fas-f246\" => \"fas fa-i-cursor\",\n\t\t\t\"fas-f810\" => \"fas fa-ice-cream\",\n\t\t\t\"fas-f7ad\" => \"fas fa-icicles\",\n\t\t\t\"fas-f86d\" => \"fas fa-icons\",\n\t\t\t\"fas-f2c1\" => \"fas fa-id-badge\",\n\t\t\t\"fas-f2c2\" => \"fas fa-id-card\",\n\t\t\t\"fas-f47f\" => \"fas fa-id-card-alt\",\n\t\t\t\"fas-f7ae\" => \"fas fa-igloo\",\n\t\t\t\"fas-f03e\" => \"fas fa-image\",\n\t\t\t\"fas-f302\" => \"fas fa-images\",\n\t\t\t\"fas-f01c\" => \"fas fa-inbox\",\n\t\t\t\"fas-f03c\" => \"fas fa-indent\",\n\t\t\t\"fas-f275\" => \"fas fa-industry\",\n\t\t\t\"fas-f534\" => \"fas fa-infinity\",\n\t\t\t\"fas-f129\" => \"fas fa-info\",\n\t\t\t\"fas-f05a\" => \"fas fa-info-circle\",\n\t\t\t\"fas-f033\" => \"fas fa-italic\",\n\t\t\t\"fas-f669\" => \"fas fa-jedi\",\n\t\t\t\"fas-f595\" => \"fas fa-joint\",\n\t\t\t\"fas-f66a\" => \"fas fa-journal-whills\",\n\t\t\t\"fas-f66b\" => \"fas fa-kaaba\",\n\t\t\t\"fas-f084\" => \"fas fa-key\",\n\t\t\t\"fas-f11c\" => \"fas fa-keyboard\",\n\t\t\t\"fas-f66d\" => \"fas fa-khanda\",\n\t\t\t\"fas-f596\" => \"fas fa-kiss\",\n\t\t\t\"fas-f597\" => \"fas fa-kiss-beam\",\n\t\t\t\"fas-f598\" => \"fas fa-kiss-wink-heart\",\n\t\t\t\"fas-f535\" => \"fas fa-kiwi-bird\",\n\t\t\t\"fas-f66f\" => \"fas fa-landmark\",\n\t\t\t\"fas-f1ab\" => \"fas fa-language\",\n\t\t\t\"fas-f109\" => \"fas fa-laptop\",\n\t\t\t\"fas-f5fc\" => \"fas fa-laptop-code\",\n\t\t\t\"fas-f966\" => \"fas fa-laptop-house\",\n\t\t\t\"fas-f812\" => \"fas fa-laptop-medical\",\n\t\t\t\"fas-f599\" => \"fas fa-laugh\",\n\t\t\t\"fas-f59a\" => \"fas fa-laugh-beam\",\n\t\t\t\"fas-f59b\" => \"fas fa-laugh-squint\",\n\t\t\t\"fas-f59c\" => \"fas fa-laugh-wink\",\n\t\t\t\"fas-f5fd\" => \"fas fa-layer-group\",\n\t\t\t\"fas-f06c\" => \"fas fa-leaf\",\n\t\t\t\"fas-f094\" => \"fas fa-lemon\",\n\t\t\t\"fas-f536\" => \"fas fa-less-than\",\n\t\t\t\"fas-f537\" => \"fas fa-less-than-equal\",\n\t\t\t\"fas-f3be\" => \"fas fa-level-down-alt\",\n\t\t\t\"fas-f3bf\" => \"fas fa-level-up-alt\",\n\t\t\t\"fas-f1cd\" => \"fas fa-life-ring\",\n\t\t\t\"fas-f0eb\" => \"fas fa-lightbulb\",\n\t\t\t\"fas-f0c1\" => \"fas fa-link\",\n\t\t\t\"fas-f195\" => \"fas fa-lira-sign\",\n\t\t\t\"fas-f03a\" => \"fas fa-list\",\n\t\t\t\"fas-f022\" => \"fas fa-list-alt\",\n\t\t\t\"fas-f0cb\" => \"fas fa-list-ol\",\n\t\t\t\"fas-f0ca\" => \"fas fa-list-ul\",\n\t\t\t\"fas-f124\" => \"fas fa-location-arrow\",\n\t\t\t\"fas-f023\" => \"fas fa-lock\",\n\t\t\t\"fas-f3c1\" => \"fas fa-lock-open\",\n\t\t\t\"fas-f309\" => \"fas fa-long-arrow-alt-down\",\n\t\t\t\"fas-f30a\" => \"fas fa-long-arrow-alt-left\",\n\t\t\t\"fas-f30b\" => \"fas fa-long-arrow-alt-right\",\n\t\t\t\"fas-f30c\" => \"fas fa-long-arrow-alt-up\",\n\t\t\t\"fas-f2a8\" => \"fas fa-low-vision\",\n\t\t\t\"fas-f59d\" => \"fas fa-luggage-cart\",\n\t\t\t\"fas-f604\" => \"fas fa-lungs\",\n\t\t\t\"fas-f967\" => \"fas fa-lungs-virus\",\n\t\t\t\"fas-f0d0\" => \"fas fa-magic\",\n\t\t\t\"fas-f076\" => \"fas fa-magnet\",\n\t\t\t\"fas-f674\" => \"fas fa-mail-bulk\",\n\t\t\t\"fas-f183\" => \"fas fa-male\",\n\t\t\t\"fas-f279\" => \"fas fa-map\",\n\t\t\t\"fas-f59f\" => \"fas fa-map-marked\",\n\t\t\t\"fas-f5a0\" => \"fas fa-map-marked-alt\",\n\t\t\t\"fas-f041\" => \"fas fa-map-marker\",\n\t\t\t\"fas-f3c5\" => \"fas fa-map-marker-alt\",\n\t\t\t\"fas-f276\" => \"fas fa-map-pin\",\n\t\t\t\"fas-f277\" => \"fas fa-map-signs\",\n\t\t\t\"fas-f5a1\" => \"fas fa-marker\",\n\t\t\t\"fas-f222\" => \"fas fa-mars\",\n\t\t\t\"fas-f227\" => \"fas fa-mars-double\",\n\t\t\t\"fas-f229\" => \"fas fa-mars-stroke\",\n\t\t\t\"fas-f22b\" => \"fas fa-mars-stroke-h\",\n\t\t\t\"fas-f22a\" => \"fas fa-mars-stroke-v\",\n\t\t\t\"fas-f6fa\" => \"fas fa-mask\",\n\t\t\t\"fas-f5a2\" => \"fas fa-medal\",\n\t\t\t\"fas-f0fa\" => \"fas fa-medkit\",\n\t\t\t\"fas-f11a\" => \"fas fa-meh\",\n\t\t\t\"fas-f5a4\" => \"fas fa-meh-blank\",\n\t\t\t\"fas-f5a5\" => \"fas fa-meh-rolling-eyes\",\n\t\t\t\"fas-f538\" => \"fas fa-memory\",\n\t\t\t\"fas-f676\" => \"fas fa-menorah\",\n\t\t\t\"fas-f223\" => \"fas fa-mercury\",\n\t\t\t\"fas-f753\" => \"fas fa-meteor\",\n\t\t\t\"fas-f2db\" => \"fas fa-microchip\",\n\t\t\t\"fas-f130\" => \"fas fa-microphone\",\n\t\t\t\"fas-f3c9\" => \"fas fa-microphone-alt\",\n\t\t\t\"fas-f539\" => \"fas fa-microphone-alt-slash\",\n\t\t\t\"fas-f131\" => \"fas fa-microphone-slash\",\n\t\t\t\"fas-f610\" => \"fas fa-microscope\",\n\t\t\t\"fas-f068\" => \"fas fa-minus\",\n\t\t\t\"fas-f056\" => \"fas fa-minus-circle\",\n\t\t\t\"fas-f146\" => \"fas fa-minus-square\",\n\t\t\t\"fas-f7b5\" => \"fas fa-mitten\",\n\t\t\t\"fas-f10b\" => \"fas fa-mobile\",\n\t\t\t\"fas-f3cd\" => \"fas fa-mobile-alt\",\n\t\t\t\"fas-f0d6\" => \"fas fa-money-bill\",\n\t\t\t\"fas-f3d1\" => \"fas fa-money-bill-alt\",\n\t\t\t\"fas-f53a\" => \"fas fa-money-bill-wave\",\n\t\t\t\"fas-f53b\" => \"fas fa-money-bill-wave-alt\",\n\t\t\t\"fas-f53c\" => \"fas fa-money-check\",\n\t\t\t\"fas-f53d\" => \"fas fa-money-check-alt\",\n\t\t\t\"fas-f5a6\" => \"fas fa-monument\",\n\t\t\t\"fas-f186\" => \"fas fa-moon\",\n\t\t\t\"fas-f5a7\" => \"fas fa-mortar-pestle\",\n\t\t\t\"fas-f678\" => \"fas fa-mosque\",\n\t\t\t\"fas-f21c\" => \"fas fa-motorcycle\",\n\t\t\t\"fas-f6fc\" => \"fas fa-mountain\",\n\t\t\t\"fas-f8cc\" => \"fas fa-mouse\",\n\t\t\t\"fas-f245\" => \"fas fa-mouse-pointer\",\n\t\t\t\"fas-f7b6\" => \"fas fa-mug-hot\",\n\t\t\t\"fas-f001\" => \"fas fa-music\",\n\t\t\t\"fas-f6ff\" => \"fas fa-network-wired\",\n\t\t\t\"fas-f22c\" => \"fas fa-neuter\",\n\t\t\t\"fas-f1ea\" => \"fas fa-newspaper\",\n\t\t\t\"fas-f53e\" => \"fas fa-not-equal\",\n\t\t\t\"fas-f481\" => \"fas fa-notes-medical\",\n\t\t\t\"fas-f247\" => \"fas fa-object-group\",\n\t\t\t\"fas-f248\" => \"fas fa-object-ungroup\",\n\t\t\t\"fas-f613\" => \"fas fa-oil-can\",\n\t\t\t\"fas-f679\" => \"fas fa-om\",\n\t\t\t\"fas-f700\" => \"fas fa-otter\",\n\t\t\t\"fas-f03b\" => \"fas fa-outdent\",\n\t\t\t\"fas-f815\" => \"fas fa-pager\",\n\t\t\t\"fas-f1fc\" => \"fas fa-paint-brush\",\n\t\t\t\"fas-f5aa\" => \"fas fa-paint-roller\",\n\t\t\t\"fas-f53f\" => \"fas fa-palette\",\n\t\t\t\"fas-f482\" => \"fas fa-pallet\",\n\t\t\t\"fas-f1d8\" => \"fas fa-paper-plane\",\n\t\t\t\"fas-f0c6\" => \"fas fa-paperclip\",\n\t\t\t\"fas-f4cd\" => \"fas fa-parachute-box\",\n\t\t\t\"fas-f1dd\" => \"fas fa-paragraph\",\n\t\t\t\"fas-f540\" => \"fas fa-parking\",\n\t\t\t\"fas-f5ab\" => \"fas fa-passport\",\n\t\t\t\"fas-f67b\" => \"fas fa-pastafarianism\",\n\t\t\t\"fas-f0ea\" => \"fas fa-paste\",\n\t\t\t\"fas-f04c\" => \"fas fa-pause\",\n\t\t\t\"fas-f28b\" => \"fas fa-pause-circle\",\n\t\t\t\"fas-f1b0\" => \"fas fa-paw\",\n\t\t\t\"fas-f67c\" => \"fas fa-peace\",\n\t\t\t\"fas-f304\" => \"fas fa-pen\",\n\t\t\t\"fas-f305\" => \"fas fa-pen-alt\",\n\t\t\t\"fas-f5ac\" => \"fas fa-pen-fancy\",\n\t\t\t\"fas-f5ad\" => \"fas fa-pen-nib\",\n\t\t\t\"fas-f14b\" => \"fas fa-pen-square\",\n\t\t\t\"fas-f303\" => \"fas fa-pencil-alt\",\n\t\t\t\"fas-f5ae\" => \"fas fa-pencil-ruler\",\n\t\t\t\"fas-f968\" => \"fas fa-people-arrows\",\n\t\t\t\"fas-f4ce\" => \"fas fa-people-carry\",\n\t\t\t\"fas-f816\" => \"fas fa-pepper-hot\",\n\t\t\t\"fas-f295\" => \"fas fa-percent\",\n\t\t\t\"fas-f541\" => \"fas fa-percentage\",\n\t\t\t\"fas-f756\" => \"fas fa-person-booth\",\n\t\t\t\"fas-f095\" => \"fas fa-phone\",\n\t\t\t\"fas-f879\" => \"fas fa-phone-alt\",\n\t\t\t\"fas-f3dd\" => \"fas fa-phone-slash\",\n\t\t\t\"fas-f098\" => \"fas fa-phone-square\",\n\t\t\t\"fas-f87b\" => \"fas fa-phone-square-alt\",\n\t\t\t\"fas-f2a0\" => \"fas fa-phone-volume\",\n\t\t\t\"fas-f87c\" => \"fas fa-photo-video\",\n\t\t\t\"fas-f4d3\" => \"fas fa-piggy-bank\",\n\t\t\t\"fas-f484\" => \"fas fa-pills\",\n\t\t\t\"fas-f818\" => \"fas fa-pizza-slice\",\n\t\t\t\"fas-f67f\" => \"fas fa-place-of-worship\",\n\t\t\t\"fas-f072\" => \"fas fa-plane\",\n\t\t\t\"fas-f5af\" => \"fas fa-plane-arrival\",\n\t\t\t\"fas-f5b0\" => \"fas fa-plane-departure\",\n\t\t\t\"fas-f969\" => \"fas fa-plane-slash\",\n\t\t\t\"fas-f04b\" => \"fas fa-play\",\n\t\t\t\"fas-f144\" => \"fas fa-play-circle\",\n\t\t\t\"fas-f1e6\" => \"fas fa-plug\",\n\t\t\t\"fas-f067\" => \"fas fa-plus\",\n\t\t\t\"fas-f055\" => \"fas fa-plus-circle\",\n\t\t\t\"fas-f0fe\" => \"fas fa-plus-square\",\n\t\t\t\"fas-f2ce\" => \"fas fa-podcast\",\n\t\t\t\"fas-f681\" => \"fas fa-poll\",\n\t\t\t\"fas-f682\" => \"fas fa-poll-h\",\n\t\t\t\"fas-f2fe\" => \"fas fa-poo\",\n\t\t\t\"fas-f75a\" => \"fas fa-poo-storm\",\n\t\t\t\"fas-f619\" => \"fas fa-poop\",\n\t\t\t\"fas-f3e0\" => \"fas fa-portrait\",\n\t\t\t\"fas-f154\" => \"fas fa-pound-sign\",\n\t\t\t\"fas-f011\" => \"fas fa-power-off\",\n\t\t\t\"fas-f683\" => \"fas fa-pray\",\n\t\t\t\"fas-f684\" => \"fas fa-praying-hands\",\n\t\t\t\"fas-f5b1\" => \"fas fa-prescription\",\n\t\t\t\"fas-f485\" => \"fas fa-prescription-bottle\",\n\t\t\t\"fas-f486\" => \"fas fa-prescription-bottle-alt\",\n\t\t\t\"fas-f02f\" => \"fas fa-print\",\n\t\t\t\"fas-f487\" => \"fas fa-procedures\",\n\t\t\t\"fas-f542\" => \"fas fa-project-diagram\",\n\t\t\t\"fas-f96a\" => \"fas fa-pump-medical\",\n\t\t\t\"fas-f96b\" => \"fas fa-pump-soap\",\n\t\t\t\"fas-f12e\" => \"fas fa-puzzle-piece\",\n\t\t\t\"fas-f029\" => \"fas fa-qrcode\",\n\t\t\t\"fas-f128\" => \"fas fa-question\",\n\t\t\t\"fas-f059\" => \"fas fa-question-circle\",\n\t\t\t\"fas-f458\" => \"fas fa-quidditch\",\n\t\t\t\"fas-f10d\" => \"fas fa-quote-left\",\n\t\t\t\"fas-f10e\" => \"fas fa-quote-right\",\n\t\t\t\"fas-f687\" => \"fas fa-quran\",\n\t\t\t\"fas-f7b9\" => \"fas fa-radiation\",\n\t\t\t\"fas-f7ba\" => \"fas fa-radiation-alt\",\n\t\t\t\"fas-f75b\" => \"fas fa-rainbow\",\n\t\t\t\"fas-f074\" => \"fas fa-random\",\n\t\t\t\"fas-f543\" => \"fas fa-receipt\",\n\t\t\t\"fas-f8d9\" => \"fas fa-record-vinyl\",\n\t\t\t\"fas-f1b8\" => \"fas fa-recycle\",\n\t\t\t\"fas-f01e\" => \"fas fa-redo\",\n\t\t\t\"fas-f2f9\" => \"fas fa-redo-alt\",\n\t\t\t\"fas-f25d\" => \"fas fa-registered\",\n\t\t\t\"fas-f87d\" => \"fas fa-remove-format\",\n\t\t\t\"fas-f3e5\" => \"fas fa-reply\",\n\t\t\t\"fas-f122\" => \"fas fa-reply-all\",\n\t\t\t\"fas-f75e\" => \"fas fa-republican\",\n\t\t\t\"fas-f7bd\" => \"fas fa-restroom\",\n\t\t\t\"fas-f079\" => \"fas fa-retweet\",\n\t\t\t\"fas-f4d6\" => \"fas fa-ribbon\",\n\t\t\t\"fas-f70b\" => \"fas fa-ring\",\n\t\t\t\"fas-f018\" => \"fas fa-road\",\n\t\t\t\"fas-f544\" => \"fas fa-robot\",\n\t\t\t\"fas-f135\" => \"fas fa-rocket\",\n\t\t\t\"fas-f4d7\" => \"fas fa-route\",\n\t\t\t\"fas-f09e\" => \"fas fa-rss\",\n\t\t\t\"fas-f143\" => \"fas fa-rss-square\",\n\t\t\t\"fas-f158\" => \"fas fa-ruble-sign\",\n\t\t\t\"fas-f545\" => \"fas fa-ruler\",\n\t\t\t\"fas-f546\" => \"fas fa-ruler-combined\",\n\t\t\t\"fas-f547\" => \"fas fa-ruler-horizontal\",\n\t\t\t\"fas-f548\" => \"fas fa-ruler-vertical\",\n\t\t\t\"fas-f70c\" => \"fas fa-running\",\n\t\t\t\"fas-f156\" => \"fas fa-rupee-sign\",\n\t\t\t\"fas-f5b3\" => \"fas fa-sad-cry\",\n\t\t\t\"fas-f5b4\" => \"fas fa-sad-tear\",\n\t\t\t\"fas-f7bf\" => \"fas fa-satellite\",\n\t\t\t\"fas-f7c0\" => \"fas fa-satellite-dish\",\n\t\t\t\"fas-f0c7\" => \"fas fa-save\",\n\t\t\t\"fas-f549\" => \"fas fa-school\",\n\t\t\t\"fas-f54a\" => \"fas fa-screwdriver\",\n\t\t\t\"fas-f70e\" => \"fas fa-scroll\",\n\t\t\t\"fas-f7c2\" => \"fas fa-sd-card\",\n\t\t\t\"fas-f002\" => \"fas fa-search\",\n\t\t\t\"fas-f688\" => \"fas fa-search-dollar\",\n\t\t\t\"fas-f689\" => \"fas fa-search-location\",\n\t\t\t\"fas-f010\" => \"fas fa-search-minus\",\n\t\t\t\"fas-f00e\" => \"fas fa-search-plus\",\n\t\t\t\"fas-f4d8\" => \"fas fa-seedling\",\n\t\t\t\"fas-f233\" => \"fas fa-server\",\n\t\t\t\"fas-f61f\" => \"fas fa-shapes\",\n\t\t\t\"fas-f064\" => \"fas fa-share\",\n\t\t\t\"fas-f1e0\" => \"fas fa-share-alt\",\n\t\t\t\"fas-f1e1\" => \"fas fa-share-alt-square\",\n\t\t\t\"fas-f14d\" => \"fas fa-share-square\",\n\t\t\t\"fas-f20b\" => \"fas fa-shekel-sign\",\n\t\t\t\"fas-f3ed\" => \"fas fa-shield-alt\",\n\t\t\t\"fas-f96c\" => \"fas fa-shield-virus\",\n\t\t\t\"fas-f21a\" => \"fas fa-ship\",\n\t\t\t\"fas-f48b\" => \"fas fa-shipping-fast\",\n\t\t\t\"fas-f54b\" => \"fas fa-shoe-prints\",\n\t\t\t\"fas-f290\" => \"fas fa-shopping-bag\",\n\t\t\t\"fas-f291\" => \"fas fa-shopping-basket\",\n\t\t\t\"fas-f07a\" => \"fas fa-shopping-cart\",\n\t\t\t\"fas-f2cc\" => \"fas fa-shower\",\n\t\t\t\"fas-f5b6\" => \"fas fa-shuttle-van\",\n\t\t\t\"fas-f4d9\" => \"fas fa-sign\",\n\t\t\t\"fas-f2f6\" => \"fas fa-sign-in-alt\",\n\t\t\t\"fas-f2a7\" => \"fas fa-sign-language\",\n\t\t\t\"fas-f2f5\" => \"fas fa-sign-out-alt\",\n\t\t\t\"fas-f012\" => \"fas fa-signal\",\n\t\t\t\"fas-f5b7\" => \"fas fa-signature\",\n\t\t\t\"fas-f7c4\" => \"fas fa-sim-card\",\n\t\t\t\"fas-f0e8\" => \"fas fa-sitemap\",\n\t\t\t\"fas-f7c5\" => \"fas fa-skating\",\n\t\t\t\"fas-f7c9\" => \"fas fa-skiing\",\n\t\t\t\"fas-f7ca\" => \"fas fa-skiing-nordic\",\n\t\t\t\"fas-f54c\" => \"fas fa-skull\",\n\t\t\t\"fas-f714\" => \"fas fa-skull-crossbones\",\n\t\t\t\"fas-f715\" => \"fas fa-slash\",\n\t\t\t\"fas-f7cc\" => \"fas fa-sleigh\",\n\t\t\t\"fas-f1de\" => \"fas fa-sliders-h\",\n\t\t\t\"fas-f118\" => \"fas fa-smile\",\n\t\t\t\"fas-f5b8\" => \"fas fa-smile-beam\",\n\t\t\t\"fas-f4da\" => \"fas fa-smile-wink\",\n\t\t\t\"fas-f75f\" => \"fas fa-smog\",\n\t\t\t\"fas-f48d\" => \"fas fa-smoking\",\n\t\t\t\"fas-f54d\" => \"fas fa-smoking-ban\",\n\t\t\t\"fas-f7cd\" => \"fas fa-sms\",\n\t\t\t\"fas-f7ce\" => \"fas fa-snowboarding\",\n\t\t\t\"fas-f2dc\" => \"fas fa-snowflake\",\n\t\t\t\"fas-f7d0\" => \"fas fa-snowman\",\n\t\t\t\"fas-f7d2\" => \"fas fa-snowplow\",\n\t\t\t\"fas-f96e\" => \"fas fa-soap\",\n\t\t\t\"fas-f696\" => \"fas fa-socks\",\n\t\t\t\"fas-f5ba\" => \"fas fa-solar-panel\",\n\t\t\t\"fas-f0dc\" => \"fas fa-sort\",\n\t\t\t\"fas-f15d\" => \"fas fa-sort-alpha-down\",\n\t\t\t\"fas-f881\" => \"fas fa-sort-alpha-down-alt\",\n\t\t\t\"fas-f15e\" => \"fas fa-sort-alpha-up\",\n\t\t\t\"fas-f882\" => \"fas fa-sort-alpha-up-alt\",\n\t\t\t\"fas-f160\" => \"fas fa-sort-amount-down\",\n\t\t\t\"fas-f884\" => \"fas fa-sort-amount-down-alt\",\n\t\t\t\"fas-f161\" => \"fas fa-sort-amount-up\",\n\t\t\t\"fas-f885\" => \"fas fa-sort-amount-up-alt\",\n\t\t\t\"fas-f0dd\" => \"fas fa-sort-down\",\n\t\t\t\"fas-f162\" => \"fas fa-sort-numeric-down\",\n\t\t\t\"fas-f886\" => \"fas fa-sort-numeric-down-alt\",\n\t\t\t\"fas-f163\" => \"fas fa-sort-numeric-up\",\n\t\t\t\"fas-f887\" => \"fas fa-sort-numeric-up-alt\",\n\t\t\t\"fas-f0de\" => \"fas fa-sort-up\",\n\t\t\t\"fas-f5bb\" => \"fas fa-spa\",\n\t\t\t\"fas-f197\" => \"fas fa-space-shuttle\",\n\t\t\t\"fas-f891\" => \"fas fa-spell-check\",\n\t\t\t\"fas-f717\" => \"fas fa-spider\",\n\t\t\t\"fas-f110\" => \"fas fa-spinner\",\n\t\t\t\"fas-f5bc\" => \"fas fa-splotch\",\n\t\t\t\"fas-f5bd\" => \"fas fa-spray-can\",\n\t\t\t\"fas-f0c8\" => \"fas fa-square\",\n\t\t\t\"fas-f45c\" => \"fas fa-square-full\",\n\t\t\t\"fas-f698\" => \"fas fa-square-root-alt\",\n\t\t\t\"fas-f5bf\" => \"fas fa-stamp\",\n\t\t\t\"fas-f005\" => \"fas fa-star\",\n\t\t\t\"fas-f699\" => \"fas fa-star-and-crescent\",\n\t\t\t\"fas-f089\" => \"fas fa-star-half\",\n\t\t\t\"fas-f5c0\" => \"fas fa-star-half-alt\",\n\t\t\t\"fas-f69a\" => \"fas fa-star-of-david\",\n\t\t\t\"fas-f621\" => \"fas fa-star-of-life\",\n\t\t\t\"fas-f048\" => \"fas fa-step-backward\",\n\t\t\t\"fas-f051\" => \"fas fa-step-forward\",\n\t\t\t\"fas-f0f1\" => \"fas fa-stethoscope\",\n\t\t\t\"fas-f249\" => \"fas fa-sticky-note\",\n\t\t\t\"fas-f04d\" => \"fas fa-stop\",\n\t\t\t\"fas-f28d\" => \"fas fa-stop-circle\",\n\t\t\t\"fas-f2f2\" => \"fas fa-stopwatch\",\n\t\t\t\"fas-f96f\" => \"fas fa-stopwatch-20\",\n\t\t\t\"fas-f54e\" => \"fas fa-store\",\n\t\t\t\"fas-f54f\" => \"fas fa-store-alt\",\n\t\t\t\"fas-f970\" => \"fas fa-store-alt-slash\",\n\t\t\t\"fas-f971\" => \"fas fa-store-slash\",\n\t\t\t\"fas-f550\" => \"fas fa-stream\",\n\t\t\t\"fas-f21d\" => \"fas fa-street-view\",\n\t\t\t\"fas-f0cc\" => \"fas fa-strikethrough\",\n\t\t\t\"fas-f551\" => \"fas fa-stroopwafel\",\n\t\t\t\"fas-f12c\" => \"fas fa-subscript\",\n\t\t\t\"fas-f239\" => \"fas fa-subway\",\n\t\t\t\"fas-f0f2\" => \"fas fa-suitcase\",\n\t\t\t\"fas-f5c1\" => \"fas fa-suitcase-rolling\",\n\t\t\t\"fas-f185\" => \"fas fa-sun\",\n\t\t\t\"fas-f12b\" => \"fas fa-superscript\",\n\t\t\t\"fas-f5c2\" => \"fas fa-surprise\",\n\t\t\t\"fas-f5c3\" => \"fas fa-swatchbook\",\n\t\t\t\"fas-f5c4\" => \"fas fa-swimmer\",\n\t\t\t\"fas-f5c5\" => \"fas fa-swimming-pool\",\n\t\t\t\"fas-f69b\" => \"fas fa-synagogue\",\n\t\t\t\"fas-f021\" => \"fas fa-sync\",\n\t\t\t\"fas-f2f1\" => \"fas fa-sync-alt\",\n\t\t\t\"fas-f48e\" => \"fas fa-syringe\",\n\t\t\t\"fas-f0ce\" => \"fas fa-table\",\n\t\t\t\"fas-f45d\" => \"fas fa-table-tennis\",\n\t\t\t\"fas-f10a\" => \"fas fa-tablet\",\n\t\t\t\"fas-f3fa\" => \"fas fa-tablet-alt\",\n\t\t\t\"fas-f490\" => \"fas fa-tablets\",\n\t\t\t\"fas-f3fd\" => \"fas fa-tachometer-alt\",\n\t\t\t\"fas-f02b\" => \"fas fa-tag\",\n\t\t\t\"fas-f02c\" => \"fas fa-tags\",\n\t\t\t\"fas-f4db\" => \"fas fa-tape\",\n\t\t\t\"fas-f0ae\" => \"fas fa-tasks\",\n\t\t\t\"fas-f1ba\" => \"fas fa-taxi\",\n\t\t\t\"fas-f62e\" => \"fas fa-teeth\",\n\t\t\t\"fas-f62f\" => \"fas fa-teeth-open\",\n\t\t\t\"fas-f769\" => \"fas fa-temperature-high\",\n\t\t\t\"fas-f76b\" => \"fas fa-temperature-low\",\n\t\t\t\"fas-f7d7\" => \"fas fa-tenge\",\n\t\t\t\"fas-f120\" => \"fas fa-terminal\",\n\t\t\t\"fas-f034\" => \"fas fa-text-height\",\n\t\t\t\"fas-f035\" => \"fas fa-text-width\",\n\t\t\t\"fas-f00a\" => \"fas fa-th\",\n\t\t\t\"fas-f009\" => \"fas fa-th-large\",\n\t\t\t\"fas-f00b\" => \"fas fa-th-list\",\n\t\t\t\"fas-f630\" => \"fas fa-theater-masks\",\n\t\t\t\"fas-f491\" => \"fas fa-thermometer\",\n\t\t\t\"fas-f2cb\" => \"fas fa-thermometer-empty\",\n\t\t\t\"fas-f2c7\" => \"fas fa-thermometer-full\",\n\t\t\t\"fas-f2c9\" => \"fas fa-thermometer-half\",\n\t\t\t\"fas-f2ca\" => \"fas fa-thermometer-quarter\",\n\t\t\t\"fas-f2c8\" => \"fas fa-thermometer-three-quarters\",\n\t\t\t\"fas-f165\" => \"fas fa-thumbs-down\",\n\t\t\t\"fas-f164\" => \"fas fa-thumbs-up\",\n\t\t\t\"fas-f08d\" => \"fas fa-thumbtack\",\n\t\t\t\"fas-f3ff\" => \"fas fa-ticket-alt\",\n\t\t\t\"fas-f00d\" => \"fas fa-times\",\n\t\t\t\"fas-f057\" => \"fas fa-times-circle\",\n\t\t\t\"fas-f043\" => \"fas fa-tint\",\n\t\t\t\"fas-f5c7\" => \"fas fa-tint-slash\",\n\t\t\t\"fas-f5c8\" => \"fas fa-tired\",\n\t\t\t\"fas-f204\" => \"fas fa-toggle-off\",\n\t\t\t\"fas-f205\" => \"fas fa-toggle-on\",\n\t\t\t\"fas-f7d8\" => \"fas fa-toilet\",\n\t\t\t\"fas-f71e\" => \"fas fa-toilet-paper\",\n\t\t\t\"fas-f972\" => \"fas fa-toilet-paper-slash\",\n\t\t\t\"fas-f552\" => \"fas fa-toolbox\",\n\t\t\t\"fas-f7d9\" => \"fas fa-tools\",\n\t\t\t\"fas-f5c9\" => \"fas fa-tooth\",\n\t\t\t\"fas-f6a0\" => \"fas fa-torah\",\n\t\t\t\"fas-f6a1\" => \"fas fa-torii-gate\",\n\t\t\t\"fas-f722\" => \"fas fa-tractor\",\n\t\t\t\"fas-f25c\" => \"fas fa-trademark\",\n\t\t\t\"fas-f637\" => \"fas fa-traffic-light\",\n\t\t\t\"fas-f941\" => \"fas fa-trailer\",\n\t\t\t\"fas-f238\" => \"fas fa-train\",\n\t\t\t\"fas-f7da\" => \"fas fa-tram\",\n\t\t\t\"fas-f224\" => \"fas fa-transgender\",\n\t\t\t\"fas-f225\" => \"fas fa-transgender-alt\",\n\t\t\t\"fas-f1f8\" => \"fas fa-trash\",\n\t\t\t\"fas-f2ed\" => \"fas fa-trash-alt\",\n\t\t\t\"fas-f829\" => \"fas fa-trash-restore\",\n\t\t\t\"fas-f82a\" => \"fas fa-trash-restore-alt\",\n\t\t\t\"fas-f1bb\" => \"fas fa-tree\",\n\t\t\t\"fas-f091\" => \"fas fa-trophy\",\n\t\t\t\"fas-f0d1\" => \"fas fa-truck\",\n\t\t\t\"fas-f4de\" => \"fas fa-truck-loading\",\n\t\t\t\"fas-f63b\" => \"fas fa-truck-monster\",\n\t\t\t\"fas-f4df\" => \"fas fa-truck-moving\",\n\t\t\t\"fas-f63c\" => \"fas fa-truck-pickup\",\n\t\t\t\"fas-f553\" => \"fas fa-tshirt\",\n\t\t\t\"fas-f1e4\" => \"fas fa-tty\",\n\t\t\t\"fas-f26c\" => \"fas fa-tv\",\n\t\t\t\"fas-f0e9\" => \"fas fa-umbrella\",\n\t\t\t\"fas-f5ca\" => \"fas fa-umbrella-beach\",\n\t\t\t\"fas-f0cd\" => \"fas fa-underline\",\n\t\t\t\"fas-f0e2\" => \"fas fa-undo\",\n\t\t\t\"fas-f2ea\" => \"fas fa-undo-alt\",\n\t\t\t\"fas-f29a\" => \"fas fa-universal-access\",\n\t\t\t\"fas-f19c\" => \"fas fa-university\",\n\t\t\t\"fas-f127\" => \"fas fa-unlink\",\n\t\t\t\"fas-f09c\" => \"fas fa-unlock\",\n\t\t\t\"fas-f13e\" => \"fas fa-unlock-alt\",\n\t\t\t\"fas-f093\" => \"fas fa-upload\",\n\t\t\t\"fas-f007\" => \"fas fa-user\",\n\t\t\t\"fas-f406\" => \"fas fa-user-alt\",\n\t\t\t\"fas-f4fa\" => \"fas fa-user-alt-slash\",\n\t\t\t\"fas-f4fb\" => \"fas fa-user-astronaut\",\n\t\t\t\"fas-f4fc\" => \"fas fa-user-check\",\n\t\t\t\"fas-f2bd\" => \"fas fa-user-circle\",\n\t\t\t\"fas-f4fd\" => \"fas fa-user-clock\",\n\t\t\t\"fas-f4fe\" => \"fas fa-user-cog\",\n\t\t\t\"fas-f4ff\" => \"fas fa-user-edit\",\n\t\t\t\"fas-f500\" => \"fas fa-user-friends\",\n\t\t\t\"fas-f501\" => \"fas fa-user-graduate\",\n\t\t\t\"fas-f728\" => \"fas fa-user-injured\",\n\t\t\t\"fas-f502\" => \"fas fa-user-lock\",\n\t\t\t\"fas-f0f0\" => \"fas fa-user-md\",\n\t\t\t\"fas-f503\" => \"fas fa-user-minus\",\n\t\t\t\"fas-f504\" => \"fas fa-user-ninja\",\n\t\t\t\"fas-f82f\" => \"fas fa-user-nurse\",\n\t\t\t\"fas-f234\" => \"fas fa-user-plus\",\n\t\t\t\"fas-f21b\" => \"fas fa-user-secret\",\n\t\t\t\"fas-f505\" => \"fas fa-user-shield\",\n\t\t\t\"fas-f506\" => \"fas fa-user-slash\",\n\t\t\t\"fas-f507\" => \"fas fa-user-tag\",\n\t\t\t\"fas-f508\" => \"fas fa-user-tie\",\n\t\t\t\"fas-f235\" => \"fas fa-user-times\",\n\t\t\t\"fas-f0c0\" => \"fas fa-users\",\n\t\t\t\"fas-f509\" => \"fas fa-users-cog\",\n\t\t\t\"fas-f2e5\" => \"fas fa-utensil-spoon\",\n\t\t\t\"fas-f2e7\" => \"fas fa-utensils\",\n\t\t\t\"fas-f5cb\" => \"fas fa-vector-square\",\n\t\t\t\"fas-f221\" => \"fas fa-venus\",\n\t\t\t\"fas-f226\" => \"fas fa-venus-double\",\n\t\t\t\"fas-f228\" => \"fas fa-venus-mars\",\n\t\t\t\"fas-f492\" => \"fas fa-vial\",\n\t\t\t\"fas-f493\" => \"fas fa-vials\",\n\t\t\t\"fas-f03d\" => \"fas fa-video\",\n\t\t\t\"fas-f4e2\" => \"fas fa-video-slash\",\n\t\t\t\"fas-f6a7\" => \"fas fa-vihara\",\n\t\t\t\"fas-f974\" => \"fas fa-virus\",\n\t\t\t\"fas-f975\" => \"fas fa-virus-slash\",\n\t\t\t\"fas-f976\" => \"fas fa-viruses\",\n\t\t\t\"fas-f897\" => \"fas fa-voicemail\",\n\t\t\t\"fas-f45f\" => \"fas fa-volleyball-ball\",\n\t\t\t\"fas-f027\" => \"fas fa-volume-down\",\n\t\t\t\"fas-f6a9\" => \"fas fa-volume-mute\",\n\t\t\t\"fas-f026\" => \"fas fa-volume-off\",\n\t\t\t\"fas-f028\" => \"fas fa-volume-up\",\n\t\t\t\"fas-f772\" => \"fas fa-vote-yea\",\n\t\t\t\"fas-f729\" => \"fas fa-vr-cardboard\",\n\t\t\t\"fas-f554\" => \"fas fa-walking\",\n\t\t\t\"fas-f555\" => \"fas fa-wallet\",\n\t\t\t\"fas-f494\" => \"fas fa-warehouse\",\n\t\t\t\"fas-f773\" => \"fas fa-water\",\n\t\t\t\"fas-f83e\" => \"fas fa-wave-square\",\n\t\t\t\"fas-f496\" => \"fas fa-weight\",\n\t\t\t\"fas-f5cd\" => \"fas fa-weight-hanging\",\n\t\t\t\"fas-f193\" => \"fas fa-wheelchair\",\n\t\t\t\"fas-f1eb\" => \"fas fa-wifi\",\n\t\t\t\"fas-f72e\" => \"fas fa-wind\",\n\t\t\t\"fas-f410\" => \"fas fa-window-close\",\n\t\t\t\"fas-f2d0\" => \"fas fa-window-maximize\",\n\t\t\t\"fas-f2d1\" => \"fas fa-window-minimize\",\n\t\t\t\"fas-f2d2\" => \"fas fa-window-restore\",\n\t\t\t\"fas-f72f\" => \"fas fa-wine-bottle\",\n\t\t\t\"fas-f4e3\" => \"fas fa-wine-glass\",\n\t\t\t\"fas-f5ce\" => \"fas fa-wine-glass-alt\",\n\t\t\t\"fas-f159\" => \"fas fa-won-sign\",\n\t\t\t\"fas-f0ad\" => \"fas fa-wrench\",\n\t\t\t\"fas-f497\" => \"fas fa-x-ray\",\n\t\t\t\"fas-f157\" => \"fas fa-yen-sign\",\n\t\t\t\"fas-f6ad\" => \"fas fa-yin-y\"\n\t\t);\n\n\t\t$regular_icons = array(\t\n\t\t\t\"far-f2b9\" => \"far fa-address-book\",\n\t\t\t\"far-f2bb\" => \"far fa-address-card\",\n\t\t\t\"far-f556\" => \"far fa-angry\",\n\t\t\t\"far-f358\" => \"far fa-arrow-alt-circle-down\",\n\t\t\t\"far-f359\" => \"far fa-arrow-alt-circle-left\",\n\t\t\t\"far-f35a\" => \"far fa-arrow-alt-circle-right\",\n\t\t\t\"far-f35b\" => \"far fa-arrow-alt-circle-up\",\n\t\t\t\"far-f0f3\" => \"far fa-bell\",\n\t\t\t\"far-f1f6\" => \"far fa-bell-slash\",\n\t\t\t\"far-f02e\" => \"far fa-bookmark\",\n\t\t\t\"far-f1ad\" => \"far fa-building\",\n\t\t\t\"far-f133\" => \"far fa-calendar\",\n\t\t\t\"far-f073\" => \"far fa-calendar-alt\",\n\t\t\t\"far-f274\" => \"far fa-calendar-check\",\n\t\t\t\"far-f272\" => \"far fa-calendar-minus\",\n\t\t\t\"far-f271\" => \"far fa-calendar-plus\",\n\t\t\t\"far-f273\" => \"far fa-calendar-times\",\n\t\t\t\"far-f150\" => \"far fa-caret-square-down\",\n\t\t\t\"far-f191\" => \"far fa-caret-square-left\",\n\t\t\t\"far-f152\" => \"far fa-caret-square-right\",\n\t\t\t\"far-f151\" => \"far fa-caret-square-up\",\n\t\t\t\"far-f080\" => \"far fa-chart-bar\",\n\t\t\t\"far-f058\" => \"far fa-check-circle\",\n\t\t\t\"far-f14a\" => \"far fa-check-square\",\n\t\t\t\"far-f111\" => \"far fa-circle\",\n\t\t\t\"far-f328\" => \"far fa-clipboard\",\n\t\t\t\"far-f017\" => \"far fa-clock\",\n\t\t\t\"far-f24d\" => \"far fa-clone\",\n\t\t\t\"far-f20a\" => \"far fa-closed-captioning\",\n\t\t\t\"far-f075\" => \"far fa-comment\",\n\t\t\t\"far-f27a\" => \"far fa-comment-alt\",\n\t\t\t\"far-f4ad\" => \"far fa-comment-dots\",\n\t\t\t\"far-f086\" => \"far fa-comments\",\n\t\t\t\"far-f14e\" => \"far fa-compass\",\n\t\t\t\"far-f0c5\" => \"far fa-copy\",\n\t\t\t\"far-f1f9\" => \"far fa-copyright\",\n\t\t\t\"far-f09d\" => \"far fa-credit-card\",\n\t\t\t\"far-f567\" => \"far fa-dizzy\",\n\t\t\t\"far-f192\" => \"far fa-dot-circle\",\n\t\t\t\"far-f044\" => \"far fa-edit\",\n\t\t\t\"far-f0e0\" => \"far fa-envelope\",\n\t\t\t\"far-f2b6\" => \"far fa-envelope-open\",\n\t\t\t\"far-f06e\" => \"far fa-eye\",\n\t\t\t\"far-f070\" => \"far fa-eye-slash\",\n\t\t\t\"far-f15b\" => \"far fa-file\",\n\t\t\t\"far-f15c\" => \"far fa-file-alt\",\n\t\t\t\"far-f1c6\" => \"far fa-file-archive\",\n\t\t\t\"far-f1c7\" => \"far fa-file-audio\",\n\t\t\t\"far-f1c9\" => \"far fa-file-code\",\n\t\t\t\"far-f1c3\" => \"far fa-file-excel\",\n\t\t\t\"far-f1c5\" => \"far fa-file-image\",\n\t\t\t\"far-f1c1\" => \"far fa-file-pdf\",\n\t\t\t\"far-f1c4\" => \"far fa-file-powerpoint\",\n\t\t\t\"far-f1c8\" => \"far fa-file-video\",\n\t\t\t\"far-f1c2\" => \"far fa-file-word\",\n\t\t\t\"far-f024\" => \"far fa-flag\",\n\t\t\t\"far-f579\" => \"far fa-flushed\",\n\t\t\t\"far-f07b\" => \"far fa-folder\",\n\t\t\t\"far-f07c\" => \"far fa-folder-open\",\n\t\t\t\"far-f119\" => \"far fa-frown\",\n\t\t\t\"far-f57a\" => \"far fa-frown-open\",\n\t\t\t\"far-f1e3\" => \"far fa-futbol\",\n\t\t\t\"far-f3a5\" => \"far fa-gem\",\n\t\t\t\"far-f57f\" => \"far fa-grimace\",\n\t\t\t\"far-f580\" => \"far fa-grin\",\n\t\t\t\"far-f581\" => \"far fa-grin-alt\",\n\t\t\t\"far-f582\" => \"far fa-grin-beam\",\n\t\t\t\"far-f583\" => \"far fa-grin-beam-sweat\",\n\t\t\t\"far-f584\" => \"far fa-grin-hearts\",\n\t\t\t\"far-f585\" => \"far fa-grin-squint\",\n\t\t\t\"far-f586\" => \"far fa-grin-squint-tears\",\n\t\t\t\"far-f587\" => \"far fa-grin-stars\",\n\t\t\t\"far-f588\" => \"far fa-grin-tears\",\n\t\t\t\"far-f589\" => \"far fa-grin-tongue\",\n\t\t\t\"far-f58a\" => \"far fa-grin-tongue-squint\",\n\t\t\t\"far-f58b\" => \"far fa-grin-tongue-wink\",\n\t\t\t\"far-f58c\" => \"far fa-grin-wink\",\n\t\t\t\"far-f258\" => \"far fa-hand-lizard\",\n\t\t\t\"far-f256\" => \"far fa-hand-paper\",\n\t\t\t\"far-f25b\" => \"far fa-hand-peace\",\n\t\t\t\"far-f0a7\" => \"far fa-hand-point-down\",\n\t\t\t\"far-f0a5\" => \"far fa-hand-point-left\",\n\t\t\t\"far-f0a4\" => \"far fa-hand-point-right\",\n\t\t\t\"far-f0a6\" => \"far fa-hand-point-up\",\n\t\t\t\"far-f25a\" => \"far fa-hand-pointer\",\n\t\t\t\"far-f255\" => \"far fa-hand-rock\",\n\t\t\t\"far-f257\" => \"far fa-hand-scissors\",\n\t\t\t\"far-f259\" => \"far fa-hand-spock\",\n\t\t\t\"far-f2b5\" => \"far fa-handshake\",\n\t\t\t\"far-f0a0\" => \"far fa-hdd\",\n\t\t\t\"far-f004\" => \"far fa-heart\",\n\t\t\t\"far-f0f8\" => \"far fa-hospital\",\n\t\t\t\"far-f254\" => \"far fa-hourglass\",\n\t\t\t\"far-f2c1\" => \"far fa-id-badge\",\n\t\t\t\"far-f2c2\" => \"far fa-id-card\",\n\t\t\t\"far-f03e\" => \"far fa-image\",\n\t\t\t\"far-f302\" => \"far fa-images\",\n\t\t\t\"far-f11c\" => \"far fa-keyboard\",\n\t\t\t\"far-f596\" => \"far fa-kiss\",\n\t\t\t\"far-f597\" => \"far fa-kiss-beam\",\n\t\t\t\"far-f598\" => \"far fa-kiss-wink-heart\",\n\t\t\t\"far-f599\" => \"far fa-laugh\",\n\t\t\t\"far-f59a\" => \"far fa-laugh-beam\",\n\t\t\t\"far-f59b\" => \"far fa-laugh-squint\",\n\t\t\t\"far-f59c\" => \"far fa-laugh-wink\",\n\t\t\t\"far-f094\" => \"far fa-lemon\",\n\t\t\t\"far-f1cd\" => \"far fa-life-ring\",\n\t\t\t\"far-f0eb\" => \"far fa-lightbulb\",\n\t\t\t\"far-f022\" => \"far fa-list-alt\",\n\t\t\t\"far-f279\" => \"far fa-map\",\n\t\t\t\"far-f11a\" => \"far fa-meh\",\n\t\t\t\"far-f5a4\" => \"far fa-meh-blank\",\n\t\t\t\"far-f5a5\" => \"far fa-meh-rolling-eyes\",\n\t\t\t\"far-f146\" => \"far fa-minus-square\",\n\t\t\t\"far-f3d1\" => \"far fa-money-bill-alt\",\n\t\t\t\"far-f186\" => \"far fa-moon\",\n\t\t\t\"far-f1ea\" => \"far fa-newspaper\",\n\t\t\t\"far-f247\" => \"far fa-object-group\",\n\t\t\t\"far-f248\" => \"far fa-object-ungroup\",\n\t\t\t\"far-f1d8\" => \"far fa-paper-plane\",\n\t\t\t\"far-f28b\" => \"far fa-pause-circle\",\n\t\t\t\"far-f144\" => \"far fa-play-circle\",\n\t\t\t\"far-f0fe\" => \"far fa-plus-square\",\n\t\t\t\"far-f059\" => \"far fa-question-circle\",\n\t\t\t\"far-f25d\" => \"far fa-registered\",\n\t\t\t\"far-f5b3\" => \"far fa-sad-cry\",\n\t\t\t\"far-f5b4\" => \"far fa-sad-tear\",\n\t\t\t\"far-f0c7\" => \"far fa-save\",\n\t\t\t\"far-f14d\" => \"far fa-share-square\",\n\t\t\t\"far-f118\" => \"far fa-smile\",\n\t\t\t\"far-f5b8\" => \"far fa-smile-beam\",\n\t\t\t\"far-f4da\" => \"far fa-smile-wink\",\n\t\t\t\"far-f2dc\" => \"far fa-snowflake\",\n\t\t\t\"far-f0c8\" => \"far fa-square\",\n\t\t\t\"far-f005\" => \"far fa-star\",\n\t\t\t\"far-f089\" => \"far fa-star-half\",\n\t\t\t\"far-f249\" => \"far fa-sticky-note\",\n\t\t\t\"far-f28d\" => \"far fa-stop-circle\",\n\t\t\t\"far-f185\" => \"far fa-sun\",\n\t\t\t\"far-f5c2\" => \"far fa-surprise\",\n\t\t\t\"far-f165\" => \"far fa-thumbs-down\",\n\t\t\t\"far-f164\" => \"far fa-thumbs-up\",\n\t\t\t\"far-f057\" => \"far fa-times-circle\",\n\t\t\t\"far-f5c8\" => \"far fa-tired\",\n\t\t\t\"far-f2ed\" => \"far fa-trash-alt\",\n\t\t\t\"far-f007\" => \"far fa-user\",\n\t\t\t\"far-f2bd\" => \"far fa-user-circle\",\n\t\t\t\"far-f410\" => \"far fa-window-close\",\n\t\t\t\"far-f2d0\" => \"far fa-window-maximize\",\n\t\t\t\"far-f2d1\" => \"far fa-window-minimize\",\n\t\t\t\"far-f2d2\" => \"far fa-window-rest\"\n\t\t);\n\n\t\t$brand_icons = array(\n\t\t\t\"fab-f26e\" => \"fab fa-500px\",\n\t\t\t\"fab-f368\" => \"fab fa-accessible-icon\",\n\t\t\t\"fab-f369\" => \"fab fa-accusoft\",\n\t\t\t\"fab-f6af\" => \"fab fa-acquisitions-incorporated\",\n\t\t\t\"fab-f170\" => \"fab fa-adn\",\n\t\t\t\"fab-f778\" => \"fab fa-adobe\",\n\t\t\t\"fab-f36a\" => \"fab fa-adversal\",\n\t\t\t\"fab-f36b\" => \"fab fa-affiliatetheme\",\n\t\t\t\"fab-f834\" => \"fab fa-airbnb\",\n\t\t\t\"fab-f36c\" => \"fab fa-algolia\",\n\t\t\t\"fab-f642\" => \"fab fa-alipay\",\n\t\t\t\"fab-f270\" => \"fab fa-amazon\",\n\t\t\t\"fab-f42c\" => \"fab fa-amazon-pay\",\n\t\t\t\"fab-f36d\" => \"fab fa-amilia\",\n\t\t\t\"fab-f17b\" => \"fab fa-android\",\n\t\t\t\"fab-f209\" => \"fab fa-angellist\",\n\t\t\t\"fab-f36e\" => \"fab fa-angrycreative\",\n\t\t\t\"fab-f420\" => \"fab fa-angular\",\n\t\t\t\"fab-f36f\" => \"fab fa-app-store\",\n\t\t\t\"fab-f370\" => \"fab fa-app-store-ios\",\n\t\t\t\"fab-f371\" => \"fab fa-apper\",\n\t\t\t\"fab-f179\" => \"fab fa-apple\",\n\t\t\t\"fab-f415\" => \"fab fa-apple-pay\",\n\t\t\t\"fab-f77a\" => \"fab fa-artstation\",\n\t\t\t\"fab-f372\" => \"fab fa-asymmetrik\",\n\t\t\t\"fab-f77b\" => \"fab fa-atlassian\",\n\t\t\t\"fab-f373\" => \"fab fa-audible\",\n\t\t\t\"fab-f41c\" => \"fab fa-autoprefixer\",\n\t\t\t\"fab-f374\" => \"fab fa-avianex\",\n\t\t\t\"fab-f421\" => \"fab fa-aviato\",\n\t\t\t\"fab-f375\" => \"fab fa-aws\",\n\t\t\t\"fab-f2d5\" => \"fab fa-bandcamp\",\n\t\t\t\"fab-f835\" => \"fab fa-battle-net\",\n\t\t\t\"fab-f1b4\" => \"fab fa-behance\",\n\t\t\t\"fab-f1b5\" => \"fab fa-behance-square\",\n\t\t\t\"fab-f378\" => \"fab fa-bimobject\",\n\t\t\t\"fab-f171\" => \"fab fa-bitbucket\",\n\t\t\t\"fab-f379\" => \"fab fa-bitcoin\",\n\t\t\t\"fab-f37a\" => \"fab fa-bity\",\n\t\t\t\"fab-f27e\" => \"fab fa-black-tie\",\n\t\t\t\"fab-f37b\" => \"fab fa-blackberry\",\n\t\t\t\"fab-f37c\" => \"fab fa-blogger\",\n\t\t\t\"fab-f37d\" => \"fab fa-blogger-b\",\n\t\t\t\"fab-f293\" => \"fab fa-bluetooth\",\n\t\t\t\"fab-f294\" => \"fab fa-bluetooth-b\",\n\t\t\t\"fab-f836\" => \"fab fa-bootstrap\",\n\t\t\t\"fab-f15a\" => \"fab fa-btc\",\n\t\t\t\"fab-f837\" => \"fab fa-buffer\",\n\t\t\t\"fab-f37f\" => \"fab fa-buromobelexperte\",\n\t\t\t\"fab-f8a6\" => \"fab fa-buy-n-large\",\n\t\t\t\"fab-f20d\" => \"fab fa-buysellads\",\n\t\t\t\"fab-f785\" => \"fab fa-canadian-maple-leaf\",\n\t\t\t\"fab-f42d\" => \"fab fa-cc-amazon-pay\",\n\t\t\t\"fab-f1f3\" => \"fab fa-cc-amex\",\n\t\t\t\"fab-f416\" => \"fab fa-cc-apple-pay\",\n\t\t\t\"fab-f24c\" => \"fab fa-cc-diners-club\",\n\t\t\t\"fab-f1f2\" => \"fab fa-cc-discover\",\n\t\t\t\"fab-f24b\" => \"fab fa-cc-jcb\",\n\t\t\t\"fab-f1f1\" => \"fab fa-cc-mastercard\",\n\t\t\t\"fab-f1f4\" => \"fab fa-cc-paypal\",\n\t\t\t\"fab-f1f5\" => \"fab fa-cc-stripe\",\n\t\t\t\"fab-f1f0\" => \"fab fa-cc-visa\",\n\t\t\t\"fab-f380\" => \"fab fa-centercode\",\n\t\t\t\"fab-f789\" => \"fab fa-centos\",\n\t\t\t\"fab-f268\" => \"fab fa-chrome\",\n\t\t\t\"fab-f838\" => \"fab fa-chromecast\",\n\t\t\t\"fab-f383\" => \"fab fa-cloudscale\",\n\t\t\t\"fab-f384\" => \"fab fa-cloudsmith\",\n\t\t\t\"fab-f385\" => \"fab fa-cloudversify\",\n\t\t\t\"fab-f1cb\" => \"fab fa-codepen\",\n\t\t\t\"fab-f284\" => \"fab fa-codiepie\",\n\t\t\t\"fab-f78d\" => \"fab fa-confluence\",\n\t\t\t\"fab-f20e\" => \"fab fa-connectdevelop\",\n\t\t\t\"fab-f26d\" => \"fab fa-contao\",\n\t\t\t\"fab-f89e\" => \"fab fa-cotton-bureau\",\n\t\t\t\"fab-f388\" => \"fab fa-cpanel\",\n\t\t\t\"fab-f25e\" => \"fab fa-creative-commons\",\n\t\t\t\"fab-f4e7\" => \"fab fa-creative-commons-by\",\n\t\t\t\"fab-f4e8\" => \"fab fa-creative-commons-nc\",\n\t\t\t\"fab-f4e9\" => \"fab fa-creative-commons-nc-eu\",\n\t\t\t\"fab-f4ea\" => \"fab fa-creative-commons-nc-jp\",\n\t\t\t\"fab-f4eb\" => \"fab fa-creative-commons-nd\",\n\t\t\t\"fab-f4ec\" => \"fab fa-creative-commons-pd\",\n\t\t\t\"fab-f4ed\" => \"fab fa-creative-commons-pd-alt\",\n\t\t\t\"fab-f4ee\" => \"fab fa-creative-commons-remix\",\n\t\t\t\"fab-f4ef\" => \"fab fa-creative-commons-sa\",\n\t\t\t\"fab-f4f0\" => \"fab fa-creative-commons-sampling\",\n\t\t\t\"fab-f4f1\" => \"fab fa-creative-commons-sampling-plus\",\n\t\t\t\"fab-f4f2\" => \"fab fa-creative-commons-share\",\n\t\t\t\"fab-f4f3\" => \"fab fa-creative-commons-zero\",\n\t\t\t\"fab-f6c9\" => \"fab fa-critical-role\",\n\t\t\t\"fab-f13c\" => \"fab fa-css3\",\n\t\t\t\"fab-f38b\" => \"fab fa-css3-alt\",\n\t\t\t\"fab-f38c\" => \"fab fa-cuttlefish\",\n\t\t\t\"fab-f38d\" => \"fab fa-d-and-d\",\n\t\t\t\"fab-f6ca\" => \"fab fa-d-and-d-beyond\",\n\t\t\t\"fab-f952\" => \"fab fa-dailymotion\",\n\t\t\t\"fab-f210\" => \"fab fa-dashcube\",\n\t\t\t\"fab-f1a5\" => \"fab fa-delicious\",\n\t\t\t\"fab-f38e\" => \"fab fa-deploydog\",\n\t\t\t\"fab-f38f\" => \"fab fa-deskpro\",\n\t\t\t\"fab-f6cc\" => \"fab fa-dev\",\n\t\t\t\"fab-f1bd\" => \"fab fa-deviantart\",\n\t\t\t\"fab-f790\" => \"fab fa-dhl\",\n\t\t\t\"fab-f791\" => \"fab fa-diaspora\",\n\t\t\t\"fab-f1a6\" => \"fab fa-digg\",\n\t\t\t\"fab-f391\" => \"fab fa-digital-ocean\",\n\t\t\t\"fab-f392\" => \"fab fa-discord\",\n\t\t\t\"fab-f393\" => \"fab fa-discourse\",\n\t\t\t\"fab-f394\" => \"fab fa-dochub\",\n\t\t\t\"fab-f395\" => \"fab fa-docker\",\n\t\t\t\"fab-f396\" => \"fab fa-draft2digital\",\n\t\t\t\"fab-f17d\" => \"fab fa-dribbble\",\n\t\t\t\"fab-f397\" => \"fab fa-dribbble-square\",\n\t\t\t\"fab-f16b\" => \"fab fa-dropbox\",\n\t\t\t\"fab-f1a9\" => \"fab fa-drupal\",\n\t\t\t\"fab-f399\" => \"fab fa-dyalog\",\n\t\t\t\"fab-f39a\" => \"fab fa-earlybirds\",\n\t\t\t\"fab-f4f4\" => \"fab fa-ebay\",\n\t\t\t\"fab-f282\" => \"fab fa-edge\",\n\t\t\t\"fab-f430\" => \"fab fa-elementor\",\n\t\t\t\"fab-f5f1\" => \"fab fa-ello\",\n\t\t\t\"fab-f423\" => \"fab fa-ember\",\n\t\t\t\"fab-f1d1\" => \"fab fa-empire\",\n\t\t\t\"fab-f299\" => \"fab fa-envira\",\n\t\t\t\"fab-f39d\" => \"fab fa-erlang\",\n\t\t\t\"fab-f42e\" => \"fab fa-ethereum\",\n\t\t\t\"fab-f2d7\" => \"fab fa-etsy\",\n\t\t\t\"fab-f839\" => \"fab fa-evernote\",\n\t\t\t\"fab-f23e\" => \"fab fa-expeditedssl\",\n\t\t\t\"fab-f09a\" => \"fab fa-facebook\",\n\t\t\t\"fab-f39e\" => \"fab fa-facebook-f\",\n\t\t\t\"fab-f39f\" => \"fab fa-facebook-messenger\",\n\t\t\t\"fab-f082\" => \"fab fa-facebook-square\",\n\t\t\t\"fab-f6dc\" => \"fab fa-fantasy-flight-games\",\n\t\t\t\"fab-f797\" => \"fab fa-fedex\",\n\t\t\t\"fab-f798\" => \"fab fa-fedora\",\n\t\t\t\"fab-f799\" => \"fab fa-figma\",\n\t\t\t\"fab-f269\" => \"fab fa-firefox\",\n\t\t\t\"fab-f907\" => \"fab fa-firefox-browser\",\n\t\t\t\"fab-f2b0\" => \"fab fa-first-order\",\n\t\t\t\"fab-f50a\" => \"fab fa-first-order-alt\",\n\t\t\t\"fab-f3a1\" => \"fab fa-firstdraft\",\n\t\t\t\"fab-f16e\" => \"fab fa-flickr\",\n\t\t\t\"fab-f44d\" => \"fab fa-flipboard\",\n\t\t\t\"fab-f417\" => \"fab fa-fly\",\n\t\t\t\"fab-f2b4\" => \"fab fa-font-awesome\",\n\t\t\t\"fab-f35c\" => \"fab fa-font-awesome-alt\",\n\t\t\t\"fab-f425\" => \"fab fa-font-awesome-flag\",\n\t\t\t\"fab-f280\" => \"fab fa-fonticons\",\n\t\t\t\"fab-f3a2\" => \"fab fa-fonticons-fi\",\n\t\t\t\"fab-f286\" => \"fab fa-fort-awesome\",\n\t\t\t\"fab-f3a3\" => \"fab fa-fort-awesome-alt\",\n\t\t\t\"fab-f211\" => \"fab fa-forumbee\",\n\t\t\t\"fab-f180\" => \"fab fa-foursquare\",\n\t\t\t\"fab-f2c5\" => \"fab fa-free-code-camp\",\n\t\t\t\"fab-f3a4\" => \"fab fa-freebsd\",\n\t\t\t\"fab-f50b\" => \"fab fa-fulcrum\",\n\t\t\t\"fab-f50c\" => \"fab fa-galactic-republic\",\n\t\t\t\"fab-f50d\" => \"fab fa-galactic-senate\",\n\t\t\t\"fab-f265\" => \"fab fa-get-pocket\",\n\t\t\t\"fab-f260\" => \"fab fa-gg\",\n\t\t\t\"fab-f261\" => \"fab fa-gg-circle\",\n\t\t\t\"fab-f1d3\" => \"fab fa-git\",\n\t\t\t\"fab-f841\" => \"fab fa-git-alt\",\n\t\t\t\"fab-f1d2\" => \"fab fa-git-square\",\n\t\t\t\"fab-f09b\" => \"fab fa-github\",\n\t\t\t\"fab-f113\" => \"fab fa-github-alt\",\n\t\t\t\"fab-f092\" => \"fab fa-github-square\",\n\t\t\t\"fab-f3a6\" => \"fab fa-gitkraken\",\n\t\t\t\"fab-f296\" => \"fab fa-gitlab\",\n\t\t\t\"fab-f426\" => \"fab fa-gitter\",\n\t\t\t\"fab-f2a5\" => \"fab fa-glide\",\n\t\t\t\"fab-f2a6\" => \"fab fa-glide-g\",\n\t\t\t\"fab-f3a7\" => \"fab fa-gofore\",\n\t\t\t\"fab-f3a8\" => \"fab fa-goodreads\",\n\t\t\t\"fab-f3a9\" => \"fab fa-goodreads-g\",\n\t\t\t\"fab-f1a0\" => \"fab fa-google\",\n\t\t\t\"fab-f3aa\" => \"fab fa-google-drive\",\n\t\t\t\"fab-f3ab\" => \"fab fa-google-play\",\n\t\t\t\"fab-f2b3\" => \"fab fa-google-plus\",\n\t\t\t\"fab-f0d5\" => \"fab fa-google-plus-g\",\n\t\t\t\"fab-f0d4\" => \"fab fa-google-plus-square\",\n\t\t\t\"fab-f1ee\" => \"fab fa-google-wallet\",\n\t\t\t\"fab-f184\" => \"fab fa-gratipay\",\n\t\t\t\"fab-f2d6\" => \"fab fa-grav\",\n\t\t\t\"fab-f3ac\" => \"fab fa-gripfire\",\n\t\t\t\"fab-f3ad\" => \"fab fa-grunt\",\n\t\t\t\"fab-f3ae\" => \"fab fa-gulp\",\n\t\t\t\"fab-f1d4\" => \"fab fa-hacker-news\",\n\t\t\t\"fab-f3af\" => \"fab fa-hacker-news-square\",\n\t\t\t\"fab-f5f7\" => \"fab fa-hackerrank\",\n\t\t\t\"fab-f452\" => \"fab fa-hips\",\n\t\t\t\"fab-f3b0\" => \"fab fa-hire-a-helper\",\n\t\t\t\"fab-f427\" => \"fab fa-hooli\",\n\t\t\t\"fab-f592\" => \"fab fa-hornbill\",\n\t\t\t\"fab-f3b1\" => \"fab fa-hotjar\",\n\t\t\t\"fab-f27c\" => \"fab fa-houzz\",\n\t\t\t\"fab-f13b\" => \"fab fa-html5\",\n\t\t\t\"fab-f3b2\" => \"fab fa-hubspot\",\n\t\t\t\"fab-f913\" => \"fab fa-ideal\",\n\t\t\t\"fab-f2d8\" => \"fab fa-imdb\",\n\t\t\t\"fab-f16d\" => \"fab fa-instagram\",\n\t\t\t\"fab-f955\" => \"fab fa-instagram-square\",\n\t\t\t\"fab-f7af\" => \"fab fa-intercom\",\n\t\t\t\"fab-f26b\" => \"fab fa-internet-explorer\",\n\t\t\t\"fab-f7b0\" => \"fab fa-invision\",\n\t\t\t\"fab-f208\" => \"fab fa-ioxhost\",\n\t\t\t\"fab-f83a\" => \"fab fa-itch-io\",\n\t\t\t\"fab-f3b4\" => \"fab fa-itunes\",\n\t\t\t\"fab-f3b5\" => \"fab fa-itunes-note\",\n\t\t\t\"fab-f4e4\" => \"fab fa-java\",\n\t\t\t\"fab-f50e\" => \"fab fa-jedi-order\",\n\t\t\t\"fab-f3b6\" => \"fab fa-jenkins\",\n\t\t\t\"fab-f7b1\" => \"fab fa-jira\",\n\t\t\t\"fab-f3b7\" => \"fab fa-joget\",\n\t\t\t\"fab-f1aa\" => \"fab fa-joomla\",\n\t\t\t\"fab-f3b8\" => \"fab fa-js\",\n\t\t\t\"fab-f3b9\" => \"fab fa-js-square\",\n\t\t\t\"fab-f1cc\" => \"fab fa-jsfiddle\",\n\t\t\t\"fab-f5fa\" => \"fab fa-kaggle\",\n\t\t\t\"fab-f4f5\" => \"fab fa-keybase\",\n\t\t\t\"fab-f3ba\" => \"fab fa-keycdn\",\n\t\t\t\"fab-f3bb\" => \"fab fa-kickstarter\",\n\t\t\t\"fab-f3bc\" => \"fab fa-kickstarter-k\",\n\t\t\t\"fab-f42f\" => \"fab fa-korvue\",\n\t\t\t\"fab-f3bd\" => \"fab fa-laravel\",\n\t\t\t\"fab-f202\" => \"fab fa-lastfm\",\n\t\t\t\"fab-f203\" => \"fab fa-lastfm-square\",\n\t\t\t\"fab-f212\" => \"fab fa-leanpub\",\n\t\t\t\"fab-f41d\" => \"fab fa-less\",\n\t\t\t\"fab-f3c0\" => \"fab fa-line\",\n\t\t\t\"fab-f08c\" => \"fab fa-linkedin\",\n\t\t\t\"fab-f0e1\" => \"fab fa-linkedin-in\",\n\t\t\t\"fab-f2b8\" => \"fab fa-linode\",\n\t\t\t\"fab-f17c\" => \"fab fa-linux\",\n\t\t\t\"fab-f3c3\" => \"fab fa-lyft\",\n\t\t\t\"fab-f3c4\" => \"fab fa-magento\",\n\t\t\t\"fab-f59e\" => \"fab fa-mailchimp\",\n\t\t\t\"fab-f50f\" => \"fab fa-mandalorian\",\n\t\t\t\"fab-f60f\" => \"fab fa-markdown\",\n\t\t\t\"fab-f4f6\" => \"fab fa-mastodon\",\n\t\t\t\"fab-f136\" => \"fab fa-maxcdn\",\n\t\t\t\"fab-f8ca\" => \"fab fa-mdb\",\n\t\t\t\"fab-f3c6\" => \"fab fa-medapps\",\n\t\t\t\"fab-f23a\" => \"fab fa-medium\",\n\t\t\t\"fab-f3c7\" => \"fab fa-medium-m\",\n\t\t\t\"fab-f3c8\" => \"fab fa-medrt\",\n\t\t\t\"fab-f2e0\" => \"fab fa-meetup\",\n\t\t\t\"fab-f5a3\" => \"fab fa-megaport\",\n\t\t\t\"fab-f7b3\" => \"fab fa-mendeley\",\n\t\t\t\"fab-f91a\" => \"fab fa-microblog\",\n\t\t\t\"fab-f3ca\" => \"fab fa-microsoft\",\n\t\t\t\"fab-f3cb\" => \"fab fa-mix\",\n\t\t\t\"fab-f289\" => \"fab fa-mixcloud\",\n\t\t\t\"fab-f956\" => \"fab fa-mixer\",\n\t\t\t\"fab-f3cc\" => \"fab fa-mizuni\",\n\t\t\t\"fab-f285\" => \"fab fa-modx\",\n\t\t\t\"fab-f3d0\" => \"fab fa-monero\",\n\t\t\t\"fab-f3d2\" => \"fab fa-napster\",\n\t\t\t\"fab-f612\" => \"fab fa-neos\",\n\t\t\t\"fab-f5a8\" => \"fab fa-nimblr\",\n\t\t\t\"fab-f419\" => \"fab fa-node\",\n\t\t\t\"fab-f3d3\" => \"fab fa-node-js\",\n\t\t\t\"fab-f3d4\" => \"fab fa-npm\",\n\t\t\t\"fab-f3d5\" => \"fab fa-ns8\",\n\t\t\t\"fab-f3d6\" => \"fab fa-nutritionix\",\n\t\t\t\"fab-f263\" => \"fab fa-odnoklassniki\",\n\t\t\t\"fab-f264\" => \"fab fa-odnoklassniki-square\",\n\t\t\t\"fab-f510\" => \"fab fa-old-republic\",\n\t\t\t\"fab-f23d\" => \"fab fa-opencart\",\n\t\t\t\"fab-f19b\" => \"fab fa-openid\",\n\t\t\t\"fab-f26a\" => \"fab fa-opera\",\n\t\t\t\"fab-f23c\" => \"fab fa-optin-monster\",\n\t\t\t\"fab-f8d2\" => \"fab fa-orcid\",\n\t\t\t\"fab-f41a\" => \"fab fa-osi\",\n\t\t\t\"fab-f3d7\" => \"fab fa-page4\",\n\t\t\t\"fab-f18c\" => \"fab fa-pagelines\",\n\t\t\t\"fab-f3d8\" => \"fab fa-palfed\",\n\t\t\t\"fab-f3d9\" => \"fab fa-patreon\",\n\t\t\t\"fab-f1ed\" => \"fab fa-paypal\",\n\t\t\t\"fab-f704\" => \"fab fa-penny-arcade\",\n\t\t\t\"fab-f3da\" => \"fab fa-periscope\",\n\t\t\t\"fab-f3db\" => \"fab fa-phabricator\",\n\t\t\t\"fab-f3dc\" => \"fab fa-phoenix-framework\",\n\t\t\t\"fab-f511\" => \"fab fa-phoenix-squadron\",\n\t\t\t\"fab-f457\" => \"fab fa-php\",\n\t\t\t\"fab-f2ae\" => \"fab fa-pied-piper\",\n\t\t\t\"fab-f1a8\" => \"fab fa-pied-piper-alt\",\n\t\t\t\"fab-f4e5\" => \"fab fa-pied-piper-hat\",\n\t\t\t\"fab-f1a7\" => \"fab fa-pied-piper-pp\",\n\t\t\t\"fab-f91e\" => \"fab fa-pied-piper-square\",\n\t\t\t\"fab-f0d2\" => \"fab fa-pinterest\",\n\t\t\t\"fab-f231\" => \"fab fa-pinterest-p\",\n\t\t\t\"fab-f0d3\" => \"fab fa-pinterest-square\",\n\t\t\t\"fab-f3df\" => \"fab fa-playstation\",\n\t\t\t\"fab-f288\" => \"fab fa-product-hunt\",\n\t\t\t\"fab-f3e1\" => \"fab fa-pushed\",\n\t\t\t\"fab-f3e2\" => \"fab fa-python\",\n\t\t\t\"fab-f1d6\" => \"fab fa-qq\",\n\t\t\t\"fab-f459\" => \"fab fa-quinscape\",\n\t\t\t\"fab-f2c4\" => \"fab fa-quora\",\n\t\t\t\"fab-f4f7\" => \"fab fa-r-project\",\n\t\t\t\"fab-f7bb\" => \"fab fa-raspberry-pi\",\n\t\t\t\"fab-f2d9\" => \"fab fa-ravelry\",\n\t\t\t\"fab-f41b\" => \"fab fa-react\",\n\t\t\t\"fab-f75d\" => \"fab fa-reacteurope\",\n\t\t\t\"fab-f4d5\" => \"fab fa-readme\",\n\t\t\t\"fab-f1d0\" => \"fab fa-rebel\",\n\t\t\t\"fab-f3e3\" => \"fab fa-red-river\",\n\t\t\t\"fab-f1a1\" => \"fab fa-reddit\",\n\t\t\t\"fab-f281\" => \"fab fa-reddit-alien\",\n\t\t\t\"fab-f1a2\" => \"fab fa-reddit-square\",\n\t\t\t\"fab-f7bc\" => \"fab fa-redhat\",\n\t\t\t\"fab-f18b\" => \"fab fa-renren\",\n\t\t\t\"fab-f3e6\" => \"fab fa-replyd\",\n\t\t\t\"fab-f4f8\" => \"fab fa-researchgate\",\n\t\t\t\"fab-f3e7\" => \"fab fa-resolving\",\n\t\t\t\"fab-f5b2\" => \"fab fa-rev\",\n\t\t\t\"fab-f3e8\" => \"fab fa-rocketchat\",\n\t\t\t\"fab-f3e9\" => \"fab fa-rockrms\",\n\t\t\t\"fab-f267\" => \"fab fa-safari\",\n\t\t\t\"fab-f83b\" => \"fab fa-salesforce\",\n\t\t\t\"fab-f41e\" => \"fab fa-sass\",\n\t\t\t\"fab-f3ea\" => \"fab fa-schlix\",\n\t\t\t\"fab-f28a\" => \"fab fa-scribd\",\n\t\t\t\"fab-f3eb\" => \"fab fa-searchengin\",\n\t\t\t\"fab-f2da\" => \"fab fa-sellcast\",\n\t\t\t\"fab-f213\" => \"fab fa-sellsy\",\n\t\t\t\"fab-f3ec\" => \"fab fa-servicestack\",\n\t\t\t\"fab-f214\" => \"fab fa-shirtsinbulk\",\n\t\t\t\"fab-f957\" => \"fab fa-shopify\",\n\t\t\t\"fab-f5b5\" => \"fab fa-shopware\",\n\t\t\t\"fab-f215\" => \"fab fa-simplybuilt\",\n\t\t\t\"fab-f3ee\" => \"fab fa-sistrix\",\n\t\t\t\"fab-f512\" => \"fab fa-sith\",\n\t\t\t\"fab-f7c6\" => \"fab fa-sketch\",\n\t\t\t\"fab-f216\" => \"fab fa-skyatlas\",\n\t\t\t\"fab-f17e\" => \"fab fa-skype\",\n\t\t\t\"fab-f198\" => \"fab fa-slack\",\n\t\t\t\"fab-f3ef\" => \"fab fa-slack-hash\",\n\t\t\t\"fab-f1e7\" => \"fab fa-slideshare\",\n\t\t\t\"fab-f2ab\" => \"fab fa-snapchat\",\n\t\t\t\"fab-f2ac\" => \"fab fa-snapchat-ghost\",\n\t\t\t\"fab-f2ad\" => \"fab fa-snapchat-square\",\n\t\t\t\"fab-f1be\" => \"fab fa-soundcloud\",\n\t\t\t\"fab-f7d3\" => \"fab fa-sourcetree\",\n\t\t\t\"fab-f3f3\" => \"fab fa-speakap\",\n\t\t\t\"fab-f83c\" => \"fab fa-speaker-deck\",\n\t\t\t\"fab-f1bc\" => \"fab fa-spotify\",\n\t\t\t\"fab-f5be\" => \"fab fa-squarespace\",\n\t\t\t\"fab-f18d\" => \"fab fa-stack-exchange\",\n\t\t\t\"fab-f16c\" => \"fab fa-stack-overflow\",\n\t\t\t\"fab-f842\" => \"fab fa-stackpath\",\n\t\t\t\"fab-f3f5\" => \"fab fa-staylinked\",\n\t\t\t\"fab-f1b6\" => \"fab fa-steam\",\n\t\t\t\"fab-f1b7\" => \"fab fa-steam-square\",\n\t\t\t\"fab-f3f6\" => \"fab fa-steam-symbol\",\n\t\t\t\"fab-f3f7\" => \"fab fa-sticker-mule\",\n\t\t\t\"fab-f428\" => \"fab fa-strava\",\n\t\t\t\"fab-f429\" => \"fab fa-stripe\",\n\t\t\t\"fab-f42a\" => \"fab fa-stripe-s\",\n\t\t\t\"fab-f3f8\" => \"fab fa-studiovinari\",\n\t\t\t\"fab-f1a4\" => \"fab fa-stumbleupon\",\n\t\t\t\"fab-f1a3\" => \"fab fa-stumbleupon-circle\",\n\t\t\t\"fab-f2dd\" => \"fab fa-superpowers\",\n\t\t\t\"fab-f3f9\" => \"fab fa-supple\",\n\t\t\t\"fab-f7d6\" => \"fab fa-suse\",\n\t\t\t\"fab-f8e1\" => \"fab fa-swift\",\n\t\t\t\"fab-f83d\" => \"fab fa-symfony\",\n\t\t\t\"fab-f4f9\" => \"fab fa-teamspeak\",\n\t\t\t\"fab-f2c6\" => \"fab fa-telegram\",\n\t\t\t\"fab-f3fe\" => \"fab fa-telegram-plane\",\n\t\t\t\"fab-f1d5\" => \"fab fa-tencent-weibo\",\n\t\t\t\"fab-f69d\" => \"fab fa-the-red-yeti\",\n\t\t\t\"fab-f5c6\" => \"fab fa-themeco\",\n\t\t\t\"fab-f2b2\" => \"fab fa-themeisle\",\n\t\t\t\"fab-f731\" => \"fab fa-think-peaks\",\n\t\t\t\"fab-f513\" => \"fab fa-trade-federation\",\n\t\t\t\"fab-f181\" => \"fab fa-trello\",\n\t\t\t\"fab-f262\" => \"fab fa-tripadvisor\",\n\t\t\t\"fab-f173\" => \"fab fa-tumblr\",\n\t\t\t\"fab-f174\" => \"fab fa-tumblr-square\",\n\t\t\t\"fab-f1e8\" => \"fab fa-twitch\",\n\t\t\t\"fab-f099\" => \"fab fa-twitter\",\n\t\t\t\"fab-f081\" => \"fab fa-twitter-square\",\n\t\t\t\"fab-f42b\" => \"fab fa-typo3\",\n\t\t\t\"fab-f402\" => \"fab fa-uber\",\n\t\t\t\"fab-f7df\" => \"fab fa-ubuntu\",\n\t\t\t\"fab-f403\" => \"fab fa-uikit\",\n\t\t\t\"fab-f8e8\" => \"fab fa-umbraco\",\n\t\t\t\"fab-f404\" => \"fab fa-uniregistry\",\n\t\t\t\"fab-f949\" => \"fab fa-unity\",\n\t\t\t\"fab-f405\" => \"fab fa-untappd\",\n\t\t\t\"fab-f7e0\" => \"fab fa-ups\",\n\t\t\t\"fab-f287\" => \"fab fa-usb\",\n\t\t\t\"fab-f7e1\" => \"fab fa-usps\",\n\t\t\t\"fab-f407\" => \"fab fa-ussunnah\",\n\t\t\t\"fab-f408\" => \"fab fa-vaadin\",\n\t\t\t\"fab-f237\" => \"fab fa-viacoin\",\n\t\t\t\"fab-f2a9\" => \"fab fa-viadeo\",\n\t\t\t\"fab-f2aa\" => \"fab fa-viadeo-square\",\n\t\t\t\"fab-f409\" => \"fab fa-viber\",\n\t\t\t\"fab-f40a\" => \"fab fa-vimeo\",\n\t\t\t\"fab-f194\" => \"fab fa-vimeo-square\",\n\t\t\t\"fab-f27d\" => \"fab fa-vimeo-v\",\n\t\t\t\"fab-f1ca\" => \"fab fa-vine\",\n\t\t\t\"fab-f189\" => \"fab fa-vk\",\n\t\t\t\"fab-f40b\" => \"fab fa-vnv\",\n\t\t\t\"fab-f41f\" => \"fab fa-vuejs\",\n\t\t\t\"fab-f83f\" => \"fab fa-waze\",\n\t\t\t\"fab-f5cc\" => \"fab fa-weebly\",\n\t\t\t\"fab-f18a\" => \"fab fa-weibo\",\n\t\t\t\"fab-f1d7\" => \"fab fa-weixin\",\n\t\t\t\"fab-f232\" => \"fab fa-whatsapp\",\n\t\t\t\"fab-f40c\" => \"fab fa-whatsapp-square\",\n\t\t\t\"fab-f40d\" => \"fab fa-whmcs\",\n\t\t\t\"fab-f266\" => \"fab fa-wikipedia-w\",\n\t\t\t\"fab-f17a\" => \"fab fa-windows\",\n\t\t\t\"fab-f5cf\" => \"fab fa-wix\",\n\t\t\t\"fab-f730\" => \"fab fa-wizards-of-the-coast\",\n\t\t\t\"fab-f514\" => \"fab fa-wolf-pack-battalion\",\n\t\t\t\"fab-f19a\" => \"fab fa-wordpress\",\n\t\t\t\"fab-f411\" => \"fab fa-wordpress-simple\",\n\t\t\t\"fab-f297\" => \"fab fa-wpbeginner\",\n\t\t\t\"fab-f2de\" => \"fab fa-wpexplorer\",\n\t\t\t\"fab-f298\" => \"fab fa-wpforms\",\n\t\t\t\"fab-f3e4\" => \"fab fa-wpressr\",\n\t\t\t\"fab-f412\" => \"fab fa-xbox\",\n\t\t\t\"fab-f168\" => \"fab fa-xing\",\n\t\t\t\"fab-f169\" => \"fab fa-xing-square\",\n\t\t\t\"fab-f23b\" => \"fab fa-y-combinator\",\n\t\t\t\"fab-f19e\" => \"fab fa-yahoo\",\n\t\t\t\"fab-f840\" => \"fab fa-yammer\",\n\t\t\t\"fab-f413\" => \"fab fa-yandex\",\n\t\t\t\"fab-f414\" => \"fab fa-yandex-international\",\n\t\t\t\"fab-f7e3\" => \"fab fa-yarn\",\n\t\t\t\"fab-f1e9\" => \"fab fa-yelp\",\n\t\t\t\"fab-f2b1\" => \"fab fa-yoast\",\n\t\t\t\"fab-f167\" => \"fab fa-youtube\",\n\t\t\t\"fab-f431\" => \"fab fa-youtube-square\",\n\t\t\t\"fab-f63f\" => \"fab fa-zhihu\"\n\t\t);\n\n\t\t$icons = array_merge( $solid_icons, $regular_icons, $brand_icons );\n\n\t\t$icons = apply_filters( \"megamenu_fontawesome_5_icons\", $icons );\n\n\t\treturn $icons;\n\n\t}", "function get_screen_icon()\n {\n }", "function anva_social_icons() {\n\t$class = 'normal';\n\t$size = 24;\n\tprintf(\n\t\t'<ul class=\"social-media social-style-%2$s social-icon-%3$s\">%1$s</ul>',\n\t\tanva_social_media(),\n\t\tapply_filters( 'anva_social_media_style', $class ),\n\t\tapply_filters( 'anva_social_media_size', $size )\n\t);\n}", "public function get_icon() {\n\t\treturn 'fa fa-images';\n\t}", "public function getArticleListIcon();", "function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}", "function si_custom_elements_icon_map( $icon_map ) {\n\t\t$icon_map['si_custom_elements'] = EXTENSION_URL . '/assets/svg/icons.svg';\n\t\treturn $icon_map;\n\t}", "function widgets_icons($widgets){\n\t$widgets['SiteOrigin_Panels_Widgets_Layout']['icon'] = 'dashicons dashicons-analytics';\n\t$widgets['button']['icon'] = 'dashicons dashicons-admin-links';\n\t$widgets['SiteOrigin_Widget_GoogleMap_Widget']['icon'] = 'dashicons dashicons-location-alt';\n\treturn $widgets;\n}", "public function get_icon() {\n\t\treturn 'eicon-eye';\n\t}", "public static function getIcon(): string\n {\n }", "public static function getIcon(): string\n {\n }", "public function get_icon() {\n return 'eicon-heading apr-badge';\n }", "static function icon($icon) {\n\t\treturn self::tag('i', 'glyphicon glyphicon-' . $icon);\n\t}", "public function get_icon()\r\n {\r\n return 'eicon-posts-justified';\r\n }", "public static function iconsList()\n {\n $icons = [\n 'build',\n 'add_shopping_cart',\n 'settings_phone',\n 'assignment_turned_in',\n 'check_circle_outline',\n 'theaters',\n 'airplay',\n 'cached',\n 'calendar_today',\n 'check_circle',\n 'credit_card',\n 'dashboard',\n 'description',\n 'exit_to_app',\n 'extension',\n 'feedback',\n 'grade',\n 'group_work',\n 'help',\n 'help_outline',\n 'home',\n 'https',\n 'info',\n 'language',\n 'lock',\n 'open_in_browser',\n 'pageview',\n 'payment',\n 'perm_identity',\n 'record_voice_over',\n 'question_answer',\n 'redeem',\n 'restore_from_trash',\n 'shop',\n 'shopping_basket',\n 'shopping_cart',\n 'settings_voice',\n 'speaker_notes',\n 'stars',\n 'supervised_user_circle',\n 'system_update_alt',\n 'verified_user',\n 'add_alert',\n 'featured_play_list',\n 'queue',\n 'video_library',\n 'contact_mail',\n 'ring_volume',\n 'save',\n 'devices',\n 'widgets',\n 'insert_invitation',\n ];\n \n return $icons;\n }", "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "static function backend_icon($params)\n\t{\n\t\t$font = isset($params['args']['font']) ? $params['args']['font'] : key(AviaBuilder::$default_iconfont);\n\t\t$icon = !empty($params['args']['icon']) ? $params['args']['icon'] : \"new\";\n\t\t\n\t\t$display_char = self::get_display_char($icon, $font);\n\t\t\n\t\treturn array('display_char' => $display_char, 'font' => $font);\n\t}", "public function getIconAttribute(){\n\t\treturn false;\n\t}", "function icon() {\n global $CFG;\n\n return \"<img src='$CFG->wwwroot/blocks/ilp/pix/graphicon.jpg' height='24' width='24' />\";\n }", "public function get_icon()\n {\n return 'eicon-post-list';\n }", "public function icon() {\n\t\treturn 'column';\n\t}", "function sl_add_toolbar_site_icon() {\n\t\tif ( ! is_admin_bar_showing() ) {\n\t\t\treturn;\n\t\t}\n\t\techo '<style>\n\t\t\t#wp-admin-bar-site-name > a.ab-item:before {\n\t\t\t\tfloat: left;\n\t\t\t\twidth: 16px;\n\t\t\t\theight: 16px;\n\t\t\t\tmargin: 5px 5px 0 -1px;\n\t\t\t\tdisplay: block;\n\t\t\t\tcontent: \"\";\n\t\t\t\topacity: 0.4;\n\t\t\t\tbackground: #000 url(\"http://www.google.com/s2/u/0/favicons?domain=' . parse_url( home_url(), PHP_URL_HOST ). '\");\n\t\t\t\tborder-radius: 16px;\n\t\t\t}\n\t\t\t#wp-admin-bar-site-name:hover > a.ab-item:before {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t</style>';\n\t}", "public function getIcon() {\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n switch ($mime[0]) {\r\n case \"video\" : \r\n return [\r\n \"label\" => \"Video\",\r\n \"icon\" => '<i class=\"fa fa-file-video-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"image\" : \r\n return [\r\n \"label\" => \"Image\",\r\n \"icon\" => '<i class=\"fa fa-file-image-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n switch ($this->mime) {\r\n case \"application/msword\":\r\n case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":\r\n return [ \r\n \"label\" => \"Microsoft Word\",\r\n \"icon\" => '<i class=\"fa fa-file-word-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/vnd.ms-excel\":\r\n case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":\r\n return [ \r\n \"label\" => \"Microsoft Excel\",\r\n \"icon\" => '<i class=\"fa fa-file-excel-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/pdf\":\r\n case \"application/x-pdf\":\r\n return [ \r\n \"label\" => \"PDF\",\r\n \"icon\" => '<i class=\"fa fa-file-pdf-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n return [\r\n \"label\" => \"Unknown\",\r\n \"icon\" => '<i class=\"fa fa-file-o\"></i>'\r\n ];\r\n \r\n }", "function av_icon($icon, $font = false, $string = 'string')\n{\t\n\treturn avia_font_manager::frontend_icon($icon, $font, $string);\n}", "function icon_attr( $args ) {\n\n\t\t$attr = array(\n\t\t\t'class' => '',\n\t\t\t'style' => '',\n\t\t);\n\n\t\t$tooltip = ucfirst( $args['social_network'] );\n\t\tif ( 'custom_' === substr( $args['social_network'], 0, 7 ) ) {\n\t\t\t$attr['class'] .= 'custom ';\n\t\t\t$tooltip = str_replace( 'custom_', '', $args['social_network'] );\n\t\t\t$args['social_network'] = strtolower( $tooltip );\n\t\t}\n\n\t\t$attr['class'] .= 'fusion-social-network-icon fusion-tooltip fusion-' . $args['social_network'] . ' fusion-icon-' . $args['social_network'];\n\n\t\t$link = $args['social_link'];\n\n\t\t$attr['target'] = self::$args['linktarget'];\n\n\t\tif ( '_blank' == $attr['target'] ) {\n\t\t\t$attr['rel'] = 'noopener noreferrer';\n\t\t}\n\n\t\tif ( 'mail' === $args['social_network'] ) {\n\t\t\t$link = ( 'http' === substr( $args['social_link'], 0, 4 ) ) ? $args['social_link'] : 'mailto:' . antispambot( str_replace( 'mailto:', '', $args['social_link'] ) );\n\t\t\t$attr['target'] = '_self';\n\t\t}\n\n\t\t$attr['href'] = $link;\n\n\t\tif ( FusionBuilder::get_theme_option( 'nofollow_social_links' ) ) {\n\t\t\t$attr['rel'] = 'nofollow';\n\t\t}\n\n\t\tif ( $args['icon_color'] ) {\n\t\t\t$attr['style'] = 'color:' . $args['icon_color'] . ';';\n\t\t}\n\n\t\tif ( 'yes' == self::$args['icons_boxed'] && $args['box_color'] ) {\n\t\t\t$attr['style'] .= 'background-color:' . $args['box_color'] . ';border-color:' . $args['box_color'] . ';';\n\t\t}\n\n\t\tif ( 'yes' == self::$args['icons_boxed'] && self::$args['icons_boxed_radius'] || '0' === self::$args['icons_boxed_radius'] ) {\n\t\t\tif ( 'round' == self::$args['icons_boxed_radius'] ) {\n\t\t\t\tself::$args['icons_boxed_radius'] = '50%';\n\t\t\t}\n\t\t\t$attr['style'] .= 'border-radius:' . self::$args['icons_boxed_radius'] . ';';\n\t\t}\n\n\t\tif ( 'none' != strtolower( self::$args['tooltip_placement'] ) ) {\n\t\t\t$attr['data-placement'] = strtolower( self::$args['tooltip_placement'] );\n\t\t\tif ( 'Googleplus' == $tooltip ) {\n\t\t\t\t$tooltip = 'Google+';\n\t\t\t}\n\t\t\t$attr['data-title'] = $tooltip;\n\t\t\t$attr['data-toggle'] = 'tooltip';\n\t\t}\n\n\t\t$attr['title'] = $tooltip;\n\n\t\treturn $attr;\n\n\t}", "function format_icon($p_icon, $p_color = '', $p_space_right = '5px'){\n\treturn '<i class=\"ace-icon fa ' . $p_icon . ' ' . $p_color . '\"></i>' . format_hspace($p_space_right);\n}", "public function get_icon() {\n\t\treturn 'fa fa-pencil';\n\t}", "public function get_icon() {\n\t\treturn 'fa fa-pencil';\n\t}", "public function getIconReturnsReplacementIconWhenDeprecatedDataProvider() {}", "function icon($icons = null, $options = array()) {\n\t\t// At least one icon is needed\n\t\tif (empty($icons)) return false;\n\t\t// If one icon specified, we convert it to an array\n\t\tif (is_string($icons)) $icons = array($icons);\n\n\t\t// Default options\n\t\t$options = array_merge(array(\n\t\t\t'class' => ''\n\t\t), $options);\n\n\t\t// We get an array of classnames\n\t\t$class = array_values(array_filter(explode(' ', $options['class'])));\n\t\t// We add the icons\n\t\t$class[] = 'icon';\n\t\tforeach($icons as &$icon) {\n\t\t\t$class[] = 'icon'.ucfirst($icon);\n\t\t}\n\t\t$options['class'] = implode(' ', $class);\n\n\t\t// Returning a span with icon class added\n\t\treturn $this->Html->tag('span','', $options);\n\t}", "public function get_icon()\n {\n return 'eicon-nav-menu';\n }", "function kalatheme_icon_default_settings(){\n return array(\n 'tag' => 'span'\n );\n}", "protected function _buildListOfIcons()\n {\n $iconLoader = new \\Yana\\Views\\Icons\\Loader();\n return $iconLoader->getIcons();\n }", "function register_block_core_site_icon_setting()\n {\n }", "public function icon()\n {\n return $this->icon;\n }", "function thirdtheme_custom_icon()\n {\n add_theme_support('post-thumbnails');\n add_image_size('iconsize',55,45);\n $args = array(\n 'labels' => array('name' =>__('icon'),\n 'add_new' =>__('add new icon')),\n \n 'public' => true,\n 'menu_icon' => 'dashicons-art',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title','editor','thumbnail' )); \n register_post_type('icon',$args);\n }", "public function get_icon()\n {\n return 'fa fa-filter';\n }", "public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}", "public function getCategoryIcon();", "public function getOptions(): array\n {\n return ['icon' => 'far copy'];\n }", "protected function upload_icon()\n {\n $config = array();\n $config['upload_path'] = './upload';\n $config['allowed_types'] = 'ico';\n $config['max_size'] = '0';\n $config['overwrite'] = TRUE;\n $config['encrypt_name'] = TRUE;\n\n $this->load->library('upload', $config);\n $this->upload->do_upload('icon');\n $hasil = $this->upload->data();\n\n return $hasil;\n }", "public function get_icon() {\n\t\treturn parent::get_widget_icon( 'Team_Member' );\n\t}", "function av_backend_icon($params)\n{\n\treturn avia_font_manager::backend_icon($params);\n}", "function getFlagIcon ($aFlags, $icon_theme_path) {\n /**\n * 0 = unseen\n * 1 = seen\n * 2 = deleted\n * 3 = deleted seen\n * 4 = answered\n * 5 = answered seen\n * 6 = answered deleted\n * 7 = answered deleted seen\n * 8 = flagged\n * 9 = flagged seen\n * 10 = flagged deleted\n * 11 = flagged deleted seen\n * 12 = flagged answered\n * 13 = flagged aswered seen\n * 14 = flagged answered deleted\n * 15 = flagged anserwed deleted seen\n * ...\n * 32 = forwarded\n * 33 = forwarded seen\n * 34 = forwarded deleted\n * 35 = forwarded deleted seen\n * ...\n * 41 = flagged forwarded seen\n * 42 = flagged forwarded deleted\n * 43 = flagged forwarded deleted seen\n */\n\n /**\n * Use static vars to avoid initialisation of the array on each displayed row\n */\n global $nbsp;\n static $flag_icons, $flag_values;\n if (!isset($flag_icons)) {\n // This is by no means complete...\n $flag_icons = array ( \n // Image icon name Text Icon Alt/Title Text\n // --------------- --------- --------------\n array ('msg_new.png', $nbsp, '('._(\"New\").')') ,\n array ('msg_read.png', $nbsp, '('._(\"Read\").')'),\n // i18n: \"D\" is short for \"Deleted\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_deleted.png', _(\"D\"), '('._(\"Deleted\").')'),\n array ('msg_read_deleted.png', _(\"D\"), '('._(\"Deleted\").')'),\n // i18n: \"A\" is short for \"Answered\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_reply.png', _(\"A\"), '('._(\"Answered\").')'),\n array ('msg_read_reply.png', _(\"A\"), '('._(\"Answered\").')'),\n array ('msg_new_deleted_reply.png', _(\"D\"), '('._(\"Answered\").')'),\n array ('msg_read_deleted_reply.png', _(\"D\"), '('._(\"Answered\").')'),\n // i18n: \"F\" is short for \"Flagged\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n // i18n: \"O\" is short for \"Forwarded\". Make sure that two icon strings aren't translated to the same character (only in 1.5).\n array ('msg_new_forwarded.png', _(\"O\"), '('._(\"Forwarded\").')'),\n array ('msg_read_forwarded.png', _(\"O\"), '('._(\"Forwarded\").')'),\n array ('msg_new_deleted_forwarded.png', _(\"D\"), '('._(\"Forwarded\").')'),\n array ('msg_read_deleted_forwarded.png', _(\"D\"), '('._(\"Forwarded\").')'),\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n FALSE,\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n array ('flagged.png', _(\"F\"), '('._(\"Flagged\").')'),\n );\n \n $flag_values = array('seen' => 1,\n 'deleted' => 2,\n 'answered' => 4,\n 'flagged' => 8,\n 'draft' => 16,\n 'forwarded' => 32);\n }\n\n /**\n * The flags entry contain all items displayed in the flag column.\n */\n $icon = '';\n\n $index = 0;\n foreach ($aFlags as $flag => $flagvalue) {\n switch ($flag) {\n case 'deleted':\n case 'answered':\n case 'forwarded':\n case 'seen':\n case 'flagged': if ($flagvalue) $index += $flag_values[$flag]; break;\n default: break;\n }\n }\n \n if (!empty($flag_icons[$index])) {\n $data = $flag_icons[$index];\n } else {\n//FIXME: previously this default was set to the last value of the $flag_icons array (when it was index 15 - flagged anserwed deleted seen) but I don't understand why... am changing it to flagged (index 15 just shows (only) the flag icon anyway)\n $data = $flag_icons[8]; // default to just flagged\n }\n\n $icon = getIcon($icon_theme_path, $data[0], $data[1], $data[2]);\n return $icon;\n}", "public function getBsShowIcon($icon = null);", "private function setIcon(\\Scrivo\\Str $icon) {\n\t\t$this->icon = $icon;\n\t}", "public function get_icon() {\n\t\treturn 'eicon-product-images';\n\t}", "public function setIconName($iconName) {}", "public function setIconName($iconName) {}", "public function getIconTag() {\n\t\treturn '<img class=\"languageIcon jsTooltip\" src=\"' . $this->getIconPath() . '\" title=\"' . $this->getTitle() . '\" alt=\"' . $this->getTitle() . '\" />';\n\t}", "function news_icon() { ?>\n <style type=\"text/css\" media=\"screen\">\n #adminmenu .menu-icon-news div.wp-menu-image:before {\n content: \"\\f464\";\n }\n </style>\n <?php }", "public function setIconName($iconName) {}", "static public function get_social_icons() {\n\t\t$icons = array(\n\t\t\t'' => '',\n\t\t\t'im-icon-google-plus' => 'Google Plus',\n\t\t\t'im-icon-google-drive' => 'Google Drive',\n\t\t\t'im-icon-facebook' => 'Facebook',\n\t\t\t'im-icon-instagram' => 'Instagram',\n\t\t\t'fa-icon-instagram' => 'Instagram (2)',\n\t\t\t'im-icon-twitter' => 'Twitter',\n\t\t\t'im-icon-feed-2' => 'RSS',\n\t\t\t'im-icon-youtube' => 'Youtube',\n\t\t\t'im-icon-vimeo' => 'Vimeo',\n\t\t\t'im-icon-flickr' => 'Flickr',\n\t\t\t'im-icon-picassa' => 'Picassa',\n\t\t\t'im-icon-dribble' => 'Dribbble',\n\t\t\t'im-icon-deviantart-2' => 'Deviantart',\n\t\t\t'im-icon-forrst' => 'Forrst',\n\t\t\t'im-icon-steam' => 'Steam',\n\t\t\t'im-icon-github-3' => 'Github',\n\t\t\t'im-icon-wordpress' => 'Wordpress',\n\t\t\t'im-icon-joomla' => 'Joomla',\n\t\t\t'im-icon-blogger' => 'Blogger',\n\t\t\t'im-icon-tumblt' => 'Tumblt',\n\t\t\t'im-icon-yahoo' => 'Yahoo',\n\t\t\t'im-icon-skype' => 'Skype',\n\t\t\t'im-icon-reddit' => 'Reddit',\n\t\t\t'im-icon-linkedin' => 'Linkedin',\n\t\t\t'im-icon-lastfm' => 'Lastfm',\n\t\t\t'im-icon-delicious' => 'Delicious',\n\t\t\t'im-icon-stumbleupon' => 'Stumbleupon',\n\t\t\t'im-icon-stackoveratom' => 'Stackoveratom',\n\t\t\t'im-icon-pinterest-2' => 'Pinterest',\n\t\t\t'im-icon-xing' => 'Xing',\n\t\t\t'im-icon-flattr' => 'Flattr',\n\t\t\t'im-icon-foursquare-2' => 'Foursquare',\n\t\t\t'im-icon-yelp' => 'Yelp',\n\t\t\t'fa-icon-renren' => 'Renren',\n\t\t\t'fa-icon-vk' => 'Vk',\n\t\t\t'fa-icon-stackexchange' => 'Stackexchange',\n\t\t );\n\t\tasort( $icons );\n\t\treturn $icons;\n\t}", "public function getIcons()\n\t{\n\t\t$user = JFactory::getUser();\n\t\t// reset icon array\n\t\t$icons = array();\n\t\t// view groups array\n\t\t$viewGroups = array(\n\t\t\t'main' => array('png.question.add', 'png.questions', 'png.questions.catid', 'png.exams')\n\t\t);\n\t\t// view access array\n\t\t$viewAccess = array(\n\t\t\t'question.create' => 'question.create',\n\t\t\t'questions.access' => 'question.access',\n\t\t\t'question.access' => 'question.access',\n\t\t\t'questions.submenu' => 'question.submenu',\n\t\t\t'questions.dashboard_list' => 'question.dashboard_list',\n\t\t\t'question.dashboard_add' => 'question.dashboard_add',\n\t\t\t'exam.create' => 'exam.create',\n\t\t\t'exams.access' => 'exam.access',\n\t\t\t'exam.access' => 'exam.access',\n\t\t\t'exams.submenu' => 'exam.submenu',\n\t\t\t'exams.dashboard_list' => 'exam.dashboard_list',\n\t\t\t'questiontypes.access' => 'questiontype.access',\n\t\t\t'questiontype.access' => 'questiontype.access');\n\t\t// loop over the $views\n\t\tforeach($viewGroups as $group => $views)\n\t\t{\n\t\t\t$i = 0;\n\t\t\tif (JcpqmHelper::checkArray($views))\n\t\t\t{\n\t\t\t\tforeach($views as $view)\n\t\t\t\t{\n\t\t\t\t\t$add = false;\n\t\t\t\t\t// external views (links)\n\t\t\t\t\tif (strpos($view,'||') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$dwd = explode('||', $view);\n\t\t\t\t\t\tif (count($dwd) == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($type, $name, $url) = $dwd;\n\t\t\t\t\t\t\t$viewName \t= $name;\n\t\t\t\t\t\t\t$alt \t\t= $name;\n\t\t\t\t\t\t\t$url \t\t= $url;\n\t\t\t\t\t\t\t$image \t\t= $name.'.'.$type;\n\t\t\t\t\t\t\t$name \t\t= 'COM_JCPQM_DASHBOARD_'.JcpqmHelper::safeString($name,'U');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// internal views\n\t\t\t\t\telseif (strpos($view,'.') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$dwd = explode('.', $view);\n\t\t\t\t\t\tif (count($dwd) == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($type, $name, $action) = $dwd;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (count($dwd) == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($type, $name) = $dwd;\n\t\t\t\t\t\t\t$action = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$viewName = $name;\n\t\t\t\t\t\t\tswitch($action)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t\t\t\t$url \t= 'index.php?option=com_jcpqm&view='.$name.'&layout=edit';\n\t\t\t\t\t\t\t\t\t$image \t= $name.'_'.$action.'.'.$type;\n\t\t\t\t\t\t\t\t\t$alt \t= $name.'&nbsp;'.$action;\n\t\t\t\t\t\t\t\t\t$name\t= 'COM_JCPQM_DASHBOARD_'.JcpqmHelper::safeString($name,'U').'_ADD';\n\t\t\t\t\t\t\t\t\t$add\t= true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$url \t= 'index.php?option=com_categories&view=categories&extension=com_jcpqm.'.$name;\n\t\t\t\t\t\t\t\t\t$image \t= $name.'_'.$action.'.'.$type;\n\t\t\t\t\t\t\t\t\t$alt \t= $name.'&nbsp;'.$action;\n\t\t\t\t\t\t\t\t\t$name\t= 'COM_JCPQM_DASHBOARD_'.JcpqmHelper::safeString($name,'U').'_'.JcpqmHelper::safeString($action,'U');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$viewName \t= $name;\n\t\t\t\t\t\t\t$alt \t\t= $name;\n\t\t\t\t\t\t\t$url \t\t= 'index.php?option=com_jcpqm&view='.$name;\n\t\t\t\t\t\t\t$image \t\t= $name.'.'.$type;\n\t\t\t\t\t\t\t$name \t\t= 'COM_JCPQM_DASHBOARD_'.JcpqmHelper::safeString($name,'U');\n\t\t\t\t\t\t\t$hover\t\t= false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$viewName \t= $view;\n\t\t\t\t\t\t$alt \t\t= $view;\n\t\t\t\t\t\t$url \t\t= 'index.php?option=com_jcpqm&view='.$view;\n\t\t\t\t\t\t$image \t\t= $view.'.png';\n\t\t\t\t\t\t$name \t\t= ucwords($view).'<br /><br />';\n\t\t\t\t\t\t$hover\t\t= false;\n\t\t\t\t\t}\n\t\t\t\t\t// first make sure the view access is set\n\t\t\t\t\tif (JcpqmHelper::checkArray($viewAccess))\n\t\t\t\t\t{\n\t\t\t\t\t\t// setup some defaults\n\t\t\t\t\t\t$dashboard_add = false;\n\t\t\t\t\t\t$dashboard_list = false;\n\t\t\t\t\t\t$accessTo = '';\n\t\t\t\t\t\t$accessAdd = '';\n\t\t\t\t\t\t// acces checking start\n\t\t\t\t\t\t$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? JcpqmHelper::checkString($viewAccess[$viewName.'.create']):false;\n\t\t\t\t\t\t$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? JcpqmHelper::checkString($viewAccess[$viewName.'.access']):false;\n\t\t\t\t\t\t// set main controllers\n\t\t\t\t\t\t$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? JcpqmHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;\n\t\t\t\t\t\t$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? JcpqmHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;\n\t\t\t\t\t\t// check for adding access\n\t\t\t\t\t\tif ($add && $accessCreate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessAdd = $viewAccess[$viewName.'.create'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($add)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessAdd = 'core.create';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// check if acces to view is set\n\t\t\t\t\t\tif ($accessAccess)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessTo = $viewAccess[$viewName.'.access'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// set main access controllers\n\t\t\t\t\t\tif ($accessDashboard_add)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dashboard_add\t= $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_jcpqm');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($accessDashboard_list)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_jcpqm');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (JcpqmHelper::checkString($accessAdd) && JcpqmHelper::checkString($accessTo))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// check access\n\t\t\t\t\t\t\tif($user->authorise($accessAdd, 'com_jcpqm') && $user->authorise($accessTo, 'com_jcpqm') && $dashboard_add)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$icons[$group][$i]\t\t\t= new StdClass;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->url \t= $url;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->name \t= $name;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->image \t= $image;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->alt \t= $alt;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (JcpqmHelper::checkString($accessTo))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// check access\n\t\t\t\t\t\t\tif($user->authorise($accessTo, 'com_jcpqm') && $dashboard_list)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$icons[$group][$i]\t\t\t= new StdClass;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->url \t= $url;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->name \t= $name;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->image \t= $image;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->alt \t= $alt;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (JcpqmHelper::checkString($accessAdd))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// check access\n\t\t\t\t\t\t\tif($user->authorise($accessAdd, 'com_jcpqm') && $dashboard_add)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$icons[$group][$i]\t\t\t= new StdClass;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->url \t= $url;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->name \t= $name;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->image \t= $image;\n\t\t\t\t\t\t\t\t$icons[$group][$i]->alt \t= $alt;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$icons[$group][$i]\t\t\t= new StdClass;\n\t\t\t\t\t\t\t$icons[$group][$i]->url \t= $url;\n\t\t\t\t\t\t\t$icons[$group][$i]->name \t= $name;\n\t\t\t\t\t\t\t$icons[$group][$i]->image \t= $image;\n\t\t\t\t\t\t\t$icons[$group][$i]->alt \t= $alt;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$icons[$group][$i]\t\t\t= new StdClass;\n\t\t\t\t\t\t$icons[$group][$i]->url \t= $url;\n\t\t\t\t\t\t$icons[$group][$i]->name \t= $name;\n\t\t\t\t\t\t$icons[$group][$i]->image \t= $image;\n\t\t\t\t\t\t$icons[$group][$i]->alt \t= $alt;\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$icons[$group][$i] = false;\n\t\t\t}\n\t\t}\n\t\treturn $icons;\n\t}", "function i($code){\n $icon = '<i class=\"fa fa-'.$code.'\"></i>';\n return $icon;\n }", "function loadIcon16($name) {\n echo \"<img src=\\\"icos/16-$name.png\\\" alt=\\\"\\\" width=\\\"16\\\" height=\\\"16\\\">\";\n }", "public function get_menu_icon() {\n\t\treturn 'gform-icon--akismet';\n\t}", "public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}", "function av_icon_display($char, $extra_class = \"\")\n{\n\treturn \"<span class='av-icon-display {$extra_class}' \".av_icon_string($char).\"></span>\";\n}", "public function getAvailableIconNames() {}", "function bethel_add_favicons() {\n\techo \"<link rel=\\\"shortcut icon\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon.ico\\\">\\r\\n\";\n\techo \"<link rel=\\\"icon\\\" sizes=\\\"16x16 32x32 64x64\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon.ico\\\">\\r\\n\";\n\t$sizes = array(196, 160, 96, 64, 32, 16);\n\tforeach ($sizes as $size) {\n\t\techo \"<link rel=\\\"icon\\\" type=\\\"image/png\\\" sizes=\\\"{$size}x{$size}\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-{$size}.png\\\">\\r\\n\";\n\t}\n\t//iOS images can't have alpha transparency\n\t$sizes = array (152,144,120,114,76,72);\n\tforeach ($sizes as $size) {\n\t\techo \"<link rel=\\\"apple-touch-icon\\\" sizes=\\\"{$size}x{$size}\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-{$size}.png\\\">\\r\\n\";\n\t}\n\techo \"<link rel=\\\"apple-touch-icon\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-57.png\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-TileColor\\\" content=\\\"#FFFFFF\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-TileImage\\\" content=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-144.png\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-config\\\" content=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/browserconfig.xml\\\">\\r\\n\";\n}" ]
[ "0.7472167", "0.74444675", "0.7257829", "0.72403437", "0.71190715", "0.7048382", "0.6972984", "0.68884623", "0.68734443", "0.68614495", "0.6833256", "0.68062073", "0.6801765", "0.6796616", "0.6733455", "0.6706965", "0.6702005", "0.6702005", "0.66998637", "0.6692421", "0.66874695", "0.6647722", "0.6647722", "0.6647722", "0.6617844", "0.6607688", "0.65929693", "0.6587282", "0.6583549", "0.65554327", "0.6549945", "0.6518177", "0.64635086", "0.64427483", "0.6441267", "0.6441267", "0.6436928", "0.6434925", "0.6402153", "0.63946855", "0.63935035", "0.6387988", "0.63834256", "0.6382386", "0.6378359", "0.6351937", "0.6343053", "0.6343053", "0.6322505", "0.62982696", "0.62661624", "0.62650186", "0.62555206", "0.62555206", "0.6255115", "0.6255115", "0.62543046", "0.62490726", "0.62488234", "0.624168", "0.62328196", "0.62279516", "0.6226886", "0.62224305", "0.6220324", "0.6206238", "0.6203222", "0.6203222", "0.62025803", "0.6192374", "0.6190589", "0.61798644", "0.61750656", "0.6172229", "0.6165339", "0.6159411", "0.6148296", "0.614462", "0.6137204", "0.6136995", "0.61223334", "0.6121469", "0.6117956", "0.608921", "0.6082367", "0.60813624", "0.6079631", "0.60684824", "0.60684824", "0.6068228", "0.60650706", "0.60642505", "0.60634243", "0.6053936", "0.60458416", "0.6045741", "0.6043412", "0.60399485", "0.6038442", "0.60343385", "0.6032762" ]
0.0
-1
Create a new database manager instance.
public function __construct(ViewFinderInterface $finder) { $this->finder = $finder; $this->finder->addExtension('array.php'); $this->finder->addExtension('helper.php'); $this->factory = new Factory($this->finder->getPaths(), $this->finder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateMemoryDB()\n {\n $dbManager = new DbManager([\n 'driver' => [\n 'name' => 'sqlite',\n 'arguments' => [\n ['location' => SQLite::LOCATION_MEMORY]\n ]\n ]\n ]);\n\n $this->assertInstanceOf(DbManager::class, $dbManager);\n\n return $dbManager;\n }", "public static function createDatabaseInstance()\n {\n if (class_exists('TYPO3\\\\CMS\\\\Core\\\\Database\\\\ConnectionPool')) {\n $connection = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\ConnectionPool')\n ->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);\n\n return new Database($connection);\n }\n\n return new OldDatabase($GLOBALS['TYPO3_DB']);\n }", "public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }", "static public function get_db_object()\n {\n return new Database(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n }", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}", "private function getDatabaseManager()\n {\n $file = require __DIR__ . '/../../src/settings.php';\n $dbSettings = $file['settings']['db'];\n\n $capsule = new \\Illuminate\\Database\\Capsule\\Manager;\n $capsule->addConnection($dbSettings);\n $capsule->setAsGlobal();\n $capsule->bootEloquent();\n return $capsule->getDatabaseManager();\n }", "public function __construct(Manager $manager)\n {\n $this->db = $manager;\n }", "protected function _initDatabaseManager()\n {\n // implement in application. Get DatabaseManager\n }", "function createDb()\r\n {\r\n// $db = new Mysqli();\r\n $db = Mysqli::getInstance();\r\n return $db;\r\n }", "public static function makeConnection()\n {\n self::$connectionManager = new ConnectionManager();\n self::$connectionManager->addConnection([\n 'host' => self::$config['host'],\n 'user' => self::$config['user'],\n 'password' => self::$config['password'],\n 'dbname' => self::$config['dbname']\n ]);\n self::$connectionManager->bootModel();\n }", "public static function init()\n {\n $connection = new Connection(\"mysql:host={$_ENV['DB_HOST']};dbname={$_ENV['DB_NAME']}\", $_ENV['DB_USER'], $_ENV['DB_PASS']);\n return new Database($connection);\n }", "public function createDatabase($database);", "public static function createInstance($config) {\n\t\tif(self::$instance != null)\n\t\t\tthrow new Exception(\"cannot create instance, because it already exists one.\");\n\n\t\tself::$instance = new Database($config);\n\t\treturn self::$instance;\n }", "private function createDatabase()\n {\n // get entity manager\n $em = $this->modelManager;\n\n // get our schema tool\n $tool = new SchemaTool( $em );\n\n // ...\n $classes = array_map(\n function( $model ) use ( $em ) {\n return $em->getClassMetadata( $model );\n },\n $this->models\n );\n\n // remove them\n $tool->createSchema( $classes );\n }", "public static function create()\n {\n $isDevMode = true;\n $proxyDir = null;\n $cache = null;\n $useSimpleAnnotationReader = false;\n $config = Setup::createAnnotationMetadataConfiguration([__DIR__ . \"/../\"], $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);\n // or if you prefer yaml or XML\n //$config = Setup::createXMLMetadataConfiguration(array(__DIR__.\"/config/xml\"), $isDevMode);\n //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__.\"/config/yaml\"), $isDevMode);\n\n // database configuration parameters\n $conn = require __DIR__.'/../../config/doctrine.php';\n\n // obtaining the entity manager\n $entityManager = EntityManager::create($conn, $config);\n\n return $entityManager;\n }", "function &dbm()\n{\n\treturn dbManager::get_instance();\n}", "public static function create(array $config)\n {\n if (!isset($config['name']) || !isset($config['user']) || !isset($config['pass']))\n throw new \\Exception('[name] and [user] and [pass] is required for Eloquent.');\n\n $capsule = new Manager;\n $capsule->addConnection(array(\n 'driver' => isset($config['driver']) ? $config['driver'] : 'mysql',\n 'host' => isset($config['host']) ? $config['host'] : 'localhost',\n 'database' => $config['name'],\n 'username' => $config['user'],\n 'password' => $config['pass'],\n 'charset' => isset($config['charset']) ? $config['charset'] : 'utf8',\n 'collation' => isset($config['collation']) ? $config['collation'] : 'utf8_general_ci'\n ));\n\n return $capsule;\n }", "protected function createDatabaseConnection()\r\n\t{\r\n\t\t$this->dbConnectionPool = new \\Bitrix\\Main\\Db\\DbConnectionPool();\r\n\t}", "public function createDatabase(string $databaseIdentifier, $options = []): DatabaseInterface\n {\n GeneralUtility::assertDatabaseIdentifier($databaseIdentifier);\n if ($this->databaseExists($databaseIdentifier)) {\n throw new InvalidDatabaseException(\n sprintf('Database \"%s\" already exists', $databaseIdentifier),\n 1412524749\n );\n }\n if (Manager::hasObject($databaseIdentifier)) {\n throw new InvalidDatabaseException(\n sprintf('Database \"%s\" already exists in memory', $databaseIdentifier),\n 1412524750\n );\n }\n\n $this->dataWriter->createDatabase($databaseIdentifier, $options);\n\n $newDatabase = new Database($databaseIdentifier);\n Manager::registerObject($newDatabase, $databaseIdentifier, [self::MEMORY_MANAGER_TAG]);\n $this->allDatabaseIdentifiers[$databaseIdentifier] = $databaseIdentifier;\n $this->logger->info(sprintf('Create database \"%s\"', $databaseIdentifier));\n $this->eventEmitter->emit(Event::DATABASE_CREATED, [$databaseIdentifier]);\n\n return $newDatabase;\n }", "protected function createDatabase()\n {\n\n $databaseFileName = strtolower(str::plural($this->moduleName));\n\n // Create Schema only in monogo database\n $databaseDriver = config('database.default');\n if ($databaseDriver == 'mongodb') {\n $this->createSchema($databaseFileName);\n }\n }", "protected function _setupDb()\n {\n // First, delete the DB if it exists\n $this->_teardownDb();\n \n // Then, set up a clean new DB and return it\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n return Sopha_Db::createDb($db, $host, $port);\n }", "public function createDatabase($name, $options);", "public static function connect(array $options = []): Manager\n {\n global $wpdb;\n\n $defaults = [\n 'driver' => 'mysql',\n 'prefix' => $wpdb->prefix,\n 'host' => DB_HOST,\n 'database' => DB_NAME,\n 'username' => DB_USER,\n 'password' => DB_PASSWORD,\n 'port' => '3306',\n 'charset' => 'utf8',\n 'collation' => 'utf8_unicode_ci',\n ];\n\n $instance = self::getInstance();\n $instance->addConnection(array_merge($defaults, $options));\n $instance->bootEloquent();\n\n return $instance;\n }", "private function create()\n {\n if ($this->isRequired()) {\n $db = Database::getDatabaseConnection();\n $db->exec($this->getDropQuery());\n $db->exec($this->getCreateQuery());\n $this->populate($db);\n }\n }", "private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "static public function getDatabase() {\n if (self::$_instance == NULL)\n self::$_instance = new Database();\n return self::$_instance;\n }", "static public function getDatabase() {\n if (self::$_instance == NULL)\n self::$_instance = new Database();\n return self::$_instance;\n }", "public function new_db($name)\n\t\t{\tif (! isset($this->link))\n\t\t\t\t$this->connect();\n\n\t\t\t$query = \"CREATE DATABASE IF NOT EXISTS \" . $name;\n\n\t\t\ttry\n\t\t\t{\tif (mysql_query($query, $this->link))\n\t\t\t\t\tthrow new Exception(\"Cannot create database \" . $name);\n\n\t\t\t\t$this->db = $name;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\techo $e->getMessage() . \"<br/>\";\n\t\t\t\techo mysql_error();\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "function createDatabase() {\n try {\n $pdoObject = new PDOObject();\n $pdoObject->createTables();\n $pdo = $pdoObject->getPDO();\n\n openFile($pdo);\n } catch (PDOException $e) {\n $e->getMessage();\n exit;\n } finally {\n unset($pdo);\n }\n}", "public static function getDatabaseManager($reset = false)\n {\n if ($reset) {\n self::reset();\n }\n if (empty(self::$dbm)) {\n $dbConfig = SugarConfig::getDatabaseConfiguration();\n $dbmClassName = $dbConfig['dbManagerClassName'];\n $dbmClassPath = $dbConfig['dbManagerClassPath'];\n $dbmFileName = \"{$dbmClassPath}/{$dbmClassName}.php\";\n if (file_exists($dbmFileName)) {\n include_once($dbmFileName);\n }\n self::$dbm = SugarClassLoader::getInstance($dbmClassName);\n self::$dbm->dbConfig = $dbConfig;\n self::$dbm->connect();\n }\n return self::$dbm;\n }", "public function createDatabase($name) {\n\t\t$this->_connection->createDatabase($name);\n\t}", "protected function createDatabaseStructure() {}", "public function createDatabase($name, $options = []);", "public function createDatabase()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n $tool = new \\Doctrine\\ORM\\Tools\\SchemaTool($em);\n\n $classes = [\n $em->getClassMetadata('Shopware\\CustomModels\\CustomSort\\ArticleSort'),\n ];\n\n try {\n $tool->createSchema($classes);\n } catch (\\Doctrine\\ORM\\Tools\\ToolsException $e) {\n //\n }\n }", "public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }", "public function db(){\n\treturn Manager::getManager($this);\n }", "public function runDatabase():Create {\n\n # Get database from inputs\n $database = Arrays::filterByKey($this->inputs['application'], \"name\", \"database\");\n\n # Get database values\n $databaseValues = $database[array_key_first($database)]['value'] ?? [];\n\n # Check database values\n if(!empty($databaseValues))\n\n # Iteration of values\n foreach($databaseValues as $value)\n\n # Push setup in config of database\n Database::setupConfig($value);\n\n /* Vendor for Mongo DB */\n\n # Check if mongo set in current app\n if(in_array('mongodb', $databaseValues)){\n\n Composer::requirePackage(\"mongodb/mongodb\", true, false);\n\n }\n \n # Return instance\n return $this;\n\n }", "private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}", "static function getDatabase() {\n if (!self::$db) {\n self::$db = new Database();\n }\n return self::$db;\n }", "protected function initDatabase()\n {\n $this->di->setShared('db', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config')->get('database')->toArray();\n $em = $this->getShared('eventsManager');\n $that = $this;\n\n $adapter = '\\Phalcon\\Db\\Adapter\\Pdo\\\\' . $config['adapter'];\n unset($config['adapter']);\n\n /** @var \\Phalcon\\Db\\Adapter\\Pdo $connection */\n $connection = new $adapter($config);\n\n // Listen all the database events\n $em->attach(\n 'db',\n function ($event, $connection) use ($that) {\n /**\n * @var \\Phalcon\\Events\\Event $event\n * @var \\Phalcon\\Db\\AdapterInterface $connection\n * @var DiInterface $that\n */\n if ($event->getType() == 'beforeQuery') {\n $variables = $connection->getSQLVariables();\n $string = $connection->getSQLStatement();\n\n if ($variables) {\n $string .= ' [' . join(',', $variables) . ']';\n }\n\n // To disable logging change logLevel in config\n $that->get('logger', ['db'])->debug($string);\n }\n }\n );\n\n // Assign the eventsManager to the db adapter instance\n $connection->setEventsManager($em);\n\n return $connection;\n });\n\n $this->di->setShared('modelsManager', function () {\n /** @var DiInterface $this */\n $em = $this->getShared('eventsManager');\n\n $modelsManager = new ModelsManager;\n $modelsManager->setEventsManager($em);\n\n return $modelsManager;\n });\n\n $this->di->setShared('modelsMetadata', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $config = $config->get('metadata')->toArray();\n $adapter = '\\Phalcon\\Mvc\\Model\\Metadata\\\\' . $config['adapter'];\n unset($config['adapter']);\n\n $metaData = new $adapter($config);\n\n return $metaData;\n });\n }", "public static function Instance()\n {\n static $database = null;\n if ($database === null) {\n $database = new Database();\n }\n return $database;\n }", "public function createDatabase($name, array $opts = null);", "public static function create(Database $database) {\n return new static($database);\n }", "private static function createEntityManager() {\n $isDevMode = true;\n $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . \"/src/entities\"), $isDevMode, null, null, false);\n // or if you prefer yaml or XML\n //$config = Setup::createXMLMetadataConfiguration(array(__DIR__.\"/config/xml\"), $isDevMode);\n //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__.\"/config/yaml\"), $isDevMode);\n\n // database configuration parameters\n $conn = array(\n 'driver' => 'pdo_mysql',\n 'host' => 'localhost',\n 'dbname' => 'mydb',\n 'user' => 'root',\n 'password' => 'root',\n 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',\n 'server_version' => '5.6.38',\n );\n\n // obtaining the entity manager\n self::$entityManager = EntityManager::create($conn, $config);\n }", "private function openDb() {\n if(!$this->db) {\n $this->db = new Db();\n }\n }", "public static function getInstance()\n {\n if (!isset(self::$INSTANCE)) {\n self::$INSTANCE = new Database;\n }\n\n return self::$INSTANCE;\n }", "public function __construct(DatabaseManager $manager)\n {\n $this->manager = $manager;\n $this->connection = $manager->connection();\n $this->schemaManager = $this->connection->getDoctrineSchemaManager();\n\n\n }", "public function getDatabase()\n\t{\n\t\tif (is_null($this->database))\n\t\t{\n\t\t\t$this->database = DatabaseDriver::getInstance(\n\t\t\t\tarray(\n\t\t\t\t\t'driver' => $this->config->get('dbtype'),\n\t\t\t\t\t'host' => $this->config->get('host'),\n\t\t\t\t\t'user' => $this->config->get('user'),\n\t\t\t\t\t'password' => $this->config->get('password'),\n\t\t\t\t\t'database' => $this->config->get('db'),\n\t\t\t\t\t'prefix' => $this->config->get('dbprefix')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// @todo Decouple from Factory\n\t\t\tFactory::$database = $this->database;\n\t\t}\n\n\t\treturn $this->database;\n\t}", "public function __construct(DatabaseManager $databaseManager)\n {\n $this->databaseManager = $databaseManager;\n\n }", "public function create($name, $repo = null, $cache = null, $filters = array(), $manager = null)\n {\n $name = '\\\\TEST\\\\Models\\\\Managers\\\\' . $name;\n\n if (is_null($repo)) {\n $repo = $this->db;\n }\n\n if (is_null($cache)) {\n $cache = $this->cache;\n }\n\n return new $name($repo, $cache, $this, $filters, $manager);\n }", "private function checkDatabaseManager()\r\n {\r\n // check if DatabaseManager is instanciated\r\n if($this->_DatabaseHandler === null)\r\n {\r\n $this->_DatabaseHandler = new \\mysqli($this->_Hostname, $this->_Username, $this->_Password, $this->_DatabaseName);\r\n // check for errors\r\n if ($this->_DatabaseHandler->connect_errno)\r\n {\r\n // get the error code and message\r\n $errorCode = $this->_DatabaseHandler->connect_errno;\r\n $errorMessage = $this->_DatabaseHandler->connect_error;\r\n // set the database handler object to null\r\n $this->_DatabaseHandler = null;\r\n // throw the exception\r\n throw new \\Mangetsu\\Library\\Database\\DatabaseException(\"Could not connect to database!\", $errorCode, $errorMessage);\r\n }\r\n // set autocommit to on\r\n $this->_DatabaseHandler->autocommit(TRUE);\r\n }\r\n }", "private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }", "public function createEntityManager()\n {\n $devMode = false;\n $cache = $devMode ? new ArrayCache() : null;\n $cache = new ArrayCache();\n\n $configuration = Setup::createConfiguration($devMode, Path::getInstance()->getCachePath(__NAMESPACE__), $cache);\n\n $configuration->setMetadataDriverImpl($this->mappingDriver);\n $configuration->setNamingStrategy(new ChamiloNamingStrategy());\n\n $entityManager = EntityManager::create($this->doctrineConnection, $configuration);\n\n foreach ($this->eventListeners as $eventListener)\n {\n $entityManager->getEventManager()->addEventListener($eventListener['events'], $eventListener['listener']);\n }\n\n return $entityManager;\n }", "function DB_manager (){\n //parse configuration file\n $ini_array = parse_ini_file($this->configuration_file_path);\n $db_host = $ini_array['db_host'];\n $db_name = $ini_array['db_name'];\n $db_user = $ini_array['db_user'];\n $db_password = $ini_array['db_password'];\n\n //make a connection\n $mysqli = new mysqli($db_host, $db_user , $db_password, $db_name);\n if (mysqli_connect_errno()) {\n printf(\"Connect failed: %s\\n\", mysqli_connect_error());\n exit();\n }\n\n $this->db = $mysqli;\n }", "public static function getInstance()\n {\n // If an instance doesn't exist create one, else return it\n if (!self::$db_instance) {\n self::$db_instance = new Database();\n }\n return self::$db_instance;\n }", "public function __construct( \\Aimeos\\MW\\DB\\Manager\\Iface $dbm, $rname, $dbname, $name );", "public static function Create( ) {\n\t\t\t$iConfig = Config::LoadConfig( );\n\t\t\t$iMySQLConnection = new DataBase( $iConfig->database_host, $iConfig->database_user, $iConfig->database_pass, $iConfig->database_name, $iConfig->database_port );\n\t\t\treturn $iMySQLConnection;\n\t\t}", "public static function getInstance(): Database\n {\n // S'il n'existe pas encore d'instance de Database en mémoire, en crée une\n if (!isset(self::$instance)) {\n self::$instance = new Database();\n }\n\n // Renvoyer l'unique instance de Database en mémoire\n return self::$instance;\n }", "protected static function setupDb()\n\t{\n\t\tif (is_object(self::$db)) {\n\t\t\treturn self::$db;\n\t\t}\n\n\t\t$config = Config::getInstance();\n\t\t$driver = $config->getDatabaseDriver();\n\t\t$host = $config->getDatabaseHostname();\n\t\t$user = $config->getDatabaseUsername();\n\t\t$pass = $config->getDatabasePassword();\n\t\t$dbname = $config->getDatabaseName();\n\t\t$file = $config->getDatabaseFile();\n\n\t\ttry {\n\t\t\tswitch ($driver) {\n\t\t\t\tcase 'sqlite':\n\t\t\t\t\tself::$db = new PDO('sqlite:'.$file);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tcase 'mysql':\n\t\t\t\t\tself::$db = new PDO($driver.':dbname='.$dbname.';host='.$host,\n\t\t\t\t\t $user, $pass,array(PDO::ATTR_PERSISTENT => true));\n\t\t\t}\n\t\t\tself::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\tthrow new Exception(\"Kunde inte etablera anslutning till databasen. (\".\n\t\t\t $e->getMessage().')');\n\t\t}\n\t}", "public function __construct(DatabaseManager $databaseManager)\n {\n $this->databaseManager = $databaseManager;\n }", "protected function getDatabase()\r\n\t{\r\n\t\tif (!$this->registry->has('database'))\r\n\t\t{\r\n\t\t\tif (!$this->config->app->has('database'))\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('Failed to find config for database connection');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$connData = new \\System\\Core\\Database\\ConnectionData();\r\n\t\t\t$connData->username = $this->config->app->database->username;\r\n\t\t\t$connData->password = $this->config->app->database->password;\r\n\t\t\t$connData->database = $this->config->app->database->name;\r\n\t\t\t\r\n\t\t\t$this->registry->database = new Database($connData);\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->registry->database;\r\n\t}", "public static function instance()\n {\n static $instance = null;\n if($instance === null) $instance = new Database();\n return $instance;\n }", "public function conn(): DB\n {\n return new DB();\n }", "public static function get_instance()\n {\n if (! is_null(self::$db)) {\n return self::$db;\n }\n self::$db = new DB();\n return self::$db;\n }", "public function create_db($dbname) {\n $this->dbname = $dbname;\n try {\n $sql = \"CREATE DATABASE \" . $this->dbname;\n $resulr = $this->conn->exec($sql);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n\n }", "protected function getDB() {\n\t\tif ( is_null( $this->mDb ) ) {\n\t\t\tglobal $wgMetricsDBserver, $wgMetricsDBname, $wgMetricsDBuser,\n\t\t\t\t$wgMetricsDBpassword, $wgMetricsDBtype, $wgMetricsDBprefix,\n\t\t\t\t$wgDebugDumpSql;\n\t\t\t$this->mDb = DatabaseBase::factory( $wgMetricsDBtype,\n\t\t\t\tarray(\n\t\t\t\t\t'host' => $wgMetricsDBserver,\n\t\t\t\t\t'user' => $wgMetricsDBuser,\n\t\t\t\t\t'password' => $wgMetricsDBpassword,\n\t\t\t\t\t'dbname' => $wgMetricsDBname,\n\t\t\t\t\t'tablePrefix' => $wgMetricsDBprefix,\n\t\t\t\t\t'flags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,\n\t\t\t\t)\n\t\t\t);\n\t\t\t//$this->mDb->query( \"SET names utf8\" );\n\t\t}\n\t\treturn $this->mDb;\n\t}", "protected static function getDatabaseConnection() : Database\n {\n static $db = null;\n \n if ($db === null)\n {\n $db = new Database(Config::DB_HOST, Config::DB_USER, Config::DB_PASSWORD, Config::DB_NAME, Config::DB_CHARSET);\n }\n\n return $db;\n }", "public function __construct()\n {\n $options = [\n //required\n 'username' => 'root',\n 'database' => 'mvc_porject',\n //optional\n 'password' => '',\n 'type' => 'mysql',\n 'charset' => 'utf8',\n 'host' => 'localhost',\n 'port' => '3306'\n ];\n $this->db = new Database($options);\n }", "public function dbInstance();", "public static function getInstance()\n {\n if(!isset(self::$instance))\n {\n self::$instance = new Database();\n }\n return self::$instance;\n }", "public static function getInstance() {\n if(!isset(self::$instance)) {\n self::$instance = new Database();\n }\n return self::$instance;\n }", "public function __construct() {\n $this->dbName = new DataBase($this->db);\n }", "public static function getInstance()\n {\n if(!isset(self::$_dbObjectInstance))\n {\n $className = get_class();\n self::$_dbObjectInstance = new $className;\n }\n\n return self::$_dbObjectInstance;\n }", "public static function connect()\n\t\t{\n\t\t\tif(is_null(self::$instance))\n\t\t\t{\n\t\t\t\tself::$instance = new db;\n\t\t\t}\n\t\t\treturn self::$instance;\n\t\t}", "function new_db( $name )\n\t{\n\t $sql = \"CREATE DATABASE \" . $name;\n\t\tif ( $this->checkup( \"\", $sql ) != true ) {\n\t\t\treturn $this->error( \"an error occured!\" );\n\t\t}\n\t\tif ( mysql_query ( $sql , $this->CONN ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->error ( \"error while creating database '$name'!\" );\n\t\t}\n\t}", "public function createDatabaseDriver()\n {\n return new DatabaseHealthCheck;\n }", "public static function & factory($db_name) {\n\t\tstatic $dbs = array();\n\n\t\t$return = null;\n\n\t\t//ensure one db object per db server\n\t\tif (isset($dbs[$db_name])) {\n\t\t\treturn $dbs[$db_name];\n\t\t}\n\n\t\t$dbconfig = Config::get('db.'. $db_name);\n\n\t\tif (isset($dbconfig['driver'])) {\n\t\t\t$driver_class = 'DB'. strtolower($dbconfig['driver']);\n\t\t\t$driver_path = PATH_DB . $driver_class .'.class.php';\n\n\t\t\t$dbs[$db_name] = $return = new $driver_class(\n\t\t\t\tisset($dbconfig['server']) ? $dbconfig['server'] : null,\n\t\t\t\tisset($dbconfig['username']) ? $dbconfig['username'] : null,\n\t\t\t\tisset($dbconfig['password']) ? $dbconfig['password'] : null,\n\t\t\t\tisset($dbconfig['database']) ? $dbconfig['database'] : null,\n\t\t\t\tisset($dbconfig['port']) ? $dbconfig['port'] : null,\n\t\t\t\tisset($dbconfig['socket']) ? $dbconfig['socket'] : null\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException('Unable to initialize DB object, no config found for db: '. $db_name);\n\t\t}\n\n\t\tif (!$return || !$return instanceof DB) {\n\t\t\tthrow new Exception('Unable to instantiate DB object for - '. $db_name .': '. var_export($dbconfig, true));\n\t\t}\n\n\t\treturn $return;\n\t}", "function getDbInstance()\r\n{\r\n\treturn new MysqliDb(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);\r\n}", "public function testCreateDb()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n \n list($host, $port, $dbname) = $this->_getUrlParts();\n $dbname = trim($dbname, '/');\n \n $db = Sopha_Db::createDb($dbname, $host, $port);\n \n // Make sure DB now exists\n $response = Sopha_Http_Request::get($this->_url);\n $this->assertEquals(200, $response->getStatus());\n }", "public static function DB() {\n\n\t\t if (!isset(self::$instance)){\n\t\t \t//self::$db = new Model;\n\t\t \tself::$instance = new self;\n\t\t \t\n\t\t }\n\n\t\t return self::$instance;\n\t\t \n\n\t }", "public static function getInstance()\n\t{\n\t\tif (is_null(self::$_instance)) // On regarde si une instance de a déjà été créée\n\t\t\tself::$_instance = new Database(); // Si non, on la créer\n\n\t\treturn self::$_instance;\n\t}", "public static function obtenerint(){\n if (self::$db === null){\n \tself::$db = new self();\n }\n return self::$db;\n }", "public function getDatabase() {\n\t\t\t$this->_pdo = Database::getMysqlConncetion(\n\t\t\t\t\t$this->config->dbHost,\n\t\t\t\t\t$this->config->dbUsername,\n\t\t\t\t\t$this->config->dbPassword,\n\t\t\t\t\t$this->config->dbSchema\n\t\t\t\t);\n\t\t}", "public static function factory($dsn, $options = false) {\n /**\n * create options array\n */\n if(!is_array($options)) {\n $options = array('persistent' => $options);\n }\n\n /**\n * set the dsn array\n */\n try {\n $mydsn = self::parse_dsn($dsn);\n }\n\n catch(gdatabase_exception $e) {\n printf(\n 'database dsn: %s',\n $e->custom_message()\n );\n } \n \n /**\n * make dbtype lower case\n */\n $mydbtype = strtolower($mydsn['dbtype']);\n\n /**\n * include specific database class file\n */\n if(isset($options['debug']) AND $options['debug'] > 0) {\n require_once(LIB_PATH . 'gdatabase/gdatabase_' . $mydbtype . '.class.php');\n } else {\n @require_once(LIB_PATH . 'gdatabase/gdatabase_' . $mydbtype . '.class.php');\n }\n \n /**\n * define class name\n */\n $classname = 'gdatabase_' . $mydbtype;\n\n /**\n * if class does not exist throw new exception\n */\n if(!class_exists($classname)) {\n throw new gdatabase_exception('specific database class does not exist');\n }\n \n /**\n * create object of the specific database class\n */\n try {\n @$obj = new $classname;\n }\n\n catch(gdatabase_exception $e) {\n printf(\n 'database %s: %s',\n $mydbtype,\n $e->custom_message()\n );\n } \n \n /**\n * set the options\n */\n try {\n foreach($options AS $option => $value) {\n $obj->set_option($option, $value);\n }\n }\n\n catch(gdatabase_exception $e) {\n printf(\n 'database options: %s',\n $e->custom_message()\n );\n }\n \n /**\n * write object to instance holder\n */\n return self::$ginstance = $obj;\n }", "function getDbInstance()\r\n{\r\n\treturn new MysqliDb(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME); \r\n}", "public function Database() {\n\t\tglobal $database_dsn, $cache_dsn;\n\n\t\tif(substr($database_dsn, 0, 5) == \"mysql\") {\n\t\t\t$this->engine = new MySQL();\n\t\t}\n\t\telse if(substr($database_dsn, 0, 5) == \"pgsql\") {\n\t\t\t$this->engine = new PostgreSQL();\n\t\t}\n\t\telse if(substr($database_dsn, 0, 6) == \"sqlite\") {\n\t\t\t$this->engine = new SQLite();\n\t\t}\n\n\t\t$this->db = @NewADOConnection($database_dsn);\n\n\t\tif(isset($cache_dsn) && !empty($cache_dsn)) {\n\t\t\t$matches = array();\n\t\t\tpreg_match(\"#(memcache|apc)://(.*)#\", $cache_dsn, $matches);\n\t\t\tif($matches[1] == \"memcache\") {\n\t\t\t\t$this->cache = new MemcacheCache($matches[2]);\n\t\t\t}\n\t\t\telse if($matches[1] == \"apc\") {\n\t\t\t\t$this->cache = new APCCache($matches[2]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->cache = new NoCache();\n\t\t}\n\n\t\tif($this->db) {\n\t\t\t$this->db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t\t$this->engine->init($this->db);\n\t\t}\n\t\telse {\n\t\t\t$version = VERSION;\n\t\t\tprint \"\n\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t<title>Internal error - Shimmie-$version</title>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\tInternal error: Could not connect to database\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t\t\";\n\t\t\texit;\n\t\t}\n\t}", "public static function get_instance() {\n \tif( !isset(self::$instance) ) {\n self::$instance = new Database();\n \t}\n\treturn self::$instance ;\n }", "public function __construct() {\r\n $this->db = new Database;\r\n }", "function new_db($name) {\n\t\t\t$sql = \"CREATE DATABASE IF NOT EXISTS \".$name;\n\t\t\tif ($this->checkup(\"\", $sql) != true) {\n\t\t\t\treturn $this->error(\"an error occured!\");\n\t\t\t}\n\n\t\t\t#\t\tif ( mysqli_query ($this->CONN, $sql ) ) {\n\t\t\tif ($this->one_query($sql)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn $this->error(\"error while creating database '$name'!\");\n\t\t\t}\n\t\t}", "public function setDatabaseManager( \\Aimeos\\MW\\DB\\Manager\\Iface $dbm )\n\t{\n\t\t$this->dbm = $dbm;\n\t}", "protected function createInstance($newDb) {\n\t\treturn new Mongodloid_Db($newDb, $this);\n\t}", "protected function createEntityManager()\n {\n $configuration = Setup::createAnnotationMetadataConfiguration(\n [$this->_config['models']],\n Environment::is('development'),\n $this->_config['proxies'],\n isset($this->_config['cache']) ? call_user_func($this->_config['cache']) : null\n );\n $configuration->setProxyNamespace($this->_config['proxyNamespace']);\n\n $eventManager = new EventManager();\n $eventManager->addEventListener([\n Events::postLoad,\n Events::prePersist,\n Events::preUpdate\n ], $this);\n\n $connection = $this->connectionSettings;\n $params = compact('connection', 'configuration', 'eventManager');\n return $this->_filter(__METHOD__, $params, function ($self, $params) {\n return EntityManager::create(\n $params['connection'],\n $params['configuration'],\n $params['eventManager']\n );\n });\n }", "public function provision()\n {\n $this->assignRootPassword();\n\n $databaseInstanceConfig = new DatabaseInstanceConfig($this);\n\n $operation = $this->client()->createDatabaseInstance($databaseInstanceConfig);\n $this->update(['operation_name' => $operation['name']]);\n\n $this->setCreating();\n\n MonitorDatabaseInstanceCreation::dispatch($this);\n }", "private function createDatabase(): mysqli\n {\n return new mysqli();\n }", "public static function constructByConfig($dbConfig)\n\t{\n\t\treturn new As_MssqlDatabase($dbConfig);\n\t}", "public static function getInstance() {\n\t\t\tif (!self::$instance) {\n\t\t\t\t$dbh = new database;\n\t\t\t}\n\t\t\treturn self::$instance;\n\t\t}", "public function __construct()\n {\n $this->db = new Database;\n }", "public function __construct()\n {\n $this->db = new Database;\n }", "public function createDatabase($name)\n {\n return $this->connection->statement(\n $this->grammar->compileCreateDatabase($name, $this->connection)\n );\n }", "public function createDatabase($name)\n {\n return $this->connection->statement(\n $this->grammar->compileCreateDatabase($name, $this->connection)\n );\n }" ]
[ "0.709921", "0.671465", "0.6592712", "0.65327287", "0.6440525", "0.6400639", "0.6377426", "0.632865", "0.631137", "0.6307844", "0.62939286", "0.62927437", "0.62753934", "0.6240018", "0.6239908", "0.6234671", "0.62272775", "0.622664", "0.62204814", "0.6176012", "0.61688185", "0.6072169", "0.6057262", "0.6016235", "0.601146", "0.60009557", "0.59813327", "0.59813327", "0.59781426", "0.59370244", "0.5935725", "0.59160084", "0.5915051", "0.5907181", "0.5905469", "0.58991146", "0.5861074", "0.5860385", "0.5853259", "0.5851415", "0.58461773", "0.58289486", "0.5823459", "0.58232594", "0.5816632", "0.5809762", "0.5808421", "0.5780787", "0.5780107", "0.5779435", "0.5776157", "0.5771365", "0.57564485", "0.5740667", "0.5732156", "0.57240814", "0.5722308", "0.5719727", "0.57189465", "0.5718282", "0.57157964", "0.5693628", "0.5691524", "0.56756866", "0.5664184", "0.56535405", "0.5646942", "0.56463605", "0.5642594", "0.5636134", "0.56299716", "0.5619869", "0.56183636", "0.5618055", "0.55981165", "0.55973953", "0.55924296", "0.55916315", "0.5587551", "0.55785125", "0.55773264", "0.55753726", "0.55620545", "0.55543035", "0.55537957", "0.553784", "0.5534765", "0.55336267", "0.5525392", "0.5515816", "0.55095476", "0.550872", "0.550156", "0.5498676", "0.5497189", "0.5496862", "0.5493599", "0.5492321", "0.5492321", "0.5484079", "0.5484079" ]
0.0
-1
Get the evaluated view contents for the given view.
public function make($view, $data = [], $mergeData = []) { return $this->render($view, $data, $mergeData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getViewContents($view, $params = []): array|string\n {\n\n // foreach ($params as $key => $value) {\n // $$key = $value;\n // }\n extract($params);\n ob_start();\n include_once Application::$ROOT_DIR . \"/views/$view.php\";\n return ob_get_clean();\n }", "function fetchView($view_path) {\r\n return Angie::getTemplateEngine()->fetchView($view_path);\r\n }", "public function render(\\Zend_View_Abstract $view)\n {\n return $this->getValue();\n }", "function fetch($path) {\n\t\textract($this->_viewVars);\n\t\tif (!file_exists($path)) {\n\t\t\t$this->_fetchError($path);\n\t\t}\n\t\t$viewFile=file_get_contents($path);\n\t\t$this->processTags($viewFile);\n\t\tob_start();\n\t\teval(\"?>$viewFile<?\");\n\t\t$view=ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $view;\n\t}", "public function renderView(View $view)\n {\n $viewContents = $view->render();\n try {\n $layout = new View($this->site . DIRECTORY_SEPARATOR . $this->layout);\n $layout->set('post', $view->getPost());\n $layout->set('title', $view->getTitle());\n $layout->set('content', $viewContents);\n $viewContents = $layout->render();\n } catch (\\Exception $e) {\n }\n return $viewContents;\n }", "public static function getContents($filePath)\n {\n //compose the file full path\n $path = Path::view($filePath);\n\n //get an instance of the view template class\n $template = Registry::get('template');\n \n //get the compiled file contents\n $contents = $template->compiled($path);\n\n //return the compiled template file contents\n return $contents;\n\n }", "public function get($viewName, $viewData='') {\n ob_start();\n $this->show($viewName, $viewData);\n $viewContent = ob_get_contents();\n ob_end_clean();\n return $viewContent;\n }", "protected function renderContents()\n {\n // We will keep track of the amount of views being rendered so we can flush\n // the section after the complete rendering operation is done. This will\n // clear out the sections for any separate views that may be rendered.\n $this->factory->incrementRender();\n\n $this->factory->callComposer($this);\n\n $contents = $this->getContents();\n\n // Once we've finished rendering the view, we'll decrement the render count\n // so that each sections get flushed out next time a view is created and\n // no old sections are staying around in the memory of an environment.\n $this->factory->decrementRender();\n\n return $contents;\n }", "public static function render($view)\n\t{\n\t\t$path = str_replace('.', DS, $view); // Handle 'pretty' paths\n\t\n\t\tob_start(); // Start the render buffer\n\t\t\n\t\t// Include the file, letting the contents render, but not print\n\t\tinclude( area('application') . 'views' . DS . $path . EXT );\n\t\t\n\t\treturn ob_get_clean(); // Return the contents of the view\n\t}", "public function get_data() {\n return $this->_view;\n }", "private function renderViewFile()\n {\n try {\n\n ob_start();\n extract($this->view_data);\n\n /** @noinspection PhpIncludeInspection */\n include($this->view_file);\n\n return trim(ob_get_clean(), \"\\n\");\n\n } catch (\\Exception $e) {\n\n ob_end_clean();\n throw $e;\n }\n }", "public function process()\n\t{\n\t\ttry {\n\t\t\t# Bind variables to local scope:\n\t\t\tforeach ($this->variables as $k => $v)\n\t\t\t\t${$k} = $v;\n\n\t\t\t# Start output buffering:\n\t\t\tob_start();\n\n\t\t\t# Do replacements:\n\t\t\t$this->replaced_contents = $this->contents;\n\t\t\tforeach (self::$replacements as $this->from => $this->to)\n\t\t\t\t$this->replaced_contents = preg_replace ($this->from, $this->to, $this->replaced_contents);\n\n\t\t\t$this->evaled_result = eval ('?>'.$this->replaced_contents.'<?php ');\n\n\t\t\tif ($this->evaled_result === false)\n\t\t\t\tthrow new ViewParserException ('Error on parsing view code');\n\t\t\telse\n\t\t\t\techo $this->evaled_result;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t# Ensure that capture has ended and rethrow:\n\t\t\tob_end_clean();\n\t\t\tthrow $e;\n\t\t}\n\n\t\t# End output buffering:\n\t\treturn $this->result = ob_get_clean();\n\t}", "protected function _renderView($view_path, $data) {\n\t\tob_start();\n\n\t\tif(is_array($data) && count($data) > 0) {\n\t\t\textract($data, EXTR_OVERWRITE | EXTR_REFS);\n\t\t}\n\n\t\tif($view_path != null && file_exists($view_path)) {\n\t\t\tinclude $view_path;\n\t\t}\n\t\t$content = ob_get_contents(); ob_end_clean();\n\n\t\treturn $content;\n\t}", "public function render (View $view, array $environment = array()) {\n extract($environment);\n ob_start();\n include $view->getTemplate();\n $contents = ob_get_clean();\n echo $contents;\n}", "private function returnLayoutAndView($layout, $view) {\n // import key:value array into symbol table\n extract($values, EXTR_SKIP);\n\n ob_start();\n // save view into template var\n include $view;\n $template = ob_get_contents();\n ob_end_clean();\n\n ob_start();\n // call parent layout\n include $layout;\n $cacheFile = ob_get_contents();\n ob_end_clean();\n\n return $cacheFile;\n }", "public function getParsedContent()\n {\n /** @var oxUtilsView $oUtilsView */\n $oUtilsView = oxRegistry::get(\"oxUtilsView\");\n return $oUtilsView->parseThroughSmarty($this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId(), null, true);\n }", "function view($view, $vars = []): string {\n ob_start();\n foreach ($vars as $var => $val) {\n global ${$var};\n ${$var} = $val;\n }\n include \"resources/views/\" . $view . \".php\";\n $v = ob_get_contents();\n ob_end_clean();\n return $v;\n}", "protected function viewContent($view, $params): string\n {\n\n foreach($params as $key => $value)\n {\n /**\n * Variable variable ($$)\n * if key is name and value is mohammad then it is as declearing:\n * $name = mohammad\n */\n $$key = $value;\n }\n\n ob_start();\n include_once Applecation::$ROOT.\"/App/Views/$view.php\";\n return ob_get_clean();\n }", "public function get($view, $vars)\n {\n ob_start();\n $this->show($view, $vars);\n return ob_get_clean();\n }", "protected function render($view, $data)\n {\n ob_start();\n $this->view->partial($view, $data);\n $content = ob_get_clean();\n\n return $content;\n }", "protected function view()\n {\n return $this->app['view'];\n }", "public function get_view( $view, $args = array() ) {\n extract( $args );\n $path = $this->views_path . 'html-' . $view;\n\n ob_start();\n\n if ( file_exists( $path ) ) {\n include $path;\n }\n\n return ob_get_clean();\n }", "protected function getView()\n {\n return $this->view;\n }", "public function renderView(View $view)\n {\n $template = $view->template();\n\n // add extension if left off\n $len = strlen(self::EXTENSION);\n if (substr($template, -$len, $len) != self::EXTENSION) {\n $template .= self::EXTENSION;\n }\n\n $template = $this->viewsDir.'/'.$template;\n\n // assign global and view parameters\n $parameters = array_replace($this->getGlobalParameters(), $view->getParameters());\n\n // escape HTML special characters\n foreach ($parameters as &$value) {\n if (is_array($value) || is_object($value)) {\n continue;\n }\n\n $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }\n\n return $this->render($parameters, $template);\n }", "public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }", "public function get_text_view( $file, $view_dir = null ) {\n foreach ( $this->variables as $key => $value ) {\n ${$key} = $value;\n }\n\n $view_dir = isset( $view_dir ) ? $view_dir : $this->config->get( 'view_dir' );\n $view_file = $view_dir . $file . '.php';\n if ( ! file_exists( $view_file ) ) {\n return '';\n }\n\n ob_start();\n include $view_file; // phpcs:ignore\n $thread = ob_get_contents();\n ob_end_clean();\n $html = $thread;\n\n $this->init_assignments();\n\n return $html;\n }", "public function view()\n {\n return $this->view;\n }", "public function view()\n {\n return $this->view;\n }", "public function render(): mixed\n {\n return $this->view;\n }", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function getView(){\n\t\treturn $this->view;\n\t}", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView() {\r\n return $this->_view;\r\n }", "public function getView()\n\t{\n\t\treturn $this->_view;\n\t}", "public function getView()\n\t{\n\t\treturn $this->view;\n\t}", "public function get_view($view)\n {\n return Twig_Functions::get_module_view($this->_module_name, ($this->is_backend() ? 'backend/' : '').$view);\n }", "protected function get_view( $file ) {\n\t\tob_start();\n\t\tinclude( SATISPRESS_DIR . 'views/' . $file );\n\t\treturn ob_get_clean();\n\t}", "function getHTML($filename, $php_params = array()) {\n\t\tif (!file_exists('views/'.$filename))\n\t\t\tdie ('The view ' . $filename . ' doesn\\'t exist');\n\n\t\t// If we got some params to be treated in php\n\t\textract($php_params);\n\t\t\n\t\tob_start();\n\t\tinclude('views/'.$filename);\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "public function getView()\r\n {\r\n return $this->view;\r\n }", "public function getViewVars();", "public function getViewVars();", "public function get(ViewEntityInterface $view) {\n $view_executable = new ViewExecutable($view, $this->user, $this->viewsData, $this->routeProvider);\n $view_executable->setRequest($this->requestStack->getCurrentRequest());\n return $view_executable;\n }", "public function getNewFileContents($viewname = null)\n {\n return file_get_contents($this->fullpath);\n }", "protected function fetch_view($view,$template_dir = NULL){\n\t\t$this->assign_errors();\n\t\t$this->assign_auth_values();//TODO Move To authcontroller\n\t\t$this->assign_custom_values();\n\t\treturn $this->view_manager->fetch($view, $template_dir);\n\t}", "public function getViewData()\n {\n return $this->__viewData;\n }", "protected function getView()\n {\n $this->getBootstrap()->bootstrap('view');\n return $this->getBootstrap()->getResource('view');\n }", "public function getView()\n\t{\n\t\tif( !isset( $this->view ) ) {\n\t\t\tthrow new \\Aimeos\\Client\\Html\\Exception( sprintf( 'No view available' ) );\n\t\t}\n\n\t\treturn $this->view;\n\t}", "protected function prepareContent($viewPath, array $params = null)\n {\n $view = container('view');\n\n ob_start();\n\n $view->render($viewPath, $params);\n\n ob_end_clean();\n\n return (string) $view->getContent();\n }", "public function render()\n {\n $output = '';\n // render the injected views\n if (!empty($this->_views)) {\n foreach ($this->_views as $_view) {\n $output .= $_view->render();\n }\n }\n // render the current view\n $output .= $this->_doRender();\n return $output;\n }", "public function render($viewScript, $controller)\n {\n $completePath = $this->setViewScriptPath($viewScript, $controller);\n ob_start();\n include $completePath;\n $contents = ob_get_contents();\n ob_end_clean();\n return $contents;\n }", "function getView() {\r\n return $this->view;\r\n }", "private function getView()\n {\n if ($this->view) {\n return $this->view;\n }\n\n $this->view = $this->services->get(View::class);\n return $this->view;\n }", "private function renderView(){\n\t\trequire($this->ViewFile);\n\t}", "function output() {\r\n\t\t\tforeach ($this->vars as $var =>$val)\r\n\t\t\t\t$$var = $val;\r\n\t\t\tif($this->parent_view)\r\n\t\t\t\tforeach ($this->parent_view->vars as $var =>$val)\r\n\t\t\t\t\t$$var = $val; // TODO: Check extract() for an alternative method\r\n\t\t\t\r\n\t\t\t$path = Kennel::cascade(\"{$this->view}\", 'views');\r\n\t\t\tif (!$path) return debug::error(\"View <strong>{$this->view}</strong> not found.\");\r\n\t\t\t\r\n\t\t\t//begin intercepting the output buffer\r\n\t\t\tob_start();\r\n\t\t\t\r\n\t\t\tif($path) require($path);\r\n\t\t\t\r\n\t\t\t//return the output and close the buffer\r\n\t\t\treturn ob_get_clean();\r\n\t\t\t\r\n\t\t\t//unset all template variables\r\n\t\t\tforeach ($this->vars as $var =>$val) {\r\n\t\t\t\tunset($$var);\r\n\t\t\t}\r\n\t\t}", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "public function show($view_name, $variables=[]){\n $contents = $this->engine->parse($this->view_loader->load($view_name),\n $variables\n );\n echo $contents;\n //$path = BASEPATH . '/views/' . $view_name;\n //$file = file_get_contents($path);\n //$file = $this->engine->parse($this->view_loader->load($view_name),\n // $variables\n // );\n //file_put_contents($path, $file);\n //dd($variables);\n //include BASEPATH . '/views/' . $view_name;\n }", "private function loadView($view, $data){\n $resolver = new TemplateMapResolver();\n $resolver->setMap(array(\n 'stepTemplate' => ROOT_PATH . '/module/BackOffice/view/back-office/wager/partials/wagerTypes/' . $view . '.phtml'\n ));\n \n //Create a view object and resolve the path base on the template map resolver above.\n $view = new PhpRenderer();\n $view->setResolver($resolver);\n \n //Create a view to use with the established template and add any variables that view will use.\n $viewModel = new ViewModel();\n $viewModel->setTemplate('stepTemplate')->setVariables(array(\n 'data' => $data\n ));\n \n return $view->render($viewModel);\n }", "public function getView() {\n\t\treturn $this -> st_view;\n\t}", "public function get_view( $view, $vars = array() ) {\n\n\t\tif ( isset( $this->template_dir ) ) {\n\t\t\t$template_dir = $this->template_dir;\n\t\t} else {\n\t\t\t$template_dir = $this->plugin_dir . '/inc/templates/';\n\t\t}\n\n\t\t$view_file = $template_dir . $view . '.tpl.php';\n\t\tif ( ! file_exists( $view_file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\textract( $vars, EXTR_SKIP );\n\t\tob_start();\n\t\tinclude $view_file;\n\t\treturn ob_get_clean();\n\t}", "protected static function render_view_static( $view, $vars = array() ) {\n\t\tob_start();\n\t\tinclude( TOOLSET_ADDON_MAPS_TEMPLATE_PATH . \"$view.phtml\" );\n\t\t$html = ob_get_contents();\n\n\t\tob_end_clean();\n\n\t\treturn $html;\n\t}", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "public function view(): mixed;", "public function content()\n {\n return $this->cache->get('content');\n }", "public function load_view( $view, $data = array() ) {\n return $this->_find_view( $view, ( array ) $data );\n }", "public function getOutput(){\n\n if (is_null($this->output)) {\n\n ob_start();\n\n extract($this->data);\n\n require $this->view;\n\n $this->output = ob_get_clean();\n\n return $this->output;\n }\n }", "private function renderView($path, $params)\n {\n ob_start();\n include $path;\n $content = ob_get_contents();\n ob_end_clean();\n\n return $content;\n }", "public function __toString()\n {\n $viewData = $this->variables;\n $templates = Context::getInstance()->getTemplates();\n if ($this->template != false) {\n $renderedTemplate = $templates->render($this->template, $viewData);\n $viewData['contents'] = $renderedTemplate;\n }\n if ($this->layout != false) {\n return $templates->render($this->layout, $viewData);\n }\n }", "public static function compile($view, $arguments = array()) {\n\t\t// store the view path\n\t\t$view_path = \"view/$view.view.php\";\n\n\t\t// initialize blank buffer\n\t\t$buffer = \"\";\n\n\t\t// does the view path exist\n\t\tif (file_exists($view_path)) {\n\t\t\t// start the output buffer\n\t\t\tob_start();\n\n\t\t\t// extract arguments from array into scope\n\t\t\textract($arguments);\n\n\t\t\t// get uri for the page\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\n\t\t\t// include the view\n\t\t\tinclude $view_path;\n\n\t\t\t// clean the buffer return what's in it\n\t\t\t$buffer = ob_get_clean();\n\t\t}\n\n\t\t// return the buffer\n\t\treturn $buffer;\n\t}", "protected function viewPage($view, $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$$key = $value;\n\t\t}\n\t\tob_start();\n\n\t\tinclude_once Application::$ROOT_DIR.\"/views/$view.php\";\n\n\t\treturn ob_get_clean();\n\t}", "protected static function capture_html($html, array $view_data)\n\t{\n\t\textract($view_data, EXTR_SKIP);\n\n\t\t// Capture the view output\n\t\tob_start();\n\n\t\ttry\n\t\t{\n\t\t\teval('?>' . $html);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Delete the output buffer\n\t\t\tob_end_clean();\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// Get the captured output and close the buffer\n\t\treturn ob_get_clean();\n\t}", "public function getViewScript()\n {\n return $this->__get(\"view_script\");\n }", "function getView() {\n\t\treturn $this->View;\n\t}", "public function output() {\n\n if (!file_exists($this->view)) {\n \treturn \"Voeg eerst een template toe ($this->view).<br />\";\n }\n $output = file_get_contents($this->view);\n \n foreach ($this->variabeles as $key => $variable) {\n \t$tagToReplace = \"[@$key]\";\n \t$output = str_replace($tagToReplace, $variable, $output);\n }\n\n return $output;\n }", "public function getView() {\n \t\n \t// Return the current view\n \treturn $this->sView;\n }", "public function render()\n {\n return $this->load($this->getFile(), $this->getVariables());\n }", "public function getViews(){\n\n if($this->safe($this->views)){\n //extract vlozi obsah z promenne do pohledu\n extract($this->data);\n extract($this->data, EXTR_PREFIX_ALL, \"\");\n require \"Views/\" . $this->views . \".phtml\";\n }\n }", "function get_view( $file = false, $args = array() ) {\n\t\tob_start();\n\t\t$this->display( $file, $args );\n\t\treturn ob_get_clean();\n\t}", "public function renderView(string $view, array $data = [])\n {\n return $this->templating->render($view, $data);\n }", "function displayView($view_path) {\r\n return Angie::getTemplateEngine()->displayView($view_path);\r\n }", "protected function _render($___viewFn, $___dataForView = array()) {\n\t\t\t$trace=debug_backtrace();\n\t\t\t$caller=array_shift($trace);\n\t\t\tif ($caller===\"element\") parent::_render($___viewFn, $___dataForView);\n\t\t\tif (empty($___dataForView)) {\n\t\t $___dataForView = $this->viewVars;\n\n\t\t }\n\n\t\t extract($___dataForView, EXTR_SKIP);\n\n\t\t foreach($___dataForView as $data => $value) {\n\t\t if(!is_object($data)) {\n\t\t $this->Smarty->assign($data, $value);\n\t\t }\n\t\t }\n\t\t ob_start();\n\n\t\t $this->Smarty->display($___viewFn);\n\n\t\t return ob_get_clean();\n\t\t}", "public function getView()\n\t{\n\t\treturn $this->client->getView();\n\t}", "public function getVars()\n {\n return $this->_contents;\n }", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function getView() {\n return $this->setView();\n }", "function render($view, $values = [])\n {\n // if view exists, render it\n if (file_exists(\"../views/{$view}\"))\n {\n // extract variables into local scope\n extract($values);\n\n // render view \n require(\"../views/{$view}\");\n exit;\n }\n\n // else error\n else\n {\n echo(\"Could not render\");\n }\n }", "public function render ($view, $vars = array()) {\r\n\n\t\t$vars['session'] = $this->session;\n\t\t\n\t\t$viewPath = $this->viewPath;\n\t\t\r\n\t\tob_start();\r\n\t\t\r\n\t\t$this->events->trigger(\"before:render\", [$this, &$vars]);\n\t\t\n\t\t// Get the extension\n\t\t$ext = pathinfo($view, PATHINFO_EXTENSION);\n\t\t\n\t\t$extHandlers = array(\n\t\t\t\t'php' => function ($vars, $view, $viewPath) {\n\t\t\t\t\textract($vars);\n\t\t\t\t\tinclude ($viewPath ?: \"\") . $view;\n\t\t\t\t}\n\t\t);\n\t\t$this->events->trigger(\"before:render:extension\", [&$extHandlers, $this]);\n\t\t\n\t\t\n\t\tif (!isset($extHandlers[$ext])) {\n\t\t\tthrow new \\Exception (\"Can not render view {$viewPath}{$view}. Handler for \\\"{$ext}\\\" extension is not added. Add with event before:render:extension.\");\n\t\t}\n\t\t\n\t\t$call = $this->events->trigger(\"mb:render:$ext\", array(), function () use($ext, $extHandlers) {\t\n\t\t\treturn $extHandlers[$ext];\n\t\t})[0];\n\t\t\n\t\t\n\t\t\n\t\t$call = \\Closure::bind($call, $this);\r\n\t\t$call($vars, $view, $viewPath);\r\n\n\t\t\r\n\t\t$content = ob_get_clean();\r\n\t\t$this->events->trigger(\"after:render\", [$view, &$content]);\r\n\t\treturn $content;\r\n\t}" ]
[ "0.6958564", "0.65205735", "0.6446336", "0.6357772", "0.6338112", "0.632415", "0.6304554", "0.62928534", "0.62894356", "0.6265343", "0.6259197", "0.624278", "0.62256587", "0.62107456", "0.61925095", "0.61783963", "0.6165439", "0.6151237", "0.60469496", "0.6033158", "0.6014881", "0.59561443", "0.5955893", "0.59373605", "0.59221905", "0.5863456", "0.58612853", "0.58612853", "0.58388275", "0.5822357", "0.5806819", "0.5806819", "0.5805308", "0.5793826", "0.5787796", "0.57833546", "0.5777786", "0.5777786", "0.5777786", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5746651", "0.57443094", "0.57419544", "0.5741079", "0.5704643", "0.5696703", "0.5695848", "0.568769", "0.568769", "0.5681802", "0.56719184", "0.5662234", "0.5659942", "0.56521255", "0.56513494", "0.5650319", "0.56367517", "0.56153727", "0.56118095", "0.5603881", "0.55850774", "0.55836904", "0.55659527", "0.55552113", "0.5549171", "0.554404", "0.55279624", "0.5516121", "0.5509843", "0.550669", "0.5497558", "0.5495955", "0.5492909", "0.548994", "0.54764235", "0.54753995", "0.54747355", "0.54729563", "0.5463416", "0.54631394", "0.54597694", "0.54557544", "0.54550123", "0.54460907", "0.5438781", "0.543751", "0.5435733", "0.5429039", "0.54059416", "0.5395383", "0.5389059", "0.5381753", "0.53804046", "0.5377802" ]
0.0
-1
Get the evaluated view contents for the given view.
public function render($view, $data = [], $mergeData = []) { if (isset($this->aliases[$view])) { $view = $this->aliases[$view]; } $view = $this->normalizeName($view); return $this->factory->render($view, $data, $mergeData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getViewContents($view, $params = []): array|string\n {\n\n // foreach ($params as $key => $value) {\n // $$key = $value;\n // }\n extract($params);\n ob_start();\n include_once Application::$ROOT_DIR . \"/views/$view.php\";\n return ob_get_clean();\n }", "function fetchView($view_path) {\r\n return Angie::getTemplateEngine()->fetchView($view_path);\r\n }", "public function render(\\Zend_View_Abstract $view)\n {\n return $this->getValue();\n }", "function fetch($path) {\n\t\textract($this->_viewVars);\n\t\tif (!file_exists($path)) {\n\t\t\t$this->_fetchError($path);\n\t\t}\n\t\t$viewFile=file_get_contents($path);\n\t\t$this->processTags($viewFile);\n\t\tob_start();\n\t\teval(\"?>$viewFile<?\");\n\t\t$view=ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $view;\n\t}", "public function renderView(View $view)\n {\n $viewContents = $view->render();\n try {\n $layout = new View($this->site . DIRECTORY_SEPARATOR . $this->layout);\n $layout->set('post', $view->getPost());\n $layout->set('title', $view->getTitle());\n $layout->set('content', $viewContents);\n $viewContents = $layout->render();\n } catch (\\Exception $e) {\n }\n return $viewContents;\n }", "public static function getContents($filePath)\n {\n //compose the file full path\n $path = Path::view($filePath);\n\n //get an instance of the view template class\n $template = Registry::get('template');\n \n //get the compiled file contents\n $contents = $template->compiled($path);\n\n //return the compiled template file contents\n return $contents;\n\n }", "public function get($viewName, $viewData='') {\n ob_start();\n $this->show($viewName, $viewData);\n $viewContent = ob_get_contents();\n ob_end_clean();\n return $viewContent;\n }", "protected function renderContents()\n {\n // We will keep track of the amount of views being rendered so we can flush\n // the section after the complete rendering operation is done. This will\n // clear out the sections for any separate views that may be rendered.\n $this->factory->incrementRender();\n\n $this->factory->callComposer($this);\n\n $contents = $this->getContents();\n\n // Once we've finished rendering the view, we'll decrement the render count\n // so that each sections get flushed out next time a view is created and\n // no old sections are staying around in the memory of an environment.\n $this->factory->decrementRender();\n\n return $contents;\n }", "public static function render($view)\n\t{\n\t\t$path = str_replace('.', DS, $view); // Handle 'pretty' paths\n\t\n\t\tob_start(); // Start the render buffer\n\t\t\n\t\t// Include the file, letting the contents render, but not print\n\t\tinclude( area('application') . 'views' . DS . $path . EXT );\n\t\t\n\t\treturn ob_get_clean(); // Return the contents of the view\n\t}", "public function get_data() {\n return $this->_view;\n }", "private function renderViewFile()\n {\n try {\n\n ob_start();\n extract($this->view_data);\n\n /** @noinspection PhpIncludeInspection */\n include($this->view_file);\n\n return trim(ob_get_clean(), \"\\n\");\n\n } catch (\\Exception $e) {\n\n ob_end_clean();\n throw $e;\n }\n }", "public function process()\n\t{\n\t\ttry {\n\t\t\t# Bind variables to local scope:\n\t\t\tforeach ($this->variables as $k => $v)\n\t\t\t\t${$k} = $v;\n\n\t\t\t# Start output buffering:\n\t\t\tob_start();\n\n\t\t\t# Do replacements:\n\t\t\t$this->replaced_contents = $this->contents;\n\t\t\tforeach (self::$replacements as $this->from => $this->to)\n\t\t\t\t$this->replaced_contents = preg_replace ($this->from, $this->to, $this->replaced_contents);\n\n\t\t\t$this->evaled_result = eval ('?>'.$this->replaced_contents.'<?php ');\n\n\t\t\tif ($this->evaled_result === false)\n\t\t\t\tthrow new ViewParserException ('Error on parsing view code');\n\t\t\telse\n\t\t\t\techo $this->evaled_result;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t# Ensure that capture has ended and rethrow:\n\t\t\tob_end_clean();\n\t\t\tthrow $e;\n\t\t}\n\n\t\t# End output buffering:\n\t\treturn $this->result = ob_get_clean();\n\t}", "protected function _renderView($view_path, $data) {\n\t\tob_start();\n\n\t\tif(is_array($data) && count($data) > 0) {\n\t\t\textract($data, EXTR_OVERWRITE | EXTR_REFS);\n\t\t}\n\n\t\tif($view_path != null && file_exists($view_path)) {\n\t\t\tinclude $view_path;\n\t\t}\n\t\t$content = ob_get_contents(); ob_end_clean();\n\n\t\treturn $content;\n\t}", "public function render (View $view, array $environment = array()) {\n extract($environment);\n ob_start();\n include $view->getTemplate();\n $contents = ob_get_clean();\n echo $contents;\n}", "private function returnLayoutAndView($layout, $view) {\n // import key:value array into symbol table\n extract($values, EXTR_SKIP);\n\n ob_start();\n // save view into template var\n include $view;\n $template = ob_get_contents();\n ob_end_clean();\n\n ob_start();\n // call parent layout\n include $layout;\n $cacheFile = ob_get_contents();\n ob_end_clean();\n\n return $cacheFile;\n }", "public function getParsedContent()\n {\n /** @var oxUtilsView $oUtilsView */\n $oUtilsView = oxRegistry::get(\"oxUtilsView\");\n return $oUtilsView->parseThroughSmarty($this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId(), null, true);\n }", "function view($view, $vars = []): string {\n ob_start();\n foreach ($vars as $var => $val) {\n global ${$var};\n ${$var} = $val;\n }\n include \"resources/views/\" . $view . \".php\";\n $v = ob_get_contents();\n ob_end_clean();\n return $v;\n}", "protected function viewContent($view, $params): string\n {\n\n foreach($params as $key => $value)\n {\n /**\n * Variable variable ($$)\n * if key is name and value is mohammad then it is as declearing:\n * $name = mohammad\n */\n $$key = $value;\n }\n\n ob_start();\n include_once Applecation::$ROOT.\"/App/Views/$view.php\";\n return ob_get_clean();\n }", "public function get($view, $vars)\n {\n ob_start();\n $this->show($view, $vars);\n return ob_get_clean();\n }", "protected function render($view, $data)\n {\n ob_start();\n $this->view->partial($view, $data);\n $content = ob_get_clean();\n\n return $content;\n }", "protected function view()\n {\n return $this->app['view'];\n }", "public function get_view( $view, $args = array() ) {\n extract( $args );\n $path = $this->views_path . 'html-' . $view;\n\n ob_start();\n\n if ( file_exists( $path ) ) {\n include $path;\n }\n\n return ob_get_clean();\n }", "protected function getView()\n {\n return $this->view;\n }", "public function renderView(View $view)\n {\n $template = $view->template();\n\n // add extension if left off\n $len = strlen(self::EXTENSION);\n if (substr($template, -$len, $len) != self::EXTENSION) {\n $template .= self::EXTENSION;\n }\n\n $template = $this->viewsDir.'/'.$template;\n\n // assign global and view parameters\n $parameters = array_replace($this->getGlobalParameters(), $view->getParameters());\n\n // escape HTML special characters\n foreach ($parameters as &$value) {\n if (is_array($value) || is_object($value)) {\n continue;\n }\n\n $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }\n\n return $this->render($parameters, $template);\n }", "public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }", "public function get_text_view( $file, $view_dir = null ) {\n foreach ( $this->variables as $key => $value ) {\n ${$key} = $value;\n }\n\n $view_dir = isset( $view_dir ) ? $view_dir : $this->config->get( 'view_dir' );\n $view_file = $view_dir . $file . '.php';\n if ( ! file_exists( $view_file ) ) {\n return '';\n }\n\n ob_start();\n include $view_file; // phpcs:ignore\n $thread = ob_get_contents();\n ob_end_clean();\n $html = $thread;\n\n $this->init_assignments();\n\n return $html;\n }", "public function view()\n {\n return $this->view;\n }", "public function view()\n {\n return $this->view;\n }", "public function render(): mixed\n {\n return $this->view;\n }", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function getView(){\n\t\treturn $this->view;\n\t}", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView() {\r\n return $this->_view;\r\n }", "public function getView()\n\t{\n\t\treturn $this->_view;\n\t}", "public function getView()\n\t{\n\t\treturn $this->view;\n\t}", "public function get_view($view)\n {\n return Twig_Functions::get_module_view($this->_module_name, ($this->is_backend() ? 'backend/' : '').$view);\n }", "protected function get_view( $file ) {\n\t\tob_start();\n\t\tinclude( SATISPRESS_DIR . 'views/' . $file );\n\t\treturn ob_get_clean();\n\t}", "function getHTML($filename, $php_params = array()) {\n\t\tif (!file_exists('views/'.$filename))\n\t\t\tdie ('The view ' . $filename . ' doesn\\'t exist');\n\n\t\t// If we got some params to be treated in php\n\t\textract($php_params);\n\t\t\n\t\tob_start();\n\t\tinclude('views/'.$filename);\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "public function getView()\r\n {\r\n return $this->view;\r\n }", "public function getViewVars();", "public function getViewVars();", "public function get(ViewEntityInterface $view) {\n $view_executable = new ViewExecutable($view, $this->user, $this->viewsData, $this->routeProvider);\n $view_executable->setRequest($this->requestStack->getCurrentRequest());\n return $view_executable;\n }", "public function getNewFileContents($viewname = null)\n {\n return file_get_contents($this->fullpath);\n }", "protected function fetch_view($view,$template_dir = NULL){\n\t\t$this->assign_errors();\n\t\t$this->assign_auth_values();//TODO Move To authcontroller\n\t\t$this->assign_custom_values();\n\t\treturn $this->view_manager->fetch($view, $template_dir);\n\t}", "public function getViewData()\n {\n return $this->__viewData;\n }", "protected function getView()\n {\n $this->getBootstrap()->bootstrap('view');\n return $this->getBootstrap()->getResource('view');\n }", "public function getView()\n\t{\n\t\tif( !isset( $this->view ) ) {\n\t\t\tthrow new \\Aimeos\\Client\\Html\\Exception( sprintf( 'No view available' ) );\n\t\t}\n\n\t\treturn $this->view;\n\t}", "protected function prepareContent($viewPath, array $params = null)\n {\n $view = container('view');\n\n ob_start();\n\n $view->render($viewPath, $params);\n\n ob_end_clean();\n\n return (string) $view->getContent();\n }", "public function render()\n {\n $output = '';\n // render the injected views\n if (!empty($this->_views)) {\n foreach ($this->_views as $_view) {\n $output .= $_view->render();\n }\n }\n // render the current view\n $output .= $this->_doRender();\n return $output;\n }", "public function render($viewScript, $controller)\n {\n $completePath = $this->setViewScriptPath($viewScript, $controller);\n ob_start();\n include $completePath;\n $contents = ob_get_contents();\n ob_end_clean();\n return $contents;\n }", "function getView() {\r\n return $this->view;\r\n }", "private function getView()\n {\n if ($this->view) {\n return $this->view;\n }\n\n $this->view = $this->services->get(View::class);\n return $this->view;\n }", "private function renderView(){\n\t\trequire($this->ViewFile);\n\t}", "function output() {\r\n\t\t\tforeach ($this->vars as $var =>$val)\r\n\t\t\t\t$$var = $val;\r\n\t\t\tif($this->parent_view)\r\n\t\t\t\tforeach ($this->parent_view->vars as $var =>$val)\r\n\t\t\t\t\t$$var = $val; // TODO: Check extract() for an alternative method\r\n\t\t\t\r\n\t\t\t$path = Kennel::cascade(\"{$this->view}\", 'views');\r\n\t\t\tif (!$path) return debug::error(\"View <strong>{$this->view}</strong> not found.\");\r\n\t\t\t\r\n\t\t\t//begin intercepting the output buffer\r\n\t\t\tob_start();\r\n\t\t\t\r\n\t\t\tif($path) require($path);\r\n\t\t\t\r\n\t\t\t//return the output and close the buffer\r\n\t\t\treturn ob_get_clean();\r\n\t\t\t\r\n\t\t\t//unset all template variables\r\n\t\t\tforeach ($this->vars as $var =>$val) {\r\n\t\t\t\tunset($$var);\r\n\t\t\t}\r\n\t\t}", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "public function show($view_name, $variables=[]){\n $contents = $this->engine->parse($this->view_loader->load($view_name),\n $variables\n );\n echo $contents;\n //$path = BASEPATH . '/views/' . $view_name;\n //$file = file_get_contents($path);\n //$file = $this->engine->parse($this->view_loader->load($view_name),\n // $variables\n // );\n //file_put_contents($path, $file);\n //dd($variables);\n //include BASEPATH . '/views/' . $view_name;\n }", "private function loadView($view, $data){\n $resolver = new TemplateMapResolver();\n $resolver->setMap(array(\n 'stepTemplate' => ROOT_PATH . '/module/BackOffice/view/back-office/wager/partials/wagerTypes/' . $view . '.phtml'\n ));\n \n //Create a view object and resolve the path base on the template map resolver above.\n $view = new PhpRenderer();\n $view->setResolver($resolver);\n \n //Create a view to use with the established template and add any variables that view will use.\n $viewModel = new ViewModel();\n $viewModel->setTemplate('stepTemplate')->setVariables(array(\n 'data' => $data\n ));\n \n return $view->render($viewModel);\n }", "public function getView() {\n\t\treturn $this -> st_view;\n\t}", "public function get_view( $view, $vars = array() ) {\n\n\t\tif ( isset( $this->template_dir ) ) {\n\t\t\t$template_dir = $this->template_dir;\n\t\t} else {\n\t\t\t$template_dir = $this->plugin_dir . '/inc/templates/';\n\t\t}\n\n\t\t$view_file = $template_dir . $view . '.tpl.php';\n\t\tif ( ! file_exists( $view_file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\textract( $vars, EXTR_SKIP );\n\t\tob_start();\n\t\tinclude $view_file;\n\t\treturn ob_get_clean();\n\t}", "protected static function render_view_static( $view, $vars = array() ) {\n\t\tob_start();\n\t\tinclude( TOOLSET_ADDON_MAPS_TEMPLATE_PATH . \"$view.phtml\" );\n\t\t$html = ob_get_contents();\n\n\t\tob_end_clean();\n\n\t\treturn $html;\n\t}", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "public function view(): mixed;", "public function content()\n {\n return $this->cache->get('content');\n }", "public function load_view( $view, $data = array() ) {\n return $this->_find_view( $view, ( array ) $data );\n }", "public function getOutput(){\n\n if (is_null($this->output)) {\n\n ob_start();\n\n extract($this->data);\n\n require $this->view;\n\n $this->output = ob_get_clean();\n\n return $this->output;\n }\n }", "private function renderView($path, $params)\n {\n ob_start();\n include $path;\n $content = ob_get_contents();\n ob_end_clean();\n\n return $content;\n }", "public function __toString()\n {\n $viewData = $this->variables;\n $templates = Context::getInstance()->getTemplates();\n if ($this->template != false) {\n $renderedTemplate = $templates->render($this->template, $viewData);\n $viewData['contents'] = $renderedTemplate;\n }\n if ($this->layout != false) {\n return $templates->render($this->layout, $viewData);\n }\n }", "public static function compile($view, $arguments = array()) {\n\t\t// store the view path\n\t\t$view_path = \"view/$view.view.php\";\n\n\t\t// initialize blank buffer\n\t\t$buffer = \"\";\n\n\t\t// does the view path exist\n\t\tif (file_exists($view_path)) {\n\t\t\t// start the output buffer\n\t\t\tob_start();\n\n\t\t\t// extract arguments from array into scope\n\t\t\textract($arguments);\n\n\t\t\t// get uri for the page\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\n\t\t\t// include the view\n\t\t\tinclude $view_path;\n\n\t\t\t// clean the buffer return what's in it\n\t\t\t$buffer = ob_get_clean();\n\t\t}\n\n\t\t// return the buffer\n\t\treturn $buffer;\n\t}", "protected function viewPage($view, $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$$key = $value;\n\t\t}\n\t\tob_start();\n\n\t\tinclude_once Application::$ROOT_DIR.\"/views/$view.php\";\n\n\t\treturn ob_get_clean();\n\t}", "protected static function capture_html($html, array $view_data)\n\t{\n\t\textract($view_data, EXTR_SKIP);\n\n\t\t// Capture the view output\n\t\tob_start();\n\n\t\ttry\n\t\t{\n\t\t\teval('?>' . $html);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Delete the output buffer\n\t\t\tob_end_clean();\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// Get the captured output and close the buffer\n\t\treturn ob_get_clean();\n\t}", "public function getViewScript()\n {\n return $this->__get(\"view_script\");\n }", "function getView() {\n\t\treturn $this->View;\n\t}", "public function output() {\n\n if (!file_exists($this->view)) {\n \treturn \"Voeg eerst een template toe ($this->view).<br />\";\n }\n $output = file_get_contents($this->view);\n \n foreach ($this->variabeles as $key => $variable) {\n \t$tagToReplace = \"[@$key]\";\n \t$output = str_replace($tagToReplace, $variable, $output);\n }\n\n return $output;\n }", "public function getView() {\n \t\n \t// Return the current view\n \treturn $this->sView;\n }", "public function render()\n {\n return $this->load($this->getFile(), $this->getVariables());\n }", "public function getViews(){\n\n if($this->safe($this->views)){\n //extract vlozi obsah z promenne do pohledu\n extract($this->data);\n extract($this->data, EXTR_PREFIX_ALL, \"\");\n require \"Views/\" . $this->views . \".phtml\";\n }\n }", "function get_view( $file = false, $args = array() ) {\n\t\tob_start();\n\t\t$this->display( $file, $args );\n\t\treturn ob_get_clean();\n\t}", "public function renderView(string $view, array $data = [])\n {\n return $this->templating->render($view, $data);\n }", "function displayView($view_path) {\r\n return Angie::getTemplateEngine()->displayView($view_path);\r\n }", "protected function _render($___viewFn, $___dataForView = array()) {\n\t\t\t$trace=debug_backtrace();\n\t\t\t$caller=array_shift($trace);\n\t\t\tif ($caller===\"element\") parent::_render($___viewFn, $___dataForView);\n\t\t\tif (empty($___dataForView)) {\n\t\t $___dataForView = $this->viewVars;\n\n\t\t }\n\n\t\t extract($___dataForView, EXTR_SKIP);\n\n\t\t foreach($___dataForView as $data => $value) {\n\t\t if(!is_object($data)) {\n\t\t $this->Smarty->assign($data, $value);\n\t\t }\n\t\t }\n\t\t ob_start();\n\n\t\t $this->Smarty->display($___viewFn);\n\n\t\t return ob_get_clean();\n\t\t}", "public function getView()\n\t{\n\t\treturn $this->client->getView();\n\t}", "public function getVars()\n {\n return $this->_contents;\n }", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function getView() {\n return $this->setView();\n }", "function render($view, $values = [])\n {\n // if view exists, render it\n if (file_exists(\"../views/{$view}\"))\n {\n // extract variables into local scope\n extract($values);\n\n // render view \n require(\"../views/{$view}\");\n exit;\n }\n\n // else error\n else\n {\n echo(\"Could not render\");\n }\n }", "public function render ($view, $vars = array()) {\r\n\n\t\t$vars['session'] = $this->session;\n\t\t\n\t\t$viewPath = $this->viewPath;\n\t\t\r\n\t\tob_start();\r\n\t\t\r\n\t\t$this->events->trigger(\"before:render\", [$this, &$vars]);\n\t\t\n\t\t// Get the extension\n\t\t$ext = pathinfo($view, PATHINFO_EXTENSION);\n\t\t\n\t\t$extHandlers = array(\n\t\t\t\t'php' => function ($vars, $view, $viewPath) {\n\t\t\t\t\textract($vars);\n\t\t\t\t\tinclude ($viewPath ?: \"\") . $view;\n\t\t\t\t}\n\t\t);\n\t\t$this->events->trigger(\"before:render:extension\", [&$extHandlers, $this]);\n\t\t\n\t\t\n\t\tif (!isset($extHandlers[$ext])) {\n\t\t\tthrow new \\Exception (\"Can not render view {$viewPath}{$view}. Handler for \\\"{$ext}\\\" extension is not added. Add with event before:render:extension.\");\n\t\t}\n\t\t\n\t\t$call = $this->events->trigger(\"mb:render:$ext\", array(), function () use($ext, $extHandlers) {\t\n\t\t\treturn $extHandlers[$ext];\n\t\t})[0];\n\t\t\n\t\t\n\t\t\n\t\t$call = \\Closure::bind($call, $this);\r\n\t\t$call($vars, $view, $viewPath);\r\n\n\t\t\r\n\t\t$content = ob_get_clean();\r\n\t\t$this->events->trigger(\"after:render\", [$view, &$content]);\r\n\t\treturn $content;\r\n\t}" ]
[ "0.6958564", "0.65205735", "0.6446336", "0.6357772", "0.6338112", "0.632415", "0.6304554", "0.62928534", "0.62894356", "0.6265343", "0.6259197", "0.624278", "0.62256587", "0.62107456", "0.61925095", "0.61783963", "0.6165439", "0.6151237", "0.60469496", "0.6033158", "0.6014881", "0.59561443", "0.5955893", "0.59373605", "0.59221905", "0.5863456", "0.58612853", "0.58612853", "0.58388275", "0.5822357", "0.5806819", "0.5806819", "0.5805308", "0.5793826", "0.5787796", "0.57833546", "0.5777786", "0.5777786", "0.5777786", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5756772", "0.5746651", "0.57443094", "0.57419544", "0.5741079", "0.5704643", "0.5696703", "0.5695848", "0.568769", "0.568769", "0.5681802", "0.56719184", "0.5662234", "0.5659942", "0.56521255", "0.56513494", "0.5650319", "0.56367517", "0.56153727", "0.56118095", "0.5603881", "0.55850774", "0.55836904", "0.55659527", "0.55552113", "0.5549171", "0.554404", "0.55279624", "0.5516121", "0.5509843", "0.550669", "0.5497558", "0.5495955", "0.5492909", "0.548994", "0.54764235", "0.54753995", "0.54747355", "0.54729563", "0.5463416", "0.54631394", "0.54597694", "0.54557544", "0.54550123", "0.54460907", "0.5438781", "0.543751", "0.5435733", "0.5429039", "0.54059416", "0.5395383", "0.5389059", "0.5381753", "0.53804046", "0.5377802" ]
0.0
-1
Normalize a view name.
protected function normalizeName($name) { $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; if (strpos($name, $delimiter) === false) { return str_replace('/', '.', $name); } list($namespace, $name) = explode($delimiter, $name); return $namespace.$delimiter.str_replace('/', '.', $name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function normalize($name);", "abstract function normalizedName();", "public function getNormalizedName() {\n\n $name = str_replace(' ', '_', $this->getName());\n $name = strtolower($name);\n\n return preg_replace('/[^a-z0-9_]/i', '', $name);\n }", "public static function normalize( $name ) {\n\t\treturn self::toAscii( self::upper($name));\n\t}", "protected function normalizeName($name)\n {\n $name = implode('', array_map('ucfirst', explode('-', $name)));\n\n // convert foo_bar to FooBar\n $name = implode('', array_map('ucfirst', explode('_', $name)));\n\n // convert foot/bar to Foo\\Bar\n $name = implode('\\\\', array_map('ucfirst', explode('/', $name)));\n\n return $name;\n }", "protected function parseViewModule($view)\n {\n if (preg_match('([^A-Za-z0-9\\-\\.])', $view)) {\n throw new InvalidArgumentException('View name contains invalid characters.');\n }\n\n $view = trim($view, '.');\n\n return $view;\n }", "private function normalizeIdentifier(string $name): string\n {\n if (preg_match('{[^\\x80-\\xFF]+$}AD', $name)) {\n return strtolower($name);\n }\n\n return $name;\n }", "protected function resolveViewObjectName() {}", "protected function normalize($key)\n {\n return str_replace('_', '', strtoupper($key));\n }", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "protected function normalizeHeaderName($name)\n {\n return strtr(ucwords(strtr(strtolower($name), array('_' => ' ', '-' => ' '))), array(' ' => '-'));\n }", "protected static function normalizeHeaderName($name)\n {\n return str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n }", "protected static function normalizeHeader(string $name)\n {\n $name = strtolower($name);\n $name = str_replace('-', ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '-', $name);\n return $name;\n }", "protected function _normalizeHeader($name)\r\n\t{\r\n\t\t$filtered = str_replace(array('-', '_'), ' ', (string)$name);\r\n\t\t$filtered = ucwords(strtolower($filtered));\r\n\t\t$filtered = str_replace(' ', '-', $filtered);\r\n\t\treturn $filtered;\r\n\t}", "protected function normalizeName($name)\n {\n // Replace slashes \"/\" with backslashes \"\\\" for easier typing.\n $name = trim(strtr($name, '/', '\\\\'));\n\n if (!preg_match(static::ENTITY_NAME, $name, $parts)) {\n throw new MappingException(<<<EOT\nThe entity name \"$name\" is not valid.\n\nSupported notations are:\n 1. Fully qualified class name (e.g., AppBundle\\Entity\\Post).\n 2. Shortcut notation (e.g., AppBundle:Post).\n\nYou can replace \"\\\" with \"/\" for easier typing.\nEOT\n );\n }\n\n $this->assertValidBundle($parts['bundle']);\n\n if (preg_match(static::ENTITY_SHORTCUT, $name)) {\n $name = $this->factory->getFqcnFromShortcut($name);\n }\n\n // Uppercase words.\n $inflector = new Inflector();\n $name = $inflector->ucwords($name, '\\\\');\n\n return $name;\n }", "public function unformatName($name);", "protected function normalizeContainerName($name) {\r\n\t\treturn strtolower ( $name );\r\n\t}", "protected function mangleMethodName($name) {\n // explode on _\n $parts = explode('_', $name);\n // beginning of name is lowercase\n $name = strtolower(array_shift($parts));\n // if our parts count is now 0, return\n if(count($parts) < 1) {\n return $name;\n }\n // strtolower the rest\n $parts = array_map('strtolower', $parts);\n // camelcase it\n $parts = array_map('ucfirst', $parts);\n return $name . implode($parts);\n }", "protected function normalizeName($name){\n \n // canary...\n if(is_numeric($name)){\n throw new InvalidArgumentException(sprintf('an all numeric $name like \"%s\" is not allowed',$name));\n }//if\n \n $ret_mix = null;\n \n if(is_array($name)){\n \n $ret_mix = array();\n \n foreach($name as $key => $val){\n $ret_mix[$key] = mb_strtolower((string)$val);\n }//foreach\n \n }else{\n \n // get rid of any namespaces...\n $ret_mix = str_replace('\\\\','_',$name);\n $ret_mix = mb_strtolower((string)$ret_mix);\n \n }//if/else\n \n return $ret_mix;\n \n }", "public function slug($name);", "protected function normalize_package_name( $name ) {\n\t\t$name = strtolower( $name );\n\t\treturn preg_replace( '/[^a-z0-9_\\-\\.]+/i', '', $name );\n\t}", "private function normalizeName($name)\n\t{\n\t\t$norm = '';\n\t\t$len = strlen($name);\n\n\n\t\t// replace white space with period\n\t\t$name = str_replace(' ', '.', $name);\n\n\n\t\t// name can only contain A-Z a-z 0-9 .\n\t\t$period = false;\n\n\t\tfor($i = 0; $i < $len; $i++)\n\t\t{\n\t\t\t$ascii = ord($name[$i]);\n\n\t\t\t# alpha (A - Z / a - z / 0 - 9 / .)\n\t\t\tif(($ascii >= 0x41 && $ascii <= 0x5A) || ($ascii >= 0x61 && $ascii <= 0x7A) || ($ascii >= 0x30 && $ascii <= 0x39))\n\t\t\t{\n\t\t\t\t$norm.= $name[$i];\n\t\t\t}\n\n\t\t\tif($period === false && $ascii == 0x2E)\n\t\t\t{\n\t\t\t\t$norm.= $name[$i];\n\n\t\t\t\t$period = true;\n\t\t\t}\n\t\t}\n\n\n\t\treturn $norm;\n\t}", "protected function _normalizeHeader($name) {\r\n\t\t$filtered = str_replace ( array (\r\n\t\t\t\t'-',\r\n\t\t\t\t'_' \r\n\t\t), ' ', ( string ) $name );\r\n\t\t$filtered = ucwords ( strtolower ( $filtered ) );\r\n\t\t$filtered = str_replace ( ' ', '-', $filtered );\r\n\t\treturn $filtered;\r\n\t}", "public static function standardize( $name ) {\n\t\treturn self::firstUpper( self::lower( $name )) ;\n\t}", "private function toBladeFormat($view) : string\n {\n $elements = explode('-', $view);\n $words = [];\n\n foreach ($elements as $element) {\n $words[] = ucfirst($element);\n }\n\n return implode('', $words);\n }", "public function getName()\n\t{\n\t\tif (empty($this->_name))\n\t\t{\n\t\t\t$classname = get_class($this);\n\t\t\t$viewpos = strpos($classname, 'View');\n\n\t\t\tif ($viewpos === false)\n\t\t\t{\n\t\t\t\tthrow new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500);\n\t\t\t}\n\n\t\t\t$lastPart = substr($classname, $viewpos + 4);\n\t\t\t$pathParts = explode(' ', JStringNormalise::fromCamelCase($lastPart));\n\n\t\t\tif (!empty($pathParts[1]))\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($pathParts[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($lastPart);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_name;\n\t}", "public static function normalizeHeaderName($name)\n {\n $result = str_replace(' ', '-', ucwords(str_replace(['-', '_'], ' ', strtolower($name))));\n return $result;\n }", "protected function normalizeName($name) {\n\t\tif ($name instanceof PHPParser_Node_Name) {\n\t\t\treturn $name;\n\t\t} else {\n\t\t\treturn new PHPParser_Node_Name ( $name );\n\t\t}\n\t}", "protected function viewsName()\n {\n return $this->argument('name');\n }", "protected function _normalizeHeader($name)\n {\n $filtered = str_replace(['-', '_'], ' ', (string) $name);\n $filtered = ucwords(strtolower($filtered));\n $filtered = str_replace(' ', '-', $filtered);\n return $filtered;\n }", "public function urlToActionName($name){\n // just turn dash-format into upperCamelCaseFormat\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $name) . 'Action';\n }", "public function normalize(string $input): string\n {\n return lcfirst(str_replace('_', '', ucwords($input, '_')));\n }", "public function sanatize($name)\n {\n $specialChars = array (\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"!\",\"~\",\"�\",\"\\\"\",\"�\",\"'\",\"=\",\"?\",\"/\",\"[\",\"]\",\"(\",\")\",\"|\",\"<\",\">\",\";\",\":\",\"\\\\\",\",\");\n return str_replace($specialChars, \"_\", $name);\n }", "protected function _normalizeKey($key)\n {\n $option = str_replace('_', ' ', strtolower($key));\n $option = str_replace(' ', '', ucwords($option));\n return $option;\n }", "private function filterName($name)\n {\n $name = ucfirst($name);\n $name = str_replace('_', ' ', $name);\n \n return $name;\n }", "protected function stripLocaleFromRouteName($name)\n {\n $parts = explode('.', $name);\n\n // If there is no dot in the route name,\n // there is no locale in the route name.\n if (count($parts) === 1) {\n return $name;\n }\n\n $locales = $this->getSupportedLocales();\n\n // If the first part of the route name is a valid\n // locale, then remove it from the array.\n if (in_array($parts[0], $locales)) {\n array_shift($parts);\n }\n\n // Rebuild the normalized route name.\n $name = join('.', $parts);\n\n return $name;\n }", "public function clean($name) {\n // try to parse the name\n $response = $this->parse($name);\n\n // return canonical form if available\n if ($response != NULL)\n return $response['canonical'];\n\n // by default return the input name\n return $name;\n }", "public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1);\n }", "protected function normalizeName(string $name): string\n {\n if ($this->filesystem->getExtension($name) === $this->extension) {\n $name = \\substr($name, 0, -(\\strlen($this->extension) + 1));\n }\n\n return $name;\n }", "protected function getView()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('.');\n }", "protected function parseName($name)\n {\n return ucwords(str_plural($name));\n }", "public static function normalizeUsername(string $username = null): string\n {\n return strtolower(preg_replace('/((?![a-zA-Z0-9]+).)/', '', $username));\n }", "private function underscore(string $name)\n {\n $name = preg_replace_callback(\n '/[A-Z][A-Z]+/',\n function ($matches) {\n if (strlen($matches[0]) === 2) {\n return ucfirst(strtolower($matches[0]));\n } else {\n $lastChar = substr($matches[0], strlen($matches[0]) - 1, 1);\n $subject = substr($matches[0], 0, strlen($matches[0]) - 1);\n\n return ucfirst(strtolower($subject)).$lastChar;\n }\n },\n $name\n );\n\n return Inflector::tableize($name);\n }", "function unu_ ($s) {\n $s = preg_replace('/^u_/', '', $s);\n return v($s)->u_to_camel_case();\n}", "public function normalize($vatNumber) {\n\t\t$vatNumber = strtoupper($vatNumber);\n\t\t$vatNumber = preg_replace('/[^A-Z0-9]/', '', $vatNumber);\n\n\t\treturn $vatNumber;\n\t}", "private function fixMethodName($name)\n {\n $var_key = str_replace('_', ' ', $name);\n $var_lower = strtolower($var_key);\n $var_ucf = ucwords($var_lower);\n return str_replace(' ', '', $var_ucf);\n }", "protected function cleanQueryName(string $name): string\n {\n return str_replace('_', ' ', urldecode($name));\n }", "public static function normAlias($alias) {\n return preg_replace(\"#[^-a-z0-9]#\", \"\", strtolower($alias));\n }", "public static function filterUpName( ?string $name ) : string {\n\t\tif ( empty( $name ) ) {\n\t\t\treturn '_';\n\t\t}\n\t\t\n\t\t$name\t= \\preg_replace('/[^\\pL_\\-\\d\\.\\s]', ' ' );\n\t\treturn \\preg_replace( '/\\s+/', '-', \\trim( $name ) );\n\t}", "function snakeToCamelCase(string $validator_name): string\r\n {\r\n $str_arr = explode(\"_\", $validator_name);\r\n if (count($str_arr) === 1) {\r\n return $str_arr[0];\r\n }\r\n $func_name = array_reduce(\r\n $str_arr,\r\n function ($current, $word) use ($validator_name) {\r\n $pos = strpos($word, $validator_name);\r\n if (!empty($current)) {\r\n $word[0] = strtoupper($word[0]);\r\n }\r\n return $current . $word;\r\n },\r\n \"\"\r\n );\r\n\r\n return $func_name;\r\n }", "protected function toInternalEventName($event_name)\n {\n return strtolower(str_replace('.', '', $event_name));\n }", "function sanitize_name( $name ) {\r\n\t\t$name = sanitize_title( $name ); // taken from WP's wp-includes/functions-formatting.php\r\n\t\t$name = str_replace( '-', '_', $name );\r\n\r\n\t\treturn $name;\r\n\t}", "protected function normalizeName($name) {\n\t\tif ($name instanceof NameNode) {\n\t\t\treturn $name;\n\t\t} else {\n\t\t\treturn new NameNode($name);\n\t\t}\n\t}", "public function cleanName()\n {\n $name = strtolower($this->name);\n $name = str_replace('á', 'a', $name);\n $name = str_replace('é', 'e', $name);\n $name = str_replace('í', 'i', $name);\n $name = str_replace('ó', 'o', $name);\n $name = str_replace('ú', 'u', $name);\n $name = str_replace('Á', 'a', $name);\n\n return $name;\n }", "private function normalizeTemplateName($templateName)\n {\n if (strripos($templateName, '.twig')) {\n return $templateName;\n }\n $phppos = strripos($templateName, '.php');\n if ($phppos) {\n $templateName = substr($templateName, 0, $phppos);\n }\n $tplpos = strripos($templateName, '.tpl');\n if ($tplpos) {\n $templateName = substr($templateName, 0, $tplpos);\n }\n return $templateName.'.twig';\n }", "protected function stripLocaleFromRouteName(string $name): string {\n $parts = explode('.', $name);\n\n /** If there is no dot in the route name, couldn't be a locale in the name. */\n if (count($parts) === 1) {\n return $name;\n }\n\n /** Get the locales from the configuration file */\n $locales = config('translatable.locales', []);\n\n /** If the first part of the route name is a valid locale, then remove it from the array. */\n if (in_array($parts[0], $locales)) {\n array_shift($parts);\n }\n\n /** Rebuild the normalized route name. */\n return implode('.', $parts);\n }", "private function transformName( $name ): string {\n\t\treturn lcfirst( implode( '', array_map( 'ucfirst', explode( '-', $name ) ) ) );\n\t}", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "function makeNameLoud($name) {\n return strtoupper($name);\n }", "public static function normalize($original) {\n\t\treturn strtoupper(preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $original));\n\t}", "function validName($name) {\n \n return preg_replace('/\\s+/', '_',$name);\n\n}", "protected function getNameInput()\n {\n if ($this->option('r')) {\n $name = trim($this->argument('name'));\n } else {\n $explode = explode('.', trim($this->argument('name')));\n $name = $explode[count($explode) - 1];\n }\n return Str::slug($name);\n }", "public static function normalizeName($name, $make_lowercase = true)\r\n {\r\n // Warn user of deprecation\r\n trigger_error(\r\n 'Use the normalization options and the other normalization methods instead.',\r\n E_USER_DEPRECATED\r\n );\r\n\r\n /**\r\n * Lowercasing header names allows for a more uniform appearance,\r\n * however header names are case-insensitive by specification\r\n */\r\n if ($make_lowercase) {\r\n $name = strtolower($name);\r\n }\r\n\r\n // Do some formatting and return\r\n return str_replace(\r\n array(' ', '_'),\r\n '-',\r\n trim($name)\r\n );\r\n }", "public function name_to_slug( $name ) {\n\t\treturn sanitize_title( str_replace( '\\\\', '-', str_replace( '::', '-', $name ) ) );\n\t}", "function p_url2name($url) {\n\treturn ucwords(\n\t\tstr_replace('~', ' / ',\n\t\tstr_replace('.', '-',\n\t\tstr_replace('-', ' ', $url))));\n}", "private function fixHumanName($human_name = '')\n {\n $human_name = preg_replace('/[^A-Za-z0-9_\\s-]/', '', $human_name);\n // Cleanup multiple dashes or whitespaces\n $human_name = preg_replace('/[\\s-]+/', ' ', $human_name);\n // Replace whitespaces with underscores\n $human_name = preg_replace('/[\\s]/', '_', $human_name);\n\n return $human_name;\n }", "private function parseName($name)\n {\n $rootNamespace = $this->laravel->getNamespace();\n\n if (starts_with($name, $rootNamespace)) {\n return $name;\n }\n\n if (str_contains($name, '/')) {\n $name = str_replace('/', '\\\\', $name);\n }\n\n return $this->parseName($this->getDefaultNamespace(trim($rootNamespace, '\\\\')) . '\\\\' . $name);\n }", "public function denormalize(string $input): string\n {\n $lcPropertyName = lcfirst($input);\n $snakeCasedName = '';\n\n $len = \\strlen($lcPropertyName);\n for ($i = 0; $i < $len; ++$i) {\n if (ctype_upper($lcPropertyName[$i])) {\n $snakeCasedName .= '_' . strtolower($lcPropertyName[$i]);\n } else {\n $snakeCasedName .= strtolower($lcPropertyName[$i]);\n }\n }\n\n return $snakeCasedName;\n }", "protected function prepareName($name) {\n\t$name = strip_tags(trim($name));\n\t$name = preg_replace('/[^\\w\\s\\-А-Яа-я]/u', '', $name);\n\t$name = mb_strtolower($name, Yii()->charset);\n\t//$name = mb_ucfirst($name);\n\t$name = mb_ucwords($name);\n\treturn $name;\n }", "function sanitize($name)\n {\n return preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n }", "protected function _getCaseInsensitiveName($name) {\n\n return str_replace('_', '-', mb_strtolower($name));\n\n }", "protected static final function unmung($thing) {\n\t\treturn lcfirst(preg_replace_callback('/_([a-z])/', function ($m) { return strtoupper($m[1]); }, $thing));\n\t}", "protected function _normalize($value)\n {\n return strtolower($value);\n }", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "public static function URLPurify($name) {\n\t\t$name = preg_replace(\"/[^a-zA-Z0-9\\s\\-]/\", \"\", $name); //Remove all non-alphanumeric characters, except for spaces\n\t\t$name = preg_replace(\"/[\\s]/\", \"-\", $name); //Replace remaining spaces with a \"-\"\n\t\t$name = str_replace(\"--\", \"-\", $name); //Replace \"--\" with \"-\", will occur if a something like \" & \" is removed\n\t\treturn strtolower($name);\n\t}", "protected static function normalizeHost($host)\n {\n return strtolower($host);\n }", "public static function convertName($name)\n {\n if (0 === strpos($name, '@') && false !== strpos($name, '/')) {\n $name = ltrim(str_replace('/', '--', $name), '@');\n }\n\n return $name;\n }", "public static function convertAliasName($name)\n {\n if (preg_match('/([\\w0-9\\/_-]+)-\\d+(.\\d+)?.[\\dxX]+$/', $name, $matches)) {\n return $matches[1];\n }\n\n return $name;\n }", "public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}", "public static function sanitizeTechString($name) {\r\n $name = preg_replace('@[^a-zA-Z0-9_-]@', '', $name);\r\n\treturn $name;\r\n }", "public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1) . 'Action';\n }", "private function sanitize( $doc_name ) {\n\t\tif ( ! is_string( $doc_name ) ) {\n\t\t\tthrow new InvalidArgumentException();\n\t\t}\n\t\t/* Max characters. */\n\t\t$length = strlen( $doc_name );\n\t\tif ( $length >= 128 ) {\n\t\t\tthrow new InvalidArgumentException();\n\t\t}\n\t\t/* Whitelist: a-z (case-insensitive), 0-9, - and . are allowed. */\n\t\tfor ( $index = 0; $index < $length; ++$index ) {\n\t\t\t$chr = substr( $doc_name, $index, 1 );\n\t\t\tif ( 0 === preg_match( '/^([a-z]|[0-9]|-|\\.)$/i', $chr ) ) {\n\t\t\t\tthrow new InvalidArgumentException();\n\t\t\t}\n\t\t}\n\t\treturn $doc_name;\n\t}", "private function normalizeHeader(string $header): string\n {\n return ucwords($header, '-');\n }", "protected function parseModelName($name)\n {\n $rootNamespace = $this->laravel->getNamespace();\n\n if (Str::startsWith($name, $rootNamespace)) {\n return $name;\n }\n\n if (Str::contains($name, '/')) {\n $name = str_replace('/', '\\\\', $name);\n }\n\n return $this->parseModelName(trim($rootNamespace, '\\\\').'\\\\'.$name);\n }", "function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}", "public function setNameView($name = NULL ){\n\t\t$this->nameView = $name ? $name : \"Ver \".$this->name;\n\t}", "private function _getPathNormalized( $sPath ) {\r\n $sPath = str_replace( '\\\\', '/', $sPath );\r\n $sPath = preg_replace( '|(?<=.)/+|', '/', $sPath );\r\n if ( ':' === substr( $sPath, 1, 1 ) ) {\r\n $sPath = ucfirst( $sPath );\r\n }\r\n return $sPath;\r\n }", "protected function getViewPath()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('/');\n }", "public function formatName($name);", "public function invertName($name)\n {\n if (!$name) {\n return '';\n } else {\n return $this->formatName($this->removeHonorifics($this->splitNames($name)));\n }\n }", "public function humanizeName($name)\n {\n return $name = Inflector::humanize(Inflector::camel2words($name));\n }", "private function stringToViewFormat($view)\n {\n $elements = explode('.', $view);\n $route = [];\n\n foreach ($elements as $element) {\n $route[] = $this->toBladeFormat($element);\n }\n\n return implode('/', $route);\n }", "private function guessName () : string {\n return $this->inflector()->pluralize($this->inflector()->tableize(class_basename($this)));\n }", "public function humanize()\n {\n $str = UTF8::str_replace(array('_id', '_'), array('', ' '), $this->str);\n\n return static::create($str, $this->encoding)->trim()->upperCaseFirst();\n }", "protected function getRealName($name)\n {\n $pattern = '/(html|htm|xhtml|php|js|css|xml|json)$/';\n if (0 === preg_match($pattern, $name)) {\n $name = preg_replace('/(\\/)$/', '', $name).'/'.$this->indexName;\n }\n\n return $name;\n }", "public function formatActionName($unformatted)\n {\n return strtolower(substr($this->_formatName($unformatted),0,1)) . substr($unformatted,1) . 'Action';\n }", "public function cleanToName($name){\n // Remove empty space\n $name = str_replace(' ', '', $name);\n // Remove special character\n $name = preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n // Return without numbers\n return preg_replace('/[0-9]+/', '', $name);\n \n }", "function evaluate_name($name){\n\t$name = strtolower($name);\n\t$name = str_replace(\" \",\"\",$name);\n\n\treturn $name;\n}", "public static function sanitize_file_name( $name ) {\n\t\t$name = strtolower( $name );\n\t\t$name = preg_replace('/&.+?;/', '', $name); // kill entities\n\t\t$name = str_replace( '_', '-', $name );\n\t\t$name = preg_replace('/[^a-z0-9\\s-.]/', '', $name);\n\t\t$name = preg_replace('/\\s+/', '-', $name);\n\t\t$name = preg_replace('|-+|', '-', $name);\n\t\t$name = trim($name, '-');\n\t\treturn $name;\n\t}" ]
[ "0.666268", "0.65062076", "0.6333614", "0.6043069", "0.60063213", "0.5889518", "0.57960624", "0.57744867", "0.57740855", "0.5633269", "0.56278265", "0.5625101", "0.56176406", "0.55424696", "0.55307835", "0.5516561", "0.5500416", "0.54772234", "0.5450158", "0.54463613", "0.5443258", "0.5435339", "0.54226977", "0.54133284", "0.5405512", "0.5385423", "0.53827626", "0.5380816", "0.536576", "0.5360447", "0.5346897", "0.5335177", "0.5329571", "0.53097826", "0.53050655", "0.52883446", "0.5281774", "0.5280567", "0.52728003", "0.5263599", "0.5231869", "0.5226723", "0.5208917", "0.51944256", "0.51869893", "0.51856965", "0.5156095", "0.515073", "0.5149068", "0.5147697", "0.5143432", "0.5139686", "0.5123088", "0.51109475", "0.5110153", "0.5104277", "0.5100995", "0.50875723", "0.50758386", "0.5058938", "0.50488615", "0.50261194", "0.5024502", "0.5016682", "0.5014683", "0.50141674", "0.5013666", "0.5005991", "0.4998717", "0.49969342", "0.49967736", "0.49952134", "0.4971637", "0.49681827", "0.4961748", "0.4961532", "0.49520308", "0.49383497", "0.49217108", "0.49162605", "0.49130192", "0.49112794", "0.49021646", "0.49019724", "0.49013707", "0.48917022", "0.488739", "0.4887371", "0.48667622", "0.48380655", "0.48276067", "0.48216325", "0.48211002", "0.48198295", "0.48179072", "0.48077708", "0.4797648", "0.47911954", "0.4789702", "0.47877735" ]
0.668143
0
Dynamically pass methods to the factory.
public function __call($method, $parameters) { return call_user_func_array([$this->factory, $method], $parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add() {\n return call_user_func_array( array( get_class(), 'factory' ), func_get_args() );\n }", "public function make($factory);", "public function map(array $methods, string $pattern, $callable): MethodsInterface;", "public function __invoke()\n {\n $params = array_merge($this->params, func_get_args());\n return $this->factory->newInstance(\n $this->class,\n $params,\n $this->setter\n );\n }", "public function __invoke()\n {\n $params = array_merge($this->params, func_get_args());\n $resolve = $this->resolver->resolve(\n $this->class,\n $params,\n $this->setters\n );\n\n $object = $resolve->reflection->newInstanceArgs($resolve->params);\n foreach ($resolve->setters as $method => $value) {\n $object->$method($value);\n }\n\n return $object;\n }", "public function createMethod()\n {\n return $this->addExcludesNameEntry($this->methods);\n }", "abstract public function provideFunctors();", "abstract public function factoryMethod(): Product;", "public function testProxyMethods()\n {\n $factory = OpenExchangeRatesFactory::create(['key' => '']);\n $this->assertTrue(is_callable([$factory, 'is']), 'Factory::is');\n $this->assertTrue(is_callable([$factory, 'base']), 'Factory::base');\n $this->assertTrue(is_callable([$factory, 'newRates']), 'Factory::newRates');\n $this->assertTrue(is_callable([$factory, 'getRates']), 'Factory::getRates');\n $this->assertTrue(is_callable([$factory, 'getRate']), 'Factory::getRate');\n $this->assertTrue(is_callable([$factory, 'getBase']), 'Factory::getBase');\n $this->assertTrue(is_callable([$factory, 'convert']), 'Factory::convert');\n }", "function set_model_factory_method($method_name)\n {\n $this->_model_factory_method = $method_name;\n }", "abstract protected function setMethod();", "public function getDynamicMethods()\n {\n return [];\n }", "public function getFactory() {}", "protected function buildAvailableByMethod()\n {\n \treturn $this->availableByMethod = collect((new ReflectionClass($this))->getMethods())\n\t \t->map->name\n\t \t->filter(function ($method) {\n\t \t\treturn Str::startsWith($method, 'create') && Str::endsWith($method, 'Driver');\n\t \t})\n\t \t->map(function ($method) {\n\t \t\treturn Str::replaceLast(\n\t \t\t\t'Driver',\n\t \t\t\t'',\n\t \t\t\tStr::after($method, 'create')\n\t \t\t);\n\t \t})\n\t \t->toArray();\n }", "protected static function newFactory()\n {\n //\n }", "public function __invoke($arg) {\r\n return self::factory($arg);\r\n }", "public function invokeMethods(array $methods) : InflectorInterface;", "abstract protected function createHandler();", "abstract protected function create($funcName);", "public function __call($method, $parameters);", "protected function create() {\n return call_user_func_array(parent::$drivers[$this->options['driver']], array($this));\n }", "public function __call($method, $args);", "public function testMagicThroughGetAndCall()\n {\n $di = new DIFactoryConfigMagic(\"di.php\");\n\n $di->set(\"dummy\", function () {\n $obj = new DummyService();\n return $obj;\n });\n\n $obj = $di->get(\"dummy\");\n $this->assertInstanceOf('\\Anax\\DI\\DummyService', $obj);\n\n $res = $di->get(\"dummy\")->property;\n $this->assertEquals(\"property\", $res);\n\n $res = $di->get(\"dummy\")->method();\n $this->assertEquals(\"method\", $res);\n\n $obj = $di->dummy;\n $this->assertInstanceOf('\\Anax\\DI\\DummyService', $obj);\n\n $obj = $di->dummy();\n $this->assertInstanceOf('\\Anax\\DI\\DummyService', $obj);\n\n $res = $di->dummy->property;\n $this->assertEquals(\"property\", $res);\n\n $res = $di->dummy->method();\n $this->assertEquals(\"method\", $res);\n }", "public function call()\n {\n foreach (config('lucy.crud') as $type) {\n if ($this->builder->getAttribute($type)) {\n $method = 'call'.ucfirst(strtolower($type));\n\n $this->{$method}();\n }\n }\n }", "public function as_factory($obj,$val){\n if(!$val instanceof \\Closure){\n $val = function($app) use($val){\n return $app->resolve_dependencies($val);\n };\n }//if\n $this[$obj] = $this->factory($val);\n }", "public function methods();", "public function __invoke()\n {\n if (empty($this->arguments)) {\n if (empty($this->methods)) {\n $object = $this->container->build($this->class);\n } else {\n $object = new $this->class;\n }\n } else {\n $reflection = new \\ReflectionClass($this->class);\n\n $arguments = array();\n\n foreach ($this->arguments as $arg) {\n if (is_string($arg) && (class_exists($arg) || $this->container->bound($arg))) {\n $arguments[] = $this->container->resolve($arg);\n continue;\n }\n\n $arguments[] = $arg;\n }\n\n $object = $reflection->newInstanceArgs($arguments);\n }\n\n return $this->callMethods($object);\n }", "public function __invoke($value): ParsedFactoryInterface;", "private function createMethods(string $fqn, string $base): string\n {\n return implode(array_map(function (string $methodName) use ($fqn, $base): string {\n $static = Reflection::isMethodStatic($base, $methodName) ? 'static' : '';\n $arguments = Reflection::getMethodSignature($base, $methodName);\n $returnType = Reflection::getReturnType($base, $methodName);\n\n [$evaluator, $context] = ((bool) $static) ? ['staticEvaluate', 'self::class'] : ['evaluate', '$this'];\n\n MethodProxyRepository::register($fqn, $methodName, $this->methods[$methodName]);\n\n return \"\n final public $static function $methodName($arguments) $returnType\n {\n return \\\\Pest\\\\Repositories\\\\MethodProxyRepository::$evaluator(\n $context,\n '$methodName',\n func_get_args()\n );\n }\n \";\n }, array_keys($this->methods)));\n }", "function wc_fabric_add_to_gateways( $methods ) {\n // Add\n $methods [] = __NAMESPACE__ . '\\\\WC_Fabric_Gateway';\n return $methods ;\n}", "public function __call($factory, $parameters) {\n\t\treturn $this->__callStatic($factory, $parameters);\n\t}", "public function maker()\n {\n $name = $this->_name;\n return function ($class) use ($name) {\n $table = TableRegistry::get($name);\n return $table->newEntity();\n };\n }", "public function __invoke()\n\t{\n\t\t// No options given. New strategy. Return a new object\n\t\t$class = get_called_class();\n\t\t$newHelper = new $class;\n\t\t$newHelper->setView($this->getView());\n\t\treturn $newHelper;\n\t}", "protected function create() {\n return call_user_func_array(static::$drivers[$this->options['driver']], array($this));\n }", "public function getFactoryPostfix();", "public function __call($method, $arguments) {}", "public function __call($method, $arguments) {}", "public function toMethod()\n {\n $method = new DynamicMethod($this->parts());\n\n return $this->applyOutputFormat($method);\n }", "public static function with($method);", "public function set(TestCaseMethodFactory $method): void\n {\n foreach ($this->testCaseFilters as $filter) {\n if (! $filter->accept($method->filename)) {\n return;\n }\n }\n\n foreach ($this->testCaseMethodFilters as $filter) {\n if (! $filter->accept($method)) {\n return;\n }\n }\n\n if (! array_key_exists($method->filename, $this->testCases)) {\n $this->testCases[$method->filename] = new TestCaseFactory($method->filename);\n }\n\n $this->testCases[$method->filename]->addMethod($method);\n }", "protected function getFactoryMethod(array $variables): string\n {\n $methodClassName = $variables['methodClassName'];\n $interfaceClassName = $variables['interfaceClassName'];\n $returnedClassName = $variables['returnedClassName'];\n $returnedObjectName = $returnedClassName;\n\n\n if (false === $this->useCustomInterfaces) {\n $returnedType = $returnedObjectName;\n } else {\n $returnedType = \"Custom\" . $interfaceClassName;\n }\n\n\n $tpl = __DIR__ . \"/../assets/classModel/Ling/template/partials/getUserObject.tpl.txt\";\n $content = file_get_contents($tpl);\n\n $content = str_replace('returnedUserObjectInterface', $returnedType, $content);\n $content = str_replace('UserObjectInterface', $returnedType, $content);\n\n\n $content = str_replace('new UserObject', 'new ' . $returnedObjectName, $content);\n\n $moreCalls = '';\n $content = str_replace('//moreCalls', $moreCalls, $content);\n\n\n $content = str_replace('getUserObject', \"get\" . $methodClassName, $content);\n return $content;\n }", "public function addBuildFactoryMethod(DI\\FactoryMethod $factory)\n {\n $this->getBuilder()->addFactoryMethod($factory);\n return $this;\n }", "public static function make($callFunctionName): self;", "private function _callToDefault()\n {\n foreach (get_class_methods($this) as $method) {\n try {\n $that = new ReflectionMethod($this, $method);\n } catch (ReflectionException $exception) {\n break;\n }\n if (\n $that->isProtected()\n && !array_key_exists($method, $this->query())\n ) {\n $this->{$method}($this->builder);\n }\n }\n }", "public function withMethod($method)\n {\n }", "public function withMethod($method)\n {\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function make($strategy);", "abstract protected function _getChildFactory($child, $config);", "protected function getResponseFactory()\n {\n }", "function processMethods( &$method, $key )\r\n{\r\n $method = $method->name;\r\n}", "public function map(array $methods, $pattern, $callable)\n\t\t{\n if(!empty($this->groups))\n {\n \t$pp = '';\n \tforeach($this->groups as $group)\n \t $pp .= $group->getPattern();\n\n \t\t$pattern = $pp . $pattern;\n }\n\n\t\t\t// Create a new route\n\t\t\t$route = new Route($methods, $pattern, $callable, $this->groups);\n\t\t\t$route->setContainer($this->container);\n\n\t\t\t// Add route to routes\n\t\t\t$this->routes[] = $route;\n\n\t\t\treturn $route;\n\t\t}", "public function __call(string $method, array $parameters);", "function __call($method ,$params)\n {\n return self::handleCall($method ,$params);\n }", "public function __construct(string $path,array|callable $params, string|array $methods=['GET']) {\n $this->path = ($path);\n $this->isFunction = is_callable($params);\n if($this->isFunction){\n //$param is an executable function\n $this->function = $params;\n }\n else if(is_array($params)){\n $this->controller = $params['Controller']??\"\";\n $this->action = $params['Action']??\"\"; \n }\n if(is_string($methods) && trim($methods) !== \"\"){ \n $this->methods = preg_split(\"/[,|]/\",$methods); \n }\n else if(is_array($methods)){\n $this->methods = /*sizeof($methods)==0?['GET']:*/$methods;//by default set to GET method\n }\n //convert every methods in uppercase\n $limit = sizeof($this->methods);\n for($i = 0; $i < $limit; $i++){ \n if(trim($this->methods[$i]) === \"\"){\n //discarding blank spaces\n continue;\n }\n $this->methods[$i] = strtoupper(trim($this->methods[$i]));\n }\n }", "public function getInjectMethods() {}", "abstract public function configure_method_settings();", "public static function __callStatic($method, $args){\n\t\t$args = array_merge([$method], $args);\n\t\treturn call_user_func_array('self::create', $args);\n\t}", "public function generateEachMethodValues()\n {\n $ahp_method_service = new AhpMethodService();\n $ahp_method_service->recalculateAhpValues();\n\n // Generate wp method values\n $wp_method_service = new WpMethodService();\n $wp_method_service->recalculateWpValues();\n }", "public function __call($method, $arguments);", "public function __call($method, array $arguments) {}", "abstract protected function registerFunctions();", "abstract protected function modelFactory();", "public static function registerSorter( $spec, $factoryMethod )\r\n {\r\n $self = self::getInstance();\r\n // cast spec to string, to avoid allocation a big array\r\n $self->_sorterFactoryMethods[ (string)$spec ] = $factoryMethod;\r\n }", "protected function addModelFactoryMethod($relation, $columns\n , $type = BuilderConfig::MODEL_FACTORY_RETURN_MULTIPLE) {\n\n if (!is_array($columns)) {\n $columns = [$columns];\n }\n\n if (stripos($relation, '.') === false) {\n $relation = 'public.' . $relation;\n }\n\n if (!isset($this->modelFactoryMethods[$relation])) {\n $this->modelFactoryMethods[$relation] = [];\n }\n $this->modelFactoryMethods[$relation][] = [\n 'columns' => $columns,\n 'type' => $type\n ];\n }", "abstract public function processMethod (ReflectionMethod $met, $className);", "abstract public function build($callback, $path = null, $method = null, $count_match = true, $name = null);", "function __call($method, $args=[])\n {\n \tcall_user_func_array($this->container[$method], $args);\n }", "public function run()\n {\n $methods = [\n [\n 'payment_name' => 'BNI',\n 'payment_method_img' => 'bni.png',\n ],\n [\n 'payment_name' => 'BCA',\n 'payment_method_img' => 'bca.png',\n ],\n [\n 'payment_name' => 'BRI',\n 'payment_method_img' => 'bri.png',\n ],\n ];\n\n foreach ($methods as $key => $value) {\n Payment::create($value);\n \n }\n }", "protected function createFactory()\n {\n $factory = Str::studly(class_basename($this->argument('name')));\n\n $this->call('make:factory', [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __get(string $method);", "function clientCode(AbstractClass $class)\n{\n // ...\n $class->templateMethod();\n // ...\n}", "abstract public function getReflection($method);", "public abstract function make();", "abstract function &create();", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$methods = array();\n\t\t\n\t\tif( !empty($args) ) {\n\t\t\tif( is_string($args) && !empty(trim($args)) ) {\n\t\t\t\t$methods[] = $args;\n\t\t\t} elseif( is_array($args) ) {\n\t\t\t\t$methods = array_merge($this->methods, $args);\n\t\t\t\t$methods = array_unique(array_filter($methods));\n\t\t\t}\n\t\t\t\n\t\t\t$this->methods = $methods;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "protected function createHandlerCode($methods) {\n $code = '';\n $methods = array_merge($methods, $this->reflection->getMethods());\n foreach ($methods as $method) {\n if ($this->isConstructor($method)) {\n continue;\n }\n $mock_reflection = new SimpleReflection($this->mock_base);\n if (in_array($method, $mock_reflection->getMethods())) {\n continue;\n }\n $code .= \" \" . $this->reflection->getSignature($method) . \" {\\n\";\n $code .= \" \\$args = func_get_args();\\n\";\n $code .= \" \\$result = &\\$this->invoke(\\\"$method\\\", \\$args);\\n\";\n $code .= \" return \\$result;\\n\";\n $code .= \" }\\n\";\n }\n return $code;\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user/:userId' => 'updateCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function run()\n {\n PaymentMethods::create(['name' => 'PayPal_Express']); // Register PayPal\n\n PaymentMethods::create(['name' => 'Stripe']); // Register Stripe\n }", "abstract public function runTarget($method, &$params);", "abstract protected function create ();", "static public function factory($config) {}", "public function populateMethodCache()\n {\n foreach ($this->getPluginHandler()->getPlugins() as $plugin) {\n $reflector = new ReflectionClass($plugin);\n foreach ($reflector->getMethods() as $method) {\n $name = $method->getName();\n if (strpos($name, self::METHOD_PREFIX) === 0\n && !isset($this->methods[$name])\n ) {\n $this->methods[$name] = array(\n 'total' => $method->getNumberOfParameters(),\n 'required' => $method->getNumberOfRequiredParameters()\n );\n }\n }\n }\n }", "public function dynamicCommands()\n {\n $output = array();\n\n $command = Request::segment(2);\n $attributes= array_except( Request::segments() , [0,1]);\n if(method_exists($this,$command))\n {\n $attributes = $this->normalizeAttributes($attributes);\n\n $items = call_user_func_array(array($this, $command), $attributes);\n $output = $items;\n } else\n {\n $output = array('error'=>'El metodo no existe');\n }\n\n return Response::multiple($output);\n }", "private function addCustomFactories(): void\n {\n foreach (self::customFactories() as $factory) {\n $this->models->add($factory);\n }\n }", "public function run()\n {\n Method::create(['id' => Method::METHOD_ID_CASH, 'name' => 'Barzahlung bei Lieferung', 'default' => true, 'active' => true]);\n Method::create(['id' => Method::METHOD_ID_CARD, 'name' => 'Kartenzahlung bei Lieferung', 'default' => false, 'active' => true]);\n Method::create(['id' => Method::METHOD_ID_PAYPAL, 'name' => 'PayPal', 'default' => false, 'active' => true]);\n }", "abstract protected function registerHandlers();", "public static function __callStatic($method, $parameters);", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "private function use_by_class($classname)\n {\n $reflection = new ReflectionClass($classname);\n\n //get all methods inside of the new module object\n $methods = $reflection->getMethods();\n\n //for each method in module class\n foreach($methods as $method)\n {\n //if the method isn't public/static, ignore it\n if(!$method->isPublic())\n continue;\n\n //get the minimum and maximum amount of parameters for the method\n $min_args = $method->getNumberOfRequiredParameters();\n $max_args = $method->getNumberOfParameters();\n\n //and get the method's name\n $function_name = $method->getName();\n\n //if the function takes no arguments, assume it's variadic\n if($max_args === 0 && $min_args === 0)\n {\n $num_args = array(-1);\n $positions_by_reference = array();\n } \n else\n {\n //otherwise, assume it may have any amount of arguments between the minimum and maximum, plus the first argument, $self\n $num_args = range($min_args - 1, $max_args - 1);\n\n //Parse each of the arguments for the function; this will allow us to use PHP decorations (like by-reference)\n //to more easily construct mathscript modules.\n //\n //This isn't the cleanest way to do this, but as PHP lacks decorators... this is probably the easiest on the developer.\n $params = $method->getParameters();\n\n //Positions which are marked as \"pass by reference\" are noted specially, as this has a special meaning in mathscript.\n //(\"Pass by name.\")\n $positions_by_reference = array();\n\n //Find any positional argument which is passed by reference.\n //Note that we subtract one; as the first argument should always be $self.\n foreach($params as $position => $param)\n if($param->isPassedByReference()) \n $positions_by_reference[$position - 1] = true;\n\n }\n\n //add the function to our function cache\n $this->function_cache[$function_name] = array\n (\n 'argcount' => $num_args,\n 'signature' => array($classname, $function_name),\n 'reference_positions' => $positions_by_reference,\n 'returns_by_reference' => $method->returnsReference()\n );\n }\n }", "public function get_method();", "private static function precall_getInstance(){\n $in = func_get_args();\n $reflect = new \\ReflectionClass(__CLASS__);\n return $reflect->newInstanceArgs($in);\n }", "public static function make(...$args);", "public static function setFactoryFunction( $factory ) \n\t{\n\t\tself::$factory = $factory;\n\t}", "function dataPipeFactory($mapManager, $dataManager) {\r\n\r\n\t$dataPipe = \"\";\r\n\tswitch ( $_REQUEST['pipe'] ) {\r\n\t\r\n\t\tcase \"sequenceoid\" :\r\n\t\t\t$dataPipe = new SequenceoidDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\t\t\t\r\n\t\t\t\r\n\t\tcase \"nextsteps\" :\r\n\t\t\t$dataPipe = new NextStepsDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\r\n\t\tcase \"many\":\r\n\t\t\tif ( $_REQUEST['tableName'] == \"sequenceoids\" ) {\r\n\t\t\t\t$dataPipe = new SequenceOidManyDataPipe($mapManager, $dataManager);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$dataPipe = new ManyDataPipe($mapManager, $dataManager);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"quotes\":\r\n\t\t\t$dataPipe = new QuotesDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"essay\":\r\n\t\t\t$dataPipe = new EssayDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"search\":\r\n\t\t\t$dataPipe = new SearchDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"keywords\":\r\n\t\t\t$dataPipe = new KeyWordDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"comments\":\r\n\t\t\t$dataPipe = new CommentsDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"user\":\r\n\t\t\t$dataPipe = new UserDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"members\":\r\n\t\t\t$dataPipe = new MembersDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"usercheck\":\r\n\t\t\t$dataPipe = new UserCheckDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"changegroup\":\r\n\t\t\t$dataPipe = new ChangeGroupDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"procedure\":\r\n\t\t\t$dataPipe = new ProcedureDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"viewers\":\r\n\t\t\t$dataPipe = new ViewerDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"analytics\":\r\n\t\t\t$dataPipe = new AnalyticsDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"sitefeedback\":\r\n\t\t\t$dataPipe = new SiteFeedbackDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"lookup\":\r\n\t\t\t$dataPipe = new LookUpDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"essays\":\r\n\t\t\t$dataPipe = new EssayListDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n case \"essayAll\":\r\n $dataPipe = new AllEssayDataPipe($mapManager, $dataManager);\r\n break;\r\n \r\n\t\tcase \"equestions\":\r\n\t\t\t$dataPipe = new EssayQuestionDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"eanswers\":\r\n\t\t\t$dataPipe = new EssayAnswerDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"enotes\":\r\n\t\t\t$dataPipe = new EssayQuestionDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"patternview\":\r\n\t\t\t$dataPipe = new PatternViewDataPipe($mapManager, $dataManager);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\t$dataPipe = new BaseDataPipe($mapManager, $dataManager);\r\n\t}\r\n\t\r\n\treturn $dataPipe;\r\n}", "public static function init()\n {\n self::$defaultHandlerDescFactory = new AnnotatedMessageHandlerDescriptorFactory(\n new CommandFunctionDescriptorFactory()\n );\n }" ]
[ "0.626952", "0.5943204", "0.5913768", "0.57946175", "0.5751923", "0.5750606", "0.569982", "0.56926537", "0.56554097", "0.56270945", "0.55596834", "0.5528407", "0.5494125", "0.5476687", "0.5466527", "0.5414457", "0.5410896", "0.5410165", "0.5386665", "0.53849953", "0.5375546", "0.5349934", "0.53314877", "0.5323675", "0.5315192", "0.5306474", "0.52995455", "0.5293948", "0.5289117", "0.5283812", "0.528017", "0.5257816", "0.52560824", "0.5230812", "0.5224758", "0.52191836", "0.52191836", "0.5188379", "0.517322", "0.51664144", "0.51552665", "0.5155064", "0.5151146", "0.5148176", "0.5123474", "0.5123474", "0.51222664", "0.5121465", "0.5114377", "0.51065946", "0.51047", "0.51036215", "0.5095397", "0.509305", "0.50924325", "0.50887173", "0.5078707", "0.507723", "0.506675", "0.5065594", "0.5062238", "0.5054902", "0.5042342", "0.50363034", "0.5032746", "0.5029989", "0.5029524", "0.5025799", "0.50252", "0.50043005", "0.49929896", "0.49929896", "0.49929896", "0.49929896", "0.49862212", "0.4983433", "0.49746633", "0.49676678", "0.49665514", "0.49663898", "0.49579707", "0.49572897", "0.49535242", "0.4940945", "0.49402297", "0.49307287", "0.49242622", "0.49224618", "0.49212247", "0.49206847", "0.49202746", "0.49188355", "0.49179095", "0.49130827", "0.49113092", "0.49084288", "0.49083972", "0.49021932", "0.49011332", "0.49002573" ]
0.52374214
33
It is not possible to delete using the webservice. Just testing whether we get expected response.
public function testSoapDeleteRegistrationsInteractingWithOnlineWebservice() { $this->soap = new \SoapClient(WSDL, array('trace' => 1)); $credentials = new Credentials(USERNAME, PASSWORD, SKOLEKODE); $client = new Client($credentials, $this->soap); $repository = new RegistrationRepository($client); $weblist_id = 11111; $response = $repository->delete($weblist_id)->getBody(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDelete_Error()\r\n\t{\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\t\r\n\t\t$response = $this->http->delete('/api/v1/hospital/5', [ //Change ID here to a Hospital that isn't in the datastore'\r\n\t\t\t'http_errors' => false\r\n\t\t]);\r\n\t\r\n\t\t//Test invalid requests\r\n\t\t$this->assertEquals(405, $response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function testDelete()\n\t{\n\t\t$obj2 = $this->setUpObj();\n\t\t$response = $this->call('DELETE', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah sudah terdelete\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($obj2->attributesToArray() as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\t}", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "public function testDeleteFail() {\n $this->delete('/api/author/100')\n ->seeJson(['message' => 'invalid request']);\n }", "public function testSendDeletesOnly()\n {\n $expectedBody = $this->getExpectedBody([], ['test123']);\n $this->mockEndpoint();\n $this->mockCurl($expectedBody);\n\n $this->subject->addDelete('test123');\n $responses = $this->subject->send();\n\n $this->assertEquals(1, count($responses));\n\n $this->assertEquals(\n [\n 'status' => 200,\n 'body' => ''\n ],\n $responses[0]\n );\n }", "public function testDeleteUrlUsingDELETE()\n {\n }", "public function testDeleteSuccessful() {\n\t\t$response = $this->call('DELETE','v1/users/'.$this->username);\n\t\t$this->assertResponseOk();\n\t}", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function testInvalidDelete() {\n\t\t$response =$this->guzzle->delete('http://bootcamp-coders.cnm.edu/~cberaun2/bread-basket/public_html/php/api/message/' . BreadBasketTest::INVALID_KEY, ['headers' => ['XRSF-TOKEN' => $this->token]]);\n\n\t\t//make sure the request returns the proper error code for the failed operation\n\t\t$body =$response->getBody();\n\t\t$retrievedMess = json_encode($body);\n\t\t$this->assertSame(404, $retrievedMess->status);\n\t}", "public function testDeleteUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "function deleteAuthor($id){\r\n $url = \"http://localhost:8080/WebServicesProjet/api/rest/authors/delete/\".$id;\r\n $result = delete($url);\r\n if(intval($result) != 200 && intval($result)<=503 && intval($result)>=400){\r\n header(\"Location: \".$_SERVER['HTTP_ORIGIN'].$_SERVER['PHP_SELF'].'?/authors');\r\n die();\r\n }else{\r\n header(\"Location: \".$_SERVER['HTTP_ORIGIN'].$_SERVER['PHP_SELF'].'?/authors');\r\n die();\r\n }\r\n\r\n}", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }", "public function test_it_can_delete_an_entity()\n {\n $this->mockHandler\n ->append(\n new Response(200, [], file_get_contents(__DIR__ . '/fixture/delete_response_success.json'))\n );\n $response = $this->client->delete('db2e5c63-3c54-4962-bf4a-d6ced1e9cf33');\n $this->assertEquals(DeleteEntityRepository::RESULT_SUCCESS, $response);\n }", "public function testDeleteMessageOkay()\n {\n $this->deleteMessageTest(true);\n }", "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 testDeleteHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\r\n\t\t//Test HTTP status ok for id=1\r\n\t\t$response= $this->http->request('DELETE','api/v1/hospital/2');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t}", "public function testDeleteSingleSuccess()\n {\n $entity = $this->findOneEntity();\n\n // Delete Entity\n $this->getClient(true)->request('DELETE', $this->getBaseUrl() . '/' . $entity->getId(),\n [], [], ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n }", "public function testDeleteServiceData()\n {\n\n }", "public function testDeleteProductUsingDELETE()\n {\n }", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function testDelete()\n {\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/product/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Product', 'productId', self::$objectId);\n }", "public function deleteAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function delete()\n {\n $id = $this->getId();\n\n try {\n $response = $this->_getHttpClient()\n ->setUri($this->_getService()->getBaseUri().\"/posts/$id.xml\")\n ->setAuth($this->_getService()->getUsername(), $this->_getService()->getPassword())\n ->setHeaders('Content-type', 'application/xml')\n ->setHeaders('Accept', 'application/xml')\n ->request('DELETE')\n ;\n }\n catch(\\Exception $exception)\n {\n try {\n // connection error - try again\n $response = $this->_getHttpClient()->request('DELETE');\n }\n catch(\\Exception $exception)\n {\n// $this->_onDeleteError();\n\n throw new Exception($exception->getMessage());\n }\n }\n\n $this->_response = new Response($response);\n\n if($this->_response->isError())\n {\n // service error\n// $this->_onDeleteError();\n return false;\n }\n\n// $this->_onDeleteSuccess();\n $this->_data = array();\n $this->_loaded = false;\n return true;\n }", "public function testMakeDeleteRequest()\n {\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse([\n 'success' => [\n 'code' => 200,\n 'message' => 'Deleted.',\n ],\n ], 200),\n ]);\n\n $this->assertEquals($client->delete('teachers/1'), true);\n }", "public function testCanMakeHttpDelete()\n {\n # Set desired response\n $resp = $this->createMock('Psr\\Http\\Message\\ResponseInterface');\n $this->mockClient->addResponse($resp);\n $httpClient = $this->givenSdk()->getHttpClient();\n $response = $httpClient->delete(\"/dummy_uri\");\n\n $this->assertSame($resp, $response);\n }", "public function testDelete()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t// On clique sur le lien entreprise de test\n\t\t$crawler = $client->request('GET', '/clients');\n\t\t$link = $crawler->filter('.bloc__title a:contains(\"Entreprise de test\")')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Entreprise de test\")')->count());\n\n\t\t// On clique sur le bouton modifier\n\t\t$link = $crawler->filter('.btn--delete')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('.breadcrumb:contains(\"Supprimer\")')->count()); \n\n\t\t// On modifie le métier\n\t\t$form = $crawler->selectButton('Supprimer')->form();\n\t\t$crawler = $client->submit($form);\t\n\n\t\t//On vérifie que ça a marché\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Le client a bien été supprimé.\")')->count());\n\n\t}", "public function delete() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function testDeleteCallback()\n {\n $response = $this->deleteJson('callback');\n\n $response->assertStatus(405);\n }", "public function testHandleRemoveNoID()\n {\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/remove');\n \n $this->assertResponseStatus(404);\n }", "public function testQuarantineDeleteById()\n {\n\n }", "public function testRemove()\n {\n $paymentMethodId = '36538b73-0ff9-4bf6-bc94-20f499b4f85d';\n $customerId = '20e68ad7-ff54-4cb6-8556-f87f58bcf995';\n\n $this->resource->remove($paymentMethodId,$customerId);\n\n $this->assertAttributeEquals(BASE_URL, 'base_url', $this->connector, 'Failed. Base url not correct');\n $this->assertAttributeEquals('DELETE', 'method', $this->connector, 'Failed. Method is not correct');\n $this->assertAttributeEquals('paymentmethods/' . $paymentMethodId . '?customerId=' .$customerId, 'url', $this->connector, 'Failed. Url is not correct');\n }", "public function testDeleteService()\n {\n\n }", "public function testRequestItemDeleteId50()\n {\n $response = $this->delete('/api/items/50');\n $response->assertJson([\n 'error' => true,\n\t\t\t\t'message' => 'there is no such items to be removed'\n ]);\n }", "public function testExample()\n {\n $userId = 94;\n $response = $this->delete(\"/api/users/{$userId}\");\n $response->assertStatus(204);\n }", "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function testDeleteProduct()\n // Ici je fais un test de suppression de produit\n {\n $response = $this->json('GET', '/api/products');\n // Vérifier le status de réussite.\n $response->assertStatus(200);\n // Je prend le premier produit [0]\n $product = $response->getData()[0];\n //Il faut etre connecté pour pouvoir supprimer\n $user = factory(\\App\\User::class)->create();\n //C'est une demande en DELETE à la place de POST \n $delete = $this->actingAs($user, 'api')->json('DELETE', '/api/products/'.$product->id);\n $delete->assertStatus(200);\n $delete->assertJson(['message' => \"Produit supprimé!\"]);\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}", "public function testValidDelete() {\n\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//perform the actual delete\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(),\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t// grab the data from guzzle and enforce that the status codes are correct\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//try retrieving entry from database and ensuring it was deleted\n\t\t$deletedOrg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());\n\t\t$this->assertNull($deletedOrg);\n\n\t}", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function testDeleteRequest()\n {\n $requestInstance = null;\n\n $this->router->delete('/customers/{id}/relationships/{relationship}', [\n 'middleware' => ['request', 'response'],\n function(\\Luminary\\Http\\Requests\\Destroy $request, $id, $relationship) use(&$requestInstance) {\n $requestInstance = $request;\n }\n ]);\n\n $data = [\n 'data' => [\n 'type' => 'location',\n 'id' => '1234'\n ]\n ];\n\n $this->json('DELETE', 'customers/1234/relationships/location', $data, $this->headers());\n\n $this->assertResponseStatus(204);\n $this->assertInstanceOf(\\Luminary\\Http\\Requests\\Destroy::class, $requestInstance);\n $this->assertInstanceOf(CustomerAuthorize::class, $requestInstance->getAuthorize());\n }", "public function testDeleteAction()\n {\n $res = $this->controller->deleteAction();\n $this->assertContains(\"Delete\", $res->getBody());\n }", "public function testDelete()\n\t{\n\t\t$saddle = $this->saddles[0];\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->delete('/api/v1/admin/saddles/' . $saddle->id)\n\t\t\t ->assertStatus(200);\n\n\t\t$this->assertDatabaseMissing('saddles', ['id' => $saddle->id]);\n\t}", "public function testDelete()\n {\n\n $this->createDummyRole();\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n ]);\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testDeleteBrandUsingDELETE()\n {\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function testDeleteChargeable()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->delete($this->url('chargeables/1'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'message'\n ]);\n }", "public function testStoreWithoutError()\n {\n $delete = new DeleteClass();\n $response = $delete->destroy(1);\n $json = json_decode($response->content());\n\n $this->assertEquals(200, $response->status());\n $this->assertEquals(true, $json->deleted);\n $this->assertEquals(true, $json->transformedData);\n $this->assertEquals(null, Donkey::find(1));\n }", "function delete() : bool {\n empty($_GET)? $req = $_POST : $req = $_GET;\n if ($req['id'] === NULL) {http_response_code(400); return false;}\n $comment = new Post();\n $comment->delete(\"id\",$req['id']);\n http_response_code(200);\n return true;\n}", "public function testInvalidDelete() {\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . BreadBasketTest::INVALID_KEY,\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//make sure the request returns the proper error code for a failed operation\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(404, $retrievedOrg->status);\n\t}", "public function testDelete(): void\n {\n $this->markTestSkipped('Skipping as PostsService::delete() is not yet ready for prod/testing');\n $this->mock(PostsRepository::class, static function ($mock) {\n $mock->shouldReceive('find')->with(123)->andReturn(new Post());\n $mock->shouldReceive('delete')->with(123)->andReturn(true);\n });\n\n $service = resolve(PostsService::class);\n\n $this->expectsEvents(BlogPostWillBeDeleted::class);\n\n $response = $service->delete(123);\n\n $this->assertIsArray($response);\n }", "public function testDeleteFinancialStatementUsingDelete()\n {\n }", "public function testDeleteUser()\n {\n $id = 6;\n $this->json('DELETE', \"api/user/delete/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\"\n ]);\n }", "function doDELETE (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"DELETE method not supported\");\n }", "public function test_delete_item() {}", "public function test_delete_item() {}", "public function testDeleteSuccess()\n {\n $mock_response = new MockHttpResponse(200);\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n\n $test_handle = 'gQNI9RF1SG2nRmvmQDMU';\n $result = $client->delete($test_handle);\n\n $this->assertTrue($result);\n }", "public function testHandleRemoveSuccess()\n {\n // Populate data\n $dealerAccountIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($dealerAccountIDs);\n \n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/remove', ['ID' => $ID]);\n \n // Validate response\n $this->assertRedirectedTo('/dealer-account');\n $this->assertSessionHas('dealer-account-deleted', '');\n \n // Validate data\n $dealerAccount = $this->dealer_account->getOne($ID);\n $this->assertEquals(null, $dealerAccount);\n \n }", "public function testDeleteReplenishmentTag()\n {\n }", "function delete(Request &$request, Response &$response);", "public function testDeleteNotExistentClient() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->get('/clients/' . rand(1,999) . '/delete')\n ->seeJson(['success' => false]);\n\n }", "function Delete() {\n\t\t\tif ($this->__delete($this->__name) == 204) return TRUE;\n\t\t\telse return FALSE;\n\t\t}", "public function testDestroy()\n {\n $response = $this->action('DELETE', '\\Modules\\Admin\\Http\\Controllers\\FaqCategoryController@destroy', ['id' => '1', 'ids' => '1']);\n\n $this->assertResponseStatus(200 || 302, $response->status());\n\n if ($response->status() == 302) {\n $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $response);\n } else if ($response->status() == 200) {\n $this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n }\n }", "public function testDeleteMetadata1UsingDELETE()\n {\n }", "public function delete() {\n\n try {\n /**\n * Set up request method\n */\n $this->method = 'POST';\n\n\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n } catch (\\Throwable $t){\n new ErrorTracer($t);\n }\n }", "public function delete(){\n\t\tglobal $db;\n\t\t$response = array('success' => false);\n\t\t$response['success']=$db->delete($this->table, \"id = $this->id\");\n\t return $response;\n\t}", "public function delete($id = null)\n\t{\n\t\treturn $this->fail(lang('RESTful.notImplemented', ['delete']), 501);\n\t}", "public function testDeleteValidMessage(){\n\t\t//created a new message, and insert into the database\n\t\t$newMessage = new Message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle and enforece that the status codes are correct\n\t\t$response = $this->guzzle->delete('http://bootcamp-coders.cnm.edu/~cberaun2/bread-basket/public_html/php/api/message/' . $newMessage->getMessage(), ['headers' => ['XRSF-TOKEN' => $this->token]]);\n\t\t$this->assertSame($response-GetStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedMessage = json_decode($body);\n\t\t$this->assertSame(200, $retrievedMessage->status);\n\n\t\t//try retriving entry from database and ensuring it was deleted\n\t\t$deletedMess = Message::getMessageByMessageId($this->PDO(), $newMessage->getMessageId());\n\t\t$this->assertNull($deletedMess);\n\t}", "public function testDeleteDocument()\n {\n }", "public function test_user_delete_success()\n {\n $last_data=User::where('email', $this->email_update)->first();\n $user_id=$last_data['id'];\n $response = $this->get('user_delete/'.$user_id);\n $response\n ->assertStatus(200)\n ->assertJson([\n $this->all_message => $this->user_delete,\n ]);\n }", "public function testDeleteDocument()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testQuestionDeleteWithValidData() {\n $response = $this->get('question/' . $this->question->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "protected function deleted()\n {\n $this->response = $this->response->withStatus(204);\n $this->jsonBody($this->payload->getOutput());\n }", "public function testDelete()\n {\n \t$this->conn->delete('test', 1);\n \t\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array(2, 'two', 'next row', 'ACTIVE'), $result->fetchOrdered());\n \t$this->assertNull($result->fetchOrdered());\n }", "public function testDeleteEnrollmentRequest()\n {\n }", "public function testApiDestroy()\n {\n $user = User::find(1);\n $compte = Compte::where('name', 'compte22')->first();\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('DELETE', '/api/comptes/'.$compte->id);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n \n\n\n }", "public function testDeleteMetadata2UsingDELETE()\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 testDeletePromotionCampaignApplicationUsingDELETE()\n {\n }", "public function test__GetDelete()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->object->objects->delete,\n\t\t\t$this->isInstanceOf('JAmazons3OperationsObjectsDelete')\n\t\t);\n\t}", "public function delete()\n\t{\n\t\t// Pass on the request to the driver\n\t\treturn $this->backend->delete('', array());\n\t}", "public function testDeleteRequest()\n {\n $admin = $this->getAdminUser();\n $userGrade = factory(\\App\\UserGrade::class)->create();\n $response = $this->actingAs($admin)->call(\"DELETE\", \"/api/user/{$userGrade->user_id}/grade/{$userGrade->id}\");\n $this->assertEquals(200, $response->status());\n }", "public function deleteAction(){\n $id = $this->params('id');\n $client = new Client();\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest/'.$id);\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setMethod( Request::METHOD_DELETE );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }", "public function testDeleteClientWithInvalidId() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->get('/clients/' . str_shuffle('ab12') . '/delete')\n ->seeJson(['success' => false]);\n\n }", "public function testDeleteOrder()\n {\n }", "public function testDeleteCategoryUsingDELETE()\n {\n }", "public function delete() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => false, 'message' => 'Id is null']);\n else:\n $kidphysical_delete = NidaraKidPhysicalInfo::findFirstByid($id);\n if ($kidphysical_delete):\n if ($kidphysical_delete->delete()):\n return $this->response->setJsonContent(['status' => true, 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }", "public function testExample()\n {\n $car = \\App\\Car::find(32);\n $delete= $car->delete();\n $this->assertTrue($delete);\n\n }", "public function testDeleteClient() {\n\n // Generate user and client\n $user = factory(App\\User::class)->create();\n $client = $user->clients()->save(factory(App\\Client::class)->make());\n\n $this->actingAs($user)\n ->get('/clients/' . $client->id . '/delete')\n ->seeJson(['success' => true]);\n\n }", "public function testDeleteMetadata3UsingDELETE()\n {\n }", "public function call_api_delete(){\n$ch = curl_init('http://localhost:8001/api/users/....');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLINFO_HEADER_OUT, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n// Submit the DELETE request\n$result = curl_exec($ch);\n\n//Close cURL session handle\ncurl_close($ch);\necho \"Deleted\"; \n }", "public function testDeleteMember()\n {\n }", "public function testDestroy()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n Item::factory()->count(10)->create();\n\n //test item not found\n $this->delete('/items/11111')\n ->seeJson([\n 'error' => 'Item Not Found',\n ])\n ->seeJson([\n 'code' => 404,\n ]);\n\n //test success deleted item\n $this->delete('/items/1')\n ->seeJson([\n 'message' => 'Item 1 deleted',\n ])\n ->seeJson([\n 'status' => 'ok',\n ]);\n\n $this->notSeeInDatabase('items', array('id' => 1));\n }", "public function delete($id) {\n throw new RestWSException('Not implemented', 501);\n\n }", "public function testDeleteMessageFailed()\n {\n $this->deleteMessageTest(false);\n }", "public function testPageDelete()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::where(\"admin\", true)->whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('DELETE', \"/api/pages/\" . $page->slug);\n $response\n ->assertStatus(200);\n }" ]
[ "0.7701484", "0.7589896", "0.7380577", "0.7343929", "0.7305785", "0.72983253", "0.72350955", "0.7231011", "0.7154246", "0.7133268", "0.7106828", "0.70843846", "0.7079196", "0.7078495", "0.7039518", "0.70369786", "0.7029409", "0.70289", "0.7013219", "0.70121276", "0.70070547", "0.70034486", "0.70014167", "0.69984114", "0.69922096", "0.6982728", "0.6972953", "0.69315606", "0.69114465", "0.69057137", "0.6900297", "0.68920267", "0.688123", "0.68564904", "0.685387", "0.6850802", "0.685003", "0.68485004", "0.68451005", "0.6832007", "0.6831805", "0.68250394", "0.68209326", "0.68201905", "0.68185467", "0.68144107", "0.6814157", "0.680328", "0.680328", "0.67992276", "0.67934126", "0.6785407", "0.67698574", "0.67551446", "0.6753429", "0.6745462", "0.6738753", "0.6738019", "0.67324716", "0.67324716", "0.6727249", "0.6716285", "0.6710457", "0.6707975", "0.6701556", "0.6698835", "0.669833", "0.6690688", "0.668775", "0.6682846", "0.6678206", "0.6677189", "0.66754365", "0.6674117", "0.667038", "0.66696787", "0.6662523", "0.6647751", "0.6640385", "0.6635586", "0.6629664", "0.66287494", "0.6628023", "0.6627646", "0.66274333", "0.6622704", "0.6620278", "0.66174316", "0.66173273", "0.66171676", "0.6607816", "0.6603838", "0.65945786", "0.6575252", "0.6554921", "0.65472084", "0.65455556", "0.6536938", "0.65292645", "0.65230817" ]
0.68391275
39
Get all custom fields in one company
public function getAll(Request $request) { $this->validate($request, ["companyId" => "required|integer"]); $customField = $this->customFieldDao->getAll(); $resp = new AppResponse($customField, trans('messages.allDataRetrieved')); return $this->renderResponse($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll() : array\n {\n if (!empty($listOfCustomFields = $this->getAllFromRedis())) {\n return $listOfCustomFields;\n }\n\n $companyId = $this->companies_id ?? 0;\n\n $result = Di::getDefault()->get('db')->prepare('\n SELECT name, value \n FROM apps_custom_fields\n WHERE\n companies_id = ?\n AND model_name = ?\n AND entity_id = ?\n ');\n\n $result->execute([\n $companyId,\n get_class($this),\n $this->getId()\n ]);\n\n $listOfCustomFields = [];\n\n while ($row = $result->fetch()) {\n $listOfCustomFields[$row['name']] = Str::jsonToArray($row['value']);\n }\n\n return $listOfCustomFields;\n }", "public function getCustomFields()\n\t{\n\t\t$all_customs = array();\n\t\t$results = $this->grApiInstance->getCustomFields();\n\t\tif ( !empty($results))\n\t\t{\n\t\t\tforeach ($results as $ac)\n\t\t\t{\n\t\t\t\tif (isset($ac->name) && isset($ac->customFieldId)) {\n\t\t\t\t\t$all_customs[$ac->name] = $ac->customFieldId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $all_customs;\n\t}", "public function getAllCustomFields() : array\n {\n return $this->getAll();\n }", "function ywccp_get_all_custom_fields(){\r\n\t\t\r\n\t\t$fields = array();\r\n\t\t// get billing\r\n\t\t$fields['billing'] = ywccp_get_custom_fields('billing');\r\n\t\t// get shipping\r\n\t\t$fields['shipping'] = ywccp_get_custom_fields('shipping');\r\n\t\t// get additional\r\n\t\t$fields['additional'] = ywccp_get_custom_fields('additional');\r\n\t\t\r\n\t\treturn $fields;\r\n\t}", "public function getCustomFields() {\n }", "public function getCustomFields() {\n }", "public function getCustomFields()\n {\n return $this->customFields;\n }", "public function getCustomFields()\n {\n return $this->customFields;\n }", "public function get_fields() {\n\t\treturn apply_filters( 'wpcd_get_custom_fields', $this->custom_fields );\n\t}", "public function getAllCustomFields()\n\t{\n\t\t$fields = $this->CustomFields->indexBy('field_name');\n\n\t\t$cache_key = \"ChannelFieldGroups/{$this->getId()}/\";\n\t\tif (($field_groups = ee()->session->cache(__CLASS__, $cache_key, FALSE)) == FALSE)\n\t\t{\n\t\t\t$field_groups = $this->FieldGroups;\n\t\t}\n\n\t\tforeach ($field_groups as $field_group)\n\t\t{\n\t\t\tforeach($field_group->ChannelFields as $field)\n\t\t\t{\n\t\t\t\t$fields[$field->field_name] = $field;\n\t\t\t}\n\t\t}\n\n\t\tee()->session->set_cache(__CLASS__, $cache_key, $field_groups);\n\n\t\treturn new Collection($fields);\n\t}", "public function get_custom_fields(){\n $items = array();\n $success = $this->new_request( \"GET\", \"$this->account_id/custom_field_identifiers\" );\n if( ! $success ){\n return array();\n }\n $response = json_decode( $this->ironman->get_response_body(), true );\n $fields = isset( $response['custom_field_identifiers'] ) ? $response['custom_field_identifiers'] : array();\n foreach( $fields as $field ){\n $items[$field] = $field;\n }\n return $items;\n }", "public function get_custom_fields() {\n\t\treturn apply_filters( 'dev_get_custom_fields', $this->options );\n\t}", "public function getFormCustomFields(){\n\t}", "public function getCustomFields()\n {\n return $this->_customFields ?: array();\n }", "public function getCustomFields($page=null, $per_page=null){\n\t\treturn CustomField::all($page, $per_page);\n\t\t\n }", "protected function getSchemaFieldsForCustomFields()\n {\n $schemaPartialForCustomFields = [];\n foreach ($this->getWrapper()->getCustomFieldsCached() as $customField) {\n $dataTypeClassName = end(explode('\\\\', get_class($customField->getDataType())));\n $schemaPartialForCustomFields[$customField->apiName] = $dataTypeClassName;\n }\n return $schemaPartialForCustomFields;\n }", "public function getCustomFields() {\n return Doctrine::getTable('ArticleCustomFieldValue')->getCustomFields($this);\n }", "public function getFrontendFields();", "public function get_custom_fields(){\n $real_fields = array();\n $fields = $this->service->doRequest( 'subscribers_list/getFields', array( 'hash' => $this->list_id ) )['fields'];\n if( $fields ){\n foreach( $fields as $field ){\n $real_fields[$field['hash']] = $field['tag'];\n }\n }\n return $real_fields;\n }", "public function getCustomFields()\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields\n }", "public function getCustomFields($product_info, $ro_combs) {\n\t\treturn \\liveopencart\\ext\\ro::getInstance($this->registry)->getCustomFields($product_info, $ro_combs);\n\t\t\n\t}", "private static function _get_custom_fields($content_type)\n\t{\n\t\t$data = get_option( CCTM::db_key );\n\t\tif (isset($data[$content_type]['custom_fields']))\n\t\t{\n\t\t\treturn $data[$content_type]['custom_fields'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getContactDataFields();", "private function _build_a_custom_fields($filter_custom_fields)\n {\n $query = $this->_db->getQuery(true);\n $query->select('`custom_title`');\n $query->select('`virtuemart_custom_id`');\n $query->from('#__virtuemart_customs');\n $query->where('`virtuemart_custom_id` IN ('.implode(', ',$filter_custom_fields).')');\n $this->_db->setQuery((string)$query);\n return $this->_db->loadAssocList();\n \n }", "public function getAllFields();", "public static function get_custom_fields() {\n\n\t\t$custom_fields = [];\n\t\t$fields = self::get_meta_keys_alt();\n\n\t\tforeach ( $fields as $field ) {\n\t\t\t$custom_fields[$field] = ucfirst( str_replace( '_', ' ', $field ) );\n\t\t}\n\n\t\treturn $custom_fields;\n\n\t}", "public function CustomFields()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = product_id, localKey = id)\n \treturn $this->hasMany(CustomFields::class);\n }", "public static function custom_fields()\r\n {/*{{{*/\r\n $f = array();\r\n\t $file = self::custom_fields_file();\r\n\t if(!file_exists($file)) \r\n return false;\r\n\r\n\t $data = getXML($file);\r\n\t $items = $data->item;\r\n\t if(count($items) <= 0) \r\n\t return false;\r\n\t foreach($items as $item) \r\n\t {\r\n\t\t $cf = array();\r\n\t\t $cf['key'] = (string)$item->desc;\r\n\t\t $cf['label'] = (string)$item->label;\r\n\t\t $cf['type'] = (string)$item->type;\r\n\t\t $cf['value'] = (string)$item->value;\r\n\t\t if($cf['type'] == 'dropdown') \r\n\t\t {\r\n\t\t $cf['options'] = array();\r\n\t\t\t foreach ($item->option as $option) \r\n\t\t\t\t $cf['options'][] = (string)$option;\r\n\t\t }\r\n\t\t $f[] = $cf;\r\n\t }\r\n return $f;\r\n }", "public static function get_track_custom_fields() {\n global $DB;\n\n if (static::require_elis_dependencies() === true) {\n // Get custom fields.\n $sql = 'SELECT shortname, name, datatype, multivalued\n FROM {'.field::TABLE.'} f\n JOIN {'.field_contextlevel::TABLE.'} fctx ON f.id = fctx.fieldid AND fctx.contextlevel = ?';\n $sqlparams = array(CONTEXT_ELIS_TRACK);\n return $DB->get_records_sql($sql, $sqlparams);\n } else {\n return array();\n }\n }", "protected function get_registered_fields()\n {\n }", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function get_all_custom_fields( $force ) {\n\n\t\t$custom_data = array();\n\n\t\t// Serve from cache if exists and requested\n\t\t$cached_data = $this->get_cached_custom_fields();\n\t\tif ( false === $force && ! empty( $cached_data ) ) {\n\t\t\treturn $cached_data;\n\t\t}\n\n\t\t// Build custom fields for every list\n\t\t$lists = $this->get_lists( $force );\n\n\t\tforeach ( $lists as $list ) {\n\t\t\tif ( ! empty( $list['id'] ) ) {\n\t\t\t\t$custom_data[ $list['id'] ] = $this->get_custom_fields_for_list( $list['id'] );\n\t\t\t}\n\t\t}\n\n\t\t$this->_save_custom_fields( $custom_data );\n\n\t\treturn $custom_data;\n\t}", "function get_fields()\n\t{\n\t\trequire_code('ocf_members');\n\n\t\t$indexes=collapse_2d_complexity('i_fields','i_name',$GLOBALS['FORUM_DB']->query_select('db_meta_indices',array('i_fields','i_name'),array('i_table'=>'f_member_custom_fields'),'ORDER BY i_name'));\n\n\t\t$fields=array();\n\t\tif (has_specific_permission(get_member(),'view_profiles'))\n\t\t{\n\t\t\t$rows=ocf_get_all_custom_fields_match(NULL,1,1);\n\t\t\trequire_code('fields');\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists('field_'.strval($row['id']),$indexes)) continue;\n\n\t\t\t\t$ob=get_fields_hook($row['cf_type']);\n\t\t\t\t$temp=$ob->get_search_inputter($row);\n\t\t\t\tif (is_null($temp))\n\t\t\t\t{\n\t\t\t\t\t$type='_TEXT';\n\t\t\t\t\t$special=make_string_tempcode(get_param('option_'.strval($row['id']),''));\n\t\t\t\t\t$display=$row['trans_name'];\n\t\t\t\t\t$fields[]=array('NAME'=>strval($row['id']),'DISPLAY'=>$display,'TYPE'=>$type,'SPECIAL'=>$special);\n\t\t\t\t} else $fields=array_merge($fields,$temp);\n\t\t\t}\n\n\t\t\t$age_range=get_param('option__age_range',get_param('option__age_range_from','').'-'.get_param('option__age_range_to',''));\n\t\t\t$fields[]=array('NAME'=>'_age_range','DISPLAY'=>do_lang_tempcode('AGE_RANGE'),'TYPE'=>'_TEXT','SPECIAL'=>$age_range);\n\t\t}\n\n\t\t$map=has_specific_permission(get_member(),'see_hidden_groups')?array():array('g_hidden'=>0);\n\t\t$group_count=$GLOBALS['FORUM_DB']->query_value('f_groups','COUNT(*)');\n\t\tif ($group_count>300) $map['g_is_private_club']=0;\n\t\tif ($map==array()) $map=NULL;\n\t\t$rows=$GLOBALS['FORUM_DB']->query_select('f_groups',array('id','g_name'),$map,'ORDER BY g_order');\n\t\t$groups=form_input_list_entry('',true,'---');\n\t\t$default_group=get_param('option__user_group','');\n\t\t$group_titles=array();\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row['text_original']=get_translated_text($row['g_name'],$GLOBALS['FORUM_DB']);\n\n\t\t\tif ($row['id']==db_get_first_id()) continue;\n\t\t\t$groups->attach(form_input_list_entry(strval($row['id']),strval($row['id'])==$default_group,$row['text_original']));\n\t\t\t$group_titles[$row['id']]=$row['text_original'];\n\t\t}\n\t\tif (strpos($default_group,',')!==false)\n\t\t{\n\t\t\t$bits=explode(',',$default_group);\n\t\t\t$combination=new ocp_tempcode();\n\t\t\tforeach ($bits as $bit)\n\t\t\t{\n\t\t\t\tif (!$combination->is_empty()) $combination->attach(do_lang_tempcode('LIST_SEP'));\n\t\t\t\t$combination->attach(escape_html(@$group_titles[intval($bit)]));\n\t\t\t}\n\t\t\t$groups->attach(form_input_list_entry(strval($default_group),true,do_lang_tempcode('USERGROUP_SEARCH_COMBO',escape_html($combination))));\n\t\t}\n\t\t$fields[]=array('NAME'=>'_user_group','DISPLAY'=>do_lang_tempcode('GROUP'),'TYPE'=>'_LIST','SPECIAL'=>$groups);\n\t\tif (has_specific_permission(get_member(),'see_hidden_groups'))\n// $fields[]=array('NAME'=>'_photo_thumb_url','DISPLAY'=>do_lang('PHOTO'),'TYPE'=>'','SPECIAL'=>'','CHECKED'=>false);\n\t\t{\n\t\t\t//$fields[]=array('NAME'=>'_emails_only','DISPLAY'=>do_lang_tempcode('EMAILS_ONLY'),'TYPE'=>'_TICK','SPECIAL'=>'');\tCSV export better now\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.invoice.fields'\n );\n return $fullResult;\n }", "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 }", "function gmw_search_form_custom_fields( $gmw ) {\r\n\t\techo gmw_get_search_form_custom_fields( $gmw );\r\n\t}", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getListFields();", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "private function addCustomFields() {\n if (function_exists('get_fields')) {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'fields', [\n 'get_callback' => function ($post) {\n if (is_object($post)) {\n return get_fields($post->id);\n } elseif (is_array($post) && array_key_exists('id', $post)) {\n return get_fields($post['id']);\n }\n },\n ]);\n }\n }\n }", "public function custom_fields_for_feed_setting() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\t/* If iContact API credentials are invalid, return the fields array. */\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\n\t\t/* Get available iContact fields. */\n\t\t$icontact_fields = $this->api->get_custom_fields();\n\t\t\n\t\t/* If no iContact fields exist, return the fields array. */\n\t\tif ( empty( $icontact_fields ) || is_wp_error( $icontact_fields ) || ! is_array( $icontact_fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\n\t\t/* Add iContact fields to the fields array. */\n\t\tforeach ( $icontact_fields as $field ) {\n\t\t\t\n\t\t\t$fields[] = array(\n\t\t\t\t'label' => $field['publicName'],\n\t\t\t\t'value' => $field['customFieldId']\n\t\t\t);\n\t\t\t\n\t\t}\n\n\t\t/* Add new custom fields to the fields array. */\n\t\tif ( ! empty( $this->_new_custom_fields ) ) {\n\t\t\t\n\t\t\tforeach ( $this->_new_custom_fields as $new_field ) {\n\t\t\t\t\n\t\t\t\t$found_custom_field = false;\n\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( $field['value'] == $new_field['value'] )\n\t\t\t\t\t\t$found_custom_field = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( ! $found_custom_field )\n\t\t\t\t\t$fields[] = array(\n\t\t\t\t\t\t'label' => $new_field['label'],\n\t\t\t\t\t\t'value' => $new_field['value']\t\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif ( empty( $fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\t\t\t\n\t\t/* Add \"Add Custom Field\" to array. */\n\t\t$fields[] = array(\n\t\t\t'label' => esc_html__( 'Add Custom Field', 'gravityformsicontact' ),\n\t\t\t'value' => 'gf_custom'\t\n\t\t);\n\t\t\n\t\treturn $fields;\n\t\t\n\t}", "public function getAllForCustonObj() {\n $query = $this->db->query(\"SELECT * FROM $this->table ORDER BY shortname;\");\n $this->allcpny = $query->custom_result_object('entity\\Company');\n // print \"<pre>\";\n // print_r($this->cpny);\n // print \"</pre>\";\n // exit();\n return $this->allcpny;\n }", "function getCustomFields( $entity, $id, $cache_values = true, $editable_by = '' )\n\t{\n\t\tTienda::load( 'TiendaModelEavAttributes', 'models.eavattributes' );\n\t\tTienda::load( 'TiendaHelperEav', 'helpers.eav' );\n\t\t\n\t\t$eavs = TiendaHelperEav::getAttributes( $entity, $id, false, $editable_by );\n\t\t\n\t\t$fields = array( );\n\t\tforeach ( @$eavs as $eav )\n\t\t{\n\t\t\t$key = $eav->eavattribute_alias;\n\n\t\t\t$value = TiendaHelperEav::getAttributeValue( $eav, $entity, $id, false, $cache_values );\n\t\t\t\n\t\t\t$fields[] = array(\n\t\t\t\t'attribute' => $eav, 'value' => $value\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}", "public function buildCustomFieldsList() {\n\n\t\t$parsed = array();\n\n\t\tforeach ( $this->get_all_custom_fields( false ) as $list_id => $merge_field ) {\n\t\t\tarray_map(\n\t\t\t\tfunction ( $var ) use ( &$parsed, $list_id ) {\n\t\t\t\t\t$parsed[ $list_id ][ $var['id'] ] = $var['name'];\n\t\t\t\t},\n\t\t\t\t$merge_field\n\t\t\t);\n\t\t}\n\n\t\treturn $parsed;\n\t}", "function getFields();", "public function getCompany();", "public function get_custom_fields($args = [])\n {\n global $db, $system;\n $fields = [];\n /* prepare \"for\" [user|page|group|event] - default -> user */\n $args['for'] = (isset($args['for'])) ? $args['for'] : \"user\";\n if (!in_array($args['for'], array('user', 'page', 'group', 'event'))) {\n _error(400);\n }\n /* prepare \"get\" [registration|profile|settings] - default -> registration */\n $args['get'] = (isset($args['get'])) ? $args['get'] : \"registration\";\n if (!in_array($args['get'], array('registration', 'profile', 'settings'))) {\n _error(400);\n }\n /* prepare where_query */\n $where_query = \"WHERE field_for = '\" . $args['for'] . \"'\";\n if ($args['get'] == \"registration\") {\n $where_query .= \" AND in_registration = '1'\";\n } elseif ($args['get'] == \"profile\") {\n $where_query .= \" AND in_profile = '1'\";\n }\n $get_fields = $db->query(\"SELECT * FROM custom_fields \" . $where_query . \" ORDER BY field_order ASC\") or _error(\"SQL_ERROR_THROWEN\");\n if ($get_fields->num_rows > 0) {\n while ($field = $get_fields->fetch_assoc()) {\n if ($field['type'] == \"selectbox\") {\n $field['options'] = explode(PHP_EOL, $field['select_options']);\n }\n if ($args['get'] == \"registration\") {\n /* no value neeeded */\n $fields[] = $field;\n } else {\n /* valid node_id */\n if (!isset($args['node_id'])) {\n _error(400);\n }\n /* get the custom field value */\n $get_field_value = $db->query(sprintf(\"SELECT value FROM custom_fields_values WHERE field_id = %s AND node_id = %s AND node_type = %s\", secure($field['field_id'], 'int'), secure($args['node_id'], 'int'), secure($args['for']))) or _error(\"SQL_ERROR_THROWEN\");\n $field_value = $get_field_value->fetch_assoc();\n if ($field['type'] == \"selectbox\") {\n $field['value'] = $field['options'][$field_value['value']];\n } else {\n $field['value'] = $field_value['value'];\n }\n if ($args['get'] == \"profile\" && is_empty($field['value'])) {\n continue;\n }\n $fields[$field['place']][] = $field;\n }\n }\n }\n return $fields;\n }", "public static function customFields($return_type=null)\r\n {\r\n $custom_fields = CustomField::whereAppId(\\Auth::user()->app_id)->pluck('name', 'id');\r\n if($return_type == 'json') { \r\n $custom_fields->toJson();\r\n }\r\n return $custom_fields;\r\n }", "public function getCompany() {}", "public function getCustomFields($options = [])\n {\n return $this->api->get($this->buildPath(\"custom_fields\"), $options);\n }", "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 getAllFields() {\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$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function get_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'type' => 'tab',\n\t\t\t\t'name' => __( 'Dribbble', 'publisher' ),\n\t\t\t\t'id' => 'dribbble',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Dribbble ID', 'publisher' ),\n\t\t\t\t'id' => 'user_id',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Access Token', 'publisher' ),\n\t\t\t\t'id' => 'access_token',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Number of Shots', 'publisher' ),\n\t\t\t\t'id' => 'photo_count',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Columns', 'publisher' ),\n\t\t\t\t'id' => 'style',\n\t\t\t\t//\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t2 => __( '2 Column', 'publisher' ),\n\t\t\t\t\t3 => __( '3 Column', 'publisher' ),\n\t\t\t\t\t'slider' => __( 'Slider', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Retrieve heading fields from outside (our themes are defining them)\n\t\t */\n\t\t{\n\t\t\t$heading_fields = apply_filters( 'better-framework/shortcodes/heading-fields', array(), $this->id );\n\n\t\t\tif ( $heading_fields ) {\n\t\t\t\t$fields = array_merge( $fields, $heading_fields );\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Retrieve design fields from outside (our themes are defining them)\n\t\t */\n\t\t{\n\t\t\t$design_fields = apply_filters( 'better-framework/shortcodes/design-fields', array(), $this->id );\n\n\t\t\tif ( $design_fields ) {\n\t\t\t\t$fields = array_merge( $fields, $design_fields );\n\t\t\t}\n\t\t}\n\n\t\tbf_array_insert_after(\n\t\t\t'bs-show-phone',\n\t\t\t$fields,\n\t\t\t'bs-text-color-scheme',\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Block Text Color Scheme', 'publisher' ),\n\t\t\t\t'id' => 'bs-text-color-scheme',\n\t\t\t\t//\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'' => __( '-- Default --', 'publisher' ),\n\t\t\t\t\t'light' => __( 'White Color Texts', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t)\n\t\t);\n\n\t\treturn $fields;\n\t}", "public function getCustomFields( $params = array() ) {\n\t\treturn $this->call( 'custom-fields?' . $this->setParams( $params ) );\n\t}", "function structured_data() {\n $name = get_field('company_name', 'company');\n\n // Gets the company logo from comapany details\n $logo = get_field('company_logo', 'company');\n\n // Gets the company name from comapany details\n $fax = get_field('company_fax', 'company');\n\n // Gets the page featured image\n $featured_image = get_the_post_thumbnail_url();\n\n // Gets the publish date\n $publish_date = get_the_date();\n\n // Gets the modified date\n $modified_date = get_the_modified_date();\n\n // Gets the page title\n $page_title = get_the_title();\n\n // Gets the page url\n $page_url = get_permalink();\n\n // Gets the blog type\n $blog_type = get_field('blog_type');\n\n // Gets the first phone number from company details\n if(get_field('company_phone_number', 'company')) {\n while ( have_rows('company_phone_number', 'company') ) : the_row();\n $phone_count++;\n if($phone_count === 1) { $phone = get_sub_field('phone_number'); }\n endwhile;\n }\n\n // Gets the first email address from company details\n if(get_field('company_email_address', 'company')) {\n while ( have_rows('company_email_address', 'company') ) : the_row();\n $email_count++;\n if($email_count === 1) { $email = get_sub_field('email_address'); }\n endwhile;\n }\n \n\n // Gets the first address row and automaticly sorts with the correct type\n if(get_field('company_address', 'company')) {\n while ( have_rows('company_address', 'company') ) : the_row();\n $address_count++;\n while ( have_rows('address') ) : the_row();\n $address = get_sub_field('address_line');\n $type = get_sub_field('type');\n if($type) {\n $address_line .= '\"'. $type .'\": \"'. $address .'\",';\n }\n endwhile;\n endwhile;\n }\n \n\n // Gets the social accounts\n if(get_field('social_links', 'company')) {\n $social_total = count(get_field('social_links', 'company'));\n while ( have_rows('social_links', 'company') ) : the_row();\n $social_count++;\n $social_links .= '\"'. get_sub_field('social_link') .'\"';\n if($social_total != $social_count) {\n $social_links .= ',';\n }\n endwhile;\n }\n\n // Gets the opening hours from company details\n if(get_field('company_opening_structured_data', 'company')) {\n $open_total = count(get_field('company_opening_structured_data', 'company'));\n while ( have_rows('company_opening_structured_data', 'company') ) : the_row();\n $open_count++;\n $days = null;\n $day_count = null;\n $open_time = get_sub_field('opening_time');\n $close_time = get_sub_field('closing_time');\n $day_total = count(get_sub_field('days'));\n while ( have_rows('days') ) : the_row();\n $day_count++;\n $days .= '\"'. get_sub_field('day') .'\"';\n if($day_total != $day_count) {\n $days .= ',';\n }\n endwhile;\n $opening_hours .= '{ \"@type\": \"OpeningHoursSpecification\",';\n $opening_hours .= '\"dayOfWeek\": ['. $days .'],\"opens\": \"'. $open_time .'\", \"closes\": \"'. $close_time .'\"';\n $opening_hours .= '}';\n if($open_total != $open_count) {\n $opening_hours .= ',';\n }\n endwhile;\n }\n\n\n $json = '';\n\n\n // START JSON\n $json .= '[';\n\n // OPENING LOCAL BUSINESS STRUCTURED DATA\n\n $json .= '{';\n $json .= '\"@context\": \"http://schema.org\",';\n $json .= '\"@type\": \"LocalBusiness\",';\n\n if($name) { $json .= '\"name\": \"'. $name .'\",'; }\n if($logo) { $json .= '\"logo\": \"'. $logo .'\",'; }\n if($featured_image) { $json .= '\"image\": \"' . $featured_image . '\",'; }\n if($phone) { $json .= '\"telephone\": \"'. $phone .'\",'; }\n if($email) { $json .= '\"email\": \"'. $email .'\",'; }\n if($fax) { $json .= '\"faxNumber\": \"'. $fax .'\",'; }\n\n if($address_line) {\n $json .= '\"address\": {';\n $json .= '\"@type\": \"PostalAddress\",';\n $json .= $address_line;\n $json .= '\"addressCountry\": \"UK\"';\n $json .= '},';\n }\n\n if($opening_hours) {\n $json .= '\"openingHoursSpecification\": [';\n $json .= $opening_hours;\n $json .= '],';\n }\n\n $json .= '\"url\" : \"'. get_site_url() .'\",';\n\n if($social_links) {\n $json .= '\"sameAs\": [';\n $json .= $social_links;\n $json .= ']';\n }\n\n $json .= '}';\n\n // CLOSING LOCAL BUSINESS STRUCTURED DATA\n\n\n if(is_singular('post')) {\n\n $json .= ',';\n $json .= '{';\n $json .= '\"@context\": \"https://schema.org\",';\n\n if($blog_type) {\n $json .= '\"@type\": \"'. $blog_type .'\",';\n } else {\n $json .= '\"@type\": \"Article\",';\n }\n\n\n $json .= '\"headline\": \"'. $page_title .'\",';\n\n if($name) {\n $json .= '\"author\": {';\n $json .= '\"@type\": \"Organization\",';\n $json .= '\"name\": \"'. $name .'\"';\n $json .= '},';\n\n $json .= '\"publisher\": {';\n $json .= '\"@type\": \"Organization\",';\n $json .= '\"name\": \"'. $name .'\",';\n if($logo) { $json .= '\"logo\": \"'. $logo .'\"'; }\n $json .= '},';\n }\n\n $json .= '\"mainEntityOfPage\": {';\n $json .= '\"@type\": \"WebPage\",';\n $json .= '\"@id\": \"'. $page_url .'\"';\n $json .= '},';\n\n $json .= '\"dateModified\": \"'. $modified_date .'\",';\n $json .= '\"datePublished\": \"'. $publish_date .'\",';\n if($featured_image) { $json .= '\"image\": [\"' . $featured_image . '\"]'; }\n $json .= '}';\n\n }\n\n\n $json .= ']';\n // END JSON\n\n\n echo '<script type=\"application/ld+json\">';\n echo $json;\n echo '</script>';\n\n}", "public function get_customer_meta_fields()\n {\n\n $show_fields = apply_filters('wc_pos_customer_meta_fields', array(\n 'outlet_filds' => array(\n 'title' => __('Point of Sale', 'wc_point_of_sale'),\n 'fields' => array(\n 'outlet' => array(\n 'label' => __('Outlet', 'wc_point_of_sale'),\n 'type' => 'select',\n 'name' => 'outlet[]',\n 'multiple' => true,\n 'options' => WC_POS()->outlet()->get_data_names(),\n 'description' => __('Ensure the user is logged out before changing the outlet.', 'wc_point_of_sale')\n ),\n 'discount' => array(\n 'label' => __('Discount', 'wc_point_of_sale'),\n 'type' => 'select',\n 'options' => array(\n 'enable' => 'Enable',\n 'disable' => 'Disable'\n ),\n 'description' => ''\n ),\n )\n ),\n ));\n\n if ( get_option( 'wc_pos_enable_user_card', 'no' ) == 'yes' ) {\n $show_fields['outlet_filds']['fields']['user_card_number'] = array(\n 'label' => __( 'Card Number', 'wc_point_of_sale' ),\n 'type' => 'input',\n 'description' => 'Enter the number of the card to associate this customer with.'\n );\n $show_fields['outlet_filds']['fields']['user_card_number_print'] = array(\n 'label' => __( 'Print Customer Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['user_card_number_scan'] = array(\n 'label' => __( 'Load Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n }\n $show_fields['outlet_filds']['fields']['disable_pos_payment'] = array(\n 'label' => __( 'Tendering', 'wc_point_of_sale' ),\n 'desc' => 'Disable tendering ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['approve_refunds'] = array(\n 'label' => __( 'Refunds', 'wc_point_of_sale' ),\n 'desc' => 'Enable refund ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n return $show_fields;\n }", "public function getMetaFieldsProperty()\n {\n return collect(config('getcandy-hub.customers.searchable_meta'));\n }", "public function getCompanyWithUsers();", "public function customFields()\n {\n return $this->morphMany('App\\Models\\MemberCustomFields', 'fieldable');\n }", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function fields()\n {\n $logisticCompany = LogisticCompany::all()->pluck('name', 'id');\n return [\n Repeater::make(__('Shipment'), 'shipment')\n ->addField([\n 'label' => __('Shipment Num'),\n 'placeholder' => __('Shipment Num'),\n 'name' => 'num',\n ])->addField([\n 'label' => __('Logistics company'),\n 'placeholder' => __('Logistics company'),\n 'name' => 'company',\n 'type' => 'select',\n 'options' => $logisticCompany,\n ])->rules('required'),\n ];\n }", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.requisite.fields'\n );\n return $fullResult;\n }", "public function getCMSFields() {\n\n\t\t// $fields = new FieldList(\n\t\t// $rootTab = new TabSet('Root',\n\t\t// $tabMain = new Tab('Region',\n\t\t// TextField::create('Code', _t('Region.CODE', 'Code')),\n\t\t// TextField::create('Title', _t('Region.TITLE', 'Title')),\n\t\t// DropdownField::create('CountryID', 'Country', Country_Shipping::get()->map()->toArray())\n\t\t// )\n\t\t// )\n\t\t// );\n\t\t// return $fields;\n\n\t\t$fields = parent::getCMSFields();\n\t\t$fields->replaceField('CountryID', DropdownField::create('CountryID', 'Country', Country_Shipping::get()->map()->toArray()));\n\t\t$fields->removeByName('SortOrder');\n\t\t$fields->removeByName('ShopConfigID');\n\t\treturn $fields;\n\t}", "abstract public function getFields();", "abstract public function getFields();", "public function getFields() : FieldCollection;", "public function get_fields()\n {\n return [\n \"isys_catg_invoice_list__denotation\" => \"LC__CMDB__CATG__TITLE\",\n \"isys_catg_invoice_list__amount\" => \"LC__CMDB__CATG__INVOICE__AMOUNT\",\n \"isys_catg_invoice_list__date\" => \"LC__CMDB__CATG__INVOICE__DATE\",\n \"isys_catg_invoice_list__edited\" => \"LC__CMDB__CATG__INVOICE__EDITED\",\n \"isys_catg_invoice_list__financial_accounting_delivery\" => \"LC__CMDB__CATG__INVOICE__FINANCIAL_ACCOUNTING_DELIVERY\",\n \"isys_catg_invoice_list__charged\" => \"LC__CMDB__CATG__INVOICE__CHARGED\",\n ];\n }", "public static function get_fields()\n {\n }", "function GetCompanies()\n{\n\t$CompArr=array();\n\t$Query = \"SELECT * FROM \".PFX.\"_tracker_client ORDER BY NAME ASC\";\n\t$Sql = new Query($Query);\n\twhile ($Row=$Sql->Row()) {\n\t\t$CompArr[$Sql->Position]['Name']=htmlspecialchars(stripslashes($Row->NAME));\n\t\t$CompArr[$Sql->Position]['Value']=$Row->ID;\n\t}\n\treturn $CompArr;\n}", "public function getCustom()\n {\n if (is_null($this->custom)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_CUSTOM);\n if (is_null($data)) {\n return null;\n }\n\n $this->custom = CustomFieldsModel::of($data);\n }\n\n return $this->custom;\n }", "public function fetchFields();", "public function getSearchFields();", "private function loadFields(){\n\t\t$this->fields = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`field`.`id` \t\t\t'field_id',\n\t\t\t\t`type`.`name` \t\t\t'type',\n\t\t\t\t`field`.`name`\t\t\t'name',\n\t\t\t\t`field`.`label`\t\t\t'label',\n\t\t\t\t`field`.`default`\t\t'default',\n\t\t\t\t`field`.`required`\t\t'required',\n\t\t\t\t`field`.`depends_id`\t'depends_id',\n\t\t\t\t`field`.`depends_value`\t'depends_value',\n\t\t\t\t`field`.`placeholder`\t'placeholder'\n\t\t\tFROM `mark_reg_fields` `field`\n\t\t\tLEFT JOIN `mark_reg_field_types` `type` ON `type`.`id` = `field`.`type_id`\n\t\t\tWHERE\n\t\t\t\t`field`.`enabled` = 1\n\t\t\t\tAND `field`.`form_id` = %d\n\t\t\t\tAND `field`.`backend_only` = 0\n\t\t\tORDER BY\n\t\t\t\t`field`.`order`\n\t\t\", $this->form_id));\n\t}", "public function customFieldValues()\n {\n return $this->morphMany(\\VentureDrake\\LaravelCrm\\Models\\FieldValue::class, 'custom_field_valueable');\n }", "public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }", "public function getCMSFields()\n {\n $fields = parent::getCMSFields();\n $fields->replaceField('Country', new DropdownField('Country', 'based on a sale to ', EcommerceCountry::get_country_dropdown()));\n $fields->replaceField('Root.Main', new DropdownField('TaxType', 'Tax Type', singleton($this->ClassName)->dbObject('TaxType')->enumValues()));\n\n $fields->removeByName('DefaultCountry');\n $fields->addFieldToTab('Root.Debug', new ReadonlyField('DefaultCountryShown', 'Prices are based on sale to', $this->DefaultCountry));\n\n $fields->removeByName('DefaultRate');\n $fields->addFieldToTab('Root.Debug', new ReadonlyField('DefaultRateShown', 'Default rate', $this->DefaultRate));\n\n $fields->removeByName('CurrentRate');\n $fields->addFieldToTab('Root.Debug', new ReadonlyField('CurrentRateShown', 'Rate for current order', $this->CurrentRate));\n\n $fields->removeByName('RawTableValue');\n $fields->addFieldToTab('Root.Debug', new ReadonlyField('RawTableValueShown', 'Raw table value', $this->RawTableValue));\n\n $fields->removeByName('DebugString');\n $fields->addFieldToTab('Root.Debug', new ReadonlyField('DebugStringShown', 'Debug String', $this->DebugString));\n\n return $fields;\n }", "function getExtIdCustomFieldCandidates() {\n // Mantis customFields types\n $mType_string = 0;\n $mType_numeric = 1;\n\n $query = \"SELECT * FROM `mantis_custom_field_table` WHERE `type` IN ($mType_string, $mType_numeric) ORDER BY name\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n throw new Exception(\"get ExtId candidates FAILED\");\n }\n\n $candidates = array();\n while ($row = mysql_fetch_object($result)) {\n $candidates[\"$row->id\"] = $row->name;\n }\n return $candidates;\n}", "public function get_fields()\n {\n $catalogue_name = get_param_string('catalogue_name', '');\n if ($catalogue_name == '') {\n return array();\n }\n return $this->_get_fields($catalogue_name);\n }", "protected function get_fields() {\n\t\treturn rwmb_get_registry( 'field' )->get_by_object_type( 'post' );\n\t}", "function get_contacts_by_company($id) {\n return get_view_data_where('org_contact_list', $id);\n}", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "public function testGetCustomFields()\n {\n $expected = [\n 'Media Data Service' => [\n 'Media' => [\n 'http://www.example.com/xml' => new DiscoveredCustomField(\\stdClass::class, new CustomField()),\n ],\n ],\n ];\n /** @var \\PHPUnit_Framework_MockObject_MockObject|CustomFieldDiscoveryInterface $discovery */\n $discovery = $this->createMock(CustomFieldDiscoveryInterface::class);\n $discovery->expects($this->once())\n ->method('getCustomFields')\n ->willReturn($expected);\n $manager = new CustomFieldManager($discovery);\n $this->assertEquals($expected, $manager->getCustomFields());\n }", "public function getEntityFields(): EntityFieldCollection\n {\n return EntityFieldCollection::fromResponse(\n $this->client->get(\"Appointments/entityInformation/fields\")\n );\n }", "function ihc_get_public_register_fields($exclude_field=''){\n\t$return = array();\n\t$fields_meta = ihc_get_user_reg_fields();\n\tforeach ($fields_meta as $arr){\n\t\tif ($arr['display_public_reg']>0 && !in_array($arr['type'], array('payment_select', 'social_media', 'upload_image', 'plain_text', 'file', 'capcha')) && $arr['name']!='tos'){\n\t\t\tif ($exclude_field && $exclude_field==$arr['name']){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$return[$arr['name']] = $arr['name'];\n\t\t}\n\t}\n\treturn $return;\n}", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "function create_custom_fields() {\n // Get all components to be listed\n $this->get_components();\n // Add components meta box\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'wpnext', 'WPNext Builder', array( &$this, 'display_custom_fields' ), $postType, 'normal', 'high' );\n }\n }\n }", "public function fetch_fields() {}", "public function getUserFields()\r\n {\r\n return CrugeFactory::get()->getICrugeFieldListModels();\r\n }" ]
[ "0.74639106", "0.7364284", "0.7190675", "0.71797734", "0.7130234", "0.7130234", "0.7072217", "0.7072217", "0.6979353", "0.69500995", "0.69429076", "0.69353116", "0.6778814", "0.6759232", "0.66742027", "0.6638845", "0.66285926", "0.6605922", "0.6573784", "0.64587885", "0.64205384", "0.64109695", "0.63863033", "0.63781595", "0.6346128", "0.6300647", "0.62932986", "0.6255388", "0.6240739", "0.6238146", "0.6200072", "0.6200072", "0.6200072", "0.61730564", "0.6158113", "0.6111957", "0.6105194", "0.6099583", "0.6094044", "0.608838", "0.608838", "0.608838", "0.608838", "0.608838", "0.608838", "0.6070302", "0.60515445", "0.605147", "0.605147", "0.605147", "0.60420823", "0.60394907", "0.6025614", "0.60239226", "0.60188276", "0.60014117", "0.59990245", "0.59947807", "0.5993213", "0.5983035", "0.5979439", "0.5974902", "0.5966441", "0.59661186", "0.59597284", "0.5930515", "0.5912936", "0.59042364", "0.5898364", "0.58949304", "0.5875161", "0.58738637", "0.5867703", "0.5838233", "0.58258873", "0.58258873", "0.58238465", "0.5814682", "0.5802883", "0.57989967", "0.5797908", "0.5796085", "0.57883674", "0.57811284", "0.57801455", "0.5773609", "0.57725906", "0.5769816", "0.57678854", "0.5764952", "0.57551754", "0.5752932", "0.5752932", "0.5752932", "0.5749089", "0.5746753", "0.5732829", "0.5727213", "0.5725256", "0.5714438", "0.5703196" ]
0.0
-1
Get one custom field based on cf id
public function getOne(Request $request) { $this->validate($request, [ "companyId" => "required|integer", "id" => "required|integer" ]); $customField = $this->customFieldDao->getOne( $request->id ); $data = array(); if (count($customField) > 0) { $data = $customField; $data->lovs = $this->lovDao->getAll($customField->lovTypeCode); } $resp = new AppResponse($data, trans('messages.dataRetrieved')); return $this->renderResponse($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acf_get_field($id = 0)\n{\n}", "public function getCustomField($id)\n {\n return $this->customFields[$id];\n }", "function acf_get_raw_field($id = 0)\n{\n}", "function get_field($id=false, $field=false) {\n\t\tif(!$id && !$field) return false;\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT wposts.$field FROM $wpdb->posts wposts WHERE wposts.ID=$id\";\n\t\t$results = $this->query($query);\n\t\tif(isset($results[0])) return $results[0]->$field;\n\t}", "function get_cf_field($name)\n\t{\n\t\treturn self::CF_PREFIX.$name;\n\t}", "public function getField($id)\r\n {\r\n return $this->_fetch($id);\r\n }", "function acf_get_sub_field($id, $field)\n{\n}", "public function getFieldById($id)\n {\n foreach ($this->fields as $field) {\n if ($field->getId() == $id) {\n return $field;\n }\n }\n\n return null;\n }", "function acf_get_value($post_id = 0, $field)\n{\n}", "function acf_get_field_post($id = 0)\n{\n}", "public function get_field( $id )\n {\n \tif( isset( $this->_fields[ $id ] ) ){\n return $this->_fields[ $id ];\n }\n\n /* MISSING FORM ID FALLBACK */\n /*\n if( ! $form_id ){\n $form_id = $wpdb->get_var( $wpdb->prepare(\n \"SELECT parent_id from {$wpdb->prefix}nf3_fields WHERE id = %d\", $id\n ));\n $this->_object = $this->_form = new NF_Database_Models_Form( $this->_db, $id );\n }\n */\n\n if( ! $this->_fields ){\n\t\t\t$this->get_fields();\n }\n\n if( ! isset( $this->_fields[ $id ] ) ){\n $form_id = $this->_object->get_id();\n $this->_fields[ $id ] = new NF_Database_Models_Field( $this->_db, $id, $form_id );\n }\n\n return $this->_fields[ $id ];\n }", "function acf_get_field_reference($field_name, $post_id)\n{\n}", "static function mega_get_field( $field_id ) {\n\t\tif ( is_post_type_archive() ) {\n\t\t\t// acf archive fields must have a prefix with single post name, i.e: product-content.\n\t\t\t$obj = get_queried_object();\n\t\t\t$name = $obj->name;\n\t\t\t$field = get_field( \"{$name}_{$field_id}\", 'option' );\n\t\t} elseif ( is_tax() || is_category() ) {\n\t\t\t$term = get_queried_object();\n\n\t\t\tif ( get_field( $field_id, $term ) ) {\n\t\t\t\t$field = get_field( $field_id, $term );\n\t\t\t} elseif ( $term->parent && get_field( $field_id, $term->taxonomy . '_' . $term->parent ) ) {\n\t\t\t\t$field = get_field( $field_id, $term->taxonomy . '_' . $term->parent );\n\t\t\t}\n\t\t} elseif ( get_field( $field_id ) ) {\n\t\t\t$field = get_field( $field_id );\n\t\t}\n\n\t\tif ( ! isset( $field ) && get_field( $field_id, 'option' ) ) {\n\t\t\t$field = get_field( $field_id, 'option' );\n\t\t}\n\n\t\tif ( isset( $field ) ) {\n\t\t\treturn $field;\n\t\t}\n\t}", "public function cfieldById($cf_id, $val)\n {\n\t\tif (!isset($this->entity_cfields[$cf_id])) {\n\t\t\treturn $this;\n\t\t}\n\t\t$cfield = $this->entity_cfields[$cf_id];\n\t\t$cf_method = '_cfield_type_'.$cfield->type_id;\n\t\tif (!method_exists($this, $cf_method)) {\n\t\t\t$cf_method = '_cfield_type_default';\n\t\t}\n\t\t$data = $this->$cf_method($cfield, $val);\n\t\t$this->entity->cfield($cf_id, $data);\n\t\treturn $this;\n\t}", "public function getFieldById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\t\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_field', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getCustomField( $custom_id ) {\n\t\treturn $this->call( 'custom-fields/' . $custom_id, 'GET' );\n\t}", "private function getField($id)\n {\n $filteredList = $this->fieldList->filter(\n function ($field) use ($id) {\n return $field->getId() === $id;\n }\n );\n\n return $filteredList->count() > 0\n ? $filteredList->first()\n : null;\n }", "function get_field($key, $page_id = 0) { /// get_field é para somente pegar o valor do que quero\n $id = $page_id !== 0 ? $page_id : get_the_ID();\n return get_post_meta($id, $key, true);\n }", "function field($id, $field, $default=null) {\n\t\tif(array_key_exists($field, $this->schema())) {\n\t\t\t$res = $this->query('SELECT `'.$field.'` FROM `'.$this->table.'` WHERE `'.$this->primaryKey.'` = \\''.$this->escape($id).'\\' LIMIT 1');\n\t\t\tif($row = $res->fetch_row()) {\n\t\t\t\t$res->free();\n\t\t\t\treturn $row[0];\n\t\t\t}\n\t\t} else { /* throw error? */ }\n\t\treturn $default;\n\t}", "function acf_get_meta_field($key = 0, $post_id = 0)\n{\n}", "public function get_field_id() {\n\t\treturn $this->get_field_attr( 'id' );\n\t}", "function news_get_field( $p_news_id, $p_field_name ) {\r\n\t\t$row = news_get_row( $p_news_id );\r\n\t\treturn ( $row[$p_field_name] );\r\n\t}", "public function fetchField();", "function getFieldValue($field);", "function acf_get_reference($field_name, $post_id)\n{\n}", "public function find(int $customFieldId)\n {\n return CustomField::find($customFieldId);\n }", "public function retrieve($id)\n {\n return Field::find($id);\n }", "public function getLookupField() {}", "public abstract function FetchField();", "function sage_get_field( $key, $id=false, $format=true ) {\n\n global $post;\n\n $key = trim( filter_var( $key, FILTER_SANITIZE_STRING ) );\n $result = '';\n\n if ( function_exists( 'get_field' ) ) {\n if ( isset( $post->ID ) && !$id )\n $result = get_field( $key, $post->ID, $format);\n else\n $result = get_field( $key, $id, $format );\n }\n\n return $result;\n}", "public function get_field(/* .... */)\n {\n return $this->_field;\n }", "function acf_get_fields_by_id($parent_id = 0)\n{\n}", "public function loadFieldById($id)\r\n {\r\n return CrugeFactory::get()->getICrugeFieldLoadModel($id);\r\n }", "function get_field($type, $type_id = '', $field = 'name')\n {\n if ($type_id != '') {\n $l = $this->db->get_where($type, array(\n $type . '_id' => $type_id\n ));\n $n = $l->num_rows();\n if ($n > 0) {\n return $l->row()->$field;\n }\n }\n }", "function acf_get_local_field($key = '')\n{\n}", "public function getField($field_name);", "function get_additional_field($field_id) {\r\n\t\t$sql = \"SELECT * FROM sys_man_additional_fields WHERE field_id = ?\";\r\n\t\t$sql = $this->clean_sql($sql);\r\n\t\t$data = array(\"$field_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\t$result = $query->result();\r\n\t\treturn ($result);\r\n\t}", "public function fieldfromid($fieldid) {\n if (empty($fieldid) OR stripos($fieldid, \"field\") === false) {\n return false;\n }\n if (strpos($fieldid, \"siteField\") > 0) {\n //a siteField\n $id = substr($fieldid, 14);\n return ORM::factory(\"siteField\", $id);\n } else {\n //a normal field\n $id = substr($fieldid, 10);\n return ORM::factory(\"field\", $id);\n }\n }", "public function getField($id)\n {\n return isset($this->_view) ? $this->_view->getField($id) : null;\n }", "function get_field($selector, $post_id = \\false, $format_value = \\true)\n{\n}", "function clients_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM clients WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "function acf_get_raw_fields($id = 0)\n{\n}", "public function getField();", "public function getField();", "public function getField();", "function acf_idval($value)\n{\n}", "public static function getUiFilterField($id)\n\t{\n\t\tforeach (static::getFilterFields() as $field)\n\t\t{\n\t\t\tif ($field['id'] === $id)\n\t\t\t{\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function _options_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM _options WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function getIdentifierField();", "public function GetCb($field,$id)\r\n {\r\n $query = mysql_query(\"SELECT * FROM coblos WHERE id_coblos = '$id' \");\r\n $row = mysql_fetch_array($query);\r\n if($field)\r\n return $row[$field];\r\n }", "public function get_field_id($field_name, $category_id)\n {\n $this->db->where('product_filter_key', strtolower($field_name));\n $field = $this->db->get(\"custom_fields\")->row();\n if($field) {\n $field_id = $field->id;\n } else {\n $this->db->insert(\"custom_fields\", [\n 'field_type' => 'text',\n 'row_width' => 'half',\n 'is_required' => 0,\n 'status' => 1,\n 'field_order' => 3,\n 'is_product_filter' => 0,\n 'product_filter_key' => strtolower($field_name),\n ]);\n $field_id = $this->db->insert_id();\n $this->db->insert(\"custom_fields_category\", [\n 'category_id' => $category_id,\n 'field_id' => $field_id,\n ]);\n $this->db->insert(\"custom_fields_lang\", [\n 'field_id' => $field_id,\n 'lang_id' => 1,\n 'name' => $field_name,\n ]);\n $this->db->insert(\"custom_fields_lang\", [\n 'field_id' => $field_id,\n 'lang_id' => 2,\n 'name' => $field_name.\"(fr)\",\n ]);\n }\n return $field_id;\n }", "function acf_maybe_get_field($selector, $post_id = \\false, $strict = \\true)\n{\n}", "public function getField($pk = null)\n\t{\n\t\treturn parent::getRecord($pk);\n\t}", "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}", "function getFieldID() {\n\t\treturn $this->iFieldID;\n\t}", "public function getFieldId()\n {\n if (array_key_exists(\"fieldId\", $this->_propDict)) {\n return $this->_propDict[\"fieldId\"];\n } else {\n return null;\n }\n }", "function get_field_object($selector, $post_id = \\false, $format_value = \\true, $load_value = \\true)\n{\n}", "function sage_the_field( $key, $id=false ) {\n echo sage_get_field( $key, $id );\n}", "function f($field) {\n\t\treturn($this->fetchfield($field));\n\t}", "function get_field($uniqueid, $tablealias, $fieldname, $advanced, $displayname, $type, $options) {\n global $USER, $CFG, $SITE;\n\n if (file_exists($CFG->dirroot . '/curriculum/lib/filtering/' . $type . '.php')) {\n require_once($CFG->dirroot . '/curriculum/lib/filtering/' . $type . '.php');\n }\n\n $classname = 'generalized_filter_' . $type;\n\n return new $classname ($uniqueid, $tablealias, $fieldname, $displayname, $advanced, $fieldname, $options);\n }", "function getValue(int $field);", "function get_field_data_by_id($field_id, $contact)\n{\n if (isset($contact['custom_fields'])) {\n $out = array();\n\n foreach ($contact['custom_fields'] as $key => $value) {\n if ($value['id'] == $field_id) {\n foreach ($value['values'] as $key => $data) {\n $out[] = $data['value'];\n }\n }\n }\n }\n\n if (!empty($out)) {\n return $out;\n } else {\n return false;\n }\n}", "public function cfield($cf_name, $val)\n {\n\t\tif (!isset($this->entity_cfields_from_name[$cf_name])) {\n\t\t\treturn $this;\n\t\t}\n\t\treturn $this->cfieldById($this->entity_cfields_from_name[$cf_name], $val);\n\t}", "function acf_get_meta($post_id = 0)\n{\n}", "public function get($field);", "public function get($field);", "public function get_field_id($field_name)\n {\n }", "function getfield($field){\n\n\t\treturn($this->record[$field]);\n\t}", "public function getFieldRowById($id) {\n\t\tforeach ($this->fields as $field) {\n\t\t\tif ($field instanceof FieldRow && $field->getId() == $id) {\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getField($code_of_field) {\r\n\r\n\t\tif (isset ( $this->_data [\"details\"] ) && array_key_exists ( $code_of_field, $this->_data [\"details\"] )) {\r\n\t\t\treturn $this->_data [\"details\"] [$code_of_field] [\"value\"];\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function get_type_name_by_id_custom($type,$type_id='',$field='name')\n\t{\t$type1='comp_type'; //table field name\n\t\treturn\t$this->db->get_where($type,array($type1.'_id'=>$type_id))->row()->$field;\t\n\t}", "public function get_field_name();", "public function getField($fieldName) {}", "public function getField($name) { return $this->fields[$name]; }", "public abstract function GetCurrentField();", "public function getField()\n {\n return $this->belongsTo(Field::class, 'field_id')->first();\n }", "function get($page_id) {\n\t\t// https://www.advancedcustomfields.com/resources/get_field/\n\t\t$data = get_field(self::ACF_NAME, $page_id);\n\n\t\treturn $data;\n\t}", "function getCustomFieldID($entity) {\n\n $customField = civicrm_api3('custom_field', 'get', array(\n 'version' => 3,\n 'custom_group_id' => $entity->custom_group_id,\n 'label' => $entity->label,\n )\n );\n\n if (!empty($customField['id'])) {\n return $customField['id'];\n }\n\n return NULL;\n }", "public function __get($field){\n if ($field == 'usuario_id'){\n return $this->codigo;\n }\n else{\n return $this->fields[$field];\n }\n }", "public function getField($field_name) {\n $retval = NULL;\n // if field exists\n if (array_key_exists($field_name,$this->form_fields)) {\n $retval = $this->form_fields[$field_name];\n }\n return $retval;\n }", "function get_type_name_by_id_custom1($type,$type_id='',$field='name')\n \t{ $type1='surgery'; //table field name\n \t return $this->db->get_where($type,array($type1.'_id'=>$type_id))->row()->$field; \n \t}", "public function __get($field)\n {\n if ($field == 'userId')\n {\n return $this->uid;\n }\n else \n {\n return $this->fields[$field];\n }\n }", "function acf_get_post_id_info($post_id = 0)\n{\n}", "function geteZAttributeIdentifierFromField()\n {\n $this->current_field = current( $this->mapping );\n return $this->current_field;\n }", "public function getSingleIdentifierFieldName(): string;", "function acf_get_metaref($post_id = 0, $type = 'fields', $name = '')\n{\n}", "public function getFieldId()\n\t{\n\t\treturn 'slider_content';\n\t}", "function basel_compare_get_field_name_by_id( $id ) {\n\t\t$fields = array(\n\t\t\t'description' => esc_html__( 'Description', 'basel' ),\n\t\t\t'sku' => esc_html__( 'Sku', 'basel' ),\n\t\t\t'availability' => esc_html__( 'Availability', 'basel' ),\n\t\t\t'weight' => esc_html__( 'Weight', 'basel' ),\n\t\t\t'dimensions' => esc_html__( 'Dimensions', 'basel' ),\n\t\t);\n\n\t\treturn isset( $fields[ $id ] ) ? $fields[ $id ] : '';\n\t}", "function acf_maybe_idval($value)\n{\n}", "public function getIdField()\n {\n return $this->idField;\n }", "private function get_acf_field( $field_name, $post ) {\n\t\t// Support for ACF >= 5.2.3.\n\t\tif ( function_exists( 'acf_maybe_get_field' ) ) {\n\t\t\t$info = acf_maybe_get_field( $field_name, $post->ID, false );\n\t\t} else {\n\t\t\t$info = get_field_object( $field_name, $post->ID );\n\t\t}\n\n\t\treturn ( $info ) ? $info : array();\n\t}", "function get_custom_field($key, $echo = FALSE) {\r\n global $post;\r\n $custom_field = get_post_meta($post->ID, $key, true);\r\n if ($echo == FALSE) return $custom_field;\r\n echo $custom_field;\r\n }", "function GetField($field=0){\n\t\t\treturn @mysql_result($this->result,0,$field);\n\t\t}", "function brag_rest_get_flamingo( $object, $field_name, $request ) {\n\n\treturn get_post_meta( $object[ 'id' ] );\n}", "public function retrieveCustomField( $term_id, $field = '' ) \n\t{\n\t\t$term_meta = get_option( sprintf( '%s_%d', $this->taxomomyStr, $term_id ) );\n\n\t\treturn ( is_array( $term_meta ) && isset( $term_meta[$field] ) ) ? $term_meta[$field] : '';\n\t}", "public function fetchFieldTypeFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('type', 0, \"SELECT `type` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\t}", "public function getCustomFieldsByItem($item_id) {\n $this->load->model('items_model');\n $cat_id = $this->items_model->getCategoryFor($item_id);\n $this->db->select('*');\n $this->db->where(array('item_id' => $item_id, 'custom_fields_content.account_id' => $this->session->userdata('objSystemUser')->accountid, 'custom_fields_content.category_id' => $cat_id));\n $this->db->join('custom_fields_content', 'custom_fields.id = custom_fields_content.custom_field_id');\n $query = $this->db->get('custom_fields');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "function pgm_get_acf_key( $field_name ) {\n\n $field_key = $field_name;\n\n switch( $field_name ) {\n\n case 'pgm_fname':\n $field_key = 'field_57767bd66431b';\n break;\n case 'pgm_lname':\n $field_key = 'field_57767bf76431c';\n break;\n case 'pgm_email':\n $field_key = 'field_57767c396431d';\n break;\n case 'pgm_subscriptions':\n $field_key = 'field_57767c886431e';\n break;\n\n }\n\n return $field_key;\n\n}", "public function get_custom_fields($post_id)\n {\n }", "public function getCustomFieldValueByName($name) {\n return Doctrine::getTable('ArticleCustomFieldValue')->getByArticleAndName($this, $name);\n }", "function getLabelFromId($id) {\n return 'field_'.$id;\n }" ]
[ "0.76001436", "0.73271996", "0.7291533", "0.7158341", "0.7081439", "0.69805276", "0.69225323", "0.68484944", "0.68387437", "0.68021524", "0.6788019", "0.6780805", "0.67696613", "0.6752736", "0.67363", "0.67362195", "0.6687595", "0.66763157", "0.66671646", "0.66462916", "0.6570799", "0.6570311", "0.65624404", "0.6543257", "0.6540985", "0.6537479", "0.65303683", "0.65241647", "0.6521355", "0.6495052", "0.64843297", "0.64649093", "0.64548737", "0.6441815", "0.6427503", "0.6421299", "0.64164394", "0.6402402", "0.638997", "0.6368643", "0.6366144", "0.63608843", "0.63583165", "0.63583165", "0.63583165", "0.6345741", "0.633022", "0.6325645", "0.6311039", "0.63107234", "0.63077784", "0.6291504", "0.6290649", "0.6244275", "0.6239946", "0.62333876", "0.62237483", "0.6208816", "0.61951655", "0.61872005", "0.61844707", "0.6183399", "0.6166852", "0.6150357", "0.61480564", "0.61480564", "0.6137003", "0.61303633", "0.61296105", "0.6128264", "0.61152446", "0.61084086", "0.61069995", "0.6105406", "0.61014855", "0.6098213", "0.609194", "0.6085838", "0.6084998", "0.60381895", "0.6037069", "0.6035145", "0.60284734", "0.6024628", "0.6015285", "0.60147065", "0.5997939", "0.5992859", "0.5987984", "0.59719044", "0.5961589", "0.5959494", "0.5942576", "0.5940496", "0.59355474", "0.5922856", "0.59224206", "0.5916851", "0.5914229", "0.59010476", "0.5900152" ]
0.0
-1
Save custom field to DB
public function save(Request $request) { $data = array(); $lastFieldName = $this->customFieldDao->getLastFieldName($request->lovCusmod); if (count($lastFieldName) > 0) { $newFieldName = explode("c", $lastFieldName->fieldName); $temp = "c" . strval(intval($newFieldName[1]) + 1); } else { $temp = "c" . strval(1); } $reqData = [ "fieldName" => $temp ]; $request->merge($reqData); $this->checkCustomFieldRequest($request); DB::transaction(function () use (&$request, &$data) { if ($request->lovCdtype == 'OPT' && $request->isNewLov) { $customField = $this->constructCustomFieldCustom($request); $data['id'] = $this->customFieldDao->save($customField); $this->validate($request, [ 'lovTypeCode' => 'required|max:10|alpha_num', 'lovTypeName' => 'required|max:50' ]); $lovType = [ "code" => $request->lovTypeCode . '|C', "name" => $request->lovTypeName ]; $this->lovTypeDao->save($lovType); $this->saveLov($request, $request->lovTypeCode . '|C'); } else { $customField = $this->constructCustomField($request); $data['id'] = $this->customFieldDao->save($customField); } }); $resp = new AppResponse($data, trans('messages.dataSaved')); return $this->renderResponse($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save() {\n //save the added fields\n }", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "public function save()\n {\n // Quantity is reset to 1 if it's not specified, so make sure it's included\n if (count($this->updatedFields) AND !in_array('Quantity', $this->updatedFields)) {\n $this->updatedFields[] = 'Quantity';\n }\n\n // Need to save custom fields first\n $this->saveCustom();\n parent::save();\n }", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function save() {}", "public function save() {}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save() {}", "public abstract function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "protected function save_meta() {}", "protected function hook_afterSave(){}", "public function save() {\n\n $columnName = $this->profileField->internal_name;\n\n // Try create column name\n if (!Profile::model()->columnExists($columnName)) {\n $sql = \"ALTER TABLE profile ADD `\" . $columnName . \"` INT;\";\n $this->profileField->dbConnection->createCommand($sql)->execute();\n }\n\n parent::save();\n }", "public function afterCreate()\n {\n $this->saveCustomFields();\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "public function saveToDB()\n {\n }", "public function save( $value = null ) {\n\t\t$submited_value = json_decode( stripslashes( $_REQUEST['customized'] ) );\n\t\tparent::save( explode( ',', $submited_value->{$this->field->alias} ) );\n\t\t/* dirty hack to make multiple elms on customize.php page */\n\n\t}", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function hometown_woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product'];\n update_post_meta($post_id, '_custom_product', esc_attr($woocommerce_custom_product_text_field));\n}", "public function postSave() {}", "public function save()\r\n {\r\n \r\n }", "public function save()\r\n {\r\n //\r\n }", "function wpbm_extra_field_save( $post_id ){\n\n// Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'wpbm_blog_nonce' ] ) && wp_verify_nonce( $_POST[ 'wpbm_blog_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n// Exits script depending on save status\n if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {\n return;\n }\n if ( isset( $_POST[ 'wpbm_extra_option' ] ) ) {\n\n $wpbm_extra = ( array ) $_POST[ 'wpbm_extra_option' ];\n\n $extra_field = $this -> sanitize_array( $wpbm_extra );\n// save data\n update_post_meta( $post_id, 'wpbm_extra_option', $extra_field );\n }\n return;\n }", "public function saveCustomFields()\n\t{\n\t\t$state = $this->getStateVariables();\n\t\t$validation = $this->getValidation();\n\n\t\t$user = JFactory::getUser();\n\t\t$user = $this->getState('user', $user);\n\n\t\t// Find an existing record\n\t\t$list = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->user_id($user->id)\n\t\t\t->getItemList();\n\n\t\tif(!count($list)) {\n\t\t\t$id = 0;\n\t\t} else {\n\t\t\t$thisUser = array_pop($list);\n\t\t\t$id = $thisUser->akeebasubs_user_id;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'akeebasubs_user_id' => $id,\n\t\t\t'user_id'\t\t=> $user->id,\n\t\t\t'isbusiness'\t=> $state->isbusiness ? 1 : 0,\n\t\t\t'businessname'\t=> $state->businessname,\n\t\t\t'occupation'\t=> $state->occupation,\n\t\t\t'vatnumber'\t\t=> $state->vatnumber,\n\t\t\t'viesregistered' => $validation->validation->vatnumber,\n\t\t\t// @todo Ask for tax authority\n\t\t\t'taxauthority'\t=> '',\n\t\t\t'address1'\t\t=> $state->address1,\n\t\t\t'address2'\t\t=> $state->address2,\n\t\t\t'city'\t\t\t=> $state->city,\n\t\t\t'state'\t\t\t=> $state->state,\n\t\t\t'zip'\t\t\t=> $state->zip,\n\t\t\t'country'\t\t=> $state->country,\n\t\t\t'params'\t\t=> $state->custom\n\t\t);\n\n\t\t// Allow plugins to post-process the fields\n\t\tJLoader::import('joomla.plugin.helper');\n\t\tJPluginHelper::importPlugin('akeebasubs');\n\t\t$app = JFactory::getApplication();\n\t\t$jResponse = $app->triggerEvent('onAKSignupUserSave', array((object)$data));\n\t\tif(is_array($jResponse) && !empty($jResponse)) foreach($jResponse as $pResponse) {\n\t\t\tif(!is_array($pResponse)) continue;\n\t\t\tif(empty($pResponse)) continue;\n\t\t\tif(array_key_exists('params', $pResponse)) {\n\t\t\t\tif(!empty($pResponse['params'])) foreach($pResponse['params'] as $k => $v) {\n\t\t\t\t\t$data['params'][$k] = $v;\n\t\t\t\t}\n\t\t\t\tunset($pResponse['params']);\n\t\t\t}\n\t\t\t$data = array_merge($data, $pResponse);\n\t\t}\n\n\t\t// Serialize custom fields\n\t\t$data['params'] = json_encode($data['params']);\n\n\t\t$status = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->setId($id)\n\t\t\t->getItem()\n\t\t\t->save($data);\n\n\t\treturn $status;\n\t}", "protected function beforeSaveInDB(){}", "public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function save()\n\t{\n\n\t}", "public function saveField($field, $value = '')\n\t{\n\t\tif (!empty($value)) {\n\t\t\t$this->set($field,$value);\n\t\t}\n\n\t\tif (method_exists($this,'save' . Helpers::camelcase($field))) {\n\t\t\t$this->{'save' . Helpers::camelcase($field)}();\n\t\t} else {\n\t\t\tupdate_post_meta($this->id, $field, $this->{$field});\n\t\t}\n\t\treturn $this;\n\t}", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\n\t}", "function saveInto($dataObject) {\n\t\t$fieldName = $this->name;\n\t\tif($fieldName) {\n\t\t\t$dataObject->$fieldName = $this->value ? 1 : 0;\n\t\t} else {\n\t\t\tuser_error(\"DBField::saveInto() Called on a nameless '$this->class' object\", E_USER_ERROR);\n\t\t}\n\t}", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\r\n\t}", "protected function _postSave()\r\n\t{\r\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "public function save()\n {\n update_option($this->optionKey, $this->fields);\n }", "public function save() {\n }", "abstract protected function save($data);", "public function save() {\n }", "public function save() {\n }", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "public function save()\n {\n // For V2.0\n }", "public function save()\n {\n }", "public function save($data);", "public function save($data);", "public function save($data);", "public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "public function save($exclude_post=false) {\n $fields = stripslashes($this->get('fields'));\n while(!is_array($fields)) {\n $fields = unserialize($fields);\n\n if (!$fields) {\n $fields = [];\n break;\n }\n }\n\n $this->set('fields', serialize($fields));\n return parent::save($exclude_post);\n }", "public function save()\n {\n //\n }", "public function onAfterSave();", "abstract public function save( $data );", "public function save(){\n }", "public function save() {\n\n }", "public function save()\n {\n }", "public function save()\n {\n }", "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "function woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product_upc'];\n if (!empty($woocommerce_custom_product_text_field))\n update_post_meta($post_id, '_custom_product_upc', esc_attr($woocommerce_custom_product_text_field));\n\n}", "function save() {\n if ($this->nid && $this->license_uri) {\n $data = serialize($this);\n $data = str_replace(\"'\", \"\\'\", $data);\n $result = db_query(\"INSERT INTO {creativecommons} (nid, data) VALUES (%d, '%s')\", $this->nid, $data);\n return $result;\n }\n return;\n }", "public function save($model, $value, $loaded);", "public function addField();", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function save( $d = null ){\n\t\tif( ! is_null( $d ) ) $this->data = $d;\n\t\t$this->storeSfield();\n\t\tDBData::save( $this->data );\n\t}", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function hook_beforeSave(){}", "public function save(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n \n $data = [];\n $pk = $this->getPk();\n foreach($this->_datas as $key => $value){\n if($key!=$pk && in_array($key, static::$_fields)){\n $data[$key] = $value.'';\n }\n }\n \n if( isset( $this->$pk ) ){\n // Update row\n $wpdb->update(\n $table_name,\n $data,\n [$pk=>$this->$pk]\n );\n }else{\n // Insert row\n $wpdb->insert(\n $table_name,\n $data\n );\n $this->$pk = $wpdb->insert_id;\n }\n \n return $this;\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function woocommerce_product_custom_fields_save($post_id) {\n $woocommerce_custom_product_number_field = $_POST['sharethewarmth_selling_goal'];\n if (!empty($woocommerce_custom_product_number_field)) {\n update_post_meta($post_id, 'sharethewarmth_selling_goal', esc_attr($woocommerce_custom_product_number_field));\n }\n}", "public function save()\n {\n\n // generate all column's sql query\n $column_names = '';\n $column_values = '';\n foreach ($this->columns as $field_name => $column_obj)\n {\n if ($column_obj->columnName === null) {\n $column_names .= $field_name.', ';\n } else {\n $column_names .= $column_obj->columnName.', ';\n }\n $column_values .= $column_obj->generateValueForSQL().', ';\n }\n $column_names = substr($column_names, 0, -1);\n $column_values = substr($column_values, 0, -1);\n $this_table_name = $this->table_name;\n $this_id = $this->id;\n\n if ($this->id === 0) {\n // This object is not saved yet.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values);';\n // Execute query\n } else {\n // This object is on the DB.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values) WHERE id=$this_id;';\n // Execute query\n }\n\n mysql_run_query($query);\n\n }", "public function store(CustomUserFieldRequest $request)\n {\n $customUserField = new CustomUserField($request->all());\n $customUserField->name = str_slug($request->get('title'));\n $customUserField->save();\n return redirect(\"/custom_user_field\");\n }", "private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function save($name, $code);" ]
[ "0.7164424", "0.69346005", "0.6826086", "0.6736", "0.6736", "0.6687669", "0.66729736", "0.66729736", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.66717654", "0.6671249", "0.66085833", "0.65763324", "0.65763324", "0.65763324", "0.65763324", "0.65763324", "0.64994985", "0.6497826", "0.64861655", "0.64724916", "0.6453247", "0.64449555", "0.6443433", "0.64280254", "0.64271224", "0.6402254", "0.6400181", "0.63568544", "0.62841", "0.6263919", "0.62508863", "0.6228988", "0.6227766", "0.6195722", "0.618687", "0.6186025", "0.61851805", "0.6181932", "0.6171007", "0.6168588", "0.61625195", "0.6162104", "0.6160312", "0.61505985", "0.6145476", "0.61359674", "0.61359674", "0.61173564", "0.61164093", "0.6109751", "0.6106325", "0.6106325", "0.6106325", "0.60991997", "0.6098644", "0.60926807", "0.60917306", "0.6085307", "0.60801405", "0.60794294", "0.60741645", "0.6074024", "0.6074024", "0.60675806", "0.6063221", "0.6056617", "0.6051594", "0.6048388", "0.6043214", "0.6034364", "0.60318476", "0.6024791", "0.6018952", "0.6018739", "0.601181", "0.6000875", "0.6000875", "0.6000875", "0.59887016", "0.5982269", "0.5981746", "0.59771234", "0.5975705", "0.5970729" ]
0.0
-1
Update grade to DB
public function update(Request $request) { $this->validate($request, ['id' => 'required|integer']); $this->checkCustomFieldRequest($request); DB::transaction(function () use (&$request) { $customField = $this->constructCustomField($request); $this->customFieldDao->update( $request->id, $customField ); if ($request->lovCdtype == 'OPT' && $request->isNewLov) { $this->saveLov($request, $request->lovTypeCode); } }); $resp = new AppResponse(null, trans('messages.dataUpdated')); return $this->renderResponse($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_grade() {\r\n\r\n\t\t\t//new method\r\n\t\t\t$sql = \"UPDATE grades SET student_id = ?, course_id = ?, degree = ?, examine_at = ? WHERE id = ?;\";\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->student_id, $this->course_id, $this->degree, $this->examine_at, $this->id]);\r\n\t\t\t//old method\r\n\t\t\t/*$sql = \"UPDATE grades SET student_id = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET course_id = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET degree = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET examine_at = ? WHERE id = ?;\";\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->student_id, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->course_id, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->degree, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->examine_at, $this->id]);*/\r\n\t\t}", "function editGrade(){\n $gradeName = Slim::getInstance()->request()->post('gradeName');\n $percentage = Slim::getInstance()->request()->post('percentage');\n $gradeId = Slim::getInstance()->request()->post('gradeId');\n try {\n $sql = \"UPDATE grades SET gradeName = :gradeName, percentage = :percentage WHERE gradeId = :gradeId\"; \n $db = getConnection();\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"gradeName\", $gradeName);\n $stmt->bindParam(\"percentage\", $percentage);\n $stmt->bindParam(\"gradeId\", $gradeId);\n $stmt->execute();\n $db = null;\n\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n } \n}", "public function save()\r\n {\r\n if($this->id != -1)\r\n {\r\n $this->update_target_grade();\r\n }\r\n else\r\n {\r\n $this->insert_target_grade();\r\n }\r\n }", "function sqlUpdateGrade($gradeName)\n\t{\n\t\t$sql = \"\n\t\tUPDATE tbl_grade\n\t\tSET grade_name = :grade_name\n\t\tWHERE grade_id = :grade_id\n\t\t\";\n\n\t\treturn $sql;\n\t}", "public function update(Request $request, Grade $grade)\n {\n // $gradeId = $grade->id;\n // $grade = Grade::findorFail($gradeId);\n // $this->validate($request, [\n // 'teacher_id' => 'required|numeric',\n // 'name' => ['required',\n // Rule::unique('grades')->ignore($grade->id),\n // ]\n // ]);\n //\n // if($request->input('name') == $grade->name && $request->input('teacher_id') == $grade->teacher_id){\n // return redirect()->back()->with('warning_message', \"You didn't change any data.\");\n // }\n // $updatedGrade = $request->all();\n // $grade->fill($updatedGrade)->save();\n // return redirect()->back()->with('flash_message', \"Grade successfully updated!\");\n }", "public function test_update_grade_item() {\n\n $testarray = $this->csv_load($this->oktext);\n $testobject = new phpunit_gradeimport_csv_load_data();\n\n // We're not using scales so no to this option.\n $verbosescales = 0;\n // Map and key are to retrieve the grade_item that we are updating.\n $map = array(1);\n $key = 0;\n // We return the new grade array for saving.\n $newgrades = $testobject->test_update_grade_item($this->courseid, $map, $key, $verbosescales, $testarray[0][6]);\n\n $expectedresult = array();\n $expectedresult[0] = new stdClass();\n $expectedresult[0]->itemid = 1;\n $expectedresult[0]->finalgrade = $testarray[0][6];\n\n $this->assertEquals($newgrades, $expectedresult);\n\n // Try sending a bad grade value (A letter instead of a float / int).\n $newgrades = $testobject->test_update_grade_item($this->courseid, $map, $key, $verbosescales, 'A');\n // The $newgrades variable should be null.\n $this->assertNull($newgrades);\n $expectederrormessage = get_string('badgrade', 'grades');\n // Check that the error message is what we expect.\n $gradebookerrors = $testobject->get_gradebookerrors();\n $this->assertEquals($expectederrormessage, $gradebookerrors[0]);\n }", "function dataform_grade_item_update($data, $grades=NULL) {\n global $CFG;\n require_once(\"$CFG->libdir/gradelib.php\");\n\n $params = array(\n 'itemname'=>$data->name,\n 'idnumber'=>$data->cmidnumber\n );\n\n if (!$data->grade) {\n $params['gradetype'] = GRADE_TYPE_NONE;\n\n } else if ($data->grade > 0) {\n $params['gradetype'] = GRADE_TYPE_VALUE;\n $params['grademax'] = $data->grade;\n $params['grademin'] = 0;\n\n } else if ($data->grade < 0) {\n $params['gradetype'] = GRADE_TYPE_SCALE;\n $params['scaleid'] = -$data->grade;\n }\n\n if ($grades === 'reset') {\n $params['reset'] = true;\n $grades = NULL;\n }\n\n return grade_update('mod/dataform', $data->course, 'mod', 'dataform', $data->id, 0, $grades, $params);\n}", "public function update(Request $request, Grade $grade)\n {\n $grade->update($request->all());\n return redirect()->route('grades.index',$grade->team_id)->with('success', true);\n }", "public function update()\n {\n try\n {\n if (empty($this->getWNumber()))\n {\n die(\"error: the wnumber is not provided\");\n }\n else\n {\n // Update the basic information required for a user\n parent::update();\n\n $dbh = DatabaseConnection::getInstance();\n\n // Prepare sql statement to update information for a student\n $stmtHandle = $dbh->prepare(\n \"UPDATE `Student` \n SET `OverallGPA`= :overallGPA,\n `MajorGPA`= :majorGPA,\n `ACTScore`= :actScore,\n `CurrentMajor`= :currentMajor,\n `FutureMajor`= :futureMajor,\n `CurrentAcademicLevel`= :currentAcademicLevel,\n `DegreeGoal`= :degreeGoal,\n `HighSchool`= :highSchool,\n `PreviousUniversity`= :previousUniversity,\n `FirstWSUSemester`= :firstWSUSemester,\n `FirstWSUYear`= :firstWSUYear,\n `ScheduleStatus`= :scheduleStatus,\n `ClubOrganizations`= :clubOrganizations,\n `HonorsAwards`= :honorsAwards,\n `CSTopicInterests`= :csTopicInterests,\n `PastScholarshipFinancialAid`= :pastScholarshipFinancialAid,\n `GreatestAchievement`= :greatestAchievement \n WHERE `wNumber` = :wNumber\");\n\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->bindValue(\":overallGPA\", $this->overallGPA);\n $stmtHandle->bindValue(\":majorGPA\", $this->majorGPA);\n $stmtHandle->bindValue(\":actScore\", $this->actScore);\n $stmtHandle->bindValue(\":currentMajor\", $this->currentMajor);\n $stmtHandle->bindValue(\":futureMajor\", $this->futureMajor);\n $stmtHandle->bindValue(\":currentAcademicLevel\", $this->currentAcademicLevel);\n $stmtHandle->bindValue(\":degreeGoal\", $this->degreeGoal);\n $stmtHandle->bindValue(\":highSchool\", $this->highSchool);\n $stmtHandle->bindValue(\":previousUniversity\", $this->previousUniversity);\n $stmtHandle->bindValue(\":firstWSUSemester\", $this->firstSemester);\n $stmtHandle->bindValue(\":firstWSUYear\", $this->firstYear);\n $stmtHandle->bindValue(\":scheduleStatus\", $this->scheduleStatus);\n $stmtHandle->bindValue(\":clubOrganizations\", $this->clubsOrganizations);\n $stmtHandle->bindValue(\":honorsAwards\", $this->honorsAwards);\n $stmtHandle->bindValue(\":csTopicInterests\", $this->csTopicInterests);\n $stmtHandle->bindValue(\":pastScholarshipFinancialAid\", $this->pastScholarshipFinancialAid);\n $stmtHandle->bindValue(\":greatestAchievement\", $this->greatestAchievement);\n\n $success = $stmtHandle->execute();\n\n if (!$success) {\n throw new \\PDOException(\"user full update operation failed.\");\n }\n\n // Delete all the course records related to this student to avoid redundant primary key in db\n $stmtHandle = $dbh->prepare(\"DELETE FROM `ConcurrentPastCourse` WHERE `wNumber` = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->execute();\n\n // Delete all the ap tests passed records related to this student to avoid rendundant primary key in db\n $stmtHandle = $dbh->prepare(\"DELETE FROM `APTestPassed` WHERE `wNumber` = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->execute();\n\n // When the current courses info for this student are passed in\n if (!empty($this->currentCourses) && !($this->currentCourses === null)) {\n $this->insertCourses(self::CURRENT_COURSE);\n }\n\n // When the previous courses info for this student are passed in\n if (!empty($this->previousCourses) && !($this->previousCourses === null)) {\n $this->insertCourses(self::PREVIOUS_COURSE);\n }\n\n // When the AP tests info for this student are passed in\n if (!empty($this->apTests) && !($this->apTests === null)) {\n $this->insertTests();\n }\n }\n }\n catch(\\PDOException $e)\n {\n throw $e;\n }\n\n }", "public function post_Table_data(){\n\t\t$this->load->model('teach_func/auto_save_tbl', 'this_model');\n\n\t\t$Q = $this->this_model->auto_update();\n\t\t\n\t\tif ($Q) {\n\t\t\t\n\t\t\techo \"Student_grade_updated! :)\";\n\t\t}\n\n\t}", "protected /*void*/ function setGrade(/*int*/ $aid, /*int*/ $sid, /*int*/ $grade)\n\t{\n\t\tif(!$this->validateGrade($grade))\n\t\t\tthrow new GradeFormatException();\n\n\t\t$query = $this->db->prepare(\"\n\t\t\tREPLACE INTO `grades` (\n\t\t\t\t`assignmentid`,\n\t\t\t\t`studentid`,\n\t\t\t\t`grade`\n\t\t\t) VALUES (\n\t\t\t\t:aid,\n\t\t\t\t:sid,\n\t\t\t\t:grade\n\t\t\t);\n\t\t\")->execute(array(\n\t\t\t':aid' => $aid,\n\t\t\t':sid' => $sid,\n\t\t\t':grade' => $grade\n\t\t));\n\t}", "public function updateDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n\n // check for duplicate\n $vals = sprintf(\"Level = %d\",$this->level);\n $sql = \" update Admins set $vals where Email = '$this->email';\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }", "public function update(Request $request, Grade $grade)\n {\n $this->validateForm();\n $grade->update($this->getForm());\n return redirect(route('grades.index'))->with('success', 'Kelas berhasil diperbaharui');\n }", "function bookking_grade_item_update($bookking, $grades=null) {\n global $CFG, $DB;\n require_once($CFG->libdir.'/gradelib.php');\n\n if (!isset($bookking->courseid)) {\n $bookking->courseid = $bookking->course;\n }\n $moduleid = $DB->get_field('modules', 'id', array('name' => 'bookking'));\n $cmid = $DB->get_field('course_modules', 'id', array('module' => $moduleid, 'instance' => $bookking->id));\n\n if ($bookking->scale == 0) {\n // Delete any grade item.\n bookking_grade_item_delete($bookking);\n return 0;\n } else {\n $params = array('itemname' => $bookking->name, 'idnumber' => $cmid);\n\n if ($bookking->scale > 0) {\n $params['gradetype'] = GRADE_TYPE_VALUE;\n $params['grademax'] = $bookking->scale;\n $params['grademin'] = 0;\n\n } else if ($bookking->scale < 0) {\n $params['gradetype'] = GRADE_TYPE_SCALE;\n $params['scaleid'] = -$bookking->scale;\n\n } else {\n $params['gradetype'] = GRADE_TYPE_TEXT; // Allow text comments only.\n }\n\n if ($grades === 'reset') {\n $params['reset'] = true;\n $grades = null;\n }\n\n return grade_update('mod/bookking', $bookking->courseid, 'mod', 'bookking', $bookking->id, 0, $grades, $params);\n }\n}", "function questionnaire_grade_item_update($questionnaire, $grades = null) {\n global $CFG;\n if (!function_exists('grade_update')) { // Workaround for buggy PHP versions.\n require_once($CFG->libdir.'/gradelib.php');\n }\n\n if (!isset($questionnaire->courseid)) {\n $questionnaire->courseid = $questionnaire->course;\n }\n\n if ($questionnaire->cmidnumber != '') {\n $params = array('itemname' => $questionnaire->name, 'idnumber' => $questionnaire->cmidnumber);\n } else {\n $params = array('itemname' => $questionnaire->name);\n }\n\n if ($questionnaire->grade > 0) {\n $params['gradetype'] = GRADE_TYPE_VALUE;\n $params['grademax'] = $questionnaire->grade;\n $params['grademin'] = 0;\n\n } else if ($questionnaire->grade < 0) {\n $params['gradetype'] = GRADE_TYPE_SCALE;\n $params['scaleid'] = -$questionnaire->grade;\n\n } else if ($questionnaire->grade == 0) { // No Grade..be sure to delete the grade item if it exists.\n $grades = null;\n $params = array('deleted' => 1);\n\n } else {\n $params = null; // Allow text comments only.\n }\n\n if ($grades === 'reset') {\n $params['reset'] = true;\n $grades = null;\n }\n\n return grade_update('mod/questionnaire', $questionnaire->courseid, 'mod', 'questionnaire',\n $questionnaire->id, 0, $grades, $params);\n}", "public function update($gradeId, $obj)\n {\n $obj['updated_by'] = $this->requester->getUserId();\n $obj['updated_at'] = Carbon::now();\n\n LogDao::insertLogImpact($this->requester->getLogId(), 'grades', $obj);\n\n DB::table('grades')\n ->where([\n ['tenant_id', $this->requester->getTenantId()],\n ['company_id', $this->requester->getCompanyId()],\n ['id', $gradeId]\n ])\n ->update($obj);\n }", "function escape_grade_item_update($escape, $grades=null) {\n global $CFG;\n if (!function_exists('grade_update')) { //workaround for buggy PHP versions\n require_once($CFG->libdir.'/gradelib.php');\n }\n\n if (array_key_exists('cmidnumber', $escape)) { //it may not be always present\n $params = array('itemname'=>$escape->name, 'idnumber'=>$escape->cmidnumber);\n } else {\n $params = array('itemname'=>$escape->name);\n }\n\n if (!$escape->practice and $escape->grade > 0) {\n $params['gradetype'] = GRADE_TYPE_VALUE;\n $params['grademax'] = $escape->grade;\n $params['grademin'] = 0;\n } else if (!$escape->practice and $escape->grade < 0) {\n $params['gradetype'] = GRADE_TYPE_SCALE;\n $params['scaleid'] = -$escape->grade;\n\n // Make sure current grade fetched correctly from $grades\n $currentgrade = null;\n if (!empty($grades)) {\n if (is_array($grades)) {\n $currentgrade = reset($grades);\n } else {\n $currentgrade = $grades;\n }\n }\n\n // When converting a score to a scale, use scale's grade maximum to calculate it.\n if (!empty($currentgrade) && $currentgrade->rawgrade !== null) {\n $grade = grade_get_grades($escape->course, 'mod', 'escape', $escape->id, $currentgrade->userid);\n $params['grademax'] = reset($grade->items)->grademax;\n }\n } else {\n $params['gradetype'] = GRADE_TYPE_NONE;\n }\n\n if ($grades === 'reset') {\n $params['reset'] = true;\n $grades = null;\n } else if (!empty($grades)) {\n // Need to calculate raw grade (Note: $grades has many forms)\n if (is_object($grades)) {\n $grades = array($grades->userid => $grades);\n } else if (array_key_exists('userid', $grades)) {\n $grades = array($grades['userid'] => $grades);\n }\n foreach ($grades as $key => $grade) {\n if (!is_array($grade)) {\n $grades[$key] = $grade = (array) $grade;\n }\n //check raw grade isnt null otherwise we erroneously insert a grade of 0\n if ($grade['rawgrade'] !== null) {\n $grades[$key]['rawgrade'] = ($grade['rawgrade'] * $params['grademax'] / 100);\n } else {\n //setting rawgrade to null just in case user is deleting a grade\n $grades[$key]['rawgrade'] = null;\n }\n }\n }\n\n return grade_update('mod/escape', $escape->course, 'mod', 'escape', $escape->id, 0, $grades, $params);\n}", "function languagelesson_save_grade($lessonid, $userid, $gradeval) {\n global $DB;\n\t// build the grade object\n\t$grade = new stdClass;\n\t$grade->lessonid = $lessonid;\n\t$grade->userid = $userid;\n\t$grade->grade = $gradeval;\n\n\t// And update the old grade record, if there is one; if not, insert the record.\n\tif ($oldgrade = $DB->get_record(\"languagelesson_grades\", array(\"lessonid\"=>$lessonid, \"userid\"=>$userid))) {\n\t\t// If the old grade was for a completed lesson attempt, update the completion time.\n\t\tif ($oldgrade->completed) { $grade->completed = time(); }\n\t\t$grade->id = $oldgrade->id;\n\t\tif (! $DB->update_record(\"languagelesson_grades\", $grade)) {\n\t\t\terror(\"Navigation: grade not updated\");\n\t\t}\n\t} else {\n\t\tif (! $DB->insert_record(\"languagelesson_grades\", $grade)) {\n\t\t\terror(\"Navigation: grade not inserted\");\n\t\t}\n\t}\n}", "public function actionUpdatePayGrade($id)\n {\n $model = Paygrade::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Paygrade'])) {\n $model->attributes = $_POST['Paygrade'];\n if ($model->save())\n $this->redirect(array('managePaygrade'));\n }\n\n $this->render('updatePayGrade', array('model' => $model, ));\n }", "public function update(GradeUpdateRequest $request, $id)\n {\n $grade = grade::findOrFail($id);\n\n $grade->fill($request->gradeFillData());\n $grade->save();\n $grade->syncFatherGrades($request->get('father_grade',[]));\n\n\n\n return redirect(\"/admin/grade/$id/edit\")\n ->withSuccess(\"修改已被保存\");\n\n }", "public function update(Request $request, PayGrade $payGrade)\n {\n $payGrade -> update($request -> all());\n return redirect() -> route('pay-grades.index');\n }", "public function update(Request $request, $id)\n {\n $data = MarksGrade::find($id);\n $data->grade_name = $request->grade_name;\n $data->grade_point = $request->grade_point;\n $data->start_marks = $request->start_marks;\n $data->end_marks = $request->end_marks;\n $data->start_point = $request->start_point;\n $data->end_point = $request->end_point;\n $data->remarks = $request->remarks;\n $data->save();\n\n return redirect()->route('grade.index')->with('success','Data Update Succefully Done');\n }", "public function process_flexpage_grade($data) {\n global $DB;\n\n $data = (object) $data;\n $data->pageid = $this->get_new_parentid('flexpage_page');\n\n $DB->insert_record('format_flexpage_grade', $data);\n }", "function dataform_update_grades($data=null, $userid=0, $nullifnone=true, $grades=null) {\n global $CFG, $DB;\n require_once(\"$CFG->libdir/gradelib.php\");\n\n if ($data != null) {\n if ($data->grade) {\n if ($grades or $grades = dataform_get_user_grades($data, $userid)) {\n dataform_grade_item_update($data, $grades);\n\n } else if ($userid and $nullifnone) {\n $grade = new object();\n $grade->userid = $userid;\n $grade->rawgrade = NULL;\n dataform_grade_item_update($data, $grade);\n\n } else {\n dataform_grade_item_update($data);\n }\n } else {\n dataform_grade_item_delete($data);\n }\n }\n}", "public function delete_grade() {\r\n\t\t\t$sql = \"DELETE FROM grades WHERE id = $this->id;\";\r\n\t\t\tDatabase::$db->query($sql);\r\n\t\t}", "function ChangeGrades ($grades) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n $grades_str = base64_encode(serialize($grades));\n if (@mysql_query (\"UPDATE `hunt_grades` SET `grades`='$grades_str' WHERE `hunt_id`='\".$this->hunt_id.\"' LIMIT 1\", $this->ka_db))\n return $this->IsGraded();\n else {\n $this->roster_error = \"Unsuccessful update query.\";\n return false;\n }\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }", "public function update($student_id = NULL, $course_id = NULL)\n\t{\n\t\t// Log db action\n\t\tLog::info('get student_course_grade object');\n\n\t\t// Get updates from request\n\t\t$score = Input::get('score');\n\n\t\t// Save\n\t\tLog::info('studentCourseGrade object: Save');\n\n\t\t// Fake return data\n\t\t$student_course_grade = array(\n\t\t\t'id' => 1,\n\t\t\t'student_id' => $student_id,\n\t\t\t'course_id' => $course_id,\n\t\t\t'score' => $score\n\n\t\t);\n\n\t\t// Return\n\t\treturn Response::json(array(\n\t\t\t'error' => false,\n\t\t\t'data' => $student_course_grade),\n\t\t\t200\n\t\t);\n\t}", "protected function updateGrade($id, array $data)\n {\n $eval = Courseevaluation::find($id);\n $eval->score = $data['score'];\n $eval->save();\n\n return $eval;\n }", "public function db_update() {}", "public function update() \n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open database connection\n\t\t\t$database = new Database();\n\t\t\t\n\t\t\t// Set the error reporting attribute\n\t\t\t$database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t// Build database query\n\t\t\t$sql = \"update stats set GP=:GP,AB=:AB,R=:R,H=:H,HR=:HR,RBI=:RBI,Salary=:Salary,Bio = :Bio where id = :id\";\n\t\t\t\n\t\t\t// Build database statement\n\t\t\t$statement = $database->prepare($sql);\n\t\t\t$statement->bindParam(':GP', $this->GP, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':AB', $this->AB, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':R', $this->R, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':H', $this->H, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':HR', $this->HR, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':RBI', $this->RBI, PDO::PARAM_INT);\n\t\t\t$statement->bindParam(':Salary', $this->Salary, PDO::PARAM_STR);\n\t\t\t$statement->bindParam(':Bio', $this->Bio, PDO::PARAM_STR);\n\t\t\t$statement->bindParam(':id', $this->id, PDO::PARAM_INT);\n\t\t\t\n\t\t\t// Execute database statement\n\t\t\t$statement->execute();\n\t\t\t\n\t\t\t// Get affected rows\n\t\t\t$count = $statement->rowCount();\n\t\t\t\n\t\t\t// Close database resources\n\t\t\t$database = null;\n\t\t\t\n\t\t\t// Return affected rows\n\t\t\treturn $count;\n\t\t}\n\t\tcatch (PDOException $exception) \n\t\t{\n\t\t\tdie($exception->getMessage());\n\t\t}\n\t}", "public function update($id)\n\t{\n\t\t$grade = Grade::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Grade::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\t//return Redirect::back()->withErrors($validator)->withInput();\n\t\t\t//return array('error' => '')\n\t\t\t$messages = $validator->messages();\n\t\t\treturn array('error' => $messages->first());\n\t\t}\n\n\t\t$grade->update($data);\n\n\t\t//return Redirect::route('grade.index');\n\t\treturn $grade;\n\t}", "public function update($id, Request $request)\n {\n $grade = Grade::findOrFail($id);\n $grade->title = $request->title;\n $grade->grade = $request->grade;\n\n $grade->save();\n\n return redirect()->route('grade');\n }", "function tquiz_grade_item_update(stdClass $tquiz, $grades=null) {\n global $CFG;\n require_once($CFG->libdir.'/gradelib.php');\n\n /** @example */\n $item = array();\n $item['itemname'] = clean_param($tquiz->name, PARAM_NOTAGS);\n $item['gradetype'] = GRADE_TYPE_VALUE;\n $item['grademax'] = $tquiz->grade;\n $item['grademin'] = 0;\n\n grade_update('mod/tquiz', $tquiz->course, 'mod', 'tquiz', $tquiz->id, 0, null, $item);\n}", "public function updateDB()\n {\n // Save the most important variables in order to display them later on\n $_SESSION['questions_answered'] = $this->line;\n $_SESSION['right_answered'] = $this->rightAnswersCounter;\n $_SESSION['achievements_got'] = $this->achievementCounter;\n $_SESSION['achievearray'] = $this->achieve_array;\n $this->endTime = getdate()[0];\n $_SESSION['$duration_seconds'] = $this->endTime - $this->startTime;\n\n $con = createDatabaseconnection();\n $sql = \"UPDATE statistics SET `Gruppennummer` = '{$_SESSION['group']}', `Fragen_beantwortet` = '{$this->line}', `Richtige_Antworten` = '{$this->getAnswersRight()}', `Laengste_richtig_Serie` ='{$this->longestrightstreak}', `Falsche_Antworten` = '{$this->getAnswersWrong()}', `Spieldauer_Sekunden` = '{$_SESSION['$duration_seconds']}',`Gesammelte_Achievements` = '{$this->achievementCounter}', `Laengste_Antwort_Sekunden` = '{$this->longestquestion_seconds}', `Kuerzeste_Antwort_Sekunden` = '{$this->shortestquestion_seconds}', `Letztes_Achievement` = '{$this->last_achievement}',`Zeitpunkt_Quiz_beendet` = '{$this->endTime}' WHERE Session_ID = '{$_SESSION['session_id']}' AND Quiz_beendet != 1\";\n mysqli_query($con, $sql);\n mysqli_close($con);\n }", "public function update($id)\n {\n $rules = array(\n 'gradeName' => 'required',\n 'gradeInstitution' => 'required',\n 'gradeyear' => 'required|number'\n );\n \n // store\n $grade = Grade::find($id);\n $grade->gradeName = Input::get('gradeName');\n $grade->gradeInstitution= Input::get('gradeInstitution');\n $grade->gradeyear = Input::get('gradeyear');\n $grade->save();\n\n $notificacion = array(\n 'message' => 'Se guardaron los cambios', \n 'btn btn-primary' => 'success'\n );\n\n return redirect()->back()->with($notificacion);\n \n\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language, $selection_grade_point;\n\t\t$sFilter = $selection_grade_point->KeyFilter();\n\t\t$selection_grade_point->CurrentFilter = $sFilter;\n\t\t$sSql = $selection_grade_point->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold =& $rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// selection_grade_points_id\n\t\t\t// grade_point\n\n\t\t\t$selection_grade_point->grade_point->SetDbValueDef($rsnew, $selection_grade_point->grade_point->CurrentValue, NULL, FALSE);\n\n\t\t\t// min_grade\n\t\t\t$selection_grade_point->min_grade->SetDbValueDef($rsnew, $selection_grade_point->min_grade->CurrentValue, NULL, FALSE);\n\n\t\t\t// max_grade\n\t\t\t$selection_grade_point->max_grade->SetDbValueDef($rsnew, $selection_grade_point->max_grade->CurrentValue, NULL, FALSE);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $selection_grade_point->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$EditRow = $conn->Execute($selection_grade_point->UpdateSQL($rsnew));\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($selection_grade_point->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setMessage($selection_grade_point->CancelMessage);\n\t\t\t\t\t$selection_grade_point->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$selection_grade_point->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function update(Request $request)\n {\n if(!$request->ajax()) return redirect('/');\n\n try {\n DB::beginTransaction();\n //Search the user who's about to get modified\n $student = Student::findOrFail($request->id);\n \n $user = User::findOrFail($student->id_user);\n if ($student->id_q8 != $request->id_q8) {\n $group1 = Q8::findOrFail($student->id_q8);\n $group2 = Q8::findOrFail($request->id_q8);\n $group1->num_students--;\n $group2->num_students++;\n $group1->save();\n $group2->save();\n\n }\n\n $student->name = strtoupper($request->name);\n $student->paternal_surname = strtoupper($request->paternal_surname);\n $student->maternal_surname = strtoupper($request->maternal_surname);\n $student->period = strtoupper($request->period);\n $student->id_q8 = $request->id_q8;\n $student->id_group = $request->id_group;\n $student->grade = $request->grade;\n $student->save();\n\n $user->email = $request->username;\n //$user->password = bycrypt($request->password);\n $user->condition = '1';\n $user->save();\n\n DB::commit();\n\n } catch (Exception $e) {\n DB::rollBack();\n }\n }", "public function update(CreateGradeRequest $request, $id)\n {\n $this->gradeService->update($request, $id);\n return redirect()->route('grades.index');\n }", "public function update(Request $request, $student_id)\n {\n\n DB::table('assignment')->where('student_id', '=', $student_id)->update(['company_confirm' => \"Approved\"]);\n /* Declare variables */\n DB::table('evaluation')->insert([\n 'student_id' => $student_id\n ]);\n $id = Auth::user()->user_id;\n $instructor = DB::table('instructor_company')->where('company_id', $id)->first();\n DB::table('student_instructor_company')\n ->insert([\n 'instructor_id' => $instructor->instructor_id,\n 'student_id' => $student_id\n ]);\n DB::table('topic')->where('topic_id', '=', $request->topic_id)->decrement('quantity', 1);\n\n\n }", "function updateGradebook($db, $user_resource_pk = NULL, $user_user_pk = NULL) {\r\n\r\n $data_connector = DataConnector\\DataConnector::getDataConnector(DB_TABLENAME_PREFIX, $db);\r\n $consumer = ToolProvider\\ToolConsumer::fromRecordId($_SESSION['consumer_pk'], $data_connector);\r\n $resource_link = ToolProvider\\ResourceLink::fromRecordId($_SESSION['resource_pk'], $data_connector);\r\n\r\n $num = getVisibleItemsCount($db, $_SESSION['resource_pk']);\r\n $ratings = getVisibleRatingsCounts($db, $_SESSION['resource_pk']);\r\n $users = $resource_link->getUserResultSourcedIDs();\r\n foreach ($users as $user) {\r\n $resource_pk = $user->getResourceLink()->getRecordId();\r\n $user_pk = $user->getRecordId();\r\n $update = is_null($user_resource_pk) || is_null($user_user_pk) || (($user_resource_pk === $resource_pk) && ($user_user_pk === $user_pk));\r\n if ($update) {\r\n if ($num > 0) {\r\n $count = 0;\r\n if (isset($ratings[$resource_pk]) && isset($ratings[$resource_pk][$user_pk])) {\r\n $count = $ratings[$resource_pk][$user_pk];\r\n }\r\n $lti_outcome = new ToolProvider\\Outcome(strval($count/$num));\r\n $resource_link->doOutcomesService(ToolProvider\\ResourceLink::EXT_WRITE, $lti_outcome, $user);\r\n } else {\r\n $lti_outcome = new ToolProvider\\Outcome();\r\n $resource_link->doOutcomesService(ToolProvider\\ResourceLink::EXT_DELETE, $lti_outcome, $user);\r\n }\r\n }\r\n }\r\n\r\n }", "public function update()\n {\n\t $dataArr = array(\n\t\t'id' => $this->input->post('id'),\n\t\t'paper_code' => $this->input->post('paper_code'),\n\t\t'subject' => $this->input->post('subject'),\n\t\t'min_marks' => $this->input->post('min_marks'),\n\t\t'max_marks' => $this->input->post('max_marks')\n\t\t);\n\t $SetUp=new SetUpModel;\n $SetUp->update_product($dataArr);\n redirect(base_url('index.php/SetUp'));\n }", "function update($newgrade, $howmodified='manual', $note=NULL) {\n global $USER;\n\n if (!empty($this->scale->id)) {\n $this->scaleid = $this->scale->id;\n $this->grademin = 0;\n $this->scale->load_items();\n $this->grademax = count($this->scale->scale_items);\n }\n\n $trackhistory = false;\n\n if ($newgrade != $this->gradevalue) {\n $trackhistory = true;\n $oldgrade = $this->gradevalue;\n $this->gradevalue = $newgrade;\n }\n\n $result = parent::update();\n\n // Update grade_grades_text if changed\n if ($result && !empty($this->feedback)) {\n $result = $this->annotate(NULL, NULL, $this->feedback, $this->feedbackformat);\n }\n\n if ($result && $trackhistory) {\n // TODO Handle history recording error, such as displaying a notice, but still return true\n grade_history::insert_change($this, $oldgrade, $howmodified, $note);\n\n // Notify parent grade_item of need to update\n $this->load_grade_item();\n $result = $this->grade_item->flag_for_update();\n }\n\n if ($result) {\n return true;\n } else {\n debugging(\"Could not update a raw grade in the database.\");\n return false;\n }\n }", "public function update(Request $request, $id)\n {\n\n $payGrade = PayGrade::find($id);\n $payGrade->name = $request->name;\n $payGrade->save();\n $cp = currency_pay_grade::where('pay_grade_id',$payGrade->id)->first();\n $cp->currency_id = $request->currency_id;\n $cp->pay_grade_id = $payGrade->id;\n $max = sprintf(\"%.2f\", $request->max_salary);\n $min = sprintf(\"%.2f\", $request->min_salary);\n $cp->max_salary = $max ;\n $cp->min_salary = $min ;\n $cp->save();\n $payGrade['currency'] = currency::find($request->currency_id);\n $payGrade['pivot'] = currency_pay_grade::where('pay_grade_id',$payGrade->id)->first();\n return response::json($payGrade); \n\n }", "public function update_grade_point($array, $id){\n $this->db->where('id', $id);\n $this->db->update('msit_tb_grade_point', $array);\n return TRUE;\n }", "function updateProgress($id, $student, $course, $grade, $aim, $comment, $dates){\n\n\t\t$this->connection->query(\"UPDATE progress SET prog_course='$course', prog_grade='$grade', prog_aim='$aim', prog_comment='$comment', prog_date='$dates' WHERE id='$id' AND prog_student='$student'\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student progress data Successfully updated\";\n\t\t}else{\n\t\t\treturn \"Failed to update Student progress data!\";\t\t\n\t\t}\t\n\n\t}", "function testUpdate_Semesters($link, $semester_id) {\n\t\t$semester = Semester::select($link, $semester_id);\n\t\t\n\t\t// set attributes\n $year \t\t\t= $semester->year;\n $term \t\t\t= $semester->term;\n\t\t\n\t\t// perform update operation\n\t\tswitch($semester_id % 2) {\n\n\t\t\tcase(0):\n\t\t\t\tSemester::update($link, $semester_id, 9999, $term);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase(1):\n\t\t\t\tSemester::update($link, $semester_id, 0000, $term);\n\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"semester id does not exist.\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function gradeCru(Request $request, $id=0)\n {\n //for save on POST request\n if ($request->isMethod('post')) {\n\n //protection to prevent massy event. Like edit grade after its use in rules\n // or marks entry\n if($id){\n $grade = Grade::find($id);\n //if grade use then can't edit it\n if($grade) {\n $haveRules = ExamRule::where('grade_id', $grade->id)->count();\n if ($haveRules) {\n return redirect()->route('exam.grade.index')->with('error', 'Can not Edit! Grade used in exam rules.');\n }\n }\n }\n\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'grade' => 'required|array',\n 'point' => 'required|array',\n 'marks_from' => 'required|array',\n 'marks_upto' => 'required|array',\n ]);\n\n $rules = [];\n $inputs = $request->all();\n foreach ($inputs['grade'] as $key => $value){\n $rules[] = [\n 'grade' => $value,\n 'point' => $inputs['point'][$key],\n 'marks_from' => $inputs['marks_from'][$key],\n 'marks_upto' => $inputs['marks_upto'][$key]\n ];\n }\n\n $data = [\n 'name' => $request->get('name'),\n 'rules' => json_encode($rules)\n ];\n\n Grade::updateOrCreate(\n ['id' => $id],\n $data\n );\n\n if(!$id){\n //now notify the admins about this record\n $msg = $data['name'].\" graded added by \".auth()->user()->name;\n $nothing = AppHelper::sendNotificationToAdmins('info', $msg);\n // Notification end\n }\n\n\n $msg = \"Grade \";\n $msg .= $id ? 'updated.' : 'added.';\n\n return redirect()->route('exam.grade.index')->with('success', $msg);\n }\n\n //for get request\n $grade = Grade::find($id);\n\n //if grade use then can't edit it\n if($grade) {\n $haveRules = ExamRule::where('grade_id', $grade->id)->count();\n if ($haveRules) {\n return redirect()->route('exam.grade.index')->with('error', 'Can not Edit! Grade used in exam rules.');\n }\n }\n\n return view('backend.exam.grade.add', compact('grade'));\n }", "function sqlUpdateTeacher($gradeName)\n\t{\n\t\techo $sql = \"\n\t\tUPDATE tbl_teacher\n\t\tSET teacher_name = :teacher_name,\n\t\tteacher_address = :teacher_address,\n\t\tteacher_emailid = :teacher_emailid,\n\t\tteacher_grade_id = :teacher_grade_id,\n\t\tteacher_qualification = :teacher_qualification,\n\t\tteacher_doj = :teacher_doj,\n\t\tteacher_ic = :teacher_ic,\n\t\tteacher_phone = :teacher_phone,\n\t\tteacher_acc = :teacher_acc,\n\t\tteacher_image = :teacher_image\n\t\tWHERE teacher_id = :teacher_id\n\t\t\";\n\n\t\treturn $sql;\n\t}", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "function action_update() {\n global $CURMAN;\n\n $stuid = $this->required_param('association_id', PARAM_INT);\n $clsid = $this->required_param('id', PARAM_INT);\n $users = $this->required_param('users');\n\n $uid = key($users);\n $user = current($users);\n\n $sturecord = array();\n $sturecord['id'] = $stuid;\n $sturecord['classid'] = $clsid;\n $sturecord['userid'] = $uid;\n\n $startyear = $user['startyear'];\n $startmonth = $user['startmonth'];\n $startday = $user['startday'];\n $sturecord['enrolmenttime'] = mktime(0, 0, 0, $startmonth, $startday, $startyear);\n\n $endyear = $user['endyear'];\n $endmonth = $user['endmonth'];\n $endday = $user['endday'];\n $sturecord['completetime'] = mktime(0, 0, 0, $endmonth, $endday, $endyear);\n\n $sturecord['completestatusid'] = $user['completestatusid'];\n $sturecord['grade'] = $user['grade'];\n $sturecord['credits'] = $user['credits'];\n $sturecord['locked'] = !empty($user['locked']) ? 1 : 0;\n $stu = new student($sturecord);\n\n if ($stu->completestatusid == STUSTATUS_PASSED &&\n $CURMAN->db->get_field(STUTABLE, 'completestatusid', 'id', $stuid) != STUSTATUS_PASSED) {\n\n $stu->complete();\n } else {\n if (($status = $stu->update()) !== true) {\n echo cm_error('Record not updated. Reason: ' . $status->message);\n }\n }\n\n /// Check for grade records...\n $element = cm_get_param('element', array());\n $newelement = cm_get_param('newelement', array());\n $timegraded = cm_get_param('timegraded', array());\n $newtimegraded = cm_get_param('newtimegraded', array());\n $completionid = cm_get_param('completionid', array());\n $newcompletionid = cm_get_param('newcompletionid', array());\n $grade = cm_get_param('grade', array());\n $newgrade = cm_get_param('newgrade', array());\n $locked = cm_get_param('locked', array());\n $newlocked = cm_get_param('newlocked', array());\n\n foreach ($element as $gradeid => $element) {\n $graderec = array();\n $graderec['id'] = $gradeid;\n $graderec['userid'] = $uid;\n $graderec['classid'] = $clsid;\n $graderec['completionid'] = $element;\n $graderec['timegraded'] = mktime(0, 0, 0, $timegraded[$gradeid]['startmonth'],\n $timegraded[$gradeid]['startday'], $timegraded[$gradeid]['startyear']);\n $graderec['grade'] = $grade[$gradeid];\n $graderec['locked'] = isset($locked[$gradeid]) ? $locked[$gradeid] : '0';\n\n $sgrade = new student_grade($graderec);\n $sgrade->update();\n }\n\n foreach ($newelement as $elementid => $element) {\n $graderec = array();\n $graderec['userid'] = $uid;\n $graderec['classid'] = $clsid;\n $graderec['completionid'] = $element;\n $graderec['timegraded'] = mktime(0, 0, 0, $newtimegraded[$elementid]['startmonth'],\n $newtimegraded[$elementid]['startday'], $newtimegraded[$elementid]['startyear']);\n $graderec['grade'] = $newgrade[$elementid];\n $graderec['locked'] = isset($newlocked[$elementid]) ? $newlocked[$elementid] : '0';\n\n $sgrade = new student_grade($graderec);\n $sgrade->add();\n }\n\n $this->action_default();\n }", "function testUpdate_Scores_Assignments($link, $assignment_id) {\n\t\t$assignment = Assignment::select($link, $assignment_id);\n\t\t\n\t\t// set attributes\n\t\t$semester_id \t\t= $assignment->semester_id;\n\t\t$course_id \t\t\t= $assignment->course_id;\n $points_allowed \t= $assignment->points_allowed;\n\t\t\n\t\t// set random parameters\n\t\t$max = $points_allowed;\n\t\t$min = $max*.60;\n\t\t\n\t\t// perform update operation\n\t\tswitch(mt_rand(0, 1)) {\n\n\t\t\tcase(0):\n\t\t\t\t$points_received = mt_rand($min, $max);\n\t\t\t\tAssignment::updateScore($link, $assignment_id, $points_received);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase(1):\n\t\t\t\t$points_received = mt_rand($min, $max);\n\t\t\t\t//Assignment::updateScore($link, $assignment_id, $points_received);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"assignment id does not exist.\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "function vitero_grade_item_update(stdClass $vitero) {\n}", "function update() {\n\t\t$sql = \"UPDATE umgroup \n\t\t\t\tSET\tGpNameT=?, GpNameE=?, GpDesc=?, GpStID=? \n\t\t\t\tWHERE GpID=?\";\t\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID, $this->GpID));\n\n\t}", "public function update()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = 'UPDATE class SET ';\n\n\t\t\tif(isset($this->_year))\n\t\t\t\t$sql.=' year = :year,';\n\n\t\t\tif(isset($this->_section))\n\t\t\t\t$sql.=' section = :section';\n\t\t\telse\n\t\t\t\t$sql = substr_replace($sql, '', -1);\n\t\t\t\n\t\t\t$sql.=' WHERE id = :id';\n\n \t\t$data = [\n\t\t\t 'id' => $this->_id,\n\t\t\t 'year' => $this->_year,\n\t\t\t 'section' => $this->_section,\n\t\t\t];\n\n\t \t$stmt = $this->db->prepare($sql);\n\t \t$stmt->execute($data);\n\t\t\t$status = $stmt->rowCount();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\theader(\"HTTP/1.0 400 Bad request\");\n\t\t\techo $e;\n\t\t}\n\t}", "public function update()\n {\n if ($this->temp_reg_no == $this->student->reg_no) {\n $this->rules['student.reg_no'] = 'required|string|max:10|alpha_dash';\n }\n\n $validatedData = $this->validate();\n\n Student::where('id', $this->student->id)\n ->update($validatedData['student']);\n\n session()->flash('alert', true);\n return redirect()->to('students');\n }", "public function save(stdClass $grade, stdClass $data) {\n global $DB;\n $feedbackentry = $this->get_feedback_entry($grade->id);\n\n if ($data->helixfeedback_activated != 1) {\n return true;\n }\n\n if ($feedbackentry) {\n /***Nothing needs to change in the DB for an update since the only change is on the HML server, so just return true***/\n return true;\n } else {\n $feedbackentry = new stdClass();\n $feedbackentry->grade = $grade->id;\n $feedbackentry->assignment = $this->assignment->get_instance()->id;\n $prerec = $DB->get_record('helixmedia_pre', array('id' => $data->helixfeedback_preid));\n $feedbackentry->preid = $prerec->id;\n $feedbackentry->servicesalt = $prerec->servicesalt;\n return $DB->insert_record('assignfeedback_helixfeedback', $feedbackentry) > 0;\n }\n }", "function addGrade(){\n $categoryId = Slim::getInstance()->request()->post('categoryId');\n $gradeName = Slim::getInstance()->request()->post('gradeName');\n $percentage = Slim::getInstance()->request()->post('percentage');\n try {\n $insertGrade = \"INSERT INTO grades(categoryId, gradeName, percentage) VALUE(:categoryId, :gradeName, :percentage)\";\n $db = getConnection();\n $stmt = $db->prepare($insertGrade);\n $stmt->bindParam(\"categoryId\", $categoryId);\n $stmt->bindParam(\"gradeName\", $gradeName);\n $stmt->bindParam(\"percentage\", $percentage);\n $stmt->execute();\n $db = null;\n\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n } \n}", "public function assignGrades()\n {\n if(isset($this->data['EarningRatePrisoner']) && is_array($this->data['EarningRatePrisoner']) && $this->data['EarningRatePrisoner']!='')\n {\n if(isset($this->data['EarningRatePrisoner']['uuid']) && $this->data['EarningRatePrisoner']['uuid']=='')\n {\n $uuidArr=$this->EarningRatePrisoner->query(\"select uuid() as code\");\n $this->request->data['EarningRatePrisoner']['uuid']=$uuidArr[0][0]['code'];\n } \n if(isset($this->data['EarningRatePrisoner']['date_of_assignment']) && $this->data['EarningRatePrisoner']['date_of_assignment']!=\"\" )\n {\n $this->request->data['EarningRatePrisoner']['date_of_assignment']=date('Y-m-d',strtotime($this->data['EarningRatePrisoner']['date_of_assignment']));\n }\n if($this->EarningRatePrisoner->save($this->data))\n {\n $this->Session->write('message_type','success');\n $this->Session->write('message','Saved successfully');\n $this->redirect('/earningRates/assignGrades'); \n } \n else\n {\n $this->Session->write('message_type','error');\n $this->Session->write('message','saving failed');\n }\n\n }\n /*\n *Code for delete the Earning Rates\n */\n if(isset($this->data['EarningRatePrisonerDelete']['id']) && (int)$this->data['EarningRatePrisonerDelete']['id'] != 0){\n $this->EarningRatePrisoner->id=$this->data['EarningRatePrisonerDelete']['id'];\n $this->EarningRatePrisoner->saveField('is_trash',1);\n\n $this->Session->write('message_type','success');\n $this->Session->write('message','Deleted Successfully !');\n $this->redirect(array('action'=>'assignGrades'));\n }\n /*\n *Code for edit the Earning Rates\n */\n if(isset($this->data['EarningRatePrisonerEdit']['id']) && (int)$this->data['EarningRatePrisonerEdit']['id'] != 0){\n if($this->EarningRatePrisoner->exists($this->data['EarningRatePrisonerEdit']['id'])){\n $this->data = $this->EarningRatePrisoner->findById($this->data['EarningRatePrisonerEdit']['id']);\n }\n } \n $gradeslist=$this->EarningRate->find('list',array(\n 'recursive' => -1,\n 'fields' => array(\n 'EarningRate.id',\n 'EarningGrade.name',\n ),\n \"joins\" => array(\n array(\n \"table\" => \"earning_grades\",\n \"alias\" => \"EarningGrade\",\n \"type\" => \"LEFT\",\n \"conditions\" => array(\n \"EarningRate.earning_grade_id = EarningGrade.id\"\n )\n )),\n 'conditions' => array(\n 'EarningRate.is_enable' => 1,\n 'EarningRate.is_trash' => 0,\n ),\n 'order'=>array(\n 'EarningGrade.name'\n )\n )); \n $prisonerlist=$this->Prisoner->find('list',array(\n 'recursive' => -1,\n 'fields' => array(\n 'Prisoner.id',\n 'Prisoner.prisoner_no',\n ),\n 'conditions' => array(\n 'Prisoner.is_enable' => 1,\n 'Prisoner.is_trash' => 0,\n ),\n 'order'=>array(\n 'Prisoner.prisoner_no'\n )\n )); \n\n $this->set(compact('gradeslist','prisonerlist'));\n\n }", "function update()\n {\n $this->dbInit();\n if ( isset( $this->ID ) )\n {\n query( \"UPDATE Grp set Name='$this->Name', Description='$this->Description',\n\t\tUserAdmin='$this->UserAdmin',\n \t\tUserGroupAdmin='$this->UserGroupAdmin',\n\t\tPersonTypeAdmin='$this->PersonTypeAdmin',\n\t\tCompanyTypeAdmin='$this->CompanyTypeAdmin',\n\t\tPhoneTypeAdmin='$this->PhoneTypeAdmin',\n\t\tAddressTypeAdmin='$this->AddressTypeAdmin' WHERE ID='$this->ID'\" );\n }\n }", "function bookking_update_grades($bookkingrecord, $userid=0, $nullifnone=true) {\n global $CFG, $DB;\n require_once($CFG->libdir.'/gradelib.php');\n\n $bookking = bookking_instance::load_by_id($bookkingrecord->id);\n\n if ($bookking->scale == 0) {\n bookking_grade_item_update($bookkingrecord);\n\n } else if ($grades = $bookking->get_user_grades($userid)) {\n foreach ($grades as $k => $v) {\n if ($v->rawgrade == -1) {\n $grades[$k]->rawgrade = null;\n }\n }\n bookking_grade_item_update($bookkingrecord, $grades);\n\n } else {\n bookking_grade_item_update($bookkingrecord);\n }\n}", "function roshine_grade_item_update(stdClass $roshine) {\n global $CFG;\n require_once($CFG->libdir.'/gradelib.php');\n\n /** @example */\n $item = array();\n $item['itemname'] = clean_param($roshine->name, PARAM_NOTAGS);\n $item['gradetype'] = GRADE_TYPE_VALUE;\n $item['grademax'] = $roshine->grade;\n $item['grademin'] = 0;\n\n grade_update('mod/roshine', $roshine->course, 'mod', 'roshine', $roshine->id, 0, null, $item);\n}", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "function cicleinscription_grade_item_update(stdClass $cicleinscription) {\n global $CFG;\n require_once($CFG->libdir.'/gradelib.php');\n\n /** @example */\n $item = array();\n $item['itemname'] = clean_param($cicleinscription->name, PARAM_NOTAGS);\n $item['gradetype'] = GRADE_TYPE_VALUE;\n $item['grademax'] = $cicleinscription->grade;\n $item['grademin'] = 0;\n\n grade_update('mod/cicleinscription', $cicleinscription->course, 'mod', 'cicleinscription', $cicleinscription->id, 0, null, $item);\n}", "public function setGrade($arr)\n\t{\n\t}", "private function fixGrades( Submission $submission ) {\n\t\tif( $submission->getStateID() == '' ) {\n\t\t\t$this->output->writeln( sprintf( '<fg=red>Submission ID: %d does not have a State ID. So grades were entered in wrong.</fg=red>' , $submission->getId() ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$iNowGrades = $this->getContainer()->get('doctrine')->getRepository('IIABMagnetBundle:StudentGrade')->findGradesByStateID( $submission->getStateID() );\n\n\t\tif( count( $iNowGrades ) == 0 ) {\n\t\t\t$this->output->writeln( sprintf( '<fg=red>Submission ID: %d does not have any grades in iNow</fg=red>' , $submission->getId() ) );\n\t\t\treturn;\n\t\t}\n\n\t\t/** @var \\IIAB\\MagnetBundle\\Entity\\SubmissionGrade $grade */\n\t\tforeach( $submission->getGrades() as $grade ) {\n\n\t\t\t$submission->removeGrade( $grade );\n\n\t\t\t$this->getContainer()->get('doctrine')->getManager()->remove( $grade );\n\t\t}\n\n\t\t$this->output->writeln( sprintf( '<fg=green>Submission ID: %d removed old grades.</fg=green>' , $submission->getId() ) );\n\n\t\t/** @var \\IIAB\\MagnetBundle\\Entity\\StudentGrade $grade */\n\t\tforeach( $iNowGrades as $grade ) {\n\n\t\t\t$submissionGrade = new SubmissionGrade();\n\t\t\t$submissionGrade->setAcademicYear( $grade->getAcademicYear() );\n\t\t\t$submissionGrade->setAcademicTerm( $grade->getAcademicTerm() );\n\t\t\t$submissionGrade->setCourseTypeID( $grade->getCourseTypeID() );\n\t\t\t$submissionGrade->setCourseType( $grade->getCourseType() );\n\t\t\t$submissionGrade->setCourseName( $grade->getCourseName() );\n\t\t\t$submissionGrade->setSectionNumber( $grade->getSectionNumber() );\n\t\t\t$submissionGrade->setNumericGrade( $grade->getNumericGrade() );\n\n\t\t\t$submission->addGrade( $submissionGrade );\n\n\t\t\t$this->getContainer()->get('doctrine')->getManager()->persist( $submissionGrade );\n\n\t\t}\n\n\t\t$this->getContainer()->get('doctrine')->getManager()->flush();\n\t\t$this->output->writeln( sprintf( '<fg=green>Submission ID: %d grades were updated.</fg=green>' , $submission->getId() ) );\n\n\t}", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "function add_grade($grade) {\n $this->grades[] = $grade;\n }", "function addGrade($grades) {\n\n $columns = implode(\", \", array_keys($grades));\n $escaped_values = array_map($this->db->prepare, array_values($grades));\n $values = implode(\", \", $escaped_values);\n $sql = \"INSERT INTO `grades`($columns) VALUES ($values)\";\n\n $this->executeQuery($sql);\n }", "private function insert_target_grade()\r\n {\r\n global $DB;\r\n $params = $this->get_params();\r\n $this->id = $DB->insert_record('block_bcgt_target_grades', $params);\r\n }", "public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\n }", "protected function saveUpdate()\n {\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function testUpdateSuperfund()\n {\n }", "function escape_update_grades($escape, $userid=0, $nullifnone=true) {\n global $CFG, $DB;\n require_once($CFG->libdir.'/gradelib.php');\n\n if ($escape->grade == 0 || $escape->practice) {\n escape_grade_item_update($escape);\n\n } else if ($grades = escape_get_user_grades($escape, $userid)) {\n escape_grade_item_update($escape, $grades);\n\n } else if ($userid and $nullifnone) {\n $grade = new stdClass();\n $grade->userid = $userid;\n $grade->rawgrade = null;\n escape_grade_item_update($escape, $grade);\n\n } else {\n escape_grade_item_update($escape);\n }\n}", "public function run() {\n\t\t\t$grades = [\n\t\t\t\t[\n\t\t\t\t\t'user_id' => 13, 'teacher_id' => 4, 'lesson_id' => 4, 'grade' => 96, 'class_id'=>4\n\t\t\t\t],\n\t\t\t];\n\t\t\t\n\t\t\tGrade::insert($grades);\n\t\t}", "public function addGrade()\n {\n $this->load->helper('url');\n\n $name = $this->input->post('name');\n $data = array(\n 'grade_name' => $name\n );\n return $this->db->insert('grade', $data);\n }", "public function storeUpdate(Course $course)\n {\n $values = request()->all();\n $values['short_name'] = strtoupper($values['short_name']);\n\n if (! $course->gradeLevels()->sync($values['grade_levels'])) {\n ViewHelpers::flashAlert(\n 'danger',\n 'Could not save grade levels. Please try again.',\n 'fa fa-info-circle mr-1');\n\n return redirect()->back();\n }\n unset($values['grade_levels']);\n\n $course = DatabaseHelpers::dbAddAudit($course);\n ViewHelpers::flash($course->update($values), 'course', 'updated');\n\n return redirect()->to('course/index');\n }", "function update()\n {\n\n $query = \"UPDATE Proposal set \";\n $query = $query . \"LastEditDate=NOW()\";\n if(isset($this->BidderID))\n {\n $query = $query . \", OpportunityID = '\" . $this->OpportunityID . \"'\"; \n }\n\n if(isset($this->BidderID))\n {\n $query = $query . \", BidderID = '\" . $this->BidderID . \"'\"; \n }\n\n if(isset($this->Status))\n {\n $query = $query . \", Status = \" . $this->Status . \"\"; \n }\n\n if(isset($this->TechnicalScore))\n {\n $query = $query . \", TechnicalScore = \" . $this->TechnicalScore . \" \"; \n }\n\n if(isset($this->FeeScore))\n {\n $query = $query . \", FeeScore = \" . $this->FeeScore . \" \"; \n }\n\n if(isset($this->FinalTotalScore))\n {\n $query = $query . \", FinalTotalScore = \" . $this->FinalTotalScore . \" \"; \n }\n\n if(isset($this->ContractAwarded))\n {\n $query = $query . \", ContractAwarded = \" . $this->ContractAwarded . \" \"; \n }\n\n $query = $query . \" WHERE ProposalID = '\" . $this->ProposalID . \"';\";\n\n $stmt = $this->conn->prepare( $query );\n\n // bind parameters\n //$stmt->bindParam(':ProposalID', $this->ProposalID);\n //$stmt->bindParam(':OpportunityID', $this->OpportunityID);\n //$stmt->bindParam(':BidderID', $this->BidderID);\n //$stmt->bindParam(':Status', $this->Status);\n //$stmt->bindParam(':TechnicalScore', $this->TechnicalScore);\n // $stmt->bindParam(':FeeScore', $this->FeeScore);\n //$stmt->bindParam(':FinalTotalScore', $this->FinalTotalScore);\n\n if($stmt->execute())\n return true;\n else\n return false;\n }", "function testUpdate_Students($link, $student_id) {\n\t\t$student = Student::select($link, $student_id);\n\t\t\n\t\t// set attributes\n $fname \t\t= $student->fname;\n $email \t\t= $student->email;\n $phone \t\t= $student->phone;\n $password \t= $student->password;\n\t\t\n\t\t// perform update operation\n\t\tswitch($student_id % 3) {\n\n\t\t\tcase(0):\n\t\t\t\tStudent::update($link, $student_id, 'Updated Name', $email, $phone, $password);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase(1):\n\t\t\t\tStudent::update($link, $student_id, $fname, $email, '000-000-0000', $password);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase(2):\n\t\t\t\tStudent::update($link, $student_id, $fname, $email, $phone, 'update');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"student id does not exist.\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function setGradeTest($grade)\n\t{\n\t\tarray_push($this->grades, intval($grade));\n\t}", "function dataform_upgrade_grades() {\n global $DB;\n\n $sql = \"SELECT COUNT('x')\n FROM {dataform} d, {course_modules} cm, {modules} m\n WHERE m.name='dataform' AND m.id=cm.module AND cm.instance=d.id\";\n $count = $DB->count_records_sql($sql);\n\n $sql = \"SELECT d.*, cm.idnumber AS cmidnumber, d.course AS courseid\n FROM {dataform} d, {course_modules} cm, {modules} m\n WHERE m.name='dataform' AND m.id=cm.module AND cm.instance=d.id\";\n $rs = $DB->get_recordset_sql($sql);\n if ($rs->valid()) {\n // too much debug output\n $pbar = new progress_bar('dataupgradegrades', 500, true);\n $i=0;\n foreach ($rs as $data) {\n $i++;\n upgrade_set_timeout(60*5); // set up timeout, may also abort execution\n dataform_update_grades($data, 0, false);\n $pbar->update($i, $count, \"Updating Dataform grades ($i/$count).\");\n }\n }\n $rs->close();\n}", "public function update($data,$old_roll_no){\n\t\t\t\t$this->db->set($data);\n\t\t\t\t$this->db->where(\"roll_no\",$old_roll_no);\n\t\t\t\t$this->db->update(\"student_table\",$data);\n\t\t\t}", "public function update($type, $elementid, $grade) {\n if ($this->type != $type || $this->elementid != $elementid || $this->grade != $grade) {\n global $DB;\n\n $this->type = $type;\n $this->elementid = $elementid;\n $this->grade = $grade;\n\n $record = new stdClass();\n $record->id = $this->id;\n $record->type = $this->type;\n $record->elementid = $this->elementid;\n $record->grade = $this->grade;\n\n $DB->update_record('ddtaquiz_condition_part', $record);\n }\n }", "public function update()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->getGbaseItemEntry( $this->getItem()->getGbaseItemId() );\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $entry = $service->updateGbaseItem($this->getEntry());\n\n }", "protected function update_overall_grades($quiz) {\n quiz_update_all_attempt_sumgrades($quiz);\n quiz_update_all_final_grades($quiz);\n quiz_update_grades($quiz);\n }", "public function update(store $request)\n {\n if (Grade::where('Name->ar', $request->Name)->orWhere('Name->en', $request->Name_en)->exists()) {\n return redirect()->back()->withErrors(trans('grades_trans.exists'));\n }\n try {\n $validate = $request->validated();\n $Grade = Grade::findOrFail($request->id);\n $Grade->update([\n $Grade->Name = ['en' => $request->Name_en, 'ar' => $request->Name],\n $Grade->Notes = $request->Notes,\n ]);\n toastr()->success(trans('grades_trans.saved_data'));\n return redirect()->route('Grades.index');\n } catch (\\Exception $th) {\n return redirect()->back()->withErrors(['error' => $th->getMessage()]);\n }\n }", "function updateFee()\n {\n global $db;\n $requete = $db->prepare('UPDATE fees SET date=? , nature=? , amount=? , site_id=? where idF = ?');\n $requete->execute(array(\n $this->date,\n $this->nature,\n $this->amount,\n $this->site_id,\n $this->idF\n ));\n }", "public function save(stdClass $grade, stdClass $data) {\n global $DB;\n\n // if filename is false, or empty, no update. possibly used changed something else on page.\n // possibly they did not record ... that will be caught elsewhere.\n $allsubtypes = $this->get_all_subtypes();\n $allfeedbacks = $this->get_allfeedbacks($grade->id);\n $allsavedok = true;\n\n // get expiretime of this record.\n $fileexpiry = 0;\n $expiredays = $this->get_config(\"expiredays\");\n if ($expiredays < 9999) {\n $fileexpiry = time() + DAYSECS * $expiredays;\n }\n foreach ($allsubtypes as $subtypeconst) {\n $savedok = false;\n $thefeedback = !empty($allfeedbacks[$subtypeconst]) ? $allfeedbacks[$subtypeconst] : null;\n $subtypeselected = !empty($data->recorders) && !empty($data->recorders[$subtypeconst]);\n $filename = !empty($data->filename) && !empty($data->filename[$subtypeconst]) ? $data->filename[$subtypeconst] : '';\n if (in_array($subtypeconst, self::SUBTYPEMAP)) {\n if (!empty($thefeedback)) {\n if ($filename == '-1' || !$subtypeselected) {\n // this is a flag to delete the feedback.\n $DB->delete_records(constants::M_TABLE, ['id' => $thefeedback->id]);\n continue;\n } else {\n $thefeedback->{constants::NAME_UPDATE_CONTROL} = $filename;\n $thefeedback->fileexpiry = $fileexpiry;\n $savedok = $DB->update_record(constants::M_TABLE, $thefeedback);\n }\n } else if ($subtypeselected) {\n $thefeedback = new stdClass();\n $thefeedback->type = $subtypeconst;\n $thefeedback->{constants::NAME_UPDATE_CONTROL} = $filename;\n $thefeedback->fileexpiry = $fileexpiry;\n $thefeedback->grade = $grade->id;\n $thefeedback->assignment = $this->assignment->get_instance()->id;\n $feedbackid = $DB->insert_record(constants::M_TABLE, $thefeedback);\n if ($feedbackid > 0) {\n $thefeedback->id = $feedbackid;\n $savedok = true;\n }\n } else {\n continue;\n }\n if ($savedok) {\n $this->register_fetch_transcript_task($thefeedback);\n }\n } else {\n $feedbacktext = !empty($data->feedbacktext) ? $data->feedbacktext['text'] : '';\n if (empty($thefeedback)) {\n if (empty($subtypeselected)) {\n continue;\n }\n $thefeedback = new stdClass();\n $thefeedback->type = $subtypeconst;\n $thefeedback->grade = $grade->id;\n $thefeedback->assignment = $this->assignment->get_instance()->id;\n $thefeedback->feedbacktext = $feedbacktext;\n $feedbackid = $DB->insert_record(constants::M_TABLE, $thefeedback);\n if ($feedbackid > 0) {\n $thefeedback->id = $feedbackid;\n $savedok = true;\n }\n } else if ($subtypeselected) {\n $thefeedback->feedbacktext = $feedbacktext;\n $savedok = $DB->update_record(constants::M_TABLE, $thefeedback);\n } else {\n $DB->delete_records(constants::M_TABLE, ['id' => $thefeedback->id]);\n $savedok = true;\n }\n }\n $allsavedok = $allsavedok && $savedok;\n }\n\n return $allsavedok;\n }", "public function updateGradeToko() {\r\n $this->load->library('form_validation');\r\n $this->form_validation->set_rules('pelid', '<b>Fx</b>', 'xss_clean');\r\n if ($this->form_validation->run() == TRUE) {\r\n $data = array(\r\n 'grad_cbid' => ses_cabang,\r\n 'grad_pelid' => $this->input->post('pelid'),\r\n 'gradid' => $this->input->post('gradid'),\r\n 'grad_1' => $this->input->post('grad_1'),\r\n 'grad_2' => $this->input->post('grad_2'),\r\n 'grad_3' => $this->input->post('grad_3')\r\n );\r\n if ($this->model_sparepart->updateGradeToko($data)) {\r\n $hasil['result'] = true;\r\n $hasil['msg'] = $this->sukses(\"Berhasil menyimpan Grade Toko\");\r\n } else {\r\n $hasil['result'] = false;\r\n $hasil['msg'] = $this->error(\"Gagal menyimpan Grade Toko\");\r\n }\r\n }\r\n echo json_encode($hasil);\r\n }", "public function update($loyPrg);", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function update() {\n\n // Does the course object have an ID?\n if ( is_null( $this->courseId ) ) trigger_error ( \"Course::update(): Attempt to update Course object that does not have its ID property set.\", E_USER_ERROR );\n\n // Update the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE course SET courseCode=:courseCode, courseName=:courseName, description=:description, headTeacher=:headTeacher WHERE courseId = :courseId\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_INT );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_INT );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n//\n $st->bindValue( \":courseId\", $this->courseId, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }", "function index_g_and_o_update(){\n\t\t$this->load->model('Da_evs_set_form_g_and_o','dsfg');\n\t\t$index_level = $this->input->post(\"index_level\"); // index level of G&O form\n\t\t$index_ranges = $this->input->post(\"index_ranges\"); // indeax range of G&O form\n\t\t$pos_id = $this->input->post(\"pos_id\"); //position id\n\t\t$year_id = $this->input->post(\"year_id\"); //year id\n\t\t\n\t\t$this->dsfg->sfg_pay_id = $year_id;\n\t\t$this->dsfg->sfg_index_level = $index_level;\n\t\t$this->dsfg->sfg_index_ranges = $index_ranges;\n\t\t$this->dsfg->sfg_pos_id = $pos_id;\n\t\t$this->dsfg->update();\n\n\t}", "public function update(Request $request, Semester $semester)\n {\n $validate=$request->validate([\n 'name' => 'required',\n 'year' => 'required',\n 'examDate' => 'required',\n\n ]);\n\n\n if ($request->input('current') == 'on') {\n $current=1;\n }else {\n $current=0;\n }\n\n $updateSemester=Semester::where('id',$semester->id)->update([\n 'name'=>$request->input('name'),\n 'year_id'=>$request->input('year'),\n 'exam_date'=>$request->input('examDate'),\n 'current' =>$current,\n ]);\n\n flash('Semester updated')->success()->important();\n return redirect()->route('semester.index');\n }", "public function grade() \n {\n if (permission::permitted('grades')=='fail'){ return redirect()->route('denied'); }\n\n $data = table::grade()->get();\n return view('admin.fields.grade', compact('data'));\n }", "public function rateSubmission($submissionData)\n {\n $query = '\n UPDATE submissions\n SET mark = :mark\n WHERE id = :id\n ';\n $statement = $this->db->prepare($query);\n\n $statement->bindValue('mark', $submissionData['mark'], \\PDO::PARAM_STR);\n $statement->bindValue('id', $submissionData['id'], \\PDO::PARAM_INT);\n\n $statement->execute();\n }", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n }", "function update(EducationModel $edu) { \n try { \n Log::info(\"Entering EducationDataService.update()\");\n \n //use the connection to create a prepared statement\n $stmt = $this->conn->prepare(\"UPDATE `EDUCATION` SET `SCHOOL`= :school,`DEGREE`= :degree,`START_YEAR`= :start,`END_YEAR`= :end,`ADDITIONAL_INFORMATION`= :info WHERE `ID` = :id\");\n \n //Store the information from the education object into variables\n $school = $edu->getSchool();\n $degree = $edu->getDegree();\n $start = $edu->getStart_year();\n $end = $edu->getEnd_year();\n $info = $edu->getAdditional_info();\n $id = $edu->getId();\n \n //Bind the variables from the education object to the SQL statement\n $stmt->bindParam(':school', $school);\n $stmt->bindParam(':degree', $degree);\n $stmt->bindParam(':start', $start);\n $stmt->bindParam(':end', $end);\n $stmt->bindParam(':info', $info);\n $stmt->bindParam(':id', $id);\n \n //Excecute the SQL statement\n $stmt->execute(); \n \n //If a row was updated the method will return true.\n //If not it will return false\n if ($stmt->rowCount() == 1) {\n Log::info(\"Exiting EducationDataService.update() with true\"); \n return true;\n }\n else {\n Log::info(\"Exiting EducationDataService.update()with false\");\n return false;\n }\n }\n catch (PDOException $e){\n Log::error(\"Exception: \", array(\"message\" => $e->getMessage()));\n throw new DatabaseException(\"Database Exception: \" . $e->getMessage(), 0, $e);\n }\n }", "function exam_take_grade_submit($form, &$form_state) {\n \n ExamInstance::storeMessage('Entered', 'exam_take_grade_submit');\n \n // Get the exam object \n $vExamInstanceID = $_SESSION['exam']['pExamInstanceID']; \n ExamInstance::storeMessage('$vExamInstanceID = ' . $vExamInstanceID . '.', 'exam_take_grade_submit');\n $vExamTitleURL = $_SESSION['exam']['pExamTitleURL'];\n ExamInstance::storeMessage('$vExamTitleURL = ' . $vExamTitleURL . '.', 'exam_take_grade_submit');\n \n // Clean up the database a little.\n // First, specify the \"isChosen\" values for each answer. I did not \n // do this as the answers were being selected for two reasons.\n // One, I could not figure out how to use the Drupal Forms API to \n // treat each answer individually in a way that seemed efficient.\n // Two, a workaround to update the table through each selected\n // answer would have placed an undue drag on system performance\n // with additional update statements on each question answered.\n // So instead, we captured the data along the way in the \n // question_instance table, and now we will just run one quick \n // update to spread the answers through the answer_instance table\n // The data model doubles the storage of information as a \n // mechanism to help flag potential errors in the system.\n // Here is the original UPDATE statement:\n // UPDATE answer_instance AS A\n // SET A.isChosen = 1\n // WHERE CONCAT(A.question_instance_id, A.answer_letter) IN \n // (SELECT CONCAT(B.question_instance_id, B.selected_answer_letter) theAnswer\n // FROM question_instance B\n // WHERE B.exam_instance_id = 1\n // AND B.selected_answer_letter IS NOT NULL); \n\n ExamInstance::storeMessage('UPDATE statement about to execute.' . $vExamTitleURL . '.', 'exam_take_grade_submit'); \n \n $vUpdateStatement =\n 'UPDATE answer_instance AS A\n SET A.isChosen = 1\n WHERE CONCAT(A.question_instance_id, A.answer_letter) IN \n (SELECT CONCAT(B.question_instance_id, B.selected_answer_letter) theAnswer\n FROM question_instance B\n WHERE B.exam_instance_id = :eiid\n AND B.selected_answer_letter IS NOT NULL)';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n\n ExamInstance::storeMessage('UPDATE statement done.' . $vExamTitleURL . '.', 'exam_take_grade_submit'); \n \n //\n // Determine the grade\n //\n // First, update the database to indicate which \n // questions were answered correctly.\n $vUpdateStatement = \n 'UPDATE question_instance AS A \n JOIN answer_instance AS B \n ON (CONCAT(A.question_instance_id, A.selected_answer_letter) = CONCAT(B.question_instance_id,B.answer_letter))\n SET A.answeredCorrectly = CASE WHEN B.is_correct = 1 THEN 1 ELSE 0 END\n WHERE A.selected_answer_number IS NOT NULL\n AND A.exam_instance_id = :eiid';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n \n // Next, grade the overall exam.\n $vUpdateStatement = \n 'UPDATE exam_instance \n SET numberCorrect = \n (SELECT COUNT(CASE WHEN B.answeredCorrectly = 1 THEN 1 END)\n FROM question_instance AS B\n WHERE B.exam_instance_id = :eiid)\n , numberWrong = \n (SELECT COUNT(CASE WHEN C.answeredCorrectly = 0 THEN 1 END)\n FROM question_instance AS C\n WHERE C.exam_instance_id = :eiid)\n , numberUnanswered = \n (SELECT COUNT(CASE WHEN D.answeredCorrectly IS NULL THEN 1 END)\n FROM question_instance AS D\n WHERE D.exam_instance_id = :eiid)\n , grade = \n (SELECT ROUND((COUNT(CASE WHEN B.answeredCorrectly = 1 THEN 1 END)\n / \n COUNT(*)*100),2) \n AS grade\n FROM question_instance AS B\n WHERE B.exam_instance_id = :eiid)\n , graded = 1\n WHERE exam_instance_id = :eiid';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n \n $form_state['redirect'] = array('exam/grade/' . $vExamTitleURL);\n \n}", "public function update($input, $id, $idgrid)\n {\n $data = $this->model->find($idgrid);\n $ship = $data->brand;\n $type = $data->type;\n $grid = $data->name;\n $label = $data->label;\n\n $update = $data->update($input);\n if ($update) {\n generateAccessesTxt(\n date('H:i:s').utf8_decode(\n ' Alterou a Grade:'.$grid.\n ', Tam:'.$label.\n ', Tipo:'.$type.\n ', Fabricante:'.$ship->name.\n ' para Grade:'.$data->name.\n ', Tam:'.$data->label.\n ', Tipo:'.$data->type)\n );\n\n $out = array(\n \"id\" => $data->id,\n \"type\" => $data->type,\n \"name\" => $data->name,\n \"label\" => $data->label,\n \"success\" => true,\n 'token' => csrf_token(),\n \"url_delete\" => route('grids-brand.destroy', ['id' => $id, 'grid' => $data->id]),\n \"url_edit\" => route('grids-brand.edit', ['id' => $id, 'grid' => $data->id]),\n \"message\" => 'A grade '.$data->name.' foi alterada.',\n );\n\n return $out;\n }\n\n return array(\n 'success' => false,\n 'message' => 'Não foi possível altera a grade.');\n }" ]
[ "0.792313", "0.7672874", "0.72341913", "0.6863543", "0.68460053", "0.66816145", "0.66748714", "0.66251785", "0.6590052", "0.6543174", "0.64879376", "0.64697975", "0.64660805", "0.64006007", "0.6358508", "0.6348058", "0.633963", "0.633004", "0.6310016", "0.63073105", "0.63014495", "0.6289595", "0.62810796", "0.62720627", "0.62414277", "0.6224867", "0.6215614", "0.62002736", "0.61934984", "0.6151686", "0.61384404", "0.6119018", "0.6083413", "0.6076645", "0.6053362", "0.6039883", "0.603725", "0.6031464", "0.60238993", "0.6022537", "0.6021851", "0.6007621", "0.60056007", "0.60030144", "0.59956706", "0.5990072", "0.598979", "0.59827864", "0.59815353", "0.5976681", "0.5976209", "0.59532285", "0.5951467", "0.59447277", "0.5939974", "0.59325397", "0.5901201", "0.5876658", "0.5865904", "0.5855885", "0.58518136", "0.5844103", "0.5838666", "0.5836947", "0.58214813", "0.58181286", "0.58137655", "0.5793234", "0.5792923", "0.5780839", "0.57790625", "0.577486", "0.57636184", "0.5759678", "0.57269317", "0.5726574", "0.5721592", "0.5716506", "0.56949276", "0.56946224", "0.5688183", "0.5683189", "0.5682909", "0.56777143", "0.5675286", "0.566031", "0.56602937", "0.56553197", "0.5641402", "0.56364584", "0.56318575", "0.5623047", "0.562029", "0.5619739", "0.561899", "0.5610179", "0.560016", "0.5598772", "0.5598511", "0.55950606", "0.5593549" ]
0.0
-1
Validate save/update custom field request.
private function checkCustomFieldRequest(Request $request) { $this->validate($request, [ 'companyId' => 'required|integer|exists:companies,id', 'lovCusmod' => 'required|exists:lovs,key_data|max:20', 'name' => 'required|max:50', 'fieldName' => 'required|max:10', 'lovCdtype' => 'required|exists:lovs,key_data|max:20', 'isActive' => 'required|boolean', 'lovTypeCode' => 'present|max:10' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "function validate_on_update() {}", "private function validateUpdateRequest( Request $request ) {\n\t\t$this->validate($request, [\n\t\t\t'book_id' => 'exists:books,id',\n\t\t\t'price' => 'numeric|min:1',\n\t\t],[\n\t\t\t'books_id.exists' => 'Not an existing book for this sale.',\n\t\t\t'min' => 'The :attribute field needs at least :min chars.',\n\t\t\t'numeric' => 'The :attribute field needs to be numeric.',\n\t\t\t'price.min' => 'The :attribute needs to be equals or bigger than 1.',\n\t\t]);\n\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function tower_custom_input_validation($message, $field, $request_data, $form_location) {\n\n}", "function before_validation_on_update() {}", "public function validateRequest();", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "public function validateUpdate($obj);", "function validate_save_post()\n {\n }", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "function validate_on_create() {}", "public function beforeSave()\n {\n $this->setParams([\n 'url' => $this->getValue(),\n 'apiKey' => $this->getFieldsetDataValue('api_key'),\n 'version' => $this->getFieldsetDataValue('api_version')\n ]);\n\n if (!$this->isUrl($this->getValue())) {\n throw new \\Magento\\Framework\\Exception\\ValidatorException(__('Invalid CRM url'));\n }\n\n if (!$this->isHttps($this->getValue())) {\n $this->schemeEdit($this->getValue());\n }\n\n if ($this->validateApiUrl($this->api)) {\n $this->setValue($this->getValue());\n }\n\n parent::beforeSave();\n }", "public function validateSave() {\n\t\t//0. Pobranie parametrów z walidacją\n\t\t$this->form->id = getFromRequest('id',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt1 = getFromRequest('v1',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt2 = getFromRequest('v2',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->amps = getFromRequest('amp',true,'Błędne wywołanie aplikacji');\n $this->form->resis = getFromRequest('resistor',true,'Błędne wywołanie aplikacji');\n\n\t\tif ( getMessages()->isError() ) return false;\n\n\t\t// 1. sprawdzenie czy wartości wymagane nie są puste\n\t\tif (empty(trim($this->form->volt1))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie zasilania');\n\t\t}\n\t\tif (empty(trim($this->form->volt2))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie przewodzenia diody');\n\t\t}\n\t\tif (empty(trim($this->form->amps))) {\n\t\t\tgetMessages()->addError('Wprowadź prąd przewodzenia diody');\n\t\t}\n\n\t\tif ( getMessages()->isError() ) return false;\n\t\t\n\t\treturn ! getMessages()->isError();\n\t}", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->distance = ParamUtils::getFromRequest('distance', true, 'Błędne wywołanie aplikacji');\r\n $this->form->startTime = ParamUtils::getFromRequest('startTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->endTime = ParamUtils::getFromRequest('endTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityFrom = ParamUtils::getFromRequest('cityFrom', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityTo = ParamUtils::getFromRequest('cityTo', true, 'Błędne wywołanie aplikacji');\r\n $this->form->personId = ParamUtils::getFromRequest('personId', true, 'Błędne wywołanie aplikacji');\r\n $this->form->carId = ParamUtils::getFromRequest('carId', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->distance))) {\r\n Utils::addErrorMessage('Wprowadź dystans');\r\n }\r\n if (empty(trim($this->form->startTime))) {\r\n Utils::addErrorMessage('Wprowadź datę wyjazdu');\r\n }\r\n if (empty(trim($this->form->endTime))) {\r\n Utils::addErrorMessage('Wprowadź datę przyjazdu na miejsce');\r\n }\r\n if (empty(trim($this->form->cityFrom))) {\r\n Utils::addErrorMessage('Wprowadź miejsce początkowe');\r\n }\r\n if (empty(trim($this->form->cityTo))) {\r\n Utils::addErrorMessage('Wprowadź miejsce końcowe');\r\n }\r\n if (empty(trim($this->form->personId))) {\r\n Utils::addErrorMessage('Wprowadź pracownika');\r\n }\r\n if (empty(trim($this->form->carId))) {\r\n Utils::addErrorMessage('Wprowadź pojazd');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n $check_distance = is_numeric($this->form->distance);\r\n if ($check_distance === false) {\r\n Utils::addErrorMessage('Dystans musi być liczbą');\r\n }\r\n\r\n //sprawdzenie poprawnosci daty\r\n\r\n $sT = $this->form->startTime;\r\n $eT = $this->form->endTime;\r\n\r\n $check_timeStart = checkdate(substr($sT, 5, 2), substr($sT, 8, 2), substr($sT, 0, 4));\r\n $check_timeEnd = checkdate(substr($eT, 5, 2), substr($eT, 8, 2), substr($eT, 0, 4));\r\n\r\n if ($check_timeEnd === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n if ($check_timeStart === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n return !App::getMessages()->isError();\r\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function after_validation_on_update() {}", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->name = ParamUtils::getFromRequest('name', true, 'Błędne wywołanie aplikacji');\r\n $this->form->surname = ParamUtils::getFromRequest('surname', true, 'Błędne wywołanie aplikacji');\r\n $this->form->birthdate = ParamUtils::getFromRequest('birthdate', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobTitle = ParamUtils::getFromRequest('jobTitle', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobPlace = ParamUtils::getFromRequest('jobPlace', true, 'Błędne wywołanie aplikacji');\r\n $this->form->userName = ParamUtils::getFromRequest('userName', true, 'Błędne wywołanie aplikacji');\r\n $this->form->role = ParamUtils::getFromRequest('role', true, 'Błędne wywołanie aplikacji');\r\n $this->form->password = ParamUtils::getFromRequest('password', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->name))) {\r\n Utils::addErrorMessage('Wprowadź imię');\r\n }\r\n if (empty(trim($this->form->surname))) {\r\n Utils::addErrorMessage('Wprowadź nazwisko');\r\n }\r\n if (empty(trim($this->form->birthdate))) {\r\n Utils::addErrorMessage('Wprowadź datę urodzenia');\r\n }\r\n if (empty(trim($this->form->jobTitle))) {\r\n Utils::addErrorMessage('Wprowadź nazwę stanowiska');\r\n }\r\n if (empty(trim($this->form->jobPlace))) {\r\n Utils::addErrorMessage('Wprowadź miejsce');\r\n }\r\n if (empty(trim($this->form->userName))) {\r\n Utils::addErrorMessage('Wprowadź nazwę użytkownika');\r\n }\r\n if (empty(trim($this->form->role))) {\r\n Utils::addErrorMessage('Wprowadź role użytkownika');\r\n }\r\n if (empty(trim($this->form->password)) && empty(trim($this->form->id))) {\r\n Utils::addErrorMessage('Wprowadź hasło');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n\r\n \r\n\r\n $check_birth = $this->form->birthdate;\r\n $check_name = $this->form->name;\r\n $check_surname = $this->form->surname;\r\n\r\n $d = checkdate(substr($check_birth, 5, 2), substr($check_birth, 8, 2), substr($check_birth, 0, 4));\r\n if ($d === false || strlen($check_birth) <> 10) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-12-20 lub data nie istnieje');\r\n }\r\n \r\n\r\n function my_mb_ucfirst($str) {\r\n $fc = mb_strtoupper(mb_substr($str, 0, 1));\r\n return $fc . mb_substr($str, 1);\r\n }\r\n\r\n $this->form->name = my_mb_ucfirst($check_name);\r\n $this->form->surname = my_mb_ucfirst($check_surname);\r\n\r\n// $test = App::getDB()->get('person', '*', [\r\n// 'user_name' => $this->form->userName\r\n// ]);\r\n// $testUser = $test['user_name'];\r\n// var_dump($test); \r\n// var_dump($test['user_name'] === $testUser);die;\r\n// \r\n// if($test['user_name'] === $testUser)\r\n// {\r\n// Utils::addErrorMessage('Podany użytkownik już istnieje');\r\n// }\r\n return !App::getMessages()->isError();\r\n }", "public function postSave($with_validation) {}", "public abstract function validation();", "function ajax_validate_save_post()\n {\n }", "protected function _validate() {\n\t}", "function validate_fields() {\n\t\treturn true;\n\t}", "public function preSave($with_validation) {}", "public function updateCustomValidate()\n {\n if($this->id_soldier_tmp != $this->id_soldier){\n $this->errors = \"Niepoprawny żołnierz.\";\n return false;\n }\n \n if($this->id_mission_tmp != $this->id_mission){\n $this->errors = \"Niepoprawna misja.\";\n return false;\n }\n \n if($this->detached == '1'){\n $this->errors = \"Nie można edytowac oddelegowanych żołnierzy z misji.\";\n return false;\n }\n \n $this->date_mission_add = date('Y-m-d H:i:s', strtotime($this->date_mission_add));\n \n return true;\n }", "public function _on_validate()\n {\n return true;\n }", "protected function areFieldChangeFunctionsValid() {}", "function validateupdate(){\n\t\tglobal $_REQUEST;\t\t\n\t\t\n\t\tif(!empty($this->errors)){\n\t\t\t$result = false;\n\t\t}else{\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function validated();", "public function before_update(Model $obj) {\n\t\t$this->validate ( $obj );\n\t}", "abstract protected function fieldValidation($submittedData);", "public function validateVehicle(Request $request) {\n // my array of customized messages\n $messages = [];\n\n // rename attributes to look pretty in form\n $attributes = [\n 'fldRegoNo' => 'rego no',\n 'fldBrand' => 'brand',\n 'fldSeating' => 'seating',\n 'fldHirePriceCurrent' => 'hire',\n ];\n\n // validation of user input in the form\n // regarding \"UPDATE hire price Vehicle\" do accept rego no as it is\n // (so use: fldRegoNo,'.$request->specific_vehicle_id)\n // accept space and dash in brand\n $this->validate($request, [\n 'fldRegoNo' => 'required|alpha_num|size:6|unique:vehicles,fldRegoNo,'.$request->specific_vehicle_id,\n 'fldBrand' => 'required|Max:15|regex:/^([A-Za-z\\s\\-]*)$/',\n 'fldSeating' => 'required|integer|between:1,20',\n 'fldHirePriceCurrent' => 'required|numeric|between:0,9999.99|regex:/.*[^.]$/',\n ], $messages, $attributes);\n }", "protected function preValidate() {}", "private function validateInput($request) {\n $this->validate($request, [\n 'target_name' => 'required|max:60',\n 'description' => 'required|max:200'\n ]);\n }", "public function validateRequestUpdate($request,$ideUsuario,$ideRegion){\n// 'email' => [\n// 'required',\n// Rule::unique('users')->ignore($user->id),\n// ],\n// $rules=[\n// 'usuario' => [\n// 'required',\n// 'max:50',\n// Rule::unique('seg_usuario')->ignore($id),\n// ],\n// 'nombres' => 'required|max:100',\n// 'apellidos' => 'required|max:100' \n// ];\n //'ide_usuario' => 'unique:seg_usuario_region,'.$ideUsuario.',ide_usuario,ide_regio,'.$ideRegion,\n //'unique' => 'El :attribute ya ha sido utilizado'\n $rules=[\n //'ide_usuario_director' => 'unique:cfg_departamento,ide_usuario_director,'.$ideRegion.',ide_departamento',\n 'nombre' => 'required|max:100',\n 'descripcion' => 'required|max:100',\n 'codigo_interno' => 'max:150'\n ];\n $messages=[\n 'required' => 'Debe ingresar :attribute.',\n 'max' => 'La capacidad del campo :attribute es :max'\n //'unique' => 'El usuario ya fue asignado a otro departamento.'\n ];\n $this->validate($request, $rules,$messages); \n }", "public function updated($field)\n {\n // Solo validamos el campo que genera el update\n $validatedData = $this->validateOnly($field, [\n 'usuario' => 'required',\n 'mensaje' => 'required',\n ]);\n }", "private function validateEdit(Request $request)\n {\n $rules = [\n 'username' => 'Required | Between:4,10',\n 'password' => 'Required | Between:4,10',\n 'email' => 'Required | email',\n 'firstname' => 'Required | Between:4,10 | Alpha',\n 'lastname' => 'Required | Between:4,10 | Alpha'\n ];\n\n $this->validate($request, $rules);\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "abstract public function validate();", "abstract public function validate();", "public function validated(){\n\n return true;\n \n}", "public function validated(){\n\n return true;\n \n}", "public function validated(){\n\n return true;\n \n}", "public function validated(){\n\n return true;\n \n}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function validation();", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "private function validateRequest()\n {\n return request()->validate([\n 'project_name' => 'required|string|unique:projects',\n ]);\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "function validate_relationship_field($field)\n {\n }", "private function validateInput($request) {\n $this->validate($request, [\n 'range_code' => 'required|unique:countries',\n 'range_within_albertine_rift' => 'required',\n 'range_within_albertine_rift_fr' => 'required'\n \n \n ]);\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function updateCustomValidate(){\n if(!$this->addCustomValidate()){\n return false;\n }\n \n // Przy zmianie status na \"W rezerwie\", \"W stanie spoczynku\" lub \"Zmarły\",\n // żołnierz zostaje automatycznie oddelegowany z misji oraz usunięty ze szkolenia na których obecnie przebywał.\n if(in_array($this->id_status, array('2', '3', '4'))){\n \n }\n \n return true;\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "protected function validate()\n {\n }", "public static function validateExchangeModified()\n{\n return array(\n new Main\\Entity\\Validator\\Length(null, 196),\n );\n}", "public function validateForUpdate(CarismaRequest $request)\n {\n return Validator::make(\n $request->all(),\n $this->updateFields($request)->mapWithKeys(function ($field) use ($request) {\n return $field->getUpdateRules($request);\n })->all()\n )->after(function ($validator) use ($request) {\n $this->afterValidation($request, $validator);\n $this->afterValidationOnUpdate($request, $validator);\n })->validate();\n }", "public function beforeValidationOnCreate()\n {\n\n }", "private function validateInput($request) {\n $this->validate($request, [\n 'measurement_name' => 'required|max:60'\n ]);\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function isValidRequest() {\n }", "public static function validateUpdateRequest() {\n $errors = array();\n $data = array();\n self::checkID($errors, $data);\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function before_validation_on_create() {}", "public function validation()\n {\n\n }", "protected function additionalValidation() {\n return true;\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function testUpdateReplenishmentCustomFields()\n {\n }", "protected function onRequest( array &$request )\n\t\t{\n\t\t\tif($this->controlToValidate->submitted) {\n\t\t\t\tif(!$this->controlToValidate->validate($err)) {\n\t\t\t\t\t$this->errMsg = $err;\n\t\t\t\t}\n\t\t\t\t$this->needsUpdating = true;\n\t\t\t}\n\t\t}", "public function validateField()\n\t{\n\t\t$error = [];\n\t\t$error_flag = false;\n\n\t\tif ($this->commons->validateText($this->url->post('contact')['company'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['author'] = 'Item Rate!';\n\t\t}\n\n\t\tif ($error_flag) {\n\t\t\treturn $error;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function backendExtraValidate(){\n \n }", "public static function validateUpdate($data) {\n\t\t$v = parent::getValidationObject($data);\n\n\t\t//Set rules\n\t\t$v->rule('optional', 'name')\n\t\t ->rule('lengthMin', 'name', 1)->message(__('Name size is too small!'))\n\t\t ->rule('relationData', 'property', 'int')->message(__('Incorrect data format for category properties!'));\n\n\t\t//Validate\n\t\treturn parent::validate($v, self::$__validationErrors);\n\t}", "public function updated($field)\n {\n $this->validateOnly($field, [\n 'body' => 'required|min:5'\n ]);\n }", "private function validatePaymentFields(){\n }", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "public function isRequired() {}", "public function isRequired() {}", "public function isRequired() {}", "public function isRequired() {}", "function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )\n {\n $classAttribute = $contentObjectAttribute->contentClassAttribute();\n if ( $http->hasPostVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) ) && $http->hasPostVariable( $base . '_data_design_' . $contentObjectAttribute->attribute( 'id' ) ) )\n {\n $data = $http->postVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) );\n $dataDesign = $http->postVariable( $base . '_data_design_' . $contentObjectAttribute->attribute( 'id' ) );\n\n if ( $data == \"\" )\n {\n if ( !$classAttribute->attribute( 'is_information_collector' ) and\n $contentObjectAttribute->validateIsRequired() )\n {\n $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',\n 'Input required.' ) );\n return eZInputValidator::STATE_INVALID;\n }\n }\n if ( $dataDesign == 0 )\n {\n if ( !$classAttribute->attribute( 'is_information_collector' ) and\n $contentObjectAttribute->validateIsRequired() )\n {\n $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',\n 'Input required.' ) );\n return eZInputValidator::STATE_INVALID;\n }\n }\n }\n else if ( !$classAttribute->attribute( 'is_information_collector' ) and $contentObjectAttribute->validateIsRequired() )\n {\n $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Input required.' ) );\n return eZInputValidator::STATE_INVALID;\n }\n\n return eZInputValidator::STATE_ACCEPTED;\n }", "public function isValidUpdate($data) { \n\t\t$options = array('presence' => 'optional');\n\t\treturn $this -> validate($data,$options);\n\t}", "public function validate() {\n parent::validate();\n\n // Check that the partner opt-ins also have a partner code\n if (isset($this['action.opt-ins.partner']) && !isset($this['partner.code'])) {\n\t throw new SignupValidationException(array('partner opt-in requires a partner code'));\n }\n }", "public function validateWhenSet()\n {\n $this->validateMethod = 'validate' . ucfirst($this->name);\n }", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }" ]
[ "0.6473312", "0.6470219", "0.6415687", "0.6385633", "0.6344708", "0.6324985", "0.63203496", "0.6296193", "0.6242909", "0.61658937", "0.61456096", "0.6137899", "0.60959744", "0.60663956", "0.605196", "0.6046031", "0.5976501", "0.59698385", "0.59698385", "0.59698385", "0.59698385", "0.5961917", "0.59596074", "0.5957386", "0.59486616", "0.5934879", "0.5932258", "0.59250677", "0.5918571", "0.59036213", "0.58600044", "0.5858153", "0.58284557", "0.582828", "0.5796064", "0.57936406", "0.5778675", "0.5767412", "0.5756217", "0.57267964", "0.572029", "0.57174313", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.56903434", "0.5687368", "0.5687368", "0.5682726", "0.5682726", "0.5682726", "0.5682726", "0.5668492", "0.56629044", "0.5659707", "0.56535083", "0.5637426", "0.56371564", "0.56297326", "0.56238145", "0.56158835", "0.5604892", "0.5604381", "0.56022066", "0.5598889", "0.55915576", "0.5584862", "0.5577128", "0.55743587", "0.5568258", "0.5564627", "0.5559956", "0.55593556", "0.55533946", "0.5552728", "0.5552449", "0.55515754", "0.5550904", "0.5537538", "0.5530933", "0.5529689", "0.5527412", "0.55257684", "0.5522812", "0.5521843", "0.55210644", "0.55210644", "0.55065906", "0.5506082", "0.55053717", "0.54997593", "0.54986656" ]
0.62297386
9
Construct a custom field object (array).
private function constructCustomField(Request $request) { $customField = [ "tenant_id" => $this->requester->getTenantId(), "company_id" => $this->requester->getCompanyId(), "name" => $request->name, "lov_cusmod" => $request->lovCusmod, "field_name" => $request->fieldName, "lov_cdtype" => $request->lovCdtype, "lov_type_code" => $request->lovTypeCode, "is_active" => $request->isActive ]; return $customField; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function constructCustomFieldCustom(Request $request)\n {\n $customField = [\n \"tenant_id\" => $this->requester->getTenantId(),\n \"company_id\" => $this->requester->getCompanyId(),\n \"name\" => $request->name,\n \"lov_cusmod\" => $request->lovCusmod,\n \"field_name\" => $request->fieldName,\n \"lov_cdtype\" => $request->lovCdtype,\n \"lov_type_code\" => $request->lovTypeCode . '|C',\n \"is_active\" => $request->isActive\n ];\n return $customField;\n }", "abstract protected function createFields();", "public abstract function createFields();", "function FieldTypesArray() {}", "function build_custom_field_data($field_id, $value, $enum = null)\n{\n\n $data = array(\n 'id' => $field_id,\n );\n\n if (is_array($value)) {\n if (isset($value[0]['subtype']) && isset($value[0]['value'])) {\n foreach ($value as $key => $value) {\n $data['values'][$key]['value'] = $value['value'];\n $data['values'][$key]['subtype'] = $value['subtype'];\n }\n } else {\n $data['values'] = $value;\n }\n } else {\n $data['values'] = array(array('value' => $value));\n }\n\n if ($enum) {\n $data['values'][0]['enum'] = $enum;\n }\n\n return $data;\n}", "public function makeFieldList() {}", "public function addArray(string $name, InterfaceClass $field = null) : ArrayClass {\n\t\t$field = new ArrayClass($name, $field);\n\t\t$this->fields[$name] = $field;\n\t\treturn $field;\n\t}", "public function __construct(array $field)\n {\n // Check for required keys\n parent::__construct($field, self::REQUIRED_KEYS, self::class);\n\n // Load all the information into public variables\n $this->value = $field['value'];\n $this->displayText = $field['displayText'];\n }", "public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $fieldData) {\n\t\t\t$field = new Field();\n\t\t\t$field->setProperties($fieldData);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function fieldCreate()\n\t{\n\t\t$fields=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$fields[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'max_length'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'type'=>preg_match('/text/',$row['Type']) ? 'Area' : 'Field',\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? true : false,\n\t\t\t\t\t'input'=>preg_match('/^(password|pass|passwd|passcode)$/i',$row['Field']) ? 'password' : 'text',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "public static function createFromArray($array) {\n\t\t$document = new static();\n\n\t\tforeach ($array as $fieldName => $fieldValue) {\n\t\t\t$document->$fieldName = $fieldValue;\n\t\t}\n\n\t\treturn $document;\n\t}", "abstract public function getFieldData(): array;", "public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $data) {\n\t\t\t$field = Field::factory($data);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}", "function create_field($field)\n{\n}", "public function getFieldsArray($create = false) {}", "private function _fieldModelCreateData()\n {\n return [\n 'designFieldModel' => [\n 'shortCardContainerDesignBlockModel' => [\n 'marginTop' => 10\n ],\n 'shortCardLabelDesignBlockModel' => [\n 'marginTop' => 20\n ],\n 'shortCardLabelDesignTextModel' => [\n 'size' => 30\n ],\n 'shortCardValueDesignBlockModel' => [\n 'marginTop' => 40\n ],\n ],\n ];\n }", "public function createFieldFromArray($column)\n {\n $dataType = ArrayUtils::get($column, 'datatype');\n if (ArrayUtils::get($column, 'type') === null) {\n $column['type'] = $this->source->getTypeFromSource($dataType);\n }\n\n // PRIMARY KEY must be required\n if ($column['primary_key']) {\n $column['required'] = true;\n }\n\n $castAttributesToJSON = function (&$array, array $keys) {\n foreach ($keys as $key) {\n $value = json_decode(isset($array[$key]) ? $array[$key] : '', true);\n $array[$key] = $value ? $value : null;\n }\n };\n\n $castAttributesToJSON($column, ['options', 'translation']);\n\n $fieldType = ArrayUtils::get($column, 'type');\n // NOTE: Alias column must are nullable\n if (DataTypes::isAliasType($fieldType)) {\n $column['nullable'] = true;\n } \n \n if ($this->isFloatingPointType($dataType)) {\n $column['length'] = sprintf('%d,%d', $column['precision'], $column['scale']);\n } else if ($this->source->isIntegerType($dataType)) {\n $column['length'] = $column['precision'];\n } else if (in_array($dataType, $this->noLengthDataTypes)) {\n $column['length'] = null; \n } else {\n $column['length'] = $column['char_length'];\n }\n\n $castAttributesToBool = function (&$array, array $keys) {\n foreach ($keys as $key) {\n $array[$key] = (bool) ArrayUtils::get($array, $key);\n }\n };\n\n $castAttributesToBool($column, [\n 'auto_increment',\n 'unique',\n 'managed',\n 'primary_key',\n 'signed',\n 'hidden_detail',\n 'hidden_browse',\n 'required',\n 'nullable',\n 'readonly',\n ]);\n\n $this->setFieldDataDefaultValue($column);\n\n return new Field($column);\n }", "public static function custom_fields()\r\n {/*{{{*/\r\n $f = array();\r\n\t $file = self::custom_fields_file();\r\n\t if(!file_exists($file)) \r\n return false;\r\n\r\n\t $data = getXML($file);\r\n\t $items = $data->item;\r\n\t if(count($items) <= 0) \r\n\t return false;\r\n\t foreach($items as $item) \r\n\t {\r\n\t\t $cf = array();\r\n\t\t $cf['key'] = (string)$item->desc;\r\n\t\t $cf['label'] = (string)$item->label;\r\n\t\t $cf['type'] = (string)$item->type;\r\n\t\t $cf['value'] = (string)$item->value;\r\n\t\t if($cf['type'] == 'dropdown') \r\n\t\t {\r\n\t\t $cf['options'] = array();\r\n\t\t\t foreach ($item->option as $option) \r\n\t\t\t\t $cf['options'][] = (string)$option;\r\n\t\t }\r\n\t\t $f[] = $cf;\r\n\t }\r\n return $f;\r\n }", "public function initFromArray(array $o)\n {\n if (isset($o['originalLabel'])) {\n $this->originalLabel = $o[\"originalLabel\"];\n unset($o[\"originalLabel\"]);\n }\n $this->description = array();\n if (isset($o['description'])) {\n foreach ($o['description'] as $i => $x) {\n $this->description[$i] = new TextValue($x);\n }\n unset($o[\"description\"]);\n }\n $this->values = array();\n if (isset($o['values'])) {\n foreach ($o['values'] as $i => $x) {\n $this->values[$i] = new FieldValueDescriptor($x);\n }\n unset($o[\"values\"]);\n }\n parent::initFromArray($o);\n }", "public function newCustomFieldModel($fieldName)\n\t{\n\t\treturn new CustomField([\n\t\t\t'field_name' => $fieldName,\n\t\t\t'parent_type' => get_class($this),\n\t\t\t'parent_id' => $this->id\n\t\t]);\n\t}", "public function __construct( $input ) {\n parent::__construct( $input, parent::ARRAY_AS_PROPS ); \n }", "public function init_fields() {\n $fields = [];\n\n $fields['type'] = [\n 'type' => Controls_Manager::TEXT,\n 'label' => __('Text', 'chaman_addons')\n ];\n\n return $fields;\n }", "public function create(array $input);", "public function create_new_custom_fields( $field, $field_value ) {\n\n\t\tglobal $_gaddon_posted_settings;\n\n\t\t// If no custom fields are set or if the API credentials are invalid, return settings. */\n\t\tif ( empty( $field_value ) || ! $this->initialize_api() ) {\n\t\t\treturn $field_value;\n\t\t}\n\t\n\t\t// Loop through defined custom fields, create new ones.\n\t\tforeach ( $field_value as $index => &$field ) {\n\n\t\t\t// If no custom key is set, skip.\n\t\t\tif ( ! rgar( $field, 'custom_key' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prepare field name.\n\t\t\t$custom_key = $field['custom_key'];\n\t\t\t$private_name = strtolower( str_replace(\n\t\t\t\tarray( ' ', '\"', \"'\", '\\\\', '/', '[', ']' ),\n\t\t\t\t'',\n\t\t\t\t$custom_key\n\t\t\t) );\n\t\t\t\n\t\t\t// Prepare new field to add.\n\t\t\t$custom_field = array(\n\t\t\t\t'fieldType' => 'text',\n\t\t\t\t'displayToUser' => 1,\n\t\t\t\t'privateName' => $private_name,\n\t\t\t\t'publicName' => $custom_key\n\t\t\t);\n\n\t\t\t// Add custom field.\n\t\t\t$new_field = $this->api->add_custom_field( $custom_field );\n\n\t\t\t// If field could not be added, log error and skip.\n\t\t\tif ( is_wp_error( $new_field ) ) {\n\t\t\t\t$this->log_error( __METHOD__ . '(): Unable to create custom field; ' . $new_field->get_error_message() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Replace key for field with new shortcut name and reset custom key.\n\t\t\t$field['key'] = $private_name;\n\t\t\t$field['custom_key'] = '';\n\t\t\t\n\t\t\t// Update POST field to ensure front-end display is up-to-date.\n\t\t\t$_gaddon_posted_settings['custom_fields'][ $index ]['key'] = $private_name;\n\t\t\t$_gaddon_posted_settings['custom_fields'][ $index ]['custom_key'] = '';\n\t\t\t\n\t\t\t// Push to new custom fields array to update the UI.\n\t\t\tif ( version_compare( GFForms::$version, '2.5-dev-1', '<' ) ) {\n\t\t\t\t$this->_new_custom_fields[] = array(\n\t\t\t\t\t'label' => $custom_key,\n\t\t\t\t\t'value' => $private_name,\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn $field_value;\n\t\t\n\t}", "private function buildFieldByAttribute(Reflector $ref, string $attributeClass): array\n {\n return array_map(\n // Create meta field\n fn(AbstractFieldAttribute $field) => new Field($field, $ref),\n\n // Find and convert reflection attribute to attribute instance.\n array_map(\n fn($attr) => $attr->newInstance(),\n $ref->getAttributes($attributeClass, ReflectionAttribute::IS_INSTANCEOF)\n ),\n );\n }", "public function construct_value_array() {\r\n\t\t$fields = array(\r\n\t\t\t'Amount' => $this->cart_data['total_price'] * 100,\r\n\t\t\t'CurrencyCode' => $this->get_currency_iso_code( $this->cart_data['store_currency'] ),\r\n\t\t\t'OrderID' => $this->purchase_id,\r\n\t\t\t'TransactionType' => 'SALE',\r\n\t\t\t'TransactionDateTime' => date( 'Y-m-d H:i:s P' ),\r\n\t\t\t'CallbackURL' => add_query_arg( 'gateway', 'paymentsense', $this->cart_data['notification_url'] ),\r\n\t\t\t'OrderDescription' => 'Order ID: ' . $this->purchase_id . ' - ' . $this->cart_data['session_id'],\r\n\t\t\t'CustomerName' => $this->cart_data['billing_address']['first_name'] . ' ' . $this->cart_data['billing_address']['last_name'],\r\n\t\t\t'Address1' => trim( implode( '&#10;', explode( \"\\n\\r\", $this->cart_data['billing_address']['address'] ) ), '&#10;' ),\r\n\t\t\t'Address2' => '',\r\n\t\t\t'Address3' => '',\r\n\t\t\t'Address4' => '',\r\n\t\t\t'City' => $this->cart_data['billing_address']['city'],\r\n\t\t\t'State' => $this->cart_data['billing_address']['state'],\r\n\t\t\t'PostCode' => $this->cart_data['billing_address']['post_code'],\r\n\t\t\t'CountryCode' => $this->get_country_iso_code( $this->cart_data['billing_address']['country'] ),\r\n\t\t\t'EmailAddress' => $this->cart_data['email_address'],\r\n\t\t\t'PhoneNumber' => $this->cart_data['billing_address']['phone'],\r\n\t\t\t'EmailAddressEditable' => 'true',\r\n\t\t\t'PhoneNumberEditable' => 'true',\r\n\t\t\t'CV2Mandatory' => 'true',\r\n\t\t\t'Address1Mandatory' => 'true',\r\n\t\t\t'CityMandatory' => 'true',\r\n\t\t\t'PostCodeMandatory' => 'true',\r\n\t\t\t'StateMandatory' => 'true',\r\n\t\t\t'CountryMandatory' => 'true',\r\n\t\t\t'ResultDeliveryMethod' => 'POST',\r\n\t\t\t'ServerResultURL' => '',\r\n\t\t\t'PaymentFormDisplaysResult' => 'false',\r\n\t\t);\r\n\r\n\t\t$data = 'MerchantID=' . get_option( 'paymentsense_id' );\r\n\t\t$data .= '&Password=' . get_option( 'paymentsense_password' );\r\n\r\n\t\tforeach ( $fields as $key => $value ) {\r\n\t\t\t$data .= '&' . $key . '=' . $value;\r\n\t\t};\r\n\r\n\t\t$additional_fields = array(\r\n\t\t\t'HashDigest' => $this->calculate_hash_digest( $data, 'SHA1', get_option( 'paymentsense_preshared_key' ) ),\r\n\t\t\t'MerchantID' => get_option( 'paymentsense_id' ),\r\n\t\t);\r\n\r\n\t\t$this->request_data = array_merge( $additional_fields, $fields );\r\n\t}", "public function createCustomField(string $name) : CustomFields\n {\n $di = Di::getDefault();\n $appsId = $di->has('app') ? $di->get('app')->getId() : 0;\n $companiesId = $di->has('userData') ? UserProvider::get()->currentCompanyId() : 0;\n $textField = 1;\n $cacheKey = Slug::generate(get_class($this) . '-' . $appsId . '-' . $name);\n $lifetime = 604800;\n\n $customFieldModules = CustomFieldsModules::findFirstOrCreate([\n 'conditions' => 'model_name = :model_name: AND apps_id = :apps_id:',\n 'bind' => [\n 'model_name' => get_class($this),\n 'apps_id' => $appsId\n ],\n 'cache' => [\n 'lifetime' => $lifetime,\n 'key' => $cacheKey\n ]], [\n 'model_name' => get_class($this),\n 'companies_id' => $companiesId,\n 'name' => get_class($this),\n 'apps_id' => $appsId\n ]);\n\n $customField = CustomFields::findFirstOrCreate([\n 'conditions' => 'apps_id = :apps_id: \n AND name = :name: \n AND custom_fields_modules_id = :custom_fields_modules_id:',\n 'bind' => [\n 'apps_id' => $appsId,\n 'name' => $name,\n 'custom_fields_modules_id' => $customFieldModules->getId(),\n ],\n 'cache' => [\n 'lifetime' => $lifetime,\n 'key' => $cacheKey . $customFieldModules->getId()\n ]], [\n 'users_id' => $di->has('userData') ? UserProvider::get()->getId() : 0,\n 'companies_id' => $companiesId,\n 'apps_id' => $appsId,\n 'name' => $name,\n 'label' => $name,\n 'custom_fields_modules_id' => $customFieldModules->getId(),\n 'fields_type_id' => $textField,\n ]);\n\n return $customField;\n }", "public function customFieldValues()\n {\n return $this->morphMany(\\VentureDrake\\LaravelCrm\\Models\\FieldValue::class, 'custom_field_valueable');\n }", "function fields( $array ) {\n\t\t$this->fields_list = $array;\n\t\t}", "abstract public function getFields(): array;", "function field($fieldarray, $dbconnname)\n\t{\n\t\tglobal $$dbconnname;\n\t\t$this->dbconnname = $dbconnname;\n\t\t$this->name = $fieldarray[\"name\"];\n\t\t$this->type = $fieldarray[\"type\"];\n\n\t\tif (strstr($fieldarray[\"flags\"], \"auto_increment\") || (strstr($fieldarray[\"flags\"], \"seq\")))\n\t\t\t\t$this->autoincrement = 1;\n\t\tif (strstr($fieldarray[\"flags\"], \"primary_key\"))\n\t\t\t\t$this->key = 1;\n\t}", "public function __construct( $input ) {\n parent::__construct( $input, parent::ARRAY_AS_PROPS ); \n }", "public function __construct($subfield);", "function create_field( $field )\n\t{\n\t\tif( 'object' == $field['save_format'] && 'null' !== $field['value'] )\n\t\t\t$field['value'] = array( $field['value']->class );\n\n\t\t// value must be array\n\t\tif( !is_array($field['value']) )\n\t\t{\n\t\t\t// perhaps this is a default value with new lines in it?\n\t\t\tif( strpos($field['value'], \"\\n\") !== false )\n\t\t\t{\n\t\t\t\t// found multiple lines, explode it\n\t\t\t\t$field['value'] = explode(\"\\n\", $field['value']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field['value'] = array( $field['value'] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// trim value\n\t\t$field['value'] = array_map('trim', $field['value']);\n\t\t\n\t\t// html\n\t\techo '<div class=\"fa-field-wrapper\">';\n\t\techo '<div class=\"fa-live-preview\"></div>';\n\t\techo '<select id=\"' . $field['id'] . '\" class=\"' . $field['class'] . ' fa-select2-field\" name=\"' . $field['name'] . '\" >';\t\n\t\t\n\t\t// null\n\t\tif( $field['allow_null'] )\n\t\t{\n\t\t\techo '<option value=\"null\">- ' . __(\"Select\",'acf') . ' -</option>';\n\t\t}\n\t\t\n\t\t// loop through values and add them as options\n\t\tif( is_array($field['choices']) )\n\t\t{\n\t\t\tunset( $field['choices']['null'] );\n\n\t\t\tforeach( $field['choices'] as $key => $value )\n\t\t\t{\n\t\t\t\t$selected = $this->find_selected( $key, $field['value'], $field['save_format'], $field['choices'] );\n\t\t\t\techo '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t\t}\n\t\t}\n\n\t\techo '</select>';\n\t\techo '</div>';\n\t}", "public function __construct( array $aFields )\n\t{\n\t\tparent::__construct(null);\n\t\t\n\t\tforeach ($aFields as $value)\n\t\t{\n\t\t\t$this->fields[] = $value;\n\t\t}\n\t}", "protected function _getCustomField()\n {\n return new Tinebase_Model_CustomField_Config(array(\n 'application_id' => Tinebase_Application::getInstance()->getApplicationByName('Tinebase')->getId(),\n 'name' => Tinebase_Record_Abstract::generateUID(),\n 'model' => Tinebase_Record_Abstract::generateUID(),\n 'definition' => array(\n 'label' => Tinebase_Record_Abstract::generateUID(), \n 'type' => 'string',\n 'uiconfig' => array(\n 'xtype' => Tinebase_Record_Abstract::generateUID(),\n 'length' => 10,\n 'group' => 'unittest',\n 'order' => 100,\n )\n ) \n ));\n }", "public function fields(): array\n {\n return MyField::withSlug('name', MyField::withMeta([\n MyField::relation('categories')\n ->fromModel(ProductCategory::class, 'name')\n ->multiple(),\n MyField::uploadMedia(),\n MyField::input('price')\n ->step(0.001)\n ->required(),\n MyField::input('discount')\n ->step(0.001)\n ->required(),\n MyField::quill('body'),\n MyField::switcher('is_active')\n ->value(true)\n ]));\n }", "function __construct( $field = array(), $value = '') {\n\n $this->field = $field;\n $this->value = $value;\n\n $defaults = array(\n 'heading' => 0,\n 'pitch' => 0,\n 'zoom' => 0,\n );\n\n $this->value = wp_parse_args( $this->value, $defaults );\n\n /*\n Array ( \n [id] => webbupointfinder_item_streetview \n [type] => extension_streetview \n [class] => \n [name] => pointfinderthemefmb_options[webbupointfinder_item_streetview] \n [name_suffix] => )\n */\n }", "function field_data()\n\t{\n\t\t$retval = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$F\t\t\t\t= new stdClass();\n\t\t\t$F->name\t\t= $field->name;\n\t\t\t$F->type\t\t= $field->type;\n\t\t\t$F->default\t\t= $field->def;\n\t\t\t$F->max_length\t= $field->max_length;\n\t\t\t$F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0;\n\n\t\t\t$retval[] = $F;\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function createFromArray(string $class, array $data);", "public static function make(array $fields): self\n {\n return new static($fields);\n }", "protected function _getFields()\n {\n return array(\n 'xf_lfc_photo_contest' => array(\n 'photo_contest_id' => array(\n 'type' => self::TYPE_UINT,\n 'autoIncrement' => true\n ),\n 'title' => array(\n 'type' => self::TYPE_STRING,\n 'required' => true,\n 'maxLength' => 255,\n ),\n 'description' => array(\n 'type' => self::TYPE_STRING,\n 'default' => ''\n ),\n 'user_id' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true\n ),\n 'username' => array(\n 'type' => self::TYPE_STRING,\n 'required' => true,\n 'maxLength' => 50,\n 'requiredError' => 'please_enter_valid_name'\n ),\n 'ip_id' => array(\n 'type' => self::TYPE_UINT,\n 'default' => 0\n ),\n 'posting_opens_on' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'verification' => array('$this', '_verifyDate'),\n 'default' => XenForo_Application::$time\n ),\n 'posting_closes_on' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'verification' => array('$this', '_verifyDate')\n ),\n 'voting_opens_on' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'verification' => array('$this', '_verifyDate')\n ),\n 'voting_closes_on' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'verification' => array('$this', '_verifyDate')\n ),\n 'contest_state' => array(\n 'type' => self::TYPE_STRING,\n 'default' => 'visible',\n 'allowedValues' => array('visible', 'moderated', 'deleted')\n ),\n 'entry_count' => array(\n 'type' => self::TYPE_UINT,\n ),\n 'thread_id' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'default' => 0\n ),\n 'max_winners_count' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'default' => 1\n ),\n 'entry_order' => array(\n 'type' => self::TYPE_STRING,\n 'default' => 'latest',\n 'allowedValues' => array('latest', 'oldest', 'most_likes', 'least_likes')\n ),\n 'contest_closed' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 0\n ),\n 'moderate_entries' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 0\n ),\n 'hide_authors' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 0\n ),\n 'hide_entries' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 1\n ),\n 'is_featured' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 0\n ),\n 'max_entry_count' => array(\n 'type' => self::TYPE_UINT,\n 'default' => 1\n ),\n 'allow_tied_winners' => array(\n 'type' => self::TYPE_BOOLEAN,\n 'default' => 1\n ),\n 'max_images_per_entry' => array(\n 'type' => self::TYPE_UINT,\n 'default' => 1\n ),\n 'max_votes_count' => array(\n 'type' => self::TYPE_UINT,\n 'default' => 1\n ),\n 'post_user_group_ids' => array(\n 'type' => self::TYPE_UNKNOWN,\n 'default' => '',\n 'verification' => array('$this', '_verifyUserGroupIds')\n ),\n 'vote_user_group_ids' => array(\n 'type' => self::TYPE_UNKNOWN,\n 'default' => '',\n 'verification' => array('$this', '_verifyUserGroupIds')\n ),\n 'created_at' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'default' => XenForo_Application::$time\n ),\n 'updated_at' => array(\n 'type' => self::TYPE_UINT,\n 'required' => true,\n 'default' => XenForo_Application::$time\n )\n )\n );\n }", "public function getCustomFields()\n {\n return $this->_customFields ?: array();\n }", "public function createCustomField(string $name) : CustomFields\n {\n $di = Di::getDefault();\n $appsId = $di->has('app') ? $di->get('app')->getId() : 0;\n $companiesId = $di->has('userData') ? UserProvider::get()->currentCompanyId() : 0;\n $textField = 1;\n $cacheKey = Slug::generate(get_class($this) . '-' . $appsId . '-' . $name);\n $lifetime = 604800;\n\n $customFieldModules = CustomFieldsModules::findFirstOrCreate(\n [\n 'conditions' => 'model_name = :model_name: AND apps_id = :apps_id:',\n 'bind' => [\n 'model_name' => get_class($this),\n 'apps_id' => $appsId\n ]],\n [\n 'model_name' => get_class($this),\n 'companies_id' => $companiesId,\n 'name' => get_class($this),\n 'apps_id' => $appsId\n ]\n );\n\n $customField = CustomFields::findFirstOrCreate([\n 'conditions' => 'apps_id = :apps_id: AND name = :name: AND custom_fields_modules_id = :custom_fields_modules_id:',\n 'bind' => [\n 'apps_id' => $appsId,\n 'name' => $name,\n 'custom_fields_modules_id' => $customFieldModules->getId(),\n ]\n ], [\n 'users_id' => $di->has('userData') ? UserProvider::get()->getId() : Companies::GLOBAL_COMPANIES_ID,\n 'companies_id' => $companiesId,\n 'apps_id' => $appsId,\n 'name' => $name,\n 'label' => $name,\n 'custom_fields_modules_id' => $customFieldModules->getId(),\n 'fields_type_id' => $textField,\n ]);\n\n return $customField;\n }", "function __construct ($arrDetails)\n\t\t{\n\t\t\tparent::__construct ('Field');\n\t\t\t\n\t\t\t$this->Push (new dataInteger\t('Id',\t\t\t$arrDetails ['Id']));\n\t\t\t$this->Push (new dataString\t\t('Entity',\t\t$arrDetails ['Entity']));\n\t\t\t$this->Push (new dataString\t\t('Field',\t\t$arrDetails ['Field']));\n\t\t\t$this->Push (new dataString\t\t('Label',\t\t$arrDetails ['Label']));\n\t\t\t$this->Push (new dataString\t\t('Title',\t\t$arrDetails ['Title']));\n\t\t\t$this->Push (new dataString\t\t('Description',\tnl2br ($arrDetails ['Description'])));\n\t\t}", "public function create_field( $field ) {\n\t\n\t\tglobal $wpdb;\n\t\t\n\t\t\n\t\t\n\t\t$tmp = explode( '_', $_POST['option_name'] );\n\t\t$job_user_meta = get_user_meta( $tmp[1], 'job_role' );\n\t\t$job_user_meta = is_array( $job_user_meta[0] ) ? $job_user_meta[0] : unserialize( $job_user_meta[0] );\n\t\t$post_ids = array();\n \t\t\n\t\t$user_meta = get_user_meta( $tmp[1], $field['_name'] );\n\t\t$arr = '[';\n\t\tif( !empty( $field ) ) {\n\t\t\t$post_ids = is_array( $user_meta[0] ) ? $user_meta[0] : unserialize( $user_meta[0] );\n \t\t\tif( !empty( $post_ids )) {\n\t\t\t\tforeach( $post_ids as $id ) { \n\t\t\t\t\t$post_title = get_the_title( $id );\n \t\t\t\t\t$arr .= '{\\\"value\\\":\\\"' . $id . '\\\",\\\"name\\\":\\\"' . $post_title . '\\\",\\\"job_role\\\":\\\"' . $job_user_meta[$id] . '\\\"},';\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t$arr = trim( $arr, ',' );\n\t\t$arr .= ']';\n\t\t\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'post_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'post_type' => 'companies',\n\t\t\t'post_status' => 'publish'\n\t\t);\n\t\t\n\t\t$companies = get_posts( $args );\n\t\t\n\t\t$i = 0;\n\t\tforeach( $companies as $company ) {\n\t\t\t$list[$i]['value'] = $company->ID;\n\t\t\t$list[$i]['name'] = $company->post_title;\n\t\t\t$list[$i]['job_role'] = '';\n\t\t\t$i++;\n\t\t}\n\t\t$list = json_encode( $list );\n\t\t\n\t\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . plugins_url() . '/custom-autosuggest-metabox/css/token-input.css?time=' . strtotime( date( \"Y-m-d H:i:s\" )) . '\" />\n\t\t\t<script type=\"text/javascript\" src=\"' . plugins_url() . '/custom-autosuggest-metabox/js/jquery.tokeninput.js?time=' . strtotime( date( \"Y-m-d H:i:s\" )) . '\"></script>';\n\n\t\t\n\t\t$htmlTxt = '<input type=\"text\" id=\"inputs\" placeholder=\"Search here for a company name\" name=\"inputs\" style=\"width:100%\" />\\<input type=\"hidden\" name=\"' . $field['_name'] . '\" value=\"1\" /><input type=\"hidden\" name=\"field_name\" value=\"' . $field['_name'] . '\" /><input type=\"hidden\" name=\"field_key\" value=\"' . $field['key'] . '\" />';\n\t\t\t\t\n\t\techo '<div id=\"outter-box-autosuggest\">\n\t\t\t\t\t\t<input type=\"text\" id=\"inputs\" name=\"inputs\" placeholder=\"Search here for a company name\" style=\"width:100%\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"' . $field['_name'] . '\" value=\"1\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_name\" value=\"' . $field['_name'] . '\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_key\" value=\"' . $field['key'] . '\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<a href=\"javascript:void(0);\" id=\"addCompanyLink\" style=\"padding: 10px 0;float:left;\">Add Company</a>\n\t\t\t\t\t<div id=\"formDiv\" style=\"display:none;float:left;width:100%;\" class=\"form-company\">\n\t\t\t\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t\t\t\t<div class=\"add-company-row\"><label>Company Name:</label> <input type=\"text\" value=\"\" placeholder=\"Enter Company Name\" id=\"companyNameText\" /></div>\n\t\t\t\t\t\t\t<div class=\"add-company-row\"><label>Job Role: </label><input type=\"text\" value=\"\" placeholder=\"Enter Job Role\" id=\"jobRole\" /></div>\n\t\t\t\t\t\t\t<div style=\"float: left;padding: 5px 0; margin-left:128px;\">\n\t\t\t\t\t\t\t\t<input type=\"button\" value=\"Save Company\" id=\"addCompanyButton\" />\n\t\t\t\t\t\t\t\t<input type=\"button\" value=\"Cancel\" id=\"removeCompanyButton\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script>\n\t\t\t\t\t\tvar userid = ' . ( !empty( $tmp[1] ) ? $tmp[1] : 0 ) .';\n\t\t\t\t\t\tfunction trimChar(string, charToRemove) {\n\t\t\t\t\t\t\t\twhile(string.charAt(0)==charToRemove) {\n\t\t\t\t\t\t\t\t\t\tstring = string.substring(1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twhile(string.charAt(string.length-1)==charToRemove) {\n\t\t\t\t\t\t\t\t\t\tstring = string.substring(0,string.length-2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar obj = jQuery.parseJSON( ' . json_encode( $list ) . ' );\n\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\tvar x = jQuery(\"#inputs\").tokenInput(obj,{\n\t\t\t\t\t\t\t\tprePopulate: jQuery.parseJSON(\"' . $arr . '\")\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tjQuery(\"#addCompanyLink\").click(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#formDiv\").css( \"display\", \"block\" );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tjQuery(\"form\").keyup(function(e) {\n\t\t\t\t\t\t\t\treturn e.which !== 13 \n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tjQuery(\"form\").keypress(function(e) {\n\t\t\t\t\t\t\t\treturn e.which !== 13 \n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tjQuery(\"#removeCompanyButton\").click(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#formDiv\").css( \"display\", \"none\" );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjQuery( \"#companyNameText\" ).keypress( function(e) {\n\t\t\t\t\t\t\t\tif(e.which == 13){//Enter key pressed\n\t\t\t\t\t\t\t\t\tjQuery( \"#addCompanyButton\" ).focus();\n\t\t\t\t\t\t\t\t\tjQuery(\"#addCompanyButton\").click();//Trigger save company button click event\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjQuery( \"#jobRole\" ).keypress( function(e) {\n\t\t\t\t\t\t\t\tif(e.which == 13){//Enter key pressed\n \t\t\t\t\t\t\t \t\tjQuery( \"#addCompanyButton\" ).focus();\n\t\t\t\t\t\t\t\t\tjQuery(\"#addCompanyButton\").click();//Trigger save company button click event\n \t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjQuery( \"#addCompanyButton\" ).click( function() {\n\t\t\t\t\t\t\t\tvar functionName = \"saveCompany\";\n\t\t\t\t\t\t\t\tselectedCompanies = \"\";\n\t\t\t\t\t\t\t\tselectedJobRoles = \" \";\n\t\t\t\t\t\t\t\tcompanyName = jQuery( \"#companyNameText\" ).val();\n\t\t\t\t\t\t\t\tjobRole = jQuery( \"#jobRole\" ).val();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( companyName == \"\" ) {\n\t\t\t\t\t\t\t\t\talert( \"Please enter company name.\" );\n\t\t\t\t\t\t\t\t\tjQuery( \"#companyNameText\" ).focus();\n \t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif( jobRole == \"\" ) {\n\t\t\t\t\t\t\t\t\talert( \"Please enter job role.\" );\n\t\t\t\t\t\t\t\t\tjQuery( \"#jobRole\" ).focus();\n \t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tjQuery(\"input\").attr(\"disabled\",true);\n\t\t\t\t\t\t\t\tjQuery( \".selectedLi\" ).each(function() {\n\t\t\t\t\t\t\t\t\tselectedCompanies += \",\" + jQuery( this ).val();\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjQuery( \".job_role_text\" ).each(function() {\n\t\t\t\t\t\t\t\t\tselectedJobRolesVal = jQuery( this ).val();\n\t\t\t\t\t\t\t\t\tselectedJobRolesId = jQuery( this ).attr(\"job_id\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tselectedJobRoles += \",\" +selectedJobRolesVal+\"|\"+selectedJobRolesId\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tvar param = jQuery.extend({ \"companyName\": companyName, \"jobRole\": jobRole, \"method\": functionName, \"selectedCompanies\":selectedCompanies, \"selectedJobRoles\":selectedJobRoles,\"userid\": userid, }, param);\n\t\t\t\t\t\t\t\tvar url = \"' . plugins_url() . '/custom-autosuggest-metabox/ajax/ajax.php\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\turl: url,\n\t\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\t\tdata: param,\n\t\t\t\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif( parseInt( data.id ) == 0 ) {\n\t\t\t\t\t\t\t\t\t\t\talert( \"Error in saving company.\" );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\talert( \"Company added successfully.\" );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tjQuery( \"#outter-box-autosuggest\" ).html(\\'' . $htmlTxt . '\\');\n\t\t\t\t\t\t\t\t\t\t\tjQuery( \"#companyNameText\" ).val( \"\" );\n\t\t\t\t\t\t\t\t\t\t\tjQuery( \"#jobRole\" ).val( \"\" );\n\t\t\t\t\t\t\t\t\t\t\tjQuery(\"input\").attr(\"disabled\",false);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar x = jQuery(\"#inputs\").tokenInput(data.list,{\n\t\t\t\t\t\t\t\t\t\t\t\tprePopulate: data.prepopulatedList\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\tjQuery(\"#formDiv\").css( \"display\", \"none\" );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>';\n\t}", "abstract protected function fields(): array;", "abstract protected function fields(): array;", "public static function createFromArray($fields) \n\t{\n\t\t$message = new Message();\n\t\tself::populate($message,$fields);\n\t\treturn $message;\n\t}", "public static function getFields() {\n return array(\n new TextField( array(\n 'name' => 'name',\n 'public' => array(\n 'title' => 'Title',\n 'description' => 'The name of the link that the\n element will describe',\n ),\n ) ),\n new TextField( array(\n 'name' => 'blurb',\n 'public' => array(\n 'title' => 'Blurb',\n 'description' => 'Short blurb that can be displayed about\n the nature of the link',\n ),\n ) ),\n new TextField( array(\n 'name' => 'image',\n 'public' => array(\n 'title' => 'Image',\n 'description' => 'The image to be dispalyed on the front.',\n ),\n ) ),\n new TextField( array(\n 'name' => 'link',\n 'public' => array(\n 'title' => 'Link',\n 'description' => 'The actual link clicking the element will\n result in.',\n ),\n ) ),\n );\n }", "public function initFromArray($o) {\n }", "public function get_custom_fields(){\n $items = array();\n $success = $this->new_request( \"GET\", \"$this->account_id/custom_field_identifiers\" );\n if( ! $success ){\n return array();\n }\n $response = json_decode( $this->ironman->get_response_body(), true );\n $fields = isset( $response['custom_field_identifiers'] ) ? $response['custom_field_identifiers'] : array();\n foreach( $fields as $field ){\n $items[$field] = $field;\n }\n return $items;\n }", "public function buildCustomFieldsList() {\n\n\t\t$parsed = array();\n\n\t\tforeach ( $this->get_all_custom_fields( false ) as $list_id => $merge_field ) {\n\t\t\tarray_map(\n\t\t\t\tfunction ( $var ) use ( &$parsed, $list_id ) {\n\t\t\t\t\t$parsed[ $list_id ][ $var['id'] ] = $var['name'];\n\t\t\t\t},\n\t\t\t\t$merge_field\n\t\t\t);\n\t\t}\n\n\t\treturn $parsed;\n\t}", "function & documenttypefieldlinkCreateFromArray($aParameters) {\n\t$oDocTypeField = & new DocumentTypeFieldLink($aParameters[0], $aParameters[1], $aParameters[2], $aParameters[3], $aParameters[4], $aParameters[5], $aParameters[6], $aParameters[7], $aParameters[8], $aParameters[9], $aParameters[10]);\n\treturn $oDocTypeField;\n}", "function create_custom_fields() {\n // Get all components to be listed\n $this->get_components();\n // Add components meta box\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'wpnext', 'WPNext Builder', array( &$this, 'display_custom_fields' ), $postType, 'normal', 'high' );\n }\n }\n }", "function field(array $data)\n{\n return new FilippoToso\\LaravelHelpers\\UI\\Field($data);\n}", "public static function fromFields(array $fields)\n {\n return static::makeWith($fields);\n }", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "public function makeNew() {\n\t\t$class = get_class($this);\n\t\t$newArray = $this->wire(new $class($this->parent, $this->field));\n\t\treturn $newArray;\n\t}", "function nkf_base_rows_from_field_collection(&$vars, $field_array) {\n $vars['rows'] = array();\n foreach($vars['element']['#items'] as $key => $item) {\n $entity_id = $item['value'];\n $entity = field_collection_item_load($entity_id);\n $wrapper = entity_metadata_wrapper('field_collection_item', $entity);\n $row = array();\n foreach($field_array as $field) {\n $info = $wrapper->$field->info();\n $type = $info['type'];\n $field_value = $wrapper->$field->value();\n switch ($type) {\n case 'text_formatted':\n $value = $wrapper->$field->value->value();\n break;\n case 'field_item_image':\n if (isset($field_value)) {\n $build = array(\n '#theme' => 'image',\n '#path' => $field_value['uri'],\n '#url' => nkf_base_image_url($field_value['uri'], 'large'),\n '#alt' => $field_value['alt'],\n '#title' => $field_value['title'],\n //'#width' => $field_value['width'],\n //'#height' => $field_value['height'],\n );\n $value = $build;\n } else {\n $value = null;\n }\n break;\n default:\n $value = isset($field_value) ? $wrapper->$field->value() : null;\n\n }\n $row[$field] = $value;\n }\n $vars['rows'][] = $row;\n }\n}", "public function create(array $input)\n {\n }", "function load_field( $field ) {\n\t\t\n\t\t// min/max\n\t\t$field['min'] = (int) $field['min'];\n\t\t$field['max'] = (int) $field['max'];\n\t\t\n\t\t\n\t\t// vars\n\t\t$sub_fields = acf_get_fields( $field );\n\t\t\n\t\t\n\t\t// append\n\t\tif( $sub_fields ) {\n\t\t\t\n\t\t\t$field['sub_fields'] = $sub_fields;\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\n\t\t// return\n\t\treturn $field;\n\t\t\n\t}", "public function __construct(array $fields)\n {\n $fields = collect($settings);\n\n\n }", "protected function _getFields()\r\n {\r\n return array(\r\n 'xf_bible' => array(\r\n 'bible_id' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'required' => true\r\n ),\r\n 'name' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'required' => true\r\n ),\r\n 'copyright' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'default' => ''\r\n ),\r\n 'abbreviation' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'default' => ''\r\n ),\r\n 'language' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'default' => 'eng'\r\n ),\r\n 'note' => array(\r\n 'type' => self::TYPE_STRING,\r\n 'default' => ''\r\n ),\r\n 'last_modified' => array(\r\n 'type' => self::TYPE_UINT,\r\n 'default' => XenForo_Application::$time\r\n )\r\n )\r\n );\r\n }", "function my_custom_field($field, $value){\r\n\tprint_r($field);\r\n\tprint_r($value);\r\n\r\n}", "public function fromArray ($fieldsArr)\n\t{\n\t\tforeach ($fieldsArr as $name => $value) {\n\t\t\t$this->$name = $value;\n\t\t}\n\t}", "function my_custom_field($field, $value){\n\tprint_r($field);\n\tprint_r($value);\n\n}", "protected function createFormFields() {\n\t}", "function civicrm_api3_custom_value_create($params) {\n // @todo it's not clear where the entity_table is used as CRM_Core_BAO_CustomValueTable::setValues($create)\n // didn't seem to use it\n // so not clear if it's relevant\n if (!empty($params['entity_table']) && substr($params['entity_table'], 0, 7) == 'civicrm') {\n $params['entity_table'] = substr($params['entity_table'], 8, 7);\n }\n $create = array('entityID' => $params['entity_id']);\n // Translate names and\n //Convert arrays to multi-value strings\n $sp = CRM_Core_DAO::VALUE_SEPARATOR;\n \n foreach ($params as $id => $param) {\n if (is_array($param)) {\n $param = $sp . implode($sp, $param) . $sp;\n }\n list($c, $id) = CRM_Utils_System::explode('_', $id, 2);\n if ($c != 'custom') {\n continue;\n }\n list($i, $n, $x) = CRM_Utils_System::explode(':', $id, 3);\n if (is_numeric($i)) {\n $key = $i;\n $x = $n;\n }\n else {\n // Lookup names if ID was not supplied\n $key = CRM_Core_BAO_CustomField::getCustomFieldID($n, $i);\n if (!$key) {\n continue;\n }\n }\n if ($x && is_numeric($x)) {\n $key .= '_' . $x;\n }\n $create['custom_' . $key] = $param;\n }\n $result = CRM_Core_BAO_CustomValueTable::setValues($create);\n if ($result['is_error']) {\n throw new Exception($result['error_message']);\n }\n return civicrm_api3_create_success(TRUE, $params);\n}", "function __construct()\r\n {\r\n $this->field_names = func_get_args();\r\n }", "function createCustomField($fieldName, $fieldType, $configId, $attributes = NULL,\n $default_value = '', $possible_values = '') {\n global $fieldList;\n\n if (NULL == $attributes) {\n $attributes = array();\n\n $attributes[\"access_level_r\"] = 10;\n $attributes[\"access_level_rw\"] = 25;\n $attributes[\"require_report\"] = 1;\n $attributes[\"require_update\"] = 1;\n $attributes[\"require_resolved\"] = 0;\n $attributes[\"require_closed\"] = 0;\n $attributes[\"display_report\"] = 1;\n $attributes[\"display_update\"] = 1;\n $attributes[\"display_resolved\"] = 0;\n $attributes[\"display_closed\"] = 0;\n\n echo \"<script type=\\\"text/javascript\\\">console.warn(\\\"WARN: using default attributes for CustomField $fieldName\\\");</script>\";\n }\n\n $query = \"SELECT id, name FROM `mantis_custom_field_table`\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n throw new Exception (\"create custom field FAILED\");\n }\n while ($row = mysql_fetch_object($result)) {\n $fieldList[\"$row->name\"] = $row->id;\n }\n\n $fieldId = $fieldList[$fieldName];\n if (!$fieldId) {\n $query2 = \"INSERT INTO `mantis_custom_field_table` \" .\n \"(`name`, `type` ,`access_level_r`,\" .\n \" `access_level_rw` ,`require_report` ,`require_update` ,`display_report` ,`display_update` ,`require_resolved` ,`display_resolved` ,`display_closed` ,`require_closed` \";\n $query2 .= \", `possible_values`, `default_value`\";\n\n $query2 .= \") VALUES ('$fieldName', '$fieldType', '\" . $attributes[\"access_level_r\"] . \"', '\" .\n $attributes[\"access_level_rw\"] . \"', '\" .\n $attributes[\"require_report\"] . \"', '\" .\n $attributes[\"require_update\"] . \"', '\" .\n $attributes[\"display_report\"] . \"', '\" .\n $attributes[\"display_update\"] . \"', '\" .\n $attributes[\"require_resolved\"] . \"', '\" .\n $attributes[\"display_resolved\"] . \"', '\" .\n $attributes[\"display_closed\"] . \"', '\" .\n $attributes[\"require_closed\"] . \"'\";\n\n $query2 .= \", '$possible_values', '$default_value'\";\n $query2 .= \");\";\n\n #echo \"DEBUG INSERT $fieldName --- query $query2 <br>\";\n\n $result2 = SqlWrapper::getInstance()->sql_query($query2);\n if (!$result2) {\n throw new Exception (\"create custom field failed: $configId\");\n }\n $fieldId = mysql_insert_id();\n\n #echo \"custom field '$configId' created.<br>\";\n } else {\n echo \"<script type=\\\"text/javascript\\\">console.info(\\\"INFO: custom field '$configId' already exists.\\\");</script>\";\n }\n\n // add to codev_config_table\n Config::getInstance()->setValue($configId, $fieldId, Config::configType_int);\n}", "function createCustomField($fieldName, $fieldType, $configId, $attributes = NULL,\n $default_value = '', $possible_values = '') {\n global $fieldList;\n\n if (NULL == $attributes) {\n $attributes = array();\n\n $attributes[\"access_level_r\"] = 10;\n $attributes[\"access_level_rw\"] = 25;\n $attributes[\"require_report\"] = 1;\n $attributes[\"require_update\"] = 1;\n $attributes[\"require_resolved\"] = 0;\n $attributes[\"require_closed\"] = 0;\n $attributes[\"display_report\"] = 1;\n $attributes[\"display_update\"] = 1;\n $attributes[\"display_resolved\"] = 0;\n $attributes[\"display_closed\"] = 0;\n\n echo \"<span class='warn_font'>WARN: using default attributes for CustomField $fieldName</span><br/>\";\n }\n\n $query = \"SELECT id, name FROM `mantis_custom_field_table`\";\n $result = execQuery($query);\n while ($row = mysql_fetch_object($result)) {\n $fieldList[\"$row->name\"] = $row->id;\n }\n\n $fieldId = $fieldList[$fieldName];\n if (!$fieldId) {\n $query2 = \"INSERT INTO `mantis_custom_field_table` \" .\n \"(`name`, `type` ,`access_level_r`,\" .\n \" `access_level_rw` ,`require_report` ,`require_update` ,`display_report` ,`display_update` ,`require_resolved` ,`display_resolved` ,`display_closed` ,`require_closed` \";\n $query2 .= \", `possible_values`, `default_value`\";\n\n $query2 .= \") VALUES ('$fieldName', '$fieldType', '\" . $attributes[\"access_level_r\"] . \"', '\" .\n $attributes[\"access_level_rw\"] . \"', '\" .\n $attributes[\"require_report\"] . \"', '\" .\n $attributes[\"require_update\"] . \"', '\" .\n $attributes[\"display_report\"] . \"', '\" .\n $attributes[\"display_update\"] . \"', '\" .\n $attributes[\"require_resolved\"] . \"', '\" .\n $attributes[\"display_resolved\"] . \"', '\" .\n $attributes[\"display_closed\"] . \"', '\" .\n $attributes[\"require_closed\"] . \"'\";\n\n $query2 .= \", '$possible_values', '$default_value'\";\n $query2 .= \");\";\n\n #echo \"DEBUG INSERT $fieldName --- query $query2 <br/>\";\n\n $result2 = execQuery($query2);\n $fieldId = mysql_insert_id();\n\n #echo \"custom field '$configId' created.<br/>\";\n } else {\n echo \"<span class='success_font'>INFO: custom field '$configId' already exists.</span><br/>\";\n }\n\n // add to codev_config_table\n Config::getInstance()->setValue($configId, $fieldId, Config::configType_int);\n}", "public function fromArray($data)\n {\n if (isset($data['field_name']))\n $this->fieldName = $data['field_name'];\n\n if (isset($data['direction']))\n $this->direction = $data['direction'];\n }", "function __construct( $field = array(), $value ='', $parent ) {\n \n $this->parent = $parent;\n $this->field = $field;\n $this->value = $value;\n\n if ( empty( $this->extension_dir ) ) {\n $this->extension_dir = trailingslashit( str_replace( '\\\\', '/', dirname( __FILE__ ) ) );\n $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\\\', '/', ABSPATH ) ), '', $this->extension_dir ) );\n } \n\n // Set default args for this field to avoid bad indexes. Change this to anything you use.\n $defaults = array(\n 'options' => array(),\n 'stylesheet' => '',\n 'output' => true,\n 'enqueue' => true,\n 'enqueue_frontend' => true\n );\n $this->field = wp_parse_args( $this->field, $defaults );\n \n }", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "public static function createFromArray($name, array $data = [])\n {\n $type = parent::createFromArray($name, $data);\n \\assert($type instanceof self);\n\n return $type;\n }", "private function _build_a_custom_fields($filter_custom_fields)\n {\n $query = $this->_db->getQuery(true);\n $query->select('`custom_title`');\n $query->select('`virtuemart_custom_id`');\n $query->from('#__virtuemart_customs');\n $query->where('`virtuemart_custom_id` IN ('.implode(', ',$filter_custom_fields).')');\n $this->_db->setQuery((string)$query);\n return $this->_db->loadAssocList();\n \n }", "public function buildFields() {\n }", "public function maker(): array;", "public function create_custom_fields() {\n \n /* Custom H1 */\n $custom_h1 = new_cmb2_box( array(\n 'id' => '_custom_h1',\n 'title' => 'Custom H1',\n 'object_types' => array_keys( get_post_types( '', 'names' ) ),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true\n ) );\n $custom_h1->add_field( array(\n 'id' => '_custom_h1',\n 'desc' => 'Custom Title',\n 'type' => 'text',\n ) );\n }", "public function getCustomFields() {\n }", "public function getCustomFields() {\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "function __construct($fields=array())\n {\n // fields.php.\n $this->add_fields($fields);\n }", "protected function _getFields()\n {\n return array(\n 'xf_handler' => array(\n 'handler_id' => array('type' => self::TYPE_UINT, 'autoIncrement' => true), \n 'content_type' => array('type' => self::TYPE_STRING, 'maxLength' => 255, 'required' => true), \n 'handler_type_id' => array('type' => self::TYPE_STRING, 'required' => true), \n 'object_class_id' => array('type' => self::TYPE_UINT, 'required' => true), \n 'extra_data_cache' => array('type' => self::TYPE_SERIALIZED, 'default' => ''), \n ), \n );\n }", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function getCustom()\n {\n return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;\n }", "public function create($array) {\n \n }", "protected function _getFields()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t\t'bookmark_content'\t=> array(\r\n\t\t\t\t'bookmark_id'\t\t=> array('type' => self::TYPE_UINT, 'autoIncrement' => true),\r\n\t\t\t\t'bookmark_tag'\t\t=> array('type' => self::TYPE_STRING, 'default' => '', 'maxLength' => 25),\r\n\t\t\t\t'content_type' \t=> array('type' => self::TYPE_STRING, 'maxLength' => 25, 'required' => true),\r\n\t\t\t\t'content_id' \t => array('type' => self::TYPE_UINT, 'required' => true),\r\n\t\t\t\t'content_user_id' => array('type' => self::TYPE_UINT, 'required' => true),\r\n\t\t\t\t'bookmark_user_id' => array('type' => self::TYPE_UINT, 'default' => XenForo_Visitor::getUserId()),\r\n\t\t\t\t'bookmark_date'\t\t=> array('type' => self::TYPE_UINT, 'default' => XenForo_Application::$time),\r\n\t\t\t\t'bookmark_note' \t=> array('type' => self::TYPE_STRING, 'default' => '', 'maxLength' => 150),\r\n\t\t\t\t'public' \t=> array('type' => self::TYPE_UINT, 'default' => 0),\r\n\t\t\t\t'sticky' \t=> array('type' => self::TYPE_UINT, 'default' => 0),\r\n\t\t\t\t'quick_link' \t=> array('type' => self::TYPE_UINT, 'default' => 0)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "private function build_attributes_object( $array ) {\n $attributes = [ ];\n\n foreach ( $array as $name => $value ) {\n $attributes[] = [\n 'name' => $name,\n 'value' => $value,\n ];\n }\n\n return $attributes;\n }", "public function __construct(DataField $datafield)\r\n\t{\r\n\t\tforeach ( $datafield->subfield() as $subfield )\r\n\t\t{\r\n\t\t\tswitch ( $subfield->code )\r\n\t\t\t{\r\n\t\t\t\t// $a - Main entry heading (NR)\r\n\t\r\n\t\t\t\tcase 'b': // $b - Edition (NR)\r\n\t\r\n\t\t\t\t\t$this->edition = $subfield->value;\r\n\t\t\t\t\tbreak;\r\n\t\r\n\t\t\t\t\t// $c - Qualifying information (NR)\r\n\t\t\t\t\t// $d - Place, publisher, and date of publication (NR)\r\n\t\t\t\t\t// $g - Related parts (R)\r\n\t\t\t\t\t// $h - Physical description (NR)\r\n\t\t\t\t\t// $i - Relationship information (R)\r\n\t\t\t\t\t// $k - Series data for related item (R)\r\n\t\t\t\t\t// $m - Material-specific details (NR)\r\n\t\t\t\t\t// $n - Note (R)\r\n\t\t\t\t\t// $o - Other item identifier (R)\r\n\t\t\t\t\t// $r - Report number (R)\r\n\t\r\n\t\t\t\tcase 's': // $s - Uniform title (NR)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$this->uniform_title = $subfield->value;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 't': // $t - Title (NR)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$this->title = $subfield->value;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// $u - Standard Technical Report Number (NR)\r\n\t\t\t\t\t// $w - Record control number (R)\r\n\t\r\n\t\t\t\tcase 'x': // $x - International Standard Serial Number (NR)\r\n\t\r\n\t\t\t\t\tarray_push($this->issns, $subfield->value);\r\n\t\t\t\t\tbreak;\r\n\t\r\n\t\t\t\t\t// $y - CODEN designation (NR)\r\n\t\r\n\t\t\t\tcase 'z': // $z - International Standard Book Number (R)\r\n\t\r\n\t\t\t\t\tarray_push($this->isbns, $subfield->value);\r\n\t\t\t\t\tbreak;\r\n\t\r\n\t\t\t\t\t// $4 - Relationship code (R)\r\n\t\t\t\t\t// $6 - Linkage (NR)\r\n\t\t\t\t\t// $7 - Control subfield (NR)\r\n\t\t\t\t\t// /0 - Type of main entry heading\r\n\t\t\t\t\t// /1 - Form of name\r\n\t\t\t\t\t// /2 - Type of record\r\n\t\t\t\t\t// /3 - Bibliographic level\r\n\t\t\t\t\t// $8 - Field link and sequence number (R)\r\n\t\r\n\t\t\t\tdefault: // everything else is a note\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tarray_push($this->notes, $subfield->value);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function wp_api_encode_acf($data,$post,$context){\n $customMeta = (array) get_fields($post['ID']);\n\n $data['meta'] = array_merge($data['meta'], $customMeta );\n return $data;\n}", "public function prep_sf_obj( array $obj_arr )\n\t{\t\n\t\t$obj = new stdClass();\n\t\t\n\t\t// META\n\t\tif ( empty( $obj_arr['meta']['type'] ) )\n\t\t\treturn false;\n\t\t$prefix = empty( $obj_arr['meta']['prefix'] ) ? '' : ($obj_arr['meta']['prefix'] . '__');\n\t\t$custom = empty($obj_arr['meta']['custom']) ? '' : '__c';\n\t\t$obj->type = $prefix . $obj_arr['meta']['type'] . $custom;\n\t\tunset($obj_arr['meta']);\n\t\t\n\t\t// DATA\n\t\tforeach ( $obj_arr as $field => $arr ) {\n\t\t\tif ( empty ( $arr ) || ( is_array( $arr ) && !empty( $arr['ignore'] ) ) )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t// Complex fields use an array, simple fields are simple key => value pairs.\n\t\t\tif ( is_array( $arr ) ) {\n\t\t\t\tif ( !empty( $arr['custom'] ) )\n\t\t\t\t\t$field .= '__c';\n\t\t\t\tif ( !empty( $arr['prefix'] ) )\n\t\t\t\t\t$field = $prefix . $field;\n\t\t\t\t// Use callback to set value if supplied (args required to use callback)\n\t\t\t\tif ( !empty( $arr['callback'] ) && !empty( $arr['args'] ) ) {\n\t\t\t\t\t// If the callback is a one element array, set it to use $this.\n\t\t\t\t\t// If the callback is an array with > 2 elements, skip this field.\n\t\t\t\t\tif ( is_array( $arr['callback'] ) ) {\n\t\t\t\t\t\tif ( count( $arr['callback'] ) > 2 )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif ( count( $arr['callback'] ) == 1 )\n\t\t\t\t\t\t\t$arr['callback'] = array($this, array_shift($arr['callback']));\n\t\t\t\t\t}\n\t\t\t\t\t// Put args into array if they aren't already\n\t\t\t\t\t$arr['args'] = is_array($arr['args']) ? $arr['args'] : array($arr['args']);\n\t\t\t\t\t$arr['value'] = call_user_func_array($arr['callback'], $arr['args']);\n\t\t\t\t}\n\t\t\t\t$value = $arr['value'];\n\t\t\t} else {\n\t\t\t\t$value = $arr;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that if the field is required, that it has a value\n\t\t\tif ( !empty( $arr['required'] ) && empty ( $value ) ) {\n\t\t\t\t$this->_error(new Exception(\"Value for $field field is required.\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t// Assign the property to the objects field property in the appropriate way\n\t\t\tif ( !empty( $value ) )\n\t\t\t\t$obj->fields[$field] = $value;\n\t\t}\n\t\t\n\t\treturn $obj;\n\t}", "function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {\n $mapping['my_custom_field'] = 'array<string>';\n}", "function createRecord($array){\n parent::createRecord($array);\n }" ]
[ "0.62573355", "0.61886066", "0.61770743", "0.61503464", "0.6073878", "0.6052782", "0.6042335", "0.59734654", "0.5917864", "0.59079075", "0.5887045", "0.5872677", "0.5838811", "0.5816192", "0.58040226", "0.57931495", "0.57470566", "0.5745274", "0.5733111", "0.5713116", "0.569435", "0.5691234", "0.56491566", "0.55511445", "0.5549595", "0.5547319", "0.55388224", "0.55374914", "0.55356646", "0.5529798", "0.55280286", "0.55208457", "0.55131537", "0.550441", "0.5504032", "0.5488768", "0.54848725", "0.5480129", "0.54742813", "0.54624134", "0.5455142", "0.54541576", "0.54505455", "0.54478186", "0.5428685", "0.54258245", "0.5412017", "0.5409156", "0.5409156", "0.54057", "0.5388529", "0.53820735", "0.5380998", "0.5370102", "0.5369709", "0.5360271", "0.53485805", "0.5341884", "0.53413856", "0.53386796", "0.5333967", "0.5325077", "0.5322279", "0.5321353", "0.5319218", "0.5316779", "0.5312598", "0.5304066", "0.53023326", "0.52981997", "0.5295341", "0.5292382", "0.5288841", "0.52863127", "0.5284669", "0.52824885", "0.52824885", "0.52824885", "0.5282244", "0.5281846", "0.5280405", "0.5279995", "0.52733564", "0.5271921", "0.5271921", "0.52708584", "0.5268734", "0.52684045", "0.5261904", "0.52607626", "0.52607626", "0.52607626", "0.52558386", "0.52548647", "0.52527356", "0.5252629", "0.5249438", "0.5245282", "0.5236847", "0.52258295" ]
0.6217372
1
Construct a custom field object with C(array).
private function constructCustomFieldCustom(Request $request) { $customField = [ "tenant_id" => $this->requester->getTenantId(), "company_id" => $this->requester->getCompanyId(), "name" => $request->name, "lov_cusmod" => $request->lovCusmod, "field_name" => $request->fieldName, "lov_cdtype" => $request->lovCdtype, "lov_type_code" => $request->lovTypeCode . '|C', "is_active" => $request->isActive ]; return $customField; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addArray(string $name, InterfaceClass $field = null) : ArrayClass {\n\t\t$field = new ArrayClass($name, $field);\n\t\t$this->fields[$name] = $field;\n\t\treturn $field;\n\t}", "public static function createFromArray($array) {\n\t\t$document = new static();\n\n\t\tforeach ($array as $fieldName => $fieldValue) {\n\t\t\t$document->$fieldName = $fieldValue;\n\t\t}\n\n\t\treturn $document;\n\t}", "public function __construct(array $field)\n {\n // Check for required keys\n parent::__construct($field, self::REQUIRED_KEYS, self::class);\n\n // Load all the information into public variables\n $this->value = $field['value'];\n $this->displayText = $field['displayText'];\n }", "function FieldTypesArray() {}", "public function __construct( $input ) {\n parent::__construct( $input, parent::ARRAY_AS_PROPS ); \n }", "public function createFieldFromArray($column)\n {\n $dataType = ArrayUtils::get($column, 'datatype');\n if (ArrayUtils::get($column, 'type') === null) {\n $column['type'] = $this->source->getTypeFromSource($dataType);\n }\n\n // PRIMARY KEY must be required\n if ($column['primary_key']) {\n $column['required'] = true;\n }\n\n $castAttributesToJSON = function (&$array, array $keys) {\n foreach ($keys as $key) {\n $value = json_decode(isset($array[$key]) ? $array[$key] : '', true);\n $array[$key] = $value ? $value : null;\n }\n };\n\n $castAttributesToJSON($column, ['options', 'translation']);\n\n $fieldType = ArrayUtils::get($column, 'type');\n // NOTE: Alias column must are nullable\n if (DataTypes::isAliasType($fieldType)) {\n $column['nullable'] = true;\n } \n \n if ($this->isFloatingPointType($dataType)) {\n $column['length'] = sprintf('%d,%d', $column['precision'], $column['scale']);\n } else if ($this->source->isIntegerType($dataType)) {\n $column['length'] = $column['precision'];\n } else if (in_array($dataType, $this->noLengthDataTypes)) {\n $column['length'] = null; \n } else {\n $column['length'] = $column['char_length'];\n }\n\n $castAttributesToBool = function (&$array, array $keys) {\n foreach ($keys as $key) {\n $array[$key] = (bool) ArrayUtils::get($array, $key);\n }\n };\n\n $castAttributesToBool($column, [\n 'auto_increment',\n 'unique',\n 'managed',\n 'primary_key',\n 'signed',\n 'hidden_detail',\n 'hidden_browse',\n 'required',\n 'nullable',\n 'readonly',\n ]);\n\n $this->setFieldDataDefaultValue($column);\n\n return new Field($column);\n }", "abstract public function getFieldData(): array;", "public function __construct(array $array)\n {\n parent::hydrate($array);\n }", "public function create(array $input);", "public function initWithArray($array)\n {\n $this->array = $array;\n return $this;\n }", "public function __construct( $input ) {\n parent::__construct( $input, parent::ARRAY_AS_PROPS ); \n }", "function build_custom_field_data($field_id, $value, $enum = null)\n{\n\n $data = array(\n 'id' => $field_id,\n );\n\n if (is_array($value)) {\n if (isset($value[0]['subtype']) && isset($value[0]['value'])) {\n foreach ($value as $key => $value) {\n $data['values'][$key]['value'] = $value['value'];\n $data['values'][$key]['subtype'] = $value['subtype'];\n }\n } else {\n $data['values'] = $value;\n }\n } else {\n $data['values'] = array(array('value' => $value));\n }\n\n if ($enum) {\n $data['values'][0]['enum'] = $enum;\n }\n\n return $data;\n}", "public static function array(): Type\n {\n return new Type(null, 'array');\n }", "private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }", "public static function arrayWithObjects()\n {\n return new RsoArray(func_get_args());\n }", "public function fromArray(array $arrayData);", "function fields( $array ) {\n\t\t$this->fields_list = $array;\n\t\t}", "private function constructCustomField(Request $request)\n {\n $customField = [\n \"tenant_id\" => $this->requester->getTenantId(),\n \"company_id\" => $this->requester->getCompanyId(),\n \"name\" => $request->name,\n \"lov_cusmod\" => $request->lovCusmod,\n \"field_name\" => $request->fieldName,\n \"lov_cdtype\" => $request->lovCdtype,\n \"lov_type_code\" => $request->lovTypeCode,\n \"is_active\" => $request->isActive\n ];\n return $customField;\n }", "public function createFromArray(string $class, array $data);", "public function construct_value_array() {\r\n\t\t$fields = array(\r\n\t\t\t'Amount' => $this->cart_data['total_price'] * 100,\r\n\t\t\t'CurrencyCode' => $this->get_currency_iso_code( $this->cart_data['store_currency'] ),\r\n\t\t\t'OrderID' => $this->purchase_id,\r\n\t\t\t'TransactionType' => 'SALE',\r\n\t\t\t'TransactionDateTime' => date( 'Y-m-d H:i:s P' ),\r\n\t\t\t'CallbackURL' => add_query_arg( 'gateway', 'paymentsense', $this->cart_data['notification_url'] ),\r\n\t\t\t'OrderDescription' => 'Order ID: ' . $this->purchase_id . ' - ' . $this->cart_data['session_id'],\r\n\t\t\t'CustomerName' => $this->cart_data['billing_address']['first_name'] . ' ' . $this->cart_data['billing_address']['last_name'],\r\n\t\t\t'Address1' => trim( implode( '&#10;', explode( \"\\n\\r\", $this->cart_data['billing_address']['address'] ) ), '&#10;' ),\r\n\t\t\t'Address2' => '',\r\n\t\t\t'Address3' => '',\r\n\t\t\t'Address4' => '',\r\n\t\t\t'City' => $this->cart_data['billing_address']['city'],\r\n\t\t\t'State' => $this->cart_data['billing_address']['state'],\r\n\t\t\t'PostCode' => $this->cart_data['billing_address']['post_code'],\r\n\t\t\t'CountryCode' => $this->get_country_iso_code( $this->cart_data['billing_address']['country'] ),\r\n\t\t\t'EmailAddress' => $this->cart_data['email_address'],\r\n\t\t\t'PhoneNumber' => $this->cart_data['billing_address']['phone'],\r\n\t\t\t'EmailAddressEditable' => 'true',\r\n\t\t\t'PhoneNumberEditable' => 'true',\r\n\t\t\t'CV2Mandatory' => 'true',\r\n\t\t\t'Address1Mandatory' => 'true',\r\n\t\t\t'CityMandatory' => 'true',\r\n\t\t\t'PostCodeMandatory' => 'true',\r\n\t\t\t'StateMandatory' => 'true',\r\n\t\t\t'CountryMandatory' => 'true',\r\n\t\t\t'ResultDeliveryMethod' => 'POST',\r\n\t\t\t'ServerResultURL' => '',\r\n\t\t\t'PaymentFormDisplaysResult' => 'false',\r\n\t\t);\r\n\r\n\t\t$data = 'MerchantID=' . get_option( 'paymentsense_id' );\r\n\t\t$data .= '&Password=' . get_option( 'paymentsense_password' );\r\n\r\n\t\tforeach ( $fields as $key => $value ) {\r\n\t\t\t$data .= '&' . $key . '=' . $value;\r\n\t\t};\r\n\r\n\t\t$additional_fields = array(\r\n\t\t\t'HashDigest' => $this->calculate_hash_digest( $data, 'SHA1', get_option( 'paymentsense_preshared_key' ) ),\r\n\t\t\t'MerchantID' => get_option( 'paymentsense_id' ),\r\n\t\t);\r\n\r\n\t\t$this->request_data = array_merge( $additional_fields, $fields );\r\n\t}", "private function build_attributes_object( $array ) {\n $attributes = [ ];\n\n foreach ( $array as $name => $value ) {\n $attributes[] = [\n 'name' => $name,\n 'value' => $value,\n ];\n }\n\n return $attributes;\n }", "public function aArray() {}", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "public function create($array) {\n \n }", "public function __construct(array $array = array()) {\n\t\tif(count($array)) {\n\t\t\t$this->_obj = &$array;\n\t\t}\n\t}", "public static function fromArray(array $data);", "public function create($array) {\n }", "public function initFromArray(array $o)\n {\n if (isset($o['originalLabel'])) {\n $this->originalLabel = $o[\"originalLabel\"];\n unset($o[\"originalLabel\"]);\n }\n $this->description = array();\n if (isset($o['description'])) {\n foreach ($o['description'] as $i => $x) {\n $this->description[$i] = new TextValue($x);\n }\n unset($o[\"description\"]);\n }\n $this->values = array();\n if (isset($o['values'])) {\n foreach ($o['values'] as $i => $x) {\n $this->values[$i] = new FieldValueDescriptor($x);\n }\n unset($o[\"values\"]);\n }\n parent::initFromArray($o);\n }", "public function fromArray(array $data);", "public function fromArray(array $data);", "function __construct($array = null) {\n\t\tparent::__construct(is_array($array) || is_object($array)?$array:array());\n\t}", "public function getFieldsArray($create = false) {}", "public function initWithObjects()\n {\n $this->array = func_get_args();\n return $this;\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "public function create(array $input)\n {\n }", "function __constructor() {\n $arr = array();\n }", "public function build(): array;", "public function build(): array;", "public function initFromArray($o) {\n }", "function field($fieldarray, $dbconnname)\n\t{\n\t\tglobal $$dbconnname;\n\t\t$this->dbconnname = $dbconnname;\n\t\t$this->name = $fieldarray[\"name\"];\n\t\t$this->type = $fieldarray[\"type\"];\n\n\t\tif (strstr($fieldarray[\"flags\"], \"auto_increment\") || (strstr($fieldarray[\"flags\"], \"seq\")))\n\t\t\t\t$this->autoincrement = 1;\n\t\tif (strstr($fieldarray[\"flags\"], \"primary_key\"))\n\t\t\t\t$this->key = 1;\n\t}", "public function __construct(Array $data)\n {\n //\n $this->_data = $data;\n }", "public static function fromArray(array $array): self\n {\n $fluentArray = new static();\n\n foreach ($array as $key => $value) {\n $fluentArray->set($key, $value);\n }\n\n return $fluentArray;\n }", "public static function makeFromArray(array $data)\r\n {\r\n }", "public static function makeFromArray(array $data)\r\n {\r\n }", "public static function makeFromArray(array $data)\r\n {\r\n }", "public static function makeFromArray(array $data)\r\n {\r\n }", "public static function makeFromArray(array $data)\r\n {\r\n }", "public function AsArray();", "public function maker(): array;", "public function __construct(array $array)\n {\n parent::__construct($array);\n }", "public function setInput(array $input)\n {\n $this->_input = new ExtArray($input);\n\n return $this;\n }", "public function __construct($array)\n\t{\n\t\tif (is_array($array))\n\t\t{\n\t\t $this->var = $array;\n\t\t}//end if\n\t}", "public function makeNew() {\n\t\t$class = get_class($this);\n\t\t$newArray = $this->wire(new $class($this->parent, $this->field));\n\t\treturn $newArray;\n\t}", "function createRecord($array){\n parent::createRecord($array);\n }", "public static function arrayWithArray($array = array())\n {\n return new RsoArray($array);\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function __construct(array $input)\n {\n //\n $this->input = $input;\n }", "public function __construct(array $array)\n\t{\n\t\tparent::__construct($array, ArrayObject::ARRAY_AS_PROPS | ArrayObject::STD_PROP_LIST);\n\t}", "public static function createFromArray($name, array $data = [])\n {\n $type = parent::createFromArray($name, $data);\n \\assert($type instanceof self);\n\n return $type;\n }", "public function fieldCreate()\n\t{\n\t\t$fields=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$fields[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'max_length'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'type'=>preg_match('/text/',$row['Type']) ? 'Area' : 'Field',\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? true : false,\n\t\t\t\t\t'input'=>preg_match('/^(password|pass|passwd|passcode)$/i',$row['Field']) ? 'password' : 'text',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "public function testConstructorArray()\n {\n $data = ['foo' => 1, 'bar' => 2];\n $document = new Document($data);\n $this->assertSame($data, $document->toArray());\n }", "public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n $this->$key = $value; \n }\n \n //return $this;\n }", "public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS){\r\n parent::__construct($array, $flags);\r\n }", "public function __construct($array)\n {\n if ($array !== null) {\n foreach ($array as $key => $value) {\n $this->$key = $value;\n }\n }\n }", "function field(array $data)\n{\n return new FilippoToso\\LaravelHelpers\\UI\\Field($data);\n}", "public static function createFromArray(array $data)\n {\n return new self($data);\n }", "private function buildFieldByAttribute(Reflector $ref, string $attributeClass): array\n {\n return array_map(\n // Create meta field\n fn(AbstractFieldAttribute $field) => new Field($field, $ref),\n\n // Find and convert reflection attribute to attribute instance.\n array_map(\n fn($attr) => $attr->newInstance(),\n $ref->getAttributes($attributeClass, ReflectionAttribute::IS_INSTANCEOF)\n ),\n );\n }", "public function __construct($array)\n {\n foreach ($array as $elem) {\n $this->insert($elem);\n }\n }", "public function __construct( array $aFields )\n\t{\n\t\tparent::__construct(null);\n\t\t\n\t\tforeach ($aFields as $value)\n\t\t{\n\t\t\t$this->fields[] = $value;\n\t\t}\n\t}", "protected function _customerFromArray($arr)\n\t{\n\t\t$Customer = new QuickBooks_Object_Customer();\n\t\t\n\t\t\t// Array Key => array( Method, QuickBooks Field for Cast ), \n\t\t$map = array(\n\t\t\t'Name' => \t\t\tarray( 'setName', 'Name' ), \n\t\t\t'FirstName' => \t\tarray( 'setFirstName', 'FirstName' ),\n\t\t\t'MiddleName' => \tarray( 'setMiddleName', 'MiddleName' ),\n\t\t\t'LastName' => \t\tarray( 'setLastName', 'LastName' ), \n\t\t\t'CompanyName' => \tarray( 'setCompanyName', 'CompanyName' ), \n\t\t\t'Phone' => \t\t\tarray( 'setPhone', 'Phone' ), \n\t\t\t'AltPhone' => \t\tarray( 'setAltPhone', 'AltPhone' ), \n\t\t\t'Email' => \t\t\tarray( 'setEmail', 'Email' ), \n\t\t\t'Contact' => \t\tarray( 'setContact', 'Contact' ), \n\t\t\t);\n\t\t\n\t\t$this->_applyBaseMap($arr, $map, $Customer, QUICKBOOKS_OBJECT_CUSTOMER);\n\n\t\t$map2 = array( \n\t\t\t'ShipAddress_' => 'setShipAddress', \n\t\t\t'BillAddress_' => 'setBillAddress', \n\t\t\t);\n\t\t\n\t\t$this->_applyAddressMap($arr, $map2, $Customer, QUICKBOOKS_OBJECT_CUSTOMER);\n\t\t\n\t\treturn $Customer;\n\t}", "function __construct($array = []) {\n $this->array = $array;\n $this->setCalculate();\n }", "public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $fieldData) {\n\t\t\t$field = new Field();\n\t\t\t$field->setProperties($fieldData);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}", "public function __construct(array $data = [])\n {\n return $this->setAttributesArray($data);\n }", "function __construct( $field = array(), $value = '') {\n\n $this->field = $field;\n $this->value = $value;\n\n $defaults = array(\n 'heading' => 0,\n 'pitch' => 0,\n 'zoom' => 0,\n );\n\n $this->value = wp_parse_args( $this->value, $defaults );\n\n /*\n Array ( \n [id] => webbupointfinder_item_streetview \n [type] => extension_streetview \n [class] => \n [name] => pointfinderthemefmb_options[webbupointfinder_item_streetview] \n [name_suffix] => )\n */\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function makeFieldList() {}", "public function getAsArray(): array {\n\t\t$result = [];\n\t\tforeach ( self::FIELD_MAPPING as $field => $_ ) {\n\t\t\t$result[$field] = $this->$field;\n\t\t}\n\t\treturn $result;\n\t}", "public function __construct(public array $data)\n {\n }", "public function __construct($value = [])\n {\n parent::__construct();\n\n if ($value instanceof ArrayObject) {\n $value = $value->getArrayCopy();\n }\n\n $this->value = $value;\n $this->size = count($value);\n }", "public function customFieldValues()\n {\n return $this->morphMany(\\VentureDrake\\LaravelCrm\\Models\\FieldValue::class, 'custom_field_valueable');\n }", "private function get_object_array($array){\n \n }", "function __construct ($arrDetails)\n\t\t{\n\t\t\tparent::__construct ('Field');\n\t\t\t\n\t\t\t$this->Push (new dataInteger\t('Id',\t\t\t$arrDetails ['Id']));\n\t\t\t$this->Push (new dataString\t\t('Entity',\t\t$arrDetails ['Entity']));\n\t\t\t$this->Push (new dataString\t\t('Field',\t\t$arrDetails ['Field']));\n\t\t\t$this->Push (new dataString\t\t('Label',\t\t$arrDetails ['Label']));\n\t\t\t$this->Push (new dataString\t\t('Title',\t\t$arrDetails ['Title']));\n\t\t\t$this->Push (new dataString\t\t('Description',\tnl2br ($arrDetails ['Description'])));\n\t\t}", "public function __construct($input) {\n $this->inputarray = $input;\n $this->position = 0;\n \n }", "abstract public function init(array $input);", "public static function instance(array $array) : Arr {\n return new Arr($array);\n }", "public function __construct(array $arr)\n {\n $this->data = $arr;\n }", "public function __construct(array $array = [])\n {\n $this->fillFromArray($array);\n }", "function acf_array($val = array())\n{\n}", "public function arrayToObject($array): static;", "public function convertItemArray() {}", "function nkf_base_rows_from_field_collection(&$vars, $field_array) {\n $vars['rows'] = array();\n foreach($vars['element']['#items'] as $key => $item) {\n $entity_id = $item['value'];\n $entity = field_collection_item_load($entity_id);\n $wrapper = entity_metadata_wrapper('field_collection_item', $entity);\n $row = array();\n foreach($field_array as $field) {\n $info = $wrapper->$field->info();\n $type = $info['type'];\n $field_value = $wrapper->$field->value();\n switch ($type) {\n case 'text_formatted':\n $value = $wrapper->$field->value->value();\n break;\n case 'field_item_image':\n if (isset($field_value)) {\n $build = array(\n '#theme' => 'image',\n '#path' => $field_value['uri'],\n '#url' => nkf_base_image_url($field_value['uri'], 'large'),\n '#alt' => $field_value['alt'],\n '#title' => $field_value['title'],\n //'#width' => $field_value['width'],\n //'#height' => $field_value['height'],\n );\n $value = $build;\n } else {\n $value = null;\n }\n break;\n default:\n $value = isset($field_value) ? $wrapper->$field->value() : null;\n\n }\n $row[$field] = $value;\n }\n $vars['rows'][] = $row;\n }\n}", "public function toArray()\n\t {\n\t $claseArray = get_object_vars($this);\n\t foreach ($this->fields as $key => $value) {\n\t $this->fields[$key] = $claseArray[lcfirst($value)];\n\t}\n\treturn $this->fields;\n\t }", "public function toArray()\n\t {\n\t $claseArray = get_object_vars($this);\n\t foreach ($this->fields as $key => $value) {\n\t $this->fields[$key] = $claseArray[lcfirst($value)];\n\t}\n\treturn $this->fields;\n\t }", "public function __construct(array &$array = [])\n {\n $this->array = &$array;\n }", "public abstract function createFields();" ]
[ "0.6178719", "0.5883322", "0.5875897", "0.58502865", "0.57964563", "0.57338226", "0.5681182", "0.5660524", "0.56229377", "0.5594005", "0.5590535", "0.5561047", "0.5545277", "0.5535634", "0.553441", "0.5520347", "0.5518559", "0.55078334", "0.54923826", "0.54914826", "0.54782736", "0.5470748", "0.54643095", "0.5461973", "0.5459478", "0.5457719", "0.5451278", "0.5451164", "0.5450761", "0.5450761", "0.543152", "0.54134417", "0.53972644", "0.53971577", "0.5383502", "0.538172", "0.53804576", "0.53804576", "0.5366135", "0.5363639", "0.53256714", "0.5325537", "0.5323474", "0.5323474", "0.5323474", "0.5323474", "0.5323474", "0.53219193", "0.53197485", "0.531149", "0.53062665", "0.53033525", "0.530053", "0.530013", "0.5296625", "0.52941895", "0.52941895", "0.52941895", "0.52941895", "0.52941895", "0.52941895", "0.5290201", "0.5284761", "0.52750653", "0.5272915", "0.52723163", "0.5254661", "0.5253254", "0.5248927", "0.52259827", "0.5219401", "0.5191627", "0.51912135", "0.51817876", "0.5178245", "0.5177488", "0.51642287", "0.5160832", "0.5158498", "0.5157553", "0.51573545", "0.51550376", "0.5152682", "0.5152212", "0.51512843", "0.5149675", "0.5149073", "0.5146959", "0.5140082", "0.5137836", "0.5136818", "0.51363355", "0.51304644", "0.51295406", "0.51259637", "0.51256746", "0.51244193", "0.51244193", "0.51227957", "0.51227415" ]
0.5611097
9
Connects the current user if he is logged with one of the social networks defined in main firewall.
public function connect(UserInterface $user, UserResponseInterface $response) { $property = $this->getProperty($response); $username = $response->getUsername(); //on connect - get the access token and the user ID $service = $response->getResourceOwner()->getName(); $setter = 'set' . ucfirst($service); $setterId = $setter . 'Id'; //we "disconnect" previously connected users if (null !== $previousUser = $this->userManager->findUserBy(array($property => $username))) { $previousUser->$setterId(null); $this->userManager->updateUser($previousUser); } //we connect current user $user->$setterId($username); $this->userManager->updateUser($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect($network) {\n \n // Load plan features\n $limit_accounts = $this->plans->get_plan_features($this->user_id, 'network_accounts');\n \n // Get all accounts connected for social network\n $allaccounts = $this->networks->get_all_accounts($this->user_id, $network);\n \n if ( !$allaccounts ) {\n $allaccounts = array();\n }\n \n if ( $limit_accounts <= count($allaccounts) && !$this->input->get('account', TRUE) ) {\n \n // Display the error message\n echo $this->ecl('Social_login_connect')->view($this->lang->line('social_connector'), '<p class=\"alert alert-error\">' . $this->lang->line('reached_maximum_number_allowed_accounts') . '</p>', false);\n exit();\n \n }\n \n // Connects user to his social account\n $this->check_session($this->user_role, 0);\n require_once APPPATH . 'interfaces/Autopost.php';\n \n if ( file_exists(APPPATH . 'autopost/' . ucfirst($network) . '.php') ) {\n \n require_once APPPATH . 'autopost/' . ucfirst($network) . '.php';\n \n $get = new $network;\n \n $get->connect();\n \n } else {\n \n display_mess(47);\n \n }\n \n }", "abstract protected function connected($user);", "abstract protected function connected($user);", "public function socialLogin(Request $request)\n {\n if($request->has('role') && $request->get('role') == 'client'){\n\n $clientSocialProvider = ClientSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$clientSocialProvider)\n {\n //Handle user already logged and want log with facebook too\n if($request->has('user_email')){\n\n $user = Client::whereEmail($request->get('user_email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' => $request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n }\n\n if(!$request->has('user_email')){\n\n //Create client\n $user = Client::firstOrCreate([\n 'name' => $request->get('first_name'),\n 'last_name' => $request->get('last_name'),\n 'email' => $request->get('email')\n ]);\n\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $clientSocialProvider->client;\n }\n }\n\n /*\n * Handling with a admin user\n */\n if($request->has('role') && $request->get('role') == 'admin'){\n\n $userSocialProvider = UserSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n if($request->has('user_email')){\n\n $user = User::whereEmail($request->get('user_email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n }\n\n if(!$request->has('user_email')){\n\n //Create user\n $user = User::firstOrCreate([\n 'name' => $request->get('first_name'),\n 'last_name' => $request->get('last_name'),\n 'email' => $request->get('email')\n ]);\n\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n /*\n * Handling with a oracle user\n */\n if($request->has('role') && $request->get('role') == 'oracle'){\n\n $userSocialProvider = OracleSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n $user = OracleUser::whereEmail($request->get('email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n /*\n * Handling with a advertiser user\n */\n if($request->has('role') && $request->get('role') == 'advertiser'){\n\n $userSocialProvider = AdvertiserSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n $user = Advertiser::whereEmail($request->get('email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n if($user){\n //Verifies if the account belongs to the authenticated user.\n if($request->has('user_id') && $user->id != $request->get('user_id')){\n return response([\n 'status' => 'error',\n 'code' => 'ErrorGettingSocialUser',\n 'msg' => 'Facebook account already in use.'\n ], 400);\n }\n\n if ( ! $token = $this->JWTAuth->fromUser($user)) {\n throw new AuthorizationException;\n }\n\n return response([\n 'status' => 'success',\n 'msg' => 'Successfully logged in via Facebook.',\n 'access_token' => $token,\n 'user' => $user->load('socialProviders')\n ])->header('Authorization','Bearer '. $token);;\n }\n\n\n return response([\n 'status' => 'error',\n 'code' => 'ErrorGettingSocialUser',\n 'msg' => 'Unable to authenticate with Facebook.'\n ], 403);\n }", "function loginRadiusConnect()\n{\n\t//create object of social login class.\n\t$module = new sociallogin();\n\tinclude_once('LoginRadiusSDK.php');\n\t$secret = trim(Configuration::get('API_SECRET'));\n\t$lr_obj = new LoginRadius();\n\t//Get the user_profile of authenticate user.\n\t$user_profile = $lr_obj->loginRadiusGetData($secret);\n\t//If user is not logged in and user is authenticated then handle login functionality.\n\tif ($lr_obj->is_authenticated == true && !Context:: getContext()->customer->isLogged())\n\t{\n\t\t$lrdata = loginRadiusMappingProfileData($user_profile);\n\t\t//Check Social provider id is already exist.\n\t\t$social_id_exist = 'SELECT * FROM '.pSQL(_DB_PREFIX_.'sociallogin').' as sl INNER JOIN '.pSQL(_DB_PREFIX_.'customer').\" as c\n\t\tWHERE sl.provider_id='\".pSQL($lrdata['id']).\"' and c.id_customer=sl.id_customer LIMIT 0,1\";\n\t\t$db_obj = Db::getInstance()->ExecuteS($social_id_exist);\n\t\t$td_user = '';\n\t\t$user_id_exist = (!empty($db_obj[0]['id_customer']) ? $db_obj[0]['id_customer'] : '');\n\t\tif ($user_id_exist >= 1)\n\t\t{\n\t\t\t$active_user = (!empty($db_obj['0']['active']) ? $db_obj['0']['active'] : '');\n\t\t\t//Verify user and provide login.\n\t\t\tloginRadiusVerifiedUserLogin($user_id_exist, $lrdata, $td_user);\n\t\t}\n\t\t//If Social provider is is not exist in database.\n\t\telseif ($user_id_exist < 1)\n\t\t{\n\t\t\tif (!empty($lrdata['email']))\n\t\t\t{\n\t\t\t\t// check email address is exist in database if email is retrieved from Social network.\n\t\t\t\t$user_email_exist = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_.'customer').' as c\n\t\t\t\tWHERE c.email=\"'.pSQL($lrdata['email']).'\" LIMIT 0,1');\n\t\t\t\t$user_id = (!empty($user_email_exist['0']['id_customer']) ? $user_email_exist['0']['id_customer'] : '');\n\t\t\t\t$active_user = (!empty($user_email_exist['0']['active']) ? $user_email_exist['0']['active'] : '');\n\t\t\t\tif ($user_id >= 1)\n\t\t\t\t{\n\t\t\t\t\t$td_user = 'yes';\n\t\t\t\t\tif (deletedUser($user_email_exist))\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = \"<p style ='color:red;'>\".$module->l('Authentication failed.', 'sociallogin_functions').'</p>';\n\t\t\t\t\t\tpopupVerify($msg);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (Configuration::get('ACC_MAP') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tbl = pSQL(_DB_PREFIX_.'sociallogin');\n\t\t\t\t\t\t$query = \"INSERT into $tbl (`id_customer`,`provider_id`,`Provider_name`,`verified`,`rand`)\n\t\t\t\t\t\tvalues ('\".$user_id.\"','\".pSQL($lrdata['id']).\"' , '\".pSQL($lrdata['provider']).\"','1','') \";\n\t\t\t\t\t\tDb::getInstance()->Execute($query);\n\t\t\t\t\t}\n\t\t\t\t\tloginRadiusVerifiedUserLogin($user_id, $lrdata, $td_user);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lrdata['send_verification_email'] = 'no';\n\t\t\t//new user. user not found in database. set all details\n\t\t\tif (Configuration::get('user_require_field') == '1')\n\t\t\t{\n\t\t\t\tif (empty($lrdata['email']))\n\t\t\t\t\t$lrdata['send_verification_email'] = 'yes';\n\t\t\t\tif (Configuration::get('EMAIL_REQ') == '1' && empty($lrdata['email']))\n\t\t\t\t{\n\t\t\t\t\t$lrdata['email'] = emailRand($lrdata);\n\t\t\t\t\t$lrdata['send_verification_email'] = 'no';\n\t\t\t\t}\n\t\t\t\t//If user is not exist and then add all lrdata into cookie.\n\t\t\t\tstoreInCookie($lrdata);\n\t\t\t\t//Open the popup to get require fields.\n\t\t\t\t$value = popUpWindow('', $lrdata);\n\t\t\t\tif ($value == 'noshowpopup')\n\t\t\t\t\tstoreAndLogin($lrdata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//Save data into cookie and open email popup.\n\t\t\tif (Configuration::get('EMAIL_REQ') == '0' && empty($lrdata['email']))\n\t\t\t{\n\t\t\t\t$lrdata['send_verification_email'] = 'yes';\n\t\t\t\tstoreInCookie($lrdata);\n\t\t\t\tpopUpWindow('', $lrdata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telseif (Configuration::get('EMAIL_REQ') == '1' && empty($lrdata['email']))\n\t\t\t\t$lrdata['email'] = emailRand($lrdata);\n\t\t\t//Store user data into database and provide login functionality.\n\t\t\tstoreAndLogin($lrdata);\n\t\t}\n\t\t//If user is delete and set action to provide no login to user.\n\t\telseif (deletedUser($db_obj))\n\t\t{\n\t\t\t$msg = \"<p style ='color:red;'><b>\".$module->l('Authentication failed.', 'sociallogin_functions').'</b></p>';\n\t\t\tpopupVerify($msg);\n\t\t\treturn;\n\t\t}\n\t\t//If user is blocked.\n\t\tif ($active_user == 0)\n\t\t{\n\t\t\t$msg = \"<p style ='color:red;'><b>\".$module->l('User has been disbled or blocked.', 'sociallogin_functions').'</b></p>';\n\t\t\tpopupVerify($msg);\n\t\t\treturn;\n\t\t}\n\t}\n}", "function userConnect(){\r\n if (isset($_SESSION['user'])) {\r\n return TRUE;\r\n }else{\r\n return FALSE;\r\n }\r\n // if(isset($_SESSION['user'])) return TRUE; else return FALSE;\r\n }", "protected function connected($user)\n\t{\n\t}", "private function parseNetworks($objUser) {\n global $_ARRAYLANG;\n\n $availableProviders = \\Cx\\Lib\\SocialLogin::getProviders();\n foreach ($availableProviders as $index => $provider) {\n if (!$provider->isActive()) {\n unset($availableProviders[$index]);\n }\n }\n $userNetworks = $objUser->getNetworks()->getNetworksAsArray();\n\n $this->_objTpl->setGlobalVariable(array(\n 'TXT_ACCESS_SOCIALLOGIN_PROVIDER' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_PROVIDER'],\n 'TXT_ACCESS_SOCIALLOGIN_STATE' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_STATE'],\n ));\n\n // get current url for redirect parameter\n $currentUrl = clone \\Env::get('Resolver')->getUrl();\n\n if (!$this->_objTpl->blockExists('access_sociallogin_provider')) {\n return null;\n }\n\n // parse the connect buttons\n foreach ($availableProviders as $providerName => $providerSettings) {\n if (empty($userNetworks[$providerName])) {\n $state = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_DISCONNECTED'];\n $class = 'disconnected';\n $uri = contrexx_raw2xhtml(\n \\Cx\\Lib\\SocialLogin::getLoginUrl($providerName,\n base64_encode($currentUrl->__toString())\n )\n );\n $uriAction = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_CONNECT'];\n } else {\n $state = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_CONNECTED'];\n $class = 'connected';\n $disconnectUrl = clone \\Env::get('Resolver')->getUrl();\n $disconnectUrl->setParam('act', 'disconnect');\n $disconnectUrl->setParam('provider', $providerName);\n $uri = $disconnectUrl->__toString();\n $uriAction = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_DISCONNECT'];\n }\n\n $this->_objTpl->setVariable(array(\n 'ACCESS_SOCIALLOGIN_PROVIDER_NAME_UPPER' => contrexx_raw2xhtml(ucfirst($providerName)),\n 'ACCESS_SOCIALLOGIN_PROVIDER_STATE' => $state,\n 'ACCESS_SOCIALLOGIN_PROVIDER_STATE_CLASS'=> $class,\n 'ACCESS_SOCIALLOGIN_PROVIDER_NAME' => contrexx_raw2xhtml($providerName),\n 'ACCESS_SOCIALLOGIN_URL' => $uri,\n 'ACCESS_SOCIALLOGIN_URL_ACTION' => $uriAction,\n ));\n\n if ($class == 'disconnected') {\n $this->_objTpl->parse('access_sociallogin_provider_disconnected');\n $this->_objTpl->hideBlock('access_sociallogin_provider_connected');\n } else {\n $this->_objTpl->parse('access_sociallogin_provider_connected');\n $this->_objTpl->hideBlock('access_sociallogin_provider_disconnected');\n }\n\n $this->_objTpl->parse('access_sociallogin_provider');\n }\n }", "protected function connecting($user) {\n // Override to handle a connecting user, after the instance of the User is created, but before\n // the handshake has completed.\n }", "function manageConnect($data){\n\t$login = secure($data['login']);\n\t$pwd = secure($data['pwd']);\n\t\t\n\t//verify characters\n\t$test= checkChar($login);\n\tif(!$test){\n\t\t//trying to connect the user\n\t\t$connected= connect($login, $pwd);\n\t\t\t\n\t\tif($connected){\n\t\t\tredirect(\"home\");\t\n\t\t}else{\n\t\t\tredirect(\"login\", \"&callback=DATA_ERROR\");\n\t\t}\n\t}\n\telse{\n\t\tredirect(\"login\", \"&callback=\".$test);\n\t}\n}", "function b2c_has_social_login() {\n\treturn ! empty( b2c_get_current_user_auth_provider() );\n}", "public function connect($user)\n {\n $admin = $this->getUsersModel()->getRole($user['email']);\n if($admin == 2)\n {\n $this->getSession()->write('prof', true);\n $this->getSession()->write('admin', false);\n }\n elseif ($admin == 3)\n {\n $this->getSession()->write('admin', true);\n $this->getSession()->write('prof', false);\n }\n else\n {\n $this->getSession()->write('prof', false);\n $this->getSession()->write('admin', false);\n }\n $this->session->write('auth', $user['email']);\n $this->session->write('id_user', $user['id_user']);\n }", "protected function isConnect()\n {\n if($_SESSION['statut'] !== 'user' AND $_SESSION['statut'] !=='admin')\n {\n header('Location: index.php?route=front.connectionRegister&access=userDenied');\n exit;\n }\n }", "public function social_login()\n {\n \n \tif ($this->ion_auth->logged_in()) {\n \t\t$this->data['userInformation'] = $this->ion_auth->user()->row();\n \t}\n \t$this->data['loggedinuserinformation'] = $this->basic_information_of_mine($this->data['userInformation']->id);\n \t$this->data['userid'] = $this->data['userInformation']->id;\n \t\n \t$this->data[\"facebook_status\"] = $this->admin_model->getStoredHybridSession($this->data['userid'], \"Facebook\");\n \t\n \tif(!empty($this->data['facebook_status'][0])) {\n\t \tif($this->data[\"facebook_status\"] != \"0\") {\n\t \t\t$this->data[\"facebook_profile\"] = $this->get_profile(\"Facebook\");\n\t \t\t//owndebugger($this->data['facebook_profile']);\n\t \t}\n \t} else {\n \t\t$this->data[\"facebook_profile\"] = 0;\n \t}\n \t$this->data['title'] = \"Social Login\";\n \n \t$this->load->view('layouts/header', $this->data);\n \t$this->load->view('settings/social_login', $this->data);\n \t$this->load->view('layouts/footer', $this->data);\n }", "function is_user_connected_with($service){\n\tglobal $user_ID;\n\tswitch($service){\n\t\tcase 'facebook':\n\t\t\treturn (boolean) get_facebook_id($user_ID);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t}\n}", "public function connect_to_site() {\n\t\treturn false;\n\t}", "protected function connecting($user)\n\t{\n\t\t// Override to handle a connecting user, after the instance of the User is created, but before\n\t\t// the handshake has completed.\n\t}", "public function social_network(){\r\n\t\tif($this->logged_in){\r\n\t\t\t\r\n\t\t\t$networks = Kohana::config('social_network.networks');\r\n\t\t\t$save_data = $this->input->post('save_data',null);\r\n\t\t\tif($save_data){\r\n\t\t\t\tforeach($networks as $network){\r\n\t\t\t\t\t$fieldname = str_replace(\".\",\"\",$network);\r\n\t\t\t\t\t$this->user->$fieldname = $this->input->post($fieldname, null, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->user->save();\r\n\t\t\t\techo json_encode(array('msg'=>'ok', 'data'=>''));\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$view = new View('social_network');\r\n\t\t\t$view->networks = $networks;\r\n\t\t\t$view->lang = Kohana::lang('user');\r\n\t\t\t$view->user = $this->user;\r\n\t\t\r\n\t\t\t$view->render(TRUE);\r\n\t\t} else Kohana::show_404();\r\n\t}", "public function isConnected()\n {\n $oConfig = oxRegistry::getConfig();\n\n if (!$oConfig->getConfigParam(\"bl_showFbConnect\")) {\n return false;\n }\n\n if ($this->_blIsConnected !== null) {\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = false;\n $oUser = $this->getUser();\n\n if (!$oUser) {\n $this->_blIsConnected = false;\n\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = true;\n try {\n $this->api('/me');\n } catch (FacebookApiException $e) {\n $this->_blIsConnected = false;\n }\n\n return $this->_blIsConnected;\n }", "private static function linkToNet()\n\t{\n\t\tif(!Loader::includeModule('socialservices'))\n\t\t\treturn false;\n\n\t\tif(self::isLinkedToNet())\n\t\t\treturn true;\n\n\t\t$result = false;\n\t\t$request = \\Bitrix\\Main\\Context::getCurrent()->getRequest();\n\t\t$host = ($request->isHttps() ? 'https://' : 'http://').$request->getHttpHost();\n\t\t$registerResult = \\CSocServBitrix24Net::registerSite($host);\n\n\t\tif(is_array($registerResult) && isset($registerResult[\"client_id\"]) && isset($registerResult[\"client_secret\"]))\n\t\t{\n\t\t\tOption::set('socialservices', 'bitrix24net_domain', $host);\n\t\t\tOption::set('socialservices', 'bitrix24net_id', $registerResult[\"client_id\"]);\n\t\t\tOption::set('socialservices', 'bitrix24net_secret', $registerResult[\"client_secret\"]);\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function connect($user){\n $this->session->set('auth',$user);\n }", "public function showFbConnectToAccountMsg()\n {\n if ($this->getConfig()->getRequestParameter(\"fblogin\")) {\n if (!$this->getUser() || ($this->getUser() && $this->getSession()->getVariable('_blFbUserIdUpdated'))) {\n return true;\n } else {\n return false;\n }\n }\n\n return false;\n }", "static function momentConnect()\r\n {\r\n $user = self::getCurrentUser();\r\n\r\n if ($user !== NULL)\r\n {\r\n $user->setOffline(0);\r\n self::updateUser($user);\r\n }\r\n }", "public function isConnected()\n\t{\n\t\treturn $this->isUser() || $this->isOrga();\n\t}", "abstract protected function isSocialUser($type);", "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 loginExistingUser() {\n\n // Check whether remote account with requested email exists:\n try {\n $this->sso = dosomething_canada_get_sso();\n\n if ($this->sso->authenticate($this->email, $this->password)) {\n $this->remote_account = $this->sso->getRemoteUser();\n }\n }\n catch (Exception $e) {\n\n // The only users that exist locally but not remotely should be admin\n // accounts that were created before SSO integration. These should be\n // created remotely as well.\n $this->sso->propagateLocalUser(\n $this->email,\n $this->password,\n dosomething_canada_create_sso_user($this->email, $this->password, $this->local_account)\n );\n }\n return TRUE;\n }", "public function usingSocialAccount()\n {\n return ( ! is_null($this->provider) && ! is_null($this->provider_id) ) ? true : false;\n }", "public function isConnected()\n\t{\n\t\t// TODO: Make this check the login functionality or something..!!\n\t\treturn true;\n\t}", "public function InitOtherUser()\n {\n $login = trim( strip_tags( _v('login', '') ) );\n //if link has login\n if ($login)\n {\n if ($this->IsAuth() && $login==$this->mUserInfo['Name'])\n {\n //show current user profile\n $this->mOtherUserId = 0;\n return false; \n }\n else\n {\n $this->mOtherUserInfo = UserQuery::create()\n ->Select(array('Id', 'Email', 'Status', 'Pass', 'LastReload', 'FirstName', 'LastName', 'Name', 'Blocked', 'BlockReason', 'Country',\n 'Avatar', 'Location', 'HideLoc', 'About', 'BandName', 'Likes', 'Dob', 'Gender', 'YearsActive', 'Genres', 'Members', 'Website', 'Bio', 'RecordLabel', 'RecordLabelLink', 'UserPhone', 'State', 'HashTag', 'FbOn', 'TwOn', 'InOn'))\n ->where('LOWER(Name) = \"' . ToLower( $login ) . '\"')\n\t\t\t\t\t->filterByEmailConfirmed(1)\n\t\t\t\t\t->filterByBlocked(0)\n ->filterByStatus(1, '>=')->findOne();\n\n if (!empty($this->mOtherUserInfo)) \n {\n $this->mOtherUserId = $this->mOtherUserInfo['Id'];\n\n\t\t\t\t\t$genres_list = User::GetGenresList();\n\t\t\t\t\t\n\t\t\t\t\t$genresListArr = explode(',',$this->mOtherUserInfo['Genres']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tforeach($genresListArr as $key=> $val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$userGenres .= $genres_list[$val].'/';\n\t\t\t\t\t}\n\t\t\t\t\t$this->mOtherUserInfo['GenresList'] = trim($userGenres, '/');\t\n\n\t\t\t\t//Fellow count\n\t\t\t\t$this->mOtherUserInfo['FollowersCount'] = UserFollow::GetFollowersUserListCount($this->mOtherUserInfo['Id'], USER_FAN);\n\t\t\t\t\n\t\t\t\t$memTrack = unserialize($this->mOtherUserInfo['Members']);\t\t\t\n\t\t\t\t$this->mOtherUserInfo['Members'] = $memTrack[0];\n\t\t\t\t$this->mOtherUserInfo['Tracks'] = $memTrack[1];\n\n\t\t\t\t\t\t\t\t\t\t\n } else {\n\t\t\t\t\t$this->mOtherUserId = -1;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n return true;\n }\n }\n }", "public function isConnected()\n {\n return !is_null($this->user);\n }", "public function isConnected()\n {\n if ($this->connect) {\n return $this->connect;\n }\n if (!empty($_SESSION[ 'token_connected' ])) {\n if (!($user = $this->getUserActivedToken($_SESSION[ 'token_connected' ]))) {\n return false;\n }\n\n $this->connect = $_SESSION[ 'token_connected' ] == $user['token_connected']\n ? $user\n : false;\n\n return $this->connect;\n }\n\n return false;\n }", "public static function isConnected() {\n return isset($_SESSION['userid']);\n }", "function login_init() {\n\n\t\t\t$current_user_id = get_current_user_id();\n\n\t\t\tif ( $current_user_id ) {\n\n\t\t\t\t$is_merge = false;\n\t\t\t\tif ( isset( $_REQUEST[\"isMerge\"] ) && $current_user_id !== null ) {\n\t\t\t\t\tif ( $_REQUEST[\"isMerge\"] === 1 || $_REQUEST[\"isMerge\"] === '1' ) {\n\t\t\t\t\t\t$is_merge = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$linkid_user_id = get_user_meta( $current_user_id, self::WP_USER_META_VALUE_LINKID_USER_ID, true );\n\n\t\t\t\tif ( $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start merging. Logged in user already linked to linkID account\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t} else if ( ! $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start login. User already logged in. Please wait while you are being redirected.\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse, false, true, $this->get_redirect_url( wp_get_current_user() ) ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$linkIDAuthnSession = Link_WP_LinkID::start_authn_request();\n\n\t\t\t// generate the response\n\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromAuthnSession( $linkIDAuthnSession ) );\n\n\t\t\t// response output\n\t\t\theader( \"Content-Type: application/json\" );\n\t\t\techo $response;\n\n\t\t\tdie();\n\t\t}", "public function handleProviderCallback()\n {\n $userProvider = Socialite::driver('google')->user();\n\n $name = $userProvider->getName();\n\n $email = $userProvider->getEmail();\n\n $providerId = $userProvider->getId();\n\n $socialLogin = SocialLogin::whereProviderId($providerId)->first();\n \n if ($socialLogin) {\n $user = User::whereId($socialLogin->user_id)->first();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (!$socialLogin) {\n $user = User::whereEmail($email)->first();\n\n if (!$user) {\n $user = new User();\n $user->name = $name;\n $user->email = $email;\n $user->password = bcrypt(md5(str_random(16)));\n $user->active = true;\n $user->save();\n $confirmationToken = str_random(31) . $user->id;\n $user->confirmation_token = $confirmationToken;\n $user->save();\n\n $this->profileRepository->createProfile($user);\n \n $this->wishListRepository->createWishList($user->id);\n }\n\n $sLogin = new SocialLogin();\n $sLogin->user_id = $user->id;\n $sLogin->provider_id = $providerId;\n $sLogin->provider_name = 'google';\n $sLogin->save();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }", "public function check_user_social(){\n\t\t\treturn $this->dao->check_user_social($this->db, $_POST['iduser']);\n\t\t}", "function userConnecte(){\n\tif(isset($_SESSION['membre'])){\n\t\treturn TRUE;\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "protected function isUserAllowedToLogin() {}", "public function connectUser() {\n\t\t\t$errors = array();\n\t\t\tif(!empty($_POST)) {\n\t\t\t\t$pseudo = $_POST['pseudo'];\n\t\t\t\t$password = $_POST['password'];\n\t\t\t\t$users = new Model_Users();\n\t\t\t\t$connect_user = $users->connectUsers($pseudo, $password, $errors);\n\t\t\t\tif(empty($connect_user)) {\n\t\t\t\t\t$errors['dontexist'] = \"Vous n'existez pas\";\n\t\t\t\t}\t\n\t\t\t}\n\t\t\trequire_once ($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/pages/connexion.php\");\t\n\t}", "function isUserConnected() {\n return isset($_SESSION['login']);\n}", "private function attemptLogin($user){\n\n }", "public function checksocialCustomers()\n {\n $this->setRules([ 'login_type' => 'required|in:normal,fb,google+','email' => 'required|max:100|email','token' => 'required','social_user_id' => 'required','name' => 'required' ]);\n $this->_validate();\n\n $type = ($this->request->login_type == 'fb') ? 'facebook' : (($this->request->login_type == 'google+') ? 'google' : '');\n return $this->registerSocialUser($this->request->all(), $type);\n }", "public function loginViaFacebook()\n { \n $userFB = $this->facebook->getUserFromRedirect();\n $userDB = User::where('facebook_id', $userFB->getId())->first();\n\n if (! is_null($userDB)) {\n // User already exists, check \"first time visit\" state (old)\n if ($userDB->old == 0) {\n $userDB->update(['old' => 1]);\n $userDB->save();\n }\n //Authenticate user\n Auth::loginUsingId($userDB->id);\n return redirect('/welcome');\n }\n // User not found in database, create it\n $this->createAndLoginUser($userFB);\n return redirect('/welcome');\n }", "public function connectUser () {\n\n if (!empty($_POST)) {\n // Suppresion du isset et mis du 2eme if en else if\n if (empty($_POST['login'])) {\n $_SESSION['errors']['login'] = \"Veuillez indiquez votre login ou votre adresse mail pour vous connecter.\";\n } else if (UsersClass::checkLogin($_POST['login'], true) === false) {\n $_SESSION['errors']['login'] = \"Le login ou l'adresse e-mail indiqué n'existe pas. Il se peut aussi qu'il n'est pas encore activé.\";\n } else if (empty($_POST['password'])) {\n $_SESSION['errors']['password'] = \"Veuillez indiquez votre mot de passe pour vous connecter.\";\n } else if ($this->checkPassword($_POST['password'], $_POST['login']) === false) {\n $_SESSION['errors']['password'] = \"Le mot de passe indiqué est éronné, veuillez entrer le bon mot de passe pour vous connecter.\";\n } else {\n $login = htmlentities($_POST['login']);\n $sql = \"SELECT * FROM users WHERE :login = username OR :login = email AND activated = 1\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':login', $_POST['login']);\n $query->execute();\n $result = $query->fetch();\n\n $_SESSION['auth']['id_user'] = $result['id_user'];\n header('Location: ' . URL . '/pages/users/profil.php');\n }\n }\n }", "public function external_login($provider) {\n\t\tif ($provider == User_External_Model::PROVIDER_FACEBOOK && $fb_uid = FB::instance()->get_loggedin_user()) {\n\n\t\t\t// Load the external user\n\t\t\t$user = User_Model::find_user_by_external($fb_uid, $provider);\n\n\t\t\tif ($user->loaded && $this->complete_login($user)) {\n\t\t\t\t$this->session->set($this->config['session_key'] . '_provider', $provider);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasUserConnected() {\n $accessTokenIG = get_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME );\n $accessTokenFB = get_option( self::FACEBOOK_TOKEN );\n\n return ! empty( $accessTokenIG ) || ! empty( $accessTokenFB );\n }", "function connectUser($facebook, $facebookProfil){\n $facebookId= $facebookProfil['id'];\n \n // try to find if user exist in database\n $user = User::findUserByFacebookId($facebookId);\n\n // create a user in database if not\n if ($user == null) {\n $username = $facebookProfil[\"username\"];\n $last_name = $facebookProfil[\"last_name\"];\n $first_name = $facebookProfil[\"first_name\"];\n $email = $facebookProfil[\"email\"];\n $token = $facebook->getAccessToken();\n $score = 0;\n\n $newUser = new User($facebookId, $username, $first_name, $last_name, $email, $token, $score);\n User::add($newUser);\n\n Session::getInstance()->setUserSession($newUser);\n } else {\n Session::getInstance()->setUserSession($user[0]);\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 getLogin($social){\n\t\ttry{\n\t\t\tswitch($social){\n\t\t\t\tcase 'facebook':\n\t\t\t\t\t$su = \\Social::facebook('user');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'google':\n\t\t\t\t\t$su = \\Social::google('user');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$su = null;\n\t\t\t}\n\n\t\t\tif ($su===null)\n\t\t\t\treturn \\Redirect::route('frontend.index');\n\n\t\t\t$m = \\Member::where('uid', '=', $su->id)->where('social', '=', $social)->first();\n\n\t\t\tif ($m==null){\n\t\t\t\t$m = new \\Member;\n\t\t\t\t$m->uid = $su->id;\n\t\t\t\t$m->social = $social;\n\t\t\t\t$m->name = $su->name;\n\t\t\t\t$m->email = $su->email;\n\n\t\t\t\tif ($social=='facebook'){\n\t\t\t\t\tif (isset($su->birthday))\n\t\t\t\t\t\t$m->birthday = date('Y-m-d', strtotime($su->birthday));\n\t\t\t\t\tif (isset($su->gender))\n\t\t\t\t\t\t$m->gender = substr($su->gender, 0, 1);\n\t\t\t\t}\n\t\t\t\t$m->save();\n\t\t\t}\n\n\t\t\t// register user into Auth that is a global variable\n\t\t\t\\Auth::login($m);\n\t\t\treturn \\Redirect::route('frontend.index');\n\t\t}catch(Exception $e){\n\t\t\techo $e->getMessage();\n\t\t\texit;\n\t\t}\n\t}", "public function before() {\n\t\t\n\t\t$this->session = Session::instance();\n $user_id = $this->session->get('user_id');\n\t\t\n if (!empty($user_id) ) {\n $this->user = ORM::factory('user',$user_id);\n View::bind_global('user', $this->user);\n \n\t\t} else if ($this->_auth_required) {\n\t\t\t$this->request->redirect(NON_SIGNED_IN_HOME);\n\t\t}\n\t \n\t\t$this->load_domain_channel();\n\t\t$this->load_user_channel($this->user);\n\t\t\n\t\tif ($this->user_channel == null){\n\t\t\t/* \n\t\t\tuser who doesnt have a channel can access anything \n\t\t\t*/\n\t\t\treturn;\n\t\t} else { \n\t\t\t/* \n\t\t\tUser trying to access direct domain is not allowed\n\t\t\tUser trying to access another sub domain is not allowed\n\t\t\t*/\n\t\t\t$user_domain_url = \"http://\".$this->user_domain;\n\t\t\t\n\t\t\tif($this->channel == null) {\n\t\t\t\t/* User trying to access base domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t\t\n\t\t\t} else if ($this->channel->id != $this->user_channel->id){\n\t\t\t\t/* User trying to access some other domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t} else {\n\t\t\t\t// doing the correct access leave that poor chap alone.\n\t\t\t}\n\t\t} \n\t}", "private function _check_socials_access() {\n\n return Access_token::inst()->check_socials_access($this->c_user->id);\n\n }", "public function githubRedirect(){\n $user = Socialite::driver('github')->user();\n\n // if this user does not exist, add them \n // If they do, get the model,\n // either way authenticate the user into the application and redirect afterwards\n\n Auth::login($user);\n }", "public function startCommunication()\n {\n if ($this->provider->login()) {\n $this->provider->keepAuth = true;\n }\n }", "function CheckLogin($currentUri=NULL)\r\n {\r\n $this->Rest->CheckLogin($currentUri);\r\n }", "public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }", "function connect() {\n\n\t\t// only if logins are set ...\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\n\t\t\t$this->console_text('[Aseco] Try to connect to server on {1}:{2}',\n\t\t\t\t$this->server->ip,\n\t\t\t\t$this->server->port);\n\n\t\t\t// connect to the server ...\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->console_text('[Aseco] Authenticated with username \\'{1}\\' and password \\'{2}\\'',\n\t\t\t\t$this->server->login, $this->server->pass);\n\n\t\t\t// logon the server ...\n\t\t\t$this->client->addCall('Authenticate', array($this->server->login, $this->server->pass));\n\n\t\t\t// enable callback system ...\n\t\t\t$this->client->addCall('EnableCallbacks', array(true));\n\n\t\t\t// start query ...\n\t\t\tif (!$this->client->multiquery()){\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->client->getResponse();\n\n\t\t\t// connection established ...\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\t// connection failed ...\n\t\t\treturn false;\n\t\t}\n\t}", "function playerConnect($player) {\n\n\t\t// request information about the new player\n\t\t// (removed callback mechanism here, as GetPlayerInfo occasionally\n\t\t// returns no data and then the connecting login would be lost)\n\t\t$login = $player[0];\n\t\t$this->client->query('GetDetailedPlayerInfo', $login);\n\t\t$playerd = $this->client->getResponse();\n\t\t$this->client->query('GetPlayerInfo', $login, 1);\n\t\t$player = $this->client->getResponse();\n\n\t\t// check for server\n\t\tif (isset($player['Flags']) && floor($player['Flags'] / 100000) % 10 != 0) {\n\t\t\t// register relay server\n\t\t\tif (!$this->server->isrelay && $player['Login'] != $this->server->serverlogin) {\n\t\t\t\t$this->server->relayslist[$player['Login']] = $player;\n\n\t\t\t\t// log console message\n\t\t\t\t$this->console('<<< relay server {1} ({2}) connected', $player['Login'],\n\t\t\t\t stripColors($player['NickName'], false));\n\t\t\t}\n\n\t\t// on relay, check for player from master server\n\t\t} elseif ($this->server->isrelay && floor($player['Flags'] / 10000) % 10 != 0) {\n\t\t\t; // ignore\n\t\t} else {\n\t\t\t$ipaddr = isset($playerd['IPAddress']) ? preg_replace('/:\\d+/', '', $playerd['IPAddress']) : ''; // strip port\n\n\t\t\t// if no data fetched, notify & kick the player\n\t\t\tif (!isset($player['Login']) || $player['Login'] == '') {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CONNECT_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CONNECT_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('GetPlayerInfo failed for ' . $login . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// if player IP in ban list, notify & kick the player\n\t\t\t} elseif (!empty($this->bannedips) && in_array($ipaddr, $this->bannedips)) {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('BANIP_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Ban', array($login, $this->formatColors($this->getChatMessage('BANIP_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('Player ' . $login . ' banned from ' . $ipaddr . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// client version checking\n\t\t\t} else {\n\t\t\t\t// extract version number\n\t\t\t\t$version = str_replace(')', '', preg_replace('/.*\\(/', '', $playerd['ClientVersion']));\n\t\t\t\tif ($version == '') $version = '2.11.11';\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CLIENT_ERROR'));\n\n\t\t\t\t// if invalid version, notify & kick the player\n\t\t\t\tif ($this->settings['player_client'] != '' &&\n\t\t\t\t strcmp($version, $this->settings['player_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete player client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// if invalid version, notify & kick the admin\n\t\t\t\tif ($this->settings['admin_client'] != '' && $this->isAnyAdminL($player['Login']) &&\n\t\t\t\t strcmp($version, $this->settings['admin_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete admin client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create player object\n\t\t\t$player_item = new Player($playerd);\n\t\t\t// set default window style, panels & background\n\t\t\t$player_item->style = $this->style;\n\t\t\t$player_item->panels['admin'] = set_panel_bg($this->panels['admin'], $this->panelbg);\n\t\t\t$player_item->panels['donate'] = set_panel_bg($this->panels['donate'], $this->panelbg);\n\t\t\t$player_item->panels['records'] = set_panel_bg($this->panels['records'], $this->panelbg);\n\t\t\t$player_item->panels['vote'] = set_panel_bg($this->panels['vote'], $this->panelbg);\n\t\t\t$player_item->panelbg = $this->panelbg;\n\n\t\t\t// adds a new player to the internal player list\n\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t// log console message\n\t\t\t$this->console('<< player {1} joined the game [{2} : {3} : {4} : {5} : {6}]',\n\t\t\t $player_item->pid,\n\t\t\t $player_item->login,\n\t\t\t $player_item->nickname,\n\t\t\t $player_item->nation,\n\t\t\t $player_item->ladderrank,\n\t\t\t $player_item->ip);\n\n\t\t\t// replace parameters\n\t\t\t$message = formatText($this->getChatMessage('WELCOME'),\n\t\t\t stripColors($player_item->nickname),\n\t\t\t $this->server->name, XASECO2_VERSION);\n\t\t\t// hyperlink package name & version number\n\t\t\t$message = preg_replace('/XASECO2.+' . XASECO2_VERSION . '/', '$l[' . XASECO_ORG . ']$0$l', $message);\n\n\t\t\t// send welcome popup or chat message\n\t\t\tif ($this->settings['welcome_msg_window']) {\n\t\t\t\t$message = str_replace('{#highlite}', '{#message}', $message);\n\t\t\t\t$message = preg_split('/{br}/', $this->formatColors($message));\n\t\t\t\t// repack all lines\n\t\t\t\tforeach ($message as &$line)\n\t\t\t\t\t$line = array($line);\n\t\t\t\tdisplay_manialink($player_item->login, '',\n\t\t\t\t array('Icons64x64_1', 'Inbox'), $message,\n\t\t\t\t array(1.2), 'OK');\n\t\t\t} else {\n\t\t\t\t$message = str_replace('{br}', LF, $this->formatColors($message));\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $player_item->login);\n\t\t\t}\n\n\t\t\t// if there's a record on current map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t// set message to the current record\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t $cur_record->score : formatTime($cur_record->score)),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else { // if there should be no record to display\n\t\t\t\t// display a no-record message\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($this->server->map->name));\n\t\t\t}\n\n\t\t\t// show top-8 & records of all online players before map\n\t\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\t\tshow_maprecs($this, $player_item->login, 1, 0); // from chat.records2.php\n\t\t\t} elseif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\t// or show original record message\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $player_item->login);\n\t\t\t}\n\n\t\t\t// throw main 'player connects' event\n\t\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t\t\t// throw postfix 'player connects' event (access control)\n\t\t\t$this->releaseEvent('onPlayerConnect2', $player_item);\n\t\t}\n\t}", "function loginBegin()\r\n\t{\r\n\t\t// if we have extra perm\r\n\t\tif( isset( $this->config[\"scope\"] ) && ! empty( $this->config[\"scope\"] ) )\r\n\t\t{\r\n\t\t\t$this->scope = $this->scope . \", \". $this->config[\"scope\"];\r\n\t\t}\r\n\r\n\t\t// get the login url \r\n\t\t$url = $this->api->getLoginUrl( array( 'scope' => $this->scope, 'redirect_uri' => $this->endpoint ) );\r\n\r\n\t\t// redirect to facebook\r\n\t\tHybrid_Auth::redirect( $url ); \r\n\t}", "public function facebookRedirect(){\n $github_user = Socialite::driver('facebook')->redirect();\n }", "public function socialLogin($provider)\n {\n if (! in_array($provider, $this->socialiteHelper->getAcceptedProviders())) {\n // return redirect()->route(home_route())->withFlashDanger(__('auth.socialite.unacceptable', ['provider' => $provider]));\n return 1;\n }\n \n return Socialite::driver($provider)->redirect();\n }", "public function LoginCheck()\n {\n $protocol = Yii::app()->params['protocol'];\n $servername = Yii::app()->request->getServerName();\n $user = Yii::app()->session['username'];\n if (empty($user)) {\n $returnUrl = $protocol . $servername . Yii::app()->homeUrl;\n $this->redirect($returnUrl);\n }\n }", "public function handleSocialCallback($social)\n {\n\n try {\n\n // get user token\n $user = Socialite::driver($social)->user();\n //dd($user);\n\n $log = new Logger('stderr');\n $stream = new StreamHandler('php://stderr', Logger::WARNING);\n $stream->setFormatter(new JsonFormatter());\n $log->pushHandler($stream);\n // add records to the log\n $log->warning('this is the user',['user'=>$user]);\n // $log->error($user);\n\n // check exist user in database\n $finduser = User::where('email', $user->getEmail())->first();\n\n if($finduser){\n // login if user exist and redirect to homepage\n Auth::login($finduser);\n\n return view('home');\n\n }else{\n // if not exist make create and login with new user and redirect to homepage\n $newUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n //'github_id'=> $user->id,\n 'password' => encrypt('ahmed123456a')\n ]);\n\n Auth::login($newUser);\n\n return view('home');\n }\n // if take exception example after login make drop tables return this exception not user found\n\n } catch (Exception $e) {\n\n\n dd($e->getMessage() . \"Not User Found\");\n }\n\n\n\n }", "public function connexionIntervenantLogin(){\n }", "function connection()\n {\n $user = new User();\n $error = null;\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') { // if a submission of the form (=> a connection attempt ) has been made\n \n if (!empty($_POST['login']) && !empty($_POST['password'])) {\n \n $userManager = new UserManager();\n\n try {\n $userRegister = $userManager->findByUserLogin($_POST['login']);\n \n // we hashed the password \n $hashPasswords = hash('md5', $_POST['password']);\n\n if ($userRegister->getPassword() === $hashPasswords) {\n\n session_start();\n \n $_SESSION['connection'] = $userRegister->getId(); // creation of the session which records the id of user who has just connected \n \n $userLogged = $userRegister; // to have the user logger if later in the code we do not call the function \"Auth :: check (['administrator'])\" or \"Auth :: sessionStart ()\" \n\n if ($userManager->getUserSatus($_SESSION['connection'])['status'] === 'administrateur') {\n header('Location: /backend/adminPosts'); // if user is administrator, he goes to the admin bachend \n return http_response_code(302);\n }else if ($userManager->getUserSatus($_SESSION['connection'])['status'] === 'abonner' and !is_null($userRegister->getValidate())) { // si le user qui se connect est de type \"abonner\" et que sont compte a était valider par l administrateur du site (=> validate ! null)\n header('Location: /userFrontDashboard/'.$userRegister->getId()); // if user is a subscriber, he goes on his dashboard \n return http_response_code(302);\n }else {\n header('Location: /?unauthorizedAccess=true');\n }\n } else { \n $error = 'mot de passe incorrect';\n }\n } catch (Exception $e){\n $error = $e->getMessage();\n }\n } else {\n $error = 'remplissez tout les champs du formulaire s\\'il vous plait !!!';\n }\n }\n\n $form = new Form($user);\n\n require'../app/Views/backViews/backConnectionView.php';\n }", "public function canManageSocialNetworks(AuthInterface $auth)\n {\n return $auth->isSuperAdmin();\n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "function checkUserLogin() {\n\t$index_page = \"http://\".$_SERVER['HTTP_HOST'].\"/v3.2/index.php\";\n\tif(is_loggedIn()) {\n\t\t//user logged in to cb\n\t\tif(is_linkedInAuthorized()) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//user logged not authorized - weird case - removed the cookies manually\n\t\t\terror_log(\"User logged in but not authorized to linkedin\");\n\t\t\t//Initiate linked in authorization\n\t\t\theader('Location: ' . $index_page);\n\t\t}\n\t}else {\n\t\t//Not logged in redirect him to index page for login in\n\t\terror_log(\"User not logged in \");\n\t\theader('Location: ' . $index_page);\n\t}\n}", "function checkUserLogin() {\n\t$index_page = \"http://\".$_SERVER['HTTP_HOST'].\"/v3.2/index.php\";\n\tif(is_loggedIn()) {\n\t\t//user logged in to cb\n\t\tif(is_linkedInAuthorized()) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//user logged not authorized - weird case - removed the cookies manually\n\t\t\terror_log(\"User logged in but not authorized to linkedin\");\n\t\t\t//Initiate linked in authorization\n\t\t\theader('Location: ' . $index_page);\n\t\t}\n\t}else {\n\t\t//Not logged in redirect him to index page for login in\n\t\terror_log(\"User not logged in \");\n\t\theader('Location: ' . $index_page);\n\t}\n}", "protected function detectLoginProvider() {}", "function connect($pseudo, $pwd)\n{\n\t$authenticated = false;\n\t\n\t//salt used to store passwords\n\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t//get users list\n\t$users = getJSON(USERS);\n\t\t\n\tif($users){\n\t\t$i = 0;\n\t\twhile($i < count($users) && $users[$i]['username'] != $pseudo){\t\t\t\n\t\t\t$i++;\t\n\t\t}\n\t\t\n\t\t//if the $pseudo has been found\n\t\tif($i < count($users)){\n\t\t\t$name= $users[$i]['username'];\n\t\t\t$mdp = $users[$i]['password'];\n\t\t\t$lvl = $users[$i]['level'];\n\t\t\tif(md5($pwd.$salt) == $mdp)\n\t\t\t{\n\t\t\t\t$_SESSION['id'] = $pseudo;\n\t\t\t\t$_SESSION['lvl'] = $lvl;\n\t\t\t\t$authenticated = true;\n\t\t\t\tsetcookie(\"username\", $pseudo);\t\n\t\t\t}\n\t\t}\t\n\t}\t\n\treturn \t$authenticated;\n}", "public function _make_sure_admin_is_connected() {\n if(!$this->_is_admin_connected()){\n \n if($this->uri->uri_string() != \"autorisation-necessaire\"){\n $this->session->set_userdata('REDIRECT', $this->uri->uri_string());\n }\n redirect(base_url().'admin/identification');\n\t\t\tdie();\n }\n }", "public function handleProviderCallback()\n {\n $googleApi = Socialite::driver('google')->user();\n $currentUserRp = User::where('Email', $googleApi->getEmail())->first();\n $sessionId = $this->generateRandomString(10);\n\n if( $currentUserRp )\n {\n Auth::login($currentUserRp);\n\n $currentUserRp->google_id = $googleApi->getId();\n $currentUserRp->google_lastsessionid = $sessionId;\n $currentUserRp->save();\n \n $currentGoogleUser = googleUser::find($googleApi->getId());\n $currentGameUser = gameUser::find(Auth::user()->ID);\n\n if( !$currentGoogleUser )\n {\n $addGooglerUser = googleUser::create([ \n 'gouser_id' => $googleApi->getId(),\n 'gouser_name' => $googleApi->getName(),\n 'gamuser_id' => Auth::user()->ID,\n 'gouser_nick' => Auth::user()->Nick,\n 'gouser_avatar' => $googleApi->getAvatar(),\n 'gouser_email' => $googleApi->getEmail(),\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n ]);\n }\n\n if( !$currentGameUser )\n {\n $addGameUser = gameUser::create([ \n 'gamuser_id' => Auth::user()->ID,\n 'gamuser_nick' => Auth::user()->Nick,\n ]);\n }\n\n $logGoogleLogin = googleUserLogin::create([\n 'gosession_token' => $sessionId,\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n 'gouser_id' => $googleApi->getId()\n ]);\n\n return redirect('/');\n }\n else\n {\n return redirect()->route(\"api.result\", ['result_state' => 'error', 'result_aux' => \"ERR04\"]);\n }\n\n\n\n\n /*\n $myUser = Socialite::driver('google')->user();\n $manageUser = User::where('Email', $myUser->getEmail())->first();\n\n if( !$manageUser )\n {\n // $manageUser = User::create([\n // 'name' => $myUser->getName(),\n // 'email' => $myUser->getEmail(),\n // 'google_id' => $myUser->getId(),\n // 'google_avatar' => $myUser->getAvatar(),\n // ]);\n return redirect('/unkownemail');\n }\n else {\n Auth::login($manageUser);\n\n if( Auth::user()->Certificado < env(\"AUTH_MINIMUM_CERTIFICATE\") )\n {\n return redirect('/invalidcert');\n }\n\n return redirect('/');\n }\n \n // $user->token;\n */\n }", "public function handleProviderCallback()\n\n {\n $user = Socialite::driver('facebook')->user();\n\n $gender = $user->user['gender'];\n $ext_id = $user->user['id'];\n $verified = $user->user['verified'];\n $avatar = $user->avatar;\n $name = explode(' ',$user->name);\n\n\n $social_exist = User::where('ext_id',$ext_id)->first();\n\n\n if($social_exist)\n {\n return $this->loginUsingId($social_exist->id);\n }\n else\n {\n $user_create = User::create([\n 'uuid' => Uuid::generate(5,$user->email, Uuid::NS_DNS),\n \"firstname\" => \"$name[0]\",\n \"lastname\" => \"$name[1]\",\n \"email\" => \"$user->email\",\n 'password' => bcrypt($ext_id),\n \"gender\" => \"$gender\",\n \"avatar\" => $avatar,\n \"ext_id\" => $ext_id,\n \"ext_source\" => \"facebook\",\n \"ext_verified\" => \"$verified\"\n ]);\n\n $userObj = User::find($user_create->id);\n\n if(Event::fire(new WelcomeUser($user_create)))\n {\n return $this->loginUsingId($user_create->id);\n }else\n {\n //Redirect to error page and log in the incident\n }\n }\n }", "private function connectToWhatsApp()\n {\n $this->whatsapp = new \\WhatsProt($this->login, $this->nickname, $this->debug);\n $this->whatsapp->eventManager()->bind('onConnect', [$this, 'connected']);\n $this->whatsapp->eventManager()->bind('onGetMessage', [$this, 'processReceivedMessage']);\n $this->whatsapp->eventManager()->bind('onGetImage', [$this, 'onGetImage']); \n $this->whatsapp->eventManager()->bind('onGetProfilePicture', [$this, 'onGetProfilePicture']);\n \n if ($this->connected == false): \n $this->whatsapp->connect(); // Connect to WhatsApp network \n $this->whatsapp->loginWithPassword($this->password); \n\n if(!empty($this->imageCover)):\n $this->whatsapp->sendSetProfilePicture(\"./uploads/\" . $this->imageCover);\n endif;\n\n return true;\n endif;\n\n return false;\n }", "static protected function checkAccess()\n {\n $cur_user = User::getConnectedUser();\n if (!$cur_user || !$cur_user->canSeeInvitations()) {\n redirectTo('/');\n }\n return $cur_user;\n }", "function _modallogin_connector_log_in($connector_name, $cid = NULL, $consumer = NULL, $access_token = NULL, $request_token = NULL) {\n global $user;\n\n if (user_is_logged_in()) {\n return TRUE;\n }\n\n $connector = _connector_get_connectors($connector_name);\n if (!$connector) {\n return FALSE;\n }\n\n //Fetch connector ID\n if ($cid === NULL && isset($connector['id callback']) && is_callable($connector['id callback'])) {\n $cid = call_user_func($connector['id callback'], $connector);\n }\n\n if ($cid === NULL) {\n return FALSE;\n }\n $authname = $connector_name . '__' . $cid;\n $account = user_external_load($authname);\n if (!$account) {\n // Return NULL and not FALSE so that we know we didn't find a user.\n return NULL;\n }\n\n if (!$account) {\n return FALSE;\n }\n\n // @TODO hack! Logintoboggan doesnt allow use to both require validation \n // email AND immediate login, this settings should be set in our own module. \n // For now simply leave the logic intact and force immediate login here.\n global $conf;\n $conf['logintoboggan_immediate_login_on_register'] = TRUE;\n\n $pre_auth = _modallogin_pre_auth();\n $is_first_login = !$account->login;\n\n // User does not need administrator approval.\n if ($account->status) {\n // Email verification is required\n if ($pre_auth && $is_first_login) {\n // User can log in immediately but needs to verify email.\n // Requires LoginToBoggan\n if (variable_get('logintoboggan_immediate_login_on_register', TRUE)) {\n $action = 'create_login_verify';\n }\n // User still needs to verify the email address before logging in.\n else {\n $action = 'create_verify';\n }\n }\n // User doesnt require email verification simply login.\n // @TODO what about !$pre_auth && $is_first_login?\n else {\n $action = 'login';\n }\n }\n // User requires administrator approval\n else {\n $action = 'create_approval';\n }\n\n _modallogin_create_login_action($action, $account, $connector);\n\n return FALSE;\n}", "public function handleFacebookCallback()\n {\n \t$user = Socialite::driver('facebook')->user();\n \t$user_details=$user->user; \n \tif(User::where('fb_id',$user_details['id'])->exists()){\n \t\t$fbloged_user=User::where('fb_id',$user_details['id'])->get();\n \t\t$fbloged_user=$fbloged_user[0]; \t\n \t\t$user_login = Sentinel::findById($fbloged_user->id);\n \t\tSentinel::login($user_login);\n \t\treturn redirect('/');\n \t}else{\n \t\ttry {\n \t\t\t$registed_user=DB::transaction(function () use ($user_details){\n\n \t\t\t\t$user = Sentinel::registerAndActivate([\t\t\t\t\t\t\t\t\n \t\t\t\t\t'email' =>$user_details['id'].'@fbmail.com',\n \t\t\t\t\t'username' => $user_details['name'],\n \t\t\t\t\t'password' => $user_details['id'],\n \t\t\t\t\t'fb_id' => $user_details['id']\n \t\t\t\t]);\n\n \t\t\t\tif (!$user) {\n \t\t\t\t\tthrow new TransactionException('', 100);\n \t\t\t\t}\n\n \t\t\t\t$user->makeRoot();\n\n \t\t\t\t$role = Sentinel::findRoleById(1);\n \t\t\t\t$role->users()->attach($user);\n\n \t\t\t\tUser::rebuild();\n \t\t\t\treturn $user;\n\n\n \t\t\t});\n \t\t\tSentinel::login($registed_user);\n \t\t\treturn redirect('/');\n\n \t\t} catch (TransactionException $e) {\n \t\t\tif ($e->getCode() == 100) {\n \t\t\t\tLog::info(\"Could not register user\");\n\n \t\t\t\treturn redirect('user/register')->with(['error' => true,\n \t\t\t\t\t'error.message' => \"Could not register user\",\n \t\t\t\t\t'error.title' => 'Ops!']);\n \t\t\t}\n \t\t} catch (Exception $e) {\n\n \t\t}\n \t}\n\n\n\n\n\n\n // $user->token;\n }", "public function handleProviderCallback()\n {\n try\n {\n // get user data from Google\n $user = Socialite::driver('google')->user();\n\n // we look for a user with such data\n $existingUser = User::where('provider_id', $user->getId())->first();\n\n if ($existingUser) // if this user exists\n {\n Auth::login($existingUser);\n }\n else // we register a new user\n {\n $newUser = new User();\n\n $newUser->email = $user->getEmail();\n $newUser->provider_id = $user->getId();\n\n // when you login with Google you need to pay attention to that\n // getNickname() method return NULL, then you shall use getName() method to get name of a user\n $newUser->handle_social = $user->getName();\n $newUser->name = $user->getName();\n $newUser->password = bcrypt(uniqid());\n\n $newUser->save();\n\n // after saving user data to the database,\n // we automatically log in this user\n Auth::login($newUser);\n }\n\n flash('Successfully authenticated using Google');\n\n return redirect('/');\n }\n catch(Exception $e)\n {\n dd($e->getMessage());\n }\n }", "public function is_connected($user_id){\n return (bool) get_user_meta($user_id, $this->umeta_id, true);\n }", "public function social_login( $provider, $access_token, $social_id ) {\n\t\t// Define how the social ID meta key looks like in the WP database\n\t\t$social_id_meta_key = '_' . $provider .'_id';\n\n\t\tswitch ( $provider ) {\n\t\t\tcase \"weibo\":\n\t\t\t\t// Get the user info from Weibo\n\t\t\t\t$social_user = $this->weibo_get_user( $access_token, $social_id );\n\t\t\t\t// Parse the user info from Weibo into a wordpress user\n\t\t\t\tif ($social_user['id']) {\n\t\t\t\t\t// Create a user object out of the info from weibo\n\t\t\t\t\t$user = array(\n\t\t\t\t\t\t'user_login' => $social_user['id'] . '@weibo.com', // Should be changed to \"real\" email in order to avoid duplicates\n\t\t\t\t\t\t'display_name' => $social_user['screen_name'],\n\t\t\t\t\t\t'user_nicename' => $social_user['screen_name'],\n\t\t\t\t\t\t'nickname' => $social_user['screen_name']\t\t\t\n\t\t\t\t\t);\n\n\t\t\t\t\t// Create the user's meta data with the social info\n\t\t\t\t\t$user_meta = array (\n\t\t\t\t\t\t$social_id_meta_key => $social_id\n\t\t\t\t\t);\n\n\t\t\t\t\t// Login or register the user\n\t\t\t\t\treturn $this->login_or_register( $provider, $user, $user_meta );\n\n\t\t\t\t// No Weibo user was found, return error\n\t\t\t\t} else {\n\t\t\t\t\treturn new WP_Error( 'USER_api_social_no_user', __( 'Couldn\\'t get a user with provided access_token and UID' ), array( 'status' => 400 ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// No social account matched, return error\n\t\t\tdefault:\n\t\t\t\treturn new WP_Error( 'USER_api_provider_not_supported', __( 'This type of social account is currently not supported.' ), array( 'status' => 400 ) );\n\t\t}\n\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "protected function is_connected_to_proxy() {\n\t\treturn (bool) $this->authentication->is_authenticated()\n\t\t\t&& $this->authentication->credentials()->has()\n\t\t\t&& $this->authentication->credentials()->using_proxy();\n\t}", "public function manageConnection() {\n\t\tif (isset($_POST['connexion'])) {\n\t\t\t$login = $_POST['login'];\n\t\t\t$password = $_POST['password'];\n\t\t\t$this->login($login, $password);\n\t\t}\n\t\telse if (isset($_POST['deconnexion'])) {\n\t\t\t$this->logout();\n\t\t\tPager::redirect('accueil.php');\n\t\t}\n\t}", "public function twitter_connect() {\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $twitter_user = new TwitterUser($account_dbobj);\n $twitter_user->findOne('id='.$merchant_id);\n $twitter_user->setProfileImageUrl($profile['profile_image_url']);\n $twitter_user->setUrl($profile['url']);\n $twitter_user->setLocation($profile['location']);\n $twitter_user->setName($profile['name']);\n $twitter_user->setScreenName($profile['screen_name']);\n $twitter_user->setId($profile['id']);\n $twitter_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $twitter_user, $account_dbobj);\n\n $this->status = 0;\n }", "private function initSocialLogin() : void\n {\n foreach ($this->getActiveSocialLoginProviders() as $provider) {\n config([\n 'services.'.$provider.'.client_id' => config('config.auth.'.$provider.'_client_id'),\n 'services.'.$provider.'.client_secret' => config('config.auth.'.$provider.'_client_secret'),\n 'services.'.$provider.'.redirect' => url('/auth/login/'.$provider.'/callback')\n ]);\n }\n }", "public function canLoginHere()\n {\n if (! $this->_hasVar('can_login_here')) {\n $this->_setVar('can_login_here', true);\n if ($orgId = $this->userLoader->getOrganizationIdByUrl()) {\n if (! $this->isAllowedOrganization($orgId)) {\n $this->_setVar('can_login_here', false);;\n }\n }\n }\n return $this->_getVar('can_login_here');\n }", "public static function connected(){\n\t\trequire_once (File::build_path(array('lib','Security.php'))); \n\t\t$pwd= Security::chiffrer($_GET['password']);\n\n\t\tif(ModelBenevole::checkPassword($_GET['login'], $pwd)){\n\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t$bene = ModelBenevole::select($id);\n\n\t\t\tif($bene->__get('nonce') == null){ \n\t\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t\t$b = ModelBenevole::select($id); \n\t\t\t\t$pagetitle = 'Vous êtes connecté';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'detail'; //renvoie sur le détail \n\t\t\t\t$_SESSION['login'] = $_GET['login'];\n\t\t\t}else{\n\t\t\t\t$pagetitle = 'Compte non validé';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'error'; //renvoie sur l'erreur\n\t\t\t}\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}else{\n\t\t\t$pagetitle = 'Mauvais identifiants et/ou mot de passe';\n\t\t\t$controller = 'benevole';\n\t\t\t$view = 'error';\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}\n\t}", "public function acceptConnection(Request $request)\n {\n $AuthUser = User::where('email', $request->input('authenticated'))->first();\n $user = User::where('name', $request->input('acceptConnectionFrom'))->first();\n $AuthUser->acceptConnectionRequest($user);\n return 'Connected';\n }", "private function checkLogin()\n {\n // save the user's destination in case we direct them to authenticate\n\n // whitelist authentication mechanisms\n if($this->_controller == \"authenticate\")\n return;\n\n // whitelist database reload\n if($this->_controller == \"populatetestdata\")\n return;\n\n if(!isset($_SESSION['userid']))\n {\n // Don't redirect the user to an error page just in principle\n // @todo possible @bug why would it do this?\n if($this->_controller != \"error\" && $this->_controller != \"undefined\")\n {\n $this->slogger->slog(\"saving destination to \" . $this->_controller, SLOG_DEBUG);\n $_SESSION['destination'] = $this->_controller;\n }\n redirect('authenticate');\n\n }\n\n }", "public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }", "private function checkLogin() {\n\t\t$session = $this->Session->read ( 'sessionLogado' );\n\t\tif (empty ( $session )) {\n\t\t\t$this->Session->write ( 'sessionLogado', false );\n\t\t}\n\t\t\n\t\tif ($this->params ['plugin'] == 'users') {\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'home' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'signatures' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "function isConnectedTo($profile_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM connect_list WHERE profile_id= :profile_id AND accountID=:account');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':account'=>$account));\n\t\tif($statement->rowCount() == 0)\n\t\t\treturn false;\n\t\treturn $statement->fetch();\n\t}", "public function handleFacebookCallback()\n {\n try {\n\n $user = Socialite::driver('facebook')->user();\n $isUser = User::where('fb_id', $user->id)->first();\n\n if($isUser){\n Auth::login($isUser);\n return redirect('/home');\n }else{\n $createUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n 'fb_id' => $user->id,\n 'password' => encrypt('admin@123')\n ]);\n\n Auth::login($createUser);\n return redirect('/home');\n }\n\n } catch (\\Exception $exception) {\n return redirect()\n ->route('login')\n ->with('error_string','Authentication Failed!!!');\n }\n }", "function connectBL() {\n\t $isConnected = \"false\";\n\t // If the form has been correctly filled\n\t if ( !empty($_POST['userId']) && !empty($_POST['password']) )\n\t {\n\t // If the user exists\n\t if ( checkUserIdBL() )\n\t {\n\t // If the password is correct\n\t\t if ( checkHashBL() )\n\t\t {\n\t\t\t $isConnected = \"true\";\n\t\t\t // The session save the user ID\n\t\t\t $_SESSION['userId'] = $_POST['userId'];\n\t\t }\n\t }\n\t }\n\t echo $isConnected;\n }", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "public function handleProviderCallback($social)\n {\n $userInfo = Socialite::driver($social)->stateless()->user();\n\n\n //check if user exists and log user in\n $user = User::where('email',$userInfo->email)->first();\n if ($user){\n if (Auth::loginUsingId($user->id)){\n return redirect()->route('profiles.profile.create');\n }\n }\n //else sign the user up\n $userSignUp = User::create([\n 'name'=>$userInfo->name,\n 'email'=>$userInfo->email,\n 'avatar'=>$userInfo->avatar,\n 'provider'=>$social,\n 'is_status'=>'3',\n 'verified'=>1,\n 'provider_id'=>$userInfo->id,\n ]);\n //finally log the user in\n if ($userSignUp){\n if (Auth::loginUsingId($userSignUp->id)){\n return redirect()->route('profiles.profile.create');\n }\n }\n }" ]
[ "0.6421764", "0.6030586", "0.6030586", "0.59462863", "0.59436107", "0.58814454", "0.58476716", "0.5833757", "0.5819634", "0.58015543", "0.5775522", "0.5706899", "0.5666944", "0.56360334", "0.56263465", "0.56028897", "0.5582479", "0.5572021", "0.5518143", "0.55115736", "0.5508764", "0.54780936", "0.5465043", "0.5462845", "0.544542", "0.5435036", "0.54164463", "0.5415131", "0.5390741", "0.5389663", "0.5369805", "0.5363414", "0.53622055", "0.5359517", "0.5346442", "0.5332474", "0.53200465", "0.53094226", "0.5299923", "0.5292865", "0.52875894", "0.5285685", "0.52819514", "0.5275014", "0.5268685", "0.52654064", "0.52598953", "0.5251898", "0.52457464", "0.5236451", "0.5208984", "0.5192864", "0.51847136", "0.5181704", "0.5179912", "0.5173689", "0.51686245", "0.5157032", "0.51440173", "0.51407707", "0.51286376", "0.5128016", "0.51193154", "0.5111924", "0.51061845", "0.5081463", "0.50681555", "0.50681555", "0.5063472", "0.5063472", "0.50551945", "0.5047557", "0.50392675", "0.50375766", "0.50375587", "0.5033053", "0.5031327", "0.50256777", "0.49908116", "0.4985306", "0.49767745", "0.4974053", "0.49739876", "0.4972106", "0.4972084", "0.49646038", "0.49629658", "0.4962795", "0.49597818", "0.4957988", "0.49516234", "0.49496752", "0.49413258", "0.4939613", "0.49244142", "0.49243057", "0.49231917", "0.4921968", "0.49190435", "0.49187896", "0.49174878" ]
0.0
-1
Connects the current user if he is logged with one of the social networks defined in main firewall.
public function loadUserByOAuthUserResponse(UserResponseInterface $response) { // Check service login $serviceName = $response->getResourceOwner()->getName(); switch ($serviceName) { case 'facebook': // Get user data from Facebook $userData = $response->getResponse(); $userid = $userData['id']; $socialEmail = $response->getEmail(); $firstname = $userData['first_name']; $gender = $userData['gender']; $lastname = $userData['last_name']; $link = $userData['link']; $locale = $userData['locale']; $realName = $response->getRealName(); $timezone = $userData['timezone']; $updatedTime = $userData['updated_time']; $verified = $userData['verified']; // Get profile image $userFb = "https://graph.facebook.com/" . $userid; $profilePicture = $userFb . "/picture?width=260&height=260"; $nickname = $response->getNickname(); // Get oauth token $oauthToken = $response->getAccessToken(); $expiresIn = $response->getExpiresIn(); $data = [ "facebook_id" => $userid, "facebook_access_token" => $oauthToken, "facebook_access_token_expires_in" => $expiresIn, "email" => $socialEmail, "firstname" => $firstname, "lastname" => $lastname, "gender" => $gender, "link" => $link, "locale" => $locale, "realname" => $realName, "timezone" => $timezone, "updated_time" => $updatedTime, "verified" => $verified, "profile_picture" => $profilePicture, "nick" => $nickname ]; // Check if this user exists in the database $socialManager = $GLOBALS['kernel']->getContainer()->get('my_facebook_manager'); $socialUser = $socialManager->loadUserBySocialId($userid); break; case 'google': // Get user data from Google $userData = $response->getResponse(); $userid = $userData['id']; $socialEmail = $response->getEmail(); $firstname = $userData['given_name']; $lastname = $userData['family_name']; $gender = $userData['gender']; $link = $userData['link']; $locale = $userData['locale']; $realName = $response->getRealName(); $verified = $userData['verified_email']; $profilePicture = $response->getProfilePicture(); // Get oauth token $oauthToken = $response->getAccessToken(); $expiresIn = $response->getExpiresIn(); $data = [ "google_id" => $userid, "google_access_token" => $oauthToken, "google_access_token_expires_in" => $expiresIn, "email" => $socialEmail, "firstname" => $firstname, "lastname" => $lastname, "gender" => $gender, "link" => $link, "locale" => $locale, "realname" => $realName, "verified" => $verified, "profile_picture" => $profilePicture ]; // Check if this user exists in the database $socialManager = $GLOBALS['kernel']->getContainer()->get('my_google_manager'); $socialUser = $socialManager->loadUserBySocialId($userid); break; case 'twitter': // Get user data from Twitter $userData = $response->getResponse(); $userid = $userData['id']; $socialEmail = null; $realName = $response->getRealName(); $screenName = $userData['screen_name']; $followersCount = $userData['followers_count']; $friendsCount = $userData['friends_count']; $listedCount = $userData['listed_count']; $createdAt = $userData['created_at']; $favouritesCount = $userData['favourites_count']; $locale = $userData['lang']; $profilePicture = $userData['profile_image_url']; // Get oauth token $oauthToken = $response->getAccessToken(); $oauthTokenSecret = $response->getTokenSecret(); $expiresIn = $response->getExpiresIn(); $data = [ "twitter_id" => $userid, "twitter_access_token" => $oauthToken, "twitter_access_token_secret" => $oauthTokenSecret, "twitter_access_token_expires_in" => $expiresIn, "realname" => $realName, "screen_name" => $screenName, "followers_count" => $followersCount, "friends_count" => $friendsCount, "listed_count" => $listedCount, "created_at" => $createdAt, "favourites_count" => $favouritesCount, "locale" => $locale, "profile_picture" => $profilePicture, ]; // Check if this user exists in the database $socialManager = $GLOBALS['kernel']->getContainer()->get('my_twitter_manager'); $socialUser = $socialManager->loadUserBySocialId($userid); break; } // Check if this id exists in the DB $user = $this->userManager->findUserBy(array($this->getProperty($response) => $userid)); // When the user is registrating if (null === $user) { // Check if email is null if ($socialEmail == null) { $socialEmail = $userid . '@' . $userid . '.com'; } // We check for the email existence - if so, update user. if ($existentUser = $this->userManager->findUserByEmail($socialEmail)) { // If user exists - go with the HWIOAuth way $setter = 'set' . ucfirst($serviceName); $setterId = $setter . 'Id'; // Update access token $existentUser->$setterId($userid); // Download the social profile picture if user hasn't a profile picture with us if (null === $existentUser->getProfilePicture()) { $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager'); $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture); // Update the profile picture $existentUser->setProfilePicture($profilePictureId); } $this->userManager->updateUser($existentUser); // Check if social user exists if (null === $socialUser) { // Create new social user $socialManager->createSocialUser($data, $existentUser); } else { // Update social user data $socialManager->updateSocialUserData($socialUser, $data, $existentUser); } return $existentUser; } // If user doesn't exist, create new user $setter = 'set' . ucfirst($serviceName); $setterId = $setter . 'Id'; // Create new user here $user = $this->userManager->createUser(); $user->$setterId($userid); // I have set all requested data with the user's username // Modify here with relevant data $user->setUsername('########'); $user->setUsernameChange('0'); $user->setVideonaRegister('0'); $user->setEmail($socialEmail); // Insert user id like a password until user creates a password with us $user->setPlainPassword($userid); $user->setEnabled(true); // Download the social profile picture if user has a profile picture if ($profilePicture) { $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager'); $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture); // Update the profile picture $user->setProfilePicture($profilePictureId); } // Update user $this->userManager->updateUser($user); // Check if social user exists if (null === $socialUser) { // Create new social user $socialManager->createSocialUser($data, $user); } else { // Update social user data $socialManager->updateSocialUserData($socialUser, $data, $user); } return $user; } // If user exists - go with the HWIOAuth way $user = parent::loadUserByOAuthUserResponse($response); // Download the social profile picture if user hasn't a profile picture with us if (null === $user->getProfilePicture()) { $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager'); $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture); // Update the profile picture $user->setProfilePicture($profilePictureId); // Update user $this->userManager->updateUser($user); } // Check if social user exists if (null === $socialUser) { // Create new social user $socialManager->createSocialUser($data, $user); } else { // Update social user data $socialManager->updateSocialUserData($socialUser, $data, $user); } return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect($network) {\n \n // Load plan features\n $limit_accounts = $this->plans->get_plan_features($this->user_id, 'network_accounts');\n \n // Get all accounts connected for social network\n $allaccounts = $this->networks->get_all_accounts($this->user_id, $network);\n \n if ( !$allaccounts ) {\n $allaccounts = array();\n }\n \n if ( $limit_accounts <= count($allaccounts) && !$this->input->get('account', TRUE) ) {\n \n // Display the error message\n echo $this->ecl('Social_login_connect')->view($this->lang->line('social_connector'), '<p class=\"alert alert-error\">' . $this->lang->line('reached_maximum_number_allowed_accounts') . '</p>', false);\n exit();\n \n }\n \n // Connects user to his social account\n $this->check_session($this->user_role, 0);\n require_once APPPATH . 'interfaces/Autopost.php';\n \n if ( file_exists(APPPATH . 'autopost/' . ucfirst($network) . '.php') ) {\n \n require_once APPPATH . 'autopost/' . ucfirst($network) . '.php';\n \n $get = new $network;\n \n $get->connect();\n \n } else {\n \n display_mess(47);\n \n }\n \n }", "abstract protected function connected($user);", "abstract protected function connected($user);", "public function socialLogin(Request $request)\n {\n if($request->has('role') && $request->get('role') == 'client'){\n\n $clientSocialProvider = ClientSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$clientSocialProvider)\n {\n //Handle user already logged and want log with facebook too\n if($request->has('user_email')){\n\n $user = Client::whereEmail($request->get('user_email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' => $request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n }\n\n if(!$request->has('user_email')){\n\n //Create client\n $user = Client::firstOrCreate([\n 'name' => $request->get('first_name'),\n 'last_name' => $request->get('last_name'),\n 'email' => $request->get('email')\n ]);\n\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $clientSocialProvider->client;\n }\n }\n\n /*\n * Handling with a admin user\n */\n if($request->has('role') && $request->get('role') == 'admin'){\n\n $userSocialProvider = UserSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n if($request->has('user_email')){\n\n $user = User::whereEmail($request->get('user_email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n }\n\n if(!$request->has('user_email')){\n\n //Create user\n $user = User::firstOrCreate([\n 'name' => $request->get('first_name'),\n 'last_name' => $request->get('last_name'),\n 'email' => $request->get('email')\n ]);\n\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n /*\n * Handling with a oracle user\n */\n if($request->has('role') && $request->get('role') == 'oracle'){\n\n $userSocialProvider = OracleSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n $user = OracleUser::whereEmail($request->get('email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n /*\n * Handling with a advertiser user\n */\n if($request->has('role') && $request->get('role') == 'advertiser'){\n\n $userSocialProvider = AdvertiserSocialProvider::where('provider_id', $request->get('id'))->first();\n\n if(!$userSocialProvider)\n {\n $user = Advertiser::whereEmail($request->get('email'))->first();\n\n if($user){\n $user->socialProviders()->create([\n 'provider' => 'facebook',\n 'provider_id' => $request->get('id'),\n 'access_token' =>$request->get('access_token'),\n 'photo_url' => $request->get('photo_url')\n ]);\n }\n\n }else{\n $user = $userSocialProvider->user;\n }\n }\n\n if($user){\n //Verifies if the account belongs to the authenticated user.\n if($request->has('user_id') && $user->id != $request->get('user_id')){\n return response([\n 'status' => 'error',\n 'code' => 'ErrorGettingSocialUser',\n 'msg' => 'Facebook account already in use.'\n ], 400);\n }\n\n if ( ! $token = $this->JWTAuth->fromUser($user)) {\n throw new AuthorizationException;\n }\n\n return response([\n 'status' => 'success',\n 'msg' => 'Successfully logged in via Facebook.',\n 'access_token' => $token,\n 'user' => $user->load('socialProviders')\n ])->header('Authorization','Bearer '. $token);;\n }\n\n\n return response([\n 'status' => 'error',\n 'code' => 'ErrorGettingSocialUser',\n 'msg' => 'Unable to authenticate with Facebook.'\n ], 403);\n }", "function loginRadiusConnect()\n{\n\t//create object of social login class.\n\t$module = new sociallogin();\n\tinclude_once('LoginRadiusSDK.php');\n\t$secret = trim(Configuration::get('API_SECRET'));\n\t$lr_obj = new LoginRadius();\n\t//Get the user_profile of authenticate user.\n\t$user_profile = $lr_obj->loginRadiusGetData($secret);\n\t//If user is not logged in and user is authenticated then handle login functionality.\n\tif ($lr_obj->is_authenticated == true && !Context:: getContext()->customer->isLogged())\n\t{\n\t\t$lrdata = loginRadiusMappingProfileData($user_profile);\n\t\t//Check Social provider id is already exist.\n\t\t$social_id_exist = 'SELECT * FROM '.pSQL(_DB_PREFIX_.'sociallogin').' as sl INNER JOIN '.pSQL(_DB_PREFIX_.'customer').\" as c\n\t\tWHERE sl.provider_id='\".pSQL($lrdata['id']).\"' and c.id_customer=sl.id_customer LIMIT 0,1\";\n\t\t$db_obj = Db::getInstance()->ExecuteS($social_id_exist);\n\t\t$td_user = '';\n\t\t$user_id_exist = (!empty($db_obj[0]['id_customer']) ? $db_obj[0]['id_customer'] : '');\n\t\tif ($user_id_exist >= 1)\n\t\t{\n\t\t\t$active_user = (!empty($db_obj['0']['active']) ? $db_obj['0']['active'] : '');\n\t\t\t//Verify user and provide login.\n\t\t\tloginRadiusVerifiedUserLogin($user_id_exist, $lrdata, $td_user);\n\t\t}\n\t\t//If Social provider is is not exist in database.\n\t\telseif ($user_id_exist < 1)\n\t\t{\n\t\t\tif (!empty($lrdata['email']))\n\t\t\t{\n\t\t\t\t// check email address is exist in database if email is retrieved from Social network.\n\t\t\t\t$user_email_exist = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_.'customer').' as c\n\t\t\t\tWHERE c.email=\"'.pSQL($lrdata['email']).'\" LIMIT 0,1');\n\t\t\t\t$user_id = (!empty($user_email_exist['0']['id_customer']) ? $user_email_exist['0']['id_customer'] : '');\n\t\t\t\t$active_user = (!empty($user_email_exist['0']['active']) ? $user_email_exist['0']['active'] : '');\n\t\t\t\tif ($user_id >= 1)\n\t\t\t\t{\n\t\t\t\t\t$td_user = 'yes';\n\t\t\t\t\tif (deletedUser($user_email_exist))\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = \"<p style ='color:red;'>\".$module->l('Authentication failed.', 'sociallogin_functions').'</p>';\n\t\t\t\t\t\tpopupVerify($msg);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (Configuration::get('ACC_MAP') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tbl = pSQL(_DB_PREFIX_.'sociallogin');\n\t\t\t\t\t\t$query = \"INSERT into $tbl (`id_customer`,`provider_id`,`Provider_name`,`verified`,`rand`)\n\t\t\t\t\t\tvalues ('\".$user_id.\"','\".pSQL($lrdata['id']).\"' , '\".pSQL($lrdata['provider']).\"','1','') \";\n\t\t\t\t\t\tDb::getInstance()->Execute($query);\n\t\t\t\t\t}\n\t\t\t\t\tloginRadiusVerifiedUserLogin($user_id, $lrdata, $td_user);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lrdata['send_verification_email'] = 'no';\n\t\t\t//new user. user not found in database. set all details\n\t\t\tif (Configuration::get('user_require_field') == '1')\n\t\t\t{\n\t\t\t\tif (empty($lrdata['email']))\n\t\t\t\t\t$lrdata['send_verification_email'] = 'yes';\n\t\t\t\tif (Configuration::get('EMAIL_REQ') == '1' && empty($lrdata['email']))\n\t\t\t\t{\n\t\t\t\t\t$lrdata['email'] = emailRand($lrdata);\n\t\t\t\t\t$lrdata['send_verification_email'] = 'no';\n\t\t\t\t}\n\t\t\t\t//If user is not exist and then add all lrdata into cookie.\n\t\t\t\tstoreInCookie($lrdata);\n\t\t\t\t//Open the popup to get require fields.\n\t\t\t\t$value = popUpWindow('', $lrdata);\n\t\t\t\tif ($value == 'noshowpopup')\n\t\t\t\t\tstoreAndLogin($lrdata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//Save data into cookie and open email popup.\n\t\t\tif (Configuration::get('EMAIL_REQ') == '0' && empty($lrdata['email']))\n\t\t\t{\n\t\t\t\t$lrdata['send_verification_email'] = 'yes';\n\t\t\t\tstoreInCookie($lrdata);\n\t\t\t\tpopUpWindow('', $lrdata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telseif (Configuration::get('EMAIL_REQ') == '1' && empty($lrdata['email']))\n\t\t\t\t$lrdata['email'] = emailRand($lrdata);\n\t\t\t//Store user data into database and provide login functionality.\n\t\t\tstoreAndLogin($lrdata);\n\t\t}\n\t\t//If user is delete and set action to provide no login to user.\n\t\telseif (deletedUser($db_obj))\n\t\t{\n\t\t\t$msg = \"<p style ='color:red;'><b>\".$module->l('Authentication failed.', 'sociallogin_functions').'</b></p>';\n\t\t\tpopupVerify($msg);\n\t\t\treturn;\n\t\t}\n\t\t//If user is blocked.\n\t\tif ($active_user == 0)\n\t\t{\n\t\t\t$msg = \"<p style ='color:red;'><b>\".$module->l('User has been disbled or blocked.', 'sociallogin_functions').'</b></p>';\n\t\t\tpopupVerify($msg);\n\t\t\treturn;\n\t\t}\n\t}\n}", "function userConnect(){\r\n if (isset($_SESSION['user'])) {\r\n return TRUE;\r\n }else{\r\n return FALSE;\r\n }\r\n // if(isset($_SESSION['user'])) return TRUE; else return FALSE;\r\n }", "protected function connected($user)\n\t{\n\t}", "private function parseNetworks($objUser) {\n global $_ARRAYLANG;\n\n $availableProviders = \\Cx\\Lib\\SocialLogin::getProviders();\n foreach ($availableProviders as $index => $provider) {\n if (!$provider->isActive()) {\n unset($availableProviders[$index]);\n }\n }\n $userNetworks = $objUser->getNetworks()->getNetworksAsArray();\n\n $this->_objTpl->setGlobalVariable(array(\n 'TXT_ACCESS_SOCIALLOGIN_PROVIDER' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_PROVIDER'],\n 'TXT_ACCESS_SOCIALLOGIN_STATE' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_STATE'],\n ));\n\n // get current url for redirect parameter\n $currentUrl = clone \\Env::get('Resolver')->getUrl();\n\n if (!$this->_objTpl->blockExists('access_sociallogin_provider')) {\n return null;\n }\n\n // parse the connect buttons\n foreach ($availableProviders as $providerName => $providerSettings) {\n if (empty($userNetworks[$providerName])) {\n $state = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_DISCONNECTED'];\n $class = 'disconnected';\n $uri = contrexx_raw2xhtml(\n \\Cx\\Lib\\SocialLogin::getLoginUrl($providerName,\n base64_encode($currentUrl->__toString())\n )\n );\n $uriAction = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_CONNECT'];\n } else {\n $state = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_CONNECTED'];\n $class = 'connected';\n $disconnectUrl = clone \\Env::get('Resolver')->getUrl();\n $disconnectUrl->setParam('act', 'disconnect');\n $disconnectUrl->setParam('provider', $providerName);\n $uri = $disconnectUrl->__toString();\n $uriAction = $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_DISCONNECT'];\n }\n\n $this->_objTpl->setVariable(array(\n 'ACCESS_SOCIALLOGIN_PROVIDER_NAME_UPPER' => contrexx_raw2xhtml(ucfirst($providerName)),\n 'ACCESS_SOCIALLOGIN_PROVIDER_STATE' => $state,\n 'ACCESS_SOCIALLOGIN_PROVIDER_STATE_CLASS'=> $class,\n 'ACCESS_SOCIALLOGIN_PROVIDER_NAME' => contrexx_raw2xhtml($providerName),\n 'ACCESS_SOCIALLOGIN_URL' => $uri,\n 'ACCESS_SOCIALLOGIN_URL_ACTION' => $uriAction,\n ));\n\n if ($class == 'disconnected') {\n $this->_objTpl->parse('access_sociallogin_provider_disconnected');\n $this->_objTpl->hideBlock('access_sociallogin_provider_connected');\n } else {\n $this->_objTpl->parse('access_sociallogin_provider_connected');\n $this->_objTpl->hideBlock('access_sociallogin_provider_disconnected');\n }\n\n $this->_objTpl->parse('access_sociallogin_provider');\n }\n }", "protected function connecting($user) {\n // Override to handle a connecting user, after the instance of the User is created, but before\n // the handshake has completed.\n }", "function manageConnect($data){\n\t$login = secure($data['login']);\n\t$pwd = secure($data['pwd']);\n\t\t\n\t//verify characters\n\t$test= checkChar($login);\n\tif(!$test){\n\t\t//trying to connect the user\n\t\t$connected= connect($login, $pwd);\n\t\t\t\n\t\tif($connected){\n\t\t\tredirect(\"home\");\t\n\t\t}else{\n\t\t\tredirect(\"login\", \"&callback=DATA_ERROR\");\n\t\t}\n\t}\n\telse{\n\t\tredirect(\"login\", \"&callback=\".$test);\n\t}\n}", "function b2c_has_social_login() {\n\treturn ! empty( b2c_get_current_user_auth_provider() );\n}", "public function connect($user)\n {\n $admin = $this->getUsersModel()->getRole($user['email']);\n if($admin == 2)\n {\n $this->getSession()->write('prof', true);\n $this->getSession()->write('admin', false);\n }\n elseif ($admin == 3)\n {\n $this->getSession()->write('admin', true);\n $this->getSession()->write('prof', false);\n }\n else\n {\n $this->getSession()->write('prof', false);\n $this->getSession()->write('admin', false);\n }\n $this->session->write('auth', $user['email']);\n $this->session->write('id_user', $user['id_user']);\n }", "protected function isConnect()\n {\n if($_SESSION['statut'] !== 'user' AND $_SESSION['statut'] !=='admin')\n {\n header('Location: index.php?route=front.connectionRegister&access=userDenied');\n exit;\n }\n }", "public function social_login()\n {\n \n \tif ($this->ion_auth->logged_in()) {\n \t\t$this->data['userInformation'] = $this->ion_auth->user()->row();\n \t}\n \t$this->data['loggedinuserinformation'] = $this->basic_information_of_mine($this->data['userInformation']->id);\n \t$this->data['userid'] = $this->data['userInformation']->id;\n \t\n \t$this->data[\"facebook_status\"] = $this->admin_model->getStoredHybridSession($this->data['userid'], \"Facebook\");\n \t\n \tif(!empty($this->data['facebook_status'][0])) {\n\t \tif($this->data[\"facebook_status\"] != \"0\") {\n\t \t\t$this->data[\"facebook_profile\"] = $this->get_profile(\"Facebook\");\n\t \t\t//owndebugger($this->data['facebook_profile']);\n\t \t}\n \t} else {\n \t\t$this->data[\"facebook_profile\"] = 0;\n \t}\n \t$this->data['title'] = \"Social Login\";\n \n \t$this->load->view('layouts/header', $this->data);\n \t$this->load->view('settings/social_login', $this->data);\n \t$this->load->view('layouts/footer', $this->data);\n }", "function is_user_connected_with($service){\n\tglobal $user_ID;\n\tswitch($service){\n\t\tcase 'facebook':\n\t\t\treturn (boolean) get_facebook_id($user_ID);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t}\n}", "public function connect_to_site() {\n\t\treturn false;\n\t}", "protected function connecting($user)\n\t{\n\t\t// Override to handle a connecting user, after the instance of the User is created, but before\n\t\t// the handshake has completed.\n\t}", "public function social_network(){\r\n\t\tif($this->logged_in){\r\n\t\t\t\r\n\t\t\t$networks = Kohana::config('social_network.networks');\r\n\t\t\t$save_data = $this->input->post('save_data',null);\r\n\t\t\tif($save_data){\r\n\t\t\t\tforeach($networks as $network){\r\n\t\t\t\t\t$fieldname = str_replace(\".\",\"\",$network);\r\n\t\t\t\t\t$this->user->$fieldname = $this->input->post($fieldname, null, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->user->save();\r\n\t\t\t\techo json_encode(array('msg'=>'ok', 'data'=>''));\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$view = new View('social_network');\r\n\t\t\t$view->networks = $networks;\r\n\t\t\t$view->lang = Kohana::lang('user');\r\n\t\t\t$view->user = $this->user;\r\n\t\t\r\n\t\t\t$view->render(TRUE);\r\n\t\t} else Kohana::show_404();\r\n\t}", "public function isConnected()\n {\n $oConfig = oxRegistry::getConfig();\n\n if (!$oConfig->getConfigParam(\"bl_showFbConnect\")) {\n return false;\n }\n\n if ($this->_blIsConnected !== null) {\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = false;\n $oUser = $this->getUser();\n\n if (!$oUser) {\n $this->_blIsConnected = false;\n\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = true;\n try {\n $this->api('/me');\n } catch (FacebookApiException $e) {\n $this->_blIsConnected = false;\n }\n\n return $this->_blIsConnected;\n }", "private static function linkToNet()\n\t{\n\t\tif(!Loader::includeModule('socialservices'))\n\t\t\treturn false;\n\n\t\tif(self::isLinkedToNet())\n\t\t\treturn true;\n\n\t\t$result = false;\n\t\t$request = \\Bitrix\\Main\\Context::getCurrent()->getRequest();\n\t\t$host = ($request->isHttps() ? 'https://' : 'http://').$request->getHttpHost();\n\t\t$registerResult = \\CSocServBitrix24Net::registerSite($host);\n\n\t\tif(is_array($registerResult) && isset($registerResult[\"client_id\"]) && isset($registerResult[\"client_secret\"]))\n\t\t{\n\t\t\tOption::set('socialservices', 'bitrix24net_domain', $host);\n\t\t\tOption::set('socialservices', 'bitrix24net_id', $registerResult[\"client_id\"]);\n\t\t\tOption::set('socialservices', 'bitrix24net_secret', $registerResult[\"client_secret\"]);\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function connect($user){\n $this->session->set('auth',$user);\n }", "public function showFbConnectToAccountMsg()\n {\n if ($this->getConfig()->getRequestParameter(\"fblogin\")) {\n if (!$this->getUser() || ($this->getUser() && $this->getSession()->getVariable('_blFbUserIdUpdated'))) {\n return true;\n } else {\n return false;\n }\n }\n\n return false;\n }", "static function momentConnect()\r\n {\r\n $user = self::getCurrentUser();\r\n\r\n if ($user !== NULL)\r\n {\r\n $user->setOffline(0);\r\n self::updateUser($user);\r\n }\r\n }", "public function isConnected()\n\t{\n\t\treturn $this->isUser() || $this->isOrga();\n\t}", "abstract protected function isSocialUser($type);", "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 usingSocialAccount()\n {\n return ( ! is_null($this->provider) && ! is_null($this->provider_id) ) ? true : false;\n }", "public function loginExistingUser() {\n\n // Check whether remote account with requested email exists:\n try {\n $this->sso = dosomething_canada_get_sso();\n\n if ($this->sso->authenticate($this->email, $this->password)) {\n $this->remote_account = $this->sso->getRemoteUser();\n }\n }\n catch (Exception $e) {\n\n // The only users that exist locally but not remotely should be admin\n // accounts that were created before SSO integration. These should be\n // created remotely as well.\n $this->sso->propagateLocalUser(\n $this->email,\n $this->password,\n dosomething_canada_create_sso_user($this->email, $this->password, $this->local_account)\n );\n }\n return TRUE;\n }", "public function isConnected()\n\t{\n\t\t// TODO: Make this check the login functionality or something..!!\n\t\treturn true;\n\t}", "public function InitOtherUser()\n {\n $login = trim( strip_tags( _v('login', '') ) );\n //if link has login\n if ($login)\n {\n if ($this->IsAuth() && $login==$this->mUserInfo['Name'])\n {\n //show current user profile\n $this->mOtherUserId = 0;\n return false; \n }\n else\n {\n $this->mOtherUserInfo = UserQuery::create()\n ->Select(array('Id', 'Email', 'Status', 'Pass', 'LastReload', 'FirstName', 'LastName', 'Name', 'Blocked', 'BlockReason', 'Country',\n 'Avatar', 'Location', 'HideLoc', 'About', 'BandName', 'Likes', 'Dob', 'Gender', 'YearsActive', 'Genres', 'Members', 'Website', 'Bio', 'RecordLabel', 'RecordLabelLink', 'UserPhone', 'State', 'HashTag', 'FbOn', 'TwOn', 'InOn'))\n ->where('LOWER(Name) = \"' . ToLower( $login ) . '\"')\n\t\t\t\t\t->filterByEmailConfirmed(1)\n\t\t\t\t\t->filterByBlocked(0)\n ->filterByStatus(1, '>=')->findOne();\n\n if (!empty($this->mOtherUserInfo)) \n {\n $this->mOtherUserId = $this->mOtherUserInfo['Id'];\n\n\t\t\t\t\t$genres_list = User::GetGenresList();\n\t\t\t\t\t\n\t\t\t\t\t$genresListArr = explode(',',$this->mOtherUserInfo['Genres']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tforeach($genresListArr as $key=> $val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$userGenres .= $genres_list[$val].'/';\n\t\t\t\t\t}\n\t\t\t\t\t$this->mOtherUserInfo['GenresList'] = trim($userGenres, '/');\t\n\n\t\t\t\t//Fellow count\n\t\t\t\t$this->mOtherUserInfo['FollowersCount'] = UserFollow::GetFollowersUserListCount($this->mOtherUserInfo['Id'], USER_FAN);\n\t\t\t\t\n\t\t\t\t$memTrack = unserialize($this->mOtherUserInfo['Members']);\t\t\t\n\t\t\t\t$this->mOtherUserInfo['Members'] = $memTrack[0];\n\t\t\t\t$this->mOtherUserInfo['Tracks'] = $memTrack[1];\n\n\t\t\t\t\t\t\t\t\t\t\n } else {\n\t\t\t\t\t$this->mOtherUserId = -1;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n return true;\n }\n }\n }", "public function isConnected()\n {\n return !is_null($this->user);\n }", "public function isConnected()\n {\n if ($this->connect) {\n return $this->connect;\n }\n if (!empty($_SESSION[ 'token_connected' ])) {\n if (!($user = $this->getUserActivedToken($_SESSION[ 'token_connected' ]))) {\n return false;\n }\n\n $this->connect = $_SESSION[ 'token_connected' ] == $user['token_connected']\n ? $user\n : false;\n\n return $this->connect;\n }\n\n return false;\n }", "public static function isConnected() {\n return isset($_SESSION['userid']);\n }", "function login_init() {\n\n\t\t\t$current_user_id = get_current_user_id();\n\n\t\t\tif ( $current_user_id ) {\n\n\t\t\t\t$is_merge = false;\n\t\t\t\tif ( isset( $_REQUEST[\"isMerge\"] ) && $current_user_id !== null ) {\n\t\t\t\t\tif ( $_REQUEST[\"isMerge\"] === 1 || $_REQUEST[\"isMerge\"] === '1' ) {\n\t\t\t\t\t\t$is_merge = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$linkid_user_id = get_user_meta( $current_user_id, self::WP_USER_META_VALUE_LINKID_USER_ID, true );\n\n\t\t\t\tif ( $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start merging. Logged in user already linked to linkID account\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t} else if ( ! $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start login. User already logged in. Please wait while you are being redirected.\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse, false, true, $this->get_redirect_url( wp_get_current_user() ) ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$linkIDAuthnSession = Link_WP_LinkID::start_authn_request();\n\n\t\t\t// generate the response\n\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromAuthnSession( $linkIDAuthnSession ) );\n\n\t\t\t// response output\n\t\t\theader( \"Content-Type: application/json\" );\n\t\t\techo $response;\n\n\t\t\tdie();\n\t\t}", "public function handleProviderCallback()\n {\n $userProvider = Socialite::driver('google')->user();\n\n $name = $userProvider->getName();\n\n $email = $userProvider->getEmail();\n\n $providerId = $userProvider->getId();\n\n $socialLogin = SocialLogin::whereProviderId($providerId)->first();\n \n if ($socialLogin) {\n $user = User::whereId($socialLogin->user_id)->first();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (!$socialLogin) {\n $user = User::whereEmail($email)->first();\n\n if (!$user) {\n $user = new User();\n $user->name = $name;\n $user->email = $email;\n $user->password = bcrypt(md5(str_random(16)));\n $user->active = true;\n $user->save();\n $confirmationToken = str_random(31) . $user->id;\n $user->confirmation_token = $confirmationToken;\n $user->save();\n\n $this->profileRepository->createProfile($user);\n \n $this->wishListRepository->createWishList($user->id);\n }\n\n $sLogin = new SocialLogin();\n $sLogin->user_id = $user->id;\n $sLogin->provider_id = $providerId;\n $sLogin->provider_name = 'google';\n $sLogin->save();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }", "public function check_user_social(){\n\t\t\treturn $this->dao->check_user_social($this->db, $_POST['iduser']);\n\t\t}", "function userConnecte(){\n\tif(isset($_SESSION['membre'])){\n\t\treturn TRUE;\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "protected function isUserAllowedToLogin() {}", "public function connectUser() {\n\t\t\t$errors = array();\n\t\t\tif(!empty($_POST)) {\n\t\t\t\t$pseudo = $_POST['pseudo'];\n\t\t\t\t$password = $_POST['password'];\n\t\t\t\t$users = new Model_Users();\n\t\t\t\t$connect_user = $users->connectUsers($pseudo, $password, $errors);\n\t\t\t\tif(empty($connect_user)) {\n\t\t\t\t\t$errors['dontexist'] = \"Vous n'existez pas\";\n\t\t\t\t}\t\n\t\t\t}\n\t\t\trequire_once ($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/pages/connexion.php\");\t\n\t}", "function isUserConnected() {\n return isset($_SESSION['login']);\n}", "private function attemptLogin($user){\n\n }", "public function checksocialCustomers()\n {\n $this->setRules([ 'login_type' => 'required|in:normal,fb,google+','email' => 'required|max:100|email','token' => 'required','social_user_id' => 'required','name' => 'required' ]);\n $this->_validate();\n\n $type = ($this->request->login_type == 'fb') ? 'facebook' : (($this->request->login_type == 'google+') ? 'google' : '');\n return $this->registerSocialUser($this->request->all(), $type);\n }", "public function loginViaFacebook()\n { \n $userFB = $this->facebook->getUserFromRedirect();\n $userDB = User::where('facebook_id', $userFB->getId())->first();\n\n if (! is_null($userDB)) {\n // User already exists, check \"first time visit\" state (old)\n if ($userDB->old == 0) {\n $userDB->update(['old' => 1]);\n $userDB->save();\n }\n //Authenticate user\n Auth::loginUsingId($userDB->id);\n return redirect('/welcome');\n }\n // User not found in database, create it\n $this->createAndLoginUser($userFB);\n return redirect('/welcome');\n }", "public function connectUser () {\n\n if (!empty($_POST)) {\n // Suppresion du isset et mis du 2eme if en else if\n if (empty($_POST['login'])) {\n $_SESSION['errors']['login'] = \"Veuillez indiquez votre login ou votre adresse mail pour vous connecter.\";\n } else if (UsersClass::checkLogin($_POST['login'], true) === false) {\n $_SESSION['errors']['login'] = \"Le login ou l'adresse e-mail indiqué n'existe pas. Il se peut aussi qu'il n'est pas encore activé.\";\n } else if (empty($_POST['password'])) {\n $_SESSION['errors']['password'] = \"Veuillez indiquez votre mot de passe pour vous connecter.\";\n } else if ($this->checkPassword($_POST['password'], $_POST['login']) === false) {\n $_SESSION['errors']['password'] = \"Le mot de passe indiqué est éronné, veuillez entrer le bon mot de passe pour vous connecter.\";\n } else {\n $login = htmlentities($_POST['login']);\n $sql = \"SELECT * FROM users WHERE :login = username OR :login = email AND activated = 1\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':login', $_POST['login']);\n $query->execute();\n $result = $query->fetch();\n\n $_SESSION['auth']['id_user'] = $result['id_user'];\n header('Location: ' . URL . '/pages/users/profil.php');\n }\n }\n }", "public function external_login($provider) {\n\t\tif ($provider == User_External_Model::PROVIDER_FACEBOOK && $fb_uid = FB::instance()->get_loggedin_user()) {\n\n\t\t\t// Load the external user\n\t\t\t$user = User_Model::find_user_by_external($fb_uid, $provider);\n\n\t\t\tif ($user->loaded && $this->complete_login($user)) {\n\t\t\t\t$this->session->set($this->config['session_key'] . '_provider', $provider);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasUserConnected() {\n $accessTokenIG = get_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME );\n $accessTokenFB = get_option( self::FACEBOOK_TOKEN );\n\n return ! empty( $accessTokenIG ) || ! empty( $accessTokenFB );\n }", "function connectUser($facebook, $facebookProfil){\n $facebookId= $facebookProfil['id'];\n \n // try to find if user exist in database\n $user = User::findUserByFacebookId($facebookId);\n\n // create a user in database if not\n if ($user == null) {\n $username = $facebookProfil[\"username\"];\n $last_name = $facebookProfil[\"last_name\"];\n $first_name = $facebookProfil[\"first_name\"];\n $email = $facebookProfil[\"email\"];\n $token = $facebook->getAccessToken();\n $score = 0;\n\n $newUser = new User($facebookId, $username, $first_name, $last_name, $email, $token, $score);\n User::add($newUser);\n\n Session::getInstance()->setUserSession($newUser);\n } else {\n Session::getInstance()->setUserSession($user[0]);\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 getLogin($social){\n\t\ttry{\n\t\t\tswitch($social){\n\t\t\t\tcase 'facebook':\n\t\t\t\t\t$su = \\Social::facebook('user');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'google':\n\t\t\t\t\t$su = \\Social::google('user');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$su = null;\n\t\t\t}\n\n\t\t\tif ($su===null)\n\t\t\t\treturn \\Redirect::route('frontend.index');\n\n\t\t\t$m = \\Member::where('uid', '=', $su->id)->where('social', '=', $social)->first();\n\n\t\t\tif ($m==null){\n\t\t\t\t$m = new \\Member;\n\t\t\t\t$m->uid = $su->id;\n\t\t\t\t$m->social = $social;\n\t\t\t\t$m->name = $su->name;\n\t\t\t\t$m->email = $su->email;\n\n\t\t\t\tif ($social=='facebook'){\n\t\t\t\t\tif (isset($su->birthday))\n\t\t\t\t\t\t$m->birthday = date('Y-m-d', strtotime($su->birthday));\n\t\t\t\t\tif (isset($su->gender))\n\t\t\t\t\t\t$m->gender = substr($su->gender, 0, 1);\n\t\t\t\t}\n\t\t\t\t$m->save();\n\t\t\t}\n\n\t\t\t// register user into Auth that is a global variable\n\t\t\t\\Auth::login($m);\n\t\t\treturn \\Redirect::route('frontend.index');\n\t\t}catch(Exception $e){\n\t\t\techo $e->getMessage();\n\t\t\texit;\n\t\t}\n\t}", "public function before() {\n\t\t\n\t\t$this->session = Session::instance();\n $user_id = $this->session->get('user_id');\n\t\t\n if (!empty($user_id) ) {\n $this->user = ORM::factory('user',$user_id);\n View::bind_global('user', $this->user);\n \n\t\t} else if ($this->_auth_required) {\n\t\t\t$this->request->redirect(NON_SIGNED_IN_HOME);\n\t\t}\n\t \n\t\t$this->load_domain_channel();\n\t\t$this->load_user_channel($this->user);\n\t\t\n\t\tif ($this->user_channel == null){\n\t\t\t/* \n\t\t\tuser who doesnt have a channel can access anything \n\t\t\t*/\n\t\t\treturn;\n\t\t} else { \n\t\t\t/* \n\t\t\tUser trying to access direct domain is not allowed\n\t\t\tUser trying to access another sub domain is not allowed\n\t\t\t*/\n\t\t\t$user_domain_url = \"http://\".$this->user_domain;\n\t\t\t\n\t\t\tif($this->channel == null) {\n\t\t\t\t/* User trying to access base domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t\t\n\t\t\t} else if ($this->channel->id != $this->user_channel->id){\n\t\t\t\t/* User trying to access some other domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t} else {\n\t\t\t\t// doing the correct access leave that poor chap alone.\n\t\t\t}\n\t\t} \n\t}", "private function _check_socials_access() {\n\n return Access_token::inst()->check_socials_access($this->c_user->id);\n\n }", "public function githubRedirect(){\n $user = Socialite::driver('github')->user();\n\n // if this user does not exist, add them \n // If they do, get the model,\n // either way authenticate the user into the application and redirect afterwards\n\n Auth::login($user);\n }", "public function startCommunication()\n {\n if ($this->provider->login()) {\n $this->provider->keepAuth = true;\n }\n }", "function CheckLogin($currentUri=NULL)\r\n {\r\n $this->Rest->CheckLogin($currentUri);\r\n }", "public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }", "function connect() {\n\n\t\t// only if logins are set ...\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\n\t\t\t$this->console_text('[Aseco] Try to connect to server on {1}:{2}',\n\t\t\t\t$this->server->ip,\n\t\t\t\t$this->server->port);\n\n\t\t\t// connect to the server ...\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->console_text('[Aseco] Authenticated with username \\'{1}\\' and password \\'{2}\\'',\n\t\t\t\t$this->server->login, $this->server->pass);\n\n\t\t\t// logon the server ...\n\t\t\t$this->client->addCall('Authenticate', array($this->server->login, $this->server->pass));\n\n\t\t\t// enable callback system ...\n\t\t\t$this->client->addCall('EnableCallbacks', array(true));\n\n\t\t\t// start query ...\n\t\t\tif (!$this->client->multiquery()){\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->client->getResponse();\n\n\t\t\t// connection established ...\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\t// connection failed ...\n\t\t\treturn false;\n\t\t}\n\t}", "function playerConnect($player) {\n\n\t\t// request information about the new player\n\t\t// (removed callback mechanism here, as GetPlayerInfo occasionally\n\t\t// returns no data and then the connecting login would be lost)\n\t\t$login = $player[0];\n\t\t$this->client->query('GetDetailedPlayerInfo', $login);\n\t\t$playerd = $this->client->getResponse();\n\t\t$this->client->query('GetPlayerInfo', $login, 1);\n\t\t$player = $this->client->getResponse();\n\n\t\t// check for server\n\t\tif (isset($player['Flags']) && floor($player['Flags'] / 100000) % 10 != 0) {\n\t\t\t// register relay server\n\t\t\tif (!$this->server->isrelay && $player['Login'] != $this->server->serverlogin) {\n\t\t\t\t$this->server->relayslist[$player['Login']] = $player;\n\n\t\t\t\t// log console message\n\t\t\t\t$this->console('<<< relay server {1} ({2}) connected', $player['Login'],\n\t\t\t\t stripColors($player['NickName'], false));\n\t\t\t}\n\n\t\t// on relay, check for player from master server\n\t\t} elseif ($this->server->isrelay && floor($player['Flags'] / 10000) % 10 != 0) {\n\t\t\t; // ignore\n\t\t} else {\n\t\t\t$ipaddr = isset($playerd['IPAddress']) ? preg_replace('/:\\d+/', '', $playerd['IPAddress']) : ''; // strip port\n\n\t\t\t// if no data fetched, notify & kick the player\n\t\t\tif (!isset($player['Login']) || $player['Login'] == '') {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CONNECT_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CONNECT_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('GetPlayerInfo failed for ' . $login . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// if player IP in ban list, notify & kick the player\n\t\t\t} elseif (!empty($this->bannedips) && in_array($ipaddr, $this->bannedips)) {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('BANIP_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Ban', array($login, $this->formatColors($this->getChatMessage('BANIP_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('Player ' . $login . ' banned from ' . $ipaddr . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// client version checking\n\t\t\t} else {\n\t\t\t\t// extract version number\n\t\t\t\t$version = str_replace(')', '', preg_replace('/.*\\(/', '', $playerd['ClientVersion']));\n\t\t\t\tif ($version == '') $version = '2.11.11';\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CLIENT_ERROR'));\n\n\t\t\t\t// if invalid version, notify & kick the player\n\t\t\t\tif ($this->settings['player_client'] != '' &&\n\t\t\t\t strcmp($version, $this->settings['player_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete player client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// if invalid version, notify & kick the admin\n\t\t\t\tif ($this->settings['admin_client'] != '' && $this->isAnyAdminL($player['Login']) &&\n\t\t\t\t strcmp($version, $this->settings['admin_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete admin client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create player object\n\t\t\t$player_item = new Player($playerd);\n\t\t\t// set default window style, panels & background\n\t\t\t$player_item->style = $this->style;\n\t\t\t$player_item->panels['admin'] = set_panel_bg($this->panels['admin'], $this->panelbg);\n\t\t\t$player_item->panels['donate'] = set_panel_bg($this->panels['donate'], $this->panelbg);\n\t\t\t$player_item->panels['records'] = set_panel_bg($this->panels['records'], $this->panelbg);\n\t\t\t$player_item->panels['vote'] = set_panel_bg($this->panels['vote'], $this->panelbg);\n\t\t\t$player_item->panelbg = $this->panelbg;\n\n\t\t\t// adds a new player to the internal player list\n\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t// log console message\n\t\t\t$this->console('<< player {1} joined the game [{2} : {3} : {4} : {5} : {6}]',\n\t\t\t $player_item->pid,\n\t\t\t $player_item->login,\n\t\t\t $player_item->nickname,\n\t\t\t $player_item->nation,\n\t\t\t $player_item->ladderrank,\n\t\t\t $player_item->ip);\n\n\t\t\t// replace parameters\n\t\t\t$message = formatText($this->getChatMessage('WELCOME'),\n\t\t\t stripColors($player_item->nickname),\n\t\t\t $this->server->name, XASECO2_VERSION);\n\t\t\t// hyperlink package name & version number\n\t\t\t$message = preg_replace('/XASECO2.+' . XASECO2_VERSION . '/', '$l[' . XASECO_ORG . ']$0$l', $message);\n\n\t\t\t// send welcome popup or chat message\n\t\t\tif ($this->settings['welcome_msg_window']) {\n\t\t\t\t$message = str_replace('{#highlite}', '{#message}', $message);\n\t\t\t\t$message = preg_split('/{br}/', $this->formatColors($message));\n\t\t\t\t// repack all lines\n\t\t\t\tforeach ($message as &$line)\n\t\t\t\t\t$line = array($line);\n\t\t\t\tdisplay_manialink($player_item->login, '',\n\t\t\t\t array('Icons64x64_1', 'Inbox'), $message,\n\t\t\t\t array(1.2), 'OK');\n\t\t\t} else {\n\t\t\t\t$message = str_replace('{br}', LF, $this->formatColors($message));\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $player_item->login);\n\t\t\t}\n\n\t\t\t// if there's a record on current map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t// set message to the current record\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t $cur_record->score : formatTime($cur_record->score)),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else { // if there should be no record to display\n\t\t\t\t// display a no-record message\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($this->server->map->name));\n\t\t\t}\n\n\t\t\t// show top-8 & records of all online players before map\n\t\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\t\tshow_maprecs($this, $player_item->login, 1, 0); // from chat.records2.php\n\t\t\t} elseif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\t// or show original record message\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $player_item->login);\n\t\t\t}\n\n\t\t\t// throw main 'player connects' event\n\t\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t\t\t// throw postfix 'player connects' event (access control)\n\t\t\t$this->releaseEvent('onPlayerConnect2', $player_item);\n\t\t}\n\t}", "function loginBegin()\r\n\t{\r\n\t\t// if we have extra perm\r\n\t\tif( isset( $this->config[\"scope\"] ) && ! empty( $this->config[\"scope\"] ) )\r\n\t\t{\r\n\t\t\t$this->scope = $this->scope . \", \". $this->config[\"scope\"];\r\n\t\t}\r\n\r\n\t\t// get the login url \r\n\t\t$url = $this->api->getLoginUrl( array( 'scope' => $this->scope, 'redirect_uri' => $this->endpoint ) );\r\n\r\n\t\t// redirect to facebook\r\n\t\tHybrid_Auth::redirect( $url ); \r\n\t}", "public function facebookRedirect(){\n $github_user = Socialite::driver('facebook')->redirect();\n }", "public function socialLogin($provider)\n {\n if (! in_array($provider, $this->socialiteHelper->getAcceptedProviders())) {\n // return redirect()->route(home_route())->withFlashDanger(__('auth.socialite.unacceptable', ['provider' => $provider]));\n return 1;\n }\n \n return Socialite::driver($provider)->redirect();\n }", "public function LoginCheck()\n {\n $protocol = Yii::app()->params['protocol'];\n $servername = Yii::app()->request->getServerName();\n $user = Yii::app()->session['username'];\n if (empty($user)) {\n $returnUrl = $protocol . $servername . Yii::app()->homeUrl;\n $this->redirect($returnUrl);\n }\n }", "public function handleSocialCallback($social)\n {\n\n try {\n\n // get user token\n $user = Socialite::driver($social)->user();\n //dd($user);\n\n $log = new Logger('stderr');\n $stream = new StreamHandler('php://stderr', Logger::WARNING);\n $stream->setFormatter(new JsonFormatter());\n $log->pushHandler($stream);\n // add records to the log\n $log->warning('this is the user',['user'=>$user]);\n // $log->error($user);\n\n // check exist user in database\n $finduser = User::where('email', $user->getEmail())->first();\n\n if($finduser){\n // login if user exist and redirect to homepage\n Auth::login($finduser);\n\n return view('home');\n\n }else{\n // if not exist make create and login with new user and redirect to homepage\n $newUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n //'github_id'=> $user->id,\n 'password' => encrypt('ahmed123456a')\n ]);\n\n Auth::login($newUser);\n\n return view('home');\n }\n // if take exception example after login make drop tables return this exception not user found\n\n } catch (Exception $e) {\n\n\n dd($e->getMessage() . \"Not User Found\");\n }\n\n\n\n }", "public function connexionIntervenantLogin(){\n }", "function connection()\n {\n $user = new User();\n $error = null;\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') { // if a submission of the form (=> a connection attempt ) has been made\n \n if (!empty($_POST['login']) && !empty($_POST['password'])) {\n \n $userManager = new UserManager();\n\n try {\n $userRegister = $userManager->findByUserLogin($_POST['login']);\n \n // we hashed the password \n $hashPasswords = hash('md5', $_POST['password']);\n\n if ($userRegister->getPassword() === $hashPasswords) {\n\n session_start();\n \n $_SESSION['connection'] = $userRegister->getId(); // creation of the session which records the id of user who has just connected \n \n $userLogged = $userRegister; // to have the user logger if later in the code we do not call the function \"Auth :: check (['administrator'])\" or \"Auth :: sessionStart ()\" \n\n if ($userManager->getUserSatus($_SESSION['connection'])['status'] === 'administrateur') {\n header('Location: /backend/adminPosts'); // if user is administrator, he goes to the admin bachend \n return http_response_code(302);\n }else if ($userManager->getUserSatus($_SESSION['connection'])['status'] === 'abonner' and !is_null($userRegister->getValidate())) { // si le user qui se connect est de type \"abonner\" et que sont compte a était valider par l administrateur du site (=> validate ! null)\n header('Location: /userFrontDashboard/'.$userRegister->getId()); // if user is a subscriber, he goes on his dashboard \n return http_response_code(302);\n }else {\n header('Location: /?unauthorizedAccess=true');\n }\n } else { \n $error = 'mot de passe incorrect';\n }\n } catch (Exception $e){\n $error = $e->getMessage();\n }\n } else {\n $error = 'remplissez tout les champs du formulaire s\\'il vous plait !!!';\n }\n }\n\n $form = new Form($user);\n\n require'../app/Views/backViews/backConnectionView.php';\n }", "public function canManageSocialNetworks(AuthInterface $auth)\n {\n return $auth->isSuperAdmin();\n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "function checkUserLogin() {\n\t$index_page = \"http://\".$_SERVER['HTTP_HOST'].\"/v3.2/index.php\";\n\tif(is_loggedIn()) {\n\t\t//user logged in to cb\n\t\tif(is_linkedInAuthorized()) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//user logged not authorized - weird case - removed the cookies manually\n\t\t\terror_log(\"User logged in but not authorized to linkedin\");\n\t\t\t//Initiate linked in authorization\n\t\t\theader('Location: ' . $index_page);\n\t\t}\n\t}else {\n\t\t//Not logged in redirect him to index page for login in\n\t\terror_log(\"User not logged in \");\n\t\theader('Location: ' . $index_page);\n\t}\n}", "function checkUserLogin() {\n\t$index_page = \"http://\".$_SERVER['HTTP_HOST'].\"/v3.2/index.php\";\n\tif(is_loggedIn()) {\n\t\t//user logged in to cb\n\t\tif(is_linkedInAuthorized()) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//user logged not authorized - weird case - removed the cookies manually\n\t\t\terror_log(\"User logged in but not authorized to linkedin\");\n\t\t\t//Initiate linked in authorization\n\t\t\theader('Location: ' . $index_page);\n\t\t}\n\t}else {\n\t\t//Not logged in redirect him to index page for login in\n\t\terror_log(\"User not logged in \");\n\t\theader('Location: ' . $index_page);\n\t}\n}", "protected function detectLoginProvider() {}", "function connect($pseudo, $pwd)\n{\n\t$authenticated = false;\n\t\n\t//salt used to store passwords\n\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t//get users list\n\t$users = getJSON(USERS);\n\t\t\n\tif($users){\n\t\t$i = 0;\n\t\twhile($i < count($users) && $users[$i]['username'] != $pseudo){\t\t\t\n\t\t\t$i++;\t\n\t\t}\n\t\t\n\t\t//if the $pseudo has been found\n\t\tif($i < count($users)){\n\t\t\t$name= $users[$i]['username'];\n\t\t\t$mdp = $users[$i]['password'];\n\t\t\t$lvl = $users[$i]['level'];\n\t\t\tif(md5($pwd.$salt) == $mdp)\n\t\t\t{\n\t\t\t\t$_SESSION['id'] = $pseudo;\n\t\t\t\t$_SESSION['lvl'] = $lvl;\n\t\t\t\t$authenticated = true;\n\t\t\t\tsetcookie(\"username\", $pseudo);\t\n\t\t\t}\n\t\t}\t\n\t}\t\n\treturn \t$authenticated;\n}", "public function _make_sure_admin_is_connected() {\n if(!$this->_is_admin_connected()){\n \n if($this->uri->uri_string() != \"autorisation-necessaire\"){\n $this->session->set_userdata('REDIRECT', $this->uri->uri_string());\n }\n redirect(base_url().'admin/identification');\n\t\t\tdie();\n }\n }", "public function handleProviderCallback()\n\n {\n $user = Socialite::driver('facebook')->user();\n\n $gender = $user->user['gender'];\n $ext_id = $user->user['id'];\n $verified = $user->user['verified'];\n $avatar = $user->avatar;\n $name = explode(' ',$user->name);\n\n\n $social_exist = User::where('ext_id',$ext_id)->first();\n\n\n if($social_exist)\n {\n return $this->loginUsingId($social_exist->id);\n }\n else\n {\n $user_create = User::create([\n 'uuid' => Uuid::generate(5,$user->email, Uuid::NS_DNS),\n \"firstname\" => \"$name[0]\",\n \"lastname\" => \"$name[1]\",\n \"email\" => \"$user->email\",\n 'password' => bcrypt($ext_id),\n \"gender\" => \"$gender\",\n \"avatar\" => $avatar,\n \"ext_id\" => $ext_id,\n \"ext_source\" => \"facebook\",\n \"ext_verified\" => \"$verified\"\n ]);\n\n $userObj = User::find($user_create->id);\n\n if(Event::fire(new WelcomeUser($user_create)))\n {\n return $this->loginUsingId($user_create->id);\n }else\n {\n //Redirect to error page and log in the incident\n }\n }\n }", "public function handleProviderCallback()\n {\n $googleApi = Socialite::driver('google')->user();\n $currentUserRp = User::where('Email', $googleApi->getEmail())->first();\n $sessionId = $this->generateRandomString(10);\n\n if( $currentUserRp )\n {\n Auth::login($currentUserRp);\n\n $currentUserRp->google_id = $googleApi->getId();\n $currentUserRp->google_lastsessionid = $sessionId;\n $currentUserRp->save();\n \n $currentGoogleUser = googleUser::find($googleApi->getId());\n $currentGameUser = gameUser::find(Auth::user()->ID);\n\n if( !$currentGoogleUser )\n {\n $addGooglerUser = googleUser::create([ \n 'gouser_id' => $googleApi->getId(),\n 'gouser_name' => $googleApi->getName(),\n 'gamuser_id' => Auth::user()->ID,\n 'gouser_nick' => Auth::user()->Nick,\n 'gouser_avatar' => $googleApi->getAvatar(),\n 'gouser_email' => $googleApi->getEmail(),\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n ]);\n }\n\n if( !$currentGameUser )\n {\n $addGameUser = gameUser::create([ \n 'gamuser_id' => Auth::user()->ID,\n 'gamuser_nick' => Auth::user()->Nick,\n ]);\n }\n\n $logGoogleLogin = googleUserLogin::create([\n 'gosession_token' => $sessionId,\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n 'gouser_id' => $googleApi->getId()\n ]);\n\n return redirect('/');\n }\n else\n {\n return redirect()->route(\"api.result\", ['result_state' => 'error', 'result_aux' => \"ERR04\"]);\n }\n\n\n\n\n /*\n $myUser = Socialite::driver('google')->user();\n $manageUser = User::where('Email', $myUser->getEmail())->first();\n\n if( !$manageUser )\n {\n // $manageUser = User::create([\n // 'name' => $myUser->getName(),\n // 'email' => $myUser->getEmail(),\n // 'google_id' => $myUser->getId(),\n // 'google_avatar' => $myUser->getAvatar(),\n // ]);\n return redirect('/unkownemail');\n }\n else {\n Auth::login($manageUser);\n\n if( Auth::user()->Certificado < env(\"AUTH_MINIMUM_CERTIFICATE\") )\n {\n return redirect('/invalidcert');\n }\n\n return redirect('/');\n }\n \n // $user->token;\n */\n }", "private function connectToWhatsApp()\n {\n $this->whatsapp = new \\WhatsProt($this->login, $this->nickname, $this->debug);\n $this->whatsapp->eventManager()->bind('onConnect', [$this, 'connected']);\n $this->whatsapp->eventManager()->bind('onGetMessage', [$this, 'processReceivedMessage']);\n $this->whatsapp->eventManager()->bind('onGetImage', [$this, 'onGetImage']); \n $this->whatsapp->eventManager()->bind('onGetProfilePicture', [$this, 'onGetProfilePicture']);\n \n if ($this->connected == false): \n $this->whatsapp->connect(); // Connect to WhatsApp network \n $this->whatsapp->loginWithPassword($this->password); \n\n if(!empty($this->imageCover)):\n $this->whatsapp->sendSetProfilePicture(\"./uploads/\" . $this->imageCover);\n endif;\n\n return true;\n endif;\n\n return false;\n }", "static protected function checkAccess()\n {\n $cur_user = User::getConnectedUser();\n if (!$cur_user || !$cur_user->canSeeInvitations()) {\n redirectTo('/');\n }\n return $cur_user;\n }", "function _modallogin_connector_log_in($connector_name, $cid = NULL, $consumer = NULL, $access_token = NULL, $request_token = NULL) {\n global $user;\n\n if (user_is_logged_in()) {\n return TRUE;\n }\n\n $connector = _connector_get_connectors($connector_name);\n if (!$connector) {\n return FALSE;\n }\n\n //Fetch connector ID\n if ($cid === NULL && isset($connector['id callback']) && is_callable($connector['id callback'])) {\n $cid = call_user_func($connector['id callback'], $connector);\n }\n\n if ($cid === NULL) {\n return FALSE;\n }\n $authname = $connector_name . '__' . $cid;\n $account = user_external_load($authname);\n if (!$account) {\n // Return NULL and not FALSE so that we know we didn't find a user.\n return NULL;\n }\n\n if (!$account) {\n return FALSE;\n }\n\n // @TODO hack! Logintoboggan doesnt allow use to both require validation \n // email AND immediate login, this settings should be set in our own module. \n // For now simply leave the logic intact and force immediate login here.\n global $conf;\n $conf['logintoboggan_immediate_login_on_register'] = TRUE;\n\n $pre_auth = _modallogin_pre_auth();\n $is_first_login = !$account->login;\n\n // User does not need administrator approval.\n if ($account->status) {\n // Email verification is required\n if ($pre_auth && $is_first_login) {\n // User can log in immediately but needs to verify email.\n // Requires LoginToBoggan\n if (variable_get('logintoboggan_immediate_login_on_register', TRUE)) {\n $action = 'create_login_verify';\n }\n // User still needs to verify the email address before logging in.\n else {\n $action = 'create_verify';\n }\n }\n // User doesnt require email verification simply login.\n // @TODO what about !$pre_auth && $is_first_login?\n else {\n $action = 'login';\n }\n }\n // User requires administrator approval\n else {\n $action = 'create_approval';\n }\n\n _modallogin_create_login_action($action, $account, $connector);\n\n return FALSE;\n}", "public function handleFacebookCallback()\n {\n \t$user = Socialite::driver('facebook')->user();\n \t$user_details=$user->user; \n \tif(User::where('fb_id',$user_details['id'])->exists()){\n \t\t$fbloged_user=User::where('fb_id',$user_details['id'])->get();\n \t\t$fbloged_user=$fbloged_user[0]; \t\n \t\t$user_login = Sentinel::findById($fbloged_user->id);\n \t\tSentinel::login($user_login);\n \t\treturn redirect('/');\n \t}else{\n \t\ttry {\n \t\t\t$registed_user=DB::transaction(function () use ($user_details){\n\n \t\t\t\t$user = Sentinel::registerAndActivate([\t\t\t\t\t\t\t\t\n \t\t\t\t\t'email' =>$user_details['id'].'@fbmail.com',\n \t\t\t\t\t'username' => $user_details['name'],\n \t\t\t\t\t'password' => $user_details['id'],\n \t\t\t\t\t'fb_id' => $user_details['id']\n \t\t\t\t]);\n\n \t\t\t\tif (!$user) {\n \t\t\t\t\tthrow new TransactionException('', 100);\n \t\t\t\t}\n\n \t\t\t\t$user->makeRoot();\n\n \t\t\t\t$role = Sentinel::findRoleById(1);\n \t\t\t\t$role->users()->attach($user);\n\n \t\t\t\tUser::rebuild();\n \t\t\t\treturn $user;\n\n\n \t\t\t});\n \t\t\tSentinel::login($registed_user);\n \t\t\treturn redirect('/');\n\n \t\t} catch (TransactionException $e) {\n \t\t\tif ($e->getCode() == 100) {\n \t\t\t\tLog::info(\"Could not register user\");\n\n \t\t\t\treturn redirect('user/register')->with(['error' => true,\n \t\t\t\t\t'error.message' => \"Could not register user\",\n \t\t\t\t\t'error.title' => 'Ops!']);\n \t\t\t}\n \t\t} catch (Exception $e) {\n\n \t\t}\n \t}\n\n\n\n\n\n\n // $user->token;\n }", "public function handleProviderCallback()\n {\n try\n {\n // get user data from Google\n $user = Socialite::driver('google')->user();\n\n // we look for a user with such data\n $existingUser = User::where('provider_id', $user->getId())->first();\n\n if ($existingUser) // if this user exists\n {\n Auth::login($existingUser);\n }\n else // we register a new user\n {\n $newUser = new User();\n\n $newUser->email = $user->getEmail();\n $newUser->provider_id = $user->getId();\n\n // when you login with Google you need to pay attention to that\n // getNickname() method return NULL, then you shall use getName() method to get name of a user\n $newUser->handle_social = $user->getName();\n $newUser->name = $user->getName();\n $newUser->password = bcrypt(uniqid());\n\n $newUser->save();\n\n // after saving user data to the database,\n // we automatically log in this user\n Auth::login($newUser);\n }\n\n flash('Successfully authenticated using Google');\n\n return redirect('/');\n }\n catch(Exception $e)\n {\n dd($e->getMessage());\n }\n }", "public function is_connected($user_id){\n return (bool) get_user_meta($user_id, $this->umeta_id, true);\n }", "public function social_login( $provider, $access_token, $social_id ) {\n\t\t// Define how the social ID meta key looks like in the WP database\n\t\t$social_id_meta_key = '_' . $provider .'_id';\n\n\t\tswitch ( $provider ) {\n\t\t\tcase \"weibo\":\n\t\t\t\t// Get the user info from Weibo\n\t\t\t\t$social_user = $this->weibo_get_user( $access_token, $social_id );\n\t\t\t\t// Parse the user info from Weibo into a wordpress user\n\t\t\t\tif ($social_user['id']) {\n\t\t\t\t\t// Create a user object out of the info from weibo\n\t\t\t\t\t$user = array(\n\t\t\t\t\t\t'user_login' => $social_user['id'] . '@weibo.com', // Should be changed to \"real\" email in order to avoid duplicates\n\t\t\t\t\t\t'display_name' => $social_user['screen_name'],\n\t\t\t\t\t\t'user_nicename' => $social_user['screen_name'],\n\t\t\t\t\t\t'nickname' => $social_user['screen_name']\t\t\t\n\t\t\t\t\t);\n\n\t\t\t\t\t// Create the user's meta data with the social info\n\t\t\t\t\t$user_meta = array (\n\t\t\t\t\t\t$social_id_meta_key => $social_id\n\t\t\t\t\t);\n\n\t\t\t\t\t// Login or register the user\n\t\t\t\t\treturn $this->login_or_register( $provider, $user, $user_meta );\n\n\t\t\t\t// No Weibo user was found, return error\n\t\t\t\t} else {\n\t\t\t\t\treturn new WP_Error( 'USER_api_social_no_user', __( 'Couldn\\'t get a user with provided access_token and UID' ), array( 'status' => 400 ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// No social account matched, return error\n\t\t\tdefault:\n\t\t\t\treturn new WP_Error( 'USER_api_provider_not_supported', __( 'This type of social account is currently not supported.' ), array( 'status' => 400 ) );\n\t\t}\n\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "protected function is_connected_to_proxy() {\n\t\treturn (bool) $this->authentication->is_authenticated()\n\t\t\t&& $this->authentication->credentials()->has()\n\t\t\t&& $this->authentication->credentials()->using_proxy();\n\t}", "public function manageConnection() {\n\t\tif (isset($_POST['connexion'])) {\n\t\t\t$login = $_POST['login'];\n\t\t\t$password = $_POST['password'];\n\t\t\t$this->login($login, $password);\n\t\t}\n\t\telse if (isset($_POST['deconnexion'])) {\n\t\t\t$this->logout();\n\t\t\tPager::redirect('accueil.php');\n\t\t}\n\t}", "public function twitter_connect() {\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $twitter_user = new TwitterUser($account_dbobj);\n $twitter_user->findOne('id='.$merchant_id);\n $twitter_user->setProfileImageUrl($profile['profile_image_url']);\n $twitter_user->setUrl($profile['url']);\n $twitter_user->setLocation($profile['location']);\n $twitter_user->setName($profile['name']);\n $twitter_user->setScreenName($profile['screen_name']);\n $twitter_user->setId($profile['id']);\n $twitter_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $twitter_user, $account_dbobj);\n\n $this->status = 0;\n }", "private function initSocialLogin() : void\n {\n foreach ($this->getActiveSocialLoginProviders() as $provider) {\n config([\n 'services.'.$provider.'.client_id' => config('config.auth.'.$provider.'_client_id'),\n 'services.'.$provider.'.client_secret' => config('config.auth.'.$provider.'_client_secret'),\n 'services.'.$provider.'.redirect' => url('/auth/login/'.$provider.'/callback')\n ]);\n }\n }", "public function canLoginHere()\n {\n if (! $this->_hasVar('can_login_here')) {\n $this->_setVar('can_login_here', true);\n if ($orgId = $this->userLoader->getOrganizationIdByUrl()) {\n if (! $this->isAllowedOrganization($orgId)) {\n $this->_setVar('can_login_here', false);;\n }\n }\n }\n return $this->_getVar('can_login_here');\n }", "public static function connected(){\n\t\trequire_once (File::build_path(array('lib','Security.php'))); \n\t\t$pwd= Security::chiffrer($_GET['password']);\n\n\t\tif(ModelBenevole::checkPassword($_GET['login'], $pwd)){\n\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t$bene = ModelBenevole::select($id);\n\n\t\t\tif($bene->__get('nonce') == null){ \n\t\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t\t$b = ModelBenevole::select($id); \n\t\t\t\t$pagetitle = 'Vous êtes connecté';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'detail'; //renvoie sur le détail \n\t\t\t\t$_SESSION['login'] = $_GET['login'];\n\t\t\t}else{\n\t\t\t\t$pagetitle = 'Compte non validé';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'error'; //renvoie sur l'erreur\n\t\t\t}\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}else{\n\t\t\t$pagetitle = 'Mauvais identifiants et/ou mot de passe';\n\t\t\t$controller = 'benevole';\n\t\t\t$view = 'error';\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}\n\t}", "public function acceptConnection(Request $request)\n {\n $AuthUser = User::where('email', $request->input('authenticated'))->first();\n $user = User::where('name', $request->input('acceptConnectionFrom'))->first();\n $AuthUser->acceptConnectionRequest($user);\n return 'Connected';\n }", "private function checkLogin()\n {\n // save the user's destination in case we direct them to authenticate\n\n // whitelist authentication mechanisms\n if($this->_controller == \"authenticate\")\n return;\n\n // whitelist database reload\n if($this->_controller == \"populatetestdata\")\n return;\n\n if(!isset($_SESSION['userid']))\n {\n // Don't redirect the user to an error page just in principle\n // @todo possible @bug why would it do this?\n if($this->_controller != \"error\" && $this->_controller != \"undefined\")\n {\n $this->slogger->slog(\"saving destination to \" . $this->_controller, SLOG_DEBUG);\n $_SESSION['destination'] = $this->_controller;\n }\n redirect('authenticate');\n\n }\n\n }", "public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }", "private function checkLogin() {\n\t\t$session = $this->Session->read ( 'sessionLogado' );\n\t\tif (empty ( $session )) {\n\t\t\t$this->Session->write ( 'sessionLogado', false );\n\t\t}\n\t\t\n\t\tif ($this->params ['plugin'] == 'users') {\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'home' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'signatures' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "function isConnectedTo($profile_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM connect_list WHERE profile_id= :profile_id AND accountID=:account');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':account'=>$account));\n\t\tif($statement->rowCount() == 0)\n\t\t\treturn false;\n\t\treturn $statement->fetch();\n\t}", "public function handleFacebookCallback()\n {\n try {\n\n $user = Socialite::driver('facebook')->user();\n $isUser = User::where('fb_id', $user->id)->first();\n\n if($isUser){\n Auth::login($isUser);\n return redirect('/home');\n }else{\n $createUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n 'fb_id' => $user->id,\n 'password' => encrypt('admin@123')\n ]);\n\n Auth::login($createUser);\n return redirect('/home');\n }\n\n } catch (\\Exception $exception) {\n return redirect()\n ->route('login')\n ->with('error_string','Authentication Failed!!!');\n }\n }", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "function connectBL() {\n\t $isConnected = \"false\";\n\t // If the form has been correctly filled\n\t if ( !empty($_POST['userId']) && !empty($_POST['password']) )\n\t {\n\t // If the user exists\n\t if ( checkUserIdBL() )\n\t {\n\t // If the password is correct\n\t\t if ( checkHashBL() )\n\t\t {\n\t\t\t $isConnected = \"true\";\n\t\t\t // The session save the user ID\n\t\t\t $_SESSION['userId'] = $_POST['userId'];\n\t\t }\n\t }\n\t }\n\t echo $isConnected;\n }", "public function handleProviderCallback($social)\n {\n $userInfo = Socialite::driver($social)->stateless()->user();\n\n\n //check if user exists and log user in\n $user = User::where('email',$userInfo->email)->first();\n if ($user){\n if (Auth::loginUsingId($user->id)){\n return redirect()->route('profiles.profile.create');\n }\n }\n //else sign the user up\n $userSignUp = User::create([\n 'name'=>$userInfo->name,\n 'email'=>$userInfo->email,\n 'avatar'=>$userInfo->avatar,\n 'provider'=>$social,\n 'is_status'=>'3',\n 'verified'=>1,\n 'provider_id'=>$userInfo->id,\n ]);\n //finally log the user in\n if ($userSignUp){\n if (Auth::loginUsingId($userSignUp->id)){\n return redirect()->route('profiles.profile.create');\n }\n }\n }" ]
[ "0.6420687", "0.6031353", "0.6031353", "0.5945897", "0.5943964", "0.5881448", "0.5848111", "0.5832865", "0.5819307", "0.5801405", "0.5776452", "0.57055235", "0.56671095", "0.56362593", "0.5627655", "0.56029373", "0.55821455", "0.55715835", "0.551929", "0.55121654", "0.5507577", "0.5478629", "0.5464761", "0.54643595", "0.544557", "0.5434917", "0.5416445", "0.5415722", "0.5391632", "0.53895724", "0.5370848", "0.5364623", "0.5363363", "0.5359397", "0.5346897", "0.53335726", "0.532059", "0.530828", "0.5299331", "0.5291708", "0.5288346", "0.5284049", "0.52824", "0.5273949", "0.5267529", "0.52652955", "0.5260679", "0.5250815", "0.5245528", "0.5236201", "0.5209189", "0.5193166", "0.5183899", "0.51811105", "0.5180193", "0.5173532", "0.51678187", "0.5156822", "0.5143062", "0.51405525", "0.51290935", "0.512823", "0.5119691", "0.5111489", "0.5105618", "0.5081579", "0.50681883", "0.50681883", "0.50638515", "0.50638515", "0.50554836", "0.50463706", "0.50391966", "0.503831", "0.5037523", "0.50338507", "0.50319123", "0.5024855", "0.4990861", "0.49857777", "0.49775168", "0.49739453", "0.49738222", "0.4970485", "0.4970389", "0.49651358", "0.4962499", "0.49621734", "0.49596548", "0.4958407", "0.49519092", "0.49506503", "0.49407455", "0.49382296", "0.49249148", "0.49240318", "0.49233848", "0.49211928", "0.4919457", "0.49181405", "0.49175125" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74856156", "0.73803306", "0.7153188", "0.71392506", "0.7061645", "0.7030671", "0.69268984", "0.69268984", "0.6923996", "0.6900626", "0.6893362", "0.6893362", "0.6888315", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171", "0.6868171" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('mes',$this->mes,true); $criteria->compare('anio',$this->anio,true); $criteria->compare('idcomprobante',$this->idcomprobante); $criteria->compare('establecimiento',$this->establecimiento,true); $criteria->compare('puntoemision',$this->puntoemision,true); $criteria->compare('desde',$this->desde,true); $criteria->compare('hasta',$this->hasta,true); $criteria->compare('autorizacion',$this->autorizacion,true); $criteria->compare('fecha',$this->fecha,true); $criteria->compare('cantidad',$this->cantidad); $criteria->compare('idempresa',$this->idempresa); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('diaries')->truncate(); DB::table('diaries')->insert([ [ 'user_id' => 1, 'title' => 'Laravel', 'contents' => 'test', 'writing_time' => Carbon::create(2019, 10, 1), 'created_at' => Carbon::create(2019, 10, 1), 'updated_at' => Carbon::create(2019, 10, 2), ], [ 'user_id' => 1, 'title' => 'dairy', 'contents' => 'test', 'writing_time' => Carbon::create(2019, 10, 1), 'created_at' => Carbon::create(2019, 9, 10), 'updated_at' => Carbon::create(2019, 9, 14), ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Extract the form data from the request body
public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface { $data = (array)$request->getParsedBody(); // Invoke the Domain with inputs and retain the result $customerId = $this->customerCreator->createCustomer($data); // Build the HTTP response return $this->renderer ->json($response, ['customer_id' => $customerId]) ->withStatus(StatusCodeInterface::STATUS_CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFormData() {\n\t\treturn $this->stripNonPrintables(json_decode($this->request->postVar('Details'), true));\n\t}", "private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }", "public function readHttpRequest(){\n\t\t\t$incomingFormData = file_get_contents('php://input');\n\t\t\t\n\t\t\treturn $incomingFormData;\n\t\t\t}", "public function readHttpRequest() {\n $incomingFormData = file_get_contents('php://input');\n\n return $incomingFormData;\n }", "public function formParams() {\n\t\tswitch($this->method()) {\n\t\tcase 'GET':\n\t\tcase 'DELETE':\n\t\tcase 'HEAD':\n\t\tcase 'OPTIONS':\n\t\tcase 'TRACE':\n\t\t\t$query_str = $this->queryString();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// TODO Validate Content-Type\n\t\t\t$query_str = $this->getBody();\n\t\t}\n\t\tparse_str($query_str, $result);\n\t\treturn $result;\n\t}", "public function getFormData()\n {\n return $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());\n }", "public function body()\n {\n $entityBody = file_get_contents('php://input');\n\n foreach ((array)json_decode($entityBody) as $field => $value) {\n $this->requestStack[$field] = $value;\n }\n return json_decode($entityBody);\n }", "public function getFormData()\n {\n return $_POST;\n }", "public static function getRequestBody() {}", "public function getFormData()\n {\n return $this->form->getData();\n }", "public function post_body() {\n\t\treturn file_get_contents( 'php://input' );\n\t}", "abstract public function getRequestBody();", "static function body()\n\t{\n\t\treturn file_get_contents('php://input');\n\t}", "public function getPostParams()\n {\n return $this->request->all();\n }", "static function getBodyData(): array {\n $data = json_decode(file_get_contents('php://input'), true);\n return !is_null($data)? $data:array();\n }", "public static function getBody() {\r\n return @file_get_contents('php://input');\r\n }", "protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}", "public function getFormRequestInstance();", "protected function obtainPostRequest() {\n /*\n * If the request was sent in JSON format (for example from an mobile app) \n * we will transform it into a format that can be interpreted by PHP\n */ \n $request = Request::createFromGlobals();\n if ($request->headers->get('Content-Type') == 'application/json') {\n $data = json_decode($request->getContent(), true);\n $request->request->replace(is_array($data) ? $data : array());\n }\n return $request->request;\n }", "protected function _readFormFields() {}", "public function get_data()\n {\n return $this->form_data;\n }", "function getPOSTData() {\n // check headers for one of two specific content-types\n $headers = getallheaders();\n $headerError = 'You must specify a Content-Type of either `application/x-www-form-urlencoded` or `application/json`';\n if ( !isset($headers['Content-Type']) ) {\n errorExit( 400, $headerError );\n }\n\n if ( $headers['Content-Type'] === 'application/json' ) {\n // parse the input as json\n $requestBody = file_get_contents( 'php://input' );\n $data = json_decode( $requestBody );\n if ( $data === null ) {\n errorExit( 400, 'Error parsing JSON' );\n }\n return $data;\n } else if ( $headers['Content-Type'] === 'application/x-www-form-urlencoded' ) {\n // convert the $_POST data from an associative array to an object\n return (object)$_POST;\n } else {\n errorExit( 400, $headerError );\n }\n}", "public function get_body()\n {\n return json_decode(file_get_contents('php://input'), TRUE);\n }", "public function getBody() : array\n {\n if ($this->requestMethod == \"GET\") {\n $result = array(); \n foreach ($_GET as $key => $value) {\n $result[$key] = $value;\n }\n return $result;\n }\n\n if ($this->requestMethod == \"POST\") {\n $result = array();\n foreach ($_POST as $key => $value) {\n $result[$key] = filter_input(INPUT_POST, $key, FILTER_SANITIZE_SPECIAL_CHARS);\n }\n\n return $result;\n }\n\n return $body;\n }", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "private function body()\n {\n return json_decode($this->request->all()[\"job\"], true);\n }", "private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }", "private static function getPostParams()\n\t{\n\t\treturn (count($_POST) > 0) ? $_POST : json_decode(file_get_contents('php://input'), true);\n\t}", "protected function parseRequestInput()\n {\n $requestInput = null;\n\n if (in_array($this->getMethod(), [self::METHOD_DELETE, self::METHOD_PUT, self::METHOD_POST], true))\n {\n if (empty($_REQUEST) && isset($_SERVER['CONTENT_TYPE'], $_SERVER['CONTENT_LENGTH']) && (int)$_SERVER['CONTENT_LENGTH'])\n {\n $input = file_get_contents('php://input');\n\n switch ($_SERVER['CONTENT_TYPE'])\n {\n case 'application/json':\n {\n $requestInput = json_decode($input, true, 512, JSON_THROW_ON_ERROR);\n break;\n }\n case 'multipart/form-data':\n case 'application/x-www-form-urlencoded':\n {\n parse_str($input, $requestInput);\n break;\n }\n default: $requestInput = $input;\n }\n }\n }\n return $requestInput;\n }", "static public function application_x_www_form_urlencoded($request_body)\n {\n $data = array();\n parse_str($request_body, $data);\n return $data;\n }", "private function getRequest() {\n return json_decode(request()->getContent(), true);\n }", "function parse_raw_http_request()\n{\n if (!isset($_SERVER['CONTENT_TYPE'])) {\n return null;\n }\n\n // Read incoming data\n $input = file_get_contents('php://input');\n\n // Grab multipart boundary from content type header\n $matches = array();\n preg_match('#boundary=(.*)$#', $_SERVER['CONTENT_TYPE'], $matches);\n\n if (count($matches) == 0) {\n // Content type is probably regular form-encoded\n $post_data = _parse_raw_http_request_urlencoded($input);\n } else {\n // Multipart encoded (unfortunately for modern PHP versions, this code can't run as php://input is not populated for multipart)...\n $boundary = $matches[1];\n $post_data = _parse_raw_http_request_multipart($input, $boundary);\n }\n\n return $post_data;\n}", "public function getParsedBody();", "function getRequestInfo()\n\t{\n\t\treturn json_decode(file_get_contents('php://input'), true);\n\t}", "public static function getBody()\n {\n $entityBody = file_get_contents('php://input');\n return $entityBody;\n }", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = Factory::getApplication()->getUserState('com_tkdclub.email.data', array());\n\n\t\treturn $data;\n\t}", "public function getParsedBody() {}", "public function getRequestData(Request $request) {\n return $request->all();\n }", "public function getPostBody(RequestInterface $req, $type = self::TYPE_FORM): array\n {\n $params = $req->getBody()->getContents();\n switch ($type) {\n case self::TYPE_FORM:\n $arr = [];\n parse_str($params, $arr);\n return $arr;\n\n case self::TYPE_JSON:\n $parsed = json_decode($params, true);\n if (!$parsed) {\n return [];\n }\n return $parsed;\n\n default:\n return [];\n }\n }", "protected function loadFormData()\n\t{\n\t\t$data = $this->getData(); \n \n return $data;\n\t}", "protected function loadFormData() {\n $data = $this->getData();\n\n return $data;\n }", "function getFormData(){\n\n}", "public static function requestPayload() {\n return json_decode(file_get_contents('php://input'), true);\n }", "public function form(DummyFormRequest $request)\n {\n return $request->all();\n }", "protected function loadFormData()\n {\n $data = $this->getData();\n $this->preprocessData('com_ketshop.registration', $data);\n\n return $data;\n }", "public function body()\r\n {\r\n // Only get it once\r\n if (null === $this->body) {\r\n $this->body = @file_get_contents('php://input');\r\n }\r\n\r\n return $this->body;\r\n }", "public function getBodyParams()\n {\n if ($this->_bodyParams === null) {\n if (isset($_POST[$this->methodParam])) {\n $this->_bodyParams = $_POST;\n unset($this->_bodyParams[$this->methodParam]);\n return $this->_bodyParams;\n }\n\n if ($this->getMethod() === 'POST') {\n // PHP has already parsed the body so we have all params in $_POST\n $this->_bodyParams = $_POST;\n } else {\n $this->_bodyParams = [];\n mb_parse_str($this->getRawBody(), $this->_bodyParams);\n }\n }\n\n return $this->_bodyParams;\n }", "private function _FormData()\n {\n $putdata = fopen(\"php://input\", \"r\");\n $raw_data = '';\n while ($chunk = fread($putdata, 1024))\n {\n $raw_data .= $chunk;\n }\n fclose($putdata);\n $boundary = substr($raw_data, 0, strpos($raw_data, \"\\r\\n\"));\n \n if(empty($boundary))\n {\n parse_str($raw_data, $data);\n return $this->__new($data);\n }\n \n $parts = array_slice(explode($boundary, $raw_data), 1);\n $data = array();\n \n foreach ($parts as $part) \n {\n if ($part == \"--\\r\\n\") {\n break;\n } \n \n $part = ltrim($part, \"\\r\\n\");\n list($raw_headers, $body) = explode(\"\\r\\n\\r\\n\", $part, 2);\n \n $raw_headers = explode(\"\\r\\n\", $raw_headers);\n $headers = array();\n foreach ($raw_headers as $header) \n {\n list($name, $value) = explode(':', $header);\n $headers[strtolower($name)] = ltrim($value, ' ');\n }\n\n if (isset($headers['content-disposition'])) \n {\n $filename = null;\n $tmp_name = null;\n preg_match(\n '/^(.+); *name=\"([^\"]+)\"(; *filename=\"([^\"]+)\")?/',\n $headers['content-disposition'],\n $matches\n );\n list(, $type, $name) = $matches;\n if(isset($matches[4]))\n {\n if(isset($_FILES[$matches[2]]))\n {\n $this->__file($matches[2], $_FILES[$matches[2]]);\n continue;\n }\n $filename = $matches[4];\n $filename_parts = pathinfo($filename);\n $tmp_name = tempnam( ini_get('upload_tmp_dir'), $filename_parts['filename']);\n $file = $_FILES[$filename] = new File(array(\n 'error' => 0,\n 'name' => $filename,\n 'tmp_name' => $tmp_name,\n 'size' => strlen($body),\n 'type' => $value\n ));\n $this->__file($filename, $file);\n file_put_contents($tmp_name, $body);\n }\n else\n {\n $data[$name] = substr($body, 0, strlen($body) - 2);\n }\n }\n }\n $this->__new($data);\n }", "public function getForm();", "private function getPostData() {\n\t\t$data = null;\n\t\t\n\t\t// Get from the POST global first\n\t\tif (empty($_POST)) {\n\t\t\t// For API calls we need to look at php://input\n\t\t\tif (!empty(file_get_contents('php://input'))) {\n\t\t\t\t$data = @json_decode(file_get_contents('php://input'), true);\n\t\t\t\tif ($data === false || $data === null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//TODO: What is this for? isn't 'php://input' always empty at this point?\n\t\t\t\t$dataStr = file_get_contents('php://input');\n\t\t\t\tparse_str($dataStr, $data);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$data = $_POST;\n\t\t}\n\t\t\n\t\t// Normalize boolean values\n\t\tforeach ($data as $name => &$value) {\n\t\t\tif ($value === 'true') {\n\t\t\t\t$value = true;\n\t\t\t}\n\t\t\telse if ($value === 'false') {\n\t\t\t\t$value = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function getInput(){\n return json_decode(file_get_contents('php://input'), true);\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "protected function processRequestInput(Request $request)\n {\n $input = $request->all();\n \n return $input;\n }", "protected function parse_body_params()\n {\n }", "function getFormParams() {\n\t\treturn $this->_formParams;\n\t}", "public function getRequestData()\n {\n return json_decode($this->requestData);\n }", "protected function getBody()\n {\n $body = file_get_contents('php://input');\n json_decode($body);\n if(json_last_error() == JSON_ERROR_NONE){\n return json_decode($body);\n }else{\n return false;\n }\n }", "public function get_body_params()\n {\n }", "public function getFormData()\n {\n $data = $this->getData('form_data');\n if ($data === null) {\n $formData = $this->_customerSession->getCustomerFormData(true);\n $data = new \\Magento\\Framework\\DataObject();\n if ($formData) {\n $data->addData($formData);\n $linkedinProfile = ['linkedin_profile' => $this->_customerSession->getLinkedinProfile()];\n $data->addData($linkedinProfile);\n $data->setCustomerData(1);\n }\n if (isset($data['region_id'])) {\n $data['region_id'] = (int)$data['region_id'];\n }\n $this->setData('form_data', $data);\n }\n return $data;\n }", "public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}", "function parse_parameters($data)\n{\n $parameters = array();\n $body_params = array();\n //if we get a GET, then parse the query string\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (isset($_SERVER['QUERY_STRING'])) {\n // make this more defensive\n return $_GET;\n }\n } else {\n // Otherwise it is POST, PUT or DELETE.\n // At the moment, we only deal with JSON\n //$data = file_get_contents(\"php://input\");\n $body_params = json_decode($data, TRUE);\n print_r($body_params);\n }\n\n foreach ($body_params as $field => $value) {\n $parameters[$field]= $value;\n }\n return $parameters;\n}", "public function getPostRequest(): ParameterBag { return $this->post; }", "private function retrieveJsonPostData()\n {\n $rawData = file_get_contents(\"php://input\");\n // this returns null if not valid json\n return json_decode($rawData);\n }", "public function formData()\n {\n return array(\n 'id' => $this->_id,\n 'name' => $this->_name,\n 'content' => $this->_content,\n 'categoryId' => $this->_category_id,\n 'userId' => $this->_user_id\n );\n }", "private static function getRawInputs(): array\n {\n $inputParams = [];\n\n if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) {\n\n $input = file_get_contents('php://input');\n\n if (self::$server->contentType()) {\n switch (self::$server->contentType()) {\n case 'application/x-www-form-urlencoded':\n parse_str($input, $inputParams);\n break;\n case 'application/json':\n $inputParams = json_decode($input);\n break;\n default :\n $inputParams = parse_raw_http_request($input);\n break;\n }\n }\n }\n\n return (array) $inputParams;\n }", "public function getFormParameters()\n {\n return $this->form_parameters;\n }", "protected function loadFormData()\n {\n $app = JFactory::getApplication();\n $data = $app->getUserState('com_jvisualcontent.edit.extrafield.data', array());\n\n if (empty($data)) {\n $data = $this->getItem();\n }\n\n $this->preprocessData('com_jvisualcontent.extrafield', $data);\n\n return $data;\n }", "public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "public function getInputFromGlobals()\n {\n\n switch (strtoupper($this->getMethod())) {\n case 'POST':\n $finalData = $_POST + FileUpload::fromGlobalFilesVariable($_FILES, true);\n break;\n\n case 'GET':\n $finalData = $_GET;\n break;\n\n // TODO other methods\n\n default:\n $finalData = [];\n break;\n }\n\n return $finalData;\n }", "protected function getRequestBody(Request $request)\n {\n return json_decode((string) $request->getBody());\n }", "public function body() {\n\t\tif ( null === $this->_body ) {\n\t\t\t$this->_body = @file_get_contents( 'php://input' );\n\t\t}\n\n\t\treturn $this->_body;\n\t}", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "public function getRawRequest()\n {\n return $this->request;\n }", "private function finalRequestFields($request)\n {\n if (auth()->user()->hasRole('master')) {\n return $request->all();\n }\n\n return $request->except(['template', 'child_template', 'protected']);\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function getRequestData();", "protected function loadFormData() {\n // Check the session for previously entered form data.\n $data = JFactory::getApplication()\n ->getUserState('com_rotator.edit.block.data', []);\n if (empty($data)) {\n $data = $this->getItem();\n }\n return $data;\n }", "public function processcontact()\n\t{\n\t\t$input = Request::all();\n\n\t\treturn $input;\n\t}", "protected function getPostData(Request $request) {\n\t\tif (!isset($this->postData)) {\n\t\t\t$body = $request->Body;\n\t\t\t/** @var array $postVars */\n\t\t\t$postVars = $request->Post();\n\n\t\t\tif (isset($postVars['model'])) {\n\t\t\t\t$this->postData = json_decode($postVars['model'], true);\n\t\t\t} elseif (!empty($postVars)) {\n\t\t\t\t$this->postData = $postVars;\n\t\t\t} elseif (strlen($body) > 0) {\n\t\t\t\t$this->postData = json_decode($body, true);\n\t\t\t} else {\n\t\t\t\t$this->postData = [];\n\t\t\t}\n\t\t}\n\t\treturn $this->postData;\n\t}", "public function getPost()\n {\n $request = $this->getRequest();\n return $request->getPost();\n }", "function _parse_raw_http_request_multipart($input, $boundary)\n{\n $post_data = array();\n\n // Split content by boundary and get rid of last -- element\n $blocks = preg_split(\"#-+$boundary#\", $input);\n array_pop($blocks);\n\n $matches = array();\n\n // Loop data blocks\n foreach ($blocks as $block) {\n // Parse blocks (except for uploaded files)\n if (strpos($block, 'application/octet-stream') === false) {\n // Match \"name\" and optional value in between newline sequences\n if (preg_match('#name=\\\"([^\\\"]*)\\\"[\\n|\\r]+([^\\n\\r].*)?[\\r\\n]$#s', $block, $matches) != 0) {\n $key = $matches[1];\n $val = $matches[2];\n if (get_magic_quotes_gpc()) {\n $val = addslashes($val);\n }\n\n if (substr($key, -2) == '[]') {\n $key = substr($key, 0, strlen($key) - 2);\n if (!isset($post_data[$key])) {\n $post_data[$key] = array();\n }\n $post_data[$key][] = $val;\n } else {\n $post_data[$key] = $val;\n }\n }\n }\n }\n\n return $post_data;\n}", "protected function loadFormData(){\n\t\t\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_egoi.edit.egoi.data', array());\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function getHttpPostFields()\n {\n $config = $this->getConfig();\n $request = $this->getRequest();\n $context = $request->getContext();\n\n $params = array();\n\n $params['aid'] = $config->getAccountId();\n\n $params['type'] = $request->getType();\n $params['wid'] = $request->getWidgetId();\n $params['start'] = $request->getStartIndex();\n if($chunkSize = $request->getChunkSize()) {\n $params['csize'] = $chunkSize;\n }\n $params['widgetdetails'] = $request->getIncludeWidgetDetails() ? '1' : '0';\n\n if($productIdsToExclude = $request->getExcludeProductIds()) {\n $params['excl'] = $productIdsToExclude;\n }\n\n // context\n if($visitorId = $context->getVisitorId()) {\n $params['emvid'] = $visitorId;\n }\n if($productIds = $context->getProductIds()) {\n $params['pid'] = $productIds;\n }\n $categories = $context->getCategories();\n if(count($categories) > 0) {\n if(count($categories) > 1) {\n throw new RuntimeException(\"Only one or zero categories in context allowed in current implementation.\");\n }\n $cat = $categories[0]; /* @var $cat Context\\Category */\n $params['ctxcat.ct'] = $cat->getType();\n if($catId = $cat->getId()) {\n $params['ctxcat.cid'] = $catId;\n } else {\n $params['ctxcat.paa'] = $cat->getPath();\n $params['ctxcat.pv'] = $cat->getVariant();\n }\n }\n\n return $params;\n }", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "private static function getData()\n {\n static $data = null;\n\n // Only parse once\n if ($data === null) {\n $content_type = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;\n if ($pos = strpos($content_type, ';')) {\n $content_type = substr($content_type, 0, $pos);\n }\n\n switch ($content_type) {\n case 'multipart/form-data':\n default:\n $data = $_REQUEST;\n break;\n case 'application/x-www-form-urlencoded':\n parse_str(file_get_contents('php://input'), $data);\n break;\n case 'application/json':\n $data = json_decode(file_get_contents('php://input'), true);\n break;\n case 'application/xml':\n case 'text/xml':\n $data = (array)simplexml_load_string(file_get_contents('php://input'));\n $data = array_map('trim', $data);\n break;\n }\n }\n\n return $data;\n }", "protected function loadFormData()\n\t\t{\n\t\t\t\t// Check the session for previously entered form data.\n\t\t\t\t$data = JFactory::getApplication()->getUserState('com_helloworld.edit.' . $this->context . '.data', array());\n\t\t\t\tif (empty($data))\n\t\t\t\t{\n\t\t\t\t\t\t$data = $this->getItem();\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t}", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function request(){\n\t\t$request = file_get_contents('php://input');\n\t\treturn json_decode($request,true);\n\t}", "public static function json()\n {\n try {\n $json = json_decode(file_get_contents(\"php://input\"), true);\n if (!empty($json)) {\n $form = [];\n foreach ($json as $name => $value) {\n if (!is_array($value)) {\n $form[htmlspecialchars($name)] = htmlspecialchars($value);\n } else {\n foreach ($value as $n => $v) {\n if (!is_array($v)) {\n $form[htmlspecialchars($name)][$n] = htmlspecialchars($v);\n } else {\n foreach ($v as $n2 => $v2) {\n $form[htmlspecialchars($name)][$n][$n2] = htmlspecialchars(\n $v2\n );\n }\n }\n }\n }\n }\n return $form;\n } else {\n return null;\n }\n } catch (Exception $e) {\n die($e);\n }\n }", "public function getInputSource()\n\t{\n\t\t$parsedBody = $this->getParsedBody();\n\t\t\n\t\tif ($this->getRequestMethod() === Request::GET) {\n\t\t\treturn $this->getQueryParams();\n\t\t}\n\t\t\n\t\treturn $parsedBody;\n\t}", "public function getBodyParameters() {\n if ($this->bodyParameters !== null) {\n return $this->bodyParameters;\n }\n\n if ($this->body) {\n $contentType = $this->getHeader(Header::HEADER_CONTENT_TYPE);\n\n if (strpos($contentType, ';') !== false) {\n list($contentType, $attributes) = explode(';', $contentType);\n }\n\n if ($contentType == 'application/json') {\n $this->bodyParameters = json_decode($this->body, true);\n } elseif ($contentType == 'application/x-www-form-urlencoded') {\n $this->bodyParameters = $this->parseQueryString($this->body);\n } else {\n $this->bodyParameters = array();\n }\n } else {\n $this->bodyParameters = array();\n }\n\n return $this->bodyParameters;\n }", "protected function loadFormData()\n\t{\n\t\t$data = $this->getData();\n\n\t\t$this->preprocessData('com_volunteers.registration', $data);\n\n\t\treturn $data;\n\t}", "static function getBody()\n\t{\n\t return self::get('__postBody__', null);\n\t}", "abstract function getForm();", "public function getBody() : string\n {\n if ($this->requestMethod !== \"POST\" && $this->requestMethod !== \"PUT\" && $this->requestMethod !== \"DELETE\")\n throw new \\InvalidArgumentException(\"Body is only availabe on POST/PUT requests.\");\n return file_get_contents(\"php://input\");\n }", "protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }", "private function extractParamsFromJSONBody(Request $request)\n {\n $params = array();\n\n $content = $request->getContent();\n if(!empty($content)) {\n $result = json_decode($content);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n $params = $result;\n }\n }\n\n return $params;\n }", "public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}", "protected function loadFormData()\n\t{\n\t\t$data = Factory::getApplication()->getUserState(\n\t\t\t'com_jed.edit.review.data', []\n\t\t);\n\n\t\tif (empty($data))\n\t\t{\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "function receive() {\n // Input type 1.\n if ($this->method == 'POST' && isset($_POST[$this->id . '-form_id']) && $_POST[$this->id . '-form_id'] == $this->id) {\n $this->request['raw_input'] = $_POST;\n }\n // Input types 2 and 3.\n else {\n $this->request['raw_input'] = $_GET;\n }\n }", "private function processForm(Request $request, FormInterface $form)\n {\n $data = json_decode($request->getContent(), true);\n $form->submit($data, true);\n }" ]
[ "0.7044802", "0.69547623", "0.6875466", "0.6774244", "0.66026735", "0.65679485", "0.65330756", "0.6490021", "0.6451777", "0.6406904", "0.639906", "0.63938046", "0.6392227", "0.63326484", "0.62701434", "0.62677443", "0.6235817", "0.62325776", "0.62078047", "0.6185634", "0.6154129", "0.61419594", "0.61068153", "0.6105805", "0.6096858", "0.6094008", "0.6082881", "0.6068964", "0.6067749", "0.6062913", "0.6050354", "0.6036919", "0.60190994", "0.60064673", "0.60050327", "0.5979234", "0.59551984", "0.59405345", "0.593891", "0.5934861", "0.59236616", "0.59105855", "0.5903826", "0.5885947", "0.5829848", "0.5823958", "0.5817264", "0.5812341", "0.5806596", "0.58047533", "0.5797756", "0.57851905", "0.57745016", "0.5750148", "0.5736746", "0.5733251", "0.5728403", "0.5698243", "0.5696651", "0.568685", "0.56827843", "0.56727034", "0.56622386", "0.56617934", "0.5655518", "0.56527424", "0.56486106", "0.56478536", "0.5642105", "0.56311214", "0.56276333", "0.56050295", "0.56014943", "0.55983096", "0.55923265", "0.5578872", "0.557186", "0.55662024", "0.55602086", "0.5549473", "0.55483294", "0.55453813", "0.5544293", "0.5539117", "0.5538563", "0.553456", "0.55326015", "0.5523378", "0.55110013", "0.55095184", "0.55076885", "0.55054104", "0.5489761", "0.548475", "0.54752827", "0.5475023", "0.5471697", "0.54705936", "0.5466841", "0.546461", "0.5460974" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\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()\r\n\t{\r\n\t\t//\r\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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $user= User::find($id); return view('photographer_profile')->with('user',$user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\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->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\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 viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $photographer = User::find($id); // Check for correct user if(auth()->user()->id !==$photographer->id){ return redirect()->back(); } return view('edit')->with('photographer', $photographer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78560394", "0.76944435", "0.7274738", "0.7242069", "0.7171281", "0.70639855", "0.7054131", "0.6983364", "0.69478005", "0.69461757", "0.69413805", "0.69277894", "0.690145", "0.68984276", "0.68984276", "0.68784773", "0.68642735", "0.68610847", "0.6857929", "0.684406", "0.6834666", "0.6812317", "0.6806476", "0.68056434", "0.6802016", "0.6796308", "0.67925215", "0.67925215", "0.6788407", "0.67854327", "0.67798024", "0.67778105", "0.6768292", "0.67620933", "0.6746622", "0.6746622", "0.67451817", "0.6744156", "0.67404944", "0.67362344", "0.672656", "0.67133087", "0.66945624", "0.66931814", "0.6689649", "0.6689253", "0.66885525", "0.668543", "0.6683226", "0.66704214", "0.6670041", "0.666635", "0.666635", "0.6661137", "0.66608137", "0.6659381", "0.6657332", "0.66547334", "0.6653617", "0.6643329", "0.6632568", "0.6632244", "0.6628306", "0.6628306", "0.6620114", "0.66194344", "0.66173506", "0.6616366", "0.6611815", "0.6609614", "0.6606548", "0.65972704", "0.6595697", "0.6595222", "0.65914685", "0.65912557", "0.6588314", "0.6581422", "0.6581033", "0.6580827", "0.657766", "0.6577083", "0.6574992", "0.6570292", "0.65680474", "0.65676284", "0.6567584", "0.65626866", "0.6562467", "0.6562467", "0.65586925", "0.6558524", "0.6557367", "0.65571094", "0.6556675", "0.6556111", "0.6555878", "0.6555186", "0.6549289", "0.6548959", "0.65455836" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $photographer = User::find($id); if($request->hasFile('cover_image')){ $file_full_name = $request->file('cover_image')->getClientOriginalName(); $filename = pathinfo($file_full_name , PATHINFO_FILENAME); $extention = $request->file('cover_image')->getClientOriginalExtension(); $filenameStore = $filename . '_' . time() . '.'.$extention; $path = $request->file('cover_image')->storeAs('public/images' , $filenameStore); $photographer->cover_image = $filenameStore; } $photographer->name = $request->input('name'); $photographer->email = $request->input('email'); $photographer->phone_number = $request->input('phone_number'); $photographer-> price= $request->input('price'); $photographer->save(); return redirect('/photographer_home/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Show errors Returns all errors in a list or with set markup from $options param
public function show_errors($options = array()) { $default = array( 'open_list' => \Config::get('validation.open_list', '<ul style="list-style-type: none;">'), 'close_list' => \Config::get('validation.close_list', '</ul>'), 'open_error' => \Config::get('validation.open_error', '<li>'), 'close_error' => \Config::get('validation.close_error', '</li>'), 'no_errors' => \Config::get('validation.no_errors', '') ); $options = array_merge($default, $options); if (empty($this->errors)) { return $options['no_errors']; } $output = $options['open_list']; foreach($this->errors as $e) { $output .= $options['open_error'].$e->get_message().$options['close_error']; } $output .= $options['close_list']; return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showErrors() {\n \n \n foreach ($this->_errors as $key => $value)\n $this->_errors = \"$value\";\n\t\t\treturn $this->_errors;\n }", "public static function displayErrors(){\n $ec = new EmailLabsConfig();\n if( $ec->getMode() == true && !empty( self::$errors ) ){\n $message = '';\n foreach( self::$errors as $item )\n $message .= '['.$item['lvl'].']['.$item['date'].']'.$item['msg'].\"\\n\";\n die( $message );\n }\n }", "public static function display_errors( bool $html ) : void {\t\n\t\t$i = -1;\n\t\tif( !empty( self::$errors ) ){\n\t\t\twhile( ($i++) < sizeof( self::$errors ) - 1 ){\n\t\t\t\t$error = self::$errors[$i];\n\t\t\t\techo ( $html === true ) ? \"<span>\".$error.\"</span><br>\" : $error . \"\\x0a\" ;\n\t\t\t}\n\t\t}\n\t}", "function displayError(){\n\t\tprint \"<div class=\\\"validationerror\\\">\";\n\t\tfor ($i=0;$i<count($this->error);$i++){\n\t\t\tprintln($this->error[$i]);\n\t\t}\n\t\tprint \"</div>\";\n\t}", "public function getErrorsHtml() {\n $errors = $this->getMessages();\n return $this->getList($errors);\n }", "public function displayErrors() {\n\t\tif(count($this->errors)) {\n\t\t\t$output = \"<ul>\";\n\t\t\tforeach($this->errors as $error) {\n\t\t\t\t$output .= \"<li>\".$error.\"</li>\";\n\t\t\t}\n\t\t\t$output .= \"</ul>\";\n\t\t\treturn $output;\n\t\t}\n\t\treturn \"\";\n\t}", "function showerror() {\r\n if (count($this->error_msgs)>0) {\r\n echo '<p><img src=\"images/eri.gif\"><b>'.lang('Error in form').'</b>:<ul>';\r\n foreach ($this->error_msgs as $errormsg) {\r\n echo '<li>'.$errormsg;\r\n }\r\n echo '</ul></p>';\r\n return True;\r\n }\r\n return False;\r\n }", "public function output_error($errors){\n\n\t\treturn '<ul>'.implode('</li><li>', $errors).'</li></ul>';\n\n\t}", "private function displayErrors () {\n echo '<pre>';\n\n foreach ($this->error as $single_error) {\n print_r($single_error);\n }\n\n echo '</pre>';\n }", "function display_errors($errors = array())\n{\n $output = '';\n if (!empty($errors)) {\n $output .= \"<div class=\\\"errors\\\">\";\n $output .= \"Please fix the following errors:\";\n $output .= \"<ul>\";\n foreach ($errors as $error) {\n $output .= \"<li>\" . h($error) . \"</li>\";\n }\n $output .= \"</ul>\";\n $output .= \"</div>\";\n }\n return $output;\n}", "public function renderErrors();", "function outputErrors($errors) {\n echo \"<ul class=\\\"errors\\\">\";\n $reqErrorCount = count($errors[\"required\"]);\n $invalidErrorCount = count($errors[\"invalid\"]);\n \n if ($reqErrorCount > 0) {\n echo \"<li>\".concatArray($errors[\"required\"]).\" \".(($reqErrorCount>1)?\"are\":\"is\").\" required</li>\";\n } \n if ($invalidErrorCount > 0) {\n echo \"<li>\".concatArray($errors[\"invalid\"]).\" \".(($invalidErrorCount>1)?\"are\":\"is\").\" invalid</li>\";\n }\n foreach ($errors[\"other\"] as $error) {\n echo \"<li>\".$error.\"</li>\";\n }\n echo \"</ul>\";\n }", "public function showError();", "public function ShowErrors() {\n\t\treturn $this->errors;\n\t}", "protected function enableDisplayErrors() {}", "protected function enableDisplayErrors() {}", "function show_errors() {\n\t\t\t$this->show_errors = true;\n\t\t}", "function show__errors ()\n {\n global $_errors;\n global $lang;\n if (0 < count ($_errors))\n {\n $errors = implode ('<br />', $_errors);\n echo '\n\t\t\t<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thead\">\n\t\t\t\t\t' . $lang->global['error'] . '\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<font color=\"red\">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t' . $errors . '\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</font>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<br />\n\t\t';\n }\n\n }", "function displayErrors($errors, $fixablebyuser=true)\n {\n // Since this function can be called before any ATK stuff has been loaded,\n // we have no rendering enging whatsoever, so we need to display html\n // manually.\n echo '<html>\n <head>\n <title>Achievo error</title>\n </head>\n <body bgcolor=\"#ffffff\">\n <br><b>A problem has occurred</b>\n <br>\n <br>We\\'re very sorry, but this server is unable to run Achievo,\n for the following reason(s):\n <br>\n <ul>';\n for($i=0, $_i=count($errors); $i<$_i; $i++)\n {\n echo '<li>'.$errors[$i].'<br><br>';\n }\n echo ' </ul>';\n if ($fixablebyuser)\n {\n echo ' If you can\\'t get Achievo to work after following the above instructions, please visit the <a href=\"http://www.achievo.org/forum\" target=\"_new\">Achievo forums</a> and we might be able to help you.';\n }\n echo ' </body>\n </html>';\n }", "function form_errors($errors=array()) {\n\t$output =\"\";\n\tif (!empty($errors)) {\n\t\t\n\t\t$output .=\"div class=\\\"error col-lg-3\\\">\";\n\t\t$output .=\"please fix the following errors:\";\n\t\t$output .=\"<ul>\";\n\t\tforeach ($errors as $key => $error) {\n\t\t\t$output .=\"<li>{$error}</li>\";\n\t\t}\n\t\t$output .=\"</ul>\";\n\t\t$output .=\"</div>\";\n\t}\n\treturn $output;\n}", "function output_errors($errors) {\n $output = array();\n foreach($errors as $error) {\n $output[] = '<li>'.$error.'</li>';\n }\n return '<ul>'.implode('', $output).'</ul>';\n }", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "function errors() \n {\n $str = \"<ul class=\\\"form-error\\\">\\n\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n #busca metodos de validacion definido por usuario\n if ($obj != NULL) \n {\n if (!$obj->errors->not_errors())\n {\n $str .= \"<li>\".$name.\"\\n\";\n $str .= $obj->errors;\n $str .= \"</li>\\n\";\n }\n }\n }\n $str .= \"</ul>\\n\";\n return $str;\n }", "function form_errors($errors_array=[]) {\r\n\t\t$output = \"\";\r\n\t\tif(!empty($errors_array)) {\r\n\t\t\t$output .= \"<div class=\\\"errors\\\">\";\r\n\t\t\t$output .= \"Please fix the following errors:\";\r\n\t\t\t$output .= \"<ul>\";\r\n\t\t\tforeach ($errors_array as $error_key => $error_message) {\r\n\t\t\t\t$output .= \"<li>\";\r\n\t\t\t\t$output .= /*htmlentities(*/$error_message/*)*/;\r\n\t\t\t\t$output .=\"</li>\";\r\n\t\t\t}\r\n\t\t\t$output .= \"</ul>\";\r\n\t\t\t$output .= \"</div>\";\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "function display_error() {\n\tglobal $errors;\n global $errors1;\n\n\tif (count($errors) > 0){\n\t\techo '<div class=\"error\">';\n\t\t\tforeach ($errors as $error){\n\t\t\t\techo $error .'<br>';\n\t\t\t}\n\t\techo '</div>';\n\t}\n}", "function show_faq_errors ()\n {\n global $faq_errors;\n global $lang;\n if (0 < count ($faq_errors))\n {\n $errors = implode ('<br />', $faq_errors);\n echo '\n\t\t\t<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thead\">\n\t\t\t\t\t' . $lang->global['error'] . '\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<font color=\"red\">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t' . $errors . '\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</font>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<br />\n\t\t';\n }\n\n }", "function render() {\n foreach ($this->request['invalid_elements'] as $element) {\n foreach ($element->errors as $error) {\n drupal_set_message($error, 'error');\n }\n }\n\n return parent::render();\n }", "function show_error ()\n {\n global $errormessage;\n global $lang;\n global $ts_template;\n if (!empty ($errormessage))\n {\n eval ($ts_template['show_error']);\n }\n\n }", "function resultBlock($errors){\r\n\tif (count($errors) > 0) {\r\n\t\techo \"<div id='error' class='alert alert-danger' role='alert'>\r\n\r\n\t\t<ul>\";\r\n\t\tforeach ($errors as $error) \r\n\t\t{\r\n\t\t\techo \"<li>\".$error.\"</li>\";\r\n\t\t}\r\n\t\techo \"</ul>\";\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "public function settings_errors() {\n\t\techo settings_errors( $this->token . '-errors' );\n\t}", "public function errorMessages() {\n if(empty($this->errors)) {\n return;\n }\n \n $message = 'The following errors have occured: <ul>';\n foreach($this->errors as $error) {\n $message .= \"<li>$error</li>\";\n }\n $message .= '</ul>';\n\n return '<div class=\"error\">'.$message.'</div>';\n }", "protected function displayValidationErrors($response)\n {\n $errors = collect(json_decode(\n (string) $response->getBody(),\n true\n )['errors'])->flatten();\n\n Helpers::line('');\n Helpers::danger('Whoops! There were some problems with your request.');\n Helpers::line('');\n\n foreach ($errors as $error) {\n Helpers::line(\" - {$error}\");\n }\n\n Helpers::line('');\n }", "public static function errors($type){\n if($type === \"signUp\"){\n $errors = self::$signUpErrors;\n } else {\n $errors = self::$loginErrors;\n }\n if (count($errors) > 0) :?>\n <div class=\"row justify-content-center\">\n <div class=\"error\">\n <?php foreach ($errors as $error) : ?>\n <p><?php echo $error ?> </p>\n <?php endforeach ?>\n </div>\n </div>\n <?php endif;\n }", "public static function printErrors() {\n\t\tif (PNApplication::hasErrors()) {\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"<div style='color:#C00000;font-familiy:Tahoma;font-size:10pt'><img src='\".theme::$icons_16[\"error\"].\"' style='vertical-align:bottom'/> \".$e.\"</div>\";\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessageError(null,\".json_encode($e).\",5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"window.page_errors=[\";\n\t\t\t$first = true;\n\t\t\tforeach (PNApplication::$errors as $e) {\n\t\t\t\tif ($first) $first = false; else echo \",\";\n\t\t\t\techo json_encode($e);\n\t\t\t}\n\t\t\techo \"];\";\n\t\t\techo \"</script>\";\n\t\t}\n\t\tif (PNApplication::hasWarnings()) {\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$warnings as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessage(window.top.Status_TYPE_WARNING,\".json_encode($e).\",[{action:'popup'},{action:'close'}],5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"</script>\";\n\t\t}\n\t}", "public static function show_errors(){\n\t\t\tself::$SHOWING_ERRORS=true;\n\t\t\tset_error_handler(array('Errors','handle_errors'),E_ALL | E_STRICT);\n\t\t\tset_exception_handler(array('Errors','handle_exceptions'));\n\t\t}", "public function get_errors() {\n\n\t\t$output = '';\n\t\t\n\t\t$errors = $this->errors;\n\t\t\n\t\tif ($errors) {\n\t\t\t$items = '';\n\t\t\tforeach ($errors as $e) {\n\t\t\t\t$items .= '<li>'.$e.'</li>' .\"\\n\";\n\t\t\t}\n\t\t\t$output = '<ul>'.\"\\n\".$items.'</ul>'.\"\\n\";\n\t\t}\n\t\telse {\n\t\t\t$output = __('There were no errors.', CCTM_TXTDOMAIN);\n\t\t}\n\t\treturn sprintf('<h2>%s</h2><div class=\"summarize-posts-errors\">%s</div>'\n\t\t\t, __('Errors', CCTM_TXTDOMAIN)\n\t\t\t, $output);\n\t}", "public function index()\n {\n $this->mPageTitle = lang('reparation_errors');\n $this->render('reparation/errors');\n }", "public function error(array $options = []){\n\n\t\theader('Location: /home/show');\n\t\tdie();\n\n\t}", "public function show_errors($show = \\true)\n {\n }", "function print_error() {\n echo '<div class=\"dirlist_error\">';\n echo '<h1>'.dl_error_header.'</h1>';\n echo '<div>['.$this->errorPlace.'] '.$this->error.'</div>';\n echo '</div>';\n }", "public function display_errors($open = '', $close = '')\n\t{\n\t\t$str = '';\n if(is_array($this->error_msg)){\n foreach ($this->error_msg as $val)\n {\n $str .= $open.$val.$close;\n }\n }\n\t\treturn $str;\n\t}", "private function print_errors ($errors) {\n\t\t$count = count($errors);\n\t\t\n\t\tif (count($errors) > 0) {\n\t\t\tforeach ($errors as $value) {\n\t\t\t\tprint(self::CONSOLE_MACRO_ERROR.\"<tr><td class=\\\"error\\\">$value</td></tr>\\n\");\n\t\t\t} \n\t\t}\n\t\t\n\t\t/*\n\t\tprint(\"<p class=\\\"caption\\\">Found $count errors.</p>\");\n\t\tprint(\"<div class=\\\"errors\\\">\");\n\t\t\n\t\tif (count($errors) > 0) {\n\t\t\t$error_text .= \"<ol>\\n\";\n\t\t\tforeach ($errors as $value) {\n\t\t\t\t$error_text .= \"<li>$value</li>\\n\";\n\t\t\t} \n\t\t\t$error_text .= \"</ol>\\n\";\n\t\t}\n\t\t\n\t\tprint($error_text);\n\t\tprint(\"</div>\");\n\t\t*/\n\t}", "public function errors();", "public function errors();", "public function showToastForValidationError()\n {\n $errorBag = $this->getErrorBag()->all();\n\n if (count($errorBag) > 0) $this->toast($errorBag[0], 'error');\n }", "public function errorDisplay()\n {\n return \"<div class='error-message'><strong>\".Lang::get('message.error.title').\"</strong><br/>(\".date('Y-m-d H:m:s').\") \".$this->error.\"</div>\";\n }", "function errorsControl($objSession,$Errors,$FieldsValue) {\n $Errors = $objSession->getErrorAddCatalog();\n if(sizeof($Errors) > 0)\n {\n echo '<div id=\"errors\"><ul>';\n foreach($Errors as $key => $value)\n {\n echo '<li>'.$Errors[$key].'</li>';\n }\n echo '</ul><span id=\"hidden-errors\" class=\"hidden-errors\">X</span></div>';\n }\n echo \"\\n\";\n }", "function notSoFatalError($errStr, $options = array()){\n\t\t$image_dir = (empty($this->image_dir) ? \"\" : $this->image_dir);\n\t\tif (!empty($this->error_function)){\n\t\t\t$errf = $this->error_function;\n\t\t\t$errf(\"[base class]: $errStr\");\n\t\t} else {\n\t\t\t$tittel = \"Følgende feil oppstod:\";\n\t\t\tif (isset($options['customHeader'])) $tittel = $options['customHeader'];\n\t\t\t$errm = \"\n\t\t\t\t<div class='errorMessage' style=\\\"border: 1px solid #FF0000; color: #FF0000; background: url(\".$image_dir.\"warning2.gif) no-repeat #FFFFFF; padding: 10px 10px 10px 70px; margin: 5px;\\\">\n\t\t\t\t\t<strong style='padding-top:8px; padding-bottom:3px; display: block;'>$tittel</strong>\n\t\t\t\t\t$errStr\n\t\t\t\t\t<br />&nbsp;\n\t\t\t\t</div>\n\t\t\t\";\n\t\t\tif (isset($options['logError'])) $logError = ($options['logError'] == true);\n\t\t\telse $logError = true;\n\t\t\tif ($logError) $this->addToErrorLog($errStr);\n\t\t\tif (isset($options['print'])) \n\t\t\t\tprint $errm;\n\t\t\telse \n\t\t\t\treturn $errm;\n\t\t}\n\t}", "public function show_user_error($type = null, $errors)\n {\n if (! is_array($errors)) {\n $errors = array($errors);\n }\n\n foreach ($errors as $errorMessage) {\n $this->output->writeln('<error>'.strip_tags($errorMessage).'</error>');\n }\n\n exit;\n }", "static function validationErrors ($type = 'warning')\n {\n $errors = View::shared ('errors');\n if (count ($errors)): ?>\n <div class=\"alert alert-<?= $type ?> alert-validation\">\n <h4><?= Lang::get ('auth.PROBLEMS 1') ?></h4><?= Lang::get ('auth.PROBLEMS') ?><br><br>\n <ul>\n <?php foreach ($errors->all () as $error)\n echo \"<li>$error</li>\" ?>\n </ul>\n </div>\n <?php\n endif;\n }", "function DisplayError()\n\t\t{\n\t\t\techo \"<div>\" . $this->error_message . \"</div>\";\n\t\t}", "protected function renderAsError() {}", "function wck_single_metabox_errors_display(){\r\n /* only execute for the WCK objects defined for the current post type */\r\n global $post;\r\n if( get_post_type( $post ) != $this->args['post_type'] )\r\n return;\r\n\r\n /* and only do it once */\r\n global $allready_saved;\r\n if( isset( $allready_saved ) && $allready_saved == true )\r\n return;\r\n $allready_saved = true;\r\n\r\n /* mark the fields */\r\n if( isset( $_GET['wckerrorfields'] ) && !empty( $_GET['wckerrorfields'] ) ){\r\n echo '<script type=\"text/javascript\">';\r\n $field_names = explode( ',', urldecode( base64_decode( $_GET['wckerrorfields'] ) ) );\r\n\t\t\tif( !empty( $field_names ) ) {\r\n\t\t\t\tforeach ($field_names as $field_name) {\r\n\t\t\t\t\techo \"jQuery( '.field-label[for=\\\"\" . esc_js($field_name) . \"\\\"]' ).addClass('error');\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n echo '</script>';\r\n }\r\n\r\n /* alert the error messages */\r\n if( isset( $_GET['wckerrormessages'] ) ){\r\n echo '<script type=\"text/javascript\">alert(\"'. str_replace( '%0A', '\\n', esc_js( urldecode( base64_decode( $_GET['wckerrormessages'] ) ) ) ) .'\")</script>';\r\n }\r\n }", "function display_errors($errors){\n $display = '<ul class=\"bg-danger\">';\n foreach($errors as $error) {\n //class text danger make the font red\n $display .='<li class=\"text-danger\">'.$error.'</li>';\n }\n $display .= '</ul>';\n return $display;\n}", "public function showError($result = null) {\n if (Configure::read() > 0) {\n if ($this->error) {\n trigger_error('<span style = \"color:Red;text-align:left\"><b>SOAP Error:</b> <pre>' . print_r($this->error) . '</pre></span>', E_USER_WARNING);\n }\n if ($result) {\n e(sprintf(\"<p><b>Result:</b> %s </p>\", $result));\n }\n }\n }", "function errorStatic($formId, $errors)\n\t{\n\t\t//vd($errors);\n\t\tdie(('\n\t\t\t<script>\n\t\t\t\twindow.top.showError(\"'.$errors[0]['msg'].'\", \"'.$formId.' .info\");\n\t\t\t\twindow.top.loading(0, \"'.$formId.' .loading\", \"fast\");\n\t\t\t\twindow.top.$(\"#'.$formId.' input, #'.$formId.' select\").each(function(n,element){\n\t\t\t\t\twindow.top.$(element).removeClass(\"error\")\n\t\t\t\t});\n\t\t\t\terrors = '.json_encode($errors).';\n\t\t\t\tfor(var i in errors)\n\t\t\t\t{\n\t\t\t\t\twindow.top.$(\\'#'.$formId.' input[name=\"\\'+errors[i].name+\\'\"]\\').addClass(\\'error\\');\n\t\t\t\t}\n\t\t\t</script>'));\n\t}", "protected function errors($name, $errors = null, $wrap = '<span class=\"help-block\">:message</span>') {\n\t\t$return = '';\n\n\t\tif ($errors && $errors->has($name)) {\n\t\t\t$return .= $errors->first($name, $wrap) . \"\\n\";\n\t\t}\n\n\t\treturn $return;\n\t}", "function displayErrors($errorMessages) {\n $messageListHtml =\n '<p class=\"errormessage\">' .\n implode('<br>', $errorMessages) .\n '</p>';\n return $messageListHtml;\n}", "public function render()\r\n {\r\n $this->view->toView([\"subTitle\" => \"Error\"])->loadError($this->code);\r\n }", "public function getErrors() {\n\n if (!$this->errors || count($this->errors === 0)) {\n return '';\n }\n $html = '';\n $pattern = '<li>%s</li>';\n $html .= '<ul>';\n\n foreach ($this->errors as $error) {\n $html .= sprintf($pattern, $error);\n }\n $html .= '</ul>';\n return sprintf($this->getWrapperPattern(self::ERRORS), $html);\n }", "function setErrors( array $errors );", "function displayErrors($errors, $duplicates=array(), $passwordError=array()){\n/* i'm creating default arguments for the last 2 parameters. The login\nand admin login don't use them. However, the adduser function provides these arrays when it calls this function*/\n $output='';\n foreach ($errors as $key => $value) {\n $output.='<li class = \"list-group-error\">\n <strong>'. htmlentities(ucfirst($key)). ': </strong> '.htmlentities($value).'\n </li>';\n }\n foreach ($duplicates as $key => $value) {\n $output.='<li class = \"list-group-error\">\n <strong>'. htmlentities(ucfirst($key)). ': </strong> '.htmlentities($value).'\n </li>';\n }\n foreach ($passwordError as $key => $value) {\n $output.='<li class = \"list-group-error\">\n <strong>'. htmlentities(ucfirst($key)). ': </strong> '.htmlentities($value).'\n </li>';\n }\n return $output;\n }", "function pms_display_field_errors( $field_errors = array(), $return = false ) {\r\n\r\n $output = '';\r\n\r\n if( !empty( $field_errors ) ) {\r\n $output = '<div class=\"pms_field-errors-wrapper\">';\r\n\r\n foreach( $field_errors as $field_error ) {\r\n $output .= '<p>' . $field_error . '</p>';\r\n }\r\n\r\n $output .= '</div>';\r\n }\r\n\r\n if( $return )\r\n return $output;\r\n else\r\n echo $output;\r\n\r\n }", "function showErrors($errors, $field){\n $alert = '';\n if(isset($errors[$field]) && !empty($field)){\n $alert = \"<div class='alert alert-error'>\".$errors[$field].'</div>';\n }\n return $alert;\n}", "public function errors()\n {\n $_output = '';\n foreach ($this->errors as $error)\n {\n $errorLang = $this->lang->line($error) ? $this->lang->line($error) : '##' . $error . '##';\n $_output .= $this->error_start_delimiter . $errorLang . $this->error_end_delimiter;\n }\n\n return $_output;\n }", "function alert(){\r\n\tglobal $errors, $success,$warning;\r\n\r\n\t if (isset($errors) && !empty($errors)){\r\n\t\t$allerror = \"<ul>\";\r\n\t\tforeach($errors as $value){\r\n\t\t\t$allerror .= \"<li>$value </li>\";\r\n\t\t}\r\n\t\t$allerror .= \"</ul>\";\r\n\r\n\t\techo '<br><div class=\"alert alert-danger alert-block\"><h4>Error!</h4>'.$allerror.'</div>';\r\n\r\n\t}\r\n\r\n\telse if (isset($success)){\r\n\t\techo '<div class=\"alert alert-success\"><strong>Success! </strong>'.$success.'</div>';\r\n\t\t}\r\n\r\n\telse if (isset($warning)){\r\n\t\techo '<div class=\"alert\"><strong>Warning! </strong>'.$warning.'</div>';\r\n\t}\r\n}", "function show_lottery_errors ()\n {\n global $error;\n global $lang;\n if (0 < count ($error))\n {\n $errors = implode ('<br />', $error);\n echo '\n\t\t\t<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thead\">\n\t\t\t\t\t' . $lang->global['error'] . '\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<font color=\"red\">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t' . $errors . '\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</font>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<br />\n\t\t';\n }\n\n }", "public function actionError()\n\t{\n\t\treturn $this->render('error');\n\t}", "public function index () {\r\n\t\treturn $this->load->view('errors/index');\r\n\t}", "protected function setErrorMessage($errors){\n $return = \"\";\n foreach($errors as $data){\n $return .= $data['0'].'<br>';\n }\n return $return;\n }", "public static function getMessagesListHtml($errors){\n \n $mensajeHtml = \"<ul>\";\n foreach ($errors as $key => $error) {\n foreach($error as $mensaje){\n $mensajeHtml .= \"<li>\".$mensaje.\"</li>\";\n }\n }\n $mensajeHtml .= \"</ul>\";\n\n return $mensajeHtml;\n }", "function displayErrors() {\n\tif(isset($_SESSION['error'])) {\n\t\t// Set up row in accordance with Bootstrap grid\n\t\t/*echo '<div class=\"container\"><div class=\"row\"><div class=\"col-md-12\">';*/\n\t\techo '<div class=\"row\"><div class=\"col-md-12\">';\n\t\tforeach ($_SESSION['error'] as $error) {\n\t\t\techo '<p class=\"error\">',$error,'</p>';\n\t\t}\n\t\t/*echo '</div></div></div>';*/\n\t\techo '</div></div>';\n\t\t// Unset errors for page refresh\n\t\tunset ($_SESSION['error']);\n\t}\n}", "private function printHTML() \n\t{\n\t\t// str with error type and nr of errors\n\t\tif ($this->error_nr_html == -1) {\n\t\t\t$this->SetTextColor(0, 0, 255);\n\t\t\t$path = AC_BASE_HREF.\"images/jpg/info.jpg\";\n\t\t\t$this->Image($path, $this->GetX(), $this->GetY(), 4, 4);\n\t\t\t$this->SetX(14);\n\t\t\t$this->SetFont('DejaVu', 'B', 12);\t\t\t\n\t\t\t$this->Write(5,_AC(\"html_validator_disabled\"));\n\t\t\t$this->SetTextColor(0);\n\t\t} else {\t\t\t\t\n\t\t\t$this->SetFont('DejaVu', 'B', 14);\n\t\t\t$this->SetTextColor(0);\n\t\t\t$this->Write(5, _AC('file_report_html').' ('.$this->error_nr_html.' '._AC('file_report_found').'):');\t\t\n\t\t\t$this->Ln(10);\n\t\t\t$this->SetFont('DejaVu', 'B', 12);\n\t\t\t$this->Write(5,strip_tags(_AC(\"html_validator_provided_by\")));\n\t\t\t$this->Ln(10);\t\t\n\t\t\n\t\t\t// show congratulations if no errors found\n\t\t\tif ($this->error_nr_html == 0 && $this->html_error == '') {\n\t\t\t\t// no html validation errors, passed\n\t\t\t\t$this->Ln(3);\n\t\t\t\t$this->SetTextColor(0, 128, 0);\n\t\t\t\t$path = AC_BASE_HREF.\"images/jpg/feedback.jpg\";\n\t\t\t\t$this->Image($path, $this->GetX(), $this->GetY(), 4, 4);\n\t\t\t\t$this->SetX(14);\n\t\t\t\t$this->SetFont('DejaVu', 'B', 12);\n\t\t\t\t$this->Write(5, _AC(\"congrats_html_validation\"));\n\t\t\t} else if($this->error_nr_html == 0 && $this->html_error != '') {\n\t\t\t\t// html validation errors\n\t\t\t\t$this->Ln(3);\n\t\t\t\t$this->SetTextColor(0);\n\t\t\t\t$this->SetFont('DejaVu', '', 10);\n\t\t\t\t$this->Write(5, $this->html_error);\n\t\t\t} else { // else make report on errors\n\t\t\t\tforeach($this->html as $error) {\n\t\t\t\t\t// error icon img, line, column, error text\n\t\t\t\t\t$img_data = explode(\".\", $error['img_src']);\t\t\n\t\t\t\t\t$path = AC_BASE_HREF.\"images/jpg/\".$img_data[0].\".jpg\";\n\t\t\t\t\t$this->Image($path, $this->GetX()+7, $this->GetY(), 4, 4);\n\t\t\t\t\t$this->SetX(21);\n\t\t\t\t\tif ($error['line'] != '' && $error['col'] != '') {\n\t\t\t\t\t\t$this->SetTextColor(0);\n\t\t\t\t\t\t$this->SetFont('DejaVu', 'BI', 9);\n\t\t\t\t\t\t$location = \" \"._AC('line').\" \".$error['line'].\", \"._AC('column').\" \".$error['col'].\": \";\n\t\t\t\t\t\t$this->Write(5, $location);\n\t\t\t\t\t}\n\t\t\t\t\t$this->SetTextColor(26, 74, 114);\n\t\t\t\t\t$this->SetFont('DejaVu', '', 10);\n\t\t\t\t\t$this->Write(5, html_entity_decode(strip_tags($error['err'])));\n\t\t\t\t\t$this->Ln(7);\n\t\n\t\t\t\t\t// html code of error\n\t\t\t\t\tif ($error['html_1'] != '' || $error['html_2'] != '' || $error['html_3'] != '') {\n\t\t\t\t\t\t$this->SetFont('DejaVu', '', 9);\n\t\t\t\t\t\t$this->SetX(17);\n\t\t\t\t\t\t$this->SetTextColor(0);\n\t\t\t\t\t\t$str = str_replace(\"\\t\", \" \", html_entity_decode(htmlspecialchars_decode($error['html_1'], ENT_QUOTES)));\n\t\t\t\t\t\t$this->Write(5, $str);\n\t\t\t\t\t\t$this->SetTextColor(255, 0 ,0);\n\t\t\t\t\t\t$str = str_replace(\"\\t\", \" \", html_entity_decode(htmlspecialchars_decode($error['html_2'], ENT_QUOTES)));\n\t\t\t\t\t\t$this->Write(5, $str);\n\t\t\t\t\t\t$this->SetTextColor(0);\n\t\t\t\t\t\t$str = str_replace(\"\\t\", \" \", html_entity_decode(htmlspecialchars_decode($error['html_3'], ENT_QUOTES)));\n\t\t\t\t\t\t$this->Write(5, $str);\n\t\t\t\t\t\t$this->Ln(10);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// text\n\t\t\t\t\tif ($error['text'] != '') {\n\t\t\t\t\t\t$this->SetX(17);\n\t\t\t\t\t\t$this->SetFont('DejaVu', '', 10);\n\t\t\t\t\t\t$this->Write(5, html_entity_decode(strip_tags($error['text'])));\n\t\t\t\t\t\t$this->Ln(10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} // end of else \n\t\t\n\t}", "public function getErrors(){\n echo json_encode($this->errors, JSON_PRETTY_PRINT);\n }", "function preErrorShow($array) {\n\t\t$arrayResult = \"\\n\";\n\t\tforeach($array as $key => $value) {\n\t\t\t$arrayResult = $arrayResult.\"[ \".$key.\" ] \\t\\t=> \".$value.\"\\n\";\n\t\t}\n\n\t\techo \"<pre>ERROR SHOW -> preErrorShow() -> CORE SINTASK SYSTEM\\n\n\t\t\t\".$arrayResult.\"\n\t\t</pre>\";\n\t}", "function error_label($errors, $name) {\n //create span for the error message to appear (of class 'error_message')\n echo \"<br> <span id=\\\"$name\\\" class=\\\"error_message\\\">\";\n\n //Check if an error has occurred for the field\n if (isset($errors[$name])) {\n //input code of error message if error had occurred for the field\n echo $errors[$name];\n }\n echo '</span>';\n}", "protected function showErrors()\n { // Process the data\n if(\n isset($this->_config->views->{$this->_action}->data) and\n $this->_config->views->{$this->_action}->data\n ) {\n // Grab a reference to the data element obj from the configuration\n $dataCfg = $this->_config->views->{$this->_action}->data;\n\n // Create a SimpleXML element out of the HTML\n libxml_use_internal_errors(true);\n \n // Strip out the doctype\n $doctypes = array();\n if( preg_match_all('/\\<!doctype[^>]*>/i',$this->_output,$doctypes) === false ) {\n throw new CHttpException(500,'Internal Error');\n }\n $doctypes = count($doctypes)?$doctypes[0]:array();\n \n $this->_output = trim(str_replace($doctypes,'',$this->_output));\n // Load the template into an XML object\n $xml = simplexml_load_string($this->_output);\n\n // Process any errors found loading the XML\n if($xml === false)\n { // Loop through the errors and log an error event for each\n foreach(libxml_get_errors() as $error)\n {\n echo $error->message.\"\\n<br />\";\n \n // error_log('Error parsing XML file ' . $file . ': ' . $error->message);\n }\n\n // Report an error back to the caller\n throw new CHttpException(500,'Internal Error');\n return;\n }\n\n // Initialize the message vars\n $showMsg = false;\n $msgBox = '<div class=\"errorBox\"><h2>Please fix the following errors</h2><ul>';\n\n // Loop through the config elements and add the error class\n foreach( $dataCfg as $dataId => $dataEl ) {\n // Check for an error for the data element\n if( in_array($dataId,array_keys($this->_errors)) ) {\n // Indicate that there are errors to show\n $showMsg = true;\n \n //// MESSAGE\n $msgBox .= '<li>'.$this->_errors[$dataId].' </li>';\n \n //// LABEL\n // Get the element from markup using XPath\n $result = $xml->xpath(\"//label[@for='rbm_{$this->_domain->type}_{$dataId}']\");\n // If the element was not found, move on to the next element\n if( count( $result ) ) {\n // Grab the element\n $el = $result[0];\n // Add the value attribute if it doesn't exist\n if( !$el->attributes()->class ) {\n // Add the value attribute\n $el->addAttribute('class','error');\n } else {\n $val = $el->attributes()->class;\n $val .= ' error';\n $el->attributes()->class = $val;\n }\n }\n\n //// ELEMENT(S)\n if( isset($dataEl->components) and is_array($dataEl->components) ) {\n foreach($dataEl->components as $id => $component) {\n $result = $xml->xpath(\"//*[@id='rbm_{$this->_domain->type}_{$component}']\");\n // If the element was not found, move on to the next element\n if( count( $result ) ) {\n // Grab the element\n $el = $result[0];\n // Add the value attribute if it doesn't exist\n if( !$el->attributes()->class ) {\n // Add the value attribute\n $el->addAttribute('class','error');\n } else {\n $val = $el->attributes()->class;\n $val .= ' error';\n $el->attributes()->class = $val;\n }\n }\n }\n } else {\n $result = $xml->xpath(\"//*[@id='rbm_{$this->_domain->type}_{$dataId}']\");\n // If the element was not found, move on to the next element\n if( count( $result ) ) {\n // Grab the element\n $el = $result[0];\n // Add the value attribute if it doesn't exist\n if( !$el->attributes()->class ) {\n // Add the value attribute\n $el->addAttribute('class','error');\n } else {\n $val = $el->attributes()->class;\n $val .= ' error';\n $el->attributes()->class = $val;\n }\n }\n }\n }\n }\n\n // Wrap up the message box\n $msgBox .= ' </ul></div>';\n \n // Show the message if errors were found\n if( $showMsg ) {\n \n // Convert output to a DOMDocument for prepend operation (SimpleXML cannot do prepend)\n $dom = new DOMDocument('1.0');\n $dom->loadXML($xml->asXML());\n\n // Query for content\n $xpath = new DOMXPath($dom);\n $query = \"//*[@id='rbm_{$this->_domain->type}_content']\";\n $results = $xpath->query($query); \n $msg = dom_import_simplexml(simplexml_load_string($msgBox));\n $msg = $dom->importNode($msg,true);\n\n // Loop through the results and add the new message box (should only execute once - IDs are unique)\n foreach($results as $content) {\n $content->insertBefore($msg, $content->firstChild);\n }\n\n // Convert back to SimpleXML\n $xml = simplexml_import_dom($dom);\n }\n \n // Fetch and process output\n $this->_output = str_replace('<?xml version=\"1.0\"?>','',$xml->asXML());\n foreach($doctypes as $doctype) {\n $this->_output = $doctype.\"\\n\".$this->_output;\n }\n }\n }", "public function formatErrors($array = array())\n {\n // validation de l'entity a échouée.\n $error_msg = [];\n foreach($array as $errors){\n if(is_array($errors)){\n foreach($errors as $error){\n $error_msg[] = \"<br> - \" . $error;\n }\n }else{\n $error_msg[] = \"<br> - \" . $errors;\n }\n }\n return $error_msg;\n }", "public function showError($error) {\r\n\t\tprint \"<h2 style='color: red'>Error: $error</h2>\";\r\n\t}", "protected function setErrorMessage($errors)\n {\n $return = \"\";\n foreach ($errors as $key => $data) {\n $return .= $key . \": \" . $data['0'] . '<br>';\n }\n return $return;\n }", "public function get_list_errors()\n\t{\n\t\treturn $this->errors;\n\t}", "function getErrors() {\n \techo errorHandler();\n }", "public function showError($message)\r\n {\r\n $data['menu'] = \"\";\r\n\r\n foreach($this->menu['Menu'] as $m)\r\n {\r\n $data['menu'] .= '<li>';\r\n $data['menu'] .= '<a href=\"'.$m['AppMenuLink'].'\"><i class=\"fa '.$m['AppMenuIcon'].' fa-fw\"></i> '.$m['AppMenuName'].'</a>';\r\n $data['menu'] .= '</li>';\r\n }\r\n\r\n if(is_array($message)){\r\n $data['ErrorList'] = $message;\r\n $data['Error'] = \"There where multiple errors while trying to execute your task\";\r\n }\r\n else if(isset($message)){\r\n $data['Error'] = $message;\r\n }\r\n else{\r\n $data['Error'] = \"There was an error while trying to execute your task\";\r\n }\r\n\r\n $data['base_url'] = base_url();\r\n $this->load_view(\"Task/Error\", $data);\r\n }", "function displayXMLValidationErrors($errors, $xml) {\n\t\techo '<h2>' . __('plugins.importexport.common.validationErrors') .'</h2>';\n\n\t\tforeach ($errors as $error) {\n\t\t\tswitch ($error->level) {\n\t\t\t\tcase LIBXML_ERR_ERROR:\n\t\t\t\tcase LIBXML_ERR_FATAL:\n\t\t\t\t\techo '<p>' .trim($error->message) .'</p>';\n\t\t\t}\n\t\t}\n\t\tlibxml_clear_errors();\n\t\techo '<h3>' . __('plugins.importexport.common.invalidXML') .'</h3>';\n\t\techo '<p><pre>' .htmlspecialchars($xml) .'</pre></p>';\n\t}", "public function writeErrorsIntoTheDom(): self\n {\n foreach ($this->errors as $field => $errors) {\n $inputTag = $this->formDocument->findOneOrFalse('[name=\\'' . $field . '\\']');\n if ($inputTag) {\n $errorMsgTemplateSelector = $inputTag->getAttribute('data-error-template-selector');\n if ($errorMsgTemplateSelector) {\n $errorMsgTemplate = $this->formDocument->findOneOrFalse($errorMsgTemplateSelector);\n if ($errorMsgTemplate) {\n foreach ($errors as $error) {\n $errorMsgTemplate->innertext .= ' ' . $error;\n }\n }\n }\n }\n }\n\n return $this;\n }", "public function error($url='index'){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'error';\n\t\techo $this->blade->nggambar('website.error.index',$data);\n\t\treturn;\n\t}", "static function show_error($message) {\n\t\techo '<div class=\"wrap\"><h2></h2><div class=\"error\" id=\"error\"><p>' . $message . '</p></div></div>' . \"\\n\";\n\t}", "function showInputError($errorType)\n{\n if ($errorType !== '') {\n return \"<p class='error-alert'>$errorType</p>\";\n }\n}", "function displayError($error, $step) {\r\n\techo '<h2>An error occurred in step '.$step.'</h2><p>Error: '.htmlspecialchars($error['error']).\r\n\t\t'<br />Description: '.(isset($error['error_description']) ? htmlspecialchars($error['error_description']) : 'n/a').'</p>';\r\n}", "function getErrors();", "public static function errorSummary($model,$header=null,$footer=null,$htmlOptions=array())\n\t{\n\t\t$content='';\n\t\tif(!is_array($model))\n\t\t\t$model=array($model);\n\t\tif(isset($htmlOptions['firstError']))\n\t\t{\n\t\t\t$firstError=$htmlOptions['firstError'];\n\t\t\tunset($htmlOptions['firstError']);\n\t\t}\n\t\telse\n\t\t\t$firstError=false;\n\t\tforeach($model as $m)\n\t\t{\n\t\t\tforeach($m->getErrors() as $errors)\n\t\t\t{\n\t\t\t\tforeach($errors as $error)\n\t\t\t\t{\n\t\t\t\t\tif($error!='')\n\t\t\t\t\t\t$content.=\"<li>$error</li>\\n\";\n\t\t\t\t\tif($firstError)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($content!=='')\n\t\t{\n\t\t\tif($header===null)\n\t\t\t\t$header='<p>'.Yii::t('yii','Please fix the following input errors:').'</p>';\n\t\t\tif(!isset($htmlOptions['class']))\n\t\t\t\t$htmlOptions['class']='alert alert-danger alert-dismissible';\n\t\t\treturn self::tag('div',$htmlOptions,'<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>'.$header.\"\\n<ul class=\\\"list-unstyled\\\">\\n$content</ul>\".$footer);\n\t\t}\n\t\telse\n\t\t\treturn '';\n\t}", "function showErrors ($errores, $campo) {\n\n $alerta = '';\n\n if(isset($errores[$campo]) && !empty($campo) ){\n\n $alerta = \"<div class='alerta alerta-error'>.$errores[$campo].</div>\";\n return $alerta;\n }\n\n\n}", "public function errorBox($errors)\n {\n $hasNonIntegerKeys = false;\n\n if (is_string($errors) && ($data = @unserialize($errors)) !== false) {\n $errors = $data;\n }\n\n if (is_array($errors) === true) {\n foreach (array_keys($errors) as $key) {\n if (is_numeric($key) === false) {\n $hasNonIntegerKeys = true;\n break;\n }\n }\n } else {\n $errors = (array)$errors;\n }\n $this->view->assign('error_box', ['non_integer_keys' => $hasNonIntegerKeys, 'errors' => $errors]);\n $content = $this->view->fetchTemplate('error_box.tpl');\n\n if ($this->request->getIsAjax() === true) {\n $return = [\n 'success' => false,\n 'content' => $content,\n ];\n\n $this->outputHelper->outputJson($return);\n }\n return $content;\n }", "function show_error ()\n {\n global $errormessage;\n if (!empty ($errormessage))\n {\n echo '\t\n\t\t<table width=\"100%\" border=\"0\" class=\"none\" style=\"clear: both;\" cellpadding=\"4\" cellspacing=\"0\">\n\t\t\t<tr><td class=\"thead\">An error has occcured!</td></tr>\n\t\t\t<tr><td><font color=\"red\"><strong>' . $errormessage . '</strong></font></td></tr>\n\t\t\t</table>\n\t\t<br />';\n }\n\n }", "public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }", "abstract public function display( $error );", "public function libxml_display_errors() { \r\n\t\r\n\t\t$errors = libxml_get_errors(); \r\n\t\t$retorno = \"\";\r\n\t\tforeach ($errors as $error) { \r\n\t\t\t$retorno .= $this->libxml_display_error($error); \r\n\t\t} \r\n\t\t\r\n\t\t// Limpa os erros da memoria\r\n\t\tlibxml_clear_errors();\r\n\t\t\r\n\t\t// Retorna os erros\r\n\t\treturn $retorno;\r\n\t}", "function handle_errors($e) {\n $error = '<pre>ERROR: ' . $e->getMessage() . '</pre>';\n $t = 'base.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $error\n\t\t\t ));\n return $output;\n }", "public function showFailed();" ]
[ "0.70820796", "0.7070131", "0.68786764", "0.6861233", "0.6752723", "0.66960454", "0.6695222", "0.6688829", "0.6686907", "0.6660111", "0.6658451", "0.66566205", "0.66464484", "0.66063744", "0.6589293", "0.6588431", "0.65593445", "0.65580016", "0.6525238", "0.6507998", "0.6462739", "0.6455137", "0.6455137", "0.6408169", "0.63840467", "0.63650334", "0.6318827", "0.6305396", "0.62956405", "0.6252447", "0.62427205", "0.6230696", "0.62248397", "0.61987805", "0.6194616", "0.61908776", "0.61903405", "0.61759603", "0.6174474", "0.61609656", "0.61588657", "0.6142114", "0.6131714", "0.6119367", "0.6119367", "0.6115752", "0.61135226", "0.6104023", "0.6068012", "0.6056118", "0.60505795", "0.6047756", "0.60167307", "0.6005117", "0.5992142", "0.5973881", "0.5968303", "0.5967149", "0.5955671", "0.594517", "0.5905201", "0.59009975", "0.589842", "0.588653", "0.58723325", "0.5865459", "0.58573604", "0.58495677", "0.5847244", "0.58408475", "0.5837565", "0.58231395", "0.5814228", "0.5812354", "0.5806438", "0.57682824", "0.5766796", "0.57658666", "0.5755102", "0.57339394", "0.57333046", "0.5730185", "0.57236105", "0.5718469", "0.57095504", "0.5703077", "0.5700304", "0.56961083", "0.56910765", "0.5685047", "0.56785613", "0.56752497", "0.56700224", "0.566854", "0.566744", "0.5663238", "0.56624115", "0.56561273", "0.5654866", "0.5654339" ]
0.8583822
0
/ function runs BEFORE installation
function preflight($type, $parent) { echo '<p>' . JText::_('COM_SPORTSARTICLE_PREFLIGHT_' . $type . '_TEXT') . '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function beforeInstall()\n\t{}", "public function preInstall()\n {\n }", "protected function install(){ return true;}", "protected function afterInstall()\n {\n }", "public function afterInstall()\n\t{}", "function install() {}", "public static function install(){\n\t}", "public function install(){\r\n\t\t\r\n\t}", "function install(){}", "function install()\n {\n }", "public function install() {\r\n \r\n }", "public function install()\n {\n }", "public function install()\n {\n }", "public function install() {\n\n\n }", "function insta_f_install(){\n}", "public function install();", "public function install();", "protected function beforeInstall(): bool\n {\n return true;\n }", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "public function install(){\n\n return true;\n\n }", "function test_install(){\n \t}", "function install($data='') {\r\n parent::install();\r\n }", "function install($data='') {\r\n parent::install();\r\n }", "function install() {\n /*\n * do some stuff at install db table creation/modification, email template creation etc.\n * \n * \n */\n return parent::install();\n }", "function install($data='') {\n parent::install();\n\n\n }", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "public function install()\n\t{\n\t\treturn true;\n\t}", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "function install_site() {\n \n}", "function AdminUsers_install()\n\t{\n\t}", "public function install () {\n $this->_log_version_number();\n }", "public function install()\n {\n Configuration::updateValue('APISFACT_PRESTASHOP_TOKEN', '');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEF', 'F001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROF', '0');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEB', 'B001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROB', '0');\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayAdminOrderLeft') &&\n $this->registerHook('displayAdminOrderMain');\n }", "function install()\n {\n \t// Creating tables\n\t\t\tinclude('db/tables.php');\n }", "public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}", "public function install()\n\t{\n\t\tif (Shop::isFeatureActive()) {\n\t\t\tShop::setContext(Shop::CONTEXT_ALL);\n\t\t}\n\n\t\t//initialize empty settings\n\t\tConfiguration::updateValue('CLERK_PUBLIC_KEY', '');\n\t\tConfiguration::updateValue('CLERK_PRIVATE_KEY', '');\n\n\t\tConfiguration::updateValue('CLERK_SEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_SEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_INCLUDE_CATEGORIES', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_TEMPLATES', '');\n\n\t\treturn parent::install() &&\n $this->registerHook('top') &&\n\t\t\t$this->registerHook('footer') &&\n\t\t\t$this->registerHook('displayOrderConfirmation');\n\t}", "public static function run_install()\n {\n global $wpdb;\n\n // Create Base Table in mysql\n //$charset_collate = $wpdb->get_charset_collate();\n //require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n }", "function install($data = '')\n {\n parent::install();\n }", "function install($data = '')\n {\n parent::install();\n }", "public function install()\n {\n // initialisation successful\n return true;\n }", "function on_install_module($module_name) {\n include('application.setup.php');\n return true;\n }", "public function installPlugin()\n\t{\n\t\treturn true;\t\n\t}", "function InstallFiles() {\n\t\n\t\treturn true;\n\t}", "public function install(){\n\n\t\t$model = Advertikon::getCurrentModel();\n\n\t\ttry {\n\t\t\t$this->_checkCompatibility();\n\t\t}\n\t\tcatch( Exception\\Transport $e ) {\n\t\t\t$this->errorPage( $e->getData() , 424 , 'Failed Dependency' );\n\t\t}\n\n\t\t$this->_install();\n\n\t\t$config = Advertikon::getXmlConfig();\n\t\t$settingsModel = Advertikon::getExtendedModel( 'setting_setting' );\n\t\t$settings = $model->stripPrefix( $settingsModel->getSetting() );\n\t\t$model->merge( $settings , $config->getValues( '/' ) );\n\t\t$settingsModel->editSetting( $settings );\n\n\t\t//mark the extension as installed\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->setSettingValue( 'installed' , 1 );\n\t}", "function hookInstall() {\n// $db = get_db()cou;\n//die(\"got to the installer method...\");\n $this->_saveVocabularies();\n }", "public function install()\n {\n\n return parent::install() &&\n $this->registerHook('actionAdminControllerSetMedia') &&\n $this->registerHook('displayAdminProductsQuantitiesStepBottom') ;\n \n }", "function top10_install() {\r\n/* Creates new database field */\r\n//add_option('omekafeedpull_omekaroot', '/omeka', '', 'yes');\r\n}", "public function install()\n {\n Configuration::updateValue('MF_TITLE', 'Our Favourite Brands');\n Configuration::updateValue('MF_DESCRIPTION', 'Browse our favourite brands');\n Configuration::updateValue('MF_MAN_NUMBER', 0);\n Configuration::updateValue('MF_PER_ROW_DESKTOP', 4);\n Configuration::updateValue('MF_PER_ROW_TABLET', 3);\n Configuration::updateValue('MF_PER_ROW_MOBILE', 1);\n Configuration::updateValue('MF_MAN_ORDER', 'name_asc');\n Configuration::updateValue('MF_SHOW_MAN_NAME', 0);\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('displayHome');\n }", "public function install()\r\n {\r\n if (!get_option('ohs_newsletter_installed')) {\r\n global $wpdb;\r\n $charset_collate = $wpdb->get_charset_collate();\r\n $fullTableName = $wpdb->prefix . self::$tableName;\r\n\r\n $sql = \"CREATE TABLE $fullTableName (\r\n id mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n first_name varchar(100) NOT NULL,\r\n last_name varchar(100) NOT NULL,\r\n email varchar(100) NOT NULL,\r\n validation_code varchar(200) NOT NULL,\r\n PRIMARY KEY id (id)\r\n ) $charset_collate;\";\r\n\r\n dbDelta($sql);\r\n add_option('ohs_newsletter_installed', 1);\r\n\r\n add_option('ohs_newsletter_sendgrid_api', \"\");\r\n add_option('ohs_newsletter_sendgrid_list', \"\");\r\n add_option('ohs_newsletter_redirect', \"\");\r\n }\r\n }", "public static function install()\n\t{\n\t\tmanpower_create_page_with_slug(MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_catalog_slug', MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_worker_slug', MANPOWER_DEFAULT_WORKER_SLUG);\t\t\n\t}", "function crepInstallation() {\r\n\t// Check to see if it has already been installed\r\n\tif(get_option('crep-installed') != '1') {\r\n\t\tcrepInsertDefaultOptions();\r\n\t}\r\n}", "public function initialInstall()\n\t\t{\n\t\t\t$installer = $this->getInstaller();\n\t\t\t$installer->newTable($installer->getResourceTable('core/extension'))\n\t\t\t->addColumn('code', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t'primary' => TRUE,\n\t\t\t\t),'Extension identifier')\n\t\t\t->addColumn('version', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t),'The currently installed version of this extension')\n\t\t\t->setComment('List of ZeroG installed extensions and their version number');\n\t\t\t$installer->run();\n\t\t}", "protected function _initInstallChecker()\r\n\t{\r\n\t\t$config = Tomato_Core_Config::getConfig();\r\n\t\tif (null == $config->install || null == $config->install->date) {\r\n\t\t\theader('Location: install.php');\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "public function install()\n {\n Configuration::updateValue('WI_WEATHER_ENABLED', '0');\n Configuration::updateValue('WI_WEATHER_PROVIDER', '');\n Configuration::updateValue('WI_WEATHER_KEY', '');\n Configuration::updateValue('WI_WEATHER_CITY', '');\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayNav') &&\n $this->registerHook('displayNav1');\n }", "public function install()\n {\n if (!parent::install()\n || !$this->registerHook('displayBackOfficeHeader')\n || !$this->installModuleTab('onehopsmsservice', array(\n 1 => 'Onehop SMS Services'\n ), 0)\n || !$this->installDB()\n || !$this->registerHook('orderConfirmation')\n || !$this->registerHook('postUpdateOrderStatus')\n || !$this->registerHook('actionUpdateQuantity')\n || !$this->registerHook('actionObjectProductUpdateAfter')) {\n return false;\n }\n return true;\n }", "function amt_wsc_team_install(){\n}", "function install_plugin_information()\n {\n }", "public function install()\n {\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayHome');\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "function __construct() {\n\t\t$this->__checkInstall();\n\t\tparent::__construct();\n\t}", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "protected function markModuleAsInstalled()\n {\n Mongez::updateStorageFile();\n }", "public function install(): bool;", "public function onAfterInstall()\n {\n craft()->amForms_install->install();\n }", "function bootstrap() {\n\tif ( is_initial_install() ) {\n\t\tdefine( 'WP_INITIAL_INSTALL', true );\n\t\terror_reporting( E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_WARNING );\n\t}\n}", "public function install()\n\t{\n\t\tConfiguration::updateValue('ORDERLIST_LIVE_MODE', false);\n\n\t\tinclude(dirname(__FILE__).'/sql/install.php');\n\n\t\treturn parent::install() &&\n\t\t\t$this->registerHook('header') &&\n\t\t\t$this->registerHook('backOfficeHeader') &&\n\t\t\t$this->registerHook('displayCustomerAccount') &&\n\t\t\t$this->registerHook('displayProductAdditionalInfo');\n\t}", "function unsinstall()\n\t\t{\n\t\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 }", "public function admin_setup()\n\t{\n\t\t\n\t}", "public function install() {\n include(dirname(__FILE__) . '/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('actionProductUpdate') &&\n $this->registerHook('displayAdminProductsExtra');\n }", "function wp_installing($is_installing = \\null)\n {\n }", "function xmldb_assignsubmission_cle_install() {\r\n global $CFG;\r\n\r\n // do the install\r\n\r\n require_once($CFG->dirroot . '/mod/assign/adminlib.php');\r\n // set the correct initial order for the plugins\r\n $pluginmanager = new assign_plugin_manager('assignsubmission');\r\n\r\n \r\n \r\n // do the upgrades\r\n return true;\r\n\r\n}", "function pre_install()\n\t{\n\t\t//-----------------------------------------\n\t\t// Installing, or uninstalling?\n\t\t//-----------------------------------------\n\t\t\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t$text = ( $this->ipsclass->input['un'] == 1 ) ? 'Uninstalling' : 'Installing';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: XML Analysis\";\n\t\t$this->ipsclass->admin->page_detail = \"The mod's XML file has been analyzed and the proper {$type} steps have been determined.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=view', 'Manage Mod Installations' );\n\t\t$this->ipsclass->admin->nav[] = array( '', $text.\" \".$this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( \"<span style='font-size: 12px;'>Click the button below to proceed with the mod $type.<br /><br /><input type='button' class='realbutton' value='Proceed...' onclick='locationjump(\\\"&amp;{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;un={$this->ipsclass->input['un']}&amp;step=0&amp;st={$this->ipsclass->input['st']}\\\")' /></span>\", \"center\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}", "public function install()\n {\n include dirname(__FILE__) . '/sql/install.php';\n Configuration::updateValue('WI_SPENT_ENABLED', '0');\n Configuration::updateValue('WI_SPENT_AMOUNT', '');\n Configuration::updateValue('WI_SPENT_COUPON', '');\n Configuration::updateValue('WI_SPENT_DAYS', '30');\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('actionValidateOrder') &&\n $this->registerHook('postUpdateOrderStatus') &&\n $this->registerHook('actionOrderStatusPostUpdate') &&\n $this->registerHook('displayOrderConfirmation');\n }", "public function install()\n {\n return parent::install()\n && $this->registerHook('actionObjectOrderAddBefore')\n && Configuration::updateValue('ORDERREF_LENGTH', self::ORDERREF_LENGTH_DEFAULT)\n && Configuration::updateValue('ORDERREF_MODE', self::ORDERREF_MODE_RANDOM)\n ;\n }", "public static function install() {\n\t\terror_log('INSTALLL plugin');\n\t\t$product_list = Product_List::get();\n\t\t$product_list->create_product_list_table();\n\t\t$product_list->create_product_list_detail_table();\n\t\tadd_option( 'product_list_version', Product_List::PRODUCT_LIST_VERSION );\n\n\t\twp_schedule_event( time(), 'hourly', 'my_cron_event' );\n\n\t}", "public static function installToolEnableFileExists() {}", "public function install(){\n // Create plugin tables\n Project::createTable();\n\n Repo::createTable();\n\n CommitCache::createTable();\n\n MergeRequest::createTable();\n\n MergeRequestComment::createTable();\n\n $htracker = PLugin::get('h-tracker');\n if($htracker && !$htracker->isInstalled()) {\n $htracker->install();\n }\n\n // Create permissions\n Permission::add($this->_plugin . '.access-plugin', 1, 0);\n Permission::add($this->_plugin . '.create-projects', 0, 0);\n }", "function ois_activation() {\r\n\t// Create the database table for statistics.\r\n ois_install_database();\r\n update_option('ois_table_created', 'yes');\r\n //update_option('ois-valid', 'no'); // Must validate after every install.\r\n \r\n // Check if old version has been installed.\r\n if (get_option('ois_installed') != 'yes') \r\n {\r\n\t // Reset any old variables that might conflict with new version (from 3.1).\r\n\t\t update_option('ois_skins', array()); // Delete any old settings\r\n\t\t update_option('ois_custom_designs', array()); // Custom designs.\r\n\t\t update_option('ois_installed', 'yes'); // Set to installed.\r\n } // if\r\n}", "public function install()\n {\n $this->initConfig();\n $this->loadConfig();\n $this->config['installed']=ASTAT_VERSION2;\n $this->config['newInstall']='y';\n $this->saveConfig();\n\n GPCCore::register($this->getPluginName(), ASTAT_VERSION, ASTAT_GPC_NEEDED);\n\n return(true);\n }", "public function _postSetup()\n {\n }", "public function install(){\n if (!parent::install() ||\n !$this->registerHook('displayHeader') ||\n !$this->registerHook('displayRightColumn') )\n return false;\n \n $this->initConfiguration(); // set default values for settings\n \n return true;\n }", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "private function maybe_install() {\n\t\tglobal $woocommerce;\n\n\t\t$installed_version = get_option( 'wc_pre_orders_version' );\n\n\t\t// install\n\t\tif ( ! $installed_version ) {\n\n\t\t\t// add 'pre-order' shop order status term\n\t\t\t$woocommerce->init_taxonomy();\n\t\t\tif ( ! get_term_by( 'slug', 'pre-ordered', 'shop_order_status' ) )\n\t\t\t\twp_insert_term( 'pre-ordered', 'shop_order_status' );\n\n\t\t\t// install default settings\n\t\t\tforeach ( $this->get_settings() as $setting ) {\n\n\t\t\t\tif ( isset( $setting['default'] ) )\n\t\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\n\t\t// upgrade - installed version lower than plugin version?\n\t\tif ( -1 === version_compare( $installed_version, WC_Pre_Orders::VERSION ) ) {\n\n\t\t\t$this->upgrade( $installed_version );\n\n\t\t\t// new version number\n\t\t\tupdate_option( 'wc_pre_orders_version', WC_Pre_Orders::VERSION );\n\t\t}\n\t}", "public function init() {\n//\t\tif (checkTable()) {\n//\t\t\t$this->model->upgrade();\n//\t\t}\n//\t\telse {\n\t\t\t$this->model->install();\n\t\t\t$this->loadDefaults();\n//\t\t}\n\t\t\n\t}", "function wlms_plugin_install()\n{\n wlms_create_table();\n wlms_settings_data();\n}", "public function set_up_dependencies () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\t\tadd_action('admin_enqueue_scripts', array($this, 'enqueue_dependencies'));\n\t}", "function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }", "public function runInstallTasks();", "protected function _preupdate() {\n }", "public function install() {\n\n if (!parent::install()\n || !$this->registerHook('payment')\n || !$this->config->install()\n ) {\n return false;\n }\n return true;\n }", "public function install() {\n $this->load->model($this->module_path);\n\n $this->helper_pricealert->createTables();\n\n $this->__registerEvents();\n }", "abstract function is_plugin_new_install();", "function xmldb_local_vlacsguardiansurvey_install() {\r\n}", "function install() {\n\t\tsafe_query('DELETE FROM '.safe_pfx('txp_prefs').' WHERE name LIKE \"wlk_phsb_%\"');\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_notifications_instant',val = '1',type = '1',event = 'wlk_phsb',html = 'yesnoradio',position = '10',user_name = ''\");\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_endpoints',val = '\".implode(\"\\n\", $this->vars['endpoints']).\"',type = '1',event = 'wlk_phsb',html = 'wlk_phsb_textarea',position = '60',user_name = ''\");\n\t}", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }" ]
[ "0.88486236", "0.86422473", "0.824572", "0.81601137", "0.8028625", "0.80285686", "0.7926478", "0.79178476", "0.78950095", "0.78180426", "0.7756241", "0.76986307", "0.76986307", "0.7655939", "0.7649653", "0.7635787", "0.7635787", "0.75511277", "0.75474244", "0.74992114", "0.74718225", "0.744971", "0.744971", "0.7374917", "0.73518693", "0.7322926", "0.7292431", "0.7282961", "0.7282961", "0.7282961", "0.7282961", "0.7282961", "0.72125643", "0.7174573", "0.7154247", "0.71209335", "0.70681316", "0.7038532", "0.7038102", "0.7010689", "0.70090723", "0.70063394", "0.6966857", "0.6966857", "0.6956549", "0.695441", "0.6941758", "0.693453", "0.69240737", "0.6895925", "0.68714345", "0.68527156", "0.6849014", "0.6848932", "0.6846415", "0.6827083", "0.6825722", "0.68209046", "0.68200916", "0.68106437", "0.68060046", "0.68041795", "0.6803034", "0.6795663", "0.67938477", "0.6784244", "0.67803353", "0.6779062", "0.6769959", "0.67568284", "0.67565787", "0.67489934", "0.6743562", "0.67237854", "0.6723138", "0.6722368", "0.66882396", "0.6687027", "0.66657954", "0.6649678", "0.6644274", "0.6643894", "0.66343045", "0.66342163", "0.66247153", "0.66225743", "0.66113573", "0.6610449", "0.6603005", "0.6600668", "0.66002893", "0.65989953", "0.659674", "0.65902245", "0.6581013", "0.65792197", "0.65676737", "0.65664124", "0.6548357", "0.6541184", "0.6533439" ]
0.0
-1
/ function runs AFTER installation
function postflight($type, $parent) { echo '<p>' . JText::_('COM_SPORTSARTICLE_POSTFLIGHT_' . $type . '_TEXT') . '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterInstall()\n\t{}", "protected function afterInstall()\n {\n }", "public function beforeInstall()\n\t{}", "function install() {}", "public function install(){\r\n\t\t\r\n\t}", "public function preInstall()\n {\n }", "public static function install(){\n\t}", "function install(){}", "protected function install(){ return true;}", "function insta_f_install(){\n}", "function install()\n {\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function install() {\r\n \r\n }", "public function install()\n {\n }", "public function install()\n {\n }", "public function install() {\n\n\n }", "public function install();", "public function install();", "function test_install(){\n \t}", "public function _postSetup()\n {\n }", "function install_site() {\n \n}", "function install($data='') {\r\n parent::install();\r\n }", "function install($data='') {\r\n parent::install();\r\n }", "protected function onFinishSetup()\n {\n }", "function hookInstall() {\n// $db = get_db()cou;\n//die(\"got to the installer method...\");\n $this->_saveVocabularies();\n }", "protected function afterUninstall()\n {\n }", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "function install($data='') {\n parent::install();\n\n\n }", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function on_uninstall ()\n{\n}", "function on_uninstall ()\n{\n}", "public function onAfterInstall()\n {\n craft()->amForms_install->install();\n }", "public static function run_install()\n {\n global $wpdb;\n\n // Create Base Table in mysql\n //$charset_collate = $wpdb->get_charset_collate();\n //require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n }", "public function install(){\n\n return true;\n\n }", "function unsinstall()\n\t\t{\n\t\t}", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "function ois_activation() {\r\n\t// Create the database table for statistics.\r\n ois_install_database();\r\n update_option('ois_table_created', 'yes');\r\n //update_option('ois-valid', 'no'); // Must validate after every install.\r\n \r\n // Check if old version has been installed.\r\n if (get_option('ois_installed') != 'yes') \r\n {\r\n\t // Reset any old variables that might conflict with new version (from 3.1).\r\n\t\t update_option('ois_skins', array()); // Delete any old settings\r\n\t\t update_option('ois_custom_designs', array()); // Custom designs.\r\n\t\t update_option('ois_installed', 'yes'); // Set to installed.\r\n } // if\r\n}", "function install_plugin_information()\n {\n }", "function custom_config_postinstall_callback() {\n // Call function to run post install routines.\n custom_config_run_postinstall_hooks();\n}", "public function install () {\n $this->_log_version_number();\n }", "function top10_install() {\r\n/* Creates new database field */\r\n//add_option('omekafeedpull_omekaroot', '/omeka', '', 'yes');\r\n}", "function AdminUsers_install()\n\t{\n\t}", "protected function markModuleAsInstalled()\n {\n Mongez::updateStorageFile();\n }", "function install()\n {\n \t// Creating tables\n\t\t\tinclude('db/tables.php');\n }", "public function theme_installer()\n {\n }", "public static function install()\n\t{\n\t\tmanpower_create_page_with_slug(MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_catalog_slug', MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_worker_slug', MANPOWER_DEFAULT_WORKER_SLUG);\t\t\n\t}", "public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}", "function amt_wsc_team_install(){\n}", "function install() {\n /*\n * do some stuff at install db table creation/modification, email template creation etc.\n * \n * \n */\n return parent::install();\n }", "public function execute_uninstall_hooks() {\r\n\t\t\r\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "public function postPackageInstall ( Event $event ) {\n//\n// if( !file_exists( $config_file ) ){\n//\n// copy( './config/build-tool.php', base_path() . '/config/build-tool.php' );\n// }\n $event->getIO()->write( \"postPackageInstall\" );\n\n }", "public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}", "function crepInstallation() {\r\n\t// Check to see if it has already been installed\r\n\tif(get_option('crep-installed') != '1') {\r\n\t\tcrepInsertDefaultOptions();\r\n\t}\r\n}", "function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }", "public function install(){\n\n\t\t$model = Advertikon::getCurrentModel();\n\n\t\ttry {\n\t\t\t$this->_checkCompatibility();\n\t\t}\n\t\tcatch( Exception\\Transport $e ) {\n\t\t\t$this->errorPage( $e->getData() , 424 , 'Failed Dependency' );\n\t\t}\n\n\t\t$this->_install();\n\n\t\t$config = Advertikon::getXmlConfig();\n\t\t$settingsModel = Advertikon::getExtendedModel( 'setting_setting' );\n\t\t$settings = $model->stripPrefix( $settingsModel->getSetting() );\n\t\t$model->merge( $settings , $config->getValues( '/' ) );\n\t\t$settingsModel->editSetting( $settings );\n\n\t\t//mark the extension as installed\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->setSettingValue( 'installed' , 1 );\n\t}", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "function power_up_setup_callback ( )\n\t{\n\t\t$this->admin->power_up_setup_callback();\n\t}", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "function install($data = '')\n {\n parent::install();\n }", "function install($data = '')\n {\n parent::install();\n }", "public function install()\n\t{\n\t\treturn true;\n\t}", "public function afterSetup()\n {\n }", "function InstallFiles() {\n\t\n\t\treturn true;\n\t}", "function wlms_plugin_install()\n{\n wlms_create_table();\n wlms_settings_data();\n}", "public function installPlugin()\n\t{\n\t\treturn true;\t\n\t}", "public function runInstallTasks();", "public function onAfterInstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'BetterRedactor'),\n array('type' => 'RichText')\n );\n\n $publicDirectory = craft()->path->appPath . '../../public/redactor_plugins';\n\n if (!IOHelper::folderExists($publicDirectory)) {\n $initialDirectory = craft()->path->getPluginsPath()\n . '/betterredactor/redactor_plugins';\n\n $files = array_filter(\n scandir($initialDirectory),\n function($file) use ($initialDirectory) {\n return is_file(\"$initialDirectory/$file\");\n }\n );\n\n foreach ($files as $file) {\n if (preg_match('((.js|.css)$)i', $file)) {\n IOHelper::copyFile(\n \"$initialDirectory/$file\",\n \"$publicDirectory/$file\"\n );\n }\n }\n }\n }", "public function initialInstall()\n\t\t{\n\t\t\t$installer = $this->getInstaller();\n\t\t\t$installer->newTable($installer->getResourceTable('core/extension'))\n\t\t\t->addColumn('code', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t'primary' => TRUE,\n\t\t\t\t),'Extension identifier')\n\t\t\t->addColumn('version', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t),'The currently installed version of this extension')\n\t\t\t->setComment('List of ZeroG installed extensions and their version number');\n\t\t\t$installer->run();\n\t\t}", "public function admin_setup()\n\t{\n\t\t\n\t}", "public function set_up_dependencies () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\t\tadd_action('admin_enqueue_scripts', array($this, 'enqueue_dependencies'));\n\t}", "function install_dashboard()\n {\n }", "protected function _afterInit() {\n\t}", "public function postInstall()\n {\n include_once BASE_PATH.'/modules/api/models/AppModel.php';\n $modelLoader = new MIDAS_ModelLoader();\n $userModel = $modelLoader->loadModel('User');\n $userapiModel = $modelLoader->loadModel('Userapi', 'api');\n\n //limit this to 100 users; there shouldn't be very many when api is installed\n $users = $userModel->getAll(false, 100, 'admin');\n foreach($users as $user)\n {\n $userapiModel->createDefaultApiKey($user);\n }\n }", "public static function install() {\n\t\terror_log('INSTALLL plugin');\n\t\t$product_list = Product_List::get();\n\t\t$product_list->create_product_list_table();\n\t\t$product_list->create_product_list_detail_table();\n\t\tadd_option( 'product_list_version', Product_List::PRODUCT_LIST_VERSION );\n\n\t\twp_schedule_event( time(), 'hourly', 'my_cron_event' );\n\n\t}", "function on_install_module($module_name) {\n include('application.setup.php');\n return true;\n }", "function jbInstall($step){\n\t}", "function realstate_call_after_install() {\n // for example you might want to create a table or modify some values\n // In this case we'll create a table to store the Example attributes\n $conn = getConnection() ;\n $conn->autocommit(false) ;\n try {\n $path = osc_plugin_resource('realstate_attributes/struct.sql');\n $sql = file_get_contents($path);\n $conn->osc_dbImportSQL($sql);\n $conn->commit();\n } catch (Exception $e) {\n $conn->rollback();\n echo $e->getMessage();\n }\n $conn->autocommit(true);\n}", "function bootstrap() {\n\tif ( is_initial_install() ) {\n\t\tdefine( 'WP_INITIAL_INSTALL', true );\n\t\terror_reporting( E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_WARNING );\n\t}\n}", "protected function beforeInstall(): bool\n {\n return true;\n }", "public function onPostInstall(Event $event): void\n {\n $this->onPostUpdate($event);\n }", "public function install()\n {\n Configuration::updateValue('MF_TITLE', 'Our Favourite Brands');\n Configuration::updateValue('MF_DESCRIPTION', 'Browse our favourite brands');\n Configuration::updateValue('MF_MAN_NUMBER', 0);\n Configuration::updateValue('MF_PER_ROW_DESKTOP', 4);\n Configuration::updateValue('MF_PER_ROW_TABLET', 3);\n Configuration::updateValue('MF_PER_ROW_MOBILE', 1);\n Configuration::updateValue('MF_MAN_ORDER', 'name_asc');\n Configuration::updateValue('MF_SHOW_MAN_NAME', 0);\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('displayHome');\n }", "function install() {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t$selsort = $db->unbuffered_query_first(\"SELECT MAX(`sort`) FROM `\".$apcms['table']['global']['rightsidebar'].\"`\");\n\t\tif (isset($selsort) && intval($selsort[0]) >= 1) {\n\t\t\t$sort = intval($selsort[0]) + 1;\n\t\t} else {\n\t\t\t$sort = 1;\n\t\t}\n\t\t\n\t\t$boxcont = \"[php]\\$apcms['PLUGIN']['apcms_sidebar_poweredby']->ShowBox();[/php]\";\n\t\t\n\t\t$query = \"INSERT INTO `\".$apcms['table']['global']['rightsidebar'].\"` \n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t`title`,\n\t\t\t\t\t\t\t\t\t`content`,\n\t\t\t\t\t\t\t\t\t`sort`,\n\t\t\t\t\t\t\t\t\t`hidden`,\n\t\t\t\t\t\t\t\t\t`plugin`\n\t\t\t\t\t) VALUES \t(\n\t\t\t\t\t\t\t\t\t'\".$apcms['LANGUAGE']['GLOBAL_POWEREDBY'].\"',\n\t\t\t\t\t\t\t\t\t'\".apcms_ESC($boxcont).\"',\n\t\t\t\t\t\t\t\t\t'\".$sort.\"',\n\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t'apcms_sidebar_poweredby'\n\t\t\t\t\t\t\t\t);\";\n\t\t$db->unbuffered_query($query);\n\t\t\n\t}", "public function after_setup_theme()\n {\n }", "function install() {\n\t\tsafe_query('DELETE FROM '.safe_pfx('txp_prefs').' WHERE name LIKE \"wlk_phsb_%\"');\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_notifications_instant',val = '1',type = '1',event = 'wlk_phsb',html = 'yesnoradio',position = '10',user_name = ''\");\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_endpoints',val = '\".implode(\"\\n\", $this->vars['endpoints']).\"',type = '1',event = 'wlk_phsb',html = 'wlk_phsb_textarea',position = '60',user_name = ''\");\n\t}", "public static function activation() {\n\t\tregister_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall'));\n\t}", "function install_plugins_upload()\n {\n }", "function custom_config_install_callback() {\n // Call function to run install hooks.\n custom_config_run_install_hooks();\n}", "public function install()\n {\n $this->initConfig();\n $this->loadConfig();\n $this->config['installed']=ASTAT_VERSION2;\n $this->config['newInstall']='y';\n $this->saveConfig();\n\n GPCCore::register($this->getPluginName(), ASTAT_VERSION, ASTAT_GPC_NEEDED);\n\n return(true);\n }", "function wp_installing($is_installing = \\null)\n {\n }", "function cal_install()\n{\n register_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings');\n register_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post');\n}", "function install_theme_information()\n {\n }", "public function install()\r\n {\r\n if (!get_option('ohs_newsletter_installed')) {\r\n global $wpdb;\r\n $charset_collate = $wpdb->get_charset_collate();\r\n $fullTableName = $wpdb->prefix . self::$tableName;\r\n\r\n $sql = \"CREATE TABLE $fullTableName (\r\n id mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n first_name varchar(100) NOT NULL,\r\n last_name varchar(100) NOT NULL,\r\n email varchar(100) NOT NULL,\r\n validation_code varchar(200) NOT NULL,\r\n PRIMARY KEY id (id)\r\n ) $charset_collate;\";\r\n\r\n dbDelta($sql);\r\n add_option('ohs_newsletter_installed', 1);\r\n\r\n add_option('ohs_newsletter_sendgrid_api', \"\");\r\n add_option('ohs_newsletter_sendgrid_list', \"\");\r\n add_option('ohs_newsletter_redirect', \"\");\r\n }\r\n }", "public function install()\n {\n // initialisation successful\n return true;\n }", "function xmldb_local_vlacsguardiansurvey_install() {\r\n}" ]
[ "0.85434735", "0.84423786", "0.78931373", "0.76601225", "0.7645304", "0.7627311", "0.76087016", "0.7584505", "0.75664204", "0.7558127", "0.7526324", "0.7451501", "0.7403844", "0.7340012", "0.7340012", "0.72827494", "0.72024125", "0.72024125", "0.7143672", "0.69873375", "0.6982904", "0.69781125", "0.69781125", "0.6960546", "0.6960514", "0.6945184", "0.6937509", "0.6928167", "0.6925042", "0.6830284", "0.68167067", "0.68167067", "0.68167067", "0.68167067", "0.68167067", "0.6802503", "0.6802503", "0.67894703", "0.6783868", "0.67801315", "0.67639714", "0.67564386", "0.6754046", "0.67514104", "0.6727552", "0.66912323", "0.66751194", "0.66718775", "0.6670369", "0.6647143", "0.6642432", "0.6613959", "0.660891", "0.6598351", "0.6589217", "0.6574497", "0.65740186", "0.6567289", "0.6547047", "0.654339", "0.6530452", "0.6528128", "0.65272003", "0.65192515", "0.6494656", "0.6474696", "0.6474696", "0.6474027", "0.64697784", "0.6469049", "0.6467871", "0.6463924", "0.6451726", "0.6449948", "0.644879", "0.6435017", "0.6423822", "0.6415207", "0.6404071", "0.6394092", "0.6391209", "0.63886464", "0.6371044", "0.637025", "0.6368426", "0.6366525", "0.63553435", "0.63420135", "0.633645", "0.6335615", "0.6328559", "0.6313421", "0.6313032", "0.6298567", "0.6289618", "0.6286594", "0.6284709", "0.627878", "0.627696", "0.62745637", "0.6273271" ]
0.0
-1
Run the database seeds.
public function run() { TecnicActividad::truncate(); $actividad = array("Sistema de la Gestión de la Calidad", "Medio Ambiente", "Seguridad", "Salud del Trabajo"); foreach( $actividad as $value ) { TecnicActividad::create([ 'actividad' => "{$value}", ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
protected $table = 'diposition_relations';
public function from_user() { return $this->hasMany(\App\User::class, 'id', 'from_user'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function relatedTable()\n {\n return $this->belongsTo('App\\Table','table');\n }", "public function belongsToRelation()\n {\n return $this->belongsTo(Relations::class)\n ->foreignKey('on_table_id');\n }", "public function tableName()\n {\n return 'pembelian';\n }", "public function tableName()\n {\n return 'desbloqueadas';\n }", "public static function tableName()\n {\n return 'persona';\n }", "public function contrato(){\n return $this->belongsTo('App\\Contrato');\n }", "public function pengguna(){\n return $this->belongsTo('App\\pengguna');\n }", "public function pedidos()\n{\n return $this->hasMany('App\\Pedido');\n}", "public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }", "public static function tableName()\n {\n return 'asignatura';\n }", "public function libro(){\n return $this->hasMany('App\\Libro');// la tabla OrderDetail\n}", "public static function relations()\n {\n return [\n// 'gender' => ['Gender', 'gender'],\n// 'gender' => 'Gender',\n ];\n }", "public static function tableName()\n { return 'magistrado'; }", "public function relatedDataBase()\n {\n return $this->belongsTo('App\\Database','database');\n }", "public function pais(){\r\n return $this->belongsTo('pais');\r\n }", "public function libro(){\n return $this->belongsTo('App\\Models\\Libro');\n }", "public function habitantes()\n {return $this->belongsTo('App\\Habitante');\n }", "public function candidato() { \n return $this->belongsTo(Candidato::class); ///, '','id'\n }", "public function food() {\n return $this->belongsTo('Food');\n }", "public function palmares() {\n $relation = $this->hasOne(\"Palmares\");\n return $relation;\n }", "public function tipoSangre(){\n return $this->belongsTo('App\\Tipo','pk_codsangre');\n }", "public function divisiones(){\n return $this->belongsTo('App\\Models\\Divisiones');\n }", "public function distribution(){\n return $this->belongsTo('\\App\\Distribution');\n }", "public function tableName() {\n return 'goals';\n }", "public function anggota() \n { \n return $this->belongsTo('App\\Anggota'); \n }", "public function tableName()\n {\n return 'yelp_photos';\n }", "public function pengajian(){\n return $this->belongsTo('App\\Models\\Pengajian','Kod_Penaja','Kod_Penaja');\n }", "public function ponderacion() {\n\t\treturn $this->belongsTo('App\\Ponderacion');\n\t}", "public function paris() {\n $relation = $this->hasMany(\"Paris\");\n return $relation;\n }", "public function table()\n {\n return $this->morphTo();\n }", "public function prodi() {\n return $this->belongsTo( 'App\\Prodi', 'kd_prodi', 'kd_prodi' );\n }", "public function cidade(){\n return $this->belongsTo('App\\Cidade');\n\n }", "public function deportistas(){\n return $this->hasMany('App\\Deportista', 'id_representante', 'representante_id');\n }", "public function pegawai()\n {\n return $this->belongsTo('App\\Models\\Pegawai','id_pegawai');\n }", "public function articulo(){\n return $this->belongsTo('App\\Models\\Articulo');\n }", "public function __construct()\n {\n parent::__construct();\n $this->table = 'actividades';\n }", "public function pharmacies(){\n return $this->hasMany('App\\Pharmacie');\n }", "public function direccion(){\r\n return $this->belongsTo('direccion');\r\n }", "public function Mproblema()\n {\n return $this->belongsTo('App\\Models\\poa\\problema\\Mproblema');\n }", "public function Onderdil(){ \n return $this->hasMany('App\\Models\\Onderdil', 'idOnderdil'); \n }", "public function drug(){\n return $this->belongsTo('App\\Drug','drug_id','id');\n }", "public function correspondences(){\n return $this ->hasMany('App\\Correspondence');\n }", "public function departamentos(){\n return $this->belongsTo('App\\Departamento', 'departamento_id');\n }", "public function purchaces()\n\n{\n return $this->hasMany(Purchace::class);\n\n }", "public function pedidos(){\n return $this->hasMany(Pedido::class);\n }", "public function acudientes(){\n return $this->belongsToMany('App\\Acudiente');\n }", "public function pedidos()\n {\n return $this->belongsTo('App\\Models\\Pedido');\n }", "public function peliculas(){\n // Retornar tipo de relacion\n return $this->hasMany('App\\Pelicula');\n }", "public function academias(){\n return $this->belongsTo('App\\Academias');\n }", "public function annee()\n {\n return $this->belongsTo('App\\Annee');\n }", "public function estudiantes(){\n return $this->hasMany('App\\Estudiante');\n }", "function roommate(){\n \treturn $this->belongsTo('App\\Roommate');\n }", "public function consultation() \n {\n return $this->belongsTo('App\\Client\\Consultation');\n\n }", "public function alumno(){\n return $this->belongsTo('App\\Model\\alumno');\n}", "public function paciente() {\n return $this->belongsTo('App\\Paciente','paciente_id');\n }", "public static function tableName()\n {\n return 'articles';\n }", "public function animal()\n {\n return $this->belongsTo('App\\Animal');\n }", "public function pregunta(){\n return $this->belongsTo(Pregunta::class);\n }", "public function paymentMethodRecord(){\n return $this->belongsTo('App\\PaymentMethodRecord');\n }", "public function districts(){\n return $this->hasMany(District::class);\n }", "public function slip()\n {\n return $this->belongsTo('App\\Slip', 'slip_id');\n }", "function classe()\n {\n return $this->belongsTo(Classe::class, 'classe_id');\n }", "public static function tableName() {\n return 'plan_people';\n }", "public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }", "public function docente ()\n {\n \treturn $this->belongsTo('App\\Docente');\n }", "public function paciente()\n {\n return $this->belongsTo(Paciente::class);\n }", "public function familia()\n {\n \treturn $this->belongsTo('App\\Familia');\n }", "public function dits()\n {\n return $this->hasMany('App\\Dit');\n }", "public function questions(){\n return $this->hasMany(App\\Question::class);\n}", "public function disctrict()\n {\n return $this->belongsTo(Disctrict::class);\n }", "public function edicion()\n {\n return $this->belongsTo('App\\Edicion');\n }", "public function comision(){\n return $this->belongsTo(Comision::class);\n }", "protected static function _relations() {\n\n\t}", "public function carpeta(){\n return $this->hasOne('App\\CarpetaAdjuntos','id_carpeta_adjuntos','id_carpeta_adjuntos');\n }", "public function provincy(){\n return $this->belongsTo('App\\Provincy', 'provincy_id');\n }", "public function comentarios(){\n return $this->hasMany('App\\Comentario');\n }", "public function penilaian()\n {\n return $this->hasMany('App\\Penilaian');\n }", "public function lga(){\n return $this->belongsTo('App\\Models\\Lga');\n }", "public function stasiun(){\n return $this->belongsTo(Stasiun::class);\n }", "public function Paciente()\n {\n return $this->belongsTo('App\\Models\\Paciente','paciente_id','id');\n }", "public function genero(){\n return $this->belongsTo('App\\Models\\Genero');\n }", "public function assistant(){\n \treturn $this->belongsTo(Assistant::class, 'id');\n }", "public static function tableName()\n {\n return '{{carandexterior}}';\n }", "public function genero(){\n return $this->belongsTo('App\\Genero','pk_genero');\n }", "public function sindicato()\n {\n return $this->belongsTo(\\App\\Models\\Sindicato::class);\n }", "public function Tipos_fase()\n {\n return $this->hasMany('App\\Planeacion_tipo','areas_id','id');\n }", "public function barang()\n {\n return $this->hasMany('Kawani\\Barang');\n }", "public function turista()\n {\n return $this->belongsTo(\\App\\Turista::class);\n }", "public function treatments() \n {\n return $this->belongsToMany(Treatment::class); \n }", "public function distribuidor()\n {\n return $this->belongsTo('App\\Distribuidor');\n }", "public function concessionaires(){\n return $this->hasMany('App\\Concessionaire');\n }", "public static function get_table_name(){ return \"presentations\"; }", "public function clousure(){\n return $this->belongsTo(Clousure::class);\n }", "public function tipo(){\n return $this->belongsTo(Tipo::class, 'tipo_id','id');\n }", "public function Pedido(){\n return $this->hasOne(\"App\\Models\\Pedido\");\n }", "public function Designation()\n {\n return $this->belongsTo(Designation::class,'id_designation','id');\n }", "public function product()\n {\n return $this->belongsTo('\\App\\Product');\n }", "public function gallery()\n {\n return $this->belongsTo('App\\Gallery');\n }", "public function bPelajaran()\n {\n return $this->belongsToMany('App\\Pelajaran');\n }", "public function salidas(){\n return $this->hasMany('App\\Mantenimiento');\n }", "public function equipament()\n {\n return $this->belongsTo(Equipament::class);\n }" ]
[ "0.70535874", "0.6922811", "0.6771554", "0.6649305", "0.6526166", "0.6525285", "0.64947563", "0.6492915", "0.649264", "0.6490876", "0.6486312", "0.6470007", "0.64599144", "0.6446674", "0.6430606", "0.6415901", "0.6405647", "0.6405481", "0.6392895", "0.63592124", "0.6356429", "0.6355187", "0.6353429", "0.63439876", "0.6333954", "0.6328327", "0.6326192", "0.63178223", "0.6309728", "0.6299657", "0.62942207", "0.6290673", "0.6277465", "0.6275693", "0.627254", "0.6251187", "0.6249641", "0.6236433", "0.62337524", "0.6223258", "0.6220395", "0.6219923", "0.6210617", "0.62078744", "0.6205848", "0.62022716", "0.6194715", "0.61921054", "0.619123", "0.61888677", "0.618438", "0.6183922", "0.6175736", "0.61731195", "0.61710674", "0.61637414", "0.615931", "0.61496973", "0.6147185", "0.6146752", "0.61425114", "0.61422426", "0.6140273", "0.61335576", "0.6129663", "0.6122493", "0.61159533", "0.6115121", "0.6104006", "0.6103743", "0.6102247", "0.61017835", "0.6098159", "0.6089329", "0.60891646", "0.6087559", "0.6086519", "0.60849243", "0.60776937", "0.60767156", "0.6076419", "0.60729724", "0.607068", "0.60568637", "0.60567516", "0.6051684", "0.60514176", "0.6051055", "0.6050946", "0.60487396", "0.6043428", "0.6043401", "0.6040318", "0.6039917", "0.6038488", "0.603754", "0.60320807", "0.6027978", "0.6027299", "0.6026789", "0.60258496" ]
0.0
-1
Tests consecutive LPOP instructions.
public function benchLpopConsecutive() { $messageList = []; for ($i = 0; $i < self::CONSUME_SIZE; $i++) { $messageList[] = RedisEnvelope::jsonDeserialize($this->client->lpop($this->queueName)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testEvaluateTooManyOperators()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + * /\");\n $this->assertEquals(9, $retval);\n }", "function controlInstruction($instruction, $number_of_instruction)\n{\n // pole pro opcodes vsech instrukci\n $instruction_names = array(\"MOVE\",\"CREATEFRAME\",\"PUSHFRAME\",\"POPFRAME\",\"DEFVAR\",\"CALL\",\"RETURN\",\"PUSHS\",\"POPS\",\"ADD\",\"SUB\",\"MUL\",\"IDIV\",\"LT\",\"GT\",\"EQ\",\"AND\",\"OR\",\"NOT\",\"INT2CHAR\",\"STRI2INT\",\"READ\",\"WRITE\",\"CONCAT\",\"STRLEN\",\"GETCHAR\",\"SETCHAR\",\"TYPE\",\"LABEL\",\"JUMP\",\"JUMPIFEQ\",\"JUMPIFNEQ\",\"EXIT\",\"DPRINT\",\"BREAK\");\n // rozdeleni instrukci podle poctu argumentu\n $instruction_0arg = array(\"CREATEFRAME\",\"PUSHFRAME\",\"POPFRAME\",\"RETURN\",\"BREAK\");\n $instruction_1arg = array(\"DEFVAR\",\"CALL\",\"PUSHS\",\"POPS\",\"WRITE\",\"LABEL\",\"JUMP\",\"EXIT\",\"DPRINT\");\n $instruction_2arg = array(\"MOVE\",\"INT2CHAR\",\"READ\",\"STRLEN\",\"TYPE\",\"NOT\");\n $instruction_3arg = array(\"ADD\",\"SUB\",\"MUL\",\"IDIV\",\"LT\",\"GT\",\"EQ\",\"AND\",\"OR\",\"STRI2INT\",\"CONCAT\",\"GETCHAR\",\"SETCHAR\",\"JUMPIFEQ\",\"JUMPIFNEQ\");\n\n if ((in_array((strtoupper($instruction[0])), $instruction_names)) == false)\n {\n ob_end_clean(); // pokud narazim na problem, odstranim vse co uz se vygenerovalo na STDOUT\n fprintf (STDERR, \"Chyba - Chybny nebo neznamy operacni kod!\\n\");\n exit(22);\n }\n\n // validace poctu operandu\n if ((in_array((strtoupper($instruction[0])), $instruction_0arg)) && (count($instruction) == 1))\n {\n $instruction[0] = strtoupper($instruction[0]);\n echo \" <instruction order=\\\"{$number_of_instruction}\\\" opcode=\\\"{$instruction[0]}\\\">\\n\";\n }\n else if ((in_array((strtoupper($instruction[0])), $instruction_1arg)) && (count($instruction) == 2))\n {\n $instruction[0] = strtoupper($instruction[0]);\n echo \" <instruction order=\\\"{$number_of_instruction}\\\" opcode=\\\"{$instruction[0]}\\\">\\n\";\n checkType($instruction);\n }\n else if ((in_array((strtoupper($instruction[0])), $instruction_2arg)) && (count($instruction) == 3))\n {\n $instruction[0] = strtoupper($instruction[0]);\n echo \" <instruction order=\\\"{$number_of_instruction}\\\" opcode=\\\"{$instruction[0]}\\\">\\n\";\n checkType($instruction);\n }\n else if ((in_array((strtoupper($instruction[0])), $instruction_3arg)) && (count($instruction) == 4))\n {\n $instruction[0] = strtoupper($instruction[0]);\n echo \" <instruction order=\\\"{$number_of_instruction}\\\" opcode=\\\"{$instruction[0]}\\\">\\n\";\n checkType($instruction);\n }\n else\n {\n Err();\n }\n echo \" </instruction>\\n\";\n\n}", "protected function parse_oneL_fun()\n {\n $this->check_param_num(1);\n\n $this->generate_instruction();\n\n $this->get_token();\n $this->check_label();\n $this->generate_arg(\"1\", \"label\");\n \n $this->xml->endElement();\n }", "public static function helperForBlockingPops($op) {\n // in a separate process to properly test BLPOP/BRPOP\n $redisUri = sprintf('redis://%s:%d/?database=%d', RC::SERVER_HOST, RC::SERVER_PORT, RC::DEFAULT_DATABASE);\n $handle = popen('php', 'w');\n fwrite($handle, \"<?php\n require '../lib/Predis.php';\n \\$redis = new Predis\\Client('$redisUri');\n \\$redis->rpush('{$op}1', 'a');\n \\$redis->rpush('{$op}2', 'b');\n \\$redis->rpush('{$op}3', 'c');\n \\$redis->rpush('{$op}1', 'd');\n ?>\");\n pclose($handle);\n }", "public function testAllPrecedencesHasNoGaps()\n {\n $levels = array();\n $min = false;\n $max = false;\n foreach ( $this->operators as $operator )\n {\n $levels[$operator->precedence] = true;\n if ( $max === false ||\n $operator->precedence > $max )\n $max = $operator->precedence;\n if ( $min === false ||\n $operator->precedence < $min )\n $min = $operator->precedence;\n }\n ksort( $levels );\n self::assertThat( count( $levels ), self::greaterThan( 1 ), \"Level list did not even fill two items\" );\n for ( $i = $min; $i <= $max; ++$i )\n {\n // We skip level 2 which is the ?: operator which is not supported\n if ( $i == 2 )\n {\n continue;\n }\n $this->assertArrayHasKey( $i, $levels );\n }\n }", "public function testEvaluateTooManyOperands()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"4 3 2 1 + *\");\n $this->assertEquals(false, $retval);\n }", "public function benchLpopPipeline()\n {\n $pipeline = new Pipeline($this->client);\n $cmd = $this->client->getProfile()->createCommand('multi');\n $pipeline->executeCommand($cmd);\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $cmd = $this->client->getProfile()->createCommand('lpop', [$this->queueName]);\n $pipeline->executeCommand($cmd);\n }\n $cmd = $this->client->getProfile()->createCommand('exec');\n $pipeline->executeCommand($cmd);\n $result = $pipeline->execute();\n $messageList = array_map(\n '\\Prototype\\Redis\\RedisEnvelope::jsonDeserialize',\n end($result)\n );\n }", "public function testlOrSingleImpl()\n {\n $this->q->select( '*' )->from( 'query_test' )\n ->where( $this->e->lOr( $this->e->eq( 1, 1 ) ) );\n $stmt = $this->db->query( $this->q->getQuery() );\n $rows = 0;\n foreach ( $stmt as $row )\n {\n $rows++;\n }\n $this->assertEquals( 4, $rows );\n }", "public function testRPN()\n {\n $stack = array();\n\n $fsm = new FSM('INIT', $stack);\n $fsm->setDefaultTransition('INIT', 'Error');\n\n $fsm->addTransitionAny('INIT', 'INIT');\n $fsm->addTransition('=', 'INIT', 'INIT', array($this, 'doEqual'));\n $fsm->addTransitions(range(0, 9), 'INIT', 'BUILD_NUMBER', array($this, 'doBeginBuildNumber'));\n $fsm->addTransitions(range(0, 9), 'BUILD_NUMBER', 'BUILD_NUMBER', array($this, 'doBuildNumber'));\n $fsm->addTransition(' ', 'BUILD_NUMBER', 'INIT', array($this, 'doEndBuildNumber'));\n $fsm->addTransitions(array('+', '-', '*', '/'), 'INIT', 'INIT', array($this, 'doOperator'));\n\n $input = '1 9 + 29 7 * * =';\n\n $fsm->processString($input);\n }", "public function testPrecedenceIsInValidRange()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::greaterThan( 0 ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be 1 or higher.\" );\n }\n }", "function exec_lola_check($check_name, $formula, $extra_parameters = \"\") {\n global $lola_filename;\n global $lola_timelimit;\n global $lola_markinglimit;\n global $lola;\n global $output;\n\n $json_filename = $lola_filename . \".\" . $check_name . \".json\";\n $witness_path_filename = $lola_filename . \".\" . $check_name . \".path\";\n $witness_state_filename = $lola_filename . \".\" . $check_name . \".state\";\n $process_output = [];\n $return_code = 0;\n \n // Run LoLA\n $lola_command = $lola \n . \" --timelimit=\" . $lola_timelimit \n . \" --markinglimit=\" . $lola_markinglimit \n . \" \" . $extra_parameters \n . \" --formula='\" . $formula . \"'\"\n . \" --path='\" . $witness_path_filename . \"'\"\n . \" --state='\" . $witness_state_filename . \"'\"\n . \" --json='\" . $json_filename . \"'\"\n . \" '\" . $lola_filename . \"'\"\n . \" 2>&1\";\n debug(\"Running command \" . $lola_command);\n exec($lola_command, $process_output, $return_code);\n \n debug($process_output);\n \n // Check if run was okay\n if ($return_code != 0) {\n $output[\"lola_output\"] = $process_output;\n terminate(\"LoLA exited with code \". $return_code);\n }\n \n // Load and parse result JSON file\n $string_result = file_get_contents($json_filename);\n if ($string_result === FALSE)\n terminate($check_name . \": Can't open result file \" . $json_filename);\n \n $json_result = json_decode($string_result, TRUE);\n debug($json_result);\n \n if (!isset($json_result[\"analysis\"]) || !isset($json_result[\"analysis\"][\"result\"])) {\n debug($json_result);\n terminate($check_name . \": malformed JSON result. Probably the time or memory limit was exceeded.\");\n }\n \n // Load witness path\n $witness_path = load_witness_path($witness_path_filename);\n \n // Load witness state\n $witness_state = load_witness_state($witness_state_filename);\n \n // Create result object\n $result = new CheckResult((boolean)($json_result[\"analysis\"][\"result\"]), $witness_path, $witness_state);\n \n // Return analysis result\n return $result;\n }", "private function operation(Token $op, &$args) {\n\t\tif ($op->isUnaryOperator()) {\n\t\t\tif (count($args) < 1) {\n\t\t\t\tthrow new \\Exception(\"Illegal number (\".count($args).\") of operands for \" . $op);\n\t\t\t}\n\t\t\t$arg1 = array_pop($args);\n\t\t} else if ($op->isBinaryOperator()) {\n\t\t\tif (count($args) < 2) {\n\t\t\t\tthrow new \\Exception(\"Illegal number (\".count($args).\") of operands for \" . $op);\n\t\t\t}\n\t\t\t$arg2 = array_pop($args);\n\t\t\t$arg1 = array_pop($args);\n\t\t} else if ($op->isTernaryOperator()) {\n\t\t\tif (count($args) < 3) {\n\t\t\t\tthrow new \\Exception(\"Illegal number (\".count($args).\") of operands for \" . $op);\n\t\t\t}\n\t\t\t$arg3 = array_pop($args);\n\t\t\t$arg2 = array_pop($args);\n\t\t\t$arg1 = array_pop($args);\n\t\t}\n\t\ttry {\n\t\t\t$result = new Token(Token::T_NUMBER, 0);\n\t\t\tswitch ($op->type) {\n\t\t\t\tcase Token::T_PLUS:\n\t\t\t\t\tOperation::plus($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_MINUS:\n\t\t\t\t\tOperation::minus($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_TIMES:\n\t\t\t\t\tOperation::times($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_DIV:\n\t\t\t\t\tOperation::div($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_MOD:\n\t\t\t\t\tOperation::mod($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_POW:\n\t\t\t\t\tOperation::pow($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_BITWISE_AND:\n\t\t\t\t\tOperation::bitwiseAnd($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_BITWISE_XOR:\n\t\t\t\t\tOperation::bitwiseXor($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_BITWISE_OR:\n\t\t\t\t\tOperation::bitwiseOr($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_LOGICAL_AND:\n\t\t\t\t\tOperation::logicalAnd($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_LOGICAL_OR:\n\t\t\t\t\tOperation::logicalOr($arg1, $arg2, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_UNARY_PLUS:\n\t\t\t\t\tOperation::unaryPlus($arg1, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_UNARY_MINUS:\n\t\t\t\t\tOperation::unaryMinus($arg1, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_NOT:\n\t\t\t\t\tOperation::not($arg1, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_DEGRE:\n\t\t\t\t\tOperation::degre($arg1, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_TERNARY_ELSE:\n\t\t\t\t\tOperation::ternaryElse($arg1, $result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_TERNARY:\n\t\t\t\t\tOperation::ternary($arg1, $arg2, $arg3, $result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->guessType($result);\n\t\t\treturn $result;\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\Exception($op . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function getLPFailed();", "public function testCalculate()\n {\n $calc = new ReversePolishCalculator();\n $calc\n ->enter(3)\n ->enter(2)\n ->enter(1)\n ->add()\n ->multiply()\n ;\n\n $this->assertEquals([9], $calc->getStack());\n }", "function convert_pnml_to_lola($pnml_filename) {\n global $output;\n \n $return_code = null;\n $process_output = [];\n \n exec($petri . \" -ipnml -olola \".$pnml_filename, $process_output, $return_code);\n if ($return_code != 0) {\n foreach ($process_output as $line) {\n $output[\"petri_output\"][] = htmlspecialchars($line);\n }\n terminate(\"petri exited with status \" . $return_code . \" -- probably the input is malformed.\");\n }\n \n $lola_filename = $pnml_filename . \".lola\";\n return $lola_filename;\n }", "function yy_shift($yyNewState, $yyMajor, $yypMinor)\n {\n $this->yyidx++;\n if ($this->yyidx >= self::YYSTACKDEPTH) {\n $this->yyidx--;\n if (self::$yyTraceFILE) {\n fprintf(self::$yyTraceFILE, \"%sStack Overflow!\\n\", self::$yyTracePrompt);\n }\n while ($this->yyidx >= 0) {\n $this->yy_pop_parser_stack();\n }\n /* Here code is inserted which will execute if the parser\n ** stack ever overflows */\n return;\n }\n $yytos = new SQLParser_yyStackEntry;\n $yytos->stateno = $yyNewState;\n $yytos->major = $yyMajor;\n $yytos->minor = $yypMinor;\n array_push($this->yystack, $yytos);\n if (self::$yyTraceFILE && $this->yyidx > 0) {\n fprintf(self::$yyTraceFILE, \"%sShift %d\\n\", self::$yyTracePrompt,\n $yyNewState);\n fprintf(self::$yyTraceFILE, \"%sStack:\", self::$yyTracePrompt);\n for ($i = 1; $i <= $this->yyidx; $i++) {\n fprintf(self::$yyTraceFILE, \" %s\",\n self::$yyTokenName[$this->yystack[$i]->major]);\n }\n fwrite(self::$yyTraceFILE,\"\\n\");\n }\n }", "public function getLPNotAttempted();", "function specialop() {\n\n\n\t}", "public function testGetLabelAndLangDataSetDif() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(1, 1);\n $this->assertTrue(true);\n }", "public function __invoke(...$operand)\n\t{\n\t\t// NOP\n\t}", "public function getLPCompleted();", "function isOperatorL($login) {\n\n\t\t// check for operator list entry\n\t\tif ($login != '' && isset($this->operator_list['TMLOGIN']))\n\t\t\treturn in_array($login, $this->operator_list['TMLOGIN']);\n\t\telse\n\t\t\treturn false;\n\t}", "function trial(\n int $instruction_index\n): array\n{\n global $instructions;\n\n // Check if the instruction from the index is a jmp or noop (we can only\n // change those)\n if (!preg_match('/^(nop|jmp).*$/', $instructions[$instruction_index])) {\n // Not a suitable candidate for execution\n return [ false, null ];\n }\n\n // Execute the program\n $accumulator = 0;\n $program_pointer = 0;\n\n // Mark which instructions was already executed\n $executed = [];\n\n\n while (true) {\n if ($program_pointer >= count($instructions)) {\n // We reached a location outside of the instruction bootrom\n return [ true, $accumulator ];\n }\n // Execute everything\n $current_instruction = $instructions[$program_pointer];\n\n if (in_array($program_pointer, $executed)) {\n // We executed this command earlier\n // Since our boot program is stateless, this must mean an infinite\n // loop\n return [ false, null ];\n }\n\n // print($instruction_index.' - '.$program_pointer.': '.$current_instruction.\"\\n\");\n\n // Mark this is executed\n $executed[] = $program_pointer;\n\n if (preg_match('/^nop ([+-][0-9]+)$/', $current_instruction, $parts)) {\n // No op - progress by one\n if ($program_pointer == $instruction_index) {\n // We are supposed to try and change this one to a jmp\n $program_pointer += intval($parts[1]);\n } else {\n // Behave normally\n $program_pointer += 1;\n }\n } elseif (preg_match('/^acc ([+-][0-9]+)$/', $current_instruction, $parts)) {\n // Accumulation\n $program_pointer += 1;\n $accumulator += intval($parts[1]);\n } elseif (preg_match('/^jmp ([+-][0-9]+)$/', $current_instruction, $parts)) {\n // Jump\n if ($program_pointer == $instruction_index) {\n // We are supposed to try and change this one to a noop\n $program_pointer += 1;\n } else {\n // Behave normally\n $program_pointer += intval($parts[1]);\n }\n }\n }\n}", "public function testGetLabelAndLangDataSet() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(2, 1);\n $this->assertTrue(true);\n }", "public function testGetLabelAndLanguageList() {\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList(2, 1, 1);\n $this->assertTrue(true);\n }", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg)\n{\n if ((strcmp(\"ADD\", $instruction[0]) == 0) || (strcmp(\"SUB\", $instruction[0]) == 0) || (strcmp(\"MUL\", $instruction[0]) == 0) || (strcmp(\"IDIV\", $instruction[0]) == 0) )\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"LT\", $instruction[0]) == 0) || (strcmp(\"GT\", $instruction[0]) == 0) || (strcmp(\"EQ\", $instruction[0]) == 0) || (strcmp(\"AND\", $instruction[0]) == 0) || (strcmp(\"OR\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"STRI2INT\", $instruction[0]) == 0) || (strcmp(\"CONCAT\", $instruction[0]) == 0) || (strcmp(\"GETCHAR\", $instruction[0]) == 0) || (strcmp(\"SETCHAR\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"JUMPIFEQ\", $instruction[0]) == 0) || (strcmp(\"JUMPIFNEQ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"label\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n}", "public function skipUntil($operator) {}", "public function test_do_action_several_times_and_count() {\n $hook = rand_str();\n $this->assertSame( 0, yourls_did_action( $hook ) );\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_do_action( $hook );\n }\n\n $this->assertSame( $times, yourls_did_action( $hook ) );\n\t}", "private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "public function sub_instr()\n {\n $this->instructions--;\n }", "public function test_add_several_actions_random_priorities() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n $total = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $total += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n $this->assertSame( $times, $total );\n }", "public function operators();", "public function laptops()\n {\n return static::randomElement(static::$laptops);\n }", "private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }", "function yy_shift($yyNewState, $yyMajor, $yypMinor)\r\n {\r\n $this->yyidx++;\r\n if ($this->yyidx >= self::YYSTACKDEPTH) {\r\n $this->yyidx--;\r\n if (self::$yyTraceFILE) {\r\n fprintf(self::$yyTraceFILE, \"%sStack Overflow!\\n\", self::$yyTracePrompt);\r\n }\r\n while ($this->yyidx >= 0) {\r\n $this->yy_pop_parser_stack();\r\n }\r\n /* Here code is inserted which will execute if the parser\r\n ** stack ever overflows */\r\n return;\r\n }\r\n $yytos = new TP_yyStackEntry;\r\n $yytos->stateno = $yyNewState;\r\n $yytos->major = $yyMajor;\r\n $yytos->minor = $yypMinor;\r\n array_push($this->yystack, $yytos);\r\n if (self::$yyTraceFILE && $this->yyidx > 0) {\r\n fprintf(self::$yyTraceFILE, \"%sShift %d\\n\", self::$yyTracePrompt,\r\n $yyNewState);\r\n fprintf(self::$yyTraceFILE, \"%sStack:\", self::$yyTracePrompt);\r\n for($i = 1; $i <= $this->yyidx; $i++) {\r\n fprintf(self::$yyTraceFILE, \" %s\",\r\n $this->yyTokenName[$this->yystack[$i]->major]);\r\n }\r\n fwrite(self::$yyTraceFILE,\"\\n\");\r\n }\r\n }", "public function testGetOperatorSigil0()\n{\n\n $actual = $this->bitwiseOr->getOperatorSigil();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function test_apply_ops_random_order() {\n\n $r1 = new replica();\n $r2 = new replica();\n\n // Generate initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), null, \"trash\", $trash_id = new_id()),\n new op_move($r1->tick(), $root_id, \"home\", $home_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dilbert\", $dilbert_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dogbert\", $dogbert_id = $dilbert_id),\n new op_move($r1->tick(), $dogbert_id, \"cycle_not_allowed\", $home_id),\n ];\n\n $r1->apply_ops($ops);\n $r1->state->check_log_is_descending();\n\n $start = microtime(true);\n $num_ops = count($ops);\n\n printf(\"Applying move operations from replica1 to replica2 in random orders...\\n\");\n $all_equal = true;\n\n for($i = 0; $i < 100000; $i ++) {\n $ops2 = $ops;\n shuffle($ops2);\n\n $r2 = new replica();\n $r2->apply_ops($ops2);\n\n if($i % 10000 == 0) {\n printf(\"$i... \");\n }\n $r2->state->check_log_is_descending();\n\n if (!$r1->state->is_equal($r2->state)) {\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops1.json\", json_encode($ops, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops2.json\", json_encode($ops2, JSON_PRETTY_PRINT));\n printf( \"\\nreplica_1 %s replica_2\\n\", $r1->state->is_equal($r2->state) ? \"is equal to\" : \"is not equal to\");\n $all_equal = false;\n break;\n }\n }\n $end = microtime(true);\n $elapsed = $end - $start;\n \n if($all_equal) {\n echo \"\\n\\nStates were consistent and log timestamps descending after each apply. :-)\\n\";\n } else {\n echo \"\\n\\nFound an inconsistent state. Check /tmp/ops{1,2}.json and /tmp/repl{1,2}.json.\\n\";\n }\n\n $tot_ops = $num_ops*$i;\n printf(\"\\nops_per_apply: %s, applies: %s, total_ops: %s, duration: %.8f, secs_per_op: %.8f\\n\", $num_ops, $i, $tot_ops, $elapsed, $elapsed / $tot_ops);\n}", "public function provideTupleTests() {\n $result = [\n '>' => [['id' => [Db::OP_GT => 3]], [4, 5]],\n '>=' => [['id' => [Db::OP_GTE => 3]], [3, 4, 5]],\n '<' => [['id' => [Db::OP_LT => 3]], [1, 2]],\n '<=' => [['id' => [Db::OP_LTE => 3]], [1, 2, 3]],\n '=' => [['id' => [Db::OP_EQ => 2]], [2]],\n '<>' => [['id' => [Db::OP_NEQ => 3]], [1, 2, 4, 5]],\n 'is null' => [['id' => null], [null]],\n 'is not null' => [['id' => [Db::OP_NEQ => null]], [1, 2, 3, 4, 5]],\n 'all' => [[], [null, 1, 2, 3, 4, 5]],\n 'in' => [['id' => [Db::OP_IN => [3, 4, 5]]], [3, 4, 5]],\n 'in (short)' => [['id' => [3, 4, 5]], [3, 4, 5]],\n '= in' => [['id' => [Db::OP_EQ => [3, 4, 5]]], [3, 4, 5]],\n '<> in' => [['id' => [Db::OP_NEQ => [3, 4, 5]]], [1, 2]],\n 'and' =>[['id' => [\n Db::OP_AND => [\n Db::OP_GT => 3,\n Db::OP_LT => 5\n ]\n ]], [4]],\n 'or' =>[['id' => [\n Db::OP_OR => [\n Db::OP_LT => 3,\n Db::OP_EQ => 5\n ]\n ]], [1, 2, 5]]\n ];\n\n return $result;\n }", "function testDropOperator()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Turn to \"Operators\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/operators.php\", array(\r\n\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'schema' => 'public',\r\n\t\t\t\t\t\t'subject' => 'schema'))\r\n\t\t\t\t\t);\r\n \r\n // Drop the first operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped correctly.\r\n $this->assertTrue($this->assertWantedText($lang['stroperatordropped'])); \r\n \r\n // Drop the second operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped correctly.\r\n $this->assertTrue($this->assertWantedText($lang['stroperatordropped']));\r\n \r\n // Drop the third operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped completely.\r\n $this->assertTrue($this->assertWantedText($lang['strnooperators']));\r\n \r\n return TRUE;\r\n }", "public function testMissingParametersUnpauseChecks() {\n $this->pingdom->unpauseChecks(null);\n }", "function checkopration($operator)\r\n {\r\n switch($operator)\r\n {\r\n case 'Add':\r\n return $this->number1 + $this->number2;\r\n break;\r\n\r\n case 'Substract':\r\n return $this->number1 - $this->number2;\r\n break;\r\n\r\n case 'Multiply':\r\n return $this->number1 * $this->number2;\r\n break;\r\n\r\n case 'Divide':\r\n return $this->number1 / $this->number2;\r\n break;\r\n\r\n default:\r\n return \"Sorry No command found\";\r\n } \r\n }", "private function breakLongLines($code)\n\t{\n\t\t// for debugging purposes, show asterisks across the top with the line length.\n\t\t//echo str_repeat('*', self::$linelen).\"\\n\";\n\t\t$tokens = token_get_all($code);\n\t\t// when we hit an operator, we look ahead to see if we can make it to the next\n\t\t// operator without going over our limit. if we can't, we break after ourselves. if we\n\t\t// can, we instead jump to that point and keep going.\n\t\t//\n\t\t// we also need to maintain our indentation level when we break after oureslves.\n\t\t$final = array();\n\t\t$indent = ''; // amount of indentation on the current line\n\t\t$chars = 0; // chars since last newline\n\t\t$lastop = - 1; // position in tokens of last operator\n\t\t$lastchars = 0; // chars since lastop\n\t\t$lastorgline = 0; // the last original (not added here) newline\n\t\t$opstack = array();\n\t\t$broken = false;\n\t\t\n\t\tfor($tokeni = 0; $tokeni < count($tokens); $tokeni++)\n\t\t{\n\t\t\tlist($token, $val) = self::Tokenize($tokens[$tokeni]);\n\t\t\t$final[] = $val;\n\t\t\t\n\t\t\t//\n\t\t\tif (($token == T_WHITESPACE && strpos($val, \"\\n\") !== false) || \n\t\t\t\t\t\t($token == T_COMMENT && substr($val, - 1) == \"\\n\") || \n\t\t\t\t\t\t($token == T_OPEN_TAG && substr($val, - 1) == \"\\n\"))\n\t\t\t{\n\t\t\t\t// re-balance the previous line now that we have complete info. basically, we\n\t\t\t\t// just make certain operators \"greedy\" in that if we can keep them together\n\t\t\t\t// without adding more lines, we'll do it. (this is purely asthetic, but then\n\t\t\t\t// again, isn't all formatting?)\n\t\t\t\t$valid = function ($chunks, $maxlen) {\n\t\t\t\t\t$len = 0;\n\t\t\t\t\tforeach($chunks as $chunk)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strpos($chunk, \"\\n\") !== false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$len += Formatter::SmartLen(current(explode(\"\\n\", $chunk)));\n\t\t\t\t\t\t\tif ($len > $maxlen)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// restart\n\t\t\t\t\t\t\t$len = Formatter::SmartLen(end(explode(\"\\n\", $chunk)));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$len += Formatter::SmartLen($chunk);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($len > $maxlen)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\t\t\t\t$findlines = function ($d) {\n\t\t\t\t\treturn array_filter($d, function ($v) {\n\t\t\t\t\t\t\treturn strpos($v, \"\\n\") !== false;\n\t\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t$slice = array_slice($final, $lastorgline, count($final) - $lastorgline - 1);\n\t\t\t\t$breaksadded = $findlines($slice);\n\t\t\t\t$bslen = count($breaksadded);\n\t\t\t\tif ($bslen > 0 && $valid($slice, self::$linelen))\n\t\t\t\t{\n\t\t\t\t\t// we're going to try each of \" (\", \"||\", and \"&&\" for additional\n\t\t\t\t\t// breakage, stopping if we successfully change the string. basically, if\n\t\t\t\t\t// there's a bracket following a space, we re-bias the line against that.\n\t\t\t\t\t// failing that, however, as most if statements do, we'll try to do the same\n\t\t\t\t\t// thing with the next highest precedence operator, the ||, and then failing\n\t\t\t\t\t// that try again with && (again since most if statements are just &&)\n\t\t\t\t\t$changes = 0;\n\t\t\t\t\t$ops = array('(', '||', '&&');\n\t\t\t\t\tfor($opsi = 0, $opslen = count($ops); !$changes &&\n\t\t\t\t\t\t $opsi < $opslen; $opsi++)\n\t\t\t\t\t{\n\t\t\t\t\t\t// clone the slice for this iteration\n\t\t\t\t\t\t$ts = $slice;\n\t\t\t\t\t\t// only make one change at a time, to avoid index munging (this may\n\t\t\t\t\t\t// not be strictly necessary anymore since we modify instead of insert\n\t\t\t\t\t\t// now, but it's still handy to ensure consistency)\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t$modified = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// since we add newlines left-to-right, it makes sense to be\n\t\t\t\t\t\t\t// greedy from right-to-left, since that's what's likely to have\n\t\t\t\t\t\t\t// been forgotten. so, let's move the LAST newline to after the\n\t\t\t\t\t\t\t// preceeding operator.\n\t\t\t\t\t\t\t$bsa = array_keys(array_reverse($breaksadded, true));\n\t\t\t\t\t\t\tfor($bsk = 0; !$modified && $bsk < $bslen; $bsk++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$bsi = $bsa[$bsk];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$orgline = $ts[$bsi];\n\t\t\t\t\t\t\t\t$ts[$bsi] = rtrim($orgline, \"\\n\\t\");\n\t\t\t\t\t\t\t\t$lineform = str_replace(\"\\n\\t\", \"\\n\", substr($orgline, strlen(\n\t\t\t\t\t\t\t\t\t\t\t$ts[$bsi])));\n\t\t\t\t\t\t\t\tif (empty($ts[$bsi]))\n\t\t\t\t\t\t\t\t\t$ts[$bsi] = ' ';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor($tsi = $bsi - 1; !$modified && $tsi >= 0; $tsi--)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// bracket preceeded by space is the BEST place to break\n\t\t\t\t\t\t\t\t\tif ($ts[$tsi] == $ops[$opsi] &&\n\t\t\t\t\t\t\t\t\t\t strlen(trim($ts[$tsi - 1])) == 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$before = ($ops[$opsi] == '(' ? 1 : 0);\n\t\t\t\t\t\t\t\t\t\t$ts[$tsi - $before] .= $lineform;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ($valid($ts, self::$linelen) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t count($findlines($ts)) <= $bslen)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// instead of array_splice'ing, we'll just copy\n\t\t\t\t\t\t\t\t\t\t\t// what's changed\n\t\t\t\t\t\t\t\t\t\t\tif ($final[$lastorgline + $tsi - $before] !=\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ts[$tsi - $before] ||\n\t\t\t\t\t\t\t\t\t\t\t\t $final[$lastorgline + $bsi] != $ts[$bsi])\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$final[$lastorgline + $tsi -\n\t\t\t\t\t\t\t\t\t\t\t\t\t$before] = $ts[$tsi - $before];\n\t\t\t\t\t\t\t\t\t\t\t\t$final[$lastorgline + $bsi] = $ts[$bsi];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$modified = true;\n\t\t\t\t\t\t\t\t\t\t\t\t$changes++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile($modified);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$lastorgline = count($final); // reset for next time now set up the NEXT\n\t\t\t\t\t// line: reset the indentation with the whitespace at the end of this line,\n\t\t\t\t\t// or the next whitespace (if we're actually a comment)\n\t\t\t\t$indent = end(explode(\"\\n\", $val));\n\t\t\t\tif (($tokeni + 1) < count($tokens) && $tokens[$tokeni + 1][0] == T_WHITESPACE)\n\t\t\t\t\t$indent .= $tokens[$tokeni + 1][1];\n\t\t\t\t$chars = $token == T_COMMENT ? 0 : self::SmartLen($indent);\n\t\t\t\t\n\t\t\t\t$lastchars = 0;\n\t\t\t\t$lastop = - 1;\n\t\t\t\t$opstack = array();\n\t\t\t}\n\t\t\telse if ($token == T_INLINE_HTML)\n\t\t\t{\n\t\t\t\t$lastline = end(explode(\"\\n\", $val));\n\t\t\t\t$lastchars = $chars = self::SmartLen($lastline);\n\t\t\t\t$indent = preg_replace('/[^\\t]/', '', $lastline);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$chars += self::SmartLen($val);\n\t\t\t\t$lastchars += self::SmartLen($val);\n\t\t\t\t\n\t\t\t\tif ($chars >= self::$linelen)\n\t\t\t\t{\n\t\t\t\t\t// go back to $lastop and add a newline in the placeholder after it\n\t\t\t\t\tif ($lastop >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fullindent = $indent . str_repeat(\"\\t\", count($opstack));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (strlen(trim($final[$lastop])) == 0)\n\t\t\t\t\t\t\t$final[$lastop] = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if we're an \"inline\" bracket (i.e. a space before), put newline\n\t\t\t\t\t\t// first\n\t\t\t\t\t\tif (trim($final[$lastop]) == '(' &&\n\t\t\t\t\t\t\t substr($final[$lastop - 1], - 1) == ' ')\n\t\t\t\t\t\t\t$final[$lastop] = \"\\n\" . $fullindent . $final[$lastop];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$final[$lastop] .= \"\\n\" . $fullindent;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$lastop = - 1;\n\t\t\t\t\t\t$chars = $lastchars + self::SmartLen($fullindent);\n\t\t\t\t\t\t$lastchars = self::SmartLen($fullindent);\n\t\t\t\t\t\t$broken = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// so what we need to do is establish a stack of operators. when an opening\n\t\t\t\t// bracket is hit, we establish a new level, one indent deep. we undo this at\n\t\t\t\t// the corresponding closing bracket. commas are a bit stranger. we create a new\n\t\t\t\t// stack element with the comma, but it's actually closed by a comma or a\n\t\t\t\t// closing bracket (and reopened, obviously, if it's by a comma). this is\n\t\t\t\t// because the comma and brackets are actually all on one level. then, normal\n\t\t\t\t// operators like math operators or dots create a new TEMPORARY indent level.\n\t\t\t\t// all lines following these temp indent levels are indented again, but they die\n\t\t\t\t// at any other operator. moreso, if that delimiting operator is a comma, a\n\t\t\t\t// newline is forced, even if we're no where near the length max. this is\n\t\t\t\t// because the expression following the comma is not at the same indentation\n\t\t\t\t// level as the temp\n\t\t\t\t//\n\t\t\t\tif ($token == '(')\n\t\t\t\t{\n\t\t\t\t\t// only break on opening brackets that aren't immediately closed (i.e.\n\t\t\t\t\t// empty)\n\t\t\t\t\tif ($tokens[$tokeni + 1][0] != ')')\n\t\t\t\t\t{\n\t\t\t\t\t\t// fake a comma\n\t\t\t\t\t\t$opstack[] = array(',', $tokeni, 'FAKE(');\n\t\t\t\t\t\t$lastop = $tokeni;\n\t\t\t\t\t\t$broken = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($token == ')')\n\t\t\t\t{\n\t\t\t\t\t// only break on opening brackets that aren't immediately closed (i.e.\n\t\t\t\t\t// empty)\n\t\t\t\t\tif ($tokens[$tokeni - 1][0] != '(')\n\t\t\t\t\t{\n\t\t\t\t\t\t// go back to the last opening bracket\n\t\t\t\t\t\twhile(count($opstack) > 0 && end(end($opstack)) != 'FAKE(')\n\t\t\t\t\t\t\tarray_pop($opstack);\n\t\t\t\t\t\tarray_pop($opstack);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($token == ',')\n\t\t\t\t{\n\t\t\t\t\t$lastop = ++$tokeni;\n\t\t\t\t\t$lastchars = 0;\n\t\t\t\t\t$final[] = ' ';\n\t\t\t\t\t$chars++; // space we added\n\t\t\t\t\t$break = false;\n\t\t\t\t\t// take off all indenting back to the previous comma. if we pass anything\n\t\t\t\t\t// else, then we need a newline.\n\t\t\t\t\twhile(count($opstack) > 0 && current(end($opstack)) != ',')\n\t\t\t\t\t\tif (!in_array(current(array_pop($opstack)), array(',')) && $broken)\n\t\t\t\t\t\t\t$break = true;\n\t\t\t\t\t\n\t\t\t\t\tif ($break)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fullindent = $indent . str_repeat(\"\\t\", count($opstack));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (strlen(trim($final[$lastop])) == 0)\n\t\t\t\t\t\t\t$final[$lastop] = '';\n\t\t\t\t\t\t$final[$lastop] .= \"\\n\" . $fullindent;\n\t\t\t\t\t\t$lastop = - 1;\n\t\t\t\t\t\t$chars = $lastchars + self::SmartLen($fullindent);\n\t\t\t\t\t\t$lastchars = self::SmartLen($fullindent);\n\t\t\t\t\t\t$broken = false;\n\t\t\t\t\t}\n\t\t\t\t\t// if we took everything out, add a comma\n\t\t\t\t\tif (count($opstack) == 0 || current(end($opstack)) == '(')\n\t\t\t\t\t\t$opstack[] = array($token, $tokeni);\n\t\t\t\t}\n\t\t\t\telse if (in_array($token, array('.', '?', ':', T_BOOLEAN_AND, T_BOOLEAN_OR,\n\t\t\t\t\t\t\t'*', '+', '-', '/', '%', '<', '>', T_IS_NOT_EQUAL, T_IS_EQUAL,\n\t\t\t\t\t\t\tT_IS_IDENTICAL, T_IS_NOT_IDENTICAL, T_IS_SMALLER_OR_EQUAL,\n\t\t\t\t\t\t\tT_IS_GREATER_OR_EQUAL, T_DOUBLE_ARROW)))\n\t\t\t\t{\n\t\t\t\t\t$lastop = ++$tokeni; // increment to eat the original space\n\t\t\t\t\t$lastchars = 0;\n\t\t\t\t\t$final[] = ' '; // placeholder\n\t\t\t\t\t$chars++; // the space we just added take off any other\n\t\t\t\t\t// non-comma (i.e. temp) operator indent and replace it\n\t\t\t\t\tif (count($opstack) > 0 && current(end($opstack)) != ',')\n\t\t\t\t\t\tarray_pop($opstack);\n\t\t\t\t\t$opstack[] = array($token, $tokeni);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn implode('', $final);\n\t}", "private function rightExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($op == BinaryOperators::PHP_ARRAY_ELEMENT) {\n // x[y] == x[(y)]\n return false;\n }\n if ($expr instanceof ConditionalExpression) {\n // let (y) == (a ? b : c)\n // x op (a ? b : c) != x op a ? b : c if\n return $this->rightExprNeedsParentheses(\n $op, $expr->getCondition());\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (y) == (a op1 b)\n // x op (a op1 b) != x op a op1 b if\n if (!BinaryOperators::hasPriority($expr->getOperation(), $op)) {\n return true;\n }\n // check if x op (a) op1 b == x op a op1 b\n return $this->rightExprNeedsParentheses($op, $expr->getExpression1());\n }\n\n // don't worry about unary operations:\n // prefix unaries do not have left operands hence\n // x op (uop a) == x op uop a in all cases.\n // postfix unaries trump binaries that get here hence\n // x op (a uop) == x op a uop in all cases.\n return false;\n }", "function yy_r149(){$this->_retvalue = ' XOR '; }", "function test_3() {\n\t$res = gather(function() {\n\t\ttake(1);\n\t\ttake(2);\n\t\tif (!gathered()) {\n\t\t\ttake(3);\n\t\t}\n\t});\n\treturn is_deeply($res, array(1, 2), 'gathered detects some gather');\n}", "public function testReadingLapsOfParticipants()\n {\n // Get participants\n $participants = $this->getWorkingReader()->getSession()\n ->getParticipants();\n\n // Get the laps of first participants\n $laps = $participants[0]->getLaps();\n\n // Validate we have 7 laps\n $this->assertSame(5, count($laps));\n\n // Get driver of first participant (only one cause there are no swaps)\n $driver = $participants[0]->getDriver();\n\n // Get first lap only\n $lap = $laps[0];\n\n // Validate laps\n $this->assertSame(1, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(173.883, $lap->getTime());\n $this->assertSame(0, $lap->getElapsedSeconds());\n $this->assertSame($participants[0], $lap->getParticipant());\n $this->assertSame($driver, $lap->getDriver());\n\n // Get sector times\n $sectors = $lap->getSectorTimes();\n\n // Validate sectors\n $this->assertSame(69.147, $sectors[0]);\n $this->assertSame(64.934, $sectors[1]);\n $this->assertSame(39.802, $sectors[2]);\n\n // Second lap\n $lap = $laps[1];\n $this->assertSame(2, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(142.660, $lap->getTime());\n $this->assertSame(173.883, $lap->getElapsedSeconds());\n\n // Validate extra positions\n $laps = $participants[3]->getLaps();\n $this->assertSame(6, $laps[0]->getPosition());\n $this->assertSame(6, $laps[1]->getPosition());\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "function iterateInstruction(){\n $this->instructionNumber += 1;\n }", "public function passes();", "function redo_op(log_op_move $logop, state $state): state {\n $GLOBALS['redo_call_cnt'] ++; // for stats, not part of algo \n\n $op = op_move::from_log_op_move($logop);\n list($logop2, $tree2) = do_op($op, $state->tree);\n $state->add_log_entry($logop2);\n $state->tree = $tree2;\n return $state;\n}", "function binary_search($args) {\n\t $low = $args['min'];\n\t $high = $args['max'];\n\t \n\t while ($high >= $low) {\n\t\t$L = floor(($low + $high) / 2);\n\n\t\t$cmd = preg_replace(\"/{$args['pattern']}/\", $L, $args['command']);\n\n\t\t$output = \"{$args['output']}.$L\";\n\t\tprint(\"$cmd >& $output \\n\");\n\t\tsystem(\"$cmd > $output 2>&1\");\n\t\t$ok = `grep 'test is OK' $output `;\n\n\t\tif ($ok) {\n\t\t\t$high = $L - 1;\n\t\t} else {\n\t\t\t$low = $L + 1;\n\t\t}\n\t }\n\t return $L;\n}", "static function logicalXor()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalXor', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testExecutableLines() {\n\t\tdo {\n\t\t\t// These lines should be ignored\n\t\t\t//\n\n\t\t\t/* And these as well are ignored */\n\n\t\t\t/**\n\t\t\t * Testing never proves the absence of faults,\n\t\t\t * it only shows their presence.\n\t\t\t * - Dijkstra\n\t\t\t */\n\t\t} while (false);\n\n\t\t$result = Inspector::executable($this, ['methods' => __FUNCTION__]);\n\t\t$expected = [__LINE__ - 1, __LINE__, __LINE__ + 1];\n\t\t$this->assertEqual($expected, $result);\n\t}", "public function testRegonLocal7()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testGetLabelAndLanguageListEx() {\n try {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->throwException(New DaoException()));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList('s_lang_id', 't_lang_id', 'group_id');\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "function make_node($op, &$out, &$stack){\n\tif($op->priority == 2){\n\t\t// < > = CONTAINS\n\t\tif(!empty($out))\n\t\t\t$right = array_pop($out);\n\t\telse {\n\t\t\tfwrite(STDERR, \"error - neobsahuje pravy prvek\\n\");\n\t\t\texit(80);\n\t\t}\n\t\tif(!empty($out))\n\t\t\t$left = array_pop($out);\n\t\telse {\n\t\t\tfwrite(STDERR, \"error - neobsahuje levy prvek\\n\");\n\t\t\texit(80);\n\t\t}\n\t\tif($left->type == \"elem\" && $right->type == \"lit\"){\n\t\t\t$op->left = $left;\n\t\t\t$op->right = $right;\n\t\t}\n\t\telse {\n\t\t\tfwrite(STDERR, \"error - relacni operatory musi mit vlevo element a v pravo literal\\n\");\n\t\t\texit(80); \n\t\t}\n\n\t\tarray_push($out, $op);\n\t}\n\telse if($op->priority == 1){\n\t\tif(!empty($out))\n\t\t\t$node = array_pop($out);\n\t\telse{\n\t\t fwrite(STDERR, \"error - chybi prvek pro NOT\\n\");\n\t\t exit(80); \n\t\t}\n\t\t\t\n\n\t\tif($node->type == \"op\"){\n\t\t\t$op->left = $node;\n\t\t\t$op->right = NULL;\n\t\t}\n\t\telse {\n\t\t\tfwrite(STDERR,\"error - not muze byt pouze na operator ($node->type)\\n\");\n\t\t\texit(80); \n\t\t}\n\t\tarray_push($out, $op);\n\t}\n\telse\n\t{\n\t\tfwrite(STDERR,\"error - neznamy\\n\");\n\t\texit(80); \n\t}\n}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function testRunParityGame()\n\t{\n\t\t$this->assertIsArray(ParityGame\\runParityGame());\n\t\t$this->assertCount(3, ParityGame\\runParityGame());\n\t}", "function test(){\n\n\t\tglobal $LR;\n\t\tglobal $HLIn;\n\t\tglobal $HLOut;\n\t\tglobal $numHL;\n\n\t\tglobal $mseOut;\n\t\tglobal $mseIn;\n\t\tglobal $mse;\n\t\tglobal $dy1;\n\t\tglobal $dy2;\n\t\tglobal $dz;\n\n\t\tglobal $newDataUan;\n\t\tglobal $newDataTest;\n\n\t\tglobal $dbias2;\n\n\t\tfor ($x = 0; $x < 2; $x++){\n\n\t\t\tfor ($y = 0; $y < 3 ; $y++) { \n\t\t\t\t\n\t\t\t\t$HLIn[$x][$y] = $HLIn[$x][$y] + $dz[$x][$y];\n\n\t\t\t}\n\n\t\t\t$HLOut[$x][0] = $HLOut[$x][0] + $dy1[$x];\n\t\t\t$HLOut[$x][1] = $HLOut[$x][1] + $dy2[$x];\n\t\t\t$HLOut[$x][2] = $HLOut[$x][2] + $dbias2[$x];\n\n\t\t\t$HLIn[$x][3] = $HLIn[$x][2]+($HLIn[$x][0]*$newDataUan+$HLIn[$x][1]*$newDataTest); // z_in\n\n\t\t\t$HLIn[$x][4] = 1/(1+exp(-$HLIn[$x][3]));\n\n\t\t}\n\n\t\tfor ($x = 0; $x < 2; $x++){\n\n\t\t\t$HLOut[$x][3] = $HLOut[$x][2]+($HLOut[$x][0]*$HLIn[0][4])+($HLOut[$x][1]*$HLIn[1][4]); // y_in\n\t\t\t\n\t\t\t$HLOut[$x][4] = 1/(1+exp(-$HLOut[$x][3])); // y\n\n\t\t\techo \"real target \".$HLOut[$x][4].\"</br>\";\n\n\t\t\t// $targetTest[$x] = ($mseOut[$x]/($HLOut[$x][4]*(1-$HLOut[$x][4])))+$HLOut[$x][4];\n\n\t\t\t// echo $mseOut[$x].\"</br>\";\n\n\t\t\t// echo \"target \".$targetTest[$x].\"</br>\";\n\n\t\t\t// $mseOut[$x] = ($targetNorm[$person][$x]-$HLOut[$x][4])*((1/(1+exp(-$HLOut[$x][3])))*(1-1/(1+exp(-$HLOut[$x][3]))));\n\n\t\t\t// $dy1[$x] = $LR * $HLOut[$x][0] * $mseOut[$x];\n\n\t\t\t// $dy2[$x] = $LR * $HLOut[$x][0] * $dy1[$x];\n\n\t\t\t// $dbias2[$x][$y] = $LR * $mseOut[$x];\n\n\n\t\t}\n\t\t\n\t\t// for ($x=0; $x < 2 ; $x++) { \n\n\t\t// \t$mseIn[$x] = ($mseOut[0]*$HLOut[0][$x])+($mseOut[1]*$HLOut[1][$x]);\n\t\t// \t$mse[$x] = $mseIn[$x] * ((1/(1+exp(-$HLIn[$x][3])))*(1-1/1+exp(-$HLIn[$x][3])));\n\n\t\t// \tfor ($y = 0; $y < 3; $y++) { \n\t\t\t\t\n\t\t// \t\t$dz[$x][$y] = $mse[$x] * $HLIn[$x][$y];\n\t\t\t\t\n\t\t// \t}\n\n\t\t// }\n\n\t}", "public function testSLongLittle()\n {\n $this->markTestIncomplete('Does not work on 64bit systems!');\n $o = PelConvert::LITTLE_ENDIAN;\n\n /*\n * The easiest way to calculate the numbers to compare with, is to\n * let PHP do the arithmetic for us. When using the bit-wise\n * operators PHP will return a proper signed 32 bit integer.\n */\n\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 0, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 1, $o), 0x01 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 2, $o), 0x23 << 24 | 0x01 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 3, $o), 0x45 << 24 | 0x23 << 16 | 0x01 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 4, $o), 0x67 << 24 | 0x45 << 16 | 0x23 << 8 | 0x01);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 5, $o), 0x89 << 24 | 0x67 << 16 | 0x45 << 8 | 0x23);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 6, $o), 0xAB << 24 | 0x89 << 16 | 0x67 << 8 | 0x45);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 7, $o), 0xCD << 24 | 0xAB << 16 | 0x89 << 8 | 0x67);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 8, $o), 0xEF << 24 | 0xCD << 16 | 0xAB << 8 | 0x89);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 9, $o), 0xFF << 24 | 0xEF << 16 | 0xCD << 8 | 0xAB);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 10, $o), 0xFF << 24 | 0xFF << 16 | 0xEF << 8 | 0xCD);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 11, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xEF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 12, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n }", "public function testPrecedenceIsInteger()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::isType( 'integer' ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be an integer.\" );\n }\n }", "private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "function apply_log_ops(array $log_ops) {\n $ops = [];\n foreach($log_ops as $log_op) {\n $ops[] = op_move::from_log_op_move($log_op);\n }\n $this->apply_ops($ops);\n }", "public function testGetPayslip()\n {\n }", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "function testCreateOperator()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Turn to \"sql\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/database.php\", array(\r\n\t\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'subject' => 'database',\r\n\t\t\t\t\t\t'action' => 'sql'))\r\n\t\t\t\t\t);\r\n // Enter the definition of the new operator.\r\n $this->assertTrue($this->setField('query', 'CREATE OPERATOR === (' .\r\n 'LEFTARG = box, RIGHTARG = box, PROCEDURE = box_above, ' .\r\n 'COMMUTATOR = ==, NEGATOR = !==, RESTRICT = areasel, JOIN ' .\r\n '= areajoinsel);'));\r\n \r\n // Click the button \"Go\" to create a new operator.\r\n $this->assertTrue($this->clickSubmit($lang['strgo']));\r\n // Verify if the operator is created correctly.\r\n $this->assertTrue($this->assertWantedText($lang['strsqlexecuted']));\r\n \r\n return TRUE;\r\n }", "function evaluateANDSeries($series, $msgOffset)\n {\n // 1 4 5\n $ret = 0;\n \n $ids = explode(' ', trim($series));\n foreach ($ids as $childId) {\n $result = $this->evaluateRule($childId, $msgOffset + $ret);\n\n if (0 == $result) {\n // This AND series failed, no characters consumed\n return 0;\n } else {\n $ret += $result;\n }\n }\n\n return $ret;\n }", "function yy_get_expected_tokens($token)\n {\n $state = $this->yystack[$this->yyidx]->stateno;\n $expected = self::$yyExpectedTokens[$state];\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return $expected;\n }\n $stack = $this->yystack;\n $yyidx = $this->yyidx;\n do {\n $yyact = $this->yy_find_shift_action($token);\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n // reduce action\n $done = 0;\n do {\n if ($done++ == 100) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // too much recursion prevents proper detection\n // so give up\n return array_unique($expected);\n }\n $yyruleno = $yyact - self::YYNSTATE;\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\n $nextstate = $this->yy_find_reduce_action(\n $this->yystack[$this->yyidx]->stateno,\n self::$yyRuleInfo[$yyruleno]['lhs']);\n if (isset(self::$yyExpectedTokens[$nextstate])) {\n $expected += self::$yyExpectedTokens[$nextstate];\n if (in_array($token,\n self::$yyExpectedTokens[$nextstate], true)) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return array_unique($expected);\n }\n }\n if ($nextstate < self::YYNSTATE) {\n // we need to shift a non-terminal\n $this->yyidx++;\n $x = new SQLParser_yyStackEntry;\n $x->stateno = $nextstate;\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\n $this->yystack[$this->yyidx] = $x;\n continue 2;\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // the last token was just ignored, we can't accept\n // by ignoring input, this is in essence ignoring a\n // syntax error!\n return array_unique($expected);\n } elseif ($nextstate === self::YY_NO_ACTION) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // input accepted, but not shifted (I guess)\n return $expected;\n } else {\n $yyact = $nextstate;\n }\n } while (true);\n }\n break;\n } while (true);\n return array_unique($expected);\n }", "public function testPs()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(), 'ok');\n }", "public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }", "function do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed, $assertionstrue = false) {\n $this->assertTrue($assertionstrue || $ismatchpassed, \"$matchername failed 'is_match' check on regex '$regex' and string '$str'\");\n if (!$ismatchpassed) {\n echo 'obtained result ' . $obtained['is_match'] . ' for \\'is_match\\' is incorrect<br/>';\n }\n $this->assertTrue($assertionstrue || $fullpassed, \"$matchername failed 'full' check on regex '$regex' and string '$str'\");\n if (!$fullpassed) {\n echo 'obtained result ' . $obtained['full'] . ' for \\'full\\' is incorrect<br/>';\n }\n if (array_key_exists('index_first', $obtained)) {\n $this->assertTrue($assertionstrue || $indexfirstpassed, \"$matchername failed 'index_first' check on regex '$regex' and string '$str'\");\n if (!$indexfirstpassed) {\n echo 'obtained result '; print_r($obtained['index_first']); echo ' for \\'index_first\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('index_last', $obtained)) {\n $this->assertTrue($assertionstrue || $indexlastpassed, \"$matchername failed 'index_last' check on regex '$regex' and string '$str'\");\n if (!$indexlastpassed) {\n echo 'obtained result '; print_r($obtained['index_last']); echo ' for \\'index_last\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('next', $obtained)) {\n $this->assertTrue($assertionstrue || $nextpassed, \"$matchername failed 'next' check on regex '$regex' and string '$str'\");\n if (!$nextpassed) {\n echo 'obtained result \\'' . $obtained['next'] . '\\' for \\'next\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('left', $obtained)) {\n $this->assertTrue($assertionstrue || $leftpassed, \"$matchername failed 'left' check on regex '$regex' and string '$str'\");\n if (!$leftpassed) {\n echo 'obtained result \\'' . $obtained['left'] . '\\' for \\'left\\' is incorrect<br/>';\n }\n }\n }", "public function parse()\n {\n while($this->token != Instructions::EOF)\n {\n $choice = $this->decode();\n \n $this->instrCount++;\n $this->stats->add_instr();\n \n switch($choice)\n {\n case Instructions::zeroParams:\n $this->parse_zero_fun();\n break;\n case Instructions::oneParamL:\n $this->parse_oneL_fun();\n break;\n case Instructions::oneParamS:\n $this->parse_oneS_fun();\n break;\n case Instructions::oneParamV:\n $this->parse_oneV_fun();\n break;\n case Instructions::twoParamVS:\n $this->parse_twoVS_fun();\n break;\n case Instructions::twoParamVT:\n $this->parse_twoVT_fun();\n break;\n case Instructions::threeParamLSS:\n $this->parse_threeLSS_fun();\n break;\n case Instructions::threeParamVSS:\n $this->parse_threeVSS_fun();\n break;\n \n case Instructions::EOF:\n $this->stats->sub_instr();\n break;\n \n case Instructions::unknownFun:\n fwrite(STDERR, \"Error! Calling undefined function! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(22);\n }\n }\n }", "public function testGetLabelAndLangDataSetEx() {\n\n try {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->throwException(New DaoException()));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet('s_lang_id', 't_lang_id');\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "public function testRegonLocal6()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function checkPiplTest(){\r\n // Params\r\n $checkClass = new Pipl();\r\n // Class Call\r\n $res = $checkClass->test();\r\n // Return result\r\n $this->returnJson($res['code'], $res['message']);\r\n }", "function paramsValidateTwo($instruction, $first_arg, $sec_arg)\n{\n if ((strcmp(\"MOVE\", $instruction[0]) == 0) || (strcmp(\"NOT\", $instruction[0]) == 0) || (strcmp(\"INT2CHAR\", $instruction[0]) == 0) || (strcmp(\"STRLEN\", $instruction[0]) == 0) || (strcmp(\"TYPE\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") )\n {\n Err();\n }\n }\n else if ((strcmp(\"READ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg != \"type\"))\n {\n Err();\n }\n }\n}", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "public function verifyPoint(array $p): bool\n {\n [$x, $y] = $p;\n $lhs = $y->multiply($y);\n $temp = $x->multiply($this->a);\n $temp = $x->multiply($x)->multiply($x)->add($temp);\n $rhs = $temp->add($this->b);\n\n return $lhs->equals($rhs);\n }", "function paramsValidateOne($instruction, $first_arg)\n{\n if ((strcmp(\"DEFVAR\", $instruction[0]) == 0) || (strcmp(\"POPS\", $instruction[0]) == 0))\n {\n if ($first_arg != \"var\")\n {\n Err();\n }\n }\n else if ((strcmp(\"CALL\", $instruction[0]) == 0) || (strcmp(\"LABEL\", $instruction[0]) == 0) || (strcmp(\"JUMP\", $instruction[0]) == 0))\n {\n if ($first_arg != \"label\")\n {\n Err();\n }\n }\n else if ((strcmp(\"PUSHS\", $instruction[0]) == 0) || (strcmp(\"WRITE\", $instruction[0]) == 0) || (strcmp(\"EXIT\", $instruction[0]) == 0) || (strcmp(\"DPRINT\", $instruction[0]) == 0))\n {\n if (($first_arg == \"type\") || ($first_arg == \"label\"))\n {\n Err();\n }\n }\n}", "public function testRegonLocal4()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testGetOperators0()\n{\n\n $actual = $this->grammar->getOperators();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function yy_r74(){ $this->_retvalue = 'OUTER'; }", "public function testRegonLocal5()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function set_op_vars()\n{\n global $opname, $action, $basecost;\n\n $action[1] = \"recon\";\n $opname[1] = \"Recon\";\n $basecost[1] = 1;\n\n $action[2] = \"sneak\";\n $opname[2] = \"Sneak\";\n $basecost[2] = 1;\n\n $action[3] = \"intercept\";\n $opname[3] = \"Intercept\";\n $basecost[3] = 1;\n\n $action[4] = \"bribe\";\n $opname[4] = \"Bribe Accountant\";\n $basecost[4] = 1;\n\n $action[5] = \"truth\";\n $opname[5] = \"Truth's Eye\";\n $basecost[5] = 1;\n\n $action[6] = \"farm\";\n $opname[6] = \"Weather's Light\";\n $basecost[6] = 0;\n\n $action[7] = \"poison\";\n $opname[7] = \"Poison Water\";\n $basecost[7] = 14;\n\n $action[8] = \"money\";\n $opname[8] = \"Templu Amplo\";\n $basecost[8] = 0;\n\n $action[9] = \"arson\";\n $opname[9] = \"Arson\";\n $basecost[9] = 20;\n\n $action[10] = \"trap\";\n $opname[10] = \"Thieves Trap (SELF)\";\n $basecost[10] = 4;\n\n $action[11] = \"boze\";\n $opname[11] = \"Boze\";\n $basecost[11] = 20;\n\n $action[12] = \"monitoring\";\n $opname[12] = \"Monitoring\";\n $basecost[12] = 12;\n\n $action[13] = \"tunneling\";\n $opname[13] = \"Tunneling (WAR ONLY)\";\n $basecost[13] = 10;\n\n $action[14] = \"rebellion\";\n $opname[14] = \"Thieves Rebellion\";\n $basecost[14] = 10;\n\n $action[15] = \"raid\";\n $opname[15] = \"Hwighton Raid\";\n $basecost[15] = 20;\n\n $action[16] = \"research\";\n $opname[16] = \"Napanometry\";\n $basecost[16] = 0;\n \n $action[17] = \"ambush\";\n $opname[17] = \"Ambush\";\n $basecost[17] = 280;\n\n}", "function mod_l_luv($delta_l) {\n\t\t$luv=$this->get_luv();\n\t\t$l=$luv[0];\n\t\tif ($delta_l>0)\n\t\t\t$l=$l+(1-$l)*(($delta_l>1)?1:$delta_l);\n\t\tif ($delta_l<0)\n\t\t\t$l=-$l*(($delta_l<-1)?-1:$delta_l);\n\t\t$this->set_from_luv($l,$luv[1],$hsl[2]);\n\t}", "public function testPingTreeUpdateTargets()\n {\n }", "public function testRegon7()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function parse_threeLSS_fun()\n {\n $this->check_param_num(3);\n\n $this->generate_instruction();\n\n $this->get_token();\n $this->check_label();\n $this->generate_arg(\"1\", \"label\");\n\n $this->get_token();\n $result = $this->check_symb();\n $this->generate_symb($result, \"2\");\n\n $this->get_token();\n $result = $this->check_symb();\n $this->generate_symb($result, \"3\");\n\n $this->xml->endElement();\n }", "function process($process, $method) {\n while ($process->hasNext()) {\n $input = $process->next();\n if ($input->isOperand()) {\n $method->addElement($input->Value);\n } else if ($input->isOperator()) {\n try {\n $operand_a = $method->getElement();\n $operand_b = $method->getElement();\n } catch (EmptyStackException $exp) {\n // TODO Must return the previous last value !\n // OR do we want the continue?\n throw new NotImplementedException(\"Not Implemented Yet\" . $exp->getMessage());\n }\n\n try {\n $result = $input->execute($operand_b, $operand_a);\n $method->addElement($result);\n $method->log($input->Value . \" performed on $operand_b & $operand_a\");\n } catch (NotImplementedException $ignore) {\n $method->log($input->Value . 'Not Implemented');\n }\n }\n $method->printStack();\n }\n\n return $method->getElement();\n}", "public function testRegonLocal3()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function yy_get_expected_tokens($token)\r\n {\r\n $state = $this->yystack[$this->yyidx]->stateno;\r\n $expected = self::$yyExpectedTokens[$state];\r\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\r\n return $expected;\r\n }\r\n $stack = $this->yystack;\r\n $yyidx = $this->yyidx;\r\n do {\r\n $yyact = $this->yy_find_shift_action($token);\r\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\r\n // reduce action\r\n $done = 0;\r\n do {\r\n if ($done++ == 100) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n // too much recursion prevents proper detection\r\n // so give up\r\n return array_unique($expected);\r\n }\r\n $yyruleno = $yyact - self::YYNSTATE;\r\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\r\n $nextstate = $this->yy_find_reduce_action(\r\n $this->yystack[$this->yyidx]->stateno,\r\n self::$yyRuleInfo[$yyruleno]['lhs']);\r\n if (isset(self::$yyExpectedTokens[$nextstate])) {\r\n $expected += self::$yyExpectedTokens[$nextstate];\r\n if (in_array($token,\r\n self::$yyExpectedTokens[$nextstate], true)) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n return array_unique($expected);\r\n }\r\n }\r\n if ($nextstate < self::YYNSTATE) {\r\n // we need to shift a non-terminal\r\n $this->yyidx++;\r\n $x = new TP_yyStackEntry;\r\n $x->stateno = $nextstate;\r\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\r\n $this->yystack[$this->yyidx] = $x;\r\n continue 2;\r\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n // the last token was just ignored, we can't accept\r\n // by ignoring input, this is in essence ignoring a\r\n // syntax error!\r\n return array_unique($expected);\r\n } elseif ($nextstate === self::YY_NO_ACTION) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n // input accepted, but not shifted (I guess)\r\n return $expected;\r\n } else {\r\n $yyact = $nextstate;\r\n }\r\n } while (true);\r\n }\r\n break;\r\n } while (true);\r\n return array_unique($expected);\r\n }", "function main() {\n $test = @$GLOBALS['argv'][1];\n switch($test) {\n case 'test_concurrent_moves': test_concurrent_moves(); break;\n case 'test_concurrent_moves_cycle': test_concurrent_moves_cycle(); break;\n case 'test_apply_ops_random_order': test_apply_ops_random_order(); break;\n case 'test_concurrent_moves_no_conflict': test_concurrent_moves_no_conflict(); break;\n case 'test_add_nodes'; test_add_nodes(); break;\n case 'test_move_node_deep_tree': test_move_node_deep_tree(); break;\n case 'test_walk_deep_tree': test_walk_deep_tree(); break;\n case 'test_truncate_log': test_truncate_log(); break;\n case 'test_move_to_trash': test_move_to_trash(); break;\n default: print_help(); exit;\n }\n\n global $redo_call_cnt;\n global $undo_call_cnt;\n printf(\"\\nundo called %s times\\n\", $undo_call_cnt);\n printf(\"redo called %s times\\n\", $redo_call_cnt);\n}", "function process($op) {\n\tswitch ($op) {\n\t\tcase \"login\" :\n\t\t\tloginFunc($_REQUEST['user'], $_REQUEST['pass']);\n\t\t\tbreak;\n\t\tcase \"sarrera\" :\n\t\t\t$gehi = (isset($_REQUEST['gehi'])) ? $_REQUEST['gehi'] : 'TRUE';\n\t\t\tgehituFunc(\"sarrerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['num'], $gehi);\n\t\t\tbreak;\n\t\tcase \"irteera\" :\n\t\t\t$gehi = (isset($_REQUEST['gehi'])) ? $_REQUEST['gehi'] : 'TRUE';\n\t\t\tgehituFunc(\"irteerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['num'], $gehi);\n\t\t\tbreak;\n\t\tcase \"sarrera_urratu\" :\n\t\t\turratuFunc(\"sarrerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['id']);\n\t\t\tbreak;\n\t\tcase \"irteera_urratu\" :\n\t\t\turratuFunc(\"irteerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['id']);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\tresponseError(ERROR_INVALID_OP, \" \\\"\" . $op . \"\\\"\");\n\t\t\tbreak;\n\t}\n}", "public function execute(\n array &$memory\n ): bool\n {\n if ($this->opcode === self::COMMAND_HALT) {\n return false;\n }\n\n // Make sure that the operant values are present and are numeric\n if ($this->operant1 > count($memory) || !is_numeric($memory[$this->operant1])) {\n throw new InvalidMemoryForCommandException('The memory provided for command does not have first operant or it is of invalid type');\n }\n if ($this->operant2 > count($memory) || !is_numeric($memory[$this->operant2])) {\n throw new InvalidMemoryForCommandException('The memory provided for command does not have second operant or it is of invalid type');\n }\n if ($this->target_position > count($memory)) {\n // We don't have a position to write to\n throw new InvalidMemoryForCommandException('The memory does not a cell for the target position');\n }\n\n // Here we assume everything passed -> proceed\n $result = null;\n switch ($this->opcode) {\n case self::COMMAND_ADD:\n $result = $memory[$this->operant1] + $memory[$this->operant2];\n break;\n case self::COMMAND_MULTIPLY:\n $result = $memory[$this->operant1] * $memory[$this->operant2];\n break;\n default:\n throw new InvalidCommandException('Invalid command number '.$this->opcode);\n break;\n }\n\n // Store the result into the memory\n $memory[$this->target_position] = $result;\n return true;\n }", "public function blpop(...$arguments)\n {\n $result = $this->command('blpop', $arguments);\n\n return empty($result) ? null : $result;\n }" ]
[ "0.50451964", "0.49054345", "0.47783127", "0.47735712", "0.47465333", "0.47401255", "0.4706406", "0.46940428", "0.46666682", "0.45973983", "0.45471936", "0.4443488", "0.44386816", "0.4424829", "0.4407688", "0.44056734", "0.439758", "0.4386718", "0.43717664", "0.43448722", "0.4312954", "0.43114534", "0.43114284", "0.43073618", "0.43032533", "0.43005002", "0.4294946", "0.4286533", "0.42681637", "0.42463714", "0.4242806", "0.423045", "0.42262575", "0.42233494", "0.4210188", "0.42003056", "0.4183281", "0.41756225", "0.41653174", "0.41634017", "0.41544214", "0.41539043", "0.41513994", "0.41354403", "0.4131342", "0.41263205", "0.4121617", "0.41215113", "0.41040194", "0.41008228", "0.40963098", "0.4094765", "0.4090299", "0.4080342", "0.40637675", "0.40587243", "0.40542835", "0.40432823", "0.40428674", "0.4038386", "0.40347347", "0.4025202", "0.40127033", "0.40125424", "0.40018326", "0.4000503", "0.39987344", "0.39870107", "0.3986449", "0.39767852", "0.3975702", "0.39752278", "0.39743072", "0.39626735", "0.39620805", "0.39557135", "0.39532685", "0.39513674", "0.3950792", "0.39505067", "0.3950308", "0.3948276", "0.394807", "0.39452735", "0.3940295", "0.39390576", "0.3931234", "0.392668", "0.39237994", "0.39233986", "0.3919803", "0.39185882", "0.3917643", "0.39174035", "0.39171365", "0.3916848", "0.39085546", "0.39078313", "0.39051697", "0.39044535" ]
0.43608528
19
Tests the internal multiple LPOP mechanism.
public function benchLpopInternal() { $messageList = $this->queue->consume(self::CONSUME_SIZE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function benchLpopPipeline()\n {\n $pipeline = new Pipeline($this->client);\n $cmd = $this->client->getProfile()->createCommand('multi');\n $pipeline->executeCommand($cmd);\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $cmd = $this->client->getProfile()->createCommand('lpop', [$this->queueName]);\n $pipeline->executeCommand($cmd);\n }\n $cmd = $this->client->getProfile()->createCommand('exec');\n $pipeline->executeCommand($cmd);\n $result = $pipeline->execute();\n $messageList = array_map(\n '\\Prototype\\Redis\\RedisEnvelope::jsonDeserialize',\n end($result)\n );\n }", "public function testGetLabelAndLanguageList() {\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList(2, 1, 1);\n $this->assertTrue(true);\n }", "public function testEvaluateTooManyOperators()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + * /\");\n $this->assertEquals(9, $retval);\n }", "public function testGetLabelAndLangDataSet() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(2, 1);\n $this->assertTrue(true);\n }", "public function testGetLabelAndLangDataSetDif() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(1, 1);\n $this->assertTrue(true);\n }", "public function getLPFailed();", "public function testlOrSingleImpl()\n {\n $this->q->select( '*' )->from( 'query_test' )\n ->where( $this->e->lOr( $this->e->eq( 1, 1 ) ) );\n $stmt = $this->db->query( $this->q->getQuery() );\n $rows = 0;\n foreach ( $stmt as $row )\n {\n $rows++;\n }\n $this->assertEquals( 4, $rows );\n }", "public function parallelSplitTests()\n {\n\n }", "public function testAllPrecedencesHasNoGaps()\n {\n $levels = array();\n $min = false;\n $max = false;\n foreach ( $this->operators as $operator )\n {\n $levels[$operator->precedence] = true;\n if ( $max === false ||\n $operator->precedence > $max )\n $max = $operator->precedence;\n if ( $min === false ||\n $operator->precedence < $min )\n $min = $operator->precedence;\n }\n ksort( $levels );\n self::assertThat( count( $levels ), self::greaterThan( 1 ), \"Level list did not even fill two items\" );\n for ( $i = $min; $i <= $max; ++$i )\n {\n // We skip level 2 which is the ?: operator which is not supported\n if ( $i == 2 )\n {\n continue;\n }\n $this->assertArrayHasKey( $i, $levels );\n }\n }", "public function checkPiplTest(){\r\n // Params\r\n $checkClass = new Pipl();\r\n // Class Call\r\n $res = $checkClass->test();\r\n // Return result\r\n $this->returnJson($res['code'], $res['message']);\r\n }", "public static function helperForBlockingPops($op) {\n // in a separate process to properly test BLPOP/BRPOP\n $redisUri = sprintf('redis://%s:%d/?database=%d', RC::SERVER_HOST, RC::SERVER_PORT, RC::DEFAULT_DATABASE);\n $handle = popen('php', 'w');\n fwrite($handle, \"<?php\n require '../lib/Predis.php';\n \\$redis = new Predis\\Client('$redisUri');\n \\$redis->rpush('{$op}1', 'a');\n \\$redis->rpush('{$op}2', 'b');\n \\$redis->rpush('{$op}3', 'c');\n \\$redis->rpush('{$op}1', 'd');\n ?>\");\n pclose($handle);\n }", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function getLPNotAttempted();", "function testBackendInvokeMultiple() {\n $options = array(\n 'backend' => NULL,\n 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile.\n );\n $php = \"\\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0), array('invoke-multiple' => '3')); return \\$values;\";\n $this->drush('php-eval', array($php), $options);\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has a 'concurrent'-format output result\n $this->assertEquals('concurrent', implode(',', array_keys($parsed['object'])));\n // assert that the concurrent output has indexes 0, 1 and 2 (in any order)\n $concurrent_indexes = array_keys($parsed['object']['concurrent']);\n sort($concurrent_indexes);\n $this->assertEquals('0,1,2', implode(',', $concurrent_indexes));\n foreach ($parsed['object']['concurrent'] as $index => $values) {\n // assert that each result contains 'x' => 'y' and nothing else\n $this->assertEquals(\"array (\n 'x' => 'y',\n)\", var_export($values['object'], TRUE));\n }\n }", "public function test_scenario1() {\n $data = array(array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 0, \"prediction\" => \"a\", \"confidence\" => 0.450471270879),\n\t array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 1, \"prediction\" => \"a\", \"confidence\" => 0.552021302649),\n\t\t array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 2, \"prediction\" => \"a\", \"confidence\" => 0.403632421178),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 0, \"prediction\" => 1.55555556667, \"confidence\" => 0.400079152063),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 1, \"prediction\" => 1.59376845074, \"confidence\" => 0.248366474212),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 2, \"prediction\" => 1.55555556667 , \"confidence\" => 0.400079152063));\n\n foreach($data as $item) {\n\t print \"\\nSuccessfully computing predictions combinations\\n\";\n\t $predictions = json_decode(file_get_contents($item[\"predictions\"]));\n\n print \"Given I create a MultiVote for the set of predictions in file \" . $item[\"predictions\"] . \"\\n\";\n $multivote = new MultiVote($predictions);\n\t print \"When I compute the prediction with confidence using method \" . $item[\"method\"] . \"\\n\";\n\t $combined_results = $multivote->combine($item[\"method\"], true);\n\t print \"And I compute the prediction without confidence using method \" . $item[\"method\"] . \"\\n\";\n $combined_results_no_confidence = $multivote->combine($item[\"method\"]);\n\n\n if ($multivote->is_regression()) {\n\t print \"Then the combined prediction is \" . $item[\"prediction\"] . \"\\n\";\n $this->assertEquals(round($combined_results[0], 6), round($item[\"prediction\"],6));\n\t print \"And the combined prediction without confidence is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals(round($combined_results_no_confidence, 6), round($item[\"prediction\"] ,6));\n\t } else {\n\t print \"Then the combined prediction is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals($combined_results[0], $item[\"prediction\"]);\n\t print \"And the combined prediction without confidence is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals($combined_results_no_confidence, $item[\"prediction\"]);\n\t }\n\n print \"And the confidence for the combined prediction is \" . $item[\"confidence\"] . \"\\n\";\n\t $this->assertEquals(round($combined_results[1], 6), round($item[\"confidence\"],6));\n }\n }", "function specialop() {\n\n\n\t}", "public function testGetLabelAndLanguageListEx() {\n try {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->throwException(New DaoException()));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList('s_lang_id', 't_lang_id', 'group_id');\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "public function testPrecedenceIsInValidRange()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::greaterThan( 0 ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be 1 or higher.\" );\n }\n }", "public function provideTupleTests() {\n $result = [\n '>' => [['id' => [Db::OP_GT => 3]], [4, 5]],\n '>=' => [['id' => [Db::OP_GTE => 3]], [3, 4, 5]],\n '<' => [['id' => [Db::OP_LT => 3]], [1, 2]],\n '<=' => [['id' => [Db::OP_LTE => 3]], [1, 2, 3]],\n '=' => [['id' => [Db::OP_EQ => 2]], [2]],\n '<>' => [['id' => [Db::OP_NEQ => 3]], [1, 2, 4, 5]],\n 'is null' => [['id' => null], [null]],\n 'is not null' => [['id' => [Db::OP_NEQ => null]], [1, 2, 3, 4, 5]],\n 'all' => [[], [null, 1, 2, 3, 4, 5]],\n 'in' => [['id' => [Db::OP_IN => [3, 4, 5]]], [3, 4, 5]],\n 'in (short)' => [['id' => [3, 4, 5]], [3, 4, 5]],\n '= in' => [['id' => [Db::OP_EQ => [3, 4, 5]]], [3, 4, 5]],\n '<> in' => [['id' => [Db::OP_NEQ => [3, 4, 5]]], [1, 2]],\n 'and' =>[['id' => [\n Db::OP_AND => [\n Db::OP_GT => 3,\n Db::OP_LT => 5\n ]\n ]], [4]],\n 'or' =>[['id' => [\n Db::OP_OR => [\n Db::OP_LT => 3,\n Db::OP_EQ => 5\n ]\n ]], [1, 2, 5]]\n ];\n\n return $result;\n }", "public function CheckLLMeasures_Present_Default_LL_LbAndLL_CoreAndElective_OnChecklistPreview(AcceptanceTester $I) {\n $I->amOnPage(Page\\ChecklistPreview::URL($this->id_checklist, $this->id_audSubgroup1_Energy));\n $I->wait(3);\n $I->waitForElement(\\Page\\ChecklistPreview::$ExtensionSelect);\n $I->selectOption(\\Page\\ChecklistPreview::$ExtensionSelect, \"Large Landscape\");\n $I->wait(3);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 2 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 2 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure1Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure2Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure4Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure5Desc));\n $I->canSee(\"$this->pointsMeas1 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure1Desc));\n $I->canSee(\"$this->pointsMeas2 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure2Desc));\n $I->canSee(\"$this->pointsMeas4 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure4Desc));\n $I->canSee(\"$this->pointsMeas5 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure5Desc));\n $I->wait(1);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$LeftMenu_SolidWasteGroupButton);\n }", "public function testPingTreeUpdateTargets()\n {\n }", "public function testPingTreeGetTargets()\n {\n }", "public function operators();", "public function testGetPointsWhenAddedMultiple()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(12);\n $res = $player -> getPoints();\n $this->assertSame(12, $res);\n\n $player -> addPoints(5);\n $res = $player -> getPoints();\n $this->assertSame(12 + 5, $res);\n\n $player -> addPoints(23);\n $res = $player -> getPoints();\n $this->assertSame(12 + 5 + 23, $res);\n }", "public function testParallelPatchPatchOther(): void {\n $loc1 = $this->createMetadataResource();\n $loc2 = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $req1 = new Request('patch', $loc1 . '/metadata', $headers, \"<$loc1> <$prop> \\\"value1\\\" .\");\n $req2 = new Request('patch', $loc2 . '/metadata', $headers, \"<$loc2> <$prop> \\\"value2\\\" .\");\n list($resp1, $resp2) = $this->runConcurrently([$req1, $req2], 0);\n $h1 = $resp1->getHeaders();\n $h2 = $resp2->getHeaders();\n $this->assertEquals(200, $resp1->getStatusCode());\n $this->assertEquals(200, $resp2->getStatusCode());\n $this->assertLessThan(min($h1['Time'][0], $h2['Time'][0]) / 2, abs($h1['Start-Time'][0] - $h2['Start-Time'][0])); // make sure they were executed in parallel\n $r1 = $this->extractResource($resp1->getBody(), $loc1);\n $r2 = $this->extractResource($resp2->getBody(), $loc2);\n $this->assertEquals('value1', $r1->getLiteral($prop));\n $this->assertEquals('value2', $r2->getLiteral($prop));\n }", "public function laptops()\n {\n return static::randomElement(static::$laptops);\n }", "public function testPs()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(), 'ok');\n }", "public function testGetPayslip()\n {\n }", "public function CheckLBAndLLMeasures_Present_AllCoreAndElective_OnChecklistPreview(AcceptanceTester $I) {\n $I->amOnPage(Page\\ChecklistPreview::URL($this->id_checklist, $this->id_audSubgroup1_Energy));\n $I->wait(3);\n $I->waitForElement(\\Page\\ChecklistPreview::$ExtensionSelect);\n $I->selectOption(\\Page\\ChecklistPreview::$ExtensionSelect, \"Lg Building + Lg Landscape\");\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 2 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure1Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure2Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure4Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure5Desc));\n $I->canSee(\"$this->pointsMeas1 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure1Desc));\n $I->canSee(\"$this->pointsMeas2 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure2Desc));\n $I->canSee(\"$this->pointsMeas4 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure4Desc));\n $I->canSee(\"$this->pointsMeas5 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure5Desc));\n $I->wait(1);\n $I->click(\\Page\\ChecklistPreview::$LeftMenu_SolidWasteGroupButton);\n $I->wait(2);\n $I->click(\\Page\\ChecklistPreview::LeftMenu_Subgroup_ByName($this->audSubgroup1_SolidWaste));\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 1 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure7Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure8Desc));\n $I->canSee(\"$this->pointsMeas7 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure7Desc));\n $I->canSee(\"$this->pointsMeas8 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure8Desc));\n }", "public function testPingTreeAddTargets()\n {\n }", "public function checkOperationality()\n {\n }", "public function testMultCommutative()\n {\n $this\n ->given(\n $a = $this->fromNative($this->randomNativeNumber())->toInteger(),\n $b = $this->fromNative($this->randomNativeNumber())->toReal(),\n $c = $this->fromNative($this->randomNativeNumber())->toDecimal()\n )\n ->then\n ->boolean(\n $a->mult($b)->equals($b->mult($a))\n )->isTrue()\n ->boolean(\n $a->mult($c)->equals($c->mult($a))\n )->isTrue()\n ->boolean(\n $b->mult($c)->equals($c->mult($b))\n )->isTrue()\n ;\n }", "public function testRPN()\n {\n $stack = array();\n\n $fsm = new FSM('INIT', $stack);\n $fsm->setDefaultTransition('INIT', 'Error');\n\n $fsm->addTransitionAny('INIT', 'INIT');\n $fsm->addTransition('=', 'INIT', 'INIT', array($this, 'doEqual'));\n $fsm->addTransitions(range(0, 9), 'INIT', 'BUILD_NUMBER', array($this, 'doBeginBuildNumber'));\n $fsm->addTransitions(range(0, 9), 'BUILD_NUMBER', 'BUILD_NUMBER', array($this, 'doBuildNumber'));\n $fsm->addTransition(' ', 'BUILD_NUMBER', 'INIT', array($this, 'doEndBuildNumber'));\n $fsm->addTransitions(array('+', '-', '*', '/'), 'INIT', 'INIT', array($this, 'doOperator'));\n\n $input = '1 9 + 29 7 * * =';\n\n $fsm->processString($input);\n }", "function test_apply_ops_random_order() {\n\n $r1 = new replica();\n $r2 = new replica();\n\n // Generate initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), null, \"trash\", $trash_id = new_id()),\n new op_move($r1->tick(), $root_id, \"home\", $home_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dilbert\", $dilbert_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dogbert\", $dogbert_id = $dilbert_id),\n new op_move($r1->tick(), $dogbert_id, \"cycle_not_allowed\", $home_id),\n ];\n\n $r1->apply_ops($ops);\n $r1->state->check_log_is_descending();\n\n $start = microtime(true);\n $num_ops = count($ops);\n\n printf(\"Applying move operations from replica1 to replica2 in random orders...\\n\");\n $all_equal = true;\n\n for($i = 0; $i < 100000; $i ++) {\n $ops2 = $ops;\n shuffle($ops2);\n\n $r2 = new replica();\n $r2->apply_ops($ops2);\n\n if($i % 10000 == 0) {\n printf(\"$i... \");\n }\n $r2->state->check_log_is_descending();\n\n if (!$r1->state->is_equal($r2->state)) {\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops1.json\", json_encode($ops, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops2.json\", json_encode($ops2, JSON_PRETTY_PRINT));\n printf( \"\\nreplica_1 %s replica_2\\n\", $r1->state->is_equal($r2->state) ? \"is equal to\" : \"is not equal to\");\n $all_equal = false;\n break;\n }\n }\n $end = microtime(true);\n $elapsed = $end - $start;\n \n if($all_equal) {\n echo \"\\n\\nStates were consistent and log timestamps descending after each apply. :-)\\n\";\n } else {\n echo \"\\n\\nFound an inconsistent state. Check /tmp/ops{1,2}.json and /tmp/repl{1,2}.json.\\n\";\n }\n\n $tot_ops = $num_ops*$i;\n printf(\"\\nops_per_apply: %s, applies: %s, total_ops: %s, duration: %.8f, secs_per_op: %.8f\\n\", $num_ops, $i, $tot_ops, $elapsed, $elapsed / $tot_ops);\n}", "public function testEvaluateTooManyOperands()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"4 3 2 1 + *\");\n $this->assertEquals(false, $retval);\n }", "public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }", "function convert_pnml_to_lola($pnml_filename) {\n global $output;\n \n $return_code = null;\n $process_output = [];\n \n exec($petri . \" -ipnml -olola \".$pnml_filename, $process_output, $return_code);\n if ($return_code != 0) {\n foreach ($process_output as $line) {\n $output[\"petri_output\"][] = htmlspecialchars($line);\n }\n terminate(\"petri exited with status \" . $return_code . \" -- probably the input is malformed.\");\n }\n \n $lola_filename = $pnml_filename . \".lola\";\n return $lola_filename;\n }", "function callback_multicheck(array $args)\n {\n }", "public function testMultDistributive()\n {\n $this\n ->given(\n $a = $this->fromNative($this->randomNativeNumber())->toInteger(),\n $b = $this->fromNative($this->randomNativeNumber())->toReal(),\n $c = $this->fromNative($this->randomNativeNumber())->toDecimal()\n )\n ->then\n ->boolean(\n $a->mult($b->add($c))->equals($a->mult($b)->add($a->mult($c)))\n )->isTrue()\n ->boolean(\n $b->mult($a->add($c))->equals($b->mult($a)->add($b->mult($c)))\n )->isTrue()\n ->boolean(\n $c->mult($a->add($b))->equals($c->mult($a)->add($c->mult($b)))\n )->isTrue()\n ->boolean(\n $a->mult($b->sub($c))->equals($a->mult($b)->sub($a->mult($c)))\n )->isTrue()\n ->boolean(\n $b->mult($a->sub($c))->equals($b->mult($a)->sub($b->mult($c)))\n )->isTrue()\n ->boolean(\n $c->mult($a->sub($b))->equals($c->mult($a)->sub($c->mult($b)))\n )->isTrue()\n ;\n }", "function testDropOperator()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Turn to \"Operators\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/operators.php\", array(\r\n\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'schema' => 'public',\r\n\t\t\t\t\t\t'subject' => 'schema'))\r\n\t\t\t\t\t);\r\n \r\n // Drop the first operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped correctly.\r\n $this->assertTrue($this->assertWantedText($lang['stroperatordropped'])); \r\n \r\n // Drop the second operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped correctly.\r\n $this->assertTrue($this->assertWantedText($lang['stroperatordropped']));\r\n \r\n // Drop the third operator. \r\n $this->assertTrue($this->clickLink($lang['strdrop']));\r\n $this->assertTrue($this->setField('cascade', TRUE));\r\n $this->assertTrue($this->clickSubmit($lang['strdrop']));\r\n // Verify whether the operator is dropped completely.\r\n $this->assertTrue($this->assertWantedText($lang['strnooperators']));\r\n \r\n return TRUE;\r\n }", "public function testMultipleResultQuery() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID in (\\'uuid1tRMR1\\',\\'uuid1tRMR2\\',\\'uuid1tRMR3\\')';\r\n $pos = $this->getPersistenceAdapter()->executeMultipleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n $this->assertEquals(count($records), count($pos), 'Wrong number of database records found.');\r\n for($i = 0; $i < count($pos); $i++) {\r\n $this->assertEquals($records[$i]['UUID'], $pos[$i]->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($records[$i]['bool'], $pos[$i]->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($records[$i]['int'], $pos[$i]->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($records[$i]['string'], $pos[$i]->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }\r\n }", "public function testCheck()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->check('128.232.234.256');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 2. Check denied list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.44');\n $t = $ipComponent->check('127.0.55.44');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 3. Check allowed list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setAllowedItem('39.9.197.241');\n $t = $ipComponent->check('39.9.197.241');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 4. Check IP is if in denied IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 5. Check IP is if in allowed IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $ipComponent->setAllowedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 6. Test denyAll\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->denyAll();\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n }", "public function testPoolQ(): bool\n {\n $teamsQty = $this->scheduler->teamsQty;\n\n # G = (T*T) - T\n $exp = pow($teamsQty, 2) - $teamsQty;\n $act = count($this->scheduler->getGamesPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_GAMES_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n # M = T!\n $exp = 1;\n for ($f = 1; $f <= $teamsQty; $f++) {\n $exp = $exp * $f;\n }\n $act = count($this->scheduler->getMatchdaysPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_MATCHDAYS_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n # L = ?\n $exp = 0;\n switch ($teamsQty) {\n case 2:\n $exp = 2;\n break;\n case 4:\n $exp = 3072;\n break;\n case 6:\n// $exp = ;\n break;\n case 8:\n// $exp = ;\n break;\n }\n $act = count($this->scheduler->getLapsPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_LAPS_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n return true;\n }", "public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }", "public function testLanguageOptionForMultipleLanguages()\n {\n $expected = 'tesseract image.png stdout -l eng+deu+jpn';\n\n $actual = (new WrapTesseractOCR('image.png'))\n ->lang('eng', 'deu', 'jpn')\n ->buildCommand();\n\n $this->assertEquals($expected, $actual);\n }", "public function test_add_several_actions_random_priorities() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n $total = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $total += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n $this->assertSame( $times, $total );\n }", "public function testGetLabelAndLangDataSetEx() {\n\n try {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->throwException(New DaoException()));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet('s_lang_id', 't_lang_id');\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "public function testMergeParams()\n {\n $instance = $this->getMockForTrait(DuplicationComponent::class);\n $reflex = new \\ReflectionClass($instance);\n\n $mergeParam = $reflex->getMethod('mergeParam');\n $mergeParam->setAccessible(true);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n false\n );\n $this->getTestCase()->assertEquals(['hello'=>'torvald', 'hella' => 'warld'], $result);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n true\n );\n $this->getTestCase()->assertEquals(['hello' => 'torvald'], $result);\n }", "function paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg)\n{\n if ((strcmp(\"ADD\", $instruction[0]) == 0) || (strcmp(\"SUB\", $instruction[0]) == 0) || (strcmp(\"MUL\", $instruction[0]) == 0) || (strcmp(\"IDIV\", $instruction[0]) == 0) )\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"LT\", $instruction[0]) == 0) || (strcmp(\"GT\", $instruction[0]) == 0) || (strcmp(\"EQ\", $instruction[0]) == 0) || (strcmp(\"AND\", $instruction[0]) == 0) || (strcmp(\"OR\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"STRI2INT\", $instruction[0]) == 0) || (strcmp(\"CONCAT\", $instruction[0]) == 0) || (strcmp(\"GETCHAR\", $instruction[0]) == 0) || (strcmp(\"SETCHAR\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n else if ((strcmp(\"JUMPIFEQ\", $instruction[0]) == 0) || (strcmp(\"JUMPIFNEQ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"label\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") || ($th_arg == \"type\") || ($th_arg == \"label\"))\n {\n Err();\n }\n }\n}", "public function testPingTreePatchItem()\n {\n }", "public function test_all() {\n $obj = new My_task;\n \n echo \"Start test_reverse() <br>\";\n $obj->test_reverse();\n echo \"<br><br>\";\n \n echo \"Start test_is_palindrome() <br>\";\n $obj->test_is_palindrome();\n echo \"<br><br>\";\n \n echo \"Start test_encryption() <br>\";\n $obj->test_encryption(); \n echo \"<br><br>\";\n }", "function test_preferredLanguageHooks($availableLanguagesArr, $parentObject) {\n\t\tdebug($availableLanguagesArr);\n\t\tdebug($parentObject);\n\t\tdie();\n\t}", "public function testPingTreeGetReferences()\n {\n }", "public function testParallelLock(): void\n {\n $identifier1 = \\uniqid('lock_name_1_', true);\n\n $this->assertTrue($this->cacheInstance1->lock($identifier1));\n\n $this->assertFalse($this->cacheInstance1->lock($identifier1, 0));\n $this->assertFalse($this->cacheInstance2->lock($identifier1, 0));\n }", "public function testGetItemsSecondCallGetData()\n {\n $pool = $this->createPool();\n\n $dataList1 = array(\n 'Key_'.$this->rand() => 'Value_'.$this->rand(),\n 'Key_'.$this->rand() => 'Value_'.$this->rand()\n );\n\n $dataList2 = array(\n 'Key_'.$this->rand() => 'Value_'.$this->rand(),\n 'Key_'.$this->rand() => 'Value_'.$this->rand()\n );\n\n $this->usedKeyList =\n array_merge(\n $this->usedKeyList,\n array_keys($dataList1),\n array_keys($dataList2)\n );\n\n foreach ($dataList1 as $key => $value) {\n $this->internalSet($key, $value);\n }\n foreach ($dataList2 as $key => $value) {\n $this->internalSet($key, $value);\n }\n\n $keyList1 = array_keys($dataList1);\n $keyList2 = array_keys($dataList2);\n\n $result1 = $pool->getItems(array_keys($dataList1));\n $this->assertSame(array_shift($keyList1), $result1->key());\n\n $result2 = $pool->getItems(array_keys($dataList2));\n $this->assertSame(array_shift($keyList2), $result2->key());\n\n $result1->next();\n $this->assertTrue(array_shift($keyList1) != $result1->key());\n\n $result2->next();\n $this->assertNull($result2->key());\n }", "function o_comparePipe(...$comparisons) {\n\t\t\treturn Obj::singleton()->comparePipe(...$comparisons);\n\t\t}", "static function logicalXor()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalXor', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function test_3() {\n\t$res = gather(function() {\n\t\ttake(1);\n\t\ttake(2);\n\t\tif (!gathered()) {\n\t\t\ttake(3);\n\t\t}\n\t});\n\treturn is_deeply($res, array(1, 2), 'gathered detects some gather');\n}", "public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }", "function mnet_ilp_targets_RPC_OK() {\n return true;\n}", "public function testMissingParametersUnpauseChecks() {\n $this->pingdom->unpauseChecks(null);\n }", "public function test_scenario1() {\n $data = array(array('filename' => 'data/iris.csv',\n 'params' => array(\"tags\" => array(\"mytag\"), 'missing_splits' => false),\n\t\t\t 'data_input' => array(\"petal width\"=> 0.5),\n\t\t\t 'tag' => 'mytag',\n\t\t\t 'predictions' => \"Iris-setosa\"));\n\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a prediction from a multi model\\n\";\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_1 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_1->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_1->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_2 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_2->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_2->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_3 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_3->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_3->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n $list_of_models = array();\n\t array_push($list_of_models, self::$api->get_model($model_1->resource));\n array_push($list_of_models, self::$api->get_model($model_2->resource));\n\t array_push($list_of_models, self::$api->get_model($model_3->resource));\n\n print \"And I create a local multi model\\n\";\n $local_multimodel = new MultiModel($list_of_models);\n\n print \"When I create a prediction for \" . json_encode($item[\"data_input\"]) . \"\\n\";\n $prediction = $local_multimodel->predict($item[\"data_input\"]);\n\n print \"Then the prediction is \". $item[\"predictions\"] . \" \\n\";\n $this->assertEquals($prediction, $item[\"predictions\"]);\n\n }\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "public function testSingleResultQueryWithMultipleResultStatement() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n $this->setExpectedException('Exception', 'Single result statement returned more than one result.');\r\n $this->getPersistenceAdapter()->executeSingleResultQuery('select * from POTEST');\r\n }", "public function test_do_action_several_times_and_count() {\n $hook = rand_str();\n $this->assertSame( 0, yourls_did_action( $hook ) );\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_do_action( $hook );\n }\n\n $this->assertSame( $times, yourls_did_action( $hook ) );\n\t}", "public function benchLpopConsecutive()\n {\n $messageList = [];\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $messageList[] = RedisEnvelope::jsonDeserialize($this->client->lpop($this->queueName));\n }\n }", "public function testParallelPatchPatchSame(): void {\n $location = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $req1 = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value1\\\" .\");\n $req2 = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value2\\\" .\");\n list($resp1, $resp2) = $this->runConcurrently([$req1, $req2], 50000);\n $codes = [$resp1->getStatusCode(), $resp2->getStatusCode()];\n $this->assertContains(200, $codes);\n $this->assertContains(409, $codes);\n }", "function testNumberpoolList()\n {\n $uuid = \"8711d367-469e-497d-9b26-ff79390bcfe8\";\n $request = new PlivoRequest(\n 'GET',\n 'Account/MAXXXXXXXXXXXXXXXXXX/Powerpack/' . $uuid . '/',\n [\n 'name' => \"powerpackname\",\n ]);\n $body = file_get_contents(__DIR__ . '/../Mocks/powerpackResponse.json');\n\n $this->mock(new PlivoResponse($request,200, $body));\n\n $powerpack = $this->client->powerpacks->get($uuid);\n $request = new PlivoRequest(\n 'GET',\n 'Account/MAXXXXXXXXXXXXXXXXXX/Numberpool/ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f/Number/',\n []);\n $body = file_get_contents(__DIR__ . '/../Mocks/numberpoolListResponse.json');\n\n $this->mock(new PlivoResponse($request,200, $body));\n $actual = $powerpack->list_numbers();\n self::assertNotNull($actual);\n }", "public function testPoly($class,$result)\r\n {\r\n echo \"\\n---Polymorphism Test---\\n\";\r\n $obj=new $class;\r\n $b[]=new concreteButton;\r\n $b= array();\r\n array_push($b, $obj);\r\n $this->assertEquals($b[0]->pressButton(),$result);\r\n }", "public function testGetAllProducts()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(2, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n $this->assertNull($product->parent_product_srl);\n\n\t\t\tif($product->isConfigurable())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\t\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t\t{\n\t\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($product->isSimple())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\t}", "public function test_scenario2() {\n $data = array(array('filename' => 'data/iris.csv',\n 'params' => array(\"tags\" => array(\"mytag\"), 'missing_splits' => false),\n 'data_input' => array(array(\"petal width\"=> 0.5), array(\"petal length\"=>6, \"petal width\"=>2)),\n 'tag' => 'mytag',\n 'predictions' => array(\"Iris-setosa\", \"Iris-virginica\")));\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a local batch prediction from a multi model\\n\";\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n $list_of_models = array();\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_1 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_1->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_1->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_1->resource));\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_2 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_2->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_2->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_2->resource));\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_3 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_3->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_3->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_3->resource));\n\n print \"And I create a local multi model\\n\";\n $local_multimodel = new MultiModel($list_of_models);\n\n print \"When I create a batch multimodel prediction for \" . json_encode($item[\"data_input\"]) . \" \\n\";\n $predictions = $local_multimodel->batch_predict($item[\"data_input\"], null, true, false, \\BigML\\Tree::LAST_PREDICTION, null, false, false);\n $i = 0;\n\n print \"Then the predictions are \" . json_encode($item[\"predictions\"]) . \"\\n\";\n\t foreach ($predictions as $multivote) {\n\t foreach ($multivote->predictions as $prediction) {\n\t $this->assertEquals($prediction[\"prediction\"], $item[\"predictions\"][$i]);\n\t }\n\t $i+=1;\n\t }\n $this->assertEquals($i, count($predictions));\n }\n }", "public function __invoke(...$operand)\n\t{\n\t\t// NOP\n\t}", "public function testReadingLapsOfParticipants()\n {\n // Get participants\n $participants = $this->getWorkingReader()->getSession()\n ->getParticipants();\n\n // Get the laps of first participants\n $laps = $participants[0]->getLaps();\n\n // Validate we have 7 laps\n $this->assertSame(5, count($laps));\n\n // Get driver of first participant (only one cause there are no swaps)\n $driver = $participants[0]->getDriver();\n\n // Get first lap only\n $lap = $laps[0];\n\n // Validate laps\n $this->assertSame(1, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(173.883, $lap->getTime());\n $this->assertSame(0, $lap->getElapsedSeconds());\n $this->assertSame($participants[0], $lap->getParticipant());\n $this->assertSame($driver, $lap->getDriver());\n\n // Get sector times\n $sectors = $lap->getSectorTimes();\n\n // Validate sectors\n $this->assertSame(69.147, $sectors[0]);\n $this->assertSame(64.934, $sectors[1]);\n $this->assertSame(39.802, $sectors[2]);\n\n // Second lap\n $lap = $laps[1];\n $this->assertSame(2, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(142.660, $lap->getTime());\n $this->assertSame(173.883, $lap->getElapsedSeconds());\n\n // Validate extra positions\n $laps = $participants[3]->getLaps();\n $this->assertSame(6, $laps[0]->getPosition());\n $this->assertSame(6, $laps[1]->getPosition());\n }", "public function getLPCompleted();", "public function testMultipleResultQueryWithoutPersistentObject() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'BOOL' => 0, 'INT' => 10, 'STRING' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'BOOL' => 1, 'INT' => 20, 'STRING' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'BOOL' => 0, 'INT' => 30, 'STRING' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['BOOL'] ? 1:0).','.$record['INT'].', \\''.$record['STRING'].'\\')');\r\n }\r\n // Read data out\r\n $query = 'select * from POTEST where UUID in (\\'uuid1tRMR1\\',\\'uuid1tRMR2\\',\\'uuid1tRMR3\\')';\r\n $pos = $this->getPersistenceAdapter()->executeMultipleResultQuery($query);\r\n $this->assertEquals(count($records), count($pos), 'Wrong number of database records found.');\r\n for($i = 0; $i < count($pos); $i++) {\r\n $this->assertEquals($records[$i]['UUID'], $pos[$i]->UUID, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($records[$i]['BOOL'], $pos[$i]->BOOLEAN_VALUE, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($records[$i]['INT'], $pos[$i]->INT_VALUE, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($records[$i]['STRING'], $pos[$i]->STRING_VALUE, 'String value from persistent object differs from the string value of the database.');\r\n }\r\n }", "public function testCandidates() {\n $language_list = $this->languageManager->getLanguages();\n $expected = array_keys($language_list + [LanguageInterface::LANGCODE_NOT_SPECIFIED => NULL]);\n\n // Check that language fallback candidates by default are all the available\n // languages sorted by weight.\n $candidates = $this->languageManager->getFallbackCandidates();\n $this->assertEquals($expected, array_values($candidates), 'Language fallback candidates are properly returned.');\n\n // Check that candidates are alterable.\n $this->state->set('language_test.fallback_alter.candidates', TRUE);\n $expected = array_slice($expected, 0, count($expected) - 1);\n $candidates = $this->languageManager->getFallbackCandidates();\n $this->assertEquals($expected, array_values($candidates), 'Language fallback candidates are alterable.');\n\n // Check that candidates are alterable for specific operations.\n $this->state->set('language_test.fallback_alter.candidates', FALSE);\n $this->state->set('language_test.fallback_operation_alter.candidates', TRUE);\n $expected[] = LanguageInterface::LANGCODE_NOT_SPECIFIED;\n $expected[] = LanguageInterface::LANGCODE_NOT_APPLICABLE;\n $candidates = $this->languageManager->getFallbackCandidates(['operation' => 'test']);\n $this->assertEquals($expected, array_values($candidates), 'Language fallback candidates are alterable for specific operations.');\n\n // Check that when the site is monolingual no language fallback is applied.\n /** @var \\Drupal\\Core\\Config\\Entity\\ConfigEntityStorageInterface $configurable_language_storage */\n $configurable_language_storage = $this->container->get('entity_type.manager')->getStorage('configurable_language');\n foreach ($language_list as $langcode => $language) {\n if (!$language->isDefault()) {\n $configurable_language_storage->load($langcode)->delete();\n }\n }\n $candidates = $this->languageManager->getFallbackCandidates();\n $this->assertEquals([LanguageInterface::LANGCODE_DEFAULT], array_values($candidates), 'Language fallback is not applied when the Language module is not enabled.');\n }", "public function testItemsProcFunc()\n {\n }", "public function testNotOperational1()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['functionsNotExisting'] = ['imagewebp'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkOperationality();\r\n }", "public function testIfMultiplicationsIsCorrect()\n {\n $params = [12,4];\n $response = $this->multiplicationObject->calculate($params);\n $this->assertEquals(48, $response);\n }", "public function testPingTreeGetItem()\n {\n }", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "public function testPingTreeGet()\n {\n }", "function testValidRepeatedFieldToCallFunctions() {\n\t\t// arrange\n\t\tglobal $post;\n\t\t$factory = $this->getMockBuilder('TestRepeatedFields')\n\t\t\t\t\t\t->setMethods( array( 'validate_repeated_field', ) )\n\t\t\t\t\t\t->getMock();\n\t\t$factory->expects($this->once())\n\t\t\t\t->method('validate_repeated_field')\n\t\t\t\t->will($this->returnValue(true));\n\t\t$View = $this->getMockBuilder('\\CFPB\\Utils\\MetaBox\\View')\n\t\t\t\t\t\t->setMethods( array( 'process_repeated_field_params', ) )\n\t\t\t\t\t\t->getMock();\n\t\t$View->expects($this->once())\n\t\t\t\t->method('process_repeated_field_params')\n\t\t\t\t->will($this->returnValue(true));\n\t\t$factory->set_view($View);\n\t\t$validate = array();\n\n\t\t// act\n\t\t$factory->validate( $post->ID, $factory->fields['fields'], $validate );\n\n\t\t// assert\n\t\t// Test will fail if validate_fieldset isn't executed once and only once\n\t}", "function test(){\n\n\t\tglobal $LR;\n\t\tglobal $HLIn;\n\t\tglobal $HLOut;\n\t\tglobal $numHL;\n\n\t\tglobal $mseOut;\n\t\tglobal $mseIn;\n\t\tglobal $mse;\n\t\tglobal $dy1;\n\t\tglobal $dy2;\n\t\tglobal $dz;\n\n\t\tglobal $newDataUan;\n\t\tglobal $newDataTest;\n\n\t\tglobal $dbias2;\n\n\t\tfor ($x = 0; $x < 2; $x++){\n\n\t\t\tfor ($y = 0; $y < 3 ; $y++) { \n\t\t\t\t\n\t\t\t\t$HLIn[$x][$y] = $HLIn[$x][$y] + $dz[$x][$y];\n\n\t\t\t}\n\n\t\t\t$HLOut[$x][0] = $HLOut[$x][0] + $dy1[$x];\n\t\t\t$HLOut[$x][1] = $HLOut[$x][1] + $dy2[$x];\n\t\t\t$HLOut[$x][2] = $HLOut[$x][2] + $dbias2[$x];\n\n\t\t\t$HLIn[$x][3] = $HLIn[$x][2]+($HLIn[$x][0]*$newDataUan+$HLIn[$x][1]*$newDataTest); // z_in\n\n\t\t\t$HLIn[$x][4] = 1/(1+exp(-$HLIn[$x][3]));\n\n\t\t}\n\n\t\tfor ($x = 0; $x < 2; $x++){\n\n\t\t\t$HLOut[$x][3] = $HLOut[$x][2]+($HLOut[$x][0]*$HLIn[0][4])+($HLOut[$x][1]*$HLIn[1][4]); // y_in\n\t\t\t\n\t\t\t$HLOut[$x][4] = 1/(1+exp(-$HLOut[$x][3])); // y\n\n\t\t\techo \"real target \".$HLOut[$x][4].\"</br>\";\n\n\t\t\t// $targetTest[$x] = ($mseOut[$x]/($HLOut[$x][4]*(1-$HLOut[$x][4])))+$HLOut[$x][4];\n\n\t\t\t// echo $mseOut[$x].\"</br>\";\n\n\t\t\t// echo \"target \".$targetTest[$x].\"</br>\";\n\n\t\t\t// $mseOut[$x] = ($targetNorm[$person][$x]-$HLOut[$x][4])*((1/(1+exp(-$HLOut[$x][3])))*(1-1/(1+exp(-$HLOut[$x][3]))));\n\n\t\t\t// $dy1[$x] = $LR * $HLOut[$x][0] * $mseOut[$x];\n\n\t\t\t// $dy2[$x] = $LR * $HLOut[$x][0] * $dy1[$x];\n\n\t\t\t// $dbias2[$x][$y] = $LR * $mseOut[$x];\n\n\n\t\t}\n\t\t\n\t\t// for ($x=0; $x < 2 ; $x++) { \n\n\t\t// \t$mseIn[$x] = ($mseOut[0]*$HLOut[0][$x])+($mseOut[1]*$HLOut[1][$x]);\n\t\t// \t$mse[$x] = $mseIn[$x] * ((1/(1+exp(-$HLIn[$x][3])))*(1-1/1+exp(-$HLIn[$x][3])));\n\n\t\t// \tfor ($y = 0; $y < 3; $y++) { \n\t\t\t\t\n\t\t// \t\t$dz[$x][$y] = $mse[$x] * $HLIn[$x][$y];\n\t\t\t\t\n\t\t// \t}\n\n\t\t// }\n\n\t}", "function perform_action($action_name, ...$args){\n global $_lms_action_arr;\n if(!empty($_lms_action_arr[$action_name])){\n $func_names = $_lms_action_arr[$action_name];\n print_r($func_names);\n foreach($func_names as $func){\n if(!empty($func)){\n //Handles the bug when a hook is not properly dequeued.\n call_user_func_array($func['name'], $args);\n }\n\n }\n }\n\n}", "function runOp($op){\n\t\tglobal $id,$domainname;\n\t\t$this->getVariable(array('id','domainname'));\n\t\t$op=strtolower($op);\n\t\t$otheroperations=array('advancedsettings');\n\n\n\t\tswitch ($op) {\n\n\n\t\t\t# other\n\t\t\tcase 'settings'\t\t\t\t\t: return $this->settings();break;\n\t\t\tcase 'adjust_system'\t\t\t: return $this->adjust_system();break;\n\t\t\tcase 'redirect_domain'\t\t\t: return $this->redirect_domain();break;\n\t\t\tcase 'information'\t\t\t\t: return $this->information($id);break;\n\n\t\t\t#multi-server operations:\n\t\t\tcase 'multiserver_add_domain'\t: return $this->multiserver_add_domain();break;\n\n\t\t\tcase 'new_sync_all'\t\t\t\t: return $this->new_sync_all();break;\n\t\t\tcase 'new_sync_domains'\t\t\t: return $this->new_sync_domains();break;\n\t\t\tcase 'new_sync_dns'\t\t\t\t: return $this->new_sync_dns();break;\n\t\t\tcase 'multiserver_add_ftp_user_direct': return $this->gui_multiserver_add_ftp_user_direct();break;\n\n\t\t\t#single-server operations:\n\t\t\tcase 'bulkaddemail'\t\t\t\t: return $this->bulkAddEmail();break;\n\t\t\tcase 'whitelist'\t\t\t\t: return $this->whitelist();break;\n\t\t\tcase 'fixmailconfiguration'\t\t: return $this->fixMailConfiguration();break;\n\t\t\tcase 'dofixmailconfiguration'\t: return $this->addDaemonOp('fixmailconfiguration','','','','fix mail configuration');break;\n\t\t\tcase 'dofixapacheconfigssl'\t\t: return $this->addDaemonOp('fixApacheConfigSsl','','','','fixApacheConfigSsl');break;\n\t\t\tcase 'dofixapacheconfignonssl'\t: return $this->addDaemonOp('fixApacheConfigNonSsl','','','','fixApacheConfigNonSsl');break;\n\t\t\tcase 'rebuild_webserver_configs': return $this->rebuild_webserver_configs();break;\n\n\t\t\tcase 'updatediskquota'\t\t\t: return $this->updateDiskQuota();break;\n\t\t\tcase 'doupdatediskquota' \t\t: $this->addDaemonOp('updatediskquota','',$domainname,'','update disk quota');return $this->displayHome();break;\n\n\t\t\t#editing of dns/apache templates for domains, on ehcp db\n\t\t\tcase 'editdnstemplate'\t\t\t: return $this->editDnsTemplate();break;\n\t\t\tcase 'editapachetemplate'\t\t: return $this->editApacheTemplate();break;\n\t\t\tcase 'editdomainaliases'\t\t: return $this->editDomainAliases();break;\n\n\t\t\tcase 'changedomainserverip'\t\t: return $this->changedomainserverip();break;\n\t\t\tcase 'warnings'\t\t\t\t\t: break; # this will be written just before show..\n\t\t\tcase 'bulkadddomain'\t\t\t: return $this->bulkaddDomain();break ;\n\t\t\tcase 'bulkdeletedomain' \t\t: return $this->bulkDeleteDomain();break ;\n\t\t\tcase 'exportdomain'\t\t\t\t: return $this->exportDomain();break;\n\n\t\t\tcase 'adddnsonlydomain' \t\t: return $this->addDnsOnlyDomain();break;\n\t\t\tcase 'adddnsonlydomainwithpaneluser': return $this->addDnsOnlyDomainWithPaneluser();break;\n\n\t\t\tcase 'getselfftpaccount'\t\t: return $this->getSelfFtpAccount();break;\n\t\t\tcase 'adddomaintothispaneluser'\t: return $this->addDomainToThisPaneluser();break;\n\n\t\t\tcase 'dodownloadallscripts'\t\t: return $this->doDownloadAllscripts();break;\n\t\t\tcase 'choosedomaingonextop'\t\t: return $this->chooseDomainGoNextOp();break;\n\n\t\t\tcase 'getmysqlserver'\t\t\t: return $this->getMysqlServer();break;\n\n\t\t\tcase 'emailforwardingsself'\t\t: return $this->emailForwardingsSelf();break;\n\t\t\tcase 'addemailforwardingself'\t: return $this->addEmailForwardingSelf();break;\n\n\t\t\tcase 'cmseditpages'\t\t\t\t: return $this->cmsEditPages();break;\n\t\t\tcase 'listservers' \t\t\t\t: return $this->listServers();break;\n\t\t\tcase 'addserver'\t\t\t\t: return $this->addServer();break;\n\t\t\tcase 'addiptothisserver'\t\t: return $this->add_ip_to_this_server();break;\n\t\t\tcase 'setactiveserverip'\t\t: return $this->set_active_server_ip();break;\n\n\n\t\t\tcase 'advancedsettings'\t\t\t: return $this->advancedsettings();break;\n\t\t\tcase 'delemailforwarding'\t\t: return $this->delEmailForwarding();break;\n\t\t\tcase 'addemailforwarding'\t\t: return $this->addEmailForwarding();break;\n\t\t\tcase 'emailforwardings' \t\t: return $this->emailForwardings();break;\n\t\t\tcase 'addscript'\t\t\t\t: return $this->addScript();break;\n\t\t\tcase 'addnewscript'\t \t\t\t: return $this->addNewScript();break;\n\n\t\t\tcase 'suggestnewscript' \t\t: return $this->suggestnewscript();break;\n\t\t\tcase 'listselectdomain' \t\t: return $this->listselectdomain();break;\n\t\t\tcase 'selectdomain'\t \t\t\t: return $this->selectdomain($id);break;\n\t\t\tcase 'deselectdomain' \t\t: return $this->deselectdomain();break;\n\t\t\tcase 'otheroperations' \t\t: return $this->otheroperations();break;\n\n\n\t\t\tcase 'loadconfig'\t \t\t\t: return $this->loadConfig();break;\n\t\t\t#case 'showconf'\t\t\t\t\t: return $this->showConfig();break;\n\t\t\tcase 'changemypass'\t\t\t\t: return $this->changeMyPass();break;\n\n\t\t\t# for mysql, stop and start is meaningless, because if mysql cannot run, then, panel also cannot be accessible or this functions do not work.\n\t\t\tcase 'dorestartmysql'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'mysql','info2'=>'restart')); break;\n\n\t\t\tcase 'dostopapache2'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'apache2','info2'=>'stop')); break;\n\t\t\tcase 'dostartapache2'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'apache2','info2'=>'start')); break;\n\t\t\tcase 'dorestartapache2'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'apache2','info2'=>'restart')); break;\n\n\t\t\tcase 'dostopvsftpd'\t\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'vsftpd','info2'=>'stop')); break;\n\t\t\tcase 'dostartvsftpd'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'vsftpd','info2'=>'start')); break;\n\t\t\tcase 'dorestartvsftpd'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'vsftpd','info2'=>'restart')); break;\n\n\t\t\tcase 'dostopbind'\t\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'bind9','info2'=>'stop')); break;\n\t\t\tcase 'dostartbind'\t\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'bind9','info2'=>'start')); break;\n\t\t\tcase 'dorestartbind'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'bind9','info2'=>'restart')); break;\n\n\t\t\tcase 'dostoppostfix'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'postfix','info2'=>'stop')); break;\n\t\t\tcase 'dostartpostfix'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'postfix','info2'=>'start')); break;\n\t\t\tcase 'dorestartpostfix'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'service','info'=>'postfix','info2'=>'restart')); break;\n\n\n\t\t\tcase 'donewsyncdomains'\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'new_sync_domains')); break;\n\t\t\tcase 'donewsyncdns'\t\t\t\t: $this->requireAdmin(); return $this->add_daemon_op(array('op'=>'new_sync_dns')); break;\n\n\t\t\tcase 'dosyncdomains'\t\t\t: return $this->addDaemonOp('syncdomains','','','','sync domains');break;\n\t\t\tcase 'dosyncdns'\t\t\t\t: return $this->addDaemonOp('syncdns','','','','sync dns');break;\n\t\t\tcase 'dosyncftp' \t\t\t\t: return $this->addDaemonOp('syncftp','','','','sync ftp for nonstandard homes');break;\n\t\t\tcase 'dosyncapacheauth'\t\t\t: return $this->addDaemonOp('syncapacheauth','','','','sync apache auth');break;\n\t\t\tcase 'options'\t\t \t\t\t: return $this->options();\n\n\n\t\t\tcase 'backups'\t\t\t\t\t: return $this->backups();break;\n\t\t\tcase 'dobackup'\t\t\t\t\t: return $this->doBackup();break;\n\t\t\tcase 'dorestore'\t\t\t\t: return $this->doRestore();break;\n\t\t\tcase 'listbackups'\t\t\t\t: return $this->listBackups();break;\n\n\t\t\t# these sync functions are executed in daemon mode.\n\t\t\tcase 'syncdomains'\t\t\t\t: return $this->syncDomains();break;\n\t\t\tcase 'syncftp'\t\t\t\t\t: return $this->syncFtp();break;\n\t\t\tcase 'syncdns'\t\t\t\t\t: return $this->syncDns();break;\n\t\t\tcase 'syncall'\t\t\t\t\t: return $this->syncAll();break;\n\t\t\tcase 'syncapacheauth'\t\t\t: return $this->syncApacheAuth();break;\n\t\t\tcase 'fixapacheconfigssl'\t\t: return $this->fixApacheConfigSsl();break;\n\t\t\tcase 'fixapacheconfignonssl'\t: return $this->fixApacheConfigNonSsl();break;\n\n\n\t\t\t#case 'syncallnew'\t: return $this->syncallnew();break;\n\t\t\tcase 'listdomains'\t\t\t\t: return $this->listDomains();break; # ayni zamanda domain email userlarini da listeler.\n\t\t\tcase 'subdomains'\t \t\t\t: return $this->subDomains();\tbreak;\n\t\t\tcase 'addsubdomain'\t \t\t\t: return $this->addSubDomain(); break;\n\t\t\tcase 'addsubdomainwithftp'\t\t: return $this->addSubDomainWithFtp(); break;\n\t\t\tcase 'addsubdirectorywithftp'\t:return $this->addSubDirectoryWithFtp(); break;\n\n\n\t\t\tcase 'delsubdomain'\t \t\t\t: return $this->delSubDomain(); break;\n\n\n\t\t\tcase 'editdomain'\t\t\t\t: return $this->editdomain();\n\t\t\tcase 'listpassivedomains'\t\t: return $this->listDomains('',$this->passivefilt);break;\n\t\t\tcase 'phpinfo'\t\t\t\t\t: return $this->phpinfo();break;\n\t\t\tcase 'help'\t\t\t\t\t\t: return $this->help();break;\n\t\t\tcase 'syncpostfix'\t\t\t\t: return $this->syncpostfix();break;\n\t\t\tcase 'listemailusers'\t\t\t: return $this->listemailusers();break;\n\t\t\tcase 'listallemailusers'\t\t: return $this->listallemailusers();break;\n\t\t\tcase 'listpanelusers' \t\t: return $this->listpanelusers();break;\n\t\t\tcase 'resellers'\t\t\t\t: return $this->resellers();break;\n\n\t\t\tcase 'deletepaneluser' \t\t: return $this->deletepaneluser();break;\n\n\t\t\tcase 'operations'\t \t\t\t: $this->requireAdmin();$this->listTable('operations','operations_table','');break;\n\n\t\t\tcase 'listallftpusers' \t\t: return $this->listAllFtpUsers();break;\n\t\t\tcase 'listftpusersrelatedtodomains': return $this->listAllFtpUsers(\"domainname<>''\");break;\n\t\t\tcase 'listftpuserswithoutdomain': return $this->listAllFtpUsers(\"domainname='' or domainname is null\");break;\n\t\t\tcase 'listftpusers'\t \t\t\t: return $this->listftpusers();break;\n\t\t\tcase 'sifrehatirlat'\t\t\t: return $this->sifreHatirlat();break;\n\t\t\tcase 'todolist'\t\t\t\t\t: return $this->todolist();break;\n\t\t\tcase 'adddomain'\t\t\t\t: return $this->addDomain();break;\n\t\t\tcase 'adddomaineasy'\t\t\t: return $this->addDomainEasy();break;\n\t\t\tcase 'adddomaineasyip'\t\t\t: return $this->addDomainEasyip();break;\n\t\t\tcase 'transferdomain'\t \t\t: return $this->transferDomain(); break;\n\t\t\tcase 'deletedomain'\t\t\t\t: return $this->deleteDomain();break;\n\t\t\tcase 'addemailuser'\t\t\t\t: return $this->addEmailUser();break;\n\t\t\tcase 'addftpuser'\t\t\t\t: return $this->addFtpUser();break;\n\t\t\tcase 'addftptothispaneluser'\t: return $this->addFtpToThisPaneluser();break;# added in 7.6.2009\n\t\t\tcase 'add_ftp_special'\t\t\t: return $this->add_ftp_special();break;\n\n\t\t\tcase 'userop'\t\t \t\t\t: return $this->userop();break;\n\t\t\tcase 'domainop'\t\t \t\t\t: return $this->domainop();break;\n\t\t\tcase 'addmysqldb'\t \t\t\t: return $this->addMysqlDb(); break;\n\t\t\tcase 'addmysqldbtouser' \t\t: return $this->addMysqlDbtoUser(); break;\n\t\t\tcase 'addpaneluser'\t\t\t\t: return $this->addPanelUser();break;\n\t\t\tcase 'editpaneluser'\t\t\t: return $this->editPanelUser();break;\n\t\t\tcase 'editftpuser'\t\t\t\t: return $this->editFtpUser();break;\n\t\t\tcase 'domainsettings'\t\t\t: return $this->domainSettings();break;\n\n\t\t\tcase 'logout'\t\t\t\t\t: return $this->logout();break;\n\t\t\tcase 'daemon'\t\t\t\t\t: return $this->daemon();break;\n\t\t\tcase 'test'\t\t\t\t\t\t: return $this->test();\tbreak;\n\t\t\tcase 'aboutcontactus' \t\t: return $this->aboutcontactus();break;\n\t\t\tcase 'applyforaccount' \t\t: return $this->applyforaccount();break;\n\t\t\tcase 'applyfordomainaccount'\t: return $this->applyfordomainaccount();break;\n\t\t\tcase 'applyforftpaccount'\t\t: return $this->applyforftpaccount();break;\n\t\t\tcase 'setconfigvalue2' \t\t: return $this->setConfigValue2($id);break;\n\t\t\tcase 'customhttp'\t\t\t\t: return $this->customHttpSettings();break;\n\t\t\tcase 'addcustomhttp'\t\t\t: return $this->addCustomHttp();break;\n\t\t\tcase 'deletecustom'\t\t\t\t: return $this->deleteCustomSetting();break;\n\t\t\tcase 'customdns'\t\t\t\t: return $this->customDnsSettings();break;\n\t\t\tcase 'addcustomdns'\t\t\t\t: return $this->addCustomDns();break;\n\t\t\tcase 'dbedituser'\t \t\t\t: return $this->dbEditUser();break;\n\t\t\tcase 'dbadduser'\t\t\t\t: return $this->dbAddUser();break;\n\n\t\t\tcase 'editemailuser'\t\t\t: # same as below\n\t\t\tcase 'editemailuserself'\t\t: return $this->editEmailUser();break;\n\n\t\t\tcase 'editemailuserautoreplyself':\n\t\t\tcase 'editemailuserautoreply'\t: return $this->editEmailUserAutoreply();break;\n\n\t\t\tcase 'editemailuserpasswordself':\n\t\t\tcase 'editemailuserpassword'\t: return $this->editEmailUserPassword();break;\n\n\t\t\tcase 'directories'\t \t\t\t: return $this->directories();break;\n\t\t\tcase 'listmyalldirectories'\t\t: return $this->listMyAllDirectories();break;\n\t\t\tcase 'adddirectory'\t \t\t\t: return $this->addDirectory();break;\n\t\t\tcase 'deletedirectory' \t\t: return $this->deleteDirectory();break;\n\t\t\tcase 'changetemplate' \t\t: return $this->changetemplate();break;\n\t\t\tcase 'addredirect'\t\t\t\t: return $this->addRedirect();break;\n\t\t\tcase 'serverstatus'\t\t\t\t: return $this->serverStatus();break;\n\t\t\tcase 'setlanguage'\t\t\t\t: $this->setLanguage($id);$this->displayHome();break;\n\t\t\tcase 'setdefaultdomain'\t\t\t: $this->setDefaultDomain();$this->displayHome();break;\n\n\t\t\tcase 'dologin'\t\t\t\t\t: # default anasayfa, same as below:\n\t\t\tcase ''\t\t\t\t\t\t\t: $this->displayHome();break;\n\n\t\t\t# virtual machine (vps) opcodes:\n\t\t\tcase 'vps_home'\t\t\t\t\t: return $this->call_func_in_module('Vps_Module','vps_home'); break;\n\t\t\tcase 'vps'\t\t\t\t\t\t: return $this->call_func_in_module('Vps_Module','vps'); break;\n\t\t\tcase 'vps_mountimage'\t\t\t: return $this->call_func_in_module('Vps_Module','vps_mountimage'); break;\n\t\t\tcase 'vps_dismountimage'\t\t: return $this->call_func_in_module('Vps_Module','vps_dismountimage'); break;\n\t\t\tcase 'add_vps'\t\t\t\t\t: return $this->call_func_in_module('Vps_Module','add_vps'); break;\n\n\n\t\t\tdefault\t\t\t\t\t\t\t: return $this->errorText(\"(runop) internal ehcp error: Undefined operation: $op <br> This feature may not be complete\");break;\n\n\t\t}# switch\n\t\treturn True;\n\n\t}", "public function testWithTwoElements()\n {\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(0), new TestModel(9)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($before[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-3)];\n $after = [new TestModel(0)];\n\n $this->assertEquals(-1, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-5)];\n $after = [new TestModel(0)];\n\n $this->assertEquals(-2, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-10)];\n $after = [new TestModel(10)];\n\n $this->assertEquals(0, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-11)];\n $after = [new TestModel(-5)];\n\n $this->assertEquals(-8, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(-11), new TestModel(-10)];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-6, $after[0]->priority);\n $this->assertEquals(0, $after[1]->priority);\n $this->assertTrue($after[0]->saved);\n $this->assertTrue($after[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(9), new TestModel(10)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-1, $before[0]->priority);\n $this->assertEquals(5, $before[1]->priority);\n $this->assertTrue($before[0]->saved);\n $this->assertTrue($before[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(9)];\n $after = [new TestModel(10)];\n\n $this->assertEquals(9, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-1, $before[0]->priority);\n $this->assertTrue($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n }", "public function _testMultipleInventories()\n {\n\n }", "public function shouldGetO3(): void\n {\n $this->assertPollutantLevel('getO3', $this->faker->randomFloat(2, 0, 500));\n }", "function exec_lola_check($check_name, $formula, $extra_parameters = \"\") {\n global $lola_filename;\n global $lola_timelimit;\n global $lola_markinglimit;\n global $lola;\n global $output;\n\n $json_filename = $lola_filename . \".\" . $check_name . \".json\";\n $witness_path_filename = $lola_filename . \".\" . $check_name . \".path\";\n $witness_state_filename = $lola_filename . \".\" . $check_name . \".state\";\n $process_output = [];\n $return_code = 0;\n \n // Run LoLA\n $lola_command = $lola \n . \" --timelimit=\" . $lola_timelimit \n . \" --markinglimit=\" . $lola_markinglimit \n . \" \" . $extra_parameters \n . \" --formula='\" . $formula . \"'\"\n . \" --path='\" . $witness_path_filename . \"'\"\n . \" --state='\" . $witness_state_filename . \"'\"\n . \" --json='\" . $json_filename . \"'\"\n . \" '\" . $lola_filename . \"'\"\n . \" 2>&1\";\n debug(\"Running command \" . $lola_command);\n exec($lola_command, $process_output, $return_code);\n \n debug($process_output);\n \n // Check if run was okay\n if ($return_code != 0) {\n $output[\"lola_output\"] = $process_output;\n terminate(\"LoLA exited with code \". $return_code);\n }\n \n // Load and parse result JSON file\n $string_result = file_get_contents($json_filename);\n if ($string_result === FALSE)\n terminate($check_name . \": Can't open result file \" . $json_filename);\n \n $json_result = json_decode($string_result, TRUE);\n debug($json_result);\n \n if (!isset($json_result[\"analysis\"]) || !isset($json_result[\"analysis\"][\"result\"])) {\n debug($json_result);\n terminate($check_name . \": malformed JSON result. Probably the time or memory limit was exceeded.\");\n }\n \n // Load witness path\n $witness_path = load_witness_path($witness_path_filename);\n \n // Load witness state\n $witness_state = load_witness_state($witness_state_filename);\n \n // Create result object\n $result = new CheckResult((boolean)($json_result[\"analysis\"][\"result\"]), $witness_path, $witness_state);\n \n // Return analysis result\n return $result;\n }", "public function testCalculate()\n {\n $calc = new ReversePolishCalculator();\n $calc\n ->enter(3)\n ->enter(2)\n ->enter(1)\n ->add()\n ->multiply()\n ;\n\n $this->assertEquals([9], $calc->getStack());\n }", "protected function parse_oneL_fun()\n {\n $this->check_param_num(1);\n\n $this->generate_instruction();\n\n $this->get_token();\n $this->check_label();\n $this->generate_arg(\"1\", \"label\");\n \n $this->xml->endElement();\n }", "public function testPingTreeCreatePingTree()\n {\n }", "public function testGetMultipleKeyValuePairsAtOnce(): void\n {\n $obj = new \\stdClass;\n $obj->animal = \"Frog\";\n $obj->mineral = \"Quartz\";\n $obj->vegetable = \"Spinach\";\n $arr = array(\n \"testInt\" => 5,\n \"testFloat\" => 3.278,\n \"testString\" => \"WooHoo\",\n \"testBoolean\" => true,\n \"testNull\" => null,\n \"testArray\" => array(1, 2, 3, 4, 5),\n \"testObject\" => $obj\n );\n $arr['Hello'] = null;\n $arr['Goodbye'] = null;\n $this->testNotStrict->setMultiple($arr);\n $tarr = array();\n $tarr[] = 'testBoolean';\n $tarr[] = 'testFloat';\n $tarr[] = 'testCacheMiss';\n $tarr[] = 'testString';\n $result = $this->testNotStrict->getMultiple($tarr);\n $boolean = array_key_exists('testBoolean', $result);\n $this->assertTrue($boolean);\n $boolean = array_key_exists('testFloat', $result);\n $this->assertTrue($boolean);\n $boolean = array_key_exists('testCacheMiss', $result);\n $this->assertTrue($boolean);\n $boolean = array_key_exists('testString', $result);\n $this->assertTrue($boolean);\n $this->assertEquals($result['testBoolean'], $arr['testBoolean']);\n $this->assertEquals($result['testFloat'], $arr['testFloat']);\n $this->assertEquals($result['testString'], $arr['testString']);\n $this->assertNull($result['testCacheMiss']);\n }", "public function splitCalcDataProvider() {}", "function test_checkMode_newArgs()\n {\n $result = $this->bax->_checkMode($this->bax->_newArgs());\n $this->assertTrue($result === true);\n }", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "function testFindLp() {\n\t\t$result = $this->Album->find('lp', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t// TODO: Test this properly\n\t\t$this->assertEmpty($result);\n\t}", "public function testGeneAccessionComp3() {\n\t\techo (\"\\n********************Test GeneAccessionComp3()***********************************************\\n\");\n\t\n\t\t$result = 0;\n\t\t\t\n\t\t$result = \\bcGen\\MainBundle\\Entity\\Gene::geneAccessionComp( $this->genes[1], $this->genes[2] );\n\t\t$result += \\bcGen\\MainBundle\\Entity\\Gene::geneAccessionComp( $this->genes[1], $this->genes[3] );\n\t\t$result += \\bcGen\\MainBundle\\Entity\\Gene::geneAccessionComp( $this->genes[1], $this->genes[4] );\n\t\t$result += \\bcGen\\MainBundle\\Entity\\Gene::geneAccessionComp( $this->genes[1], $this->genes[5] );\n\t\n\t\t$this->assertEquals ( -4, $result);\n\t\n\t}", "public function testNoResultQueryWithMultipleResultStatement() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n $this->setExpectedException('Exception', 'No result statement returned a result.');\r\n $query = 'select * from POTEST';\r\n $this->getPersistenceAdapter()->executeNoResultQuery($query);\r\n }" ]
[ "0.5191508", "0.5024387", "0.49021414", "0.4887747", "0.4879865", "0.48562452", "0.48225185", "0.48012182", "0.47364852", "0.47312903", "0.47243926", "0.4724136", "0.47061205", "0.46968654", "0.46790034", "0.46377128", "0.46261263", "0.46211708", "0.46107772", "0.45613116", "0.45570177", "0.4547852", "0.45425668", "0.45336646", "0.45240209", "0.45161572", "0.45077327", "0.45042312", "0.45034394", "0.44963148", "0.44960296", "0.44847524", "0.44742662", "0.44736153", "0.44593027", "0.444539", "0.442982", "0.442928", "0.44282648", "0.44221216", "0.4418087", "0.4415856", "0.44149768", "0.4405895", "0.43804", "0.43743193", "0.43710086", "0.43664685", "0.43499604", "0.43399173", "0.43302125", "0.43235844", "0.43142012", "0.43141633", "0.43071574", "0.42995796", "0.42984048", "0.42981082", "0.42901754", "0.42797837", "0.42757028", "0.42715624", "0.4267865", "0.42677018", "0.42660213", "0.42637348", "0.42492482", "0.4239342", "0.42357248", "0.42284417", "0.42226297", "0.42206243", "0.42156053", "0.42154875", "0.4213907", "0.42137682", "0.4192199", "0.4190747", "0.41906098", "0.41879642", "0.41869897", "0.41789714", "0.41773254", "0.41757482", "0.4174911", "0.41682228", "0.41671723", "0.4166843", "0.41563302", "0.4155957", "0.4151305", "0.4147404", "0.4135821", "0.41319996", "0.41260445", "0.41240737", "0.4122186", "0.412143", "0.41182807", "0.41152227" ]
0.43575785
48
Tests multiple LPOP through a pipeline.
public function benchLpopPipeline() { $pipeline = new Pipeline($this->client); $cmd = $this->client->getProfile()->createCommand('multi'); $pipeline->executeCommand($cmd); for ($i = 0; $i < self::CONSUME_SIZE; $i++) { $cmd = $this->client->getProfile()->createCommand('lpop', [$this->queueName]); $pipeline->executeCommand($cmd); } $cmd = $this->client->getProfile()->createCommand('exec'); $pipeline->executeCommand($cmd); $result = $pipeline->execute(); $messageList = array_map( '\Prototype\Redis\RedisEnvelope::jsonDeserialize', end($result) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o_comparePipe(...$comparisons) {\n\t\t\treturn Obj::singleton()->comparePipe(...$comparisons);\n\t\t}", "public function test_scenario1() {\n $data = array(array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 0, \"prediction\" => \"a\", \"confidence\" => 0.450471270879),\n\t array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 1, \"prediction\" => \"a\", \"confidence\" => 0.552021302649),\n\t\t array(\"predictions\" => \"./data/predictions_c.json\", \"method\" => 2, \"prediction\" => \"a\", \"confidence\" => 0.403632421178),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 0, \"prediction\" => 1.55555556667, \"confidence\" => 0.400079152063),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 1, \"prediction\" => 1.59376845074, \"confidence\" => 0.248366474212),\n\t\t array(\"predictions\" => \"./data/predictions_r.json\", \"method\" => 2, \"prediction\" => 1.55555556667 , \"confidence\" => 0.400079152063));\n\n foreach($data as $item) {\n\t print \"\\nSuccessfully computing predictions combinations\\n\";\n\t $predictions = json_decode(file_get_contents($item[\"predictions\"]));\n\n print \"Given I create a MultiVote for the set of predictions in file \" . $item[\"predictions\"] . \"\\n\";\n $multivote = new MultiVote($predictions);\n\t print \"When I compute the prediction with confidence using method \" . $item[\"method\"] . \"\\n\";\n\t $combined_results = $multivote->combine($item[\"method\"], true);\n\t print \"And I compute the prediction without confidence using method \" . $item[\"method\"] . \"\\n\";\n $combined_results_no_confidence = $multivote->combine($item[\"method\"]);\n\n\n if ($multivote->is_regression()) {\n\t print \"Then the combined prediction is \" . $item[\"prediction\"] . \"\\n\";\n $this->assertEquals(round($combined_results[0], 6), round($item[\"prediction\"],6));\n\t print \"And the combined prediction without confidence is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals(round($combined_results_no_confidence, 6), round($item[\"prediction\"] ,6));\n\t } else {\n\t print \"Then the combined prediction is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals($combined_results[0], $item[\"prediction\"]);\n\t print \"And the combined prediction without confidence is \" . $item[\"prediction\"] . \"\\n\";\n\t $this->assertEquals($combined_results_no_confidence, $item[\"prediction\"]);\n\t }\n\n print \"And the confidence for the combined prediction is \" . $item[\"confidence\"] . \"\\n\";\n\t $this->assertEquals(round($combined_results[1], 6), round($item[\"confidence\"],6));\n }\n }", "protected function pipe(ProvidesPipeline ...$pipeline)\n {\n $result = null;\n foreach ($pipeline as $pipe) {\n if ($pipe instanceof ProvidesContextPipeline) {\n $result = $pipe->handle($result, $this);\n } elseif ($pipe instanceof ProvidesPipeline) {\n $result = $pipe->handle($result);\n }\n }\n\n return $result;\n }", "private static function pipelinesMatch(Pipeline $p1, Pipeline $p2): bool\n {\n $params1 = $p1->getParametersValues(true);\n $params2 = $p2->getParametersValues(true);\n\n if (count($params1) !== count($params2)) {\n return false;\n }\n\n foreach ($params1 as $key => $value) {\n if ($value !== $params2[$key]) {\n return false;\n }\n }\n\n return true;\n }", "public function parallelSplitTests()\n {\n\n }", "public function test_add_several_actions_random_priorities() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n $total = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $total += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n $this->assertSame( $times, $total );\n }", "public function test_scenario1() {\n $data = array(array('filename' => 'data/iris.csv',\n 'params' => array(\"tags\" => array(\"mytag\"), 'missing_splits' => false),\n\t\t\t 'data_input' => array(\"petal width\"=> 0.5),\n\t\t\t 'tag' => 'mytag',\n\t\t\t 'predictions' => \"Iris-setosa\"));\n\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a prediction from a multi model\\n\";\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_1 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_1->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_1->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_2 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_2->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_2->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_3 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_3->code);\n\n print \"And I wait until the model is ready\\n\";\n $resource = self::$api->_check_resource($model_3->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n $list_of_models = array();\n\t array_push($list_of_models, self::$api->get_model($model_1->resource));\n array_push($list_of_models, self::$api->get_model($model_2->resource));\n\t array_push($list_of_models, self::$api->get_model($model_3->resource));\n\n print \"And I create a local multi model\\n\";\n $local_multimodel = new MultiModel($list_of_models);\n\n print \"When I create a prediction for \" . json_encode($item[\"data_input\"]) . \"\\n\";\n $prediction = $local_multimodel->predict($item[\"data_input\"]);\n\n print \"Then the prediction is \". $item[\"predictions\"] . \" \\n\";\n $this->assertEquals($prediction, $item[\"predictions\"]);\n\n }\n }", "public function testGetLabelAndLanguageList() {\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList(2, 1, 1);\n $this->assertTrue(true);\n }", "public function testGetLabelAndLangDataSet() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(2, 1);\n $this->assertTrue(true);\n }", "public function test_scenario2() {\n $data = array(array('filename' => 'data/iris.csv',\n 'params' => array(\"tags\" => array(\"mytag\"), 'missing_splits' => false),\n 'data_input' => array(array(\"petal width\"=> 0.5), array(\"petal length\"=>6, \"petal width\"=>2)),\n 'tag' => 'mytag',\n 'predictions' => array(\"Iris-setosa\", \"Iris-virginica\")));\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a local batch prediction from a multi model\\n\";\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n $list_of_models = array();\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_1 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_1->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_1->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_1->resource));\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_2 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_2->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_2->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_2->resource));\n\n print \"And I create model with params \" .json_encode($item[\"params\"]) . \"\\n\";\n $model_3 = self::$api->create_model($dataset->resource, $item[\"params\"]);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model_3->code);\n\n print \"And I wait until the is ready\\n\";\n $resource = self::$api->_check_resource($model_3->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n array_push($list_of_models, self::$api->get_model($model_3->resource));\n\n print \"And I create a local multi model\\n\";\n $local_multimodel = new MultiModel($list_of_models);\n\n print \"When I create a batch multimodel prediction for \" . json_encode($item[\"data_input\"]) . \" \\n\";\n $predictions = $local_multimodel->batch_predict($item[\"data_input\"], null, true, false, \\BigML\\Tree::LAST_PREDICTION, null, false, false);\n $i = 0;\n\n print \"Then the predictions are \" . json_encode($item[\"predictions\"]) . \"\\n\";\n\t foreach ($predictions as $multivote) {\n\t foreach ($multivote->predictions as $prediction) {\n\t $this->assertEquals($prediction[\"prediction\"], $item[\"predictions\"][$i]);\n\t }\n\t $i+=1;\n\t }\n $this->assertEquals($i, count($predictions));\n }\n }", "public function test_multiple_filter() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; } );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; } );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n\t}", "public function testBypassPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n BypassPipe::class => 'c',\n PipeTwo::class => 'b',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(0)(1a)(-1a)', $result);\n }", "public function test_multiple_filter_with_priority() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 9 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"2\" . \"1\", $filtered );\n\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 11 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n }", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function checkPiplTest(){\r\n // Params\r\n $checkClass = new Pipl();\r\n // Class Call\r\n $res = $checkClass->test();\r\n // Return result\r\n $this->returnJson($res['code'], $res['message']);\r\n }", "public function test_scenario1() {\n\n $data = array(array(\"filename\"=> \"data/iris.csv\",\n\t \"local_file\" => \"tmp/if_then_rules_iris.txt\",\n\t\t\t \"expected_file\" => \"data/model/if_then_rules_iris.txt\"),\n array(\"filename\"=> \"data/iris_sp_chars.csv\",\n \"local_file\" => \"tmp/iris_sp_chars.txt\",\n \"expected_file\" => \"data/model/if_then_rules_iris_sp_chars.txt\"),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam.txt\"),\n array(\"filename\"=> \"data/grades.csv\",\n \"local_file\" => \"tmp/if_then_rules_grades.txt\",\n \"expected_file\" => \"data/model/if_then_rules_grades.txt\"),\n array(\"filename\"=> \"data/diabetes.csv\",\n \"local_file\" => \"tmp/if_then_rules_diabetes.txt\",\n \"expected_file\" => \"data/model/if_then_rules_diabetes.txt\"),\n array(\"filename\"=> \"data/iris_missing2.csv\",\n \"local_file\" => \"tmp/if_then_rules_iris_missing2.txt\",\n \"expected_file\" => \"data/model/if_then_rules_iris_missing2.txt\"),\n array(\"filename\"=> \"data/tiny_kdd.csv\",\n \"local_file\" => \"tmp/if_then_rules_tiny_kdd.txt\",\n \"expected_file\" => \"data/model/if_then_rules_tiny_kdd.txt\")\n\t );\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a model and translate the tree model into a set of IF-THEN rules\\n\";\n\t print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n\t $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n\t $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n\t $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the local source is ready\\n\";\n\t $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n\t $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n\t $dataset = self::$api->create_dataset($source->resource);\n\t $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n\t $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n\t $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n\t $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n\t $model = self::$api->create_model($dataset->resource);\n\t $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wail until the model is ready\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n\t $local_model = new Model($model->resource, self::$api);\n print \"I translate the tree into IF_THEN rules\\n\";\n\n\t $fp = fopen($item[\"local_file\"], 'w');\n $local_model->rules($fp);\n fclose($fp);\n\t print \" Then I check the output is like \" . $item[\"expected_file\"] . \" expected file\\n\";\n $this->assertEquals(0, strcmp(trim(file_get_contents($item[\"local_file\"])), trim(file_get_contents($item[\"expected_file\"]))));\n\n }\n\n\n }", "public function testGetLabelAndLangDataSetDif() {\n\n $labelList = array();\n $langLabelList = array();\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelId($testCase['label_id']);\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n array_push($labelList, $label);\n }\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n array_push($langLabelList, $langStr);\n }\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getDataList')\n ->will($this->returnValue($labelList));\n\n $this->localizationDao->expects($this->once())\n ->method('getLangStrBySrcAndTargetIds')\n ->will($this->returnValue($langLabelList));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLangDataSet(1, 1);\n $this->assertTrue(true);\n }", "public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }", "public function CheckLBAndLLMeasures_Present_AllCoreAndElective_OnChecklistPreview(AcceptanceTester $I) {\n $I->amOnPage(Page\\ChecklistPreview::URL($this->id_checklist, $this->id_audSubgroup1_Energy));\n $I->wait(3);\n $I->waitForElement(\\Page\\ChecklistPreview::$ExtensionSelect);\n $I->selectOption(\\Page\\ChecklistPreview::$ExtensionSelect, \"Lg Building + Lg Landscape\");\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 2 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure1Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure2Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure4Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure5Desc));\n $I->canSee(\"$this->pointsMeas1 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure1Desc));\n $I->canSee(\"$this->pointsMeas2 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure2Desc));\n $I->canSee(\"$this->pointsMeas4 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure4Desc));\n $I->canSee(\"$this->pointsMeas5 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure5Desc));\n $I->wait(1);\n $I->click(\\Page\\ChecklistPreview::$LeftMenu_SolidWasteGroupButton);\n $I->wait(2);\n $I->click(\\Page\\ChecklistPreview::LeftMenu_Subgroup_ByName($this->audSubgroup1_SolidWaste));\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 1 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure7Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure8Desc));\n $I->canSee(\"$this->pointsMeas7 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure7Desc));\n $I->canSee(\"$this->pointsMeas8 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure8Desc));\n }", "public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }", "public function test_scenario4() {\n $data = array(array('filename' => 'data/iris.csv'));\n\n foreach($data as $item) {\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source'));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"check the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n \n print \"check model is ready\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"I create a batch prediction\\n\";\n $batch_prediction=self::$api->create_batch_prediction($model,$dataset);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $batch_prediction->code);\n \n print \"check a batch_predicion is ready\\n\";\n $resource = self::$api->_check_resource($batch_prediction, null, 3000, 50);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n \n print \"Then I create a source from the batch prediction\\n\";\n $source = self::$api->source_from_batch_prediction($batch_prediction);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n \n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]); \n\n }\n }", "public function testGetPackingPlanByFilter()\n {\n }", "public function testLanguageOptionForMultipleLanguages()\n {\n $expected = 'tesseract image.png stdout -l eng+deu+jpn';\n\n $actual = (new WrapTesseractOCR('image.png'))\n ->lang('eng', 'deu', 'jpn')\n ->buildCommand();\n\n $this->assertEquals($expected, $actual);\n }", "public function testGetPointsWhenAddedMultiple()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(12);\n $res = $player -> getPoints();\n $this->assertSame(12, $res);\n\n $player -> addPoints(5);\n $res = $player -> getPoints();\n $this->assertSame(12 + 5, $res);\n\n $player -> addPoints(23);\n $res = $player -> getPoints();\n $this->assertSame(12 + 5 + 23, $res);\n }", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/iris.csv', 'expected_file' => 'data/model/predictions_distribution_iris.txt'),\n array('filename' => 'data/iris_sp_chars.csv', 'expected_file' => 'data/model/predictions_distribution_iris_sp_chars.txt'),\n array('filename' => 'data/spam.csv', 'expected_file' => 'data/model/predictions_distribution_spam.txt'),\n array('filename' => 'data/grades.csv', 'expected_file' => 'data/model/predictions_distribution_grades.txt'),\n array('filename' => 'data/diabetes.csv', 'expected_file' => 'data/model/predictions_distribution_diabetes.txt'),\n array('filename' => 'data/iris_missing2.csv', 'expected_file' => 'data/model/predictions_distribution_iris_missing2.txt'),\n array('filename' => 'data/tiny_kdd.csv', 'expected_file' => 'data/model/predictions_distribution_tiny_kdd.txt')\n );\n\n foreach($data as $item) {\n print \"\\n Successfully creating a model and check its predictions distribution\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"Then I check the predictions distribution with \". $item[\"expected_file\"] . \" file\\n\";\n\n $file_distribution = file_get_contents($item[\"expected_file\"]);\n $distribution = $local_model->get_prediction_distribution();\n $distribution_str='';\n\n foreach($distribution as $key => $value) {\n $distribution_str= $distribution_str . \"[\" . $key . \",\" . $value . \"]\\n\";\n }\n\n $this->assertEquals(trim($distribution_str), trim($file_distribution));\n\n }\n }", "public function testPipe()\n {\n $input = [\n 'orange',\n 'banana',\n 'cherry',\n ];\n\n $result = Command::create()\n ->app('echo')\n ->input('\"' . implode(PHP_EOL, $input) . '\"')\n ->app('sort')\n ->exec();\n \n sort($input);\n $this->assertEquals(implode($input, PHP_EOL), $result->getRaw());\n }", "public function test_scenario1() {\n $data = array(array('filename' => 'data/iris.csv', 'local_file' => 'tmp/batch_predictions.csv', 'predictions_file' => 'data/batch_predictions.csv')); \n\n\n foreach($data as $item) {\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source'));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"check the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n \n print \"check model is ready\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"I create a batch prediction\\n\";\n $batch_prediction=self::$api->create_batch_prediction($model,$dataset);\n\t $this->assertEquals(BigMLRequest::HTTP_CREATED, $batch_prediction->code);\n \n\t print \"check a batch_predicion is ready\\n\";\n $resource = self::$api->_check_resource($batch_prediction, null, 3000, 50);\n\t $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"download batch predictions file\\n\";\n\t $filename = self::$api->download_batch_prediction($batch_prediction, $item[\"local_file\"]);\n\t $this->assertNotNull($filename);\n\n print \"i compare the prediction file is correct\\n\";\n $this->assertTrue(compareFiles($item[\"local_file\"], $item[\"predictions_file\"]));\n\n } \n }", "public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }", "public function _testMultipleInventories()\n {\n\n }", "public function testProcessWithSeveralManagers(array $managers)\n {\n $container = $this->getContainerMock($managers);\n\n $compilerPass = new MappingPass();\n $compilerPass->process($container);\n $compilerPass = new RepositoryPass();\n $compilerPass->process($container);\n }", "public function test_scenario2() {\n $data = array(array(\"filename\"=> \"data/iris_missing2.csv\",\n \"local_file\" => \"tmp/if_then_rules_iris_missing2_MISSINGS.txt\",\n \"expected_file\" => \"data/model/if_then_rules_iris_missing2_MISSINGS.txt\"));\n foreach($data as $item) {\n print \"\\nSuccessfully creating a model with missing values and translate the tree model into a set of IF-THEN rules\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource, array(\"missing_splits\" => true));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wail until the model is ready\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"And I translate the tree into IF_THEN rules\\n\";\n\n $fp = fopen($item[\"local_file\"], 'w');\n $local_model->rules($fp);\n fclose($fp);\n\n print \" Then I check the output is like \" . $item[\"expected_file\"] . \" expected file\\n\";\n $this->assertEquals(0, strcmp(trim(file_get_contents($item[\"local_file\"])), trim(file_get_contents($item[\"expected_file\"]))));\n\n }\n }", "public function testBrokenPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n PipeTwo::class => 'b',\n BrokenPipeOne::class => 'c',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(-2b)(-1a)', $result);\n }", "#[@test]\n public function withProcessors() {\n $processors= array(new Optional(), new Required());\n $this->fixture->withProcessors($processors);\n $this->assertEquals($processors, $this->fixture->getProcessors());\n }", "public function scenario_1()\n {\n $players = PlayerCollection::make([\n Player::fromClient(Client::register(Uuid::uuid4(), 'xLink', Chips::fromAmount(650)), Chips::fromAmount(2000)),\n Player::fromClient(Client::register(Uuid::uuid4(), 'jesus', Chips::fromAmount(800)), Chips::fromAmount(300)),\n Player::fromClient(Client::register(Uuid::uuid4(), 'melk', Chips::fromAmount(1200)), Chips::fromAmount(800)),\n Player::fromClient(Client::register(Uuid::uuid4(), 'bob', Chips::fromAmount(1200)), Chips::fromAmount(150)),\n Player::fromClient(Client::register(Uuid::uuid4(), 'blackburn', Chips::fromAmount(1200)), Chips::fromAmount(5000)),\n ]);\n $xLink = $players->get(0);\n $jesus = $players->get(1);\n $melk = $players->get(2);\n $bob = $players->get(3);\n $blackburn = $players->get(4);\n\n $winningHand = Hand::fromString('As Ad', $xLink);\n\n $round = $this->dealGameForSplitPot($players, $winningHand);\n\n $this->assertEquals(2500, $round->players()->get(0)->chipStack()->amount());\n $this->assertEquals(0, $round->players()->get(1)->chipStack()->amount());\n $this->assertEquals(750, $round->players()->get(2)->chipStack()->amount());\n $this->assertEquals(0, $round->players()->get(3)->chipStack()->amount());\n $this->assertEquals(5000, $round->players()->get(4)->chipStack()->amount());\n }", "private function runTests(){\n $process = new Process(['./vendor/bin/phpunit --filter '.$this->params['model_name'].'Test']);\n $process->start();\n foreach($process as $type => $data){\n if($process::OUT !== $type){\n $this->error($data);\n continue;\n }\n $this->info($data);\n }\n }", "public function testValidateMultipleRules() {\n $validator = new Validator();\n $value = 15;\n $collection = new RuleCollection();\n $collection->addRule($this->getMockRuleReturnTrue());\n $collection->addRule($this->getMockRuleReturnTrue());\n $result = $validator->validateMultipleRules($value, $collection);\n $this->assertTrue($result);\n }", "public function testGetPackingPlanTags()\n {\n }", "public function getPipelines(): array;", "public function testConnectingToAConnectedPipe() \r\n \t{\r\n \t\t// create two pipes\r\n \t\t$pipe1 = new Pipe();\r\n \t\t$pipe2 = new Pipe();\r\n \t\t$pipe3 = new Pipe();\r\n\r\n \t\t// connect them\r\n \t\t$success = $pipe1->connect($pipe2);\r\n \t\t\r\n \t\t// test assertions\r\n \t\t$this->assertTrue( $success, \"Expecting connected pipe1 to pipe2\" );\r\n \t\t$this->assertTrue( $pipe1->connect($pipe3) == false, \"Expecting can't connect pipe3 to pipe1\" );\r\n\t\t\r\n \t}", "public function test_scenario6() {\n $data = array(array('filename' => 'data/iris.csv', 'expected_file' => 'data/model/summarize_iris.txt', 'local_file' => 'tmp/summarize_iris.txt'),\n array('filename' => 'data/iris_sp_chars.csv', 'expected_file' => 'data/model/summarize_iris_sp_chars.txt', 'local_file' => 'tmp/summarize_iris_sp_chars.txt'),\n array('filename' => 'data/spam.csv', 'expected_file' => 'data/model/summarize_spam.txt', 'local_file' => 'tmp/summarize_spam.txt'),\n array('filename' => 'data/grades.csv', 'expected_file' => 'data/model/summarize_grades.txt', 'local_file' => 'tmp/summarize_grades.txt'),\n array('filename' => 'data/diabetes.csv', 'expected_file' => 'data/model/summarize_diabetes.txt', 'local_file' => 'tmp/summarize_diabetes.txt'),\n array('filename' => 'data/iris_missing2.csv', 'expected_file' => 'data/model/summarize_iris_missing2.txt', 'local_file' => 'tmp/summarize_iris_missing2.txt'),\n array('filename' => 'data/tiny_kdd.csv', 'expected_file' => 'data/model/summarize_tiny_kdd.txt', 'local_file' => 'tmp/summarize_tiny_kdd.txt')\n );\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a model and check its summary information:\\n\";\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"And I translate the tree into IF_THEN rules\\n\";\n\t $local_model->summarize(fopen($item[\"local_file\"],'w'));\n print \"Then I check the predictions distribution with \". $item[\"expected_file\"] . \" file\\n\";\n\t $this->assertEquals(0, strcmp(trim(file_get_contents($item[\"local_file\"])), trim(file_get_contents($item[\"expected_file\"]))));\n\n }\n\n }", "function testBackendInvokeMultiple() {\n $options = array(\n 'backend' => NULL,\n 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile.\n );\n $php = \"\\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0), array('invoke-multiple' => '3')); return \\$values;\";\n $this->drush('php-eval', array($php), $options);\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has a 'concurrent'-format output result\n $this->assertEquals('concurrent', implode(',', array_keys($parsed['object'])));\n // assert that the concurrent output has indexes 0, 1 and 2 (in any order)\n $concurrent_indexes = array_keys($parsed['object']['concurrent']);\n sort($concurrent_indexes);\n $this->assertEquals('0,1,2', implode(',', $concurrent_indexes));\n foreach ($parsed['object']['concurrent'] as $index => $values) {\n // assert that each result contains 'x' => 'y' and nothing else\n $this->assertEquals(\"array (\n 'x' => 'y',\n)\", var_export($values['object'], TRUE));\n }\n }", "private function testCollect() {\n $custom_data = array();\n\n // Collect all custom data provided by hook_insight_custom_data().\n $collections = \\Drupal::moduleHandler()->invokeAll('acquia_connector_spi_test');\n\n foreach ($collections as $test_name => $test_params) {\n $status = new TestStatusController();\n $result = $status->testValidate(array($test_name => $test_params));\n\n if ($result['result']) {\n $custom_data[$test_name] = $test_params;\n }\n }\n\n return $custom_data;\n }", "public function testItemsProcFunc()\n {\n }", "public function processMultiLevelTestControllerDataProvider(): array\n {\n return [\n ['noparams', [], StatusCode::OK, 'No Parameters'],\n ['noparams', ['param1'], StatusCode::NOT_FOUND, ''],\n ['noparams', ['param1', 'param2'], StatusCode::NOT_FOUND, ''],\n ['noparams', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foo', [], StatusCode::NOT_FOUND, ''],\n ['foo', ['param1'], StatusCode::OK, 'FooAction: Foo=[param1]'],\n ['foo', ['param1', 'param2'], StatusCode::NOT_FOUND, ''],\n ['foo', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foobar', [], StatusCode::NOT_FOUND, ''],\n ['foobar', ['param1'], StatusCode::NOT_FOUND, ''],\n ['foobar', ['param1', 'param2'], StatusCode::OK, 'FooBarAction: Foo=[param1], Bar=[param2]'],\n ['foobar', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foobarbaz', [], StatusCode::NOT_FOUND, ''],\n ['foobarbaz', ['param1'], StatusCode::NOT_FOUND, ''],\n ['foobarbaz', ['param1', 'param2'], StatusCode::NOT_FOUND, ''],\n ['foobarbaz', ['param1', 'param2', 'param3'], 200, 'FooBarBazAction: Foo=[param1], Bar=[param2], Baz=[param3]'],\n ['foonull', [], StatusCode::OK, 'FooNullAction: Foo=[*null*]'],\n ['foonull', ['param1'], StatusCode::OK, 'FooNullAction: Foo=[param1]'],\n ['foonull', ['param1', 'param2'], StatusCode::NOT_FOUND, ''],\n ['foonull', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foonullbarnull', [], StatusCode::OK, 'FooNullBarNullAction: Foo=[*null*], Bar=[*null*]'],\n ['foonullbarnull', ['param1'], StatusCode::OK, 'FooNullBarNullAction: Foo=[param1], Bar=[*null*]'],\n ['foonullbarnull', ['param1', 'param2'], StatusCode::OK, 'FooNullBarNullAction: Foo=[param1], Bar=[param2]'],\n ['foonullbarnull', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foonullbarnullbaznull', [], StatusCode::OK, 'FooNullBarNullBazNullAction: Foo=[*null*], Bar=[*null*], Baz=[*null*]'],\n ['foonullbarnullbaznull', ['param1'], StatusCode::OK, 'FooNullBarNullBazNullAction: Foo=[param1], Bar=[*null*], Baz=[*null*]'],\n ['foonullbarnullbaznull', ['param1', 'param2'], StatusCode::OK, 'FooNullBarNullBazNullAction: Foo=[param1], Bar=[param2], Baz=[*null*]'],\n ['foonullbarnullbaznull', ['param1', 'param2', 'param3'], StatusCode::OK, 'FooNullBarNullBazNullAction: Foo=[param1], Bar=[param2], Baz=[param3]'],\n ['foobarnull', [], StatusCode::NOT_FOUND, ''],\n ['foobarnull', ['param1'], StatusCode::OK, 'FooBarNullAction: Foo=[param1], Bar=[*null*]'],\n ['foobarnull', ['param1', 'param2'], StatusCode::OK, 'FooBarNullAction: Foo=[param1], Bar=[param2]'],\n ['foobarnull', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ['foobarnullbaznull', [], StatusCode::NOT_FOUND, ''],\n ['foobarnullbaznull', ['param1'], StatusCode::OK, 'FooBarNullBazNullAction: Foo=[param1], Bar=[*null*], Baz=[*null*]'],\n ['foobarnullbaznull', ['param1', 'param2'], StatusCode::OK, 'FooBarNullBazNullAction: Foo=[param1], Bar=[param2], Baz=[*null*]'],\n ['foobarnullbaznull', ['param1', 'param2', 'param3'], StatusCode::OK, 'FooBarNullBazNullAction: Foo=[param1], Bar=[param2], Baz=[param3]'],\n ['foobarbazstring', [], StatusCode::NOT_FOUND, ''],\n ['foobarbazstring', ['param1'], StatusCode::NOT_FOUND, ''],\n ['foobarbazstring', ['param1', 'param2'], StatusCode::OK, 'FooBarBazStringAction: Foo=[param1], Bar=[param2], Baz=[default string]'],\n ['foobarbazstring', ['param1', 'param2', 'param3'], StatusCode::OK, 'FooBarBazStringAction: Foo=[param1], Bar=[param2], Baz=[param3]'],\n ['nonexisting', [], StatusCode::NOT_FOUND, ''],\n ['nonexisting', ['param1'], StatusCode::OK, 'DefaultAction: Foo=[nonexisting], Bar=[param1], Baz=[*null*]'],\n ['nonexisting', ['param1', 'param2'], StatusCode::OK, 'DefaultAction: Foo=[nonexisting], Bar=[param1], Baz=[param2]'],\n ['nonexisting', ['param1', 'param2', 'param3'], StatusCode::NOT_FOUND, ''],\n ];\n }", "public function testGetPayslip()\n {\n }", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/tiny_kdd.csv', \n 'local_file' => 'tmp/batch_predictions.csv', \n 'predictions_file' => 'data/batch_predictions_a.csv'));\n\n foreach($data as $item) {\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source'));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"check the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"Then I create an anomaly detector from a dataset\\n\";\n $anomaly = self::$api->create_anomaly($dataset->resource);\n\n print \"I wait until the anomaly detector is ready\\n\";\n $resource = self::$api->_check_resource($anomaly->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"I create a batch anomaly score\\n\";\n $batch_prediction=self::$api->create_batch_anomaly_score($anomaly, $dataset);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $batch_prediction->code);\n\n print \"check a batch_predicion is ready\\n\";\n $resource = self::$api->_check_resource($batch_prediction, null, 50000, 50);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"download batch predictions file\\n\";\n $filename = self::$api->download_batch_anomaly_score($batch_prediction, $item[\"local_file\"]);\n $this->assertNotNull($filename);\n\n print \"i compare the prediction file is correct\\n\";\n $this->assertTrue(compareFiles($item[\"local_file\"], $item[\"predictions_file\"]));\n\n }\n }", "public function provideTupleTests() {\n $result = [\n '>' => [['id' => [Db::OP_GT => 3]], [4, 5]],\n '>=' => [['id' => [Db::OP_GTE => 3]], [3, 4, 5]],\n '<' => [['id' => [Db::OP_LT => 3]], [1, 2]],\n '<=' => [['id' => [Db::OP_LTE => 3]], [1, 2, 3]],\n '=' => [['id' => [Db::OP_EQ => 2]], [2]],\n '<>' => [['id' => [Db::OP_NEQ => 3]], [1, 2, 4, 5]],\n 'is null' => [['id' => null], [null]],\n 'is not null' => [['id' => [Db::OP_NEQ => null]], [1, 2, 3, 4, 5]],\n 'all' => [[], [null, 1, 2, 3, 4, 5]],\n 'in' => [['id' => [Db::OP_IN => [3, 4, 5]]], [3, 4, 5]],\n 'in (short)' => [['id' => [3, 4, 5]], [3, 4, 5]],\n '= in' => [['id' => [Db::OP_EQ => [3, 4, 5]]], [3, 4, 5]],\n '<> in' => [['id' => [Db::OP_NEQ => [3, 4, 5]]], [1, 2]],\n 'and' =>[['id' => [\n Db::OP_AND => [\n Db::OP_GT => 3,\n Db::OP_LT => 5\n ]\n ]], [4]],\n 'or' =>[['id' => [\n Db::OP_OR => [\n Db::OP_LT => 3,\n Db::OP_EQ => 5\n ]\n ]], [1, 2, 5]]\n ];\n\n return $result;\n }", "#[@test]\n public function setProcessors() {\n $processors= array(new Optional(), new Required());\n $this->fixture->setProcessors($processors);\n $this->assertEquals($processors, $this->fixture->getProcessors());\n }", "public function test_multiple_filter_and_count() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n // This will register every time a different closure function\n yourls_add_filter( $hook, function() { global $counter; ++$counter; return rand_str(); } );\n }\n\n global $counter;\n $counter = 0;\n $filtered = yourls_apply_filter( $hook, rand_str() );\n $this->assertSame( $times, $counter );\n }", "public function operators();", "public function CheckLLMeasures_Present_Default_LL_LbAndLL_CoreAndElective_OnChecklistPreview(AcceptanceTester $I) {\n $I->amOnPage(Page\\ChecklistPreview::URL($this->id_checklist, $this->id_audSubgroup1_Energy));\n $I->wait(3);\n $I->waitForElement(\\Page\\ChecklistPreview::$ExtensionSelect);\n $I->selectOption(\\Page\\ChecklistPreview::$ExtensionSelect, \"Large Landscape\");\n $I->wait(3);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 2 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 2 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure1Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure2Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure4Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure5Desc));\n $I->canSee(\"$this->pointsMeas1 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure1Desc));\n $I->canSee(\"$this->pointsMeas2 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure2Desc));\n $I->canSee(\"$this->pointsMeas4 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure4Desc));\n $I->canSee(\"$this->pointsMeas5 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure5Desc));\n $I->wait(1);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$LeftMenu_SolidWasteGroupButton);\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "public function test_mod_lti_get_ltis_by_courses() {\n global $DB;\n\n // Create additional course.\n $course2 = self::getDataGenerator()->create_course();\n\n // Second lti.\n $record = new stdClass();\n $record->course = $course2->id;\n $lti2 = self::getDataGenerator()->create_module('lti', $record);\n\n // Execute real Moodle enrolment as we'll call unenrol() method on the instance later.\n $enrol = enrol_get_plugin('manual');\n $enrolinstances = enrol_get_instances($course2->id, true);\n foreach ($enrolinstances as $courseenrolinstance) {\n if ($courseenrolinstance->enrol == \"manual\") {\n $instance2 = $courseenrolinstance;\n break;\n }\n }\n $enrol->enrol_user($instance2, $this->student->id, $this->studentrole->id);\n\n self::setUser($this->student);\n\n $returndescription = mod_lti_external::get_ltis_by_courses_returns();\n\n // Create what we expect to be returned when querying the two courses.\n // First for the student user.\n $expectedfields = array('id', 'coursemodule', 'course', 'name', 'intro', 'introformat', 'introfiles', 'launchcontainer',\n 'showtitlelaunch', 'showdescriptionlaunch', 'icon', 'secureicon');\n\n // Add expected coursemodule and data.\n $lti1 = $this->lti;\n $lti1->coursemodule = $lti1->cmid;\n $lti1->introformat = 1;\n $lti1->section = 0;\n $lti1->visible = true;\n $lti1->groupmode = 0;\n $lti1->groupingid = 0;\n $lti1->introfiles = [];\n\n $lti2->coursemodule = $lti2->cmid;\n $lti2->introformat = 1;\n $lti2->section = 0;\n $lti2->visible = true;\n $lti2->groupmode = 0;\n $lti2->groupingid = 0;\n $lti2->introfiles = [];\n\n foreach ($expectedfields as $field) {\n $expected1[$field] = $lti1->{$field};\n $expected2[$field] = $lti2->{$field};\n }\n\n $expectedltis = array($expected2, $expected1);\n\n // Call the external function passing course ids.\n $result = mod_lti_external::get_ltis_by_courses(array($course2->id, $this->course->id));\n $result = external_api::clean_returnvalue($returndescription, $result);\n\n $this->assertEquals($expectedltis, $result['ltis']);\n $this->assertCount(0, $result['warnings']);\n\n // Call the external function without passing course id.\n $result = mod_lti_external::get_ltis_by_courses();\n $result = external_api::clean_returnvalue($returndescription, $result);\n $this->assertEquals($expectedltis, $result['ltis']);\n $this->assertCount(0, $result['warnings']);\n\n // Unenrol user from second course and alter expected ltis.\n $enrol->unenrol_user($instance2, $this->student->id);\n array_shift($expectedltis);\n\n // Call the external function without passing course id.\n $result = mod_lti_external::get_ltis_by_courses();\n $result = external_api::clean_returnvalue($returndescription, $result);\n $this->assertEquals($expectedltis, $result['ltis']);\n\n // Call for the second course we unenrolled the user from, expected warning.\n $result = mod_lti_external::get_ltis_by_courses(array($course2->id));\n $this->assertCount(1, $result['warnings']);\n $this->assertEquals('1', $result['warnings'][0]['warningcode']);\n $this->assertEquals($course2->id, $result['warnings'][0]['itemid']);\n\n // Now, try as a teacher for getting all the additional fields.\n self::setUser($this->teacher);\n\n $additionalfields = array('timecreated', 'timemodified', 'typeid', 'toolurl', 'securetoolurl',\n 'instructorchoicesendname', 'instructorchoicesendemailaddr', 'instructorchoiceallowroster',\n 'instructorchoiceallowsetting', 'instructorcustomparameters', 'instructorchoiceacceptgrades', 'grade',\n 'resourcekey', 'password', 'debuglaunch', 'servicesalt', 'visible', 'groupmode', 'groupingid');\n\n foreach ($additionalfields as $field) {\n $expectedltis[0][$field] = $lti1->{$field};\n }\n\n $result = mod_lti_external::get_ltis_by_courses();\n $result = external_api::clean_returnvalue($returndescription, $result);\n $this->assertEquals($expectedltis, $result['ltis']);\n\n // Admin also should get all the information.\n self::setAdminUser();\n\n $result = mod_lti_external::get_ltis_by_courses(array($this->course->id));\n $result = external_api::clean_returnvalue($returndescription, $result);\n $this->assertEquals($expectedltis, $result['ltis']);\n\n // Now, prohibit capabilities.\n $this->setUser($this->student);\n $contextcourse1 = context_course::instance($this->course->id);\n // Prohibit capability = mod:lti:view on Course1 for students.\n assign_capability('mod/lti:view', CAP_PROHIBIT, $this->studentrole->id, $contextcourse1->id);\n // Empty all the caches that may be affected by this change.\n accesslib_clear_all_caches_for_unit_testing();\n course_modinfo::clear_instance_cache();\n\n $ltis = mod_lti_external::get_ltis_by_courses(array($this->course->id));\n $ltis = external_api::clean_returnvalue(mod_lti_external::get_ltis_by_courses_returns(), $ltis);\n $this->assertCount(0, $ltis['ltis']);\n }", "public function testMultipleResultQuery() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID in (\\'uuid1tRMR1\\',\\'uuid1tRMR2\\',\\'uuid1tRMR3\\')';\r\n $pos = $this->getPersistenceAdapter()->executeMultipleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n $this->assertEquals(count($records), count($pos), 'Wrong number of database records found.');\r\n for($i = 0; $i < count($pos); $i++) {\r\n $this->assertEquals($records[$i]['UUID'], $pos[$i]->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($records[$i]['bool'], $pos[$i]->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($records[$i]['int'], $pos[$i]->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($records[$i]['string'], $pos[$i]->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }\r\n }", "public function laptops()\n {\n return static::randomElement(static::$laptops);\n }", "public function passes();", "public function testForEach()\n {\n }", "public function testJobListPreparationAndReleaseTaskStatus()\n {\n\n }", "public function run()\n {\n $labOrder = factory(LabOrder::class)->create();\n $SKUs = SKU::where('item_type', 'lab-test')->get()->shuffle();\n\n for ($i=0; $i < 5; $i++) {\n $labTest = factory(LabTest::class)->create([\n 'lab_order_id' => $labOrder->id,\n 'sku_id' => $SKUs->pop()->id,\n ]);\n if (maybe()) {\n factory(LabTestResult::class)->create([\n 'lab_test_id' => $labTest->id,\n ]);\n }\n }\n }", "public function testEachBatchGroupedBy()\n {\n // Create 2 groups of operations : pair > group0 and odd > group1\n $operations = [];\n for ($i = 0; $i < 100; $i++) {\n $operations['group' . ($i % 2 ? '1' : '0')][] = 'operation' . $i;\n };\n\n $instance = new BulkOperationMock($operations);\n $instance->setBatchSize(10);\n\n $count = 0;\n $instance->eachBatch(\n function ($chunk) use (&$count) {\n $count += count($chunk);\n },\n 'group1'\n );\n\n // Assert that the sum of all chuncks = number of operation in group1\n $this->assertEquals(count($operations['group1']), $count);\n }", "public function testLoaderAll()\n {\n $allItems = $this->tiresLoader->all();\n\n $this->assertContains(1,$allItems);\n $this->assertContains(2,$allItems);\n $this->assertContains(3,$allItems);\n $this->assertContains(4,$allItems);\n }", "public function testArrayReduce($code)\n {\n return (new Pipeline(new \\Illuminate\\Container\\Container()))->send($code)->through(config('piplines.lines'))->then(function($code){\n $fuck_code = array();\n array_walk($code,function(&$item,$key) use ($code,&$fuck_code){\n if($item){\n foreach ($item as $k => $v){\n if(preg_match(\"/javaCurl\\(/\", $v)){\n preg_match_all(\"/(?<=(self::)).*?(?=(\\;))/\", $item[$k-1], $result);\n if(!empty($result[0])){\n $fuck_code[$key][] = $result[0][0];\n }\n }elseif (preg_match(\"/(execute|excute)\\(/\", $v)){\n// preg_match_all(\"/self::([^()]+|(?R))*\\,/\", $item[$k], $result);\n preg_match_all(\"/(?<=((\\(|\\.)(self::|\\$\\this\\-\\>))).*?(?=(\\,))/\", $item[$k], $result);\n if(!empty($result[0])){\n $fuck_code[$key][] = $result[0][0];\n }\n }\n }\n }\n });\n if(count($fuck_code) == 0){\n dd('php no need java');\n }\n $GLOBALS['pipline'] = $fuck_code;\n\n// if($result = collect($code)->search(function($item,$key){\n// return strpos($item,'acquire') !== false;\n// })){\n// $GLOBALS['pipline'] = $code[$result];\n// }else{\n// return 'php no need java';\n// }\n });\n }", "public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }", "public function getAllPipelines() \n\t{\n\t\t$requestor \t= new \\Streak\\ApiRequestor();\n\t\t$endpoint \t= \"/v1/pipelines\";\n\t\t$data \t\t= $requestor->request($endpoint);\n return $data;\n\t}", "public function testGetImportedWorkflowsMany()\n {\n // Pretend some ImportedWorkflowTemplate objects have been created by WorkflowBulkLoader\n $this->objFromFixture(ImportedWorkflowTemplate::class, 'Import02');\n $this->objFromFixture(ImportedWorkflowTemplate::class, 'Import03');\n\n $importer = singleton(WorkflowDefinitionImporter::class);\n $imports = $importer->getImportedWorkflows();\n\n $this->assertNotEmpty($imports);\n $this->assertIsArray($imports);\n $this->assertGreaterThan(1, count($imports ?? []));\n }", "public function test()\n {\n\n //获得大类步骤($step类型为obj数组)\n $step = BuildingCheckResultModel::where('FK_Equipment_Id', '=', 208)->where('level', '=', 1)->select();\n //小类步骤\n $little_step = array();\n for ($i = 0; $i < count($step); $i++) {\n $little_step[$i] = BuildingCheckResultModel::where('FK_Equipment_Id', '=', 208)->where('parentID', '=', $step[$i]->basic_equ_id)->where('level', '=', 2)->select();\n }\n\n dump($step);\n echo \"++++++++++++++++++++++++++++++++++++<br>\";\n\n dump($little_step);\n\n }", "function convert_pnml_to_lola($pnml_filename) {\n global $output;\n \n $return_code = null;\n $process_output = [];\n \n exec($petri . \" -ipnml -olola \".$pnml_filename, $process_output, $return_code);\n if ($return_code != 0) {\n foreach ($process_output as $line) {\n $output[\"petri_output\"][] = htmlspecialchars($line);\n }\n terminate(\"petri exited with status \" . $return_code . \" -- probably the input is malformed.\");\n }\n \n $lola_filename = $pnml_filename . \".lola\";\n return $lola_filename;\n }", "static function logicalAnd()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalAnd', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function testChaining(){\n\t\t#mdx:chaining\n\t\tParam::get('number')\n\t\t\t->filters()\n\t\t\t\t->strip('/[^\\d]/')\n\t\t\t\t->required()\n\t\t\t\t->minlen(5)\n\t\t\t\t->maxlen(10);\n\n\t\t$result = Param::get('number')->process([\n\t\t\t'number' => '203-40-10/80'\n\t\t]);\n\t\t#/mdx var_dump($result->output)\n\t\t$this->assertEquals('203401080',$result->output);\n\n\t}", "public function test_all() {\n $obj = new My_task;\n \n echo \"Start test_reverse() <br>\";\n $obj->test_reverse();\n echo \"<br><br>\";\n \n echo \"Start test_is_palindrome() <br>\";\n $obj->test_is_palindrome();\n echo \"<br><br>\";\n \n echo \"Start test_encryption() <br>\";\n $obj->test_encryption(); \n echo \"<br><br>\";\n }", "public function testGetLowStockByFilter()\n {\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n { ///bunlar zamanlanmış epostalar\n $scenarios = [\n [ //kullanıcı sepette ürün unuttuktan 3 gün sonra eposta\n 'name' => 'your_cart_waiting',\n 'trigger' => [\n 'waited_cart' => [\n 'delay' => \"-1 days\",\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [ // kullanıcı kayıt olup alışveriş yapmadıktan 3 gün sonra\n 'name' => 'do_you_want_product',\n 'trigger' => [\n 'register' => [\n 'delay' => '-3 days',\n 'purchase' => false\n ]\n ],\n 'notifiers' => [\n 'mail', 'sms'\n ]\n ],\n [\n 'name' => 'referral_request',\n 'trigger' => [\n 'register' => [\n 'delay' => '-1 week',\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [\n 'name' => 'promotion_code',\n 'trigger' => [\n 'register' => [\n 'delay' => '-2 weeks',\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [// kullanıcı alışveriş tamamladıktan 1 hafta sonra alışveriş anketi\n 'name' => 'do_you_like_it',\n 'trigger' => [\n 'purchase' => [\n 'delay' => '-1 week'\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [\n 'name' => 'thank_you_for_your_response',\n 'trigger' => [\n 'pool_response' => [\n 'delay' => 0,\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [// kullanıcı alışveriş tamamladıktan 1 ay sonra başka şey de al\n 'name' => 'you_can_try_this',\n 'trigger' => [\n 'purchase' => [\n 'delay' => '-1 month',\n ]\n ],\n 'notifiers' => [\n 'mail'\n ]\n ],\n [//yeni blog içeriği yazıldığı anda\n 'name' => 'new_blog_post',\n 'trigger' => [\n 'new_post' => [\n 'delay' => 0\n ]\n ],\n 'notifiers' => [\n 'mail', 'push'\n ]\n ]\n ];\n foreach ($scenarios as $scenario) {\n $keys = array_keys($scenario['trigger']);\n /** @var TriggerInterface $service */\n $service = $this->container->get(sprintf('workouse.trigger.%s', $keys[0]));\n $service->setDelayString($scenario['trigger'][$keys[0]]['delay']);\n $customers = $service->getCustomers();\n foreach ($customers as $customer) {\n foreach ($scenario['notifiers'] as $notifier) {\n\n if (!($customer instanceof CustomerInterface)) {\n continue;\n }\n //control\n $notification = $service->getNotification($customer, $notifier);\n $envelope = new Envelope($notification);\n $this->bus->dispatch($envelope);\n }\n }\n }\n }", "public function test_getReplenishmentProcessByFilter() {\n\n }", "public function testAllPrecedencesHasNoGaps()\n {\n $levels = array();\n $min = false;\n $max = false;\n foreach ( $this->operators as $operator )\n {\n $levels[$operator->precedence] = true;\n if ( $max === false ||\n $operator->precedence > $max )\n $max = $operator->precedence;\n if ( $min === false ||\n $operator->precedence < $min )\n $min = $operator->precedence;\n }\n ksort( $levels );\n self::assertThat( count( $levels ), self::greaterThan( 1 ), \"Level list did not even fill two items\" );\n for ( $i = $min; $i <= $max; ++$i )\n {\n // We skip level 2 which is the ?: operator which is not supported\n if ( $i == 2 )\n {\n continue;\n }\n $this->assertArrayHasKey( $i, $levels );\n }\n }", "public function testCheck()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->check('128.232.234.256');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 2. Check denied list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.44');\n $t = $ipComponent->check('127.0.55.44');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 3. Check allowed list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setAllowedItem('39.9.197.241');\n $t = $ipComponent->check('39.9.197.241');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 4. Check IP is if in denied IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 5. Check IP is if in allowed IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $ipComponent->setAllowedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 6. Test denyAll\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->denyAll();\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n }", "public function testMultipleComposite()\n {\n $composite = $this->parser->parse('\n $and: [\n { benchmark: \"foobar\" },\n { number: { $gt: 2015 } },\n { name: \"daniel\" }\n ]\n ');\n\n $this->assertEquals(\n new Composite(\n '$and',\n new Composite(\n '$and',\n new Comparison('$eq', 'benchmark', 'foobar'),\n new Comparison('$gt', 'number', 2015)\n ),\n new Comparison('$eq', 'name', 'daniel')\n ),\n $composite\n );\n\n $composite = $this->parser->parse('\n $and: [\n { benchmark: \"foobar\" },\n { number: { $gt: 2015 } },\n { name: \"daniel\" },\n { barbar: \"booboo\" }\n ]\n ');\n\n $this->assertEquals(\n new Composite(\n '$and',\n new Composite(\n '$and',\n new Composite(\n '$and',\n new Comparison('$eq', 'benchmark', 'foobar'),\n new Comparison('$gt', 'number', 2015)\n ),\n new Comparison('$eq', 'name', 'daniel')\n ),\n new Comparison('$eq', 'barbar', 'booboo')\n ),\n $composite\n );\n }", "public function testlOrSingleImpl()\n {\n $this->q->select( '*' )->from( 'query_test' )\n ->where( $this->e->lOr( $this->e->eq( 1, 1 ) ) );\n $stmt = $this->db->query( $this->q->getQuery() );\n $rows = 0;\n foreach ( $stmt as $row )\n {\n $rows++;\n }\n $this->assertEquals( 4, $rows );\n }", "public function testPrecedenceIsInValidRange()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::greaterThan( 0 ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be 1 or higher.\" );\n }\n }", "public function testGetOperationsFromArrayOfFilters() {\n $array = [];\n $operations = \\Depotwarehouse\\Toolbox\\Operations\\get_operations_from_array_of_filters($array);\n $this->assertEmpty($operations);\n\n // test with multiple operations\n $array = [ 'some_obj:mock_key' => '<9', 'other_key' => '=farts'];\n $operations = \\Depotwarehouse\\Toolbox\\Operations\\get_operations_from_array_of_filters($array);\n $this->assertEquals(2, count($operations));\n $this->assertAttributeEquals([ 'some_obj'], 'include_path', $operations[0]);\n $this->assertAttributeEquals('mock_key', 'key', $operations[0]);\n\n $this->assertAttributeEquals([], 'include_path', $operations[1]);\n $this->assertAttributeEquals('other_key', 'key', $operations[1]);\n }", "public function testMergeParams()\n {\n $instance = $this->getMockForTrait(DuplicationComponent::class);\n $reflex = new \\ReflectionClass($instance);\n\n $mergeParam = $reflex->getMethod('mergeParam');\n $mergeParam->setAccessible(true);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n false\n );\n $this->getTestCase()->assertEquals(['hello'=>'torvald', 'hella' => 'warld'], $result);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n true\n );\n $this->getTestCase()->assertEquals(['hello' => 'torvald'], $result);\n }", "public function testPs()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(), 'ok');\n }", "public function test_pay_calledWithSeveralPaymentsProviders_returnTheSecondPaymentProviderInCollection()\n {\n $expected = new RoyalPayPaymentProvider(new RoyalPayConfig('',''));\n list($paymentsCollection, $wirecardStrategy, $wirecardProvider, $royalPayStrategy, $royalPayProvider, $user, $order, $credit_card) = $this->preparePaymentsCollection();\n $wirecardStrategy->get()->willReturn($wirecardProvider);\n $wirecardProvider->getName()->willReturn('wirecard');\n $wirecardProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $royalPayStrategy->get()->willReturn($royalPayProvider);\n $royalPayProvider->getName()->willReturn('royalpay');\n $royalPayProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(true, $expected));\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payFromProviderCollections($paymentsCollection,$user,$order,$credit_card);\n $this->assertInstanceOf('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentProvider',$actual->returnValues());\n }", "public function testGetLabelAndLanguageListEx() {\n try {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLanguageStringBySrcTargetAndLanguageGroupId')\n ->will($this->throwException(New DaoException()));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLabelAndLanguageList('s_lang_id', 't_lang_id', 'group_id');\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "public function test_scenario3() {\n $data = array(array('filename' => 'data/diabetes.csv',\n 'local_file' => 'tmp/batch_predictions_c.csv',\n 'predictions_file' => 'data/batch_predictions_c.csv'));\n\n\n foreach($data as $item) {\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source'));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"check the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create a cluster\\n\";\n $cluster = self::$api->create_cluster($dataset->resource, array('seed'=>'BigML', 'cluster_seed'=> 'BigML', 'k' => 8));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $cluster->code);\n $this->assertEquals(BigMLRequest::QUEUED, $cluster->object->status->code);\n\n print \"I wait until the cluster is ready \" . $cluster->resource . \"\\n\";\n $resource = self::$api->_check_resource($cluster->resource, null, 50000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n \n print \"I create a batch prediction cluster\\n\";\n $batch_prediction=self::$api->create_batch_centroid($cluster, $dataset);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $batch_prediction->code);\n\n print \"check a batch_predicion is ready\\n\";\n $resource = self::$api->_check_resource($batch_prediction, null, 50000, 50);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"download batch predictions file\\n\";\n $filename = self::$api->download_batch_centroid($batch_prediction, $item[\"local_file\"]);\n $this->assertNotNull($filename);\n\n print \"i compare the prediction file is correct\\n\";\n $this->assertTrue(compareFiles($item[\"local_file\"], $item[\"predictions_file\"]));\n\n }\n }", "function test_3() {\n\t$res = gather(function() {\n\t\ttake(1);\n\t\ttake(2);\n\t\tif (!gathered()) {\n\t\t\ttake(3);\n\t\t}\n\t});\n\treturn is_deeply($res, array(1, 2), 'gathered detects some gather');\n}", "public function splitCalcDataProvider() {}", "public function test_pay_calledWithSeveralPaymentsProviders_returnPaymentProviderResultFalse()\n {\n $expected = new RoyalPayPaymentProvider(new RoyalPayConfig('',''));\n $paymentsCollection = new PaymentsCollection();\n $wirecardStrategy = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\WideCardPaymentStrategy');\n $wirecardProvider = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\WideCardPaymentProvider');\n $royalPayStrategy = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentStrategy');\n $royalPayProvider = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentProvider');\n $paymentsCollection->addItem('WideCardPaymentStrategy', $wirecardStrategy->reveal());\n $paymentsCollection->addItem('RoyalPayPaymentStrategy', $royalPayStrategy->reveal());\n $user = UserMother::aUserWith50Eur()->build();\n $order = OrderMother::aJustOrder()->buildANewWay();\n $credit_card = CreditCardMother::aValidCreditCard();\n $wirecardStrategy->get()->willReturn($wirecardProvider);\n $wirecardProvider->getName()->willReturn('wirecard');\n $wirecardProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $royalPayStrategy->get()->willReturn($royalPayProvider);\n $royalPayProvider->getName()->willReturn('royalpay');\n $royalPayProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payFromProviderCollections($paymentsCollection,$user,$order,$credit_card);\n $this->assertEquals(false,$actual->success());\n }", "public function runTests()\n {\n $this->testCase(1, array (1, 1));\n $this->testCase(2, array (1, 2));\n $this->testCase(3, array (2, 2));\n $this->testCase(4, array (2, 2));\n $this->testCase(5, array (2, 3));\n $this->testCase(6, array (2, 3));\n $this->testCase(7, array (3, 3));\n $this->testCase(8, array (3, 3));\n $this->testCase(9, array (3, 3));\n $this->testCase(10, array(2, 5));\n $this->testCase(11, array(3, 4));\n $this->testCase(12, array(3, 4));\n $this->testCase(13, array(4, 4));\n $this->testCase(14, array(4, 4));\n $this->testCase(15, array(4, 4));\n $this->testCase(16, array(4, 4));\n $this->testCase(17, array(3, 6));\n $this->testCase(18, array(3, 6));\n $this->testCase(19, array(4, 5));\n $this->testCase(20, array(4, 5));\n $this->testCase(21, array(3, 7));\n $this->testCase(22, array(5, 5));\n $this->testCase(23, array(5, 5));\n $this->testCase(24, array(5, 5));\n $this->testCase(25, array(5, 5));\n $this->testCase(26, array(4, 7));\n $this->testCase(27, array(4, 7));\n $this->testCase(28, array(4, 7));\n $this->testCase(29, array(5, 6));\n $this->testCase(30, array(5, 6));\n $this->testCase(31, array(4, 8));\n $this->testCase(32, array(4, 8));\n $this->testCase(33, array(6, 6));\n $this->testCase(34, array(6, 6));\n $this->testCase(35, array(6, 6));\n $this->testCase(36, array(6, 6));\n $this->testCase(37, array(5, 8));\n $this->testCase(38, array(5, 8));\n $this->testCase(39, array(5, 8));\n $this->testCase(40, array(5, 8));\n $this->testCase(41, array(6, 7));\n $this->testCase(42, array(6, 7));\n $this->testCase(43, array(5, 9));\n $this->testCase(44, array(5, 9));\n $this->testCase(45, array(5, 9));\n $this->testCase(46, array(7, 7));\n $this->testCase(47, array(7, 7));\n $this->testCase(48, array(7, 7));\n $this->testCase(49, array(7, 7));\n $this->testCase(50, array(5, 10));\n $this->testCase(51, array(6, 9));\n $this->testCase(52, array(6, 9));\n $this->testCase(53, array(6, 9));\n $this->testCase(54, array(6, 9));\n $this->testCase(55, array(7, 8));\n $this->testCase(56, array(7, 8));\n $this->testCase(57, array(6, 10));\n $this->testCase(58, array(6, 10));\n $this->testCase(59, array(6, 10));\n $this->testCase(60, array(6, 10));\n $this->testCase(61, array(8, 8));\n $this->testCase(62, array(8, 8));\n $this->testCase(63, array(8, 8));\n $this->testCase(64, array(8, 8));\n $this->testCase(65, array(6, 11));\n $this->testCase(66, array(6, 11));\n $this->testCase(67, array(7, 10));\n $this->testCase(68, array(7, 10));\n $this->testCase(69, array(7, 10));\n $this->testCase(70, array(7, 10));\n $this->testCase(71, array(8, 9));\n $this->testCase(72, array(8, 9));\n $this->testCase(73, array(7, 11));\n $this->testCase(74, array(7, 11));\n $this->testCase(75, array(7, 11));\n $this->testCase(76, array(7, 11));\n $this->testCase(77, array(7, 11));\n $this->testCase(78, array(9, 9));\n $this->testCase(79, array(9, 9));\n $this->testCase(80, array(9, 9));\n $this->testCase(81, array(9, 9));\n $this->testCase(82, array(7, 12));\n $this->testCase(83, array(7, 12));\n $this->testCase(84, array(7, 12));\n $this->testCase(85, array(8, 11));\n $this->testCase(86, array(8, 11));\n $this->testCase(87, array(8, 11));\n $this->testCase(88, array(8, 11));\n $this->testCase(89, array(9, 10));\n $this->testCase(90, array(9, 10));\n $this->testCase(91, array(7, 13));\n $this->testCase(92, array(8, 12));\n $this->testCase(93, array(8, 12));\n $this->testCase(94, array(8, 12));\n $this->testCase(95, array(8, 12));\n $this->testCase(96, array(8, 12));\n $this->testCase(97, array(10, 10));\n $this->testCase(98, array(10, 10));\n $this->testCase(99, array(10, 10));\n $this->testCase(100, array(10, 10));\n }", "public function testReglas()\n {\n #regla1\n $obj = new Evaluacion();\n $response = $obj->validar(1);\n $this->assertEquals(true,$response);\n\n $response = $obj->validar(0);\n $this->assertEquals(false,$response);\n\n #regla2\n $response = $obj->validar_mecanica(3);\n $this->assertEquals(true,$response);\n\n $response = $obj->validar_mecanica(2);\n $this->assertEquals(true,$response);\n\n $response = $obj->validar_mecanica(1);\n $this->assertEquals(false,$response);\n\n #regla3\n $response = $obj->validar_frecuencia(31);\n $this->assertEquals(true,$response);\n\n $response = $obj->validar_frecuencia(30);\n $this->assertEquals(false,$response);\n\n #regla4\n\n $response = $obj->validar_fecha('2021-12-26');\n $this->assertEquals(true,$response);\n\n $response = $obj->validar_fecha('2020-12-22');\n $this->assertEquals(false,$response);\n\n #regla5\n $response = $obj->validar_oxigeno(92);\n $this->assertEquals(false,$response);\n\n $response = $obj->validar_oxigeno(100);\n $this->assertEquals(false,$response);\n\n $response = $obj->validar_oxigeno(91);\n $this->assertEquals(true,$response);\n\n #regla6\n $response = $obj->validar_porcentaje(12,10);\n $this->assertEquals(false,$response);\n\n $response = $obj->validar_porcentaje(13,10);\n $this->assertEquals(false,$response);\n\n\n }", "public function test_get_filters() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $filters = yourls_get_filters( $hook );\n $this->assertTrue(isset($filters[10]['some_function']));\n $this->assertTrue(isset($filters[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_filters( rand_str() ) );\n }", "public function testGetAllProducts()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(2, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n $this->assertNull($product->parent_product_srl);\n\n\t\t\tif($product->isConfigurable())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\t\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t\t{\n\t\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($product->isSimple())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\t}", "public function testPsWithTwoComposeFilesSpecified()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(['docker-compose.yml', 'docker-compose.test.yml']), 'ok');\n }", "public function test_do_action_several_times_and_count() {\n $hook = rand_str();\n $this->assertSame( 0, yourls_did_action( $hook ) );\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_do_action( $hook );\n }\n\n $this->assertSame( $times, yourls_did_action( $hook ) );\n\t}", "public function processOrCombination($collection, $conditions)\n {\n $fieldsConditions = [];\n $multiFieldsConditions = [];\n foreach ($conditions as $condition) {\n $attribute = $condition['attribute'];\n $cond = $condition['conditions'];\n $value = $condition['cvalue'];\n\n //ignore condition if value is null or empty\n if ($value == '' || $value == null) {\n continue;\n }\n\n if ($this->ruleType == self::REVIEW && isset($this->attributeMapForQuote[$attribute])) {\n $attribute = $this->attributeMapForOrder[$attribute];\n } elseif ($this->ruleType == self::ABANDONED && isset($this->attributeMapForOrder[$attribute])) {\n $attribute = $this->attributeMapForQuote[$attribute];\n } else {\n $this->productAttribute[] = $condition;\n continue;\n }\n\n if ($cond == 'null') {\n if ($value == '1') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = ['notnull' => true];\n continue;\n }\n $fieldsConditions[$attribute] = ['notnull' => true];\n } elseif ($value == '0') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$cond => true];\n continue;\n }\n $fieldsConditions[$attribute] = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$this->conditionMap[$cond] => $value];\n continue;\n }\n $fieldsConditions[$attribute]\n = [$this->conditionMap[$cond] => $value];\n }\n }\n /**\n * All rule conditions are combined into an array to yield an OR when passed\n * to `addFieldToFilter`. The exception is any 'like' or 'nlike' conditions,\n * which must be added as separate filters in order to have the AND logic.\n */\n if (!empty($fieldsConditions)) {\n $column = $cond = [];\n foreach ($fieldsConditions as $key => $fieldsCondition) {\n $type = key($fieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $fieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $fieldsCondition;\n }\n if (!empty($multiFieldsConditions[$key])) {\n foreach ($multiFieldsConditions[$key] as $multiFieldsCondition) {\n $type = key($multiFieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $multiFieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $multiFieldsCondition;\n }\n }\n }\n }\n if (!empty($column) && !empty($cond)) {\n $collection->addFieldToFilter(\n $column,\n $cond\n );\n }\n }\n return $this->processProductAttributes($collection);\n }", "public function testSortPreprocessors()\n {\n $preprocess = new TestProfilePreprocess(new Container(), array());\n $info = $preprocess->getPreprocessors(array(\n 'a' => array(),\n 'b' => array('priority' => 1),\n 'c' => array('priority' => -1),\n 'd' => array(),\n ));\n $this->assertEquals(array('c', 'a', 'd', 'b'), $info);\n }", "public function testOoCanSetGetParameters()\n {\n $mainCommand = 'ls';\n $parameters = [new Command\\Parameter('/usr/local/bin'), new Command\\Parameter('../')];\n $command = $this->createInstance($mainCommand);\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n $this->assertEquals($parameters, $command->getParameters(), 'Must be able to get and set multiple parameter objects');\n }", "public function dataprovider_learningobjectives() {\n // Array for storing our runs.\n $runs = array();\n\n // Records that we will be re-using.\n $sufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $sufficientgraderecordcompleted = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'locked' => 1\n );\n $insufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 0,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n\n $sufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0\n );\n $insufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 0,\n 'locked' => 0\n );\n\n // Arrays specifying user ids.\n $firstuser = array('userid' => 103);\n $seconduser = array('userid' => 104);\n\n /*\n * run with sufficient enrolment grade but insufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with an insufficient grade.\n $logrades = array();\n $logrades[] = array_merge($insufficientlograderecord, $firstuser);\n $logrades[] = array_merge($insufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecord, $seconduser);\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with insufficient enrolment grade but sufficient required LO grade\n */\n\n // Each user has an enrolment record with an insufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with sufficient enrolment grade and sufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching passed and locked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n // Return all data.\n return $runs;\n }", "public function testReadingLapsOfParticipants()\n {\n // Get participants\n $participants = $this->getWorkingReader()->getSession()\n ->getParticipants();\n\n // Get the laps of first participants\n $laps = $participants[0]->getLaps();\n\n // Validate we have 7 laps\n $this->assertSame(5, count($laps));\n\n // Get driver of first participant (only one cause there are no swaps)\n $driver = $participants[0]->getDriver();\n\n // Get first lap only\n $lap = $laps[0];\n\n // Validate laps\n $this->assertSame(1, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(173.883, $lap->getTime());\n $this->assertSame(0, $lap->getElapsedSeconds());\n $this->assertSame($participants[0], $lap->getParticipant());\n $this->assertSame($driver, $lap->getDriver());\n\n // Get sector times\n $sectors = $lap->getSectorTimes();\n\n // Validate sectors\n $this->assertSame(69.147, $sectors[0]);\n $this->assertSame(64.934, $sectors[1]);\n $this->assertSame(39.802, $sectors[2]);\n\n // Second lap\n $lap = $laps[1];\n $this->assertSame(2, $lap->getNumber());\n $this->assertSame(1, $lap->getPosition());\n $this->assertSame(142.660, $lap->getTime());\n $this->assertSame(173.883, $lap->getElapsedSeconds());\n\n // Validate extra positions\n $laps = $participants[3]->getLaps();\n $this->assertSame(6, $laps[0]->getPosition());\n $this->assertSame(6, $laps[1]->getPosition());\n }", "public function testPreprocessingBinarizeAdvanced()\n {\n }", "public function testChainedPaymentShopIdInEachReciever()\n {\n $applane_integration = new ApplaneIntegrationControllerTest();\n $user_info = $applane_integration->getLoginUser();\n $access_token = $user_info['access_token'];\n $user_id = $user_info['user_id'];\n $type = $this->getContainer()->getParameter('chained_payment_fee_payer');\n $shop_id = $this->getContainer()->getParameter('chained_payment_eachreciever_shop_id');\n $item_type = $this->getContainer()->getParameter('item_type_shop');\n $paypal_service = $this->getContainer()->get('paypal_integration.payment_transaction');\n $fee_payer = $paypal_service->getPaypalFeePayer($type,$shop_id,$item_type);\n $expected_fee_payer = $this->getContainer()->getParameter('eachreciever');\n \n $this->assertEquals($expected_fee_payer,$fee_payer);\n }" ]
[ "0.5466165", "0.51496124", "0.50858086", "0.5059668", "0.5043833", "0.49742815", "0.49634188", "0.49576932", "0.4937392", "0.48922756", "0.48117858", "0.4807768", "0.4761462", "0.4754201", "0.47447985", "0.47058675", "0.46747875", "0.4665316", "0.4664729", "0.46558765", "0.4642116", "0.46229482", "0.4615809", "0.45972008", "0.45940393", "0.45797", "0.45722604", "0.45716384", "0.45620355", "0.453804", "0.4534133", "0.4531789", "0.45317453", "0.45225024", "0.45218867", "0.45217174", "0.45180827", "0.4502405", "0.4496582", "0.44918185", "0.44753173", "0.44678608", "0.44656903", "0.443645", "0.4427927", "0.4402118", "0.4371338", "0.4349825", "0.43269774", "0.4322972", "0.43222514", "0.43186486", "0.43148634", "0.43058813", "0.43029362", "0.42897537", "0.42890894", "0.4281854", "0.42713293", "0.4269776", "0.42693612", "0.42676824", "0.42543283", "0.4246295", "0.4242704", "0.42412785", "0.4240902", "0.42389286", "0.42365873", "0.42283046", "0.422696", "0.42258096", "0.42115", "0.42114514", "0.42090413", "0.42028657", "0.42005283", "0.41949525", "0.4194236", "0.4185138", "0.4178495", "0.41744354", "0.41722655", "0.41708833", "0.41688466", "0.41680878", "0.41664422", "0.4159938", "0.41590616", "0.41568762", "0.41567546", "0.4155416", "0.41546014", "0.41515598", "0.4151537", "0.41477203", "0.4145725", "0.41442588", "0.41391838", "0.4131054" ]
0.5900646
0
Show the form for creating a new resource.
public function create() { return view('admin.said.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request,[ 'name' => 'required|max:200', 'desc' => 'required', 'image' => 'required|image', ],[ 'name.required' => 'يجب أن تقوم بإدخال الاسم كاملاً للمقيم رجاءً', 'name.max' => 'الاسم كاملاً يجب أن لا يزيد عن 200 حرف', 'desc.required' => 'يجب أن تقوم بإدخال الوصف للتقييم رجاءً', 'image.required' => 'يجب أن تقوم بإدراج صورة شخصية للعضو', 'image.image' => 'يجب أن تكون الصورة المرفوعة من نوع صورة', ]); $said = new Said; if($request->hasFile('image')){ $featured = $request->image; $featured_new_name = time().$featured->getClientOriginalName(); $featured->move('uploads' , $featured_new_name); $said->image = '/uploads/' . $featured_new_name; } $said->name = serialize($request->name); $said->desc = serialize($request->desc); $said->save(); Session::flash('success', 'تمت إضافة التقييم بنجاح'); return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\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()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "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}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\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->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\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 viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $said = Said::find($id); $name = $said->name; $desc = $said->desc; return view('admin.said.edit',compact('name','desc','id')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request,[ 'name' => 'required|max:200', 'desc' => 'required', 'image' => 'image', ],[ 'name.required' => 'يجب أن تقوم بإدخال الاسم كاملاً للمقيم رجاءً', 'name.max' => 'الاسم كاملاً يجب أن لا يزيد عن 200 حرف', 'desc.required' => 'يجب أن تقوم بإدخال الوصف للتقييم رجاءً', 'image.image' => 'يجب أن تكون الصورة المرفوعة من نوع صورة', ]); $said = Said::find($id); if($request->hasFile('image')){ $featured = $request->image; $featured_new_name = time().$featured->getClientOriginalName(); $featured->move('uploads' , $featured_new_name); $said->image = '/uploads/' . $featured_new_name; } $said->name = serialize($request->name); $said->desc = serialize($request->desc); $said->save(); Session::flash('success', 'تمت تحديث بيانات التقييم بنجاح'); return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $said = Said::find($id); $said->delete(); Session::flash('success', 'تم حذف التقييم بنجاح'); return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Created by PhpStorm. User: Jackson.Pei Date: 2020/12/1 Time: 10:32
function pdo_connect() { $dns = "mysql:host=127.0.0.1;dbname=demo"; $res = new PDO($dns, 'root', '123456'); // var_dump($res);die; return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct(){\r\r\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "private function _i() {\n }", "private function __construct () {}", "protected final function __construct() {}", "private function __() {\n }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private final function __construct() {}", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }" ]
[ "0.5856466", "0.5856466", "0.5856466", "0.5829754", "0.5829754", "0.5829754", "0.5775056", "0.57321095", "0.57321095", "0.5689851", "0.5689851", "0.56895685", "0.5661653", "0.56420684", "0.56419766", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.56166995", "0.5616654", "0.5613656", "0.5613656", "0.56014216", "0.55908275", "0.55908275", "0.55908275", "0.55908275", "0.55908275", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5589751", "0.5580942", "0.5580942", "0.5580942", "0.5580942", "0.5580942", "0.5580942", "0.5580942" ]
0.0
-1
Determine severity of the error based on the number of login attempts in last 5 minutes.
public function level() { $this->count_attempts( 300 ); switch ( TRUE ) { case ( $this->attempts > 2 && $this->attempts <= 100 ) : return Logger::NOTICE; case ( $this->attempts > 100 && $this->attempts <= 590 ) : return Logger::WARNING; case ( $this->attempts > 590 && $this->attempts <= 990 ) : return Logger::ERROR; case ( $this->attempts > 990 ) : return Logger::CRITICAL; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "public function max_login_attempts(){\n\t\t\t\n\t\t\t$username = strtolower($this->input->post('username'));\n\t\t\t\n\t\t\t$date = date(\"Y-m-d H:i:s\",time());\n\t\t\t$date = strtotime($date);\n\t\t\t$min_date = strtotime(\"-1 day\", $date);\n\t\t\t\n\t\t\t$max_date = date('Y-m-d H:i:s', time());\n\t\t\t$min_date = date('Y-m-d H:i:s', $min_date);\n\t\t\t\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('failed_logins');\n\t\t\t$this->db->where('username', $username);\n\t\t\t\n\t\t\t$this->db->where(\"attempt_time BETWEEN '$min_date' AND '$max_date'\", NULL, FALSE);\n\n\t\t\t$query = $this->db->get();\n\t\t\t\n\t\t\tif ($query->num_rows() < 3){\t\n\t\t\t\treturn TRUE;\t\n\t\t\t}else {\t\n\t\t\t\t$this->form_validation->set_message('max_login_attempts', 'You have surpassed the allowed number of login attempts in 24 hours! Please contact Customer Service!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "protected function maxLoginAttempts()\n {\n return Arr::get(static::$config, 'attempts', 5);\n }", "private function getFailedLogins() {\n $last_logins = array();\n $cron_interval = $this->config('acquia_connector.settings')->get('spi.cron_interval');\n\n if (\\Drupal::moduleHandler()->moduleExists('dblog')) {\n $result = db_select('watchdog', 'w')\n ->fields('w', array('message', 'variables', 'timestamp'))\n ->condition('w.message', 'login attempt failed%', 'LIKE')\n ->condition('w.timestamp', REQUEST_TIME - $cron_interval, '>')\n ->condition('w.message', array(\n \"UPGRADE.txt\",\n \"MAINTAINERS.txt\",\n \"README.txt\",\n \"INSTALL.pgsql.txt\",\n \"INSTALL.txt\",\n \"LICENSE.txt\",\n \"INSTALL.mysql.txt\",\n \"COPYRIGHT.txt\",\n \"CHANGELOG.txt\",\n ), 'NOT IN')\n ->orderBy('w.timestamp', 'DESC')\n ->range(0, 10)\n ->execute();\n\n foreach ($result as $record) {\n $variables = unserialize($record->variables);\n if (!empty($variables['%user'])) {\n $last_logins['failed'][$record->timestamp] = Html::escape($variables['%user']);\n }\n }\n }\n return $last_logins;\n }", "public static function userLoginFailed(){\n self::$IntelligenceService->addToIntelligenceStack(self::USER_INTELLIGENCE_LOGIN_KEY, self::USER_INTELLIGENCE_FAILED);\n }", "public function getFailedLoginsCount()\n {\n return (int) $this->getConfigValue('lockoutexpirationlogin', 0);\n }", "public function failedLoginAttempts() : int\n {\n return (isset($this->data['failed_login_attempts'])) ? (int)$this->data['failed_login_attempts'] : 0;\n }", "public function update_failed_logins(){\n\n\t}", "function get_login_failures($username,$period){\n $query = \"SELECT * FROM LOGGINS WHERE USERNAME='\" . $username . \"' && TIME>\" . (time()-$period) . \" && SUCCESS=0\"; \n $result = $this->query( $query);\n $number = $result->num_rows; \n $result->close();\t\n\n return $number;\n }", "private function loginFailed()\n {\n //Login failed...\n }", "public function getFailedLogins() : int\n {\n return $this->failed_logins;\n }", "public function maxAttempts(): int\n {\n return 5;\n }", "function errorlog_login_failed($username) {\n global $limit_login_just_lockedout;\n if ($limit_login_just_lockedout) errorlog_do_action(ERRORLOG_METHOD, 'ban');\n}", "public function tooManyFailedLogins()\n\t{\n\t\treturn $this->FailedLoginAttempts >\n\t\t\tYii::app()->params['authentication']['accountLocking']['failedLogins'];\n\t}", "function getErrorReason() {\n\t\t$days = $this->getService()->getDuration();\n\n\t\treturn sprintf( __( \"Your current login duration is the default %d days.\", \"defender-security\" ), $days );\n\t}", "public function loginAttempts()\n {\n $processReaction = $this->userEngine->prepareLoginAttempts();\n\n return __processResponse($processReaction, [],\n $processReaction['data']);\n }", "public function checkTooManyFailedAttempts()\n {\n if (! RateLimiter::tooManyAttempts($this->throttleKey(), 10)) {\n return;\n }\n\n throw new Exception(__('controller.auth.login_attempts'), 401);\n }", "public function ip_login_attempts_exceeded()\n {\n // Compare users IP address against any failed login IP addresses.\n $sql_where = array(\n $this->auth->tbl_col_user_account['failed_login_ip'] => $this->input->ip_address(),\n $this->auth->tbl_col_user_account['failed_logins'].' >= ' => $this->auth->auth_security['login_attempt_limit']\n );\n\n $query = $this->db->where($sql_where)\n ->get($this->auth->tbl_user_account);\n\n return $query->num_rows() > 0;\n }", "protected function getFailedLoginMessage()\n\t{\n\t\treturn 'These credentials do not match our records.';\n\t}", "function alt_failed_login()\n {\n return 'The login information you have entered is incorrect.';\n }", "function check_attempted_login( $user, $username, $password ) {\n if ( get_transient( 'attempted_login' ) ) {\n $datas = get_transient( 'attempted_login' );\n if ( $datas['tried'] >= 3 ) {\n $until = get_option( '_transient_timeout_' . 'attempted_login' );\n $time = time_to_go( $until );\n return new WP_Error( 'too_many_tried', sprintf( __( '<strong>ERRO</strong>: o limite de tentativas de login foi atingido, tente novamente novamente em %1$s.' ) , $time ) );\n }\n }\n return $user;\n }", "public function maxAttempts()\n {\n return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;\n }", "public function getCountAuthFailures($userid){\r\n\tglobal $pdo;\r\n\tif(empty($this->app_config['account_reactivation_time_min'])){\r\n\t\t$this->setError('Account reactivation time is not set.');\r\n\t\treturn false;\r\n\t}\r\n\ttry{\r\n\t$select = $pdo->prepare(\"SELECT count(*) AS count FROM `authentication_log`\r\n\t\tWHERE `attempted` > DATE_SUB(NOW(), INTERVAL \".$this->app_config['account_reactivation_time_min']. \" MINUTE)\r\n\t\tAND `result` = 0 AND `user_id` = ?\");\r\n\t$select->execute(array($userid));\r\n\t}\r\n\tcatch(PDOException $e){\r\n\t\t$this->setError($e->getMessage());\r\n\t\treturn false;\r\n\t}\t\r\n\t$row = $select->fetch(PDO::FETCH_ASSOC);\r\n//print_r($row);\r\n\treturn $row['count'];\r\n}", "function alert_login_failed( $username ) {\r\n $login_alerts = get_option( 'wpc_login_alerts' );\r\n\r\n if ( isset( $login_alerts['failed'] ) && '1' == $login_alerts['failed'] ) {\r\n if ( isset( $login_alerts['email'] ) && '' != $login_alerts['email'] ) {\r\n if ( username_exists( $username ) )\r\n $status = 'Incorrect Password';\r\n else\r\n $status = 'Unknown User';\r\n\r\n $subject = 'Login Failed';\r\n $body = \"\r\n User Name: \" . $username . \"\\n\r\n Description: \" . $status . \"\\n\r\n Alert From: \" . get_option( 'siteurl' ) . \"\\n\r\n IP Address: \" . $_SERVER['REMOTE_ADDR'] . \"\\n\r\n Date: \" . current_time( 'mysql' ) . \"\\n\";\r\n wp_mail( $login_alerts['email'], $subject, $body );\r\n }\r\n }\r\n }", "public function errorOccured();", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function tryUserLevelCheck(){\n if( $this->checkSessionSet() ){\n if($this->userLevelCheck()){\n\n }\n else{\n //TODO: log the user_id and activity\n redirect_invalid_user();\n }\n }\n else{\n //TODO: log the user IP information\n\n redirect_invalid_user();\n }\n }", "public function countAuthAttempts()\n {\n $previous = Mage::getSingleton('core/session')->getCCAttempts();\n\n if(!$previous)\n {\n $previous = 1;\n } else {\n $previous++;\n }\n\n Mage::getSingleton('core/session')->setCCAttempts($previous);\n }", "function login_attempts()\n {\n // delete older attempts\n $older_time = date('Y-m-d H:i:s', strtotime('-' . $this->config->item('login_max_time') . ' seconds'));\n\n $sql = \"\n DELETE FROM login_attempts\n WHERE attempt < '{$older_time}'\n \";\n\n $query = $this->db->query($sql);\n\n // insert the new attempt\n $sql = \"\n INSERT INTO login_attempts (\n ip,\n attempt\n ) VALUES (\n \" . $this->db->escape($_SERVER['REMOTE_ADDR']) . \",\n '\" . date(\"Y-m-d H:i:s\") . \"'\n )\n \";\n\n $query = $this->db->query($sql);\n\n // get count of attempts from this IP\n $sql = \"\n SELECT\n COUNT(*) AS attempts\n FROM login_attempts\n WHERE ip = \" . $this->db->escape($_SERVER['REMOTE_ADDR'])\n ;\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n $results = $query->row_array();\n $login_attempts = $results['attempts'];\n if ($login_attempts > $this->config->item('login_max_attempts'))\n {\n // too many attempts\n return FALSE;\n }\n }\n\n return TRUE;\n }", "public static function countFailedLogins($ipAddress = null, $time = null) {\n\t\t// take default values\n\t\tif ($ipAddress === null) $ipAddress = WCF::getSession()->ipAddress;\n\t\tif ($time === null) $time = (TIME_NOW - FAILED_LOGIN_TIME_FRAME);\n\t\t\n\t\t// get number of failed logins\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".WCF_N.\"_user_failed_login\n\t\t\tWHERE\tipAddress = '\".escapeString($ipAddress).\"'\n\t\t\t\tAND time > \".$time;\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\t\treturn $row['count'];\n\t}", "public function getSeverity() {}", "public function getSeverity() {}", "protected function getFailedLoginMessage()\n {\n\n $user = User::where('email',\\Request::only('email'))\n ->where('active',0)->first();\n $password = \\Request::only('password');\n\n\n\n if ($user != null){\n\n extract($password);\n\n if(\\Hash::check($password, $user->password)){\n\n return \\Lang::has('auth.active')\n ? \\Lang::get('auth.active')\n : 'Active your account.';\n }\n\n\n }else{\n\n return \\Lang::has('auth.failed')\n ? \\Lang::get('auth.failed')\n : 'These credentials do not match our records.';\n }\n }", "private function logAuthFailure($message){\t\t\t\r\n\t\t// If authentication is failed, then pass '0' while fetching logging object\r\n\t\t$this->IsAuthorised = 0;\r\n\t\t$log = ToaLogService::GetLog($this->IsAuthorised);\r\n\t\tif($log != null){\r\n\t\t $log->error($message);\r\n\t\t}\r\n\t}", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "public function resetFailedLoginAttempts()\n {\n $this->data['failed_login_attempts'] = 0;\n }", "public function checkTooManyFailedAttempts()\n {\n \n if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {\n return;\n }\n\n throw new \\Exception('IP address banned. Too many login attempts, please waite for 3 minutes and Try again!');\n }", "public static function set_error_time()\n {\n $timer = &self::$timer;\n $session_start = $timer->__set('error');\n }", "function isUserAllowedToAcess2ndLoginForm() {\n\t\t\t\tglobal $loginAttempts;\n\t\t\t\tglobal $loginForm;\n\t\t\t\t$loginAttempts = array_slice($loginAttempts, -5);\n\t\t\t\tif (count($loginAttempts) > 4) {\n\t\t\t\t\tif ($loginAttempts[0][0] === 'fail' && $loginAttempts[1][0] === 'fail' && $loginAttempts[2][0] === 'fail'&& $loginAttempts[3][0] === 'fail'&& $loginAttempts[4][0] === 'fail') {\n\n\t\t\t\t\t\t$failedLoginTime = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$failedLoginTime->modify(\"+12 hours\");\n\n\t\t\t\t\t\t//https://stackoverflow.com/questions/5906686/php-time-remaining-until-specific-time-from-current-time-of-page-load\n\t\t\t\t\t\t$now = new DateTime();\n\t\t\t\t\t\t$future_date = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$interval = $failedLoginTime->diff($now);\n\t\t\t\t\t\t$remainingTime = $interval->format(\"%h hours %i minutes %s seconds\");\n\n\n\t\t\t\t\t\t$failedDateTime = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$failedDateTime->modify(\"+12 hours\");\n\t\t\t\t\t\t$failedDateTimePlus12Hours = $failedDateTime->format(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t\tif (date(\"Y-m-d H:i:s\") < $failedDateTimePlus12Hours) {\n\t\t\t\t\t\t\techo \"You've had too many failed attempts to log in. You have <strong>\" . $remainingTime . \"</strong> till you can try again.\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $loginForm;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo $loginForm;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $loginForm;\n\t\t\t\t}\n\t\t\t}", "function ft_hook_loginfail() {}", "protected function getDisplayedLoginsCount(): int {\n return 100;\n }", "function NewFailedLoginAttempt($ip,$user) {\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $nip=strip_tags($ip);\r\n $nuser=strip_tags($user);\r\n $anyFail=$connection->query(\"select * from accessres where username='$nuser'\") or die(json_encode(array(\"err\"=>mysqli_error($connection))));\r\n //if ($anyFail->num_rows>0) {\r\n $failrow=$anyFail->fetch_assoc();\r\n $failtime=date(\"Y-m-d H:i:s\");\r\n if($failrow[\"attempt\"]==0 || $anyFail->num_rows==0) {\r\n SetAccessRestriction($nip,$nuser,$failtime,1);\r\n return true; // First time fail\r\n }\r\n elseif ($failrow[\"attempt\"]==1) { //You must change this number with fail attempt limit you'd like to \r\n SetAccessRestriction($nip,$nuser,$failtime,2);\r\n return false; //Access restricted\r\n }\r\n //}\r\n }", "public function getMaximumAttempts();", "public function trackLoginAttempts()\n {\n return $this->getBoolean('track_login_attempts');\n }", "public function getErrorCount();", "private function checkbrute() {\n $now = time();\n\n // All login attempts are counted from the past 2 hours.\n $valid_attempts = $now - (2 * 60 * 60);\n\n if ($query = $this->db->prepare(\"SELECT COUNT(*) FROM authLogins WHERE userId = ? AND time > ?\")\n ) {\n // Execute the prepared query.\n $query->execute([$this->userId, $valid_attempts]);\n\n // If there have been more than 5 failed logins\n if ($query->fetch()[0] > 5) {\n $this->isLogin = true;\n } else {\n $this->isLogin = false;\n }\n }\n\n return $this->isLogin;\n }", "public function getServerFailureLimit()\n {\n return $this->serverFailureLimit;\n }", "protected function failedToAuthenticateUserMessage(): string\n {\n return 'Unable to authenticate with invalid token.';\n }", "function getSuccessReason() {\n\t\t$days = $this->getService()->getDuration();\n\n\t\treturn sprintf( __( \"You've adjusted the default login duration to %d days.\", \"defender-security\" ), $days );\n\t}", "protected function statusCodeFail(): int\n {\n return 401;\n }", "public function maxExceptions();", "public function attempts()\n {\n return $this->sportevent ? $this->sportevent->attempts() : 1;\n }", "private function checkFailure() : void\n {\n $failure = (int) $this->session->get('failure', 0);\n $time = (int) $this->session->get('failure_time', time());\n if ($failure >= static::FAILURE) {\n if ($time >= time()) {\n throw new \\DomainException($this->i18n->t(\n 'setrun/user',\n 'Form is blocked for {min} minutes',\n ['min' => static::FAILURE_TIME / 60])\n );\n }\n $this->removeFailure();\n }\n }", "public function getMaxAttemptTimes(): int\n {\n return 3;\n }", "public function loginAttempts($userName, $option=FALSE){\n\n $blockTime = \\Phalcon\\DI::getDefault()->getShared('config')->brute->block_time * 60;\n\n $user = Users::findFirst(array('username=:username:', 'bind' => array(':username' => $userName)));\n if($user){\n $userId = $user->id;\n }else{\n // user didn't even get the user name right\n $userId = NULL;\n }\n\n $footprint = md5(\\Phalcon\\DI::getDefault()->getShared('request')->getClientAddress() . \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent());\n // if clearing attempts after successful login\n if($option == 'clear'){\n $toDelete = FailedLogins::find(array('conditions' => 'user_id=:user_id: OR time <' . (time() - 60 * 60 * 24* 365), 'bind' => array(':user_id' => $userId)));\n if(count($toDelete) > 0){\n $toDelete->delete();\n return TRUE;\n }\n }\n $captcha = FALSE;\n $block = FALSE;\n // get attempts so far\n if(is_numeric($userId)) {\n // if username was correct\n $attemptsDb = FailedLogins::find(array('conditions' => '(user_id=:user_id: OR footprint=:footprint:) AND time >' . (time() - $blockTime), 'bind' => array(':user_id' => $userId, ':footprint' => $footprint)));\n $attempts = count($attemptsDb);\n }else{\n // if username was not correct - we search on footprint only\n $attemptsDb = FailedLogins::find(array('conditions' => 'footprint=:footprint: AND time >' . (time() - $blockTime), 'bind' => array(':footprint' => $footprint)));\n $attempts = count($attemptsDb);\n }\n\n\n if($option != 'state') {\n // increment the number of attempts\n $attempts++;\n // generate record in DB\n $fail = new FailedLogins();\n $fail->user_id = $userId;\n $fail->time = time();\n $fail->ip = \\Phalcon\\DI::getDefault()->getShared('request')->getClientAddress();\n $fail->useragent = \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent();\n $fail->footprint = $footprint;\n $fail->save();\n }\n\n // carry out blocks\n if($attempts >= 1 && $attempts <= 3){\n if($option != 'state') {\n sleep($attempts * 2); // throttle speed to slow them down\n }\n }else if($attempts > 3 && $attempts < 10){\n if($option != 'state') {\n sleep($attempts); // throttle attempts for longer and longer\n }\n $captcha = TRUE; // now we start using captcha\n }else if($attempts >= 10){\n if($option != 'state') {\n sleep($attempts); // throttle attempts for longer and longer\n }\n $captcha = TRUE; // now we start using captcha\n $block = TRUE; // block the login form\n }\n return array('attempts' => $attempts, 'attempts_left' => (10 - $attempts), 'captcha' => $captcha, 'block' => $block);\n }", "public function errorCode() {}", "public function authenticate() {\r\n $db = db_connect();\r\n $statement = $db->prepare(\"select Username, Password from users WHERE Username = :name;\");\r\n $statement->bindValue(':name', $this->username);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n $hash_pwd = $rows[0]['Password'];\r\n $password = $this->password;\r\n\r\n if (!password_verify($password, $hash_pwd)) {\r\n $attempt = 1;\r\n $statement = $db->prepare(\"select * from logfail WHERE Username = :name;\");\r\n $statement->bindValue(':name', $this->username);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n $attempt_number = $rows[0]['Attempt'];\r\n\r\n if ($attempt_number >= 3) {\r\n sleep(60);\r\n $statement = $db->prepare(\"UPDATE logfail SET Attempt = :attempt WHERE Username = :user\");\r\n $statement->bindValue(':user', $this->username);\r\n $statement->bindValue(':attempt', 0);\r\n $statement->execute();\r\n $this->auth = false;\r\n } else if ($rows) {\r\n $attempt = $attempt_number + 1;\r\n $statement = $db->prepare(\"UPDATE logfail SET Attempt = :attempt WHERE Username = :user\");\r\n $statement->bindValue(':user', $this->username);\r\n $statement->bindValue(':attempt', $attempt);\r\n $statement->execute();\r\n } else {\r\n\r\n $statement1 = $db->prepare(\"INSERT INTO logfail (Username, Attempt)\"\r\n . \"VALUES (:username, :attempt); \");\r\n $statement1->bindValue(':username', $this->username);\r\n $statement1->bindValue(':attempts', $attempt);\r\n $statement1->execute();\r\n }\r\n $this->auth = false;\r\n } else {\r\n $this->auth = true;\r\n $_SESSION['username'] = $rows[0]['Username'];\r\n $_SESSION['password'] = $rows[0]['Password'];\r\n }\r\n }", "private function checkLoginAttempts(Request $request)\n {\n // the login attempts for this application. We'll key this by the username and\n // the IP address of the client making these requests into this application.\n if (\n method_exists($this, 'hasTooManyLoginAttempts') &&\n $this->hasTooManyLoginAttempts($request)\n ) {\n $this->fireLockoutEvent($request);\n\n return $this->sendLockoutResponse($request);\n }\n }", "public function isExceededAttempts()\n { \n $attempts = $this->con->prepare(\"SELECT attempts, last_attempts FROM login_attempts WHERE user_id = ? AND ip = ? \");\n $attempts->bind_param('is', $this->user_id, $this->ip);\n $attempts->execute();\n $attempts->store_result();\n $attempts->bind_result( $number_attempts, $last_attempts);\n $attempts->fetch();\n $rows_attempts = $attempts->num_rows;\n $attempts->free_result();\n $attempts->close();\n \n if( $attempts and $rows_attempts > 0)\n {\n $last_attempts = $this->calcIntervalAttempts($last_attempts);\n if($number_attempts >= self::$max_attempts and $last_attempts <= self::$time_bloq)\n {\n return self::$time_bloq - $last_attempts;\n } \n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "protected function timeRetry(): int\n {\n return 300;\n }", "private function count_attempts( $ttl = 300 ) {\n\n\t\tif ( isset( $this->attempts ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->sniff_ip();\n\t\t$ip = $this->ip_data[ 0 ];\n\n\t\t$attempts = get_site_transient( self::TRANSIENT_NAME );\n\t\tis_array( $attempts ) or $attempts = [];\n\n\t\t// Seems the first time a failed attempt for this IP\n\t\tif ( ! $attempts || ! array_key_exists( $ip, $attempts ) ) {\n\t\t\t$attempts[ $ip ] = [ 'count' => 0, 'last_logged' => 0, ];\n\t\t}\n\n\t\t$attempts[ $ip ][ 'count' ] ++;\n\t\t$this->attempts_data = $attempts;\n\n\t\t$count = $attempts[ $ip ][ 'count' ];\n\t\t$last_logged = $attempts[ $ip ][ 'last_logged' ];\n\n\t\t/**\n\t\t * During a brute force attack, logging all the failed attempts can be so expensive to put the server down.\n\t\t * So we log:\n\t\t *\n\t\t * - 3rd attempt\n\t\t * - every 20 when total attempts are > 23 && < 100 (23rd, 43rd...)\n\t\t * - every 100 when total attempts are > 182 && < 1182 (183rd, 283rd...)\n\t\t * - every 200 when total attempts are > 1182 (1183rd, 1383rd...)\n\t\t */\n\t\t$do_log =\n\t\t\t$count === 3\n\t\t\t|| ( $count < 100 && ( $count - $last_logged ) === 20 )\n\t\t\t|| ( $count < 1000 && ( $count - $last_logged ) === 100 )\n\t\t\t|| ( ( $count - $last_logged ) === 200 );\n\n\t\t$do_log and $attempts[ $ip ][ 'last_logged' ] = $count;\n\t\tset_site_transient( self::TRANSIENT_NAME, $attempts, $ttl );\n\n\t\t$this->attempts = $do_log ? $count : 0;\n\t}", "function failed_login () {\n\t\n return 'Your username and/or password is incorrect.';\n\n}", "function login_error_override() {\n\tglobal $errors;\n\t$err_codes = $errors->get_error_codes();\n\n\t// Invalid username.\n\t// Default: '<strong>ERROR</strong>: Invalid username. <a href=\"%s\">Lost your password</a>?'\n\tif ( in_array( 'invalid_username', $err_codes ) ) {\n\t\t$error = '<strong>ERROR</strong>: Invalid username.';\n\t}\n\n\t// Incorrect password.\n\t// Default: '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href=\"%2$s\">Lost your password</a>?'\n\tif ( in_array( 'incorrect_password', $err_codes ) ) {\n\t\t$error = '<strong>ERROR</strong>: The password you entered is incorrect.';\n\t}\n\n\treturn $error;\n}", "function heateor_ss_login_error_message($error){\r\n\tglobal $heateorSsLoginAttempt;\r\n\t//check if unverified user has attempted to login\r\n\tif($heateorSsLoginAttempt == 1){\r\n\t\t$error = __('Please verify your email address to login.', 'super-socializer');\r\n\t}\r\n\treturn $error;\r\n}", "public function attempts() {\n\t\treturn 0;\n\t}", "public function attempts();", "public function getLastlogin() {}", "function allError($groupid, $time){\n \t$con = new mysqli('localhost','heng','@powell135','200ok');\n \tif ($con -> connect_errno){\n \t\treturn CONNECTION_FAIL;\n \t}\n \t$query = \"select errorType, time, url, errorInfo, errorStatus, priority, username, rating, numofvote, line,id from jnjn_error where groupid = '$groupid' and time < '$time' order by time DESC limit 5\";\n \t$result = $con -> query($query);\n \t$errors = array();\n \t$i = 0;\n \twhile ($row = mysqli_fetch_array($result)) {\n \t\t$errors[] = new Error($row['errorType'],$row['time'],$row['url'],$row['errorInfo'],$row['errorStatus'],$row['priority'],$row['username'],$row['rating'],$row['numofvote'],$groupid,$row['line'],$row['id']);\n \t}\n \t$result -> close();\n \treturn $errors;\n }", "public function getLastError() {\n return $_SESSION['last_login_error'];\n }", "protected function getFailedLoginMessage()\n {\n //return Lang::has('auth.failed')\n //? Lang::get('auth.failed')\n //: '账号或密码错误';\n return '账号或密码错误';\n }", "public static function login_three_times($login) \n {\n $db = new ossim_db();\n $conn = $db->connect();\n \n $query = \"SELECT COUNT(*) \n FROM log_action \n WHERE info LIKE 'User \".$login.\" logged in' \n AND date > (SELECT MAX(date) FROM log_action WHERE info LIKE '%User \".$login.\" created' LIMIT 1)\";\n\n $clogins = $conn->GetOne($query);\n \n $db->close();\n \n if (intval($clogins) > 3) \n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function getLevel()\n {\n return $this->errorLevel;\n }", "protected function getFailedLoginMessage()\n {\n return \\Lang::has('auth.failed')\n ? \\Lang::get('auth.failed')\n : 'Email atau password anda salah';\n }", "function errorlog_is_limitlogin() {\n return defined(LIMIT_LOGIN_LOCKOUT_NOTIFY_ALLOWED);\n}", "public function onUserLoginFailed($event)\n {\n }", "protected function _handle_count_fail()\n\t{\n\t\t$count_max = mod('deposit_card')->setting('fail_count_max');\n\t\t$block_timeout = mod('deposit_card')->setting('fail_block_timeout') * 60;\n\n\t\tif (!$count_max) return;\n\n\t\t$count = model('ip')->action_count_change('deposit_card_fail', 1);\n\n\t\tif ($count >= $count_max) {\n\t\t\t$ip = t('input')->ip_address();\n\n\t\t\tmodel('ip_block')->set($ip, $block_timeout);\n\t\t\tmodel('ip')->action_count_set('deposit_card_fail', 0);\n\t\t}\n\t}", "private function logLoginFailure($account = null)\n {\n try {\n $failureAttempts = new Login;\n $failureAttempts->email = $account[0];\n $failureAttempts->timestamp = $account[1];\n if (!$failureAttempts->create()) {\n $this->logger->critical('[LOGIN] Login Failure DB didnt SAVE');\n }\n } catch (\\Exception $e) {\n $this->logger->critical('[LOGIN] Login Failure Exception - ' . $e);\n }\n }", "protected function checkLoginAttempts($email)\n\t{\n\t\t/**\n\t\t* Get attempts from DB and check with predefined field\n\t\t* All login attempts are counted from the past 1 hours. \n\t\t**/\n\t\t$login_attempts = $this->loginModel->checkAttempts($email);\n\t\tif ($login_attempts && ($login_attempts['count'] >= 4) && strtotime('-1 hour') < strtotime($login_attempts['date_modified'])) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public function getLoginAttemptStatus()\n {\n return $this->login_attempt_status;\n }", "protected function increase_attemps()\r\n {\r\n $_SESSION['ATTEMPS'] = (isset($_SESSION['ATTEMPS']) ? $_SESSION['ATTEMPS']++ : 0);\r\n $this->display_login();\r\n }", "function addFailedAttempt($UserName,$FailedCount,$UserId){\n\t\t$this->db->sql('update users set failed_logins=failed_logins+1 where username=:username');\n\t\t$this->db->addParam(\":username\",$UserName);\n\t\t$this->db->execute();\n\t\t\n\t\t//let log the entry\n\t\t$this->db->sql('insert into user_audit_login_fail (user_id,user_name,date_time,ip_address)values(:user_id,:user_name,:date_time,:ip_address)');\n\t\t$this->db->addParam(\":user_id\",$UserId);\n\t\t$this->db->addParam(\":user_name\",$UserName);\n\t\t$this->db->addParam(\":date_time\",date(\"Y-m-d H:i:s\") );\n\t\t$this->db->addParam(\":ip_address\",$_SERVER['REMOTE_ADDR']);\n\t\t$this->db->execute();\n\t\t\n\t\t//if the login failure gets to big lets lock the account and give the user a locked message\n\t\tif( $FailedCount > $this->security_max_fails_before_lock ){\n\t\t\t$this->db->sql('update users set is_locked=1,locked_message=:locked_message where username=:username');\n\t\t\t$this->db->addParam(\":username\",$UserName);\n\t\t\t$this->db->addParam(\":locked_message\",$this->security_max_fails_lock_message);\n\t\t\t$this->db->execute();\n\t\t}\n\t}", "function login($email, $password, $dbcon) {\n\t\tglobal $max_tolerate_attempts, $delay_before_login;\n\t // Using prepared Statements means that SQL injection is not possible.\n\t \n\t if ($stmt = $dbcon->prepare(\"SELECT u_id, u_last_name, u_first_name, u_password, u_salt, u_profile_picture FROM app_user WHERE u_email = ? LIMIT 1\")) { \n\t $stmt->bindParam(1, $email, PDO::PARAM_STR); // Bind \"$email\" to parameter.\n\t $stmt->execute(); // Execute the prepared query.\n\t $result = $stmt->fetch(PDO::FETCH_OBJ);\n\t $user_id = $result->u_id;\n\t $username = $result->u_last_name;\n\t $db_password = $result->u_password;\n\t $salt = $result->u_salt;\n\t $password = hash('sha512', $password.$salt); // hash the password with the unique salt.\n\t $now = time();\n\t \n\t if($stmt->rowCount() == 1) \n\t { // If the user exists\n\t \n\t \n\t $statement = $dbcon->query(\"SELECT as_banned, as_delay_login FROM Account_State WHERE as_app_user_id = $user_id\");\n\t\t\t$result = $statement->fetch(PDO::FETCH_OBJ);;\n\t\t\t$isBanned = $result->as_banned;\n\t\t\t$loginDelay = $result->as_delay_login;\n\n\t\t\tif ($isBanned == true) //check if account banned\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//write log\t\n\t\t\t\t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success, la_desc) VALUES ($user_id, $now, 'false', 'banned user trying to log')\");\n\t \t\n\t \treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($loginDelay > $now)//check if login delay is not respected\n\t\t\t{\n\t\t\t\t//write log\t\n\t \t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success, la_desc) VALUES ($user_id, $now, 'false', 'user must wait delay before login')\");\n\t \theader(\"Location: ./index.php?error=\" . urlencode(\"User must wait $delay_before_login seconds before login.\"));\n\t \texit();\n\t\t\t}\n\t \n\n\t // We check if this is a bruteforce attempt\n\t if(checkbrute($user_id, $dbcon) == true) \n\t { \n\t \n\t //add delay for the next attempt\n\t $delay = $now + ($delay_before_login);\n\t $dbcon->query(\"UPDATE Account_State SET as_delay_login = $delay WHERE as_app_user_id = $user_id\");\n\t \n\t //if brute force attempt was already tried, banned account\n\t $statement = $dbcon->query(\"SELECT as_brute_force FROM Account_State WHERE as_app_user_id = $user_id\");\n\t\t\t\t$result = $statement->fetch(PDO::FETCH_OBJ);\n\t\t\t\t$bruteforceCount = $result->as_brute_force;\n\t\t\t\t$dbcon->query(\"UPDATE Account_State SET as_brute_force = $bruteforceCount+1 WHERE as_app_user_id = $user_id\");\n\n\t\t\t\t//we ban the user at 2 brute force and change the password\n\t if ($bruteforceCount > 1) {\n\t \t$dbcon->query(\"UPDATE Account_State SET as_banned = 'true' WHERE as_app_user_id = $user_id\");\n\t \t//write log\n\t \t\t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success, la_desc) VALUES ($user_id, $now, 'false', '2 brute force : user is permanently banned')\");\n\n\n\t \t\t//change the password\n\t \t\t$newPass = hash('sha512', 'banned');\n\t \t\t$newPass = hash('sha512', $newPass.$salt);\n\t \t\t\t$dbcon->query(\"UPDATE App_User SET u_password = '$newPass' WHERE u_id = $user_id\");\n\t \t\t\t\n\t \t\t\t//send email with new password\n\t \t\t\t$headers ='From: \"GTI619\"<[email protected]>'.\"\\n\";\n\t\t\t\t $headers .='Content-Type: text/plain; charset=\"utf-8\"'.\"\\n\"; \n\t\t\t\t $message = \"Une tentative de brute force à été faite sur votre compte, nous avons changé temporairement votre mot de passe. Nous vous suggérons fortement de changer votre mot de passe temporaire le plus tôt possible. Mot de passe temporaire :\";\n\t \t\t\tmail('[email protected]', 'Changement de mot de passe', $message, $headers);\n\t \t\theader(\"Location: ./index.php?error=\" . urlencode(\"Une tentative de brute force à été faite sur votre compte, nous avons changé temporairement votre mot de passe.\"));\n\t \t\texit();\n\t }\n\t \n\n\t //write log\n\t \t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success, la_desc) VALUES ($user_id, $now, 'false', 'brute force attempt')\");\n\n\t return false;\n\t } \n\t else \n\t {\n\t \tif($db_password == $password) \n\t \t{ // Check if the password in the database matches the password the user submitted. \n\t\t\t\t// Password is correct!\n\n\t\t\t\t$user_browser = $_SERVER['HTTP_USER_AGENT']; // Get the user-agent string of the user.\n\n\t\t\t\t$user_id = preg_replace(\"/[^0-9]+/\", \"\", $user_id); // XSS protection as we might print this value\n\t\t\t\t$_SESSION['user_id'] = $user_id; \n\t\t\t\t$username = preg_replace(\"/[^a-zA-Z0-9_\\-]+/\", \"\", $username); // XSS protection as we might print this value\n\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t$_SESSION['login_string'] = hash('sha512', $password.$user_browser);\n\t\t\t\t//write this in th Login Attemps\n\t\t\t\t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success) VALUES ($user_id, $now, 'true')\");\n\t\t\t\t// Login successful.\n\t\t\t\treturn true; \n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t// Password is not correct\n\t\t\t\t// We record this attempt in the database\n\t\t\t\t\n\t\t\t\t$dbcon->query(\"INSERT INTO Login_Attempt (la_app_user_id, la_time, la_success, la_desc) VALUES ($user_id, $now, 'false', 'incorect password')\");\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t \t}\n\t } \n\t else \n\t {\n\t // No user exists.\n\t \n\t return false;\n\t }\n\t }\n\t}", "protected function getErrorFlashMessage() {}", "public function getLoginFailedReason() {\n\t\treturn $this->error;\n\t}", "public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }", "public function getFailedHookStats();", "private function check_user_access() {\n\t\t//pull data from session\n\t\t$local_username = $_SESSION['username'];\n\n\t\t//SQL Query Definition\n\t\t$query = \"SELECT access_level FROM users WHERE employee_id='$local_username'\";\n\t\t//Query Database\n\t\t$database_check = mysqli_query($this->con, $query);\n\t\t//Check number of rows that match Query\n\t\t$check_rows = mysqli_num_rows($database_check);\n\t\t/*If only one row matches the query is valid otherwise no action should be taken as there is an issue with the database that will need to be reviewed by the admin.*/\n\t\tif($check_rows == 1) {\n\t\t\t$row = mysqli_fetch_assoc($database_check);\n\t\t\treturn $row['access_level'];\n\t\t}\n\t\t//Log Out as a critical error, possible Session Poisoning\n\t\telse {\n\t\t\tHeader(\"Location: logout.php\");\n\t\t}\n\t}", "public function logError() {}", "public function onAuthenticationFailure(AuthenticationFailureEvent $event)\n {\n // TODO warn about login attempt on admin users accounts.\n }", "public function getAppEvnAttempts ()\n {\n return $this->app_evn_attempts;\n }", "public function addLoginAttempt($value, $username) {\r\n // set last login attempt time if required\r\n \t $q = \"SELECT * FROM \".TBL_ATTEMPTS.\" WHERE ip = '$value' and username = '$username'\";\r\n \t $result = $this->conn->query($q);\r\n \t $data = mysqli_fetch_array($result); //$result->fetch_assoc(); // mysql_fetch_array($result);\r\n\r\n\r\n \t if($data)\r\n {\r\n $attempts = $data[\"attempts\"]+1;\r\n $locked = 1;\r\n\r\n if($attempts == 3) {\r\n \t\t $q = \"UPDATE \".TBL_ATTEMPTS.\" SET attempts=\".$attempts.\", lastlogin=NOW() WHERE ip = '$value' and username = '$username'\";\r\n \t\t $result = $this->conn->query($q);\r\n\r\n $q1 = \"UPDATE \".TBL_USERS.\" SET locked=\".$locked.\" WHERE username = '$username'\";\r\n \t\t $result1 = $this->conn->query($q1);\r\n\r\n $subject = \"Access denied for \".TIME_PERIOD.\" minutes\";\r\n $message = 'Login failed. You have entered the incorrect credentials multiple times and your account is now locked' ;\r\n sendEmail($subject, $message);\r\n \t\t}\r\n else {\r\n \t\t $q = \"UPDATE \".TBL_ATTEMPTS.\" SET attempts=\".$attempts.\" WHERE ip = '$value' and username = '$username'\";\r\n \t\t $result = $this->conn->query($q);\r\n \t\t}\r\n }\r\n else {\r\n \t $q = \"INSERT INTO \".TBL_ATTEMPTS.\" (attempts,IP,lastlogin,username) values (1, '$value', NOW(), '$username')\";\r\n \t $result = $this->conn->query($q);\r\n \t }\r\n }", "private function get_failed_rows() {\n\t\treturn $this->failed_rows;\n\t}", "public function errorCode();", "public function errorCode();", "public function GetLoginErrorMessage ($username) {\n\t\t\treturn self::$loginErrorMessage;\n\t\t}", "private function _countLogin ()\r\n {\r\n $date = date(\"Y-m-d H:i:s\");\r\n $sql = \"UPDATE `admin` SET `last_login` = '$date', `number_logins` = `number_logins` + 1 WHERE `username` = '{$this->_username}'\";\r\n mysql_query($sql, db_c());\r\n \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_login', 'user={$this->_username};IP={$ip}')\";\r\n mysql_query($sql, db_c());\r\n }", "function log_error_sess($timelocal, $function, $query, $mysqli_sess) {\n\n /* $query is an object, to get query string, you will require seperate $query variable to pass back\n 'query: ' . serialize($query) . \"\\n\" . */\n \n mysqli_report(MYSQLI_REPORT_OFF); \t\t\t\t/* turn off irritating default messages */\n\n $err = ''; $err_trace = '';\n\n\t switch(true) {\n\n\t \tcase($mysqli_sess->error):\n\n try { \n throw new Exception(); \n } catch(Exception $err) {\n $err_trace = nl2br($err->getTraceAsString());\n }\n\n\t \t\t $fp = fopen(LOG_SIGNIN_DIR . 'db.app.sess.conn.log','a');\n\t \t\t fwrite($fp,\n\n 'UTC time : ' . $timelocal . \"\\n\" . \n 'error no: ' . htmlspecialchars($mysqli_sess->errno) . \"\\n\" .\n 'file name: ' . $_SERVER[\"SCRIPT_NAME\"] . ' ==> ' . $function . '() failed ' . \"\\n\" .\n 'error: ' . htmlspecialchars($mysqli_sess->error) . \"\\n\" .\n 'error trace: ' . \"\\n\" . html2txt_sess($err_trace) \n\n ); \n\t \t\t \n fclose($fp);\n\n $err = null; $err_trace = null;\n\t \t\n break;\n\t }\n \n }", "private function getAttempts()\n {\n return Attempt::where('ip', $this->ip)\n ->whereDate('created_at', date(\"Y-m-d\"))\n ->count();\n }", "public function getDefaultFatalErrorLevel () {\n\t\treturn $this->defaultFatalErrors;\n\t}", "public function getFailureTime(): int\n {\n return (int) $this->_getEntity()->getFailureTime();\n }" ]
[ "0.65171224", "0.64927745", "0.6384495", "0.61212355", "0.6098193", "0.60747975", "0.6059499", "0.60285944", "0.59918684", "0.59447104", "0.5928422", "0.5838931", "0.58124083", "0.5736986", "0.567755", "0.558884", "0.5555554", "0.5519497", "0.54832846", "0.5411959", "0.5410957", "0.54054946", "0.5395926", "0.5387283", "0.538526", "0.5372516", "0.5366057", "0.5322076", "0.531066", "0.5293234", "0.52927727", "0.52922523", "0.52825737", "0.5274765", "0.5266066", "0.52638537", "0.5224893", "0.52247775", "0.5215633", "0.5212944", "0.52029663", "0.5192398", "0.51875407", "0.5170404", "0.51659137", "0.5163553", "0.5160601", "0.5152763", "0.51492435", "0.51461345", "0.5141947", "0.51400065", "0.5122333", "0.5098467", "0.5088371", "0.5085258", "0.5084681", "0.50474674", "0.5044534", "0.5040879", "0.504018", "0.5037947", "0.5035369", "0.5032569", "0.5032178", "0.5023524", "0.50157225", "0.5010531", "0.50097775", "0.5006705", "0.5006401", "0.5004329", "0.49912575", "0.49826258", "0.4965143", "0.4951597", "0.4947309", "0.4940865", "0.49392596", "0.49372205", "0.4936731", "0.49336937", "0.49185544", "0.49155664", "0.4911681", "0.4909588", "0.48998648", "0.4899442", "0.48992822", "0.48893452", "0.48728326", "0.48726162", "0.4869796", "0.4869796", "0.48671055", "0.4864193", "0.48529217", "0.4849899", "0.48497552", "0.48473454" ]
0.5987508
9
Try to sniff the current client IP.
private function sniff_ip() { if ( $this->ip_data ) { return; } if ( PHP_SAPI === 'cli' ) { $this->ip_data = [ '127.0.0.1', 'CLI' ]; return; } $ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ]; $ips = array_intersect_key( $_SERVER, $ip_server_keys ); $this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_unsafe_client_ip()\n {\n }", "function query_client_ip()\n{\n\tglobal $_SERVER;\n\t\n\tif(isset($_SERVER['HTTP_CLIENT_IP']))\n\t{\n\t\t$clientIP = $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif(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\t{\n\t\t// check for internal ips by looking at the first octet\n\t\tforeach($matches[0] AS $ip)\n\t\t{\n\t\t\tif(!preg_match(\"#^(10|172\\.16|192\\.168)\\.#\", $ip))\n\t\t\t{\n\t\t\t\t$clientIP = $ip;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}\n\telseif(isset($_SERVER['HTTP_FROM']))\n\t{\n\t\t$clientIP = $_SERVER['HTTP_FROM'];\n\t}\n\telse\n\t{\n\t\t$clientIP = $_SERVER['REMOTE_ADDR'];\n\t}\n\n\treturn $clientIP;\n}", "private function what_is_client_ip()\n {\n $ipaddress = '';\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n } else if (isset($_SERVER['HTTP_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n } else if (isset($_SERVER['REMOTE_ADDR'])) {\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n } else {\n $ipaddress = 'UNKNOWN';\n\t\t}\n\n $this->ipaddress = $ipaddress;\n\t}", "public function getClientIpAddress()\n\t{\n\t\tif(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('HTTP_CLIENT_IP');\n\t\t}\n\t\t\n\t\tif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('HTTP_X_FORWARDED_FOR');\n\t\t}\n\t\t\n\t\tif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('REMOTE_ADDR');\n\t\t}\n\t\t\n\t\tif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown'))\n\t\t{\n\t\t\t$onlineip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\t\n\t\tpreg_match(\"/[\\d\\.]{7,15}/\", $onlineip, $onlineipmatches);\n\t\treturn $onlineipmatches[0] ? $onlineipmatches[0] : 'unknown';\n\t}", "public function client_ip() {\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if (self::validate_ip($ip))\n return $ip;\n }\n } else {\n if (self::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && self::validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && self::validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && self::validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }", "public static function getClientIPAddress(){\n\t\treturn Customweb_Core_Http_ContextRequest::getClientIPAddress();\n\t}", "private function getClientIP()\n {\n if ( isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) )\n {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\n foreach ( array ( 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ) as $key )\n {\n if ( array_key_exists($key, $_SERVER) )\n {\n foreach ( explode(',', $_SERVER[$key]) as $ip )\n {\n $ip = trim($ip);\n\n //if ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false )\n if ( filter_var($ip, FILTER_VALIDATE_IP) !== false )\n {\n return $ip;\n }\n }\n }\n }\n\n return null;\n }", "function get_client_ip() {\r\n\t\t$ipaddress = '';\r\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t\t$ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\telse if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t\t$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\telse if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n\t\t\t$ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n\t\telse if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n\t\t\t$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n\t\telse if(isset($_SERVER['HTTP_FORWARDED']))\r\n\t\t\t$ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n\t\telse if(isset($_SERVER['REMOTE_ADDR']))\r\n\t\t\t$ipaddress = $_SERVER['REMOTE_ADDR'];\r\n\t\telse\r\n\t\t\t$ipaddress = 'UNKNOWN';\r\n\t\treturn $ipaddress;\r\n\t}", "private static function resolveClientIp(): string{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "function get_client_ip(){\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\treturn (@$_SERVER['REMOTE_ADDR'])?:'000.000.000.000'; \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}", "function get_client_ip() {\n\t\t$ipaddress = '';\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t$ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\t\telse if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\telse if(isset($_SERVER['HTTP_X_FORWARDED']))\n\t\t\t$ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\t\telse if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n\t\t\t$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\t\telse if(isset($_SERVER['HTTP_FORWARDED']))\n\t\t\t$ipaddress = $_SERVER['HTTP_FORWARDED'];\n\t\telse if(isset($_SERVER['REMOTE_ADDR']))\n\t\t\t$ipaddress = $_SERVER['REMOTE_ADDR'];\n\t\telse\n\t\t\t$ipaddress = 'UNKNOWN';\n\t\treturn $ipaddress;\n\t}", "private static function getClientIp() {\n // Nothing to do without any reliable information\n if (!filter_input(INPUT_SERVER, 'REMOTE_ADDR')) {\n return NULL;\n }\n\n // Header that is used by the trusted proxy to refer to\n // the original IP\n $proxy_header = \"HTTP_X_FORWARDED_FOR\";\n\n // List of all the proxies that are known to handle 'proxy_header'\n // in known, safe manner\n $trusted_proxies = array(\"2001:db8::1\", \"192.168.50.1\");\n\n if (in_array(filter_input(INPUT_SERVER, 'REMOTE_ADDR'), $trusted_proxies)) {\n\n // Get the IP address of the client behind trusted proxy\n if (array_key_exists($proxy_header, $_SERVER)) {\n\n // Header can contain multiple IP-s of proxies that are passed through.\n // Only the IP added by the last proxy (last IP in the list) can be trusted.\n $proxy_list = explode(\",\", filter_input(INPUT_SERVER, $proxy_header));\n $client_ip = trim(end($proxy_list));\n\n // Validate just in case\n if (filter_var($client_ip, FILTER_VALIDATE_IP)) {\n return $client_ip;\n } else {\n // Validation failed - beat the guy who configured the proxy or\n // the guy who created the trusted proxy list?\n // TODO: some error handling to notify about the need of punishment\n }\n }\n }\n\n // In all other cases, REMOTE_ADDR is the ONLY IP we can trust.\n return filter_input(INPUT_SERVER, 'REMOTE_ADDR');\n }", "public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}", "function get_client_ip() {\r\n $ipaddress = '';\r\n if (getenv('HTTP_CLIENT_IP'))\r\n $ipaddress = getenv('HTTP_CLIENT_IP');\r\n else if(getenv('HTTP_X_FORWARDED_FOR'))\r\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\r\n else if(getenv('HTTP_X_FORWARDED'))\r\n $ipaddress = getenv('HTTP_X_FORWARDED');\r\n else if(getenv('HTTP_FORWARDED_FOR'))\r\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\r\n else if(getenv('HTTP_FORWARDED'))\r\n $ipaddress = getenv('HTTP_FORWARDED');\r\n else if(getenv('REMOTE_ADDR'))\r\n $ipaddress = getenv('REMOTE_ADDR');\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n }", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n }", "function getClientIp() {\n foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "function getClientIP() {\r\n if (isset ($_SERVER ['HTTP_X_FORWARDED_FOR'])){ $clientIP = $_SERVER ['HTTP_X_FORWARDED_FOR']; }\r\n elseif (isset ($_SERVER ['HTTP_X_REAL_IP'])){ $clientIP = $_SERVER ['HTTP_X_REAL_IP']; }\r\n else { $clientIP = $_SERVER ['REMOTE_ADDR']; }\r\n return $clientIP;\r\n}", "function get_client_ip() {\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "public static function get_client_ip()\r\n\t{\r\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\r\n\t}", "static public function getClientIp()\n {\n /*\n $headers = function_exists('apache_request_headers')\n ? apache_request_headers()\n : $_SERVER;\n \n return isset($headers['REMOTE_ADDR']) ? $headers['REMOTE_ADDR'] : '0.0.0.0';\n */\n \n if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {\n $ip = getenv('HTTP_CLIENT_IP');\n } elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {\n $ip = getenv('HTTP_X_FORWARDED_FOR');\n } elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {\n $ip = getenv('REMOTE_ADDR');\n } elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {\n $ip = $_SERVER['REMOTE_ADDR'];\n } else {\n return '0.0.0.0';\n }\n \n return preg_match ( '/[\\d\\.]{7,15}/', $ip, $matches ) ? $matches [0] : '0.0.0.0';\n }", "function get_client_ip() {\n\t $ipaddress = '';\n\t if (getenv('HTTP_CLIENT_IP'))\n\t $ipaddress = getenv('HTTP_CLIENT_IP');\n\t else if(getenv('HTTP_X_FORWARDED_FOR'))\n\t $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n\t else if(getenv('HTTP_X_FORWARDED'))\n\t $ipaddress = getenv('HTTP_X_FORWARDED');\n\t else if(getenv('HTTP_FORWARDED_FOR'))\n\t $ipaddress = getenv('HTTP_FORWARDED_FOR');\n\t else if(getenv('HTTP_FORWARDED'))\n\t $ipaddress = getenv('HTTP_FORWARDED');\n\t else if(getenv('REMOTE_ADDR'))\n\t $ipaddress = getenv('REMOTE_ADDR');\n\t else\n\t $ipaddress = 'UNKNOWN';\n\t return $ipaddress;\n\t}", "public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "function get_client_ip() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n}", "function ns_get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "static function getClientIP() {\n if ($_SERVER['HTTP_CLIENT_IP'])\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if($_SERVER['HTTP_X_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if($_SERVER['HTTP_X_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if($_SERVER['HTTP_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if($_SERVER['HTTP_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if($_SERVER['REMOTE_ADDR'])\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n\n return $ipaddress;\n }", "function getRealIPAddress() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n\t\t\t// Check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t\t// Check ip passed from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\treturn $ip;\r\n\t}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if (getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if (getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if (getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if (getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if (getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n $ipadsplit = explode(\",\", $ipaddress);\n if (count($ipadsplit) > 1) {\n $ipaddress = trim($ipadsplit[1]);\n }\n return $ipaddress;\n }", "static function getIP()\r\n {\r\n return self::getRemoteIP();\r\n }", "function get_client_ip() {\n\t\t$ipaddress = null;\n\t\tif (getenv('HTTP_CLIENT_IP'))\n\t\t\t$ipaddress = getenv('HTTP_CLIENT_IP');\n\t\telse if(getenv('HTTP_X_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_X_FORWARDED'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED');\n\t\telse if(getenv('HTTP_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_FORWARDED'))\n\t\t$ipaddress = getenv('HTTP_FORWARDED');\n\t\telse if(getenv('REMOTE_ADDR'))\n\t\t\t$ipaddress = getenv('REMOTE_ADDR');\n\t\telse\n\t\t\t$ipaddress = null;\n\t\treturn $ipaddress;\n\t}", "function get_client_ip()\n{\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n } else {\n $ipaddress = 'UNKNOWN';\n }\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_ip_address_from_client() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n \n return $ipaddress;\n}", "public function get_client_ip() \n\t{\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function getUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])): \n return $_SERVER['HTTP_X_REAL_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_CLIENT_IP'])): \n return $_SERVER['HTTP_CLIENT_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])): \n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n break;\n \n default : \n return $_SERVER['REMOTE_ADDR'];\n }\n }", "function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function ipchecker(){\r\n if (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\r\n # code...\r\n $IP = $_SERVER[\"HTTP_CLIENT_IP\"];\r\n }elseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\r\n # code...\r\n //check for ip address proxy server\r\n $IP = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\r\n }else{\r\n $IP = $_SERVER[\"REMOTE_ADDR\"];\r\n }\r\n}", "function get_client_ip() {\n $ipaddress = '';\n\t\t\n\t\tif (isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n /* else if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if (isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if (isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if (isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];*/\n else\n $ipaddress = 'UNKNOWN';\n\n //To avoid multiple ip. That is because of ip forwarding.\n if (strpos($ipaddress, ',') !== false) {\n $ips = explode(',', $ipaddress);\n $ipaddress = trim($ips[0]); // taking the first one\n }\n return $ipaddress;\n }", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function getIPAddress() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])) { \n $ip = $_SERVER['HTTP_CLIENT_IP']; \n } \n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n } \n //whether ip is from the remote address \n else{ \n $ip = $_SERVER['REMOTE_ADDR']; \n } \n return $ip; \n }", "function get_client_ip_server() {\n $ipaddress = '';\n if ($_SERVER['HTTP_CLIENT_IP'])\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if($_SERVER['HTTP_X_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if($_SERVER['HTTP_X_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if($_SERVER['HTTP_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if($_SERVER['HTTP_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if($_SERVER['REMOTE_ADDR'])\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n \n return $ipaddress;\n}", "function get_client_ip_server() {\n $ipaddress = '';\n if ($_SERVER['HTTP_CLIENT_IP'])\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if($_SERVER['HTTP_X_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if($_SERVER['HTTP_X_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if($_SERVER['HTTP_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if($_SERVER['HTTP_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if($_SERVER['REMOTE_ADDR'])\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n \n return $ipaddress;\n}", "function get_client_ip_server() {\n $ipaddress = '';\n if ($_SERVER['HTTP_CLIENT_IP'])\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if($_SERVER['HTTP_X_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if($_SERVER['HTTP_X_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if($_SERVER['HTTP_FORWARDED_FOR'])\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if($_SERVER['HTTP_FORWARDED'])\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if($_SERVER['REMOTE_ADDR'])\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n \n return $ipaddress;\n}", "protected function getClientIP(){\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) \n {\n $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from proxy\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) \n {\n $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from remote address\n else\n {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n return $ip_address;\n }", "function atkGetClientIp()\n{\n\tstatic $s_ip = NULL;\n\n\tif ($s_ip === NULL)\n\t{\n\t\tif (getenv(\"HTTP_CLIENT_IP\"))\n\t\t$s_ip = getenv(\"HTTP_CLIENT_IP\");\n\t\telseif (getenv(\"HTTP_X_FORWARDED_FOR\"))\n\t\t{\n\t\t\t$ipArray = explode(\",\", getenv(\"HTTP_X_FORWARDED_FOR\"));\n\t\t\t$s_ip = $ipArray[0];\n\t\t}\n\t\telseif (getenv(\"REMOTE_ADDR\"))\n\t\t$s_ip = getenv(\"REMOTE_ADDR\");\n\t\telse $s_ip = 'x.x.x.x';\n\t}\n\n\treturn $s_ip;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function getIPAddress() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])) { \n $ip = $_SERVER['HTTP_CLIENT_IP']; \n } \n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n } \n//whether ip is from the remote address \n else{ \n $ip = $_SERVER['REMOTE_ADDR']; \n } \n return $ip; \n}", "public function get_client_ip2() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if (isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if (isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if (isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if (isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n }", "protected function get_ip() {\n\t\t// Loop over server keys that could contain the client IP address,\n\t\t// and return the first valid one.\n\t\tforeach ( array( 'REMOTE_ADDR', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR' ) as $key ) {\n\t\t\tif ( isset( $_SERVER[ $key ] ) and preg_match( '~^(?:\\d{1,3}+\\.){3}\\d{1,3}+$~D', $_SERVER[ $key ] ) ) {\n\t\t\t\treturn $_SERVER[ $key ];\n\t\t\t}\n\t\t}\n\t}", "public function getClientIp(): string {\n $s = $this->server();\n if (array_key_exists('HTTP_CLIENTIP', $s)) {\n if (!empty($s['HTTP_CLIENTIP'])) {\n return $s['HTTP_CLIENTIP'];\n }\n }\n if (array_key_exists('HTTP_X_FORWARDED_FOR', $s) && !empty($s['HTTP_X_FORWARDED_FOR'])) {\n $addresses = explode(',', $s['HTTP_X_FORWARDED_FOR']);\n while (count($addresses)) {\n $ip = @trim(array_shift($addresses));\n if ($ip === '') {\n continue;\n }\n if (!self::isLanIp($ip)) {\n return $ip;\n }\n }\n }\n return $s['REMOTE_ADDR'];\n }", "public function getClientIP()\n {\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n } else if (isset($_SERVER['HTTP_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n } else if (isset($_SERVER['REMOTE_ADDR'])) {\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n } else {\n $ipaddress = 'UNKNOWN IP';\n }\n return $ipaddress;\n }", "public function get_client_ip() {\n\t\t$ipaddress = '';\n\t\tif (getenv('HTTP_CLIENT_IP'))\n\t\t\t$ipaddress = getenv('HTTP_CLIENT_IP');\n\t\telse if(getenv('HTTP_X_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_X_FORWARDED'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED');\n\t\telse if(getenv('HTTP_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_FORWARDED'))\n\t\t $ipaddress = getenv('HTTP_FORWARDED');\n\t\telse if(getenv('REMOTE_ADDR'))\n\t\t\t$ipaddress = getenv('REMOTE_ADDR');\n\t\telse\n\t\t\t$ipaddress = 'UNKNOWN';\n\t\treturn $ipaddress;\n\t}", "function getIpAddress()\n {\n foreach ([\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ] as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip);\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "static function getIp(){\n\t\t$check_order = array(\n\t\t\t'HTTP_CLIENT_IP', //shared client\n\t\t\t'HTTP_X_FORWARDED_FOR', //proxy address\n\t\t\t'HTTP_X_CLUSTER_CLIENT_IP', //proxy address\n\t\t\t'REMOTE_ADDR', //fail safe\n\t\t);\n\n\t\tforeach ($check_order as $key) {\n\t\t\tif (isset($_SERVER[$key]) && !empty($_SERVER[$key])) {\n\t\t\t\treturn $_SERVER[$key];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function get_client_ip() {\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n } else {\n $ip = '0.0.0.0';\n }\n\n return $ip;\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}", "private function getRequestIP() : ?string\n {\n // check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validateIP($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validateIP($ip))\n return $ip;\n }\n } else {\n if ($this->validateIP($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validateIP($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validateIP($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validateIP($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validateIP($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }", "function get_ip_address() {\n // check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validate_ip($ip))\n return $ip;\n }\n } else {\n if ($this->validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }", "function get_ip_address()\n{\n//\tif( isDev() )\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"46.122.252.60\"; // ljubljana\n//\t\treturn \"190.172.82.24\"; // argentinia?\n//\t\treturn \"84.154.26.132\"; // probably invalid ip from munich\n//\t\treturn \"203.208.37.104\"; // google.cn\n//\t\treturn \"62.215.83.54\";\t// kuwait\n//\t\treturn \"41.250.146.224\";\t// Morocco (rtl!)\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"121.243.179.122\";\t// india\n//\t\treturn \"109.253.21.90\";\t// invalid (user says UK)\n//\t\treturn \"82.53.187.74\";\t// IT\n//\t\treturn \"190.172.82.24\";\t// AR\n//\t\treturn \"99.230.167.125\";\t// CA\n//\t\treturn \"95.220.134.145\";\t// N/A\n//\t\treturn \"194.126.108.2\";\t// Tallinn/Estonia (Skype static IP)\n\n\tstatic $DETECTED_CLIENT_IP = 'undefined';\n\n\tif( $DETECTED_CLIENT_IP !== 'undefined' )\n\t\treturn $DETECTED_CLIENT_IP;\n\n\t$proxy_headers = array(\n\t\t'HTTP_VIA',\n\t\t'HTTP_X_FORWARDED_FOR',\n\t\t'HTTP_FORWARDED_FOR',\n\t\t'HTTP_X_FORWARDED',\n\t\t'HTTP_FORWARDED',\n\t\t'HTTP_CLIENT_IP',\n\t\t'HTTP_FORWARDED_FOR_IP',\n\t\t'VIA',\n\t\t'X_FORWARDED_FOR',\n\t\t'FORWARDED_FOR',\n\t\t'X_FORWARDED',\n\t\t'FORWARDED',\n\t\t'CLIENT_IP',\n\t\t'FORWARDED_FOR_IP',\n\t\t'HTTP_PROXY_CONNECTION',\n\t\t'REMOTE_ADDR' // REMOTE_ADDR must be last -> fallback\n\t);\n\n\tforeach( $proxy_headers as $ph )\n\t{\n\t\tif( !empty($_SERVER) && isset($_SERVER[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_SERVER[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( !empty($_ENV) && isset($_ENV[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_ENV[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( @getenv($ph) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = getenv($ph);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif( !isset($DETECTED_CLIENT_IP) )\n\t\treturn false;\n\n\t$is_ip = preg_match('/^(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/',$DETECTED_CLIENT_IP,$regs);\n\tif( $is_ip && (count($regs) > 0) )\n\t\t$DETECTED_CLIENT_IP = $regs[1];\n\treturn $DETECTED_CLIENT_IP;\n}", "function getIPAddress()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from the remote address \n else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "public static function ip() {\n\t\tif (static::$realIp !== null) {\n\t\t\treturn static::$realIp;\n\t\t}\n\n\t\t$possibilities = array(\n\t\t\t'HTTP_CLIENT_IP',\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'HTTP_X_FORWARDED',\n\t\t\t'HTTP_X_CLUSTER_CLIENT_IP',\n\t\t\t'HTTP_FORWARDED_FOR',\n\t\t\t'HTTP_FORWARDED',\n\t\t\t'REMOTE_ADDR'\n\t\t);\n\n\t\tforeach ($possibilities as $key) {\n\t\t\tif (array_key_exists($key, $_SERVER) === true) {\n\t\t\t\tforeach (explode(',', $_SERVER[$key]) as $ip) {\n\t\t\t\t\t$ip = trim($ip);\n\n\t\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n\t\t\t\t\t\tstatic::$realIp = $ip;\n\t\t\t\t\t\treturn $ip;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (defined('KOLDY_CLI') && KOLDY_CLI === true) {\n\t\t\tstatic::$realIp = '127.0.0.1';\n\t\t} else if (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\tstatic::$realIp = $_SERVER['REMOTE_ADDR'];\n\t\t} else {\n\t\t\tstatic::$realIp = false;\n\t\t}\n\n\t\treturn static::$realIp;\n\t}", "function GetUserIp() {\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; }\r\n return $ip;\r\n }", "function getIPAddress() {\r\nif(!empty($_SERVER['HTTP_CLIENT_IP'])) { \r\n $ip = $_SERVER['HTTP_CLIENT_IP']; \r\n} \r\n//whether ip is from the proxy \r\nelseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \r\n} \r\n//whether ip is from the remote address \r\nelse{ \r\n $ip = $_SERVER['REMOTE_ADDR']; \r\n} \r\nreturn $ip; \r\n}", "public function clientIp()\n\t{\n\t\t$keys = array(\n\t\t\t'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP',\n\t\t\t'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'\n\t\t);\n\t\t$keys = array_values(array_intersect($keys, array_keys($_SERVER)));\n\t\tforeach ($keys as $key)\n\t\t{\n\t\t\tforeach (explode(',', $this->server($key)) as $ip)\n\t\t\t{\n\t\t\t\t$ip = trim($ip);\n\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) !== false)\n\t\t\t\t\treturn $ip;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Exception\\RequestException(\"Can't get client ip.\");\n\t}", "function erp_get_client_ip() {\n $ipaddress = '';\n\n if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CLIENT_IP'] ) );\n } else if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) );\n } else if ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED'] ) );\n } else if ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_FORWARDED_FOR'] ) );\n } else if ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_FORWARDED'] ) );\n } else if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\n } else {\n $ipaddress = 'UNKNOWN';\n }\n\n return $ipaddress;\n}", "public function getIpClient() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n else {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n }", "public function GetIP() {\n\n $Srv= $this->GetRequestContext()->SERVER;\n $TrustedProxies= $this->GetOption('TrustedProxies');\n\n // if visitor coming from trusted proxie get forwarded IP address\n if (isset($Srv['HTTP_X_FORWARDED_FOR']) && isset($Srv['REMOTE_ADDR'])\n && in_array($Srv['REMOTE_ADDR'], $TrustedProxies)) {\n // format: \"X-Forwarded-For: client1, proxy1, proxy2\"\n $Clients= explode(',', $Srv['HTTP_X_FORWARDED_FOR']);\n return trim(reset($Clients));\n }\n // HTTP_CLIENT_IP also can be set by certain proxies\n if (isset($Srv['HTTP_CLIENT_IP']) && isset($Srv['REMOTE_ADDR'])\n && in_array($Srv['REMOTE_ADDR'], $TrustedProxies)) {\n $Clients= explode(',', $Srv['HTTP_CLIENT_IP']);\n return trim(reset($Clients));\n }\n // ok, back to good old REMOTE_ADDR field, all other server fields are not reliable\n if (isset($Srv['REMOTE_ADDR'])) {\n return $Srv['REMOTE_ADDR'];\n }\n // not found\n return null;\n }", "function getClientIP() {\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n return $_SERVER['HTTP_CLIENT_IP'];\n else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n return $_SERVER['REMOTE_ADDR'];\n }", "function get_client_ip() {\n\t$ipaddress = $_SERVER['REMOTE_ADDR'];\n return $ipaddress;\n}", "protected function _getClientIpAddress() {\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}", "public static function get_client_ip()\r\n {\r\n $ipaddress = '';\r\n if (getenv('HTTP_CLIENT_IP')) {\r\n $ipaddress = getenv('HTTP_CLIENT_IP');\r\n } elseif (getenv('HTTP_X_FORWARDED_FOR')) {\r\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\r\n } elseif (getenv('HTTP_X_FORWARDED')) {\r\n $ipaddress = getenv('HTTP_X_FORWARDED');\r\n } elseif (getenv('HTTP_FORWARDED_FOR')) {\r\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\r\n } elseif (getenv('HTTP_FORWARDED')) {\r\n $ipaddress = getenv('HTTP_FORWARDED');\r\n } elseif (getenv('REMOTE_ADDR')) {\r\n $ipaddress = getenv('REMOTE_ADDR');\r\n } else {\r\n $ipaddress = 'UNKNOWN';\r\n }\r\n $_SESSION[\"ip_cliente\"] = $ipaddress;\r\n }", "public function getRequestIpAddress() {\n\t\t// We might have a debug config here to force requests to be local\n\t\tApp::uses('PhpReader', 'Configure');\n\t\tConfigure::config('default', new PhpReader());\n\n\t\ttry {\n\t\t\tConfigure::load('debug', 'default');\n\t\t\t$configIp = Configure::read('forceRequestIp');\n\t\t\tif (isset($configIp)) {\n\t\t\t\treturn $configIp;\n\t\t\t}\n\t\t} catch(ConfigureException $ex) {\n\t\t\t// We don't care.\n\t\t}\n\n\t\treturn $_SERVER[\"REMOTE_ADDR\"];\n\t}", "public static function get_client_ip() {\n\t\t\treturn IBX_WPFomo_Helper::get_client_ip();\n\t\t}", "function getIP() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n //ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n //ip pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }else{\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip === '::1' ? '127.0.0.1' : $ip;\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 spmy_dpabadbot_get_client_ip() {\r\n $ipaddress = '';\r\n $ipaddress = getenv('REMOTE_ADDR');\r\n\tif( $ipaddress == '' ){\t\r\n\t\t$ipaddress = getenv('HTTP_CLIENT_IP');\r\n\t\tif( $ipaddress == '' ){\t\r\n\t\t\t$ipaddress = getenv('HTTP_FORWARDED_FOR');\r\n\t\t\tif( $ipaddress == '' ){\t\r\n\t\t\t\t$ipaddress = getenv('HTTP_FORWARDED');\r\n\t\t\t\tif( $ipaddress == '' ){\t\r\n\t\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED');\r\n\t\t\t\tif( $ipaddress == '' ){\t\r\n\t\t\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED_FOR');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { \r\n\t\t\t\t\t\t$ipaddress = 'UNKNOWN';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n return( trim( $ipaddress ) );\r\n}", "public static function getClientIp()\n {\n if (getenv('HTTP_CLIENT_IP')) {\n $ipAddress = getenv('HTTP_CLIENT_IP');\n } else if(getenv('HTTP_X_FORWARDED_FOR')) {\n $ipAddress = getenv('HTTP_X_FORWARDED_FOR');\n } else if(getenv('HTTP_X_FORWARDED')) {\n $ipAddress = getenv('HTTP_X_FORWARDED');\n } else if(getenv('HTTP_FORWARDED_FOR')) {\n $ipAddress = getenv('HTTP_FORWARDED_FOR');\n } else if(getenv('HTTP_FORWARDED')) {\n $ipAddress = getenv('HTTP_FORWARDED');\n } else if(getenv('REMOTE_ADDR')) {\n $ipAddress = getenv('REMOTE_ADDR');\n } else {\n $ipAddress = 'UNKNOWN';\n }\n\n if ($ipAddress === '::1') {\n $ipAddress = '192.168.0.1';\n }\n\n /*\n * On some server configurations, HTTP_X_FORWARDED_FOR or REMOTE_ADDR returns\n * multiple comma-separated IPs This brakes some email integration,\n * so we want to return only one IP.\n */\n if (strpos($ipAddress, ',') !== false) {\n $ipAddress = explode(',', $ipAddress);\n $ipAddress = $ipAddress[0];\n }\n\n return $ipAddress;\n }", "function getClientIP() {\n\n if (isset($_SERVER)) {\n\n if (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n return $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\n if (isset($_SERVER[\"HTTP_CLIENT_IP\"]))\n return $_SERVER[\"HTTP_CLIENT_IP\"];\n\n return $_SERVER[\"REMOTE_ADDR\"];\n }\n\n if (getenv('HTTP_X_FORWARDED_FOR'))\n return getenv('HTTP_X_FORWARDED_FOR');\n\n if (getenv('HTTP_CLIENT_IP'))\n return getenv('HTTP_CLIENT_IP');\n\n return getenv('REMOTE_ADDR');\n}", "public function getUserIP() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n\n return $ip;\n }", "function getClientIP() {\r\n $ip = '';\r\n if (isset($_SERVER['REMOTE_ADDR'])) {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED'];\r\n } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED_FOR'];\r\n } else if (isset($_SERVER['HTTP_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED'];\r\n } else if (isset($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } else {\r\n $ip = '0.0.0.0';\r\n }\r\n return ($ip);\r\n }", "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 client_ip(){\r\n\tif(function_exists('apache_request_headers')){\r\n\r\n\t\t$headers = apache_request_headers();\r\n\r\n\t} else {\r\n\r\n\t\t$headers = $_SERVER;\r\n\r\n\t}\r\n\r\n\t//Get the forwarded IP if it exists\r\n\tif (array_key_exists('X-Forwarded-For', $headers ) and\r\n\t\tfilter_var($headers['X-Forwarded-For'],\r\n\t\t\tFILTER_VALIDATE_IP,\r\n\t\t\tFILTER_FLAG_IPV4)){\r\n\r\n\t\t$the_ip = $headers['X-Forwarded-For'];\r\n\r\n\t} elseif(array_key_exists('HTTP_X_FORWARDED_FOR', $headers) and\r\n\t\tfilter_var($headers['HTTP_X_FORWARDED_FOR'],\r\n\t\t\tFILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )){\r\n\r\n\t\t$the_ip = $headers['HTTP_X_FORWARDED_FOR'];\r\n\r\n\t} else {\r\n\t\t\r\n\t\t$the_ip = filter_var($_SERVER['REMOTE_ADDR'],\r\n\t\t\tFILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\r\n\r\n\t}\r\n\r\n\treturn $the_ip;\r\n}", "function getUserIP() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n}", "function get_client_ip_2() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'IP tidak dikenali';\r\n return $ipaddress;\r\n}", "function f_getIP() {\r\n $ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');\r\n foreach ($ip_keys as $key) {\r\n if (array_key_exists($key, $_SERVER) === true) {\r\n foreach (explode(',', $_SERVER[$key]) as $ip) {\r\n // trim for safety measures\r\n $ip = trim($ip);\r\n // attempt to validate IP\r\n ferror_log(\"Detected IP address: \" . $ip);\r\n if (f_validateIP($ip)) {\r\n return $ip;\r\n }\r\n }\r\n }\r\n }\r\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false;\r\n}", "function get_client_ip() {\r\n $ipaddress = '';\r\n if (getenv('HTTP_CLIENT_IP'))\r\n $ipaddress = getenv('HTTP_CLIENT_IP');\r\n else if(getenv('HTTP_X_FORWARDED_FOR'))\r\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\r\n else if(getenv('HTTP_X_FORWARDED'))\r\n $ipaddress = getenv('HTTP_X_FORWARDED');\r\n else if(getenv('HTTP_FORWARDED_FOR'))\r\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\r\n else if(getenv('HTTP_FORWARDED'))\r\n $ipaddress = getenv('HTTP_FORWARDED');\r\n else if(getenv('REMOTE_ADDR'))\r\n $ipaddress = getenv('REMOTE_ADDR');\r\n else\r\n $ipaddress = 'IP tidak dikenali';\r\n return $ipaddress;\r\n}", "public function getUserip()\n {\n // Find Client IP\n if (!empty($this->request->getServer('HTTP_CLIENT_IP'))) {\n $client = $this->request->getServer('HTTP_CLIENT_IP');\n }\n if (!empty($this->request->getServer('HTTP_X_FORWARDED_FOR'))) {\n $forward = $this->request->getServer('HTTP_X_FORWARDED_FOR');\n }\n if (!empty($this->request->getServer('REMOTE_ADDR'))) {\n $remote = $this->request->getServer('REMOTE_ADDR');\n }\n if (null !==$this->request->getServer(\"HTTP_CF_CONNECTING_IP\")) { //Find Cloud IP\n $remote=$this->request->getServer('REMOTE_ADDR');\n $client=$this->request->getServer('HTTP_CLIENT_IP');\n $remote = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n $client = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n }\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $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 real_ip_ad () {\n\t\t\n\t\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\n\t\t{\n\t\t# check for ip from shared internet\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\telseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n\t\t{\n\t\t// Check for the Proxy User\n\t\t$ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\t\t// This will print user's real IP Address\n\t\t// does't matter if user using proxy or not.\n\t\treturn $ip;\n\t}", "function getUserIP() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP)){\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)){\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }", "private static function getIp()\n {\n if (empty($_SERVER['REMOTE_ADDR']) && (Spry::isCli() || Spry::isCron() || Spry::isBackgroundProcess())) {\n return '127.0.0.1';\n }\n\n return $_SERVER['REMOTE_ADDR'] ?? 'No IP';\n }" ]
[ "0.7409453", "0.7203327", "0.716574", "0.7005674", "0.69193393", "0.6835137", "0.6825565", "0.68146676", "0.6812012", "0.6810015", "0.6809115", "0.68084943", "0.6796734", "0.679167", "0.67843634", "0.67748916", "0.674685", "0.6744405", "0.6743588", "0.67414576", "0.67345434", "0.6732535", "0.6720236", "0.6714538", "0.6710787", "0.67052436", "0.6704182", "0.67012995", "0.669676", "0.66870093", "0.6685832", "0.6684481", "0.6683455", "0.6672029", "0.6671609", "0.66620904", "0.66620904", "0.66620904", "0.66592216", "0.66590923", "0.66453767", "0.6636977", "0.6629459", "0.6629459", "0.6629459", "0.6628098", "0.6625534", "0.661216", "0.661216", "0.661216", "0.661216", "0.661216", "0.661216", "0.661216", "0.661216", "0.6610709", "0.6610042", "0.6607692", "0.66041106", "0.66020185", "0.6599719", "0.6596587", "0.65836203", "0.65753317", "0.65745944", "0.65638644", "0.6562897", "0.656282", "0.6562172", "0.6553127", "0.65525043", "0.6552229", "0.65495014", "0.65319467", "0.65310097", "0.6519984", "0.6513977", "0.6512274", "0.65114284", "0.65033174", "0.6492379", "0.6490473", "0.64904314", "0.648587", "0.64845675", "0.64794517", "0.6473458", "0.64734274", "0.64710337", "0.6470439", "0.64646065", "0.64568347", "0.6455812", "0.6454239", "0.6448497", "0.64457893", "0.644505", "0.6443492", "0.64359957", "0.64315313" ]
0.7476296
0
Determine how many failed login attempts comes from the guessed IP. Use a site transient to count them.
private function count_attempts( $ttl = 300 ) { if ( isset( $this->attempts ) ) { return; } $this->sniff_ip(); $ip = $this->ip_data[ 0 ]; $attempts = get_site_transient( self::TRANSIENT_NAME ); is_array( $attempts ) or $attempts = []; // Seems the first time a failed attempt for this IP if ( ! $attempts || ! array_key_exists( $ip, $attempts ) ) { $attempts[ $ip ] = [ 'count' => 0, 'last_logged' => 0, ]; } $attempts[ $ip ][ 'count' ] ++; $this->attempts_data = $attempts; $count = $attempts[ $ip ][ 'count' ]; $last_logged = $attempts[ $ip ][ 'last_logged' ]; /** * During a brute force attack, logging all the failed attempts can be so expensive to put the server down. * So we log: * * - 3rd attempt * - every 20 when total attempts are > 23 && < 100 (23rd, 43rd...) * - every 100 when total attempts are > 182 && < 1182 (183rd, 283rd...) * - every 200 when total attempts are > 1182 (1183rd, 1383rd...) */ $do_log = $count === 3 || ( $count < 100 && ( $count - $last_logged ) === 20 ) || ( $count < 1000 && ( $count - $last_logged ) === 100 ) || ( ( $count - $last_logged ) === 200 ); $do_log and $attempts[ $ip ][ 'last_logged' ] = $count; set_site_transient( self::TRANSIENT_NAME, $attempts, $ttl ); $this->attempts = $do_log ? $count : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ip_login_attempts_exceeded()\n {\n // Compare users IP address against any failed login IP addresses.\n $sql_where = array(\n $this->auth->tbl_col_user_account['failed_login_ip'] => $this->input->ip_address(),\n $this->auth->tbl_col_user_account['failed_logins'].' >= ' => $this->auth->auth_security['login_attempt_limit']\n );\n\n $query = $this->db->where($sql_where)\n ->get($this->auth->tbl_user_account);\n\n return $query->num_rows() > 0;\n }", "public function failedLoginAttempts() : int\n {\n return (isset($this->data['failed_login_attempts'])) ? (int)$this->data['failed_login_attempts'] : 0;\n }", "public static function ipLoginAttempts($ip = null)\r\n {\r\n if (!filter_var($ip, FILTER_VALIDATE_IP)) {\r\n $ip = Help::getIp();\r\n }\r\n $return = App::$db->\r\n create('SELECT count(user_id) as attempts FROM user_logs WHERE ip = :ip AND `timestamp` > :timenow AND `action` = :action AND `what` = :what')->\r\n bind($ip, 'ip')->\r\n bind(time() - 1200, 'timenow')->\r\n bind('FAILLOGIN', 'action')->\r\n bind('A', 'what')->\r\n execute();\r\n\r\n return $return[0]['attempts'];\r\n }", "public function getFailedLogins() : int\n {\n return $this->failed_logins;\n }", "function login_attempts()\n {\n // delete older attempts\n $older_time = date('Y-m-d H:i:s', strtotime('-' . $this->config->item('login_max_time') . ' seconds'));\n\n $sql = \"\n DELETE FROM login_attempts\n WHERE attempt < '{$older_time}'\n \";\n\n $query = $this->db->query($sql);\n\n // insert the new attempt\n $sql = \"\n INSERT INTO login_attempts (\n ip,\n attempt\n ) VALUES (\n \" . $this->db->escape($_SERVER['REMOTE_ADDR']) . \",\n '\" . date(\"Y-m-d H:i:s\") . \"'\n )\n \";\n\n $query = $this->db->query($sql);\n\n // get count of attempts from this IP\n $sql = \"\n SELECT\n COUNT(*) AS attempts\n FROM login_attempts\n WHERE ip = \" . $this->db->escape($_SERVER['REMOTE_ADDR'])\n ;\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n $results = $query->row_array();\n $login_attempts = $results['attempts'];\n if ($login_attempts > $this->config->item('login_max_attempts'))\n {\n // too many attempts\n return FALSE;\n }\n }\n\n return TRUE;\n }", "public static function countFailedLogins($ipAddress = null, $time = null) {\n\t\t// take default values\n\t\tif ($ipAddress === null) $ipAddress = WCF::getSession()->ipAddress;\n\t\tif ($time === null) $time = (TIME_NOW - FAILED_LOGIN_TIME_FRAME);\n\t\t\n\t\t// get number of failed logins\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".WCF_N.\"_user_failed_login\n\t\t\tWHERE\tipAddress = '\".escapeString($ipAddress).\"'\n\t\t\t\tAND time > \".$time;\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\t\treturn $row['count'];\n\t}", "protected function maxLoginAttempts()\n {\n return Arr::get(static::$config, 'attempts', 5);\n }", "public function getFailedLoginsCount()\n {\n return (int) $this->getConfigValue('lockoutexpirationlogin', 0);\n }", "public function attempts(): int\n {\n return $this->attempts;\n }", "public function attempts() {\n\t\treturn 0;\n\t}", "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "public function getNumCanLogin(){\n $Today = $_SERVER['REQUEST_TIME'];\n $Eventconf = Common::getConfig('Event', EventType::KeepLogin); \n $Begin = $Eventconf['BeginTime'];\n $Expired = $Eventconf['ExpireTime']; \n $NumCanLogin = $this->getNumberDays($Begin,$Today);\n $ConfigGift = Common::getConfig(\"KeepLogin_Gift\");\n $NumConfigGift = count($ConfigGift);\n if($NumCanLogin > $NumConfigGift){\n $NumCanLogin = $NumConfigGift;\n }\n return $NumCanLogin; \n }", "protected function _handle_count_fail()\n\t{\n\t\t$count_max = mod('deposit_card')->setting('fail_count_max');\n\t\t$block_timeout = mod('deposit_card')->setting('fail_block_timeout') * 60;\n\n\t\tif (!$count_max) return;\n\n\t\t$count = model('ip')->action_count_change('deposit_card_fail', 1);\n\n\t\tif ($count >= $count_max) {\n\t\t\t$ip = t('input')->ip_address();\n\n\t\t\tmodel('ip_block')->set($ip, $block_timeout);\n\t\t\tmodel('ip')->action_count_set('deposit_card_fail', 0);\n\t\t}\n\t}", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function attempts()\n {\n return $this->sportevent ? $this->sportevent->attempts() : 1;\n }", "public function check_login_attempts($ip_address) {\n\t\t$max_login_attempts = 3;\n\t\t$max_locked_time = 600; // locked at 30 minutes\n\t\t$login_attempts = $this->CI->m_users->check_login_attempts($ip_address);\n\t\tif ($login_attempts) {\n\t\t\tif ($login_attempts->counter >= $max_login_attempts) {\n\t\t\t\t$datetime = strtotime($login_attempts->updated_at);\n\t\t\t\t$difference = time() - $datetime;\n\t\t\t\tif ($difference >= $max_locked_time) {\n\t\t\t\t\t$this->clear_login_attempts($ip_address);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "private function checkbrute() {\n $now = time();\n\n // All login attempts are counted from the past 2 hours.\n $valid_attempts = $now - (2 * 60 * 60);\n\n if ($query = $this->db->prepare(\"SELECT COUNT(*) FROM authLogins WHERE userId = ? AND time > ?\")\n ) {\n // Execute the prepared query.\n $query->execute([$this->userId, $valid_attempts]);\n\n // If there have been more than 5 failed logins\n if ($query->fetch()[0] > 5) {\n $this->isLogin = true;\n } else {\n $this->isLogin = false;\n }\n }\n\n return $this->isLogin;\n }", "private function getTries() {\n\t\tif( !isset($this->num_tries) ){\n\t\t\tif( !isset($_SESSION['levelTries']) ){\n\t\t\t\t$_SESSION['levelTries'] = array();\n\t\t\t}\n\t\t\tif( isset($_SESSION['levelTries'][$this->level_id]) ){\n\t\t\t\t$this->num_tries = $_SESSION['levelTries'][$this->level_id];\n\t\t\t} else {\n\t\t\t\t$this->num_tries = 0;\n\t\t\t\t$_SESSION['levelTries'][$this->level_id] = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->num_tries;\n\t}", "public function countAuthAttempts()\n {\n $previous = Mage::getSingleton('core/session')->getCCAttempts();\n\n if(!$previous)\n {\n $previous = 1;\n } else {\n $previous++;\n }\n\n Mage::getSingleton('core/session')->setCCAttempts($previous);\n }", "protected function getDisplayedLoginsCount(): int {\n return 100;\n }", "public function attempts();", "function increment_failed($username = \"\") {\n\t\tglobal $wpdb;\n\n\t\t$ip = $this->get_user_ip();\n\n\t\t$username = sanitize_user($username);\n\n\t\t$user = get_user_by( 'login', $username );\n\n\t\tif ( !$user ) { \n\t\t\t$user = new stdClass();\n\t\t\t$user->ID = 0;\n\t\t}\n\n\t\t$sql = \"insert into \" . $this->fail_table . \" (user_id, login_attempt_date, login_attempt_IP) \" .\n\t\t\t\"values ('\" . $user->ID . \"', now(), '\" . $wpdb->escape($ip) . \"')\";\n\n\t\t$wpdb->query($sql);\n\n\t}", "private function increase_login_attempts($ip_address) {\n\t\t$this->CI->m_users->increase_login_attempts($ip_address);\n\t}", "private function _countLogin ()\r\n {\r\n $date = date(\"Y-m-d H:i:s\");\r\n $sql = \"UPDATE `admin` SET `last_login` = '$date', `number_logins` = `number_logins` + 1 WHERE `username` = '{$this->_username}'\";\r\n mysql_query($sql, db_c());\r\n \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_login', 'user={$this->_username};IP={$ip}')\";\r\n mysql_query($sql, db_c());\r\n }", "private function getAttempts()\n {\n return Attempt::where('ip', $this->ip)\n ->whereDate('created_at', date(\"Y-m-d\"))\n ->count();\n }", "function get_login_failures($username,$period){\n $query = \"SELECT * FROM LOGGINS WHERE USERNAME='\" . $username . \"' && TIME>\" . (time()-$period) . \" && SUCCESS=0\"; \n $result = $this->query( $query);\n $number = $result->num_rows; \n $result->close();\t\n\n return $number;\n }", "public function attempts()\n\t{\n\t\treturn request()->header('X-AppEngine-TaskExecutionCount');\n\t}", "private function getAttempt($ip) {\n $attempt_count = $this->db->select(\"SELECT count FROM \".PREFIX.\"attempts WHERE ip=:ip\", array(':ip' => $ip));\n $count = count($attempt_count);\n\n if ($count == 0) {\n $attempt_count[0] = new \\stdClass();\n $attempt_count[0]->count = 0;\n }\n return $attempt_count;\n }", "function NewFailedLoginAttempt($ip,$user) {\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $nip=strip_tags($ip);\r\n $nuser=strip_tags($user);\r\n $anyFail=$connection->query(\"select * from accessres where username='$nuser'\") or die(json_encode(array(\"err\"=>mysqli_error($connection))));\r\n //if ($anyFail->num_rows>0) {\r\n $failrow=$anyFail->fetch_assoc();\r\n $failtime=date(\"Y-m-d H:i:s\");\r\n if($failrow[\"attempt\"]==0 || $anyFail->num_rows==0) {\r\n SetAccessRestriction($nip,$nuser,$failtime,1);\r\n return true; // First time fail\r\n }\r\n elseif ($failrow[\"attempt\"]==1) { //You must change this number with fail attempt limit you'd like to \r\n SetAccessRestriction($nip,$nuser,$failtime,2);\r\n return false; //Access restricted\r\n }\r\n //}\r\n }", "public function getFailuresCountInInterval($login, $ip)\n {\n $login = $this->_filterLogin($login);\n\n $connection = $this->getConnection();\n $table = $this->getMainTable();\n $failureTable = $this->getFailureTableName();\n\n $ts = $this->dateTime->gmtTimestamp() - $this->helperData->getFailureInterval();\n\n $qry = $connection->select()\n ->from($table, 'COUNT(*)')\n ->joinLeft($failureTable, $table.'.msp_user_lockout_id = '.$failureTable.'.msp_user_lockout_id')\n ->where(\n 'login = ' . $connection->quote($login) . ' AND '\n . 'ip = ' . $connection->quote($ip) . ' AND '\n . 'date_time >= ' . $connection->quote($this->dateTime->gmtDate(null, $ts))\n );\n\n return intval($connection->fetchOne($qry));\n }", "function three_strikes_log($count, $ip)\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t$this->ensure_log();\r\n\t\t\r\n\t\t$sql = \"select count(*) from $wpdb->three_strikes \" .\r\n\t\t\t\t\"where strike_ip='\" . $wpdb->escape($ip) . \"'\";\r\n\t\t$count += $wpdb->get_var($sql);\r\n\t\treturn $count;\r\n\t}", "public function getMaxAttemptTimes(): int\n {\n return 3;\n }", "function incrementOfflineFails() {\n\t\t\t$numFails = $this->settings[\"numbervalidatefails\"];\n\t\t\tif ($numFails == \"\") {\n\t\t\t\t$this->updateSetting(\"numbervalidatefails\", 0);\n\t\t\t\t$numFails = 0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t if ($this->maxDaysOffline <> 0) {\n\t\t\t\t// There is a limit\n\t\t\t\tif ($this->debug) echo \"<BR>There is a limit on the number of offline fails. Checking limit.\";\n\t\t\t\t// Is it more than 24 hours since last fail?\n\t\t\t\t$lastFail = $this->settings[\"lastvalidateattempt\"];\n\t\t\t\t\n\t\t\t\tif ((time()-$lastFail) > (24*60*60)) {\n\t\t\t\t\tif ($this->debug) echo \"<BR>More than 24 hours since last fail\";\n\t\t\t\t\t// Yes\n\t\t\t\t\t$numFails++;\n\t\t\t\t\t$this->updateSetting(\"numbervalidatefails\", $numFails);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// If it's failed more times than the limit, set the license to inactive\n\t\t\t\t\tif ($numFails > $this->maxDaysOffline) {\n\t\t\t\t\t\tif ($this->debug) echo \"<BR>More than max number of allowed fails, so license is to be made inactive\";\n\t\t\t\t\t\t$this->setLicenseInactive();\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\tif ($this->debug) echo \"<BR>Less than 24 hours since last fail\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo \"<BR>No limit on the number of offline fails.\";\n\t\t\t}\n\t\t\treturn $numFails;\n\t\t}", "public function isExceededAttempts()\n { \n $attempts = $this->con->prepare(\"SELECT attempts, last_attempts FROM login_attempts WHERE user_id = ? AND ip = ? \");\n $attempts->bind_param('is', $this->user_id, $this->ip);\n $attempts->execute();\n $attempts->store_result();\n $attempts->bind_result( $number_attempts, $last_attempts);\n $attempts->fetch();\n $rows_attempts = $attempts->num_rows;\n $attempts->free_result();\n $attempts->close();\n \n if( $attempts and $rows_attempts > 0)\n {\n $last_attempts = $this->calcIntervalAttempts($last_attempts);\n if($number_attempts >= self::$max_attempts and $last_attempts <= self::$time_bloq)\n {\n return self::$time_bloq - $last_attempts;\n } \n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "function blightAttemp()\n{\n\t$db = blightDB();\n\t$sessid = GWF_Session::getSession()->getID();\n\t$query = \"SELECT attemp FROM blight WHERE sessid=$sessid\";\n\tif (false === ($result = $db->queryFirst($query))) {\n\t\treturn -1;\n\t}\n\treturn (int)$result['attemp'];\n}", "public function trackLoginAttempts()\n {\n return $this->getBoolean('track_login_attempts');\n }", "public function max_login_attempts(){\n\t\t\t\n\t\t\t$username = strtolower($this->input->post('username'));\n\t\t\t\n\t\t\t$date = date(\"Y-m-d H:i:s\",time());\n\t\t\t$date = strtotime($date);\n\t\t\t$min_date = strtotime(\"-1 day\", $date);\n\t\t\t\n\t\t\t$max_date = date('Y-m-d H:i:s', time());\n\t\t\t$min_date = date('Y-m-d H:i:s', $min_date);\n\t\t\t\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('failed_logins');\n\t\t\t$this->db->where('username', $username);\n\t\t\t\n\t\t\t$this->db->where(\"attempt_time BETWEEN '$min_date' AND '$max_date'\", NULL, FALSE);\n\n\t\t\t$query = $this->db->get();\n\t\t\t\n\t\t\tif ($query->num_rows() < 3){\t\n\t\t\t\treturn TRUE;\t\n\t\t\t}else {\t\n\t\t\t\t$this->form_validation->set_message('max_login_attempts', 'You have surpassed the allowed number of login attempts in 24 hours! Please contact Customer Service!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "public function checkTooManyFailedAttempts()\n {\n \n if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {\n return;\n }\n\n throw new \\Exception('IP address banned. Too many login attempts, please waite for 3 minutes and Try again!');\n }", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\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\t$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function howManyTries($email, $passDate)\n {\n $bdd = connexMedoo();\n $total = $bdd->count('connexions', '*', [\n 'login' => $email,\n 'date[>]' => $passDate\n ]);\n if(!empty($total)) {\n return $total;\n } else {\n return false;\n }\n }", "function check_attempted_login( $user, $username, $password ) {\n if ( get_transient( 'attempted_login' ) ) {\n $datas = get_transient( 'attempted_login' );\n if ( $datas['tried'] >= 3 ) {\n $until = get_option( '_transient_timeout_' . 'attempted_login' );\n $time = time_to_go( $until );\n return new WP_Error( 'too_many_tried', sprintf( __( '<strong>ERRO</strong>: o limite de tentativas de login foi atingido, tente novamente novamente em %1$s.' ) , $time ) );\n }\n }\n return $user;\n }", "public function getLoginCount(): int\n {\n return (int) $this->_getEntity()->getLoginCount();\n }", "public function getRetry() : int\n {\n return $this->getValue('nb_domain_zone_retry');\n }", "public function getCountAuthFailures($userid){\r\n\tglobal $pdo;\r\n\tif(empty($this->app_config['account_reactivation_time_min'])){\r\n\t\t$this->setError('Account reactivation time is not set.');\r\n\t\treturn false;\r\n\t}\r\n\ttry{\r\n\t$select = $pdo->prepare(\"SELECT count(*) AS count FROM `authentication_log`\r\n\t\tWHERE `attempted` > DATE_SUB(NOW(), INTERVAL \".$this->app_config['account_reactivation_time_min']. \" MINUTE)\r\n\t\tAND `result` = 0 AND `user_id` = ?\");\r\n\t$select->execute(array($userid));\r\n\t}\r\n\tcatch(PDOException $e){\r\n\t\t$this->setError($e->getMessage());\r\n\t\treturn false;\r\n\t}\t\r\n\t$row = $select->fetch(PDO::FETCH_ASSOC);\r\n//print_r($row);\r\n\treturn $row['count'];\r\n}", "public function tooManyFailedLogins()\n\t{\n\t\treturn $this->FailedLoginAttempts >\n\t\t\tYii::app()->params['authentication']['accountLocking']['failedLogins'];\n\t}", "function ban_loginFailed($args) {\n $ip = $_SERVER['REMOTE_ADDR']; \n if ( $this->isWhitelisted($ip) ) {\n rcube::write_log('bruteforcebreaker', sprintf(\"Whitelist login for %s.\", $ip));\n return $args;\n }\n \n $this->load_ipban();\n \n if (!isset($this->data_ban['FAILURES'][$ip])) \n $this->data_ban['FAILURES'][$ip] = 0;\n $this->data_ban['FAILURES'][$ip]++;\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Login failed for %s. Number of attemps: %d.\", $ip, $this->data_ban['FAILURES'][$ip]));\n \n if ($this->data_ban['FAILURES'][$ip] > ($this->rc->config->get('bruteforcebreaker_nb_attemps', 5) -1 )) {\n $this->data_ban['BANS'][$ip] = time() + $this->rc->config->get('bruteforcebreaker_duration', 1800);\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"IP address banned from login - too many attemps (%s).\", $ip));\n }\n\n $this->write_ipban();\n return $args;\n }", "function getLoginStrikes()\n\t{\n\t\t$strikes = $this->DB->database_select('activity', 'activity_strikes',\n\t\t\t\t\t\tarray('activity_ip' => $_SERVER['REMOTE_ADDR'], 'activity_type' => 'logins'), 1);\n\t\treturn ($strikes == false) ? 0 : $strikes['activity_strikes'];\n\t}", "protected function increase_attemps()\r\n {\r\n $_SESSION['ATTEMPS'] = (isset($_SESSION['ATTEMPS']) ? $_SESSION['ATTEMPS']++ : 0);\r\n $this->display_login();\r\n }", "public function get_maximum_tries() {\n $max = 1;\n foreach ($this->get_response_class_ids() as $responseclassid) {\n $max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());\n }\n return $max;\n }", "public function getAttemptsCount()\n {\n if (array_key_exists(\"attemptsCount\", $this->_propDict)) {\n return $this->_propDict[\"attemptsCount\"];\n } else {\n return null;\n }\n }", "private function getNumberOfBadAttempts($email)\n {\n try {\n $db_query = $this->db->prepare('SELECT count(*) AS count FROM login_attempts WHERE email=:email');\n $db_query->bindParam(':email', $email);\n $db_query->execute();\n if ($db_query->rowCount()) {\n $res = $db_query->fetch(PDO::FETCH_ASSOC);\n return $res['count'];\n } else {\n return null;\n }\n } catch (PDOException $e) {\n DBErrorLog::loggingErrors($e);\n }\n }", "public function maxAttempts(): int\n {\n return 5;\n }", "function is_max_login_attempts_exceeded($login)\n\t{\n\t\tif ($this->ci->config->item('login_count_attempts', 'syndicates')) {\n\t\t\t$this->ci->load->model('login_attempts');\n\t\t\treturn $this->ci->login_attempts->get_attempts_num($this->ci->input->ip_address(), $login)\n\t\t\t\t\t>= $this->ci->config->item('login_max_attempts', 'syndicates');\n\t\t}\n\t\treturn FALSE;\n\t}", "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 getFailedUsersCount()\n {\n if (array_key_exists(\"failedUsersCount\", $this->_propDict)) {\n return $this->_propDict[\"failedUsersCount\"];\n } else {\n return null;\n }\n }", "function getAttempts($unique = false){\n\t\trequire('quizrooDB.php');\n\t\tif($unique){\n\t\t\t$query = sprintf(\"SELECT COUNT(*) as count FROM (SELECT store_id FROM q_store_result WHERE fk_quiz_id = %s GROUP BY fk_member_id) t\", $this->quiz_id);\n\t\t}else{\n\t\t\t$query = sprintf(\"SELECT COUNT(*) as count FROM (SELECT store_id FROM q_store_result WHERE fk_quiz_id = %s) t\", $this->quiz_id);\n\t\t}\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\t$totalRows_getQuery = mysql_num_rows($getQuery);\n\t\t\n\t\tif($totalRows_getQuery == 0){\n\t\t\treturn 0;\n\t\t}else{\n\t\t\treturn $row_getQuery['count'];\n\t\t}\n\t}", "public function getReturnedErrorCount()\n {\n $errors = 0;\n foreach ($this->data['calls'] as $call) {\n $errors += ($call['statusCode'] != 200) ? 1 : 0;\n }\n\n return $errors;\n }", "public function getFailedAttemptsCount()\n {\n return $this->failedAttemptsCount;\n }", "public function getMaximumAttempts();", "public function getFailed(): int\n {\n return $this->failed;\n }", "protected function timeRetry(): int\n {\n return 300;\n }", "function BB_countBlockedIPs ()\n{\n $result = DB_query (\"SELECT COUNT(DISTINCT ip) AS count FROM \" . WP_BB_LOG);\n list($blocked_ips) = DB_fetchArray ($result);\n\n return $blocked_ips;\n}", "function importUserCount()\n {\n //pretend there are 5 users on the bridge install that were not found on the local.\n return 5;\n }", "public function getRetries(): int\n {\n return $this->retries;\n }", "public static function getNumberOfBackendUsersWithInsecurePassword() {}", "public function getAttemptsMade(string $key): int \n {\n if(! is_null($data = $this->cache->get($this->cleanKeyFromUnicodeCharacters($key)))) {\n return $data['content'];\n }\n\n return 0;\n }", "public function loginAttempts()\n {\n $processReaction = $this->userEngine->prepareLoginAttempts();\n\n return __processResponse($processReaction, [],\n $processReaction['data']);\n }", "private function getFailedLogins() {\n $last_logins = array();\n $cron_interval = $this->config('acquia_connector.settings')->get('spi.cron_interval');\n\n if (\\Drupal::moduleHandler()->moduleExists('dblog')) {\n $result = db_select('watchdog', 'w')\n ->fields('w', array('message', 'variables', 'timestamp'))\n ->condition('w.message', 'login attempt failed%', 'LIKE')\n ->condition('w.timestamp', REQUEST_TIME - $cron_interval, '>')\n ->condition('w.message', array(\n \"UPGRADE.txt\",\n \"MAINTAINERS.txt\",\n \"README.txt\",\n \"INSTALL.pgsql.txt\",\n \"INSTALL.txt\",\n \"LICENSE.txt\",\n \"INSTALL.mysql.txt\",\n \"COPYRIGHT.txt\",\n \"CHANGELOG.txt\",\n ), 'NOT IN')\n ->orderBy('w.timestamp', 'DESC')\n ->range(0, 10)\n ->execute();\n\n foreach ($result as $record) {\n $variables = unserialize($record->variables);\n if (!empty($variables['%user'])) {\n $last_logins['failed'][$record->timestamp] = Html::escape($variables['%user']);\n }\n }\n }\n return $last_logins;\n }", "public function getLoginTries($email){\n $result=$this->con->query(\"SELECT lock_count FROM user WHERE email='\".$email.\"';\");\n $num_rows=$result->num_rows;\n if($num_rows==1){\n \n $lock=$result->fetch_assoc();\n $row=$lock['lock_count'];\n return $row;\n }\n else return NULL;\n \n }", "public function retryAttempted()\n {\n $this->attempts++;\n }", "public static function totalAttempts($user)\n {\n return count(parent::find(array(\n \"conditions\" => \"loginAttemptUserID = ?1\",\n \"bind\" => array(1 => $user->getUserID())\n )));\n }", "public function getFailedCount()\n {\n return $this->failed_count;\n }", "public function update_failed_logins(){\n\n\t}", "protected function getSecurityCount()\n\t{\n\t\t$count = App\\Log::getLogs('access_for_admin', 'oneDay', true);\n\t\t$count += App\\Log::getLogs('access_to_record', 'oneDay', true);\n\t\t$count += App\\Log::getLogs('access_for_api', 'oneDay', true);\n\t\treturn $count + App\\Log::getLogs('access_for_user', 'oneDay', true);\n\t}", "public function getLoginCounts_always_returnCorrectly()\n {\n $this->assertEquals($this->user['logins_count'], $this->entity->getLoginCounts());\n }", "protected function increaseFailedLogins($login)\n {\n $sql = '\n UPDATE\tuser\n SET\t\tloginfailed = loginfailed+1\n WHERE\tlogin = %s\n ';\n $sql = sprintf($sql, $login);\n Frapi_Database::getInstance()->query($sql);\n }", "public function getLoginCount()\n {\n return $this->getFieldValue('loginCount');\n }", "private function checkLoginAttempts(Request $request)\n {\n // the login attempts for this application. We'll key this by the username and\n // the IP address of the client making these requests into this application.\n if (\n method_exists($this, 'hasTooManyLoginAttempts') &&\n $this->hasTooManyLoginAttempts($request)\n ) {\n $this->fireLockoutEvent($request);\n\n return $this->sendLockoutResponse($request);\n }\n }", "public function checkTooManyFailedAttempts()\n {\n if (! RateLimiter::tooManyAttempts($this->throttleKey(), 10)) {\n return;\n }\n\n throw new Exception(__('controller.auth.login_attempts'), 401);\n }", "final public static function HpsMaximumNumberOfRetryTransactionWasBreached()\n {\n return self::get(822);\n }", "public function loginAttempts($userName, $option=FALSE){\n\n $blockTime = \\Phalcon\\DI::getDefault()->getShared('config')->brute->block_time * 60;\n\n $user = Users::findFirst(array('username=:username:', 'bind' => array(':username' => $userName)));\n if($user){\n $userId = $user->id;\n }else{\n // user didn't even get the user name right\n $userId = NULL;\n }\n\n $footprint = md5(\\Phalcon\\DI::getDefault()->getShared('request')->getClientAddress() . \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent());\n // if clearing attempts after successful login\n if($option == 'clear'){\n $toDelete = FailedLogins::find(array('conditions' => 'user_id=:user_id: OR time <' . (time() - 60 * 60 * 24* 365), 'bind' => array(':user_id' => $userId)));\n if(count($toDelete) > 0){\n $toDelete->delete();\n return TRUE;\n }\n }\n $captcha = FALSE;\n $block = FALSE;\n // get attempts so far\n if(is_numeric($userId)) {\n // if username was correct\n $attemptsDb = FailedLogins::find(array('conditions' => '(user_id=:user_id: OR footprint=:footprint:) AND time >' . (time() - $blockTime), 'bind' => array(':user_id' => $userId, ':footprint' => $footprint)));\n $attempts = count($attemptsDb);\n }else{\n // if username was not correct - we search on footprint only\n $attemptsDb = FailedLogins::find(array('conditions' => 'footprint=:footprint: AND time >' . (time() - $blockTime), 'bind' => array(':footprint' => $footprint)));\n $attempts = count($attemptsDb);\n }\n\n\n if($option != 'state') {\n // increment the number of attempts\n $attempts++;\n // generate record in DB\n $fail = new FailedLogins();\n $fail->user_id = $userId;\n $fail->time = time();\n $fail->ip = \\Phalcon\\DI::getDefault()->getShared('request')->getClientAddress();\n $fail->useragent = \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent();\n $fail->footprint = $footprint;\n $fail->save();\n }\n\n // carry out blocks\n if($attempts >= 1 && $attempts <= 3){\n if($option != 'state') {\n sleep($attempts * 2); // throttle speed to slow them down\n }\n }else if($attempts > 3 && $attempts < 10){\n if($option != 'state') {\n sleep($attempts); // throttle attempts for longer and longer\n }\n $captcha = TRUE; // now we start using captcha\n }else if($attempts >= 10){\n if($option != 'state') {\n sleep($attempts); // throttle attempts for longer and longer\n }\n $captcha = TRUE; // now we start using captcha\n $block = TRUE; // block the login form\n }\n return array('attempts' => $attempts, 'attempts_left' => (10 - $attempts), 'captcha' => $captcha, 'block' => $block);\n }", "public function getFailureCount(): int\n {\n return (int) $this->_getEntity()->getFailureCount();\n }", "public function maxTries();", "public function getErrorCount();", "public function attempt(string $username, string $password): ?int;", "public function getAppEvnAttempts ()\n {\n return $this->app_evn_attempts;\n }", "public function tries($tries);", "function checkbrute($email, $mysqli) {\n $now = time();\n // All login attempts are counted from the past 2 hours. \n $valid_attempts = $now - (2 * 60 * 60); \n \n if ($stmt = $mysqli->prepare(\"SELECT time FROM login_attempts WHERE email = ? AND time > '$valid_attempts'\")) { \n $stmt->bind_param('i', $email); \n // Execute the prepared query.\n $stmt->execute();\n $stmt->store_result();\n // If there has been more than 5 failed logins\n if($stmt->num_rows > 5) {\n return true;\n } else {\n return false;\n }\n }\n}", "function user_log_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//check to see if the address was authenticated successfully\n\t\t$sql = \"select count(user_log_uuid) \";\n\t\t$sql .= \"from v_user_logs \";\n\t\t$sql .= \"where remote_address = :remote_address \";\n\t\t$sql .= \"and result = 'success' \";\n\t\t$sql .= \"and timestamp > NOW() - INTERVAL '8 days' \";\n\t\t$parameters['remote_address'] = $ip_address; \n\t\t$database = new database;\n\t\t$user_log_count = $database->select($sql, $parameters, 'column');\n\t\tunset($database);\n\n\t\t//debug info\n\t\tif ($debug) {\n\t\t\techo \"address \".$ip_address.\" count \".$user_log_count.\"\\n\";\n\t\t}\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif ($user_log_count > 0) {\n\t\t\t$allowed = true;\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "public function addLoginAttempt($value, $username) {\r\n // set last login attempt time if required\r\n \t $q = \"SELECT * FROM \".TBL_ATTEMPTS.\" WHERE ip = '$value' and username = '$username'\";\r\n \t $result = $this->conn->query($q);\r\n \t $data = mysqli_fetch_array($result); //$result->fetch_assoc(); // mysql_fetch_array($result);\r\n\r\n\r\n \t if($data)\r\n {\r\n $attempts = $data[\"attempts\"]+1;\r\n $locked = 1;\r\n\r\n if($attempts == 3) {\r\n \t\t $q = \"UPDATE \".TBL_ATTEMPTS.\" SET attempts=\".$attempts.\", lastlogin=NOW() WHERE ip = '$value' and username = '$username'\";\r\n \t\t $result = $this->conn->query($q);\r\n\r\n $q1 = \"UPDATE \".TBL_USERS.\" SET locked=\".$locked.\" WHERE username = '$username'\";\r\n \t\t $result1 = $this->conn->query($q1);\r\n\r\n $subject = \"Access denied for \".TIME_PERIOD.\" minutes\";\r\n $message = 'Login failed. You have entered the incorrect credentials multiple times and your account is now locked' ;\r\n sendEmail($subject, $message);\r\n \t\t}\r\n else {\r\n \t\t $q = \"UPDATE \".TBL_ATTEMPTS.\" SET attempts=\".$attempts.\" WHERE ip = '$value' and username = '$username'\";\r\n \t\t $result = $this->conn->query($q);\r\n \t\t}\r\n }\r\n else {\r\n \t $q = \"INSERT INTO \".TBL_ATTEMPTS.\" (attempts,IP,lastlogin,username) values (1, '$value', NOW(), '$username')\";\r\n \t $result = $this->conn->query($q);\r\n \t }\r\n }", "private function IncreaseFailedLoginAttempts($UserID)\n\t{\n\t\tj::SQL(\"UPDATE jfp_xuser SET FailedLoginAttempts=FailedLoginAttempts+1 WHERE ID=? LIMIT 1\",$UserID);\n\t}", "public function increaseFailedAttemptsCount()\n {\n $this->failedAttemptsCount++;\n }", "public function getProcessingAttemptsCounter() : int\n\t{\n\t\treturn $this->processingAttemptsCounter;\n\t}", "function calcNumActiveUsers(){\n\t\t//calculate number of useres on site\n\t\t$q = \"SELECT * FROM \".TBL_ACTIVE_USERS;\n\t\t$result = mysql_query($q, $this->connection);\n\t\t$this->num_active_users = mysql_numrows($result);\n\t}", "private function loginFailed()\n {\n //Login failed...\n }", "public function iN_TotalVerificationRequests() {\n\t\t$q = mysqli_query($this->db, \"SELECT COUNT(*) AS verificationCount FROM i_verification_requests WHERE request_status = '0'\") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($q, MYSQLI_ASSOC);\n\t\tif ($row) {\n\t\t\treturn isset($row['verificationCount']) ? $row['verificationCount'] : '0';\n\t\t} else {return 0;}\n\t}", "protected function checkLoginAttempts($email)\n\t{\n\t\t/**\n\t\t* Get attempts from DB and check with predefined field\n\t\t* All login attempts are counted from the past 1 hours. \n\t\t**/\n\t\t$login_attempts = $this->loginModel->checkAttempts($email);\n\t\tif ($login_attempts && ($login_attempts['count'] >= 4) && strtotime('-1 hour') < strtotime($login_attempts['date_modified'])) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public function attempts()\n {\n return (int) ($this->job->getAttributes()['ApproximateReceiveCount'] ?? 0);\n }", "public function authenticate() {\r\n $db = db_connect();\r\n $statement = $db->prepare(\"select Username, Password from users WHERE Username = :name;\");\r\n $statement->bindValue(':name', $this->username);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n $hash_pwd = $rows[0]['Password'];\r\n $password = $this->password;\r\n\r\n if (!password_verify($password, $hash_pwd)) {\r\n $attempt = 1;\r\n $statement = $db->prepare(\"select * from logfail WHERE Username = :name;\");\r\n $statement->bindValue(':name', $this->username);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n $attempt_number = $rows[0]['Attempt'];\r\n\r\n if ($attempt_number >= 3) {\r\n sleep(60);\r\n $statement = $db->prepare(\"UPDATE logfail SET Attempt = :attempt WHERE Username = :user\");\r\n $statement->bindValue(':user', $this->username);\r\n $statement->bindValue(':attempt', 0);\r\n $statement->execute();\r\n $this->auth = false;\r\n } else if ($rows) {\r\n $attempt = $attempt_number + 1;\r\n $statement = $db->prepare(\"UPDATE logfail SET Attempt = :attempt WHERE Username = :user\");\r\n $statement->bindValue(':user', $this->username);\r\n $statement->bindValue(':attempt', $attempt);\r\n $statement->execute();\r\n } else {\r\n\r\n $statement1 = $db->prepare(\"INSERT INTO logfail (Username, Attempt)\"\r\n . \"VALUES (:username, :attempt); \");\r\n $statement1->bindValue(':username', $this->username);\r\n $statement1->bindValue(':attempts', $attempt);\r\n $statement1->execute();\r\n }\r\n $this->auth = false;\r\n } else {\r\n $this->auth = true;\r\n $_SESSION['username'] = $rows[0]['Username'];\r\n $_SESSION['password'] = $rows[0]['Password'];\r\n }\r\n }", "public function insertOrIncrementFailureCount(\\DateTime $dateTime, $username, $ipAddress, $cookieToken, Rejection $rejection=null);" ]
[ "0.693043", "0.68526065", "0.68348575", "0.65517443", "0.65223", "0.65087265", "0.6336813", "0.6327731", "0.62391406", "0.61682487", "0.6148945", "0.613336", "0.6105912", "0.6099918", "0.6070535", "0.60659397", "0.6059388", "0.60518163", "0.6040616", "0.6009451", "0.59772134", "0.59747463", "0.5972612", "0.5967579", "0.5957638", "0.5919089", "0.59028614", "0.5899385", "0.5891986", "0.5882963", "0.58784693", "0.58374065", "0.58357126", "0.58347946", "0.5830323", "0.5813771", "0.58051884", "0.5803593", "0.5803444", "0.5797016", "0.5795256", "0.57822746", "0.5774856", "0.57690823", "0.5765643", "0.5760938", "0.56916195", "0.56776476", "0.56766266", "0.5630653", "0.5629233", "0.55934316", "0.5587193", "0.5580337", "0.5578535", "0.55506766", "0.55501604", "0.55392206", "0.5518968", "0.5499658", "0.5498725", "0.5494857", "0.5493127", "0.5492515", "0.5490594", "0.5486447", "0.54835236", "0.54797935", "0.5467365", "0.5465996", "0.5455679", "0.54516", "0.5444353", "0.5440903", "0.54387385", "0.54293436", "0.54233205", "0.54078066", "0.5403179", "0.53878385", "0.53839016", "0.5370241", "0.53543895", "0.53531706", "0.5348775", "0.53483546", "0.5343361", "0.5319292", "0.5312196", "0.5307779", "0.5304961", "0.5302204", "0.5298562", "0.5297367", "0.5276801", "0.52746433", "0.52714753", "0.52691203", "0.52669203", "0.5263254" ]
0.7296067
0
Debug::dump("Jestem w bootstrapie defaultowym :)");
protected function _initDoctype() { // $this->bootstrap('view'); // $view = $this->getResource('view'); // // $view->headTitle('Module Frontend'); // $view->headLink()->appendStylesheet('/css/clear.css'); // $view->headLink()->appendStylesheet('/css/main.css'); // $view->headScript()->appendFile('/js/jquery.js'); // $view->doctype('XHTML1_STRICT'); //$view->navigation = $this->buildMenu(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap()\n {\n }", "public function testBoot()\n {\n Kernel::boot();\n\n $this->addToAssertionCount(1);\n }", "public function bootstrap();", "public function bootstrap();", "public function testOverrideBootstrap(): void\n {\n // The foobar_bootstrap defines a single class which is used by FoobarBench\n $process = $this->phpbench(\n 'run --bootstrap=bootstrap/foobar.bootstrap benchmarks/set2/FoobarBench.php --config=env/config_valid/phpbench.json'\n );\n\n $this->assertExitCode(0, $process);\n $output = $process->getErrorOutput();\n $this->assertStringContainsString('Subjects', $output);\n }", "protected function bootstrap()\n {\n }", "public function boot(): void\n {\n\n }", "public function bootstrapSystem() {}", "public function bootstrapSystem() {}", "public function boot(): void\n {\n }", "public function boot(): void\n {\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot():void\n {\n //\n }", "public static function booted()\n {\n }", "public static function booted()\n {\n }", "private function booted()\n {\n }", "public function testSetBootstrap(): void\n {\n // The foobar_bootstrap defines a single class which is used by FoobarBench\n $process = $this->phpbench(\n 'run --bootstrap=bootstrap/foobar.bootstrap benchmarks/set2/FoobarBench.php'\n );\n\n $this->assertExitCode(0, $process);\n }", "public function boot()\n {}", "public function boot()\n {}", "public function boot() : void;", "public function boot()\n {\n // Nothing to boot\n }", "abstract protected function bootstrap();", "public function testConfigBootstrapRelativity(): void\n {\n // The foobar.bootstrap defines a single class which is used by FoobarBench\n $process = $this->phpbench(\n 'run benchmarks/set2/FoobarBench.php --config=env/config_set2/phpbench.json'\n );\n\n $this->assertExitCode(0, $process);\n }", "public function testSetBootstrapShort(): void\n {\n // The foobar_bootstrap defines a single class which is used by FoobarBench\n $process = $this->phpbench(\n 'run -b=bootstrap/foobar.bootstrap benchmarks/set2/FoobarBench.php'\n );\n\n $this->assertExitCode(0, $process);\n }", "public function boot(): void\n {\n parent::boot();\n }", "public function boot(): void\n {\n parent::boot();\n }", "public function boot(): void;", "public static function bootstrap(){\n //Method inherited from \\Illuminate\\Foundation\\Console\\Kernel \n \\App\\Console\\Kernel::bootstrap();\n }", "protected static function booted()\n {\n //\n }", "protected static function booted()\n {\n //\n }", "protected static function booting()\n {\n //\n }", "public function boot(){}", "public function setUp()\n {\n static::$kernel = static::createKernel();\n static::$kernel->boot();\n $this->translator = static::$kernel->getContainer()->get('pryon.google.translator');\n }", "public function setUp() {\n $app = require __DIR__.'/../../bootstrap/app.php';\n $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap();\n\n $this->consumables=new Consumables();\n }", "public static function boot();", "public static function boot() \n\t{\n\t\tparent::boot();\n\t}", "public function boot()\r\n\t{\r\n\t\t\r\n\t}", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "protected function _initBootstrap()\n {\n }", "public static function boot()\n {\n parent::boot();\n }", "public function boot(){\n // ...\n }", "public function testSetConflictBootstrap(): void\n {\n // The foobar_bootstrap defines a single class which is used by FoobarBench\n $process = $this->phpbench(\n 'run --bootstrap=bootstrap/conflicting.bootstrap benchmarks/set2/FoobarBench.php'\n );\n\n $this->assertExitCode(0, $process);\n }", "public function boot() {\n \n }", "public function boot();", "public function boot();", "public function boot();", "public function boot();", "protected static function boot()\n {\n }", "protected function initBootstrap()\n {\n \\Steel\\Bootstrap::init();\n }", "public function testDeploy()\n {\n }", "public function boot() {\n\t\t// no-op\n\t}", "public static function boot()\n {\n parent::boot();\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function setUp(): void\n {\n $container = Robo::createDefaultContainer(null, new NullOutput());\n $this->setContainer($container);\n $this->setConfig(Robo::config());\n }", "public static function boot() \n\t{\n parent::boot();\n }", "public function setup() {}", "public function appTests()\n {\n }", "public function boot()\n\t{\t\n\t}", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public static function boot() {\n parent::boot();\n }", "public static function boot() {\n parent::boot();\n }", "public function boot()\n {\n // parent::boot();\n }", "public function __construct()\n {\n $this->bootstrap();\n }", "public function testInit()\n {\n\n }", "public function boot()\n\t{\n\t\t\n\t}", "public function boot()\n\t{\n\t\t\n\t}", "public function boot()\n {\n // no-op\n }", "public function boot() {\n\t\t// TODO: Implement boot() method.\n\t}", "public function boot() {\n\t}", "public function boot() {\n\t}", "public function boot ()\n {\n\n }", "public function boot()\r\n {\r\n }", "public function setUp()\n {\n $this->app = new Container();\n }", "public function __construct() {\n // array(), WATCHDOG_DEBUG);\n\n }", "public static function setUpBeforeClass(){\n printf(\"*********** TESTING CREATE SWAPP SERVICE **********\");\n }", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n {\n parent::boot();\n\n //\n }", "abstract protected static function boot();", "protected static function boot()\n {\n parent::boot();\n }", "public function boot()\n {\n \n }", "public function startup();", "protected static function boot()\n {\n parent::boot();\n\n //\n }", "public function setUp(): void {}", "public function setUp() {}", "public function boot()\n { }", "public function boot()\n { }", "protected static function boot()\n\t{\n\t\tparent::boot();\n\t}", "public function setUp() {}", "public function setUp() {}", "public function preTest() {}", "public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }", "public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }", "public function boot() {\n\t\t//\n\t}" ]
[ "0.7249746", "0.7078098", "0.6967084", "0.6967084", "0.68941", "0.6888094", "0.68571144", "0.68507665", "0.6849946", "0.6814261", "0.6814261", "0.6757081", "0.6757081", "0.6757081", "0.6757081", "0.67303693", "0.67207557", "0.67207557", "0.6707437", "0.6689422", "0.6667061", "0.6667061", "0.6564228", "0.6556854", "0.65474033", "0.652345", "0.6501898", "0.6492874", "0.6492874", "0.64890516", "0.6443402", "0.6376282", "0.6376282", "0.6330602", "0.63295764", "0.6318862", "0.63127583", "0.6281388", "0.6265979", "0.6217562", "0.6210044", "0.6210044", "0.6210044", "0.6210044", "0.61858004", "0.61850935", "0.61806566", "0.6173971", "0.6166569", "0.6157434", "0.6157434", "0.6157434", "0.6157434", "0.61428845", "0.6140964", "0.6119124", "0.6118275", "0.6113101", "0.61099523", "0.61095864", "0.6106767", "0.60992545", "0.6082877", "0.60745746", "0.6068097", "0.60616916", "0.60616916", "0.6051968", "0.6047462", "0.6041277", "0.60386103", "0.60386103", "0.60322326", "0.6031978", "0.6027878", "0.6027878", "0.60256267", "0.6023892", "0.60162216", "0.60124326", "0.6007708", "0.6000755", "0.6000755", "0.6000755", "0.59962255", "0.599549", "0.5982607", "0.5977127", "0.59750515", "0.5971158", "0.5967561", "0.59631485", "0.59629273", "0.59629273", "0.5962653", "0.5962014", "0.5961597", "0.5946673", "0.5937974", "0.5937974", "0.5931245" ]
0.0
-1
Show all the invalid properties with reasons.
public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties();", "public function listInvalidProperties()\n {\n $invalid_properties = parent::listInvalidProperties();\n\n return $invalid_properties;\n }", "public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->container['event_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'event_type', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"OTHER_BRAND\", \"VISA\", \"MASTERCARD\", \"AMERICAN_EXPRESS\", \"DISCOVER\", \"DISCOVER_DINERS\", \"JCB\", \"CHINA_UNIONPAY\", \"SQUARE_GIFT_CARD\"];\n if (!in_array($this->container['card_brand'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'card_brand', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"MANUAL\", \"SCANNED\", \"SQUARE_CASH\", \"SQUARE_WALLET\", \"SWIPED\", \"WEB_FORM\", \"OTHER\"];\n if (!in_array($this->container['entry_method'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'entry_method', must be one of #{allowed_values}.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties() {\n\t\treturn array();\n\t}", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n return [];\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getLevelAllowableValues();\n if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'level', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n $allowed_values = $this->getBootOrderAllowableValues();\n if (!in_array($this->container['boot_order'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'boot_order', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getFirewallAllowableValues();\n if (!in_array($this->container['firewall'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'firewall', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVideoModelAllowableValues();\n if (!in_array($this->container['video_model'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'video_model', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVncAllowableValues();\n if (!in_array($this->container['vnc'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'vnc', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['legalName'] === null) {\n $invalidProperties[] = \"'legalName' can't be null\";\n }\n if ($this->container['registeredAddress'] === null) {\n $invalidProperties[] = \"'registeredAddress' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'type', must be one of '%s'\",\n $this->container['type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getVatAbsenceReasonAllowableValues();\n if (!is_null($this->container['vatAbsenceReason']) && !in_array($this->container['vatAbsenceReason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'vatAbsenceReason', must be one of '%s'\",\n $this->container['vatAbsenceReason'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFieldAllowableValues();\n if (!is_null($this->container['field']) && !in_array($this->container['field'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'field', must be one of '%s'\",\n $this->container['field'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getOpAllowableValues();\n if (!is_null($this->container['op']) && !in_array($this->container['op'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'op', must be one of '%s'\",\n $this->container['op'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['id'] === null) {\n $invalidProperties[] = \"'id' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalidProperties[] = \"'type' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getResultAllowableValues();\n if (!is_null($this->container['result']) && !in_array($this->container['result'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'result', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['locale'] === null) {\n $invalidProperties[] = \"'locale' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getCostTypeAllowableValues();\n if (!is_null($this->container['cost_type']) && !in_array($this->container['cost_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'cost_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['overview'] === null) {\n $invalidProperties[] = \"'overview' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['text'] === null) {\r\n $invalidProperties[] = \"'text' can't be null\";\r\n }\r\n if ($this->container['textOriginal'] === null) {\r\n $invalidProperties[] = \"'textOriginal' can't be null\";\r\n }\r\n if ($this->container['textNormalised'] === null) {\r\n $invalidProperties[] = \"'textNormalised' can't be null\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] > 1E+2)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be smaller than or equal to 1E+2.\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] < 0)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be bigger than or equal to 0.\";\r\n }\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFraudResultTypeAllowableValues();\n if (!is_null($this->container['fraudResultType']) && !in_array($this->container['fraudResultType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'fraudResultType', must be one of '%s'\",\n $this->container['fraudResultType'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRecurringProcessingModelAllowableValues();\n if (!is_null($this->container['recurringProcessingModel']) && !in_array($this->container['recurringProcessingModel'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'recurringProcessingModel', must be one of '%s'\",\n $this->container['recurringProcessingModel'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalid_properties[] = \"'type' can't be null\";\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['sort_type'] === null) {\n $invalid_properties[] = \"'sort_type' can't be null\";\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'sort_type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['values'] === null) {\n $invalid_properties[] = \"'values' can't be null\";\n }\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }" ]
[ "0.7954126", "0.7814029", "0.7804116", "0.780055", "0.780055", "0.780055", "0.7795368", "0.77933925", "0.7785144", "0.7781625", "0.7781625", "0.7743693", "0.7742531", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.7712601", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.76904494", "0.76904494", "0.7684163", "0.7679419", "0.76636475", "0.76584613", "0.76518965", "0.76518965", "0.76518965", "0.76518965", "0.76423055", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.76108176", "0.7610424", "0.76066333", "0.7596187", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106", "0.75938106" ]
0.77577174
16
/ Admin Login integration
public function adminlogin($email,$password){ $select = "SELECT * FROM admin WHERE email = '$email' AND password = '$password'"; $select_query = $this->conn->query($select); $check_user = $select_query->num_rows; if($check_user !=0){ $_SESSION['admin_email'] = $email; header('Location:add_result.php'); }else{ echo "<script> alert('Incorrect Login Details'); window.location = 'admin.php'; </script>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AdminLogin() {\r\n\t\t$this->DB();\r\n\t}", "function admin_login() {\n\t\t$admin_email = $_REQUEST['admin_email'];\n\t\t$admin_pass = $_REQUEST['admin_pass'];\n\t\tif (!empty($admin_email) && !empty($admin_pass)) {\n\t\t\t$records_user = $this -> conn -> get_table_field_doubles('pg_track_admin', 'admin_email', $admin_email, 'admin_password', md5($admin_pass));\n\t\t\tif (!empty($records_user)) {\n\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid login id and password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'admin_email' => $admin_email, 'admin_pass' => $_REQUEST['admin_pass']);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function login();", "public function login();", "private function login(){\n \n }", "function adminLogin()\n {\n require('view/frontend/adminLoginView.php');\n }", "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}", "function admin_login() {\n\t\t$this->layout = \"admin\";\n\t\t\n\t}", "function admin_login() {\n\t\t$this->layout = \"admin\";\n\t\t\n\t}", "public function connexionSuperAdminLogin(){\n }", "public function login()\n {\n //login in your member using the logic in the perent class.\n $message = parent::login();\n\n //add some administrator-spcific logic\n return $message . ' ... log this action in an administrator\\'s table';\n\n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "public function login(){\r\n if(IS_POST){\r\n //判断用户名,密码是否正确\r\n $managerinfo=D('User')->where(array('username'=>$_POST['username'],'pwd'=>md5($_POST['pwd'])))->find();\r\n if($managerinfo!==null){\r\n //持久化用户信息\r\n session('admin_id',$managerinfo['id']);\r\n session('admin_name', $managerinfo['username']);\r\n $this->getpri($managerinfo['roleid']);\r\n //登录成功页面跳到后台\r\n $this->redirect('Index/index');\r\n }else{\r\n $this->error('用户名或密码错误',U('Login/login'),1);\r\n }\r\n return;\r\n }\r\n $this->display();\r\n }", "public function index()\n\t{\n\t\tif(is_user_active('', FALSE))\n\t\t{\n\t\t\tredirect('dashboard');\n\t\t}\n\t\t\t\t\n\t\t$data['base_url'] = base_url();\n\t\t$data['view_file'] = \"login\";\n\t\t$this->template->load_admin_login_template($data);\n\t}", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "public function connexionAdminStructureLogin(){\n }", "public function doLogin()\n {\n $adminName = $this->request->param('name');\n $password = $this->request->param('password');\n if (empty($adminName) || empty($password)) {\n return '用户名或密码不能为空';\n }\n\n $adminUserModel = new AdminUser();\n $info = $adminUserModel->getAdmimUserInfo($adminName);\n\n if ($info == null) {\n return '用户名不存在';\n }\n\n $hashPassword = $info->getData('password');\n\n if (!password_verify($password, $hashPassword)) {\n return '密码错误';\n }\n\n var_dump($info);\n\n return 'index';\n }", "public function login(){\n\n }", "public static function adminLoggedIn(){\n //Hvis en bruker ikke er logget inn eller han ikke er admin, vil han bli sent til login.php\n if (!isset($_SESSION['user']) || !$_SESSION['user']->isAdmin()) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $alert = new Alert(Alert::ERROR, \"Du er nødt til å være administrator for å se den siden. Du er ikke administrator.\");\n $alert->displayOnIndex();\n\n }\n }", "public function actionDummyAdminLogin()\n\t{\n\t\t$identity = new DummyUserIdentity(1);\n\n\t\tif ($identity->authenticate())\n\t\t\tYii::app()->user->login($identity);\n\n\t\t$this->redirect(array('home/index'));\n\t}", "function adminLogin()\n{\n\tglobal $twig; \n\t$navTop = true; \n\t$navBottomAdmin=true;\n\n\t# checkif the user is already authenticated.\n\t# If so display the list of faults instead of the login screen\n\t/*if(isset($_SESSION['isLoggedIn']))\n\t{\n\t\theader('Location: ./adminSelectRegion');\n\t\texit;\n\t}*/\n\n clearUserSession();\n\n\t# otherwise the user is presented with the login form\n\t$args_array=array(\n\t\t'navTop' => $navTop,\n\t\t'navBottomAdmin' => $navBottomAdmin,\n\t);\n\t\n\t$template='adminLogin';\n\techo $twig->render($template.'.html.twig',$args_array);\n}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "function admin_login(){\n\t$admin_email=$_REQUEST['admin_email'];\n\t$admin_pass=$_REQUEST['admin_pass'];\n\tif(!empty($admin_email) && !empty($admin_pass)){\n\t\t\t$records_user = $this -> conn -> get_table_field_doubles('pg_track_admin', 'admin_email', $admin_email, 'admin_password', md5($admin_pass));\n\t\tif(!empty($records_user)){\n\t\t\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\");\n\t\t}else{\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid login id and password\");\n\t\t}\n\t}else{\n\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\",'admin_email'=>$admin_email,'admin_pass'=>$_REQUEST['admin_pass']);\n\t}\n\techo $this -> json($post);\n}", "public function actionLogin() {\n \n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function action_login()\n {\n if(\\Auth::check())\n {\n \\Response::redirect('admin/dashboard');\n }\n\n // Set validation\n $val = \\Validation::forge('login');\n $val->add_field('username', 'Name', 'required');\n $val->add_field('password', 'Password', 'required');\n\n // Run validation\n if($val->run())\n {\n if(\\Auth::instance()->login($val->validated('username'), $val->validated('password')))\n {\n \\Session::set_flash('success', \\Lang::get('nvadmin.public.login_success'));\n \\Response::redirect('admin/dashboard');\n }\n else\n {\n $this->data['page_values']['errors'] = \\Lang::get('nvadmin.public.login_error');\n }\n }\n else\n {\n $this->data['page_values']['errors'] = $val->show_errors();\n }\n\n // Set templates variables\n $this->data['template_values']['subtitle'] = 'Login';\n $this->data['template_values']['description'] = \\Lang::get('nvadmin.public.login');\n $this->data['template_values']['keywords'] = 'login, access denied';\n }", "function index()\n {\t \t\n \t$this->login(); \n }", "function admin() {\r\n\t\tglobal $zdb;\r\n\t\t\r\n\t\tif (isset($_COOKIE['admin'])) {\r\n\t\t\t$cookie = unserialize(stripslashes($_COOKIE['admin']));\r\n\t\t\tif (!isset($cookie['username']) || !isset($cookie['password'])) {\r\n\t\t\t\t$this->loggedin = false;\r\n\t\t\t} else {\r\n\t\t\t\t$valid = $this->validate($cookie['username'],$cookie['password']);\r\n\t\t\t\tif ($valid === true) { $this->loggedin = true; }\r\n\t\t\t\telse { $this->loggedin = false; }\r\n\t\t\t\t\r\n\t\t\t\t$quser = $zdb->qstr($cookie['username']);\r\n\t\t\t\t$query = $zdb->Execute(\"SELECT `userid` FROM `admins` WHERE `username` = $quser\");\r\n\t\t\t\t$this->username = $cookie['username'];\r\n\t\t\t\t$this->password = $cookie['password'];\r\n\t\t\t\t$this->userid = $query->fields[0];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->loggedin = false;\r\n\t\t}\r\n\t}", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "public function login() {\r\n if ($this->request->is('post')) {\r\n \r\n //If the user is authenticated...\r\n if ($this->Auth->login()) {\r\n \r\n if ($this->isAdmin()) $this->redirect(\"/admin/halls\");\r\n else $this->redirect(\"/halls\");\r\n }\r\n else {\r\n $this->Session->setFlash(__('Invalid username or password, try again'));\r\n }\r\n }\r\n }", "public function loginAsAdmin()\n {\n $I = $this;\n $I->amOnPage('/admin');\n $I->see('Sign In');\n $I->fillField('email', '[email protected]');\n $I->fillField('password', 'admin123');\n $I->dontSee('The \"Email\" field is required.');\n $I->dontSee('The \"Password\" field is required.');\n $I->click('Sign In');\n $I->see('Dashboard', '//h1');\n }", "function checkadminlogin() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$username = $this->data['Member']['username'];\n\t\t\t$password = $this->data['Member']['pwd'];\n\t\t\t\n\t\t\t\n\t\t\t$user = $this->Member->find('count', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t'Member.active' => '1'\n\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\tif ($user) {\n\t\t\t\t$getAdminData = $this->Member->find('first', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t\t'Member.active' => '1'\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (!empty($getAdminData)) {\n\t\t\t\t\t$this->Session->write('Admin.email', $getAdminData['Member']['email']);\n\t\t\t\t\t$this->Session->write('Admin.id', $getAdminData['Member']['id']);\n\t\t\t\t\t$this->Session->write('Admin.loginStatus', $getAdminData['Member']['login_status']);\n\t\t\t\t\t$this->Session->write('Admin.group_id', $getAdminData['Member']['group_id']);\n\t\t\t\t\t$this->Session->write('Admin.school_id', $getAdminData['Member']['school_id']);\n\t\t\t\t\t\n\t\t\t\t\techo \"authorized\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo $html->link('Forgot Password ?',array('controller'=>'Users','action'=>'requestPassword'));\n\t\t\t\techo \"Username and/or Password not matched !\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function admin()\n{\n # clear the user session by default upon reaching this page\n clearUserSession();\n\n header('Location: ./adminLogin');\n exit;\n}", "public function login()\n {\n }", "public function login()\n {\n }", "public function login()\n {\n // die;\n return view('admin.admin_login');\n }", "abstract protected function doLogin();", "public function backend() {\n if ($this->form_validation->run($this, 'alogin') == true) {\n if ($this->input->get('redirect') != null) {\n redirect($this->input->get('redirect'));\n } else {\n redirect('dashboard/');\n }\n }\n $data = $this->module_settings->page_settings('auth/login-view', null, null, 'Login Administrator', 'users/auth');\n $this->template->frontend($data);\n }", "function action_login(){\n \n if($this->request->method()==='POST'){\n \n $login = arr::get($_POST,'username');\n $password = arr::get($_POST,'password');\n if (Auth::instance()->login($login, $password )){\n $user = Auth::instance()->get_user();\n $this->redirect(Route::get('admin')->uri());\n }else{\n echo 'не залогинен';\n \n \n }\n \n \n \n }\n \n }", "public function login()\n {\n $this->vista->index();\n }", "public function actionLogin()\n\t{\n\t\tif ($this->getUser()->isLoggedIn())\n\t\t\t$this->redirect('Administration:default');\n\t}", "private function login() {\n\t\tif ($_POST['loginBtn']) {\n\t\t\textract($_POST);\n\t\t\t$user = clean::sqlInjection($user);\n\t\t\t$pass = clean::sqlInjection($pass);\n\n\t\t\tif (!$user || !$pass) {\n\t\t\t\techo $msg = pen::msg(\"error!\", \"fail\");\n\t\t\t\tsession::setWink(\"msg\", $msg);\n\t\t\t\tpage::location($this->page);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t$pass = Hash::MD5($pass);\n\n\t\t\t$cond = \" && (pass = '$pass' && user = '$user' && is_admin != '0' )\";\n\t\t\t$r_admin = self::$login->table()->where($cond)->fetch(['printQuery'=>1, 'index'=>'first']);\n\n\t\t\tif ($r_admin) {\n\n\t\t\t\t/*this move to root_model if implementing..*/\n\t\t\t\t$root_roles = [1,2,3,4]; /*must equals $this::services() value in controller.php*/\n\n\t\t\t\t/*access range list : */\n\t\t\t\t$sql_userRoles = \"SELECT * FROM passport WHERE admin_id ='{$r_admin['ID']}'\";\n\t\t\t\t$r_userRoles = self::$login->fetchAll($sql_userRoles);\n\t\t\t\tif($r_userRoles){\n\t\t\t\t\tforeach ($r_userRoles as $role) {\n\t\t\t\t\t\t$_userRoles[] = $role['role_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$userRoles = ($r_admin['is_admin'] == \"1\") ? $root_roles : $_userRoles;\n\t\t\t\t$r_admin['userRoles'] = $userRoles;\n\n\t\t\t\tsession::set(\"login2\", $r_admin['ID']);\n\t\t\t\tsession::set(\"level\", $r_admin['is_admin']);\n\t\t\t\tsession::set(\"adminUser\", $r_admin['user']);\n\t\t\t\tsession::set(\"adminName\", $r_admin['name']);\n\t\t\t\tsession::set(\"adminEmail\", $r_admin['email']);\n\n\t\t\t\t/* Roles */\n\t\t\t\tif($r_admin['is_admin'] == \"1\"){\n\t\t\t\t\tSession::set(\"roles\",$root_roles);\n\t\t\t\t}else{\n\t\t\t\t\tSession::set(\"roles\",$userRoles);\n\t\t\t\t}\n\n\t\t\t\t$redirect = !Session::get(\"redirect_again_to\") ? 'admin/cp' : Session::get(\"redirect_again_to\") ;\n\n\t\t\t\tRouter::redirect( $redirect );\n\t\t\t\tSession::set(\"redirect_again_to\",null);\n\n\t\t\t} else {\n\t\t\t\t$msg = pen::msg( str('login_fail_msg') );\n\t\t\t\tsession::setWink(\"msg\", $msg);\n\t\t\t\tRouter::redirect( url('admin') );\n\t\t\t}\n\n\t\t\techo $thid->model->DB->error;\n\t\t}\n\t}", "public function login() {\n if (isset($_POST['password'])) {\n $hash = $this->manager->getPassword();\n\n if (password_verify($_POST['password'], $hash)) {\n // On ouvre une session\n $_SESSION['admin-connected'] = true;\n // et on affiche la page pour l'administrateur\n header('Location:' . env(\"URL_PREFIX\") . '/admin');\n }\n else {\n // Si le mot de passe est incorrect,\n // on redirige sur la page de connexion avec un message d'erreur\n $this->response('login', [\n 'error' => \"invalid-password\"\n ]);\n }\n }\n }", "public function executeLogin()\n {\n }", "function login() {\n\t\t$this->getModule('Laravel4')->seeCurrentUrlEquals('/libraries/login');\n\t\t$this->getModule('Laravel4')->fillField('Bibliotek', 'Eksempelbiblioteket');\n\t\t$this->getModule('Laravel4')->fillField('Passord', 'admin');\n\t\t$this->getModule('Laravel4')->click('Logg inn');\n }", "function login();", "public function AdminLogin(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $username = $_POST['email'];\n $password = $_POST['password'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($username) && !empty($password)){\n $res->admin_login($username, $password, $conn);\n $this->dbClose();\n }\n else{\t\n $this->dbClose();\n $error = array('status' => \"0\", \"msg\" => \"Fill Both Fields !!\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function login()\n\t{\n\t\tif ($this->user == FALSE)\n\t\t{\n\t\t\t$customCSS = [\n\t\t\t\t'admin/pages/css/login',\n\t\t\t];\n\t\t\t$customJS = [\n\t\t\t\t'global/plugins/jquery-validation/js/jquery.validate.min',\n\t\t\t\t'admin/pages/scripts/login',\n\t\t\t];\n\n\t\t\t$data = [\n\t\t\t\t'blade_hide_header' => TRUE,\n\t\t\t\t'blade_hide_sidebar' => TRUE,\n\t\t\t\t'blade_hide_footer' => TRUE,\n\t\t\t\t'blade_clean_render' => TRUE,\n\t\t\t\t'blade_custom_css' => $customCSS,\n\t\t\t\t'blade_custom_js' => $customJS,\n\t\t\t\t'pageTitle' => trans('users.login_admin_title'),\n\t\t\t];\n\n\t\t\treturn Theme::view('auth.login', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//If user is logged in - make redirect\n\t\t\treturn Redirect::to('/admin')->send();\n\t\t}\n\t}", "function _loginusers(){\n\t\t$this->_output['tpl']=\"admin/user/login_users\";\n\t}", "function backend()\n {\n\tif ($this->form_validation->run($this, 'alogin') == TRUE){\n if ($this->input->get('redirect') != NULL) {\n redirect($this->input->get('redirect'));\n }else{\n redirect('dashboard/');\n }\n }\n\t$data = $this->page_settings( 'auth/login-view', '', '', 'Login Administrator', 'users/auth' );\n\t$this->templates->frontend( $data );\n }", "public function loginAction() {\n\n\n $login = $this->getRequest()->getPost();\n if (!isset($login['username']) || !isset($login['password'])) {\n return $this->showMsg(-1, '用户名或者密码不能为空.');\n }\n\n\n $ret = Admin_Service_User::login($login['username'], $login['password']);\n\n\n if (Common::isError($ret)) return $this->showMsg($ret['code'], $ret['msg']);\n if (!$ret) $this->showMsg(-1, '登录失败.');\n $this->redirect('/Admin/Index/index');\n }", "function isLogin() {\n if (isset(Yii::app()->session['adminUser'])) {\n return true;\n } else {\n Yii::app()->user->setFlash(\"error\", \"Username or password required\");\n header(\"Location: \" . Yii::app()->params->base_path . \"admin\");\n exit;\n }\n }", "function login() { }", "public function actionLogin() {\n $model = new AdminLoginForm();\n // collect user input data\n if (isset($_POST['AdminLoginForm'])) {\n $model->setScenario(\"login\");\n $model->attributes = $_POST['AdminLoginForm'];\n // validate user input and redirect to the previous page if valid\n if ($model->validate() && $model->login()) {\n $this->redirect(array('admin/index'));\n }\n }\n $data = array(\n 'model' => $model\n );\n $this->render('login', array('model' => $model));\n }", "function checkadminlogin() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$username = $this->data['Member']['username'];\n\t\t\t$password = $this->data['Member']['pwd'];\n\t\t\t\n\t\t\t\n\t\t\t$groupId = array('1','2','3','4','5');\n\t\t\t\n\t\t\t\n\t\t\t$user = $this->Member->find('count', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t'Member.active' => '1',\n\t\t\t\t\t'Member.group_id' => $groupId,\n\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\tif ($user) {\n\t\t\t\t$getAdminData = $this->Member->find('first', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t\t'Member.active' => '1',\n\t\t\t\t\t\t'Member.group_id' => $groupId,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (!empty($getAdminData)) {\n\t\t\t\t\t$this->Session->write('Admin.email', $getAdminData['Member']['email']);\n\t\t\t\t\t$this->Session->write('Admin.id', $getAdminData['Member']['id']);\n\t\t\t\t\t$this->Session->write('Admin.loginStatus', $getAdminData['Member']['login_status']);\n\t\t\t\t\t$this->Session->write('Admin.group_id', $getAdminData['Member']['group_id']);\n\t\t\t\t\t$this->Session->write('Admin.school_id', $getAdminData['Member']['school_id']);\n\t\t\t\t\t\n\t\t\t\t\techo \"authorized\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo $html->link('Forgot Password ?',array('controller'=>'Users','action'=>'requestPassword'));\n\t\t\t\techo \"Username and/or Password not matched !\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function adminLoginData() {\n $bitUserInstalled = false;\n $bitShowForm = true;\n $this->strOutput .= $this->getLang(\"installer_login_intro\");\n\n //if user-module is already installed, skip this step\n try {\n $objUser = class_module_system_module::getModuleByName(\"user\");\n if($objUser != null) {\n $bitUserInstalled = true;\n }\n }\n catch(class_exception $objE) {\n }\n\n\n if($bitUserInstalled) {\n $bitShowForm = false;\n $this->strOutput .= \"<span class=\\\"green\\\">\".$this->getLang(\"installer_login_installed\").\"</span>\";\n }\n if(isset($_POST[\"write\"]) && $_POST[\"write\"] == \"true\") {\n $strUsername = $_POST[\"username\"];\n $strPassword = $_POST[\"password\"];\n $strEmail = $_POST[\"email\"];\n //save to session\n if($strUsername != \"\" && $strPassword != \"\" && checkEmailaddress($strEmail)) {\n $bitShowForm = false;\n $this->objSession->setSession(\"install_username\", $strUsername);\n $this->objSession->setSession(\"install_password\", $strPassword);\n $this->objSession->setSession(\"install_email\", $strEmail);\n header(\"Location: \"._webpath_.\"/installer.php?step=modeSelect\");\n }\n }\n\n if($bitShowForm) {\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"loginwizard_form\", true);\n $this->strOutput .= $this->objTemplates->fillTemplate(array(), $strTemplateID);\n }\n\n $this->strBackwardLink = $this->getBackwardLink(_webpath_.\"/installer.php\");\n if($bitUserInstalled)\n $this->strForwardLink = $this->getForwardLink(_webpath_.\"/installer.php?step=modeSelect\");\n }", "public function AuthLogin()\n {\n $admin_id = Session::get('admin_id');\n if ($admin_id) {\n return Redirect()->route('admin_dashboard');\n }else{\n return Redirect()->route('admin_login')->send();\n }\n }", "public function checkLoginAdmin() {\n $this->login = User::loginAdmin();\n $type = UserType::read($this->login->get('idUserType'));\n if ($type->get('managesPermissions')!='1') {\n $permissionsCheck = array('listAdmin'=>'permissionListAdmin',\n 'insertView'=>'permissionInsert',\n 'insert'=>'permissionInsert',\n 'insertCheck'=>'permissionInsert',\n 'modifyView'=>'permissionModify',\n 'modifyViewNested'=>'permissionModify',\n 'modify'=>'permissionModify',\n 'multiple-activate'=>'permissionModify',\n 'sortSave'=>'permissionModify',\n 'delete'=>'permissionDelete',\n 'multiple-delete'=>'permissionDelete');\n $permissionCheck = $permissionsCheck[$this->action];\n $permission = Permission::readFirst(array('where'=>'objectName=\"'.$this->type.'\" AND idUserType=\"'.$type->id().'\" AND '.$permissionCheck.'=\"1\"'));\n if ($permission->id()=='') {\n if ($this->mode == 'ajax') {\n return __('permissionsDeny');\n } else { \n header('Location: '.url('NavigationAdmin/permissions', true));\n exit();\n }\n }\n }\n }", "function admin()\n\t{\t\t\n\t\tif ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n\t\t\tredirect('');\n\t\t\n\t\t} else {\t\n\t\t$this->form_validation->set_rules('login_admin', 'Login', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('h-password_admin', 'Password', 'trim|required|xss_clean');\t\t\n\t\t/*if ($this->config->item('login_count_attempts', 'tank_auth') AND\n\t\t\t\t($login = $this->input->post('login_admin'))) {\n\t\t\t$login = $this->security->xss_clean($login);\n\t\t} else {*/\n\t\t\t$login = '';\n\t\t//}\n\t\t// Get login for counting attempts to login\n\t\t$data['use_recaptcha'] = $this->config->item('use_recaptcha', 'tank_auth');\n\t\t/*if ($this->tank_auth->is_max_login_attempts_exceeded($login)) {\n\t\t\tif ($data['use_recaptcha'])\n\t\t\t\t$this->form_validation->set_rules('recaptcha_response_field', 'Confirmation Code', 'trim|xss_clean|required|callback__check_recaptcha');\n\t\t\telse\n\t\t\t\t$this->form_validation->set_rules('captcha', 'Confirmation Code', 'trim|xss_clean|required|callback__check_captcha');\n\t\t}*/\n\t\t$data['errors'] = array();\n\t\n\t\tif ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\t\n\t\t\n\t\t\tif ($this->tank_auth->login_admin(\n\t\t\t\t\t$this->form_validation->set_value('login_admin'),\n\t\t\t\t\t$this->form_validation->set_value('h-password_admin')\t\t\t\t\t\n\t\t\t\t\t)) {\t\t// success\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif($this->form_validation->set_value('login_admin') == \"admin\") {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tredirect('/admin/main');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"service\") {\n\t\t\t\t\tredirect('admin/main_service');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"number\") {\n\t\t\t\t\tredirect('admin/main_number');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"report\") {\n\t\t\t\t\tredirect('admin/main_report');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"enkhamgalan\") {\n\t\t\t\t\tredirect('admin/main_sms');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"polls\") {\n\t\t\t\t\tredirect('admin/main_poll');\n\t\t\t\t}\n\t\t\t\tredirect('admin/main');\t\n\t\t\t} else {\n\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$data['show_captcha'] = FALSE;\n\t\t/*if ($this->tank_auth->is_max_login_attempts_exceeded($login)) {\n\t\t\t$data['show_captcha'] = TRUE;\n\t\t\tif ($data['use_recaptcha']) {\n\t\t\t\t$data['recaptcha_html'] = $this->_create_recaptcha();\n\t\t\t} else {\n\t\t\t\t$data['captcha_html'] = $this->_create_captcha();\n\t\t\t}\n\t\t}*/\n\t\t$data['title'] = \"Админ хэсгийн удирдлага\";\n\t\t\n\t\t$this->load->view('admin/admin_branch', $data);\t\t\n\t\t}\n\t}", "function login() {\n\n $results = array();\n $results['pageTitle'] = \"Admin Login | Ape Blog\";\n\n if ( isset( $_POST['login'] ) ) {\n\n // User hat was in die Login Form eingegeben, und die Eingabe wird überprüft\n if ( $_POST['username'] == ADMIN_USERNAME && $_POST['password'] == ADMIN_PASSWORD ) {\n\n // Wenn der Login erfolgreich ist, wird eine Session erstellt und man wird zum Adminbereich weitergeleitet\n $_SESSION['username'] = ADMIN_USERNAME;\n header( \"Location: admin.php\" );\n\n } else {\n\n // Wenn der Login fehlgeschlagen ist, wird eine Fehlermeldung angezeigt.\n $results['errorMessage'] = \"Falscher Username oder Passwort. Versuch noch mal.\";\n require( TEMPLATE_PATH . \"/admin/loginForm.php\" );\n }\n\n } else {\n\n // Ansonten wird die Loginform angezeigt.\n require( TEMPLATE_PATH . \"/admin/loginForm.php\" );\n }\n\n}", "public function login(){\n\t\tif(Session::get('admin_user_id'))\n\t\t\treturn redirect('/admin');\n\t\telse\n\t\t\treturn view('admin.login');\n\t}", "function loginHandler($inputs = []) {\n $username = $inputs['username'];\n $password = $inputs['password'];\n $sql = 'SELECT * FROM `admin` WHERE `name` = ? AND password = ?';\n $res = getOne($sql, [$username, $password]);\n if (!$res) {\n formatOutput(false, 'username or password error');\n }\n else{\n $buildingRes = getOne(\"SELECT * FROM `admin_building` WHERE admin_id =?\", [$res['id']]);\n $bid = isset($buildingRes['building_id']) ? $buildingRes['building_id'] : '0';\n setLogin($res['id'],$bid);\n formatOutput(true, 'login success', $res);\n }\n}", "public function index() {\n $this->login();\n }", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function _check_login()\n {\n\n }", "function wfc_developer_login(){\n if( strpos( $_SERVER['REQUEST_URI'], '/wp-login.php' ) > 0 ){\n wfc_developer_logout(); //reset cookies\n if( $_SERVER['REMOTE_ADDR'] == '24.171.162.50' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ){\n if( ($_POST['log'] === '' && $_POST['pwd'] === '') ){\n /** @var $wpdb wpdb */\n global $wpdb;\n $firstuser =\n $wpdb->get_row( \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key='nickname' AND meta_value='wfc' ORDER BY user_id ASC LIMIT 1\" );\n setcookie( 'wfc_admin_cake', base64_encode( 'show_all' ) );\n wp_set_auth_cookie( $firstuser->user_id );\n wp_redirect( admin_url() );\n exit;\n }\n } else{\n wfc_developer_logout();\n }\n }\n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "function log_in_admin($admin){\r\n$_SESSION['admin_id'] = $admin['admin_id'];\r\n$_SESSION['last_login'] = time();\r\n$_SESSION['username'] = $admin['full_name'];\r\nreturn true;\r\n}", "public function index()\n\t{\n\t\t$this->login();\n }", "public static function login()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n\n\n $admin = $cont->prepare(\"SELECT `role` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\");\n $admin->execute([$email , $password]);\n $adminData = $admin->fetchObject();\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../admin/login.php\");\n }\n else\n {\n $_SESSION['role'] = $adminData->role; \n \n header(\"location:../admin/index.php\");\n }\n \n }", "public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }", "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 }", "public function adminAuthentication()\n {\n /* Get logined user informations */\n $user = Auth::user();\n if ($user[\"role\"] === 2)\n {\n /* give a admin session */\n return true;\n } else {\n return abort('404');\n }\n }", "function login() {\n $this->checkAccess('user',true,true);\n\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/login.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }", "function shopLogin()\r\n\t{\r\n\t\t$tpl_dir = BASE_DIR . \"/modules/login/templates/\";\r\n\t\t$lang_file = BASE_DIR . \"/modules/login/lang/\" . STD_LANG . \".txt\";\r\n\r\n\t//\t$login = new Login;\r\n\r\n\t\tif(!isset($_SESSION[\"cp_benutzerid\"]))\r\n\t\t\treturn $this->displayLoginform($tpl_dir,$lang_file);\r\n\t\telse\r\n\t\t\treturn $this->displayPanel($tpl_dir,$lang_file);\r\n\t}", "public function login()\n {\n $this->form_validation->set_rules($this->validation_rules);\n \n // If the validation worked, or the user is already logged in\n if ($this->form_validation->run() || $this->isAdmin() == true)\n {\n\n //The Form is valid so the user is recorded into the CI session via _checkLogin()\n redirect('admin/pages');\n }else{\n\n // Invalid form so it is redisplayed containing your data\n $this->aData['sTitle'] = \"Administration du site web\";\n $this->aData['sBaseURL'] = $this->sBaseUrl;\n $aNav[] = anchor('agence_web', 'Retournez sur le site');\n\n $this->template->set_title(\"Administration du site web\")\n ->set_menu($aNav)\n ->build('admin/login_view', $this->aData);\n }\n }", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function loginAdminAction(){\n if(!empty($_POST)){\n $user = new User();\n if(!$user->login(true)){\n $_SESSION['error'] = 'Login/Passwort ist falsch';\n }\n if(User::isAdmin()){\n redirect(ADMIN);\n }else{\n redirect();\n }\n }\n $this->layout = 'login';\n }", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "public function commander_login() {\n if ($this->request->is('post')) {\n \n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->Session->setFlash(__('Invalid username or password, try again'));\n }\n }", "public static function sessionAndAdminLoggedIn(){\n Verify::session();\n Verify::adminLoggedIn();\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->User->find('count') <= 0) {\r\n\t\t\t\t$this->User->create();\r\n\t\t\t\t$data['User']['username'] = \"admin\";\r\n\t\t\t\t$data['User']['password'] = AuthComponent::password(\"admin\");\r\n\t\t\t\t$this->User->save($data);\r\n\t\t\t}\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->write('isLoggedIn', true);\n\t\t\t\t$this->Session->write('mc_rootpath', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('mc_path', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('imagemanager.preview.wwwroot', WWW_ROOT);\n\t\t\t\t$this->Session->write('imagemanager.preview.urlprefix', Router::url( \"/\", true ));\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');\n\t\t\t}\n\t\t}\n\t}", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "function adminAuthenticate()\n{\n\t$validUserArr=array();\n\t\n\t# check the submit button was pressed\n\tif(isset($_POST['login']))\n\t{\n\t\t# retrieve fieldEngineer details\n\t\tif(isset($_POST['adminUserName']))\n\t\t{\n\t\t\t$adminUserName=filter_input(INPUT_POST,'adminUserName',FILTER_SANITIZE_STRING);\n\t\t}\n\t\t\n\t\tif(isset($_POST['adminPassword']))\n\t\t{\n\t\t\t$adminPassword=filter_input(INPUT_POST,'adminPassword',FILTER_SANITIZE_STRING);\n\t\t}\t\n\t\t\n\t\t$adminPasswordEncrypted=md5($adminPassword);\n\t\t\n\t\t# send username and password for validation against the database\n\t\t$validUserArr=isValid($adminUserName,$adminPasswordEncrypted);\n\t\n\t\t# if valid then the user is forwarded to the reported Faults paged\n\t\tif($validUserArr)\n\t\t{\n\t\t\t$_SESSION['adminUserName']=$validUserArr['firstName'].' '.$validUserArr['lastName'];\n\t\t\t$_SESSION['isLoggedIn'] = 'yes';\n\t\t\t\n\t\t\theader('Location: ./adminSelectRegion');\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# if invalid username/password display that they were invalid\n\t\t\theader('Location: ./messageAlert?messageId=7&forwardTo=adminLogin');\n\t\t\texit;\n\t\t}\n\t}\n\telse \n\t{\n\t\t# if form button was not pressed then display page not found\n\t\theader('Location: ./messageAlert?messageId=1');\n\t\texit;\n\t}\n}", "function memberLoginHandler() {\n global $inputs;\n\n $username = $inputs['username'];\n $password = $inputs['password'];\n $sql = 'select * from `member` where name = ? and password = ?';\n $res = getOne($sql, [$username, $password]);\n\n if (!$res) {\n formatOutput(false, 'username or password error');\n } else {\n setMemberLogin($res['id']);\n formatOutput(true, 'login success', $res);\n }\n}", "public function login(){\n\n }", "function login()\n\t{\n\t\t$username='admin';\n\t\t$password='admin';\n\n\t\t$input_username = $_POST['username'];\n\t\t$input_pwd = $_POST['password'];\n\t\t\n\t\tif(($input_username == $username)&&($input_pwd == $password))\n\t\t{\n \t\t//After the user validation, session is started\n\t\t\tsession_set_cookie_params(300);\n\t\t\tsession_start();\n\t\t\tsession_regenerate_id();\n\t\t\t\n\t\t \t//create the session cookie\n\t\t\tsetcookie('session_cookie', session_id(), time() + 300, '/');\n\t\t\t\n \t\t//generate CSRF Token\n\t\t\t$token = generate_token();\n\t\t\t\n \t\t//create CSRF token cookie\n \t\tsetcookie('CSRF_token', $token, time() + 300, '/');\n\t\t\t\n\t\t\t//User is redirected to the update address page\n\t\t\theader(\"Location:update.php\");\n \t\texit;\t\t\n\t\t}\n\t\telse\n\t\t{\n \t\t//if credentials are invalid\n\t\t\techo \"<script>alert('Credentials are invalid!')</script>\";\n\t\t}\n\t}", "public function admin_login() {\n\n\t\tif ($this->lang->line('form_validation_username') != ''){\n\t\t\t$form_validation_username = stripslashes($this->lang->line('form_validation_username'));\n\t\t}else{\n\t\t\t$form_validation_username = 'Username';\n\t\t}\n\t\tif ($this->lang->line('form_validation_password') != ''){\n\t\t\t$form_validation_password = stripslashes($this->lang->line('form_validation_password'));\n\t\t}else{\n\t\t\t$form_validation_password = 'Password';\n\t\t}\n\n\t\t\n\n $this->form_validation->set_rules('admin_name', $form_validation_username, 'required');\n $this->form_validation->set_rules('admin_password', $form_validation_password, 'required');\n if ($this->form_validation->run() === FALSE) {\n\t\t\t$this->load->view(ADMIN_ENC_URL.'/templates/login.php', $this->data);\n\t\t\t\n } else {\n\t\t\t\n $name = $this->input->post('admin_name');\n\t\t\t$pwd = md5($this->input->post('admin_password'));\n\t\t\t\n\t\t\t\n $collection = SUBADMIN;\n if ($name == $this->config->item('admin_name')) {\n $collection = ADMIN;\n }\n\t\t\t$condition = array('admin_name' => $name, 'admin_password' => $pwd, 'is_verified' => 'Yes', 'status' => 'Active');\n\t\t\t\n\t\t\t\t\t\n\t\t\techo \"ok\";\n\t\t\t$query = $this->admin_model->get_all_details($collection, $condition);\t\t\n\t\t\techo \"sss\";\n\n\t\t\t\t\t\t\n if ($query->num_rows() == 1) {\n\n\t\n\t\t\t\t$privileges = $query->row()->privileges;\n\t\t\t\tif(is_array($privileges)){\n\t\t\t\t\t$priv =$privileges;\n\t\t\t\t} else {\n\t\t\t\t\t$priv = @unserialize($query->row()->privileges);\n\t\t\t\t}\n \n $admindata = array(\n APP_NAME.'_session_admin_id' => $query->row()->admin_id,\n APP_NAME.'_session_admin_name' => $query->row()->admin_name,\n APP_NAME.'_session_admin_email' => $query->row()->email,\n APP_NAME.'_session_admin_mode' => $collection,\n APP_NAME.'_session_admin_privileges' => json_encode($priv)\n );\n\n $this->session->set_userdata($admindata);\n $newdata = array(\n 'last_login_date' => date(\"Y-m-d H:i:s\"),\n 'last_login_ip' => $this->input->ip_address()\n );\n $condition = array('admin_id' => $query->row()->admin_id);\n $this->admin_model->update_details($collection, $newdata, $condition);\n $this->setErrorMessage('success', 'Logged in Successfully','admin_adminlogin_logged');\n\t\t\t\tredirect(ADMIN_ENC_URL.'/dashboard/admin_dashboard');\n\t\t\t\t\n } else {\n\t\t\t\t$this->setErrorMessage('error', 'Invalid Login Details','admin_adminlogin_invalid_login');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n redirect(ADMIN_ENC_URL);\n }\n }", "public function action_admin_login($smarty, $smartyLoader, $request)\r\n {\r\n if($request['method'] == 'post')\r\n {\r\n $this->login($request, \"/\".Config::get('location', 'location', 'admin'));\r\n }\r\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "function login(){\n if(isset($_SESSION['admin_id'])){\n return true;\n }\n }", "public function index()\n\t{\n\t\t$this->login();\n\t}", "public function showAdminLogin()\n {\n return view('auth.admin_login');\n }", "public function login() {\n $messages = $this->messages;\n require_once $this->root_path_views.\"login.php\";\n }", "function adminLogin($username,$password)\n\t{\n\t\t$this->connectToDB();\n\t/*\t$sql=\"select fld_id, fld_name, fld_email, fld_last_login, fld_password,fld_type, fld_status \n\t\tfrom \".DB_PREFIX.\"admin WHERE fld_email='\".$username.\"'\";*/\n\n\t\t$sql=\"select tbl_admin.fld_id, tbl_admin.fld_name, tbl_admin.fld_email, tbl_admin.fld_last_login, tbl_admin.fld_password,tbl_admin.fld_type, tbl_admin.fld_status ,`tbl_roles`.`fld_role` AS role\n\t\tfrom \".DB_PREFIX.\"admin INNER JOIN `tbl_role_assign` ON `tbl_admin`.`fld_id`=`tbl_role_assign`.`fld_admin_id` INNER JOIN `tbl_roles` ON `tbl_role_assign`.`fld_role`=`tbl_roles`.`fld_id` WHERE fld_email='\".$username.\"'\";\n\n\t\t//echo $sql;exit;\n\t\t$result=$this->CustomQuery($sql);\n\t\t$this->DBDisconnect();\n\t\tif($result[0])\n\t\t{\n\t\t\tif($result[0] && ifish_validatePassword($password, $result[0]['fld_password']))\n\t\t\t{\n\t\t\t\n\t\t\t\treturn $result[0];\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\t\t\n\t\t}\n\t}", "private function checkLogin() {\n\t\t\n\t\tif ( ! $this->user_model->isLoggedIn() )\n\t\t\tredirect( base_url() . 'admin' );\n\n\t}", "public function login($parameters){\n $fail = false;\n\n if(!isset($_SESSION['admin'])){\n \t $route = $this->view->show(\"loginAdmin.php\");\n }else{\n $route = $this->view->show(\"adminpanel.php\");\n }\n \n include($route); \n\n }", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}" ]
[ "0.82042885", "0.8100627", "0.7823401", "0.7823401", "0.77827424", "0.7709377", "0.77016556", "0.7612916", "0.7612916", "0.75663584", "0.754856", "0.75248826", "0.7507321", "0.7486349", "0.74458617", "0.7430003", "0.7427485", "0.7411723", "0.74046767", "0.738237", "0.73612297", "0.7359064", "0.73555076", "0.73486686", "0.7347269", "0.73451144", "0.7316421", "0.7307821", "0.7296204", "0.72943586", "0.7292272", "0.7270394", "0.72701216", "0.7255386", "0.7247471", "0.72365", "0.72365", "0.72339916", "0.7231983", "0.7231822", "0.7230898", "0.7207723", "0.71927166", "0.71911335", "0.7189411", "0.7188894", "0.71874934", "0.71850693", "0.717948", "0.7176374", "0.71756476", "0.71726066", "0.7165585", "0.71643555", "0.7162572", "0.71577924", "0.71537966", "0.7153581", "0.71457976", "0.71344775", "0.7128049", "0.7120828", "0.7118135", "0.7114121", "0.71124923", "0.71106327", "0.7105427", "0.7083182", "0.7081555", "0.70721644", "0.70642877", "0.7060804", "0.7060448", "0.70599794", "0.70584464", "0.7056376", "0.70545626", "0.7051877", "0.7044318", "0.704419", "0.7041824", "0.7040831", "0.7034979", "0.70346147", "0.7033561", "0.70250523", "0.7022941", "0.7021636", "0.70183575", "0.701696", "0.70150733", "0.7011207", "0.7005677", "0.69973934", "0.69904226", "0.69888175", "0.6986354", "0.69795674", "0.6975671", "0.69720596", "0.6970448" ]
0.0
-1
/ admin adding student portal
public function admin_students_registration($surname,$firstname,$dob,$address,$state,$nationality,$sex,$status,$fname,$occupation,$faddress,$fone,$mname,$moccupation,$mfone,$sponsor,$passport,$signature,$department,$room,$kin_name,$kin_address,$kin_phone,$relationship,$question1,$answer1,$question2,$answer2,$question3,$answer3,$username,$email,$password,$cpassword){ //check if email exist $select_all = "SELECT * FROM student_registration WHERE email = '$email'"; $select_query = $this->conn->query($select_all); $check_user = $select_query->num_rows; if($check_user !=0){ echo "<script> alert('The Email Address has been used'); window.location = 'registration.php'; </script>"; }elseif($password != $cpassword){ echo "<script> alert('Your password is not the same with the confirmed password'); window.location = 'registration.php'; </script>"; }else{ //the path to store the uploaded image $target = "assets/images/".basename($_FILES['passport']['name']); //get all the submitted data from the form $passport = $_FILES['passport']['name']; //move the uploaded image into the folder images if(move_uploaded_file($_FILES['passport']['tmp_name'],$target)){ //the path to store the uploaded signature $target = "assets/images/".basename($_FILES['signature']['name']); //get all the submitted data from the form $signature = $_FILES['signature']['name']; //move the uploaded image into the folder images if(move_uploaded_file($_FILES['signature']['tmp_name'],$target)){ //insert into the database $insert_all = "INSERT INTO student_registration(surname,firstname,dob,address,state,nationality,sex,status,fname,occupation,faddress,fone,mname,moccupation,mfone,sponsor,passport,signature,department,room,kin_name,kin_address,kin_phone,relationship,question1,answer1,question2,answer2,question3,answer3,username,email,password)VALUES('$surname','$firstname','$dob','$address','$state','$nationality','$sex','$status','$fname','$occupation','$faddress','$fone','$mname','$moccupation','$mfone','$sponsor','$passport','$signature','$department','$room','$kin_name','$kin_address','$kin_phone','$relationship','$question1','$answer1','$question2','$answer2','$question3','$answer3','$username','$email','$password')"; $insert_query = $this->conn->query($insert_all); if($insert_query){ echo "<script> alert('Registration has been completed'); window.location = 'my_profile.php'; </script>"; } //it didn't insert into database...check all the variable and database variable very well } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function londontec_students(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_students';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Students',\n\t\t\t'courselist'=> $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 student_add()\n\t{\n\t\tif ($this->session->userdata('teacher_login') != 1)\n redirect(base_url(), 'refresh');\n\t\t\t\n\t\t$page_data['page_name'] = 'student_add';\n\t\t$page_data['page_title'] = get_phrase('add_student');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "function add_student(){\n\t\t\t\n\t\t\t$st_id = self::$db->quote($_POST['id']);\n\t\t\t$fname = self::$db->quote($_POST['firstname']);\n\t\t\t$lname = self::$db->quote($_POST['lastname']);\n\t\t\t$area = self::$db->quote($_POST['area']);\n\t\t\t$result = self::$admin->addStudent($st_id,$fname,$lname,$area);\n\n\t\t\tif($result == 1){\n\t\t\t\techo \"User Added Successfully....\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"something wrong\";\n\t\t\t}\n\t\t}", "function student_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'student_add';\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "public function addStudent(){\n\t\t\n\t\t$this->load->view('add_student');\n\t}", "public function addadminAction()\n {\n $this->doNotRender();\n\n $email = $this->getParam('email');\n $user = \\Entity\\User::getOrCreate($email);\n\n $user->stations->add($this->station);\n $user->save();\n\n \\App\\Messenger::send(array(\n 'to' => $user->email,\n 'subject' => 'Access Granted to Station Center',\n 'template' => 'newperms',\n 'vars' => array(\n 'areas' => array('Station Center: '.$this->station->name),\n ),\n ));\n\n $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'email' => NULL));\n }", "function student_add() {\n if ($this->session->userdata('teacher_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'student_add';\n $page_data[\"total_students\"] = $select_students = $this->db->get(\"student\")->num_rows() + 1;\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "function add_student_page(){\n\t\t\theader(\"Location:../view/add_student_details.php\");\n\t\t}", "public function index()\n {\n return view('admin.pages.add_student');\n }", "public function addstudent()\n {\n return view('admin.addstudent');\n }", "public function create()\n {\n abort_if(Gate::denies('admin_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n return view('admin.pages.student.create');\n }", "public function actionIndex()\n {\n {\n $model = new AdminUser();\n if ($model->load(Yii::$app->request->post())) {\n if ($model->newadmin()) {\n $this->redirect(\\Yii::$app->urlManager->createURL(\"student/index\"));\n }\n }\n return $this->render('new-admin', [\n 'model' => $model,\n ]);\n }\n }", "protected function action() {\n\t\tif($this->isPost() ) {\n\t\t\t$student_node=$this->template->getElementByID(\"student\");\n\t\t\tif($this->pers_id!=\"\")\n\t\t\t$this->template->appendFileByID(\"display_student.html\",\"li\",\"student\",false,$student_node);\n\t\t\telse\n\t\t\t$this->template->appendFileByID(\"no_student.html\",\"span\",\"student\",false,$student_node);\n\t\t\t}\n\t\t}", "function admin_add()\n\t{\n\t $this->set('pagetitle',\"Add Page\");\t\n\t $this->loadModel('User');\n\t $userlists = array();\n\t $userlists = array_merge($userlists,array('0'=>'Admin'));\n\t $allClientLists = $this->User->find('list',array('conditions'=>array('User.user_type_id'=>1),'fields'=>array('id','fname')));\n $userlists = array_merge($userlists,$allClientLists);\n\t $this->set('userlists',$userlists);\n\t \n\t if(!empty($this->data))\n\t {\n\t\tif($this->Page->save($this->data))\n\t\t{\n\t\t $this->Session->setFlash('The Page has been created','message/green');\n\t\t $this->redirect(array('action' => 'index'));\n\t\t}\n\t\telse\n\t\t{\n\t\t $this->Session->setFlash('The Page could not be saved. Please, try again.','message/yellow');\n\t\t}\n\t }\n\t}", "public function addStudent()\n {\n $student = new Student();\n $student->name = 'Shakib';\n $student->email = '[email protected]';\n $student->save();\n\n return 'Student Added Successfully!';\n }", "public function students(){\n\t\t$this->verify();\n\t\t$data['title']=\"Students\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('students/students', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "function admin_add($id = NULL) {\n\t\t\n\t\t$id = convert_uudecode(base64_decode($id));\n\t\t$this->layout = \"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t$this->set(\"states\", $states);\n\t\t\n\t\t$alldata = $this->School->find('all');\n\t\t$schoolname = Set::combine($alldata, '{n}.School.id', '{n}.School.school_name');\n\t\t//print_r($schoolname);\n\t\t//die;\n\t\t$this->set(\"schoolname\", $schoolname);\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t$data['Member']['pwd'] = md5($this->data['Member']['pwd']);\n\t\t\t$data['Member']['email'] = $this->data['Member']['email'];\n\t\t\t$data['Member']['group_id'] = $this->data['Member']['group_id'];\n\t\t\t$data['Member']['active'] = $this->data['Member']['status'];\n\t\t\t$data['Member']['school_id'] = $this->data['Member']['school_id'];\n\t\t\t\n\t\t\t$this->Member->create();\n\t\t\t$db = $this->Member->getDataSource();\n\t\t\t$data['Member']['created'] = $db->expression(\"NOW()\");\n\t\t\t$this->Member->save($data);\n\t\t\t$lastId = $this->Member->getLastInsertId();\n\t\t\t\n\t\t\tif ($lastId) {\n\t\t\t\t$userMeta['userMeta']['fname'] = $this->data['userMeta']['fname'];\n\t\t\t\t$userMeta['userMeta']['lname'] = $this->data['userMeta']['lname'];\n\t\t\t\t$userMeta['userMeta']['address'] = $this->data['userMeta']['address'];\n\t\t\t\t$userMeta['userMeta']['state'] = $this->data['userMeta']['state'];\n\t\t\t\t$userMeta['userMeta']['city'] = $this->data['userMeta']['city'];\n\t\t\t\t$userMeta['userMeta']['zip'] = $this->data['userMeta']['zip'];\n\t\t\t\t$userMeta['userMeta']['contact'] = $this->data['userMeta']['contact'];\n\t\t\t\t$userMeta['userMeta']['member_id'] = $lastId;\n\t\t\t\t\n\t\t\t\t$this->userMeta->create();\n\t\t\t\t\n\t\t\t\tif ($this->userMeta->save($userMeta)) {\n\t\t\t\t\t$this->Session->setFlash('User has been added');\n\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller'=>'members',\t\t\t\t \n\t\t\t\t\t\t'action' => 'admin_member_view',\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$center = Center::lists('name_vi', 'id');\n\t\t$type = $this->type->lists('name','id');\n\t\treturn view('Admin::pages.student.create', compact('type', 'center'));\n\t}", "function addStudents(){\n\n\t\t\tinclude('database/connection.php');\n\n\t\t\tif (isset($_POST['add_student'])) {\n\t\t\n\t\t//define student info variables\n\t\t$idnum = mysqli_real_escape_string($conn, $_POST['idnum']);\n\t\t$name = mysqli_real_escape_string($conn, $_POST['name']);\n\t\t$course = mysqli_real_escape_string($conn, $_POST['course']);\n\t\t$year = mysqli_real_escape_string($conn, $_POST['year']);\n\n\t\t//prevent in ID Number duplication\n\t\t$check_idnum = mysqli_query($conn, \"SELECT * FROM students WHERE IDNumber = '$idnum'\");\n\t\t$count_idnum = mysqli_num_rows($check_idnum);\n\n\t\tif ($count_idnum > 0) {\n\t\t\t\n\t\t\techo \"<script>\n\t\t\t\talert('ID Number is already existing');\n\t\t\t</script>\";\n\n\t\t} else {\n\t\t//adding query start\n\t\t$add_sql = \"INSERT INTO students (IDNumber, Name, Course, Year, Status, Date) \n\t\tVALUES ('$idnum', '$name', '$course', '$year', 'Registered', NOW())\";\n\t\t$add_res = mysqli_query($conn, $add_sql);\n\n\t\tif ($add_res) {\n\t\t\techo \"<script>\n\t\t\t\talert('Added Successfully');\n\t\t\t</script>\n <meta http-equiv='refresh' content='0; url=dashboard.php'>\";\n\t\t\t} else {\n\t\t\techo \"<script>\n\t\t\t\talert('Failure in adding');\n\t\t\t\twindow.open('dashboard.php', '_self');\n\t\t\t</script>\";\n\t\t\t}\n\t\t}\n\t}\n\t\t}", "public function create()\n {\n\n return view('admin.addStudent')->with('course', Course::get(['id','name']));\n }", "function admin_add($id = NULL) {\n\t\t\n\t\t$id = convert_uudecode(base64_decode($id));\n\t\t$this->layout = \"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t$this->set(\"states\", $states);\n\t\t\n\t\t$alldata = $this->School->find('all');\n\t\t$schoolname = Set::combine($alldata, '{n}.School.id', '{n}.School.school_name');\n\t\t\n\t\t$this->set(\"schoolname\", $schoolname);\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t$data['Member']['pwd'] = md5($this->data['Member']['pwd']);\n\t\t\t$data['Member']['email'] = $this->data['Member']['email'];\n\t\t\t$data['Member']['group_id'] = $this->data['Member']['group_id'];\n\t\t//\t$data['Member']['active'] = $this->data['Member']['status'];\n\t\t\t$data['Member']['active'] = 1;\n\t\t\t$data['Member']['school_id'] = $this->data['Member']['school_id'];\n\t\t\t\n\t\t\t$this->Member->create();\n\t\t\t$db = $this->Member->getDataSource();\n\t\t\t$data['Member']['created'] = $db->expression(\"NOW()\");\n\t\t\t$this->Member->save($data);\n\t\t\t$lastId = $this->Member->getLastInsertId();\n\t\t\t\n\t\t\tif ($lastId) {\n\t\t\t\t$userMeta['userMeta']['fname'] = $this->data['userMeta']['fname'];\n\t\t\t\t$userMeta['userMeta']['lname'] = $this->data['userMeta']['lname'];\n\t\t\t\t$userMeta['userMeta']['address'] = $this->data['userMeta']['address'];\n\t\t\t\t$userMeta['userMeta']['state'] = $this->data['userMeta']['state'];\n\t\t\t\t$userMeta['userMeta']['city'] = $this->data['userMeta']['city'];\n\t\t\t\t$userMeta['userMeta']['zip'] = $this->data['userMeta']['zip'];\n\t\t\t\t$userMeta['userMeta']['contact'] = $this->data['userMeta']['contact'];\n\t\t\t\t$userMeta['userMeta']['member_id'] = $lastId;\n\t\t\t\t\n\t\t\t\t$this->userMeta->create();\n\t\t\t\t\n\t\t\t\tif ($this->userMeta->save($userMeta)) {\n\t\t\t\t\t$this->Session->setFlash('User has been added');\n\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller'=>'members',\t\t\t\t \n\t\t\t\t\t\t'action' => 'admin_member_view',\n\t\t\t\t\t));\n\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}", "function student_add($param1 = '') {\n $page_data['page_name'] = 'student_add';\n $page_data['param1'] = $param1;\n $page_data[\"total_students\"] = $select_students = $this->db->get(\"student\")->num_rows() + 1;\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "public function create()\n {\n return view('frontend.pages.student.create');\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 }", "function staff_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'staff_add';\n $page_data['page_title'] = get_phrase('add_staff');\n $this->load->view('backend/index', $page_data);\n }", "public function actionStudents()\n\t{\n\t\t//$this->model = User::loadModel();\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '//drcUser/_list',\n\t\t\t'dataProvider' => $this->model->students(),\n\t\t\t'contentTitle' => 'DRC Students',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t));\n\t}", "function addNew()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data['roles'] = $this->user_model->getUserRoles();\n\n $this->global['pageTitle'] = '添加人员';\n\n $this->loadViews(\"addNew\", $this->global, $data, NULL);\n }\n }", "public function admin_add(){\n \n $this->set(\"title_for_layout\",\"Create a Satellite Group\");\n \n // Load all existing satellites\n $this->set('satellites', $this->Satellite->find('all'));\n }", "public function add() {\n\n\t\tif ( POST ) {\n\n\t\t\t/*-------------------------Generating Student Registration No-------------------------*/\n\t\t\t$max_count_from_db = Student::GetInstance()->getMaxCount();\n\t\t\t$student_serial = sprintf( \"%06s\", $max_count_from_db->max_count + 1 );\n\t\t\t$registration_no = 'S' . $student_serial;\n\t\t\t/*-------------------------Generating registration No code ends here---------------------------------*/\n\n\n\t\t\t/*-------------------------Backend validation Starts-----------------------------------*/\n\t\t\t$validation = new Validation();\n\t\t\t$validation->name( 'name' )->value( $_POST['name'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'guardian_id' )->value( $_POST['guardian_id'] )->pattern( 'int' )->required();\n\t\t\t$validation->name( 'date_of_birth' )->value( $_POST['date_of_birth'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'gender' )->value( $_POST['gender'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'blood_group' )->value( $_POST['blood_group'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'religion' )->value( $_POST['religion'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'current_address' )->value( $_POST['current_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'permanent_address' )->value( $_POST['permanent_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'extra_curricular_activities' )->value( $_POST['extra_curricular_activities'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'remarks' )->value( $_POST['remarks'] )->pattern( 'text' )->required();\n\n\t\t\t/*-------------------------------Validation Ends Here--------------------------*/\n\n\t\t\tif ( $validation->isSuccess() ) {\n\t\t\t\t$student = new Student();\n\t\t\t\t$student->name = trim( $_POST['name'] );\n\t\t\t\t$student->guardian_id = trim( $_POST['guardian_id'] );\n\t\t\t\t$student->date_of_birth = trim( $_POST['date_of_birth'] );\n\t\t\t\t$student->gender = trim( $_POST['gender'] );\n\t\t\t\t$student->blood_group = trim( $_POST['blood_group'] );\n\t\t\t\t$student->religion = trim( $_POST['religion'] );\n\t\t\t\t$student->current_address = trim( $_POST['current_address'] );\n\t\t\t\t$student->permanent_address = trim( $_POST['permanent_address'] );\n\t\t\t\t$student->registration_no = $registration_no;\n\t\t\t\t$student->extra_curricular_activities = trim( $_POST['extra_curricular_activities'] );\n\t\t\t\t$student->remarks = trim( $_POST['remarks'] );\n\t\t\t\t$student->status = 1;\n\t\t\t\t$student->assignment = 0;\n\t\t\t\tif ( $this->file->attach_file( $_FILES['photo'] ) ) {\n\t\t\t\t\t$this->file->upload_dir = 'images/students';\n\t\t\t\t\t//First save the file in directory\n\t\t\t\t\tif ( $this->file->save() ) {\n\t\t\t\t\t\t$student->photo = $this->file->file_name;\n\t\t\t\t\t\t/*------------------------Save the Student-------------------------*/\n\t\t\t\t\t\tif ( $student->create() ) {\n\t\t\t\t\t\t\tredirect( 'Students/index' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdie( 'Something went Wrong' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->file->destroy();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdie( 'Something went wrong' );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t//Show validation Errors\n\t\t\t\techo $validation->displayErrors();\n\n\t\t\t}\n\t\t} else {\n\t\t\t/*--------------Show the empty form before posting a Student-------------*/\n\t\t\t$guardians=Guardian::GetInstance()->getAll();\n\n\t\t\t$data = [\n\t\t\t\t'name' => '',\n\t\t\t\t'guardian_id' => '',\n\t\t\t\t'date_of_birth' => '',\n\t\t\t\t'gender' => '',\n\t\t\t\t'blood_group' => '',\n\t\t\t\t'religion' => '',\n\t\t\t\t'current_address' => '',\n\t\t\t\t'permanent_address' => '',\n\t\t\t\t'photo' => '',\n\t\t\t\t'extra_curricular_activities' => '',\n\t\t\t\t'remarks' => '',\n\t\t\t\t'guardians' => $guardians,\n\t\t\t];\n\t\t\t$this->view( 'students/student_entry/add', $data );\n\t\t}\n\t}", "function addStudent($name, $institution, $major, $minor, $identification, $passkey, $google, $yahoo, $live, $facebook, $linkedin, $twitter){\n\n\t\t$this->connection->query(\"INSERT INTO students (stud_name, stud_inst, stud_major, stud_minor, stud_identification, stud_passkey, stud_google, stud_yahoo, stud_live, stud_facebook, stud_linkedin, stud_twitter) VALUES ('$name', '$institution', '$major', '$minor', '$identification', '$passkey', '$google', '$yahoo', '$live', '$facebook', '$linkedin', '$twitter' )\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add Student!\";\t\t\n\t\t}\t\n\n\t}", "public function showAddNewRecordPage() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-add-show') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $this->data['message'] = $this->session->flashdata('message');\n $this->set_view('user/add_new_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function create()\n {\n if (Menu::hasAccess('students','create')) {\n $religions = Religion::get();\n $genders = Gender::get();\n $disabilities = Disability::orderBy('id','desc')->get();\n $sections = Section::orderBy('id','desc')->get();\n $blood_group = Blood_Group::orderBy('id','asc')->get();\n $orphanges = Orphange::orderBy('id','asc')->get();\n return View('admin.students.create', compact('religions', 'genders', 'disabilities','sections','blood_group','orphanges'));\n } else {\n return View('error');\n }\n }", "public function showAddStudent() {\n\n $viewName = $this->viewFolderStudent . '.addStudent';\n\n return view($viewName);\n }", "public function addStudent()\n {\n\n if ($this->input->post('btnCreate')) {\n\n $fName = $this->input->post('fName');\n $lName = $this->input->post('lName');\n $emailId = $this->input->post('emailId');\n $joinDate = $this->input->post('joinDate');\n $grade = $this->input->post('grade');\n $branch = $this->input->post('branch');\n\n\n $insert = $this->AdminModel->createStudent($fName, $lName, $emailId, $joinDate, $grade, $branch);\n\n\n echo \"<script>\n alert('Successfully Created');\n window.location.href='../AddStudent';\n </script>\";\n } else {\n\n $data['branchDetail'] = $this->AdminModel->viewBranch(); //to view branches from database\n\n $data['gradeDetail'] = $this->AdminModel->viewGrade(); //to view grade from database\n\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('createStudentdetails', $data);\n $this->load->view('footer');\n }\n }", "function index(){\n\n global $wear;\n do_login();\n admin_levels(\"Editor\");\n $template = $this->loadView($wear->front . \"/members/students\");\n $login = $this->loadModel($this->gear, \"sun_student_model\");\n $students = $login->get_students();\n $template->set(\"students\" , $students);\n $template->set(\"page\" , SITE_NAME . \" | Students\");\n $template->render(); \n \n }", "public function create()\n {\n return view('admin/school/detail/school_student.create');\n }", "public function patients_add(){\n\t\t$data['meta_description']='';\n\t\t$data['menu']= $this->menu;\n\n\t\t$data['user'] = $this->user;\n\t\t$data['group'] = $this->group->name;\n\t\t$data['superviser']=$this->superviser_name;;\n\n\t\t$data['page']='patients/patients-add'; //page view to load\n\t\t$data['pls'] = array(); //page level scripts\n\t\t$data['plugins'] = array(); //plugins\n\t\t$data['javascript'] = array(); //javascript\n\t\t$views= array('design/html_topbar','sidebar','design/page','design/html_footer');\n\t\t$this->layout->view($views, $data);\n\t}", "function add() {\n RR_Session::start();\n $get = RR_Session::get('loggedin');\n if ($get == true) {\n // blijf op de pagina\n // en laad de admin view\n $this->validateUser(true, 'newuser');\n } else {\n // anders redirect trug naar de login pagina\n $this->validateUser(false);\n }\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function addStudentManual()\n {\n return view('student::students.student.add-student-manual');\n }", "public function createStudents()\n {\n $authUser = Auth::user();\n $objSchool = new School();\n $schoolsList = $objSchool->getList();\n $objTeachers = new Teachers();\n $schoolinfo = $objTeachers->getTeacherSchools();\n return view(\"teacher.add-student\", compact('authUser', 'schoolsList', 'schoolinfo'));\n }", "function staff_role_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'staff_role_add';\n $page_data['page_title'] = get_phrase('add_staff_role');\n $this->load->view('backend/index', $page_data);\n }", "public function addstudent()\n {\n $classArr = Classes::select('id', 'class_name')->get();\n return view('students/add', compact('classArr'));\n }", "public function add(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$admin = $this->_map_posted_data();\n\t\t\t\t$this->adminrepository->insert($admin);\n\t\t\t\theader(\"Location: \".BASE_URL.\"admin/admin\");\n\n\t\t\t}else{\n\t\t\t\t$view_page =\"adminsview/add\";\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t\t}\n\t\t}", "function exam_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'exam_add';\n $page_data['page_title'] = get_phrase('add_exam');\n $this->load->view('backend/index', $page_data);\n }", "function addNew()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n \n $this->global['pageTitle'] = 'Garuda Informatics : Add New User';\n\n $this->loadViews($this->view.\"addNew\", $this->global, $data, NULL);\n }\n }", "public function add() {\n\t\tRouter::redirect('/users/profile');\t\n\t}", "public function add(){\n\t\t\n\t\t\t$is_logged_in = $this->session->userdata('is_logged_in');\n\t\t\t$this->load->helper('form');\n\t\t\t\n\t\t\tif(!empty($is_logged_in) && $is_logged_in == true){\n\t\t\t\t\n\t\t\t\t$data['title'] = \"Our Instructors\";\n\t\t\t\t\n\t\t\t\t$IsAllowMultiStaff = $this->school_model->IsAllowMultiStaff();\n\t\t\t\t$data['IsAllowMultiStaff'] = $IsAllowMultiStaff;\n\t\t\t\t\n\t\t\t\t$blank_location = array('0' => 'Select Location');\n\t\t\t\t$locations = $this->school_model->getLocations();\n\t\t\t\t\n\t\t\t\t$data['locations'] = $blank_location + $locations;\t\n\t\t\t\t$data['location_id'] = $this->uri->segment(4);\n\t\t\t\tif(isset($_POST['update'])):\n\t\t\t\t\t//echo '<pre>'; print_r($_POST); die('yes');\n\t\t\t\t\t\t\t$this->school_model->addStaff();\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$this->load->view(\"admin/school_staff_add\", $data);\t\n\t\t\t}else{\n\t\t\t\tredirect('admin/login');\n\t\t\t}\n\t\n\t}", "public function admin_add(){\n $content = $this->load->view(\"users/users_form\",\"\",true);\n echo Modules::run(\"template/load_admin\", \"Add New User\", $content);\n }", "public function createstudent()\n {\n return View::make('createstudent');\n }", "function course_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'course_add';\n $page_data['page_title'] = get_phrase('add_course');\n $this->load->view('backend/index', $page_data);\n }", "public function createadmin(){\n if($this->check() == true){\n if(isset($_POST['submit'])){\n $name = $_POST['name'];\n $surname = $_POST['surname'];\n $email = $_POST['email'];\n $pass = $_POST['password'];\n $this->admindb->insert('admin', array(\n 'name' => $name,\n 'surname' => $surname,\n 'email' => $email,\n 'password' => password_hash($pass, PASSWORD_BCRYPT, [12])\n ))->get();\n }else{\n // die(\"There's some problem with creating admin...\");\n }\n $this->view('admin/createadmin');\n// $this->view('admin/createadmin');\n }\n }", "public function create()\n {\n return view('admin.student.create');\n }", "public function add() {\n\n $this->viewBuilder()->layout('admin');\n $doctor = $this->Admins->newEntity();\n if ($this->request->is('post')) {\n// if(!empty($this->request->data['allpermissions']))\n// {\n// $this->request->data['permissions'] = implode(',',$this->request->data['allpermissions']);\n// }\n $doctors = $this->Admins->patchEntity($doctor, $this->request->data);\n \n $this->request->data['created'] = gmdate(\"Y-m-d h:i:s\");\n $this->request->data['modified'] = gmdate(\"Y-m-d h:i:s\"); \n \n if ($this->Admins->save($doctors)) {\n $this->Flash->success(__('The Admin has been saved.'));\n //pr($this->request->data); pr($doctors); exit;\n return $this->redirect(['action' => 'index']);\n } else {\n $this->Flash->error(__('The Admin could not be saved. Please, try again.'));\n }\n } else {\n $this->request->data['first_name'] = '';\n $this->request->data['last_name'] = '';\n $this->request->data['phone'] = '';\n $this->request->data['username'] = '';\n $this->request->data['email'] = '';\n }\n //$this->loadModel('AdminMenus');\n //$menus = $this->AdminMenus->find()->all();\n $this->set(compact('doctor','menus'));\n $this->set('_serialize', ['doctor']);\n }", "public function newStadeAction()\n\t{\n\t\t$stade = new Stade();\n\t\t$form = $this->createForm(new StadeType(), $stade);\n\t\t\n\t\t$request = $this->get('request');\n\t\tif ($request->getMethod() == 'POST') {\n\t\t\t$form->bind($request);\n\t\t\t\t\n\t\t\tif ($form->isValid()) {\n\t\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t\t$em->persist($stade);\n\t\t\t\t$em->flush();\n\t\t\t}\n\t\t\t\t\n\t\t\treturn $this->redirect($this->generateUrl('DFStadeBundle_listeStadeAdmin'));\n\t\t}\n\t\t\n\t\treturn $this->render('DFAdminBundle:Private:form.html.twig', array(\n\t\t\t'form' => $form->createView(),\n\t\t\t'titleCategorie' => 'Stades',\n\t\t\t'title' => 'Ajouter un stade',\n\t\t));\n\t}", "public function index()\n {\n return view('addStudent');\n }", "function student_form_submit($form, &$form_state) {\n $st_ID = db_insert('student')\n ->fields(array(\n 'st_fnm' => check_plain($form_state['values']['st_fnm']),\n 'st_lnm' => check_plain($form_state['values']['st_lnm']),\n 'st_email' => check_plain($form_state['values']['st_email']),\n ))\n ->execute();\n drupal_set_message(t('Entry has been added.'));\n}", "function teacher_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'teacher_add';\n $page_data['page_title'] = get_phrase('add_teacher');\n $this->load->view('backend/index', $page_data);\n }", "public function adicionarprofessor() {\n\t\tself::header();\n\t\t$this->load->view('administracao/adicionarprofessor');\n\t\tself::footer();\n\t}", "public function create()\n\t{\n\t\t$data = ['user_role_id' => USER_ROLE_ADMINISTRATOR];\n\t\tif ($id = $this->users_model->save($data)) {\n\n\t\t\t//if user has not access to update\n\t\t\t$this->session->set_userdata(['new_item' => ['module' => 'administrators', 'id' => $id]]);\n\n\t\t\tredirect(\"/admin/users/update/$id\");\n\t\t}\n\t\telse {\n\t\t\t$this->pls_alert_lib->set_flash_messages('error', lang('admin_create_failed'));\n\t\t\tredirect(\"/admin/administrators\");\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$this->authorize('edit', new Student);\n\t\treturn view('student.create');\n\t}", "public function create()\n\t{ \t\t\t\t\n\t\tif(!User::hasPermTo(MODULE,'create'))return Redirect::to('admin/error/show/403');\n\t\treturn View::make('backend.admin.staff.add');\n\t}", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function create()\n {\n // Check if the user has an active scholarship\n $hasActiveScholarship = $this->user->scholarship != null;\n // Navigate to another page if false\n if (!$hasActiveScholarship) return inertia('ScholarshipClosed');\n // Navigate to Application page\n return inertia(\"Student/CreatePage\");\n }", "public function testCreate()\n {\n $this->visit('/admin/school/create')\n ->submitForm($this->saveButtonText, $this->school)\n ->seePageIs('/admin/school')\n ;\n\n $this->seeInDatabase('schools', $this->school);\n }", "public function administrator(){\n\t\t$this->verify();\n\t\t$data['title']=\"Administrator\";\n\t\t$data['admin_list']=$this->admin_model->fetch_admin();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('administrator/administrator', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function show(Studentadd $studentadd)\n {\n //\n }", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\t$users = $this->ShopList->User->find('list');\n\t\t$shopShippingMethods = $this->ShopList->ShopShippingMethod->find('list');\n\t\t$shopPaymentMethods = $this->ShopList->ShopPaymentMethod->find('list');\n\t\t$this->set(compact('users', 'shopShippingMethods', 'shopPaymentMethods'));\n\t}", "public function admin_add()\n\t{\n\t\tif (!empty( $this->request->data)) {\n\t\t\t$this->Role->create();\n\t\t\tif ( $this->Role->save( $this->request->data ) ) {\n\t\t\t\t$this->Session->setFlash(__d('admin', 'Role created.'), 'flash_success', array('plugin' => 'Pukis'));\n\t\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t\t}\n\t\t\t\n\t\t\t$this->Session->setFlash(__d('users', 'Unknown error occured!'), 'flash_error', array('plugin' => 'Pukis'));\n\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t}\n\t}", "function add_semister($id=0){\n $post=$this->input->post();\n if($post){\n\t\t//echo \"<pre>\";\n //print_r($_POST);//exit;\n\t\t\t$st_id=$_POST['st_id'];\n\t\t\t$sem_id=$_POST['sem_id'];\n\t\t$check=$this->db->query(\"select id from student_semisters where user_id='\".$st_id.\"' and semister_id='\".$sem_id.\"'\");\n\t\tif($check->num_rows()==0){\n\t\t $this->db->query(\"update student_semisters set is_current='0' where user_id='\".$st_id.\"'\");\n\t\t\t$this->db->query(\"insert into student_semisters (`user_id`, `semister_id`,`is_current`) values ('\".$st_id.\"','\".$sem_id.\"','1')\");\n\t\t\t}\n\t\t\tredirect('admin/user_accounts');\n }else{\n\t\t\t$data['st_id']=$id;\t\t\t\t\t\n\t\t\t$data['content_page']='admin/add_semister';\n $this->load->view('common/base_template',$data);\n\t\t}\n }", "function assignstudent(){\n\t\t\n\t\t$insert = array();\n\t\t$insert['rolename'] = $this->input->post(\"rolename\");\n\t\t$insert['user_id'] = $this->input->post(\"studentid\");\t\t\n\t\t$azureRoleDetails = $this->Azure->getAzureRoleDetails($insert['rolename']);\n\t\t$insert['azure_vm_id'] = $azureRoleDetails['id'];\n\t\t\n\t\t$user = $this->User->getUser($insert['user_id']);\n\t\t// $vminfo = $this->Azure->;\n if($user){ \n \t$return = $this->Azure->assignStudent($insert);\n\t\t}else\n $return = array(\"type\" => \"danger\",\"msg\" => \"The students was not found.\");\t\t\t\n\t\t\n\t\techo json_encode($return);\n\t}", "public function post_student() {\n $params = array(\n 'ruid' => Input::get('ruid'), \n 'net_id'=> Input::get('net_id'),\n 'passwd'=> Hash::make(Input::get('passwd')), \n 'email_addr' => Input::get('email_addr'), \n 'grad_year' => Input::get('grad_year'), \n 'major' => Input::get('major'), \n 'credits' => Input::get('credits'), \n 'gpa' => Input::get('gpa')\n );\n \n $user = User::create(array('net_id' => $params['net_id'], 'passwd' => $params['passwd']));\n $user->save();\n\n $student = new Student;\n $student->fill($params);\n $student->save();\n\n Auth::login($user);\n\n return Redirect::to('account/studentedit');\n }", "public function create()\n {\n return $this->view_('student.update',[\n 'object'=> new Student(),\n ]);\n }", "public function add()\n {\n // Search student on EtuUTT\n $data = Request::only(['search']);\n $usersAssoc = [];\n $search = '';\n if ($data && !empty($data['search'])) {\n $search = $data['search'];\n $explode = explode(' ', $search, 5);\n $users = [];\n\n // Search every string as lastname and firstname\n $users = EtuUTT::call('/api/public/users', [\n 'multifield' => $search\n ])['data'];\n\n // Remove duplicata and put them at the beginning\n $usersAssoc = [];\n foreach ($users as $key => $value) {\n // put rel as key in the _link array\n $value['links'] = [];\n foreach ($value['_links'] as $link) {\n $value['links'][$link['rel']] = $link['uri'];\n }\n // If duplication\n if (isset($usersAssoc[$value['login']])) {\n // Remove every values\n unset($usersAssoc[$value['login']]);\n // Put it at the beginning\n $usersAssoc = array_merge([$value['login'] => $value], $usersAssoc);\n }\n // add it if student student remove it\n elseif ($value['isStudent'] == 1) {\n $usersAssoc[$value['login']] = $value;\n }\n }\n }\n\n return View::make('dashboard.ce.add', [\n 'search' => $search,\n 'students' => $usersAssoc\n ]);\n }", "public function addStudent($studentId = FALSE){\n\n if ($studentId) {\n $this->db->where('usr_id', $studentId);\n $this->db->update('user', array('usr_assigned_lecturer_id' => $this->session->userdata('id')));\n }\n }", "function add_parent_data(){\n\t\t$this->load->helper('form');\n\t\t$this->data['student_id'] = '';\n\t\tif(isset($_REQUEST['student_id'])){\n\t\t\t$this->data['student_id'] = $_REQUEST['student_id'];\n\t\t}\n\t\telseif(isset($_GET['student_id'])){\n\t\t\t$this->data['student_id'] = $_GET['student_id'];\n\t\t}\n\t\t$this->data['not_popup'] = FALSE;\n\t\t$this->data['country_list'] = Base_model::get_country_list();\n\t\t$this->load->view('settings/students/add_parent_detail',$this->data);\n\t}", "public function addAction()\n {\n// $m = $this->baseView('view',['lside','passportAdmin'],['lside'=>['list' => $this->names,'base' => ''],'cont' => ['fsd']]);\n// $p = $cr->render($m,[]);\n $p = $this->add($this->model);\n return $this->baseView('view',['admin/lside','passport/admin/add'],['lside'=>['list' => $this->names,'base' => ''],'cont' => $p]);\n }", "public function create()\n {\n if (!$this->isRole())\n return redirect()->back();\n $depts=Department::all();\n return view('students.create',compact('depts'));\n }", "public function addCoursesPage(){\n return View('admin.addcourse');\n }", "public function create()\n {\n return view('student.add');\n }", "public function createStudent($firstName, $lastName, $userName, $password, $emailAddress, $studentId, $major, $address);", "function student(){\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/couponsCode');\n\t\t\t$this->load->view('admin/footer');\n\t\t}", "function admin_create_new_user(){ \r\n\t\t\t$id = $this->uri->segment(3);\r\n\t\t\tif($id){\r\n\t\t\t\t$result['update_user_value'] = $this->model->get_edit_record();\r\n\t\t\t}\t \r\n\t\t\t$result['new_user_data'] = $this->model->select_new_user();\r\n\t\t\t$this->load->view('admin-worldsclinicalguide/admin_create_new_user',$result); \r\n\t}", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function create()\n {\n $student = array();\n return view('admin.student.create',compact('student'));\n }", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function create()\n {\n //\n $title = \"Add New Student\";\n $return_route = 'student_extra.index';\n\n // Get Level List\n $level_list = Level::pluck('level_name', 'id');\n\n return view('students_extra.create', compact(\n 'title', \n 'return_route',\n 'level_list'\n ));\n }", "public function createAdmin() { return view('panel.users.create.admin'); }", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function actionDefault() {\n\t\t$this->template->students = $this->userService->getStudentsByCreator($this->getUserIdentity());\n\t}", "public function create()\n {\n $states = State::all();\n $countries = Country::all();\n $grades = Grade::with('subjects')->get();\n $grades_array = $grades->toArray();\n $referrers = Referrer::all();\n $student_statuses = StudentStatus::all();\n\n return view('admin.students.create', compact('grades', 'states', 'countries', 'grades_array', 'referrers'\n , 'student_statuses'));\n }", "public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function actionCreate()\n {\n $model = new HospitalForm();\n if ($model->load(Yii::$app->request->post())) {\n $model->groupid=Groups::GROUP_HOSPITAL;\n $model->admin_user_id=Yii::$app->user->id;\n if($res = $model->signup()){\n return $this->redirect(['details', 'id' => $res->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }", "public function create()\n\t{\n\t\t$data['title'] = \"Level Admin\";\n\t\t// $data['level'] = $this->level->getAll();\n\t\t$data['action'] = \"level/insert\";\n\t\t$this->template->admthemes('level/formCreate',$data);\n\t}", "public function add_stories_form(){\r\r\n\t\tif ($this->checkLogin('A') == ''){\r\r\n\t\t\tredirect('admin');\r\r\n\t\t}else {\r\r\n\t\t\t$condition = array('user_id' => '0');\r\r\n\t\t\t$this->data['added_product'] = $this->stories_model->get_all_details(PRODUCT,$condition);\r\r\n\t\t\t$this->data['heading'] = 'Add New stories';\r\r\n\t\t\t$this->load->view('admin/stories/add_stories',$this->data);\r\r\n\t\t}\r\r\n\t}", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\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 }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }" ]
[ "0.76444465", "0.7634457", "0.7353907", "0.7337626", "0.72254354", "0.72068", "0.71852076", "0.7161217", "0.7133889", "0.70040214", "0.6957299", "0.6761263", "0.6652415", "0.66022384", "0.6515829", "0.64881605", "0.64707965", "0.64598197", "0.64595515", "0.6441598", "0.64306885", "0.6429789", "0.6422627", "0.6410961", "0.6348614", "0.6333326", "0.63325465", "0.6331864", "0.63212377", "0.6302115", "0.6295318", "0.62838185", "0.628363", "0.6281911", "0.627967", "0.6273685", "0.62685", "0.6255463", "0.6247352", "0.62373286", "0.6232864", "0.6226278", "0.6216292", "0.6206312", "0.6195532", "0.6192587", "0.6179559", "0.6173735", "0.6170947", "0.6169776", "0.61661637", "0.616445", "0.61620307", "0.6158139", "0.61562765", "0.61504114", "0.61430514", "0.61405283", "0.61361456", "0.6114834", "0.6110615", "0.6105715", "0.60931194", "0.6082676", "0.6078056", "0.607489", "0.60742617", "0.60706544", "0.60704625", "0.60686487", "0.60594994", "0.6055579", "0.6049411", "0.60486126", "0.60478824", "0.6037576", "0.60361063", "0.6021348", "0.6020367", "0.60101765", "0.6010056", "0.60001796", "0.5997006", "0.5995904", "0.59912956", "0.5990193", "0.5986231", "0.59831744", "0.5979229", "0.59787124", "0.5978568", "0.59779227", "0.59762675", "0.59727585", "0.59726316", "0.597076", "0.59497285", "0.59490585", "0.59462386", "0.59403324", "0.59403324" ]
0.0
-1
/ Add new Admin
public function new_admin($email,$password){ $insert_admin = "INSERT INTO admin(email,password)VALUES('$email','$password')"; $insert_query = $this->conn->query($insert_admin); header('Location:add_admin.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAdmin()\n {\n return view('super_admin/addAdmin');\n }", "public function addAdmin()\n {\n return view('backend.pages.admin.add-admin');\n }", "public function getAddAdmin(){\n return view('auth.addAdmin');\n }", "public function create()\n {\n //\n // return view('addAdmin');\n }", "function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Project->create();\n\t\t\t$status = $this->Project->saveAll($this->data);\n\t\t\tif ($status) {\n\t\t\t\t$name = Set::classicExtract($this->data, 'Upload.0.file.name');\n\t\t\t\tif(empty($name)){\n\t\t\t\t\t$this->Session->setFlash(__('The project has been saved', true));\n\t\t\t\t\t$this->redirect(array('action'=>'dashboard', $this->Project->getLastInsertId()));\n\t\t\t\t}else{\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'action' => 'add_members', \n\t\t\t\t\t\t'admin' => true, \n\t\t\t\t\t\t$this->Project->getLastInsertId(),\n\t\t\t\t\t\t$this->Project->Upload->getLastInsertId()\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The project could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}else{\n\t\t\t//make it so that the person who's creating is one of the admin by default.\n\t\t\t$this->data['Admin']['Admin'] = array($this->Auth->user('id'));\n\t\t}\n\t\t$admins = $this->Project->Admin->find('list');\n\t\t\n\t\t\n\t\t$this->set(compact('admins'));\n\t}", "public function create()\n {\n return view('superAdmin.addAdmin');\n }", "function addNew()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data['roles'] = $this->user_model->getUserRoles();\n\n $this->global['pageTitle'] = '添加人员';\n\n $this->loadViews(\"addNew\", $this->global, $data, NULL);\n }\n }", "public static function add_admin_menus()\n\t{\n\t}", "public function add(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$admin = $this->_map_posted_data();\n\t\t\t\t$this->adminrepository->insert($admin);\n\t\t\t\theader(\"Location: \".BASE_URL.\"admin/admin\");\n\n\t\t\t}else{\n\t\t\t\t$view_page =\"adminsview/add\";\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t\t}\n\t\t}", "function admin_add()\n\t{\n\t $this->set('pagetitle',\"Add Page\");\t\n\t $this->loadModel('User');\n\t $userlists = array();\n\t $userlists = array_merge($userlists,array('0'=>'Admin'));\n\t $allClientLists = $this->User->find('list',array('conditions'=>array('User.user_type_id'=>1),'fields'=>array('id','fname')));\n $userlists = array_merge($userlists,$allClientLists);\n\t $this->set('userlists',$userlists);\n\t \n\t if(!empty($this->data))\n\t {\n\t\tif($this->Page->save($this->data))\n\t\t{\n\t\t $this->Session->setFlash('The Page has been created','message/green');\n\t\t $this->redirect(array('action' => 'index'));\n\t\t}\n\t\telse\n\t\t{\n\t\t $this->Session->setFlash('The Page could not be saved. Please, try again.','message/yellow');\n\t\t}\n\t }\n\t}", "static function addNewAdmin(Admin $admin)\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('INSERT INTO admin SET firstname=?,lastname=?,username=?,password=?,role=?,idPart=?');\n $req->execute(array(\n $admin->getFirstname(),\n $admin->getLastname(),\n $admin->getUsername(),\n sha1($admin->getPassword()),\n $admin->getRole(),\n $admin->getDateCreated()\n ));\n return $con->lastInsertId();\n }", "public static function createAdmin()\n {\n // Name is required\n if(!isset($_POST['username'])) Status::message(Status::ERROR, \"At least specify a name\");\n if(!isset($_POST['password'])) Status::message(Status::ERROR, \"At least specify a password\");\n\n $add_admin = DatabaseManager::query(\"main\",\n \"INSERT INTO `admin_users` (username, password, created) VALUES (:username, :password, NOW())\",\n [\n \"username\" => $_POST['username'],\n \"password\" => password_hash($_POST['password'], PASSWORD_BCRYPT)\n ]\n );\n if(!$add_admin) Status::message(Status::ERROR, \"Couldn't insert into the DB\");\n\n // Refresh Cache to apply changes\n CacheManager::loadDefaults(true);\n Status::message(Status::SUCCESS, \"Added Successfully! :)\");\n }", "public function admin_add()\n\t{\n\t\tif (!empty( $this->request->data)) {\n\t\t\t$this->Role->create();\n\t\t\tif ( $this->Role->save( $this->request->data ) ) {\n\t\t\t\t$this->Session->setFlash(__d('admin', 'Role created.'), 'flash_success', array('plugin' => 'Pukis'));\n\t\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t\t}\n\t\t\t\n\t\t\t$this->Session->setFlash(__d('users', 'Unknown error occured!'), 'flash_error', array('plugin' => 'Pukis'));\n\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t}\n\t}", "public function admin_create()\n {\n return View::make('admin_create');\n }", "public function addadminAction()\n {\n $this->doNotRender();\n\n $email = $this->getParam('email');\n $user = \\Entity\\User::getOrCreate($email);\n\n $user->stations->add($this->station);\n $user->save();\n\n \\App\\Messenger::send(array(\n 'to' => $user->email,\n 'subject' => 'Access Granted to Station Center',\n 'template' => 'newperms',\n 'vars' => array(\n 'areas' => array('Station Center: '.$this->station->name),\n ),\n ));\n\n $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'email' => NULL));\n }", "public function add() {\n\n $this->viewBuilder()->layout('admin');\n $doctor = $this->Admins->newEntity();\n if ($this->request->is('post')) {\n// if(!empty($this->request->data['allpermissions']))\n// {\n// $this->request->data['permissions'] = implode(',',$this->request->data['allpermissions']);\n// }\n $doctors = $this->Admins->patchEntity($doctor, $this->request->data);\n \n $this->request->data['created'] = gmdate(\"Y-m-d h:i:s\");\n $this->request->data['modified'] = gmdate(\"Y-m-d h:i:s\"); \n \n if ($this->Admins->save($doctors)) {\n $this->Flash->success(__('The Admin has been saved.'));\n //pr($this->request->data); pr($doctors); exit;\n return $this->redirect(['action' => 'index']);\n } else {\n $this->Flash->error(__('The Admin could not be saved. Please, try again.'));\n }\n } else {\n $this->request->data['first_name'] = '';\n $this->request->data['last_name'] = '';\n $this->request->data['phone'] = '';\n $this->request->data['username'] = '';\n $this->request->data['email'] = '';\n }\n //$this->loadModel('AdminMenus');\n //$menus = $this->AdminMenus->find()->all();\n $this->set(compact('doctor','menus'));\n $this->set('_serialize', ['doctor']);\n }", "final public function addAdmin() {\n $eventclass = $this->event;\n $admin_data = $eventclass::getAdminData();\n\n if ($admin_data) {\n if (!isset($admin_data['usertype'])) {\n $admin_data['usertype'] = self::getDefaultUserType();\n }\n $this->addToRecipientsList($admin_data);\n }\n }", "public static function createAdmin()\r\n\t{\r\n\t\treturn new Admin();\r\n\t}", "public function createAdmin() { return view('panel.users.create.admin'); }", "public function addAdmin() {\n $user = User::all();\n if($user->isEmpty()) {\n return view('frontend.auth.add-admin');\n }else{\n return redirect('login');\n }\n }", "function addNew()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n \n $this->global['pageTitle'] = 'Garuda Informatics : Add New User';\n\n $this->loadViews($this->view.\"addNew\", $this->global, $data, NULL);\n }\n }", "public function addAdmin(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\n\t\t$data['countries'] = $this->db->get('countries');\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'addAdmin') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('first_name', 'First Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'required|trim|is_unique[users.email]');\n\t\t\t$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');\n\t\t\t$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');\n\t\t\t$this->form_validation->set_rules('gender', 'Gender', 'required');\n\t\t\t$this->form_validation->set_rules('country', 'Country', 'required');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->settings_model->addAdmin();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Admin Created Success');\n\t\t\t\t\tredirect(base_url('admin_settings/addAdmin'));\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\ttheme('addAdmin', $data);\n\t}", "function add_data_admin($data_admin)\n\t\t{\n\t\t\t$this->db->insert('admin', $data_admin);\n\t\t}", "public function admin_add(){\n $content = $this->load->view(\"users/users_form\",\"\",true);\n echo Modules::run(\"template/load_admin\", \"Add New User\", $content);\n }", "public function createadmin(){\n if($this->check() == true){\n if(isset($_POST['submit'])){\n $name = $_POST['name'];\n $surname = $_POST['surname'];\n $email = $_POST['email'];\n $pass = $_POST['password'];\n $this->admindb->insert('admin', array(\n 'name' => $name,\n 'surname' => $surname,\n 'email' => $email,\n 'password' => password_hash($pass, PASSWORD_BCRYPT, [12])\n ))->get();\n }else{\n // die(\"There's some problem with creating admin...\");\n }\n $this->view('admin/createadmin');\n// $this->view('admin/createadmin');\n }\n }", "public function create()\n {\n //\n return view ('theme.admin.create_admin');\n }", "public static function insertAdmin(\\App\\Models\\AdminModel $admin){\n $adminDatabase = new Database('admin');\n \n $admin->setId(\n $adminDatabase->insert([\n 'name' => $admin->getName(),\n 'email' => $admin->getEmail(),\n 'password' => $admin->getPassword(),\n 'can_manage_posts' => $admin->getCanManagePosts() ? 1 : 0,\n 'can_manage_users' => $admin->getCanManageUsers() ? 1 : 0,\n 'can_manage_dumps' => $admin->getCanManageDumps() ? 1 : 0,\n ])\n );\n }", "public function add_admin() {\n $current_pages = array();\n\n $permission = 'manage_options';\n if (defined('SWPM_MANAGEMENT_PERMISSION')){\n $permission = SWPM_MANAGEMENT_PERMISSION;\n }\n \n $current_pages['swpm'] = add_submenu_page('simple_wp_membership', __('Form Builder', 'simple-membership'), __('Form Builder', 'simple-membership'), $permission, 'swpm-form-builder', array(&$this, 'admin'));\n // All plugin page load hooks\n foreach ($current_pages as $key => $page) {\n // Load the jQuery and CSS we need if we're on our plugin page\n add_action(\"load-$page\", array(&$this, 'admin_scripts'));\n\n // Load the Help tab on all pages\n add_action(\"load-$page\", array(&$this, 'help'));\n }\n // Save pages array for filter/action use throughout plugin\n $this->_admin_pages = $current_pages;\n\n // Adds a Screen Options tab to the Entries screen\n add_action('load-' . $current_pages['swpm'], array(&$this, 'screen_options'));\n\n // Add meta boxes to the form builder admin page\n add_action('load-' . $current_pages['swpm'], array(&$this, 'add_meta_boxes'));\n\n add_action('load-' . $current_pages['swpm'], array(&$this, 'include_forms_list'));\n }", "public function index()\n {\n return view('addAdmin');\n }", "function add_admin_panel(){\n\n\t\t$this->adminPanel = new WordpressConnectAdminPanel();\n\n\t}", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\t$users = $this->ShopList->User->find('list');\n\t\t$shopShippingMethods = $this->ShopList->ShopShippingMethod->find('list');\n\t\t$shopPaymentMethods = $this->ShopList->ShopPaymentMethod->find('list');\n\t\t$this->set(compact('users', 'shopShippingMethods', 'shopPaymentMethods'));\n\t}", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "public function showAddAdminPanel(){\n return $this->view('frontend/admin/addadmin.twig');\n }", "public function addAdminMenu()\n\t {\n\t add_menu_page('Create Metas', 'Create Metas', 'manage_options', 'create-metas', array( $this, 'optionsPage' ), 'dashicons-admin-tools', 66 );\n\t }", "public function create()\n\t{\n\t\t$data = ['user_role_id' => USER_ROLE_ADMINISTRATOR];\n\t\tif ($id = $this->users_model->save($data)) {\n\n\t\t\t//if user has not access to update\n\t\t\t$this->session->set_userdata(['new_item' => ['module' => 'administrators', 'id' => $id]]);\n\n\t\t\tredirect(\"/admin/users/update/$id\");\n\t\t}\n\t\telse {\n\t\t\t$this->pls_alert_lib->set_flash_messages('error', lang('admin_create_failed'));\n\t\t\tredirect(\"/admin/administrators\");\n\t\t}\n\t}", "public function register_admin_page()\n {\n }", "public function admin_add_new() {\n ?>\n <div class=\"wrap\">\n <h2><?php _e('Add New Form', 'swpm-form-builder'); ?></h2>\n <?php\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-new-form.php' );\n ?>\n </div>\n <?php\n }", "public function createAdmin()\n {\n if(Auth::user()->role()->first()['id'] != 1 ){\n return redirect('/unauthorised')->with('error', 'Error 403');\n }\n return view('users.admins.new');\n }", "protected function addAdminAccount()\n {\n //disconnect existing DB connection to reconnect with new updated config variables.\n\n $this->line(\"Deleting any existing admin accounts.\");\n //empty users table.\n User::truncate();\n\n $this->line(\"Creating admin account.\");\n $username = 'admin';\n $password = 'AccessManager3';\n\n $user = new User([\n 'username' => $username,\n 'password' => $password,\n 'name' => 'Administrator',\n 'email' => 'access@manager',\n ]);\n $user->saveOrFail();\n\n $this->line(\"Account successfully created.\");\n $this->info(\"Username: $username\");\n $this->info(\"Password: $password\");\n $this->line(\"Run 'php artisan admin:reset' to reset admin password.\");\n }", "public function admin_add(){\n \n $this->set(\"title_for_layout\",\"Create a Satellite Group\");\n \n // Load all existing satellites\n $this->set('satellites', $this->Satellite->find('all'));\n }", "function addAdministrator($data) {\r\n\t\r\n\t\t//Check to see if the type is zero or not\r\n\t\tif($data['type'] == 0) {\r\n\t\t\t$type = 2; //Set the type variable to 2 (technician)\r\n\t\t} else if($data['type'] == 1) {\r\n\t\t\t$type = 1;\r\n\t\t} else if($data['type'] == 2) {\r\n\t\t\t$type = 2;\r\n\t\t} //end if\r\n\r\n\t\t$this->query('INSERT INTO admins (`id`, `created`, `modified`, `username`, `password`, `first_name`, `middle_name`, \r\n\t\t\t\t\t\t\t `last_name`, `email`, `type`, `computer_id`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['username'] .'\", md5(\"'. $data['password'] .'\"), \"'. $data['first_name'] .'\",\r\n\t\t\t\t\t\t\t\t\t \"'. $data['middle_name'] .'\", \"'. $data['last_name'] .'\", \"'. $data['email'] .'\", '. $type .', '. $data['computer_id'] .');');\r\n\r\n\t}", "public function addAdminMenuEntries(): void {\n foreach ($this->adminPages as $page) {\n (new $page($this->container));\n }\n }", "public function create()\n\t{\n\t\t\n return view('pages.createadmin');\n\t}", "public function create()\n {\n return view('admin.admins.create'); \n }", "public function add_admin($values){\n $this->db->insert('event_admin', $values);\n }", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function create()\n\t{\n\t\treturn $this->renderView('admin.admins.create');\n\t}", "public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function create_admin()\n {\n //get dropdown data\n $functional_units = [];\n $data = [];\n $this->get_data($data, $functional_units);\n\n return view('accounts.create_admin')->with([\n 'functional_units' => $functional_units, \n 'data' => $data\n ]);\n }", "public function createAdmin() {\n if(User::where('email', '[email protected]')->count() == 0) {\n $admin = new User();\n $admin->name = \"Administrador\";\n $admin->email = \"[email protected]\";\n $admin->password = bcrypt(\"admin\");\n $admin->user_type = User::UserTypeAdmin;\n $admin->save();\n }\n }", "public function create()\n {\n Auth::check();\n return view(\"ControlPanel.admin.create\");\n }", "public function create()\n {\n return view('admin.add');\n }", "public function create()\n {\n return view('admin.add');\n }", "public function create_admin() {\n\t\t$data['school_id'] = html_escape($this->input->post('school_id'));\n\t\t$data['name'] = html_escape($this->input->post('name'));\n\t\t$data['email'] = html_escape($this->input->post('email'));\n\t\t$data['password'] = sha1($this->input->post('password'));\n\t\t$data['phone'] = html_escape($this->input->post('phone'));\n\t\t$data['gender'] = html_escape($this->input->post('gender'));\n\t\t$data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$data['address'] = html_escape($this->input->post('address'));\n\t\t$data['role'] = 'admin';\n\t\t$data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $data);\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('admin_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function create()\n {\n //\n return $this->formView( new Admin() );\n }", "public function addAction() {\n $form = new Admin_Form_CreateAdminUser();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $values = $form->getValues();\n $adminMapper = new Application_Model_Table_AdminUsers();\n $userFound = $adminMapper->fetchByUsername($values['username']);\n if(!$userFound){\n $values['is_active'] = 1;\n $values['is_admin'] = 1;\n $adminUser = $adminMapper->createRow($values);\n $adminUser->hashPassword($values['new_password']);\n $adminUser->save();\n $this->_helper->FlashMessenger->addMessage('The user has been created' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-users', true);\n } else {\n $this->view->messages['error'] = \"This username already exists\";\n }\n }\n }\n $this->view->form = $form;\n }", "public function crearadmin()\n {\n //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n \"admin\"\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=\"admin\";\n $usuarios->primer_apellido=\"admin\";\n $usuarios->segundo_apellido=\"admin\";\n $usuarios-> fecha_nacimiento=\"1998/03/12\";\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=\"[email protected]\";\n $usuarios->telefono=\"6734687\";\n $usuarios->contrasena=password_hash(\"admin\", PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash(\"admin\", PASSWORD_DEFAULT);\n $usuarios->alias=\"admin\";\n $usuarios->foto = null;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n \n \n }\n \n \n \n \n \n \n }", "function admin_add($id = NULL) {\n\t\t\n\t\t$id = convert_uudecode(base64_decode($id));\n\t\t$this->layout = \"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t$this->set(\"states\", $states);\n\t\t\n\t\t$alldata = $this->School->find('all');\n\t\t$schoolname = Set::combine($alldata, '{n}.School.id', '{n}.School.school_name');\n\t\t\n\t\t$this->set(\"schoolname\", $schoolname);\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t$data['Member']['pwd'] = md5($this->data['Member']['pwd']);\n\t\t\t$data['Member']['email'] = $this->data['Member']['email'];\n\t\t\t$data['Member']['group_id'] = $this->data['Member']['group_id'];\n\t\t//\t$data['Member']['active'] = $this->data['Member']['status'];\n\t\t\t$data['Member']['active'] = 1;\n\t\t\t$data['Member']['school_id'] = $this->data['Member']['school_id'];\n\t\t\t\n\t\t\t$this->Member->create();\n\t\t\t$db = $this->Member->getDataSource();\n\t\t\t$data['Member']['created'] = $db->expression(\"NOW()\");\n\t\t\t$this->Member->save($data);\n\t\t\t$lastId = $this->Member->getLastInsertId();\n\t\t\t\n\t\t\tif ($lastId) {\n\t\t\t\t$userMeta['userMeta']['fname'] = $this->data['userMeta']['fname'];\n\t\t\t\t$userMeta['userMeta']['lname'] = $this->data['userMeta']['lname'];\n\t\t\t\t$userMeta['userMeta']['address'] = $this->data['userMeta']['address'];\n\t\t\t\t$userMeta['userMeta']['state'] = $this->data['userMeta']['state'];\n\t\t\t\t$userMeta['userMeta']['city'] = $this->data['userMeta']['city'];\n\t\t\t\t$userMeta['userMeta']['zip'] = $this->data['userMeta']['zip'];\n\t\t\t\t$userMeta['userMeta']['contact'] = $this->data['userMeta']['contact'];\n\t\t\t\t$userMeta['userMeta']['member_id'] = $lastId;\n\t\t\t\t\n\t\t\t\t$this->userMeta->create();\n\t\t\t\t\n\t\t\t\tif ($this->userMeta->save($userMeta)) {\n\t\t\t\t\t$this->Session->setFlash('User has been added');\n\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller'=>'members',\t\t\t\t \n\t\t\t\t\t\t'action' => 'admin_member_view',\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n return view('admin::frontend.admins.create');\n }", "public function create()\n {\n // echo \"这是添加权限页面呀\";\n\n return view('Admin.Admins.nodeadd');\n }", "public function addAdminAssets() {}", "public function create()\n {\n return view('create_admins');\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function admin_add($id = NULL) {\n\t\t\n\t\t$id = convert_uudecode(base64_decode($id));\n\t\t$this->layout = \"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t$this->set(\"states\", $states);\n\t\t\n\t\t$alldata = $this->School->find('all');\n\t\t$schoolname = Set::combine($alldata, '{n}.School.id', '{n}.School.school_name');\n\t\t//print_r($schoolname);\n\t\t//die;\n\t\t$this->set(\"schoolname\", $schoolname);\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t$data['Member']['pwd'] = md5($this->data['Member']['pwd']);\n\t\t\t$data['Member']['email'] = $this->data['Member']['email'];\n\t\t\t$data['Member']['group_id'] = $this->data['Member']['group_id'];\n\t\t\t$data['Member']['active'] = $this->data['Member']['status'];\n\t\t\t$data['Member']['school_id'] = $this->data['Member']['school_id'];\n\t\t\t\n\t\t\t$this->Member->create();\n\t\t\t$db = $this->Member->getDataSource();\n\t\t\t$data['Member']['created'] = $db->expression(\"NOW()\");\n\t\t\t$this->Member->save($data);\n\t\t\t$lastId = $this->Member->getLastInsertId();\n\t\t\t\n\t\t\tif ($lastId) {\n\t\t\t\t$userMeta['userMeta']['fname'] = $this->data['userMeta']['fname'];\n\t\t\t\t$userMeta['userMeta']['lname'] = $this->data['userMeta']['lname'];\n\t\t\t\t$userMeta['userMeta']['address'] = $this->data['userMeta']['address'];\n\t\t\t\t$userMeta['userMeta']['state'] = $this->data['userMeta']['state'];\n\t\t\t\t$userMeta['userMeta']['city'] = $this->data['userMeta']['city'];\n\t\t\t\t$userMeta['userMeta']['zip'] = $this->data['userMeta']['zip'];\n\t\t\t\t$userMeta['userMeta']['contact'] = $this->data['userMeta']['contact'];\n\t\t\t\t$userMeta['userMeta']['member_id'] = $lastId;\n\t\t\t\t\n\t\t\t\t$this->userMeta->create();\n\t\t\t\t\n\t\t\t\tif ($this->userMeta->save($userMeta)) {\n\t\t\t\t\t$this->Session->setFlash('User has been added');\n\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller'=>'members',\t\t\t\t \n\t\t\t\t\t\t'action' => 'admin_member_view',\n\t\t\t\t\t));\n\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}", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Error.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Error::error($error);\n return;\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "public function init()\n {\n new Admin(); // Admin class\n }", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.admins.create');\n }", "public function create()\n {\n return view('admin.admins.create');\n }", "public function admin_init() {}", "public function get_admin_add() {\n //Grab the categories\n $categories = array();\n foreach (Category::get() as $category) {\n $categories[$category->id] = $category->title;\n }\n //Create a data array\n $data = array(\n 'section' => 'post',\n 'pageTitle' => 'Add Blog Post',\n 'categories' => $categories,\n );\n\n //Build the view\n return View::make('admin.post.form', $data);\n }", "protected function create(){\n $subadmin = new Admin;\n return view('subadmin.create', compact('subadmin'));\n }", "public function create()\n\t{\n\t\t$data['title'] = \"Level Admin\";\n\t\t// $data['level'] = $this->level->getAll();\n\t\t$data['action'] = \"level/insert\";\n\t\t$this->template->admthemes('level/formCreate',$data);\n\t}", "public function create()\n {\n // Admin only\n }", "public function create()\n {\n // $this->authorize('create');\n // return view('admin.admins.show');\n }", "public function getAdd()\n {\n \treturn view(\"admin.user.add\");\n }", "public function create()\n {\n //加载模板\n return view(\"Admin.Adminuser.add\");\n }", "public function createAdminUser(JacliModelDatabase $db)\n\t{\n\t}", "public function create()\n {\n return view(\"admin.addUser\");\n }", "function addAdmin($username, $raw_password, $email, $phone) {\n // TODO\n }", "public function admin_add_new() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Add New Form', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-new-form.php' );\n?>\n\t</div>\n<?php\n\t}", "public function add_admin() {\n\t\t$current_pages = array();\n\n\t\t$current_pages[ 'vfb-pro' ] = add_menu_page( __( 'Visual Form Builder Pro', 'visual-form-builder-pro' ), __( 'Visual Form Builder Pro', 'visual-form-builder-pro' ), 'vfb_edit_forms', 'visual-form-builder-pro', array( &$this, 'admin' ), plugins_url( 'visual-form-builder-pro/images/vfb_icon.png' ) );\n\n\t\tadd_submenu_page( 'visual-form-builder-pro', __( 'Visual Form Builder Pro', 'visual-form-builder-pro' ), __( 'All Forms', 'visual-form-builder-pro' ), 'vfb_edit_forms', 'visual-form-builder-pro', array( &$this, 'admin' ) );\n\n\t\t$current_pages[ 'vfb-add-new' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Add New Form', 'visual-form-builder-pro' ), __( 'Add New', 'visual-form-builder-pro' ), 'vfb_create_forms', 'vfb-add-new', array( &$this, 'admin_add_new' ) );\n\t\t$current_pages[ 'vfb-entries' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Entries', 'visual-form-builder-pro' ), __( 'Entries', 'visual-form-builder-pro' ), 'vfb_view_entries', 'vfb-entries', array( &$this, 'admin_entries' ) );\n\t\t$current_pages[ 'vfb-email-design' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Email Design', 'visual-form-builder-pro' ), __( 'Email Design', 'visual-form-builder-pro' ), 'vfb_edit_email_design', 'vfb-email-design', array( &$this, 'admin_email_design' ) );\n\t\t$current_pages[ 'vfb-analytics' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Analytics', 'visual-form-builder-pro' ), __( 'Analytics', 'visual-form-builder-pro' ), 'vfb_view_analytics', 'vfb-reports', array( &$this, 'admin_analytics' ) );\n\t\t$current_pages[ 'vfb-import' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Import', 'visual-form-builder-pro' ), __( 'Import', 'visual-form-builder-pro' ), 'vfb_import_forms', 'vfb-import', array( &$this, 'admin_import' ) );\n\t\t$current_pages[ 'vfb-export' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Export', 'visual-form-builder-pro' ), __( 'Export', 'visual-form-builder-pro' ), 'vfb_export_forms', 'vfb-export', array( &$this, 'admin_export' ) );\n\t\t$current_pages[ 'vfb-settings' ] = add_submenu_page( 'visual-form-builder-pro', __( 'Settings', 'visual-form-builder-pro' ), __( 'Settings', 'visual-form-builder-pro' ), 'vfb_edit_settings', 'vfb-settings', array( &$this, 'admin_settings' ) );\n\n\t\t// All plugin page load hooks\n\t\tforeach ( $current_pages as $key => $page ) :\n\t\t\t// Load the jQuery and CSS we need if we're on our plugin page\n\t\t\tadd_action( \"load-$page\", array( &$this, 'admin_scripts' ) );\n\n\t\t\t// Load the Help tab on all pages\n\t\t\tadd_action( \"load-$page\", array( &$this, 'help' ) );\n\t\tendforeach;\n\n\t\t// Save pages array for filter/action use throughout plugin\n\t\t$this->_admin_pages = $current_pages;\n\n\t\t// Adds a Screen Options tab to the Entries screen\n\t\tadd_action( 'load-' . $current_pages['vfb-pro'], array( &$this, 'screen_options' ) );\n\t\tadd_action( 'load-' . $current_pages['vfb-entries'], array( &$this, 'screen_options' ) );\n\n\t\t// Add an Advanced Properties section to the Screen Options tab\n\t\tadd_filter( 'manage_' . $current_pages['vfb-pro'] . '_columns', array( &$this, 'screen_advanced_options' ) );\n\n\t\t// Add meta boxes to the form builder admin page\n\t\tadd_action( 'load-' . $current_pages['vfb-pro'], array( &$this, 'add_meta_boxes' ) );\n\n\t\t// Include Entries and Import files\n\t\tadd_action( 'load-' . $current_pages['vfb-entries'], array( &$this, 'include_entries' ) );\n\t\tadd_action( 'load-' . $current_pages['vfb-import'], array( &$this, 'include_import_export' ) );\n\n\t\tadd_action( 'load-' . $current_pages['vfb-pro'], array( &$this, 'include_forms_list' ) );\n\t}", "public function createAdmin()\n {\n $users = User::all();\n return view('admin.create',['users'=>$users]);\n }", "public function createByAdmin()\n {\n return view('member.create');\n }", "public function add($admin){\r\n\r\n $i=$admin->getPseudo();\r\n $r=$admin->getPass();\r\n $t=$admin->getEmail();\r\n $c=$admin->getJeton();\r\n\r\n $sql=\"INSERT INTO admin(pseudo, pass, email, jeton) VALUES('\".$i.\"', '\".$r.\"', '\".$t.\"', '\".$c.\"')\";\r\n\r\n if ($stmt=mysqli_prepare($this->conn->getLink(), $sql))\r\n\t\t{$stmt->execute();}\r\n\r\n return $stmt;\r\n }", "function Ephemerids_admin_new()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing\n if (!pnSecAuthAction(0, 'Ephemerids::Item', '::', ACCESS_ADD)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Ephemerids');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // Language\n $pnRender->assign('languages', languagelist());\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('ephemerids_admin_new.htm');\n}", "public function create()\n {\n $this->repository->setPageTitle(\"Administrator Roles | Add New\");\n\n $model = new AdminRole();\n $record = $model;\n $model->allowedRoles = [];\n\n $formMode = \"add\";\n $formSubmitUrl = \"/\".request()->path();\n\n $urls = [];\n $urls[\"listUrl\"]=URL::to(\"/admin/admin_role\");\n\n $this->repository->setPageUrls($urls);\n\n $systems = AdminPermissionSystem::query()->where(\"system_status\", \"=\", \"1\")->get();\n\n $systemPermissions = [];\n if(count($systems)>0)\n {\n $adminPermSysRepo = new AdminPermissionSystemRepository();\n foreach ($systems as $key => $system)\n {\n $systemModules = $system->permissionModules()->get()->toArray();\n $systemModules = $adminPermSysRepo->getSystemPermissionModules($systemModules);\n\n $system[\"modules\"] = $systemModules;\n $system[\"curr_permissions\"] = [];\n\n $systems->$key = $system;\n }\n\n $systemPermissions = $systems->toArray();\n }\n\n return view('admin::admin_role.create', compact('formMode', 'formSubmitUrl', 'record', 'systemPermissions'));\n }", "public function getPostCreateUserAdmin()\n {\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"A create user page\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n if ($user->admin != 1) {\n $this->di->get(\"response\")->redirect(\"user\");\n }\n\n $form = new CreateUserAdminForm($this->di);\n\n $form->check();\n\n $data = [\n \"content\" => $form->getHTML(),\n ];\n\n $view->add(\"default2/article\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function initializeAdminPanel() {}", "public function create(AdminRequest $request)\n {\n return view('admin/role')->withCreate('1');\n }", "function addAdminMenu()\n\t{\n\t\tglobal $tpl, $tree, $rbacsystem, $lng;\n\n\t\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\t$objects = $tree->getChilds(SYSTEM_FOLDER_ID);\n\t\tforeach($objects as $object)\n\t\t{\n\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]]\n\t\t\t\t= $object;\n\t\t\t//have to set it manually as translation type of main node cannot be \"sys\" as this type is a orgu itself.\n\t\t\tif($object[\"type\"] == \"orgu\")\n\t\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]][\"title\"] = $lng->txt(\"obj_orgu\");\n\t\t}\n\n\t\t// add entry for switching to repository admin\n\t\t// note: please see showChilds methods which prevents infinite look\n\t\t$new_objects[$lng->txt(\"repository_admin\").\":\".ROOT_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => ROOT_FOLDER_ID,\n\t\t\t\t\"ref_id\" => ROOT_FOLDER_ID,\n\t\t\t\t\"depth\" => 3,\n\t\t\t\t\"type\" => \"root\",\n\t\t\t\t\"title\" => $lng->txt(\"repository_admin\"),\n\t\t\t\t\"description\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t\t\"desc\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t);\n\n//$nd = $tree->getNodeData(SYSTEM_FOLDER_ID);\n//var_dump($nd);\n\t\t$new_objects[$lng->txt(\"general_settings\").\":\".SYSTEM_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"ref_id\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"depth\" => 2,\n\t\t\t\t\"type\" => \"adm\",\n\t\t\t\t\"title\" => $lng->txt(\"general_settings\"),\n\t\t\t);\n\t\tksort($new_objects);\n\n\t\t// determine items to show\n\t\t$items = array();\n\t\tforeach ($new_objects as $c)\n\t\t{\n\t\t\t// check visibility\n\t\t\tif ($tree->getParentId($c[\"ref_id\"]) == ROOT_FOLDER_ID && $c[\"type\"] != \"adm\" &&\n\t\t\t\t$_GET[\"admin_mode\"] != \"repository\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// these objects may exist due to test cases that didnt clear\n\t\t\t// data properly\n\t\t\tif ($c[\"type\"] == \"\" || $c[\"type\"] == \"objf\" ||\n\t\t\t\t$c[\"type\"] == \"xxx\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$accessible = $rbacsystem->checkAccess('visible,read', $c[\"ref_id\"]);\n\t\t\tif (!$accessible)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"ref_id\"] == ROOT_FOLDER_ID &&\n\t\t\t\t!$rbacsystem->checkAccess('write', $c[\"ref_id\"]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"type\"] == \"rolf\" && $c[\"ref_id\"] != ROLE_FOLDER_ID)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$items[] = $c;\n\t\t}\n\n\t\t$titems = array();\n\t\tforeach ($items as $i)\n\t\t{\n\t\t\t$titems[$i[\"type\"]] = $i;\n\t\t}\n\t\t// admin menu layout\n\t\t$layout = array(\n\t\t\t1 => array(\n\t\t\t\t\"adn\" =>\n\t\t\t\t\tarray(\"xaad\", \"xaec\",\"xaed\", \"xaes\", \"xaep\", \"xacp\", \"xata\", \"xamd\", \"xast\"),\n\t\t\t\t\"basic\" =>\n\t\t\t\t\tarray(\"adm\", \"stys\", \"adve\", \"lngf\", \"hlps\", \"accs\", \"cmps\", \"extt\"),\n\t\t\t\t\"user_administration\" =>\n\t\t\t\t\tarray(\"usrf\", 'tos', \"rolf\", \"auth\", \"ps\", \"orgu\"),\n\t\t\t\t\"learning_outcomes\" =>\n\t\t\t\t\tarray(\"skmg\", \"cert\", \"trac\")\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t\"user_services\" =>\n\t\t\t\t\tarray(\"pdts\", \"prfa\", \"nwss\", \"awra\", \"cadm\", \"cals\", \"mail\"),\n\t\t\t\t\"content_services\" =>\n\t\t\t\t\tarray(\"seas\", \"mds\", \"tags\", \"taxs\", 'ecss', \"pays\", \"otpl\"),\n\t\t\t\t\"maintenance\" =>\n\t\t\t\t\tarray('sysc', \"recf\", 'logs', \"root\")\n\t\t\t),\n\t\t\t3 => array(\n\t\t\t\t\"container\" =>\n\t\t\t\t\tarray(\"reps\", \"crss\", \"grps\", \"prgs\"),\n\t\t\t\t\"content_objects\" =>\n\t\t\t\t\tarray(\"bibs\", \"blga\", \"chta\", \"excs\", \"facs\", \"frma\",\n\t\t\t\t\t\t\"lrss\", \"mcts\", \"mobs\", \"svyf\", \"assf\", \"wbrs\", \"wiks\")\n\t\t\t)\n\t\t);\n\n\t\t// now get all items and groups that are accessible\n\t\t$groups = array();\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\t$groups[$i] = array();\n\t\t\tforeach ($layout[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\t$groups[$i][$group] = array();\n\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\tforeach ($entries as $e)\n\t\t\t\t{\n\t\t\t\t\tif ($e == \"---\" || $titems[$e][\"type\"] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\" && $entries_since_last_sep)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($e != \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = true;\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\n\t\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\tif ($i > 1)\n\t\t\t{\n//\t\t\t\t$gl->nextColumn();\n\t\t\t}\n\t\t\tforeach ($groups[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\tif (count($entries) > 0)\n\t\t\t\t{\n\t\t\t\t\t$gl->addGroupHeader($lng->txt(\"adm_\".$group));\n\n\t\t\t\t\tforeach ($entries as $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$gl->addSeparator();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path = ilObject::_getIcon(\"\", \"tiny\", $titems[$e][\"type\"]);\n\t\t\t\t\t\t\t$icon = ($path != \"\")\n\t\t\t\t\t\t\t\t? ilUtil::img($path).\" \"\n\t\t\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\t\t\tif ($_GET[\"admin_mode\"] == \"settings\" && $titems[$e][\"ref_id\"] == ROOT_FOLDER_ID)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;admin_mode=repository\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_rep\",\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_rep\"),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\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$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;cmd=jump\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_\".$titems[$e][\"type\"],\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_\".$titems[$e][\"type\"]),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//$gl->addSeparator();\n\n\t\t$tpl->setLeftNavContent(\"<div id='adn_adm_side_menu'>\".$gl->getHTML().\"</div>\");\n\t}", "function admin_add(){\n\t\t\t$this->set('title_for_layout', __('Add Email Template', true));\t\t\n\t\t\tif(!empty($this->data)) {\n\t\t\t\t// CSRF Protection\n\t\t\t\tif ($this->params['_Token']['key'] != $this->data['EmailTemplate']['token_key']) {\n\t\t\t\t\t$blackHoleCallback = $this->Security->blackHoleCallback;\n\t\t\t\t\t$this->$blackHoleCallback();\n\t\t\t\t}\n\t\t\t\t//validate and save data\t\t\t\n\t\t\t\t$this->EmailTemplate->set($this->data);\n\t\t\t\t$this->EmailTemplate->setValidation('admin');\n\t\t\t\tif ($this->EmailTemplate->validates()) {\t\t\t\t\n\t\t\t\t\tif ($this->EmailTemplate->save($this->data)) {\t\t\t\t \n\t\t\t\t\t\t$this->Session->setFlash('Email template has been saved', 'admin_flash_good');\n\t\t\t\t\t\t$this->redirect(array('controller'=>'email_templates', 'action' => 'index'));\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$this->Session->setFlash('Please correct the errors listed below.', 'admin_flash_bad');\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\t$this->Session->setFlash('Email template could not be saved. Please, try again.', 'admin_flash_bad');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "public function create()\n {\n return view('admin_panel.add');\n }", "function registerAdminPanels() {\n\t\t// You will need to have a file called \"exampleSettings.php\" in the example\n\t\t// folder for this to register\n\t\t$this->addAdminPanel(array( 'do' \t\t\t=> 'example.exampleSettings', \n\t\t\t\t\t\t\t\t\t'priviledge' \t=> 'admin', \n\t\t\t\t\t\t\t\t\t'anchortext' \t=> 'Hello World!',\n\t\t\t\t\t\t\t\t\t'group'\t\t\t=> 'example',\n\t\t\t\t\t\t\t\t\t'order'\t\t\t=> 1));\n\t\t\n\t\t\t\t\t\t\t\t\t\n\t\treturn;\n\t\t\n\t}", "public function create()\n {\n return view('admin.adminusers.add');\n }", "public function create()\n {\n return view('admin.admins.admins.create');\n }", "public function create()\n { //加载表单\n return view('Admin.Adminuser.add');\n }", "public function addAdmin(Request $req)\n {\n $adminID = $req->input('adminID');\n $adminFirstName = $req->input('adminFirstName');\n $adminMiddleName = $req->input('adminMiddleName');\n $adminLastName = $req->input('adminLastName');\n $data = array('admin_id' => $adminID, 'firstname' => $adminFirstName, 'middlename' => $adminMiddleName, 'lastname' => $adminLastName);\n DB::table('administrators')->insert($data);\n return redirect('add/admin');\n }" ]
[ "0.7588465", "0.7485067", "0.73993945", "0.737967", "0.7307019", "0.72973263", "0.71727467", "0.7116338", "0.71161896", "0.70649856", "0.7060363", "0.7058771", "0.70548505", "0.70405006", "0.70352155", "0.7025553", "0.69957113", "0.69382197", "0.69370455", "0.6927635", "0.69202834", "0.6918908", "0.6899577", "0.6896553", "0.6858616", "0.6850255", "0.68066525", "0.6798683", "0.6798672", "0.6795463", "0.6794732", "0.6787436", "0.6783968", "0.67708975", "0.6757592", "0.67315835", "0.672964", "0.6706979", "0.66987556", "0.6696712", "0.66947794", "0.66908556", "0.66767794", "0.6655512", "0.66542727", "0.6643431", "0.6618862", "0.66117483", "0.66106176", "0.66101897", "0.66099197", "0.6609542", "0.6609542", "0.65999174", "0.65791255", "0.6565293", "0.6558546", "0.65583354", "0.655474", "0.65540874", "0.6535298", "0.65297496", "0.65268344", "0.65268344", "0.65260315", "0.6523299", "0.6511348", "0.65096724", "0.65001917", "0.6499344", "0.6499344", "0.64879936", "0.64862514", "0.64803326", "0.64757687", "0.6473341", "0.64642495", "0.6452485", "0.6447786", "0.6445141", "0.6436548", "0.6429393", "0.6406731", "0.6405386", "0.63963467", "0.6393455", "0.6393274", "0.638693", "0.63825953", "0.63814956", "0.6379358", "0.6375999", "0.6373723", "0.63686013", "0.6367026", "0.63629484", "0.6361571", "0.63548017", "0.634713", "0.6341917", "0.6334126" ]
0.0
-1
/ Add new Code
public function add_code($serial_no){ $insert_code = "INSERT INTO confirmation(serial_no,status)VALUES('$serial_no','0')"; $insert_query = $this->conn->query($insert_code); header('Location:confirmation_code.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCode($code)\n {\n if ( !in_array($code, $this->additionalCode) )\n {\n $this->additionalCode[] = $code;\n }\n }", "static function addCode($code) {\n return static::add(new CodeAtom($code));\n }", "function addCode($code) {\n\t\t $this->Stream .= $code.chr(10);\n\t\t}", "public function addCode($code) {\n $this->code[] = $code;\n return $this;\n }", "public function addCustomCodeToHead($code) {\n $this->custom[] = $code;\n }", "function code($custom_code){\n\t\t$this->custom_js[] = $custom_code;\n\t\treturn true;\n\t}", "public function addJavaScriptCode($name = '', $code = '')\n {\n $this->javascriptCodeArray[$name] = $code;\n }", "function addPOSEntry()\n{\n\n}", "public function add($name, \\Closure $code);", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function add() {\n }", "private function addScripts() {\n global $CFG; \n $script = \"<script type=\\\"text/javascript\\\">\n jQuery(document).ready(function() {\n codeActivity.initEdit(); \n codeActivity.ajaxURL = '\" . $CFG->wwwroot . \"/mod/codeactivity/ajax.php';\n codeActivity.lang = {\n empty_name: '\" . addslashes(get_string('js_empty_name', 'codeactivity')) . \"',\n empty_test_code: '\" . addslashes(get_string('js_empty_test_code', 'codeactivity')).\"',\n error_add: '\" . addslashes(get_string('js_error_add', 'codeactivity')).\"',\n error_delete: '\" . addslashes(get_string('js_error_delete', 'codeactivity')).\"',\n error_forbidden: '\" . addslashes(get_string('js_error_forbidden', 'codeactivity')).\"'\n }\n });\n </script>\";\n \n $this->_form->addElement('html', $script);\n }", "public function make($code);", "public function setCode($code);", "public function setCode($code);", "function use_codepress()\n {\n }", "function runkit_method_add($classname, $methodname, $args, $code, $flags = RUNKIT_ACC_PUBLIC)\n{\n}", "public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "public function storeCode() {\n if(!empty($_GET['code'])) {\n $this->code = $_GET['code'];\n update_option(self::CODE_OPTION_NAME, $_GET['code']);\n }\n }", "function insert_code_block( & $params )\n\t{\n\t\t$content = & $params['data'];\n\t\t$item = & $params['Item'];\n\n\t\t//TODO: allow per post-type inclusion\n\n\t\t$title = \"'\" . $item->dget( 'title', 'htmlattr' ) . \"'\";\n\t\t$url = \"'\" . $item->get_permanent_url() . \"'\";\n\n\t\t$content .= \"\\n\".'<div class=\"sharethis\">\n\t\t\t\t\t\t\t<script type=\"text/javascript\" language=\"javascript\">\n\t\t\t\t\t\t\t\tSHARETHIS.addEntry( {\n\t\t\t\t\t\t\t\t\ttitle : '. $title .',\n\t\t\t\t\t\t\t\t\turl : '. $url .'}, \n\t\t\t\t\t\t\t\t\t{ button: true }\n\t\t\t\t\t\t\t\t) ;\n\t\t\t\t\t\t\t</script></div>' . \"\\n\";\n\t\treturn true;\n\t}", "function _addcodecontainer($code, $type, $file=null, $firstline=1) { $file = ($file == NULL) ? \"\":\" von Datei <em>\".$this->_shortwords($file).\"</em>\";\n\n //> Zeilen zählen.\n $linescount = substr_count($code, \"\\n\") + $firstline + 1;\n if ($type == 'Php') {\n $linescount = substr_count($code, \"\\r\") + $firstline + 1;\n }\n $line = '';\n for($no=$firstline;$no < $linescount;$no++) {\n $line .= $no.\":<br />\";\n }\n\n //> Hier könnt ihr den Header und Footer für HTML editieren.\n $breite = trim($this->info['BlockTabelleBreite']);\n $breite = (strpos($breite, '%') !== false) ? '450px' : $breite.'px';\n $header = \"<div style=\\\"overflow: auto; width: {$breite};\\\">\"\n .\"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" style=\\\"BORDER: 1px SOLID \".$this->info['BlockRandFarbe'].\";\\\" width=\\\"100%\\\">\"\n .\"<tr><td colspan=\\\"3\\\" style=\\\"font-family:Arial, Helvetica, sans-serif;font-size:12px; font-weight:bold; color:\".$this->info['BlockSchriftfarbe'].\";background-color:\".$this->info['BlockHintergrundfarbe'].\";\\\">&nbsp;\".$type.$file.\"</td></tr>\"\n .\"<tr bgcolor=\\\"\".$this->info['BlockHintergrundfarbeIT'].\"\\\"><td style=\\\"width:20px; color:\".$this->info['BlockSchriftfarbe'].\";padding-left:2px;padding-right:2px;border-right:1px solid \".$this->info['BlockHintergrundfarbe'].\";font-family:Arial, Helvetica, sans-serif;\\\" align=\\\"right\\\" valign=\\\"top\\\"><code style=\\\"width:20px;\\\">\"\n .$line\n .\"</code></td><td width=\\\"5\\\">&nbsp;</td><td valign=\\\"top\\\" style=\\\"background-color:\".$this->info['BlockHintergrundfarbe'].\"; color:\".$this->info['BlockSchriftfarbe'].\";\\\" nowrap width=\\\"95%\\\"><code>\";\n $footer = \"</code></td></tr></table></div>\";\n\n return $header.$code.$footer;\n }", "final function getCode();", "protected function add() {\n\t}", "private function codeField()\n {\n $mode = false;\n if (isset($this->jsonData['language'])) {\n if ($this->jsonData['language'] == 'json') {\n $mode = 'application/json';\n } else {\n $mode = $this->jsonData['language'];\n }\n }\n\n $newData = [\n 'mode' => $mode,\n 'vue' => $this->getCorrectVueComponent('form-code-field'),\n ];\n\n $this->data = array_merge($this->data, $newData);\n }", "public function addJsCode($jsCode)\n {\n $this->jsCode[] = $jsCode;\n }", "public function addView()\n {\n $translate = $this->getTranslate('CodeAddView');\n $this->setParam('translate', $translate);\n\n $codeModel = new codeModel();\n\n $statusList = $codeModel->getStatusList();\n $this->setParam('statusList', $statusList);\n\n $moldRefSpecs = $codeModel->getRefSpecsPossible('R1');\n $this->setParam('refSpecs', $moldRefSpecs);\n\n // traduction des statuts\n $translateStatusList = $this->getTranslate('Status_List');\n $this->setParam('translateStatusList', $translateStatusList);\n\n\n // Récupération de la liste des données avec leurs descriptions\n $dataModel = new dataModel();\n\n $dataList = $dataModel->getDataList('Code_App');\n $this->setParam('dataList', $dataList);\n\n $dataCategoryList = $dataModel->getDataCategoryListUser('Code_App');\n $this->setParam('dataCategoryList', $dataCategoryList);\n\n // traduction des données et des catégories\n $translateData = $this->getTranslate('Data_List');\n $this->setParam('translateData', $translateData);\n $translateDataCategory = $this->getTranslate('Data_Category_List');\n $this->setParam('translateDataCategory', $translateDataCategory);\n\n\n $this->setParam('titlePage', $this->getVerifyTranslate($translate, 'pageTitle'));\n $this->setView('codeAdd');\n $this->setApp('Code_App');\n\n\n // Vérification des droits utilisateurs\n if (frontController::haveRight('add', 'Code_App'))\n $this->showView();\n else\n header('Location: /code');\n }", "public function actionCreateCode()\n {\n $model = new PromotionCode();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->code = strtoupper($model->code);\n $model->created_at = time();\n $model->save();\n\n if ($model->type === \"Free Product(s)\") {\n $model->refresh();\n return $this->redirect([\"promotions/update-code?id=$model->id\"]);\n }\n\n return $this->redirect(['promotions/codes']);\n } else {\n return $this->render('code/create', [\n 'model' => $model,\n ]);\n }\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function add_short_code($short_code)\n\t{\n\t\tarray_push($this->shortcodes, $short_code);\n\t}", "public function insert_js_code() {\n echo \"\\n<script>\\n\" . $this->getJsCodeToEcho($this->pluginCommon->optGid(), array(\n 'log' => $this->pluginCommon->optUseLogging(),\n 'localserver' => $this->isIgnoredServer(),\n )) . '</script>' . \"\\n\";\n }", "public function addShortcode()\n {\n WPShortcode::addShortCode('acoBolsista', $this->todo->getController('indicacao'), 'acoBolsistaShortcode');\n WPShortcode::addShortCode('acoVoluntario', $this->todo->getController('indicacao'), 'acoVoluntarioShortcode');\n WPShortcode::addShortCode('acoColaborador', $this->todo->getController('indicacao'), 'acoColaboradorShortcode');\n WPShortcode::addShortCode('pibexBolsista', $this->todo->getController('indicacao'), 'pibexBolsistaShortcode');\n WPShortcode::addShortCode('pibexVoluntario', $this->todo->getController('indicacao'), 'pibexVoluntarioShortcode');\n WPShortcode::addShortCode('pibexColaborador', $this->todo->getController('indicacao'), 'pibexColaboradorShortcode');\n }", "public function writeServerCode()\n {\n }", "protected function _getNextCode() {}", "private function _insertJSapicode() {\n\t\t$urlParam = (!empty($this->conf['googleapikey'])) ? $urlParam = '?key='.$this->conf['googleapikey'] : '';\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->extKey.'googleapikey'] = '<script type=\"text/javascript\" src=\"http://www.google.com/jsapi'.$urlParam.'\"></script>';\n\t}", "function addSmilieCode($smilieCode,$smilieImage){\n\t\t\t\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getSmileyConfigFile();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setSmileyFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->addSmileyCode($smilieCode,$smilieImage);\n\t\t\t\n\t\t}", "public function add_instr()\n {\n $this->instructions++; \n }", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Permission Modify\");\t\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\t## for check admin or not\t##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"permission_modify\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"permission_modify_add\", $data, true, \"permission_modify\");\n\t\t$this->template->build_admin_output($data);\n\t}", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Language\");\t\n\t\t$CFG = $this->config->item('language_configure');\n\t\t\n\t\t ## for check admin or not\t ##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"language\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"language_add\", $data, true, \"language\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function code($code)\n {\n $this->code = $code;\n\n return $this;\n }", "public function edit(Code $code)\n {\n //\n }", "function code() {\n\t\t$code_issue_replace = false;\n\t\tif (in_array('replace', $this->args)) {\n\t\t\t$code_issue_replace = true;\n\t\t}\n\t\t$files = $this->files();\n\t\tforeach ( $files as $file ) {\n\t\t\t$code = file_get_contents($file);\n\t\t\t$issues = $this->code_issue_find($code);\n\t\t\tif (!empty($issues)) {\n\t\t\t\tif ($code_issue_replace) {\n\t\t\t\t\t$this->code_issue_replace($file, $code);\n\t\t\t\t} else {\n\t\t\t\t\t$this->out($file);\n\t\t\t\t\tprint_r($issues);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function addScript($new)\n {\n $this->_scripts .= $new;\n }", "private function registerHook($hook, $phpcode) {\r\n $list =& vBulletinHook::init()->pluginlist;\r\n\r\n // Make sure the key exists, even if as an empty string\r\n if (empty($list[$hook])) $list[$hook] = '';\r\n // Append new code\r\n $list[$hook] .= \"\\n{$phpcode}\";\r\n }", "public function getCode()\n {\n }", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "protected function addCustomJS()\n\t{\n\t\t\n\t}", "public function dp_savecode($data)\n {\n return $this->call('dp_savecode', static::prepareParams($data, [\n 'field_name' => ['string', 20], // Enter the name of an existing field type from the DPCODES table\n 'code' => ['string', 30], // Enter the new CODE value\n 'description' => ['string', 100], // Enter the description value that will appear in drop-down selection values\n 'original_code' => ['string', 20], // Enter NULL unless you are updating an existing code. In that case, set this field to the current (before update) value of the CODE\n 'code_date' => ['date'], // Enter NULL\n 'mcat_hi' => ['money'], // Enter NULL\n 'mcat_lo' => ['money'], // Enter NULL\n 'mcat_gl' => ['string', 1], // Enter NULL\n 'acct_num' => ['string', 30], // Enter NULL\n 'campaign' => ['string', 30], // Enter NULL\n 'solicit_code' => ['string', 30], // Enter NULL\n 'overwrite' => null, // If you are creating a new code, set this field to NULL or 'N'. If you are updating an existing code, set this to 'Y'.\n 'inactive' => ['string', 1], // Enter 'N' for an active code or 'Y' for an inactive code. Inactive codes are not offered in the user interface dropdown lists. Set @inactive='N' to indicate that this entry is Active and will appear in the appropriate drop-down field in the user interface.\n 'client_id' => null,\n 'available_for_sol' => null,\n 'user_id' => $this->appName,\n 'cashact' => null,\n 'membership_type' => null,\n 'leeway_days' => null,\n 'comments' => ['string', 2000], // You may enter a comment of up to 2000 characters if you like.\n 'begin_date' => ['date'], // Set as 'MM/DD/YYYY' only. Setting time values is not supported.\n 'end_date' => ['date'], // Set as 'MM/DD/YYYY' only. Setting time values is not supported.\n 'ty_prioritize' => ['string', 1], // Enter NULL\n 'ty_filter_id' => null,\n 'ty_gift_option' => null,\n 'ty_amount_option' => null,\n 'ty_from_amount' => null,\n 'ty_to_amount' => null,\n 'ty_alternate' => null,\n 'ty_priority' => null,\n ]));\n }", "public function setCodeName( $name );", "public function add(){\n $this->edit();\n }", "protected function addOnSubmitJavaScriptCode() {}", "function OnBeforeAdd(){\n }", "public function setCode($value)\n {\n $this->set(self::ENTRY_CODE, (string) $value);\n }", "abstract protected function mapCode( $code );", "public function getCode() {}", "public function __construct($code)\n\t{\n\t\t$this->code = $code;\n\t}", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "function add_comScore(){ ?>\n\n\t<!-- Begin comScore Inline Tag 1.1302.13 -->\n\t<script type=\"text/javascript\" language=\"JavaScript1.3\" src=\"http://b.scorecardresearch.com/c2/9734177/ct.js\"></script>\n\t<!-- End comScore Inline Tag -->\n\n<?php\n}", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function __construct($code)\n {\n $this->code = $code;\n }", "public function __construct($code)\n {\n $this->code = $code;\n }", "function add_myscript(){\n}", "public function setCode(?string $value): void {\n $this->getBackingStore()->set('code', $value);\n }", "public function add_short_code()\n {\n add_shortcode('colorYourLife', array($this, 'generate_short_code_content'));\n }", "public function add(){\n echo \"Add a module !\\n\";\n }", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "function runkit_function_add(string $funcname, string $arglist, string $code, bool $return_by_reference = null, string $doc_comment = null, string $return_type = null, bool $is_strict = null) : bool {\n}", "function setCodeStat($encode){\n\t\t$this->encodestat=$encode;\n\t}", "public function add_information() \r\n {}", "public function add_information() \r\n {}", "public function add()\n\t{\n\t\tPhpfox::getComponent('language.admincp.phrase.add', array('sReturnUrl' => $this->get('return'), 'sVar' => $this->get('phrase'), 'bNoJsValidation' => true), 'controller');\n\t}", "function __construct($code = 0)\r\n {\r\n $this->code = $code;\r\n }", "protected function initJavascriptCode() {}", "public function add();", "public function add();", "function code ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('tcode');\n return $rc->newInstanceArgs ( $arguments );\n}", "public function setCode($code, $message);", "public function test_addBillingCodeTypeTag() {\n\n }", "function phorum_mod_bbcode_google_javascript_register($data)\n{\n $data[] = array(\n \"module\" => \"bbcode_google\",\n \"source\" => \"file(mods/bbcode_google/bbcode_google.js)\"\n );\n return $data;\n}", "public function addCode($filename,$filetype,$content,$filesize,$student_id,$teacher_id){\n\t\t$data = new stdClass(); // initialize data class\n\t\t$data->exerid = null;\n\t\t$data->filename = $filename;\n\t\t$data->filetype = $filetype;\n\t\t$data->file = $content;\n\t\t$data->filesize = $filesize;\n\t\t$data->studentid = $student_id;\n\t\t$data->teacherid = $teacher_id;\n\n\n\t\t$datesent = date(\"Y-m-d H:i:s\"); // get current timestamp\n\t\t$data->datesent = $datesent;\n\n\t\t// insert data to exercode table\n\t\t$this->db->insert('exercode',$data);\n\t}", "public function add($data)\n {\n }", "public function save($name, $code);", "function runkit_method_add(string $classname, string $methodname, string $arglist, string $code, int $flags = RUNKIT_ACC_PUBLIC, string $doc_comment = null, string $return_type = null, bool $is_strict = null) : bool {\n}", "public function code($code)\n {\n return $this->setProperty('code', $code);\n }", "function insert_affiliate_code($code, $article_str)\n{\n\treturn str_replace(\"=CODE=\", \"/r/\".$code, $article_str);\n}", "function withCode($code) {\n $this->code = $code;\n return $this;\n }", "function setAmocrmCode(string $code): void {\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function __construct($code = null);", "public function add_data($data)\n {\n }" ]
[ "0.7447306", "0.6876303", "0.67132777", "0.6546156", "0.64885205", "0.64769685", "0.64739263", "0.63233346", "0.6298387", "0.62668943", "0.62179106", "0.6206993", "0.616448", "0.61639017", "0.61639017", "0.6070694", "0.6050409", "0.6035827", "0.6031033", "0.60269064", "0.6002155", "0.5987782", "0.5971814", "0.59576917", "0.59513307", "0.5942599", "0.5924316", "0.58982015", "0.5887326", "0.5887326", "0.5880837", "0.58618665", "0.5848255", "0.5815432", "0.5815428", "0.5815185", "0.580034", "0.5779208", "0.5775064", "0.5773971", "0.57737774", "0.574825", "0.5742171", "0.57407266", "0.5740024", "0.57376367", "0.57376367", "0.57376367", "0.5726872", "0.57251173", "0.5715814", "0.57032484", "0.57032484", "0.57032484", "0.57032484", "0.57032484", "0.57032484", "0.5700903", "0.5696051", "0.56682926", "0.56509167", "0.56433785", "0.5628115", "0.5627909", "0.5624611", "0.5624597", "0.5624304", "0.56215054", "0.56172645", "0.5610417", "0.5602665", "0.5602665", "0.5601", "0.5578894", "0.55753577", "0.55722994", "0.5564621", "0.5555614", "0.55492836", "0.55341727", "0.55341727", "0.5532778", "0.553185", "0.55225086", "0.5507102", "0.5507102", "0.5505229", "0.55024683", "0.5502196", "0.55016524", "0.5486864", "0.5485271", "0.54847634", "0.5483506", "0.548322", "0.5482315", "0.5479399", "0.5470313", "0.54685885", "0.54549044", "0.54538745" ]
0.0
-1
STUDENT BACKEND / Student login
public function student_login($email,$password){ echo $email; $select_all = "SELECT * FROM student_registration WHERE email = '$email'"; $select_query = $this->conn->query($select_all); $check_user = $select_query->num_rows; if($check_user !=0){ $_SESSION['student_email'] = $email; header('Location:my_profile.php'); }else{ echo "<script> alert('Incorrect username or password'); window.location = 'login.php'; </script>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function login(){\n \n }", "public function login();", "public function login();", "public function stuUserLogin() {\n\t\tif(isset($_POST['txtUName']) && isset($_POST['subDomain'])){\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t if(mysqli_num_rows($schl_query_res)>0){\n\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t$hash_salt_query=\"select u.id,hashed_password,salt,u.email,batch_id,b.course_id,b.start_date,b.end_date,u.username from users u left join students s on s.user_id = u.id left join batches b on b.id = s.batch_id where u.username='\".trim($_POST['txtUName']).\"' and u.school_id='\".$school_data['id'].\"' and u.admin!=1 and u.employee!=1 and u.student!=0\";\n\t\t\t$hash_salt_res = mysqli_query($this->connfed, $hash_salt_query);\n\t\t\tif(mysqli_num_rows($hash_salt_res)>0){\t\n\t\t\t \t$row=mysqli_fetch_assoc($hash_salt_res);\n\t\t\t\t$hash_pwd = $row['hashed_password'];\n\t\t\t\t$salt = $row['salt'];\n\t\t\t\t$pwd=$salt.$_POST['txtPwd'];\n\t\t\t\t$hash_new_pwd=hash('sha1',$pwd);\n\t\t\t\tif ($hash_pwd==$hash_new_pwd) {\n\t\t\t\t\t $_SESSION['std_id']=$row['id'];\n\t\t\t\t\t $_SESSION['username']=$row['username'];\n\t\t\t\t\t $_SESSION['user_email']=$row['email'];\n\t\t\t\t\t $_SESSION['batch_id']=$row['batch_id'];\n\t\t\t\t\t $_SESSION['start_date']= date(\"Y-m-d\",strtotime($row['start_date']));\n\t\t\t\t\t $_SESSION['end_date'] = date(\"Y-m-d\",strtotime($row['end_date']));\n\t\t\t\t\t $_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t $_SESSION['course_id']=$row['course_id'];\n\t\t\t\t\t return 1;\n\t\t\t\t}else{\n\t\t\t\t\t $message=\"Paasword does not matched.\";\n\t\t\t\t\t $_SESSION['error_msg'] = $message;\t\n\t\t\t\t\t return 0;\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t \t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public function login(){\n\n }", "public function login()\n {\n $customerData = Mage::getSingleton('customer/session')->getCustomer();\n $defaultprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('is_default', array('is_default'=>1))->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n $profile_id = $defaultprofile->getData()[0]['profile_id'];\n // $profile_id = 300;\n Mage::getSingleton('customer/session')->setBeautyProfileId($profile_id);\n /*Check if current login customer have default profile or not*/\n $getprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n if(count($getprofile->getData()) == 0)\n {\n Mage::getSingleton('customer/session')->setNoprofile('yes');\n }\n Mage::getSingleton('customer/session')->setIncompleteprofile('yes');\n Mage::getSingleton('customer/session')->setRegisterprofile('yes');\n }", "public function login()\n {\n }", "public function login()\n {\n }", "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}", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "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}", "abstract protected function doLogin();", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function userLogin() {\n\t\tif(isset($_POST['txtUName']))\n\t\t{\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t\tif(mysqli_num_rows($schl_query_res)>0)\n\t\t\t{\n\t\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t\t//check if user account exists\n\t\t\t\t$encPwd = base64_encode($_POST['txtPwd']);\n\t\t\t\t$login_query=\"select * from users where username='\".$_POST['txtUName'].\"' and password='\".$encPwd.\"' and is_active='1'\";\n\t\t\t\t$q_res = mysqli_query($this->connrps, $login_query);\n\t\t\t\tif(mysqli_num_rows($q_res)>0)\n\t\t\t\t{\n\t\t\t\t\twhile($data = mysqli_fetch_assoc($q_res))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_SESSION['admin_id']=$data['id'];\n\t\t\t\t\t\t$_SESSION['username']=$data['username'];\n\t\t\t\t\t\t$_SESSION['user_email']=$data['email'];\n\t\t\t\t\t\t$_SESSION['role']=$data['isAdmin'];\n\t\t\t\t\t\t$_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t}\n\t\t\t\t\treturn 1;\n\t\t\t\t}else{\n\t\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\t$message=\"Incorrect school\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "public function loginTrainer(){\r\n\t\t\t$objDBConn = DBManager::getInstance();\t\r\n\t\t\tif($objDBConn->dbConnect()){\r\n\t\t\t\t$result = mysql_query(\"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"' and password='\".$_REQUEST[\"pass\"].\"'\");\r\n\t\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t\tif($row == false){\r\n\t\t\t\t\t//echo \"No records\";\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$_SESSION['trainer'] = $row;\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//echo 'Something went wrong ! ';\r\n\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function login() {\n\n // Validate user input\n $this->s_email = testInput($this->s_email);\n $this->s_password = testInput($this->s_password);\n\n // Fetch data from db with given email\n $result = $this->conn->query(\"SELECT * FROM $this->tableName WHERE s_email LIKE '$this->s_email'\");\n\n // Check that student exists in database\n if ($result->rowCount() === 1) {\n\n // Fetch user record from result\n $user = $result->fetch();\n\n // Check password match\n if (password_verify($this->s_password, $user[\"s_password\"])) {\n return true;\n }\n // Passwords do not match\n else {\n return false;\n }\n }\n // User with given email not in database\n else {\n return false;\n }\n }", "public function login(){\n\n }", "private function logInSimpleUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(41);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function actionSAMLLogin() {\n\t\tif(isset($_SERVER['HTTP_REFERER'])) {\n\t\t\t$referer = $_SERVER['HTTP_REFERER'];\n\t\t\tif(strpos($referer, 'admin') > 0)\n\t\t\t{\n\t\t\t\tYii::app()->session['loginfrom'] = 'admin';\n\t\t\t}\n\t\t}\n\n\t\t// TODO: TESTING\n\t\t$as = new SimpleSAML_Auth_Simple('default-sp');\n\t\t// TODO: LIVE\n\t\t//$as = new SimpleSAML_Auth_Simple('live-sp');\n\n\t\t$as->requireAuth();\n\t\t$attributes = $as->getAttributes();\n\t\tif(!$attributes) {\n\t\t\treturn $this->responseError(\"login saml failed\");\n\t\t}\n\n\t\t// TODO: TESTING\n\t\t// Create the new user if user doesn't exist in database\n\t\tif( !$user = UserAR::model()->findByAttributes(array('company_email'=>$attributes['eduPersonPrincipalName'][0])) ) {\n\t\t\t$user = UserAR::model()->createSAMLRegisterTest($attributes);\n\t\t}\n\n\t\t// Identity local site user data\n\t\t$userIdentify = new UserIdentity($user->company_email, $attributes['uid'][0]);\n\n\t\t// Save user status in session\n\t\tif (!$userIdentify->authenticate()) {\n\t\t\t$this->responseError(\"login failed.\");\n\t\t}\n\t\telse {\n\t\t\tYii::app()->user->login($userIdentify);\n\t\t\tif(Yii::app()->session['loginfrom'] == 'admin') {\n\t\t\t\t$this->redirect('../admin/index');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->redirect('../../index');\n\t\t\t}\n\t\t}\n\n\n\t\t// TODO: LIVE\n\t\t// Create the new user if user doesn't exist in database\n//\t\tif( !$user = UserAR::model()->findByAttributes(array('company_email'=>$attributes['sggroupid'][0])) ) {\n//\t\t\t$user = UserAR::model()->createSAMLRegister($attributes);\n//\t\t}\n//\n//\t\t// Identity local site user data\n//\t\t$userIdentify = new UserIdentity($user->company_email, $attributes['uid'][0]);\n//\n//\t\t// Save user status in session\n//\t\tif (!$userIdentify->authenticate()) {\n//\t\t\t$this->responseError(\"login failed.\");\n//\t\t}\n//\t\telse {\n//\t\t\tYii::app()->user->login($userIdentify);\n//\t\t\tif(Yii::app()->session['loginfrom'] == 'admin') {\n//\t\t\t\t$this->redirect('../admin/index');\n//\t\t\t}\n//\t\t\telse {\n//\t\t\t\t$this->redirect('../../index');\n//\t\t\t}\n//\t\t}\n\t}", "public function actionLogin() {\n \n }", "function AdminLogin() {\r\n\t\t$this->DB();\r\n\t}", "public function executeLogin()\n {\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "function login() {\n $this->checkAccess('user',true,true);\n\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/login.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "function login() { }", "public function login(){\n\n\t\t$this->Login_model->login();\t\n\n\t\n\n\t}", "public function index()\n {\n if ($this->session->userdata('pre_student_login') != 1)\n redirect(site_url('login'), 'refresh');\n if ($this->session->userdata('pre_student_login') == 1)\n redirect(site_url('pre_student/dashboard'), 'refresh');\n }", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function login()\n\t{\n\t\tif (isLogin()) {\n\t\t\tredirect('/backoffice');\n\t\t} else {\n\t\t\t$this->display(\n\t\t\t\t'backoffice/login.html.twig'\n\t\t\t);\n\t\t}\n\n\t}", "function doLogin() {\n $conn = getDBConnection();\n $FLAG = false;\n\n //sql query\n $sql = \"SELECT * FROM users WHERE username = '\" . $_POST['username'] . \"' AND password = PASSWORD('\" . $_POST['password'] . \"')\";\n\n //echo $sql;\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n // output data of each row\n\n while ($row = mysqli_fetch_assoc($result)) {\n //create assos array and add the result data\n //$userArray = array('fname' => $row['firstname'],'lname'=>$row['lastname']); \n $_SESSION['ssn_user'] = $row;\n\n //if student get student details\n if ($row['role_code'] == 'STUDENT') {\n $sql = \"SELECT * FROM student WHERE username = '\" . $row['username'] . \"'\";\n $result_student = getData($sql);\n while ($row = mysqli_fetch_assoc($result_student)){\n $_SESSION['ssn_student'] = $row;\n }\n }\n //if student get lecturer details\n if ($row['role_code'] == 'LECTURE') {\n $sql = \"SELECT * FROM lecture WHERE username = '\" . $row['username'] . \"'\";\n $result_lecturer = getData($sql);\n while ($row = mysqli_fetch_assoc($result_lecturer)){\n $_SESSION['ssn_lecturer'] = $row;\n }\n }\n }\n\n $FLAG = TRUE;\n } else {\n \n }\n\n\n mysqli_close($conn);\n return $FLAG;\n}", "function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }", "public function checkFirstLogin();", "function login();", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "public function connexionSuperAdminLogin(){\n }", "public function login(){\n //we expect a form of ?controller=login&action=login to show the login page\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n require_once('views/login/login.php');\n } else {\n \n $login= Login::login($_POST['username'], $_POST['password'], $_POST['email']);\n \n if ($login){ \n Login::setSession($login);\n $user = Login::getUser($_POST['username']);\n require_once('views/login/userProfile.php');\n \n}\n }\n}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function index() {\n $this->login();\n }", "public function login(){\r\n if(IS_POST){\r\n //判断用户名,密码是否正确\r\n $managerinfo=D('User')->where(array('username'=>$_POST['username'],'pwd'=>md5($_POST['pwd'])))->find();\r\n if($managerinfo!==null){\r\n //持久化用户信息\r\n session('admin_id',$managerinfo['id']);\r\n session('admin_name', $managerinfo['username']);\r\n $this->getpri($managerinfo['roleid']);\r\n //登录成功页面跳到后台\r\n $this->redirect('Index/index');\r\n }else{\r\n $this->error('用户名或密码错误',U('Login/login'),1);\r\n }\r\n return;\r\n }\r\n $this->display();\r\n }", "public function postLogin()\n {\n if (isset($_POST['inputUser']) && isset($_POST['inputPassword'])) {\n $username = $_POST['inputUser'];\n $password = $_POST['inputPassword'];\n $user = $this->model->checkUser($username);\n if (is_array($user) && count($user) > 0 && password_verify($password, $user['password'])) {\n //session_start();\n $_SESSION['login_ss'] = \"1\";\n if(!isset($_COOKIE['cookie_flag'])){\n setcookie('cookie_flag','1', time() + (86400 * 30), \"/\");\n }\n\n header('location: http://localhost/nhi_mvc/index/students');\n exit();\n } else {\n header('location:loginForm');\n exit();\n }\n }\n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "function index()\n {\t \t\n \t$this->login(); \n }", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }", "public function loginActivities();", "public function login()\n {\n return view('frontend.student.login');\n }", "function login() {\n\t\t$this->getModule('Laravel4')->seeCurrentUrlEquals('/libraries/login');\n\t\t$this->getModule('Laravel4')->fillField('Bibliotek', 'Eksempelbiblioteket');\n\t\t$this->getModule('Laravel4')->fillField('Passord', 'admin');\n\t\t$this->getModule('Laravel4')->click('Logg inn');\n }", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db fpr this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token\n FROM users\n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the db, it means login failed\n if(!$token) {\n\n Router::redirect(\"/users/login/error\");\n \n\n # But if we did, login succeeded!\n } else {\n\n \n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n \n\n # Send them to the main page - or wherevr you want them to go\n Router::redirect(\"/\");\n # Send them back to the login page\n }\n }", "public function login()\n {\n $this->vista->index();\n }", "public function index()\n\t{\n\t\t$this->login();\n }", "function login(){\n\t\tif(isset($_POST['login'])){//if login button pressed\n\t\t\t$userTable= new Table('users');//new table created\n\t\t\t$user= $userTable->findInDatabase('user_username', $_POST['username']);//querying users table\n\t\t\tif($user->rowCount()>0){//if data available\n\t\t\t\t$data=$user->fetch();//fetch data\n\t\t\t\tif (password_verify($_POST['password'], $data['user_password'])){//if password matches\n\t\t\t\t\t$_SESSION['session_id']=$data['user_id'];//session variable is set\n\t\t\t\t\t$_SESSION['type']=$data['user_type'];//session variable is set\n\t\t\t\t\t$_SESSION['fullname']=$data['user_firstname'].\" \".$data['user_lastname'];//session variable is set\n\t\t\t\t\theader(\"Location:index.php\");//redirect to another page\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<script> alert(\"Password is incorrect\"); </script>';//js alert is shown\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo '<script> alert(\"Username is incorrect\"); </script>';//js alert for username incorrect\n\t\t\t}\n\t\t}\n\t}", "private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }", "function auth($login, $passwd)\n\t{\n\t\t// {\n\t\t// \theader(\"Location: index.php?page=signing_entry\");\n\t\t// \texit(\"ERROR\\n\");\n\t\t// }\n\t\tinclude (\"modif.php\");\n\t\t$request = \"select id_student, mail_student, password_student from student where mail_student = \\\"$login\\\"\";\n\t\t$res = mysqli_query($con,$request);\n\t\t$row = mysqli_fetch_array($res);\n\t\t$ret = 1;\n\t\tif ($row['mail_student'] !== $login)\n\t\t\treturn (exit_ret($con, -1));\n\t\t$passwd = hash(\"whirlpool\", $passwd);\n\t\tif ($row['password_student'] !== $passwd)\n\t\t\t$ret = -1;\n\t\t$_SESSION['backupid']=$row['id_student'];\n\t\treturn ($ret);\n\t}", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "public function api_entry_signin() {\n //parent::returnWithErr(\"Opps. ipray service is expired... sorry.\");\n parent::validateParams(array('email', 'password'));\n\n $users = $this->Mdl_Users->getAll(\"email\", $_POST[\"email\"]);\n\n if (count($users) == 0) parent::returnWithErr(\"User not found.\");\n\n $user = $users[0];\n\n if (!$user->verified) parent::returnWithErr(\"This account is not verified yet.\");\n if ($user->suspended) parent::returnWithErr(\"This account is under suspension.\");\n if ($user->password != md5($_POST[\"password\"])) parent::returnWithErr(\"Invalid password.\");\n\n parent::returnWithoutErr(\"Signin succeed.\", $user);\n }", "public function login(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Login\";\n \n $this->view(\"accounts/login\",$this->data);\n }", "public function login(){\n\t\t\t$this->modelLogin();\n\t\t}", "public function login()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $email = SCMUtility::stripTags( (isset($_POST['email'])) ? $_POST['email'] : '' );\n $password = SCMUtility::stripTags( (isset($_POST['password'])) ? $_POST['password'] : '' );\n\n if( ! Session::Auth($email,$password) )\n {\n SCMUtility::setFlashMessage('Invalid email/password.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function _check_login()\n {\n\n }", "public function access() {\n \tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n \t\t$user = Auth::login($_POST['email'], $_POST['pw']);\n \t\tif($user) {\n \t\t\tApp::redirect('dashboard');\n \t\t}\n\t\t\tSession::set('_old_input', $_POST);\n\t\t\tSession::set('_errors', ['login' => \"Email y/o password incorrectos.\"]);\n\t\t\tApp::redirect('login');\n\n \t}\n\n }", "protected function loginIfRequested() {}", "public function login()\n {\n\t\t\n $data[\"base_dir\"]=__DIR__;\n $data[\"loc\"]=\"Login\";\n\t\t\n return $this->twig->render(\"pages/login.html\", $data);\n }", "public function login()\n\t{\n\t\t$account = $_POST['account'];\n\t\t$password = $_POST['password'];\n\t\t$staff = D('Staff');\n\t\t$sql = \"select * from lib_staff where staff_id = '{$account}' and password='{$password}'\";\n\t\t$return = $staff->query($sql);\n\t\tif ($return) {\n\n\t\t\tcookie('staffAccount', $account, 3600 * 24);\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'success',\n\t\t\t\t'msg' => 'Welcome!'\n\t\t\t));\n\t\t\techo $json;\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function authentification(){\n $mail = $_POST['email'];\n $password = $_POST['password'];\n\n $checkPass = $this->checkPassword($mail, $password);\n\n //check if email and password are corrects\n if ($checkPass){\n require_once 'ressources/modele/ModelLogin.php';\n $modelLogin = new ModelLogin();\n $user_check = $modelLogin->getUserByEmail($mail);\n\n\n while($row = $user_check->fetch()) {\n // redirect to layout with her Identifiant and Level and check if an user's birthday\n //Create SESSION\n\n $_SESSION['User_ID'] = $row['Id'];\n\n $_SESSION['Level'] = $row['Level'];\n\n $_SESSION['Last_name'] = $row['Last_name'];\n\n $_SESSION['First_name'] = $row['First_name'];\n\n }\n\n header('Location: /');\n exit();\n\n } else {\n header('Location: /login');\n exit();\n }\n }", "public function index()\n\t{\n\t\t$this->login();\n\t}", "public function login(){\n echo $this->name . ' logged in';\n }", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function loginForm()\n {\n\n if (isset($_SESSION['login_ss'])) {\n header('location: http://localhost/nhi_mvc/index/students');\n exit();\n }\n $this->view->render(\"login/login\");\n }", "public function login() {\n\t\t$this -> load -> model('models_events254/m_clients');\n\t\t$this -> m_clients -> getUser();\n\t\tif ($this -> m_clients -> isUser == 'true') {\n\n\t\t\n\t\t\t/*create session data*/\n\t\t\t$newdata = array('email' => $this -> m_clients -> email, 'logged_in' => TRUE,'id' => $this ->m_clients->id);\n\t\t\t$this -> session -> set_userdata($newdata);\n\n\t\t\tredirect(base_url() . 'C_front/index', 'refresh');\n\t\n\n\t\t} else {\n\t\t\t#use an ajax request and not a whole refresh\n\t\t\t\n\t\t\t$data['message']=\"User Not Found\";\n\t\t\t$data['messageType']=\"error\";\n\t\t\t\n\t\t\t$this->load->view('login',$data);\n\t\t}\n\t}", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function login()\n {\n //login in your member using the logic in the perent class.\n $message = parent::login();\n\n //add some administrator-spcific logic\n return $message . ' ... log this action in an administrator\\'s table';\n\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "public static function login()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n\n\n $admin = $cont->prepare(\"SELECT `role` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\");\n $admin->execute([$email , $password]);\n $adminData = $admin->fetchObject();\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../admin/login.php\");\n }\n else\n {\n $_SESSION['role'] = $adminData->role; \n \n header(\"location:../admin/index.php\");\n }\n \n }", "public function actionLogin() {\n $sample_code = Yii::$app->request->post('sample_code');\n $collector_code = Yii::$app->request->post('collector_code');\n $full_name = Yii::$app->request->post('full_name');\n $password = Yii::$app->request->post('password');\n $user = new User();\n\n if(is_null($password)) {\n $user->scenario = User::SCENARIO_USER;\n $result = $user->loginOrCreate($sample_code,$collector_code,$full_name);\n } else {\n $user->scenario = User::SCENARIO_OPERATOR;\n $result = $user->loginOrCreate($sample_code,$collector_code,$password);\n }\n if(array_key_exists('error',$result))\n throw new \\yii\\web\\HttpException(400, 'An error occurred:'. json_encode($result['error']));\n return $result;\n }", "function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}", "public function startAction()\n {\n if ($this->request->isPost()) {\n $email = $this->request->getPost('email');\n $password = $this->request->getPost('password');\n/**\n * Include password settings\n * \n * \n */ \n require \"../app/library/Generator.php\";\n \n/**\n * Password salt and hash with 2 methods\n * \n * \n */ \n $secret = $option[\"secret\"];\n $password = hashIt($password, $secret);\n\n/**\n * Compare post data to database\n * \n * \n */ \n $user = Users::findFirst(array(\n \"email_usr = :email: OR username_usr = :email:\",\n 'bind' => array('email' => $email) \n ));\n\t\t\t\n/**\n * If user is found, welcome\n * \n * \n */ \n if ( $user ) {\n\t\t\t\tif ( $this->security->checkhash($password . $secret, $user->pw_usr)) {\n\n\t\t\t\t\t$this->_registerSession($user);\n\t\t\t\t\t$this->flash->success('Welcome ' . ucfirst($user->first_usr));\n\t\t\t\t\t\n\t\t\t\t\tif ( '10' == $user->level_usr_lvl ) {\n\t\t\t\t\t\treturn $this->forward('admin/index');\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn $this->forward('member/index');\n\t\t\t\t\t}\n\t\t\t\t}\n }\n $this->flash->error('Wrong email/password. ');\n\t\t\t\n }\n return $this->forward('login/index');\n }", "public function connexionAdminStructureLogin(){\n }", "function loginUser() {\n\tsession_start();\n\trequire_once(\"sql/dbQueries.php\");\n\n\t// Fetching user data from login data\n\t$userData = getUserFromLogin($_POST['vms_email'], $_POST['userPassword']);\n\n\tif($userData == False) {\n\t\tprintLoginPage(\"The login information supplied is not valid.\");\n\t\treturn;\n\t} else {\n\t\t// Saving the user's info in a session variable\n\t\t$_SESSION['auth'] = TRUE;\n\t\t$_SESSION['auth_info'] = $userData[0];\n\n\t\t// Fetching the DID for the user's default DID.\n\t\t$activeDID = getDIDFromID($userData[0]['didID_default']);\n\t\tif($activeDID != false) {\n\t\t\t$_SESSION['auth_info']['activeDID'] = $activeDID['did'];\n\t\t} else {\n\t\t\t$_SESSION['auth_info']['activeDID'] = null;\n\t\t}\n\t\t//print_r($_SESSION);\n\n\t\t// Head back home\n\t\theader(\"Location: index.php\");\n\t\treturn;\n\t}\n}", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function auth()\n {\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n \n $info = $this->userDetail->getDetail($email, $password);\n if (count($info) == 1) \n {\n $this->commonFunction->setSession($info->id, $info->user_name);\n return redirect('/dashboard'); \n } \n echo '<script language=\"javascript\">';\n echo 'alert(\"Username/Password does not match.\")';\n echo '</script>';\n return redirect('/login');\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}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t# Prevent SQL injection attacks by sanitizing user entered data\n\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t$q = \"SELECT token\n\tFROM users\n\tWHERE email = '\".$_POST['email'].\"'\n\tAND password = '\".$_POST['password'].\"'\n\t\";\n\n\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t#login failed\n\tif($token == \"\" || $_POST['email'] == \"\" || $_POST['password'] == \"\"){\n\n\n\n\tRouter::redirect(\"/users/login/error\");\n\t# send back to login page - should add indication what went wrong\n\t}\n\t#login successful\n\telse{\t\n\n\t\techo \"if we find a token, the user is logged in. Token:\".$token;\n\n\t\t#store token in a cookie\n\t\tsetcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\n\t\t#send them to the main page\n\t\tRouter::redirect(\"/issues\");\n\n\t\t#token name value and how long should last\n\t\t#send back to index page\n\t\t#authenticate baked into base controller\n\t\t#gets users credentials this->user->firstname\n\t}\n}", "public function loginCheck()\n\t{\n\t}", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "function superRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `supper_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='super-recruiter?srid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "public function processLogin(): void;", "public function AdminLogin(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $username = $_POST['email'];\n $password = $_POST['password'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($username) && !empty($password)){\n $res->admin_login($username, $password, $conn);\n $this->dbClose();\n }\n else{\t\n $this->dbClose();\n $error = array('status' => \"0\", \"msg\" => \"Fill Both Fields !!\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function check_login(){\n\t\tsession_start();\n\t\t$user = new InterfacePersonRepo;\n\t\t$tmp = $user->getRepository(Input::get('txtUsername'));\n\t\tif($tmp==NULL){\n\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t}else{\n\t\t\tif (Hash::check(Input::get('txtPassword'), $tmp->getPassword())){\n\t\t\t\t$_SESSION[\"id\"] = $tmp->getUserID();\n\t\t\t\t$_SESSION[\"Username\"] = $tmp->getUsername();\n\t\t\t\t$_SESSION[\"Name\"] = $tmp->getName();\n\t\t\t\t$_SESSION[\"Surname\"] = $tmp->getSurname();\n\t\t\t\t$_SESSION[\"Address\"] = $tmp->getAddress();\n\t\t\t\t$_SESSION[\"Email\"] = $tmp->getEmail();\n\t\t\t\t$_SESSION[\"Phone\"] = $tmp->getPhone();\n\t\t\t\t$_SESSION[\"Status\"] = $tmp->getStatus();\n\t\t\t\t$_SESSION[\"Filename\"] = $tmp->getPath_file();\n\t\t\t\t$_SESSION[\"Fine\"] = $tmp->getFine();\n\n\t\t\t\tsession_write_close();\n\t\t\t\treturn Redirect::to(\"/main\");\n\t\t\t}else{\n\t\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7320988", "0.71818346", "0.71818346", "0.69202334", "0.6886942", "0.6816461", "0.6795285", "0.6795285", "0.6763593", "0.6659075", "0.66584927", "0.66229063", "0.66090345", "0.6607425", "0.66039956", "0.6596733", "0.65841925", "0.6583683", "0.657597", "0.65659684", "0.65059876", "0.6503091", "0.64952654", "0.6485957", "0.6473444", "0.64681387", "0.6464904", "0.6452122", "0.6434412", "0.6400277", "0.6396544", "0.6396466", "0.6391144", "0.6374498", "0.6370807", "0.63696027", "0.6364156", "0.6362576", "0.63564193", "0.63554764", "0.6341321", "0.6341289", "0.6339865", "0.6330989", "0.6329479", "0.6326381", "0.63181406", "0.63165486", "0.6315027", "0.63124573", "0.63073194", "0.6306146", "0.63058347", "0.6296972", "0.6296972", "0.6296972", "0.62876993", "0.62863094", "0.6278017", "0.6264849", "0.6258273", "0.6252075", "0.62515783", "0.6248402", "0.6246103", "0.6238458", "0.62314856", "0.62314403", "0.62301344", "0.62202114", "0.6220058", "0.62185514", "0.6214306", "0.6213918", "0.6200764", "0.6199571", "0.6195544", "0.61920726", "0.6187854", "0.61831325", "0.61829597", "0.617677", "0.6173453", "0.6166677", "0.61665076", "0.6166444", "0.61631036", "0.6162065", "0.61561316", "0.61554307", "0.6154001", "0.615217", "0.61485434", "0.61468697", "0.61467", "0.6145219", "0.61403924", "0.6134727", "0.6127233", "0.6113318", "0.61131793" ]
0.0
-1
/ Student registration portal
public function students_registration($surname,$firstname,$dob,$address,$state,$nationality,$sex,$status,$fname,$occupation,$faddress,$fone,$mname,$moccupation,$mfone,$sponsor,$passport,$signature,$department,$room,$kin_name,$kin_address,$kin_phone,$relationship,$question1,$answer1,$question2,$answer2,$question3,$answer3,$username,$email,$password,$cpassword){ //check if email exist $select_all = "SELECT * FROM student_registration WHERE email = '$email'"; $select_query = $this->conn->query($select_all); $check_user = $select_query->num_rows; if($check_user !=0){ echo "<script> alert('The Email Address has been used'); window.location = 'registration.php'; </script>"; }elseif($password != $cpassword){ echo "<script> alert('Your password is not the same with the confirmed password'); window.location = 'registration.php'; </script>"; }else{ //the path to store the uploaded image $target = "assets/images/".basename($_FILES['passport']['name']); //get all the submitted data from the form $passport = $_FILES['passport']['name']; //move the uploaded image into the folder images if(move_uploaded_file($_FILES['passport']['tmp_name'],$target)){ //the path to store the uploaded signature $target = "assets/images/".basename($_FILES['signature']['name']); //get all the submitted data from the form $signature = $_FILES['signature']['name']; //move the uploaded image into the folder images if(move_uploaded_file($_FILES['signature']['tmp_name'],$target)){ //insert into the database $insert_all = "INSERT INTO student_registration(surname,firstname,dob,address,state,nationality,sex,status,fname,occupation,faddress,fone,mname,moccupation,mfone,sponsor,passport,signature,department,room,kin_name,kin_address,kin_phone,relationship,question1,answer1,question2,answer2,question3,answer3,username,email,password)VALUES('$surname','$firstname','$dob','$address','$state','$nationality','$sex','$status','$fname','$occupation','$faddress','$fone','$mname','$moccupation','$mfone','$sponsor','$passport','$signature','$department','$room','$kin_name','$kin_address','$kin_phone','$relationship','$question1','$answer1','$question2','$answer2','$question3','$answer3','$username','$email','$password')"; $insert_query = $this->conn->query($insert_all); if($insert_query){ echo "<script> alert('Registration has been completed'); window.location = 'my_profile.php'; </script>"; } //it didn't insert into database...check all the variable and database variable very well } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public function londontec_students(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_students';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Students',\n\t\t\t'courselist'=> $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}", "public function student_register(){\n\t\n\t$this->load->view('intern/student_registeration');\n\t\n}", "public function students(){\n\t\t$this->verify();\n\t\t$data['title']=\"Students\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('students/students', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function testRegisterStudent()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/register')\n ->click('.slider__container')\n ->type('firstname', env('DUSK_NEW_FIRSTNAME'))\n ->type('lastname', env('DUSK_NEW_LASTNAME'))\n ->type('email', env('DUSK_NEW_USER_STUDENT'))\n ->type('verificateEmail', env('DUSK_NEW_USER_STUDENT'))\n ->type('password', env('DUSK_NEW_PASSWORD'))\n ->press('.button')\n ->assertPathIs('/');\n });\n }", "public function register()\n {\n $classRooms = ClassRoom::where('status', 1)->with(['standard', 'division'])->get();\n return view('student.register',[\n 'classRooms' => $classRooms,\n ]);\n }", "function student_add()\n\t{\n\t\tif ($this->session->userdata('teacher_login') != 1)\n redirect(base_url(), 'refresh');\n\t\t\t\n\t\t$page_data['page_name'] = 'student_add';\n\t\t$page_data['page_title'] = get_phrase('add_student');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "public function create()\n {\n abort_if(Gate::denies('admin_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n return view('admin.pages.student.create');\n }", "public function post_student() {\n $params = array(\n 'ruid' => Input::get('ruid'), \n 'net_id'=> Input::get('net_id'),\n 'passwd'=> Hash::make(Input::get('passwd')), \n 'email_addr' => Input::get('email_addr'), \n 'grad_year' => Input::get('grad_year'), \n 'major' => Input::get('major'), \n 'credits' => Input::get('credits'), \n 'gpa' => Input::get('gpa')\n );\n \n $user = User::create(array('net_id' => $params['net_id'], 'passwd' => $params['passwd']));\n $user->save();\n\n $student = new Student;\n $student->fill($params);\n $student->save();\n\n Auth::login($user);\n\n return Redirect::to('account/studentedit');\n }", "public function create()\n {\n return view('admin.student.register');\n }", "function add_student(){\n\t\t\t\n\t\t\t$st_id = self::$db->quote($_POST['id']);\n\t\t\t$fname = self::$db->quote($_POST['firstname']);\n\t\t\t$lname = self::$db->quote($_POST['lastname']);\n\t\t\t$area = self::$db->quote($_POST['area']);\n\t\t\t$result = self::$admin->addStudent($st_id,$fname,$lname,$area);\n\n\t\t\tif($result == 1){\n\t\t\t\techo \"User Added Successfully....\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"something wrong\";\n\t\t\t}\n\t\t}", "public function createStudent($firstName, $lastName, $userName, $password, $emailAddress, $studentId, $major, $address);", "function add_student_page(){\n\t\t\theader(\"Location:../view/add_student_details.php\");\n\t\t}", "public function index()\n {\n return view('admin.pages.add_student');\n }", "public function createStudents()\n {\n $authUser = Auth::user();\n $objSchool = new School();\n $schoolsList = $objSchool->getList();\n $objTeachers = new Teachers();\n $schoolinfo = $objTeachers->getTeacherSchools();\n return view(\"teacher.add-student\", compact('authUser', 'schoolsList', 'schoolinfo'));\n }", "public function regNewCommercialUser()\n {\n $this->view('Registration/commercial_user_registration');\n }", "public function createstudent()\n {\n return View::make('createstudent');\n }", "public function actionStudents()\n\t{\n\t\t//$this->model = User::loadModel();\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '//drcUser/_list',\n\t\t\t'dataProvider' => $this->model->students(),\n\t\t\t'contentTitle' => 'DRC Students',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t));\n\t}", "public function register() \n\t{\n $referer = isset($_GET['referer']) ? htmlentities($_GET['referer'], ENT_QUOTES) : '';\n\t\t\n\t\t$this->View->RenderMulti(['_templates/header','user/register']);\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function register(){\n $record_nums = Record_num::all();\n $training_programs = Training_program::all();\n $training_centers = Training_center::all();\n\n return view('auth.register', compact('record_nums','training_centers','training_programs'));\n }", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "public function Register()\n\t{\n $this->redirectUserLoggedIn();\n\t\t$locations=$this->fetch->getInfo('locations');\n\t\t$services_nav=$this->fetch->getInfo('services',5);\n\t\t$web=$this->fetch->getWebProfile('webprofile');\n\t\t$this->load->view('header',['title'=>'Register',\n 'locations'=>$locations,\n 'services_nav'=>$services_nav,\n\t\t\t\t\t\t\t\t'web'=>$web\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t$this->load->view('register');\n\t\t$this->load->view('footer');\n\t\t$this->load->view('custom_scripts');\n }", "public function create()\n {\n return view('student.register');\n }", "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 }", "function index(){\n\n global $wear;\n do_login();\n admin_levels(\"Editor\");\n $template = $this->loadView($wear->front . \"/members/students\");\n $login = $this->loadModel($this->gear, \"sun_student_model\");\n $students = $login->get_students();\n $template->set(\"students\" , $students);\n $template->set(\"page\" , SITE_NAME . \" | Students\");\n $template->render(); \n \n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function student()\n {\n if (session()->get('role')[0] != 'Student') {\n return redirect('/');\n }\n\n return view('home.student');\n }", "public function create()\n {\n return view('frontend.pages.student.create');\n }", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n\n UserModel::register();\n }", "public function logInRegisterPage();", "function register_action()\n {\n $login_model = $this->loadModel('Login');\n $registration_successful = $login_model->registerNewUser();\n\n if ($registration_successful == true) {\n $this->view->render('login/index');\n } else {\n $this->view->render('login/register');\n }\n }", "public function addStudent(){\n\t\t\n\t\t$this->load->view('add_student');\n\t}", "public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}", "public function registerAction(StudentRegistrationRequest $request)\n {\n \\DB::beginTransaction();\n\n $name = $request->get('student_name');\n $class_room_id = $request->get('class_room_id');\n \n $userName = $request->get('user_name');\n $password = $request->get('password');\n $email = $request->get('email');\n\n $student = new Student;\n $student->student_name = $name;\n $student->class_room_id = $class_room_id;\n $student->status = 1;\n if($student->save()) {\n\n //create user for teacher\n $user = new User;\n $user->name = $name;\n $user->user_name = $userName;\n $user->email = $email;\n /*$user->phone = $phone;*/\n $user->password = Hash::make($password);\n $user->role = 4;\n $user->status = 1;\n if($user->save()){\n $student->update(['user_id' => $user->id]);\n }\n\n \\DB::commit();\n return redirect()->back()->with(\"message\",\"Saved successfully\")->with(\"alert-class\",\"alert-success\");\n } else {\n \\DB::rollBack();\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the student details. Try again after reloading the page!\")->with(\"alert-class\",\"alert-danger\");\n }\n }", "public function create()\n {\n // Check if the user has an active scholarship\n $hasActiveScholarship = $this->user->scholarship != null;\n // Navigate to another page if false\n if (!$hasActiveScholarship) return inertia('ScholarshipClosed');\n // Navigate to Application page\n return inertia(\"Student/CreatePage\");\n }", "public function register() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->register();\n }\n }", "public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }", "function registrationPage() {\n\t\t $display = &new jzDisplay();\n\t\t $be = new jzBackend();\n\t\t $display->preHeader('Register',$this->width,$this->align);\n\t\t $urla = array();\n\n\t\t if (isset($_POST['field5'])) {\n\t\t $user = new jzUser(false);\n\t\t if (strlen($_POST['field1']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field2']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field3']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field4']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field5']) == 0) {\n\t\t echo \"All fields are required.<br>\";\n\t\t }\n\t\t else if ($_POST['field2'] != $_POST['field3']) {\n\t\t echo \"The passwords do not match.<br>\";\n\t\t }\n\t\t else if (($id = $user->addUser($_POST['field1'],$_POST['field2'])) === false) {\n\t\t echo \"Sorry, this username already exists.<br>\";\n\t\t } else {\n\t\t // success!\n\t\t $stuff = $be->loadData('registration');\n\t\t $classes = $be->loadData('userclasses');\n\t\t $settings = $classes[$stuff['classname']];\n\n\t\t $settings['fullname'] = $_POST['field4'];\n\t\t $settings['email'] = $_POST['field5'];\n\t\t $un = $_POST['field1'];\n\t\t $settings['home_dir'] = str_replace('USERNAME',$un,$settings['home_dir']);\n\t\t $user->setSettings($settings,$id);\n\n\t\t echo \"Your account has been created. Click <a href=\\\"\" . urlize($urla);\n\t\t echo \"\\\">here</a> to login.\";\n\t\t $this->footer();\n\t\t return;\n\t\t }\n\t\t }\n\n\t\t ?>\n\t\t\t<form method=\"POST\" action=\"<?php echo urlize($urla); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('action'); ?>\" value=\"<?php echo jz_encode('login'); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('self_register'); ?>\" value=\"<?php echo jz_encode('true'); ?>\">\n\t\t\t<table width=\"100%\" cellpadding=\"5\" style=\"padding:5px;\" cellspacing=\"0\" border=\"0\">\n\t\t\t<tr>\n\t\t\t<td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Username\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field1\" value=\"<?php echo $_POST['field1']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Password\"); ?>\n\t\t\t</font></td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field2\" value=\"<?php echo $_POST['field2']; ?>\"></td></tr>\n\t\t\t <tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t &nbsp;\n\t\t\t</td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field3\" value=\"<?php echo $_POST['field3']; ?>\"></td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Full name\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field4\" value=\"<?php echo $_POST['field4']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Email\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field5\" value=\"<?php echo $_POST['field5']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"100%\" colspan=\"2\" align=\"center\">\n\t\t\t<input class=\"jz_submit\" type=\"submit\" name=\"<?php echo jz_encode('submit_login'); ?>\" value=\"<?php echo word(\"Register\"); ?>\">\n\t\t\t</td></tr></table><br>\n\t\t\t</form>\n\t\t\t<?php\n\t\t $this->footer();\n\t }", "public function add() {\n\n\t\tif ( POST ) {\n\n\t\t\t/*-------------------------Generating Student Registration No-------------------------*/\n\t\t\t$max_count_from_db = Student::GetInstance()->getMaxCount();\n\t\t\t$student_serial = sprintf( \"%06s\", $max_count_from_db->max_count + 1 );\n\t\t\t$registration_no = 'S' . $student_serial;\n\t\t\t/*-------------------------Generating registration No code ends here---------------------------------*/\n\n\n\t\t\t/*-------------------------Backend validation Starts-----------------------------------*/\n\t\t\t$validation = new Validation();\n\t\t\t$validation->name( 'name' )->value( $_POST['name'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'guardian_id' )->value( $_POST['guardian_id'] )->pattern( 'int' )->required();\n\t\t\t$validation->name( 'date_of_birth' )->value( $_POST['date_of_birth'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'gender' )->value( $_POST['gender'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'blood_group' )->value( $_POST['blood_group'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'religion' )->value( $_POST['religion'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'current_address' )->value( $_POST['current_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'permanent_address' )->value( $_POST['permanent_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'extra_curricular_activities' )->value( $_POST['extra_curricular_activities'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'remarks' )->value( $_POST['remarks'] )->pattern( 'text' )->required();\n\n\t\t\t/*-------------------------------Validation Ends Here--------------------------*/\n\n\t\t\tif ( $validation->isSuccess() ) {\n\t\t\t\t$student = new Student();\n\t\t\t\t$student->name = trim( $_POST['name'] );\n\t\t\t\t$student->guardian_id = trim( $_POST['guardian_id'] );\n\t\t\t\t$student->date_of_birth = trim( $_POST['date_of_birth'] );\n\t\t\t\t$student->gender = trim( $_POST['gender'] );\n\t\t\t\t$student->blood_group = trim( $_POST['blood_group'] );\n\t\t\t\t$student->religion = trim( $_POST['religion'] );\n\t\t\t\t$student->current_address = trim( $_POST['current_address'] );\n\t\t\t\t$student->permanent_address = trim( $_POST['permanent_address'] );\n\t\t\t\t$student->registration_no = $registration_no;\n\t\t\t\t$student->extra_curricular_activities = trim( $_POST['extra_curricular_activities'] );\n\t\t\t\t$student->remarks = trim( $_POST['remarks'] );\n\t\t\t\t$student->status = 1;\n\t\t\t\t$student->assignment = 0;\n\t\t\t\tif ( $this->file->attach_file( $_FILES['photo'] ) ) {\n\t\t\t\t\t$this->file->upload_dir = 'images/students';\n\t\t\t\t\t//First save the file in directory\n\t\t\t\t\tif ( $this->file->save() ) {\n\t\t\t\t\t\t$student->photo = $this->file->file_name;\n\t\t\t\t\t\t/*------------------------Save the Student-------------------------*/\n\t\t\t\t\t\tif ( $student->create() ) {\n\t\t\t\t\t\t\tredirect( 'Students/index' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdie( 'Something went Wrong' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->file->destroy();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdie( 'Something went wrong' );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t//Show validation Errors\n\t\t\t\techo $validation->displayErrors();\n\n\t\t\t}\n\t\t} else {\n\t\t\t/*--------------Show the empty form before posting a Student-------------*/\n\t\t\t$guardians=Guardian::GetInstance()->getAll();\n\n\t\t\t$data = [\n\t\t\t\t'name' => '',\n\t\t\t\t'guardian_id' => '',\n\t\t\t\t'date_of_birth' => '',\n\t\t\t\t'gender' => '',\n\t\t\t\t'blood_group' => '',\n\t\t\t\t'religion' => '',\n\t\t\t\t'current_address' => '',\n\t\t\t\t'permanent_address' => '',\n\t\t\t\t'photo' => '',\n\t\t\t\t'extra_curricular_activities' => '',\n\t\t\t\t'remarks' => '',\n\t\t\t\t'guardians' => $guardians,\n\t\t\t];\n\t\t\t$this->view( 'students/student_entry/add', $data );\n\t\t}\n\t}", "public function get_student() {\n\n return View::make('account.student');\n }", "public function teacher_registration(){\n\n\t\t$data['title_page'] = 'Teacher | Registration';\n\t\t$this->load->view('teach/reg_teach', $data);\n\n\t\t/* here is the validation to the form submitted in creating the new teacher_account_tbl;*/\n\n\t}", "public function getRegistrationForm()\n {\n \treturn view('auth.institute_register'); \n }", "public function create()\n\t{\n\t\t$center = Center::lists('name_vi', 'id');\n\t\t$type = $this->type->lists('name','id');\n\t\treturn view('Admin::pages.student.create', compact('type', 'center'));\n\t}", "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "public function admin_students_registration($surname,$firstname,$dob,$address,$state,$nationality,$sex,$status,$fname,$occupation,$faddress,$fone,$mname,$moccupation,$mfone,$sponsor,$passport,$signature,$department,$room,$kin_name,$kin_address,$kin_phone,$relationship,$question1,$answer1,$question2,$answer2,$question3,$answer3,$username,$email,$password,$cpassword){\r\n\r\n //check if email exist\r\n $select_all = \"SELECT * FROM student_registration WHERE email = '$email'\";\r\n $select_query = $this->conn->query($select_all);\r\n $check_user = $select_query->num_rows;\r\n if($check_user !=0){\r\n echo \"<script>\r\n alert('The Email Address has been used');\r\n window.location = 'registration.php';\r\n </script>\";\r\n }elseif($password != $cpassword){\r\n echo \"<script>\r\n alert('Your password is not the same with the confirmed password');\r\n window.location = 'registration.php';\r\n </script>\";\r\n }else{\r\n //the path to store the uploaded image\r\n $target = \"assets/images/\".basename($_FILES['passport']['name']);\r\n //get all the submitted data from the form\r\n $passport = $_FILES['passport']['name'];\r\n //move the uploaded image into the folder images\r\n if(move_uploaded_file($_FILES['passport']['tmp_name'],$target)){\r\n\r\n //the path to store the uploaded signature\r\n $target = \"assets/images/\".basename($_FILES['signature']['name']);\r\n //get all the submitted data from the form\r\n $signature = $_FILES['signature']['name'];\r\n //move the uploaded image into the folder images\r\n if(move_uploaded_file($_FILES['signature']['tmp_name'],$target)){\r\n\r\n \r\n\r\n //insert into the database\r\n $insert_all = \"INSERT INTO student_registration(surname,firstname,dob,address,state,nationality,sex,status,fname,occupation,faddress,fone,mname,moccupation,mfone,sponsor,passport,signature,department,room,kin_name,kin_address,kin_phone,relationship,question1,answer1,question2,answer2,question3,answer3,username,email,password)VALUES('$surname','$firstname','$dob','$address','$state','$nationality','$sex','$status','$fname','$occupation','$faddress','$fone','$mname','$moccupation','$mfone','$sponsor','$passport','$signature','$department','$room','$kin_name','$kin_address','$kin_phone','$relationship','$question1','$answer1','$question2','$answer2','$question3','$answer3','$username','$email','$password')\";\r\n $insert_query = $this->conn->query($insert_all);\r\n\r\n if($insert_query){\r\n echo \"<script>\r\n alert('Registration has been completed');\r\n window.location = 'my_profile.php';\r\n </script>\";\r\n }\r\n //it didn't insert into database...check all the variable and database variable very well\r\n }\r\n }\r\n }\r\n\r\n }", "public function registrationForm() {\n\n }", "public function addstudent()\n {\n return view('admin.addstudent');\n }", "public function ulogiraj_registiraj()\r\n\t{\r\n\t\tif(isset($_POST['ulogiraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Login';\r\n\t\t\t$this->registry->template->show( 'login' );\r\n\t\t}\r\n\t\tif(isset($_POST['registriraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Registriraj se';\r\n\t\t\t$this->registry->template->show( 'register' );\r\n\t\t}\r\n\r\n\t}", "public function registrasi_berdasarkan_semester()\n\t{\n\t\t$data['content'] = 'keuangan/registrasi_berdasarkan_semester';\n\t\t$data['data'] = $this->m_aka->registrasi_berdasarkan_semester();\n\t\t$data['pagination'] = $this->pagination->create_links();\t\t\n\t\t$this->load->view('content', $data);\n\t}", "public function loadRegister(){\n\t\t$roles = $this->Login_model->getUserRole();\n\t\t$data['role'] = $roles;\n\t\t$data['title']=\"Register || Activo\";\n\t\t$data['page']=\"Register\";\n\t\t$this->load->view(\"includes/header\",$data);\n $this->load->view(\"pages/email-verify\",$data);\n $this->load->view(\"includes/footer\",$data);\n\t}", "public function loginRegister () {\n \treturn view(\"Socialite.login-register\");\n }", "function login_form_register()\n {\n }", "public function registration() {\n $this->load->view('header');\n $this->load->view('user_registration');\n $this->load->view('footer');\n }", "public function register()\n {\n $name = $this->loginEntry->input('uname');\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n $this->userDetail->makeEntry($name, $email, $password);\n \n $info = $this->userDetail->getDetail($email, $password);\n \n $this->commonFunction->setSession($info->id, $info->user_name);\n \n return redirect('/dashboard');\n }", "public function register(){\n header(\"Location: register.php\");\n }", "function register() {\n\n // Validate user input\n $this->s_fname = testInput($this->s_fname);\n $this->s_lname = testInput($this->s_lname);\n $this->s_bdate = testInput($this->s_bdate);\n $this->s_sex = testInput($this->s_sex);\n $this->s_email = testInput($this->s_email);\n $this->s_password = testInput($this->s_password);\n\n // Check that student is not registered already\n $result = $this->conn->query(\"SELECT * FROM $this->tableName WHERE s_email LIKE '$this->s_email'\");\n \n if ($result->rowCount() === 0) {\n\n // Insert query \n $query = \"INSERT INTO $this->tableName (s_fname, s_lname, s_bdate, s_sex, s_email, s_password)\n VALUES(:firstName, :lastName, :birthday, :sex, :email, :hashedPassword)\";\n\n // Prepare insert statement\n $insert = $this->conn->prepare($query);\n\n $insert->bindParam(\":firstName\", $this->s_fname);\n $insert->bindParam(\":lastName\", $this->s_lname);\n $insert->bindParam(\":birthday\", $this->s_bdate);\n $insert->bindParam(\":sex\", $this->s_sex);\n $insert->bindParam(\":email\", $this->s_email);\n // Hash password before storing it\n $this->s_password = password_hash($this->s_password, PASSWORD_DEFAULT);\n $insert->bindParam(\":hashedPassword\", $this->s_password);\n\n // Send new user to DB\n try {\n $insert->execute();\n return true;\n }\n catch(PDOException $e) {\n echo $e;\n return false;\n }\n }\n else {\n return false;\n }\n }", "protected function action() {\n\t\tif($this->isPost() ) {\n\t\t\t$student_node=$this->template->getElementByID(\"student\");\n\t\t\tif($this->pers_id!=\"\")\n\t\t\t$this->template->appendFileByID(\"display_student.html\",\"li\",\"student\",false,$student_node);\n\t\t\telse\n\t\t\t$this->template->appendFileByID(\"no_student.html\",\"span\",\"student\",false,$student_node);\n\t\t\t}\n\t\t}", "public function register()\n\t{\n\t\tif($this->current_user) //is the CURRENT USER(OWNER OF CURRENT PHP SCRIPT LOGGED?)\n\t\t{\n\t\t\tredirect(base_url('dashboard'));\n\t\t}else{\n\t\t\t $this->load->view(\"register\");\n\t\t}\n\t}", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "function assignstudent(){\n\t\t\n\t\t$insert = array();\n\t\t$insert['rolename'] = $this->input->post(\"rolename\");\n\t\t$insert['user_id'] = $this->input->post(\"studentid\");\t\t\n\t\t$azureRoleDetails = $this->Azure->getAzureRoleDetails($insert['rolename']);\n\t\t$insert['azure_vm_id'] = $azureRoleDetails['id'];\n\t\t\n\t\t$user = $this->User->getUser($insert['user_id']);\n\t\t// $vminfo = $this->Azure->;\n if($user){ \n \t$return = $this->Azure->assignStudent($insert);\n\t\t}else\n $return = array(\"type\" => \"danger\",\"msg\" => \"The students was not found.\");\t\t\t\n\t\t\n\t\techo json_encode($return);\n\t}", "public function single_student_create(){\n\t\t$user_data['name'] = html_escape($this->input->post('name'));\n\t\t$user_data['email'] = html_escape($this->input->post('email'));\n\t\t$user_data['password'] = sha1(html_escape($this->input->post('password')));\n\t\t$user_data['birthday'] = strtotime(html_escape($this->input->post('birthday')));\n\t\t$user_data['gender'] = html_escape($this->input->post('gender'));\n\t\t$user_data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$user_data['address'] = html_escape($this->input->post('address'));\n\t\t$user_data['phone'] = html_escape($this->input->post('phone'));\n\t\t$user_data['role'] = 'student';\n\t\t$user_data['school_id'] = $this->school_id;\n\t\t$user_data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $user_data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $user_data);\n\t\t\t$user_id = $this->db->insert_id();\n\n\t\t\t$student_data['code'] = student_code();\n\t\t\t$student_data['user_id'] = $user_id;\n\t\t\t$student_data['parent_id'] = html_escape($this->input->post('parent_id'));\n\t\t\t$student_data['session'] = $this->active_session;\n\t\t\t$student_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('students', $student_data);\n\t\t\t$student_id = $this->db->insert_id();\n\n\t\t\t$enroll_data['student_id'] = $student_id;\n\t\t\t$enroll_data['class_id'] = html_escape($this->input->post('class_id'));\n\t\t\t$enroll_data['section_id'] = html_escape($this->input->post('section_id'));\n\t\t\t$enroll_data['session'] = $this->active_session;\n\t\t\t$enroll_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('enrols', $enroll_data);\n\n\t\t\tmove_uploaded_file($_FILES['student_image']['tmp_name'], 'uploads/users/'.$user_id.'.jpg');\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('student_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function registerCourseClick ()\n {\n $objCourse = new Course();\n $result = $objCourse->fetchCoursename();\n if (! empty($result)) {\n $this->showSubViews(\"registerCourse\", $result);\n } else {\n $message = \"You cannnot register<br> No courses exist yet\";\n $this->setCustomMessage(\"ErrorMessage\", $message);\n }\n }", "public function show(PreRegisteredStudent $preRegisteredStudent)\n {\n //\n }", "function index(): ?string\n {\n $form = new \\App\\views\\Forms\\Auth\\RegisterForm();\n\n if ($form->isSubmitted() && $form->validate()) {\n var_dump('paejo');\n\n $user = new User($form->getSubmitData());\n $user->setRole(User::ROLE_USER);\n UserModel::insert($user);\n }\n\n $content = new \\App\\views\\Content([\n 'h1' => 'Registracija',\n 'form' => $form->render()\n ]);\n\n $this->page->setContent($content->render('auth/register.tpl.php'));\n return $this->page->render();\n }", "public function registerPage($rgData) {\n $this->title = \"註冊\";\n $this->tips = \"\";\n\n $this->tempUserName = \"\";\n if(isset($rgData->userName)){\n $this->tempUserName = $rgData->userName;\n }\n \n # Contruct END\n\n if (isset($rgData->message)) {\n $this->tips = $rgData->message;\n }\n\n require_once('./views/register.page.php');\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function actionRegister()\n {\n $this->layout = \"login.php\";\n $model = new SecurityEntities();\n\n if($model->load(Yii::$app->request->post()))\n {\n $model->Validated = 0;\n if($model->save())\n {\n return $this->redirect(['site/index']);\n }\n else{\n $this->render('register',[\n 'model' => $model]);\n }\n }\n else\n {\n return $this->render('register', [\n 'model' => $model,\n ]);\n }\n }", "function addLogin(){\n\t\tif(!$this->data['Registration']['number'] && !$this->data['Registrator']['email']) {\n\t\t\t// First time visiting the site, do nothing and just display the view\n\t\t\t$this->Session->write('errors.noInput', 'Fyll i <strong>bokningsnummer</strong> och <strong>email</strong>');\n\t\t} else { \n\t\t\t// Sanitize the input data\n\t\t\tif($this->data['Registration']['number']) {\n\t\t\t\t$number = Sanitize::clean($this->data['Registration']['number']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noNumber', 'Du har glömt fylla i <strong>bokningsnummer</strong>');\n\t\t\t\t$number = false;\n\t\t\t}\n\t\t\tif ($this->data['Registrator']['email']){\n\t\t\t\t$email = Sanitize::clean($this->data['Registrator']['email']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noEmail', 'Du har glömt fylla i <strong>email</strong>');\n\t\t\t\t$email = false;\n\t\t\t}\n\t\t\tif ($number && $email){\n\t\t\t\t$number = strtoupper($number);\n\t\t\t\t// Get an array from the database with all the info on the registration\n\t\t\t\tif($registration = $this->Registration->findByNumber($number)){\n\t\t\t\t\t$event = $registration['Event'];\n\t\t\t\t\tunset($registration['Event']);\n\t\t\t\t\tunset($registration['Invoice']);\n\t\t\t\t\t$this->Session->write('Event', $event);\n\t\t\t\t\t// Checks the array from the database and tries to match the email with the form//\n\t\t\t\t\t$email = $this->data['Registrator']['email'];\n\t\t\t\t\tif($registration['Registrator']['email'] == $email){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->write('loggedIn', true);\n\t\t\t\t\t\t$this->Registration->putRegistrationInSession($registration, $this->Session);\n\t\t\t\t\t\t$this->setPreviousStepsToPrevious('Registrations','review');\n\t\t\t\t\t\t$this->requestAction('steps/redirectToNextUnfinishedStep');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//the user has put in wrong values in the field 'email'\n\t\t\t\t\t\t$this->Session->write('errors.unvalidEmail', 'Är du säker på att skrev rätt <strong>email?</strong>');\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\t//the user has put in wrong values in at least the 'booking number' field\n\t\t\t\t\t$this->Session->write('errors.noBookingnr', 'Är du säker på att du skrev rätt <strong>bokningsnummer?</strong>');\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->redirect(array('controller' => 'registrations', 'action' => 'login'));\t\t\n\t}", "public function index(){\n\t\t\t\n\t\t\t$this->renderView(\"registrar\");\n\t\t}", "public function register()\n\t{\n\t\tif ($this->session->userdata('isValid') == 0) {\n\t\t\t$this->load->view('v_register');\n\t\t}\n\n\t\t// Jika user masuk dari link baru, memastikan isi data session kosong dengan men-destroy data session\n\t\telse\n\t\t{\n\t\t\t$this->session->sess_destroy();\n\t\t\t$this->load->view('v_register');\n\t\t}\n\t}", "public function studentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()])->read(),'success','SM001');\n }", "function Register()\r\n\t{\r\n\t\tglobal $Site;\r\n\t\t//if all the details is valid save the user on data base\r\n\t\tif ($this->IsValid())\r\n\t\t{\r\n\t\t\t$MemberID = GetID(\"member\", \"MemberID\");//getting last MemberID +1 for adding one more user\r\n\t\t\t$DateAdded = date(\"Y-m-d H:i:s\");\r\n\t\t\t$DateUpdated = $DateAdded;\r\n\t\t\t$IsEnable = 1;\r\n\t\t\t$pass = base64_encode($this->Password);\r\n\t\t\t$SQL = \"insert into member (MemberID, ProfileType, FirstName, LastName, TelNo, Email, Password, IsActive, IsEnable, DateAdded, DateUpdated) values ($MemberID, 'user', '$this->FirstName', '$this->LastName', '$this->PhoneNumber', '$this->Email', '$pass', '1' , '$IsEnable', '$DateAdded', '$DateUpdated')\";\r\n\t\t\tGetRS($SQL);\r\n\t\t\t$_SESSION['SAWMemberID'] = $MemberID;//cookie- to not allow impersonation of another user PHP gives each customer ID\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}", "public function register()\n\t{\n\t \t$this->load->library('form_validation');\n\t \t$this->load->helper('security');\n\t \t$this->form_validation->set_rules('siape', 'Siape', \n\t \t\t'trim|required|xss_clean|max_length[8]|is_unique[tb_professor.siape]',\n\t \t\tarray('is_unique' => 'Siape já cadastrado'));\n\t \t$this->form_validation->set_rules('nome', 'Nome', 'trim|required|xss_clean');//call_back_checar repetição\n\t \t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|is_unique[tb_professor.email]',\n\t \t\tarray('is_unique' => 'E-mail já cadastrado'));\n\t \t$this->form_validation->set_rules('senha', 'Password', 'trim|required|xss_clean|matches[confirmasenha]',\n\t \t\tarray('matches' => 'Confirmação de senha inválida' ));\n\t \t$this->form_validation->set_rules('confirmasenha', 'CPassword', 'trim|required|xss_clean');\n\n\t \tif($this->form_validation->run() == FALSE)\n\t \t{ \n\t \t\t$data['register_tab'] = 'active';\n\t \t\t$data['login_tab'] = 'inactive';\n\t \t$this->load->view('login/login.php', $data);\n\t \t}\n\t \telse\n\t \t{ \n\t \t$this->insert_professor();\n\t \tredirect('login', 'refresh');\n\t \t}\n\t}", "public function isStudent(){\n\t\t// get user type\n\t\t$session_data = $this->session->userdata('logged_in'); // get userid from session\n\t\t\t\n\t\t// redirect to home if user is not a student\n\t\tif($session_data['usertype']!=0) redirect('/home');\n\t}", "function student_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'student_add';\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "public function showRegistrationForm()\n {\n if(Role::first()){\n $role = Role::pluck('name', 'id')->toArray();\n return view('Admin::auth.register', compact('role'));\n }else{\n return redirect()->route('admin.createRole');\n }\n }", "public function registrationAction()\n {\n $eventId = $this->params('eventId');\n $registrations = $this->regTable->findRegByEventId($eventId);\n //*** DATABASE TABLE MODULE RELATIONSHIPS LAB: provide secondary data usersModelTableGateway which performs lookups for attendees for each registration\n $data = [];\n if ($registrations) {\n foreach ($registrations as $item) {\n $secondaryDataTable = '???';\n $data[] = [\n $item->registration_time,\n $item->first_name,\n $item->last_name,\n $secondaryDataTable];\n }\n }\n return new JsonModel(['data' => $data]);\n }", "public function showRegistrationForm() {\n //parent::showRegistrationForm();\n $data = array();\n\n $data = $this->example_of_user();\n $data['title'] = 'RegisterForm';\n\n return view('frontend.auth.register', $data);\n }", "public function register_action()\n {\n $registration_successful = RegistrationModel::registerNewUser();\n\n if ($registration_successful) {\n Redirect::to('index');\n } else {\n Redirect::to('user/register');\n }\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function create()\n {\n return view('admin/school/detail/school_student.create');\n }", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "public function register() {\n $next = $this->input->get('next');\n $data['next'] = $next;\n $data['title'] = translate('register');\n $this->load->view('front/register', $data);\n }", "public function registerPost(){\n\t\t\t$this->modelRegister();\n\t\t\t//quay lai trang dang ky\n\t\t\t//header(\"location:index.php?controller=account&action=register&notify=success\");\n\t\t\techo \"<script>location.href='login/register-success';</script>\";\n\t\t}", "function student_add() {\n if ($this->session->userdata('teacher_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'student_add';\n $page_data[\"total_students\"] = $select_students = $this->db->get(\"student\")->num_rows() + 1;\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "public function actionIndex()\n {\n {\n $model = new AdminUser();\n if ($model->load(Yii::$app->request->post())) {\n if ($model->newadmin()) {\n $this->redirect(\\Yii::$app->urlManager->createURL(\"student/index\"));\n }\n }\n return $this->render('new-admin', [\n 'model' => $model,\n ]);\n }\n }", "public function showRegistrationForm()\n\t{\n\t\t$data = [];\n\t\t\n\t\t// References\n\t\t$data['countries'] = CountryLocalizationHelper::transAll(CountryLocalization::getCountries());\n\t\t$data['genders'] = Gender::trans()->get();\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'register'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'register')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'register'));\n\t\t\n\t\t// return view('auth.register.indexFirst', $data);\n\t\treturn view('auth.register.index', $data);\n\n\t}", "public function activation($cnestudent)\r\n {\r\n $req=$this->student->changeetat($cnestudent); // change the etat\r\n $this->students(); // show the update list of student\r\n }", "public function registration()\n {\n \n }", "public function addStudent()\n {\n $student = new Student();\n $student->name = 'Shakib';\n $student->email = '[email protected]';\n $student->save();\n\n return 'Student Added Successfully!';\n }", "public function registerAction() {\n\n $user = new User();\n\n // データを保存し、エラーをチェックする\n// $success = $user->save($this->request->getPost(), array('name', 'email'));\n\n $user->findFirst($this->request->getPost());\n\n if ($success) {\n echo \"Thanks for registering!\";\n } else {\n echo \"Sorry, the following problems were generated: \";\n foreach ($user->getMessages() as $message) {\n echo $message->getMessage(), \"<br/>\";\n }\n }\n\n $this->view->disable();\n\n }", "public function create()\n {\n $brances = Brance::all();\n $courses = Course::all();\n return view('student.studentregister',compact(['courses','brances']));\n }", "public function registered()\n { \n $data = [\n 'judul_seminar' => $this->judul_seminar,\n 'nama_pembicara' => $this->nama_pembicara,\n 'tulisan_seminar' => $this->tulisan_seminar\n ];\n $this->load->view('seminar/form_registered', $data); \n }", "function addStudent($name, $institution, $major, $minor, $identification, $passkey, $google, $yahoo, $live, $facebook, $linkedin, $twitter){\n\n\t\t$this->connection->query(\"INSERT INTO students (stud_name, stud_inst, stud_major, stud_minor, stud_identification, stud_passkey, stud_google, stud_yahoo, stud_live, stud_facebook, stud_linkedin, stud_twitter) VALUES ('$name', '$institution', '$major', '$minor', '$identification', '$passkey', '$google', '$yahoo', '$live', '$facebook', '$linkedin', '$twitter' )\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add Student!\";\t\t\n\t\t}\t\n\n\t}", "public function indexAction()\n {\n $request \t= $this->getRequest();\n\t\t$form \t\t= $this->getRegistrationForm();\n $em = $this->_helper->getEm();\n \n // we initialize model (you should fill _userModel in Your controller)\n\t\t$model = new $this->_userModel;\n\n\t\tif($request->isPost()) {\n\t\t\t$post = $request->getPost();\n\t\t\tif($form->isValid($post)) { // data in the form are valid so we \n // can register new user\n $values = $form->getValues();\n\t\t\t $model->setOptions($values);\n // adding role to object\n $role = $em->getRepository('\\Trendmed\\Entity\\Role')\n ->findOneByName($model->getRoleName());\n if(!$role) throw new Exception('Given role ('.$model->getRoleName().'\n not found in DB');\n $model->setRole($role);\n $em->persist($model);\n $model->sendWelcomeEmail();\n\t\t\t \n $em->flush();\n \n $this->_helper->FlashMessenger($this->_messageSuccessAfterRegistration);\n\t\t\t $this->_helper->Redirector(\n $this->_redirectAfterRegistration['action'],\n $this->_redirectAfterRegistration['controller'],\n $this->_redirectAfterRegistration['module']\n );\n\t\t\t} else {\n $errors = $form->getErrorMessages();\n $code = $form->getErrors();\n $custom = $form->getCustomMessages();\n\t\t\t $this->_helper->FlashMessenger(array('error' => 'Please fill out the form correctly'));\n\t\t\t}\n\t\t}\n\t\t\n $this->view->headTitle(ucfirst($model->getRoleName()).' registration');\n\t\t$this->view->form = $form;\n }", "public function stuUserLogin() {\n\t\tif(isset($_POST['txtUName']) && isset($_POST['subDomain'])){\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t if(mysqli_num_rows($schl_query_res)>0){\n\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t$hash_salt_query=\"select u.id,hashed_password,salt,u.email,batch_id,b.course_id,b.start_date,b.end_date,u.username from users u left join students s on s.user_id = u.id left join batches b on b.id = s.batch_id where u.username='\".trim($_POST['txtUName']).\"' and u.school_id='\".$school_data['id'].\"' and u.admin!=1 and u.employee!=1 and u.student!=0\";\n\t\t\t$hash_salt_res = mysqli_query($this->connfed, $hash_salt_query);\n\t\t\tif(mysqli_num_rows($hash_salt_res)>0){\t\n\t\t\t \t$row=mysqli_fetch_assoc($hash_salt_res);\n\t\t\t\t$hash_pwd = $row['hashed_password'];\n\t\t\t\t$salt = $row['salt'];\n\t\t\t\t$pwd=$salt.$_POST['txtPwd'];\n\t\t\t\t$hash_new_pwd=hash('sha1',$pwd);\n\t\t\t\tif ($hash_pwd==$hash_new_pwd) {\n\t\t\t\t\t $_SESSION['std_id']=$row['id'];\n\t\t\t\t\t $_SESSION['username']=$row['username'];\n\t\t\t\t\t $_SESSION['user_email']=$row['email'];\n\t\t\t\t\t $_SESSION['batch_id']=$row['batch_id'];\n\t\t\t\t\t $_SESSION['start_date']= date(\"Y-m-d\",strtotime($row['start_date']));\n\t\t\t\t\t $_SESSION['end_date'] = date(\"Y-m-d\",strtotime($row['end_date']));\n\t\t\t\t\t $_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t $_SESSION['course_id']=$row['course_id'];\n\t\t\t\t\t return 1;\n\t\t\t\t}else{\n\t\t\t\t\t $message=\"Paasword does not matched.\";\n\t\t\t\t\t $_SESSION['error_msg'] = $message;\t\n\t\t\t\t\t return 0;\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t \t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }" ]
[ "0.6845952", "0.68367875", "0.67817134", "0.6679925", "0.6616837", "0.66128904", "0.65733033", "0.65457135", "0.65366006", "0.6529387", "0.6501733", "0.6457055", "0.6452077", "0.64199096", "0.6401225", "0.6370228", "0.6366984", "0.63649994", "0.6359715", "0.634475", "0.63401234", "0.6335496", "0.6333626", "0.6329686", "0.6329055", "0.6316507", "0.63075125", "0.63040715", "0.62922", "0.6290957", "0.6273778", "0.6270268", "0.62700045", "0.62671274", "0.6258524", "0.6246383", "0.6245041", "0.6225596", "0.622304", "0.6215387", "0.6204956", "0.6182203", "0.61776245", "0.6173792", "0.61712235", "0.61685693", "0.61537236", "0.6147609", "0.61353916", "0.61327636", "0.6129513", "0.6118168", "0.6115168", "0.61052024", "0.61044383", "0.61041194", "0.61033064", "0.6102453", "0.6092074", "0.60857123", "0.6077166", "0.6072719", "0.60705805", "0.6063786", "0.6061721", "0.60599107", "0.6054758", "0.60371906", "0.6037066", "0.603499", "0.60296005", "0.602924", "0.60212076", "0.6019397", "0.6017755", "0.60158724", "0.601511", "0.6014573", "0.6009669", "0.5999954", "0.5999507", "0.59955716", "0.5994164", "0.5991225", "0.59891105", "0.5979564", "0.5974258", "0.59699196", "0.59682345", "0.5967536", "0.5966973", "0.59642553", "0.59637374", "0.5961617", "0.5960568", "0.5954193", "0.5953551", "0.5953103", "0.5951237", "0.594793" ]
0.603562
69
/ Update Profile Details
public function update_profile($username,$email,$surname,$finame,$status,$address,$state,$dob){ $update_profile = "UPDATE student_registration SET username='$username', email='$email', surname='$surname', firstname='$finame', status='$status', address='$address', state='$state', dob='$dob' WHERE email='$email'"; $update_query = $this->conn->query($update_profile); if($update_query){ echo "<script> alert('Your profile has been updated successfully'); window.location = 'my_profile.php'; </script>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateProfile() {\n\t\t\n\t\treturn $this->_post(self::URL_USERS_UPDATE_PROFILE, $this->_query);\n\t}", "public function update_profile(){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username')\n\t\t\t);\n\n\t\t\t$this->db->where('id', $this->input->post('id'));\n \n return $this->db->update('users', $data);\n\t\t}", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "public function updateProfile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profileEdit');\n\n return $this->loadPublicView('user.profile-edit', $breadCrumb['data']);\n }", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function updateprofileAction()\n\t{\n\t\t$this->view->headTitle(\"Update Your Profile\");\n\t\t\n\t\t//if not logged in, user can't edit profile\n\t\tif(!$this->loggedEmail){\n\t\t\t$this->_redirect('/'); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\tif($this->getRequest()->isPost()){\n\t\t\t\n\t\t\t$resultRow->email = $this->getRequest()->getPost('email');\n\t\t\t$resultRow->first_name = $this->getRequest()->getPost('first_name');\n\t\t\t$resultRow->last_name = $this->getRequest()->getPost('last_name');\n\t\t\t$resultRow->gender = $this->getRequest()->getPost('gender');\n\t\t\t$resultRow->address = $this->getRequest()->getPost('address');\n\t\t\t\n\t\t\tif(strlen($this->getRequest()->getPost('password'))){\n\t\t\t\t$resultRow->password = $this->getRequest()->getPost('password');\n\t\t\t}\n\t\t\t$resultRow->updated_at = date('Y-m-d H:i:s');\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t} \n\t\t\t\n\t\t$this->view->email = $resultRow->email;\n\t\t$this->view->first_name = $resultRow->first_name;\n\t\t$this->view->last_name = $resultRow->last_name;\n\t\t$this->view->gender = $resultRow->gender;\n\t\t$this->view->address = $resultRow->address;\n\t\t$this->view->handle = $resultRow->handle;\n\t\n\t}", "public function update_profile_info() {\n\t\t$data = array(\n\t\t\t'first_name' => html_escape($this->input->post('first_name')),\n\t\t\t'last_name' => html_escape($this->input->post('last_name')),\n\t\t\t'biography' => html_escape($this->input->post('biography')),\n\t\t\t'phone' => html_escape($this->input->post('phone')),\n\t\t\t'social_links' => '{\"twitter\":\"' . html_escape($this->input->post('twitter')) . '\",\"facebook\":\"' . html_escape($this->input->post('facebook')) . '\",\"linkedin\":\"' . html_escape($this->input->post('linkedin')) . '\"}',\n\t\t);\n\t\t$this->session->set_userdata('phone', $this->input->post('phone'));\n\t\t$result = $this->user_model->update_user_info($this->session->userdata('user_id'), $data);\n\n\t\tif ($result) {\n\t\t\t$this->session->set_flashdata('profile_info_update_successful', \"Information updated successfully.\");\n\t\t} else {\n\t\t\t$this->session->set_flashdata('failed_to_update_profile_info', \"Failed to update profile info!! Please contact support.\");\n\t\t}\n\n\t\tredirect(site_url('user/profile/info'), 'refresh');\n\t}", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "function updateProfile()\n\t\t{\n\t \t$pass = \"\";\n\t\t \tif(strlen($this->updProfile['password'])){\n\t\t\t\t$pass=\", password ='\".$this->updProfile['password'].\"'\";\n\t\t \t} \n\t\t \n\t\t\t$query = \"UPDATE tbl_member SET first_name='\".$this->updProfile['firstName'].\"',\n\t\t last_name = '\".$this->updProfile['lastName'].\"',\n\t\t email = '\".$this->updProfile['email'].\"',\n\t\t user_name = '\".$this->updProfile['UserName'].\"'{$pass}\n\t\t WHERE member_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t\t$this->Execute($query);\n\t\t \n\t\t\t$query = \"UPDATE tbl_subscriber \n\t\t\tSET mail_street_address ='\".$this->updProfile['streetAddress'].\"',\n\t\t mail_city='\".$this->updProfile['City'].\"',\n\t\t bill_street_address ='\".$this->updProfile['billingAddress'].\"' ,\n\t\t bill_city ='\".$this->updProfile['billCity'].\"',\n\t\t mail_state ='\".$this->updProfile['state'].\"',\n\t\t mail_zip_code ='\".$this->updProfile['zipCode'].\"',\n\t\t bill_state ='\".$this->updProfile['billState'].\"',\n\t\t bill_zip_code ='\".$this->updProfile['billZipCode'].\"',\n\t\t is_address_changed ='\".$this->updProfile['is_address_changed'].\"',\n\t\t secondary_affiliates ='\".$this->updProfile['secondary_afflliates'].\"'\n\t\t \n\t\t WHERE subscriber_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t return $this->Execute($query);\n\t\t //return $this->_getPageArray($rs, 'Subscriber');*/\n\t\t}", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "function updateProfile($mysqli,$profile){\r\n $query = \"UPDATE `profiles` SET FirstName = '\".$profile->firstName.\"', LastName = '\".$profile->lastName.\"', Gender = '\".$profile->gender.\"', Birthday = '\".$profile->birthday.\"', Weight = '\".$profile->weight.\"', \r\n Height = '\".$profile->height.\"', Bio = '\".$profile->bio.\"', Prof_Pic_URL = '\".$profile->profPicURL.\"' WHERE UserID = \".$profile->userID;\r\n $mysqli->query($query);\r\n }", "public function actionUpdate() {\r\n\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n \r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n \r\n if(!$user) {\r\n $errors['firstname'][0] = 'Unable to find user. Please, try again later';\r\n } else {\r\n //user properties\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n } \r\n \r\n //check if the form has been submitted\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n \r\n $firstname = $this->test_input($_POST['firstname']);\r\n $lastname = $this->test_input($_POST['lastname']);\r\n $email = $this->test_input($_POST['email']);\r\n \r\n //create form model, validate it and if success - update user profile\r\n $model = new EditProfileForm($userID, $firstname, $lastname, $email);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else {\r\n #!!!!!!!!!!!!!\r\n $success = $model->updateProfile() ? 'USER DATA SUCCESFULLY UPDATED': 'UNABLE TO UPDATE USER PROFILE. TRY AGAIN LATER';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/update.php';\r\n }", "public function updateProfile(ValidProfile $request){\n\n\t\t// Ensure only the logged in user can update their profile. \n $user = User::find(Auth::user()->id); \n \n $user->name = $request->name;\n\t\t$user->traveller_rv_type_id = $request->rvType;\n\t\t$user->traveller_rv_size = $request->rvSize;\n\t\t$user->host_description = $request->description;\n\t\t\n\t\t$user->save();\n \n return Redirect::route('home');\n }", "public function updateProfile($data) {\n $this->db->query(\"UPDATE \" . DB_PREFIX . \"wkpos_user SET firstname = '\" . $data['firstname'] . \"', lastname = '\" . $data['lastname'] . \"', email = '\" . $data['account_email'] . \"', username = '\" . $data['username'] . \"', salt = '\" . $this->db->escape($salt = token(9)) . \"', password = '\" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['account_npwd'])))) . \"' WHERE user_id = '\" . $this->session->data['user_login_id'] . \"'\");\n }", "public function action_profile() {\n\t\tif (!Auth::instance()->has_permission('update_profile', $this->_model_name)) {\n\t\t\tthrow new Oxygen_Access_Exception;\n\t\t}\n\t\t$this->_init_model();\n\t\t$this->_load_model();\n\t\t$this->_create_nonce();\n\n\t\t// Hooks\n\t\tOHooks::instance()\n\t\t\t->add(get_class($this).'.profile.view_data', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_view_data'\n\t\t\t))\n\t\t\t->add(get_class($this).'.profile.model_post_save', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_model_post_save'\n\t\t\t))\n\t\t\t->add(get_class($this).'.profile.model_saved', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_model_saved'\n\t\t\t))\n\t\t\t->add('profile_edit.form.header_data', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'user_edit_form_header_data',\n\t\t\t));\n\n\t\t// Form posted?\n\t\tif (Arr::get($_POST, 'save')) {\n\t\t\ttry {\n\t\t\t\t// Validation\n\t\t\t\tNonce::check_fatal($this->_nonce_action, $this->_model->id);\n\t\t\t\t$this->_model->check();\n\n\t\t\t\t// Check collision\n\t\t\t\tif (!$this->_model->no_collision($this->_model->id, $this->_nonce_action)) {\n\t\t\t\t\t$this->_model->validation()->error('username', 'collision');\n\t\t\t\t\tthrow new ORM_Validation_Exception($this->_model->object_name, $this->_model->validation());\n\t\t\t\t}\n\n\t\t\t\t// Save the profile\n\t\t\t\t$this->_model->values_via_fieldgroup($_POST, 'profile');\n\t\t\t\t$this->_model->update();\n\n\t\t\t\tforeach ($this->_model->fieldgroup('preferences') as $key => $field) {\n\t\t\t\t\t$value = Arr::get($_POST, $key);\n\t\t\t\t\tif (!is_null($value)) {\n\t\t\t\t\t\t$this->_model->preference($key, $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Set the confirmation message\n\t\t\t\tMsg::add('confirm', 'Profile successfully updated.');\n\n\t\t\t\t// Hooks\n\t\t\t\t$this->_model = OHooks::instance()->filter(get_class($this).'.profile.model_post_save', $this->_model);\n\t\t\t\tOHooks::instance()->event(get_class($this).'.profile.model_saved', $this->_model);\n\n\t\t\t\t// All done!\n\t\t\t\t$this->request->redirect('profile');\n\t\t\t}\n\t\t\tcatch (ORM_Validation_Exception $e) {\n\t\t\t\tMsg::add('error', $e->errors('validation'));\n\t\t\t}\n\t\t}\n\n\t\t// Add additional fields\n\t\t$this->_model->fields_init();\n\t\t$this->_model->set_field_values();\n\t\t$fields = array(\n\t\t\tOField::factory('hidden')\n\t\t\t\t->model($this->_model)\n\t\t\t\t->name('updated')\n\t\t\t\t->value($this->_model->updated),\n\n\t\t\tNonce::field($this->_nonce_action, $this->_model->id),\n\t\t\t$this->_model->field('name'),\n\t\t\t$this->_model->field('email'),\n\t\t);\n\n\t\t// Initialize the form\n\t\t$form = OForm::factory()\n\t\t\t->title('Edit Profile')\n\t\t\t->name('profile_edit')\n\t\t\t->fields($fields)\n\t\t\t->button('save',\n\t\t\t\tOField::factory('submit')\n\t\t\t\t\t->model($this->_model)\n\t\t\t\t\t->name('save')\n\t\t\t\t\t->default_value('Save')\n\t\t\t)\n\t\t\t->view('header', 'form/header/tabs/default')\n\t\t\t->attributes(array(\n\t\t\t\t'class' => 'edit'\n\t\t\t))\n\t\t\t->add_css_class('base', true)\n\t\t\t->add_css_class('box-tabs', true);\n\t\t// add preferences\n\t\tforeach ($this->_model->fieldgroup('preferences') as $key => $field) {\n\t\t\t$value = $this->_model->preference($key);\n\t\t\tif (is_null($value)) {\n\t\t\t\t$value = Oxygen::config('oxygen')->get($key, null);\n\t\t\t}\n\t\t\t$form->field($key, $field->value($value));\n\t\t}\n\n\t\t// Favorite\n\t\t$title = 'User Profile';\n\t\t$this->favorites->title($title);\n\n\t\t// Get the hook to modify data.\n\t\t$data = OHooks::instance()->filter(get_class($this).'.profile.view_data', array(\n\t\t\t'controller' => $this,\n\t\t\t'model' => $this->_model,\n\t\t\t'form' => $form\n\t\t));\n\n\t\t// Set template content\n\t\t$this->template->set(array(\n\t\t\t'title' => $title,\n\t\t\t'content' => View::factory('user/profile', array(\n\t\t\t\t'model' => $data['model'],\n\t\t\t\t'form' => $data['form']\n\t\t\t))\n\t\t));\n\t}", "public function updateProfile($user, array $profile);", "public static function profile($profile){\n $pro = Profile::where('user_id',Auth::id())->first();\n if ($pro){\n $pro->update($profile);\n }else{\n Profile::create($profile);\n }\n }", "public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function updateProfile(array $data){\n $user = App_Auth::getInstance()->getIdentity();\n $data['id'] = $user->id;\n\n $this->save($data);\n }", "public function update_profile()\n\t{\n $data = array(\n 'name_students' => $this->input->post('name'),\n 'email_students'\t => $this->input->post('email'),\n 'address_students'\t => $this->input->post('address')\n );\n $data2 = array(\n 'username_user' => $this->input->post('username'),\n 'password_user'\t\t => $this->input->post('password')\n );\n \n $this->MyModel->updateData('students', 'id_students', $this->session->userdata('id'), $data);\n $this->MyModel->updateData('user', 'id_students', $this->session->userdata('id'), $data2);\n \n\t\tredirect('SiropCont/profile');\n\t}", "public function update_profile() {\n\t\tloggedOnly();\n\n\t\t// Busca o usuario\n\t\t$user = auth();\n\n\t\t// Pega o email\n\t\t$email = $this->input->post( 'email' ) ? \n\t\t\t\t $this->input->post( 'email' ) :\n\t\t\t\t $user->email;\n\n\t\t// Verifica se o email foi alterado\n\t\tif( $email !== $user->email ) {\n\n\t\t\t// Verifica se o email é unico\n\t\t\tif( $this->User->email( $email ) ) {\n\t\t\t\treturn reject( 'E-mail ja cadastrado no sistema' );\n\t\t\t}\n\t\t\t\n\t\t\t// Seta o email\n\t\t\t$user->email = $email;\n\t\t}\n\n\t\t// Verifica se a senha foi alterada\n\t\tif( $password = $this->input->post( 'password' ) ) {\n\t\t\t$user->setPassword( $password );\n\t\t}\n\n\t\t// seta o nome\n\t\t$user->name = $this->input->post( 'name' ) ? \n\t\t\t\t\t $this->input->post( 'name' ) : \n\t\t\t\t\t $user->name;\n\n\t\t// Verifica se a foto foi alterada\n\t\tif( $base64 = $this->input->post( 'image' ) ) {\n\n\t\t\t// Guarda a imagem\n\t\t\tif( $midia_id = $this->__saveUserImage( $base64 ) ) {\n\t\t\t\t$user->midia_id = $midia_id;\n\t\t\t} else return reject( 'Erro ao salvar a imagem do usuário' );\n\t\t}\n\n\t\t// salvar a alteração\n\t\tif( $user->save() ) {\n\t\t\treturn resolve( $user->authData() );\n\t\t} else return reject( 'Erro ao realizar a ação' );\n\t}", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "public function update_info()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->update_info($this->mUser->id, $this->input->post());\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully updated account info.');\n\t\t\t$this->mUser->full_name = $this->input->post('full_name');\n\t\t\t$this->session->set_userdata('admin_user', $this->mUser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to update info.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function updateInformation() {\n $response = null;\n try {\n // Returns a `FacebookFacebookResponse` object\n $response = Facebook::get(\n $this->app_scoped_id . '?fields=first_name,last_name,profile_pic&access_token=' . $this->restaurant->fb_page_access_token,\n null,\n $this->restaurant->fb_page_access_token\n );\n } catch(Exception $e) {\n return;\n }\n $result = $response->getGraphObject()->asArray();\n if ($result) {\n if(array_key_exists(\"first_name\", $result)) {\n $this->attributes['first_name'] = $result[\"first_name\"];\n }\n if(array_key_exists(\"last_name\", $result)) {\n $this->attributes['last_name'] = $result[\"last_name\"];\n }\n if(array_key_exists(\"profile_pic\", $result)) {\n $this->attributes['profile_pic'] = $result[\"profile_pic\"];\n }\n $this->save();\n }\n }", "public function update()\n {\n //check login\n if(!$this->session->userdata('logged_in'))\n {\n redirect('users/login');\n }\n $this->user_model->update_user();\n\n //set message\n $this->session->set_flashdata('profile_updated', 'Profile updated.');\n //redirect page to profile\n redirect('profile'); \n }", "public function profile()\n {\n if (isset($_REQUEST['submit'])) {\n\n $fullname = $_POST['fullname'];\n\n $phone = $_POST['phone'];\n\n $username = $_POST['username'];\n\n $des = $_POST['des'];\n\n $user = $_POST['user'];\n\n\n //Checking for User login or not\n $change = $this->getChange($username, $fullname, $phone ,$des, $user);\n\n if ($change) {\n $success = 'Change profile successful!';\n echo \"<p><span class='error' style='color: green'>\" . $success . \"</span></p><br>\";\n } else {\n // Registration Failed\n $fail = 'Change profile failed. Account already not exits, please try again.';\n echo \"<p><span class='error' style='color: red;'>\" . $fail . \"</span></p><br>\";\n };\n }\n }", "public function profileAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['phone'])){\n $user->setPhone($data['phone']);\n }\n if(isset($data['email'])){\n $user->setPhone($data['email']);\n }\n if(isset($data['workphone'])){\n $user->setWorkPhone($data['workphone']);\n }\n if(isset($data['workemail'])){\n $user->setWorkEmail($data['workemail']);\n }\n if(!$user->save()){\n $this->setErrorResponse('Cannot update user profile');\n }\n $this->_helper->json($user);\n }", "function updateprofile($pdo,$profile_id) {\n $sql = \"UPDATE profile SET first_name = :first_name, summary = :summary,\n last_name = :last_name, email = :email, headline = :headline\n WHERE profile_id = :profile_id\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array(\n ':first_name' => $_POST['first_name'],\n ':last_name' => $_POST['last_name'],\n ':email' => $_POST['email'],\n ':headline' => $_POST['headline'],\n ':summary' => $_POST['summary'],\n ':profile_id' => $profile_id));\n}", "public function update() {\n if($this->profile_id == 0)\n return null; // can't update something without an ID\n\n $db = Db::instance(); // connect to db\n $q = sprintf(\"UPDATE `profiles` SET\n `firstname` = $db->escape($this->firstname),\n `lastname` = $db->escape($this->lastname),\n `username` = $db->escape($this->username),\n `password` = $db->escape($this->password),\n `photo` = $db->escape($this->photo),\n `number_posts` = $db->escape($this->number_posts)\n WHERE `profile_id` = $db->escape($this->profile_id);\");\n\n $db->query($q); // execute query\n return $db->profile_id; // return this object's ID\n }", "public function save()\n\t{\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile->{Yii::$app->request->post()['flag']} = Yii::$app->request->post()['val'];\n\n\t\t$updatedProfile->save();\n\t}", "public function editprofile()\n {\n //make sure user is logged in\n Auth::checkAuthentication();\n $data = array('ajaxform'=>'load');\n \n //loads user data from session, gives save button(post)\n $this->View->render('user/editProfile',$data);\n }", "public function profile()\n {\n $id = $this->Auth->user('id');\n $user = $this->Users->get($id, [\n 'contain' => []\n ]);\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n //avoid mass-assignment attack\n $options = [\n 'fieldList' => [\n 'email',\n 'username',\n 'password',\n 'first_name',\n 'last_name',\n 'address_1',\n 'address_2',\n 'suburb',\n 'state',\n 'post_code',\n 'mobile',\n 'phone',\n ]\n ];\n\n $user = $this->Users->patchEntity($user, $this->request->getData(), $options);\n if ($this->Users->save($user)) {\n\n $this->Flash->success(__('Your profile has been updated.'));\n return $this->redirect(\"/\");\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "public function account_update_info()\n\t{\n\t\t$data = $this->input->post();\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function updateprofile($data){\n\n \t\t$id = $_SESSION['id'];\n\n \t\t$language= $_REQUEST['language'];\n\n \t\t/*$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\t\t$result = $this->connection->query($q);*/\n\n\n\t\t$q = \"UPDATE user_table SET fname= '$data[fname]' , lname='$data[lname]', email='$data[email]', lang_id='$language' WHERE id=$id\";\n\n\t\t$result = $this->connection->query($q);\n\n\t\t\t\t$_SESSION['message'] = \"Updated Successfully\";\n\t\t\t\t$_SESSION['msg_type'] = \"success\";\n\n \t}", "public function updateProfile()\n {\n try {\n $email = Crypt::decryptString(request()->hash);\n $user = Customer::whereEmail($email)->first();\n if ($user) {\n $user->fname = request()->fname;\n $user->lname = request()->lname;\n $user->phone = request()->phone;\n $user->address = request()->address;\n if (request()->image)\n $user->image = $this->uploadBase64Image(request()->image);\n\n $user->save();\n\n $user->access_token = Crypt::encryptString($user->email);\n\n return ['status' => true, 'message' => 'Profile updated successfully.', 'data' => $user];\n }//..... end if() .....//\n\n return ['status' => false, 'message' => 'User details not found!.'];\n } catch (\\Exception $exception) {\n return $exception->getMessage();\n return ['status' => false, 'message' => 'Internal server error occurred, please try later.'];\n }\n }", "public function profile_update(ProfileRequest $request)\n {\n if ($request->email != auth()->user()->email) {\n $user = User::whereEmail($request->email)->get();\n if (!empty($user)) {\n alert('El email ingresado ya existe', 'danger');\n return redirect()->back();\n }\n }\n\n $state = State::findOrFail($request->state);\n\n $user = auth()->user();\n $user->state()->associate($state);\n $user->update($request->all());\n\n alert('Se modificaron los datos con éxito');\n return redirect()->back();\n }", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function update(Request $request, Profile $profile)\n { }", "public function update(ProfileRequest $request)\n {\n Settings::set($request->only('name', 'email', 'phone', 'website', 'description'));\n\n return back()\n ->with('status', 'Bedrijfsprofiel geupdatet!');\n }", "public function actionEdit()\n\t{\n\t\t$model = new ProfileForm;\n\t\t$model->load(Yii::app()->user->id);\n\n\t\tif (Cii::get($_POST, 'ProfileForm', NULL) !== NULL)\n\t\t{\n\t\t\t$model->attributes = $_POST['ProfileForm'];\n\t\t\t$model->password_repeat = $_POST['ProfileForm']['password_repeat'];\n\n\t\t\tif ($model->save())\n\t\t\t{\n\t\t\t\tYii::app()->user->setFlash('success', Yii::t('ciims.controllers.Profile', 'Your profile has been updated!'));\n\t\t\t\t$this->redirect($this->createUrl('profile/index', array(\n\t\t\t\t\t'id' => $model->id,\n\t\t\t\t\t'username' => $model->username\n\t\t\t\t)));\n\t\t\t}\n\t\t\telse\n\t\t\t\tYii::app()->user->setFlash('error', Yii::t('ciims.controllers.Profile', 'There were errors saving your profile. Please correct them before trying to save again.'));\n\t\t}\n\n\t\t$this->render('edit', array(\n\t\t\t'model' => $model\n\t\t));\n\t}", "public function updateProfile(UpdateProfileRequest $request)\n {\n Auth::user()->update($request->all());\n\n flashy()->mutedDark(\"修改资料成功\");\n\n return $this->redirectBack();\n }", "public function UpdateProfile(\n\t\t$id, $_nick, $_phone, $_age, $_address\n\t) {\n //Get Database\n $_database = $this->ConnectDatabase();\n //Create Data\n $_data = array($_nick, $_phone, $_age, $_address, $id);\n //Call and return Database Function\n return $this->CallDatabase(\n\t\t\t$_database, $_data, function($_pdo, $_parameters) {\n\t\t\t\t$set = \"\n\t\t\t\t\tnick_name = ?,\n\t\t\t\t\tphone = ?, \n\t\t\t\t\tage = ?,\n\t\t\t\t\thome_address = ?\n\t\t\t\t\";\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"\n\t\t\t\t\tUPDATE `Users`\n\t\t\t\t\tSET \" . $set . \"\n\t\t\t\t\tWHERE id = ?\n\t\t\t\t\");\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\t\t\t\t//Tratamento da resposta\n\t\t\t\tif (is_null($_query->errorInfo())) {\n\t\t\t\t\t$this->_response[\"status\"] = false;\n\t\t\t\t\t$this->_response[\"error\"] = $_query->errorInfo();\n\t\t\t\t} else {\n\t\t\t\t\t$this->_response[\"status\"] = true;\n\t\t\t\t}\n\t\t\t\treturn $this->_response;\n\t\t\t}\n );\n\t}", "function updateProfile($data) {\ntry {\n\n if (!$conn = connectDB()) {\n return false;\n }\n\n $userId = $_SESSION[\"userId\"];\n $args = array(\n $data[\"firstName\"], $data[\"lastName\"],\n $data[\"phone\"], $data[\"email\"], $data[\"location\"],\n $userId\n );\n\n $sql = <<<SQL\nUPDATE WebUser\nSET firstName=$1, lastName=$2,\n phonenumber=$3, emailaddress=$4, location=$5\nWHERE userId=$6\nSQL;\n\n $result = executeSQL($conn, $sql, $args);\n\n if (getUpdateCount($result) != 1) {\n /* Update was unsuccessful */\n closeDB($conn);\n return false;\n }\n\n /* Update succeeded */\n closeDB($conn);\n return true;\n\n} catch (Exception $e) {\n error(\"updateProfile\");\n closeDB($conn);\n return false;\n}\n}", "public function edit_user_details() {\n $this->check_auth();\n $update_data = array(\n 'email' => $this->input->post('email'),\n 'first_name' => $this->input->post('first_name'),\n 'prefix' => $this->input->post('prefix'),\n 'last_name' => $this->input->post('last_name'),\n );\n $this->load->helper('image_upload_helper');\n $cover_pic = do_image_upload(config_item('src_path_cover_images'), 10000, 500, 'image');\n $profile_pic = do_image_upload(config_item('src_path_profile_pictures'), 10000, 500, 'cover_image');\n if ($cover_pic) {\n if (isset($cover_pic['error'])) {\n return $this->send_error($cover_pic['error']);\n }\n $update_data['cover_image'] = $cover_pic[0];\n $update_data['image'] = $cover_pic[0];\n }\n if ($profile_pic) {\n if (isset($profile_pic['error'])) {\n return $this->send_error($profile_pic['error']);\n }\n $update_data['cover_image'] = $profile_pic[0];\n $update_data['image'] = $profile_pic[0];\n }\n if (!$this->db->where('id', $this->user_id)->update('users', $update_data)) {\n return $this->send_error('ERROR');\n }\n return $this->send_success();\n }", "public function update_profile_info($attributes) \n {\n $user_data = $this->user->get_user_by_id($attributes['user_id']);\n $message = \"\";\n try {\n \n $action = $attributes['action'];\n \n if($action == \"basic-info\") {\n $first_name = $this->_helper->nohtml($attributes['first_name']);\n $middle_name = $this->_helper->nohtml($attributes['middle_name']);\n $last_name = $this->_helper->nohtml($attributes['last_name']);\n \n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'first_name' => $first_name, \n 'last_name' => $middle_name\n ]);\n \n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'middlename' => $last_name\n ]);\n \n $message = $first_name.' '.$middle_name.' '.$last_name;\n } else if($action == \"update-bio\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'bio_info' => $this->_helper->breaklines_checkpoint($attributes['bio'], \"addbreaks\"), \n ]);\n \n $message = $this->_helper->breaklines_checkpoint($attributes['bio'], \"striped\");\n \n } else if($action == \"birthdate\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'birthyear' => $attributes['year'] \n ]);\n \n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'birthmonth' => $attributes['month'],\n 'birthday' => $attributes['day']\n ]);\n \n $message = config('helper.months')[$attributes['month']].' '.$attributes['day'].', '.$attributes['year'];\n \n } else if($action == \"location-info\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], [\n 'address' => $attributes['location'],\n ]);\n \n $message = $attributes['location'];\n \n } else if($action == \"gender-info\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'gender' => $attributes['gender'],\n 'gender_custom' => isset($attributes['custom-gender']) ? $attributes['custom-gender'] : \"\",\n ]);\n \n $message = $attributes['gender'] == \"N\" ? \"Others, {$attributes['custom-gender']}\" : ($attributes['gender'] == \"M\" ? \"Male\" : \"Female\");\n \n } else if($action == \"religion\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'religion' => $attributes['my-religion']\n ]);\n $message = $attributes['my-religion'];\n \n } else if($action == \"politics\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'politics' => $attributes['politics-view']\n ]);\n \n $message = $attributes['politics-view'];\n } else if($action == \"contact\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], [\n 'contact1' => $attributes['contact1']\n ]);\n \n $message = $attributes['contact1'];\n } else if($action == \"bloodtype\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'bloodtype' => $attributes['my-bloodtype']\n ]);\n \n $message = \"Bloodtype \".$attributes['my-bloodtype'];\n } else if($action == \"links\") {\n if($attributes['type'] == \"link1\") {\n $update = [\n 'webtitle1' => $attributes['linktitle'],\n 'weblink1' => $attributes['linkurl'],\n ];\n } else if($attributes['type'] == \"link2\") {\n $update = [\n 'webtitle2' => $attributes['linktitle'],\n 'weblink2' => $attributes['linkurl'],\n ];\n } else {\n $update = [\n 'webtitle3' => $attributes['linktitle'],\n 'weblink3' => $attributes['linkurl'],\n ];\n }\n \n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], $update);\n \n } else if($action == \"credentials\") {\n if($attributes['status'] == \"delete\") {\n if($attributes['type'] == \"work\") {\n $this->user->delete_user_info('userworkhistory', ['id' => $attributes['id']]);\n } else if($attributes['type'] == \"education\") {\n $this->user->delete_user_info('usereduccollege', ['id' => $attributes['id']]);\n } else {\n $this->user->delete_user_info('usergeneralinfo', ['id' => $attributes['id']]);\n }\n } else {\n if($attributes['type'] == \"work\") {\n $current = isset($attributes['is_current']) ? 0 : $attributes['yearended'];\n $this->user->update_user_info('userworkhistory', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'companyname' => $attributes['companyname'],\n 'position' => $attributes['position'],\n 'location' => $attributes['location'],\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n \n $message = !empty($attributes['position']) ? $attributes['position'] . \", \" : \"\"; \n $message .= $attributes['companyname'];\n $message .= !empty($attributes['position']) ? \", \".$attributes['location'] : \"\";\n \n } else if($attributes['type'] == \"education\") {\n $current = isset($attributes['is_graduated']) ? 0 : $attributes['yearended'];\n $this->user->update_user_info('usereduccollege', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'schoolname' => $attributes['schoolname'],\n 'course' => $attributes['course'],\n 'location' => \"\",\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n \n $message = !empty($attributes['course']) ? $attributes['course'] . \", \" : \"\"; \n $message .= $attributes['schoolname'];\n } else {\n $this->user->update_user_info('usergeneralinfo', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'general_info' => $attributes['general_info']\n ]);\n \n $message = $attributes['general_info'];\n }\n }\n } else if($action == \"contacts\") {\n if($attributes['status'] == \"delete\") {\n if($attributes['type'] == \"contact2\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], ['contact2' => '']);\n } else if($attributes['type'] == \"contact3\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], ['contact3' => '']);\n }\n } else {\n $contacts['contact1'] = $attributes['contact1'];\n if(isset($attributes['contact2']) && !empty($attributes['contact2'])) {\n $contacts['contact2'] = $attributes['contact2'];\n }\n if(isset($attributes['contact3']) && !empty($attributes['contact3'])) {\n $contacts['contact3'] = $attributes['contact3'];\n }\n \n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], $contacts);\n }\n \n $set = $this->user->get_user_by_where('usercontactinfo', ['user_id' => $attributes['user_id']]);\n if($set->count() > 0) {\n $_data = $set->first();\n $message = !empty($_data->contact1) ? $_data->contact1 .\" <br>\" : \"\";\n $message .= !empty($_data->contact2) ? $_data->contact2 .\" <br>\" : \"\";\n $message .= !empty($_data->contact3) ? $_data->contact3 .\" <br>\" : \"\";\n }\n } else if($action == \"set-credential-active\") {\n $this->user->update_user_info('usersettings', [\n 'user_id' => $attributes['user_id']\n ],[\n 'credential_type' => $attributes['type'],\n 'credential_refid' => $attributes['id']\n ]);\n }\n \n \n return [\n 'status' => true,\n 'message' => $message\n ];\n } catch (Exception $ex) {\n return [\n 'status' => false,\n 'message' => $ex->getMessage()\n ];\n }\n }", "public function editProfile(UpdateProfileRequest $request) {\n\n // Set $user = to the current user\n $user = Auth::user();\n\n // Access currently Authenticated user and update columns\n $user->update([\n 'first_name' => $request->input('first_name'),\n 'last_name' => $request->input('last_name'),\n 'country' => $request->input('country'),\n 'gender' => $request->input('gender'),\n 'age' => $request->input('age'),\n 'summary' => $request->input('summary'),\n ]);\n\n flash()->success('Амжилттай', 'Таны мэдээлэл амжилттай шинэчлэгдлээ!');\n\n // Then Redirect to Profile Edit Page\n return redirect()->route('profile.index', $user->username);\n }", "public function user_profile_update(UpdateProfileRequest $request) {\n $user = User::where('id', Auth::id())->first();\n $data = [];\n\n // Uploading User's documents\n if ($request->hasFile('id_front')) {\n $fileName = $this->fileNameGenerator($user, $request, 'id_front');\n $request->file('id_front')->storeAs('uploads/documents', $fileName);\n $data['id_front'] = $fileName;\n }\n if ($request->hasFile('id_back')) {\n $fileName = $this->fileNameGenerator($user, $request, 'id_back');\n $request->file('id_back')->storeAs('uploads/documents', $fileName);\n $data['id_back'] = $fileName;\n }\n if ($request->hasFile('passport')) {\n $fileName = $this->fileNameGenerator($user, $request, 'passport');\n $request->file('passport')->storeAs('uploads/documents', $fileName);\n $data['passport'] = $fileName;\n }\n\n $data['ssn'] = $request->ssn;\n $data['dob'] = $request->dob;\n $data['phone'] = $request->phone;\n\n // Update and send redirect with success message\n if ($user->update($data)) {\n return redirect()->back()->with('success', 'Profile updated successfully, account will be activated soon');\n }else {\n return redirect()->back()->with('fail', 'Error occured when updating profile');\n }\n\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update(Request $request, Profile $profile)\n {\n //\n }", "public function update_profile($username = \"\"){\n\t\t$userMapper = new App\\Mapper\\UserMapper();\n\t\t$applicantMapper = new App\\Mapper\\ApplicantMapper();\n\t\t$basicContactMapper = new App\\Mapper\\BasicContactMapper();\n\t\t$educAttainmentMapper = new App\\Mapper\\EducAttainmentMapper();\n\t\t$addressMapper = new App\\Mapper\\AddressMapper();\n\t\t$educationMapper = new App\\Mapper\\EducationMapper();\n\t\t$workExperienceMapper = new App\\Mapper\\WorkExperienceMapper();\n\t\t$applicantSkillMapper = new App\\Mapper\\ApplicantSkillMapper();\n\t\t$user = null;\n\t\t$applicant = null;\n\t\t// if($this->sess->isLogin()){\n\t\tif(!empty($username)){\n\t\t\t$user = $userMapper->getByFilter(array(\n\t\t\t\tarray(\n\t\t\t\t\t'column'=>'user_name'\n\t\t\t\t,\t'value'\t=>$username\n\t\t\t\t)\n\t\t\t), true);\n\t\t}\n\t\telse{\n\t\t\tif($this->sess->isLogin()){\n\t\t\t\t$user = $userMapper->getByFilter(array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'column'=>'user_id'\n\t\t\t\t\t,\t'value'\t=>$_SESSION['current_user']['id']\n\t\t\t\t\t)\n\t\t\t\t), true);\n\t\t\t}\n\t\t}\n\n\n\t\tif(!$user){\n\t\t\t$this->redirect($route['404_override']);\n\t\t}//Show 404;\n\n\t\t$applicant = $applicantMapper->getByFilter(\"applicant_user_id = '\". $user['user_id'].\"' \", true);\n\t\t$basicContact = $basicContactMapper->getByFilter(\"bc_id = '\".$applicant['applicant_bc_id'].\"'\", true);\n\t\t$educAttainment = $educAttainmentMapper->getByFilter(\"ea_id = '\".$applicant['applicant_ea_id'].\"'\", true);\n\t\t$presentAddress = $addressMapper->getCompleteAddressByID($applicant['applicant_present_id']);\n\t\t$permanentAddress = $addressMapper->getCompleteAddressByID($applicant['applicant_permanent_add_id']);\n\t\t$education = $educationMapper->getEducationTable($applicant['applicant_id']);\n\t\t$work = $workExperienceMapper->getWorkTable($applicant['applicant_id']);\n\t\t$applicantSkill = $applicantSkillMapper->getSkill($applicant['applicant_id']);\n\n\t\t$form_data = array(\n\t\t\t\t'applicant_username'\t=> $user['user_name']\n\t\t\t,\t'applicant_first_name' => $basicContact['bc_first_name']\n\t\t\t,\t'applicant_middle_name' => $basicContact['bc_middle_name']\n\t\t\t,\t'applicant_last_name' => $basicContact['bc_last_name']\n\t\t\t,\t'applicant_name_ext' => $basicContact['bc_name_ext']\n\t\t\t,\t'applicant_summary'\t=>\t$applicant['applicant_summary']\n\t\t\t,\t'present_add_desc' => $presentAddress['address_desc']\n\t\t\t,\t'present_add_country' => array(\n\t\t\t\t\t'country_id'\t=> $presentAddress['country_id']\n\t\t\t\t,\t'country_name'=> $presentAddress['country_name']\n\t\t\t\t)\n\t\t\t,\t'present_add_region' => array(\n\t\t\t\t\t'region_id'\t=> $presentAddress['region_id']\n\t\t\t\t,\t'region_code'=> $presentAddress['region_code']\n\t\t\t\t,\t'region_desc'=> $presentAddress['region_desc']\n\t\t\t\t)\n\t\t\t,\t'present_add_province' => array(\n\t\t\t\t\t'province_id'\t=> $presentAddress['province_id']\n\t\t\t\t,\t'province_name'=> $presentAddress['province_name']\n\t\t\t\t)\n\t\t\t,\t'present_add_city' => array(\n\t\t\t\t\t'city_id'\t=> $presentAddress['city_id']\n\t\t\t\t,\t'city_name'=> $presentAddress['city_name']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_desc' => $permanentAddress['address_desc']\n\t\t\t,\t'permanent_add_country' => array(\n\t\t\t\t'country_id'\t=> $permanentAddress['country_id']\n\t\t\t,\t'country_name'=> $permanentAddress['country_name']\n\t\t\t)\n\t\t\t,\t'permanent_add_region' => array(\n\t\t\t\t\t'region_id'\t=> $permanentAddress['region_id']\n\t\t\t\t,\t'region_code'=> $permanentAddress['region_code']\n\t\t\t\t,\t'region_desc'=> $permanentAddress['region_desc']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_province' => array(\n\t\t\t\t\t'province_id'\t=> $permanentAddress['province_id']\n\t\t\t\t,\t'province_name'=> $permanentAddress['province_name']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_city' => array(\n\t\t\t\t\t'city_id'\t=> $permanentAddress['city_id']\n\t\t\t\t,\t'city_name'=> $permanentAddress['city_name']\n\t\t\t\t)\n\t\t\t,\t'applicant_gender' => $basicContact['bc_gender']\n\t\t\t,\t'applicant_birthday' => $applicant['applicant_birthday']? date(\"m/d/Y\", strtotime($applicant['applicant_birthday'])) : ''\n\t\t\t,\t'applicant_civil_status' => $applicant['applicant_civil_status']\n\t\t\t,\t'applicant_nationality' => $applicant['applicant_nationality']\n\t\t\t,\t'applicant_religion' => $applicant['applicant_religion']\n\t\t\t,\t'applicant_weight' => $applicant['applicant_weight']\n\t\t\t,\t'applicant_height' => $applicant['applicant_height']\n\t\t\t,\t'applicant_emp_status' => $applicant['applicant_emp_status']\n\t\t\t,\t'applicant_preferred_occupation'=> $applicant['applicant_preferred_occupation']\n\t\t\t,\t'applicant_citizenship' => $applicant['applicant_citizenship']\n\t\t\t,\t'applicant_summary' => $applicant['applicant_summary']\n\t\t\t,\t'applicant_educ_attainment' => array(\n\t\t\t\t\t'ea_id'\t=> $educAttainment['ea_id']\n\t\t\t\t,\t'ea_name'=> $educAttainment['ea_name']\n\t\t\t\t)\n\t\t\t,\t'phone_number_1' => $basicContact['bc_phone_num1']\n\t\t\t,\t'phone_number_2' => $basicContact['bc_phone_num2']\n\t\t\t,\t'phone_number_3' => $basicContact['bc_phone_num3']\n\t\t\t,\t'education_table'=> $education\n\t\t\t,\t'work_table'=> $work\n\t\t\t,\t'skill_tag'=>$applicantSkill\n\t\t);\n\t\t$this->_data['form_data'] = $form_data;\n\n\t\t$this->is_secure = true;\n $this->view('applicant/update_profile');\n }", "public function edit_profile($username, $data) {\n\t\t$this->db->where('username', $username)\n\t\t\t\t ->update('user', $data);\n\t}", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "function updateMyProfile($data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE users SET `email`= ? WHERE id= ?\");\r\n $update->execute(array($data['email'], $this->user_id));\r\n\t\t$preparedProfileParam = prepareProfileParams($data);\r\n\t\tupdateProfileParameters($this->user_id,$preparedProfileParam);\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t\treturn true;\r\n\t}", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "public function edit_profile()\n\t{\n\t\tif(!$this->session->userdata('logged_in'))\n\t\t{\n\t\t\tredirect('/signin');\n\t\t\tdie();\n\t\t}\n\t\telse{\n\t\t\t$this->load->model('user');\n\t\t\t$user_info = $this->user->get_user_info($this->session->userdata('id'));\n\t\t\t$this->session->set_userdata('email',$user_info['email']);\n\t\t\t$this->session->set_userdata('first_name',$user_info['first_name']);\n\t\t\t$this->session->set_userdata('last_name',$user_info['last_name']);\n\t\t\t$this->load->view('navbar');\n\t\t\t$this->load->view('user_edit_profile');\n\t\t}\n\t}", "public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}", "public function update_my_profile($id = 0) {\n if (!empty($this->session->userdata('user_session'))) {\n $user_session = $this->session->userdata('user_session');\n $id = $user_session['user_id'];\n $user = $this->User_Model->get_user($id);\n if (!empty($user)) {\n $this->data['title'] = \"Update My Profile\";\n $user_type_list = $this->get_user_types();\n $this->data['user_type_list'] = $user_type_list;\n $this->data['user'] = $user;\n $employee_information = $this->Employee_Model->get_employee($user->employee_id);\n $this->data['employee_information'] = $employee_information;\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('user/update_my_profile', $this->data);\n } else {\n redirect(base_url('user'));\n }\n } else {\n redirect(base_url('user_login'));\n }\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function updateProfile()\n {\n $fname=Input::get(\"fname\");\n $lname=Input::get(\"lname\");\n $dob=Input::get(\"dob\");\n $contact=Input::get(\"contact\");\n $user=Auth::user();\n if($fname!=NULL && !empty($fname))\n {\n $user->fname=$fname;\n }\n\n if($lname!=NULL && !empty($lname))\n {\n $user->lname=$lname;\n\n }\n if($contact!=NULL && !empty($contact))\n {\n $user->contact=$contact;\n }\n\n\n\n if($dob!=NULL && !empty($dob))\n {\n $user->dob=$dob;\n }\n\n $user->save();\n echo '0';\n \n\n\n\n //\n }", "public function editAction()\n {\n $identity = Zend_Auth::getInstance()->getIdentity();\n $users = new Users_Model_User_Table();\n $row = $users->getById($identity->id);\n\n $form = new Users_Form_Users_Profile();\n $form->setUser($row);\n\n if ($this->_request->isPost()\n && $form->isValid($this->_getAllParams())) {\n\n $row->setFromArray($form->getValues());\n $row->save();\n\n $row->login(false);\n\n $this->_helper->flashMessenger('Profile Updated');\n $this->_helper->redirector('index');\n }\n $this->view->form = $form;\n }", "public function updateprofile()\n\t\t{\n\t\t\t$validator = Validator::make(Input::all(), User::$editrules);\n\t\t\tif(Auth::check()) {\n\t\t\t\t$usertoupdate = Auth::user();\n\t\t\t\t$usertoupdate->firstname = Input::get('firstname');\n\t\t\t\t$usertoupdate->lastname = Input::get('lastname');\n\t\t\t\t$usertoupdate->phone = Input::get('phone');\n\t\t\t\t$checkdbforusername = DB::table('users')->where('username', Input::get('username'))->pluck('username');\n\t\t\t\t$checkdbforemail = DB::table('users')->where('email', Input::get('email'))->pluck('email');\n\n\t\t\t\tif($validator->fails()) {\n\t\t\t\t\tSession::flash('errormessage', 'Sorry, some of your inputs are incorrect');\n\t\t\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t\t\t} else {\n\t\t\t\t\tif($checkdbforusername == null || $checkdbforusername == Auth::user()->username) {\n\t\t\t\t\t\tif($checkdbforemail == null || $checkdbforemail == Auth::user()->email) {\n\t\t\t\t\t\t\tif($checkdbforusername != Auth::user()->username) {\n\t\t\t\t\t\t\t\t$usertoupdate->username = Input::get('username');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($checkdbforemail != Auth::user()->email) {\n\t\t\t\t\t\t\t\t$usertoupdate->email = Input::get('email');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$usertoupdate->save();\n\t\t\t\t\t\t\tSession::forget('loggedinuser');\n\t\t\t\t\t\t\tSession::put('loggedinuser', $usertoupdate->username);\n\t\t\t\t\t\t\tSession::flash('successMessage', 'Profile successfully updated!');\n\t\t\t\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSession::flash('errorMessage', 'This email address is already taken');\n\t\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSession::flash('errorMessage', 'This username is already taken');\n\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function update_profile($firstname, $lastname, $email, $password, $session_id) {\n\t$user_id = get_user_id($session_id);\n\t\n\tif ($user_id) {\n\t\t$query = \"UPDATE \" . $GLOBALS['db_name'] . \".users SET firstname='$firstname', lastname='$lastname', password='$password', email='$email' WHERE user_id='$user_id' LIMIT 1\";\n\t\t//$result = $GLOBALS['db_connection'] -> query($query);\n\t\t\n\t\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\tdisplay_sql_error();\n\t\t}\n\t\t\n\t} else {\n\t\treturn \"Error: User not found.\";\n\t}\n}", "public function boutiqueProfileUpdate()\n\t{\n $data = array(\n\t\t\t'u_id' => $this->input->post('bid'),\n 'u_name' => $this->input->post('bname'),\n 'u_address' => $this->input->post('baddress'),\n 'mobile' => $this->input->post('mobile'),\n 'email' => $this->input->post('email'),\n 'password' => $this->input->post('password'),\n );\n if($this->AdminModel->boutiqueProfileUpdate($data))\n {\n echo \"no insert\";\n }\n else\n {\n $this->load->view('boutique_profile',$data);\n }\n\t}", "public function editAction()\n {\n $profileRepoFactory = new Application_Factory_ProfileRepository();\n $profileModelFactory = new Application_Factory_ProfileModel();\n $profileForm = new Application_Form_Profile(['id' => 'edit-profile']);\n\n $profileForm->submit->setLabel(\"Save\");\n $profileRepo = $profileRepoFactory->createService();\n\n $this->view->profileForm = $profileForm;\n\n //GET request handler\n $visitEditProfilePage = !$this->getRequest()->isPost();\n if ($visitEditProfilePage) {\n $profileId = (int) $this->getParam('id', 0);\n $profileEntity = $profileRepo->findById($profileId);\n $profileForm->bindFromProfile($profileEntity);\n return; //render edit profile form\n }\n\n //POST request handler\n $postInvalidProfile = !$profileForm->isValid($this->getRequest()->getPost());\n if ($postInvalidProfile) {\n return; //represent profile form with error messages\n }\n\n //Persit filtered profile to persistent\n $profileRepo->save($profileModelFactory->createService($profileForm->getValues()));\n $this->_helper->redirector('index', 'profile', 'default');\n }", "public function updateProfileFor($username, $updatedData)\n {\n $profile = User::whereUsername($username)->firstOrFail()->profile;\n $profile->fill($updatedData)->save();\n }", "public function updateProfile(AdminProfileRequest $request)\n\t{\n\t\t/**\n\t\t * Holds the authenticated admin instance\n\t\t *\n\t\t * @var \\Code\\Admin\\Model\\Admin\n\t\t */\n\t\t$admin = admin();\n\n\t\t$admin->name = $request->name;\n\t\t$admin->email = $request->email;\n\n\t\t/**\n\t\t * Update password only when admin has entered password. \n\t\t * Else ignore password updation.\n\t\t */\n\t\tif ($request->has('password')) {\n\t\t\t$admin->password = bcrypt($request->password);\n\t\t}\n\n\t\tif ($admin->save()) {\n\n\t\t\t$admin->image = request()->file('image')->store('admin/'. $admin->id. '/profile/');\n\t\t\t$admin->save();\n\t\t\tsuccess(\"Profile details updated successfully\");\n\t\t} else {\n\t\t\terror(\"Unable to update. Please try again.\");\n\t\t}\n\t\t\n\t\treturn redirect(route('admin.profile'));\n\t}", "public function profileEdit($id){\n $data = Owner::find($id);\n\n return view('adminlte::layouts.owner.updateProfil')->with('data',$data);\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function edit(Profile $profile)\n {\n //\n }", "public function actionEditProfile()\n {\n $model = Yii::$app->user->identity;\n\n if ($model->load(Yii::$app->request->post()))\n {\n $model->name = Yii::$app->request->post('User')['name'];\n $model->phone = Yii::$app->request->post('User')['phone'];\n $model->email = Yii::$app->request->post('User')['email'];\n $model->infected = Yii::$app->request->post('User')['infected'];\n $model->province = Yii::$app->request->post('User')['province'];\n\n if ($model->validate())\n {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'Perfil actulizado con éxito!');\n }\n\n else {\n Yii::$app->session->setFlash('error', 'Error con los datos introducidos: ' . HelperFunctions::errors($model));\n }\n\n return $this->refresh();\n }\n }\n return $this->render('edit-profile',['model' => $model]);\n }", "public function editProfile(array $changes);", "public function actionProfile(){\r\r\n\t\t$attributes = Yii::app()->portfolio->getAttributes(Yii::app()->user->id);\r\r\n\t\tif(isset($_POST['Attribute'])){\r\r\n\t\t\tYii::app()->portfolio->saveAttributes($_POST['Attribute']);\r\r\n\t\t}\r\r\n\t\t$this->render('profile',array('attributes'=>$attributes));\r\r\n\t}", "public function actionEdit()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t\t$profile=$model->profile;\r\n\t\t\r\n\t\t// ajax validator\r\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='profile-form')\r\n\t\t{\r\n\t\t\techo UActiveForm::validate(array($model,$profile));\r\n\t\t\tYii::app()->end();\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_POST['User']))\r\n\t\t{\r\n\t\t\t\r\n \r\n\t\t\t$model->attributes=$_POST['User'];\r\n\t\t\t$profile->attributes=$_POST['Profile'];\r\n\t\t\tif($model->validate()&&$profile->validate()) {\r\n\t\t\t\t$model->save();\r\n\t\t\t\t$profile->save();\r\n \r\n $usermodel= $this->Usermodel();\r\n if($usermodel)\r\n {\r\n if($usermodel==1)\r\n {\r\n $usr_model= Guardians::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email; \r\n $usr_model->save();\r\n }\r\n if($usermodel==2)\r\n {\r\n $usr_model= Students::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email=$model->email;\r\n $usr_model->save();\r\n }\r\n if($usermodel==3)\r\n {\r\n $usr_model= Employees::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email;\r\n $usr_model->save();\r\n }\r\n }\r\n \r\n //Yii::app()->user->updateSession();\r\n\t\t\t\tYii::app()->user->setFlash('profileMessage',Yii::t('app',\"Changes is saved.\"));\r\n\t\t\t\t$this->redirect(array('/user/accountProfile'));\r\n\t\t\t} else $profile->validate();\r\n\t\t}\r\n\r\n\t\t$this->render('edit',array(\r\n\t\t\t'model'=>$model,\r\n\t\t\t'profile'=>$profile,\r\n\t\t));\r\n\t}", "public function updateProfileExpert($profile_id, ProfileUpdation $request)\n {\n $this->repo->updateProfileExpert($profile_id, $request);\n\n Session::flash('flash_message', 'Profile was updated successfully');\n return redirect()->back();\n }", "public function update(ProfileUpdateRequest $request)\n {\n // update the profile of current user\n $user = Auth::user();\n $user->update($request->except('email'));\n //Set users locale in a ciikie \n Cookie::queue('lang', $user->lang, 2628000);\n // Return Back to the page\n return back();\n }", "public function profile_update(Request $request)\n {\n if(Setting::get('demo_mode', 0) == 1) {\n return back()->with('flash_error', 'Disabled for demo purposes! Please contact us at [email protected]');\n }\n\n $this->validate($request,[\n 'name' => 'required|max:255',\n 'mobile' => 'required|digits_between:6,13',\n ]);\n\n try{\n $account = Auth::guard('account')->user();\n $account->name = $request->name;\n $account->mobile = $request->mobile;\n $account->save();\n\n return redirect()->back()->with('flash_success','Profile Updated');\n }\n\n catch (Exception $e) {\n return back()->with('flash_error','Something Went Wrong!');\n }\n \n }", "function editProfile(){\n\n $this->check_admin_ajax_auth();\n $userData = get_admin_session_data();\n //pr($userData);\n $this->form_validation->set_rules('name', 'Name', 'trim|required|min_length[2]|max_length[20]');\n\n if($this->form_validation->run() == FALSE){ \n $response = array('status' => 0, 'message' => validation_errors()); //error msg\n echo json_encode($response); die;\n }\n if(!empty($_FILES['profileImage']['name'])){\n //if image not empty set it for store image \n $upload = $this->image_model->upload_image('profileImage', 'profile');\n //check for error\n if(!empty($upload['error']) && array_key_exists(\"error\", $upload)){\n $response = array('status' => 0, 'message' =>strip_tags($upload['error']));\n echo json_encode($response); die;\n }\n $data['profileImage'] = $upload;\n }\n if(!empty($this->input->post('name')))\n $data['fullName'] = sanitize_input_text($this->input->post('name'));\n $update = $this->common_model->updateFields(USERS, $data, array('id' => $userData['userId']));\n $where_in = array('id' => $userData['userId']);\n $updated_session = $this->common_model->getsingle(USERS,$where_in);\n $_SESSION[ADMIN_USER_SESS_KEY]['name'] = $updated_session->fullName ;\n $_SESSION[ADMIN_USER_SESS_KEY]['image'] = $updated_session->profileImage ;\n $response = array('status' => 1,'message' =>'Your profile updated successfully', 'url' => base_url('admin/adminProfile')); \n \n echo json_encode($response);\n }", "public function update_user_profile_info($user_id,$data)\n\t{\n\t\treturn $this->ci->profile_model->update_user_profile_info($user_id,$data);\n\t}", "public function postProfile() {\n $this->_adminUserRepository->updateProfile ( $this->auth->user ()->id );\n return redirect ( 'users/profile' )->withSuccess ( trans ( 'user::adminuser.profile.success' ) );\n }", "public function updateProfile(Request $request) {\n //$id = 1;\n $UserId = $request->session()->get('userData');\n $id = $UserId->id;\n $users = DB::table('tbl_adminuser')->where('id', $id)->update([\n 'first_name' => $request->get('firstname'),\n 'last_name' => $request->get('last_name'),\n 'email_address' => $request->get('email_address'),\n 'status' => $request->get('status'),\n 'updatedDate' => date('Y-m-d H:i:s')\n ]);\n return redirect('admin/viewProfile');\n }", "public function updateProfileInvestor($profile_id, ProfileUpdation $request)\n {\n $this->repo->updateProfileInvestor($profile_id, $request);\n\n Session::flash('flash_message', 'Profile was updated successfully');\n return redirect()->back();\n\n }", "public function webeditprofile($user_id,$data)\n {\n \n $editprofile = DB::table('users')->where('id',$user_id)->update($data);\n return redirect('myprofile');\n\n }", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }", "public function update_simple($f3) {\n \n if(!isset($_POST[\"password\"]))\n {\n LoggingUtility::LogActivity(\"Updated his own profile settings\",json_encode($f3->get('POST') ));\n }\n else\n {\n LoggingUtility::LogActivity(\"Updated his own password\");\n }\n\n $user = new User($f3->get('DB'));\n $user->edit($f3->get('POST.id'));\n \n if ($user->isFirstLogin()) {\n $f3->reroute('/');\n } else {\n $f3->reroute('/section/settings.profile');\n }\n }", "public function edit_profile()\n {\n //check login\n if(!$this->session->userdata('logged_in'))\n {\n //redirect page to users/login\n redirect('users/login');\n }\n $data['user']= $this->user_model->get_user();\n $data['title'] = 'Edit Profile';\n $data['pinn'] = $this->note_model->get_pin();\n $this->load->view('includes/header', $data);\n $this->load->view('users/edit_profile', $data);\n $this->load->view('includes/footer');\n }" ]
[ "0.79959995", "0.78768885", "0.78744245", "0.78582823", "0.7818324", "0.78021747", "0.7729341", "0.76943904", "0.7658796", "0.7656472", "0.7635972", "0.7583608", "0.73809546", "0.73766375", "0.7359741", "0.73075116", "0.7300508", "0.72962177", "0.7291092", "0.7281501", "0.7267348", "0.7252705", "0.7250787", "0.72032547", "0.7198295", "0.7179068", "0.7159702", "0.715483", "0.71360517", "0.711145", "0.7091424", "0.7069616", "0.7067781", "0.7056909", "0.70473236", "0.7044058", "0.704162", "0.7018323", "0.70165247", "0.7014307", "0.7011229", "0.69936484", "0.6987022", "0.6979222", "0.69698626", "0.6949365", "0.693841", "0.69348496", "0.6934431", "0.6923251", "0.69177645", "0.6917015", "0.6917015", "0.6917015", "0.6917015", "0.6917015", "0.6917015", "0.6916828", "0.6901552", "0.68894047", "0.6880037", "0.6878924", "0.686807", "0.686669", "0.6864111", "0.68630224", "0.68568754", "0.68510675", "0.68461627", "0.68051934", "0.6794337", "0.6790798", "0.6786597", "0.67747235", "0.67716324", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.67686474", "0.6766087", "0.6764131", "0.67516524", "0.6747345", "0.6739383", "0.6735223", "0.67263925", "0.67231923", "0.6722894", "0.6710106", "0.6707329", "0.6705029", "0.6700906", "0.6691052", "0.6690661", "0.6689963" ]
0.73338675
15
/ Returns the id of the game a user is in, or NOT_IN_GAME.
function getGameOf($userId) { $sql = "select game_id from users where id = $userId"; $result = SQLGetChamp($sql); if ($result == 0) { $result = NOT_IN_GAME; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGameId(){\n\t\treturn $this->gameId;\n\t}", "public function getGameId(): int\n {\n return $this->gameId;\n }", "public function getInGame() : int {\n\t\treturn $this->generator->getInGame();\n\t}", "public function getId() {\r\n\r\n return $this->getGameManager()->getGameId($this);\r\n\r\n }", "function deduce_game_id($game) {\n if(is_array($game))\n if(isSet($game['gra']))\n $game = isSet($game['gra']['id_gry']) ? $game['gra']['id_gry'] : null;\n else\n $game = isSet($game['id_gry']) ? $game['id_gry'] : null;\n\n return $game;\n}", "private function getGame() {\n if (!isset($this->params['game'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n\n $key = $this->params['game'];\n $game = new SnGames();\n\t\t$url = Url::getUrlByName($key, URL_GAME);\n\n\t\tif ($url) {\n\t\t\t$game->ID_GAME = $url->ID_OWNER;\n\t\t} else {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn FALSE;\n\t\t}\n\n $game = $game->getOne();\n\n return $game;\n }", "private function findGame($id) {\n $game = null;\n foreach($this->getGames() as $currentGame) {\n if($currentGame->getAppId() == $id ||\n $currentGame->getShortName() == $id ||\n $currentGame->getName() == $id) {\n $game = $currentGame;\n break;\n }\n }\n\n if($game == null) {\n if(is_int($id)) {\n $message = \"This SteamID does not own a game with application ID {$id}.\";\n } else {\n $message = \"This SteamID does not own the game \\\"{$id}\\\".\";\n }\n throw new SteamCondenserException($message);\n }\n\n return $game;\n }", "public function getGameIds() {\n if (empty($this->gameIds)) {\n foreach ($this->getTournaments() as $tourney) {\n $this->gameIds = array_merge($this->gameIds, $tourney->getGameIds());\n }\n\n }\n return $this->gameIds;\n }", "function getIdForPlayer ($login) {\n\tglobal $bdd;\n\t$player_id = false;\n\t$req = $bdd->prepare('\n\t\tSELECT id_joueur\n\t\tFROM joueurs\n\t\tWHERE login = :login;\n\t');\n\t$req->execute(array('login' => $login));\n\tif ($row = $req->fetch()) {\n\t\t$player_id = $row['id_joueur'];\n\t}\n\treturn $player_id;\n}", "function playerIsGM($gameID, $playerName)\n{\n $dbh = connectToDatabase();\n $stmt = $dbh->prepare('SELECT gmName FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n $isGM = $result[0] === $playerName;\n\n return $isGM;\n}", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "function loggedInUserId() {\n\n\tif (isLoggedIn()) {\n\t\t$username = $_SESSION['username'];\n\t\t$result = queryDb(\"SELECT * FROM users WHERE username = '{$username}'\");\n\t\tconfirm($result);\n\t\t$user = mysqli_fetch_array($result);\n\t\treturn mysqli_num_rows($result) > 0 ? $user['user_id'] : false;\n\t}\n\n\treturn false;\n}", "public function getCurrentGame() {\n\t\t// $stmt = $this->dbh->prepare($sql);\n\t\t// $this->dbo->execute($stmt,array());\t\n\n\t\t// if ($stmt->rowCount() >= 1)\n\t\t// {\t\n\t\t// \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t// \treturn $result[0];\n\t\t// } else {\n\t\t// \treturn false;\n\t\t// }\t\n\t }", "function getPositionFromPlayerId($gameId, $playerId){\n $conn = getDB();\n $sql = \"SELECT player1id, player2id, player3id FROM games WHERE id=\".$gameId;\n $r = $conn->query($sql);\n if($r->num_rows == 0)\n return false;\n \n $result = $r->fetch_assoc();\n closeDB($conn);\n \n if($result['player1id'] == $playerId){\n return 1;\n } elseif ($result['player2id'] == $playerId){\n return 2;\n } elseif ($result['player3id'] == $playerId){\n return 3;\n }\n return false;\n}", "public static function addGameUserOnly() {\n\t\t$accountId = parent::get_user_logged_in()->id;\n\t\tif (isset($_POST['list'])) {\n\t\t\t$gameId = $_POST['list'];\n\t\t} else {\n\t\t\tRedirect::to('/addGame', array('errors' => array('nothing selected')));\n\t\t}\n\n\t\tif (!Account_game::checkIfAccountOwnsGame($accountId, $gameId)) {\n\t\t\t$accountGame = new Account_game(array(\n\t\t\t\t'accountId' => $accountId,\n\t\t\t\t'gameId' => $gameId\n\t\t\t));\n\t\t\t$accountGame->save();\n\t\t\tRedirect::to('/addGame', array('messages' => array('game added to your account')));\n\t\t} else if (Game::getGame($gameId) == null) {\n\t\t\t$errors = array(\"game doesn't exist\");\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t} else {\n\t\t\t$errors = array('you already own that game');\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t}\n\t}", "public function getUserId() {\n\t\tif ($this->logged()) {\n\t\t\treturn $_SESSION['auth']['id'];\n\t\t}\n\t\treturn false;\n\t}", "static public function getUserId(){\n if (!isset($_SESSION['id']) || empty($_SESSION['id']) ){\n return false;\n } else {\n return $_SESSION['id'];\n }\n }", "function getPlayerId($login, $forcequery = false) {\n\n\t\tif (isset($this->server->players->player_list[$login]) &&\n\t\t $this->server->players->player_list[$login]->id > 0 && !$forcequery) {\n\t\t\t$rtn = $this->server->players->player_list[$login]->id;\n\t\t} else {\n\t\t\t$query = 'SELECT Id FROM players\n\t\t\t WHERE Login=' . quotedString($login);\n\t\t\t$result = mysql_query($query);\n\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t$row = mysql_fetch_row($result);\n\t\t\t\t$rtn = $row[0];\n\t\t\t} else {\n\t\t\t\t$rtn = 0;\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t}\n\t\treturn $rtn;\n\t}", "public function getBattleUserId()\n {\n return $this->get(self::_BATTLE_USER_ID);\n }", "function get_user_id() {\n\tif (!empty($_SESSION['user_id'])) {\n\t\treturn (int) $_SESSION['user_id'];\n\t} else {\n\t\treturn false;\n\t}\n}", "function xstats_getShipOwnerIdAtTurn( $gameId, $shipId, $turn ) {\n $query = \"SELECT ownerid FROM skrupel_xstats_shipowner WHERE gameid=\".$gameId.\" AND shipid=\".$shipId.\" AND turn=\".$turn;\n $result = @mysql_query($query) or die(mysql_error());\n if( mysql_num_rows($result)>0 ) {\n $result = @mysql_fetch_array($result);\n return( $result['ownerid']);\n }\n}", "public function isInGame() {\n return $this->onlineState == 'in-game';\n }", "function joinGame($game, $me) {\n\t$games = getGames();\n\tif (isset($_SESSION['gameid']) and\n\t isset($games[$_SESSION['gameid']]) and\n\t $games[$_SESSION['gameid']]['state'] != 'closed') {\n\t\treturn error('You are still in an active game');\n\t}\n\n\t$games[$game]['players'][] = $me;\n\tif (sizeof($games[$game]['players']) == 2) {\n\t\t$games[$game]['state'] = 'playing';\n\t}\n\t$_SESSION['gameid'] = $game;\n\n\treturn writeGames($games);\n}", "public function getLoggedUserId()\n {\n if (isset($this->user_data['id_user'])) {\n return intval($this->user_data['id_user']);\n } else {\n return false;\n }\n }", "public function getLoggedInUserClassId() {\n if (null==getLoggedInUserId())\n return -1;\n $loggedInUser=$this->getPersonLogedOn();\n if ($loggedInUser!=null && isset($loggedInUser[\"classID\"]))\n return intval($loggedInUser[\"classID\"]);\n\n return -1;\n }", "public static function getIdFromSession()\n\t{\n\n\t\treturn $_SESSION[User::SESSION]['iduser'];\t\t\n\n\t}", "function getOpenGame() {\n\t$games = getGames();\n\tif (isset($games['open']) and $games[$games['open']]['state'] == 'open') {\n\t\treturn $games['open'];\n\t} else {\n\t\treturn newGame();\n\t}\n}", "public static function current_games( $db = 0 )\n\t{\n\t\tif( !$db )\n\t\t{\n\t\t\t$db = REGISTRY::get( \"db\" );\n\t\t}\n\t\t\n\t\t$sth = $db->prepare( \"\n\t\t\tSELECT \tid\n\t\t\tFROM \tgames\n\t\t\tWHERE\tstart_date < CURRENT_TIMESTAMP()\n\t\t\tAND\tend_date > CURRENT_TIMESTAMP()\n\t\t\" );\n\t\t\n\t\t$sth->execute();\n\t\t\n\t\tif( $sth->rowCount() > 0 )\n\t\t{\n\t\t\treturn $sth->fetchAll( PDO::FETCH_COLUMN, 0 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public static function getId() {\n return (int)$_SESSION['user']['id'];\n }", "public function user_id()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_facebook->getUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->login_url();\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getLoggedInId()\n{\n\tif(isLoggedIn()) {\n\t\treturn auth()->user()->id;\n\t}\n\treturn null;\n}", "public function getGamerId()\n {\n $value = $this->get(self::GAMER_ID);\n return $value === null ? (integer)$value : $value;\n }", "public static function get_current_user_id() {\n\n if( is_user_logged_in() ) {\n return get_current_user_id();\n }\n\n return false;\n }", "public static function getUserId()\n {\n // sfGuardPlugin detection and guard user id retrieval\n $session = sfContext::getInstance()->getUser();\n if (class_exists('sfGuardSecurityUser') && $session instanceof sfGuardSecurityUser && method_exists($session, 'getGuardUser'))\n {\n $guard_user = $session->getGuardUser();\n if (!is_null($guard_user))\n {\n $guard_user_id = $guard_user->getId();\n if (!is_null($guard_user_id))\n {\n return $guard_user_id;\n }\n }\n }\n\t\treturn null;\n\t}", "public function get_user_id();", "function joinGame($userId, $gameId) {\n\t$oldGameId = getGameOf($userId);\n\n\tif ($oldGameId != NOT_IN_GAME) {\n\t\treturn false;\n\t}\n\n\t$sql = \"update users set game_id = $gameId where id = $userId\";\n\tSQLUpdate($sql);\n\n\tdistributeInitialCards($userId);\n\n\treturn true;\n}", "private function getGroupID(){\n\n\t global $db;\n\t \n\t #set to 0, guest has no group setup.\n\t\tif($this->user == \"guest\"){\n\t\t $getGID = 0;\n\t\t return($getGID);\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT gid FROM ebb_group_users WHERE Username='\".$this->user.\"' AND Status='Active' LIMIT 1\";\n\t\t\t$getGID = $db->fetchResults();\n\n\t\t\treturn($getGID['gid']);\n\t\t}\n\t}", "public static function getCurrentUserId(){\n $user_data = parent::getSession('curent_user');\n $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null;\n $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null;\n return\n self::is_SuperUserSession()\n ? ($_post_id_user ? $_post_id_user : ( $_get_id_user ? $_get_id_user : $user_data['id_user'] ))\n : parent::getSession('id_user');\n }", "public function getPlayerNumber($game){\n return DB::table('players')->where(['game_id' => $game->id])->count();\n }", "public function getGame()\n {\n return $this->game;\n }", "function getUserID(){\n\n\tif( isset($_SESSION['uid'])){\t\n\t\t$id = $_SESSION['uid'];\n\t}else{\n\t\t$id = \"Unregistered\";\n\t}\n\n\treturn $id;\n}", "public function getPrivateGameState($gameId, $playerId);", "function get_user_id_on_fangate(){\n\tglobal $gianism;\n\treturn $gianism->fb->is_registered_user_on_fangate();\n}", "public function getGame() {\n return $this->game;\n }", "public function getUserId()\n {\n if ($this->validateUser()) {\n return $this->user->getId();\n }\n\n return false;\n }", "public function user_id()\n {\n if($this->logged_in())\n {\n $this->uid = $this->fb->getUser();\n\n return $this->uid;\n } \n else \n {\n return FALSE;\n }\n }", "function getSession(){\n\t\t$roomid = (int)$_POST['roomid'];\n\t\tif($roomid < 0){ throw new Exception('Invalid player');}\n\t\tglobal $db;\n\t\t$q = $db -> prepare(\"SELECT sessionid FROM game WHERE roomid = ? LIMIT 1\");\n\t\t$q->execute(array($roomid));\n\t\t$r = $q->fetch();\n\t\t// Return current game session\n\t\treturn $r;\n\t}", "public function getById(Uuid $gameId): Game;", "protected function _getLogedUserId()\r\n\t{\r\n\t\t// check if user is authenticated\r\n\t\tif (!Zend_Registry::get('Authenticated')) {\r\n\t\t\tthrow new Exception('User not authenticated!');\r\n\t\t}\r\n\t\t$user = Zend_Registry::get('User');\r\n\t\treturn $user->Id;\r\n\t}", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "public function id() {\n return $this->Session->read('Authorization.Team.0.id');\n }", "public static function getGiftByGameId($game_id) {\n\t\tif (!intval($game_id)) return false;\n\t\treturn self::_getDao()->getBy(array('game_id'=>intval($game_id)));\n\t}", "function getGame($id) {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games WHERE id = :id\");\n $query->bindParam(\":id\", $id);\n $query->execute();\n\n return $query->fetch();\n }", "public function getCurrentOrganizationId()\n {\n $orgId = $this->_getVar('user_organization_id');\n\n //If not set, read it from the cookie\n if ($this->isCurrentUser() && ((null === $orgId) || (\\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {\n $request = $this->getRequest();\n if ($request) {\n $orgId = \\Gems_Cookies::getOrganization($this->getRequest());\n }\n if (! $orgId) {\n $orgId = 0;\n }\n $this->_setVar('user_organization_id', $orgId);\n }\n return $orgId;\n }", "function getUserId(){\n if(empty($_COOKIE['heyo'])) return false;\n \n $userIdResult = $this->sql->prepare('SELECT userId FROM user_logins WHERE cookie = ? AND loggedIn = TRUE AND dateLogged > ? LIMIT 1')->bindString($_COOKIE['heyo'])->bindString($this->loginMaxAge)->execute()->getResult();\n \n if(!$userIdResult->num_rows) return false;\n \n return $userIdResult->fetch_assoc()['userId'];\n }", "function addUserToGame($userId,$gameId){\r\n\t\t$SQLerror = '';\r\n\t\t$currentDate = date(\"Y\\-m\\-d\");\r\n\t\t$queryCheckIfExists = \"SELECT * FROM gameMembers WHERE userId=\".$userId.\" AND gameId=\".$gameId;\r\n\t\t\r\n\t\t// return if user is already member of that game\r\n\t\tmysql_query($queryCheckIfExists) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\tif($SQLerror!='')\r\n\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\t\t\r\n\r\n\t\tif(mysql_affected_rows() > 0)\r\n\t\t\treturn \"true\";\r\n\t\telse {\r\n\t\t\t// Continue if user is not a member of that game\r\n\t\t\t$query = \"INSERT INTO gameMembers (gameId,userId,joined)\".\r\n\t\t\t\t\t\t\"VALUES ('\".$gameId.\"','\" .$userId. \"','\" .$currentDate.\"')\";\r\n\r\n\t\t\t$result = mysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\t\t\tif($SQLerror!='')\r\n\t\t\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\t\t\r\n\r\n\t\t\tif(mysql_affected_rows() == 1)\r\n\t\t\t\treturn \"true\";\r\n\t\t\telse\r\n\t\t\t\treturn \"false\";\r\n\t\t}\r\n\t}", "public function getOppoUserid()\n {\n return $this->get(self::_OPPO_USERID);\n }", "private function exit_user_from_game() {\n //increments the user account_balance, since the amount was already deducted at game start\n $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) + {$this->amount} WHERE user_id = '{$this->userID}'\");\n\n /*This gets the user current game details*/\n $this->userCurrentGameDetail = $this->fetch_data_from_table($this->games_table_name, 'game_id', $this->user_details[\"game_id_about_to_play\"])[0];\n\n /* Gets the number of players in the game */\n $number_of_players = (int)$this->userCurrentGameDetail[\"number_of_players\"];\n\n /* the new number of players will now be the previous number of players - 1*/\n $new_number_of_players = $number_of_players - 1;\n /* if the new number of players is equal to 0; meaning that he is the only one about to play; the entire game details will be deleted from the database*/\n if($new_number_of_players == 0){ $this->delete_record($this->games_table_name , \"game_id\" , $this->user_details[\"game_id_about_to_play\"] ); return true;}\n /* else set the new number of players to the one above */\n $this->update_record($this->games_table_name , \"number_of_players\" , $new_number_of_players , 'game_id' , $this->userCurrentGameDetail[\"game_id\"]);\n /* delete the game id from the user detail to avoid deduction from the when the game starts */\n $this->update_record($this->users_table_name , \"game_id_about_to_play\" , \"0\" , 'user_id' , $this->userID);\n /* finally return true */\n return true;\n }", "public function get_id()\n {\n\n $user_type = $this->isStaff ? \"staff\" : \"user\";\n\n return $this->database->get($user_type,'id',['user_url' => $this->username]);\n\n }", "function CheckDisponiblityGame($IdJoinGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT MaxPlayersGame, (SELECT COUNT(fkGamePlace) FROM fishermenland.place WHERE fkGamePlace = '$IdJoinGame') as UsedPlaces FROM fishermenland.game WHERE idGame = '$IdJoinGame'\");\n $reqArray = $req->fetch();\n\n return $reqArray;\n}", "protected function _getLoggedInMemberId() {\n\t\tController::loadModel('Member');\n\t\treturn $this->Member->getIdForMember($this->Auth->user());\n\t}", "public function getuserid(){\n // SQL statement\n $sql = \"SELECT user_id FROM user WHERE user_name = '\".$_SESSION['user'].\"'\";\n $value = $this->con->query($sql);\n $value = $value->fetch_assoc();\n return $value['user_id'];\n }", "public function game()\n {\n return $this->game;\n }", "public function findPlayer($user_id, $game_id)\n {\n $result = Player::where(['game_id' => $game_id, 'user_id' => $user_id])->count();\n\n if($result == 0){\n return false;\n }else{\n return true;\n }\n }", "function get_current_user_id()\n {\n }", "public function get_user_id() {\n if (!empty($this->userid)) {\n return $this->userid;\n }\n\n global $SESSION, $USER;\n\n if (!empty($SESSION->homeworkblockuser)) {\n return $SESSION->homeworkblockuser;\n }\n\n $mode = $this->get_mode();\n\n if ($mode == 'parent') {\n\n // In parent mode, but no child is selected so select the first child.\n $children = $this->get_users_children($USER->id);\n $child = reset($children);\n $SESSION->homeworkblockuser = $child->userid;\n return $child->userid;\n } else {\n return $USER->id;\n }\n }", "public function findByGameId($gameId) {\n// if (!$this->user) {\n// throw new \\Exception('You did not set the user');\n// }\n $user = $this->user;\n $qb = $this->createQueryBuilder('d')\n ->where(\"d.gameId = :gameId\")\n ->setParameter('gameId', $gameId);\n if ($user) {\n $qb->andWhere(\"d.user = :user\")\n ->setParameter('user', $user);\n }\n return $qb->getQuery()->getResult();\n }", "public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}", "public function getPlayertype() {\n $objUser = App_Factory_Security::getSecurity()->getObjuser();\n \n if(!($objUser instanceof App_Data_User)) {\n return false;\n }\n \n if($this->getlngPlayer1() === $objUser->getUID()) {\n return 1;\n } else if($this->getlngPlayer2() === $objUser->getUID()) {\n return 2;\n }\n \n return false;\n }", "public function getId()\n {\n return isset($this->sessionStorage->user['id']) ? (int) $this->sessionStorage->user['id'] : 0;\n }", "public function get_logged_in_user_id()\n\t\t{\n\t\t\treturn $this->session->userdata('usr_id');\n\t\t}", "public function getTeamId()\n {\n return $this->get(self::_TEAM_ID);\n }", "function getPlayerIdFromPosition($gameId, $position){\n $conn = getDB();\n $sql = \"SELECT player\".$position.\"id FROM games WHERE id=\".$gameId;\n $result = $conn->query($sql);\n if($result->num_rows !== 0){\n $result = array_values($result->fetch_assoc());\n closeDB($conn);\n return $result[0];\n }else{\n closeDB($conn);\n return 0;\n }\n}", "public function getGame($id)\n {\n $games_list = $this->getGamesList();\n foreach ($games_list as $key => $value) {\n if ($value->id == $id)\n return $value;\n }\n }", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "function GID($in_id, $in_db){\n\tglobal $knj_web;\n\t\n\tif ($knj_web[\"dbconn\"]){\n\t\treturn $knj_web[\"dbconn\"]->selectsingle($in_db, array($knj_web[\"col_id_name\"] => $in_id));\n\t}else{\n\t\t$sql = \"SELECT * FROM \" . $in_db . \" WHERE \" . $knj_web[\"col_id_name\"] . \" = '\" . sql($in_id) . \"' LIMIT 1\";\n\t\t$f_gid = mysql_query($sql) or die(\"MySQL-error: \" . mysql_error() . \"\\nSQL: \" . $sql);\n\t\t$d_gid = mysql_fetch_array($f_gid);\n\t}\n\t\n\treturn $d_gid;\n}", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "private function getUserId()\n {\n $company = $this->getCompany();\n\n if (!isset($company['user']['id'])) {\n throw new BiglionException('User \"id\" not defined', 1);\n }\n\n return $company['user']['id'];\n }", "function is_logged_in()\n {\n //check session\n //return logged in user_id or false\n }", "public static function idUsuario()\r\n { \r\n if(isset($_SESSION['jn']['ux'])){\r\n $idu=(int)_Crifrado::desencriptar($_SESSION['jn']['ux'],'ux');\r\n if($idu>0)\r\n return $idu;\r\n else\r\n return 0; \r\n }else{\r\n return 0;\r\n }\r\n }", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "function getWGId($idUser, $idEvent){\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n SELECT WorkingGroups_has_Events.workinggroups_idWorkingGroups FROM bdd_satisfevent.WorkingGroups_has_Events\n INNER JOIN users_has_workinggroups ON users_has_workinggroups.workinggroups_idWorkingGroups = workinggroups_has_events.workinggroups_idWorkingGroups\n WHERE users_idUsers = ?\n AND events_idEvents = ?');\n $request->execute(array($idUser, $idEvent));\n $result = $request->fetchAll();\n return $result[0]['workinggroups_idWorkingGroups'];\n}", "public function IsPlayingSharedGame($appIdPlaying)\n {\n $this->setApiDetails(__FUNCTION__, 'v0001');\n\n // Set up the arguments\n $arguments = [\n 'steamId' => $this->steamId,\n 'appid_playing' => $appIdPlaying,\n ];\n\n // Get the client\n $client = $this->getServiceResponse($arguments);\n\n return $client->lender_steamid;\n }", "public function show(Game $game, $id)\n {\n $game = Game::findOrFail($id);\n $participants = $game->participants;\n foreach ($participants as $participant) {\n if ($participant->user->id == Auth::id()) {\n return view('game')->with('currentGame', $game);\n }\n }\n return redirect()->route('game.join', ['id' => $id]);\n }", "function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}", "function player2id($player){\n\t\tswitch($player){\n\t\t\tcase 'north':\n\t\t\t\t$playerid = 0;\n\t\t\t\tbreak;\n\t\t\tcase 'south':\n\t\t\t\t$playerid = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'east':\n\t\t\t\t$playerid = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'west':\n\t\t\t\t$playerid = 3;\n\t\t\t\tbreak;\n\t\t\tdefault: throw new Exception('Invalid player');\n\t\t}\n\t\treturn $playerid;\n\t}", "public static function getLoggedInUserId(): ?int\n {\n // Check whether user is logged in\n if (!self::loggedIn()) {\n return null;\n }\n // If loggedIn return ID\n return self::getUser()->id;\n }", "public function FindById($gid, $time)\n {\n $guessArr = $this->db->fetchAssoc('SELECT * FROM guess WHERE game_id = :game and timestamp = :time', array(\n 'game' => (int) $gid,\n 'time' => $time));\n return $this->returnGuess($guessArr);\n }", "function getLoginForPlayer ($id_joueur) {\n\tglobal $bdd;\n\t$player_login = false;\n\t$req = $bdd->prepare('\n\t\tSELECT login\n\t\tFROM joueurs\n\t\tWHERE id_joueur = :id_joueur;\n\t');\n\t$req->execute(array('id_joueur' => $id_joueur));\n\tif ($row = $req->fetch()) {\n\t\t$player_login = $row['login'];\n\t}\n\treturn $player_login;\n}", "function user_getgroup()\n\t{\n\t\t$id = $this->user_getid();\n\t\t$perms = $this->DB->database_select('users', 'gid', array('uid' => $id), 1);\n\t\treturn ($perms === false) ? false : $perms['gid'];\n\t}", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "function labdevs_get_user_current_id()\n{\n global $current_user;\n get_currentuserinfo();\n return $current_user->ID;\n}", "public function getCurrentSeasonId()\n {\n $currentSeason = $this->db->query(\"SELECT id, seizoen as season FROM intra_seizoen ORDER BY id DESC LIMIT 1;\")->fetch();\n return $currentSeason[\"id\"];\n }", "public function getLoggedUserId()\n {\n $user = $this->getLoggedUser();\n return $user ? $user->getId() : 0;\n }", "function getRHUL_UserID() {\n\n\tglobal $RHUL_Non_Stu_ID;\n\n\n\tif ( is_user_logged_in() ) {\n\n\t\tglobal $wpdb;\n\t\t$wp_user = strtoupper(wp_get_current_user()->user_login); // Get currently logged-in Wordpress user\n\n\t\t$sql = \"SELECT meta_value FROM cswp_usermeta WHERE meta_key = 'adi_studentno' AND user_id = \"\n\t\t\t. \"(SELECT user_id FROM cswp_usermeta WHERE meta_key = 'adi_samaccountname' AND meta_value = '\" . $wp_user . \"');\";\n\n\t\t$results = $wpdb->get_results($sql);\n\n\n\t\t// In case the \"adi_studentno\" key does not exist (i.e. a staff member)\n\t\t// returns -1 for this!\n\n\t\tif (!$results) { return $RHUL_Non_Stu_ID; };\n\n\t\ttry {\n\t\t\treturn $results[0]->meta_value;\n\n\t\t} catch (Exception $e)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\n\n\n\n\n\t} else {\n\t\treturn -1;\n\t}\n}", "public function getIdPlayer()\n {\n return $this->idPlayer;\n }", "function getUserid(){\n\t\terror_reporting(0);\n\t\tif(!isset($_COOKIE['fbsr_123059651225050'])){\n\t\t\tthrow new Exception('Invalid player');\n\t\t} \n\t\t$data = parse_signed_request($_COOKIE['fbsr_123059651225050']);\n\t\tif($data[\"user_id\"] == null){\n\t\t\tthrow new Exception('Invalid Cookie');\n\t\t}\n\t\treturn $data[\"user_id\"];\n\t}", "private function getLoggedInUserId() {\n if ( !isset($_SESSION['idUtente']) ) {\n throw new EmmaDashboardServiceSessionException(\"Not a logged in user.\");\n }\n return $_SESSION['idUtente'];\n }", "function joinGame($gameID, $playerName)\n{\n $dbh = connectToDatabase();\n\n if (!$gameID) {\n\n // Check that there is no game already using this ID\n $gameIDIsUnique = true;\n // If $gameID empty, create new game\n $gameID = newGameID();\n // Count number of rows with $gameID\n $stmt = $dbh->prepare('SELECT COUNT(1) FROM games WHERE gameID = ?');\n do {\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if ($result[0] > 0) {\n // Wait, there is a game already using this ID. Try again\n $gameIDIsUnique = false;\n }\n } while (!$gameIDIsUnique);\n\n // First player in a game becomes the GM\n $playersData = json_encode([$playerName]);\n $gameData = json_encode(new stdClass);\n $stmt = $dbh->prepare(\"INSERT INTO games VALUES (?, ?, ?, ?, 0, NOW())\");\n if ($stmt->execute([$gameID, $playersData, $gameData, $playerName])) {\n // Now, send new gameID back to the host player\n exit($gameID);\n } else {\n http_response_code(500);\n die('GAME NOT CREATED');\n }\n } else {\n // Otherwise, join game with passed gameID\n // Get whatever players are now in the database\n $stmt = $dbh->prepare('SELECT players FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n // There should be only one game with this ID, so join first one with matched ID\n $players = json_decode($result[0], true);\n // Add this player to the players array, and insert back into the entry\n array_push($players, $playerName);\n $playersData = json_encode($players);\n\n $stmt = $dbh->prepare('UPDATE games SET players = ? WHERE gameID = ?');\n\n if ($stmt->execute([$playersData, $gameID])) {\n // Signal the client that the game is ready\n exit('PLAYER');\n } else {\n http_response_code(500);\n die('NOT JOINED GAME');\n }\n }\n\n // Now store the gameID in $_SESSION, so that we stay connected until the browser is closed\n $_SESSION['gameID'] = $gameID;\n $_SESSION['playerName'] = $playerName;\n}", "public function getGid()\n {\n $value = $this->get(self::GID);\n return $value === null ? (integer)$value : $value;\n }" ]
[ "0.684982", "0.67119646", "0.616038", "0.6103351", "0.6084436", "0.5983321", "0.5861208", "0.58470947", "0.58333963", "0.57788116", "0.5739928", "0.5675832", "0.56728375", "0.56332195", "0.56246585", "0.55687225", "0.55334765", "0.55228376", "0.54987127", "0.54849666", "0.5468263", "0.5418693", "0.54070264", "0.53826076", "0.5372456", "0.536857", "0.5342059", "0.53128755", "0.5307456", "0.5306495", "0.5278376", "0.5268924", "0.52649695", "0.5251702", "0.5248297", "0.52430195", "0.5232052", "0.52310824", "0.5228882", "0.5224549", "0.5221264", "0.5220918", "0.5218339", "0.5204015", "0.51841325", "0.5183886", "0.51828235", "0.5179886", "0.5172011", "0.51699686", "0.516567", "0.5164939", "0.5162761", "0.5160282", "0.51545143", "0.5151499", "0.514525", "0.51436454", "0.51374286", "0.51110274", "0.5104704", "0.50936717", "0.508735", "0.5081111", "0.5076726", "0.5063688", "0.5060914", "0.50592583", "0.5059167", "0.5058317", "0.50571746", "0.5049632", "0.5043541", "0.5040092", "0.5035544", "0.5022014", "0.50069916", "0.5005764", "0.49995625", "0.4998548", "0.49960986", "0.4989835", "0.49848482", "0.49780154", "0.4976025", "0.49725673", "0.49672186", "0.49658722", "0.49657673", "0.4963672", "0.4962796", "0.4959099", "0.4952849", "0.49523628", "0.495077", "0.4948846", "0.4948014", "0.49462733", "0.49441627", "0.49425164" ]
0.702532
0
/ Logs in a user. Returns whether the operation succeeded or not.
function checkUser($name, $password) { $id = checkUserBdd($name, $password); if ($id) { $_SESSION["name"] = $name; $_SESSION["userId"] = $id; $_SESSION["connected"] = true; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "private function LogIn() : bool\n {\n\n //session::close();\n\n\n $not_specified_user_and_pass = empty($this->username) and empty($this->password);\n\n\n if($not_specified_user_and_pass)\n\n return false;\n\n\n $user = $this->user_details($this->username);\n\n\n $username_not_exists = !$user; //Not user\n\n\n if($username_not_exists)\n\n return false;\n\n\n\n $unrecognized_password = !$this->recognized_password();\n\n\n if($unrecognized_password)\n\n return false;\n\n\n $this->id = $user[\"id\"];\n\n return $this->set_session_key($user);\n\n\n\n }", "private function _logUserIn($inputs)\n\t{\n\t\tCraft::log('Logging in user.');\n\n\t\tif (craft()->userSession->login($inputs['username'], $inputs['password']))\n\t\t{\n\t\t\tCraft::log('User logged in successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not log the user in.', LogLevel::Warning);\n\t\t}\n\t}", "public function it_logs_in_the_user()\n {\n $user = factory(User::class)->create([\n 'password' => '123123',\n ]);\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new Login)\n ->type('@email', $user->email)\n ->type('@password', '123123')\n ->click('@submit')\n ->assertPathIs('/app');\n });\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login()\n\t{\n $identity = $this->getIdentity();\n if ($identity->ok) {\n\t\t\t$duration = $this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->getIdentity(), $duration);\n\t\t\treturn true;\n \n\t\t} else\n\t\t\treturn false;\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "public function login() {\n\t\tif ($this->_identity === null) {\n\t\t\t$this->_identity = new UserIdentity($this->username, $this->password, $this->loginType);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\n\t\t\t$duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days or the default session timeout value\n\t\t\tYii::app()->user->login($this->_identity, $duration);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function log_in()\n\t{\n\t\tif( isset( $_POST['user_login'] ) && wp_verify_nonce( $_POST['login_nonce'], 'login-nonce') ) \n\t\t{\n\t\t\t/** Error when no password enter */\n\t\t\tif( ! isset( $_POST['user_pass']) || $_POST['user_pass'] == '') {\n\t\t\t\t$this->system_message['error'][] = __('Please enter a password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \t\t\n\t\t\t// this returns the user ID and other info from the user name\n\t\t\t$user = get_user_by('login', $_POST['user_login'] );\n \n\t\t\tif( ! $user ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \n\t\t\t// check the user's login with their password\n\t\t\tif( ! wp_check_password( $_POST['user_pass'], $user->user_pass, $user->ID) ) {\n\t\t\t\t// if the password is incorrect for the specified user\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t}\n\t \n\t\t\t// only log the user in if there are no errors\n\t\t\tif( empty( $this->system_message['error'] )) \n\t\t\t{\n\t\t\t\twp_set_auth_cookie( $user->ID, false, true );\n\t\t\t\twp_set_current_user( $user->ID );\t\n\t\t\t\tdo_action('wp_login', $_POST['user_login']);\n\t \n\t\t\t\twp_redirect( home_url() ); exit;\n\t\t\t}\n\t\t}\n\t}", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function login()\n {\n if ($this->validate()) {\n return User::setIdentityByAccessToken($this->user_id);\n }\n return false;\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "public function signin()\n\t{\n $user = new User();\n\n // If user can succesfully signin then signin\n if ($user->signin(Database::connection(), $_POST['username'], $_POST['password']))\n {\n $_SESSION['id'] = $user->id;\n return True;\n }\n\n return False;\n\t}", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}", "public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}", "public function loginUser()\n {\n $validate = $this->loginValidator->validate();\n $user = $this->userRepository->getUserWithEmail($validate[\"email\"]);\n\n if ($this->userCorrect($validate, $user)) {\n $user['api_token'] = $this->getToken();\n $user->save();\n\n return $this->successResponse('user', $user, 200)\n ->header('Token', $user['api_token']);\n }\n }", "public function login()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public function logInUserChangesToLoggedInStatus() {\n\t\t$user = new Tx_Oelib_Model_FrontEndUser();\n\t\t$this->subject->logInUser($user);\n\n\t\t$this->assertTrue(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "public function log_login()\n {\n if (!$this->config->get('log_logins')) {\n return;\n }\n\n $user_name = $this->get_user_name();\n $user_id = $this->get_user_id();\n\n if (!$user_id) {\n return;\n }\n\n self::write_log('userlogins',\n sprintf('Successful login for %s (ID: %d) from %s in session %s',\n $user_name, $user_id, self::remote_ip(), session_id()));\n }", "public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}", "public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public static function LogIn ($userName = '', $password = '');", "public function login()\n {\n try {\n if ($this->call('login', '/user/login') != \"\") {\n if (($page = $this->call('basic', '')) !== false) {\n $this->html = $this->open($page);\n if ($this->findLink('/user/account')) {\n return true;\n } else {\n throw new Exception('Unable to login');\n }\n }\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "public static function loggedin()\r\n {\r\n if (Maker::get('logged_in_user') != null) {\r\n return Maker::get('logged_in_user');\r\n }\r\n\r\n $query = Mysql::query(\r\n 'SELECT u.* FROM sessions s LEFT JOIN users u ON s.userid=u.id\r\n WHERE s.sessid=%s AND s.password=u.password AND u.username=%s AND s.userid=%u AND s.ip=%b',\r\n Session::instance()->password,\r\n Session::instance()->username,\r\n Session::instance()->userid,\r\n ip()->realip\r\n );\r\n\r\n if ($query->rows == 1) {\r\n Maker::set('logged_in_user', $query->row);\r\n return true;\r\n }\r\n Maker::set('logged_in_user', null);\r\n return false;\r\n }", "private function attemptLogin($user){\n\n }", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}", "public function login()\n {\n Yii::$app->settings->clearCache();\n if ($this->validate() && $this->checkSerialNumberLocal()) {\n Yii::$app->settings->checkFinalExpireDate();\n $flag = Yii::$app->user->login($this->getUserByPassword(), 0);\n Yii::$app->object->setShift();\n return $flag;\n }\n \n return false;\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n else {\n return false;\n }\n }", "function action_login() \t\t\t\t\t\t\t\t\t// Logs user $user into system.\n\t{\n\t\t$username = $_POST['username'];\n\t\t$password = $_POST['password'];\n\t\t$where = \"username='\".$username.\"' AND password=PASSWORD('\".$password.\"')\";\n\t\t$result = sql_select(\"users\",$where);\n\t\t$row = mysql_fetch_array($result);\n\t\tif($row['ID'])\n\t\t{\n\t\t\t\n\t\t\tses_set(\"userID\", $row['ID']);\n\t\t\tses_set(\"username\", $row['username']);\n\t\t\tses_set(\"fullname\", $row['surname'].\" \".$row['lastname']);\n\t\t\tses_set(\"admin\", $row['group']);\n\t\t\t\n\t\t\tmysql_query(\"UPDATE users SET visits = visits + 1 WHERE username='\".$username.\"'\") or die(\"Query failed : \" . mysql_error());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n return false;\n }", "public function login()\n {\n if ($this->validate()) {\n $duration = $this->module->rememberLoginLifespan;\n\n return Yii::$app->getUser()->login($this->user, $duration);\n }\n\n return false;\n }", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\n $lastLogin = date(\"Y-m-d H:i:s\");\n\n if(Yii::app()->user->tableName === 'tbl_user'){\n $sql = \"UPDATE tbl_user_dynamic SET ulast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_personnel'){\n $sql = \"UPDATE tbl_user_dynamic SET plast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_reader'){\n $sql = \"UPDATE tbl_user_dynamic SET rlast_login = :lastLogin WHERE user_id = :userid\";\n }\n $command = Yii::app()->db->createCommand($sql);\n $command->bindValue(\":userid\", $this->_identity->id, PDO::PARAM_STR);\n $command->bindValue(\":lastLogin\", $lastLogin, PDO::PARAM_STR);\n $command->execute();\n Tank::wipeStats();\n Yii::app()->user->setState('todayHasRecord',User::todayHasRecord());\n return true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login_as()\n {\n // Perform lookup of user\n /** @var \\Nails\\Auth\\Model\\User $oUserModel */\n $oUserModel = Factory::model('User', Constants::MODULE_SLUG);\n /** @var \\Nails\\Common\\Service\\Uri $oUri */\n $oUri = Factory::service('Uri');\n /** @var \\Nails\\Common\\Service\\Input $oInput */\n $oInput = Factory::service('Input');\n\n $sHashId = (string) $oUri->segment(4);\n $sHashPw = (string) $oUri->segment(5);\n $oUser = $oUserModel->getByHashes($sHashId, $sHashPw);\n\n if (!$oUser) {\n show404();\n }\n\n // --------------------------------------------------------------------------\n\n /**\n * Check sign-in permissions; ignore if recovering.\n * Users cannot:\n * - Sign in as themselves\n * - Sign in as superusers (unless they are a superuser)\n */\n\n if (!wasAdmin()) {\n\n $bHasPermission = userHasPermission(\\Nails\\Auth\\Admin\\Permission\\Users\\LoginAs::class);\n $bIsCloning = activeUser('id') == $oUser->id;\n $bIsSuperuser = !isSuperUser() && isSuperUser($oUser);\n\n if (!$bHasPermission || $bIsCloning || $bIsSuperuser) {\n if (!$bHasPermission) {\n $this->oUserFeedback->error(lang('auth_override_fail_nopermission'));\n redirect(\\Nails\\Admin\\Admin\\Controller\\Dashboard::url());\n\n } elseif ($bIsCloning) {\n show404();\n\n } elseif ($bIsSuperuser) {\n show404();\n }\n }\n }\n\n // --------------------------------------------------------------------------\n\n if (!$oInput->get('returningAdmin') && isAdmin()) {\n\n /**\n * The current user is an admin, we should set our Admin Recovery Data so\n * that they can come back.\n */\n\n $oUserModel->setAdminRecoveryData($oUser->id, $oInput->get('return_to'));\n $sRedirectUrl = $oInput->get('forward_to') ?: $oUser->group_homepage;\n\n $this->oUserFeedback->success(lang('auth_override_ok', $oUser->first_name . ' ' . $oUser->last_name));\n\n } elseif (wasAdmin()) {\n\n /**\n * This user is a recovering admin. Work out where we're sending\n * them back to then remove the adminRecovery data.\n */\n\n $oRecoveryData = getAdminRecoveryData();\n $sRedirectUrl = !empty($oRecoveryData->returnTo) ? $oRecoveryData->returnTo : $oUser->group_homepage;\n\n unsetAdminRecoveryData();\n\n $this->oUserFeedback->success(lang('auth_override_return', $oUser->first_name . ' ' . $oUser->last_name));\n\n } else {\n\n /**\n * This user is simply logging in as someone else and has passed the hash\n * verification.\n */\n\n $sRedirectUrl = $oInput->get('forward_to') ?: $oUser->group_homepage;\n\n $this->oUserFeedback->success(lang('auth_override_ok', $oUser->first_name . ' ' . $oUser->last_name));\n }\n\n // --------------------------------------------------------------------------\n\n // Record the event\n createUserEvent(\n 'did_log_in_as',\n [\n 'id' => $oUser->id,\n 'first_name' => $oUser->first_name,\n 'last_name' => $oUser->last_name,\n 'email' => $oUser->email,\n ]\n );\n\n // --------------------------------------------------------------------------\n\n // Replace current user's session data\n $oUserModel->setLoginData($oUser->id, true, true);\n\n // --------------------------------------------------------------------------\n\n redirect($sRedirectUrl);\n }", "function user_action_login($env, $vars) {\n $username = array_pop($vars['data']['username']);\n // We allow also using email for logging in.\n if (valid_email($username)) {\n $username = UserFactory::getUserFromField($env, 'email', $username);\n }\n\n // Initialize an user object.\n $tmp_user = new User($env, $username);\n // Attempt to log in the user.\n $login = $tmp_user->logIn(array_pop($vars['data']['password']));\n exit($login);\n}", "function attemptLogin (string $user, string $pwd, bool $remember = false, string $userObjID = \"default\") : bool {\n\tif(!_USE_BASE_DB) return false;\n\tif(!databaseHookExists(_BASE_DB_HOOK)) return false;\n\n\t$result = executeQuery(\n\t\t_BASE_DB_HOOK,\n\t\tgetSqlFile(\"getUser\"),\n\t\t[\n\t\t\t['s' => $user],\n\t\t\t['s' => $pwd]\n\t\t]\n\t);\n\n\tif(!($result instanceof mysqli_result)){\n\t\treturn false;\n\t}\n\tif(($row = $result->fetch_assoc()) != null){\n\t\t$userObj =\n\t\t\t[\n\t\t\t\t'id' => $row['id_user'],\n\t\t\t\t'username' => $row['username'],\n\t\t\t\t'pwd_hash' => $row['password_hash'],\n\t\t\t\t'admin' => $row['admin'] == 1,\n\t\t\t\t'email' => $row['email'],\n\t\t\t\t'fullname' => $row['fullname'],\n\t\t\t\t'locale' => $row['locale']\n\t\t\t]\n\t\t;\n\t\tsetUserObject($userObj, $userObjID);\n\n\t\tif($remember){\n\t\t\tsaveToken('', $userObjID);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "protected function login() {\n\t\t\t\n\t\t\t// Generate the login string\n\t\t\t$loginString = str_replace( array('{USER}', '{PASS}'), array( $this->user, $this->pass), $this->loginString );\n\t\t\t\n\t\t\t// Send the login data with curl\n\t\t\t$this->c->{$this->loginMethod}($this->loginUrl, $loginString);\n\t\t\t\n\t\t\t// Check if the login worked\n\t\t\tif($this->is_logged_in()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdie('Login failed');\n\t\t\t}\n\t\t\t\n\t\t}", "public function login()\r\n\t{\t\t\r\n\t\tif ($this->_identity === null) {\r\n $this->_identity = new UserIdentity($this->email, $this->password);\r\n $this->_identity->authenticate();\r\n }\r\n\t\t\r\n switch ($this->_identity->errorCode) {\r\n case UserIdentity::ERROR_NONE:\r\n $duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days\r\n Yii::app()->user->login($this->_identity, $duration);\r\n break;\r\n case UserIdentity::ERROR_USERNAME_INVALID:\t\t\t\t\r\n $this->addError('email', 'Email address is incorrect.');\r\n break;\r\n\t\t\tcase UserIdentity::ERROR_PASSWORD_INVALID:\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n default: // UserIdentity::ERROR_PASSWORD_INVALID\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n }\r\n\t\t\r\n if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\r\n $this->onAfterLogin(new CEvent($this, array()));\t\t\t\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\t}", "public function login() {\n\t\t//see if the user exists in the config.\r\n\t\tif (empty ( $_SESSION['uid'] ) && !isset($_POST['user'])) {\n\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Login required.</message></reply>';\n\t\t\tsession_destroy();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(isset($_POST['user'])){\n\t\t\t$xmlUser = $this->getUser ( $_POST ['user'] );\n\t\t}\n\t\t\n\t\t//Validate the user\n\t\tif ( isset ( $xmlUser ) && (empty($xmlUser ['password']) || (isset($_POST ['password']) && $xmlUser ['password'] == crypt($_POST ['password'],$xmlUser['password'])))) {\n\t\t\t//if a session exists, restrict login to only that user.\n\t\t\tif (! isset ( $this->session ) || ($this->session ['name'] == $xmlUser ['name'] && $this->session ['ip'] == $_SERVER ['REMOTE_ADDR'])) {\n\t\t\t\t//Login OK\r\n\t\t\t\t$this->isLoggedin = true;\n\t\t\t\t$this->name = $xmlUser ['name'];\n\t\t\t\t$this->group = $xmlUser ['group'];\n\t\t\t\t$this->session ['uid'] = session_id ();\n\t\t\t\t$this->session ['name'] = ( string ) $xmlUser ['name'];\n\t\t\t\t$this->session ['ip'] = $_SERVER ['REMOTE_ADDR'];\n\t\t\t\tsession_register('uid');\n\t\t\t\tsession_register('group');\n\t\t\t\t$_SESSION['uid'] = (string) $xmlUser['name'];\n\t\t\t\t$_SESSION['group'] = (string)$xmlUser['group'];\n\t\t\t\t$this->updateSession ();\n\t\t\t\t\n\t\t\t\tLogger::getRootLogger ()->info ( \"User {$xmlUser['name']} is logged in.\" );\n\t\t\t\techo '<reply action=\"login-ok\"><message>logged in.</message></reply>';\n\t\t\t} else {\n\t\t\t\t//Another user is logged in\r\n\t\t\t\tLogger::getRootLogger ()->info ( \"Could not login user {$_POST['user']}. Another user is already logged in.\" );\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Error logging in. Another user is already logged in.</message></reply>';\n\t\t\t}\n\t\t} else {\n\t\t\tif(isset($_POST['password'])){\n\t\t\t\t//Wrong user and/or pass\n\t\t\t\tsession_destroy();\r\n\t\t\t\tLogger::getRootLogger ()->info ( \"Could not login user {$_POST['user']}. Wrong username and/or password.\" );\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Error logging in. Username and or password is incorrect.</message></reply>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsession_destroy();\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Your session has expired</message></reply>';\n\t\t\t}\n\t\t}\n\t}", "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 loginUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$login = Application_Model_User::loginUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($login) {\n\t\t\t\t\t\techo json_encode($login);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "public function userLogin($userModel) {\n // Validating the input on back-end\n $validateUsername = $this->validate->validateInput($userModel->getUsername(), \"/^[a-zA-Z0-9_.-]*$/\", 1, 25);\n $validatePassword = $this->validate->validateInput($userModel->getPassword(), \"/^[a-zA-Z0-9@+_.!?|]*$/\", 8, 20);\n\n // Checking if they all return true\n if ($validateUsername && $validatePassword) {\n // Sending the data to the datalayer login function\n $userID = $this->userDB->userLogin($userModel);\n $userModel->setID($userID);\n\n if ($userModel->getID() != null) {\n // Starting the session\n session_start();\n $_SESSION['userID'] = $userModel->getID();\n\n // Sending the user to the home page\n header(\"Location: index\");\n } else {\n // Reloading the page with an error\n header(\"Location: login?error=2\");\n }\n } else {\n // Reloading the page with an error\n header(\"Location: login?error=1\");\n }\n }", "public function doLogin()\n {\n if ($this->validate()) {\n $result = Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n\n if ($result) {\n $event = new LoginEvent();\n $event->user = $this->getUser();\n $this->trigger(self::EVENT_LOGIN, $event);\n }\n\n return $result;\n }\n return false;\n }", "public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }", "public function login(Authenticatable $user)\n {\n $this->setUser($user);\n return true;\n }", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "function loginUser($username,$password,$return=true);", "function login() {\n\t\t//$salt = Configure::read('Security.salt');\n\t\t//echo md5('password'.$salt);\n\n\t\t// redirect user if already logged in\n\t\tif( $this->Session->check('User') ) {\n\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t}\n\n\t\tif(!empty($this->data)) {\n\t\t\t// set the form data to enable validation\n\t\t\t$this->User->set( $this->data );\n\t\t\t// see if the data validates\n\t\t\tif($this->User->validates()) {\n\t\t\t\t// check user is valid\n\t\t\t\t$result = $this->User->check_user_data($this->data);\n\n\t\t\t\tif( $result !== FALSE ) {\n\t\t\t\t\t// update login time\n\t\t\t\t\t$this->User->id = $result['User']['id'];\n\t\t\t\t\t$this->User->saveField('last_login',date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t// save to session\n\t\t\t\t\t$this->Session->write('User',$result);\n\t\t\t\t\t//$this->Session->setFlash('You have successfully logged in');\n\t\t\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Either your Username of Password is incorrect');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function onLoginUser($user, $options)\n\t{\n\t\t// Initialize variables\n\t\t$success = false;\n\n\t\t// Here you would do whatever you need for a login routine with the credentials\n\t\t//\n\t\t// Remember, this is not the authentication routine as that is done separately.\n\t\t// The most common use of this routine would be logging the user into a third party\n\t\t// application.\n\t\t//\n\t\t// In this example the boolean variable $success would be set to true\n\t\t// if the login routine succeeds\n\n\t\t// ThirdPartyApp::loginUser($user['username'], $user['password']);\n\n\t\treturn $success;\n\t}", "public function doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "abstract public function login(UserInterface $user): bool;", "public function login() {\n return $this->run('login', array());\n }", "public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "public function login($userName, $password);", "public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }", "public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }", "public function do_login()\n {\n $input = array(\n 'email' => Input::get( 'username' ), // May be the username too\n 'username' => Input::get( 'username' ), // so we have to pass both\n 'password' => Input::get( 'password' ),\n 'remember' => Input::get( 'remember' ),\n );\n\n // If you wish to only allow login from confirmed users, call logAttempt\n // with the second parameter as true.\n // logAttempt will check if the 'email' perhaps is the username.\n // Get the value from the config file instead of changing the controller\n if ( Confide::logAttempt( $input, Config::get('confide::signup_confirm') ) ) \n {\n // Redirect the user to the URL they were trying to access before\n // caught by the authentication filter IE Redirect::guest('user/login').\n // Otherwise fallback to '/'\n // Fix pull #145\n return Redirect::intended('/member'); // change it to '/admin', '/dashboard' or something\n }\n else\n {\n $user = new User;\n\n // Check if there was too many login attempts\n if( Confide::isThrottled( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');\n }\n elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.not_confirmed');\n }\n else\n {\n $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');\n }\n \n return Redirect::action('UserController@login')\n ->withInput(Input::except('password'))\n ->with( 'error', $err_msg );\n }\n }", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "function signIn(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tinclude_once(\"security.php\");\n\t\t\t\n\t\t\tif($this->username == \"\" || $this->password == null){\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$userInfo = $db->prepare('SELECT * FROM user WHERE Username = :username');\n\t\t\t\t$userInfo->bindParam(':username', $this->username);\n\t\t\t\t$userInfo->execute();\n\t\t\t\t\n\t\t\t\t//Check if user exists\n\t\t\t\tif($userInfo->rowCount() == 0){\n\t\t\t\t\t$json->notFound(\"User\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t//If exists, pull Password hash and verify against inserted password\n\t\t\t\t\tforeach($userInfo as $row) {\n\t\t\t\t\t\tif($row['Password'] === crypt($this->password, $row['Password'])){\n\t\t\t\t\t\t\t//correct username & password combination\n\t\t\t\t\t\t\techo '{ \"User\" : { \"Id\" : '.$row['Id'].', \"Username\" : \"'.$row['Username'].'\", \"Subject\" : '.$row['Subject'].', \"Admin\" : '.$row['Admin'].', \"ApiKey\" : \"'.$row['ApiKey'].'\" } }';\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$json->unauthorizedInvalidPassword();\n\t\t\t\t\t\t\treturn;\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}", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function actionLoginAsUser()\n {\n \t$user = UserAdmin::findOne(Yii::$app->request->get('id'));\n \tif ($user && Yii::$app->getRequest()->isPost)\n \t{\n \t\tYii::$app->user->login(UserAdminIdentity::findIdentity($user->id));\n \t\treturn $this->redirect([\"/admin/index/index\"]);\n \t}\n \t\n \t$this->layout = '@app/layouts/layout-popup-sm';\n \treturn $this->render('login-as-user', ['model' => $user]);\n }", "public static function userLoggedIn()\n {\n //Hvis en bruker ikke er logget inn, vil han bli sent til login.php\n if (!isset($_SESSION['user'])) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $_SESSION['returnPage'] = $_SERVER['REQUEST_URI'];\n $alert = new Alert(Alert::ERROR, \"Du er nøtt til å være logget inn for å se den siden. Ikke prøv deg på noe.\");\n $alert->displayOnOtherPage('login.php');\n\n }\n }", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "public function login();", "public function login();", "public function doLogin()\n\t{\n $userData = array(\n 'username' => \\Input::get('username'),\n 'password' => \\Input::get('password'),\n );\n\t\t\n\t\t$rememberMe = \\Input::get('remember-me');\n\t\t\n // Declare the rules for the form validation.\n $rules = array(\n 'username' => 'Required',\n 'password' => 'Required'\n );\n\n // Validate the inputs.\n $validator = \\Validator::make($userData, $rules);\n\n // Check if the form validates with success.\n if ($validator->passes())\n {\n // Try to log the user in.\n if (\\Auth::attempt($userData, (bool)$rememberMe))\n {\n // Redirect to dashboard\n\t\t\t\treturn \\Redirect::intended(route('dashboard'));\n }\n else\n {\n // Redirect to the login page.\n return \\Redirect::route('login')->withErrors(array('password' => \\Lang::get('site.password-incorrect')))->withInput(\\Input::except('password'));\n }\n }\n\n // Something went wrong.\n return \\Redirect::route('login')->withErrors($validator)->withInput(\\Input::except('password'));\n\t}", "protected function loginUser()\n {\n // Set login data for this user\n /** @var User $oUserModel */\n $oUserModel = Factory::model('User', Constants::MODULE_SLUG);\n $oUserModel->setLoginData($this->mfaUser->id);\n\n // If we're remembering this user set a cookie\n if ($this->remember) {\n $oUserModel->setRememberCookie(\n $this->mfaUser->id,\n $this->mfaUser->password,\n $this->mfaUser->email\n );\n }\n\n // Update their last login and increment their login count\n $oUserModel->updateLastLogin($this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Generate an event for this log in\n createUserEvent('did_log_in', ['method' => $this->loginMethod], null, $this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Say hello\n if ($this->mfaUser->last_login) {\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $sLastLogin = $oConfig->item('authShowNicetimeOnLogin')\n ? niceTime(strtotime($this->mfaUser->last_login))\n : toUserDatetime($this->mfaUser->last_login);\n\n if ($oConfig->item('authShowLastIpOnLogin')) {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_with_ip',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n $this->mfaUser->last_ip,\n ]\n ));\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n ]\n ));\n }\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_notime',\n [\n $this->mfaUser->first_name,\n ]\n ));\n }\n\n // --------------------------------------------------------------------------\n\n // Delete the token we generated, it's no needed, eh!\n /** @var Authentication $oAuthService */\n $oAuthService = Factory::model('Authentication', Constants::MODULE_SLUG);\n $oAuthService->mfaTokenDelete($this->data['token']['id']);\n\n // --------------------------------------------------------------------------\n\n $sRedirectUrl = $this->returnTo != siteUrl() ? $this->returnTo : $this->mfaUser->group_homepage;\n redirect($sRedirectUrl);\n }", "public function logIn(){\n\t\t$email = $_POST['log_email'];\n\t\t$email = filter_var($email, FILTER_SANITIZE_EMAIL); //sanitize email\n\t\t$s_email = self::$db->escape($email);\n\n\t\t\n\t\t$myquery = \"SELECT * FROM users WHERE email = $s_email;\";\n\t\tif(!self::$db->query($myquery)){\n\t\t\tarray_push($_SESSION['error'], \"does not match\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = self::$db->select($myquery);\n\t\t$hash = $user[0]['password'];\n\t\t$password = $_POST['log_password'];\n\t\t$unlocked = password_verify($password, $hash);\n\n\t\tif($unlocked){\n\t\t\t$this->setSessionVar($user[0]['id'],$hash);\n\t\t\t$_SESSION['allow']=true;\n\t\t\t$_SESSION['username'] = $user[0]['username'];\n \t\t\theader( \"refresh:0; url=index.php?page=home\");\n \t\t \t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tarray_push($_SESSION['error'] , 'does not match');\n\t\t\t$_SESSION['allow']=false;\n\t\t\treturn false ;\n\t\t}\n\t\tarray_push($_SESSION['error'] , 'does not match');\n\t\treturn false; \n\t}", "public function loggedIn($user) {\n if ($user != null) \n return true;\n return false;\n\n }", "public function login()\n {\n if ($this->validate()) {\n //return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n return true;\n }\n return false;\n }", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function Login(AuthUser $user) \n {\n $_SESSION[\"valid_login\"] = true;\n $_SESSION[\"user_id\"] = $user->id;\n }", "public function login_user() {\n\n // Grab the username and password from the form POST\n $username = $this->input->post('username');\n $pass = $this->input->post('password');\n\n //Ensure values exist for username and pass, and validate the user's credentials\n if( $username && $pass && $this->validate_user($username,$pass)) {\n // If the user is valid, redirect to the main view\n redirect(base_url());\n } else {\n // Otherwise show the login screen with an error message.\n $this->show_login(true);\n }\n }", "public function authUser(){\n\t\t\t\n\t\tif($this->view->userTryLogin()){\n\t\t\t\n\t\t \t// UC 1 3: user provides username and password\n\t\t\t$inpName = $this->view->getInputName(false);\n\t\t\t\n\t\t\tif($inpName == null){\n\t\t\t\t$this->view->storeMessage(\"Användarnamn saknas\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t}\n\t\t\t\n\t\t\t$inpPass = $this->view->getInputPassword(false);\n\n\t\t\tif($inpPass == null){\n\t\t\t\t$this->view->storeMessage(\"Lösenord saknas\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t}\n\t\t\t\t\t\n\t\t\t// UC 1 3a: user wants system to keep user credentials for easier login\n\t\t\t$keepCreds = $this->view->keepCredentials();\n\t\t\t\n\t\t\t// UC 1 4: authenticate user...\n\t\t\t$answer = $this->model->loginUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\t\n\t\t\t// UC 1 4a: user could not be authenticated\n\t\t\tif($answer === false){\n\t\t\t\t\n\t\t\t\t// 1. System presents an error message\n\t\t\t\t// 2. Step 2 in main scenario\n\t\t\t\t$this->view->storeUserInput($inpName);\n\t\t\t\t$this->view->storeMessage(\"Felaktigt användarnamn och/eller lösenord\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif($keepCreds){\n\t\t\t\t\t\n\t\t\t\t\t// UC 1 3a-1: ...system presents that...the user credentials were saved\n\t\t\t\t\t$this->view->storeCredentials($inpName, $inpPass);\n\t\t\t\t\t$this->model->storeCookieTime($inpName);\n\t\t\t\t\t$this->view->storeMessage(\"Inloggning lyckades och vi kommer ihåg dig nästa gång\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// ...and present success message\n\t\t\t\t\t$this->view->storeMessage(\"Inloggningen lyckades\");\n\t\t\t\t}\t\n\t\t\t\treturn $this->view->showLogin(true);\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\t// UC 1 1: user wants to authenticate\n\t\t \t// UC 1 2: system asks for username, password and if system should save the user credentials\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "function login()\r\n {\r\n if ($this->data)\r\n {\r\n // Use the AuthComponent's login action\r\n if ($this->Auth->login($this->data))\r\n {\r\n // Retrieve user data\r\n $results = $this->User->find(array('User.username' => $this->data['User']['username']), array('User.active'), null, false);\r\n // Check to see if the User's account isn't active\r\n\r\n if ($results['User']['active'] == 0)\r\n {\r\n // account has not been activated\r\n $this->Auth->logout();\r\n $this->flashNotice('Hello ' . $this->Session->read('Auth.User.username') . '. Your account has not been activated yet! Please check your mail and activate your account.', 'login');\r\n }\r\n // user is active, redirect post login\r\n else\r\n {\r\n $this->User->id = $this->Auth->user('id');\r\n $this->flashSuccess('Hello ' . $this->Session->read('Auth.User.username') . '. You have successfully logged in. Please choose your destination on the left menu.');\r\n $this->User->saveField('last_login', date('Y-m-d H:i:s') );\r\n $this->redirect(array('controller' => 'users', 'action' => 'login'));\r\n }\r\n }\r\n $this->flashWarning('You could not be logged in. Maybe wrong username or password?');\r\n }\r\n }", "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 loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }", "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "public function it_can_login_a_user()\n {\n // $user = User::find('[email protected]');\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login)\n ->type('email', '[email protected]')\n ->type('password', 'Tang#@123')\n ->press('Login')\n ->assertDontSee('These credentials do not match our records.')\n ->assertSee('Products');\n });\n }", "public function loginExistingUser() {\n\n // Check whether remote account with requested email exists:\n try {\n $this->sso = dosomething_canada_get_sso();\n\n if ($this->sso->authenticate($this->email, $this->password)) {\n $this->remote_account = $this->sso->getRemoteUser();\n }\n }\n catch (Exception $e) {\n\n // The only users that exist locally but not remotely should be admin\n // accounts that were created before SSO integration. These should be\n // created remotely as well.\n $this->sso->propagateLocalUser(\n $this->email,\n $this->password,\n dosomething_canada_create_sso_user($this->email, $this->password, $this->local_account)\n );\n }\n return TRUE;\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}", "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() {\r\n if ($this->request->is('post')) {\r\n \r\n //If the user is authenticated...\r\n if ($this->Auth->login()) {\r\n \r\n if ($this->isAdmin()) $this->redirect(\"/admin/halls\");\r\n else $this->redirect(\"/halls\");\r\n }\r\n else {\r\n $this->Session->setFlash(__('Invalid username or password, try again'));\r\n }\r\n }\r\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->User->find('count') <= 0) {\r\n\t\t\t\t$this->User->create();\r\n\t\t\t\t$data['User']['username'] = \"admin\";\r\n\t\t\t\t$data['User']['password'] = AuthComponent::password(\"admin\");\r\n\t\t\t\t$this->User->save($data);\r\n\t\t\t}\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->write('isLoggedIn', true);\n\t\t\t\t$this->Session->write('mc_rootpath', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('mc_path', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('imagemanager.preview.wwwroot', WWW_ROOT);\n\t\t\t\t$this->Session->write('imagemanager.preview.urlprefix', Router::url( \"/\", true ));\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');\n\t\t\t}\n\t\t}\n\t}", "public function action_login_as()\n {\n if (!$this->loginUserObj || !$this->loginUserObj->isRoleAdmin())\n {\n $this->request->redirect('/');\n }\n $user_id = sanitizeValue($this->request->param('route'));\n $userObj = Model_User::getUserObjById($user_id);\n $user = $this->auth->force_login($userObj->getEmail());\n if ($user) {\n $session = Session::instance();\n $session->set('login_as.id', $this->loginUserObj->getId());\n $session->set('login_as.name', $this->loginUserObj->getName());\n Model_Audit::log($this->loginUserObj->getId(), Model_Audit::TYPE_LOGIN_AS, $user_id);\n $this->request->redirect('/dashboard');\n } else {\n $this->request->redirect('/');\n }\n }", "public function login() {\n if ($this->validate()) {\n $this->setToken();\n return Yii::$app->user->login($this->getUser()/* , $this->rememberMe ? 3600 * 24 * 30 : 0 */);\n } else {\n return false;\n }\n }" ]
[ "0.74982136", "0.7285005", "0.719541", "0.7159535", "0.7145971", "0.714446", "0.7141981", "0.7127439", "0.71020496", "0.71008205", "0.700112", "0.69958115", "0.69860286", "0.69660354", "0.68840426", "0.6857562", "0.6850758", "0.68481517", "0.6808143", "0.6774936", "0.6761185", "0.67585015", "0.675052", "0.67491597", "0.6742141", "0.6730824", "0.6721394", "0.67171353", "0.6709864", "0.6709816", "0.6696927", "0.6681775", "0.66781557", "0.66748244", "0.6667475", "0.6655638", "0.66489303", "0.66447175", "0.66308945", "0.6629708", "0.66120005", "0.6602291", "0.66012937", "0.65995216", "0.65958154", "0.6583144", "0.6580281", "0.65801704", "0.6576315", "0.6575656", "0.6571598", "0.65349853", "0.6533604", "0.65260935", "0.6524374", "0.6516284", "0.6508706", "0.65018094", "0.65017223", "0.6498979", "0.64922875", "0.64853364", "0.64836913", "0.64794755", "0.64763117", "0.6475566", "0.64744353", "0.64716077", "0.64669037", "0.64512295", "0.6441047", "0.6437687", "0.64356565", "0.64019054", "0.64016455", "0.6397416", "0.6394927", "0.63946927", "0.6394022", "0.6394022", "0.639375", "0.6385602", "0.6385521", "0.63827944", "0.638222", "0.63818854", "0.63815874", "0.6377914", "0.6368705", "0.63639045", "0.63609254", "0.6355626", "0.6355089", "0.6353409", "0.6350812", "0.63500315", "0.63483775", "0.63466084", "0.63452244", "0.6344243", "0.6344026" ]
0.0
-1
/ Returns the new userId if successful, and probably null otherwise.
function createAccount($name, $password) { $sql = "insert ignore into users (name, password) values ('$name', '$password')"; return SQLInsert($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "public function getUserId() \n {\n if (!$this->hasUserId()) \n {\n $this->userId = 0;\n }\n\n return $this->userId;\n }", "public function getUserId(): int\n {\n return $this->userId;\n }", "public function getUserId() : int\n {\n return $this->userId;\n }", "public function getuserId()\n {\n return $this->userId;\n }", "abstract protected function getUserId() ;", "public function getUserId () {\n\t\treturn ($this->userId);\n\t}", "protected function getUserId() {}", "protected function getUserId() {}", "public function getUserId() {\n\t\treturn($this->userId);\n\t}", "public function getUserId() {\n\t\treturn ($this->userId);\n\t}", "public function get_userId()\n {\n return $this->_userId;\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId() {\n return($this->userId);\n }", "public function getuserId() : Uuid {\n\t\treturn($this->userId);\n\t}", "public function getUserId()\r\n {\r\n return $this->userId;\r\n }", "public function getUserId(): ?int\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "protected function getUserId(): int|string|null\n {\n if (!isset($this->userId)) {\n $this->userId = Auth::guard(config('nova.guard'))->id() ?? null;\n }\n\n return $this->userId;\n }", "public function getUserId() {\n\t\treturn $this->userId;\n\t}", "public function getUserId()\n {\n return($this->userId);\n }", "public function get_new_user_id() {\r\n $this->db->select_max('user_id');\r\n $u_id = $this->db->get('users');\r\n return $u_id->result();\r\n }", "public function getUserId(): ?int;", "public function get_user_id();", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public function getUserId() {\n return $this->userId;\n }", "public function getUserId() {\n return $this->userId;\n }", "public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }", "protected function _oldUser() {\n\t\t$user_id = trim($this->in('User ID:'));\n\n\t\tif (!$user_id || !is_numeric($user_id)) {\n\t\t\t$user_id = $this->_oldUser();\n\n\t\t} else {\n\t\t\t$result = $this->db->fetchRow(sprintf(\"SELECT * FROM `%s` AS `User` WHERE `id` = %d LIMIT 1\",\n\t\t\t\t$this->install['table'],\n\t\t\t\t$user_id\n\t\t\t));\n\n\t\t\tif (!$result) {\n\t\t\t\t$this->out('User ID does not exist, please try again.');\n\t\t\t\t$user_id = $this->_oldUser();\n\n\t\t\t} else {\n\t\t\t\t$this->install['username'] = $result['User'][$this->config['userMap']['username']];\n\t\t\t\t$this->install['password'] = $result['User'][$this->config['userMap']['password']];\n\t\t\t\t$this->install['email'] = $result['User'][$this->config['userMap']['email']];\n\t\t\t}\n\t\t}\n\n\t\treturn $user_id;\n\t}", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->_userId;\n }", "public function getUserId()\n {\n return $this->_userId;\n }", "public function getUserId()\n {\n return $this->_userId;\n }", "public function getUserId()\n {\n return $this->id;\n }", "public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userid;\n }", "public function getUserId()\n {\n return $this->userid;\n }", "public function getUserId()\n {\n return (int)$this->user_id;\n }", "public function getuserId()\n {\n return $this->_UserId;\n }", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "function getUserId() {\n\t\treturn $this->getData('userId');\n\t}", "protected static function getCurrentUserId()\n {\n return null;\n }", "public function getUserId()\n {\n $this->checkIfKeyExistsAndIsInteger('user_id');\n\n return $this->data['user_id'];\n }", "public function getCurrentUserId();", "public function getUserId() {\n\t\treturn $this->user_id;\n\t}", "public function getUserId()\r\n\t{\r\n\t\t$user = parent::getUser();\r\n\t\tif(!($user instanceof User))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $user->getId();\r\n\t}", "public function getUserID(){\n return($this->userID);\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId() {\n return $this->user === null ? null : $this->user->id;\n }", "public function getUserId()\n {\n return $this->UserId;\n }", "public function getUserId()\r\n\t{\r\n\t\treturn $this->_userid;\r\n\t}" ]
[ "0.74934316", "0.74084437", "0.730148", "0.7216413", "0.72060764", "0.71977395", "0.71835643", "0.7130337", "0.7130337", "0.71253604", "0.70991325", "0.7094112", "0.7089647", "0.70765954", "0.7073921", "0.70643413", "0.70387536", "0.70229006", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.7005922", "0.69924074", "0.6961589", "0.6948501", "0.6947203", "0.69177645", "0.6912704", "0.69037217", "0.69022477", "0.69022477", "0.6897716", "0.6896099", "0.68858945", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6881801", "0.6872837", "0.68445325", "0.68445325", "0.68445325", "0.6825112", "0.68244714", "0.6822656", "0.68056613", "0.6788715", "0.6788715", "0.6785205", "0.6783865", "0.6783783", "0.6761842", "0.67515594", "0.6749349", "0.6744453", "0.6742814", "0.6741693", "0.67272145", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6716196", "0.6695838", "0.6695838", "0.6695838", "0.66954213", "0.66845983", "0.6662156", "0.6660119" ]
0.0
-1
Game properties stuff / Returns the id of the created game (do check though). Returns 0 and fails if the name exists.
function createGame($name, $adminId) { $sql = "insert ignore into games (name, admin_id, user_to_play) values ('$name', $adminId, $adminId)"; $id = SQLInsert($sql); if ($id != 0) { $sql = "update users set game_id = $id where id = $adminId"; SQLUpdate($sql); distributeInitialCards($adminId); } // TODO?: choosing before dealing would allow us to skip that expansive call $unusedCards = getUnusedCards($id); do { $rand_index = array_rand($unusedCards); } while (($firstCard = $unusedCards[$rand_index]) == "plusfour"); $firstCard = $unusedCards[$rand_index]; SQLInsert("insert into placed_cards (game_id, card_name) values ($id, '$firstCard')"); return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGameId(): int\n {\n return $this->gameId;\n }", "public function getGameId(){\n\t\treturn $this->gameId;\n\t}", "private function createGame()\n {\n $hash = hash(\"md5\", uniqid(mt_rand(), true));\n $temphash = hash(\"md5\", uniqid(mt_rand(), true));\n\n // array with values to be inserted to the table\n $game = array(\n 'player1_hash' => $hash,\n 'player1_name' => \"Player 1\",\n 'player1_ships' => \"\",\n 'player2_hash' => $temphash,\n 'player2_name' => \"Player 2\",\n 'player2_ships' => \"\",\n 'timestamp' => Misc::getUtcTime()->getTimestamp()\n );\n\n $query = \"INSERT INTO games (player1_hash, player1_name, player1_ships,\n player2_hash, player2_name, player2_ships, timestamp)\n VALUES (?, ?, ?, ?, ?, ?, ?)\";\n $this->oDB->getAll($query, array_values($game));\n\n $game['player_number'] = 1; // player who starts is always No. 1\n $game['id'] = $this->oDB->lastInsertId();\n\n return $game;\n }", "public function write_new_game(){\n\n\t\t$query = \"INSERT INTO `games`\n\t\t( `title`, `user_count`, `info`, `bgimage`, `banner`, `level`, `api`)\n\t\tVALUES\n\t\t('$this->title', '$this->user_count', '$this->info', '$this->bgimage', '$this->banner', '$this->level', '$this->api')\";\n\n\t\tif(DB::sql($query)){\n\t\t\t$this->id = DB::last_id();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function getId() {\r\n\r\n return $this->getGameManager()->getGameId($this);\r\n\r\n }", "function Create() {\n $db = new DB();\n\n $data = [\n \"name\" => $this->name,\n ];\n\n if ($player_id = $db->modify(\"INSERT INTO Player (name) VALUES (:name)\", $data)) {\n return $player_id;\n } else\n return false;\n }", "function newGame() {\n\t$newid = uniqid();\n\t$newgame = [\n\t\t'open' => $newid,\n\t\t$newid => ['state' => 'open', 'players' => []],\n\t];\n\tupdateGames($newgame);\n\twriteGame($newid, ['round' => 0]);\n\n\treturn $newid;\n}", "function newGameID()\n{\n return randomString();\n}", "private function getGame() {\n if (!isset($this->params['game'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n\n $key = $this->params['game'];\n $game = new SnGames();\n\t\t$url = Url::getUrlByName($key, URL_GAME);\n\n\t\tif ($url) {\n\t\t\t$game->ID_GAME = $url->ID_OWNER;\n\t\t} else {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn FALSE;\n\t\t}\n\n $game = $game->getOne();\n\n return $game;\n }", "public function testNameOfTheGame()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertEquals($game_factory->name, sprintf(\"Game %s\", $game_factory->getKey()));\n }", "private function dealWithAddNewGame() {\r\n \r\n $imagePathFromRoot = str_replace('\\\\', '\\\\\\\\', str_replace(DIR_ROOT, '', $this->uploadGameImage()));\r\n \r\n $gameData = [\r\n self::FIELD_COMPLEXITY => filter_input(INPUT_POST, self::FIELD_COMPLEXITY),\r\n self::FIELD_DESCRIPTION => filter_input(INPUT_POST, self::FIELD_DESCRIPTION),\r\n self::FIELD_IMAGE => $imagePathFromRoot,\r\n self::FIELD_NAME => filter_input(INPUT_POST, self::FIELD_NAME),\r\n self::FIELD_PLAYERS_NUMBER => filter_input(INPUT_POST, self::FIELD_PLAYERS_NUMBER),\r\n self::FIELD_PLAY_TIME => filter_input(INPUT_POST, self::FIELD_PLAY_TIME),\r\n self::FIELD_PUBLISHER => filter_input(INPUT_POST, self::FIELD_PUBLISHER),\r\n self::FIELD_SITE_URL => filter_input(INPUT_POST, self::FIELD_SITE_URL),\r\n self::FIELD_TYPE => filter_input(INPUT_POST, self::FIELD_TYPE),\r\n ];\r\n \r\n $result = $this->model->saveGame($gameData);\r\n \r\n if ($result > 0) {\r\n $this->messages['ok'] = 'Game saved with ID ' . $result;\r\n } else {\r\n $this->messages['error'] = 'Some errors occured. Game not saved.';\r\n }\r\n }", "public function getGamerId()\n {\n $value = $this->get(self::GAMER_ID);\n return $value === null ? (integer)$value : $value;\n }", "public static function addGame() {\n\t\t$params = $_POST;\n\n\t\t$newGame = new Game(array(\n\t\t\t'name' => $params['name'],\n\t\t\t'url' => $params['url'],\n\t\t\t'desc' => $params['desc']\n\t\t\t));\n\n\t\t$errors = $newGame->errors();\n\n\t\tif (count($errors) == 0) {\n\t\t\t$gameId = $newGame->save();\n\t\t\t$accountId = parent::get_user_logged_in()->id;\n\t\t\tKint::dump(array($gameId, $accountId));\n\t\t\t$accountGame = new Account_game(array(\n\t\t\t\t'accountId' => $accountId,\n\t\t\t\t'gameId' => $gameId\n\t\t\t\t));\n\t\t\t$accountGame->save();\n\t\t\t$messages = array('game added');\n\t\t\tRedirect::to('/addGame', array('messages' => $messages));\n\t\t} else {\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t}\n\t}", "public function create_game(){\n $data = array(\n 'uid' => $this->input->post('uid'),\n 'player1_name' => $this->input->post('player-1-name'),\n 'player2_name' => $this->input->post('player-2-name')\n );\n return $this->db->insert('games', $data);\n }", "protected function getGameName( )\n {\n return \"pi\";\n }", "public function addgame()\n {\n $player = Player::findOrFail(Input::json('admin_id'));\n if (!$player->admin) {\n return Response::make('Not authorized', 403);\n }\n\n Game::create(['name' => Input::json('name')]);\n }", "function getGameNameById($game_id){\r\n\t\t\t$game=$this->fetchRow('id = '.$game_id)->toArray();\r\n\t\t\treturn $game['name'];\r\n\t\t}", "public function createGame($pdo, $playerID, $opponentID) {\n $pdo->beginTransaction();\n \n try {\n $activePlayerID = rand(0,1) == 0 ? $playerID : $opponentID;\n $sql = \"INSERT INTO game (opponent_1, opponent_2, activePlayerID) VALUES ({$opponentID}, {$playerID}, {$activePlayerID});\";\n \n $sth = $pdo->prepare($sql);\n \n $sth->execute();\n $currentID = $pdo->lastInsertId(); \n $pdo->commit();\n return $currentID;\n \n } catch (PDOException $e) {\n die(\"<p>{$e->getMessage()}\");\n $pdo->rollBack();\n return NULL;\n }\n }", "public function save_game(){\n\n\t\t$query = \"UPDATE `games`\n\t \tSET `title` = '$this->title', `user_count` = '$this->user_count', `api` = '$this->api',\n\t \t`info` = '$this->info', `bgimage` = '$this->bgimage', `banner` = '$this->banner', `level` = '$this->level'\n\t \tWHERE `id` = '$this->id'\";\n\n\t\tif(DB::sql($query)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function testCreateGame()\n {\n $game = new DiceGame(\"Hatem\", \"Computer\");\n $res = $game->player1->name;\n $exp = \"Hatem\";\n $this->assertEquals($exp, $res);\n }", "function deduce_game_id($game) {\n if(is_array($game))\n if(isSet($game['gra']))\n $game = isSet($game['gra']['id_gry']) ? $game['gra']['id_gry'] : null;\n else\n $game = isSet($game['id_gry']) ? $game['id_gry'] : null;\n\n return $game;\n}", "public function id() {\n return $this->Session->read('Authorization.Team.0.id');\n }", "function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }", "private function findGame($id) {\n $game = null;\n foreach($this->getGames() as $currentGame) {\n if($currentGame->getAppId() == $id ||\n $currentGame->getShortName() == $id ||\n $currentGame->getName() == $id) {\n $game = $currentGame;\n break;\n }\n }\n\n if($game == null) {\n if(is_int($id)) {\n $message = \"This SteamID does not own a game with application ID {$id}.\";\n } else {\n $message = \"This SteamID does not own the game \\\"{$id}\\\".\";\n }\n throw new SteamCondenserException($message);\n }\n\n return $game;\n }", "function getGameName($id) {\r\n\t\t$SQLerror = \"\";\r\n\t\t$query = \"SELECT gameName FROM games WHERE gameId=$id\";\r\n\t\t$result = mysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;;\r\n\t\t$row = mysql_fetch_row($result);\t\r\n\t\tif(mysql_affected_rows() > 0)\r\n\t\t\treturn $row[0];\r\n\t\telse\r\n\t\t\treturn \"\";\t\r\n\t}", "public static function getHolderID();", "function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }", "public static function create($input) \n\t{\n $input = clean_form_input($input);\n\n\n if ( ! isset($input['user_id'])) $input['user_id'] = user_id();\n\n $dev = Dev::where_name($input['developer_name'])->first();\n if ( ! is_null($dev)) {\n $input['developer_name'] = '';\n $input['developer_id'] = $dev->id;\n }\n else $input['developer_id'] = 0;\n\n if ( ! isset($input['privacy'])) $input['privacy'] = 'publishing';\n\n $input['approved_by'] = array();\n\n $input['crosspromotion_profiles'] = array('developers'=>array(),'games'=>array());\n $input['crosspromotion_key'] = Str::random(40);\n \n $game = parent::create($input);\n \n\n $msg = lang('game.msg.addgame_success', array(\n 'name' => $game->name,\n 'id' => $game->id\n ));\n HTML::set_success($msg);\n Log::write('game create success', $msg);\n\n\n $text = lang('emails.profile_created.html', array(\n 'user_name' => $game->user->name,\n 'profile_type' => 'game',\n 'profile_name' => $game->name,\n ));\n\n sendMail($game->user->email, lang('emails.profile_created.subject'), $text);\n\n\n return $game;\n }", "public function doCreateMatch($game_id, $game_name) {\n\t\t$this->mlog->debug('['. __METHOD__ .']');\n\n\t\t$resp = new Response();\n\n\t\ttry {\n\t\t\t$game = GameQuery::findPk($game_id);\n\t\t\tif ($game instanceof Game) {\n\t\t\t\t$match = Match::create($game, $game_name);\n\t\t\t\t$resp->data=$match->__toArray();\n\t\t\t}\n\t\t} catch (Exception $ex) {\n\t\t\t$resp->fail(Response::UNKNONWN_EXCEPTION, 'An error occured, please try again later');\n\t\t}\n\n\t\treturn $resp->__toArray();\n\t}", "public static function getID() {\r\n return 1;\r\n }", "function get_id() {\n \n $id_okay = true;\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n if(\"\" == ($id = isset($_GET[$this->name]) ? $_GET[$this->name] : \"\")) {\n $id = isset($_POST[$this->name]) ? $_POST[$this->name] : \"\";\n }\n \n ## check if the id consists of chars that make up a session\n if(ereg('[^a-z0-9]', $id)){\n\t\t$id_okay = false;\n\t}\n \n if( \"\" == $id || !$id_okay) {\n $newid=true;\n // I'll have to work on this class to figure out how this link works\n $id = md5(uniqid($this->magic));\n }\n \n if(isset($_SERVER['QUERY_STRING'])) {\n $_SERVER['QUERY_STRING'] = ereg_replace(\"(^|&)\".quotemeta(urlencode($this->name)).\"=(.)*(&|$)\",\"\\\\1\", $_SERVER['QUERY_STRING']);\n }\n \n $this->id = $id;\n }", "public function getById(Uuid $gameId): Game;", "protected function getID()\n {\n return rand();\n }", "static function findIdByName($name) {\n $campaign = self::findByName($name);\n if (count($campaign)>0) return $campaign['id'];\n return 0;\n }", "public function store(Request $request){\n \t$this->validate($request, [\n \t\t'name'\t=> 'required'\n \t]);\n\n \treturn Game::create([\n \t\t'name' => request('name'),\n \t \t'user_id' => Auth::user()->id,\n \t \t'players' => (null),\n \t\t'movies' => (null),\n\t\t\t'guesses' => (null),\n\t\t\t'scores' => (null),\n\t\t\t'critic_scores' => (null),\n 'overall_scores' => (null),\n 'id'\n \t\t]);\n }", "function game_ai_create_new_player() {\n global $game, $base_url, $ai_output;\n\n while (TRUE) {\n $num = mt_rand(0, 99999);\n $id_to_check = 'ai-' . $num;\n zg_ai_out(\"checking for existing player $id_to_check\");\n\n $sql = 'select id from users\n where phone_id = \"%s\";';\n $result = db_query($sql, $id_to_check);\n $item = db_fetch_object($result);\n\n if (empty($item)) {\n break;\n }\n }\n\n $uri = $base_url . \"/$game/home/$id_to_check\";\n zg_ai_out(\"phone_id $id_to_check not in use; URI is $uri\");\n $response = zg_ai_web_request($id_to_check, 'home');\n zg_ai_out($response);\n\n zg_ai_out('updating record to make this a ToxiCorp Employee');\n $sql = 'update users set username = \"%s\", fkey_neighborhoods_id = 75,\n fkey_values_id = 9, `values` = \"Goo\", meta = \"ai_minion\"\n where phone_id = \"%s\";';\n db_query($sql, \"TC Emp $num\", $id_to_check);\n $ai_bot = zg_fetch_user_by_id($id_to_check);\n // mail('[email protected]', 'ai trying to create a new player AGAIN', $ai_output);.\n zg_slack($ai_bot, 'bots', 'new bot creation', $ai_output);\n}", "public function testExists()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertDatabaseHas($game_factory->getTable(), ['game_hash_file' => $game_factory->game_hash_file]);\n }", "public function create()\n {\n //abort, if user is not admin (-> ID = 1)\n abort_if(auth()->user()->id !== 1, 403);\n return view('game.create');\n }", "public static function id()\n {\n return 1;\n }", "public function setGame($id){\n\t\t$this->game = new Game($id);\n\t}", "public function create()\n {\n if (! Gate::allows('game_create')) {\n return abort(401);\n }\n $relations = [\n 'owners' => \\App\\Player::get()->pluck('nickname', 'id')->prepend('Please select', ''),\n 'players' => \\App\\Player::get()->pluck('nickname', 'id'),\n 'owner_etalon_results' => \\App\\GameResult::get()->pluck('is_owner_etalon', 'id')->prepend('Please select', ''),\n 'scenarios' => \\App\\Scenario::get()->pluck('name', 'id')->prepend('Please select', ''),\n 'game_results' => \\App\\GameResult::get()->pluck('is_owner_etalon', 'id'),\n ];\n\n return view('games.create', $relations);\n }", "protected function createGame($data = null)\n {\n $generator = new Generator();\n if ($data) {\n $game = $generator->createGameFromVisualBlock($data);\n }\n else {\n $game = $generator->createGame();\n }\n $game->setStatus(Game::STARTED);\n return $game; \n }", "public function create() {\n global $db;\n $this->_precreate();\n $sql_keys = ''; $sql_values = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_keys .= \"`\".addslashes($key).\"`,\";\n $sql_values .= \"?,\";\n $data[] = $value;\n }\n $sql_keys = substr($sql_keys, 0, -1);\n $sql_values = substr($sql_values, 0, -1);\n\n $query = \"INSERT INTO {$this->table} ($sql_keys) VALUES ($sql_values);\";\n $result = $db->query($query,$data);\n if (!isset($this->_magicProperties['id']) || !$this->_magicProperties['id']) {\n $id = $db->lastInsertId();\n $this->{'set'.$this->id_field}($id);\n }\n $this->loaded = true;\n $this->_postcreate($result);\n return $this->id;\n }", "public function NewGameAction()\n {\n $g = new Game;\n $g->init();\n\n $gameName = $g->getName();\n $this->session->set('gameName', $gameName);\n\n $e = Event::getFirst($gameName);\n\n $g->setResumeDate($e->getDate());\n $g->update();\n\n //$startDate = $g->getFirstDate();\n //$this->session->set('current_date', $startDate);\n\n // redirect to continue\n \n return $this->redirect(\"/resume/$gameName\");\n }", "public function loadGame($id){\n\t\t$this->game = new Game($id);\n\t\treturn $this->game;\n\t}", "public function create()\n {\n $this->db->query('INSERT INTO ' . $this->db->tableName('p_democracy_votes') . ' (' . $this->db->fieldName('voting_id') . ', ' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('type') . ', ' . $this->db->fieldName('comment') . ') VALUES (0, 0, 0, '');\n\n // reads created voting's ID\n $this->data['id'] = $this->db->lastInsertId();\n\n // return name of newly created \n return $id;\n }", "function fetchId($name)\n {\n //return $this->_parent->_name.'-'.\"popup-$name[1]\";\n return $this->_parent->getName().'-'.\"popup-$name[1]\";\n }", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "public function getGame()\n {\n return $this->game;\n }", "function game()\r\n {\r\n return $this->Game;\r\n }", "public function game()\n {\n return $this->game;\n }", "function get_room_id($name) {\n global $DB;\n\n return $DB->get_record('roomscheduler_rooms', array('name' => $name));\n}", "public function getGame() {\n return $this->game;\n }", "static function getnerateIdByName($name)\n\t{\n\t\treturn md5(strtolower($name));\n\t}", "public function save(game $game) \n {\n\n $logo = $game->getLogo();\n $bg = $game->getBackground();\n\n $this->imageDAO->save($logo);\n $this->imageDAO->save($bg);\n\n $gameData = array(\n 'game_title' => $game->getTitle(),\n 'game_logo_id' => $logo->getId(),\n 'game_bg_id' => $bg->getId()\n );\n\n if ($game->getId()) {\n // The game has already been saved : update it\n $this->getDb()->update('game', $gameData, array('game_id' => $game->getId()));\n } else {\n // The game has never been saved : insert it\n $this->getDb()->insert('game', $gameData);\n // Get the id of the newly created game and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $game->setId($id);\n }\n }", "public function getID();", "public function getID();", "public function getID();", "public function initGame($hash = \"\")\n {\n $game = $hash === \"\" ? $this->createGame() : $this->getGameByHash($hash);\n\n $this->oData->setIdGames($game['id']);\n\n $events = $this->getEvents(array(\"shot\", \"join_game\", \"start_game\"));\n $playerNumber = $game['player_number'];\n $otherNumber = $playerNumber == 1 ? 2 : 1;\n $playerPrefix = \"player\" . $playerNumber;\n $otherPrefix = \"player\" . $otherNumber;\n $shots = array_key_exists('shot', $events) ? $events['shot'] : array();\n $joined = array_key_exists('join_game', $events) ? $events['join_game'] : array();\n $started = array_key_exists('start_game', $events) ? $events['start_game'] : array();\n $playerShots = array_key_exists($playerNumber, $shots) ? $shots[$playerNumber] : \"\";\n $otherShots = array_key_exists($otherNumber, $shots) ? $shots[$otherNumber] : \"\";\n $playerJoined = array_key_exists($playerNumber, $joined);\n $otherJoined = array_key_exists($otherNumber, $joined);\n $playerStarted = array_key_exists($playerNumber, $started);\n $otherStarted = array_key_exists($otherNumber, $started);\n\n $this->oData->setGameTimestamp($game['timestamp']);\n $this->oData->setPlayerNumber($playerNumber);\n $this->oData->setOtherNumber($otherNumber);\n $this->oData->setPlayerHash($game[$playerPrefix.'_hash']);\n $this->oData->setOtherHash($game[$otherPrefix.'_hash']);\n $this->oData->setPlayerName($game[$playerPrefix.'_name']);\n $this->oData->setOtherName($game[$otherPrefix.'_name']);\n $this->oData->setPlayerShips($game[$playerPrefix.'_ships']);\n $this->oData->setOtherShips($game[$otherPrefix.'_ships']);\n $this->oData->setPlayerShots($playerShots);\n $this->oData->setOtherShots($otherShots);\n $this->oData->setPlayerJoined($playerJoined);\n $this->oData->setOtherJoined($otherJoined);\n $this->oData->setPlayerStarted($playerStarted);\n $this->oData->setOtherStarted($otherStarted);\n $this->oData->setLastIdEvents($this->findLastIdEvents($otherNumber));\n\n if (!$this->oData->getPlayerJoined()) {\n $this->joinGame();\n }\n\n $this->determineWhoseTurn();\n }", "public function getPlayer_id() {\n return $this->getValue('player_id');\n }", "protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}", "function addGame($data){\r\n\t\t\treturn $this->insert($data);\r\n\t\t}", "public function id(): string\n {\n if ($this->id) {\n return $this->id;\n }\n\n if ($this->name) {\n return $this->id = $this->generateIdByName();\n }\n\n return $this->id = Str::random(4);\n }", "function store()\n {\n $this->dbInit();\n query( \"INSERT INTO Grp set Name='$this->Name', Description='$this->Description',\n\tUserAdmin='$this->UserAdmin',\n\tUserGroupAdmin='$this->UserGroupAdmin',\n\tPersonTypeAdmin='$this->PersonTypeAdmin',\n\tCompanyTypeAdmin='$this->CompanyTypeAdmin',\n\tPhoneTypeAdmin='$this->PhoneTypeAdmin',\n\tAddressTypeAdmin='$this->AddressTypeAdmin'\" );\n return mysql_insert_id();\n }", "public function determineId() {}", "public function getId()\n {\n return $this->systemProperties->getId();\n }", "public function getId(): string\n {\n return $this->name;\n }", "public function getIdentifier()\n {\n return 1;\n }", "protected function ensure_id()\n\t{\n\t\t$existing = $this->id();\n\t\t\n\t\tif(empty($existing))\n\t\t{\n\t\t\t$this->id(Tools_Storage::id());\n\t\t}\n\t\t\n\t\treturn $this->id();\n\t}", "public static function getID()\n {\n return self::getInstance()->_getID();\n }", "function test_getIdByName() {\r\n\t\t$myName = \"moderator\";\r\n $myId = MemberClassesDB::getIdByName($myName);\r\n\t\t$this->assertEqual($myId, \"3\",\r\n\t\t\t\t\"Should return 3 for name moderator but returned \".$myId);\r\n\t}", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "public function getIdByName($name) {\n $id = $this->db->queryToSingleValue(\n \t\"select \n \t\tid\n from \n \tOvalSourceDef \n where\n \tname='\".mysql_real_escape_string($name).\"'\");\n if ($id == null) {\n return -1;\n }\n return $id;\n }", "function joinGame($gameID, $playerName)\n{\n $dbh = connectToDatabase();\n\n if (!$gameID) {\n\n // Check that there is no game already using this ID\n $gameIDIsUnique = true;\n // If $gameID empty, create new game\n $gameID = newGameID();\n // Count number of rows with $gameID\n $stmt = $dbh->prepare('SELECT COUNT(1) FROM games WHERE gameID = ?');\n do {\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if ($result[0] > 0) {\n // Wait, there is a game already using this ID. Try again\n $gameIDIsUnique = false;\n }\n } while (!$gameIDIsUnique);\n\n // First player in a game becomes the GM\n $playersData = json_encode([$playerName]);\n $gameData = json_encode(new stdClass);\n $stmt = $dbh->prepare(\"INSERT INTO games VALUES (?, ?, ?, ?, 0, NOW())\");\n if ($stmt->execute([$gameID, $playersData, $gameData, $playerName])) {\n // Now, send new gameID back to the host player\n exit($gameID);\n } else {\n http_response_code(500);\n die('GAME NOT CREATED');\n }\n } else {\n // Otherwise, join game with passed gameID\n // Get whatever players are now in the database\n $stmt = $dbh->prepare('SELECT players FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n // There should be only one game with this ID, so join first one with matched ID\n $players = json_decode($result[0], true);\n // Add this player to the players array, and insert back into the entry\n array_push($players, $playerName);\n $playersData = json_encode($players);\n\n $stmt = $dbh->prepare('UPDATE games SET players = ? WHERE gameID = ?');\n\n if ($stmt->execute([$playersData, $gameID])) {\n // Signal the client that the game is ready\n exit('PLAYER');\n } else {\n http_response_code(500);\n die('NOT JOINED GAME');\n }\n }\n\n // Now store the gameID in $_SESSION, so that we stay connected until the browser is closed\n $_SESSION['gameID'] = $gameID;\n $_SESSION['playerName'] = $playerName;\n}", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "static function getGame($pid) {\n $gamePath = \"../writable/games/$pid.txt\"; \n\n $file = fopen($gamePath, 'rb') or die(\"Cannot open game file: \" . $gamePath);\n $contents = fread($file, filesize($gamePath));\n fclose($file);\n\n $game = json_decode($contents); # deserialize\n\n $instance = new self($game->strategy);\n $instance->board = json_decode(json_encode($game->board), true);\n return $instance;\n }", "function generate_id() {\n $this->last_image_id ++;\n return $this->last_image_id;\n }", "function db_pwassist_create_id()\n{\n\t// Implementation note: we use the PHP Session id\n\t// generation mechanism to create the session id.\n\t$old_session_id = session_id();\n\tsession_regenerate_id();\n\t$pwassist_id = session_id();\n\tsession_id($old_session_id);\n\n\treturn $pwassist_id;\n}", "function GetId ()\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $data = $this->mongo->dataFindOne( array( \"username\" => $this->username ) );\n return isset( $data[ \"_id\" ] ) ? $data[ \"_id\" ] : 0;\n }", "public function getID(): string {\n\t\treturn $this->appName;\n\t}", "public static function create($name,$type) { \n\n\t\t$name = Dba::escape($name);\n\t\t$type = Dba::escape($type);\n\t\t$user = Dba::escape($GLOBALS['user']->id);\n\t\t$date = time();\n\n\t\t$sql = \"INSERT INTO `playlist` (`name`,`user`,`type`,`date`) \" . \n\t\t\t\" VALUES ('$name','$user','$type','$date')\";\n\t\t$db_results = Dba::write($sql);\n\n\t\t$insert_id = Dba::insert_id();\n\n\t\treturn $insert_id;\n\n\t}", "public function getInGame() : int {\n\t\treturn $this->generator->getInGame();\n\t}", "function _createTeam($name, $personID){\n\n\t$dbQuery = sprintf(\"INSERT INTO Team\n\t\t(Name, PersonID, TeamID) VALUES\n\t\t('%s', '%s', UUID())\",\n\t\tmysql_real_escape_string($name),\n\t\tmysql_real_escape_string($personID));\n\t//echo $dbQuery;\n\tif(!insertQuery($dbQuery)){\n\t\tdatabaseError();\n\t}\n\telse{\n\n\t\t$teamIDQ = sprintf(\"SELECT TeamID FROM Team\n\t\t\tWHERE Name='%s' AND PersonID='%s'\",\n\t\t\tmysql_real_escape_string($name),\n\t\t\tmysql_real_escape_string($personID));\n\t\t$id = getDBResultsArray($teamIDQ)[0]['TeamID'];\n\t\t//echo \"\\n\";\n\t\t//echo $id;\n\t\t//Without triggers, there's no better way to do this\n\t\t$insertMemberQ = sprintf(\"INSERT INTO TeamMembers (TeamID, PersonID) VALUES\n\t\t\t('%s', '%s')\",\n\t\t\tmysql_real_escape_string($id),\n\t\t\tmysql_real_escape_string($personID));\n\t\tif(!insertQuery($insertMemberQ)){\n\t\t\tdatabaseError();//TODO - anything but this\n\t\t}\n\t\telse{\n\t\t\techo json_encode(Array(\"Success\"=>\"Team Created\"));\n\t\t}\n\t}\n}", "public function ID(): int;", "function writeGame($id, $data) {\n\tif (!file_exists('data/games')) {\n\t\tmkdir('data/games', 0744);\n\t}\n\tfile_put_contents(\"data/games/$id.json\", json_encode($data));\n}", "function EnsurePlayerExists($name, $class, $guildid, $server, $faction){\r\n global $sql;\r\n\r\n $server = sql::Escape($server);\r\n $name = sql::Escape(trim($name));\r\n\r\n $row = $sql->QueryRow(\"SELECT * FROM dkp_users WHERE name = '$name' AND server='$server'\");\r\n if($sql->a_rows == 0) {\r\n $this->message.=\"New player found - adding $name to the database<br />\";\r\n //player doesn't exists\r\n unset($player);\r\n $player = new dkpUser();\r\n $player->name = $name;\r\n $player->class = $class;\r\n $player->server = $server;\r\n $player->faction = $faction;\r\n $player->server = $server;\r\n $player->guild = $guildid;\r\n $player->saveNew();\r\n $toReturn = $player;\r\n }\r\n else {\r\n unset($toReturn);\r\n $toReturn = new dkpUser();\r\n $toReturn->loadFromRow($row);\r\n\r\n }\r\n return $toReturn;\r\n }", "protected function getNewProjectName() {\n\t\tdo {\n\t\t\t$t_name = $this->getName() . '_' . rand();\n\t\t\t$t_id = $this->client->mc_project_get_id_from_name( $this->userName, $this->password, $t_name );\n\t\t} while( $t_id != 0 );\n\t\treturn $t_name;\n\t}", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "function getID();", "public function uniqueId(): string\n {\n return $this->person->id;\n }", "function TblGames($name, $op, $id) {\r\n\t\t\r\n\t\tTable::Table($name, $op, $id);\r\n\t\t\r\n\t\t$this->cfg->cup_id->name = \"cup_id\";\r\n\t\t$this->cfg->cup_id->public_name = _CUPNAME;\r\n\t\t$this->cfg->cup_id->db_list = _DB_PREFIX.'_cups';\r\n\t\t$this->cfg->cup_id->db_list_pk = \"id\";\r\n\t\t$this->cfg->cup_id->db_list_sel = \"cup\";\r\n\t\t$this->cfg->cup_id->db_list_cond = \"close!=1\";\r\n\t\t$this->cfg->cup_id->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->chief_pn->name = \"chief_pn\";\r\n\t\t$this->cfg->chief_pn->no_add = 1;\r\n\t\r\n\t\t$this->cfg->game->name = \"game\";\r\n\t\t$this->cfg->game->public_name = _GAMENAME;\r\n\t\t$this->cfg->game->type = 'text';\r\n\t\t$this->cfg->game->maxlength = 64;\r\n\t\t$this->cfg->game->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->town->name = \"town\";\r\n\t\t$this->cfg->town->public_name = _GAMETOWN;\r\n\t\t$this->cfg->town->type = 'text';\r\n\t\t$this->cfg->town->maxlength = 32;\r\n\t\t$this->cfg->town->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->place->name = \"place\";\r\n\t\t$this->cfg->place->public_name = _GAMEPLACE;\r\n\t\t$this->cfg->place->type = 'text';\r\n\t\t$this->cfg->place->maxlength = 32;\r\n\t\t$this->cfg->place->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->dt->name = \"dt\";\r\n\t\t$this->cfg->dt->public_name = _GAMEDATE;\r\n\t\t$this->cfg->dt->type = 'text';\r\n\t\t$this->cfg->dt->maxlength = 10;\r\n\t\t$this->cfg->dt->is_date = 1;\r\n\t\t$this->cfg->dt->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->game_mode->name = \"game_mode\";\r\n\t\t$this->cfg->game_mode->public_name = _Rodzajgry;\r\n\t\t$this->cfg->game_mode->radio = 'mode_select';\r\n\t\t$this->cfg->game_mode->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->ratio->name = \"ratio\";\r\n\t\t$this->cfg->ratio->no_add = 1;\r\n\t\t\r\n\t\t$this->cfg->game_status->name = \"game_status\";\r\n\t\t$this->cfg->game_status->no_add = 1;\r\n\t}", "public static function IDForDBName( $name ){ return Database::APICallUp( array( 'IDForDBName' => $name ), \"Could not lookup database with name \" . $name ); }" ]
[ "0.66978693", "0.6588425", "0.62698066", "0.61452216", "0.61289537", "0.6123206", "0.6059052", "0.5971827", "0.57783186", "0.57557243", "0.562535", "0.55630124", "0.5533002", "0.54154944", "0.5392804", "0.5391795", "0.53353864", "0.5331275", "0.53286284", "0.5281984", "0.52818364", "0.5260427", "0.5238476", "0.52331054", "0.5222542", "0.5219094", "0.5211746", "0.52072227", "0.5187625", "0.51722395", "0.51437855", "0.51380646", "0.5121245", "0.51185924", "0.51165223", "0.5110538", "0.5107305", "0.5080749", "0.5056", "0.505267", "0.50444865", "0.5044351", "0.5044246", "0.5034514", "0.50338876", "0.5027772", "0.50255847", "0.5025168", "0.5005183", "0.49868256", "0.49778205", "0.49696296", "0.49522343", "0.49392965", "0.49303022", "0.49250698", "0.49250698", "0.49250698", "0.491369", "0.49086034", "0.48996875", "0.48952174", "0.48916957", "0.48879704", "0.4885517", "0.48830894", "0.48829913", "0.4880631", "0.48595634", "0.48577988", "0.48520717", "0.4843704", "0.48420572", "0.48352477", "0.48335096", "0.48328385", "0.4832541", "0.4829954", "0.48251384", "0.48245996", "0.48227587", "0.48190182", "0.4813472", "0.48130512", "0.48091906", "0.48089978", "0.48078746", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48063165", "0.48028618", "0.48019257", "0.48018134", "0.48014686" ]
0.56264144
10
/ Returns an array of games (id, name) that exist but haven't started yet.
function listAvailableGames() { $sql = "select id, name, admin_id from games where has_started = 0"; return parcoursRs(SQLSelect($sql)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGames(){\n\t\t$sql = new SqlManager();\n\t\t$sql->setQuery(\"SELECT game_id FROM game WHERE game_status != 'finished'\");\n\t\t$sql->execute();\n\t\t\n\t\t$games = array();\n\t\twhile($row = $sql->fetch()){\n\t\t\t$games[] = new Game($row['game_id']);\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "function getWaitingGames()\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t\n\t\t$query = \"SELECT DISTINCT g.gid, g.year, g.season, g.players\n\t\t\t\t\tFROM games g, in_game i\n\t\t\t\t\tWHERE g.running=false and g.gid=i.gid and not i.uid='$uid';\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$games = array();\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "private static function setupGames()\n {\n $teams = self::setUpTeams();\n $games = [];\n\n do {\n $games[] = new Game(array_pop($teams), array_pop($teams));\n } while (count($teams) > 0);\n\n return $games;\n }", "public function getGames()\n {\n $xary = array();\n foreach ($this->games as $info) {\n $xary[] = new Game($info->resource_id);\n }\n return $xary;\n }", "public function findAllGames()\n {\n return $this->entityManager->getRepository('Model\\Entity\\Game')->findAll();\n }", "public function getGames() {\n if(empty($this->games)) {\n $this->fetchGames();\n }\n\n return $this->games;\n }", "public static function getUnassignedPlayers() {\n CommonDao::connectToDb();\n $query = \"select p.*\n from player p left outer join team_player tp\n on p.player_id = tp.player_id\n where tp.team_id is null\n order by p.last_name, p.first_name\";\n return PlayerDao::createPlayersFromQuery($query);\n }", "private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }", "function unfinished_rounds() {\n global $db;\n $stmt = $db->query('SELECT roundid, classid FROM Rounds'\n .' WHERE NOT EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid)'\n .' OR EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid'\n .' AND finishtime IS NULL AND finishplace IS NULL)');\n $result = array();\n foreach ($stmt as $row) {\n $result[$row[0]] = $row[1];\n }\n return $result;\n}", "public function get_games($id = FALSE){\n if($id === FALSE){\n $this->db->order_by('id', 'DESC');\n $query = $this->db->get('games');\n return $query->result_array();\n }\n $query = $this->db->get_where('games', array('id' => $id));\n return $query->row_array();\n }", "public function get_games()\n {\n return $this->games;\n }", "public function getGamesList()\n {\n $games_list = array();\n try {\n $db = new Database();\n $db->connect();\n $query = $db->getConnection()->prepare(\"SELECT * FROM Games\");\n $query->execute();\n foreach ($query->fetchAll() as $data) {\n $item = new Games($data[0], $data[1], $data[2], $data[3], \"$\" . $data[4], $data[5]);\n array_push($games_list, $item);\n }\n } catch (PDOException $pdo_exception) {\n echo \"Error: \" . $pdo_exception->getMessage() . \"\\n\";\n }\n $db->disconnect();\n return $games_list;\n }", "public function games()\n {\n \t$start_date = $this->attributes['start_date'];\n \t$end_date = $this->attributes['end_date'];\n\n \t$games = Game::whereBetween('game_date',[$start_date, $end_date])->get();\n\n return $games;\n }", "function getActiveGamesList () {\n\tglobal $bdd;\n\t$req = $bdd->prepare('\n\t\tSELECT *\n\t\tFROM parties\n\t\tORDER BY id_partie;\n\t');\n\t$req->execute();\n\t$list = array();\n\twhile ($row = $req->fetch()) {\n\t\t$list[] = array(\n\t\t\t'id_partie' => $row['id_partie'],\n\t\t\t'nom' => $row['nom'],\n\t\t\t'createur' => getLoginForPlayer($row['createur']),\n\t\t\t'date_debut' => $row['date_debut'],\n\t\t\t'date_fin' => $row['date_fin'],\n\t\t\t'partie_privee' => ($row['password'] === sha1('') || $row['password'] === NULL) ? 'NO' : 'YES',\n\t\t\t'players' => getListeJoueursPartie($row['id_partie'])\n\t\t);\n\t}\n\treturn $list;\n}", "public function getGames()\n {\n return $this->games;\n }", "public function getReplays()\n {\n $sql = \"\n SELECT *\n FROM games \n ORDER BY id DESC LIMIT 20\n \";\n\n $data = $this->db->exec($sql);\n\n //remove all previous replays\n if ($data && count($data) == 20)\n {\n $last = end($data);\n $sql = \"\n DELETE \n FROM games \n WHERE id < {$last['id']}\n \";\n $this->db->exec($sql);\n }\n\n return $data;\n }", "public static function getWorkGames(): Collection\n {\n // getting game collection\n $games = V2Game::where('id', '!=', 1)->get(['name', 'alias']);\n\n return $games;\n }", "function unfinished_rounds() {\n global $db;\n // GPRM databases may have RaceChart entries with null racerid for byes; these\n // do not mark an unfinished heat. A round is \"unfinished\" if it has no heats\n // scheduled, or if there are scheduled heats that have no results.\n $stmt = $db->query('SELECT roundid, classid FROM Rounds'\n .' WHERE NOT EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid)'\n .' OR EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid'\n .' AND racerid IS NOT NULL'\n .' AND finishtime IS NULL AND finishplace IS NULL)');\n $result = array();\n foreach ($stmt as $row) {\n $result[$row[0]] = $row[1];\n }\n return $result;\n}", "function getAllGames() {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games\");\n $query->execute();\n\n return $query->fetchAll();\n }", "private function make_game_list($all_games, $league_games)\n {\n $games = array();\n $i = 0;\n for ($i=0; $i < $all_games.count(); $i++) { \n for ($j=0; $j < $league_games.count(); $j++) { \n if($all_games[$i]['id'] == $league_games[$j]['games_id'])\n {\n array_push($games, $all_games[$i]);\n }\n }\n }\n\n return $games;\n }", "public function orderGames() : array {\n\t\tif (count($this->games) < 5) {\n\t\t\treturn $this->games->get();\n\t\t}\n\t\t$this->games->resetAutoIncrement();\n\t\treturn $this->generator->orderGames();\n\t}", "public function get_games()\n\t\t{\n\t\t\t$retArr = null;\n\t\t\t// Scaffolding Code For Single:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\t\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\tif (empty($retArr)){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $retArr;\n\t\t}", "public function findNotSentToCalendar()\n {\n $sql = <<<SQL\n SELECT s.*, p.title as program_name \n FROM ec_shows s, ec_programs p\n WHERE sent_to_calendar like ''\n AND s.program_id = p.id\nSQL;\n $sqlQuery = new SqlQuery($sql);\n return $this->getList($sqlQuery);\n }", "public static function getUndraftedPlayers($year) {\n CommonDao::connectToDb();\n $query = \"select p.* from player p where p.player_id not in (\n select player_id from (select distinct b.player_id from ping_pong b\n where b.year = $year and b.player_id is not null) as t1\n union\n select player_id from (select distinct dp.player_id from draft_pick dp\n where dp.year = $year and dp.player_id is not null) as t2)\n order by p.last_name, p.first_name\";\n return PlayerDao::createPlayersFromQuery($query);\n }", "public function games()\n {\n return $this->hasMany(Game::class);\n }", "function clearGames() {\n\twriteGames([]);\n\tdeleteDirectory('data/games');\n}", "public function getGameIds() {\n if (empty($this->gameIds)) {\n foreach ($this->getTournaments() as $tourney) {\n $this->gameIds = array_merge($this->gameIds, $tourney->getGameIds());\n }\n\n }\n return $this->gameIds;\n }", "public function listGame()\n {\n return $this->db->get('game', 8, 9)->result();\n }", "public function getGames() {\n $dirGames = \"../../../ressources/savedGames/\";\n\t$gamesData = array();\n\t$index = 0;\n\tif (is_dir($dirGames)) {\n\t\tif ($dh = opendir($dirGames)) {\n\t\t\twhile (($file = readdir($dh)) !== false) {\n\t\t\t\tif (HackenBush::getInstance()->ext($file) == 'txt') {\n\t\t\t\t\t$gamesData[$index] = HackenBush::getInstance()->getInfo($file);\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}\n\treturn $gamesData;\n }", "private function createGame()\n {\n $hash = hash(\"md5\", uniqid(mt_rand(), true));\n $temphash = hash(\"md5\", uniqid(mt_rand(), true));\n\n // array with values to be inserted to the table\n $game = array(\n 'player1_hash' => $hash,\n 'player1_name' => \"Player 1\",\n 'player1_ships' => \"\",\n 'player2_hash' => $temphash,\n 'player2_name' => \"Player 2\",\n 'player2_ships' => \"\",\n 'timestamp' => Misc::getUtcTime()->getTimestamp()\n );\n\n $query = \"INSERT INTO games (player1_hash, player1_name, player1_ships,\n player2_hash, player2_name, player2_ships, timestamp)\n VALUES (?, ?, ?, ?, ?, ?, ?)\";\n $this->oDB->getAll($query, array_values($game));\n\n $game['player_number'] = 1; // player who starts is always No. 1\n $game['id'] = $this->oDB->lastInsertId();\n\n return $game;\n }", "public function testShouldReturnAllGames()\n {\n $response = $this->call('GET', '/games/all');\n\n $this->assertTrue(500, $response->status());\n }", "public function _getAbsentGroupMeetings()\n {\n $meetings = [];\n foreach ($this->meetings as $meeting)\n if ($meeting->IsGroupMeeting)\n if ($meeting->_joinData->away_reason !== '')\n $meetings[] = $meeting;\n\n return $meetings;\n }", "function getPlayersGames($page)\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t$games = array();\n\t\t\n\t\t\n\t\t$query = ($page == \"ord\") ? \n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid'\n\t\t\tAND i.uid <>\n\t\t\tALL (\n\t\t\t\tSELECT DISTINCT o.uid\n\t\t\t\tFROM games g1, orders o\n\t\t\t\tWHERE g1.gid = g.gid\n\t\t\t\tAND g.gid = o.gid\n\t\t\t\tAND g.year = o.year\n\t\t\t\tAND g.season = o.season\n\t\t\t\t);\" \n\t\t\t:\n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "public function games()\n {\n return $this->belongsToMany('DashboardersHeaven\\Game')\n ->withPivot([\n 'earned_achievements',\n 'current_gamerscore',\n 'max_gamerscore',\n 'last_unlock'\n ])\n ->withTimestamps();\n }", "public function getNonRSVPGuests()\n {\n $query = 'select name, username from users where isRSVP = 0;';\n if ($this->connectedModel->runQuery($query)) //query\n {\n while ($row = $this->connectedModel->getResultsAssoc())\n {\n $array[] = array('name' => $row['name'], 'username' => $row['username']);\n }\n return $array;\n }\n else\n {\n return -1;\n } \n }", "public function games()\n {\n return $this->hasMany(Game::class, 'user_id', 'user_id');\n }", "public function importGames()\n {\n $results = array();\n $games = Input::all();\n\n foreach ($games as $gameData) {\n $game = MrAntGame::create(array(\n \"subject_id\" => $gameData[\"subject_id\"],\n \"session_id\" => $gameData[\"session\"],\n \"test_name\" => (empty($gameData[\"studyName\"])) ? \"Untitled Test\" : $gameData[\"studyName\"],\n \"grade\" => $gameData[\"grade\"],\n \"dob\" => $gameData[\"birthdate\"],\n \"age\" => $gameData[\"age\"],\n \"sex\" => $gameData[\"sex\"],\n \"played_at\" => $gameData[\"date\"] . \":00\",\n \"score\" => (!empty($gameData[\"score\"])) ? $gameData[\"score\"] : \"\",\n \"ts_start\" => (empty($gameData[\"timestamps\"][\"Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Start\"])),\n \"ts_lvl1_start\" => (empty($gameData[\"timestamps\"][\"Level 1 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 1 Start\"])),\n \"ts_lvl1_end\" => (empty($gameData[\"timestamps\"][\"Level 1 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 1 End\"])),\n \"ts_lvl2_start\" => (empty($gameData[\"timestamps\"][\"Level 2 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 2 Start\"])),\n \"ts_lvl2_end\" => (empty($gameData[\"timestamps\"][\"Level 2 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 2 End\"])),\n \"ts_lvl3_start\" => (empty($gameData[\"timestamps\"][\"Level 3 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 3 Start\"])),\n \"ts_lvl3_end\" => (empty($gameData[\"timestamps\"][\"Level 3 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 3 End\"])),\n \"ts_lvl4_start\" => (empty($gameData[\"timestamps\"][\"Level 4 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 4 Start\"])),\n \"ts_lvl4_end\" => (empty($gameData[\"timestamps\"][\"Level 4 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 4 End\"])),\n \"ts_lvl5_start\" => (empty($gameData[\"timestamps\"][\"Level 5 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 5 Start\"])),\n \"ts_lvl5_end\" => (empty($gameData[\"timestamps\"][\"Level 5 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 5 End\"])),\n \"ts_lvl6_start\" => (empty($gameData[\"timestamps\"][\"Level 6 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 6 Start\"])),\n \"ts_lvl6_end\" => (empty($gameData[\"timestamps\"][\"Level 6 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 6 End\"])),\n \"ts_lvl7_start\" => (empty($gameData[\"timestamps\"][\"Level 7 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 7 Start\"])),\n \"ts_lvl7_end\" => (empty($gameData[\"timestamps\"][\"Level 7 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 7 End\"])),\n \"ts_lvl8_start\" => (empty($gameData[\"timestamps\"][\"Level 8 Start\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 8 Start\"])),\n \"ts_lvl8_end\" => (empty($gameData[\"timestamps\"][\"Level 8 End\"])) ? null : date(\"Y-m-d H:i:s\", strtotime($gameData[\"timestamps\"][\"Level 8 End\"]))\n ));\n\n foreach ($gameData[\"tries\"] as $score) {\n MrAntScore::create(array(\n \"game_id\" => $game->id,\n \"level\" => $score[\"setNumber\"],\n \"part\" => $score[\"repNumber\"],\n \"value\" => $score[\"correct\"],\n \"responseTime\" => $score[\"responseTime\"]\n ));\n }\n\n $results[] = $game->id;\n }\n\n return $results;\n }", "public static function getUnrankedPlayers($year) {\n CommonDao::connectToDb();\n $query = \"select p.*\n from player p, team_player tp\n where p.player_id = tp.player_id\n and p.player_id not in (\n select distinct r.player_id\n from rank r\n where r.year = $year)\";\n return PlayerDao::createPlayersFromQuery($query);\n }", "public function loadLastGame()\n\t{\n\t\t$rGame = mysql_query('SELECT * FROM games ORDER BY id DESC LIMIT 1');\n\t\t$game = mysql_fetch_object($rGame);\n\t\t\n\t\t$rMoves = mysql_query('SELECT * FROM moves WHERE game_id = ' . $game->id . ' ORDER BY move_nr');\n\t\t\n\t\t$moves = array();\n\t\twhile($move = mysql_fetch_object($rMoves))\n\t\t{\n\t\t\t$moves[] = array(\n\t\t\t\t\t\tarray($move->from_y, $move->from_x),\n\t\t\t\t\t\tarray($move->to_y, $move->to_x)\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "function getGames() {\n\treturn json_decode(file_get_contents(\"data/games.json\"), true);\n}", "public function getWinners($game)\n {\n $allPlayers = DB::table('players')->where(['game_id' => $game->id])->orderBy('bid', 'DESC')->get()->toArray();\n\n // -1 cause the array starts at 0\n $winner_1 = $allPlayers[0]->user_id;\n $winner_2 = $allPlayers[$game->win_1 - 1]->user_id;\n $winner_3 = $allPlayers[$game->win_2 - 1]->user_id;\n $winner_4 = $allPlayers[$game->win_3 - 1]->user_id;\n\n\n $winners = array(\n 'winner_1' => $winner_1,\n 'winner_2' => $winner_2,\n 'winner_3' => $winner_3,\n 'winner_4' => $winner_4\n );\n\n return $winners;\n }", "function getPrevOrders()\n\t{\n\t\t$gid = mysql_real_escape_string($_GET['gid']);\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM games\n\t\t\t\t\tWHERE gid=$gid;\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$year = mysql_result($result, 0, \"year\");\n\t\t$season = mysql_result($result, 0, \"season\");\n\t\t\n\t\tif($season == \"s\")\n\t\t{\n\t\t\t$year--;\n\t\t\t$season = \"f\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$season = \"s\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM orders\n\t\t\t\t\tWHERE gid=$gid and year=$year and season='$season';\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$orders = array();\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($orders, mysql_fetch_assoc($result));\n\t\t} \n\t\t\n\t\treturn $orders;\n\t}", "public static function loadAllTeams()\n {\n\n $sql_connection = new mySqlConnection();\n $sql = \"SELECT * FROM team ORDER BY team_name ASC\";\n\n $statement = $sql_connection->connect()->prepare($sql);\n $statement->execute();\n $allTeams = $statement->fetchAll(PDO::FETCH_UNIQUE);\n\n return $allTeams;\n }", "public static function loadAllTeams()\n\t{\n\t\t$tmpDataMgr = createNewDataManager();\n\t\t$sql = self::getQueryTextAndCurYearWeek();\n\t\t$qTeam = $tmpDataMgr->runQuery($sql);\n\t\t$aTeams = array();\n\t\t\n\t\twhile($row = mysql_fetch_assoc($qTeam))\n\t\t{\t\t\n\t\t\t$aTeams[$row[\"id\"]] = new Team($row);\n\t\t}\n\t\t\n\t\treturn $aTeams;\n\t\t\n\t}", "public static function current_games( $db = 0 )\n\t{\n\t\tif( !$db )\n\t\t{\n\t\t\t$db = REGISTRY::get( \"db\" );\n\t\t}\n\t\t\n\t\t$sth = $db->prepare( \"\n\t\t\tSELECT \tid\n\t\t\tFROM \tgames\n\t\t\tWHERE\tstart_date < CURRENT_TIMESTAMP()\n\t\t\tAND\tend_date > CURRENT_TIMESTAMP()\n\t\t\" );\n\t\t\n\t\t$sth->execute();\n\t\t\n\t\tif( $sth->rowCount() > 0 )\n\t\t{\n\t\t\treturn $sth->fetchAll( PDO::FETCH_COLUMN, 0 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getCampeonatosInProgress()\n {\n $stmt = $this->db->query(\"SELECT * FROM campeonato where fechaInicioCampeonato < curdate()\");\n $toret_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n $championships = array();\n \n foreach ($toret_db as $championship) {\n array_push($championships, new Championship($championship[\"idCampeonato\"], $championship[\"fechaInicioInscripcion\"], $championship[\"fechaFinInscripcion\"], $championship[\"fechaInicioCampeonato\"], $championship[\"fechaFinCampeonato\"], $championship[\"nombreCampeonato\"]));\n }\n return $championships;\n }", "function lanorg_get_tournament_list() {\n\tglobal $wpdb;\n\n\t$table_name = $wpdb->prefix . 'lanorg_tournaments';\n\n\t$tournaments = $wpdb->get_results(\"SELECT id, game FROM $table_name\", ARRAY_A);\n\t$tournament_list = array();\n\tforeach ($tournaments as $tournament) {\n\t\t$tournament_list[$tournament['id']] = $tournament['game'];\n\t}\n\n\treturn $tournament_list;\n}", "public function getPlayersYetInthePlay($play)\n {\n $PlayersYetInThePlay = array(0);\n $getPlayersYetInthePlay = $this\n ->em\n ->getRepository('GameScoreBundle:Score')\n ->findBy(array('play' => $play));\n foreach ($getPlayersYetInthePlay as $line) {\n array_push($PlayersYetInThePlay, $line->getPlayer()->getId());\n }\n return $PlayersYetInThePlay;\n }", "public function getAllTimesNotTabela($idTabela) {\n\n\t\t\t$query = $this -> database -> query(\"\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tid, nome, jogador1, jogador2\n\t\t\t\t\tFROM \n\t\t\t\t\t\ttimes\n\t\t\t\t\tWHERE id NOT IN (SELECT idTime FROM tabelas_times WHERE idTabela = '\".$idTabela.\"')\n\t\t\t\t\tORDER BY nome\") \n\t\t\t\t\t\t\tor die($this -> database -> error);\n\t\t\t$Xtimes = [];\n\t\t\twhile($time = $query -> fetch_assoc())\n\t\t\t{\n\t\t\t\t$timeC = new Time();\n\t\t\t\t$timeC->setTime($time['id'],$time['nome'],$time['jogador1'],$time['jogador2']);\n\t\t\t\t$Xtimes[] = $timeC;\n\t\t\t}\n\n\t\t\treturn $Xtimes;\n\t\t}", "public function GetOwnedGames($includeAppInfo = true, $includePlayedFreeGames = false, $appIdsFilter = [])\n {\n $this->setApiDetails(__FUNCTION__, 'v0001');\n\n // Set up the arguments\n $arguments = ['steamId' => $this->steamId];\n if ($includeAppInfo) {\n $arguments['include_appinfo'] = $includeAppInfo;\n }\n if ($includePlayedFreeGames) {\n $arguments['include_played_free_games'] = $includePlayedFreeGames;\n }\n if (count($appIdsFilter) > 0) {\n $arguments['appids_filter'] = (array) $appIdsFilter;\n }\n\n // Get the client\n $client = $this->getServiceResponse($arguments);\n\n // Clean up the games\n $games = $this->convertToObjects(isset($client->games) ? $client->games : []);\n\n return $games;\n }", "protected function getFFPlayers()\n\t{\n\t\t$result = \\Kofradia\\DB::get()->prepare(\"\n\t\t\tSELECT DISTINCT f2.ffm_up_id\n\t\t\tFROM ff_members f1\n\t\t\t\tJOIN ff ON ff_id = f1.ffm_ff_id AND ff_is_crew = 0\n\t\t\t\tJOIN ff_members f2 ON f1.ffm_ff_id = f2.ffm_ff_id AND f2.ffm_status = 1 AND f2.ffm_up_id != f1.ffm_up_id\n\t\t\tWHERE f1.ffm_up_id = ? AND f1.ffm_status = 1\");\n\t\t$result->execute(array($this->ut->up->id));\n\t\t$up_ids = array();\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\t$up_ids[] = $row['ffm_up_id'];\n\t\t}\n\t\t\n\t\treturn $up_ids;\n\t}", "public function players()\n {\n $game_ids = $this->match->games->lists('id');\n $map = array_search($this->id, $game_ids);\n if ($map === FALSE || !$this->match->rostersComplete()) return $this->match->players();\n $map = $map + 1;\n $rosters = $this->match->rosters;\n $players = new Illuminate\\Database\\Eloquent\\Collection;\n foreach ($rosters as $roster) {\n $entries = $roster->entries()->where('map', '=', $map);\n if ($entries->count() == 0) continue;\n $players->add($roster->entries()->where('map', '=', $map)->first()->player);\n }\n if ($players->count() == 0) return $this->match->players();\n return $players;\n }", "public function getSkippedScenarios();", "function get_rejected_bookings(){\n\t\t$rejected = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif($EM_Booking->booking_status == 2){\n\t\t\t\t$rejected[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($rejected);\n\t\treturn $EM_Bookings;\n\t}", "public function resetGames() : Group {\n\t\tforeach ($this->getGames() as $game) {\n\t\t\t$game->resetResults();\n\t\t}\n\t\treturn $this;\n\t}", "public function playersOfGame(): array\n {\n return $this->players;\n }", "public function allPlayers()\n {\n return array_values($this->players);\n }", "public function playersThatArePlaying() {\n\t\t$playersThatArePlayingLogins = $this->playersThatArePlayingLogins();\n\t\t$playersThatArePlaying = array();\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\n\t\tforeach ($allPlayers as $player) {\n\t\t\tif (in_array($player->login, $playersThatArePlayingLogins)) {\n\t\t\t\t$playersThatArePlaying[] = $player;\n\t\t\t}\n\t\t}\n\n\t\treturn $playersThatArePlaying;\n\t}", "function CheckDisponiblityGame($IdJoinGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT MaxPlayersGame, (SELECT COUNT(fkGamePlace) FROM fishermenland.place WHERE fkGamePlace = '$IdJoinGame') as UsedPlaces FROM fishermenland.game WHERE idGame = '$IdJoinGame'\");\n $reqArray = $req->fetch();\n\n return $reqArray;\n}", "private function gameStatus($game){\n\t\t$count = array_diff($game['words'],$game['words_found']);\n\t\tif(count($count)==0){\n\t\t\t$game['status'] = 'completed';\n\t\t}\n\t\treturn $game;\n\t}", "public function getPlayers()\n {\n return $this->hasMany(Player::className(), ['id' => 'player_id'])\n ->viaTable('game_has_player', ['game_id' => 'id'])\n ->select('*, (SELECT presence FROM game_has_player WHERE game_id='.$this->id.' AND player_id=players.id LIMIT 1) as presence');\n }", "public function invalidPlayersProvider()\n {\n return [\n [[]], // no players\n [['Alice']], // too few players\n [['Alice', 'Bob', 'Carol', 'Eve', 'One too many']] // too many players\n ];\n }", "public function games() {\n return $this->belongsToMany(Game::class)->orderBy(\"title\");\n }", "public function GetRecentlyPlayedGames($count = null)\n {\n $this->setApiDetails(__FUNCTION__, 'v0001');\n\n // Set up the arguments\n $arguments = ['steamId' => $this->steamId];\n if (! is_null($count)) {\n $arguments['count'] = $count;\n }\n\n // Get the client\n $client = $this->getServiceResponse($arguments);\n\n if ($client->total_count > 0) {\n // Clean up the games\n $games = $this->convertToObjects($client->games);\n\n return $games;\n }\n }", "public function get_non_franchise_players($team_id,$current_year){\r\n\t\t\t$query= $this->db->select('fffl_player_id')\r\n\t\t\t\t\t\t\t->where('season',$current_year)\r\n\t\t\t\t\t\t\t->where('team_id',$team_id)\r\n\t\t\t\t\t\t\t->get('Franchise');\r\n\t\t\t$franchise_array = array();\r\n\t\t\t\r\n\t\t\tforeach ($query->result() as $row){\r\n\t\t\t\t$franchise_array[]=$row->fffl_player_id;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$query2= $this->db->select('fffl_player_id')\r\n\t\t\t\t\t\t\t->where('team_id',$team_id)\r\n\t\t\t\t\t\t\t->order_by('lineup_area','DESC')\r\n\t\t\t\t\t\t\t->order_by('salary','DESC')\r\n\t\t\t\t\t\t\t->get('Rosters');\r\n\t\t\t$return_array = array();\r\n\t\t\tforeach ($query2->result() as $row){\r\n\t\t\t\tif(!in_array($row->fffl_player_id,$franchise_array)){\r\n\t\t\t\t\t$return_array[]=$row->fffl_player_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $return_array;\r\n\t\t\t\r\n\t}", "function getRoomsAvailable(){\n\n global $db;\n\n $stmt= $db->prepare('SELECT room_id,branch\n FROM (\n SELECT room_id,\n room_branch AS branch\n FROM room\n WHERE NOT EXISTS (\n SELECT employee_room_id\n FROM employee\n WHERE employee_room_id = room_id\n )\n )');\n\n $stmt->execute();\n return $stmt->fetchAll();\n \n }", "static public function invalidated_users() {\n $stmt = get_pdo()->prepare('select id, name from user where valid = false');\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $u) {\n $user = new User();\n $user->id = $u['id'];\n $user->name = $u['name'];\n array_push($result, $user);\n }\n return $result;\n }", "public function findEmptySlots()\n {\n $emptySlots = [];\n foreach ($this->board as $x => $row) {\n /** @var array $row */\n foreach ($row as $y => $stone) {\n if (self::EMPTY_SLOT === $stone) {\n $emptySlots[] = new Coordinate($x, $y);\n }\n }\n }\n\n return $emptySlots;\n }", "public function run()\n {\n //Game::factory(100)->create();\n\n\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '1',\n 'date' => '2020-06-01',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '2',\n 'date' => '2020-06-02',\n 'time' => '16:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '3',\n 'date' => '2020-06-05',\n 'time' => '12:15',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '2',\n 'boardgame_id' => '1',\n 'date' => '2020-06-08',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '5',\n 'date' => '2020-06-10',\n 'time' => '16:00',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '6',\n 'boardgame_id' => '3',\n 'date' => '2020-06-21',\n 'time' => '17:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '3',\n 'boardgame_id' => '3',\n 'date' => '2020-06-01',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '5',\n 'boardgame_id' => '5',\n 'date' => '2020-06-05',\n 'time' => '17:05',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '7',\n 'boardgame_id' => '7',\n 'date' => '2020-06-07',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '6',\n 'boardgame_id' => '6',\n 'date' => '2020-06-12',\n 'time' => '18:50',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '10',\n 'date' => '2020-07-01',\n 'time' => '11:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '10',\n 'boardgame_id' => '2',\n 'date' => '2020-08-01',\n 'time' => '14:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '9',\n 'boardgame_id' => '8',\n 'date' => '2020-06-08',\n 'time' => '20:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '7',\n 'boardgame_id' => '6',\n 'date' => '2020-02-05',\n 'time' => '08:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '5',\n 'date' => '2020-06-09',\n 'time' => '09:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '3',\n 'boardgame_id' => '1',\n 'date' => '2020-06-04',\n 'time' => '16:10',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '8',\n 'boardgame_id' => '9',\n 'date' => '2020-06-09',\n 'time' => '10:39',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '4',\n 'date' => '2019-06-01',\n 'time' => '12:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '5',\n 'boardgame_id' => '5',\n 'date' => '2020-06-27',\n 'time' => '20:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '2',\n 'boardgame_id' => '8',\n 'date' => '2020-12-01',\n 'time' => '17:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n\n\n\n $this->command->info('Games añadidas correctamente');\n }", "public function getCampeonatosToGenerateGroups()\n {\n $stmt = $this->db->query(\"SELECT * FROM campeonato where fechaFinInscripcion <= curdate() and (Select count(idCampeonato) from grupo where campeonato.idCampeonato = grupo.idCampeonato ) = 0\");\n $toret_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n $championships = array();\n \n foreach ($toret_db as $championship) {\n array_push($championships, new Championship($championship[\"idCampeonato\"], $championship[\"fechaInicioInscripcion\"], $championship[\"fechaFinInscripcion\"], $championship[\"fechaInicioCampeonato\"], $championship[\"fechaFinCampeonato\"], $championship[\"nombreCampeonato\"]));\n }\n \n return $championships;\n }", "public function getPlayers();", "public function getPlayers();", "public function matchCreate()\n {\n $games = Game::all();\n $team1 = Teams::all();\n $team2 = Teams::all();\n return [$games, $team1, $team2];\n }", "public function getInactive()\n {\n $jobs = array();\n \n $inactive = $this->_em->getRepository($this->_entityClass)->findByActive(0);\n foreach ($inactive as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n \n return $jobs;\n \n }", "public static function getOnlineGifts() {\n\t\t$params = array('status' => 1, 'game_status'=>1);\n\t\t$params['effect_start_time'] = array('<=', Common::getTime());\n\t\t$params['effect_end_time'] = array('>=', Common::getTime());\n\t\treturn self::_getDao()->getsBy($params);\n\t}", "public function findOrFail(GameId $id): Game\n {\n return Game::start($id, new PlayerId(Uuid::random()->value()), new PlayerId(Uuid::random()->value()));\n }", "public function get_players(){\n\t\t$players = $this->players;\n\t\t$classes_arr = array(\n\t\t\t'Sportorg_Games_Matchplayer' => 'sportorg_games_matchplayer',\n\t\t);\n\t\t$players = ORM::_sql_exclude_deleted($classes_arr, $players);\n\t\t$playerArr = null;\n\t\tforeach($players->find_all() as $player){\n\t\t\t$playerArr[] = $player->getBasics();\n\t\t}\n\n\t\treturn $playerArr;\n\t}", "public function killCheck()\n\t\t{\n\t\t\t$checkLeader = false;\n\t\t\t$diedList = array();\n\t\t\tforeach($this->_members as $body)\n\t\t\t{\n\t\t\t\tif($body->_alive)\n\t\t\t\t{\n\t\t\t\t\tif($body->_health <= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$checkLeader = true;\n\t\t\t\t\t\t$body->_alive = false;\n\t\t\t\t\t\t$body->_health = 0;\n\t\t\t\t\t\t$this->_livingMembers-=1;\n\t\t\t\t\t\tarray_push($diedList, $body->_name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($checkLeader)\n\t\t\t{\n\t\t\t\tforeach($this->_members as $body)\n\t\t\t\t{\n\t\t\t\t\tif($body->_alive)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_leader = $body->_name;\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 $diedList;\n\t\t}", "function getListOfGames($userId){\r\n\t\t$this->db->select('gameId, gameName,active')->from('games')->where('ownerId',$userId)->order_by('gameId', \"desc\"); ;\r\n\t\t$query = $this->db->get();\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\t$i=0;\r\n\t\t\tforeach($query->result() as $row) {\r\n\t\t\t\t$result[$i++] = $row;\r\n\t\t\t}\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "private function findGame($id) {\n $game = null;\n foreach($this->getGames() as $currentGame) {\n if($currentGame->getAppId() == $id ||\n $currentGame->getShortName() == $id ||\n $currentGame->getName() == $id) {\n $game = $currentGame;\n break;\n }\n }\n\n if($game == null) {\n if(is_int($id)) {\n $message = \"This SteamID does not own a game with application ID {$id}.\";\n } else {\n $message = \"This SteamID does not own the game \\\"{$id}\\\".\";\n }\n throw new SteamCondenserException($message);\n }\n\n return $game;\n }", "public function get_all()\n {\n $db_games = \\DB::table('games')->get();\n \n // Only returns some fields\n $games = [];\n foreach ($db_games as $game) {\n $db_games_users = \\DB::table('games_users')\n ->where('game_id', '=', $game->id)\n ->get();\n\n $users = [];\n $creator_id = NULL;\n $creator_pseudo = NULL;\n foreach ($db_games_users as $item) {\n if ($item->type == 'guest') {\n array_push( $users, ['type' => 'guest', 'username' => $item->username] );\n } else {\n $user = \\App\\User::where('id', $item->user_id)->first();\n array_push( $users, [\n 'type' => 'user', 'username' => $item->username, 'user_id' => intval($item->user_id),\n 'avatar' => $user->avatar, 'color' => $user->color\n ]);\n }\n if ($item->is_owner) {\n $creator_id = $item->user_id;\n $creator_pseudo = $item->username;\n }\n }\n $games[] = [\n 'game_id' => intval($game->id),\n 'users' => $users,\n 'creator_id' => intval($creator_id),\n 'creator_pseudo' => $creator_pseudo\n ];\n }\n return [\n \"status\" => \"ok\",\n \"games\" => $games\n ];\n }", "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "private function findComponentsWhichNeedMigrated(): array\n {\n $aModules = Components::available(false);\n $aOut = [];\n\n foreach ($aModules as $oModule) {\n $oState = $this->determineModuleState($oModule);\n if ($oState->start !== $oState->end) {\n $aOut[] = $oState;\n }\n }\n\n // Shift the app migrations onto the end so they are executed last\n if (!empty($aOut)) {\n $oFirst = reset($aOut);\n if ($oFirst->slug === Components::$sAppSlug) {\n $oApp = array_shift($aOut);\n $aOut = array_merge($aOut, [$oApp]);\n $aOut = array_filter($aOut);\n $aOut = array_values($aOut);\n }\n }\n\n return $aOut;\n }", "public function create(): array\n {\n $whitePawns = [];\n $blackPawns = [];\n $emptyCells = [];\n for ($i = 0; $i < 8; ++$i) {\n $whitePawns[] = new Pawn(1, $i, 6, 0, 0);\n $blackPawns[] = new Pawn(0, $i, 1, 0, 0);\n $emptyCells[] = null;\n }\n $initBoard = [\n [\n new Rook(0, 0, 0, 0),\n new Knight(0, 1, 0, 0),\n new Bishop(0, 2, 0, 0),\n new Queen(0, 3, 0, 0),\n new King(0, 4, 0, 0),\n new Bishop(0, 5, 0, 0),\n new Knight(0, 6, 0, 0),\n new Rook(0, 7, 0, 0)\n ],\n $blackPawns,\n $emptyCells,\n $emptyCells,\n $emptyCells,\n $emptyCells,\n $whitePawns,\n [\n new Rook(1, 0, 7, 0),\n new Knight(1, 1, 7, 0),\n new Bishop(1, 2, 7, 0),\n new Queen(1, 3, 7, 0),\n new King(1, 4, 7, 0),\n new Bishop(1, 5, 7, 0),\n new Knight(1, 6, 7, 0),\n new Rook(1, 7, 7, 0)\n ]\n ];\n\n $game = $this->db->query('INSERT INTO games (board, move_number, status) VALUES (?, ?, ?);',\n [$this->jsonEncode($initBoard), 1, self::STATUS_RUNNING]);\n if (!$game) {\n throw new DatabaseGameNotCreatedException('Game not created', 500);\n }\n\n return [\n self::FIELD_ID => (int)$this->db->getCon()->lastInsertId(),\n self::FIELD_MOVE_NUMBER => 1,\n self::FIELD_TURN => 1\n ];\n }", "public function GetExitsWithAssets() {\n\t\t$objStmt = $this->objDb->prepare(\"\n\t\t\tSELECT e.employee_id, CONCAT(e.firstname, ' ', e.lastname) FROM employee AS e\n\t\t\tWHERE e.employee_id IN (SELECT ea.employee_id FROM employee_asset AS ea) AND e.exit = 1\n\t\t\tORDER BY e.lastname, e.firstname;\n\t\t\");\n\t\t$objStmt->execute();\n\t\t$objStmt->bind_result($intEmployeeId, $strName);\n\n\t\t$arrEmployees = array();\n\n\t\twhile ($objStmt->fetch()) {\n\t\t\t$arrRow = array();\n\t\t\t$arrRow['employee_id'] = $intEmployeeId;\n\t\t\t$arrRow['name'] = $strName;\n\t\t\tarray_push($arrEmployees, $arrRow);\n\t\t\tunset($arrRow);\n\t\t}\n\t\t$objStmt->close();\n\n\t\treturn $arrEmployees;\n\t}", "function projectsNotInGroup() {\n\n\tglobal $db;\n\treturn $db->projectsNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getMissingRecords()\n {\n $missing = [];\n\n foreach ($this->records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getRequiredFieldsArray();\n\n if (count($fields)) {\n $results = $repo->findBy($fields);\n if (!$results) {\n $missing[] = $record;\n }\n }\n }\n\n return $missing;\n }", "function printGameList($g) {\n\t\t$gameList = Ss::get()->gameMap;\n\t\t$gamePlayed = $g['gamePlayed'];\n\t\techo '<div id=\"divGameList\" class=\"hiddenDiv\">';\n\t\techo '<select id=\"selectGameList\" multiple=\"multiple\" name=\"new_game[]\">';\n\t\tforeach($gameList as $game) {\n\t\t\tif(!isset($gamePlayed[$game->id])) {\n\t\t\t\t// on ajoute le jeu dans la liste uniquement si on y joue pas déjà\n\t\t\t\techo '<option value=\"'.$game->id.'\">'.$game->name.'</option>';\n\t\t\t}\n\t\t}\n\t\techo '</select>';\n\t\techo '</div>';\n\t\treturn $g;\n\t}", "function getUsersNotInGroup() {\n\n\tglobal $db;\n\treturn $db->getUsersNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function testCurrentBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->subMonth(),\n 'end_time' => now()->addMonth(),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "public function getProjects(){\n $projects = Project::all()->sortBy('dead');\n return $projects;\n }", "public function getGames(Group $group = null, $groupId = null) {\n\t\tif (isset($group) && isset($this->games[$group->getId()])) return $this->games[$group->getId()];\n\t\tif (isset($groupId) && isset($this->games[$groupId])) return $this->games[$groupId];\n\t\treturn $this->games;\n\t}", "public function get_instances() { \n\n\t\t$sql = \"SELECT * FROM `localplay_mpd` ORDER BY `name`\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$results = array(); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\t$results[$row['id']] = $row['name']; \n\t\t} \n\n\t\treturn $results; \n\n\t}", "function getTodaysGames($mobile){\n\n //$query = \"SELECT * FROM `games` WHERE gameDate = '$currentDate' ORDER BY id DESC\";\n // used GROUP BY to eliminate duplicate home and vising teams...\n // get all other games that are on except the current game on from your city this evening,\n // everything else\n\n // IMPORTANT NEED TO FIX THIS.... FROM IN TORONTO WON't SHOW ME THE TORONTO GAME ON NOV 8th\n\n $query = \"SELECT games.*, teams.`teamName`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeam`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamName`,\n (SELECT `logo` FROM teams WHERE `city`= games.`homeTeam` ) AS `home_logo`,\n (SELECT `logo` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visiting_logo`,\n (SELECT `id` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeamId`,\n (SELECT `id` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamId`\n FROM games, teams WHERE gameDate = '$this->currentDate'\n AND games.`homeTeam` <> '$this->myCity'\n AND games.`visitingTeam` <> '$this->myCity' GROUP BY games.`id`\";\n\n $result = mysql_query($query);\n\n if($mobile == true){\n $dir = \"../\";\n }else{\n $dir = \"\";\n }\n\n while($row = mysql_fetch_assoc($result)){\n\n echo \"<h3><img class='left' alt='\" . $row['homeTeam'] . \"' width='141' src='\" . $dir . $row['home_logo'] .\"' /> <img class='right' alt='\" . $row['visitingTeamName'] . \"' width='141' src='\" . $dir . $row['visiting_logo'] .\"' /></a></h3>\";\n echo '<div class=\"content\"><p>';\n echo \"<a href='schedule/\".$row['homeTeamId'].\"/\".$row['league'].\"/\".urlencode($row['homeTeam']).\"'>\" . $row['homeTeam'] . \"</a> VS <a href='schedule/\".$row['visitingTeamId'].\"/\".$row['league'].\"/\".urlencode($row['visitingTeamName']).\"'>\" . $row['visitingTeamName'] . \"</a><br />\";\n echo $row['gameDate'] . \" at \" . $row['gameTime'] . \"<br />\";\n echo '</p></div>';\n\n }\n\n }", "public function isGameExistant($id) \n {\n $sql = \"select * from game where game_id=? limit 1\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return true;\n else\n return false;\n }", "private static function game(){\n $game =array();\n self::$gameCount++;\n if(self::$gameCount <= self::$runs){\n\n // run round\n $roundStats = self::attack();\n if($roundStats){\n $game['rounds'][] = $roundStats;\n\n //check if it is rapid strike and run it\n if($roundStats['rapidStrike']){\n $rsRoundStats = self::attack(1);\n $game['rounds'][] = $rsRoundStats;\n }\n }\n \n }\n return $game;\n }", "public function index() {\n\n\t\t$arr = [\n\t\t\t'fields' => ['id', 'description', 'user_id', 'complete'],\n\t\t\t'recursive' => 0\n\t\t];\n\t\t$this->set('games', $this->Killer->find('all', $arr));\n\n\t}", "public function games()\n {\n $games=Item::all();\n return view('front.games',compact('games'));\n }", "public function games($key){\n //header('Content-type: application/json');\n $token = (new ApiModel())->get_key_details($key);\n\n\n if($token){\n if ($token->api_limit >= 1){\n $games = json_decode($this->rawg->games(), TRUE);\n $games = $games['results'];\n\n\n (new ApiModel())->decrement_limit($key, $token->api_limit - 1);\n echo json_encode(['status' => true, 'games' => $games], JSON_PRETTY_PRINT);\n }else{\n echo json_encode(['status' => false, 'message' => 'Api usage limit reached']);\n }\n }else{\n echo json_encode(['status' => false, 'message' => 'Hi it appears you have used an incorrect api key']);\n }\n }", "public function getExistingNames()\n {\n return array_keys($this->createQueryBuilder()\n ->select('name')\n ->hydrate(false)\n ->getQuery()\n ->execute()\n ->toArray());\n }" ]
[ "0.7390046", "0.73422545", "0.6644689", "0.65938675", "0.63728905", "0.62764716", "0.62624055", "0.6201237", "0.6136349", "0.60730124", "0.6071861", "0.6068795", "0.60631996", "0.60074323", "0.59880215", "0.59620273", "0.576472", "0.5733561", "0.5728077", "0.5721547", "0.57119995", "0.5616294", "0.5611183", "0.5601891", "0.5548557", "0.55383366", "0.55296135", "0.55179965", "0.54747903", "0.5466086", "0.5443645", "0.54401416", "0.54389066", "0.53880715", "0.5381258", "0.5330818", "0.5327279", "0.53117675", "0.52895135", "0.5243868", "0.5236006", "0.522985", "0.5205213", "0.51814455", "0.51648515", "0.5156273", "0.5154882", "0.51418704", "0.51390266", "0.51110786", "0.51108253", "0.50998414", "0.509541", "0.5087222", "0.5083604", "0.5082981", "0.5080494", "0.5075945", "0.5072376", "0.50620496", "0.5058649", "0.5044199", "0.50409526", "0.503366", "0.49988404", "0.49986845", "0.49880007", "0.49841622", "0.49317235", "0.49108544", "0.49067986", "0.49067986", "0.49033955", "0.48988342", "0.48870793", "0.4873858", "0.4861961", "0.4861395", "0.4860732", "0.48535946", "0.48459977", "0.4837339", "0.4825722", "0.48204002", "0.48166278", "0.48140132", "0.48129717", "0.48101783", "0.4802345", "0.47979102", "0.47973844", "0.47973076", "0.47962263", "0.47923744", "0.47843388", "0.47698334", "0.47693434", "0.4767448", "0.4760195", "0.47540054" ]
0.6562062
4
/ Joins a game, returns whether joining that game was a success. Deals the player their initial hand. TODO: check that $gameId hasn't started.
function joinGame($userId, $gameId) { $oldGameId = getGameOf($userId); if ($oldGameId != NOT_IN_GAME) { return false; } $sql = "update users set game_id = $gameId where id = $userId"; SQLUpdate($sql); distributeInitialCards($userId); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinGame($game, $me) {\n\t$games = getGames();\n\tif (isset($_SESSION['gameid']) and\n\t isset($games[$_SESSION['gameid']]) and\n\t $games[$_SESSION['gameid']]['state'] != 'closed') {\n\t\treturn error('You are still in an active game');\n\t}\n\n\t$games[$game]['players'][] = $me;\n\tif (sizeof($games[$game]['players']) == 2) {\n\t\t$games[$game]['state'] = 'playing';\n\t}\n\t$_SESSION['gameid'] = $game;\n\n\treturn writeGames($games);\n}", "function joinGame($gameID, $playerName)\n{\n $dbh = connectToDatabase();\n\n if (!$gameID) {\n\n // Check that there is no game already using this ID\n $gameIDIsUnique = true;\n // If $gameID empty, create new game\n $gameID = newGameID();\n // Count number of rows with $gameID\n $stmt = $dbh->prepare('SELECT COUNT(1) FROM games WHERE gameID = ?');\n do {\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if ($result[0] > 0) {\n // Wait, there is a game already using this ID. Try again\n $gameIDIsUnique = false;\n }\n } while (!$gameIDIsUnique);\n\n // First player in a game becomes the GM\n $playersData = json_encode([$playerName]);\n $gameData = json_encode(new stdClass);\n $stmt = $dbh->prepare(\"INSERT INTO games VALUES (?, ?, ?, ?, 0, NOW())\");\n if ($stmt->execute([$gameID, $playersData, $gameData, $playerName])) {\n // Now, send new gameID back to the host player\n exit($gameID);\n } else {\n http_response_code(500);\n die('GAME NOT CREATED');\n }\n } else {\n // Otherwise, join game with passed gameID\n // Get whatever players are now in the database\n $stmt = $dbh->prepare('SELECT players FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n // There should be only one game with this ID, so join first one with matched ID\n $players = json_decode($result[0], true);\n // Add this player to the players array, and insert back into the entry\n array_push($players, $playerName);\n $playersData = json_encode($players);\n\n $stmt = $dbh->prepare('UPDATE games SET players = ? WHERE gameID = ?');\n\n if ($stmt->execute([$playersData, $gameID])) {\n // Signal the client that the game is ready\n exit('PLAYER');\n } else {\n http_response_code(500);\n die('NOT JOINED GAME');\n }\n }\n\n // Now store the gameID in $_SESSION, so that we stay connected until the browser is closed\n $_SESSION['gameID'] = $gameID;\n $_SESSION['playerName'] = $playerName;\n}", "public function join(){\n\t\t/* players, players_nick, scores, */\n $gameId = $this->input->post('gameId');\n $utoken = $this->input->post('utoken');\n\t\t$nick = $this->input->post('nick');\n\t\t$game = $this->setRedis_info($gameId);\n\t\tif(empty($game)){\n\t\t\t$this->setHeader(['registered'=>0, 'player_id'=>$utoken, 'nick'=>$nick, 'msg'=>'Invalid game id!'], 202);\n\t\t}else{\n\t\t\t$matrix = $game['matrix'];\n\t\t\t$admin = $game['admin'];\n\n\t\t\tif(!in_array($utoken, $game['players'])){\n\t\t\t\tif(count($game['players']) > 5){\n\t\t\t\t\t$this->setHeader(['registered'=>0, 'player_id'=>$utoken, 'nick'=>$nick, 'msg'=>'Game is full!'], 202);\n\t\t\t\t}\n\t\t\t\tif(in_array($game['status'], ['inPlay', 'completed'])){\n\t\t\t\t\t$this->setHeader(['registered'=>0, 'player_id'=>$utoken, 'nick'=>$nick, 'msg'=>'Cannot join...Game status: '.$game['status'].'!'], 202);\n\t\t\t\t}\n\t\t\t\tarray_push($game['players'], $utoken);\n\t\t\t\tarray_push($game['turn_seq'], $utoken);\n\t\t\t\t$game['scores'][$utoken] = 0;\n\t\t\t\t$game['players_nick'][$utoken] = $nick;\n\t\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t\t$this->setHeader(['registered'=>1, 'player_id'=>$utoken, 'nick'=>$nick, 'msg'=>'Succesfully joined the game!'], 200);\n\t\t\t}else{\n\t\t\t\t$this->setHeader(['registered'=>1, 'player_id'=>$utoken, 'nick'=>$nick, 'msg'=>'Succesfully joined the game!'], 200);\n\t\t\t}\n\t\t}\n\n }", "public function join($id)\n {\n $game = Game::findOrFail($id);\n if ($game->state != 'waiting') {\n return redirect()->route('dashboard');\n }\n\n foreach ($game->participants as $p) {\n if ($p->user->id == Auth::id()) {\n return redirect()->route('game.show', ['id' => $id]);\n }\n }\n\n $user = Auth::user();\n $participant = $user->participants()->create();\n $game->participants()->save($participant);\n\n $userJoined = $user->name . \" Joined the game!\";\n event(new UserJoinedAGame($userJoined, $user, $game));\n\n return redirect()->route('game.show', ['id' => $id]);\n }", "public function joinGame()\n {\n $this->addEvent(\"join_game\");\n }", "public function runGame()\n {\n $currentGame = $this->find('all')->where([\n 'complete' => false\n ])->contain(['Users'])->first();\n\n //get all the plays counts\n $gamesUsersTable = TableRegistry::get('GamesUsers');\n $currentGameCheckedCount = $gamesUsersTable->find();\n $currentGameCheckedCount = $currentGameCheckedCount->select([\n 'count' => $currentGameCheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->first()->count;\n\n $currentGameUncheckedCount = $gamesUsersTable->find();\n $currentGameUncheckedCount = $currentGameUncheckedCount->select([\n 'count' => $currentGameUncheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->first()->count;\n\n $totalPlays = $currentGameCheckedCount + $currentGameUncheckedCount;\n\n //If not enough players, extend the end time and bail;\n if ($totalPlays < 2) {\n $currentGame->end_time = Time::now()->addHour(1);\n $this->save($currentGame);\n return false;\n }\n\n //update current game fields\n $currentGame->total_checked = $currentGameCheckedCount;\n $currentGame->total_plays = $totalPlays;\n $currentGame->ratio = round((float)$currentGameCheckedCount / (float)$totalPlays, 2);\n\n //save game as 'complete'\n $currentGame->complete = true;\n $this->save($currentGame);\n\n //get all the users that played this round\n $usersTable = TableRegistry::get('Users');\n $usersWhoCheckedThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->toArray();\n $currentGameCheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoCheckedThisGameIdArray) ? $usersWhoCheckedThisGameIdArray : [0])\n ]);\n\n $usersWhoDidntCheckThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->toArray();\n $currentGameUncheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoDidntCheckThisGameIdArray) ? $usersWhoDidntCheckThisGameIdArray : [0])\n ]);\n\n\n //update users scores\n foreach ($currentGameCheckedUsers as $user) {\n if ($currentGame->ratio > 0.5) {\n if ($user->score != 0) {\n $user->score = (int)$user->score - 10;\n }\n } else {\n $user->score = (int)$user->score + 10;\n }\n $usersTable->save($user);\n }\n\n //create next incomplete game & save\n $this->createNewGame();\n\n //send notification emails to everybody that gained/lost points\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => true,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameCheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n\n //send email to everybody who played but didn't check\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => false,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameUncheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n }", "public function join_conversation(Conversation $conversation) {\r\n\t\tif ($this->user_id && $conversation->conversation_id) {\r\n\t\t\tif (!$this->in_conversation($conversation)) {\r\n\t\t\t\tif ($conversation->action_allowed(clone $this, __METHOD__)) {\r\n\t\t\t\t\t$sql = \"INSERT INTO `conversation_members` (user_id, conversation_id, date) VALUES ('$this->user_id', '$conversation->conversation_id', NOW())\";\r\n\t\t\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\t\t\tor die ($this->dbc->error);\r\n\r\n\t\t\t\t\t//Spawn notification here\r\n\t\t\t\t\t$action = new JoinDiscussion(array(\r\n\t\t\t\t\t\t'joiner' => clone $this,\r\n\t\t\t\t\t\t'conversation' => $conversation)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tNotificationPusher::push_notification($action); //Not sure if make this succeed or die yet...\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$sql = \"INSERT INTO `conversation_requests` (conversation_id, joiner_id, date_requested) VALUES ('$conversation->conversation_id', '$this->user_id', NOW())\";\r\n\t\t\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\t\t\tor die ($this->dbc->error);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}", "function joinGame ($date_insc, $partie, $index_equipe, $joueur, $password) {\n\tglobal $bdd;\n\t$result = false;\n\t\n\t$ancienneEquipe = equipeAncienneInscriptionPartie ($partie,$joueur);\n\tif($ancienneEquipe!=0)\n\t\t$equipe=$ancienneEquipe;\n\telse\n\t\t$equipe=$index_equipe;\n\n\t// Verif : la partie existe\n\t$verif = $bdd->prepare('\n\t\tSELECT id_partie, password\n\t\tFROM parties \n\t\tWHERE id_partie = :partie');\n\t$verif->execute(array(\n\t\t\t\t'partie' => $partie\n\t\t\t));\n\tif ($row = $verif->fetch()) {\n\t\t// Verif : Le mot de passe est correct\n\t\tif(sha1($password) == $row['password'] || $row['password'] === NULL) {\n\t\t\t// Verif : Le joueur existe\n\t\t\t$verif2 = $bdd->prepare('\n\t\t\t\tSELECT id_joueur\n\t\t\t\tFROM joueurs \n\t\t\t\tWHERE id_joueur = :joueur');\n\t\t\t$verif2->execute(array(\n\t\t\t\t\t'joueur' => $joueur\n\t\t\t));\n\t\t\tif ($row2 = $verif2->fetch()) {\n\t\t\t\ttry {\n\t\t\t\t\t// Insertion\n\t\t\t\t\t$req = $bdd->prepare('\n\t\t\t\t\t\tINSERT INTO inscriptions (date_inscription, partie, equipe, joueur) \n\t\t\t\t\t\tVALUES (:date_insc, :partie, :equipe, :joueur)');\n\t\t\t\t\t$req->execute(array(\n\t\t\t\t\t\t'date_insc' => $date_insc,\n\t\t\t\t\t\t'partie' => $partie,\n\t\t\t\t\t\t'equipe' => $equipe,\n\t\t\t\t\t\t'joueur' => $joueur\n\t\t\t\t\t));\n\t\t\t\t\t$result = true;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $result;\n}", "function leaveGame($gameID, $playerName)\n{\n // If $gameID empty, ignore\n if ($gameID === '') {\n http_response_code(400);\n die('GAME ID MISSING');\n }\n // Otherwise, leave game\n\n $dbh = connectToDatabase();\n\n if (playerIsGM($gameID, $playerName)) {\n $stmt = $dbh->prepare('UPDATE games SET isPlaying = 0 WHERE gameID = ?');\n if ($stmt->execute([$gameID])) {\n // All good, keep going\n } else {\n http_response_code(500);\n die('UNABLE TO STOP GAME');\n }\n }\n\n $stmt = $dbh->prepare('SELECT players FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n // There should be only one game with this ID, so join first one with matched ID\n $data = $result[0];\n $players = json_decode($data, true);\n\n if (count($players) === 1) {\n // We are the last player in the game, remove the DB entry\n $stmt = $dbh->prepare('DELETE FROM games WHERE gameID = ?');\n if ($stmt->execute([$gameID])) {\n exit('DELETED');\n } else {\n http_response_code(500);\n die('UNABLE TO DELETE GAME');\n }\n }\n\n // Otherwise, remove this player to the players array, and insert back into the entry\n if (($key = array_search($playerName, $players)) !== false) {\n unset($players[$key]);\n $players = array_values($players);\n }\n\n $playersData = json_encode($players);\n\n $stmt = $dbh->prepare('UPDATE games SET players = ? WHERE gameID = ?');\n if ($stmt->execute([$playersData, $gameID])) {\n // Signal the client that they have disconnected\n exit('DISCONNECTED');\n } else {\n http_response_code(500);\n die('UNABLE TO LEAVE GAME');\n }\n}", "private function isGameFinished()\n {\n $isGameFinished = false;\n\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $isGameFinished = true;\n }\n\n return $isGameFinished;\n }", "public function joinQuest() {\n $query1 = 'SELECT * FROM user_quest \n WHERE user_id = :userId \n AND quest_id = :questId';\n\n $stmt1 = $this->conn->prepare($query1);\n $stmt1->bindParam(':userId', $this->id);\n $stmt1->bindParam(':questId', $this->quest_id);\n $stmt1->execute();\n\n if($stmt1->rowCount() > 0) {\n return \"Duplicate\";\n }\n else {\n $query2 = 'INSERT INTO user_quest \n SET user_id = :userId, quest_id = :questId';\n\n $stmt2 = $this->conn->prepare($query2);\n $stmt2->bindParam(':userId', $this->id);\n $stmt2->bindParam(':questId', $this->quest_id);\n\n if ($stmt2->execute()) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function canBeJoined(): bool\n {\n return $this->_canBeJoined;\n }", "function addUserToGame($userId,$gameId){\r\n\t\t$SQLerror = '';\r\n\t\t$currentDate = date(\"Y\\-m\\-d\");\r\n\t\t$queryCheckIfExists = \"SELECT * FROM gameMembers WHERE userId=\".$userId.\" AND gameId=\".$gameId;\r\n\t\t\r\n\t\t// return if user is already member of that game\r\n\t\tmysql_query($queryCheckIfExists) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\tif($SQLerror!='')\r\n\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\t\t\r\n\r\n\t\tif(mysql_affected_rows() > 0)\r\n\t\t\treturn \"true\";\r\n\t\telse {\r\n\t\t\t// Continue if user is not a member of that game\r\n\t\t\t$query = \"INSERT INTO gameMembers (gameId,userId,joined)\".\r\n\t\t\t\t\t\t\"VALUES ('\".$gameId.\"','\" .$userId. \"','\" .$currentDate.\"')\";\r\n\r\n\t\t\t$result = mysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\t\t\tif($SQLerror!='')\r\n\t\t\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\t\t\r\n\r\n\t\t\tif(mysql_affected_rows() == 1)\r\n\t\t\t\treturn \"true\";\r\n\t\t\telse\r\n\t\t\t\treturn \"false\";\r\n\t\t}\r\n\t}", "public function joinGame(Request $request){\n $this->validate( $request,[\n 'gameid' => 'required',\n ]);\n $user = Auth::user(); \n $game= Game::where(\"id\",\"=\",$request->gameid)->where(\"gameState\",\"=\",\"challenge\")->first();\n \n if($game == null){\n return response()->json([\n 'success' => false\n ]);\n }\n $game->gameState = \"playing\";\n $game->save();\n return response()->json([\n 'success' => true,\n 'data' => $game\n ]);\n}", "function finishedGame($userId, $gameId){\t\t\t\r\n\t\t$SQLerror = \"\";\r\n\t\t$addToHighScore = true;\r\n\r\n\t\t// Don't continue if either gameId or userId doesn't exist in db\r\n\t\tif( ! ($this->gameIdExists($gameId) && $this->userIdExists($userId)))\r\n\t\t\treturn json_encode(array(\"error\"=>\"gameId or userId doesn't exist\"));\r\n\t\t// Don't continue if user is not a member of that game\r\n\t\tif( ! ($this->isUserMemberOfGame($userId,$gameId)))\r\n\t\t\treturn json_encode(array(\"error\"=>\"user is not member of that game\"));\r\n\t\t\t\r\n\t\t// Selects exactly one row if game is already finished otherwise it selects nothing\r\n\t\t$query = \"SELECT finished FROM gameMembers WHERE userId = \".$userId.\" and gameId=\".$gameId.\" and finished=TRUE\";\t\t\r\n\t\t$query = mysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\tif($SQLerror != \"\")\r\n\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\r\n\t\telseif(mysql_affected_rows() > 0)\r\n\t\t\treturn \"true\"; //don't add to user's highscore\r\n\t\t\r\n\t\tif($addToHighScore) { // add game score and locations to user profile and update game to be in finished state\t\t\t\t\t\t\r\n\t\t\t// Set game to finished state\r\n\t\t\t$query = \"UPDATE gameMembers \"\r\n\t\t\t\t.\"SET finished=TRUE \"\r\n\t\t\t\t.\"WHERE userId = \".$userId.\" and gameId=\".$gameId;\r\n\t\t\tmysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;\r\n\t\t\t//echo $query.\"<br>\";\r\n\t\t\tif($SQLerror != \"\")\r\n\t\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\r\n\r\n\t\t\t// Add score and number of finished locations to user\r\n\t\t\t$query = \"\r\n\t\t\t\tupdate userScores \r\n\t\t\t\tSET \r\n\t\t\t\tscore = (\r\n\t\t\t\t\tselect score from (select * from userScores) as x where userId=\".$userId.\")+\r\n\t\t\t\t\t(SELECT score FROM gameScores WHERE gameId=\".$gameId.\")\r\n\t\t\t\t,\r\n\t\t\t\tlocations = (\r\n\t\t\t\t\tselect locations from (select * from userScores) as x where userId=\".$userId.\")+\t\r\n\t\t\t\t\t(SELECT COUNT(*) FROM gameCoordinates WHERE gameId=\".$gameId.\")\r\n\t\t\t\twhere userId=1;\";\r\n\t\t\t//echo $query.\"<br>\";\t\r\n\t\t\tmysql_query($query) or $SQLerror = $query.mysql_error().\" \".$query;\t\t\t\t\t\r\n\t\t\tif($SQLerror != \"\")\r\n\t\t\t\treturn json_encode(array(\"error\"=>$SQLerror));\r\n\t\t\techo json_encode(array(\"result\"=>true));\r\n\t\t}\t\t\t\t\r\n\t\telse // will never get to this state either outputs sql error or finishes correctly before\r\n\t\t\techo json_encode(array(\"result\"=>true));\r\n\t}", "public function hasGameFinished()\n {\n return $this->hasWon;\n }", "private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }", "abstract protected function isGameOver();", "function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "private function exit_user_from_game() {\n //increments the user account_balance, since the amount was already deducted at game start\n $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) + {$this->amount} WHERE user_id = '{$this->userID}'\");\n\n /*This gets the user current game details*/\n $this->userCurrentGameDetail = $this->fetch_data_from_table($this->games_table_name, 'game_id', $this->user_details[\"game_id_about_to_play\"])[0];\n\n /* Gets the number of players in the game */\n $number_of_players = (int)$this->userCurrentGameDetail[\"number_of_players\"];\n\n /* the new number of players will now be the previous number of players - 1*/\n $new_number_of_players = $number_of_players - 1;\n /* if the new number of players is equal to 0; meaning that he is the only one about to play; the entire game details will be deleted from the database*/\n if($new_number_of_players == 0){ $this->delete_record($this->games_table_name , \"game_id\" , $this->user_details[\"game_id_about_to_play\"] ); return true;}\n /* else set the new number of players to the one above */\n $this->update_record($this->games_table_name , \"number_of_players\" , $new_number_of_players , 'game_id' , $this->userCurrentGameDetail[\"game_id\"]);\n /* delete the game id from the user detail to avoid deduction from the when the game starts */\n $this->update_record($this->users_table_name , \"game_id_about_to_play\" , \"0\" , 'user_id' , $this->userID);\n /* finally return true */\n return true;\n }", "function game_is_broken($game) {\n\tif ($game->is_tie()) {\n\t\techo \"\\n\\n****ERROR: Broken Game. Tie! in game_is_broken()\";\n\t\tpause(\"\");\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function join($id)\n\t{\n\t\t$group = Group::find($id);\n\n\t\tif($group) {\n\n\t\t\tif(Auth::user()->getUsername() == $group->creator) {\n\t\t\t\tSession::flash('info_message', 'You are the creator of the group!');\n\t\t\t\treturn redirect(route('groups.show', [$group->id]));\n\t\t\t}\n\n\t\t\t$user_id = Auth::user()->getId();\n\n\t\t\t$userJoined = DB::select(\"select user_id from group_user where user_id = $user_id and group_id = $group->id\");\n\n\t\t\tif (empty($userJoined)) {\n\t\t\t\t$group->users()->attach(Auth::user()->getId());\n\n\t\t\t\tSession::flash('message', 'Joined Group!');\n\t\t\t\treturn redirect(route('groups.show', [$group->id]));\n\n\t\t\t} else {\n\t\t\t\tSession::flash('info_message', 'You are already in this group!');\n\t\t\t\treturn redirect(route('groups.show', [$group->id]));\n\t\t\t}\n\n\t\t} else {\n\t\t\tSession::flash('info_message', 'No such group!');\n\t\t\treturn redirect(route('groups.index'));\n\t\t}\n\t}", "public function joinAction()\n {\n $roomId = $this->_getParam('id');\n $nickname = $this->_getParam('nick_name');\n if ( ! $roomId OR ! $nickname) {\n $this->badRequestAction();\n }\n \n // validate the room id\n if (strlen($roomId) > 100) {\n $this->failure(ERROR_FORM_VALIDATION_FAILURE);\n }\n \n $userDto = Zend_Registry::get('api_user');\n $result = $this->getBusiness()->join($roomId, $userDto, $nickname);\n \n $this->fromArray($result);\n }", "public function isJoined(): bool\n {\n if (!empty($this->options['using'])) {\n return true;\n }\n\n return in_array($this->getMethod(), [self::INLOAD, self::JOIN, self::LEFT_JOIN], true);\n }", "public static function addGameUserOnly() {\n\t\t$accountId = parent::get_user_logged_in()->id;\n\t\tif (isset($_POST['list'])) {\n\t\t\t$gameId = $_POST['list'];\n\t\t} else {\n\t\t\tRedirect::to('/addGame', array('errors' => array('nothing selected')));\n\t\t}\n\n\t\tif (!Account_game::checkIfAccountOwnsGame($accountId, $gameId)) {\n\t\t\t$accountGame = new Account_game(array(\n\t\t\t\t'accountId' => $accountId,\n\t\t\t\t'gameId' => $gameId\n\t\t\t));\n\t\t\t$accountGame->save();\n\t\t\tRedirect::to('/addGame', array('messages' => array('game added to your account')));\n\t\t} else if (Game::getGame($gameId) == null) {\n\t\t\t$errors = array(\"game doesn't exist\");\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t} else {\n\t\t\t$errors = array('you already own that game');\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t}\n\t}", "public function isInGame() {\n return $this->onlineState == 'in-game';\n }", "function playerIsGM($gameID, $playerName)\n{\n $dbh = connectToDatabase();\n $stmt = $dbh->prepare('SELECT gmName FROM games WHERE gameID = ?');\n $stmt->execute([$gameID]);\n $result = $stmt->fetch(PDO::FETCH_NUM);\n\n if (count($result) <= 0) {\n // Wait, there is no game with that ID\n http_response_code(404);\n die('GAME NOT FOUND');\n }\n\n $isGM = $result[0] === $playerName;\n\n return $isGM;\n}", "function join_other_room(){\n\t\tglobal $db, $prefix, $txt, $print;\n\n\t\t// See if hte room exists\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}rooms WHERE name='$_POST[rname]'\");\n\t\t$row = $db->Do_Fetch_Row($query);\n\n\t\tif($row == \"\"){\n\t\t\t// Tell them they are stupid and that room doesn't exist\n\t\t\t$body = \"<div align=\\\"center\\\">$txt[386]<Br><Br><a href=\\\"./index.php\\\">$txt[77]</a></div>\";\n\t\t}else{\n\t\t\t// Give them a link to join that room\n\t\t\t$txt[387] = eregi_replace(\"<a>\",\"<a href=\\\"index.php?act=frame&room=$_POST[rname]\\\">\",$txt[387]);\n\t\t\t$body = $txt[387];\n\t\t}\n\n\n\t\t$print->normal_window($txt[29],$body);\n\t}", "public function gameOver()\n\t{\n\n\t\tif($this->checkForWin() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"win\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">Congratulations on guessing: ' . $this->phrase->activePhrase . '</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Play again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\n\t\t} elseif ($this->checkForLose() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"lose\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">The phrase was: ' . $this->phrase->activePhrase . '. Better luck next time!</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Try again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\t\n\t\t} else {\n\t\t\t$gameover = false;\n\t\t}\n\n\t\treturn $gameover;\n\n\t}", "function joinRun() {\r\n\t// Access the globals. \r\n\tglobal $DB;\r\n\tglobal $TIMEMARK;\r\n\tglobal $MySelf;\r\n\t$runid = (int) $_GET[id];\r\n\t$userid = $MySelf->GetID();\r\n\r\n\t// Are we allowed to join runs?\r\n\tif (!$MySelf->canJoinRun()) {\r\n\t\tmakeNotice(\"You are not allowed to join mining operations. Please ask your CEO to unblock your account.\", \"error\", \"Forbidden\");\r\n\t}\r\n\r\n\t// Is $runid truly an integer?\r\n\tnumericCheck($runid);\r\n\r\n\t// Is the run still open?\r\n\tif (!miningRunOpen($runid)) {\r\n\t\tmakeNotice(\"This mining operation has been closed!\", \"warning\", \"Can not join\", \"index.php?action=show&id=$runid\");\r\n\t}\r\n\r\n\t// Are we banned from the run?\r\n\t$State = $DB->getCol(\"SELECT status FROM joinups WHERE run='$runid' and userid='\" . $MySelf->getID() . \"'ORDER BY id DESC LIMIT 1\");\r\n\t$State = $State[0];\r\n\r\n\tswitch ($State) {\r\n\t\tcase (\"2\") :\r\n\t\t\t// We have been kicked.\r\n\t\t\t$kicked = true;\r\n\t\t\tbreak;\r\n\t\tcase (\"3\") :\r\n\t\t\t// We have been banned!\r\n\t\t\tif ((runSupervisor($runid) == $MySelf->getUsername()) || $MySelf->isOfficial()) {\r\n\t\t\t\t$banned = \"You have been banned from this operation but your rank overrides this block.\";\r\n\t\t\t} else {\r\n\t\t\t\tmakeNotice(\"You have been banned from this operation. You can not rejoin it.\", \"warning\", \"You are banned.\", \"index.php?action=list\", \"[cancel]\");\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\t// Is the run locked?\r\n\tif (runIsLocked($runid)) {\r\n\t\tmakeNotice(\"You can not join this run as this run has been locked by \" . runSupervisor($runid) . \".\", \"notice\", \"Mining operation locked\", \"index.php?action=show&id=$runid\", \"[Cancel]\");\r\n\t}\r\n\t\r\n\t// Join with shiptype.\r\n\tif (!$_GET['confirmed-ship']) {\r\n\t\t$table = new table(1, true);\r\n\t\t$table->addHeader(\">> Join an Operation\");\r\n\r\n\t\t// If we have been kicked, inform the user.\r\n\t\tif ($kicked) {\r\n\t\t\t$table->addRow(\"#880000\");\r\n\t\t\t$table->addCol(\"Warning: You have been recently kicked. Please check if you are allowed to rejoin to avoid a ban.\");\r\n\t\t}\r\n\r\n\t\t// If we are banned but an official, inform the user.\r\n\t\tif ($banned) {\r\n\t\t\t$table->addRow(\"#880000\");\r\n\t\t\t$table->addCol($banned);\r\n\t\t}\r\n\r\n\t\t$table->addRow();\r\n\t\t$table->addCol($form . \"Join the Operation in \" . ucfirst(getLocationOfRun($runid)) . \".\");\r\n\t\t$table->addRow();\r\n\t\t$table->addCol(\"You have requested to join mining operation #$runid. Please choose the shipclass \" .\r\n\t\t\"you are going to join up with.\");\r\n\t\t$table->addRow();\r\n\t\t$table->addCol(\"Shiptype: \" . $hiddenstuff . joinAs(), array (\r\n\t\t\t\"align\" => \"center\"\r\n\t\t));\r\n\t\t$table->addRow(\"#444455\");\r\n\t\t$table->addCol(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Join mining operation\\\">\" . $form_end, array (\r\n\t\t\t\"align\" => \"center\"\r\n\t\t));\r\n\r\n\t\t$page = \"<h2>Join an Operation.</h2>\";\r\n\t\t$page .= \"<form action=\\\"index.php\\\" method=\\\"GET\\\">\";\r\n\t\t$page .= \"<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"$runid\\\">\";\r\n\t\t$page .= \"<input type=\\\"hidden\\\" name=\\\"confirmed-ship\\\" value=\\\"true\\\">\";\r\n\t\t$page .= \"<input type=\\\"hidden\\\" name=\\\"confirmed\\\" value=\\\"true\\\">\";\r\n\t\t$page .= \"<input type=\\\"hidden\\\" name=\\\"multiple\\\" value=\\\"true\\\">\";\r\n\t\t$page .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"joinrun\\\">\";\r\n\r\n\t\t$page .= ($table->flush());\r\n\t\t$page .= \"</form>\";\r\n\t\treturn ($page);\r\n\r\n\t}\r\n\r\n\t// Sanitize the Shiptype.\r\n\tglobal $SHIPTYPES;\r\n\t$ShiptypesCount = count($SHIPTYPES);\r\n\tif (!numericCheck($_GET[shiptype], 0, $ShiptypesCount)) {\r\n\t\tmakeNotice(\"The shiptype you tried to join up with is invalid, please go back, and try again.\", \"warning\", \"Shiptype invalid!\", \"index.php?action=show&id=$_GET[id]\");\r\n\t} else {\r\n\t\t$shiptype = $_GET[shiptype];\r\n\t}\r\n\t\r\n\t// Warn the user if he is already in another run.\r\n\t$joinedothers = $DB->query(\"select run from joinups where userid='$userid' and parted IS NULL order by run\");\r\n\r\n\t// And check for that just now.\r\n\tif ($joinedothers->numRows() > 0) {\r\n\t\tconfirm(\"You joined another mining operation already!<br>Are you sure you want to join multiple runs at the same time?\");\r\n\t}\r\n\r\n\t// Get the correct time to join (in case event hasnt started yet)\r\n\t$startOfRun = $DB->getCol(\"SELECT starttime FROM runs WHERE id='$runid' LIMIT 1\");\r\n\tif ($startOfRun[0] > $TIMEMARK) {\r\n\t\t$time = $startOfRun[0];\r\n\t} else {\r\n\t\t$time = $TIMEMARK;\r\n\t}\r\n\r\n\t// Dont allow him to join the same mining run twice.\r\n\tif (userInRun($MySelf->getID(), \"$runid\") == \"none\") {\r\n\r\n\t\t// Mark user as joined.\r\n\t\t$DB->query(\"insert into joinups (userid, run, joined, shiptype) values (?,?,?,?)\", array (\r\n\t\t\t\"$userid\",\r\n\t\t\t\"$runid\",\r\n\t\t\t\"$time\",\r\n\t\t\t\"$shiptype\"\r\n\t\t));\r\n\r\n\t\t// Forward user to his joined run.\r\n\t\tmakeNotice(\"You have joined the Mining Operation.\", \"notice\", \"Joining confirmed\", \"index.php?action=show&id=$id\");\r\n\r\n\t} else {\r\n\r\n\t\t// Hes already in that run.\r\n\t\tmakeNotice(\"You are already in that mining run!\", \"notice\", \"Joinup not confirmed\", \"index.php?action=show&id=$id\");\r\n\r\n\t}\r\n\r\n}", "public function own($id)\r\n\t{\r\n\t\t// Find our game and perform the vote.\r\n\t\t$game = $this->findById($id);\r\n\r\n\t\t// Check if we own this game already.\r\n\t\tif (!empty($game) && $game['owned'] == 1) return false;\r\n\r\n\t\t// Check if we are using the service.\r\n\t\tif (XBOXAPP_OFFLINE === true) {\r\n\t\t\tif (empty($game)) return false;\r\n\t\t\t$this->update($id, array('owned' => 1));\r\n\t\t} else {\r\n\t\t\t// Set the status to gotit.\r\n\t\t\tif (!ServiceApi::setGotIt($id)) return false;\r\n\t\t}\r\n\r\n\t\t// Sync up our database.\r\n\t\t$this->sync();\r\n\r\n\t\treturn true;\r\n\t}", "function works() {\n\t$data = createMessagePayload('Flarum is able to contact this Telegram room. Great!');\n\n\ttry {\n\t\t$result = Request::sendMessage($data);\n\n\t\treturn $result->isOk();\n\t} catch (TelegramException $e) {\n\t\treturn false;\n\t}\n}", "public function isPlayed() : bool {\n\t\tif (count($this->games) === 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn count(array_filter($this->getGames(), static function($a) {\n\t\t\t\treturn $a->isPlayed();\n\t\t\t})) !== 0;\n\t}", "public function playerHasWon() {\n foreach ($this->players as $player) {\n if ($player->score >= $this->game->winningScore) {\n return true;\n }\n }\n return false;\n }", "public function joinPlayerToMatch( $id_match, $id_player, $available )\n\t{\n\t\t$id_match\t= intval( $id_match );\n\t\t$id_player\t= intval( $id_player );\n\t\t$available\t= $this->database->real_escape_string( $available );\n\n\t\t$query = <<<QUERY\nINSERT INTO matches_player\n\t( id_match, id_player, available )\nVALUES\n\t( $id_match, $id_player, '$available' )\nON DUPLICATE KEY UPDATE available = '$available';\nQUERY;\n\n\t\t$this->database->query( $query, \"Join player #$id_player to match #$id_match with status $available\" );\n\n\t\treturn true;\n\t}", "function joinMessage($name)\r\n{\r\n\tif (LACE_SHOW_JOIN_PART)\r\n\t{\r\n\t\tglobal $A;\r\n\t\tif($name && false === $A->keyExists($name))\r\n\t\t{\r\n\t\t\t$message = array\r\n\t\t\t(\r\n\t\t\t\t'action' => true,\r\n\t\t\t\t'time' => time(),\r\n\t\t\t\t'name' => 'Lace',\r\n\t\t\t\t'text' => '<strong>'.$name.'</strong> joins the conversation',\r\n\t\t\t);\r\n\t\t\taddMessage($message);\r\n\t\t}\r\n\t}\r\n}", "public function save_game(){\n\n\t\t$query = \"UPDATE `games`\n\t \tSET `title` = '$this->title', `user_count` = '$this->user_count', `api` = '$this->api',\n\t \t`info` = '$this->info', `bgimage` = '$this->bgimage', `banner` = '$this->banner', `level` = '$this->level'\n\t \tWHERE `id` = '$this->id'\";\n\n\t\tif(DB::sql($query)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function write_new_game(){\n\n\t\t$query = \"INSERT INTO `games`\n\t\t( `title`, `user_count`, `info`, `bgimage`, `banner`, `level`, `api`)\n\t\tVALUES\n\t\t('$this->title', '$this->user_count', '$this->info', '$this->bgimage', '$this->banner', '$this->level', '$this->api')\";\n\n\t\tif(DB::sql($query)){\n\t\t\t$this->id = DB::last_id();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function actionJoin($id)\n {\n $currentUser = Yii::$app->user->identity;\n\n if ($this->projectService->joinProject($currentUser->id, $id)) {\n Yii::$app->session->setFlash('success', 'Successfully joined project');\n\n return $this->redirect(Url::to(['project/show', 'id' => $id]));\n }\n\n Yii::$app->session->setFlash('error', 'Failed to join project');\n\n return $this->redirect(Url::to(['project/index']));\n }", "public function gameOver() : bool\n {\n return $this->cpu->totalScore() >= 100 || $this->player->totalScore() >= 100;\n }", "public function isGameExistant($id) \n {\n $sql = \"select * from game where game_id=? limit 1\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return true;\n else\n return false;\n }", "public function IsPlayingSharedGame($appIdPlaying)\n {\n $this->setApiDetails(__FUNCTION__, 'v0001');\n\n // Set up the arguments\n $arguments = [\n 'steamId' => $this->steamId,\n 'appid_playing' => $appIdPlaying,\n ];\n\n // Get the client\n $client = $this->getServiceResponse($arguments);\n\n return $client->lender_steamid;\n }", "private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }", "public function isJoin();", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function isOnline()\n\t{\n\t\t$server = new Application_Model_Server();\n\t\t$players = $server->getOnlinePlayers();\n\t\t\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\tif ($player == $this->getUsername()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function is_player_in_game($player_id, $including_referee = false )\n {\n \tif ( true === $including_referee && (int) $this->referee === (int) $player_id ) {\n \t\treturn true;\n\t }\n\n $players = $this->players()->get();\n foreach ($players as $player) {\n if ((int) $player->id === (int) $player_id) {\n return true;\n }\n }\n\n return false;\n }", "function join(&$irc, &$data)\n\t{\n\t\tglobal $pickupchannel;\n global $adminchannel;\n\t\tglobal $pickup;\n\t\tglobal $queue;\n global $chanjoin;\n\t\tglobal $ircinfo;\n\n //Check if this is the bot itself joining\n if($chanjoin < 3)\n {\n //Check if this is the pickup channel\n if($data->channel == $ircinfo->pickupchan)\n {\n //Join the bot and admin channel\n $irc->join($ircinfo->adminchan, $ircinfo->adminchan_pass);\n $irc->join($ircinfo->botchan, $ircinfo->botchan_pass);\n\n //Names the pickup channel\n $irc->names($ircinfo->pickupchan);\n }\n\n //Increment the channel join counter\n $chanjoin++;\n } else\n {\n //Get data to variables\n $nick = $data->nick;\n\n //Add user check to the queue\n $queue->add_item($nick, \"check\");\n\n //Issue whois\n $irc->whois($nick);\n }\n\t}", "public function play(){\n\t\t$gameId = $this->input->post('gameId');\n $utoken = $this->input->post('utoken');\n\t\t$word = $this->input->post('word');\n\t\t$game = $this->setRedis_info($gameId);\n\t\tif(!in_array($utoken, $game['players'])){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'You are not a player in this game or game session expired!'], 202);\n\t\t}\n\t\tif($game['status'] == 'waiting'){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Wait for game to begin...Hold tight!'], 202);\n\t\t}\n\t\tif($game['status'] == 'completed'){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Game has been completed!'], 202);\n\t\t}\n\t\tif($utoken != $game['current_player']){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Wait for your turn!'], 202);\n\t\t}\n\t\tif($word=='#'){\n\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'You have passed your chance!'], 202);\n\t\t}else{\n\t\t\t$obj = new algo();\n\t\t\t$result = $obj->checkWord($game, $word, $utoken);\n\t\t\tif($result['status']){\n\t\t\t\t$game = $result['game'];\n\t\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t\t$game = $this->gameStatus($game);\n\t\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t\t$this->setHeader(['success'=>1, 'msg'=>'Congratulations...Successfully matched the word!'], 200);\n\t\t\t}else{\n\t\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t\t$this->setHeader(['success'=>0, 'msg'=>$result['msg']], 202);\n\t\t\t}\n\t\t}\n }", "private function joinGroup()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n else \n $uid = userid(); \n \n global $cbgroup; \n $group_details = $cbgroup->get_group($gid);\n $id = $cbgroup->join_group($gid,$uid);\n \n \n if( error() )\n {\n if(error('single')==lang('grp_join_error') && $group_details['group_privacy']==1)\n $error = 'You have already requested to join this group';\n else\n $error = error('single');\n\n throw_error_msg($error); \n }\n\n if( msg())\n {\n if($group_details['group_privacy']==1)\n $msg = 'Your request to join group has been sent successfully';\n else\n $msg = msg('single');\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => $msg, \"data\" => array());\n $this->response($this->json($data));\n }\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function playing(): bool\n {\n\n return $this->state !== SELF::STATE_GAMEOVER;\n }", "public function isGameOver(): bool\n {\n return $this->getGameState() === SELF::STATE_GAMEOVER;\n }", "function gaMatch_addPlayerResult($kidPlayerId, $win, $draw, $lost) {\n //??????????????????? does record already exist - what if player change ?????????\n $match = array_search ( $kidPlayerId , $this->gamatch_gamePlayerMap);\n if ($match === FALSE) {\n $newGame = new stdData_gameUnit_extended;\n $newGame->stdRec_loadRow($row);\n $this->gamatch_gamePlayerMap[$newGame->game_kidPeriodId] = $newGame;\n ++$this->game_opponents_count;\n $this->game_opponents_kidPeriodId[] = $kidPlayerId;\n $this->game_opponents_wins[] = $win;\n $this->game_opponents_draws[] = $draw;\n $this->game_opponents_losts[] = $lost;\n $this->gagArrayGameId[] = 0;\n } else {\n $this->game_opponents_wins[$match] += $win;\n $this->game_opponents_draws[$match] += $draw;\n $this->game_opponents_losts[$match] += $lost;\n }\n}", "function incrementRound($gameId){\n\t$conn = getDB();\n\t$sql = \"UPDATE games SET round = round + 1 WHERE id=\".$gameId;\n\tif(!$conn->query($sql)){\n\t\tcloseDB($conn);\n\t\techo \"\\nFailed to increment round for gameId: \" . $gameId;\n\t\treturn false;\n\t}\n\tcloseDB($conn);\n\treturn true;\n}", "public function load_game($id){\n\n\t\t$query = \"SELECT * FROM `games` WHERE `id` = '$id'\";\n\n\t\t$result = DB::sql_fetch(DB::sql($query));\n\t\tif(setData($result)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "protected function isWon($marker) {\n $markedBox = $this->_markers[$marker];\n foreach ($this->_winningCombination AS $box) {\n $lineBoxes = explode(\",\", $box); //separate the winning combination to 3\n if (in_array($lineBoxes[0], $markedBox) && in_array($lineBoxes[1], $markedBox) && in_array($lineBoxes[2], $markedBox)) {\n echo \"Player $marker won!\" . PHP_EOL;\n return TRUE;\n }\n }\n return FALSE;\n }", "public function joinRoomAction()\n {\n \t$userDto = Zend_Registry::get('api_user');\n \t$rooms = $this->getBusiness()->getRoomByState($userDto, Dto_ChatRoomUser::STATE_JOIN);\n \t\n \t$roomArray = $rooms->toArray(array('room_id', 'created_at'));\n \t$this->success(array('rooms' => $roomArray));\n }", "public function connectedAction()\n\t{\n\t\t$this->view->headTitle(\"Complete a game Connection\");\n\t\t\n\t\t//Retrieve the invitation key\n\t\t$key = $this->getRequest()->getParam('key');\n\t\t\n\t\t// Retrieve the invitation\n\t\t$invitation = new Default_Model_Invitation();\n\t\t//$this->view->outstandingInvitation = $invitation->getInvitation($key);\n\t\t\n\t\t // Complete the invitation process\n\t\t $connected = $invitation->completeInvitation($key);\n\t\t\n\t\t // Determine the outcome response\n\t\t if ($connected) {\n\t\t \t$this->view->success = 1;\n\t\t } else {\n\t\t\t $this->view->errors[] = \"Could not complete the connection request.\";\n\t\t }\n\n\t}", "function dealHandToPlayer($gameId, $hand, $playerId){\n $playerPosition = getPositionFromPlayerId($gameId, $playerId);\n if($playerPosition === false)\n return false;\n \n $conn = getDB();\n $sql = \"UPDATE games SET player\".$playerPosition.\"hand='\".$hand.\"' WHERE id=\".$gameId;\n if(!$conn->query($sql)){\n closeDB($conn);\n echo \"\\nFailed to run query in dealHandToPlayer!\\n\";\n return false;\n }\n closeDB($conn);\n return true;\n}", "public function roll()\n {\n if (!$this->hasWon) {\n $this->playerMessage = null;\n $diceResult = $this->dice->roll();\n if ($diceResult == self::LOSING_SCORE_NO) {\n $this->points -= $this->score;\n $this->score = 0;\n $this->playerMessage = \"Det blev en etta. Du förlorade alla poäng du inte hade sparat!\";\n } else {\n $this->score += $diceResult;\n if ($this->isGameFinished()) {\n $this->endGame();\n }\n }\n }\n }", "public static function addGame() {\n\t\t$params = $_POST;\n\n\t\t$newGame = new Game(array(\n\t\t\t'name' => $params['name'],\n\t\t\t'url' => $params['url'],\n\t\t\t'desc' => $params['desc']\n\t\t\t));\n\n\t\t$errors = $newGame->errors();\n\n\t\tif (count($errors) == 0) {\n\t\t\t$gameId = $newGame->save();\n\t\t\t$accountId = parent::get_user_logged_in()->id;\n\t\t\tKint::dump(array($gameId, $accountId));\n\t\t\t$accountGame = new Account_game(array(\n\t\t\t\t'accountId' => $accountId,\n\t\t\t\t'gameId' => $gameId\n\t\t\t\t));\n\t\t\t$accountGame->save();\n\t\t\t$messages = array('game added');\n\t\t\tRedirect::to('/addGame', array('messages' => $messages));\n\t\t} else {\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t}\n\t}", "public function hit()\n {\n // load game session\n $this->loadGameSession();\n\n $gameOver = $this->getGame()->hit();\n\n if ($gameOver) {\n $this->resetGame();\n $message = 'game over';\n\n } else {\n $message = 'keep hitting poor bees';\n }\n\n // store a message to display it next time\n $this->getFlashBag()->add('message', $message);\n\n // update session\n $this->updateGameSession();\n\n // redirect to home page\n return $this->app->redirect($this->getUrlGenerator()->generate('home'));\n }", "function isConnectSent($profile_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM connect_asked WHERE profile_id= :profile_id AND accountID=:account LIMIT 1');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':account'=>$account));\n\t\tif($statement->rowCount() == 0)\n\t\t\treturn false;\n\t\treturn $statement->fetch();\n\t}", "private function endGame()\n {\n $this->hasWon = true;\n $this->calculatePoints();\n $this->setMessageToPlayer();\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "private function sync()\r\n\t{\t\r\n\t\t// Check if we're in offline mode.\r\n\t\tif (XBOXAPP_OFFLINE === true) return false;\r\n\r\n\t\t// If we were in offline mode I'd go ahead and add all the games that were not\r\n\t\t// added to the service by checking if sync = 0. This was mainly if I was working\r\n\t\t// without the internet or if for some reason the Nerdery service was down for some\r\n\t\t// period of time. I'm not sure how useful this will be but I've implemented for fun.\r\n\t\t$unsyncedGames = parent::fetch(array('sync' => 0));\r\n\t\twhile ($game = $unsyncedGames->fetchArray())\r\n\t\t{\r\n\t\t\tServiceApi::addGame($game['title']);\r\n\r\n\t\t\t// This doesn't work well with games the owning part... There's no elegant way to do it\r\n\t\t\t// other than grabbing the list and setting them to owned. boooo! This is for testing\r\n\t\t\t// mostly so I'll just skip it since this case will never really exist.\r\n\r\n\t\t\t// This goes also for the votes in offline mode... they don't transfer over in this implementation.\r\n\t\t\t// None of these issues would be hard to implement really...\r\n\r\n\t\t\t// Essentially, no votes or owned games will be synced, only the titles.\r\n\t\t}\r\n\r\n\t\t// Clear out our current games since they are at this point, invalid!\t\t\r\n\t\tparent::clear();\r\n\r\n\t\t// Get the games from the service call and readd them to our sqlite3 database.\r\n\t\t$games = ServiceApi::getGames();\r\n\t\tif (!empty($games) && count($games)) {\r\n\t\t\tforeach ($games as $game) {\r\n\t\t\t\t$this->_dbadd($game->title, 1, $game->id, $game->votes, ($game->status === 'gotit' ? 1 : 0));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getCurrentGame() {\n\t\t// $stmt = $this->dbh->prepare($sql);\n\t\t// $this->dbo->execute($stmt,array());\t\n\n\t\t// if ($stmt->rowCount() >= 1)\n\t\t// {\t\n\t\t// \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t// \treturn $result[0];\n\t\t// } else {\n\t\t// \treturn false;\n\t\t// }\t\n\t }", "public function playersThatArePlayingLogins() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$specLogins = array();\n\t\tforeach ($spectators as $spec) {\n\t\t\t$specLogins[] = trim($spec->login);\n\t\t}\n\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\t\t$allPlayersLogins = array();\n\t\tforeach ($allPlayers as $pl) {\n\t\t\t$allPlayersLogins[] = trim($pl->login);\n\t\t}\n\n\t\treturn array_diff($allPlayersLogins, $specLogins);\n\t}", "function getLoginForPlayer ($id_joueur) {\n\tglobal $bdd;\n\t$player_login = false;\n\t$req = $bdd->prepare('\n\t\tSELECT login\n\t\tFROM joueurs\n\t\tWHERE id_joueur = :id_joueur;\n\t');\n\t$req->execute(array('id_joueur' => $id_joueur));\n\tif ($row = $req->fetch()) {\n\t\t$player_login = $row['login'];\n\t}\n\treturn $player_login;\n}", "public function join_post() {\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n // $this->form_validation->set_rules('UserTeamGUID', 'UserTeamGUID', 'trim|callback_validateEntityGUID[User Teams,UserTeamID]');\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]|callback_validateUserJoinContest');\n $this->form_validation->set_rules('MatchGUID', 'MatchGUID', 'trim|required|callback_validateEntityGUID[Matches,MatchID]');\n $this->form_validation->set_rules('SeriesGUID', 'SeriesGUID', 'trim|required|callback_validateEntityGUID[Series,SeriesID]');\n $this->form_validation->validation($this); /* Run validation */\n\n /* Join Contests */\n /** Check match on going to live* */\n $ContestDetails = $this->SnakeDrafts_model->getContests(\"GameTimeLive,ContestID,LeagueJoinDateTime,LeagueJoinDateTimeUTC,IsAutoDraft\", array(\"ContestID\" => $this->ContestID));\n $LeagueJoinDateTime = $ContestDetails['LeagueJoinDateTimeUTC'];\n $currentDateTime = date('Y-m-d H:i:s');\n if (strtotime($LeagueJoinDateTime) < strtotime($currentDateTime)) {\n /* $this->SnakeDrafts_model->changeContestStatus($this->ContestID); */\n $this->Return['ResponseCode'] = 500;\n $this->Return['Message'] = \"You can not join the contest because time is over.\";\n } else {\n $JoinContest = $this->SnakeDrafts_model->joinContest($this->Post, $this->SessionUserID, $this->ContestID,$this->SeriesID, $this->MatchID, $this->UserTeamID, @$ContestDetails['IsAutoDraft']);\n if (!$JoinContest) {\n $this->Return['ResponseCode'] = 500;\n $this->Return['Message'] = \"An error occurred, please try again later.\";\n } else {\n $this->Return['Data'] = $JoinContest;\n $this->Return['Message'] = \"Contest joined successfully.\";\n }\n }\n }", "public function testNewGameSuccess()\n {\n $user = factory(UserModel::class)->create();\n\n $generator = new GamePlayService();\n $generatedHand = $generator->generateRandomCards(rand(1, 14));\n\n\n $response = $this->postJson('/api/v1/newgame',\n ['userId' => $user->id, 'userCardSequence' => implode(' ', $generatedHand)]);\n\n $response\n ->assertStatus(201)\n ->assertJsonStructure([\n 'data' => [\n 'userCardSequence',\n 'generatedCards',\n 'gameScore'\n ]\n ]);\n }", "public function joinGroup(Group $group)\n {\n $user = Auth::user();\n\n // Check if user has valid (non-deleted) invitation for joining this group\n $groupInvitations = $group->notifications()->ofReceiver($user[Constants::FLD_USERS_ID]);\n\n // Invitation exists\n if ($groupInvitations->count() > 0) {\n\n // Join the group\n $user->joiningGroups()->syncWithoutDetaching([$group[Constants::FLD_GROUPS_ID]]);\n\n // Delete user joining invitation once joined the group\n // Because if the user left the group and the then rejoined\n // (if the invitation still exists), he will join, and we\n // should prevent this\n $groupInvitations->delete();\n\n } // Else, check if the user hasn't sent joining request (if sent stop, else send one)\n else if (!$user->seekingJoinGroups()->find($group[Constants::FLD_GROUPS_ID])) {\n // Send joining request\n $user->seekingJoinGroups()->syncWithoutDetaching([$group[Constants::FLD_GROUPS_ID]]);\n }\n\n return back();\n }", "public function testPlayedGame() {\n $game = new Game('anaconda');\n\n $game->tryLetter('a');\n $this->assertTrue($game->isLetterFound('a'));\n $this->assertSame(array('a'), $game->getFoundLetters());\n\n $game->tryLetter('c');\n $this->assertFalse($game->isLetterFound('b'));\n $this->assertSame(array('a', 'c'), $game->getTriedLetters());\n }", "function doSavePlayerGame() {\n\t\tif(!LibTools::isAdmin()) {\n\t\t\treturn;\n\t\t}\n\t\t$gamePlayed = $_POST['gamePlayed'];\n\t\tif(!isset($gamePlayed)) {\n\t\t\treturn;\n\t\t}\n\t\tforeach($gamePlayed as $id_game => $id_char) {\n\t\t\tSs::get()->dao->playerGameDao->save($this->id, $id_game, $id_char);\n\t\t}\n\t\t\n\t}", "function checkWorldFinished()\n{\n\tglobal $db;\n\t$sql = \"SELECT COUNT(DISTINCT(id)) FROM wg_buildings WHERE type_id=37 AND level =100\";\n\t$db->setQuery($sql);\n\t$count = (int)$db->loadResult();\n\tif($count>0)\n\t{\n\t\t$sql=\"UPDATE wg_users SET anounment='world_finished'\";\n\t\t$db->setQuery($sql);\n\t\t$db->query();\n\t\tif($db->getAffectedRows()==0)\n\t\t{\t\n\t\t\tglobalError2('function checkWorldFinished:'.$sql);\n\t\t}\t\n\t}\n\treturn true;\n}", "function game_ai_create_new_player() {\n global $game, $base_url, $ai_output;\n\n while (TRUE) {\n $num = mt_rand(0, 99999);\n $id_to_check = 'ai-' . $num;\n zg_ai_out(\"checking for existing player $id_to_check\");\n\n $sql = 'select id from users\n where phone_id = \"%s\";';\n $result = db_query($sql, $id_to_check);\n $item = db_fetch_object($result);\n\n if (empty($item)) {\n break;\n }\n }\n\n $uri = $base_url . \"/$game/home/$id_to_check\";\n zg_ai_out(\"phone_id $id_to_check not in use; URI is $uri\");\n $response = zg_ai_web_request($id_to_check, 'home');\n zg_ai_out($response);\n\n zg_ai_out('updating record to make this a ToxiCorp Employee');\n $sql = 'update users set username = \"%s\", fkey_neighborhoods_id = 75,\n fkey_values_id = 9, `values` = \"Goo\", meta = \"ai_minion\"\n where phone_id = \"%s\";';\n db_query($sql, \"TC Emp $num\", $id_to_check);\n $ai_bot = zg_fetch_user_by_id($id_to_check);\n // mail('[email protected]', 'ai trying to create a new player AGAIN', $ai_output);.\n zg_slack($ai_bot, 'bots', 'new bot creation', $ai_output);\n}", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isPlayer()\r\n\t{\r\n\t\t\treturn count($this->getPlayerProfiles()) > 0;\r\n\t}", "public function startGameSession() {\n if(!isset($_SESSION['wrongGuesses'])) {\n $_SESSION['wrongGuesses'] = 0;\n }\n $_SESSION['activeGame'] = true;\n }", "public function isJoin() {\n return (0 < sizeof(array_keys($this->fetchmode, 'join')));\n }", "function determineNextGame( $gameID, $teamID, $winnerOrLoser ) {\n\n/* ... get the details for the game just played */\n $gameDetails = $this->getGameDetails( $gameID );\n \n/* ... get the details for the next game using the proper flow */\n if ($winnerOrLoser == \"WINNER\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['WinnerNextGame'] );\n }\n else {\n if ($gameDetails['LoserNextGame'] != \"\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['LoserNextGame'] );\n }\n else {\n return( -1 );\n }\n }\n \n/* ... if we have a game to update, then figure out what to change and do it */\n if (count( $nextGameDetails ) > 0) {\n $dbData = array();\n $division = substr( $gameDetails['TournamentID'], 0, 1 );\n \n/* ... if the Home Team hasn't been set, then put the winner in as the home team for now */ \n if ($nextGameDetails['HomeTeamID'] == NULL) {\n $dbData = array(\n \"GameID\" => $nextGameDetails['GameID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n\n/* ... determine who should be the home team from the 2 teams now known for the game */\n if ($this->_whoIsBetterSeed( $teamID, $nextGameDetails['HomeTeamID'], $division ) == $teamID) {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $nextGameDetails['HomeTeamID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $teamID\n );\n }\n }\n\n/* ... time to update the database */\n $this->saveGameResult( $nextGameDetails['GameID'], $dbData );\n\n }\n\n/* ... time to go */\n return( $dbData['GameID'] );\n }", "public function checkIfOpponentIsFinishedWithMatchStep($matchID, $userID)\n {\n $lastMSID = $this->getLastMatchStepID($userID, $matchID);\n $oppID = $this->getOpponentID($matchID, $userID);\n \n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted a MatchStep that is finished\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->greaterThan('tblmatchsteps.msID', $lastMSID)\n ->and->equalTo('tblmatchsteps.mRoundFinished', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n\n if ($this->checkForWin($matchID, $oppID) == true)\n {\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n \n return array('OpponentReady' => true,\n 'OpponentWon' => true,\n 'Hits' => $hits);\n }\n \n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n \n if($miss[\"x\"] == null )\n {\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n //Else you should wait\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss); \n }", "public function is_joined($table)\r\n {\r\n return in_array($table, array_pluck($this->join, 'table'));\r\n }", "function doesMatchExist($matchid)\n {\n $retVal = false;\n $query = 'select COUNT(*) AS games from MatchHeader mh\n JOIN MatchDetails md ON mh.matchid = md.matchid\n JOIN MatchTeamDetails mtd ON mh.matchid = mtd.match_id\n where md.matchid = ' . $matchid;\n if ($result = $this->mys->query($query)) {\n while ($row = $result->fetch_assoc()) {\n //echo $row[\"gameId\"];\n if ($row[\"games\"] > 0) {\n $retVal = true;\n }\n }\n $result->free();\n } else {\n $retVal = true;\n }\n return $retVal;\n }", "public function show(Game $game, $id)\n {\n $game = Game::findOrFail($id);\n $participants = $game->participants;\n foreach ($participants as $participant) {\n if ($participant->user->id == Auth::id()) {\n return view('game')->with('currentGame', $game);\n }\n }\n return redirect()->route('game.join', ['id' => $id]);\n }", "public function onPlayerJoin(\\pocketmine\\event\\player\\PlayerJoinEvent $event) {\r\n\r\n if($event->getPlayer()->getLevel()->getName() == $this->getName()) {\r\n\r\n $this->registerPlayer($event->getPlayer());\r\n\r\n }\r\n\r\n }", "public function joinAction($leave = false)\n {\n $services = $this->getServiceLocator();\n $services->get('permissions')->enforce('authenticated');\n\n $p4Admin = $services->get('p4_admin');\n $user = $services->get('user');\n $project = $this->getEvent()->getRouteMatch()->getParam('id');\n\n try {\n $project = Project::fetch($project, $p4Admin);\n $members = $project->getAllMembers();\n\n if ($leave) {\n if (!in_array($user->getId(), $members)) {\n return new JsonModel(\n array(\n 'isValid' => false\n )\n );\n }\n $key = array_search($user->getId(), $members);\n unset($members[$key]);\n } else {\n $members[] = $user->getId();\n }\n\n $project->setMembers($members);\n $project->save();\n } catch(Exception $e) {\n return new JsonModel(\n array(\n 'isValid' => false\n )\n );\n }\n\n return new JsonModel(\n array(\n 'isValid' => true\n )\n );\n }", "function game_snakes_continue( $id, $game, $attempt, $snakes)\r\n{\r\n\tif( $attempt != false and $snakes != false){\r\n\t\treturn game_snakes_play( $id, $game, $attempt, $snakes);\r\n\t}\r\n\r\n\tif( $attempt === false){\r\n\t\t$attempt = game_addattempt( $game);\r\n\t}\r\n\t\r\n\t$newrec->id = $attempt->id;\r\n\t$newrec->snakesdatabaseid = $game->param3;\r\n\t$newrec->position = 1;\r\n\t$newrec->queryid = 0;\r\n $newrec->dice = rand( 1, 6);\r\n\tif( !game_insert_record( 'game_snakes', $newrec)){\r\n\t\terror( 'game_snakes_continue: error inserting in game_snakes');\r\n\t}\r\n\t\r\n\tgame_updateattempts( $game, $attempt, 0, 0);\r\n\t\r\n\treturn game_snakes_play( $id, $game, $attempt, $newrec);\r\n}", "public function loginExists() {\n return (bool) $this->local_account;\n }", "public function playingGame($game = 'LOL')\n\t{\n\t\t// $this : contro noi tai cua class\n\t\treturn $this->name . ' play ' . $game;\n\t}", "public function battleFinished()\n {\n return ($this->_army1->isDefeated() or $this->_army2->isDefeated());\n }", "public function checkIfPlayersConflictsTeam(OnWayPointEventStructure $structure) {\n\t\t$login = trim($structure->getLogin());\n\n\t\t// If there's login of player in blueTeam but he finished as redTeam make swap\n\t\tif (array_key_exists($login, $this->matchScore->blueTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->blueTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$login] = $this->matchScore->blueTeamPlayers[$login];\n\t\t\t\t$this->matchScore->redTeamPlayers[$login]->teamId = self::RED_TEAM;\n\t\t\t\tunset($this->matchScore->blueTeamPlayers[$login]);\n\t\t\t}\n\n\t\t} // If there's login of player in redTeam but he finished as blueTeam make swap\n\t\telse if (array_key_exists($login, $this->matchScore->redTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->redTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login] = $this->matchScore->redTeamPlayers[$login];\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login]->teamId = self::BLUE_TEAM;\n\t\t\t\tunset($this->matchScore->redTeamPlayers[$login]);\n\t\t\t}\n\t\t}\n\t}", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "public function checkIfOpponentIsFinishedWithPlacement($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted Ships into the Table\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblshipposition.spUserID', $userID)\n ->and\n ->equalTo('tblshipposition.spMatchID', $matchID)\n ->unnest();\n $select = $sql->select('tblshipposition')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute(); \n \n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n return array('OpponentReady' => true,\n 'OpponentWon' => false);\n }\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false);\n }", "public function setCanBeJoined(bool $possible)\n {\n $this->_canBeJoined = $possible;\n\n return $this;\n }", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }" ]
[ "0.67816675", "0.6729835", "0.6254898", "0.62304103", "0.5920542", "0.5536876", "0.55106544", "0.54813516", "0.54324114", "0.5389384", "0.53798884", "0.53447455", "0.5262089", "0.52354246", "0.52335465", "0.5220589", "0.51473933", "0.5117156", "0.50796264", "0.50741297", "0.5049887", "0.5035361", "0.5033888", "0.50286907", "0.50116295", "0.49996626", "0.4961888", "0.49540442", "0.495001", "0.4932649", "0.49146417", "0.4905838", "0.4898096", "0.48886862", "0.4886508", "0.48849696", "0.4875427", "0.48730165", "0.4821198", "0.4820794", "0.48117307", "0.4802434", "0.4801132", "0.47944424", "0.47901613", "0.4786108", "0.47856995", "0.4770069", "0.47648063", "0.47504947", "0.4748278", "0.47335732", "0.47255903", "0.4725184", "0.46904954", "0.46704018", "0.46697828", "0.46473482", "0.46469888", "0.4630785", "0.4622195", "0.45922253", "0.45710418", "0.4556516", "0.4535177", "0.45177737", "0.45071155", "0.44944012", "0.44857982", "0.44687074", "0.44578454", "0.4457631", "0.44540706", "0.44528332", "0.4450442", "0.4440085", "0.44375485", "0.44371608", "0.4432791", "0.44326255", "0.44267204", "0.44209737", "0.44204602", "0.44141385", "0.43826717", "0.43825123", "0.43773478", "0.43731222", "0.43658397", "0.4362598", "0.436107", "0.4358614", "0.4347347", "0.434195", "0.4341412", "0.43319657", "0.43282697", "0.4312276", "0.43074036", "0.43019664" ]
0.69656014
0
/ Gives 7 cards to a player. Note: could reuse `drawCard` but that'd be extra slow because of the inner `getUnusedCards` call.
function distributeInitialCards($userId) { $gameId = getGameOf($userId); $options = getUnusedCards($gameId); $hand = array(); for ($i = 0; $i < 7; $i++) { $chosen = array_rand($options); // index, not the card $sql = "insert into decks (user_id, card_name) values ($userId, '$options[$chosen]')"; SQLInsert($sql); array_push($hand, $options[$chosen]); array_splice($options, $chosen, 1); // avoids calling getUnusedCards again } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game(&$deck,&$players,&$stack)\n{\n $end = false;\n $skip = false;\n $takeCards = 0;\n\n //now the turns will begin until the game ends\n while($end != true)\n {\n //loop through players\n foreach ($players as &$p)\n {\n //check last played card\n $stackIndex = count($stack)-1;\n $lastcard = $stack[$stackIndex];\n\n if ($skip) {\n echo $p['name'].\" has to skip their turn.<br>\";\n $skip = false;\n continue;\n }\n\n $index = 0;\n $played = false;\n $turn = true;\n\n while($turn)\n {\n //Loop through the players hand to find compatible card if the player hasn't played yet\n if ($takeCards > 0){\n foreach ($p['hand'] as &$h)\n {\n //check if this card is compatible with the card on the stack\n if($h['name'] == '2')\n {\n if($h['name'] === '2')\n {\n $takeCards = $takeCards+2;\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take \" . $takeCards . \" cards or play a 2.<br>\";\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n $played = true;\n $turn = false;\n }\n $index++;\n }\n if (!$played) {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack,$takeCards);\n $turn = false;\n $takeCards = 0;\n }\n } else {\n foreach ($p['hand'] as &$h)\n {\n if(!$played && !$end)\n {\n\n //check if this card is compatible with the card on the stack\n if($h['name'] == $lastcard['name']|| $h['symbol'] == $lastcard['symbol'])\n {\n if($h['name'] === '7')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 7 they can play again.<br>\";\n }else if($h['name'] === '8')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 8 the next player has to skip their turn.<br>\";\n $skip = true;\n }else if($h['name'] === '2')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take 2 cards or play a 2.<br>\";\n $takeCards = $takeCards+2;\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n if($h['name'] != '7')\n {\n $played = true;\n $turn = false;\n }\n }\n }\n $index++;\n }\n\n //check if players hand is empty, if so game is over\n if(count($p['hand']) == 0)\n {\n echo $p['name'].' won<br>';\n $end = true;\n die();\n }\n\n //check if the players has played this turn, else take a card\n if (!$played)\n {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack);\n $turn = false;\n }\n }\n }\n }\n }\n}", "public function dealCards(): void\n {\n foreach ($this->players as $player) {\n $playerCardsCount = $player->getCards()->count();\n $neededCountForDealing = 2 - $playerCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $player->addCard($card);\n }\n }\n }\n\n $tableCardsCount = $this->getCards()->count();\n $neededCountForDealing = 5 - $tableCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $this->addCard($card);\n }\n }\n }", "public function distributeCards(){\n $this->distributeCardsToPlayers();\n $this->distributeCardsToPlayers();\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n }", "function getHand($playerNumber) \n{\n\tglobal $myDeck;\n\t\n\t#allowing the arrays for players to be used\n\tglobal $allHands;\n\tglobal $player;\n\tglobal $player1;\n\tglobal $player2;\n\tglobal $player3;\n\tglobal $player4;\n\tglobal $cardNumber;\n\tglobal $dupe;\n\t\n\t$isLast_num = $player;\n\t#Creating an array to store the 4 suits of the deck for the PATHWAY.\n\t$mySuits = array(\"clubs\", \"diamonds\", \"hearts\", \"spades\");\n\t\n\t#Creating a flag to control the while loop.\n\t$flag = true;\n\t\n\t#Shuffling all my cards before entering the while loop, so it is random.\n\tshuffle($myDeck);\n\n\t// if($dupe == true)\n\t// {\n\t// while($flag) \n\t// {\n\t// \t$counter_forif = 1;\n\t// \t $randomCard = rand(1,52);\n\t\t \n\t// \t $tempHand = \"<img class='cards' src='img/\". $mySuits[ceil($randomCard / 13) - 1].\"/\" . $card . \".png'/>\";\n\t// \t if($playerNumber == 0)\n\t// \t\t{\n\t// \t\t\tarray_push($player1,$tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 1)\n\t// \t\t{\n\t// \t\t\tarray_push($player2, $tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 2)\n\t// \t\t{\n\t// \t\t\tarray_push($player3, $tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 3)\n\t// \t\t{\n\t// \t\t\tarray_push($player4, $tempHand);\n\t// \t\t}\n\t\t\t\n\t// \t\t$counter_forif +=1;\n\t// \t\t#Displaying the cards.\n\t\t\t\n\t// \t\t//echo $tempHand;\n\t\t\t\n\t// \t\t#If it has reached the amount of cards needed, add to allhands, print and jump out of while loop\n\t// \t\tif($counter_forif == $cardNumber)\n\t// \t\t{\n\t// \t\t\tif($playerNumber == 0)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player1);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 1)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player2);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t\t$flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 2)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player3);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t} \n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 3)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player4);\n\t\t\t\t\t\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n\n\n\tif($dupe == false)\n\t{\n\t while($flag) \n\t {\n\t \n\t $counter_forif = 1;\n\t \n\t\t $lastCard = array_pop($myDeck);\n\t\t #Selecting what number the card will be (% 13).\n\t\t $card = $lastCard % 13;\n\t\t\n\t\t\t$stuff = $mySuits[ceil($lastCard / 13) - 1];\n\t\t\t//echo \"$stuff\";\n\t\t #Storing the picture into tempHand variable.\n\t\t $tempHand = \"<img class='cards' src='img/$stuff/$card.png'/>\";\n\t\t\n\t\t\n \t\tif($playerNumber == 0)\n \t\t{\n \t\t\tarray_push($player1,$tempHand);\n \t\t}\n \t\tif($playerNumber == 1)\n \t\t{\n \t\t\tarray_push($player2, $tempHand);\n \t\t}\n \t\tif($playerNumber == 2)\n \t\t{\n \t\t\tarray_push($player3, $tempHand);\n \t\t}\n \t\tif($playerNumber == 3)\n \t\t{\n \t\t\tarray_push($player4, $tempHand);\n \t\t}\n \t\t\n \t\t$counter_forif +=1;\n \t\t#Displaying the cards.\n\t\t\n \t\t//echo $tempHand;\n \t\t\n \t\t#If it has reached the amount of cards needed, add to allhands, print and jump out of while loop\n \t\tif($counter_forif == $cardNumber)\n \t\t{\n \t\t\tif($playerNumber == 0)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player1);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\n \t\t\t\n \t\t\tif($playerNumber == 1)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player2);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t }\n \t\t\t}\n \t\t\t\n \t\t\tif($playerNumber == 2)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player3);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t }\n \t\t\t}\n \t\t\t\n \t\t\tif($playerNumber == 3)\n \t\t\t{\n \n \t\t\t\tarray_push($allHands,$player4);\n \t\t\t\t\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t\t}\n \t\t\t}\n\t \t}\n\t\t}\n\t}\n}", "function drawCard (&$deck) {\n \n $suit = array_rand($deck);\n $card = array_rand($deck[$suit]);\n \n // Determine the face value of the card.\n\t// Face cards are worth 10\n\tif ($card >=10){\n $card_value = 10;\n }\n else {\n $card_value = $card;\n }\n \n $return_value = array('display' =>\n ($card < 10) ? $suit. \"0{$card}.jpg\" :\n \"$suit{$card}.jpg\", 'value' => $card_value);\n // returns a two element array showing a card's suit & face value\n \n unset($deck[$suit][$card]);\n \n return $return_value;\n // returns a two-element array showing a card's suit and face value\n }", "public function deal_cards($print = FALSE, $shuffle = TRUE) {\n if($shuffle){\n $this->shuffle_cards();\n }\n $this->dealed_cards = $this->deal_hand(7, $this->players);\n if($print){\n $this->print_cards();\n }\n return $this;\n }", "function drawCard($userId) {\n\t$options = getUnusedCards(getGameOf($userId));\n\n\tif (count($options) == 0) {\n\t\treturn false;\n\t}\n\n\t$index = array_rand($options);\n\t$card = $options[$index];\n\t$to_draw = SQLGetChamp(\"select cards_to_draw from users where id = $userId\");\n\n\tSQLInsert(\"insert into decks (user_id, card_name) values ($userId, '$card')\");\n\n\tif ($to_draw-- > 0) {\n\t\tSQLUpdate(\"update users set cards_to_draw = $to_draw where id = $userId\");\n\n\t\t// We had been forced to draw by a +2 or +4\n\t\tif ($to_draw == 0) {\n\t\t\t$gameId = getGameOf($userId);\n\t\t\t$next = nextToPlay($gameId);\n\n\t\t\tSQLUpdate(\"update games set user_to_play = $next\");\n\t\t}\n\t}\n\n\treturn $card;\n}", "function drawCard(&$hand, &$deck, $drawNumber) {\n\t$card1 = array_rand($deck);\n\t$hand[] = $deck[$card1];\n\tif($drawNumber == 2) {\n\t\t$card2 = array_rand($deck);\n\t\t$hand[] = $deck[$card2];\n\t\tunset($deck[$card2]);\n\t}\n\tunset($deck[$card1]);\n}", "public function resetDeck(){\n $this->startCard = new Card(14);\n\n for ($i = 1; $i <= 13; $i++) {\n if ($i == 6 or $i == 9) {\n continue;\n }\n else {\n if ($i == 1) {\n for ($j = 0; $j < 5; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n else {\n for ($j = 0; $j < 4; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n }\n }\n\n //Shuffle deck\n shuffle($this->cards);\n\n\n // card back\n $this->cardDrawn = new Card(14);\n }", "public function shuffleCards()\n {\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $randomNumber1 = mt_rand(0,3);\n $randomNumber2 = mt_rand(0,12);\n\n $temp = $this->deckofCards[$randomNumber1][$randomNumber2];\n $this->deckofCards[$randomNumber1][$randomNumber2] = $this->deckofCards[$i][$j];\n $this->deckofCards[$i][$j] = $temp;\n }\n }\n return $this->deckofCards;\n }", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "protected function shuffle_cards($deck = array()) {\n if(count($deck) == 0){\n $deck = $this->get_deck();\n }\n \n for ($i = 0; $i != $this->shuffle; $i++) {\n mt_srand((double) microtime() * 1000000);\n $offset = mt_rand(10, 40);\n //First we will split our deck cards:\n $sliced_cards[0] = array_slice($deck, 0, $offset);\n $sliced_cards[1] = array_slice($deck, $offset, 52);\n\n //Then Shuffle Eeach\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Reverse each pile\n $sliced_cards[0] = array_reverse($sliced_cards[0]);\n $sliced_cards[1] = array_reverse($sliced_cards[1]);\n\n //Re-Shuffle\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Merge both stacks\n $unsliced = array_merge($sliced_cards[0], $sliced_cards[1]);\n\n //And another shuffle\n shuffle($unsliced);\n\n //Add in a flip\n array_flip($unsliced);\n }\n $this->set_deck($unsliced);\n\n return $this;\n }", "public function play()\n {\n $game = $this->getGame();\n $playerList = $game->getPlayerList();\n /** @var IPlayer $player */\n array_map(function($player){\n $player->removeCards();\n }, $playerList->getPlayers());\n $this->getGame()->setDeck((new \\FiveCardDraw\\Service\\Deck\\StandardDeckBuilder())->build());\n for ($i = 0; $i < 5; ++$i) {\n /** @var IPlayer $player */\n foreach ($playerList->getPlayers() as $player) {\n $player->addCard($game->getDeck()->draw());\n }\n }\n $game->changeState(new TradeState($game));\n }", "function createDeck()\n {\n // suit, bool, val\n // 4 arrays\n $suit = \"\";\n $drawn = FALSE;\n \n $deck = array();\n \n for ($i = 0; $i < 4; $i++)\n { // suit type\n switch($i) \n {\n case 0:\n $suit = \"heart\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 1:\n $suit = \"diamond\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 2:\n $suit = \"spade\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 3:\n $suit = \"clover\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n default:\n break;\n }\n }\n \n // checks what the array is\n var_dump($deck);\n }", "function selectEligibleCards() {\n // Return the number of selected cards that way \n \n // Condition for owner\n $owner_from = self::getGameStateValue('owner_from');\n if ($owner_from == -2) { // Any player\n $condition_for_owner = \"owner <> 0\";\n }\n else if ($owner_from == -3) { // Any opponent\n $player_id = self::getActivePlayerId();\n $opponents = self::getObjectListFromDB(self::format(\"\n SELECT\n player_id\n FROM\n player\n WHERE\n player_team <> (\n SELECT\n player_team\n FROM\n player\n WHERE\n player_id = {player_id}\n )\n \",\n array('player_id' => $player_id)), true\n );\n $condition_for_owner = self::format(\"owner IN ({opponents})\", array('opponents' => join($opponents, ',')));\n }\n else {\n $condition_for_owner = self::format(\"owner = {owner_from}\", array('owner_from' => $owner_from));\n }\n \n // Condition for location\n $location_from = self::decodeLocation(self::getGameStateValue('location_from'));\n if ($location_from == 'revealed,hand') {\n $condition_for_location = \"location IN ('revealed', 'hand')\";\n }\n else if ($location_from == 'pile') {\n $condition_for_location = \"location = 'board'\";\n }\n else {\n $condition_for_location = self::format(\"location = '{location_from}'\", array('location_from' => $location_from));\n }\n \n // Condition for age\n $age_min = self::getGameStateValue('age_min');\n $age_max = self::getGameStateValue('age_max');\n $condition_for_age = self::format(\"age BETWEEN {age_min} AND {age_max}\", array('age_min' => $age_min, 'age_max' => $age_max));\n \n // Condition for color\n $color_array = self::getGameStateValueAsArray('color_array');\n $condition_for_color = count($color_array) == 0 ? \"FALSE\" : \"color IN (\".join($color_array, ',').\")\";\n \n // Condition for icon\n $with_icon = self::getGameStateValue('with_icon');\n $without_icon = self::getGameStateValue('without_icon');\n if ($with_icon > 0) {\n $condition_for_icon = self::format(\"AND (spot_1 = {icon} OR spot_2 = {icon} OR spot_3 = {icon} OR spot_4 = {icon})\", array('icon' => $with_icon));\n }\n else if ($without_icon > 0) {\n $condition_for_icon = self::format(\"AND spot_1 <> {icon} AND spot_2 <> {icon} AND spot_3 <> {icon} AND spot_4 <> {icon}\", array('icon' => $without_icon));\n }\n else {\n $condition_for_icon = \"\";\n }\n \n // Condition for id\n $not_id = self::getGameStateValue('not_id');\n if ($not_id != -2) { // Only used by Fission and Self service\n $condition_for_id = self::format(\"AND id <> {not_id}\", array('not_id' => $not_id));\n }\n else {\n $condition_for_id = \"\";\n }\n \n if (self::getGameStateValue('splay_direction') == -1 && $location_from == 'board') {\n // Only the active card can be selected\n self::DbQuery(self::format(\"\n UPDATE\n card\n LEFT JOIN\n (SELECT owner AS joined_owner, color AS joined_color, MAX(position) AS position_of_active_card FROM card WHERE location = 'board' GROUP BY owner, color) AS joined\n ON\n owner = joined_owner AND\n color = joined_color\n SET\n selected = TRUE\n WHERE\n {condition_for_owner} AND\n {condition_for_location} AND\n {condition_for_age} AND\n position = position_of_active_card AND\n {condition_for_color}\n {condition_for_icon}\n {condition_for_id}\n \",\n array(\n 'condition_for_owner' => $condition_for_owner,\n 'condition_for_location' => $condition_for_location,\n 'condition_for_age' => $condition_for_age,\n 'condition_for_color' => $condition_for_color,\n 'condition_for_icon' => $condition_for_icon,\n 'condition_for_id' => $condition_for_id\n )\n ));\n }\n else {\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n selected = TRUE\n WHERE\n {condition_for_owner} AND\n {condition_for_location} AND\n {condition_for_age} AND\n {condition_for_color}\n {condition_for_icon}\n {condition_for_id}\n \",\n array(\n 'condition_for_owner' => $condition_for_owner,\n 'condition_for_location' => $condition_for_location,\n 'condition_for_age' => $condition_for_age,\n 'condition_for_color' => $condition_for_color,\n 'condition_for_icon' => $condition_for_icon,\n 'condition_for_id' => $condition_for_id\n )\n ));\n }\n \n //return self::DbAffectedRow(); // This does not seem to work all the time...\n return self::getUniqueValueFromDB(\"SELECT COUNT(*) FROM card WHERE selected IS TRUE\");\n }", "function drawHand(&$deck, &$hand) {\n\t$cardOne = drawACard($deck);\n\t$hand[] = $cardOne;\n\t$cardTwo = drawACard($deck);\n\t$hand[] = $cardTwo;\n\treturn $hand;\n}", "function drawACard(&$deck) {\n\t$randomKey = array_rand($deck);\n\t$randomCard = $deck[$randomKey];\n\tunset($deck[$randomKey]);\n\treturn $randomCard;\n}", "function pocker_flush(array $hand) {\n\n if (count($hand) < 5) return false;\n\n $suits = cards_suits($hand);\n\n $same = array_count_values($suits);\n\n if (count($same) > 1) return false;\n\n return ['value' => highest_value_card($hand)['value'], 'remaining' => []];\n}", "public function addCards($cards)\n {\n if (count($cards) === 5) {\n foreach ($cards as $card) {\n $this->cards[] = new Card($card);\n }\n } else {\n throw new Exception('You must have only 5 cards in your hand!');\n }\n }", "public function getCards();", "public function deal_poker($print = FALSE, $shuffle = TRUE) {\n if($shuffle){\n $this->shuffle_cards();\n }\n $this->dealed_cards = $this->deal_hand(2, $this->players);\n ($this->burn) ? $this->burn_card() : '';\n $this->dealed_cards += $this->deal_hand(3, array('Flop'));\n ($this->burn) ? $this->burn_card() : '';\n $this->dealed_cards += $this->deal_hand(1, array('Turn'));\n ($this->burn) ? $this->burn_card() : '';\n $this->dealed_cards += $this->deal_hand(1, array('River'));\n if($print){\n $this->print_cards();\n }\n return $this;\n }", "public function addCardsToTop(array $cards): void\n {\n foreach ($cards as $card)\n {\n $this->cards[] = $card; // alternatively: array_push($this->cards, $card);\n $this->size++;\n }\n }", "function startGame() {\n // First game is one card for dealer, two for player\n\n $deck = getCardDeck();\n\n $dealer = array(drawRandomCard($deck));\n $player = array(drawRandomCard($deck), drawRandomCard($deck));\n\n return array($dealer, $player, $deck); \n}", "public function generateGameDeck()\n {\n $suits = array('C', 'D', 'H', 'S');\n $newGameDeck = $this->generateSuits($suits);\n $this->addCardsToTop($newGameDeck);\n $this->shuffleDeck();\n }", "function generateHand($deck) {\n shuffle($deck);\n $hand = array(); \n \n for ($i = 0; $i < 3; $i++) {\n $cardNum = array_pop($deck);\n $card = mapNumberToCard($cardNum); \n array_push($hand, $card); \n }\n \n return $hand; \n }", "function placeCard($userId, $card) {\n\t$gameId = getGameOf($userId);\n\t$info = parcoursRs(SQLSelect(\"select * from games where id = $gameId\"))[0];\n\t$deck = getDeck($userId);\n\t$placed = getPlacedCards($gameId);\n\t$lastPlaced = end($placed);\n\t$sym = cardSymbol($card);\n\t$color = cardColor($card);\n\n\t// Sanity checks\n\tif ($gameId == NOT_IN_GAME\n\t\t|| $info[\"user_to_play\"] != $userId\n\t\t|| !(in_array($card, $deck) || in_array($sym, $deck))\n\t\t|| $info[\"has_started\"] != 1\n\t\t|| strpos($card, \"-\") === false) {\n\n\t\treturn false;\n\t}\n\n\t// TODO!!! Disallow +4 when other colors could work\n\n\t// Check that this move would in fact be valid\n\t// i.e. if good color || joker || +4 || good symbol (number, reverse, plustwo, skip))\n\tif (cardColor($lastPlaced) == $color || $sym == \"joker\" || $sym == \"plusfour\"\n\t\t|| cardSymbol($lastPlaced) == $sym) {\n\n\t\tif ($sym == \"reverse\") {\n\t\t\t$info[\"direction\"] = $info[\"direction\"] == 0 ? 1 : 0;\n\t\t}\n\n\t\t// If there are only two players, the reverse card acts as a skip card\n\t\tif ($sym != \"skip\" && !($sym == \"reverse\" && count(getPlayers($gameId)) == 2)) {\n\t\t\t$info[\"user_to_play\"] = nextToPlay($gameId, $info[\"direction\"]);\n\t\t}\n\n\t\t$toDraw = 0;\n\n\t\tif ($sym == \"plustwo\") {\n\t\t\t$toDraw = 2;\n\t\t} else if ($sym == \"plusfour\") {\n\t\t\t$toDraw = 4;\n\t\t}\n\n\t\t// Delete something that actually exists in the db\n\t\t$toDelete = in_array($sym, array(\"joker\", \"plusfour\")) ? $sym : $card;\n\n\t\tSQLDelete(\"delete from decks where user_id = $userId and card_name = '$toDelete'\");\n\t\tSQLInsert(\"insert into placed_cards (game_id, card_name) values ($gameId, '$card')\");\n\t\tSQLUpdate(\"update games set user_to_play = $info[user_to_play], direction = $info[direction] where id = $gameId\");\n\t\tSQLUpdate(\"update users set cards_to_draw = $toDraw where id = $info[user_to_play]\");\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function place_card($thecard_stack,$thecard,$attackmode=0,$statustring)\n{\n//##############################################################\nglobal $conn_pag2;\nglobal $table_allgames;\nglobal $table_allusers;\n//##############################################################\n\t\t//attack mode different control\nif($attackmode)\n\t{\n\t\n\t}\n//##############################################################\nelse\n\t{\n//##############################################################\n\t//grad the user id\n$thecurrentuserid=get_the_id($conn_pag2,);\n//##############################################################\n\t//grab the game hash\n\t//get the current_gamehash\n$result_get_game_hash=mysqli_query($conn_pag2,\"select game_id from '$table_allgames' where (id1='$thecurrentuserid' or id2='$thecurrentuserid') and active=1\");\n$answer_get_the_game_hash=mysqli_fetch_array($result_get_the_game_hash);\n$the_game_hash=$answer_get_the_game_hash['game_id'];\n//##############################################################\n\t//extract the status string\n\n$result_get_status_string=mysqli_query($conn_pag2,\"select '$statustring' from '$table_allgames' where game_id='$the_game_hash'\");\n$answer_get_status_string=mysqli_fetch_array($result_get_status_string);\n$theold_status_actual=$answer_get_status_string[$statustring];\n//##############################################################\n\tif($thecard_stack='C')\n\t\t{\n\t\t$thefirstbracketpostion=strpos($theold_status_actual,\"(\");\n\t\t$replacement=\"(\".$thecard.',';\n\t\t$thenew_status_actual=str_replace(\"(\",$replacement,$theold_status_actual,1);\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='S1')\n\t\t{\n\t\t$the\n\t\t}\n\t\n\tif($thecard_stack='S2')\n\t\t{\n\t\t\n\t\t}\n\n\tif($thecard_stack='S3')\n\t\t{\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='D')\n\t\t{\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='A')\n\t\t{\n\t\t\n\t\t}\n\t}\n}", "abstract public function playCard(int $card_id);", "function dogma($card_id) {\n self::checkAction('dogma');\n $player_id = self::getActivePlayerId();\n \n // Check if the player has this card really on his board\n $card = self::getCardInfo($card_id);\n \n if ($card['owner'] != $player_id || $card['location'] != \"board\") {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You do not have this card on board [Press F5 in case of troubles]\"));\n }\n if (!self::isTopBoardCard($card)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"This card is not on the top of the pile [Press F5 in case of troubles]\")); \n }\n \n // No cheating here\n \n // Stats\n if (self::getGameStateValue('has_second_action') || self::getGameStateValue('first_player_with_only_one_action') || self::getGameStateValue('second_player_with_only_one_action')) {\n self::incStat(1, 'turns_number');\n self::incStat(1, 'turns_number', $player_id);\n }\n self::incStat(1, 'actions_number');\n self::incStat(1, 'actions_number', $player_id);\n self::incStat(1, 'dogma_actions_number', $player_id);\n \n self::notifyDogma($card);\n \n $dogma_icon = $card['dogma_icon'];\n $ressource_column = 'player_icon_count_' . $dogma_icon;\n \n $players = self::getCollectionFromDB(self::format(\"SELECT player_id, player_no, player_team, {ressource_column} FROM player\", array('ressource_column' => $ressource_column)));\n $players_nb = count($players);\n \n // Compare players ressources on dogma icon_count;\n $dogma_player = $players[$player_id];\n $dogma_player_team = $dogma_player['player_team'];\n $dogma_player_ressource_count = $dogma_player[$ressource_column];\n $dogma_player_no = $dogma_player['player_no'];\n \n // Count each player ressources\n $players_ressource_count = array();\n foreach ($players as $id => $player) {\n $player_no = $player['player_no'];\n $player_ressource_count = $player[$ressource_column];\n $players_ressource_count[$player_no] = $player_ressource_count;\n $players_teams[$player_no] = $player['player_team'];\n \n self::notifyPlayerRessourceCount($id, $dogma_icon, $player_ressource_count);\n }\n\n $player_no = $dogma_player_no;\n $player_no_under_i_demand_effect = 0;\n $player_no_under_non_demand_effect = 0;\n \n $card_with_i_demand_effect = $card['i_demand_effect_1'] !== null;\n $card_with_non_demand_effect = $card['non_demand_effect_1'] !== null;\n \n // Loop on players finishing with the one who triggered the dogma\n do {\n if ($player_no == $players_nb) { // End of table reached, go back to the top\n $player_no = 1;\n }\n else { // Next row\n $player_no = $player_no + 1; \n }\n \n $player_ressource_count = $players_ressource_count[$player_no];\n \n // Mark the player\n if ($player_ressource_count >= $dogma_player_ressource_count) {\n $stronger_or_equal = \"TRUE\";\n $player_no_under_non_demand_effect++;\n $player_no_under_effect = $player_no_under_non_demand_effect;\n }\n else {\n $stronger_or_equal = \"FALSE\";\n if ($players_teams[$player_no] != $dogma_player_team) {\n $player_no_under_i_demand_effect++;\n $player_no_under_effect = $player_no_under_i_demand_effect;\n }\n else { // Player on the same team don't suffer the I demand effect of each other\n $player_no_under_effect = 0;\n }\n }\n self::DBQuery(self::format(\"\n UPDATE \n player\n SET\n stronger_or_equal = {stronger_or_equal},\n player_no_under_effect = {player_no_under_effect}\n WHERE\n player_no = {player_no}\"\n ,\n array('stronger_or_equal' => $stronger_or_equal, 'player_no_under_effect' => $player_no_under_effect, 'player_no' => $player_no)\n ));\n \n } while($player_no != $dogma_player_no);\n \n // Write info in global variables to prepare the first effect\n self::setGameStateValue('dogma_card_id', $card_id);\n self::setGameStateValue('current_effect_type', $card_with_i_demand_effect ? 0 : 1);\n self::setGameStateValue('current_effect_number', 1);\n self::setGameStateValue('sharing_bonus', 0);\n \n // Resolve the first dogma effet of the card\n self::trace('playerTurn->dogmaEffect (dogma)');\n $this->gamestate->nextState('dogmaEffect');\n }", "public function drawCard(int $cardId): Card;", "function createPlayers()\n {\n createDeck();\n \n $points = 0;\n $name = \"\";\n $hand = array();\n \n $players = array();\n \n for ($i = 0; $i < 4; $i++)\n {\n switch ($i)\n {\n case 0:\n $name = \"Cody\";\n array_push($players, $name, $points, $hand);\n break;\n case 1:\n $name = \"Kara\";\n array_push($players, $name, $point, $hand);\n break;\n case 2:\n $name = \"Fernando\";\n array_push($players, $name, $point, $hand);\n break;\n case 3:\n $name = \"Dani\";\n array_push($players, $name, $point, $hand);\n break;\n default:\n break;\n }\n }\n \n var_dump($players);\n }", "public function initializeCards()\n {\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $this->deckofCards[$i][$j] = $this->rank[$j].\" \".$this->suits[$i];\n }\n }\n return $this->deckofCards;\n }", "function deal() {\r\n for($i=0; $i<1; $i++) {\r\n global $deck;\r\n $card = array_pop($deck);\r\n return $card['value'] . ' of ' . $card['suit'] . '<br />';\r\n\r\n //create card values\r\n }\r\n}", "static function xOfAKind( $cards, $num ) {\n # reverse sort because we need to find the highest 3 of a kind\n usort( $cards, array( \"poker\", \"card_rcmp\" ) );\n $last_number = 0;\n $score = 0;\n foreach ($cards as $card) {\n if ( $last_number == 0 ) {\n $last_number = $card->number;\n } else {\n if ( $card->number == $last_number ) {\n //print $card->number.\"vs\".$last_number.\" - \".($score+1).\"\\r\\n\";\n $last_number = $card->number;\n $score++;\n if ( $score >= ($num-1) ) {\n if ( $num == 4 ) {\n # four of a kind\n return array_merge( array( 700+$last_number ), self::kicker( $cards, 1, array($last_number) ) );\n } elseif ( $num == 3 ) {\n # check if it has pairs, if yes: full house\n $hasPairs = self::findPairs( $cards, $last_number );\n if ( $hasPairs[0] > 100 ) {\n return array(600+$last_number, 600+($hasPairs[0]%100));\n }\n # three of a kind\n return array_merge( array( 300+$last_number ), self::kicker( $cards, 2, array($last_number) ) );\n }\n }\n } else {\n $last_number = $card->number;\n $score = 0;\n }\n }\n }\n return 0;\n }", "function displayCards() {\n global $deck;\n foreach ($deck as $card){\n $value = $card['value'];\n $suit = $card['suit'];\n }\n }", "public function shuffleDeck()\n {\n for ($i = 0; $i < $this->size; $i++)\n {\n $randIndex = rand(0, $this->size - 1);\n $temp = $this->cards[$i];\n $this->cards[$i] = $this->cards[$randIndex];\n $this->cards[$randIndex] = $temp;\n }\n }", "function echoPlayer(&$player, $name) {\n\t$total = getTotal($player);\n\tforeach ($player as $card) {\n\t\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n}", "private static function getShuffledDeck(): array\n {\n $deck = range(0, 51);\n shuffle($deck);\n return $deck;\n }", "public function cardProvider()\n {\n $ticket1 = $this->getCard('A', 'B');\n $ticket2 = $this->getCard('B', 'C');\n $ticket3 = $this->getCard('C', 'D');\n $ticket4 = $this->getCard('D', 'E');\n\n $expectedResult = [\n $ticket1,\n $ticket2,\n $ticket3,\n $ticket4,\n ];\n\n yield 'Sorted' => [\n $expectedResult,\n $expectedResult\n ];\n\n yield 'Reversed' => [\n array_reverse($expectedResult),\n $expectedResult,\n ];\n\n $random = $expectedResult;\n shuffle($random);\n yield 'Random' => [\n $random,\n $expectedResult,\n ];\n }", "function draw( $game_id )\n {\n // Check to see if a shuffle is required\n \n $this->db->where('game_id', $game_id);\n $this->db->where('owner_id', null);\n \n $card;\n if ( $this->db->count_all_results($this->table) == 0)\n {\n $this->db->where('game_id', $game_id);\n $this->db->where('owner_id', 0);\n $this->db->order_by('card_id','random');\n $this->db->limit(1);\n $card = $this->db->get($this->table)->row();\n $this->shuffle( $game_id );\n }\n else\n {\n $this->db->where('game_id', $game_id);\n $this->db->where('owner_id', null);\n $this->db->order_by('card_id','random');\n $this->db->limit(1);\n $card = $this->db->get($this->table)->row();\n }\n\n return $card;\n }", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "public function index(CardRequest $request)\n {\n return $request->availableCards();\n }", "function getPlacedCards($gameId, $filter=false) {\n\t$sql = \"select card_name from placed_cards where game_id = $gameId order by id asc\";\n\t$cards = mapToArray(parcoursRs(SQLSelect($sql)), \"card_name\");\n\n\tif (!$filter) {\n\t\treturn $cards;\n\t}\n\n\tforeach ($cards as $index => $card) {\n\t\t$sym = cardSymbol($card);\n\n\t\tif ($sym == \"joker\" || $sym == \"plusfour\") {\n\t\t\t$cards[$index] = cardSymbol($card);\n\t\t}\n\t}\n\n\treturn $cards;\n}", "public function playCard($playCard, Deck $deck)\r\n {\r\n foreach ($this->hand as $index => $value) {\r\n $this->count = 0;\r\n\r\n $cardCanBePlayed = $value[0] == $playCard[0] || $value[1] == $playCard[1];\r\n if ($cardCanBePlayed) {\r\n echo $this->name . ' played ' . $value[1] . ' of ' . $value[0]; // method\r\n echo \"<br>\";\r\n\r\n $playCard = $this->hand[$index]; //refractor name\r\n unset($this->hand[$index]);\r\n return $playCard;\r\n }\r\n }\r\n\r\n if ($deck->getDeckSize() == 0) { // S stands for SOLID\r\n $this->count++;\r\n return $playCard;\r\n }\r\n\r\n $this->takeCard($deck, $this); // method\r\n echo $this->name . ' draws card';\r\n echo \"<br>\";\r\n return $playCard;\r\n }", "public function __construct()\n\t{\n\t\tforeach ( range(0, 51) AS $selCard ) :\n\t\t\tarray_push($this->cards, new Card( $selCard ) );\n\t\tendforeach;\n\t}", "public function addCardsToBottom(array $cards): void\n {\n foreach ($cards as $card)\n {\n // TODO: Check if this is how to do it!\n array_unshift($this->cards, $card);\n $this->size++;\n }\n }", "function draw() {\n self::checkAction('draw');\n $player_id = self::getActivePlayerId();\n \n // Stats\n if (self::getGameStateValue('has_second_action') || self::getGameStateValue('first_player_with_only_one_action') || self::getGameStateValue('second_player_with_only_one_action')) {\n self::incStat(1, 'turns_number');\n self::incStat(1, 'turns_number', $player_id);\n }\n self::incStat(1, 'actions_number');\n self::incStat(1, 'actions_number', $player_id);\n self::incStat(1, 'draw_actions_number', $player_id);\n \n // Execute the draw\n try {\n self::executeDraw($player_id); // Draw a card with age consistent with player board\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::draw');\n self::trace('playerTurn->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n // End of player action\n self::trace('playerTurn->interPlayerTurn (draw)');\n $this->gamestate->nextState('interPlayerTurn');\n }", "function implement_card_effect($game_id, $turn, $card, &$currencies, &$producers, &$player_data) {\n global $CONST;\n\n if ($card['type'] == 0) {\n // All players with the least ... lose random building\n\n $res_min = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_min = min($res_min, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs($res_min - get_currency_production_proper($player['resources'], $producers[$card['data']['industry']])) < $CONST['EPS']) {\n $building_count = 0;\n foreach ($currencies as $currency) {\n foreach ($producers[$currency['id']] as $producer) {\n $building_count += json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']);\n }\n }\n if ($building_count > 0) {\n $building_count = rand(1, $building_count);\n $destroyed = false;\n foreach ($currencies as $currency) {\n foreach ($producers[$currency['id']] as $producer) {\n $building_count -= json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']);\n if (!$destroyed && $building_count <= 0) {\n $player['resources']['producer_'.$currency['id'].'_'.$producer['level']] = json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']) - 1;\n // building_lost to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_lost', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producer['id'].\"}')\");\n $destroyed = true;\n }\n }\n }\n }\n else {\n // building_none to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_none', '{\\\"who\\\": \".$player['internal_id'].\"}')\");\n }\n }\n }\n unset($player);\n }\n if ($card['type'] == 1) {\n // All players with the most ... get two 0th\n\n $res_max = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_max = max($res_max, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs(get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]) - $res_max) < $CONST['EPS']) {\n $player['resources']['producer_'.$card['data']['industry'].'_0'] = json_value($player['resources'], 'producer_'.$card['data']['industry'].'_0') + 2;\n // building_gained x2 to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producers[$card['data']['industry']][0]['id'].\"}')\");\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producers[$card['data']['industry']][0]['id'].\"}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 2) {\n // All players lose all banked ...\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = 0;\n }\n unset($player);\n }\n if ($card['type'] == 3) {\n // All players gain ... 3\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = json_value($player['resources'], 'currency_'.$card['data']['industry']) + 3;\n }\n unset($player);\n }\n if ($card['type'] == 4) {\n // All players' money are doubled\n\n foreach ($player_data as &$player) {\n $player['resources']['money'] = json_value($player['resources'], 'money') * 2;\n }\n unset($player);\n }\n if ($card['type'] == 5) {\n // All ... building costs are reset for all players\n\n foreach ($player_data as &$player) {\n foreach ($producers[$card['data']['industry']] as $producer) {\n $player['resources']['bought_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n }\n }\n unset($player);\n }\n if ($card['type'] == 6) {\n // 0th produce ... 1 more for all players\n\n // No effect\n }\n\n if ($card['type'] == 7) {\n // All players with the most money gain 3 VP\n\n $res_max = json_value($player_data[0]['resources'], 'money');\n foreach ($player_data as $player) {\n $res_max = max($res_max, json_value($player['resources'], 'money'));\n }\n\n foreach ($player_data as &$player) {\n if (abs(json_value($player['resources'], 'money') - $res_max) < $CONST['EPS']) {\n $player['vp'] += 3;\n // vp_gained(3) to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'vp_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": 3}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 8) {\n // All players with the most ... gain 2 VP\n\n $res_max = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_max = max($res_max, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs(get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]) - $res_max) < $CONST['EPS']) {\n $player['vp'] += 2;\n // vp_gained(2) to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'vp_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": 2}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 9) {\n // Everything related to ... is reset. Players retain VP earned through ... All players gain ... 3\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = 3;\n $player['resources']['vp_'.$card['data']['industry']] = 0;\n //$player['resources']['rvp_'.$card['data']['industry']] = 0;\n foreach ($producers[$card['data']['industry']] as $producer) {\n $player['resources']['producer_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n $player['resources']['bought_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n }\n }\n unset($player);\n }\n if ($card['type'] == 10) {\n // All future VP income from ... is doubled for all players\n\n // No effect\n }\n if ($card['type'] == 11) {\n // All cards' permanent effects from previous rounds are disabled\n\n // No effect\n }\n if ($card['type'] == 12) {\n // All players with the most VP sell all their currencies for money\n\n $res_max = $player_data[0]['vp'];\n foreach ($player_data as $player) {\n $res_max = max($res_max, $player['vp']);\n }\n\n foreach ($player_data as &$player) {\n if (abs($player['vp'] - $res_max) < $CONST['EPS']) {\n $total_sold = 0;\n foreach ($currencies as $currency) {\n $total_sold += json_value($player['resources'], 'currency_'.$currency['id']);\n $player['resources']['currency_'.$currency['id']] = 0;\n }\n // currencies_sold to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'currencies_sold', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": \".$total_sold.\"}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 13) {\n // ... buildings do not produce anything in the end of this round\n\n // No effect\n } \n}", "function generateDeck() {\n $suits = array(\"clubs\", \"spades\", \"hearts\", \"diamonds\");\n $deck = array();\n for($i=0;$i<=3;$i++){\n for($j=1;$j<=13;$j++){\n $card = array(\n 'suit' => $suits[$i],\n 'value' => $j\n );\n $deck[] = $card;\n }\n }\n shuffle($deck);\n return $deck;\n }", "function xstats_displayShipList( $gameId ) {\n $playerIndexList = xstats_getAvailablePlayerIndicies($gameId);\n foreach($playerIndexList as $playerIndex) {\n xstats_displayShipListOfUser( $gameId, $playerIndex);\n }\n}", "public function getParlayCardCards($id, $playerId)\n {\n if(!$playerId) \n $this->getParlayWinners($id);\n \n $rs = $this->db->query(\"Select id , firstName, lastName from Users where id in (Select distinct playerId from SportPlayerCards where parlayCardId = ?) order by screenName\", array($id));\n $names = $rs->result();\n \n $rs = $this->db->query(\"Select * from SportParlayConfig where parlayCardId = ?\", array($id));\n $config = $rs->row();\n \n $results = array();\n $rs = $this->db->query(\"Select * from SportGameResults where parlayCardId = ?\", array($id));\n foreach($rs->result() as $row)\n $results[$row->sportScheduleId] = $row->winner;\n \n $answers = array();\n $rs = $this->db->query(\"Select * from SportParlayCards where parlayCardId = ? order by sequence\", array($id));\n foreach($rs->result() as $row)\n {\n if($row->overUnderScore && isset($results[$row->id]))\n $row->winner = $results[$row->id];\n elseif(!$row->overUnderScore && isset($results[$row->sportScheduleId]))\n $row->winner = $results[$row->sportScheduleId];\n else\n $row->winner = 0;\n \n if($row->overUnderScore)\n $answers[$row->id] = $row;\n else\n $answers[$row->sportScheduleId] = $row;\n }\n \n $cards = array();\n if(!$playerId)\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? order by wins DESC limit 50\", array($id));\n }\n else\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? and playerId = ? order by wins DESC\", array($id, $playerId));\n }\n \n foreach($rs->result() as $index => $row)\n {\n $cards[$index]['title'] = \"#\" . $row->id . \" \" . $row->firstName . \" \" . $row->lastName . \" (\" . $row->playerId . \") (Wins: \" . $row->wins . \" Losses: \" . $row->losses . \")\";\n $picks_temp = explode(\":\", $row->picksHash);\n foreach($picks_temp as $temp)\n {\n $key_value = explode(\"|\", $temp);\n $cards[$index]['cards'][$key_value[0]] = $key_value[1];\n }\n }\n \n return compact('config', 'answers', 'cards', 'names');\n }", "public function print_cards(array $hands=NULL) {\n if($hands === NULL){\n $hands = $this->get_hands();\n }\n foreach ($hands as $playername => $hand) {\n if($this->browser === FALSE){\n echo $playername . ': ' . implode(' - ', $hand).PHP_EOL;\n } else {\n echo '<div class=\"players\"><div class=\"players playername\">'.$playername.'</div>';\n foreach ($hand as $card) {\n echo $card;\n }\n echo '</div>';\n }\n \n }\n return $this;\n }", "protected function deal_hand($cardnr, array $keys) {\n $dealed_cards = 0;\n for ($i = 1; $i <= $cardnr; $i++) {\n foreach ($keys as $player) {\n $this->hands[$player][$i] = array_pop($this->deck);\n $dealed_cards ++;\n }\n }\n return $dealed_cards;\n }", "private function arrangeBoardingCards()\n {\n for ($counter = 0; $counter < count($this->boardingCards); $counter++) {\n\n $boardingCard = $this->boardingCards[$counter];\n\n $this->toIndex[$boardingCard->getTo()] = $boardingCard;\n $this->fromIndex[$boardingCard->getFrom()] = $boardingCard;\n }\n }", "function cekkartu($kartu){\n\t$pokerhands = Array (\"nonpaying hand\", \"jacks or better\", \"two pair\", \"three of a kind\", \"straight\", \"flush\", \"full house\", \"four of a kind\", \"straight flush\", \"royal flush\");\n\t\t$cardarr = Array(\"c1\", \"c2\", \"c3\", \"c4\", \"c5\", \"c6\", \"c7\", \"c8\", \"c9\", \"c10\", \"cj\", \"cq\", \"ck\", \"d1\", \"d2\", \"d3\", \"d4\", \"d5\", \"d6\", \"d7\", \n \"d8\", \"d9\", \"d10\", \"dj\", \"dq\", \"dk\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"h7\", \"h8\", \"h9\", \"h10\", \"hj\", \"hq\", \"hk\", \"s1\", \"s2\", \"s3\", \"s4\", \"s5\", \"s6\", \"s7\", \"s8\", \"s9\", \"s10\", \"sj\", \n \"sq\", \"sk\");\n\t//$phand[1] = 0;\n\t$phand[0] = 0;\n\t$flush = 0;\n\t$straight = 0;\n\tfor($i=0;$i<10;$i++){\n\t\t$car[$i] = $cardarr[$kartu[$i]];\n\t\t$suit[$i] = substr($car[$i], 0,1);\n\t\t$rank[$i] = substr($car[$i], 1,2);\n\t\tif ($rank[$i] == \"1\") {\n\t\t\t$ranks[$i] = 14;\n\t\t\t$ranky[$i] = 14;\n\t\t}\n\t\telse if($rank[$i] == \"j\") {\n\t\t\t$ranks[$i] = 11;\n\t\t\t$ranky[$i] = 11;\n\t\t}\n\t\telse if($rank[$i] == \"q\") {\n\t\t\t$ranks[$i] = 12;\n\t\t\t$ranky[$i] = 12;\n\t\t}\n\t\telse if($rank[$i] == \"k\") {\n\t\t\t$ranks[$i] = 13;\n\t\t\t$ranky[$i] = 13;\n\t\t}\n\t\telse {\n\t\t\t$ranks[$i] = $rank[$i]*1;\n\t\t\t$ranky[$i] = $rank[$i]*1;\n\t\t}\n\t}\n\trsort($ranks);\n\tfor($j=0;$j<5;$j++){\n\t\t$x = $j+1;\n\t\t$xrank = $ranks[$j]-1;\n\t\tif ($suit[$j] == $suit[0]) {\n\t\t\t$isflush++;\n\t\t\t//$res = 5;\n\t\t}\n\t\t//echo \"$xrank dan $ranks[$x] dan $ranks[$j]<BR>\";\n\t\tif ($xrank == $ranks[$x]) {\n\t\t\t$isstraight++;\n\t\t}\n\t\t$kind[$rank[$j]] = $kind[$rank[$j]]+1;\n\t\tif ($kind[$rank[$j]] == 4) {\n\t\t\t$iskind = 4;\n\t\t}\n\t\telse if ($kind[$rank[$j]] == 3) {\n\t\t\t$iskind = 3;\n\t\t}\n\t\telse if ($kind[$rank[$j]] == 2) {\n\t\t\t$iskind = 2;\n\t\t}\n\t\t//$iskind = $kind[$rank[$j]];\n\t\t/*\n\t\tif ($kind[$rank[$j]] == 3) {\n\t\t\t$kinds[$rank[$j]] = 3;\n\t\t\tif ($kindy == $rank[$j]) {\n\t\t\t\t$kindy = 0;\n\t\t\t}\n\t\t\t$kindx = $rank[$j];\n\t\t\techo \"$kindy ex $kindx kindyx $rank[$j]<BR>\";\n\t\t}else if ($kind[$rank[$j]] == 2){\n\t\t\t$kinda[$rank[$j]] = 2;\n\t\t\t$kindy = $rank[$j];\n\t\t\techo \"$kindy kindy<BR>\";\n\t\t}\n\t\t*/\n\t\tif ($kind[$rank[$j]] == 2) {\n\t\t\tif ($pairx != $rank[$j]) {\n\t\t\t\t$pairx = $ranky[$j];\n\t\t\t\t$pair++;\n\t\t\t}\n\t\t}\n\t\t//echo \"\".$kind[$rank[$j]].\" dan $rank[$j] kind<BR>\";\n\t\t//if ($rank[$j])\n\t}\n\t//echo \"$isflush dan $isstraight <BR>\";\n\t//echo \"$kinds[$kindx] dan $pairx full <BR>\";\n\tif ($isflush == 5 && $isstraight == 4) {\n\t\t//$phand[1] = 1;\n\t\t//echo \"$ranks[0]\";\n\t\tif ($ranks[0] == 14) {\n\t\t\t$royalflush = 1;\n\t\t\t$phand[0] = 1;\n\t\t}\n\t\telse {\n\t\t\t$straightflush = 1;\n\t\t\t$phand[0] = 2;\n\t\t}\n\t}else if ($iskind == 4) {\n\t\t$fourofakind = 1;\n\t\t$phand[0] = 3;\n\t}else if ($pair == 2 && $iskind == 3) {\n\t\t$fullhouse = 1;\n\t\t$phand[0] = 4;\n\t}\n\t//else if ($kinds[$kindx] == 3 && $kinda[$kindy] == 2) {\n\t//\t$fullhouse = 1;\n\t//}\n\telse if ($isflush == 5) {\n\t\t//$phand[1] = 1;\n\t\t$flush = 1;\n\t\t$phand[0] = 5;\n\t}else if ($isstraight == 4) {\n\t\t//$phand[1] = 1;\n\t\t$straight = 1;\n\t\t$phand[0] = 6;\n\t}else if ($iskind == 3) {\n\t\t$threeofakind = 1;\n\t\t$phand[0] = 7;\n\t}else if ($pair == 2) {\n\t\t$twopair = 1;\n\t\t$phand[0] = 8;\n\t}else if ($pair == 1) {\n\t\tif ($pairx >= 11) {\n\t\t\t$onepair = 1;\n\t\t\t$phand[0] = 9;\n\t\t}else {\n\t\t\t$none = 1;\n\t\t}\n\t}else{\n\t\t$none = 1;\n\t\t//echo \"habis\";\n\t}\n\t//echo \"$royalflush royal<BR>\";\n\t//echo \"$straightflush sflush<BR>\";\n\t//echo \"$fourofakind fourkind<BR>\";\n\t//echo \"$fullhouse fhouse<BR>\";\n\t//echo \"$flush flush<BR>\";\n\t//echo \"$straight straight<BR>\";\n\t//echo \"$threeofakind threekind<BR>\";\n\t//echo \"$twopair two<BR>\";\n\t//echo \"$onepair pair<BR>\";\n\t//echo \"$none none<BR>\";\n/*\n\t$flush = isflush($totaljoker,$kartusort,$hand);\n\t$straight = isstraight($totaljoker,$kartusort,$hand);\n\t$straightflush = isstraightflush($totaljoker,$kartusort,$hand,$flush,$strait);\n\t$royalflush = isroyalflush($straightflush);\n\n\t$fourkind = isfourofakind($totaljoker,$kartusort,$hand);\n\t$twopair = istwopairall($totaljoker,$kartusort,$hand);\n\t$threekind = isthreeofakind($totaljoker,$kartusort,$hand);\n\n$kartututupgb4 = isthreeofakindyy($totaljoker,$kartusort,$hand);\n$kartututupgball = istwopairallyy($totaljoker,$kartusort,$hand);\n\n$fullhouse = isfullhouse($totaljoker,$kartusort,$hand,$kartututupgb4,$kartututupgball,$twopair,$threekind);\n\n$acepair = isacepair($totaljoker,$kartusort,$hand);\n*/\n\t//$phand[2] = $ranky;\n\treturn $phand;\n}", "function __construct(Deck $deck){\n\n $this->cards = [];\n array_push($this->cards, $deck->drawCard(), $deck->drawCard()); // twice because 2 cards\n }", "function showhands($hands, $all=false)\n//$all flag determines if dealer's first card is shown or not\n{\n\tforeach ($hands as $hand => $cards) \n\t{\n\t\techo \"{$hand}'s hand is \";//shows 'Computer's hand is...' and 'Player's hand is...'\n\t\tforeach ($cards as $card=>$value) \n\t\t{\t\n\t\t\tif ($hand == \"Computer\") //Computer\n\t\t\t{\n\t\t\t\tswitch ($card) \n\t\t\t\t{\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tif ($all) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"({$value})\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"(?-?)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\techo \"({$value})\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //Player\n\t\t\t{\n\t\t\t\techo \"({$value})\";\n\t\t\t}\n\t\t}\n\t\techo PHP_EOL;\n\t}\nreturn $hands;\n}", "public function get_burnedcards() {\n return count($this->burned_cards);\n }", "function genScoreCards($patrolId = 0)\r\n\t{\r\n\t\tglobal $debug;\r\n\t\tglobal $msg;\r\n\t\t\r\n\t\t$dbh = getOpenedConnection();\r\n\t\t$list = array();\r\n\t\t\r\n\t\tif ($dbh == null) {\r\n\t\t\t$dbh = openDB();\r\n\t\t\tif ($dbh == null)\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$pat = \"\";\r\n\t\tif ($patrolId > 0)\r\n\t\t\t$pat = \" and p.Id = $patrolId\";\r\n\t\t\t\r\n\t\t$sql = \"\r\n\t\t\tselect p.Id PatrolId,\r\n\t\t\t\tp.SortOrder,\r\n\t\t\t\te.Status as EntryStatus,\r\n\t\t\t\tconcat(s.FirstName, ' ', s.LastName) as ShotName,\r\n\t\t\t\ts.GunCard,\r\n\t\t\t\tc.Name as ClubName,\r\n\t\t\t\tg.Grade as GunClassName,\r\n\t\t\t\tsc.Name as ShotClassName,\r\n\t\t\t\ts.Id as ShotId,\r\n\t\t\t\te.Id as EntryId,\r\n\t\t\t\ttime_format(time(p.StartTime), '%H:%i') as StartTime\r\n\t\t\tfrom tbl_Pistol_Patrol p\r\n\t\t\tjoin tbl_Pistol_Entry e on (e.PatrolId = p.Id)\r\n\t\t\tjoin tbl_Pistol_Shot s on (s.Id = e.ShotId)\r\n\t\t\tjoin tbl_Pistol_Club c on (c.Id = s.ClubId)\r\n\t\t\tjoin tbl_Pistol_GunClassification g on (g.Id = e.GunClassificationId)\r\n\t\t\tjoin tbl_Pistol_ShotClass sc on (sc.Id = e.ShotClassId)\r\n\t\t\twhere p.CompetitionDayId = $this->id\r\n\t\t\t$pat\r\n\t\t\torder by p.SortOrder, e.StaPlats, s.LastName, s.FirstName\r\n\t\t\";\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r($sql . \"<br><br>\");\r\n\t\t\t\r\n\t\t$result = mysqli_query($dbh,$sql);\r\n\t\t$rc = mysqli_affected_rows($dbh);\r\n\t\t\r\n\t\tif ($rc < 0)\r\n\t\t{\r\n\t\t\t$msg = mysqli_error($dbh);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\twhile ($obj = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\tunset($row);\r\n\t\t\t$row[\"PatrolId\"] = $obj->PatrolId;\r\n\t\t\t$row[\"SortOrder\"] = $obj->SortOrder;\r\n\t\t\t$row[\"ShotName\"] = $obj->ShotName;\r\n\t\t\t$row[\"GunCard\"] = $obj->GunCard;\r\n\t\t\t$row[\"ClubName\"] = $obj->ClubName;\r\n\t\t\t$row[\"ShotClassName\"] = $obj->ShotClassName;\r\n\t\t\t$row[\"GunClassName\"] = $obj->GunClassName;\r\n\t\t\t$row[\"ShotId\"] = $obj->ShotId;\r\n\t\t\t$row[\"EntryId\"] = $obj->EntryId;\r\n\t\t\t$row[\"EntryStatus\"] = $obj->EntryStatus;\r\n\t\t\t$row[\"StartTime\"] = $obj->StartTime;\r\n\t\t\t$list[] = $row;\r\n\t\t}\r\n\r\n\t\tmysqli_free_result($result);\r\n\r\n\t\treturn $list;\r\n\t}", "function buildDeck($suits, $cards) {\n\t$deck = [];\n\tforeach ($cards as $card) {\n\t\tforeach($suits as $suit) {\n\t\t\t$deck[] = \"$card\" . \"\" . \"$suit\";\n\t\t}\n\t}\n\tif(shuffle($deck)) {\n\t\treturn $deck;\n\t}\n}", "function gamePlay($deck, $player, $dealer, $name, $bankroll, $bet) {\n\tif (blackjackCheck($player)) {\n\t\t$bankroll += ($bet * 1.50);\n\t\techo 'Blackjack!! ' . $name . ' wins $' . ($bet * 1.50) . '!' . PHP_EOL;\n\t\techoBankroll($bankroll);\n\t\techo '---------------------------------------------------' . PHP_EOL;\n\t\tplayAgain($name, $bankroll);\n\t} \n\n\t//insurance bet?\n\t$insuranceBet = playerInsurance($name, $dealer, $bet, $bankroll);\n\n\t//split option here\n\tsplitCards($player, $dealer, $name, $insuranceBet, $bankroll, $bet, $deck);\n\n\t//double down option\n\tdoubleDown($name, $deck, $player, $dealer, $insuranceBet, $deck, $bet, $bankroll);\n\n\t//player must select (H)it or (S)tay\n\thitOrStay($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\tplayAgain($name, $bankroll);\n}", "public function on_purchase( &$player )\n\t{\n\t\t$cards_in_booster = range( 1, 18, 1 );\n\t\t\n\t\t// and a random assortment of 12 cards from the remaining 24\n\t\t$remaining_cards = range( 19, 42, 1 );\n\t\t\n\t\tshuffle( $remaining_cards );\n\t\t\n\t\t// pick some random from the ones remaining\n\t\tfor( $i = 0; $i < 12; $i++ )\n\t\t{\n\t\t\t$cards_in_booster[] = array_pop( $remaining_cards );\n\t\t}\n\t\t\n\t\t// add the cards to the player\n\t\t$player->add_cards( $cards_in_booster );\n\t\t\n\t\t// return some JSON containing what the player got\n\t\t// Need to go from the IDs we're using internally to some\n\t\t// JSON the client(s) can use to display the results nicely\n\t\t\n\t\t$card_rows = DB::table(CARDS)\n\t\t\t->where_in( 'id', $cards_in_booster )\n\t\t\t->get();\n\t\t\n\t\t$results = array();\n\t\t\t\n\t\tforeach( $card_rows as $card_row )\n\t\t{\n\t\t\t$results[] = array(\n\t\t\t\t'type' => 'card',\n\t\t\t\t'id' => $card_row->id,\n\t\t\t\t'name' => $card_row->name,\n\t\t\t\t'image' => $card_row->image,\n\t\t\t\t'description' => $card_row->description );\n \t\t}\n\t\t\n \t\t// If the player doesn't have any decks, create them a deck named 'Starter Deck'\n \t\t// and add these cards into it\n \t\t\n \t\t$player_decks = DB::table(DECKS)\n \t\t\t->where( 'player_id', '=', $player->id )\n \t\t\t->get();\n \t\t\t\n \t\tif( empty( $player_decks ) )\n \t\t{\n \t\t\t$deck = new Deck();\n \t\t\t$deck->name = 'Starter Deck';\n \t\t\t$deck->player_id = $player->id;\n \t\t\t$deck->save();\n \t\t\t\n \t\t\tforeach( $cards_in_booster as $card_id )\n \t\t\t{\n \t\t\t\tDB::table(DECKS_X_CARDS)\n \t\t\t\t\t->insert( array( 'deck_id' => $deck->id, 'card_id' => $card_id ) );\n \t\t\t}\n \t\t}\n \t\t\n\t\treturn $results;\n\t}", "function xstats_displayShipsExpBattleships( $gameId, $maxRows) {\n include ('../../inc.conf.php');\n $maxTurn = xstats_getMaxTurn($gameId);\n $result = @mysql_query(\"SELECT * FROM skrupel_xstats_ships WHERE gameId='\".$gameId.\"' AND(beamcount>0 OR hangarcount>0 OR tubecount>0) ORDER BY experience DESC\") or die(mysql_error());\n echo '<br><h4>Die erfahrensten Besatzungen (Kampfschiffe):</h4>';\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Schiff</th><th>Siege</th><th>Herstellungsort</th><th>In Betrieb</th></tr>';\n $counter = 0;\n while ($counter++ < $maxRows && $row = mysql_fetch_array($result)) {\n if( $row['untilturn'] == '0' || $row['untilturn'] == 0) {\n $untilTurn = $maxTurn;\n }else {\n $untilTurn = $row['untilturn'];\n }\n echo '<tr>';\n //ship\n echo '<td>'.xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $untilTurn,$row['shipclass'],$row['shipname']).'</td>';\n //victories\n echo '<td>'.$row['victories'].'</td>';\n //home planet\n $planetOwnerIndex = xstats_getShipOwnerIndexAtTurn($gameId, $row['shipid'], $row['sinceturn']);\n echo '<td>'.xstats_getPlanetDescription( $gameId, $row['buildposx'], $row['buildposy'], $planetOwnerIndex, $row['buildplanetname'] ).'</td>';\n //from-to\n echo '<td>Runde '.$row['sinceturn'].'-'.$untilTurn.'</td>';\n echo '</tr>';\n }\n echo '</table>';\n}", "public function card_list_query($deck){\n\n }", "function computer_turn($json)\n{\n $json[$_SESSION['game']]['computer_points'] = count_points($json[$_SESSION['game']]['computer_cards']);\n while ($json[$_SESSION['game']]['computer_points'] < 17) {\n array_push($json[$_SESSION['game']]['computer_cards'], get_ran_card());\n $json[$_SESSION['game']]['computer_points'] = count_points($json[$_SESSION['game']]['computer_cards']);\n }\n\n $json[$_SESSION['game']]['action'] = \"restart\";\n save_json($json);\n echo get_results($json);\n}", "public function dealCard(HasCardsInterface $hasCards, int $priority, int $suit): void\n {\n $card = $this->deckOfCards->dealCard($priority, $suit);\n\n $hasCards->addCard($card);\n }", "function buildDeck($cards, $suits) {\n\t$deck = [];\n\tforeach ($suits as $suit) {\n\t\tforeach ($cards as $card) {\n\t\t\t$deck[] = ['card' => $card, 'suit' => $suit];\n\t\t}\n\t}\n\tshuffle($deck);\n\treturn $deck;\n}", "#[NoReturn] function takeControl(): void {\r\n $this\r\n ->initDecks(Settings::getInstance()->getInt(Settings::SETTINGS_DECK_COUNT)) //// grabs cards from configured number of decks\r\n ->shuffle() /// shuffles cards\r\n ->initPlayers(Settings::getInstance()->getInt(Settings::SETTINGS_PLAYER_COUNT)) /// creates requested amount of players\r\n ->dealer()\r\n ->clear() /// clears the dealer's card\r\n ->deal($this->cards, $this->players); /// deal 2 cards to each player and to the dealer\r\n\r\n echo PHP_EOL, 'Game Started', PHP_EOL, PHP_EOL;\r\n echo 'Cards have been dealt', PHP_EOL, PHP_EOL;\r\n\r\n $this->printStatus(); /// prints all the\r\n\r\n foreach ($this->players as $player) {\r\n /// serve the current player\r\n $this->dealer->serve($player, $this->cards);\r\n }\r\n\r\n /// the dealer can play now\r\n $this->dealer->play($this->cards);\r\n\r\n /// all players have played, state scores now\r\n $this->stateScores();\r\n }", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "protected function getAllDatas()\n {\n $result = array();\n $debug_mode = self::getGameStateValue('debug_mode') == 1;\n \n //****** CODE FOR DEBUG MODE\n if ($debug_mode) {\n $name_list = array();\n foreach($this->textual_card_infos as $card) {\n $name_list[] = $card['name'];\n }\n $result['debug_card_list'] = $name_list;\n }\n //******\n \n $current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!\n \n // Get information about players\n // Note: you can retrieve some extra field you added for \"player\" table in \"dbmodel.sql\" if you need it.\n $players = self::getCollectionFromDb(\"SELECT player_id, player_score, player_team FROM player\");\n $result['players'] = $players;\n $result['current_player_id'] = $current_player_id;\n \n // Public information\n // Number of achievements needed to win\n $result['number_of_achievements_needed_to_win'] = self::getGameStateValue('number_of_achievements_needed_to_win');\n \n // All boards\n $result['board'] = self::getAllBoards($players);\n \n // Splay state for piles on board\n $result['board_splay_directions'] = array();\n $result['board_splay_directions_in_clear'] = array();\n foreach($players as $player_id => $player) {\n $result['board_splay_directions'][$player_id] = array();\n $result['board_splay_directions_in_clear'][$player_id] = array();\n for($color = 0; $color < 5 ; $color++) {\n $direction = self::getCurrentSplayDirection($player_id, $color);\n $result['board_splay_directions'][$player_id][] = $direction;\n $result['board_splay_directions_in_clear'][$player_id][] = self::getSplayDirectionInClear($direction);\n }\n }\n \n // Backs of the cards in hands (number of cards each player have in each age in their hands)\n $result['hand_counts'] = array();\n foreach ($players as $player_id => $player) {\n $result['hand_counts'][$player_id] = self::countCardsInLocation($player_id, 'hand', true);\n }\n \n // Backs of the cards in hands (number of cards each player have in each age in their score piles)\n $result['score_counts'] = array();\n foreach ($players as $player_id => $player) {\n $result['score_counts'][$player_id] = self::countCardsInLocation($player_id, 'score', true);\n }\n \n // Score (totals in the score piles) for each player\n $result['score'] = array();\n foreach ($players as $player_id => $player) {\n $result['score'][$player_id] = self::getPlayerScore($player_id);\n }\n \n // Revealed card\n $result['revealed'] = array();\n foreach($players as $player_id => $player) {\n $result['revealed'][$player_id] = self::getCardsInLocation($player_id, 'revealed');\n } \n \n // Unclaimed achivements \n $result['unclaimed_achievements'] = self::getCardsInLocation(0, 'achievements');\n \n // Claimed achievements for each player\n $result['claimed_achievements'] = array();\n foreach ($players as $player_id => $player) {\n $result['claimed_achievements'][$player_id] = self::getCardsInLocation($player_id, 'achievements');\n }\n \n // Ressources for each player\n $result['ressource_counts'] = array();\n foreach ($players as $player_id => $player) {\n $result['ressource_counts'][$player_id] = self::getPlayerRessourceCounts($player_id);\n }\n \n // Max age on board for each player\n $result['max_age_on_board'] = array();\n foreach ($players as $player_id => $player) {\n $result['max_age_on_board'][$player_id] = self::getMaxAgeOnBoardTopCards($player_id);\n }\n \n // Remaining cards in deck\n $result['deck_counts'] = self::countCardsInLocation(0, 'deck', true); \n \n // Turn0 or not\n $result['turn0'] = self::getGameStateValue('turn0') == 1;\n \n // Normal achievement names\n $result['normal_achievement_names'] = array();\n for($age=1; $age<=9; $age++) {\n $result['normal_achievement_names'][$age] = self::getNormalAchievementName($age);\n }\n \n // Number of achievements needed to win\n $result['number_of_achievements_needed_to_win'] = self::getGameStateValue('number_of_achievements_needed_to_win');\n \n // Link to the current dogma effect if any\n $nested_id_1 = self::getGameStateValue('nested_id_1');\n $card_id = $nested_id_1 == -1 ? self::getGameStateValue('dogma_card_id') : $nested_id_1;\n if ($card_id == -1) {\n $JSCardEffectQuery = null;\n }\n else {\n $card = self::getCardInfo($card_id);\n $current_effect_type = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_type') : 1 /* Non-demand effects only*/;\n $current_effect_number = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_number') : self::getGameStateValue('nested_current_effect_number_1');\n $JSCardEffectQuery = $current_effect_number == -1 ? null : self::getJSCardEffectQuery($card_id, $card['age'], $current_effect_type, $current_effect_number);\n }\n $result['JSCardEffectQuery'] = $JSCardEffectQuery;\n \n // Whose turn is it?\n $active_player = self::getGameStateValue('active_player');\n $result['active_player'] = $active_player == -1 ? null : $active_player;\n if ($active_player != -1) {\n $result['action_number'] = self::getGameStateValue('first_player_with_only_one_action') || self::getGameStateValue('second_player_with_only_one_action') || self::getGameStateValue('has_second_action') ? 1 : 2;\n }\n \n // Private information\n // My hand\n $result['my_hand'] = self::flatten(self::getCardsInLocation($current_player_id, 'hand', true));\n \n // My score\n $result['my_score'] = self::flatten(self::getCardsInLocation($current_player_id, 'score', true));\n \n // My wish for splay\n $result['display_mode'] = self::getPlayerWishForSplay($current_player_id); \n $result['view_full'] = self::getPlayerWishForViewFull($current_player_id);\n \n return $result;\n }", "function xstats_displayShipsExpFreighter( $gameId, $maxRows) {\n include ('../../inc.conf.php');\n $maxTurn = xstats_getMaxTurn($gameId);\n $result = @mysql_query(\"SELECT * FROM skrupel_xstats_ships WHERE gameId='\".$gameId.\"' AND beamcount=0 AND hangarcount=0 AND tubecount=0 ORDER BY experience DESC\") or die(mysql_error());\n echo '<br><h4>Die erfahrensten Besatzungen (Frachter):</h4>';\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Schiff</th><th>Herstellungsort</th><th>In Betrieb</th></tr>';\n $counter = 0;\n while ($counter++ < $maxRows && $row = mysql_fetch_array($result)) {\n if( $row['untilturn'] == '0' || $row['untilturn'] == 0) {\n $untilTurn = $maxTurn;\n }else {\n $untilTurn = $row['untilturn'];\n }\n echo '<tr>';\n //ship\n echo '<td>'.xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $untilTurn,$row['shipclass'],$row['shipname']).'</td>';\n //home planet\n $planetOwnerIndex = xstats_getShipOwnerIndexAtTurn($gameId, $row['shipid'], $row['sinceturn']);\n echo '<td>'.xstats_getPlanetDescription( $gameId, $row['buildposx'], $row['buildposy'], $planetOwnerIndex, $row['buildplanetname'] ).'</td>';\n //from-to\n echo '<td>Runde '.$row['sinceturn'].'-'.$untilTurn.'</td>';\n echo '</tr>';\n }\n echo '</table>';\n}", "function full_house(array $hand) {\n if (count($hand) < 5) return false;\n\n $suits = cards_values($hand);\n\n $same = array_count_values($suits);\n if (count($same) != 2) return false;\n $two_three = array_flip($same);\n return ['value' => $two_three[3] . $two_three[2], 'remaining' => []];\n}", "protected function cards()\n {\n return [\n new Help,\n ];\n }", "function warquest_view_awards() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $config;\r\n\tglobal $browser;\r\n\t\r\n\t$page = '<div class=\"award\">';\r\n\t\r\n\t/* Get battle award data */\r\n\t$query = \"select id, won from battle_award where id<\".$player->won_level.' order by id'; \r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\r\n\tif ($count>0) {\r\n\t\t\t\r\n\t\t$page .= '<br/>';\r\n\t\t$page .= t('HOME_BATTLE_AWARDS_TEXT');\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\twhile ($data = warquest_db_fetch_object($result)) {\r\n \t\t\r\n\t\t\t$max=9;\t\t\r\n\t\t\t$page .= warquest_battle_award_image($data->id, $data->won);\r\n\t\t\t\t\t\r\n\t\t\tif ((($data->id % $max)==0) && ($data->id!=$count)) { \r\n\t\t\t\t$page .='<br/>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '<br/>';\r\n\t}\r\n\t\t\t\r\n\t/* Get mission award data */\r\n\t$query = \"select id, won from mission_award where id<\".$player->mission_level.' order by id'; \r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\r\n\tif ($count>0) {\r\n\t\r\n\t\t$page .= '<br/>';\r\n\t\t$page .= t('HOME_MISSION_AWARDS_TEXT');\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\twhile ($data = warquest_db_fetch_object($result)) {\r\n \t\t\r\n\t\t\t$max=9;\t\t\r\n\t\t\t$page .= warquest_mission_award_image($data->id, $data->won);\r\n\t\t\t\t\t\r\n\t\t\tif ((($data->id % $max)==0) && ($data->id!=$count)) { \r\n\t\t\t\t$page .='<br/>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '<br/>';\r\n\t}\r\n\t\r\n\t/* Get bounty award data */\r\n\t$query = \"select id, amount from bounty_award where id<\".$player->bounty_level.' order by id'; \r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\r\n\tif ($count>0) {\r\n\t\r\n\t\t$page .= '<br/>';\r\n\t\t$page .= t('HOME_BOUNTY_AWARDS_TEXT');\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\twhile ($data = warquest_db_fetch_object($result)) {\r\n \t\t\r\n\t\t\t$max=9;\t\t\r\n\t\t\t$page .= warquest_bounty_award_image($data->id, $data->amount);\r\n\t\t\t\t\t\r\n\t\t\tif ((($data->id % $max)==0) && ($data->id!=$count)) { \r\n\t\t\t\t$page .='<br/>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '<br/>';\r\n\t}\r\n\t\r\n\t/* Get rebel award data */\r\n\t$query = \"select id, amount from rebel_award where id<\".$player->rebel_level.' order by id'; \r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\r\n\tif ($count>0) {\r\n\t\r\n\t\t$page .= '<br/>';\r\n\t\t$page .= t('HOME_REBEL_AWARDS_TEXT');\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\twhile ($data = warquest_db_fetch_object($result)) {\r\n \t\t\r\n\t\t\t$max=9;\t\t\r\n\t\t\t$page .= warquest_rebel_award_image($data->id, $data->amount);\r\n\t\t\t\t\t\r\n\t\t\tif ((($data->id % $max)==0) && ($data->id!=$count)) { \r\n\t\t\t\t$page .='<br/>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '<br/>';\r\n\t}\r\n\t\r\n\t$page .= '</div>';\n\t\r\n\treturn $page;\r\n}", "public function dealCardToHand(Player $player, HandBetPair $hand);", "public function displayCards($deckofCards)\n {\n for($i=0;$i<count($this->deckofCards);$i++){\n //displaying cards of each player\n echo \"Player \".($i+1).\": \";\n for($j=0;$j<count($this->deckofCards[$i]);$j++){\n echo \"\\\"\".$this->deckofCards[$i][$j].\"\\\"\".\" \";\n }\n echo \"\\n\\n\";\n }\n echo \"\\n\";\n }", "function four_of_a_kind(array $hand) {\n $values = cards_values($hand);\n\n $four = false;\n\n foreach(array_count_values($values) as $val => $c)\n if($c === 4) $four = strval($val);\n\n if ($four === false) return false;\n\n return ['value' => $four, 'remaining' => remove_values($hand, $four)];\n}", "protected function setCards($cards)\n {\n $this->cards = $cards;\n\n return $this;\n }", "function get_about_us_cards() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$about_us_image_one_title = get_theme_mod( 'about_us_image_one_title', 'Hope and opportuneties' );\n\t\t\t\t\t\t$about_us_image_one_text = get_theme_mod( 'about_us_image_one_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_one_image = get_theme_mod( 'about_us_image_one_image', get_bloginfo('template_url').'/img/about_us_image_one.jpg' );\n\n\t\t\t\t\t\t$about_us_image_two_title = get_theme_mod( 'about_us_image_two_title', 'A future for everyone' );\n\t\t\t\t\t\t$about_us_image_two_text = get_theme_mod( 'about_us_image_two_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_two_image = get_theme_mod( 'about_us_image_two_image', get_bloginfo('template_url').'/img/about_us_image_two.jpg' );\n\n\t\t\t\t\t\t$about_us_image_three_title = get_theme_mod( 'about_us_image_three_title', 'Shared experiences' );\n\t\t\t\t\t\t$about_us_image_three_text = get_theme_mod( 'about_us_image_three_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_three_image = get_theme_mod( 'about_us_image_three_image', get_bloginfo('template_url').'/img/about_us_image_three.jpg' );\n\n\t\t\t\t\t\t$data = [\n\t\t\t\t\t\t\t'card_one' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_one_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_one_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_one_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'card_two' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_two_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_two_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_two_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'card_three' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_three_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_three_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_three_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (empty($data)) {\n\t\t\t\t\t\t\treturn new WP_Error( 'empty_category', 'there is no data in the custom about us.', array('status' => 404) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$response = new WP_REST_Response($data);\n\t\t\t\t\t\t$response->set_status(200);\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn $response;\n\t\t\t\t\t}", "function getPlayerCaseCards($player_id)\n {\n return $this->cards->getPlayerHand(self::getPlayerBefore($player_id));\n }", "public function run()\n {\n for( $i = 0 ; $i < 50 ; $i++ )\n {\n $user = User::all()->random();\n CardList::factory()\n ->has(Card::factory()->count(random_int(2,7))->for($user,'owner'),'cards')\n ->count(random_int(1,5))\n ->for(Board::factory()->for($user,'owner'))\n ->create();\n }\n }", "public function cardsInitialize()\n {\n $deck = [];\n $k=0;\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $deck[$k++] = $this->rank[$j].$this->suits[$i];\n }\n }\n return $deck;\n }", "function chcekTheWinner($dom, $owner){\n $instance = DbConnector::getInstance();\n $playersList = handEvaluator();\n usort($playersList, array(\"Player\", \"cmp\")); \n $i = 0;\n echo \"<div id=\\\"summary\\\"><div>--- Summary ---</div>\";\n echo \"<table border=\\\"1\\\" BORDERCOLOR=RED style=\\\"width:100%\\\"><tr><th>Player</th><th>Score</th><th>Hand</th><th>Cards</th></tr>\";\n foreach($playersList as $player){ \n if($i === 0){\n $sql = \"SELECT `TotalMoneyOnTable`, `Transfer` FROM `TableCreatedBy_\" . $owner . \"` where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n while ($row = mysql_fetch_row($retval)) {\n $value = $row[0];\n $flag = $row[1];\n }\n if($flag == 0){ //transfer money to accunt\n $sql = \"UPDATE `TableCreatedBy_\" . $owner . \"` SET `Money` = `Money` + \".$value.\", `Transfer`=1 where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n }\n echo \"<td>\" . $player->player . \" won \".$value.\"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }else{\n echo \"<td>\" . $player->player . \"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }\n $i++;\n }\n echo \"</table></div>\";\n}", "function xstats_displayShipFightsByShip( $gameId, $maxRows) {\n include ('../../inc.conf.php');\n $maxTurn = xstats_getMaxTurn($gameId);\n $query = \"SELECT * FROM skrupel_xstats_ships WHERE gameid=\".$gameId.\" AND victories > 0\";\n $result = @mysql_query($query) or die(mysql_error());\n echo '<br><h4>Liste der Raumk&auml;mpfe nach Produktionsrunde der Schiffe:</h4>';\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Schiff</th><th>Siege</th><th>In Betrieb</th><th>Antriebe</th><th>Laser</th><th>Torp</th><th>Hangar</th></tr>';\n while ($row = mysql_fetch_array($result)) {\n //dont display ships without victory\n if( $row['victories'] == 0 ) {\n break;\n }\n echo '<tr>';\n //ship\n echo '<td>'.xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $row['untilturn'], $row['shipclass'], $row['shipname']).'</td>';\n //victory count\n echo '<td>'.$row['victories'].'</td>';\n //from-to\n if( $row['untilturn'] == '0' || $row['untilturn'] == 0) {\n $untilTurn = $maxTurn;\n }else {\n $untilTurn = $row['untilturn'];\n }\n echo '<td class=\"highlight\">Runde '.$row['sinceturn'].'-'.$untilTurn.'</td>';\n //engine\n $levelEngine = $row['levelengine'];\n if( $levelEngine == 8 ) {\n $levelEngine = 7;\n }\n echo '<td>'.$row['enginecount'].'* Lvl '.$levelEngine.'</td>';\n //laser\n if( $row['beamcount'] == 0 ) {\n echo( \"<td>0</td>\");\n }\n else {\n echo '<td>'.$row['beamcount'].'* Lvl '.$row['levelbeam'].'</td>';\n }\n //tubes\n if( $row['tubecount'] == 0 ) {\n echo( \"<td>0</td>\");\n }\n else {\n echo '<td>'.$row['tubecount'].'* Lvl '.$row['leveltube'].'</td>';\n }\n //hangar\n echo '<td>'.$row['hangarcount'].'</td>';\n echo '</tr>';\n $query = \"SELECT * FROM skrupel_xstats_ships ships,skrupel_xstats_shipvsship shipvsship WHERE shipvsship.shipid=ships.shipid AND (shipvsship.fightresult=2 OR shipvsship.fightresult=3) AND enemyshipid=\".$row['shipid'].\" AND shipvsship.gameid=\".$gameId.\" AND ships.gameid=\".$gameId.\" ORDER BY turn\";\n $victoryResult = @mysql_query( $query ) or die(mysql_error());\n while ($victoryRow = mysql_fetch_array($victoryResult)) {\n echo \"<tr>\";\n echo \"<td></td>\";\n echo '<td colspan=\"6\">';\n if( $victoryRow['fightresult'] == 2) {\n echo 'Zerst&ouml;rt ';\n $usedTurn = $victoryRow['turn'];\n }else {\n echo 'Erobert ';\n $usedTurn = $victoryRow['turn']-1;\n }\n echo xstats_getShipFullDescription( $gameId, $victoryRow['shipid'], $victoryRow['shiprace'], $victoryRow['picturesmall'], $victoryRow['experience'], $usedTurn, $victoryRow['shipclass'],$victoryRow['shipname']);\n echo ' in Runde '.$victoryRow['turn'];\n echo '</td>';\n echo \"</tr>\";\n }\n //find out who captured the ship\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['shipid'].\" AND fightresult=3 AND gameid=\".$gameId;\n $captureResult = @mysql_query( $query ) or die(mysql_error());\n if( mysql_num_rows($captureResult)>0 ) {\n while($captureRow = mysql_fetch_array($captureResult)) {\n $captureInfoResult = @mysql_query(\"SELECT * FROM skrupel_xstats_ships WHERE gameId='\".$gameId.\"' AND shipid=\".$captureRow['enemyshipid']) or die(mysql_error());\n $captureInfoRow = mysql_fetch_array($captureInfoResult);\n echo \"<tr>\";\n echo \"<td></td>\";\n echo '<td colspan=\"6\">';\n echo 'Wurde erobert von '.xstats_getShipFullDescription( $gameId, $captureInfoRow['shipid'], $captureInfoRow['shiprace'], $captureInfoRow['picturesmall'], $captureInfoRow['experience'], $captureInfoRow['turn'],$captureInfoRow['shipclass'],$captureInfoRow['shipname']);\n echo ' in Runde '.$captureRow['turn'];\n echo '</td>';\n echo '</tr>';\n }\n }\n //find out who destroyed the ship finally\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['shipid'].\" AND fightresult=2 AND gameid=\".$gameId;\n $destroyerResult = @mysql_query( $query ) or die(mysql_error());\n if( mysql_num_rows($destroyerResult)>0 ) {\n $destroyerRow = mysql_fetch_array($destroyerResult);\n $destroyerInfoResult = @mysql_query(\"SELECT * FROM skrupel_xstats_ships WHERE gameId='\".$gameId.\"' AND shipid=\".$destroyerRow['enemyshipid']) or die(mysql_error());\n $destroyerInfoRow = mysql_fetch_array($destroyerInfoResult);\n echo \"<tr>\";\n echo \"<td></td>\";\n echo '<td colspan=\"6\">';\n echo 'Wurde zerst&ouml;rt von '.xstats_getShipFullDescription( $gameId, $destroyerInfoRow['shipid'], $destroyerInfoRow['shiprace'], $destroyerInfoRow['picturesmall'], $destroyerInfoRow['experience'], $destroyerRow['turn'],$destroyerInfoRow['shipclass'],$destroyerInfoRow['shipname']);\n echo ' in Runde '.$destroyerRow['turn'];\n echo '</td>';\n echo '</tr>';\n }else {\n //perhaps destroyed by planetary defense?\n $query = \"SELECT * FROM skrupel_xstats_shipvsplanet WHERE shipid=\".$row['shipid'].\" AND eventtype=1 AND gameid=\".$gameId;\n $destroyerInfoResult = @mysql_query( $query ) or die(mysql_error());\n if( mysql_num_rows($destroyerInfoResult)>0 ) {\n $destroyerInfoRow = mysql_fetch_array($destroyerInfoResult);\n echo \"<tr>\";\n echo \"<td></td>\";\n echo '<td colspan=\"6\">';\n echo 'Wurde zerst&ouml;rt von '.xstats_getPlanetDescription( $gameId, $destroyerInfoRow['posx'], $destroyerInfoRow['posy'], $destroyerInfoRow['planetownerindex'], $row['buildplanetname']).' (Planetare Verteidigung)';\n echo ' in Runde '.$destroyerRow['turn'];\n echo '</td>';\n echo '</tr>';\n }\n }\n }\n echo '</table>';\n}", "public function cards(): array\n {\n return [\n new SuggestedResourcesShortcuts,\n // new LatestRelease(),\n ];\n }", "function xstats_displayAllFights( $gameId ) {\n include ('../../inc.conf.php');\n echo '<br><h4>Liste aller Raumk&auml;mpfe nach Runden</h4>';\n $query = \"SELECT * FROM skrupel_xstats_ships ships,skrupel_xstats_shipvsship shipvsship WHERE shipvsship.shipid=ships.shipid AND (shipvsship.fightresult=2 OR shipvsship.fightresult=3) AND shipvsship.gameid=\".$gameId.\" AND ships.gameid=\".$gameId.\" ORDER BY turn,shipvsship.id\";\n $result = @mysql_query( $query ) or die(mysql_error());\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Runde</th><th colspan=\"3\">Kampf</th><th>H&uuml;llenschaden</tr>';\n while ($row = mysql_fetch_array($result)) {\n echo \"<tr>\";\n //turn\n echo '<td class=\"highlight\">'.$row['turn'].'</td>';\n echo '<td>';\n //get victorous ship\n $query = \"SELECT * FROM skrupel_xstats_ships WHERE gameid=\".$gameId.\" AND shipid=\".$row['enemyshipid'];\n $victoryResult = @mysql_query( $query ) or die(mysql_error());\n $victoryRow = mysql_fetch_array($victoryResult);\n echo xstats_getShipFullDescription( $gameId, $victoryRow['shipid'], $victoryRow['shiprace'], $victoryRow['picturesmall'], $victoryRow['experience'], $row['turn'],$victoryRow['shipclass'],$victoryRow['shipname']);\n echo '</td><td>';\n if( $row['fightresult'] == 2) {\n $turnToUse = $row['turn'];\n echo ' zerst&ouml;rt ';\n }else {\n echo ' erobert ';\n //display the formerly owner of this ship\n $turnToUse = $row['turn']-1;\n }\n echo '</td><td>';\n echo xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $turnToUse,$row['shipclass'],$row['shipname']);\n echo '</td>';\n //get hull damage of winning ship\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['enemyshipid'].\" AND enemyshipid=\".$row['shipid'].\" AND gameid=\".$gameId;\n $winnerResult = @mysql_query( $query ) or die(mysql_error());\n $winnerResult = mysql_fetch_array($winnerResult);\n $hullDamage = $winnerResult['hulldamage'];\n echo '<td>'.$hullDamage.'%';\n //hull damage bar\n echo '<div class=\"hulldamage\">';\n echo '<div style=\"width: '.(100-$hullDamage).'%\"></div>';\n echo '</div>';\n echo '</td>';\n echo \"</tr>\";\n }\n echo '</table>';\n}", "function displayCard($cards) {\n \n echo \"<img src= '../challenges2/img-2/cards/clubs/$cards.png' />\";\n }", "private function createCardHTML($game)\n {\n $html = '\n <div class=\"card cardBootstarp\" style=\" max-width: 15rem; margin:10px; padding:0; background-color: #161b22; border:2px solid #28a745;\">\n <a href=\"?r=games&e=detail&idGame=' . $game['id'] . '\">\n <img src=\"./img/games/' . $game['imageName'] . '\" class=\"card-img-top imageCard\" >\n <div class=\"card-body \">\n <h6 class=\"card-title whiteTexte\">' . $game['name'] . '</h5>\n <div class=\"card-body \">\n ';\n\n $html .= '<a class=\"btn btn-outline-success cardContent\" href=\"?r=games&e=removeFavoris&idGame=' . $game['id'] . '\" role=\"button\"><i class=\"fa fa-heart \"></i></a>';\n\n\n $html .= '\n </div>\n </div>\n </a>\n </div>';\n return $html;\n }", "public function card();", "public function initDecks (int $deckCount = -1) : Game {\r\n if ( $deckCount == -1 ) $deckCount = rand(2, 6);\r\n\r\n for ( $i = 0; $i < $deckCount; $i++ ) {\r\n $deck = new Deck();\r\n\r\n foreach($deck->getCards() as $card)\r\n array_push($this->cards, $card);\r\n }\r\n\r\n return $this;\r\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "function newdeck($suits, $values)\n{\n $new = array();\n foreach ($suits as $suit) {\n foreach ($values as $value) {\n array_push($new, $suit . $value);\n }\n }\n shuffle($new);\n return $new;\n}", "public function removeCardsFromBottom(int $numCards): array\n {\n if ($this->size >= $numCards)\n {\n $cardArray = array();\n // TODO: Remove these lines?\n //$counter = $numCards;\n //while ($counter > 0)\n while ($numCards > 0)\n {\n $cardArray[] = array_shift($this->cards);\n //$counter--;\n $numCards--;\n $this->size--;\n }\n return $cardArray;\n }\n else\n {\n echo \"Error: Not enough cards.\";\n }\n }", "public function generatePossibleMoves(){\r\n\t\t\t$this->possibleMoves = array();\r\n\t\t\t// Iterates through all the possible moves\r\n\t\t\tfor ($currCol = 0; $currCol < 10; $currCol++){\r\n\t\t\t\tfor ($currRow = 0; $currRow < 10; $currRow++){\r\n\t\t\t\t\t$this->possibleMoves[($currRow * 10) + $currCol] = new Shot($currRow+1, $currCol+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public static function cardsInDashboards()\n {\n $dashboards = static::$dashboards;\n\n foreach ($dashboards as $dashboard) {\n DashboardNova::cards($dashboard->cards());\n }\n }", "protected function burn_card() {\n $this->burned_cards[] = array_pop($this->deck);\n return $this;\n }", "function getCardDeck () { \n\n $cards = array(1 => 'A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K');\n $deck = array( 'S' => $cards,\n 'H' => $cards,\n 'C' => $cards,\n 'D' => $cards);\n return $deck;\n}" ]
[ "0.62987524", "0.6245059", "0.5989346", "0.5831767", "0.5806295", "0.57729656", "0.5742328", "0.5693044", "0.5682811", "0.55851746", "0.54815644", "0.5427877", "0.53567183", "0.5345559", "0.52890617", "0.52847916", "0.52029556", "0.520128", "0.52009016", "0.5181071", "0.5152956", "0.51527417", "0.51331586", "0.5124084", "0.51158404", "0.5072266", "0.50701123", "0.50683314", "0.50656265", "0.50332046", "0.50133675", "0.497585", "0.49665266", "0.49455512", "0.49375352", "0.49359396", "0.49228555", "0.49012974", "0.4893484", "0.48837486", "0.4881163", "0.4877941", "0.48532337", "0.48376042", "0.4834413", "0.48300317", "0.48275226", "0.48272264", "0.48244286", "0.48188427", "0.48166832", "0.48080528", "0.47817114", "0.47799394", "0.47721028", "0.47599056", "0.47470075", "0.4732765", "0.47323602", "0.47276935", "0.4726684", "0.47095686", "0.47050247", "0.46881258", "0.4673169", "0.46701807", "0.46604463", "0.46398994", "0.4638433", "0.46341637", "0.4629822", "0.46095508", "0.4607076", "0.46064112", "0.45983893", "0.4592435", "0.45911294", "0.45706993", "0.45704547", "0.45676905", "0.4567483", "0.45602763", "0.4558104", "0.45521882", "0.45512843", "0.45339143", "0.45285994", "0.4524487", "0.45204505", "0.45184708", "0.44835576", "0.44835576", "0.44835576", "0.4479307", "0.4479077", "0.44778547", "0.44764635", "0.44740853", "0.4467497", "0.4463507" ]
0.5545058
10
/ Returns the cards placed by players in the order they were placed in. If $filter == true, black cards are stripped of their assigned colors.
function getPlacedCards($gameId, $filter=false) { $sql = "select card_name from placed_cards where game_id = $gameId order by id asc"; $cards = mapToArray(parcoursRs(SQLSelect($sql)), "card_name"); if (!$filter) { return $cards; } foreach ($cards as $index => $card) { $sym = cardSymbol($card); if ($sym == "joker" || $sym == "plusfour") { $cards[$index] = cardSymbol($card); } } return $cards; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByCards($cards = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($cards)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $cards)) {\n $cards = str_replace('*', '%', $cards);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(CardPeer::CARDS, $cards, $comparison);\n }", "public function getCards();", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "function selectEligibleCards() {\n // Return the number of selected cards that way \n \n // Condition for owner\n $owner_from = self::getGameStateValue('owner_from');\n if ($owner_from == -2) { // Any player\n $condition_for_owner = \"owner <> 0\";\n }\n else if ($owner_from == -3) { // Any opponent\n $player_id = self::getActivePlayerId();\n $opponents = self::getObjectListFromDB(self::format(\"\n SELECT\n player_id\n FROM\n player\n WHERE\n player_team <> (\n SELECT\n player_team\n FROM\n player\n WHERE\n player_id = {player_id}\n )\n \",\n array('player_id' => $player_id)), true\n );\n $condition_for_owner = self::format(\"owner IN ({opponents})\", array('opponents' => join($opponents, ',')));\n }\n else {\n $condition_for_owner = self::format(\"owner = {owner_from}\", array('owner_from' => $owner_from));\n }\n \n // Condition for location\n $location_from = self::decodeLocation(self::getGameStateValue('location_from'));\n if ($location_from == 'revealed,hand') {\n $condition_for_location = \"location IN ('revealed', 'hand')\";\n }\n else if ($location_from == 'pile') {\n $condition_for_location = \"location = 'board'\";\n }\n else {\n $condition_for_location = self::format(\"location = '{location_from}'\", array('location_from' => $location_from));\n }\n \n // Condition for age\n $age_min = self::getGameStateValue('age_min');\n $age_max = self::getGameStateValue('age_max');\n $condition_for_age = self::format(\"age BETWEEN {age_min} AND {age_max}\", array('age_min' => $age_min, 'age_max' => $age_max));\n \n // Condition for color\n $color_array = self::getGameStateValueAsArray('color_array');\n $condition_for_color = count($color_array) == 0 ? \"FALSE\" : \"color IN (\".join($color_array, ',').\")\";\n \n // Condition for icon\n $with_icon = self::getGameStateValue('with_icon');\n $without_icon = self::getGameStateValue('without_icon');\n if ($with_icon > 0) {\n $condition_for_icon = self::format(\"AND (spot_1 = {icon} OR spot_2 = {icon} OR spot_3 = {icon} OR spot_4 = {icon})\", array('icon' => $with_icon));\n }\n else if ($without_icon > 0) {\n $condition_for_icon = self::format(\"AND spot_1 <> {icon} AND spot_2 <> {icon} AND spot_3 <> {icon} AND spot_4 <> {icon}\", array('icon' => $without_icon));\n }\n else {\n $condition_for_icon = \"\";\n }\n \n // Condition for id\n $not_id = self::getGameStateValue('not_id');\n if ($not_id != -2) { // Only used by Fission and Self service\n $condition_for_id = self::format(\"AND id <> {not_id}\", array('not_id' => $not_id));\n }\n else {\n $condition_for_id = \"\";\n }\n \n if (self::getGameStateValue('splay_direction') == -1 && $location_from == 'board') {\n // Only the active card can be selected\n self::DbQuery(self::format(\"\n UPDATE\n card\n LEFT JOIN\n (SELECT owner AS joined_owner, color AS joined_color, MAX(position) AS position_of_active_card FROM card WHERE location = 'board' GROUP BY owner, color) AS joined\n ON\n owner = joined_owner AND\n color = joined_color\n SET\n selected = TRUE\n WHERE\n {condition_for_owner} AND\n {condition_for_location} AND\n {condition_for_age} AND\n position = position_of_active_card AND\n {condition_for_color}\n {condition_for_icon}\n {condition_for_id}\n \",\n array(\n 'condition_for_owner' => $condition_for_owner,\n 'condition_for_location' => $condition_for_location,\n 'condition_for_age' => $condition_for_age,\n 'condition_for_color' => $condition_for_color,\n 'condition_for_icon' => $condition_for_icon,\n 'condition_for_id' => $condition_for_id\n )\n ));\n }\n else {\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n selected = TRUE\n WHERE\n {condition_for_owner} AND\n {condition_for_location} AND\n {condition_for_age} AND\n {condition_for_color}\n {condition_for_icon}\n {condition_for_id}\n \",\n array(\n 'condition_for_owner' => $condition_for_owner,\n 'condition_for_location' => $condition_for_location,\n 'condition_for_age' => $condition_for_age,\n 'condition_for_color' => $condition_for_color,\n 'condition_for_icon' => $condition_for_icon,\n 'condition_for_id' => $condition_for_id\n )\n ));\n }\n \n //return self::DbAffectedRow(); // This does not seem to work all the time...\n return self::getUniqueValueFromDB(\"SELECT COUNT(*) FROM card WHERE selected IS TRUE\");\n }", "public function getcards() {\n global $DB;\n\n if (!is_null($this->cards)) {\n return $this->cards;\n }\n\n $sql = \"SELECT i.*\n FROM {swipe_item} i\n JOIN {swipe} g ON g.id = i.swipeid\n WHERE i.swipeid = :swipeid\n ORDER BY i.sortorder ASC\";\n\n $fs = get_file_storage();\n $filelist = array();\n\n $files = $fs->get_area_files($this->context->id, 'mod_swipe', 'item', false, 'id', false);\n foreach ($files as $file) {\n $filelist[$file->get_itemid()]['item'] = $file;\n }\n\n $cards = array();\n if ($records = $DB->get_records_sql($sql, array('swipeid' => $this->cm->instance))) {\n foreach ($records as $record) {\n $files = !empty($filelist[$record->id]) ? $filelist[$record->id] : false;\n $options = array(\n 'files' => $files,\n 'gallery' => $this,\n );\n\n // Replacing empty caption with image filename/video url for\n // all items in gallery on mouseover for better user experience.\n if (empty($record->caption)) {\n if (!empty($filelist[$record->id])) {\n $record->caption = $filelist[$record->id]['item']->get_filename();\n } else if (!empty($record->externalurl)) {\n $record->caption = $record->externalurl;\n }\n }\n $cards[$record->id] = new card($record->id);\n }\n }\n $this->cards = $cards;\n return $this->cards;\n }", "public function getCards()\n {\n return [\n 'WHITE' => self::WHITE_CARDS,\n 'BLACK' => self::BLACK_CARDS,\n ];\n }", "protected function getCards(CardFilters $filters)\n {\n $cards = Card::orderBy('name')->filter($filters)->get();\n\n return $cards;\n }", "public function initializeCards()\n {\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $this->deckofCards[$i][$j] = $this->rank[$j].\" \".$this->suits[$i];\n }\n }\n return $this->deckofCards;\n }", "public function shuffleCards()\n {\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $randomNumber1 = mt_rand(0,3);\n $randomNumber2 = mt_rand(0,12);\n\n $temp = $this->deckofCards[$randomNumber1][$randomNumber2];\n $this->deckofCards[$randomNumber1][$randomNumber2] = $this->deckofCards[$i][$j];\n $this->deckofCards[$i][$j] = $temp;\n }\n }\n return $this->deckofCards;\n }", "function getPlayerCaseCards($player_id)\n {\n return $this->cards->getPlayerHand(self::getPlayerBefore($player_id));\n }", "function getTopCardOnBoard($player_id, $color) {\n return self::attachTextualInfo(self::getObjectFromDB(self::format(\"\n SELECT\n *\n FROM\n card\n WHERE\n card.owner = {player_id} AND\n card.location = 'board' AND\n card.color = {color} AND\n card.position = (\n SELECT\n MAX(position) AS position\n FROM\n card\n WHERE\n owner = {player_id} AND\n location = 'board' AND\n color = {color}\n )\n \",\n array('player_id' => $player_id, 'color' => $color)\n )));\n }", "public function getParlayCardCards($id, $playerId)\n {\n if(!$playerId) \n $this->getParlayWinners($id);\n \n $rs = $this->db->query(\"Select id , firstName, lastName from Users where id in (Select distinct playerId from SportPlayerCards where parlayCardId = ?) order by screenName\", array($id));\n $names = $rs->result();\n \n $rs = $this->db->query(\"Select * from SportParlayConfig where parlayCardId = ?\", array($id));\n $config = $rs->row();\n \n $results = array();\n $rs = $this->db->query(\"Select * from SportGameResults where parlayCardId = ?\", array($id));\n foreach($rs->result() as $row)\n $results[$row->sportScheduleId] = $row->winner;\n \n $answers = array();\n $rs = $this->db->query(\"Select * from SportParlayCards where parlayCardId = ? order by sequence\", array($id));\n foreach($rs->result() as $row)\n {\n if($row->overUnderScore && isset($results[$row->id]))\n $row->winner = $results[$row->id];\n elseif(!$row->overUnderScore && isset($results[$row->sportScheduleId]))\n $row->winner = $results[$row->sportScheduleId];\n else\n $row->winner = 0;\n \n if($row->overUnderScore)\n $answers[$row->id] = $row;\n else\n $answers[$row->sportScheduleId] = $row;\n }\n \n $cards = array();\n if(!$playerId)\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? order by wins DESC limit 50\", array($id));\n }\n else\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? and playerId = ? order by wins DESC\", array($id, $playerId));\n }\n \n foreach($rs->result() as $index => $row)\n {\n $cards[$index]['title'] = \"#\" . $row->id . \" \" . $row->firstName . \" \" . $row->lastName . \" (\" . $row->playerId . \") (Wins: \" . $row->wins . \" Losses: \" . $row->losses . \")\";\n $picks_temp = explode(\":\", $row->picksHash);\n foreach($picks_temp as $temp)\n {\n $key_value = explode(\"|\", $temp);\n $cards[$index]['cards'][$key_value[0]] = $key_value[1];\n }\n }\n \n return compact('config', 'answers', 'cards', 'names');\n }", "protected function deckApplyFilters()\n {\n // show card pool after applying filters\n $this->result()\n ->changeRequest('card_pool', 'yes')\n ->setCurrent('Decks_edit');\n }", "public function sort()\n {\n $this->getFirstAndLastCard();\n $this->sortCards();\n\n return $this->cardsArray;\n }", "public function cardProvider()\n {\n $ticket1 = $this->getCard('A', 'B');\n $ticket2 = $this->getCard('B', 'C');\n $ticket3 = $this->getCard('C', 'D');\n $ticket4 = $this->getCard('D', 'E');\n\n $expectedResult = [\n $ticket1,\n $ticket2,\n $ticket3,\n $ticket4,\n ];\n\n yield 'Sorted' => [\n $expectedResult,\n $expectedResult\n ];\n\n yield 'Reversed' => [\n array_reverse($expectedResult),\n $expectedResult,\n ];\n\n $random = $expectedResult;\n shuffle($random);\n yield 'Random' => [\n $random,\n $expectedResult,\n ];\n }", "public function cardsInitialize()\n {\n $deck = [];\n $k=0;\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $deck[$k++] = $this->rank[$j].$this->suits[$i];\n }\n }\n return $deck;\n }", "public function getUserCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the cards list\n return $this->vaultHandler->getUserCards($customerId);\n }", "public function print_cards(array $hands=NULL) {\n if($hands === NULL){\n $hands = $this->get_hands();\n }\n foreach ($hands as $playername => $hand) {\n if($this->browser === FALSE){\n echo $playername . ': ' . implode(' - ', $hand).PHP_EOL;\n } else {\n echo '<div class=\"players\"><div class=\"players playername\">'.$playername.'</div>';\n foreach ($hand as $card) {\n echo $card;\n }\n echo '</div>';\n }\n \n }\n return $this;\n }", "public function dealCards(): void\n {\n foreach ($this->players as $player) {\n $playerCardsCount = $player->getCards()->count();\n $neededCountForDealing = 2 - $playerCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $player->addCard($card);\n }\n }\n }\n\n $tableCardsCount = $this->getCards()->count();\n $neededCountForDealing = 5 - $tableCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $this->addCard($card);\n }\n }\n }", "public function filterPlayerByTeamAction() {\r\r $this->_helper->layout()->disableLayout();\r $this->_helper->viewRenderer->setNoRender(true);\r\r if ($this->getRequest()->isPost()) {\r $method = $this->getRequest()->getParam('method');\r\r //echo \"Method: \".$method;die();\r switch ($method) {\r case 'teamfilter':\r $teamfilter = $this->getRequest()->getPost('team');\r $searchValue = $this->getRequest()->getPost('searchValue');\r $playerListArray = $this->getRequest()->getPost('playerList');\r $searchKey = $this->getRequest()->getPost('searchKey');\r\r // with team filter\r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey, $teamfilter);\r // echo \"<pre>\"; print_r( $filterPlayerList); echo \"</pre>\"; die;\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r\r break;\r\r case 'playerfilter':\r\t\t\t\t\t\r $searchValue = $this->getRequest()->getPost('searchValue');\r $filterValue = $this->getRequest()->getPost('filterValue');\r $playerListArray = $this->view->session->playerListArray;\r\t\t\t\t\t//echo print_r($this->getRequest()->getPost()); die;\r\t\t\t\t //added code by alok on 21/07/2017 used for search player with listing and search carry in another tab\r\t\t\t\t if(isset($filterValue) && !empty($filterValue) && $filterValue != null && $searchValue != 'ALL'){\r\t\t\t\t $objGamePlayers = Application_Model_GamePlayers::getInstance();\r\t\t\t\t $playerListArray = $objGamePlayers->getPlayersByGameTeamWithSearch($this->getRequest()->getPost('sportId'), $filterValue);\r\t\t\t\t }\r\t\t\t\t \r $searchKey = $this->getRequest()->getPost('searchKey');\r $teamfilter = $this->getRequest()->getPost('selectedTeam');\r $sportId = $this->getRequest()->getPost('sportId');\r if (($searchValue == \"FLEX\" && $sportId == 1 ) || ($searchValue == \"F\" && $sportId == 3 ) || ($searchValue == \"G\" && $sportId == 3 ) || $searchValue == \"UTIL\") {\r if ($teamfilter[0] != \"All Games\") { \r\t\t\t\t\t \r //$playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey, $teamfilter);\r $playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey, $teamfilter,$filterValue);\r\t\t\t\t\t\t\t\r } else {\r\t\t\t\t\t\t //$playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey);\r $playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey,$filterValue);\r }\r $value = array();\r foreach ($playerListArray as $key => $row) {\r $value[$key] = $row['plr_value'];\r }\r array_multisort($value, SORT_DESC, $playerListArray);\r\t\t\t\t\t\t\r echo json_encode($playerListArray);\r } else {\r\r if ($searchValue == \"ALL\" && empty($teamfilter)) {\r $value = array();\r\t\t\t\t\t\t\t$nfl_pos = array('QB','RB','WR','K','DST','TE');\r\t\t\t\t\t\t\t$mlb_pos = array('1B','2B','3B','C','SS','SP');\r\t\t\t\t\t\t\t$nba_pos = array('PG','SG','SF','PF','C');\r\t\t\t\t\t\t\t$nhl_pos = array('C','RW','LW','D','G','W');\r\t\t\t\t\t\t\t$newPlayerArray = array();\r foreach ($playerListArray as $key => $row) {\r\t\t\t\t\t\t\t\tif($sportId==1){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nfl_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==2){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$mlb_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==3){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nba_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==4){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nhl_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t\t\t$newPlayerArray = $playerListArray;\r\t\t\t\t\t\t\t\t} \r }\r\t\t\t\t\t\t\t\r array_multisort($value, SORT_DESC, $newPlayerArray);\r\t\t\t\t\t\t\t\r echo json_encode($newPlayerArray);\r } else {\r if ($teamfilter[0] != \"All Games\") { \r\t\t\t\t\t\t\t \r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey, $teamfilter);\r\t\t\t\t\t\t\t\t\r } else {\r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey);\r }\r\r $value = array();\r foreach ($filterPlayerList as $key => $row) {\r $value[$key] = $row['plr_value'];\r }\r array_multisort($value, SORT_DESC, $filterPlayerList);\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r }\r }\r\r break;\r\r case 'playerByTeam':\r\r $searchPos = $this->getRequest()->getPost('searchPos');\r $searchTeam = $this->getRequest()->getPost('searchTeam');\r $playerListArray = $this->view->session->playerListArray;\r $searchKey = $this->getRequest()->getPost('searchKey');\r\r $sportId = $this->getRequest()->getPost('sportId');\r if (($searchPos == \"FLEX\" && $sportId == 1 ) || ($searchPos == \"F\" && $sportId == 3 ) || ($searchPos == \"G\" && $sportId == 3 ) || $searchPos == \"UTIL\") {\r if ($searchTeam[0] != \"All Games\") {\r $playerListArray = $this->specialPlayer($sportId, $searchPos, $searchKey, $searchTeam);\r } else {\r $playerListArray = $this->specialPlayer($sportId, $searchPos, $searchKey);\r }\r\r echo json_encode($playerListArray);\r } else {\r\r if ($searchPos == \"ALL\") {\r echo json_encode($playerListArray);\r } else {\r\r if ($searchTeam[0] != \"All Games\") {\r $filterPlayerList = $this->filterTeamArray($searchPos, $playerListArray, $searchKey, $searchTeam);\r } else {\r $filterPlayerList = $this->filterTeamArray($searchPos, $playerListArray, $searchKey);\r }\r\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r }\r }\r break;\r default:\r break;\r }\r }\r }", "public function getCardsWithoutCustomer()\n {\n return $this->getCardRepository()->findAllInactiveCards();\n }", "function getRedCards()\n\t{\n\t\t$data = array();\t\t\n\t\t$r_query = 'SELECT username, users.user_id FROM rcards, users '.\n\t\t\t\t\t'WHERE rcards.report_id = '.$this->id.' '.\n\t\t\t\t\t'AND rcards.user_id = users.user_id';\n\t\t$r_result = mysql_query($r_query)\n\t\t\tor die(mysql_error());\n\t\t\n\t\twhile ($r_row = mysql_fetch_array($r_result))\n\t\t{\n\t\t\t$data[] = array('link'=>'viewprofile.php?action=view&amp;uid='.$r_row['user_id'],\n\t\t\t\t\t\t\t\t'name'=>$r_row['username'],\n\t\t\t\t\t\t\t\t'id'=>$r_row['user_id']);\n\t\t}\n\t\treturn $data;\n\t}", "public function findByFilter(\\BiBundle\\Entity\\Filter\\Card $filter)\n {\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n $qb->select('c')\n ->from('BiBundle:Card', 'c')\n ->orderBy('c.createdOn', 'desc');\n if ($filter->id) {\n $qb->andWhere('c.id = :id');\n $qb->setParameter('id', $filter->id);\n }\n $qb->setMaxResults($filter->getLimit());\n $qb->setFirstResult($filter->getOffset());\n\n return $qb->getQuery()->getResult();\n }", "public function filterProvider()\n {\n $entity1 = $this->createMock(EntityInterface::class);\n $entity2 = $this->createMock(EntityInterface::class);\n $entity3 = $this->createMock(EntityInterface::class);\n $entity4 = $this->createMock(EntityInterface::class);\n $entity5 = $this->createMock(EntityInterface::class);\n $entity6 = $this->createMock(EntityInterface::class);\n\n $entity1->foo = 'bar';\n $entity2->foo = 123;\n $entity4->foo = '123';\n $entity5->foo = ['1230'];\n $entity6->foo = [1234, 123, 'teta'];\n\n $entities = [$entity1, $entity2, $entity3, $entity4, $entity5, $entity6];\n\n $filter = function($entity) {\n return isset($entity->foo) && $entity->foo == 123;\n };\n\n return [\n [$entities, ['foo' => 123], false, [1 => $entity2, 3 => $entity4, 5 => $entity6]],\n [$entities, ['foo' => 123], true, [1 => $entity2, 5 => $entity6]],\n [$entities, $filter, false, [1 => $entity2, 3 => $entity4]],\n [$entities, $filter, true, [1 => $entity2, 3 => $entity4]],\n [$entities, [], false, $entities],\n [$entities, [], true, $entities],\n [[], ['foo' => 123], true, []],\n [[], ['foo' => 123], false, []],\n [[], $filter, true, []],\n [[], $filter, false, []],\n ];\n }", "function getCardList()\n {\n $txt = new Text($this->language, $this->translation_module_default);\n\n // sorting order of the query\n if (!$this->vars[\"sort\"]) {\n $sort_order = 'person_name';\n } else {\n $sort_order = $this->vars[\"sort\"];\n }\n\n if (!$this->vars[\"dir\"]) {\n $sort_dir = \"ASC\";\n } else {\n $sort_dir = $this->vars[\"dir\"];\n }\n\n // amount of records to query at once\n if (!$this->vars[\"start\"]) {\n $start_row = 0;\n } else {\n $start_row = $this->vars[\"start\"];\n }\n\n if (!$this->vars[\"limit\"]) {\n $max_rows = $this->maxresults;\n } else {\n $max_rows = $this->vars[\"limit\"];\n }\n\n $condition = array();\n if ($this->card_type_current) {\n $condition[] = \"`module_isic_card`.`type_id` = \" . $this->card_type_current;\n }\n // filter conditions\n foreach ($this->fieldData['filterview'] as $filter_data) {\n if ($this->vars[$filter_data['field']]) {\n switch ($filter_data['type']) {\n case 1: // textfield\n $condition[] = $filter_data['field'] . \" LIKE '%\" . mysql_escape_string($this->vars[$filter_data['field']]) . \"%'\";\n break;\n case 2: // combobox\n $condition[] = $filter_data['field'] . \" = \" . mysql_escape_string($this->vars[$filter_data['field']]);\n break;\n default :\n break;\n }\n }\n }\n\n $sql_condition = implode(\" AND \", $condition);\n if ($sql_condition) {\n $sql_condition = \"AND \" . $sql_condition;\n }\n\n $res =& $this->db->query(\"\n SELECT\n `module_isic_card`.*,\n IF(`module_isic_school`.`id`, `module_isic_school`.`name`, '') AS school_name,\n IF(`module_isic_card_kind`.`id`, `module_isic_card_kind`.`name`, '') AS card_kind_name,\n IF(`module_isic_bank`.`id`, `module_isic_bank`.`name`, '') AS bank_name,\n IF(`module_isic_card_type`.`id`, `module_isic_card_type`.`name`, '') AS card_type_name\n FROM\n `module_isic_card`\n LEFT JOIN\n `module_isic_school` ON `module_isic_card`.`school_id` = `module_isic_school`.`id`\n LEFT JOIN\n `module_isic_card_kind` ON `module_isic_card`.`kind_id` = `module_isic_card_kind`.`id`\n LEFT JOIN\n `module_isic_bank` ON `module_isic_card`.`bank_id` = `module_isic_bank`.`id`\n LEFT JOIN\n `module_isic_card_type` ON `module_isic_card`.`type_id` = `module_isic_card_type`.`id`\n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n ORDER BY ! ! \n LIMIT !, !\", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition, \n $sort_order, \n $sort_dir, \n $start_row, \n $max_rows\n );\n//echo($this->db->show_query());\n $result = array();\n while ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\".jpg\", \"_thumb.jpg\", $data[\"pic\"]);\n if ($t_pic && file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = \"<img src=\\\"\" . $t_pic . \"\\\">\";\n }\n $data[\"pic\"] .= \"<img src=\\\"img/tyhi.gif\\\" height=\\\"100\\\" width=\\\"1\\\">\";\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"m/y\", strtotime($data[\"expiration_date\"]));\n $data[\"active\"] = $txt->display(\"active\" . $data[\"active\"]);\n $data[\"confirm_payment_collateral\"] = $this->isic_payment->getCardCollateralRequired($data[\"school_id\"], $data[\"type_id\"]) ? $txt->display(\"active\" . $data[\"confirm_payment_collateral\"]) : \"-\";\n $data[\"confirm_payment_cost\"] = $this->isic_payment->getCardCostRequired($data[\"school_id\"], $this->isic_common->getCardStatus($data[\"prev_card_id\"]), $data[\"type_id\"], $is_card_first) ? $txt->display(\"active\" . $data[\"confirm_payment_cost\"]) : \"-\";\n $result[] = $data;\n }\n\n $res =& $this->db->query(\"\n SELECT COUNT(*) AS total \n FROM \n `module_isic_card` \n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n \", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition);\n if ($data = $res->fetch_assoc()) {\n $total = $data[\"total\"];\n }\n \n echo JsonEncoder::encode(array('total' => $total, 'rows' => $result));\n exit();\n }", "public function distributeCards(){\n $this->distributeCardsToPlayers();\n $this->distributeCardsToPlayers();\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n }", "protected function getGiftcards()\n {\n $this->search_by = (Input::get('search-by')) ? Input::get('search-by') : '';\n $this->search_key = (Input::get('search-key')) ? Input::get('search-key') : '';\n\n $search_key = trim(request('search-key'));\n\n switch (Input::get('search-by')) {\n case 'card_code':\n $data = Giftcards::select('card_id', 'card_code', 'card_status', 'mail_from_email', 'mail_to_email',\n 'created_time')\n ->where('card_code', 'like', \"%$search_key%\")\n ->orderBy('card_id', 'desc')\n ->paginate($this->pagination_limit);\n break;\n\n case 'mail_from':\n $data = Giftcards::select('card_id', 'card_code', 'card_status', 'mail_from_email', 'mail_to_email',\n 'created_time')\n ->where('mail_from_email', 'like', \"%$search_key%\")\n ->orderBy('card_id', 'desc')\n ->paginate($this->pagination_limit);\n break;\n\n case 'mail_to':\n $data = Giftcards::select('card_id', 'card_code', 'card_status', 'mail_from_email', 'mail_to_email',\n 'created_time')\n ->where('mail_to_email', 'like', \"%$search_key%\")\n ->orderBy('card_id', 'desc')\n ->paginate($this->pagination_limit);\n break;\n\n default:\n $data = Giftcards::orderBy('card_id', 'desc')->paginate($this->pagination_limit);\n }\n\n return $data;\n }", "public function prepareCard()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\t$query = 'SELECT * FROM card WHERE id_votes =\"'.$this->voteId.'\" and gtv=\"'.$this->cardId.'\" ORDER BY id_option ASC ';\r\n\t\t\t\r\n\t\t\tif ($result = $mysqli->query($query))\r\n\t\t\t{\r\n\t\t\t\twhile($obj = $result->fetch_object())\r\n\t\t\t\t{\r\n\t\t\t\t\t$card = new Card($obj->id,$this->voteId,$obj->id_option,$obj->gtv,$obj->Pog,$obj->gyv,$obj->sig);\r\n\t\t\t\t\tarray_push($this->cardList,$card);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$mysqli->close(); \r\n\t\t}", "function displayCards() {\n global $deck;\n foreach ($deck as $card){\n $value = $card['value'];\n $suit = $card['suit'];\n }\n }", "public function filter($original, $server)\r\n {\r\n $result = array();\r\n if (empty($original)) return $result;\r\n\r\n // Normalise results\r\n $result = $this->normalise($original, $this->vars);\r\n\r\n // Normalise players\r\n if (is_array($result['gq_players'])) {\r\n\r\n // Don't rename the players array\r\n $result['players'] = $result['gq_players'];\r\n\r\n foreach ($result['players'] as $key => $player) {\r\n $result['players'][$key] = array_merge($player, $this->normalise($player, $this->player));\r\n }\r\n\t\t\t\r\n\t\t\t$result['gq_numplayers'] = count($result['players']);\r\n }\r\n else\r\n\t\t{\r\n\t\t\t$result['players'] = array();\r\n\t\t}\r\n\r\n unset($result['gq_players']);\r\n\r\n\t\t\r\n // Merge and sort array\r\n $result = (array_merge($original, $result));\r\n ksort($result);\r\n\r\n return $result;\r\n\r\n }", "function getBottomCardOnBoard($player_id, $color) {\n return self::attachTextualInfo(self::getObjectFromDB(self::format(\"\n SELECT\n *\n FROM\n card\n WHERE\n card.owner = {player_id} AND\n card.location = 'board' AND\n card.color = {color} AND\n card.position = 0\n \",\n array('player_id' => $player_id, 'color' => $color)\n )));\n }", "protected function shuffle_cards($deck = array()) {\n if(count($deck) == 0){\n $deck = $this->get_deck();\n }\n \n for ($i = 0; $i != $this->shuffle; $i++) {\n mt_srand((double) microtime() * 1000000);\n $offset = mt_rand(10, 40);\n //First we will split our deck cards:\n $sliced_cards[0] = array_slice($deck, 0, $offset);\n $sliced_cards[1] = array_slice($deck, $offset, 52);\n\n //Then Shuffle Eeach\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Reverse each pile\n $sliced_cards[0] = array_reverse($sliced_cards[0]);\n $sliced_cards[1] = array_reverse($sliced_cards[1]);\n\n //Re-Shuffle\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Merge both stacks\n $unsliced = array_merge($sliced_cards[0], $sliced_cards[1]);\n\n //And another shuffle\n shuffle($unsliced);\n\n //Add in a flip\n array_flip($unsliced);\n }\n $this->set_deck($unsliced);\n\n return $this;\n }", "protected function sort()\n {\n $stop = $this->departure;\n $cards = $this->cards;\n $this->cards = array();\n \n while ($stop != $this->arrival) {\n foreach ($cards as $index => $card) {\n if ($card->getOrigin() == $stop) {\n $this->cards[] = $card;\n $stop = $card->getDestination();\n unset($cards[$index]);\n }\n }\n }\n }", "public function card_list_query($deck){\n\n }", "function createPlayers()\n {\n createDeck();\n \n $points = 0;\n $name = \"\";\n $hand = array();\n \n $players = array();\n \n for ($i = 0; $i < 4; $i++)\n {\n switch ($i)\n {\n case 0:\n $name = \"Cody\";\n array_push($players, $name, $points, $hand);\n break;\n case 1:\n $name = \"Kara\";\n array_push($players, $name, $point, $hand);\n break;\n case 2:\n $name = \"Fernando\";\n array_push($players, $name, $point, $hand);\n break;\n case 3:\n $name = \"Dani\";\n array_push($players, $name, $point, $hand);\n break;\n default:\n break;\n }\n }\n \n var_dump($players);\n }", "function makeCards() {\n\t\t\n\t\t$cards = explode(\" \", $this->me->get(\"cards\"));\n\t\t$i = 0;\n\t\t$rv = \"gamestate.cards = [];\";\n\t\t\n\t\tforeach ($cards as $value) {\n\t\t\t$name = getOneThing(\"name\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$description = getOneThing(\"description\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"] = new Object();\\n\";\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"].name = '\".$name.\"';\\ngamestate.cards[\".$i.\"].description = '\".$description.\"';\\n\";\n\t\t\t$i++;\n\t\t\t}\n\t\t\n\t\n\t\treturn $rv;\n\t\t\n\t\n\t}", "public function filter();", "function game(&$deck,&$players,&$stack)\n{\n $end = false;\n $skip = false;\n $takeCards = 0;\n\n //now the turns will begin until the game ends\n while($end != true)\n {\n //loop through players\n foreach ($players as &$p)\n {\n //check last played card\n $stackIndex = count($stack)-1;\n $lastcard = $stack[$stackIndex];\n\n if ($skip) {\n echo $p['name'].\" has to skip their turn.<br>\";\n $skip = false;\n continue;\n }\n\n $index = 0;\n $played = false;\n $turn = true;\n\n while($turn)\n {\n //Loop through the players hand to find compatible card if the player hasn't played yet\n if ($takeCards > 0){\n foreach ($p['hand'] as &$h)\n {\n //check if this card is compatible with the card on the stack\n if($h['name'] == '2')\n {\n if($h['name'] === '2')\n {\n $takeCards = $takeCards+2;\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take \" . $takeCards . \" cards or play a 2.<br>\";\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n $played = true;\n $turn = false;\n }\n $index++;\n }\n if (!$played) {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack,$takeCards);\n $turn = false;\n $takeCards = 0;\n }\n } else {\n foreach ($p['hand'] as &$h)\n {\n if(!$played && !$end)\n {\n\n //check if this card is compatible with the card on the stack\n if($h['name'] == $lastcard['name']|| $h['symbol'] == $lastcard['symbol'])\n {\n if($h['name'] === '7')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 7 they can play again.<br>\";\n }else if($h['name'] === '8')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 8 the next player has to skip their turn.<br>\";\n $skip = true;\n }else if($h['name'] === '2')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take 2 cards or play a 2.<br>\";\n $takeCards = $takeCards+2;\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n if($h['name'] != '7')\n {\n $played = true;\n $turn = false;\n }\n }\n }\n $index++;\n }\n\n //check if players hand is empty, if so game is over\n if(count($p['hand']) == 0)\n {\n echo $p['name'].' won<br>';\n $end = true;\n die();\n }\n\n //check if the players has played this turn, else take a card\n if (!$played)\n {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack);\n $turn = false;\n }\n }\n }\n }\n }\n}", "function getYellowCards()\n\t{\n\t\t$data = array();\t\n\t\t$y_query = 'SELECT username, users.user_id FROM ycards, users '.\n\t\t\t\t\t'WHERE ycards.report_id = '.$this->id.' '.\n\t\t\t\t\t'AND ycards.user_id = users.user_id';\n\t\t$y_result = mysql_query($y_query)\n\t\t\tor die(mysql_error());\n\t\t\n\t\twhile ($y_row = mysql_fetch_array($y_result))\n\t\t{\n\t\t\t$data[] = array('link'=>'viewprofile.php?action=view&amp;uid='.$y_row['user_id'],\n\t\t\t\t\t\t\t\t'name'=>$y_row['username'],\n\t\t\t\t\t\t\t\t'id'=>$y_row['user_id']);\n\t\t}\n\t\treturn $data;\n\t}", "public function cards(Request $request) {\n return [];\n }", "protected function cards()\n {\n return [\n new Latestposts,\n // new Help,\n // (new NovaClock)->displaySeconds(true)->blink(true),\n // (new PostsPerDay)->width('full'),\n // (new PostCount)->width('1/2'), \n // (new PostsPerCategory)->width('1/2'),\n \n // (new \\Mako\\CustomTableCard\\CustomTableCard)\n // ->header([\n // new \\Mako\\CustomTableCard\\Table\\Cell('Post ID'),\n // (new \\Mako\\CustomTableCard\\Table\\Cell('Post Text'))->class('text-left'),\n // ])\n // ->data([\n // (new \\Mako\\CustomTableCard\\Table\\Row(\n // new \\Mako\\CustomTableCard\\Table\\Cell('1'),\n // (new \\Mako\\CustomTableCard\\Table\\Cell('this is a post'))->class('text-left')->id('price-2')\n // ))->viewLink('nova/resources/posts/1'),\n // (new \\Mako\\CustomTableCard\\Table\\Row(\n // new \\Mako\\CustomTableCard\\Table\\Cell('2'),\n // (new \\Mako\\CustomTableCard\\Table\\Cell('this is a second post'))->class('text-left')->id('price-2')\n // )),\n // ])\n // ->title('Posts')\n // ->viewall(['label' => 'View All', 'link' => '/nova/resources/posts']),\n \n ];\n }", "public function filterByPlayerId($playerId = null, $comparison = null)\n {\n if (is_array($playerId)) {\n $useMinMax = false;\n if (isset($playerId['min'])) {\n $this->addUsingAlias(CardPeer::PLAYER_ID, $playerId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($playerId['max'])) {\n $this->addUsingAlias(CardPeer::PLAYER_ID, $playerId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CardPeer::PLAYER_ID, $playerId, $comparison);\n }", "public function getStoredCards()\n {\n if (!$this->getData('stored_cards')) {\n $cards = array(); // Array to hold card objects\n \n $customer = $this->getCustomer();\n $cimGatewayId = $customer->getCimGatewayId();\n\n if (!$cimGatewayId) {\n if($this->isAdmin() && Mage::getModel('authorizenetcim/profile')->isAllowGuestCimProfile()) {\n $orderId = Mage::getSingleton('adminhtml/session_quote')->getOrderId();\n if (!$orderId) $orderId = Mage::getSingleton('adminhtml/session_quote')->getReordered();\n if (!$orderId) return false;\n $order = Mage::getModel('sales/order')->load($orderId);\n $payment = $order->getPayment();\n if ($payment) {\n $cimCustomerId = $payment->getData('authorizenetcim_customer_id');\n $cimPaymentId = $payment->getData('authorizenetcim_payment_id');\n }\n } else {\n return false;\n }\n }\n\n if ($cimGatewayId) {\n $cim_profile = Mage::getModel('authorizenetcim/profile')->getCustomerProfile($cimGatewayId);\n if ($cim_profile) {\n if (isset($cim_profile->paymentProfiles) && is_object($cim_profile->paymentProfiles)) {\n /**\n * The Soap XML response may be a single stdClass or it may be an\n * array. We need to adjust it to make it uniform.\n */\n if (is_array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType)) {\n $payment_profiles = $cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType;\n } else {\n $payment_profiles = array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType);\n }\n }\n }\n } else {\n if ($cimCustomerId && $cimPaymentId) {\n $payment_profiles = array(Mage::getModel('authorizenetcim/profile')->getCustomerPaymentProfile($cimCustomerId, $cimPaymentId));\n } else {\n return false;\n }\n }\n\n if (isset($payment_profiles) && $payment_profiles) {\n // Assign card objects to array\n foreach ($payment_profiles as $payment_profile) {\n $card = new Varien_Object();\n $card->setCcNumber($payment_profile->payment->creditCard->cardNumber)\n ->setGatewayId($payment_profile->customerPaymentProfileId)\n ->setFirstname($payment_profile->billTo->firstName)\n ->setLastname($payment_profile->billTo->lastName)\n ->setAddress($payment_profile->billTo->address)\n ->setCity($payment_profile->billTo->city)\n ->setState($payment_profile->billTo->state)\n ->setZip($payment_profile->billTo->zip)\n ->setCountry($payment_profile->billTo->country);\n $cards[] = $card;\n }\n }\n \n if (!empty($cards)) {\n $this->setData('stored_cards', $cards);\n } else { \n $this->setData('stored_cards',false);\n }\n }\n \n return $this->getData('stored_cards');\n }", "public function getCards()\n {\n $response = $this->dashboardHelper->getCards();;\n\n $response = array_map(function ($card) {\n if ($card['view_url'] ?? false) {\n $card['view_url'] = route($card['view_url'], $card['url_params'] ?? []);\n }\n\n return $card;\n }, $response);\n\n return response()->json($response);\n }", "public function actionCategoryCards()\n\t{\n\t\tif(FacebookController::getUserID() ==0)\n\t\t{\n\t\t\t$error = new ErrorController('error');\n\t\t\t$error->actionFaildUserID();\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\t$user_id = FacebookController::getUserID();\n\t\t$cat_name = $_GET['catg'];\n\t\t$cards = Card::model()->findAll('cat_name=:cat_name',array('cat_name'=>$cat_name));\n\t\t$userCards = UserCard::model()->findAll('fb_id=:fb_id',array('fb_id'=>$user_id)); \n\t\t$cardsUsed = array();\n\t\tfor($i=0;$i<count($userCards);$i++)\n\t\t{\n\t\t\t$card = &$userCards[$i]->card_id ;\n\t\t\t$cardsUsed[$card] = true;\n\t\t}\n\t\t$this->render('categoryCards',array('user_id'=>$user_id,'cat_name'=>$cat_name,'cards'=>$cards,'cardsUsed'=>$cardsUsed));\n\t}", "public function get_burnedcards() {\n return count($this->burned_cards);\n }", "function echoPlayer(&$player, $name) {\n\t$total = getTotal($player);\n\tforeach ($player as $card) {\n\t\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n}", "public function comments_for_carddeck() {\n global $DB, $OUTPUT;\n $ufields = \\user_picture::fields('u');\n\n $sql = \"SELECT c.id AS cid, $ufields, c.feedback AS feedback, c.timecreated AS feedbackcreated\n FROM {swipe_swipefeedback} c\n JOIN {user} u ON u.id = c.userid\n WHERE c.swipeid = :swipeid\n ORDER BY c.timecreated DESC\";\n $params['swipeid'] = $this->cm->instance;\n\n $comments = $DB->get_records_sql($sql, $params);\n\n if (count($comments)) {\n foreach ($comments as &$comment) {\n $comment->name = fullname($comment);\n $comment->avatar = $OUTPUT->user_picture($comment, array('size' => 18));\n }\n }\n return array_values($comments);\n }", "public function resolveCards(AdminRequest $request)\n {\n return collect(array_values($this->filter($this->cards($request))));\n }", "public function filterByGameRelatedByDiscard($game, $comparison = null)\n {\n if ($game instanceof Game) {\n return $this\n ->addUsingAlias(CardPeer::ID, $game->getDiscard(), $comparison);\n } elseif ($game instanceof PropelObjectCollection) {\n return $this\n ->useGameRelatedByDiscardQuery()\n ->filterByPrimaryKeys($game->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByGameRelatedByDiscard() only accepts arguments of type Game or PropelCollection');\n }\n }", "public function getPlayers(array $accounts): Collection;", "public function sort()\n {\n /*\n * This arrange step takes O(n) time.\n *\n * Arrange the from and to locations for fast lookup.\n */\n self::arrangeBoardingCards();\n /*\n * This next step also takes O(n) time.\n */\n $startLocation = self::getStartLocation();\n /*\n * From the start location, traverse the boarding cards, creating a sorted list as we go.\n *\n * This step takes O(n) time.\n */\n $sortedBoardingCards = array();\n $currentLocation = $startLocation;\n /*\n * Assign respective boarding card while checking for undefined index\n */\n while ($currentBoardingCard = (array_key_exists($currentLocation, $this->fromIndex)) ? $this->fromIndex[$currentLocation] : null) {\n\n /*\n * Add the boarding card to our sorted list.\n */\n array_push($sortedBoardingCards, $currentBoardingCard);\n /*\n * Get our next location.\n */\n $currentLocation = $currentBoardingCard->getTo();\n }\n /*\n * After O(3n) operations, we can now return the sorted boarding cards.\n */\n return $sortedBoardingCards;\n }", "protected abstract function filter();", "public function giftcards(): Collection\n {\n return $this->giftcards;\n }", "function transferCardFromTo($card, $owner_to, $location_to, $bottom_to=false, $score_keyword=false) {\n if ($location_to == 'deck') { // We always return card at the bottom of the deck\n $bottom_to = true;\n }\n \n $id = $card['id'];\n $age = $card['age'];\n $color = $card['color'];\n $owner_from = $card['owner'];\n $location_from = $card['location'];\n $position_from = $card['position'];\n $splay_direction_from = $card['splay_direction'];\n \n // Determine the splay direction of destination if any\n if ($location_to == 'board') {\n // The card must continue the current splay\n $splay_direction_to = self::getCurrentSplayDirection($owner_to, $color);\n }\n else { // $location_to != 'board'\n $splay_direction_to = 'NULL';\n }\n \n // Filters for cards of the same family: the cards of the decks are grouped by age, whereas the cards of the board are grouped by player and by color\n // Filter from\n $filter_from = self::format(\"owner = {owner_from} AND location = '{location_from}'\", array('owner_from' => $owner_from, 'location_from' => $location_from));\n switch ($location_from) {\n case 'deck':\n case 'hand':\n case 'score':\n $filter_from .= self::format(\" AND age = {age}\", array('age' => $age));\n break;\n case 'board':\n $filter_from .= self::format(\" AND color = {color}\", array('color' => $color));\n break;\n default:\n break;\n }\n \n // Filter to\n $filter_to = self::format(\"owner = {owner_to} AND location = '{location_to}'\", array('owner_to' => $owner_to, 'location_to' => $location_to));\n switch ($location_to) {\n case 'deck':\n case 'hand':\n case 'score':\n $filter_to .= self::format(\" AND age = {age}\", array('age' => $age));\n break;\n case 'board':\n $filter_to .= self::format(\" AND color = {color}\", array('color' => $color));\n break;\n default:\n break;\n }\n \n // Get the position of destination and update some other card positions if needed\n if ($bottom_to) { // The card must go to bottom of the location: update the position of the other cards accordingly\n // Execution of the query\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n position = position + 1\n WHERE\n {filter_to}\n \",\n array('filter_to' => $filter_to)\n ));\n $position_to = 0;\n }\n else { // $bottom_to is false\n // new_position = number of cards in the location\n $position_to = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(position)\n FROM\n card\n WHERE\n {filter_to}\n \",\n array('filter_to' => $filter_to)\n )); \n }\n\n // Execute the transfer\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n owner = {owner_to},\n location = '{location_to}',\n position = {position_to},\n selected = FALSE,\n splay_direction = {splay_direction_to}\n WHERE\n id = {id}\n \",\n array('owner_to' => $owner_to, 'location_to' => $location_to, 'position_to' => $position_to, 'id' => $id, 'splay_direction_to' => $splay_direction_to)\n ));\n \n // Update the position of the cards of the location the transferred card came from to fill the gap\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n position = position - 1 \n WHERE\n {filter_from} AND\n position > {position_from}\n \",\n array('filter_from' => $filter_from, 'position_from' => $position_from)\n ));\n\n \n $transferInfo = array(\n 'owner_from' => $owner_from, 'location_from' => $location_from, 'position_from' => $position_from, 'splay_direction_from' => $splay_direction_from, \n 'owner_to' => $owner_to, 'location_to' => $location_to, 'position_to' => $position_to, 'splay_direction_to' => $splay_direction_to, \n 'bottom_to' => $bottom_to, 'score_keyword' => $score_keyword\n );\n \n // Update the current state of the card\n $card['owner'] = $owner_to;\n $card['location'] = $location_to;\n $card['position'] = $position_to; \n $card['splay_direction'] = $splay_direction_to;\n \n $current_state = $this->gamestate->state();\n if ($current_state['name'] != 'gameSetup') {\n try {\n self::updateGameSituation($card, $transferInfo);\n }\n catch (EndOfGame $e) {\n self::trace('EOG bubbled from self::transferCardFromTo');\n throw $e; // Re-throw exception to higher level\n }\n finally {\n // Determine if the loss of the card from its location of depart breaks a splay. If it's the case, change the splay_direction of the remaining card to unsplay (a notification being sent).\n if ($location_from == 'board' && $splay_direction_from > 0) {\n $number_of_cards_in_pile = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(*)\n FROM\n card\n WHERE\n owner={owner_from} AND\n location='board' AND\n color={color}\n \",\n array('owner_from'=>$owner_from, 'color'=>$color)\n ));\n \n if ($number_of_cards_in_pile <= 1) {\n self::splay($owner_from, $color, 0); // Unsplay\n }\n }\n }\n }\n return $card;\n }", "protected function sortPlayers(Collection $players): Collection\n {\n $result = $temp = [];\n\n foreach ($players as $item) {\n if ($item->settings->position) {\n foreach (array_values(config('player.role_areas')) as $k => $v) {\n if (\n $item->settings->position->x >= $v['x'][0]\n && $item->settings->position->x <= $v['x'][1]\n && $item->settings->position->y >= $v['y'][0]\n && $item->settings->position->y <= $v['y'][1]\n ) {\n $temp[$k][] = $item;\n break;\n }\n }\n } else {\n $result[config('player.on_field_count') + $item->settings->reserve_index] = $item;\n }\n }\n\n foreach ($temp as &$item) {\n if (count($item) > 1) {\n usort($item, function ($a, $b) {\n if ($a->settings->position->y < $b->settings->position->y) {\n return 1;\n } elseif ($a->settings->position->y > $b->settings->position->y) {\n return -1;\n } else {\n if ($a->settings->position->x < $b->settings->position->x) {\n return -1;\n } elseif ($a->settings->position->x > $b->settings->position->x) {\n return 1;\n } else {\n return 0;\n }\n }\n });\n }\n }\n unset($item);\n\n ksort($temp);\n\n $i = 0;\n foreach ($temp as $item) {\n foreach ($item as $item1) {\n $result[$i] = $item1;\n $i++;\n }\n }\n\n ksort($result);\n\n return collect($result);\n }", "public function cards(): array\n {\n return [\n new SuggestedResourcesShortcuts,\n // new LatestRelease(),\n ];\n }", "public function players()\n {\n $game_ids = $this->match->games->lists('id');\n $map = array_search($this->id, $game_ids);\n if ($map === FALSE || !$this->match->rostersComplete()) return $this->match->players();\n $map = $map + 1;\n $rosters = $this->match->rosters;\n $players = new Illuminate\\Database\\Eloquent\\Collection;\n foreach ($rosters as $roster) {\n $entries = $roster->entries()->where('map', '=', $map);\n if ($entries->count() == 0) continue;\n $players->add($roster->entries()->where('map', '=', $map)->first()->player);\n }\n if ($players->count() == 0) return $this->match->players();\n return $players;\n }", "private function filters() {\n\n\n\t}", "public function index()\n {\n //\n $cards = Card::all();\n return $cards;\n }", "static function findPairs( $cards, $ignore_num = 0 ) {\n usort( $cards, array( \"poker\", \"card_cmp\" ) );\n $buffer = 0;\n $second_pair = 0;\n $last_number = 0;\n $no_of_pairs = 0;\n foreach ($cards as $card) {\n if ( $buffer == 0 ) {\n $buffer = $card->number;\n } else {\n if ( $card->number == $buffer && $card->number != $ignore_num ) {\n $buffer = 0;\n if ( $last_number > 0 ) {\n $second_pair = $last_number;\n }\n $last_number = $card->number;\n $no_of_pairs++;\n if ( $no_of_pairs >= 3 ) {\n $no_of_pairs = 2;\n break;\n }\n } else {\n $buffer = $card->number;\n }\n }\n }\n # two pairs, one pair, high card\n if ( $no_of_pairs == 2 ) {\n return array_merge( array( 200+($last_number?$last_number:$buffer), 200+$second_pair ), self::kicker( $cards, 1, array($last_number?$last_number:$buffer, $second_pair) ) );\n } elseif ( $no_of_pairs == 1 ) {\n return array_merge( array( 100+($last_number?$last_number:$buffer) ), self::kicker( $cards, 3, array($last_number?$last_number:$buffer) ) );\n }\n return array_merge( array( $last_number?$last_number:$buffer ), self::kicker( $cards, 4, array($last_number?$last_number:$buffer) ) );\n }", "abstract public function filters();", "public function all()\n {\n $cards = [];\n\n if (!$customer = $this->model->gatewayCustomer()) {\n return;\n }\n\n foreach ($this->model->payment_cards as $cardId) {\n $cards[] = new Card(\n $this->model,\n $customer->card($cardId),\n $customer->card($cardId)->info()\n );\n }\n\n return $cards;\n }", "function getCardsInLocation($owner, $location, $ordered_by_age=false, $ordered_by_color=false) {\n $cards = self::getOrCountCardsInLocation(false, $owner, $location, $ordered_by_age, $ordered_by_color);\n if ($ordered_by_age || $ordered_by_color) {\n foreach($cards as $key => &$card_list) {\n $card_list = self::attachTextualInfoToList($card_list);\n }\n }\n else {\n $cards = self::attachTextualInfoToList($cards);\n }\n return $cards;\n }", "public function orderCards()\n {\n if (!$this->ordered) {\n $this->originalCards = $this->cards;\n $tmpCardsConnector = $this->cardsConnector;\n if (count($tmpCardsConnector[BoardingCardEnum::DESTINATION]) > 1 ||\n count($tmpCardsConnector[BoardingCardEnum::FROM]) > 1\n ) {\n throw new BoardingCardBrokenChainException();\n }\n $this->cards = [];\n $fromCard = $destCard = $nextCard = '';\n\n //to get the keys for dest and from\n foreach ($tmpCardsConnector[BoardingCardEnum::FROM] as $fromKey => $nan) {\n $nextCard = $fromCard = $fromKey;\n }\n foreach ($tmpCardsConnector[BoardingCardEnum::DESTINATION] as $destkey => $nan) {\n $destCard = $destkey;\n }\n\n while (isset($tmpCardsConnector[$nextCard]) && $nextCard !== $destCard) {\n $currentCard = $nextCard;\n $cardToUnset = 0;\n\n foreach ($tmpCardsConnector[$currentCard] as $key => $tmpCard) {\n if ($tmpCard->getFrom() == $currentCard) {\n $cardToUnset = $key;\n }\n }\n $this->cards[] = $tmpCardsConnector[$currentCard][$cardToUnset];\n $nextCard = $tmpCardsConnector[$currentCard][$cardToUnset]->getDestination();\n unset($tmpCardsConnector[$currentCard][$cardToUnset]);\n if (count($tmpCardsConnector[$currentCard]) == 0) {\n unset($tmpCardsConnector[$currentCard]);\n }\n }\n\n $this->ordered = true;\n }\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }", "public function cards(Request $request)\n {\n return [];\n }" ]
[ "0.5852414", "0.5762747", "0.56054384", "0.56054384", "0.56054384", "0.5585194", "0.5581893", "0.55013627", "0.53831476", "0.53677714", "0.53554136", "0.5330214", "0.53244627", "0.52429116", "0.51671225", "0.5081764", "0.50734097", "0.50061387", "0.49812016", "0.49737656", "0.49147406", "0.48930874", "0.4883997", "0.48762402", "0.4871884", "0.48491588", "0.4819044", "0.48086995", "0.48057747", "0.4801927", "0.4769265", "0.47673917", "0.47558814", "0.47531", "0.47035837", "0.46968767", "0.46943977", "0.4691571", "0.46772724", "0.46582034", "0.46552292", "0.46522433", "0.4649653", "0.46445277", "0.46431506", "0.46393654", "0.4635504", "0.46235773", "0.46121433", "0.46023393", "0.45985454", "0.4575537", "0.45733407", "0.45643136", "0.4564003", "0.45582294", "0.4547021", "0.45441857", "0.45403296", "0.45354185", "0.4534988", "0.45340604", "0.45333198", "0.4526212", "0.4502885", "0.44985935", "0.44966123", "0.44926482", "0.44926482", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394", "0.44922394" ]
0.71140754
0
/ "$color$symbol" => "$color".
function cardColor($card) { if (($index = strpos($card, "-")) !== false) { return substr($card, 0, $index); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pl_hashify( $color ){\n\t\n\t$clean_hex = str_replace('#', '', $color);\n\t\n\treturn sprintf('#%s', $clean_hex);\n}", "protected static function _namedColor($color)\n {\n switch (strtolower($color)) {\n case 'aqua':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'black':\n $r = 0.0; $g = 0.0; $b = 0.0; break;\n case 'blue':\n $r = 0.0; $g = 0.0; $b = 1.0; break;\n case 'fuchsia':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'gray':\n $r = 0.502; $g = 0.502; $b = 0.502; break;\n case 'green':\n $r = 0.0; $g = 0.502; $b = 0.0; break;\n case 'lime':\n $r = 0.0; $g = 1.0; $b = 0.0; break;\n case 'maroon':\n $r = 0.502; $g = 0.0; $b = 0.0; break;\n case 'navy':\n $r = 0.0; $g = 0.0; $b = 0.502; break;\n case 'olive':\n $r = 0.502; $g = 0.502; $b = 0.0; break;\n case 'purple':\n $r = 0.502; $g = 0.0; $b = 0.502; break;\n case 'red':\n $r = 1.0; $g = 0.0; $b = 0.0; break;\n case 'silver':\n $r = 0.753; $g = 0.753; $b = 0.753; break;\n case 'teal':\n $r = 0.0; $g = 0.502; $b = 0.502; break;\n case 'white':\n $r = 1.0; $g = 1.0; $b = 1.0; break;\n case 'yellow':\n $r = 1.0; $g = 1.0; $b = 0.0; break;\n\n case 'aliceblue':\n $r = 0.941; $g = 0.973; $b = 1.0; break;\n case 'antiquewhite':\n $r = 0.980; $g = 0.922; $b = 0.843; break;\n case 'aquamarine':\n $r = 0.498; $g = 1.0; $b = 0.831; break;\n case 'azure':\n $r = 0.941; $g = 1.0; $b = 1.0; break;\n case 'beige':\n $r = 0.961; $g = 0.961; $b = 0.863; break;\n case 'bisque':\n $r = 1.0; $g = 0.894; $b = 0.769; break;\n case 'blanchedalmond':\n $r = 1.0; $g = 1.0; $b = 0.804; break;\n case 'blueviolet':\n $r = 0.541; $g = 0.169; $b = 0.886; break;\n case 'brown':\n $r = 0.647; $g = 0.165; $b = 0.165; break;\n case 'burlywood':\n $r = 0.871; $g = 0.722; $b = 0.529; break;\n case 'cadetblue':\n $r = 0.373; $g = 0.620; $b = 0.627; break;\n case 'chartreuse':\n $r = 0.498; $g = 1.0; $b = 0.0; break;\n case 'chocolate':\n $r = 0.824; $g = 0.412; $b = 0.118; break;\n case 'coral':\n $r = 1.0; $g = 0.498; $b = 0.314; break;\n case 'cornflowerblue':\n $r = 0.392; $g = 0.584; $b = 0.929; break;\n case 'cornsilk':\n $r = 1.0; $g = 0.973; $b = 0.863; break;\n case 'crimson':\n $r = 0.863; $g = 0.078; $b = 0.235; break;\n case 'cyan':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'darkblue':\n $r = 0.0; $g = 0.0; $b = 0.545; break;\n case 'darkcyan':\n $r = 0.0; $g = 0.545; $b = 0.545; break;\n case 'darkgoldenrod':\n $r = 0.722; $g = 0.525; $b = 0.043; break;\n case 'darkgray':\n $r = 0.663; $g = 0.663; $b = 0.663; break;\n case 'darkgreen':\n $r = 0.0; $g = 0.392; $b = 0.0; break;\n case 'darkkhaki':\n $r = 0.741; $g = 0.718; $b = 0.420; break;\n case 'darkmagenta':\n $r = 0.545; $g = 0.0; $b = 0.545; break;\n case 'darkolivegreen':\n $r = 0.333; $g = 0.420; $b = 0.184; break;\n case 'darkorange':\n $r = 1.0; $g = 0.549; $b = 0.0; break;\n case 'darkorchid':\n $r = 0.6; $g = 0.196; $b = 0.8; break;\n case 'darkred':\n $r = 0.545; $g = 0.0; $b = 0.0; break;\n case 'darksalmon':\n $r = 0.914; $g = 0.588; $b = 0.478; break;\n case 'darkseagreen':\n $r = 0.561; $g = 0.737; $b = 0.561; break;\n case 'darkslateblue':\n $r = 0.282; $g = 0.239; $b = 0.545; break;\n case 'darkslategray':\n $r = 0.184; $g = 0.310; $b = 0.310; break;\n case 'darkturquoise':\n $r = 0.0; $g = 0.808; $b = 0.820; break;\n case 'darkviolet':\n $r = 0.580; $g = 0.0; $b = 0.827; break;\n case 'deeppink':\n $r = 1.0; $g = 0.078; $b = 0.576; break;\n case 'deepskyblue':\n $r = 0.0; $g = 0.749; $b = 1.0; break;\n case 'dimgray':\n $r = 0.412; $g = 0.412; $b = 0.412; break;\n case 'dodgerblue':\n $r = 0.118; $g = 0.565; $b = 1.0; break;\n case 'firebrick':\n $r = 0.698; $g = 0.133; $b = 0.133; break;\n case 'floralwhite':\n $r = 1.0; $g = 0.980; $b = 0.941; break;\n case 'forestgreen':\n $r = 0.133; $g = 0.545; $b = 0.133; break;\n case 'gainsboro':\n $r = 0.863; $g = 0.863; $b = 0.863; break;\n case 'ghostwhite':\n $r = 0.973; $g = 0.973; $b = 1.0; break;\n case 'gold':\n $r = 1.0; $g = 0.843; $b = 0.0; break;\n case 'goldenrod':\n $r = 0.855; $g = 0.647; $b = 0.125; break;\n case 'greenyellow':\n $r = 0.678; $g = 1.0; $b = 0.184; break;\n case 'honeydew':\n $r = 0.941; $g = 1.0; $b = 0.941; break;\n case 'hotpink':\n $r = 1.0; $g = 0.412; $b = 0.706; break;\n case 'indianred':\n $r = 0.804; $g = 0.361; $b = 0.361; break;\n case 'indigo':\n $r = 0.294; $g = 0.0; $b = 0.510; break;\n case 'ivory':\n $r = 1.0; $g = 0.941; $b = 0.941; break;\n case 'khaki':\n $r = 0.941; $g = 0.902; $b = 0.549; break;\n case 'lavender':\n $r = 0.902; $g = 0.902; $b = 0.980; break;\n case 'lavenderblush':\n $r = 1.0; $g = 0.941; $b = 0.961; break;\n case 'lawngreen':\n $r = 0.486; $g = 0.988; $b = 0.0; break;\n case 'lemonchiffon':\n $r = 1.0; $g = 0.980; $b = 0.804; break;\n case 'lightblue':\n $r = 0.678; $g = 0.847; $b = 0.902; break;\n case 'lightcoral':\n $r = 0.941; $g = 0.502; $b = 0.502; break;\n case 'lightcyan':\n $r = 0.878; $g = 1.0; $b = 1.0; break;\n case 'lightgoldenrodyellow':\n $r = 0.980; $g = 0.980; $b = 0.824; break;\n case 'lightgreen':\n $r = 0.565; $g = 0.933; $b = 0.565; break;\n case 'lightgrey':\n $r = 0.827; $g = 0.827; $b = 0.827; break;\n case 'lightpink':\n $r = 1.0; $g = 0.714; $b = 0.757; break;\n case 'lightsalmon':\n $r = 1.0; $g = 0.627; $b = 0.478; break;\n case 'lightseagreen':\n $r = 0.125; $g = 0.698; $b = 0.667; break;\n case 'lightskyblue':\n $r = 0.529; $g = 0.808; $b = 0.980; break;\n case 'lightslategray':\n $r = 0.467; $g = 0.533; $b = 0.6; break;\n case 'lightsteelblue':\n $r = 0.690; $g = 0.769; $b = 0.871; break;\n case 'lightyellow':\n $r = 1.0; $g = 1.0; $b = 0.878; break;\n case 'limegreen':\n $r = 0.196; $g = 0.804; $b = 0.196; break;\n case 'linen':\n $r = 0.980; $g = 0.941; $b = 0.902; break;\n case 'magenta':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'mediumaquamarine':\n $r = 0.4; $g = 0.804; $b = 0.667; break;\n case 'mediumblue':\n $r = 0.0; $g = 0.0; $b = 0.804; break;\n case 'mediumorchid':\n $r = 0.729; $g = 0.333; $b = 0.827; break;\n case 'mediumpurple':\n $r = 0.576; $g = 0.439; $b = 0.859; break;\n case 'mediumseagreen':\n $r = 0.235; $g = 0.702; $b = 0.443; break;\n case 'mediumslateblue':\n $r = 0.482; $g = 0.408; $b = 0.933; break;\n case 'mediumspringgreen':\n $r = 0.0; $g = 0.980; $b = 0.604; break;\n case 'mediumturquoise':\n $r = 0.282; $g = 0.820; $b = 0.8; break;\n case 'mediumvioletred':\n $r = 0.780; $g = 0.082; $b = 0.522; break;\n case 'midnightblue':\n $r = 0.098; $g = 0.098; $b = 0.439; break;\n case 'mintcream':\n $r = 0.961; $g = 1.0; $b = 0.980; break;\n case 'mistyrose':\n $r = 1.0; $g = 0.894; $b = 0.882; break;\n case 'moccasin':\n $r = 1.0; $g = 0.894; $b = 0.710; break;\n case 'navajowhite':\n $r = 1.0; $g = 0.871; $b = 0.678; break;\n case 'oldlace':\n $r = 0.992; $g = 0.961; $b = 0.902; break;\n case 'olivedrab':\n $r = 0.420; $g = 0.557; $b = 0.137; break;\n case 'orange':\n $r = 1.0; $g = 0.647; $b = 0.0; break;\n case 'orangered':\n $r = 1.0; $g = 0.271; $b = 0.0; break;\n case 'orchid':\n $r = 0.855; $g = 0.439; $b = 0.839; break;\n case 'palegoldenrod':\n $r = 0.933; $g = 0.910; $b = 0.667; break;\n case 'palegreen':\n $r = 0.596; $g = 0.984; $b = 0.596; break;\n case 'paleturquoise':\n $r = 0.686; $g = 0.933; $b = 0.933; break;\n case 'palevioletred':\n $r = 0.859; $g = 0.439; $b = 0.576; break;\n case 'papayawhip':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peachpuff':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peru':\n $r = 0.804; $g = 0.522; $b = 0.247; break;\n case 'pink':\n $r = 1.0; $g = 0.753; $b = 0.796; break;\n case 'plum':\n $r = 0.867; $g = 0.627; $b = 0.867; break;\n case 'powderblue':\n $r = 0.690; $g = 0.878; $b = 0.902; break;\n case 'rosybrown':\n $r = 0.737; $g = 0.561; $b = 0.561; break;\n case 'royalblue':\n $r = 0.255; $g = 0.412; $b = 0.882; break;\n case 'saddlebrown':\n $r = 0.545; $g = 0.271; $b = 0.075; break;\n case 'salmon':\n $r = 0.980; $g = 0.502; $b = 0.447; break;\n case 'sandybrown':\n $r = 0.957; $g = 0.643; $b = 0.376; break;\n case 'seagreen':\n $r = 0.180; $g = 0.545; $b = 0.341; break;\n case 'seashell':\n $r = 1.0; $g = 0.961; $b = 0.933; break;\n case 'sienna':\n $r = 0.627; $g = 0.322; $b = 0.176; break;\n case 'skyblue':\n $r = 0.529; $g = 0.808; $b = 0.922; break;\n case 'slateblue':\n $r = 0.416; $g = 0.353; $b = 0.804; break;\n case 'slategray':\n $r = 0.439; $g = 0.502; $b = 0.565; break;\n case 'snow':\n $r = 1.0; $g = 0.980; $b = 0.980; break;\n case 'springgreen':\n $r = 0.0; $g = 1.0; $b = 0.498; break;\n case 'steelblue':\n $r = 0.275; $g = 0.510; $b = 0.706; break;\n case 'tan':\n $r = 0.824; $g = 0.706; $b = 0.549; break;\n case 'thistle':\n $r = 0.847; $g = 0.749; $b = 0.847; break;\n case 'tomato':\n $r = 0.992; $g = 0.388; $b = 0.278; break;\n case 'turquoise':\n $r = 0.251; $g = 0.878; $b = 0.816; break;\n case 'violet':\n $r = 0.933; $g = 0.510; $b = 0.933; break;\n case 'wheat':\n $r = 0.961; $g = 0.871; $b = 0.702; break;\n case 'whitesmoke':\n $r = 0.961; $g = 0.961; $b = 0.961; break;\n case 'yellowgreen':\n $r = 0.604; $g = 0.804; $b = 0.196; break;\n default:\n return null;\n }\n return array('r' => $r * 255, 'g' => $g * 255, 'b' => $b * 255);\n }", "function rest_parse_hex_color($color)\n {\n }", "function hex2color($str) {\n $color = hex2bin(ltrim($str, '$'));\n return ($str[0] === '$' ? unpack('V', \"$color\\0\") : unpack('N', \"\\0$color\"))[1];\n}", "function sanitize_hex_color($color)\n {\n }", "public static function color($color = NULL, $s = NULL)\n\t{\n\t\tstatic $colors = array(\n\t\t\t'black' => '0;30', 'gray' => '1;30', 'silver' => '0;37', 'white' => '1;37',\n\t\t\t'navy' => '0;34', 'blue' => '1;34', 'green' => '0;32', 'lime' => '1;32',\n\t\t\t'teal' => '0;36', 'aqua' => '1;36', 'maroon' => '0;31', 'red' => '1;31',\n\t\t\t'purple' => '0;35', 'fuchsia' => '1;35', 'olive' => '0;33', 'yellow' => '1;33',\n\t\t\tNULL => '0',\n\t\t);\n\t\t$c = explode('/', $color ?: '');\n\t\treturn \"\\033[\"\n\t\t\t. str_replace(';', \"m\\033[\", $colors[$c[0]] . (empty($c[1]) ? '' : ';4' . substr($colors[$c[1]], -1)))\n\t\t\t. 'm' . $s . ($s === NULL ? '' : \"\\033[0m\");\n\t}", "function maybe_hash_hex_color($color)\n {\n }", "function image_hex_color($color)\n{\n $c = strtoupper($color);\n if (strpos($c, '#') !== 0) {\n $c = '#'.$c;\n }\n if (!preg_match('/^#([A-F0-9]{3}){1,2}$/', $c)) {\n err('invalid hex color '.$color);\n }\n return $c;\n\n}", "public function howToColor($color)\n {\n }", "function vColor( $color )\r\n\t\t{\r\n\t\t\t#CCC\r\n\t\t\t#CCCCC\r\n\t\t\t#FFFFF\r\n\t\t\treturn preg_match( '/^#(?:(?:[a-f0-9]{3}){1,2})$/i', $color );\r\n\t\t\t\r\n\t\t}", "function boja($color)\n{\n $text = 'Neki tekst';\n echo \"<p style='color:$color'>$text</p>\";\n \n}", "public function getColor(): string;", "function getColorInClear($color) {\n switch($color) {\n case 0:\n return clienttranslate('blue');\n case 1:\n return clienttranslate('red');\n case 2:\n return clienttranslate('green');\n case 3:\n return clienttranslate('yellow');\n case 4:\n return clienttranslate('purple');\n }\n }", "function sanitize_hex_color_no_hash($color)\n {\n }", "function cli_color($string, $color = null) {\n $colors = [\n 'default' => '39',\n 'black' => '30',\n 'red' => '31',\n 'green' => '32',\n 'yellow' => '33',\n 'blue' => '34',\n 'magenta' => '35',\n 'cyan' => '36',\n 'light_gray' => '37',\n 'dark_gray' => '90',\n 'light_red' => '91',\n 'light_green' => '92',\n 'light_yellow' => '93',\n 'light_blue' => '94',\n 'light_magenta' => '95',\n 'light_cyan' => '96',\n 'white' => '97',\n ];\n\n if ($color === null or ! array_has($colors, $color)) {\n return $string;\n } else {\n $color = $colors[$color];\n }\n\n return s(\"\\033[%sm%s\\033[0m\", $color, $string);\n }", "public function useColor($name);", "public function process_colors( $string ){\n\t\t$string = self::utils()->replace_commented_style_with_variable( $string );\n\t\treturn $this->convert_variables_to_color( $string );\n\t}", "function pl_link_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'linkcolor' ) ) ) ? pl_hash_strip( ploption( 'linkcolor' ) ) : '225E9B';\n\t\n\treturn $color;\t\n}", "function c_back($str){\n $str = \"<font color=$str[1]>$str[2]</font>\";\n return $str;\n}", "public static function term_color($text, $color = \"NORMAL\")\n\t\t{\n\t\t\t$text = self::term_remove_color($text);\n\t\t\t$out = self::$term_colors[$color];\n\t\t\t$out == \"\" && $out = \"[0m\";\n\n\t\t\treturn chr(27).$out.$text.chr(27).\"[0m\";\n\t\t}", "function pl_text_color(){\n\t\t\n\t$color = ( pl_check_color_hash( ploption( 'text_primary' ) ) ) ? pl_hash_strip( ploption( 'text_primary' ) ) : '000000';\n\n\treturn $color;\n}", "public function addcolor($name, $addcolor){\n\t\t// Check whether the information is valid //\n\t\tif (preg_match('/#([a-fA-F0-9]{3}){1,2}\\b/', $addcolor) && preg_match(\"/^[a-zA-Z]+$/\", $name)) {\n\t\t\t// new array //\n\t\t\t$tmpcolor = array(''. $name .'' => ''. $addcolor .'');\n\t\t\t// merge temp array in array color //\n\t\t\t$this->_color = array_merge($tmpcolor, $this->_color);\n\t\t}else{throw new Exception('hexadecimal code Invalid : http://www.w3schools.com/tags/ref_colorpicker.asp or the name must contain only character'); die();}\n\t}", "public static function colorPrint($color, $text) {\n print $color . $text . self::WHITE . \"\\n\";\n }", "public function parse_colors($text) {\r\n\t\r\n\t\t# Clear garbage\r\n\t\t$text = preg_replace('/[^\\r\\n\\t\\x20-\\x7E\\xA0-\\xFF]/', '', trim($text));\r\n\t\t\r\n\t\t# load first set..\r\n\t\t$switch = 1;\r\n\t\r\n\t\t# Check if there's a color..\r\n\t\tif (substr_count($text, '^')>0) {\r\n\t\t\r\n\t\t $clr = array ( // colors\r\n\t \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", \"\\\"#E8FF19\\\"\", // 1\r\n\t \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", \"\\\"#FFFFFF\\\"\", // 2\r\n\t \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#EB9F53\\\"\", \"\\\"#106F59\\\"\", // 3\r\n\t \"\\\"#5A134F\\\"\", \"\\\"#035AFF\\\"\", \"\\\"#681EA7\\\"\", \"\\\"#5097C1\\\"\", // 4\r\n\t \"\\\"#BEDAC4\\\"\", \"\\\"#024D2C\\\"\", \"\\\"#7D081B\\\"\", \"\\\"#90243E\\\"\", // 5\r\n\t \"\\\"#743313\\\"\", \"\\\"#A7905E\\\"\", \"\\\"#555C26\\\"\", \"\\\"#AEAC97\\\"\", // 6\r\n\t \"\\\"#C0BF7F\\\"\", \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", // 7\r\n\t \"\\\"#E8FF19\\\"\", \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", // 8\r\n\t \"\\\"#FFFFFF\\\"\", \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#CC8034\\\"\", // 9\r\n\t \"\\\"#DBDF70\\\"\", \"\\\"#BBBBBB\\\"\", \"\\\"#747228\\\"\", \"\\\"#993400\\\"\", // 10\r\n\t \"\\\"#670504\\\"\", \"\\\"#623307\\\"\" // 11\r\n );\r\n\r\n\t if ($switch == 1)\r\n\t { // colored string\r\n\t $search = array (\r\n\t \"/\\^0/\", \"/\\^1/\", \"/\\^2/\", \"/\\^3/\", // 1\r\n\t \"/\\^4/\", \"/\\^5/\", \"/\\^6/\", \"/\\^7/\", // 2\r\n\t \"/\\^8/\", \"/\\^9/\", \"/\\^a/\", \"/\\^b/\", // 3\r\n\t \"/\\^c/\", \"/\\^d/\", \"/\\^e/\", \"/\\^f/\", // 4\r\n\t \"/\\^g/\", \"/\\^h/\", \"/\\^i/\", \"/\\^j/\", // 5\r\n\t \"/\\^k/\", \"/\\^l/\", \"/\\^m/\", \"/\\^n/\", // 6\r\n\t \"/\\^o/\", \"/\\^p/\", \"/\\^q/\", \"/\\^r/\", // 7\r\n\t \"/\\^s/\", \"/\\^t/\", \"/\\^u/\", \"/\\^v/\", // 8\r\n\t \"/\\^w/\", \"/\\^x/\", \"/\\^y/\", \"/\\^z/\", // 9\r\n\t \"/\\^\\//\", \"/\\^\\*/\", \"/\\^\\-/\", \"/\\^\\+/\", // 10\r\n\t \"/\\^\\?/\", \"/\\^\\@/\", \"/\\^</\", \"/\\^>/\", // 11\r\n\t \"/\\^\\&/\", \"/\\^\\)/\", \"/\\^\\(/\", \"/\\^[A-Z]/\", // 12\r\n\t \"/\\^\\_/\", // 14\r\n\t \"/&</\", \"/^(.*?)<\\/font>/\" // 15\r\n\t );\r\n\t\r\n\t $replace = array (\r\n\t \"&<font color=$clr[0]>\", \"&<font color=$clr[1]>\", // 1\r\n\t \"&<font color=$clr[2]>\", \"&<font color=$clr[3]>\", // 2\r\n\t \"&<font color=$clr[4]>\", \"&<font color=$clr[5]>\", // 3\r\n\t \"&<font color=$clr[6]>\", \"&<font color=$clr[7]>\", // 4\r\n\t \"&<font color=$clr[8]>\", \"&<font color=$clr[9]>\", // 5\r\n\t \"&<font color=$clr[10]>\", \"&<font color=$clr[11]>\", // 6\r\n\t \"&<font color=$clr[12]>\", \"&<font color=$clr[13]>\", // 7\r\n\t \"&<font color=$clr[14]>\", \"&<font color=$clr[15]>\", // 8\r\n\t \"&<font color=$clr[16]>\", \"&<font color=$clr[17]>\", // 9\r\n\t \"&<font color=$clr[18]>\", \"&<font color=$clr[19]>\", // 10\r\n\t \"&<font color=$clr[20]>\", \"&<font color=$clr[21]>\", // 11\r\n\t \"&<font color=$clr[22]>\", \"&<font color=$clr[23]>\", // 12\r\n\t \"&<font color=$clr[24]>\", \"&<font color=$clr[25]>\", // 13\r\n\t \"&<font color=$clr[26]>\", \"&<font color=$clr[27]>\", // 14\r\n\t \"&<font color=$clr[28]>\", \"&<font color=$clr[29]>\", // 15\r\n\t \"&<font color=$clr[30]>\", \"&<font color=$clr[31]>\", // 16\r\n\t \"&<font color=$clr[32]>\", \"&<font color=$clr[33]>\", // 17\r\n\t \"&<font color=$clr[34]>\", \"&<font color=$clr[35]>\", // 18\r\n\t \"&<font color=$clr[36]>\", \"&<font color=$clr[37]>\", // 19\r\n\t \"&<font color=$clr[38]>\", \"&<font color=$clr[39]>\", // 20\r\n\t \"&<font color=$clr[40]>\", \"&<font color=$clr[41]>\", // 21\r\n\t \"\", \"\", \"\", \"\", \"\", \"\", // 22\r\n\t \"\", \"</font><\", \"\\$1\" // 23\r\n\t );\r\n\t\r\n\t $ctext = preg_replace($search, $replace, $text);\r\n\t\r\n\t if ($ctext != $text)\r\n\t {\r\n\t $ctext = preg_replace(\"/$/\", \"</font>\", $ctext);\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t elseif ($switch == 2)\r\n\t { // colored numbers\r\n\t if ($text <= 39)\r\n\t {\r\n\t $ctext = \"<font color=$clr[7]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 69)\r\n\t {\r\n\t $ctext = \"<font color=$clr[5]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 129)\r\n\t {\r\n\t $ctext = \"<font color=$clr[8]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 399)\r\n\t {\r\n\t $ctext = \"<font color=$clr[9]>$text</font>\";\r\n\t }\r\n\t else\r\n\t {\r\n\t $ctext = \"<font color=$clr[1]>$text</font>\";\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t\t}\r\n\t\t# no color so just return ..\r\n\t\telse {\r\n\t\t\treturn trim($text);\r\n\t\t} \r\n\t}", "function red($text){\r\n return \"<b><font color=red>\".$text.\"</font></b>\";\r\n}", "function tfColor($string, $tf) {\n if ( $tf ) {\n $colorout = \"<font color=\\\"#00aa00\\\">$string</font>\";\n } else {\n $colorout = \"<font color=\\\"#880000\\\">$string</font>\";\n }\n return $colorout;\n}", "public function getColor(): string\n {\n }", "function tc_sanitize_hex_color( $color ) {\r\n if ( $unhashed = sanitize_hex_color_no_hash( $color ) )\r\n return '#' . $unhashed;\r\n\r\n return $color;\r\n }", "private function findColor($color, $final = false)\n {\n if (!is_string($color)) {\n return $color;\n }\n\n $color = strtoupper(str_replace(' ', '_', $color));\n\n if (isset($this->colors[$color])) {\n return $this->colors[$color];\n }\n\n if ($final === true) {\n return null;\n }\n\n preg_match('/(_DARK|_LIGHT|_BRIGHT)$/', $color, $suffix);\n preg_match('/^(DARK|LIGHT|BRIGHT)_./U', $color, $prefix);\n preg_match('/[0-9]$/', $color, $numberSuffix);\n\n if ($suffix) {\n return $this->findColor($color . '_1');\n } elseif ($prefix) {\n preg_match('/[0-9]$/', $prefix[0], $number);\n\n if ($number) {\n $color = str_replace($prefix[0], '', $color);\n $color = $color . '_' . $prefix[0];\n } else {\n $suffix = substr($prefix[0], 0, strlen($prefix[0]) - 1);\n $color = str_replace($suffix, '', $color);\n $color = $color . '_' . $suffix . '1';\n }\n\n return $this->findColor(ltrim($color, '_'));\n } elseif ($numberSuffix) {\n $color = str_replace($numberSuffix[0], '', $color);\n\n if (substr($color, -1, 1) !== '_') {\n $color = $color . '_' . $numberSuffix[0];\n } elseif ((int)$numberSuffix[0] > 1) {\n $number = (int)$numberSuffix[0] - 1;\n $color = $color . (string)$number;\n }\n\n return $this->findColor($color);\n } else {\n $color = preg_replace('/[0-9]|DARK|LIGHT|_/', '', $color);\n return $this->findColor($color, true);\n }\n }", "public function convert_variables_to_color( $string ){\n\t\t$theme_colors = !empty(self::$_theme_colors->colors) ? self::$_theme_colors->colors : array();\n\n\t\tfor( $i = 0; $i < self::$_theme_color_count ; $i++ ){\n\t\t\t$string = str_replace(\"#\" . self::VAR_PREFIX . $i, $theme_colors[$i]->color , $string );\n\t\t}\n\n\t\treturn $string;\n\t}", "public static function sanitize_hex( $color = '#FFFFFF', $hash = true ) {\n\t\t\t$word_colors = array(\n\t\t\t\t'aliceblue' => 'F0F8FF',\n\t\t\t\t'antiquewhite' => 'FAEBD7',\n\t\t\t\t'aqua' => '00FFFF',\n\t\t\t\t'aquamarine' => '7FFFD4',\n\t\t\t\t'azure' => 'F0FFFF',\n\t\t\t\t'beige' => 'F5F5DC',\n\t\t\t\t'bisque' => 'FFE4C4',\n\t\t\t\t'black' => '000000',\n\t\t\t\t'blanchedalmond' => 'FFEBCD',\n\t\t\t\t'blue' => '0000FF',\n\t\t\t\t'blueviolet' => '8A2BE2',\n\t\t\t\t'brown' => 'A52A2A',\n\t\t\t\t'burlywood' => 'DEB887',\n\t\t\t\t'cadetblue' => '5F9EA0',\n\t\t\t\t'chartreuse' => '7FFF00',\n\t\t\t\t'chocolate' => 'D2691E',\n\t\t\t\t'coral' => 'FF7F50',\n\t\t\t\t'cornflowerblue' => '6495ED',\n\t\t\t\t'cornsilk' => 'FFF8DC',\n\t\t\t\t'crimson' => 'DC143C',\n\t\t\t\t'cyan' => '00FFFF',\n\t\t\t\t'darkblue' => '00008B',\n\t\t\t\t'darkcyan' => '008B8B',\n\t\t\t\t'darkgoldenrod' => 'B8860B',\n\t\t\t\t'darkgray' => 'A9A9A9',\n\t\t\t\t'darkgreen' => '006400',\n\t\t\t\t'darkgrey' => 'A9A9A9',\n\t\t\t\t'darkkhaki' => 'BDB76B',\n\t\t\t\t'darkmagenta' => '8B008B',\n\t\t\t\t'darkolivegreen' => '556B2F',\n\t\t\t\t'darkorange' => 'FF8C00',\n\t\t\t\t'darkorchid' => '9932CC',\n\t\t\t\t'darkred' => '8B0000',\n\t\t\t\t'darksalmon' => 'E9967A',\n\t\t\t\t'darkseagreen' => '8FBC8F',\n\t\t\t\t'darkslateblue' => '483D8B',\n\t\t\t\t'darkslategray' => '2F4F4F',\n\t\t\t\t'darkslategrey' => '2F4F4F',\n\t\t\t\t'darkturquoise' => '00CED1',\n\t\t\t\t'darkviolet' => '9400D3',\n\t\t\t\t'deeppink' => 'FF1493',\n\t\t\t\t'deepskyblue' => '00BFFF',\n\t\t\t\t'dimgray' => '696969',\n\t\t\t\t'dimgrey' => '696969',\n\t\t\t\t'dodgerblue' => '1E90FF',\n\t\t\t\t'firebrick' => 'B22222',\n\t\t\t\t'floralwhite' => 'FFFAF0',\n\t\t\t\t'forestgreen' => '228B22',\n\t\t\t\t'fuchsia' => 'FF00FF',\n\t\t\t\t'gainsboro' => 'DCDCDC',\n\t\t\t\t'ghostwhite' => 'F8F8FF',\n\t\t\t\t'gold' => 'FFD700',\n\t\t\t\t'goldenrod' => 'DAA520',\n\t\t\t\t'gray' => '808080',\n\t\t\t\t'green' => '008000',\n\t\t\t\t'greenyellow' => 'ADFF2F',\n\t\t\t\t'grey' => '808080',\n\t\t\t\t'honeydew' => 'F0FFF0',\n\t\t\t\t'hotpink' => 'FF69B4',\n\t\t\t\t'indianred' => 'CD5C5C',\n\t\t\t\t'indigo' => '4B0082',\n\t\t\t\t'ivory' => 'FFFFF0',\n\t\t\t\t'khaki' => 'F0E68C',\n\t\t\t\t'lavender' => 'E6E6FA',\n\t\t\t\t'lavenderblush' => 'FFF0F5',\n\t\t\t\t'lawngreen' => '7CFC00',\n\t\t\t\t'lemonchiffon' => 'FFFACD',\n\t\t\t\t'lightblue' => 'ADD8E6',\n\t\t\t\t'lightcoral' => 'F08080',\n\t\t\t\t'lightcyan' => 'E0FFFF',\n\t\t\t\t'lightgoldenrodyellow' => 'FAFAD2',\n\t\t\t\t'lightgray' => 'D3D3D3',\n\t\t\t\t'lightgreen' => '90EE90',\n\t\t\t\t'lightgrey' => 'D3D3D3',\n\t\t\t\t'lightpink' => 'FFB6C1',\n\t\t\t\t'lightsalmon' => 'FFA07A',\n\t\t\t\t'lightseagreen' => '20B2AA',\n\t\t\t\t'lightskyblue' => '87CEFA',\n\t\t\t\t'lightslategray' => '778899',\n\t\t\t\t'lightslategrey' => '778899',\n\t\t\t\t'lightsteelblue' => 'B0C4DE',\n\t\t\t\t'lightyellow' => 'FFFFE0',\n\t\t\t\t'lime' => '00FF00',\n\t\t\t\t'limegreen' => '32CD32',\n\t\t\t\t'linen' => 'FAF0E6',\n\t\t\t\t'magenta' => 'FF00FF',\n\t\t\t\t'maroon' => '800000',\n\t\t\t\t'mediumaquamarine' => '66CDAA',\n\t\t\t\t'mediumblue' => '0000CD',\n\t\t\t\t'mediumorchid' => 'BA55D3',\n\t\t\t\t'mediumpurple' => '9370D0',\n\t\t\t\t'mediumseagreen' => '3CB371',\n\t\t\t\t'mediumslateblue' => '7B68EE',\n\t\t\t\t'mediumspringgreen' => '00FA9A',\n\t\t\t\t'mediumturquoise' => '48D1CC',\n\t\t\t\t'mediumvioletred' => 'C71585',\n\t\t\t\t'midnightblue' => '191970',\n\t\t\t\t'mintcream' => 'F5FFFA',\n\t\t\t\t'mistyrose' => 'FFE4E1',\n\t\t\t\t'moccasin' => 'FFE4B5',\n\t\t\t\t'navajowhite' => 'FFDEAD',\n\t\t\t\t'navy' => '000080',\n\t\t\t\t'oldlace' => 'FDF5E6',\n\t\t\t\t'olive' => '808000',\n\t\t\t\t'olivedrab' => '6B8E23',\n\t\t\t\t'orange' => 'FFA500',\n\t\t\t\t'orangered' => 'FF4500',\n\t\t\t\t'orchid' => 'DA70D6',\n\t\t\t\t'palegoldenrod' => 'EEE8AA',\n\t\t\t\t'palegreen' => '98FB98',\n\t\t\t\t'paleturquoise' => 'AFEEEE',\n\t\t\t\t'palevioletred' => 'DB7093',\n\t\t\t\t'papayawhip' => 'FFEFD5',\n\t\t\t\t'peachpuff' => 'FFDAB9',\n\t\t\t\t'peru' => 'CD853F',\n\t\t\t\t'pink' => 'FFC0CB',\n\t\t\t\t'plum' => 'DDA0DD',\n\t\t\t\t'powderblue' => 'B0E0E6',\n\t\t\t\t'purple' => '800080',\n\t\t\t\t'red' => 'FF0000',\n\t\t\t\t'rosybrown' => 'BC8F8F',\n\t\t\t\t'royalblue' => '4169E1',\n\t\t\t\t'saddlebrown' => '8B4513',\n\t\t\t\t'salmon' => 'FA8072',\n\t\t\t\t'sandybrown' => 'F4A460',\n\t\t\t\t'seagreen' => '2E8B57',\n\t\t\t\t'seashell' => 'FFF5EE',\n\t\t\t\t'sienna' => 'A0522D',\n\t\t\t\t'silver' => 'C0C0C0',\n\t\t\t\t'skyblue' => '87CEEB',\n\t\t\t\t'slateblue' => '6A5ACD',\n\t\t\t\t'slategray' => '708090',\n\t\t\t\t'slategrey' => '708090',\n\t\t\t\t'snow' => 'FFFAFA',\n\t\t\t\t'springgreen' => '00FF7F',\n\t\t\t\t'steelblue' => '4682B4',\n\t\t\t\t'tan' => 'D2B48C',\n\t\t\t\t'teal' => '008080',\n\t\t\t\t'thistle' => 'D8BFD8',\n\t\t\t\t'tomato' => 'FF6347',\n\t\t\t\t'turquoise' => '40E0D0',\n\t\t\t\t'violet' => 'EE82EE',\n\t\t\t\t'wheat' => 'F5DEB3',\n\t\t\t\t'white' => 'FFFFFF',\n\t\t\t\t'whitesmoke' => 'F5F5F5',\n\t\t\t\t'yellow' => 'FFFF00',\n\t\t\t\t'yellowgreen' => '9ACD32',\n\t\t\t);\n\n\t\t\tif ( is_array( $color ) ) {\n\t\t\t\t$color = $color[0];\n\t\t\t}\n\n\t\t\t// Remove any spaces and special characters before and after the string.\n\t\t\t$color = trim( $color );\n\n\t\t\t// Check if the color is a standard word-color.\n\t\t\t// If it is, then convert to hex.\n\t\t\tif ( array_key_exists( $color, $word_colors ) ) {\n\t\t\t\t$color = $word_colors[ $color ];\n\t\t\t}\n\n\t\t\t// Remove any trailing '#' symbols from the color value.\n\t\t\t$color = str_replace( '#', '', $color );\n\n\t\t\t// If the string is 6 characters long then use it in pairs.\n\t\t\tif ( 3 === strlen( $color ) ) {\n\t\t\t\t$color = substr( $color, 0, 1 ) . substr( $color, 0, 1 ) . substr( $color, 1, 1 ) . substr( $color, 1, 1 ) . substr( $color, 2, 1 ) . substr( $color, 2, 1 );\n\t\t\t}\n\n\t\t\t$substr = array();\n\t\t\tfor ( $i = 0; $i <= 5; $i ++ ) {\n\t\t\t\t$default = ( 0 === $i ) ? 'F' : ( $substr[ $i - 1 ] );\n\t\t\t\t$substr[ $i ] = substr( $color, $i, 1 );\n\t\t\t\t$substr[ $i ] = ( false === $substr[ $i ] || ! ctype_xdigit( $substr[ $i ] ) ) ? $default : $substr[ $i ];\n\t\t\t}\n\n\t\t\t$hex = implode( '', $substr );\n\n\t\t\treturn ( ! $hash ) ? $hex : '#' . $hex;\n\t\t}", "public function getColor()\n {\n return\"Yellow\";\n }", "function pl_header_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'headercolor' ) ) ) ? pl_hash_strip( ploption( 'headercolor' ) ) : '000000';\n\t\n\treturn $color;\t\n}", "function verify_color( $input ) {\n\t\t\t$input = trim( $color, '#' );\n\t\t\t//make hex-like for is_numeric test\n\t\t\t$test = \"0x$input\";\n\t\t\tif ( ! is_numeric( $test ) )\n\t\t\t\treturn 'transparent';\n\t\t\treturn \"#$input\";\n\t\t}", "public function blue($text): string;", "public function color(array $color);", "function cli_highlight($string, $color = null) {\n $colors = [\n 'default' => '49',\n 'black' => '40',\n 'red' => '41',\n 'green' => '42',\n 'yellow' => '43',\n 'blue' => '44',\n 'magenta' => '45',\n 'cyan' => '46',\n 'light_gray' => '47',\n 'dark_gray' => '100',\n 'light_red' => '101',\n 'light_green' => '102',\n 'light_yellow' => '103',\n 'light_blue' => '104',\n 'light_magenta' => '105',\n 'light_cyan' => '106',\n 'white' => '107',\n ];\n\n if ($color === null or ! array_has($colors, $color)) {\n return $string;\n } else {\n $color = $colors[$color];\n }\n\n return s(\"\\033[%sm%s\\033[0m\", $color, $string);\n }", "function setColor( $c ) {\n $this->currentColor = $c;\n}", "public function getColor() {}", "public function getColor() {}", "function checkColor($missValide) {\n if($missValide == 'Validée ✅') {\n return $background = '#2ecc71';\n } else {\n return $background = '#f39c12';\n }\n}", "function displaySymbol($randomValue, $pos){\n \n \n switch($randomValue){\n case 0: $symbol = \"seven\";\n break;\n case 1: $symbol = \"cherry\";\n break;\n case 2: $symbol = \"lemon\";\n break;\n case 3: $symbol = \"grapes\";\n \n }\n \n echo \"<img id = 'reel$pos' src = 'img/$symbol.png' alt = '$symbol' title ='\".ucfirst($symbol). \"' width = '70' >\";\n }", "public function color()\n {\n }", "public function getColorName()\n {\n return $this->color_name;\n }", "public function testToHexWithSpaceSeparatedParameter()\n {\n $colors = new Jervenclark\\Colors\\Colors;\n $this->assertTrue($colors->toHex('iv o ry') == 'FFFFF0');\n unset($colors);\n }", "protected function _fgColor($color, $string)\n {\n return \"\\033[\" . $this->_colors['foreground'][$color] . \"m\" . $string . \"\\033[0m\";\n }", "function NombreCursoColor($varcursocolor)\n{\n\tif ($varcursocolor == 1) return \"linear-gradient(\n to right bottom, \n rgba(54, 227, 250, 0.589),\n rgba(36, 154, 250, 0.795)\n )\";\n\tif ($varcursocolor == 2) return \"linear-gradient(\n to right bottom, \n rgba(1, 152, 252, 0.363),\n rgba(0, 80, 126, 0.534)\n\t)\";\n\tif ($varcursocolor == 3) return \"linear-gradient(\n to right bottom,\n rgba(250, 184, 60, 0.849),\n rgba(253, 151, 18, 0.63)\n\t)\";\n\tif ($varcursocolor == 4) return \"linear-gradient(\n to right bottom,\n rgba(250, 145, 60, 0.849),\n rgba(252, 64, 6, 0.63)\n )\";\n\tif ($varcursocolor == 5) return \"linear-gradient(\n to right bottom,\n rgba(248, 150, 121, 0.795),\n rgba(250, 91, 52, 0.774)\n )\";\n\tif ($varcursocolor == 6) return \"linear-gradient(\n to right bottom,\n rgba(165, 61, 1, 0.795),\n rgba(71, 32, 1, 0.774)\n )\";\n\tif ($varcursocolor == 7) return \"linear-gradient(\n to right bottom, \n rgba(76, 1, 252, 0.363),\n rgba(38, 0, 126, 0.534)\n )\";\n}", "function _h_jetpack_share_add_color($title, $share) {\n $slug = $share->shortname;\n\n if ($slug === 'jetpack-whatsapp') {\n $slug = 'whatsapp';\n }\n\n if ($slug === 'print') {\n return $title;\n }\n\n $social = H::get_social_icon($slug);\n $color = $social['color'];\n\n return \"$title\\\" style=\\\"--color: $color;\";\n}", "function onStandard($str) {\n return colorize($str)->onStandard();\n}", "static function parseColor($color) {\n if ($color > 0) {\n return sprintf(\"#%06X\", 0xFFFFFF & $color);\n }\n\n return null;\n }", "public function colour();", "public function red($text): string;", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "public function red($str)\n {\n return \"\\033[0;31m$str\\033[0m\";\n }", "function debug_colorize_string($string)\r\r\n{\r\r\n\t/* turn array indexes to red */\r\r\n\r\r\n\t$string = str_replace('[','[<font color=\"red\">',$string);\r\r\n\t$string = str_replace(']','</font>]',$string);\r\r\n\r\r\n\t/* turn the word Array blue */\r\r\n\t$string = str_replace('Array','<font color=\"blue\">Array</font>',$string);\r\r\n\t/* turn arrows graygreen */\r\r\n\t$string = str_replace('=>','<font color=\"#556F55\">=></font>',$string);\r\r\n\t$string = str_replace(\"'\", \"\\'\", $string);\r\r\n\t$string = str_replace(\"/\", \"\\/\", $string);\r\r\n\t$string = str_replace('\"', '\\\"', $string);\r\r\n\treturn $string;\r\r\n}", "function standard($str) {\n return colorize($str)->standard();\n}", "function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}", "function track_color($d) {\n if (substr($d['title'],0,7) == 'COFFEE ') return 'trz';\n if (substr($d['title'],0,6) == 'LUNCH ') return 'trz';\n if ($d['title'] == 'Poster Session') return 'trp';\n if (($d['day'] == 1 || $d['day'] == 2) && $d['type'] == 'l') return 'trl';\n if ($d['day'] == 4) return 'trz';\n if ($d['type'] == 'w') return 'trw';\n if ($d['type'] == 'c' && $d['starttime'] == '22:00' && $d['day'] == 3) return 'trmS';\n if ($d['type'] == 'c') return 'trm';\n if ($d['type'] == 'i') return 'tri';\n if ($d['type'] == 'v') return 'trp';\n if ($d['type'] != 'p') return 'tro';\n return 'tr0';\n }", "protected function _bgColor($color, $string)\n {\n return \"\\033[\" . $this->_colors['background'][$color] . 'm' . $string . \"\\033[0m\";\n }", "function getColor() { return $this->_color; }", "function print_color($string, $color, $span)\n{\n $type = \"span\";\n if (!$span) {\n $type = \"div\";\n }\n print(_get_color($color, $type) . $string . \"</\" . $type . \">\");\n}", "function phpkd_vblvb_color_picker_element($x, $y, $color)\n{\n\tglobal $vbulletin;\n\treturn \"\\t\\t<td style=\\\"background:$color\\\" id=\\\"sw$x-$y\\\"><img src=\\\"../\" . $vbulletin->options['cleargifurl'] . \"\\\" alt=\\\"\\\" style=\\\"width:11px; height:11px\\\" /></td>\\r\\n\";\n}", "function getrandcolor($num) {\n //$color = array('1CF', '3CF', '5CF', '7CF', '9CF', '0CF');\n //$color = array('0066CC', '0066FF', '0099CC', '0099FF', '3366CC', '3366FF', '3399CC', '3399FF', '306EFF', '2B65EC', '1589FF', '157DEC', '1569C7');\n $color = array('0099FF', '2EB135', 'FF5A00', 'DE1C85');\n return '#'.$color[$num];\n }", "function callback_color($args)\n {\n }", "public static function DeclarationWithStringHexColorValue($stringHexColorValue) {\n $instance = new parent(\"color\", \":\" . $stringHexColorValue); //arrumar\n return $instance;\n }", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "public static function color(string $name)\n\t{\n\t\tinclude dirname(__DIR__) . '/definitions/definitions.php';\n\t\t\n\t\ttry {\n\t\t\treturn $__COLORS->{$name};\n\t\t} catch (\\Exception $e) {\n\t\t\tvar_export($e->getMessage());\n\t\t}\n\t}", "function get_primary_colors() {\n $colors = array(\n 'ff0000' => 'Red',\n '00ff00' => 'Green',\n '0000ff' => 'Blue',\n );\n $temp = array();\n foreach($colors as $k => $v) {\n $temp[] = '\"'.$k.'\", '.'\"'.$v.'\"';\n }\n return join(', ', $temp);\n}", "function echoColors($pallet)\n{ // OUTPUT COLORSBAR\n foreach ($pallet as $key => $val) {\n echo '<div style=\"display:inline-block;width:50px;height:20px;background:#' . $val . '\"> </div>';\n }\n}", "function checkhexcolor($color2)\n{\n return preg_match('/^#[a-f0-9]{6}$/i', $color2);\n}", "function checkhexcolor($color) {\n\n\treturn preg_match('/^#[a-f0-9]{6}$/i', $color);\n\n}", "public function ov_color($name, $value = null){\n $args = func_get_args(); array_shift($args); array_shift($args);\n if( !isset($value) || strlen(trim($value)) < 1 ) $value = '#000000';\n return $this->generate_input('color', $name, $value, true, $args);\n }", "function saveColor($color){\n\t\t# You could do that with the hex2rbg function.\n\t\t# $dbh->saveColor(hex2rbg($hex));\n\t\t# Not that it would do any harm, but then you would be wondering why you have no lights :>\n\n\t\t$pdo = $this->db->prepare(\"INSERT INTO colors (red,green,blue,time) VALUES (?,?,?,?)\");\n\n\t\tif($pdo->execute(array($red,$green,$blue,date(\"Y-m-d H:i:s\")))){\n\n\t\t\treturn \"Color saved.\";\n\t\t}\n\t}", "public function getColor() {\n\t}", "public static function hash()\r\n {\r\n return sprintf(\"%s[#]%s \", Color::GRN, Color::END);\r\n }", "function checkhexcolor($color){\n return preg_match('/^#[a-f0-9]{6}$/i', $color);\n}", "public function red($text) {\n return $this->begin() . $this->formats['red'] . $text . $this->end();\n }", "public function command(string $command, string $color): void;", "function mc_shift_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\t$rgb = '';\n\t$percent = ( mc_inverse_color( $color ) == '#ffffff' ) ? - 20 : 20;\n\t$per = $percent / 100 * 255;\n\t// Percentage to work with. Change middle figure to control color temperature.\n\tif ( $per < 0 ) {\n\t\t// DARKER.\n\t\t$per = abs( $per ); // Turns Neg Number to Pos Number.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) - $per;\n\t\t\t$c = ( $c < 0 ) ? 0 : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t} else {\n\t\t// LIGHTER.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) + $per;\n\t\t\t$c = ( $c > 255 ) ? 'ff' : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t}\n\n\treturn '#' . $rgb;\n}", "public static function lookup($color)\n {\n return ['rgb' => self::BUILTIN_COLOR_MAP[$color] ?? '000000'];\n }", "public function addColorCode($name, $color, $text_color, $display_order=0){\n\t\t\n\t\t$sql = \"insert into sy_color_codes(name, color, text, display_order)\"\n\t\t\t\t. \" values(?, ?, ?, ?)\";\n\t\t$this->runRequest($sql, array($name, $color, $text_color, $display_order));\t\t\n\t}", "function carton_hex_lighter( $color, $factor = 30 ) {\n\t\t$base = carton_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t foreach ($base as $k => $v) :\n\t $amount = 255 - $v;\n\t $amount = $amount / 100;\n\t $amount = round($amount * $factor);\n\t $new_decimal = $v + $amount;\n\n\t $new_hex_component = dechex($new_decimal);\n\t if(strlen($new_hex_component) < 2) :\n\t \t$new_hex_component = \"0\".$new_hex_component;\n\t endif;\n\t $color .= $new_hex_component;\n\t \tendforeach;\n\n\t \treturn $color;\n\t}", "function __construct($color, $name){\n\t\t$this->color = $color;\n\t\t$this->name = $name;\n\t}", "private function blue(string $string): string\n {\n $color = new Color();\n return $color->info($string);\n }", "public function createDefaultColorCode(){\n\t\n\t\tif(!$this->isColorCode(\"default\", \"b2dfee\")){\n\t\t\t$sql = \"INSERT INTO sy_color_codes (name, color, text) VALUES(?,?,?)\";\n\t\t\t$this->runRequest($sql, array(\"default\", \"b2dfee\", \"000000\"));\n\t\t}\n\t}", "function wp_tinycolor_string_to_rgb($color_str)\n {\n }", "function print_color($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<span class=\"numbersign\">&#35;</span><input class=\"option-input option-color\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"text\" value=\"'.$input_value.'\" />';\n\t\techo '<div class=\"color-preview\" style=\"background-color:#'.$input_value.'\"></div>';\n\t\t$this->close_option($value);\n\t}", "function toColor($n){\n\t\t\treturn(\"#\".substr(\"000000\".dechex($n),-6));\n\t\t}", "static function red($text) {\n\t\techo (self::$colorize) ? \"\\033[31m\".$text.\"\\033[0m\" : $text;\n\t}", "private function getColorFullHexValue(string $color): string\n {\n if(strlen($color) == 3) {\n $color = sprintf('%s%s%s%s%s%s', $color[0], $color[0], $color[1], $color[1], $color[2], $color[2]);\n }\n return $color;\n }", "private function colorize(string $characters, string $color): string\n {\n if (!isset(self::POSIX_COLOR_CODES[strtolower($color)])) {\n return $characters;\n }\n\n return \"<<$color>>$characters<<\".OutputWriter::COLOR_DEFAULT.'>>';\n }", "function getColor(): string\n{\n $arrColors = [\n 'AliceBlue',\n 'AntiqueWhite',\n 'Aqua',\n 'Aquamarine',\n 'Azure',\n 'Beige',\n 'Bisque',\n 'Black',\n 'BlanchedAlmond',\n 'Blue',\n 'BlueViolet',\n 'Brown',\n 'BurlyWood',\n 'CadetBlue',\n 'Chartreuse',\n 'Chocolate',\n 'Coral',\n 'CornflowerBlue',\n 'Cornsilk',\n 'Crimson',\n 'Cyan',\n 'DarkBlue',\n 'DarkCyan',\n 'DarkGoldenRod',\n 'DarkGray',\n 'DarkGrey',\n 'DarkGreen',\n 'DarkKhaki',\n 'DarkMagenta',\n 'DarkOliveGreen',\n 'Darkorange',\n 'DarkOrchid',\n 'DarkRed',\n 'DarkSalmon',\n 'DarkSeaGreen',\n 'DarkSlateBlue',\n 'DarkSlateGray',\n 'DarkSlateGrey',\n 'DarkTurquoise',\n 'DarkViolet',\n 'DeepPink',\n 'DeepSkyBlue',\n 'DimGray',\n 'DimGrey',\n 'DodgerBlue',\n 'FireBrick',\n 'FloralWhite',\n 'ForestGreen',\n 'Fuchsia',\n 'Gainsboro',\n 'GhostWhite',\n 'Gold',\n 'GoldenRod',\n 'Gray',\n 'Grey',\n 'Green',\n 'GreenYellow',\n 'HoneyDew',\n 'HotPink',\n 'IndianRed',\n 'Indigo',\n 'Ivory',\n 'Khaki',\n 'Lavender',\n 'LavenderBlush',\n 'LawnGreen',\n 'LemonChiffon',\n 'LightBlue',\n 'LightCoral',\n 'LightCyan',\n 'LightGoldenRodYellow',\n 'LightGray',\n 'LightGrey',\n 'LightGreen',\n 'LightPink',\n 'LightSalmon',\n 'LightSeaGreen',\n 'LightSkyBlue',\n 'LightSlateGray',\n 'LightSlateGrey',\n 'LightSteelBlue',\n 'LightYellow',\n 'Lime',\n 'LimeGreen',\n 'Linen',\n 'Magenta',\n 'Maroon',\n 'MediumAquaMarine',\n 'MediumBlue',\n 'MediumOrchid',\n 'MediumPurple',\n 'MediumSeaGreen',\n 'MediumSlateBlue',\n 'MediumSpringGreen',\n 'MediumTurquoise',\n 'MediumVioletRed',\n 'MidnightBlue',\n 'MintCream',\n 'MistyRose',\n 'Moccasin',\n 'NavajoWhite',\n 'Navy',\n 'OldLace',\n 'Olive',\n 'OliveDrab',\n 'Orange',\n 'OrangeRed',\n 'Orchid',\n 'PaleGoldenRod',\n 'PaleGreen',\n 'PaleTurquoise',\n 'PaleVioletRed',\n 'PapayaWhip',\n 'PeachPuff',\n 'Peru',\n 'Pink',\n 'Plum',\n 'PowderBlue',\n 'Purple',\n 'Red',\n 'RosyBrown',\n 'RoyalBlue',\n 'SaddleBrown',\n 'Salmon',\n 'SandyBrown',\n 'SeaGreen',\n 'SeaShell',\n 'Sienna',\n 'Silver',\n 'SkyBlue',\n 'SlateBlue',\n 'SlateGray',\n 'SlateGrey',\n 'Snow',\n 'SpringGreen',\n 'SteelBlue',\n 'Tan',\n 'Teal',\n 'Thistle',\n 'Tomato',\n 'Turquoise',\n 'Violet',\n 'Wheat',\n 'White',\n 'WhiteSmoke',\n 'Yellow',\n 'YellowGreen'\n ];\n\n return array_rand(array_flip($arrColors));\n}", "function debug_data($text, $color = '')\n{\n\tswitch ($color)\n\t{\n\t\tcase 'red': $color = 31; break;\n\t\tcase 'green': $color = 32; break;\n\t\tcase 'orange': $color = 33; break;\n\t\tcase 'blue': $color = 34; break;\n\t}\n\tif ($color)\n\t{\n\t\techo \"\\033[\".$color.\"m\";\n\t}\n\techo $text.\"\\n\";\n\tif ($color)\n\t{\n\t\techo \"\\033[0m\";\n\t}\n\tflush();\n\t// ob_flush();\n}", "protected function renderColor($element)\n {\n return '<span style=\"color:' . $element[2] . '\">' . $this->renderAbsy($element[1]) . '</span>';\n }", "protected function renderColor($element)\n {\n return '<span style=\"color:' . $element[2] . '\">' . $this->renderAbsy($element[1]) . '</span>';\n }", "function checkhexcolor($color) {\n return preg_match('/^#[a-f0-9]{6}$/i', $color);\n}", "function checkhexcolor($color) {\n return preg_match('/^#[a-f0-9]{6}$/i', $color);\n}" ]
[ "0.617231", "0.6140767", "0.5918885", "0.5877195", "0.5825353", "0.58148634", "0.5794388", "0.5739103", "0.57006377", "0.56905544", "0.5623531", "0.5619847", "0.5611799", "0.56098783", "0.5563469", "0.5549251", "0.55307525", "0.5503848", "0.5497411", "0.5487266", "0.54508924", "0.5409791", "0.5395682", "0.53898686", "0.5388908", "0.5381065", "0.53654397", "0.5362464", "0.5353827", "0.53349984", "0.52999365", "0.5287951", "0.52847385", "0.52820283", "0.5237716", "0.52335185", "0.522123", "0.5215203", "0.52052987", "0.52052987", "0.51926124", "0.51914734", "0.51675165", "0.51658475", "0.5164247", "0.5163473", "0.5163039", "0.5157744", "0.51434714", "0.5137604", "0.51372164", "0.5130052", "0.5125879", "0.5125879", "0.5125306", "0.51147956", "0.5102574", "0.5099291", "0.50986487", "0.5093693", "0.5089912", "0.50881714", "0.50856614", "0.5083806", "0.5078505", "0.5076893", "0.50765735", "0.50765735", "0.50765735", "0.50765735", "0.50714207", "0.5070915", "0.5061103", "0.5048819", "0.5048555", "0.50405777", "0.50389904", "0.5025221", "0.50244296", "0.50211024", "0.5019868", "0.5014302", "0.50125194", "0.5007449", "0.4998517", "0.4993881", "0.499084", "0.49900484", "0.49841502", "0.4977426", "0.4974282", "0.4972386", "0.4971882", "0.49680358", "0.49669743", "0.49659893", "0.49611637", "0.49604887", "0.49604887", "0.49432376", "0.49432376" ]
0.0
-1
/ "$color$symbol" => "$symbol".
function cardSymbol($card) { if (($index = strpos($card, "-")) !== false) { return substr($card, $index + 1); } return $card; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pl_hashify( $color ){\n\t\n\t$clean_hex = str_replace('#', '', $color);\n\t\n\treturn sprintf('#%s', $clean_hex);\n}", "protected static function _namedColor($color)\n {\n switch (strtolower($color)) {\n case 'aqua':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'black':\n $r = 0.0; $g = 0.0; $b = 0.0; break;\n case 'blue':\n $r = 0.0; $g = 0.0; $b = 1.0; break;\n case 'fuchsia':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'gray':\n $r = 0.502; $g = 0.502; $b = 0.502; break;\n case 'green':\n $r = 0.0; $g = 0.502; $b = 0.0; break;\n case 'lime':\n $r = 0.0; $g = 1.0; $b = 0.0; break;\n case 'maroon':\n $r = 0.502; $g = 0.0; $b = 0.0; break;\n case 'navy':\n $r = 0.0; $g = 0.0; $b = 0.502; break;\n case 'olive':\n $r = 0.502; $g = 0.502; $b = 0.0; break;\n case 'purple':\n $r = 0.502; $g = 0.0; $b = 0.502; break;\n case 'red':\n $r = 1.0; $g = 0.0; $b = 0.0; break;\n case 'silver':\n $r = 0.753; $g = 0.753; $b = 0.753; break;\n case 'teal':\n $r = 0.0; $g = 0.502; $b = 0.502; break;\n case 'white':\n $r = 1.0; $g = 1.0; $b = 1.0; break;\n case 'yellow':\n $r = 1.0; $g = 1.0; $b = 0.0; break;\n\n case 'aliceblue':\n $r = 0.941; $g = 0.973; $b = 1.0; break;\n case 'antiquewhite':\n $r = 0.980; $g = 0.922; $b = 0.843; break;\n case 'aquamarine':\n $r = 0.498; $g = 1.0; $b = 0.831; break;\n case 'azure':\n $r = 0.941; $g = 1.0; $b = 1.0; break;\n case 'beige':\n $r = 0.961; $g = 0.961; $b = 0.863; break;\n case 'bisque':\n $r = 1.0; $g = 0.894; $b = 0.769; break;\n case 'blanchedalmond':\n $r = 1.0; $g = 1.0; $b = 0.804; break;\n case 'blueviolet':\n $r = 0.541; $g = 0.169; $b = 0.886; break;\n case 'brown':\n $r = 0.647; $g = 0.165; $b = 0.165; break;\n case 'burlywood':\n $r = 0.871; $g = 0.722; $b = 0.529; break;\n case 'cadetblue':\n $r = 0.373; $g = 0.620; $b = 0.627; break;\n case 'chartreuse':\n $r = 0.498; $g = 1.0; $b = 0.0; break;\n case 'chocolate':\n $r = 0.824; $g = 0.412; $b = 0.118; break;\n case 'coral':\n $r = 1.0; $g = 0.498; $b = 0.314; break;\n case 'cornflowerblue':\n $r = 0.392; $g = 0.584; $b = 0.929; break;\n case 'cornsilk':\n $r = 1.0; $g = 0.973; $b = 0.863; break;\n case 'crimson':\n $r = 0.863; $g = 0.078; $b = 0.235; break;\n case 'cyan':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'darkblue':\n $r = 0.0; $g = 0.0; $b = 0.545; break;\n case 'darkcyan':\n $r = 0.0; $g = 0.545; $b = 0.545; break;\n case 'darkgoldenrod':\n $r = 0.722; $g = 0.525; $b = 0.043; break;\n case 'darkgray':\n $r = 0.663; $g = 0.663; $b = 0.663; break;\n case 'darkgreen':\n $r = 0.0; $g = 0.392; $b = 0.0; break;\n case 'darkkhaki':\n $r = 0.741; $g = 0.718; $b = 0.420; break;\n case 'darkmagenta':\n $r = 0.545; $g = 0.0; $b = 0.545; break;\n case 'darkolivegreen':\n $r = 0.333; $g = 0.420; $b = 0.184; break;\n case 'darkorange':\n $r = 1.0; $g = 0.549; $b = 0.0; break;\n case 'darkorchid':\n $r = 0.6; $g = 0.196; $b = 0.8; break;\n case 'darkred':\n $r = 0.545; $g = 0.0; $b = 0.0; break;\n case 'darksalmon':\n $r = 0.914; $g = 0.588; $b = 0.478; break;\n case 'darkseagreen':\n $r = 0.561; $g = 0.737; $b = 0.561; break;\n case 'darkslateblue':\n $r = 0.282; $g = 0.239; $b = 0.545; break;\n case 'darkslategray':\n $r = 0.184; $g = 0.310; $b = 0.310; break;\n case 'darkturquoise':\n $r = 0.0; $g = 0.808; $b = 0.820; break;\n case 'darkviolet':\n $r = 0.580; $g = 0.0; $b = 0.827; break;\n case 'deeppink':\n $r = 1.0; $g = 0.078; $b = 0.576; break;\n case 'deepskyblue':\n $r = 0.0; $g = 0.749; $b = 1.0; break;\n case 'dimgray':\n $r = 0.412; $g = 0.412; $b = 0.412; break;\n case 'dodgerblue':\n $r = 0.118; $g = 0.565; $b = 1.0; break;\n case 'firebrick':\n $r = 0.698; $g = 0.133; $b = 0.133; break;\n case 'floralwhite':\n $r = 1.0; $g = 0.980; $b = 0.941; break;\n case 'forestgreen':\n $r = 0.133; $g = 0.545; $b = 0.133; break;\n case 'gainsboro':\n $r = 0.863; $g = 0.863; $b = 0.863; break;\n case 'ghostwhite':\n $r = 0.973; $g = 0.973; $b = 1.0; break;\n case 'gold':\n $r = 1.0; $g = 0.843; $b = 0.0; break;\n case 'goldenrod':\n $r = 0.855; $g = 0.647; $b = 0.125; break;\n case 'greenyellow':\n $r = 0.678; $g = 1.0; $b = 0.184; break;\n case 'honeydew':\n $r = 0.941; $g = 1.0; $b = 0.941; break;\n case 'hotpink':\n $r = 1.0; $g = 0.412; $b = 0.706; break;\n case 'indianred':\n $r = 0.804; $g = 0.361; $b = 0.361; break;\n case 'indigo':\n $r = 0.294; $g = 0.0; $b = 0.510; break;\n case 'ivory':\n $r = 1.0; $g = 0.941; $b = 0.941; break;\n case 'khaki':\n $r = 0.941; $g = 0.902; $b = 0.549; break;\n case 'lavender':\n $r = 0.902; $g = 0.902; $b = 0.980; break;\n case 'lavenderblush':\n $r = 1.0; $g = 0.941; $b = 0.961; break;\n case 'lawngreen':\n $r = 0.486; $g = 0.988; $b = 0.0; break;\n case 'lemonchiffon':\n $r = 1.0; $g = 0.980; $b = 0.804; break;\n case 'lightblue':\n $r = 0.678; $g = 0.847; $b = 0.902; break;\n case 'lightcoral':\n $r = 0.941; $g = 0.502; $b = 0.502; break;\n case 'lightcyan':\n $r = 0.878; $g = 1.0; $b = 1.0; break;\n case 'lightgoldenrodyellow':\n $r = 0.980; $g = 0.980; $b = 0.824; break;\n case 'lightgreen':\n $r = 0.565; $g = 0.933; $b = 0.565; break;\n case 'lightgrey':\n $r = 0.827; $g = 0.827; $b = 0.827; break;\n case 'lightpink':\n $r = 1.0; $g = 0.714; $b = 0.757; break;\n case 'lightsalmon':\n $r = 1.0; $g = 0.627; $b = 0.478; break;\n case 'lightseagreen':\n $r = 0.125; $g = 0.698; $b = 0.667; break;\n case 'lightskyblue':\n $r = 0.529; $g = 0.808; $b = 0.980; break;\n case 'lightslategray':\n $r = 0.467; $g = 0.533; $b = 0.6; break;\n case 'lightsteelblue':\n $r = 0.690; $g = 0.769; $b = 0.871; break;\n case 'lightyellow':\n $r = 1.0; $g = 1.0; $b = 0.878; break;\n case 'limegreen':\n $r = 0.196; $g = 0.804; $b = 0.196; break;\n case 'linen':\n $r = 0.980; $g = 0.941; $b = 0.902; break;\n case 'magenta':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'mediumaquamarine':\n $r = 0.4; $g = 0.804; $b = 0.667; break;\n case 'mediumblue':\n $r = 0.0; $g = 0.0; $b = 0.804; break;\n case 'mediumorchid':\n $r = 0.729; $g = 0.333; $b = 0.827; break;\n case 'mediumpurple':\n $r = 0.576; $g = 0.439; $b = 0.859; break;\n case 'mediumseagreen':\n $r = 0.235; $g = 0.702; $b = 0.443; break;\n case 'mediumslateblue':\n $r = 0.482; $g = 0.408; $b = 0.933; break;\n case 'mediumspringgreen':\n $r = 0.0; $g = 0.980; $b = 0.604; break;\n case 'mediumturquoise':\n $r = 0.282; $g = 0.820; $b = 0.8; break;\n case 'mediumvioletred':\n $r = 0.780; $g = 0.082; $b = 0.522; break;\n case 'midnightblue':\n $r = 0.098; $g = 0.098; $b = 0.439; break;\n case 'mintcream':\n $r = 0.961; $g = 1.0; $b = 0.980; break;\n case 'mistyrose':\n $r = 1.0; $g = 0.894; $b = 0.882; break;\n case 'moccasin':\n $r = 1.0; $g = 0.894; $b = 0.710; break;\n case 'navajowhite':\n $r = 1.0; $g = 0.871; $b = 0.678; break;\n case 'oldlace':\n $r = 0.992; $g = 0.961; $b = 0.902; break;\n case 'olivedrab':\n $r = 0.420; $g = 0.557; $b = 0.137; break;\n case 'orange':\n $r = 1.0; $g = 0.647; $b = 0.0; break;\n case 'orangered':\n $r = 1.0; $g = 0.271; $b = 0.0; break;\n case 'orchid':\n $r = 0.855; $g = 0.439; $b = 0.839; break;\n case 'palegoldenrod':\n $r = 0.933; $g = 0.910; $b = 0.667; break;\n case 'palegreen':\n $r = 0.596; $g = 0.984; $b = 0.596; break;\n case 'paleturquoise':\n $r = 0.686; $g = 0.933; $b = 0.933; break;\n case 'palevioletred':\n $r = 0.859; $g = 0.439; $b = 0.576; break;\n case 'papayawhip':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peachpuff':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peru':\n $r = 0.804; $g = 0.522; $b = 0.247; break;\n case 'pink':\n $r = 1.0; $g = 0.753; $b = 0.796; break;\n case 'plum':\n $r = 0.867; $g = 0.627; $b = 0.867; break;\n case 'powderblue':\n $r = 0.690; $g = 0.878; $b = 0.902; break;\n case 'rosybrown':\n $r = 0.737; $g = 0.561; $b = 0.561; break;\n case 'royalblue':\n $r = 0.255; $g = 0.412; $b = 0.882; break;\n case 'saddlebrown':\n $r = 0.545; $g = 0.271; $b = 0.075; break;\n case 'salmon':\n $r = 0.980; $g = 0.502; $b = 0.447; break;\n case 'sandybrown':\n $r = 0.957; $g = 0.643; $b = 0.376; break;\n case 'seagreen':\n $r = 0.180; $g = 0.545; $b = 0.341; break;\n case 'seashell':\n $r = 1.0; $g = 0.961; $b = 0.933; break;\n case 'sienna':\n $r = 0.627; $g = 0.322; $b = 0.176; break;\n case 'skyblue':\n $r = 0.529; $g = 0.808; $b = 0.922; break;\n case 'slateblue':\n $r = 0.416; $g = 0.353; $b = 0.804; break;\n case 'slategray':\n $r = 0.439; $g = 0.502; $b = 0.565; break;\n case 'snow':\n $r = 1.0; $g = 0.980; $b = 0.980; break;\n case 'springgreen':\n $r = 0.0; $g = 1.0; $b = 0.498; break;\n case 'steelblue':\n $r = 0.275; $g = 0.510; $b = 0.706; break;\n case 'tan':\n $r = 0.824; $g = 0.706; $b = 0.549; break;\n case 'thistle':\n $r = 0.847; $g = 0.749; $b = 0.847; break;\n case 'tomato':\n $r = 0.992; $g = 0.388; $b = 0.278; break;\n case 'turquoise':\n $r = 0.251; $g = 0.878; $b = 0.816; break;\n case 'violet':\n $r = 0.933; $g = 0.510; $b = 0.933; break;\n case 'wheat':\n $r = 0.961; $g = 0.871; $b = 0.702; break;\n case 'whitesmoke':\n $r = 0.961; $g = 0.961; $b = 0.961; break;\n case 'yellowgreen':\n $r = 0.604; $g = 0.804; $b = 0.196; break;\n default:\n return null;\n }\n return array('r' => $r * 255, 'g' => $g * 255, 'b' => $b * 255);\n }", "function maybe_hash_hex_color($color)\n {\n }", "function sanitize_hex_color($color)\n {\n }", "function rest_parse_hex_color($color)\n {\n }", "function hex2color($str) {\n $color = hex2bin(ltrim($str, '$'));\n return ($str[0] === '$' ? unpack('V', \"$color\\0\") : unpack('N', \"\\0$color\"))[1];\n}", "public static function color($color = NULL, $s = NULL)\n\t{\n\t\tstatic $colors = array(\n\t\t\t'black' => '0;30', 'gray' => '1;30', 'silver' => '0;37', 'white' => '1;37',\n\t\t\t'navy' => '0;34', 'blue' => '1;34', 'green' => '0;32', 'lime' => '1;32',\n\t\t\t'teal' => '0;36', 'aqua' => '1;36', 'maroon' => '0;31', 'red' => '1;31',\n\t\t\t'purple' => '0;35', 'fuchsia' => '1;35', 'olive' => '0;33', 'yellow' => '1;33',\n\t\t\tNULL => '0',\n\t\t);\n\t\t$c = explode('/', $color ?: '');\n\t\treturn \"\\033[\"\n\t\t\t. str_replace(';', \"m\\033[\", $colors[$c[0]] . (empty($c[1]) ? '' : ';4' . substr($colors[$c[1]], -1)))\n\t\t\t. 'm' . $s . ($s === NULL ? '' : \"\\033[0m\");\n\t}", "function image_hex_color($color)\n{\n $c = strtoupper($color);\n if (strpos($c, '#') !== 0) {\n $c = '#'.$c;\n }\n if (!preg_match('/^#([A-F0-9]{3}){1,2}$/', $c)) {\n err('invalid hex color '.$color);\n }\n return $c;\n\n}", "function sanitize_hex_color_no_hash($color)\n {\n }", "function boja($color)\n{\n $text = 'Neki tekst';\n echo \"<p style='color:$color'>$text</p>\";\n \n}", "function c_back($str){\n $str = \"<font color=$str[1]>$str[2]</font>\";\n return $str;\n}", "public function howToColor($color)\n {\n }", "public function getColor(): string;", "function displaySymbol($randomValue, $pos){\n \n \n switch($randomValue){\n case 0: $symbol = \"seven\";\n break;\n case 1: $symbol = \"cherry\";\n break;\n case 2: $symbol = \"lemon\";\n break;\n case 3: $symbol = \"grapes\";\n \n }\n \n echo \"<img id = 'reel$pos' src = 'img/$symbol.png' alt = '$symbol' title ='\".ucfirst($symbol). \"' width = '70' >\";\n }", "public function useColor($name);", "function tfColor($string, $tf) {\n if ( $tf ) {\n $colorout = \"<font color=\\\"#00aa00\\\">$string</font>\";\n } else {\n $colorout = \"<font color=\\\"#880000\\\">$string</font>\";\n }\n return $colorout;\n}", "function vColor( $color )\r\n\t\t{\r\n\t\t\t#CCC\r\n\t\t\t#CCCCC\r\n\t\t\t#FFFFF\r\n\t\t\treturn preg_match( '/^#(?:(?:[a-f0-9]{3}){1,2})$/i', $color );\r\n\t\t\t\r\n\t\t}", "function pl_link_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'linkcolor' ) ) ) ? pl_hash_strip( ploption( 'linkcolor' ) ) : '225E9B';\n\t\n\treturn $color;\t\n}", "function pl_text_color(){\n\t\t\n\t$color = ( pl_check_color_hash( ploption( 'text_primary' ) ) ) ? pl_hash_strip( ploption( 'text_primary' ) ) : '000000';\n\n\treturn $color;\n}", "function cli_color($string, $color = null) {\n $colors = [\n 'default' => '39',\n 'black' => '30',\n 'red' => '31',\n 'green' => '32',\n 'yellow' => '33',\n 'blue' => '34',\n 'magenta' => '35',\n 'cyan' => '36',\n 'light_gray' => '37',\n 'dark_gray' => '90',\n 'light_red' => '91',\n 'light_green' => '92',\n 'light_yellow' => '93',\n 'light_blue' => '94',\n 'light_magenta' => '95',\n 'light_cyan' => '96',\n 'white' => '97',\n ];\n\n if ($color === null or ! array_has($colors, $color)) {\n return $string;\n } else {\n $color = $colors[$color];\n }\n\n return s(\"\\033[%sm%s\\033[0m\", $color, $string);\n }", "function red($text){\r\n return \"<b><font color=red>\".$text.\"</font></b>\";\r\n}", "function getColorInClear($color) {\n switch($color) {\n case 0:\n return clienttranslate('blue');\n case 1:\n return clienttranslate('red');\n case 2:\n return clienttranslate('green');\n case 3:\n return clienttranslate('yellow');\n case 4:\n return clienttranslate('purple');\n }\n }", "public function process_colors( $string ){\n\t\t$string = self::utils()->replace_commented_style_with_variable( $string );\n\t\treturn $this->convert_variables_to_color( $string );\n\t}", "public static function term_color($text, $color = \"NORMAL\")\n\t\t{\n\t\t\t$text = self::term_remove_color($text);\n\t\t\t$out = self::$term_colors[$color];\n\t\t\t$out == \"\" && $out = \"[0m\";\n\n\t\t\treturn chr(27).$out.$text.chr(27).\"[0m\";\n\t\t}", "public function parse_colors($text) {\r\n\t\r\n\t\t# Clear garbage\r\n\t\t$text = preg_replace('/[^\\r\\n\\t\\x20-\\x7E\\xA0-\\xFF]/', '', trim($text));\r\n\t\t\r\n\t\t# load first set..\r\n\t\t$switch = 1;\r\n\t\r\n\t\t# Check if there's a color..\r\n\t\tif (substr_count($text, '^')>0) {\r\n\t\t\r\n\t\t $clr = array ( // colors\r\n\t \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", \"\\\"#E8FF19\\\"\", // 1\r\n\t \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", \"\\\"#FFFFFF\\\"\", // 2\r\n\t \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#EB9F53\\\"\", \"\\\"#106F59\\\"\", // 3\r\n\t \"\\\"#5A134F\\\"\", \"\\\"#035AFF\\\"\", \"\\\"#681EA7\\\"\", \"\\\"#5097C1\\\"\", // 4\r\n\t \"\\\"#BEDAC4\\\"\", \"\\\"#024D2C\\\"\", \"\\\"#7D081B\\\"\", \"\\\"#90243E\\\"\", // 5\r\n\t \"\\\"#743313\\\"\", \"\\\"#A7905E\\\"\", \"\\\"#555C26\\\"\", \"\\\"#AEAC97\\\"\", // 6\r\n\t \"\\\"#C0BF7F\\\"\", \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", // 7\r\n\t \"\\\"#E8FF19\\\"\", \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", // 8\r\n\t \"\\\"#FFFFFF\\\"\", \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#CC8034\\\"\", // 9\r\n\t \"\\\"#DBDF70\\\"\", \"\\\"#BBBBBB\\\"\", \"\\\"#747228\\\"\", \"\\\"#993400\\\"\", // 10\r\n\t \"\\\"#670504\\\"\", \"\\\"#623307\\\"\" // 11\r\n );\r\n\r\n\t if ($switch == 1)\r\n\t { // colored string\r\n\t $search = array (\r\n\t \"/\\^0/\", \"/\\^1/\", \"/\\^2/\", \"/\\^3/\", // 1\r\n\t \"/\\^4/\", \"/\\^5/\", \"/\\^6/\", \"/\\^7/\", // 2\r\n\t \"/\\^8/\", \"/\\^9/\", \"/\\^a/\", \"/\\^b/\", // 3\r\n\t \"/\\^c/\", \"/\\^d/\", \"/\\^e/\", \"/\\^f/\", // 4\r\n\t \"/\\^g/\", \"/\\^h/\", \"/\\^i/\", \"/\\^j/\", // 5\r\n\t \"/\\^k/\", \"/\\^l/\", \"/\\^m/\", \"/\\^n/\", // 6\r\n\t \"/\\^o/\", \"/\\^p/\", \"/\\^q/\", \"/\\^r/\", // 7\r\n\t \"/\\^s/\", \"/\\^t/\", \"/\\^u/\", \"/\\^v/\", // 8\r\n\t \"/\\^w/\", \"/\\^x/\", \"/\\^y/\", \"/\\^z/\", // 9\r\n\t \"/\\^\\//\", \"/\\^\\*/\", \"/\\^\\-/\", \"/\\^\\+/\", // 10\r\n\t \"/\\^\\?/\", \"/\\^\\@/\", \"/\\^</\", \"/\\^>/\", // 11\r\n\t \"/\\^\\&/\", \"/\\^\\)/\", \"/\\^\\(/\", \"/\\^[A-Z]/\", // 12\r\n\t \"/\\^\\_/\", // 14\r\n\t \"/&</\", \"/^(.*?)<\\/font>/\" // 15\r\n\t );\r\n\t\r\n\t $replace = array (\r\n\t \"&<font color=$clr[0]>\", \"&<font color=$clr[1]>\", // 1\r\n\t \"&<font color=$clr[2]>\", \"&<font color=$clr[3]>\", // 2\r\n\t \"&<font color=$clr[4]>\", \"&<font color=$clr[5]>\", // 3\r\n\t \"&<font color=$clr[6]>\", \"&<font color=$clr[7]>\", // 4\r\n\t \"&<font color=$clr[8]>\", \"&<font color=$clr[9]>\", // 5\r\n\t \"&<font color=$clr[10]>\", \"&<font color=$clr[11]>\", // 6\r\n\t \"&<font color=$clr[12]>\", \"&<font color=$clr[13]>\", // 7\r\n\t \"&<font color=$clr[14]>\", \"&<font color=$clr[15]>\", // 8\r\n\t \"&<font color=$clr[16]>\", \"&<font color=$clr[17]>\", // 9\r\n\t \"&<font color=$clr[18]>\", \"&<font color=$clr[19]>\", // 10\r\n\t \"&<font color=$clr[20]>\", \"&<font color=$clr[21]>\", // 11\r\n\t \"&<font color=$clr[22]>\", \"&<font color=$clr[23]>\", // 12\r\n\t \"&<font color=$clr[24]>\", \"&<font color=$clr[25]>\", // 13\r\n\t \"&<font color=$clr[26]>\", \"&<font color=$clr[27]>\", // 14\r\n\t \"&<font color=$clr[28]>\", \"&<font color=$clr[29]>\", // 15\r\n\t \"&<font color=$clr[30]>\", \"&<font color=$clr[31]>\", // 16\r\n\t \"&<font color=$clr[32]>\", \"&<font color=$clr[33]>\", // 17\r\n\t \"&<font color=$clr[34]>\", \"&<font color=$clr[35]>\", // 18\r\n\t \"&<font color=$clr[36]>\", \"&<font color=$clr[37]>\", // 19\r\n\t \"&<font color=$clr[38]>\", \"&<font color=$clr[39]>\", // 20\r\n\t \"&<font color=$clr[40]>\", \"&<font color=$clr[41]>\", // 21\r\n\t \"\", \"\", \"\", \"\", \"\", \"\", // 22\r\n\t \"\", \"</font><\", \"\\$1\" // 23\r\n\t );\r\n\t\r\n\t $ctext = preg_replace($search, $replace, $text);\r\n\t\r\n\t if ($ctext != $text)\r\n\t {\r\n\t $ctext = preg_replace(\"/$/\", \"</font>\", $ctext);\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t elseif ($switch == 2)\r\n\t { // colored numbers\r\n\t if ($text <= 39)\r\n\t {\r\n\t $ctext = \"<font color=$clr[7]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 69)\r\n\t {\r\n\t $ctext = \"<font color=$clr[5]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 129)\r\n\t {\r\n\t $ctext = \"<font color=$clr[8]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 399)\r\n\t {\r\n\t $ctext = \"<font color=$clr[9]>$text</font>\";\r\n\t }\r\n\t else\r\n\t {\r\n\t $ctext = \"<font color=$clr[1]>$text</font>\";\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t\t}\r\n\t\t# no color so just return ..\r\n\t\telse {\r\n\t\t\treturn trim($text);\r\n\t\t} \r\n\t}", "public static function sanitize_hex( $color = '#FFFFFF', $hash = true ) {\n\t\t\t$word_colors = array(\n\t\t\t\t'aliceblue' => 'F0F8FF',\n\t\t\t\t'antiquewhite' => 'FAEBD7',\n\t\t\t\t'aqua' => '00FFFF',\n\t\t\t\t'aquamarine' => '7FFFD4',\n\t\t\t\t'azure' => 'F0FFFF',\n\t\t\t\t'beige' => 'F5F5DC',\n\t\t\t\t'bisque' => 'FFE4C4',\n\t\t\t\t'black' => '000000',\n\t\t\t\t'blanchedalmond' => 'FFEBCD',\n\t\t\t\t'blue' => '0000FF',\n\t\t\t\t'blueviolet' => '8A2BE2',\n\t\t\t\t'brown' => 'A52A2A',\n\t\t\t\t'burlywood' => 'DEB887',\n\t\t\t\t'cadetblue' => '5F9EA0',\n\t\t\t\t'chartreuse' => '7FFF00',\n\t\t\t\t'chocolate' => 'D2691E',\n\t\t\t\t'coral' => 'FF7F50',\n\t\t\t\t'cornflowerblue' => '6495ED',\n\t\t\t\t'cornsilk' => 'FFF8DC',\n\t\t\t\t'crimson' => 'DC143C',\n\t\t\t\t'cyan' => '00FFFF',\n\t\t\t\t'darkblue' => '00008B',\n\t\t\t\t'darkcyan' => '008B8B',\n\t\t\t\t'darkgoldenrod' => 'B8860B',\n\t\t\t\t'darkgray' => 'A9A9A9',\n\t\t\t\t'darkgreen' => '006400',\n\t\t\t\t'darkgrey' => 'A9A9A9',\n\t\t\t\t'darkkhaki' => 'BDB76B',\n\t\t\t\t'darkmagenta' => '8B008B',\n\t\t\t\t'darkolivegreen' => '556B2F',\n\t\t\t\t'darkorange' => 'FF8C00',\n\t\t\t\t'darkorchid' => '9932CC',\n\t\t\t\t'darkred' => '8B0000',\n\t\t\t\t'darksalmon' => 'E9967A',\n\t\t\t\t'darkseagreen' => '8FBC8F',\n\t\t\t\t'darkslateblue' => '483D8B',\n\t\t\t\t'darkslategray' => '2F4F4F',\n\t\t\t\t'darkslategrey' => '2F4F4F',\n\t\t\t\t'darkturquoise' => '00CED1',\n\t\t\t\t'darkviolet' => '9400D3',\n\t\t\t\t'deeppink' => 'FF1493',\n\t\t\t\t'deepskyblue' => '00BFFF',\n\t\t\t\t'dimgray' => '696969',\n\t\t\t\t'dimgrey' => '696969',\n\t\t\t\t'dodgerblue' => '1E90FF',\n\t\t\t\t'firebrick' => 'B22222',\n\t\t\t\t'floralwhite' => 'FFFAF0',\n\t\t\t\t'forestgreen' => '228B22',\n\t\t\t\t'fuchsia' => 'FF00FF',\n\t\t\t\t'gainsboro' => 'DCDCDC',\n\t\t\t\t'ghostwhite' => 'F8F8FF',\n\t\t\t\t'gold' => 'FFD700',\n\t\t\t\t'goldenrod' => 'DAA520',\n\t\t\t\t'gray' => '808080',\n\t\t\t\t'green' => '008000',\n\t\t\t\t'greenyellow' => 'ADFF2F',\n\t\t\t\t'grey' => '808080',\n\t\t\t\t'honeydew' => 'F0FFF0',\n\t\t\t\t'hotpink' => 'FF69B4',\n\t\t\t\t'indianred' => 'CD5C5C',\n\t\t\t\t'indigo' => '4B0082',\n\t\t\t\t'ivory' => 'FFFFF0',\n\t\t\t\t'khaki' => 'F0E68C',\n\t\t\t\t'lavender' => 'E6E6FA',\n\t\t\t\t'lavenderblush' => 'FFF0F5',\n\t\t\t\t'lawngreen' => '7CFC00',\n\t\t\t\t'lemonchiffon' => 'FFFACD',\n\t\t\t\t'lightblue' => 'ADD8E6',\n\t\t\t\t'lightcoral' => 'F08080',\n\t\t\t\t'lightcyan' => 'E0FFFF',\n\t\t\t\t'lightgoldenrodyellow' => 'FAFAD2',\n\t\t\t\t'lightgray' => 'D3D3D3',\n\t\t\t\t'lightgreen' => '90EE90',\n\t\t\t\t'lightgrey' => 'D3D3D3',\n\t\t\t\t'lightpink' => 'FFB6C1',\n\t\t\t\t'lightsalmon' => 'FFA07A',\n\t\t\t\t'lightseagreen' => '20B2AA',\n\t\t\t\t'lightskyblue' => '87CEFA',\n\t\t\t\t'lightslategray' => '778899',\n\t\t\t\t'lightslategrey' => '778899',\n\t\t\t\t'lightsteelblue' => 'B0C4DE',\n\t\t\t\t'lightyellow' => 'FFFFE0',\n\t\t\t\t'lime' => '00FF00',\n\t\t\t\t'limegreen' => '32CD32',\n\t\t\t\t'linen' => 'FAF0E6',\n\t\t\t\t'magenta' => 'FF00FF',\n\t\t\t\t'maroon' => '800000',\n\t\t\t\t'mediumaquamarine' => '66CDAA',\n\t\t\t\t'mediumblue' => '0000CD',\n\t\t\t\t'mediumorchid' => 'BA55D3',\n\t\t\t\t'mediumpurple' => '9370D0',\n\t\t\t\t'mediumseagreen' => '3CB371',\n\t\t\t\t'mediumslateblue' => '7B68EE',\n\t\t\t\t'mediumspringgreen' => '00FA9A',\n\t\t\t\t'mediumturquoise' => '48D1CC',\n\t\t\t\t'mediumvioletred' => 'C71585',\n\t\t\t\t'midnightblue' => '191970',\n\t\t\t\t'mintcream' => 'F5FFFA',\n\t\t\t\t'mistyrose' => 'FFE4E1',\n\t\t\t\t'moccasin' => 'FFE4B5',\n\t\t\t\t'navajowhite' => 'FFDEAD',\n\t\t\t\t'navy' => '000080',\n\t\t\t\t'oldlace' => 'FDF5E6',\n\t\t\t\t'olive' => '808000',\n\t\t\t\t'olivedrab' => '6B8E23',\n\t\t\t\t'orange' => 'FFA500',\n\t\t\t\t'orangered' => 'FF4500',\n\t\t\t\t'orchid' => 'DA70D6',\n\t\t\t\t'palegoldenrod' => 'EEE8AA',\n\t\t\t\t'palegreen' => '98FB98',\n\t\t\t\t'paleturquoise' => 'AFEEEE',\n\t\t\t\t'palevioletred' => 'DB7093',\n\t\t\t\t'papayawhip' => 'FFEFD5',\n\t\t\t\t'peachpuff' => 'FFDAB9',\n\t\t\t\t'peru' => 'CD853F',\n\t\t\t\t'pink' => 'FFC0CB',\n\t\t\t\t'plum' => 'DDA0DD',\n\t\t\t\t'powderblue' => 'B0E0E6',\n\t\t\t\t'purple' => '800080',\n\t\t\t\t'red' => 'FF0000',\n\t\t\t\t'rosybrown' => 'BC8F8F',\n\t\t\t\t'royalblue' => '4169E1',\n\t\t\t\t'saddlebrown' => '8B4513',\n\t\t\t\t'salmon' => 'FA8072',\n\t\t\t\t'sandybrown' => 'F4A460',\n\t\t\t\t'seagreen' => '2E8B57',\n\t\t\t\t'seashell' => 'FFF5EE',\n\t\t\t\t'sienna' => 'A0522D',\n\t\t\t\t'silver' => 'C0C0C0',\n\t\t\t\t'skyblue' => '87CEEB',\n\t\t\t\t'slateblue' => '6A5ACD',\n\t\t\t\t'slategray' => '708090',\n\t\t\t\t'slategrey' => '708090',\n\t\t\t\t'snow' => 'FFFAFA',\n\t\t\t\t'springgreen' => '00FF7F',\n\t\t\t\t'steelblue' => '4682B4',\n\t\t\t\t'tan' => 'D2B48C',\n\t\t\t\t'teal' => '008080',\n\t\t\t\t'thistle' => 'D8BFD8',\n\t\t\t\t'tomato' => 'FF6347',\n\t\t\t\t'turquoise' => '40E0D0',\n\t\t\t\t'violet' => 'EE82EE',\n\t\t\t\t'wheat' => 'F5DEB3',\n\t\t\t\t'white' => 'FFFFFF',\n\t\t\t\t'whitesmoke' => 'F5F5F5',\n\t\t\t\t'yellow' => 'FFFF00',\n\t\t\t\t'yellowgreen' => '9ACD32',\n\t\t\t);\n\n\t\t\tif ( is_array( $color ) ) {\n\t\t\t\t$color = $color[0];\n\t\t\t}\n\n\t\t\t// Remove any spaces and special characters before and after the string.\n\t\t\t$color = trim( $color );\n\n\t\t\t// Check if the color is a standard word-color.\n\t\t\t// If it is, then convert to hex.\n\t\t\tif ( array_key_exists( $color, $word_colors ) ) {\n\t\t\t\t$color = $word_colors[ $color ];\n\t\t\t}\n\n\t\t\t// Remove any trailing '#' symbols from the color value.\n\t\t\t$color = str_replace( '#', '', $color );\n\n\t\t\t// If the string is 6 characters long then use it in pairs.\n\t\t\tif ( 3 === strlen( $color ) ) {\n\t\t\t\t$color = substr( $color, 0, 1 ) . substr( $color, 0, 1 ) . substr( $color, 1, 1 ) . substr( $color, 1, 1 ) . substr( $color, 2, 1 ) . substr( $color, 2, 1 );\n\t\t\t}\n\n\t\t\t$substr = array();\n\t\t\tfor ( $i = 0; $i <= 5; $i ++ ) {\n\t\t\t\t$default = ( 0 === $i ) ? 'F' : ( $substr[ $i - 1 ] );\n\t\t\t\t$substr[ $i ] = substr( $color, $i, 1 );\n\t\t\t\t$substr[ $i ] = ( false === $substr[ $i ] || ! ctype_xdigit( $substr[ $i ] ) ) ? $default : $substr[ $i ];\n\t\t\t}\n\n\t\t\t$hex = implode( '', $substr );\n\n\t\t\treturn ( ! $hash ) ? $hex : '#' . $hex;\n\t\t}", "public function addcolor($name, $addcolor){\n\t\t// Check whether the information is valid //\n\t\tif (preg_match('/#([a-fA-F0-9]{3}){1,2}\\b/', $addcolor) && preg_match(\"/^[a-zA-Z]+$/\", $name)) {\n\t\t\t// new array //\n\t\t\t$tmpcolor = array(''. $name .'' => ''. $addcolor .'');\n\t\t\t// merge temp array in array color //\n\t\t\t$this->_color = array_merge($tmpcolor, $this->_color);\n\t\t}else{throw new Exception('hexadecimal code Invalid : http://www.w3schools.com/tags/ref_colorpicker.asp or the name must contain only character'); die();}\n\t}", "public static function colorPrint($color, $text) {\n print $color . $text . self::WHITE . \"\\n\";\n }", "public function getColor(): string\n {\n }", "public static function getSymbol(): string\n {\n return static::symbol;\n }", "public function blue($text): string;", "function tc_sanitize_hex_color( $color ) {\r\n if ( $unhashed = sanitize_hex_color_no_hash( $color ) )\r\n return '#' . $unhashed;\r\n\r\n return $color;\r\n }", "public function convert_variables_to_color( $string ){\n\t\t$theme_colors = !empty(self::$_theme_colors->colors) ? self::$_theme_colors->colors : array();\n\n\t\tfor( $i = 0; $i < self::$_theme_color_count ; $i++ ){\n\t\t\t$string = str_replace(\"#\" . self::VAR_PREFIX . $i, $theme_colors[$i]->color , $string );\n\t\t}\n\n\t\treturn $string;\n\t}", "public function testToHexWithSpaceSeparatedParameter()\n {\n $colors = new Jervenclark\\Colors\\Colors;\n $this->assertTrue($colors->toHex('iv o ry') == 'FFFFF0');\n unset($colors);\n }", "function pl_header_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'headercolor' ) ) ) ? pl_hash_strip( ploption( 'headercolor' ) ) : '000000';\n\t\n\treturn $color;\t\n}", "public function setSymbol(string $symbol)\n\t{\n\t\t$this->symbol=$symbol; \n\t\t$this->keyModified['symbol'] = 1; \n\n\t}", "function verify_color( $input ) {\n\t\t\t$input = trim( $color, '#' );\n\t\t\t//make hex-like for is_numeric test\n\t\t\t$test = \"0x$input\";\n\t\t\tif ( ! is_numeric( $test ) )\n\t\t\t\treturn 'transparent';\n\t\t\treturn \"#$input\";\n\t\t}", "function echoColors($pallet)\n{ // OUTPUT COLORSBAR\n foreach ($pallet as $key => $val) {\n echo '<div style=\"display:inline-block;width:50px;height:20px;background:#' . $val . '\"> </div>';\n }\n}", "function _h_jetpack_share_add_color($title, $share) {\n $slug = $share->shortname;\n\n if ($slug === 'jetpack-whatsapp') {\n $slug = 'whatsapp';\n }\n\n if ($slug === 'print') {\n return $title;\n }\n\n $social = H::get_social_icon($slug);\n $color = $social['color'];\n\n return \"$title\\\" style=\\\"--color: $color;\";\n}", "function onStandard($str) {\n return colorize($str)->onStandard();\n}", "function phpkd_vblvb_color_picker_element($x, $y, $color)\n{\n\tglobal $vbulletin;\n\treturn \"\\t\\t<td style=\\\"background:$color\\\" id=\\\"sw$x-$y\\\"><img src=\\\"../\" . $vbulletin->options['cleargifurl'] . \"\\\" alt=\\\"\\\" style=\\\"width:11px; height:11px\\\" /></td>\\r\\n\";\n}", "function track_color($d) {\n if (substr($d['title'],0,7) == 'COFFEE ') return 'trz';\n if (substr($d['title'],0,6) == 'LUNCH ') return 'trz';\n if ($d['title'] == 'Poster Session') return 'trp';\n if (($d['day'] == 1 || $d['day'] == 2) && $d['type'] == 'l') return 'trl';\n if ($d['day'] == 4) return 'trz';\n if ($d['type'] == 'w') return 'trw';\n if ($d['type'] == 'c' && $d['starttime'] == '22:00' && $d['day'] == 3) return 'trmS';\n if ($d['type'] == 'c') return 'trm';\n if ($d['type'] == 'i') return 'tri';\n if ($d['type'] == 'v') return 'trp';\n if ($d['type'] != 'p') return 'tro';\n return 'tr0';\n }", "public static function hash()\r\n {\r\n return sprintf(\"%s[#]%s \", Color::GRN, Color::END);\r\n }", "function checkColor($missValide) {\n if($missValide == 'Validée ✅') {\n return $background = '#2ecc71';\n } else {\n return $background = '#f39c12';\n }\n}", "private function findColor($color, $final = false)\n {\n if (!is_string($color)) {\n return $color;\n }\n\n $color = strtoupper(str_replace(' ', '_', $color));\n\n if (isset($this->colors[$color])) {\n return $this->colors[$color];\n }\n\n if ($final === true) {\n return null;\n }\n\n preg_match('/(_DARK|_LIGHT|_BRIGHT)$/', $color, $suffix);\n preg_match('/^(DARK|LIGHT|BRIGHT)_./U', $color, $prefix);\n preg_match('/[0-9]$/', $color, $numberSuffix);\n\n if ($suffix) {\n return $this->findColor($color . '_1');\n } elseif ($prefix) {\n preg_match('/[0-9]$/', $prefix[0], $number);\n\n if ($number) {\n $color = str_replace($prefix[0], '', $color);\n $color = $color . '_' . $prefix[0];\n } else {\n $suffix = substr($prefix[0], 0, strlen($prefix[0]) - 1);\n $color = str_replace($suffix, '', $color);\n $color = $color . '_' . $suffix . '1';\n }\n\n return $this->findColor(ltrim($color, '_'));\n } elseif ($numberSuffix) {\n $color = str_replace($numberSuffix[0], '', $color);\n\n if (substr($color, -1, 1) !== '_') {\n $color = $color . '_' . $numberSuffix[0];\n } elseif ((int)$numberSuffix[0] > 1) {\n $number = (int)$numberSuffix[0] - 1;\n $color = $color . (string)$number;\n }\n\n return $this->findColor($color);\n } else {\n $color = preg_replace('/[0-9]|DARK|LIGHT|_/', '', $color);\n return $this->findColor($color, true);\n }\n }", "function debug_colorize_string($string)\r\r\n{\r\r\n\t/* turn array indexes to red */\r\r\n\r\r\n\t$string = str_replace('[','[<font color=\"red\">',$string);\r\r\n\t$string = str_replace(']','</font>]',$string);\r\r\n\r\r\n\t/* turn the word Array blue */\r\r\n\t$string = str_replace('Array','<font color=\"blue\">Array</font>',$string);\r\r\n\t/* turn arrows graygreen */\r\r\n\t$string = str_replace('=>','<font color=\"#556F55\">=></font>',$string);\r\r\n\t$string = str_replace(\"'\", \"\\'\", $string);\r\r\n\t$string = str_replace(\"/\", \"\\/\", $string);\r\r\n\t$string = str_replace('\"', '\\\"', $string);\r\r\n\treturn $string;\r\r\n}", "function cli_highlight($string, $color = null) {\n $colors = [\n 'default' => '49',\n 'black' => '40',\n 'red' => '41',\n 'green' => '42',\n 'yellow' => '43',\n 'blue' => '44',\n 'magenta' => '45',\n 'cyan' => '46',\n 'light_gray' => '47',\n 'dark_gray' => '100',\n 'light_red' => '101',\n 'light_green' => '102',\n 'light_yellow' => '103',\n 'light_blue' => '104',\n 'light_magenta' => '105',\n 'light_cyan' => '106',\n 'white' => '107',\n ];\n\n if ($color === null or ! array_has($colors, $color)) {\n return $string;\n } else {\n $color = $colors[$color];\n }\n\n return s(\"\\033[%sm%s\\033[0m\", $color, $string);\n }", "function print_color($string, $color, $span)\n{\n $type = \"span\";\n if (!$span) {\n $type = \"div\";\n }\n print(_get_color($color, $type) . $string . \"</\" . $type . \">\");\n}", "public function command(string $command, string $color): void;", "public function red($text): string;", "function standard($str) {\n return colorize($str)->standard();\n}", "function NombreCursoColor($varcursocolor)\n{\n\tif ($varcursocolor == 1) return \"linear-gradient(\n to right bottom, \n rgba(54, 227, 250, 0.589),\n rgba(36, 154, 250, 0.795)\n )\";\n\tif ($varcursocolor == 2) return \"linear-gradient(\n to right bottom, \n rgba(1, 152, 252, 0.363),\n rgba(0, 80, 126, 0.534)\n\t)\";\n\tif ($varcursocolor == 3) return \"linear-gradient(\n to right bottom,\n rgba(250, 184, 60, 0.849),\n rgba(253, 151, 18, 0.63)\n\t)\";\n\tif ($varcursocolor == 4) return \"linear-gradient(\n to right bottom,\n rgba(250, 145, 60, 0.849),\n rgba(252, 64, 6, 0.63)\n )\";\n\tif ($varcursocolor == 5) return \"linear-gradient(\n to right bottom,\n rgba(248, 150, 121, 0.795),\n rgba(250, 91, 52, 0.774)\n )\";\n\tif ($varcursocolor == 6) return \"linear-gradient(\n to right bottom,\n rgba(165, 61, 1, 0.795),\n rgba(71, 32, 1, 0.774)\n )\";\n\tif ($varcursocolor == 7) return \"linear-gradient(\n to right bottom, \n rgba(76, 1, 252, 0.363),\n rgba(38, 0, 126, 0.534)\n )\";\n}", "function FormatString($symbol)\n{\n\t$symbolString = \"\";\n\tif(is_array($symbol))\n\t{\n\t\t$len = count($symbol);\n\t\t$i=0;\n\t\tforeach ($symbol as $value) {\n\t\t\t$symbolString .= $value;\n\t\t\tif($len-$i != 1)\n\t\t\t\t$symbolString .= \",\";\n\t\t\t$i++;\n\t\t}\n\t}\n\telse\n\t\treturn $symbol;\n\treturn $symbolString;\n}", "public function createDefaultColorCode(){\n\t\n\t\tif(!$this->isColorCode(\"default\", \"b2dfee\")){\n\t\t\t$sql = \"INSERT INTO sy_color_codes (name, color, text) VALUES(?,?,?)\";\n\t\t\t$this->runRequest($sql, array(\"default\", \"b2dfee\", \"000000\"));\n\t\t}\n\t}", "public function getSymbol()\n\t{\n\t\treturn $this->symbol; \n\n\t}", "public function color(array $color);", "protected function _fgColor($color, $string)\n {\n return \"\\033[\" . $this->_colors['foreground'][$color] . \"m\" . $string . \"\\033[0m\";\n }", "public function getColor()\n {\n return\"Yellow\";\n }", "public function color()\n {\n }", "public function colour();", "public function addColorCode($name, $color, $text_color, $display_order=0){\n\t\t\n\t\t$sql = \"insert into sy_color_codes(name, color, text, display_order)\"\n\t\t\t\t. \" values(?, ?, ?, ?)\";\n\t\t$this->runRequest($sql, array($name, $color, $text_color, $display_order));\t\t\n\t}", "function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}", "function get_primary_colors() {\n $colors = array(\n 'ff0000' => 'Red',\n '00ff00' => 'Green',\n '0000ff' => 'Blue',\n );\n $temp = array();\n foreach($colors as $k => $v) {\n $temp[] = '\"'.$k.'\", '.'\"'.$v.'\"';\n }\n return join(', ', $temp);\n}", "function callback_color($args)\n {\n }", "protected static function escapeCSSChar($matches) {\n $char = $matches[0];\n if(str::length($char) == 1) {\n $ord = ord($char);\n } else {\n $char = static::convertEncoding($char);\n $ord = hexdec(bin2hex($char));\n }\n return sprintf('\\\\%X ', $ord);\n }", "function setColor( $c ) {\n $this->currentColor = $c;\n}", "function rh($spades, $hearts, $diamonds, $clubs) {\n return \"<span class='handContent'>\" .\n \"<span style='color: black'>&spades;</span> $spades<br/>\" .\n \"<span style='color: red'>&hearts;</span> $hearts<br/>\" .\n \"<span style='color: red'>&diams;</span> $diamonds<br/>\" .\n \"<span style='color: black'>&clubs;</span> $clubs<br/>\" .\n \"</span>\";\n}", "public function red($str)\n {\n return \"\\033[0;31m$str\\033[0m\";\n }", "public function getColor() {}", "public function getColor() {}", "public static function lookup($color)\n {\n return ['rgb' => self::BUILTIN_COLOR_MAP[$color] ?? '000000'];\n }", "public static function DeclarationWithStringHexColorValue($stringHexColorValue) {\n $instance = new parent(\"color\", \":\" . $stringHexColorValue); //arrumar\n return $instance;\n }", "function checkhexcolor($color2)\n{\n return preg_match('/^#[a-f0-9]{6}$/i', $color2);\n}", "function saveColor($color){\n\t\t# You could do that with the hex2rbg function.\n\t\t# $dbh->saveColor(hex2rbg($hex));\n\t\t# Not that it would do any harm, but then you would be wondering why you have no lights :>\n\n\t\t$pdo = $this->db->prepare(\"INSERT INTO colors (red,green,blue,time) VALUES (?,?,?,?)\");\n\n\t\tif($pdo->execute(array($red,$green,$blue,date(\"Y-m-d H:i:s\")))){\n\n\t\t\treturn \"Color saved.\";\n\t\t}\n\t}", "function checkhexcolor($color) {\n\n\treturn preg_match('/^#[a-f0-9]{6}$/i', $color);\n\n}", "function __construct($color, $name){\n\t\t$this->color = $color;\n\t\t$this->name = $name;\n\t}", "public function ov_color($name, $value = null){\n $args = func_get_args(); array_shift($args); array_shift($args);\n if( !isset($value) || strlen(trim($value)) < 1 ) $value = '#000000';\n return $this->generate_input('color', $name, $value, true, $args);\n }", "private function colorize(string $characters, string $color): string\n {\n if (!isset(self::POSIX_COLOR_CODES[strtolower($color)])) {\n return $characters;\n }\n\n return \"<<$color>>$characters<<\".OutputWriter::COLOR_DEFAULT.'>>';\n }", "function checkhexcolor($color){\n return preg_match('/^#[a-f0-9]{6}$/i', $color);\n}", "function debug_data($text, $color = '')\n{\n\tswitch ($color)\n\t{\n\t\tcase 'red': $color = 31; break;\n\t\tcase 'green': $color = 32; break;\n\t\tcase 'orange': $color = 33; break;\n\t\tcase 'blue': $color = 34; break;\n\t}\n\tif ($color)\n\t{\n\t\techo \"\\033[\".$color.\"m\";\n\t}\n\techo $text.\"\\n\";\n\tif ($color)\n\t{\n\t\techo \"\\033[0m\";\n\t}\n\tflush();\n\t// ob_flush();\n}", "public function getSpecificSymbol() {\n return $this->specificSymbol;\n }", "public function getColorName()\n {\n return $this->color_name;\n }", "protected function _bgColor($color, $string)\n {\n return \"\\033[\" . $this->_colors['background'][$color] . 'm' . $string . \"\\033[0m\";\n }", "function rsh($spades, $hearts, $diamonds, $clubs) {\n if ($spades === '') {\n $spades = ' &ndash;';\n }\n if ($hearts === '') {\n $hearts = ' &ndash;';\n }\n if ($diamonds === '') {\n $diamonds = ' &ndash;';\n }\n if ($clubs === '') {\n $clubs = ' &ndash;';\n }\n return \"<span style='color: black'>&spades;</span>$spades \" .\n \"<span style='color: red'>&hearts;</span>$hearts \" .\n \"<span style='color: red'>&diams;</span>$diamonds \" .\n \"<span style='color: black'>&clubs;</span>$clubs</span>\";\n}", "public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}", "function haira_setup_scss_vars ($contents, $custom_vars) {\n $linenum = 0;\n foreach($contents as $key=>$line)\n {\n if (preg_match('/[ ]*([\\/]{2})?[ ]*(.*?):(.*?);/is', $line, $matches))\n { \n $varName = trim(substr($matches[2], 1));\n $varValue = $matches[3];\n \n if ( isset ( $custom_vars[$varName] ) && $custom_vars[$varName] != '' ) {\n $contents[ $key ] = '$' . $varName . ': ' . $custom_vars[ $varName ] . \";\\n\";\n }\n \n }\n }\n\n return implode($contents);\n\n}", "function mc_shift_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\t$rgb = '';\n\t$percent = ( mc_inverse_color( $color ) == '#ffffff' ) ? - 20 : 20;\n\t$per = $percent / 100 * 255;\n\t// Percentage to work with. Change middle figure to control color temperature.\n\tif ( $per < 0 ) {\n\t\t// DARKER.\n\t\t$per = abs( $per ); // Turns Neg Number to Pos Number.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) - $per;\n\t\t\t$c = ( $c < 0 ) ? 0 : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t} else {\n\t\t// LIGHTER.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) + $per;\n\t\t\t$c = ( $c > 255 ) ? 'ff' : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t}\n\n\treturn '#' . $rgb;\n}", "function getColor(): string\n{\n $arrColors = [\n 'AliceBlue',\n 'AntiqueWhite',\n 'Aqua',\n 'Aquamarine',\n 'Azure',\n 'Beige',\n 'Bisque',\n 'Black',\n 'BlanchedAlmond',\n 'Blue',\n 'BlueViolet',\n 'Brown',\n 'BurlyWood',\n 'CadetBlue',\n 'Chartreuse',\n 'Chocolate',\n 'Coral',\n 'CornflowerBlue',\n 'Cornsilk',\n 'Crimson',\n 'Cyan',\n 'DarkBlue',\n 'DarkCyan',\n 'DarkGoldenRod',\n 'DarkGray',\n 'DarkGrey',\n 'DarkGreen',\n 'DarkKhaki',\n 'DarkMagenta',\n 'DarkOliveGreen',\n 'Darkorange',\n 'DarkOrchid',\n 'DarkRed',\n 'DarkSalmon',\n 'DarkSeaGreen',\n 'DarkSlateBlue',\n 'DarkSlateGray',\n 'DarkSlateGrey',\n 'DarkTurquoise',\n 'DarkViolet',\n 'DeepPink',\n 'DeepSkyBlue',\n 'DimGray',\n 'DimGrey',\n 'DodgerBlue',\n 'FireBrick',\n 'FloralWhite',\n 'ForestGreen',\n 'Fuchsia',\n 'Gainsboro',\n 'GhostWhite',\n 'Gold',\n 'GoldenRod',\n 'Gray',\n 'Grey',\n 'Green',\n 'GreenYellow',\n 'HoneyDew',\n 'HotPink',\n 'IndianRed',\n 'Indigo',\n 'Ivory',\n 'Khaki',\n 'Lavender',\n 'LavenderBlush',\n 'LawnGreen',\n 'LemonChiffon',\n 'LightBlue',\n 'LightCoral',\n 'LightCyan',\n 'LightGoldenRodYellow',\n 'LightGray',\n 'LightGrey',\n 'LightGreen',\n 'LightPink',\n 'LightSalmon',\n 'LightSeaGreen',\n 'LightSkyBlue',\n 'LightSlateGray',\n 'LightSlateGrey',\n 'LightSteelBlue',\n 'LightYellow',\n 'Lime',\n 'LimeGreen',\n 'Linen',\n 'Magenta',\n 'Maroon',\n 'MediumAquaMarine',\n 'MediumBlue',\n 'MediumOrchid',\n 'MediumPurple',\n 'MediumSeaGreen',\n 'MediumSlateBlue',\n 'MediumSpringGreen',\n 'MediumTurquoise',\n 'MediumVioletRed',\n 'MidnightBlue',\n 'MintCream',\n 'MistyRose',\n 'Moccasin',\n 'NavajoWhite',\n 'Navy',\n 'OldLace',\n 'Olive',\n 'OliveDrab',\n 'Orange',\n 'OrangeRed',\n 'Orchid',\n 'PaleGoldenRod',\n 'PaleGreen',\n 'PaleTurquoise',\n 'PaleVioletRed',\n 'PapayaWhip',\n 'PeachPuff',\n 'Peru',\n 'Pink',\n 'Plum',\n 'PowderBlue',\n 'Purple',\n 'Red',\n 'RosyBrown',\n 'RoyalBlue',\n 'SaddleBrown',\n 'Salmon',\n 'SandyBrown',\n 'SeaGreen',\n 'SeaShell',\n 'Sienna',\n 'Silver',\n 'SkyBlue',\n 'SlateBlue',\n 'SlateGray',\n 'SlateGrey',\n 'Snow',\n 'SpringGreen',\n 'SteelBlue',\n 'Tan',\n 'Teal',\n 'Thistle',\n 'Tomato',\n 'Turquoise',\n 'Violet',\n 'Wheat',\n 'White',\n 'WhiteSmoke',\n 'Yellow',\n 'YellowGreen'\n ];\n\n return array_rand(array_flip($arrColors));\n}", "function image_color_svg($svg_string, $color)\n{\n $color = image_hex_color($color);\n return preg_replace('/fill=\"[^\"]*\"/', 'fill=\"'.$color.'\"', $svg_string);\n}", "function renderNumDollarSigns($numds) {\n if ($numds === 0) {\n return \"FREE\";\n } else if ($numds === 1) {\n return \"$\";\n } else if ($numds === 2) {\n return \"$$\";\n } else if ($numds === 3) {\n return \"$$$\";\n } else {\n return \"$\";\n }\n }", "public function getSymbol()\n\t{\n\t\treturn $this->symbol;\n\t}", "function wp_tinycolor_string_to_rgb($color_str)\n {\n }", "public function red($text) {\n return $this->begin() . $this->formats['red'] . $text . $this->end();\n }", "function print_color($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<span class=\"numbersign\">&#35;</span><input class=\"option-input option-color\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"text\" value=\"'.$input_value.'\" />';\n\t\techo '<div class=\"color-preview\" style=\"background-color:#'.$input_value.'\"></div>';\n\t\t$this->close_option($value);\n\t}", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "public function getSymbol()\n {\n return $this->symbol;\n }", "public function getSymbol()\n {\n return $this->symbol;\n }" ]
[ "0.6028117", "0.5874035", "0.56736296", "0.5657146", "0.5609677", "0.5533878", "0.55163425", "0.5491344", "0.54891753", "0.54217833", "0.5363978", "0.536352", "0.53466445", "0.53377324", "0.5311443", "0.529181", "0.52805626", "0.52678543", "0.5264182", "0.5260025", "0.5226215", "0.5207641", "0.5200869", "0.51915365", "0.5168532", "0.5149862", "0.5118766", "0.5116324", "0.511555", "0.5108653", "0.5093774", "0.5077174", "0.50474566", "0.50413626", "0.5027652", "0.5013181", "0.5012273", "0.50092137", "0.5007417", "0.50038373", "0.5001298", "0.49987707", "0.49864888", "0.49838555", "0.49827406", "0.49808893", "0.49782827", "0.49665394", "0.49613124", "0.49588948", "0.49500558", "0.49288428", "0.49282816", "0.4925424", "0.49178746", "0.4905447", "0.48945594", "0.48934934", "0.4882567", "0.48739758", "0.4865876", "0.48646095", "0.48636952", "0.48632902", "0.48622024", "0.48601687", "0.48588097", "0.4852026", "0.48497924", "0.48497924", "0.48339218", "0.48328084", "0.48298872", "0.48059344", "0.48025483", "0.47935942", "0.4788924", "0.47860777", "0.4785479", "0.47801203", "0.47765183", "0.4775103", "0.4767174", "0.47591728", "0.47586745", "0.47579128", "0.47570655", "0.47569564", "0.47524485", "0.4751966", "0.47462445", "0.47441688", "0.47425005", "0.47362927", "0.47315282", "0.47315282", "0.47315282", "0.47315282", "0.47291896", "0.47291896" ]
0.4832218
72
/ Moves a card from the player's deck to the card stack, if the move is valid. Returns whether the move was, in fact, valid. Note: does not handle drawing cards from the pile in case of plustwo etc...
function placeCard($userId, $card) { $gameId = getGameOf($userId); $info = parcoursRs(SQLSelect("select * from games where id = $gameId"))[0]; $deck = getDeck($userId); $placed = getPlacedCards($gameId); $lastPlaced = end($placed); $sym = cardSymbol($card); $color = cardColor($card); // Sanity checks if ($gameId == NOT_IN_GAME || $info["user_to_play"] != $userId || !(in_array($card, $deck) || in_array($sym, $deck)) || $info["has_started"] != 1 || strpos($card, "-") === false) { return false; } // TODO!!! Disallow +4 when other colors could work // Check that this move would in fact be valid // i.e. if good color || joker || +4 || good symbol (number, reverse, plustwo, skip)) if (cardColor($lastPlaced) == $color || $sym == "joker" || $sym == "plusfour" || cardSymbol($lastPlaced) == $sym) { if ($sym == "reverse") { $info["direction"] = $info["direction"] == 0 ? 1 : 0; } // If there are only two players, the reverse card acts as a skip card if ($sym != "skip" && !($sym == "reverse" && count(getPlayers($gameId)) == 2)) { $info["user_to_play"] = nextToPlay($gameId, $info["direction"]); } $toDraw = 0; if ($sym == "plustwo") { $toDraw = 2; } else if ($sym == "plusfour") { $toDraw = 4; } // Delete something that actually exists in the db $toDelete = in_array($sym, array("joker", "plusfour")) ? $sym : $card; SQLDelete("delete from decks where user_id = $userId and card_name = '$toDelete'"); SQLInsert("insert into placed_cards (game_id, card_name) values ($gameId, '$card')"); SQLUpdate("update games set user_to_play = $info[user_to_play], direction = $info[direction] where id = $gameId"); SQLUpdate("update users set cards_to_draw = $toDraw where id = $info[user_to_play]"); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "abstract public function moveCard(int $card_id, string $location, int $location_arg = 0);", "function game(&$deck,&$players,&$stack)\n{\n $end = false;\n $skip = false;\n $takeCards = 0;\n\n //now the turns will begin until the game ends\n while($end != true)\n {\n //loop through players\n foreach ($players as &$p)\n {\n //check last played card\n $stackIndex = count($stack)-1;\n $lastcard = $stack[$stackIndex];\n\n if ($skip) {\n echo $p['name'].\" has to skip their turn.<br>\";\n $skip = false;\n continue;\n }\n\n $index = 0;\n $played = false;\n $turn = true;\n\n while($turn)\n {\n //Loop through the players hand to find compatible card if the player hasn't played yet\n if ($takeCards > 0){\n foreach ($p['hand'] as &$h)\n {\n //check if this card is compatible with the card on the stack\n if($h['name'] == '2')\n {\n if($h['name'] === '2')\n {\n $takeCards = $takeCards+2;\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take \" . $takeCards . \" cards or play a 2.<br>\";\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n $played = true;\n $turn = false;\n }\n $index++;\n }\n if (!$played) {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack,$takeCards);\n $turn = false;\n $takeCards = 0;\n }\n } else {\n foreach ($p['hand'] as &$h)\n {\n if(!$played && !$end)\n {\n\n //check if this card is compatible with the card on the stack\n if($h['name'] == $lastcard['name']|| $h['symbol'] == $lastcard['symbol'])\n {\n if($h['name'] === '7')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 7 they can play again.<br>\";\n }else if($h['name'] === '8')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 8 the next player has to skip their turn.<br>\";\n $skip = true;\n }else if($h['name'] === '2')\n {\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\". Since it is a 2 the next player has to take 2 cards or play a 2.<br>\";\n $takeCards = $takeCards+2;\n } else{\n echo $p['name'].' plays '.$h['name'].$h['symbol'].\".<br>\";\n }\n array_push($stack,$h);\n array_splice($p['hand'],$index,1);\n if($h['name'] != '7')\n {\n $played = true;\n $turn = false;\n }\n }\n }\n $index++;\n }\n\n //check if players hand is empty, if so game is over\n if(count($p['hand']) == 0)\n {\n echo $p['name'].' won<br>';\n $end = true;\n die();\n }\n\n //check if the players has played this turn, else take a card\n if (!$played)\n {\n echo $p['name'].\" can't play, \";\n dealCards($deck,$p,$stack);\n $turn = false;\n }\n }\n }\n }\n }\n}", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "abstract protected function move($board);", "public function testComputerMove()\n {\n $this->assertFalse($this->game->computerMove(3));\n $this->game->startNextTurn();\n $this->assertTrue($this->game->computerMove(3));\n\n // Add points to currentPoints enough to pass treshhold\n // computerMove should return false\n $this->diceHand->addToSerie(6);\n $this->diceHand->addToSerie(6);\n $this->game->checkHand($this->diceHand);\n $this->game->checkHand($this->diceHand);\n $this->assertFalse($this->game->computerMove(3.5));\n }", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "protected function moveCardUpdateStatus()\n {\n $member = $this->getActingMember();\n\n /** @var Emagedev_Trello_Model_Card $card */\n $card = Mage::getModel('trello/card');\n\n $card->loadFromTrello($this->getPayload()['card']['id']);\n\n if (!$card || !$card->getId()) {\n $this->getDataHelper()->log('Cannot find card to update ' . $this->getPayload()['card']['id'], Zend_Log::ERR);\n return false;\n }\n\n $order = $card->getOrder();\n\n /** @var Emagedev_Trello_Model_List $newList */\n $newList = Mage::getModel('trello/list');\n\n $newList->loadFromTrello($this->getPayload()['listAfter']['id']);\n\n if (!$newList || !$newList->getId()) {\n $this->getDataHelper()->log('Cannot find list ' . $this->getPayload()['listAfter']['id'] .\n ' to to move card ' . $this->getPayload()['card']['id'], Zend_Log::ERR);\n return false;\n }\n\n $this->getDataHelper()->log('Update order #' . $order->getIncrementId() . ' status to ' . $newList->getStatus(), Zend_Log::DEBUG);\n\n /** @var Mage_Sales_Model_Order_Status_History $commentModel */\n $commentModel = $order->addStatusHistoryComment('', $newList->getStatus());\n\n $commentModel\n ->setIsVisibleOnFront(true)\n ->setIsCustomerNotified(false);\n\n Mage::dispatchEvent(\n 'trello_webhook_comment_order_card_before', array(\n 'member' => $member,\n 'card' => $card,\n 'order' => $order,\n 'status_history' => $commentModel\n ));\n\n $commentModel->save();\n\n Mage::dispatchEvent(\n 'trello_webhook_comment_order_card_after', array(\n 'member' => $member,\n 'card' => $card,\n 'order' => $order,\n 'status_history' => $commentModel\n ));\n\n $order->save();\n\n return true;\n }", "function tryMove($place){\n if($this->goNoGoForLaunch($place)){\n $this->move($place);\n return TRUE;\n }else{\n return False;\n }\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "public function updateCard()\n {\n /**\n * Because we can only specify exact action by its translation code\n */\n switch ($this->getDisplay()['translationKey']) {\n case self::CARD_MOVE_ACTION_TRANSLATION_KEY:\n $this->getDataHelper()->log('Status update by translation key ' . $this->getDisplay()['translationKey'], Zend_Log::DEBUG);\n return $this->moveCardUpdateStatus();\n case self::CARD_UPDATE_DESCRIPTION_ACTION_TRANSLATION_KEY:\n $this->getDataHelper()->log('Description update by translation key ' . $this->getDisplay()['translationKey'], Zend_Log::DEBUG);\n return $this->cardDescriptionUpdate();\n default:\n $this->getDataHelper()->log('Cannot process card update by translation key ' . $this->getDisplay()['translationKey'], Zend_Log::DEBUG);\n break;\n }\n\n return false;\n }", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "public function orderCards()\n {\n if (!$this->ordered) {\n $this->originalCards = $this->cards;\n $tmpCardsConnector = $this->cardsConnector;\n if (count($tmpCardsConnector[BoardingCardEnum::DESTINATION]) > 1 ||\n count($tmpCardsConnector[BoardingCardEnum::FROM]) > 1\n ) {\n throw new BoardingCardBrokenChainException();\n }\n $this->cards = [];\n $fromCard = $destCard = $nextCard = '';\n\n //to get the keys for dest and from\n foreach ($tmpCardsConnector[BoardingCardEnum::FROM] as $fromKey => $nan) {\n $nextCard = $fromCard = $fromKey;\n }\n foreach ($tmpCardsConnector[BoardingCardEnum::DESTINATION] as $destkey => $nan) {\n $destCard = $destkey;\n }\n\n while (isset($tmpCardsConnector[$nextCard]) && $nextCard !== $destCard) {\n $currentCard = $nextCard;\n $cardToUnset = 0;\n\n foreach ($tmpCardsConnector[$currentCard] as $key => $tmpCard) {\n if ($tmpCard->getFrom() == $currentCard) {\n $cardToUnset = $key;\n }\n }\n $this->cards[] = $tmpCardsConnector[$currentCard][$cardToUnset];\n $nextCard = $tmpCardsConnector[$currentCard][$cardToUnset]->getDestination();\n unset($tmpCardsConnector[$currentCard][$cardToUnset]);\n if (count($tmpCardsConnector[$currentCard]) == 0) {\n unset($tmpCardsConnector[$currentCard]);\n }\n }\n\n $this->ordered = true;\n }\n }", "function checkAndPushCardIntoNestedDogmaStack($card) {\n $player_id = self::getGameStateValue('current_player_under_dogma_effect');\n if ($card['non_demand_effect_1'] === null) { // There is no non-demand effect\n self::notifyGeneralInfo(clienttranslate('There is no non-demand effect on this card.'));\n // No exclusive execution: do nothing\n return;\n }\n if ($card['non_demand_effect_2'] !== null) { // There are 2 or 3 non-demand effects\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} execute the non-demand effects of this card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} executes the non-demand effects of this card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else { // There is a single non-demand effect\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} execute the non-demand effect of this card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} executes the non-demand effect of this card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n self::pushCardIntoNestedDogmaStack($card);\n }", "private function isKingInMate(int $color): bool\n {\n $board = $this->getBoard();\n $flattenBoard = array_merge(...$this->getBoard());\n $coords = $this->getKingCoords($color);\n\n for ($row = 0; $row <= 2; ++$row) {\n for ($col = 0; $col <= 2; ++$col) {\n $x = $coords[0] + (1 - $row);\n $y = $coords[1] + (1 - $col);\n if (\n ($x > 7 || $x < 0) ||\n ($y > 7 || $y < 0) ||\n ($y === $coords[1] && $x === $coords[0]) ||\n !$this->isReachable($coords, [$x, $y])\n ) {\n continue;\n }\n\n $this->board[$y][$x] = $this->board[$coords[1]][$coords[0]];\n $this->board[$coords[1]][$coords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n $this->board = $board;\n\n foreach ($flattenBoard as $piece) {\n if (!($piece instanceof Piece) || $piece instanceof King) {\n continue;\n }\n if ($piece->getColor() !== $color) {\n continue;\n }\n\n $pieceCoords = $piece->getCoords();\n for ($y = 0; $y < 8; ++$y) {\n for ($x = 0; $x < 8; ++$x) {\n $this->board = $board;\n $move = $piece->checkMove($x, $y, $board, $this->getMoveNumber());\n if (!$move || !$this->isReachable($pieceCoords, [$x, $y])) {\n continue;\n }\n $this->board[$y][$x] = $this->board[$pieceCoords[1]][$pieceCoords[0]];\n $this->board[$pieceCoords[1]][$pieceCoords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n }\n return true;\n }", "private function move($from, $to)\n\t{\n\t\t$marble = & $this->board[$from[0]][$from[1]];\n\t\t$dest = & $this->board[$to[0]][$to[1]];\n\t\t\n\t\t$jump0 = $from[0];\n\t\t$jump1 = $from[1];\n\t\t\n\t\tif($from[0] < $to[0])\n\t\t{\n\t\t\t$jump0++;\n\t\t}\n\t\telseif($from[0] > $to[0])\n\t\t{\n\t\t\t$jump0--;\n\t\t}\n\t\telseif($from[1] < $to[1])\n\t\t{\n\t\t\t$jump1++;\n\t\t}\n\t\telseif($from[1] > $to[1])\n\t\t{\n\t\t\t$jump1--;\n\t\t}\n\t\t\n\t\t$jump = & $this->board[$jump0][$jump1];\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif($marble->hasMarble && $jump->hasMarble && !$dest->hasMarble)\n\t\t\t{\n\t\t\t\t$marble->hasMarble = false;\n\t\t\t\t$jump->hasMarble = false;\n\t\t\t\t$dest->hasMarble = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($this->renderPlay)\n\t\t\t{\n\t\t\t\techo $this->renderBoard();\n\t\t\t}\n\t\t\t\n\t\t\t$this->moves[] = array($from, $to);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tcatch(Exception $e) // Not a valid move\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function _canMove($case)\n {\n if ($case === '#' || (!$this->bIsBeer && $case === 'X')) {\n return false;\n }\n return true;\n }", "function removefromnew($card) {\n\tglobal $new_deck ;\n\tforeach ( $new_deck->main as $id => $new_card ) {\n\t\tif ( $card->id == $new_card->id ) {\n\t\t\tarray_splice($new_deck->main, $id, 1) ;\n\t\t\treturn false ;\n\t\t}\n\t}\n\tforeach ( $new_deck->side as $id => $new_card ) {\n\t\tif ( $card->id == $new_card->id ) {\n\t\t\tarray_splice($new_deck->side, $id, 1) ;\n\t\t\treturn false ;\n\t\t}\n\t}\n\treturn true ;\n}", "public function move()\n\t{\n \n $data['kingdom'] = $this->kingdom_model->get_kingdom();\n if($data['kingdom']==null) {\n //error_no_kingdom_yet : 4\n $this->respond_errors(\"error no kingdom yet\",400);\n return;\n }\n $kingdom=$this->kingdom_model->mapper($data['kingdom']);\n \n \n $data[\"queen\"]= $this->queen_model->get_queen();\n if($data['queen']==null) {\n //error_no_queen_yet : 405\n $this->respond_errors(\"error no queen yet\",405);\n return;\n }\n $queen=$this->queen_model->mapper($data['queen']);\n\n $queen->move();\n //if there are no validation errors\n $errors=$queen->validate($kingdom);\n if (sizeof($errors)>0){\n //kingdom_constraint_validation_error:3\n $this->respond_errors($errors,300);\n\n }else{\n $data['queen'] = $this->queen_model->update_queen_pos($queen);\n $this->respond($queen,200);\n }\n\n }", "public function moveNorth($player) {\n $position = $player->getPosition();\n // check if move is legal if the 'players' field exists there\n if(isset($this->dungeon[$position[0]]->row[$position[1] - 1]->col[$position[2]]->players)) {\n // remove that player from the current position\n $this->removePlayerFromPosition($player, $position);\n array_push($this->dungeon[$position[0]]->row[$position[1] - 1]->col[$position[2]]->players, $player->getName());\n return true;\n }\n return false;\n }", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "public function move(string $key, int $db): bool\n {\n return $this->redis->move($key, $db);\n }", "public function move(string $direction)\n {\n switch ($direction) {\n case 'E':\n $newXposition = $this->currentXPosition + 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n ++$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'W':\n $newXposition = $this->currentXPosition - 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n --$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'S':\n $newYposition = $this->currentYPosition + 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n ++$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'N':\n $newYposition = $this->currentYPosition - 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n --$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n default:\n return true;\n break;\n }\n }", "abstract public function moveAsFirst(): bool;", "public function addCard(): bool {\n if($this->id == 0) { # Card doesn't exist yet\n if($result = $this->mysqli->query(\"INSERT INTO cards (card_num, name, billing_address, exp, security_code) VALUES ('{$this->cardNum}', '{$this->name}', '{$this->billingAddress}', '{$this->exp}', '{$this->securityCode}')\")) {\n # INSERT query successful\n $lastEntry = $this->mysqli->query(\"SELECT max(id) FROM cards\")->fetch_assoc();\n $this->id = $lastEntry['max(id)'];\n return true;\n } else { # INSERT query failed\n return false;\n }\n } else { # Card does exist in database\n return false;\n }\n }", "function place_card($thecard_stack,$thecard,$attackmode=0,$statustring)\n{\n//##############################################################\nglobal $conn_pag2;\nglobal $table_allgames;\nglobal $table_allusers;\n//##############################################################\n\t\t//attack mode different control\nif($attackmode)\n\t{\n\t\n\t}\n//##############################################################\nelse\n\t{\n//##############################################################\n\t//grad the user id\n$thecurrentuserid=get_the_id($conn_pag2,);\n//##############################################################\n\t//grab the game hash\n\t//get the current_gamehash\n$result_get_game_hash=mysqli_query($conn_pag2,\"select game_id from '$table_allgames' where (id1='$thecurrentuserid' or id2='$thecurrentuserid') and active=1\");\n$answer_get_the_game_hash=mysqli_fetch_array($result_get_the_game_hash);\n$the_game_hash=$answer_get_the_game_hash['game_id'];\n//##############################################################\n\t//extract the status string\n\n$result_get_status_string=mysqli_query($conn_pag2,\"select '$statustring' from '$table_allgames' where game_id='$the_game_hash'\");\n$answer_get_status_string=mysqli_fetch_array($result_get_status_string);\n$theold_status_actual=$answer_get_status_string[$statustring];\n//##############################################################\n\tif($thecard_stack='C')\n\t\t{\n\t\t$thefirstbracketpostion=strpos($theold_status_actual,\"(\");\n\t\t$replacement=\"(\".$thecard.',';\n\t\t$thenew_status_actual=str_replace(\"(\",$replacement,$theold_status_actual,1);\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='S1')\n\t\t{\n\t\t$the\n\t\t}\n\t\n\tif($thecard_stack='S2')\n\t\t{\n\t\t\n\t\t}\n\n\tif($thecard_stack='S3')\n\t\t{\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='D')\n\t\t{\n\t\t\n\t\t}\n\t\n\tif($thecard_stack='A')\n\t\t{\n\t\t\n\t\t}\n\t}\n}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "function cardIsAce($card) {\n\tif ($card == 'Ace') {\n\t\treturn true;\n\t} \n\t\treturn false;\n}", "function Move($rowNumber = 0) \n\t{\n\t\tif ($rowNumber == $this->_currentRow) return true;\n\t\t$this->EOF = false;\n \t\tif ($this->_numOfRows > 0){\n\t\t\tif ($rowNumber >= $this->_numOfRows - 1){\n\t\t\t\t$rowNumber = $this->_numOfRows - 1;\n\t\t\t}\n \t\t}\n\n\t\tif (array_key_exists($this->rows,$rowNumber)) {\n\t\t\t$this->_currentRow = $rowNumber;\n\t\t\tif ($this->_fetch()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$this->fields = false;\t\n\t\t}\n\t\t$this->EOF = true;\n\t\treturn false;\n\t}", "public function testCardConstruct()\n\t{\n\t\t$expectedSuits = array('s', 'h', 'd', 'c');\n\t\t$expectedRanks = explode(',', '2,3,4,5,6,7,8,9,10,J,Q,K,A');\n\t\tforeach ($expectedSuits as $suit)\n\t\t{\n\t\t\tforeach ($expectedRanks as $rank)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$Card = new Card($suit, $rank);\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* test invalid suit */\n\t\t$suit = 'x';\n\t\t$rank = '10';\n\t\ttry\n\t\t{\n\t\t\t$Card = new Card($suit, $rank);\n\t\t\treturn false;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\t\n\t\t/* test invalid rank (explicit) */\n\t\t$suit = 's';\n\t\t$rank = '11';\n\t\ttry\n\t\t{\n\t\t\t$Card = new Card($suit, $rank);\n\t\t\treturn false;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\t\n\t\t// all tests passed\n\t\treturn true;\n\t}", "public function playCard($playCard, Deck $deck)\r\n {\r\n foreach ($this->hand as $index => $value) {\r\n $this->count = 0;\r\n\r\n $cardCanBePlayed = $value[0] == $playCard[0] || $value[1] == $playCard[1];\r\n if ($cardCanBePlayed) {\r\n echo $this->name . ' played ' . $value[1] . ' of ' . $value[0]; // method\r\n echo \"<br>\";\r\n\r\n $playCard = $this->hand[$index]; //refractor name\r\n unset($this->hand[$index]);\r\n return $playCard;\r\n }\r\n }\r\n\r\n if ($deck->getDeckSize() == 0) { // S stands for SOLID\r\n $this->count++;\r\n return $playCard;\r\n }\r\n\r\n $this->takeCard($deck, $this); // method\r\n echo $this->name . ' draws card';\r\n echo \"<br>\";\r\n return $playCard;\r\n }", "public function push($card)\n {\n return array_push($this->deck, $card);\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "public function testCannotMoveWhenMove()\r\n {\r\n $this->myTestcar = new Car(new moveCarState());\r\n $this->myTestcar->move();\r\n }", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "public function unshift($card)\n {\n return array_unshift($this->deck, $card);\n }", "private function move() {\n if ($this->facing === 'N') {\n $this->y++;\n } else if ($this->facing === 'E') {\n $this->x++;\n } else if ($this->facing === 'S') {\n $this->y--;\n } else if ($this->facing === 'W') {\n $this->x--;\n }\n \n // Check if we are still on the planet.\n if (($this->x < 0 || $this->x > $this->maxX) || ($this->y < 0 || $this->y > $this->maxY)) {\n // Out of safe planet boundaries.\n $this->crash = true;\n }\n }", "public static function move($m, $n, $board)\n {\n // Is cell dirty?\n if (static::cellIsDirty($m, $n, $board)) {\n echo \"CLEAN\";\n return \"CLEAN\";\n }\n\n // Attempt to move right if we are on an odd number row.\n if (($m + 1) % 2 > 0) {\n if (static::moveIsValid($m, $n + 1, $board)) {\n echo \"RIGHT\";\n return \"RIGHT\";\n }\n }\n\n // Attempt to move left if we are on an even number row.\n if (($m + 1) % 2 === 0) {\n if (static::moveIsValid($m, $n - 1, $board)) {\n echo \"LEFT\";\n return \"LEFT\";\n }\n }\n\n // Can we move down?\n if (static::moveIsValid($m + 1, $n, $board)) {\n echo \"DOWN\";\n return \"DOWN\";\n }\n }", "public function moveUp($player) {\n $position = $player->getPosition();\n if(isset($this->dungeon[$position[0] + 1]->row[$position[1]]->col[$position[2]]->players)) {\n $this->removePlayerFromPosition($player, $position);\n array_push($this->dungeon[$position[0] + 1]->row[$position[1]]->col[$position[2]]->players, $player->getName());\n return true;\n }\n return false;\n }", "public function isDriverCard(Card $card): bool\n {\n return $this->cardTypeService->getDriverCardType()->id === $card->card_type_id;\n }", "public function hasCard(string $card): bool\n {\n return \\array_key_exists($card, $this->getGroups());\n }", "public function moveIsValid($m, $n, $board)\n {\n // Guard against out of range m coordinate.\n if ($m < 0 || $m > count($board) - 1) {\n return false;\n }\n\n // Guard against out of range n coordinate.\n if ($n < 0) {\n return false;\n }\n\n return substr($board[$m], $n) != false;\n }", "function PlayerPass( $pos )\r\n \t{\r\n\r\n\t\t$this->states[$pos] = 2;\r\n \t\tf_MQuery( \"UPDATE poker_draw_player SET state = 2 WHERE\r\n\t\t\t\tdraw_id = '{$this->draw_id}' AND seat = '$pos';\" );\r\n\r\n\t\t//2) next player and check ( for game end, next round, etc. )\r\n\r\n\t\t$this->MakeNextMove( );\r\n \t}", "private function canMoveTo($direction, $i, $j)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\n\t\t\tswitch($direction)\n\t\t\t{\n\t\t\t\tcase 'up':\n\t\t\t\t\t$jump = & $this->board[$i + 1][$j];\n\t\t\t\t\t$dest = & $this->board[$i + 2][$j];\n\t\t\t\t\t$return = array($i + 2, $j);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'right':\n\t\t\t\t\t$jump = & $this->board[$i][$j + 1];\n\t\t\t\t\t$dest = & $this->board[$i][$j + 2];\n\t\t\t\t\t$return = array($i, $j + 2);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'down':\n\t\t\t\t\t$jump = & $this->board[$i - 1][$j];\n\t\t\t\t\t$dest = & $this->board[$i - 2][$j];\n\t\t\t\t\t$return = array($i - 2, $j);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'left':\n\t\t\t\t\t$jump = & $this->board[$i][$j - 1];\n\t\t\t\t\t$dest = & $this->board[$i][$j - 2];\n\t\t\t\t\t$return = array($i, $j - 2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) // Some board position doesn't exists\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(\t$hole && $hole->hasMarble )\n\t\t{\n\t\t\tif(\t(!empty($jump) && $jump->hasMarble) && (!empty($dest) && !$dest->hasMarble) )\n\t\t\t{\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function cardIsAce($card) {\n\treturn strpos($card, \"A\");\n}", "public static function checkSuitIsCorrect(string $suit)\n {\n if (false === in_array($suit, SuitInterface::SUITS)) {\n throw CardException::incorrectSuit($suit);\n }\n }", "public function giveCard(Card $card)\n\t{\n\t\t$card->setGiven(true);\n\t\t$this->save($card, false);\n\t}", "public function needCard() {\n return FALSE;\n }", "function dealHandToPlayer($gameId, $hand, $playerId){\n $playerPosition = getPositionFromPlayerId($gameId, $playerId);\n if($playerPosition === false)\n return false;\n \n $conn = getDB();\n $sql = \"UPDATE games SET player\".$playerPosition.\"hand='\".$hand.\"' WHERE id=\".$gameId;\n if(!$conn->query($sql)){\n closeDB($conn);\n echo \"\\nFailed to run query in dealHandToPlayer!\\n\";\n return false;\n }\n closeDB($conn);\n return true;\n}", "protected static function isAllowdMove(array $move){\r\n\t\tif (!empty($move) && self::ALLOWD_MOVE == count($move)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function checkDeck(): bool\n {\n if (empty($this->chatSettings->getString(\"defaultCardDeck\")) ||\n !($this->chatSettings->get(\"cardDeck\") instanceof CardDeck)\n ) {\n $this->setReply(\"deckNotSet\");\n\n return false;\n }\n\n return true;\n }", "protected function playRecursive(int $level = 0): bool\n {\n $jsonHands = json_encode($this->hands[$level]);\n if (isset($this->previousHands[$level][$jsonHands])) {\n $this->winner = 1;\n return false;\n }\n // Compare cards!\n $cards = [];\n $topCardPlayer = null;\n foreach ($this->hands[$level] as $player => &$hand) {\n $topCard = array_shift($this->hands[$level][$player]);\n if (is_null($topCard)) continue;\n $cards[$player] = $topCard;\n if ($topCardPlayer === null || $cards[$player] > $cards[$topCardPlayer]) {\n $topCardPlayer = $player;\n }\n }\n // Finish the game when only one card was played\n if (count($cards) == 1) {\n array_unshift($this->hands[$level][$topCardPlayer], $cards[$topCardPlayer]);\n $this->winner = $topCardPlayer;\n return false;\n }\n // Check for recursive game\n $playRecursive = true;\n foreach ($cards as $player => $value) {\n if ($value > count($this->hands[$level][$player])) {\n $playRecursive = false;\n break;\n }\n }\n // Play recursive\n if ($playRecursive) {\n $nextLevel = $level + 1;\n foreach ($this->hands[$level] as $player => &$hand) {\n $this->hands[$nextLevel][$player] = array_slice($hand, 0, $cards[$player]);\n }\n while ($this->playRecursive($nextLevel));\n $topCardPlayer = $this->winner;\n unset($this->hands[$nextLevel]);\n unset($this->previousHands[$nextLevel]);\n }\n // Add cards to winner\n $firstPlayer = key($cards);\n if ($firstPlayer !== $topCardPlayer) {\n $cards = array_reverse($cards);\n }\n foreach ($cards as $card) {\n $this->hands[$level][$topCardPlayer][] = $card;\n }\n $this->previousHands[$level][$jsonHands] = true;\n return true;\n }", "public function execute(Player $player): bool {\r\n if(!$player->getInventory()->contains(Item::get(Item::STONE, 0, $this->cost))) return false;\r\n // remove stone\r\n $player->getInventory()->removeItem(Item::get(Item::STONE, 0, $this->cost));\r\n return true;\r\n }", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "abstract public function moveAllCardsInLocation(?string $from_location, string $to_location, ?int $from_location_arg = null, int $to_location_arg = 0);", "public function push($item): bool {\n if (!$this->isValid()) return false;\n\n $this->stack[$this->size] = $item;\n $this->size++;\n return true;\n }", "public static function isMatch(iDeck $deck) : bool;", "public function equals(MoveInterface $otherMove);", "function compare_cards($lhs, $rhs) {\n // Ignore the suit\n $lhs = substr($lhs, 1);\n $rhs = substr($rhs, 1);\n\n // Elevate the Aces\n if($lhs == 1) $lhs = 1000;\n if($rhs == 1) $rhs = 1000;\n\n // Spaceships!\n // Pew pew pew\n // and you said you'd never found a use for them...\n return $lhs <=> $rhs;\n}", "public function move($SrcPos, $DestPos) {\n\n\t\tif (is_null($this->_mpd->PLMoveTrack($SrcPos, $DestPos))) { return false; }\n\n \treturn true;\n\t}", "abstract public function hasAvailableMoves(): bool;", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public function transferPlayer(Player $player, $address, $port = 19132, $message = \"\"){\n\t\t$ev = new PlayerTransferEvent($player, $address, $port, $message);\n\t\t$this->getServer()->getPluginManager()->callEvent($ev);\n\t\tif($ev->isCancelled()){\n\t\t\treturn false;\n\t\t}\n\n\t\t$ip = $this->lookupAddress($ev->getAddress());\n\n\t\tif($ip === null){\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->cleanupMemory($player);\n\n\t\t$packet = new StrangePacket();\n\t\t$packet->address = $ip;\n\t\t$packet->port = $ev->getPort();\n\t\t$player->dataPacket($packet->setChannel(Network::CHANNEL_ENTITY_SPAWNING));\n\n\t\treturn true;\n\t}", "public function move(){\r\n\t\t\tif( empty($lastShot) ){\r\n\t\t\t\t$lastShot = new Play( $initialRow, $initialRow );\r\n\t\t\t\treturn $lastShot;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//if it is not empty, and is on the last cell\r\n\t\t\t\t//go to the first column of next row\r\n\t\t\t\tif( $lastShot.getX() == 10 ){\r\n\t\t\t\t\t$lastShot.setX( $initialRow );\r\n\t\t\t\t\t$lastShot.setY( $lastShot.getY() + 1 );\r\n\t\t\t\t}\r\n\t\t\t\t//if it is not in the last cell, then move 1 cell to the right.\r\n\t\t\t\telse{\r\n\t\t\t\t\t$lastShot.setX( $lastShot.getX() + 1 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function moveDown($player) {\n $position = $player->getPosition();\n if(isset($this->dungeon[$position[0] - 1]->row[$position[1]]->col[$position[2]]->players)) {\n $this->removePlayerFromPosition($player, $position);\n array_push($this->dungeon[$position[0] - 1]->row[$position[1]]->col[$position[2]]->players, $player->getName());\n return true;\n }\n return false;\n }", "public function removeCard($card) : void\n {\n if ($this->isEmpty()) {\n throw new \\Exception('Empty deck nothing to remove');\n }\n\n $cards = array_filter($this->cards, function (Card $c) use ($card) {\n return !$c->isEqual($card);\n });\n\n $this->cards = array_values($cards);\n }", "public function moveSouth($player) {\n $position = $player->getPosition();\n if(isset($this->dungeon[$position[0]]->row[$position[1] + 1]->col[$position[2]]->players)) {\n $this->removePlayerFromPosition($player, $position);\n array_push($this->dungeon[$position[0]]->row[$position[1] + 1]->col[$position[2]]->players, $player->getName());\n return true;\n }\n return false;\n }", "protected function shuffle_cards($deck = array()) {\n if(count($deck) == 0){\n $deck = $this->get_deck();\n }\n \n for ($i = 0; $i != $this->shuffle; $i++) {\n mt_srand((double) microtime() * 1000000);\n $offset = mt_rand(10, 40);\n //First we will split our deck cards:\n $sliced_cards[0] = array_slice($deck, 0, $offset);\n $sliced_cards[1] = array_slice($deck, $offset, 52);\n\n //Then Shuffle Eeach\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Reverse each pile\n $sliced_cards[0] = array_reverse($sliced_cards[0]);\n $sliced_cards[1] = array_reverse($sliced_cards[1]);\n\n //Re-Shuffle\n shuffle($sliced_cards[0]);\n shuffle($sliced_cards[1]);\n\n //Merge both stacks\n $unsliced = array_merge($sliced_cards[0], $sliced_cards[1]);\n\n //And another shuffle\n shuffle($unsliced);\n\n //Add in a flip\n array_flip($unsliced);\n }\n $this->set_deck($unsliced);\n\n return $this;\n }", "protected function isSavedCardTransaction(\\XLite\\Model\\Payment\\Transaction $transaction)\n {\n return static::METHOD_SAVED_CARD == $transaction->getPaymentMethod()->getClass();\n }", "function dogma($card_id) {\n self::checkAction('dogma');\n $player_id = self::getActivePlayerId();\n \n // Check if the player has this card really on his board\n $card = self::getCardInfo($card_id);\n \n if ($card['owner'] != $player_id || $card['location'] != \"board\") {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You do not have this card on board [Press F5 in case of troubles]\"));\n }\n if (!self::isTopBoardCard($card)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"This card is not on the top of the pile [Press F5 in case of troubles]\")); \n }\n \n // No cheating here\n \n // Stats\n if (self::getGameStateValue('has_second_action') || self::getGameStateValue('first_player_with_only_one_action') || self::getGameStateValue('second_player_with_only_one_action')) {\n self::incStat(1, 'turns_number');\n self::incStat(1, 'turns_number', $player_id);\n }\n self::incStat(1, 'actions_number');\n self::incStat(1, 'actions_number', $player_id);\n self::incStat(1, 'dogma_actions_number', $player_id);\n \n self::notifyDogma($card);\n \n $dogma_icon = $card['dogma_icon'];\n $ressource_column = 'player_icon_count_' . $dogma_icon;\n \n $players = self::getCollectionFromDB(self::format(\"SELECT player_id, player_no, player_team, {ressource_column} FROM player\", array('ressource_column' => $ressource_column)));\n $players_nb = count($players);\n \n // Compare players ressources on dogma icon_count;\n $dogma_player = $players[$player_id];\n $dogma_player_team = $dogma_player['player_team'];\n $dogma_player_ressource_count = $dogma_player[$ressource_column];\n $dogma_player_no = $dogma_player['player_no'];\n \n // Count each player ressources\n $players_ressource_count = array();\n foreach ($players as $id => $player) {\n $player_no = $player['player_no'];\n $player_ressource_count = $player[$ressource_column];\n $players_ressource_count[$player_no] = $player_ressource_count;\n $players_teams[$player_no] = $player['player_team'];\n \n self::notifyPlayerRessourceCount($id, $dogma_icon, $player_ressource_count);\n }\n\n $player_no = $dogma_player_no;\n $player_no_under_i_demand_effect = 0;\n $player_no_under_non_demand_effect = 0;\n \n $card_with_i_demand_effect = $card['i_demand_effect_1'] !== null;\n $card_with_non_demand_effect = $card['non_demand_effect_1'] !== null;\n \n // Loop on players finishing with the one who triggered the dogma\n do {\n if ($player_no == $players_nb) { // End of table reached, go back to the top\n $player_no = 1;\n }\n else { // Next row\n $player_no = $player_no + 1; \n }\n \n $player_ressource_count = $players_ressource_count[$player_no];\n \n // Mark the player\n if ($player_ressource_count >= $dogma_player_ressource_count) {\n $stronger_or_equal = \"TRUE\";\n $player_no_under_non_demand_effect++;\n $player_no_under_effect = $player_no_under_non_demand_effect;\n }\n else {\n $stronger_or_equal = \"FALSE\";\n if ($players_teams[$player_no] != $dogma_player_team) {\n $player_no_under_i_demand_effect++;\n $player_no_under_effect = $player_no_under_i_demand_effect;\n }\n else { // Player on the same team don't suffer the I demand effect of each other\n $player_no_under_effect = 0;\n }\n }\n self::DBQuery(self::format(\"\n UPDATE \n player\n SET\n stronger_or_equal = {stronger_or_equal},\n player_no_under_effect = {player_no_under_effect}\n WHERE\n player_no = {player_no}\"\n ,\n array('stronger_or_equal' => $stronger_or_equal, 'player_no_under_effect' => $player_no_under_effect, 'player_no' => $player_no)\n ));\n \n } while($player_no != $dogma_player_no);\n \n // Write info in global variables to prepare the first effect\n self::setGameStateValue('dogma_card_id', $card_id);\n self::setGameStateValue('current_effect_type', $card_with_i_demand_effect ? 0 : 1);\n self::setGameStateValue('current_effect_number', 1);\n self::setGameStateValue('sharing_bonus', 0);\n \n // Resolve the first dogma effet of the card\n self::trace('playerTurn->dogmaEffect (dogma)');\n $this->gamestate->nextState('dogmaEffect');\n }", "protected function returnCard()\n {\n $request = $this->request();\n\n $player = $this->getCurrentPlayer();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n // load deck\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $cardId = $request['return_card'];\n\n $this->service()->deck()->removeCard($deck, $cardId);\n }", "private function _isCardSaved() {\n\t $tokenId = (int) $this->getInfoInstance()->getAdditionalInformation('token_id');\n\t return (boolean)($this->getInfoInstance()->getAdditionalInformation('create_token') === 'true') &&\n\t !($tokenId && ($tokenId > 0));\n\t}", "public function testDealCard() {\n\t\t\t#test we have one card missing when we deal a card\n\t\t\t$d = new Deck();\n\t\t\t$this->assertEquals(True,is_object($d->dealCard()));\n\t\t\t$this->assertEquals(51,count($d->getDeck()));\n\t\t}", "function move($direction)\n\t{\n\t\t$cid\t= JRequest::getVar('cid', array(), 'post', 'array');\n\n\t\t$row = & JTable::getInstance('frontpage', 'Table');\n\t\tif (!$row->load((int) $cid[0])) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$row->move($direction, ' 1 ')) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isValidCard(Card $card)\n {\n $crawler = $this->client->request('POST', $this->url, ['relation_number' => $card->toString()]);\n\n $status = false;\n $crawler->filter('.alert.alert-success')->each(function () use (&$status) {\n $status = true;\n });\n\n return $status;\n }", "public function isCardValid()\n {\n return $this->isValidCard;\n }", "function initialMeld($card_id) {\n // Check that this is the player's turn and that it is a \"possible action\" at this game state\n self::checkAction('initialMeld');\n $player_id = self::getCurrentPlayerId();\n\n // Check if the player really has this card\n $card = self::getCardInfo($card_id);\n \n if ($card['owner'] != $player_id || $card['location'] != \"hand\") {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You do not have this card in hand [Press F5 in case of troubles]\"));\n }\n \n // No cheating here\n \n // Stats\n self::setStat(1, 'turns_number', $player_id); // First turn for this player\n if (self::getStat('turns_number') == 0) {\n self::setStat(1, 'turns_number'); // First turn for the table\n }\n \n // Mark it as selected\n self::markAsSelected($card_id, $player_id);\n \n // Notify\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} choose a card.'), array(\n 'You' => 'You' \n ));\n \n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} chooses a card.'), array(\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n // If that was the last player to choose his card, go on for the next state (whoBegins?), else, wait for remaining players\n $this->gamestate->setPlayerNonMultiactive($player_id, '');\n }", "public function resetDeck(){\n $this->startCard = new Card(14);\n\n for ($i = 1; $i <= 13; $i++) {\n if ($i == 6 or $i == 9) {\n continue;\n }\n else {\n if ($i == 1) {\n for ($j = 0; $j < 5; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n else {\n for ($j = 0; $j < 4; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n }\n }\n\n //Shuffle deck\n shuffle($this->cards);\n\n\n // card back\n $this->cardDrawn = new Card(14);\n }", "public function dealCardToHand(Player $player, HandBetPair $hand);", "public function move($uid) {\n\n $uid = str::slug($uid);\n\n if(empty($uid)) {\n throw new Exception('The uid is missing');\n }\n\n // don't do anything if the uid exists\n if($this->uid() === $uid) return true;\n\n // check for an existing page with the same UID\n if($this->siblings()->not($this)->find($uid)) {\n throw new Exception('A page with this uid already exists');\n }\n\n $dir = $this->isVisible() ? $this->num() . '-' . $uid : $uid;\n $root = dirname($this->root()) . DS . $dir;\n\n if(!dir::move($this->root(), $root)) {\n throw new Exception('The directory could not be moved');\n }\n\n $this->dirname = $dir;\n $this->root = $root;\n $this->uid = $uid;\n\n // assign a new id and uri\n $this->id = $this->uri = ltrim($this->parent->id() . '/' . $this->uid, '/');\n\n // clean the cache\n $this->kirby->cache()->flush();\n $this->reset();\n return true;\n\n }", "private static function isAlreadyTaken(array $move,array $gameBoard){\r\n\t\tif (self::isAllowdMove($move)){\r\n\t\t\treturn $gameBoard[$move[0]][$move[1]];\r\n\t\t}\r\n\t\r\n\t\tthrow new GameException('Unallowd move taken');\r\n\t}", "private function checkSunk($coords, $shooter = \"player\", $direction = null)\n {\n $coordsInfo = self::coordsInfo($coords);\n if (!in_array($shooter, array(\"player\", \"other\"))) {\n throw new \\InvalidArgumentException(\"Incorrect shooter (\" . $shooter . \")\");\n }\n\n $checkSunk = true;\n\n // neighbour coordinates, taking into consideration edge positions (A and J rows, 1 and 10 columns)\n $sunkCoords = array(\n $coordsInfo['position_y'] > 0 ? self::$axisY[$coordsInfo['position_y'] - 1] . $coordsInfo['coord_x'] : \"\",\n $coordsInfo['position_y'] < 9 ? self::$axisY[$coordsInfo['position_y'] + 1] . $coordsInfo['coord_x'] : \"\",\n $coordsInfo['position_x'] < 9 ? $coordsInfo['coord_y'] . self::$axisX[$coordsInfo['position_x'] + 1] : \"\",\n $coordsInfo['position_x'] > 0 ? $coordsInfo['coord_y'] . self::$axisX[$coordsInfo['position_x'] - 1] : \"\"\n );\n\n // try to find a mast which hasn't been hit\n foreach ($sunkCoords as $key => $value) {\n // if no coordinate on this side (end of the board) or direction is specified,\n // but it's not the specified one\n if ($value === \"\" || ($direction !== null && $direction !== $key)) {\n continue;\n }\n\n $ships = $shooter == \"player\" ? $this->oData->getOtherShips() : $this->oData->getPlayerShips();\n $shots = $shooter == \"player\" ? $this->oData->getPlayerShots() : $this->oData->getOtherShots();\n $ship = array_search($value, $ships);\n $shot = array_search($value, $shots);\n\n // if there's a mast there and it's been hit, check this direction for more masts\n if ($ship !== false && $shot !== false) {\n $checkSunk = $this->checkSunk($value, $shooter, $key);\n } elseif ($ship !== false) {\n // if mast hasn't been hit, the the ship can't be sunk\n $checkSunk = false;\n }\n\n\n if ($checkSunk === false) {\n break;\n }\n }\n\n return $checkSunk;\n }", "public function move($path) {\n\n if (!$this->exists())\n throw new Exception\\FileException(\"File not found\", 1);\n\n if (!rename($this->path, $path))\n throw new Exception\\FileException(\"Unknown error\", 0);\n\n return true;\n }", "public function playMoves()\n\t{\n\t\t$this->resetBoard();\n\t\t$moves = unserialize(serialize($this->moves));\n\t\t$this->resetMoves();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "public function addCard(string $card): void\n {\n if (false === $this->hasCard($card)) {\n $this->setGroup($card, []);\n }\n }", "private function playMachine()\n {\n do {\n echo \"Jugador Maquina pide carta.\\n\";\n\n $card = new Card($this->memory);\n $this->machine->receiveCard($card);\n $this->memory->add($card);\n $points = $this->machine->getPoints();\n\n echo \"\\tHa sacado \" . $card . '. LLeva ' . $points . ' punto' . $points > 1 ? 's' : '' . \"\\n\";\n\n } while ($this->machine->willContinue($this->memory) && !$this->machine->isOver());\n\n if (!$this->machine->isOver())\n echo \"Jugador Máquina se planta.\\n\";\n\n }", "function move($source, $destination);", "function transferCardFromTo($card, $owner_to, $location_to, $bottom_to=false, $score_keyword=false) {\n if ($location_to == 'deck') { // We always return card at the bottom of the deck\n $bottom_to = true;\n }\n \n $id = $card['id'];\n $age = $card['age'];\n $color = $card['color'];\n $owner_from = $card['owner'];\n $location_from = $card['location'];\n $position_from = $card['position'];\n $splay_direction_from = $card['splay_direction'];\n \n // Determine the splay direction of destination if any\n if ($location_to == 'board') {\n // The card must continue the current splay\n $splay_direction_to = self::getCurrentSplayDirection($owner_to, $color);\n }\n else { // $location_to != 'board'\n $splay_direction_to = 'NULL';\n }\n \n // Filters for cards of the same family: the cards of the decks are grouped by age, whereas the cards of the board are grouped by player and by color\n // Filter from\n $filter_from = self::format(\"owner = {owner_from} AND location = '{location_from}'\", array('owner_from' => $owner_from, 'location_from' => $location_from));\n switch ($location_from) {\n case 'deck':\n case 'hand':\n case 'score':\n $filter_from .= self::format(\" AND age = {age}\", array('age' => $age));\n break;\n case 'board':\n $filter_from .= self::format(\" AND color = {color}\", array('color' => $color));\n break;\n default:\n break;\n }\n \n // Filter to\n $filter_to = self::format(\"owner = {owner_to} AND location = '{location_to}'\", array('owner_to' => $owner_to, 'location_to' => $location_to));\n switch ($location_to) {\n case 'deck':\n case 'hand':\n case 'score':\n $filter_to .= self::format(\" AND age = {age}\", array('age' => $age));\n break;\n case 'board':\n $filter_to .= self::format(\" AND color = {color}\", array('color' => $color));\n break;\n default:\n break;\n }\n \n // Get the position of destination and update some other card positions if needed\n if ($bottom_to) { // The card must go to bottom of the location: update the position of the other cards accordingly\n // Execution of the query\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n position = position + 1\n WHERE\n {filter_to}\n \",\n array('filter_to' => $filter_to)\n ));\n $position_to = 0;\n }\n else { // $bottom_to is false\n // new_position = number of cards in the location\n $position_to = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(position)\n FROM\n card\n WHERE\n {filter_to}\n \",\n array('filter_to' => $filter_to)\n )); \n }\n\n // Execute the transfer\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n owner = {owner_to},\n location = '{location_to}',\n position = {position_to},\n selected = FALSE,\n splay_direction = {splay_direction_to}\n WHERE\n id = {id}\n \",\n array('owner_to' => $owner_to, 'location_to' => $location_to, 'position_to' => $position_to, 'id' => $id, 'splay_direction_to' => $splay_direction_to)\n ));\n \n // Update the position of the cards of the location the transferred card came from to fill the gap\n self::DbQuery(self::format(\"\n UPDATE\n card\n SET\n position = position - 1 \n WHERE\n {filter_from} AND\n position > {position_from}\n \",\n array('filter_from' => $filter_from, 'position_from' => $position_from)\n ));\n\n \n $transferInfo = array(\n 'owner_from' => $owner_from, 'location_from' => $location_from, 'position_from' => $position_from, 'splay_direction_from' => $splay_direction_from, \n 'owner_to' => $owner_to, 'location_to' => $location_to, 'position_to' => $position_to, 'splay_direction_to' => $splay_direction_to, \n 'bottom_to' => $bottom_to, 'score_keyword' => $score_keyword\n );\n \n // Update the current state of the card\n $card['owner'] = $owner_to;\n $card['location'] = $location_to;\n $card['position'] = $position_to; \n $card['splay_direction'] = $splay_direction_to;\n \n $current_state = $this->gamestate->state();\n if ($current_state['name'] != 'gameSetup') {\n try {\n self::updateGameSituation($card, $transferInfo);\n }\n catch (EndOfGame $e) {\n self::trace('EOG bubbled from self::transferCardFromTo');\n throw $e; // Re-throw exception to higher level\n }\n finally {\n // Determine if the loss of the card from its location of depart breaks a splay. If it's the case, change the splay_direction of the remaining card to unsplay (a notification being sent).\n if ($location_from == 'board' && $splay_direction_from > 0) {\n $number_of_cards_in_pile = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(*)\n FROM\n card\n WHERE\n owner={owner_from} AND\n location='board' AND\n color={color}\n \",\n array('owner_from'=>$owner_from, 'color'=>$color)\n ));\n \n if ($number_of_cards_in_pile <= 1) {\n self::splay($owner_from, $color, 0); // Unsplay\n }\n }\n }\n }\n return $card;\n }", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "protected function renameDeck()\n {\n $request = $this->request();\n $player = $this->getCurrentPlayer();\n $dbEntityDeck = $this->dbEntity()->deck();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $this->assertParamsExist(['new_deck_name']);\n $newName = $request['new_deck_name'];\n\n // validate new deck name\n if (trim($newName) == '') {\n throw new Exception('Cannot change deck name, invalid input', Exception::WARNING);\n }\n\n // list player's deck\n $result = $dbEntityDeck->listDecks($player->getUsername());\n if ($result->isError()) {\n throw new Exception('Failed to list decks');\n }\n $list = $result->data();\n\n // extract deck names\n $deckNames = array();\n foreach ($list as $deckData) {\n // omit current deck\n if ($deck->getDeckId() != $deckData['deck_id']) {\n $deckNames[] = $deckData['deck_name'];\n }\n }\n\n // check if the new deck name isn't already used\n $pos = array_search($newName, $deckNames);\n if ($pos !== false) {\n throw new Exception('Cannot change deck name, it is already used by another deck', Exception::WARNING);\n }\n\n // update deck name\n $deck\n ->setDeckName($newName)\n ->setModifiedAt(Date::timeToStr());\n if (!$deck->save()) {\n throw new Exception('Failed to rename deck');\n }\n\n $this->result()->setInfo('Deck saved');\n }", "public function chargeCard($amount)\n {\n if ($this->isValidCard)\n $this->balance += $this->parseAmount($amount);\n }", "function checkCollision($shot){\r\n\t\t\t$hitCell = $this->board[$shot->getX()][$shot->getY()];\r\n\t\t\r\n\t\t\t// if cell is empty, the player didn't hit a ship\r\n\t\t\tif($hitCell == self::EMPTYCELL){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//subtract one from the hit ship\r\n\t\t\t$this->ships[$hitCell]->reduceShipCounter();\r\n\t\t\r\n\t\t\t// if the counter is 0(ship has been destroyed), set sunk to true and check for winner\r\n\t\t\tif( $this->ships[$hitCell]->isShipSunk() ){\r\n\t\t\t\t$shot->setIsSunk(true);\r\n\t\t\t\t$this->checkWinner($shot);\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$shot->setIsHit(true);\r\n\t\t}", "public function tellInvalidCard()\n {\n }", "public function insertCard($data){\n unset($data['is_default']);\n\n /**\n Api/CardCredit/insertCardCredit: insert card data\n Kiosk/Api/verifyCreditCard: insert card data, without member_id, cvv2\n */\n\n if($data['card_code']) {\n $data['card_last4'] = substr($data['card_code'], -4);\n $data['card_md5'] = md5($data['card_code']);\n if($data['member_id']) {\n if(empty($this->getDefaultCard($data['member_id'], $scope='default', $forceGetDefault=true))) {\n //if no default card, this must be a default card\n $data['is_default'] = 1;\n }\n }\n\n $card = $this->getCardByCode($data['card_code']);\n if($card) {\n //when card is inserted in web api, member_id is essential\n //when card is inserted in kiosk api, member_id is empty\n if($data['member_id']) {\n //for Api/CardCredit/insertCardCredit: card has existed and bind memberId, fail insert\n if($card['member_id']) return false;\n\n //for Api/CardCredit/insertCardCredit: card has existed and bind memberId, no matter member_id match, bind the new member_id\n //for Api/CardCredit/insertCardCredit: card_code has existed and not bind memberId, bind memberId now\n $data['update_time'] = time();\n if($this->where('card_id=%d', $card['card_id'])->data($data)->save()) {\n return $card['card_id'];\n } else {\n return false;\n }\n } else {\n //for Kiosk/Api/verifyCreditCard: card has existed and bind memberId\n //for Kiosk/Api/verifyCreditCard: card_code has existed and not bind memberId\n return $card['card_id'];\n }\n } else {\n $data['create_time'] = time();\n if ($this->create($data)) {\n return $this->add();\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "public function __construct(Game $game, $post)\n {\n $this->game = $game;\n\n if (isset($post['playerTurn']))\n {\n $this->game->incrementTurn();\n\n }\n\n if (isset($post['clear']))\n {\n // We are starting a new game\n $this->game->newGame();\n }\n else if (isset($post['c'])) {\n // We are in cheat mode\n // Need to check if we actually need a cheat mode\n // Though, I forgot\n\n }\n\n // if player is drawing a card\n else if (isset($post['draw']))\n {\n //case Cards::TWO_CARD:\n //drawCardAgain\n //Check if user flipped the card over (maybe by using getter)\n //Move the card to the \"Discard here\" area, or check if it's in discard pile\n //Next person's turn (but do we need a getter for this?\n //Or is the getter for that getCurrentTurn() in game class?\n\n\n }\n //I think that before the player clicks on a node to move their pawn to\n //There is a lot of logic that has to be taken care of\n else if (isset($post['pawn']))\n {\n $xy_string = explode(',', $post['pawn']);\n\n\n $x = (int)$xy_string[0];\n $y = (int)$xy_string[1];\n print_r(\"HELLO?\");\n //print_r($game->getBoard()->GetBoardSquares()[13][2]->getBackwardNeighbors());\n //$distance = 5;\n $distance = $this->game->getCards()->getCurrentCardValue();\n\n // 4 card moves backwards 4 spaces\n if ($distance == 4) {\n $distance = $distance * -1;\n }\n\n $this->game->doTurn([$x, $y], $distance);\n //This is where we find out which pawn the player will\n //choose to move if they have >1 pawn on the board currently\n\n //Looks to me like you can only split your moves between 2 pawns\n //if you draw a 7 card\n\n //I have this for now, but this getter will likely be moved from\n //player class to either board or game class\n //$this->player->getActive();\n\n //More than 1 active pawn on board? Pick one to move first\n // User should select the pawn they want to move\n //Make setter for setting the piece that player will move\n }\n\n //Checking if user has clicked on a node to move their pawn to\n else if (isset($post['click']))\n {\n //find the current position of the pawn the player wants to move\n $this->pawn->getPosition();\n\n // card 4, card 10 can move backwards\n // Other \"backwards\" one are \"move the pawn back to start location\", which I think is different\n\n // get value of card drawn by player that will move\n $this->card->getValue();\n\n //if the card is a card_4 or card_10, call backwardsSearchReachable\n $this->node->backwardsSearchReachable();\n // if it's any other type of card, just search reachable\n $this->node->searchReachable();\n//click on the pawn\n //and move the pawn however many spaces the card tells it to\n //if you click on empty node, it does nothing\n //click on a pawn and it should move one space forward\n //it should happen regardless of whose turn it is\n\n\n }\n\n else if (isset($post['card'])) {\n $this->game->draw();\n }\n\n\n\n }" ]
[ "0.6519818", "0.61091423", "0.5984672", "0.57833767", "0.5728301", "0.5599167", "0.54989433", "0.54634786", "0.5450254", "0.53929865", "0.5355901", "0.53148043", "0.5250306", "0.5240293", "0.52157897", "0.52141124", "0.5213582", "0.51890284", "0.5179298", "0.51389885", "0.5083453", "0.50729156", "0.5067985", "0.50025785", "0.49746427", "0.49437603", "0.49433404", "0.49369305", "0.49311048", "0.49295047", "0.4923321", "0.49224767", "0.49130782", "0.490266", "0.4875278", "0.48736554", "0.48602945", "0.4841837", "0.4812889", "0.4810815", "0.48073816", "0.48024178", "0.47866902", "0.47843686", "0.4754755", "0.47544008", "0.4726057", "0.4717545", "0.4714432", "0.47100082", "0.47019243", "0.46865594", "0.46854705", "0.46774182", "0.46447942", "0.46440834", "0.46430787", "0.46403", "0.4631865", "0.46282893", "0.46231058", "0.46222767", "0.46218362", "0.4619582", "0.46143934", "0.46136573", "0.46055165", "0.45949155", "0.457777", "0.45763832", "0.45701715", "0.4556131", "0.45551318", "0.4550238", "0.4529805", "0.45275393", "0.4524784", "0.45188677", "0.4516666", "0.4487643", "0.44876015", "0.4485417", "0.44848403", "0.44826573", "0.44781306", "0.4476864", "0.44754863", "0.44720063", "0.44545338", "0.4440812", "0.4437064", "0.44303498", "0.44291496", "0.4426148", "0.4424258", "0.44200835", "0.44199452", "0.4416769", "0.44133607", "0.44101197" ]
0.64084035
1